var RQe = Object.defineProperty;
var AQe = (i, e, t) => e in i ? RQe(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
var mi = (i, e, t) => AQe(i, typeof e != "symbol" ? e + "" : e, t);
import { s as rMe } from "./index-NGRI5FCS.js";
function WA(i) {
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
}
var b7 = { exports: {} }, OM = {}, v7 = { exports: {} }, Tr = {}, WEe;
function OQe() {
  if (WEe) return Tr;
  WEe = 1;
  /**
   * @license React
   * react.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var i = Symbol.for("react.element"), e = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), o = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), c = Symbol.for("react.memo"), u = Symbol.for("react.lazy"), d = Symbol.iterator;
  function h(ae) {
    return ae === null || typeof ae != "object" ? null : (ae = d && ae[d] || ae["@@iterator"], typeof ae == "function" ? ae : null);
  }
  var g = { isMounted: function() {
    return !1;
  }, enqueueForceUpdate: function() {
  }, enqueueReplaceState: function() {
  }, enqueueSetState: function() {
  } }, m = Object.assign, _ = {};
  function v(ae, be, re) {
    this.props = ae, this.context = be, this.refs = _, this.updater = re || g;
  }
  v.prototype.isReactComponent = {}, v.prototype.setState = function(ae, be) {
    if (typeof ae != "object" && typeof ae != "function" && ae != null) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
    this.updater.enqueueSetState(this, ae, be, "setState");
  }, v.prototype.forceUpdate = function(ae) {
    this.updater.enqueueForceUpdate(this, ae, "forceUpdate");
  };
  function w() {
  }
  w.prototype = v.prototype;
  function E(ae, be, re) {
    this.props = ae, this.context = be, this.refs = _, this.updater = re || g;
  }
  var L = E.prototype = new w();
  L.constructor = E, m(L, v.prototype), L.isPureReactComponent = !0;
  var T = Array.isArray, D = Object.prototype.hasOwnProperty, N = { current: null }, R = { key: !0, ref: !0, __self: !0, __source: !0 };
  function M(ae, be, re) {
    var ze, Ve = {}, st = null, ot = null;
    if (be != null) for (ze in be.ref !== void 0 && (ot = be.ref), be.key !== void 0 && (st = "" + be.key), be) D.call(be, ze) && !R.hasOwnProperty(ze) && (Ve[ze] = be[ze]);
    var et = arguments.length - 2;
    if (et === 1) Ve.children = re;
    else if (1 < et) {
      for (var at = Array(et), en = 0; en < et; en++) at[en] = arguments[en + 2];
      Ve.children = at;
    }
    if (ae && ae.defaultProps) for (ze in et = ae.defaultProps, et) Ve[ze] === void 0 && (Ve[ze] = et[ze]);
    return { $$typeof: i, type: ae, key: st, ref: ot, props: Ve, _owner: N.current };
  }
  function B(ae, be) {
    return { $$typeof: i, type: ae.type, key: be, ref: ae.ref, props: ae.props, _owner: ae._owner };
  }
  function H(ae) {
    return typeof ae == "object" && ae !== null && ae.$$typeof === i;
  }
  function j(ae) {
    var be = { "=": "=0", ":": "=2" };
    return "$" + ae.replace(/[=:]/g, function(re) {
      return be[re];
    });
  }
  var K = /\/+/g;
  function X(ae, be) {
    return typeof ae == "object" && ae !== null && ae.key != null ? j("" + ae.key) : be.toString(36);
  }
  function Y(ae, be, re, ze, Ve) {
    var st = typeof ae;
    (st === "undefined" || st === "boolean") && (ae = null);
    var ot = !1;
    if (ae === null) ot = !0;
    else switch (st) {
      case "string":
      case "number":
        ot = !0;
        break;
      case "object":
        switch (ae.$$typeof) {
          case i:
          case e:
            ot = !0;
        }
    }
    if (ot) return ot = ae, Ve = Ve(ot), ae = ze === "" ? "." + X(ot, 0) : ze, T(Ve) ? (re = "", ae != null && (re = ae.replace(K, "$&/") + "/"), Y(Ve, be, re, "", function(en) {
      return en;
    })) : Ve != null && (H(Ve) && (Ve = B(Ve, re + (!Ve.key || ot && ot.key === Ve.key ? "" : ("" + Ve.key).replace(K, "$&/") + "/") + ae)), be.push(Ve)), 1;
    if (ot = 0, ze = ze === "" ? "." : ze + ":", T(ae)) for (var et = 0; et < ae.length; et++) {
      st = ae[et];
      var at = ze + X(st, et);
      ot += Y(st, be, re, at, Ve);
    }
    else if (at = h(ae), typeof at == "function") for (ae = at.call(ae), et = 0; !(st = ae.next()).done; ) st = st.value, at = ze + X(st, et++), ot += Y(st, be, re, at, Ve);
    else if (st === "object") throw be = String(ae), Error("Objects are not valid as a React child (found: " + (be === "[object Object]" ? "object with keys {" + Object.keys(ae).join(", ") + "}" : be) + "). If you meant to render a collection of children, use an array instead.");
    return ot;
  }
  function G(ae, be, re) {
    if (ae == null) return ae;
    var ze = [], Ve = 0;
    return Y(ae, ze, "", "", function(st) {
      return be.call(re, st, Ve++);
    }), ze;
  }
  function Q(ae) {
    if (ae._status === -1) {
      var be = ae._result;
      be = be(), be.then(function(re) {
        (ae._status === 0 || ae._status === -1) && (ae._status = 1, ae._result = re);
      }, function(re) {
        (ae._status === 0 || ae._status === -1) && (ae._status = 2, ae._result = re);
      }), ae._status === -1 && (ae._status = 0, ae._result = be);
    }
    if (ae._status === 1) return ae._result.default;
    throw ae._result;
  }
  var oe = { current: null }, Z = { transition: null }, pe = { ReactCurrentDispatcher: oe, ReactCurrentBatchConfig: Z, ReactCurrentOwner: N };
  function J() {
    throw Error("act(...) is not supported in production builds of React.");
  }
  return Tr.Children = { map: G, forEach: function(ae, be, re) {
    G(ae, function() {
      be.apply(this, arguments);
    }, re);
  }, count: function(ae) {
    var be = 0;
    return G(ae, function() {
      be++;
    }), be;
  }, toArray: function(ae) {
    return G(ae, function(be) {
      return be;
    }) || [];
  }, only: function(ae) {
    if (!H(ae)) throw Error("React.Children.only expected to receive a single React element child.");
    return ae;
  } }, Tr.Component = v, Tr.Fragment = t, Tr.Profiler = r, Tr.PureComponent = E, Tr.StrictMode = n, Tr.Suspense = l, Tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = pe, Tr.act = J, Tr.cloneElement = function(ae, be, re) {
    if (ae == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + ae + ".");
    var ze = m({}, ae.props), Ve = ae.key, st = ae.ref, ot = ae._owner;
    if (be != null) {
      if (be.ref !== void 0 && (st = be.ref, ot = N.current), be.key !== void 0 && (Ve = "" + be.key), ae.type && ae.type.defaultProps) var et = ae.type.defaultProps;
      for (at in be) D.call(be, at) && !R.hasOwnProperty(at) && (ze[at] = be[at] === void 0 && et !== void 0 ? et[at] : be[at]);
    }
    var at = arguments.length - 2;
    if (at === 1) ze.children = re;
    else if (1 < at) {
      et = Array(at);
      for (var en = 0; en < at; en++) et[en] = arguments[en + 2];
      ze.children = et;
    }
    return { $$typeof: i, type: ae.type, key: Ve, ref: st, props: ze, _owner: ot };
  }, Tr.createContext = function(ae) {
    return ae = { $$typeof: o, _currentValue: ae, _currentValue2: ae, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, ae.Provider = { $$typeof: s, _context: ae }, ae.Consumer = ae;
  }, Tr.createElement = M, Tr.createFactory = function(ae) {
    var be = M.bind(null, ae);
    return be.type = ae, be;
  }, Tr.createRef = function() {
    return { current: null };
  }, Tr.forwardRef = function(ae) {
    return { $$typeof: a, render: ae };
  }, Tr.isValidElement = H, Tr.lazy = function(ae) {
    return { $$typeof: u, _payload: { _status: -1, _result: ae }, _init: Q };
  }, Tr.memo = function(ae, be) {
    return { $$typeof: c, type: ae, compare: be === void 0 ? null : be };
  }, Tr.startTransition = function(ae) {
    var be = Z.transition;
    Z.transition = {};
    try {
      ae();
    } finally {
      Z.transition = be;
    }
  }, Tr.unstable_act = J, Tr.useCallback = function(ae, be) {
    return oe.current.useCallback(ae, be);
  }, Tr.useContext = function(ae) {
    return oe.current.useContext(ae);
  }, Tr.useDebugValue = function() {
  }, Tr.useDeferredValue = function(ae) {
    return oe.current.useDeferredValue(ae);
  }, Tr.useEffect = function(ae, be) {
    return oe.current.useEffect(ae, be);
  }, Tr.useId = function() {
    return oe.current.useId();
  }, Tr.useImperativeHandle = function(ae, be, re) {
    return oe.current.useImperativeHandle(ae, be, re);
  }, Tr.useInsertionEffect = function(ae, be) {
    return oe.current.useInsertionEffect(ae, be);
  }, Tr.useLayoutEffect = function(ae, be) {
    return oe.current.useLayoutEffect(ae, be);
  }, Tr.useMemo = function(ae, be) {
    return oe.current.useMemo(ae, be);
  }, Tr.useReducer = function(ae, be, re) {
    return oe.current.useReducer(ae, be, re);
  }, Tr.useRef = function(ae) {
    return oe.current.useRef(ae);
  }, Tr.useState = function(ae) {
    return oe.current.useState(ae);
  }, Tr.useSyncExternalStore = function(ae, be, re) {
    return oe.current.useSyncExternalStore(ae, be, re);
  }, Tr.useTransition = function() {
    return oe.current.useTransition();
  }, Tr.version = "18.3.1", Tr;
}
var HP = { exports: {} };
HP.exports;
var VEe;
function MQe() {
  return VEe || (VEe = 1, (function(i, e) {
    var t = {};
    /**
     * @license React
     * react.development.js
     *
     * Copyright (c) Facebook, Inc. and its affiliates.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
     */
    t.NODE_ENV !== "production" && (function() {
      typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
      var n = "18.3.1", r = Symbol.for("react.element"), s = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), u = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), v = Symbol.for("react.offscreen"), w = Symbol.iterator, E = "@@iterator";
      function L(ne) {
        if (ne === null || typeof ne != "object")
          return null;
        var Le = w && ne[w] || ne[E];
        return typeof Le == "function" ? Le : null;
      }
      var T = {
        /**
         * @internal
         * @type {ReactComponent}
         */
        current: null
      }, D = {
        transition: null
      }, N = {
        current: null,
        // Used to reproduce behavior of `batchedUpdates` in legacy mode.
        isBatchingLegacy: !1,
        didScheduleLegacyUpdate: !1
      }, R = {
        /**
         * @internal
         * @type {ReactComponent}
         */
        current: null
      }, M = {}, B = null;
      function H(ne) {
        B = ne;
      }
      M.setExtraStackFrame = function(ne) {
        B = ne;
      }, M.getCurrentStack = null, M.getStackAddendum = function() {
        var ne = "";
        B && (ne += B);
        var Le = M.getCurrentStack;
        return Le && (ne += Le() || ""), ne;
      };
      var j = !1, K = !1, X = !1, Y = !1, G = !1, Q = {
        ReactCurrentDispatcher: T,
        ReactCurrentBatchConfig: D,
        ReactCurrentOwner: R
      };
      Q.ReactDebugCurrentFrame = M, Q.ReactCurrentActQueue = N;
      function oe(ne) {
        {
          for (var Le = arguments.length, tt = new Array(Le > 1 ? Le - 1 : 0), dt = 1; dt < Le; dt++)
            tt[dt - 1] = arguments[dt];
          pe("warn", ne, tt);
        }
      }
      function Z(ne) {
        {
          for (var Le = arguments.length, tt = new Array(Le > 1 ? Le - 1 : 0), dt = 1; dt < Le; dt++)
            tt[dt - 1] = arguments[dt];
          pe("error", ne, tt);
        }
      }
      function pe(ne, Le, tt) {
        {
          var dt = Q.ReactDebugCurrentFrame, Gt = dt.getStackAddendum();
          Gt !== "" && (Le += "%s", tt = tt.concat([Gt]));
          var In = tt.map(function(vn) {
            return String(vn);
          });
          In.unshift("Warning: " + Le), Function.prototype.apply.call(console[ne], console, In);
        }
      }
      var J = {};
      function ae(ne, Le) {
        {
          var tt = ne.constructor, dt = tt && (tt.displayName || tt.name) || "ReactClass", Gt = dt + "." + Le;
          if (J[Gt])
            return;
          Z("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", Le, dt), J[Gt] = !0;
        }
      }
      var be = {
        /**
         * Checks whether or not this composite component is mounted.
         * @param {ReactClass} publicInstance The instance we want to test.
         * @return {boolean} True if mounted, false otherwise.
         * @protected
         * @final
         */
        isMounted: function(ne) {
          return !1;
        },
        /**
         * Forces an update. This should only be invoked when it is known with
         * certainty that we are **not** in a DOM transaction.
         *
         * You may want to call this when you know that some deeper aspect of the
         * component's state has changed but `setState` was not called.
         *
         * This will not invoke `shouldComponentUpdate`, but it will invoke
         * `componentWillUpdate` and `componentDidUpdate`.
         *
         * @param {ReactClass} publicInstance The instance that should rerender.
         * @param {?function} callback Called after component is updated.
         * @param {?string} callerName name of the calling function in the public API.
         * @internal
         */
        enqueueForceUpdate: function(ne, Le, tt) {
          ae(ne, "forceUpdate");
        },
        /**
         * Replaces all of the state. Always use this or `setState` to mutate state.
         * You should treat `this.state` as immutable.
         *
         * There is no guarantee that `this.state` will be immediately updated, so
         * accessing `this.state` after calling this method may return the old value.
         *
         * @param {ReactClass} publicInstance The instance that should rerender.
         * @param {object} completeState Next state.
         * @param {?function} callback Called after component is updated.
         * @param {?string} callerName name of the calling function in the public API.
         * @internal
         */
        enqueueReplaceState: function(ne, Le, tt, dt) {
          ae(ne, "replaceState");
        },
        /**
         * Sets a subset of the state. This only exists because _pendingState is
         * internal. This provides a merging strategy that is not available to deep
         * properties which is confusing. TODO: Expose pendingState or don't use it
         * during the merge.
         *
         * @param {ReactClass} publicInstance The instance that should rerender.
         * @param {object} partialState Next partial state to be merged with state.
         * @param {?function} callback Called after component is updated.
         * @param {?string} Name of the calling function in the public API.
         * @internal
         */
        enqueueSetState: function(ne, Le, tt, dt) {
          ae(ne, "setState");
        }
      }, re = Object.assign, ze = {};
      Object.freeze(ze);
      function Ve(ne, Le, tt) {
        this.props = ne, this.context = Le, this.refs = ze, this.updater = tt || be;
      }
      Ve.prototype.isReactComponent = {}, Ve.prototype.setState = function(ne, Le) {
        if (typeof ne != "object" && typeof ne != "function" && ne != null)
          throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
        this.updater.enqueueSetState(this, ne, Le, "setState");
      }, Ve.prototype.forceUpdate = function(ne) {
        this.updater.enqueueForceUpdate(this, ne, "forceUpdate");
      };
      {
        var st = {
          isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
          replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
        }, ot = function(ne, Le) {
          Object.defineProperty(Ve.prototype, ne, {
            get: function() {
              oe("%s(...) is deprecated in plain JavaScript React classes. %s", Le[0], Le[1]);
            }
          });
        };
        for (var et in st)
          st.hasOwnProperty(et) && ot(et, st[et]);
      }
      function at() {
      }
      at.prototype = Ve.prototype;
      function en(ne, Le, tt) {
        this.props = ne, this.context = Le, this.refs = ze, this.updater = tt || be;
      }
      var sn = en.prototype = new at();
      sn.constructor = en, re(sn, Ve.prototype), sn.isPureReactComponent = !0;
      function Vt() {
        var ne = {
          current: null
        };
        return Object.seal(ne), ne;
      }
      var Bi = Array.isArray;
      function pi(ne) {
        return Bi(ne);
      }
      function tn(ne) {
        {
          var Le = typeof Symbol == "function" && Symbol.toStringTag, tt = Le && ne[Symbol.toStringTag] || ne.constructor.name || "Object";
          return tt;
        }
      }
      function Vr(ne) {
        try {
          return tr(ne), !1;
        } catch {
          return !0;
        }
      }
      function tr(ne) {
        return "" + ne;
      }
      function qr(ne) {
        if (Vr(ne))
          return Z("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tn(ne)), tr(ne);
      }
      function Bs(ne, Le, tt) {
        var dt = ne.displayName;
        if (dt)
          return dt;
        var Gt = Le.displayName || Le.name || "";
        return Gt !== "" ? tt + "(" + Gt + ")" : tt;
      }
      function Ts(ne) {
        return ne.displayName || "Context";
      }
      function ts(ne) {
        if (ne == null)
          return null;
        if (typeof ne.tag == "number" && Z("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof ne == "function")
          return ne.displayName || ne.name || null;
        if (typeof ne == "string")
          return ne;
        switch (ne) {
          case o:
            return "Fragment";
          case s:
            return "Portal";
          case l:
            return "Profiler";
          case a:
            return "StrictMode";
          case h:
            return "Suspense";
          case g:
            return "SuspenseList";
        }
        if (typeof ne == "object")
          switch (ne.$$typeof) {
            case u:
              var Le = ne;
              return Ts(Le) + ".Consumer";
            case c:
              var tt = ne;
              return Ts(tt._context) + ".Provider";
            case d:
              return Bs(ne, ne.render, "ForwardRef");
            case m:
              var dt = ne.displayName || null;
              return dt !== null ? dt : ts(ne.type) || "Memo";
            case _: {
              var Gt = ne, In = Gt._payload, vn = Gt._init;
              try {
                return ts(vn(In));
              } catch {
                return null;
              }
            }
          }
        return null;
      }
      var io = Object.prototype.hasOwnProperty, nr = {
        key: !0,
        ref: !0,
        __self: !0,
        __source: !0
      }, _s, Hs, He;
      He = {};
      function yt(ne) {
        if (io.call(ne, "ref")) {
          var Le = Object.getOwnPropertyDescriptor(ne, "ref").get;
          if (Le && Le.isReactWarning)
            return !1;
        }
        return ne.ref !== void 0;
      }
      function Ln(ne) {
        if (io.call(ne, "key")) {
          var Le = Object.getOwnPropertyDescriptor(ne, "key").get;
          if (Le && Le.isReactWarning)
            return !1;
        }
        return ne.key !== void 0;
      }
      function oi(ne, Le) {
        var tt = function() {
          _s || (_s = !0, Z("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Le));
        };
        tt.isReactWarning = !0, Object.defineProperty(ne, "key", {
          get: tt,
          configurable: !0
        });
      }
      function vi(ne, Le) {
        var tt = function() {
          Hs || (Hs = !0, Z("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", Le));
        };
        tt.isReactWarning = !0, Object.defineProperty(ne, "ref", {
          get: tt,
          configurable: !0
        });
      }
      function Dt(ne) {
        if (typeof ne.ref == "string" && R.current && ne.__self && R.current.stateNode !== ne.__self) {
          var Le = ts(R.current.type);
          He[Le] || (Z('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', Le, ne.ref), He[Le] = !0);
        }
      }
      var cn = function(ne, Le, tt, dt, Gt, In, vn) {
        var Ei = {
          // This tag allows us to uniquely identify this as a React Element
          $$typeof: r,
          // Built-in properties that belong on the element
          type: ne,
          key: Le,
          ref: tt,
          props: vn,
          // Record the component responsible for creating this element.
          _owner: In
        };
        return Ei._store = {}, Object.defineProperty(Ei._store, "validated", {
          configurable: !1,
          enumerable: !1,
          writable: !0,
          value: !1
        }), Object.defineProperty(Ei, "_self", {
          configurable: !1,
          enumerable: !1,
          writable: !1,
          value: dt
        }), Object.defineProperty(Ei, "_source", {
          configurable: !1,
          enumerable: !1,
          writable: !1,
          value: Gt
        }), Object.freeze && (Object.freeze(Ei.props), Object.freeze(Ei)), Ei;
      };
      function En(ne, Le, tt) {
        var dt, Gt = {}, In = null, vn = null, Ei = null, sr = null;
        if (Le != null) {
          yt(Le) && (vn = Le.ref, Dt(Le)), Ln(Le) && (qr(Le.key), In = "" + Le.key), Ei = Le.__self === void 0 ? null : Le.__self, sr = Le.__source === void 0 ? null : Le.__source;
          for (dt in Le)
            io.call(Le, dt) && !nr.hasOwnProperty(dt) && (Gt[dt] = Le[dt]);
        }
        var ys = arguments.length - 2;
        if (ys === 1)
          Gt.children = tt;
        else if (ys > 1) {
          for (var Us = Array(ys), zs = 0; zs < ys; zs++)
            Us[zs] = arguments[zs + 2];
          Object.freeze && Object.freeze(Us), Gt.children = Us;
        }
        if (ne && ne.defaultProps) {
          var Yi = ne.defaultProps;
          for (dt in Yi)
            Gt[dt] === void 0 && (Gt[dt] = Yi[dt]);
        }
        if (In || vn) {
          var so = typeof ne == "function" ? ne.displayName || ne.name || "Unknown" : ne;
          In && oi(Gt, so), vn && vi(Gt, so);
        }
        return cn(ne, In, vn, Ei, sr, R.current, Gt);
      }
      function ii(ne, Le) {
        var tt = cn(ne.type, Le, ne.ref, ne._self, ne._source, ne._owner, ne.props);
        return tt;
      }
      function li(ne, Le, tt) {
        if (ne == null)
          throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + ne + ".");
        var dt, Gt = re({}, ne.props), In = ne.key, vn = ne.ref, Ei = ne._self, sr = ne._source, ys = ne._owner;
        if (Le != null) {
          yt(Le) && (vn = Le.ref, ys = R.current), Ln(Le) && (qr(Le.key), In = "" + Le.key);
          var Us;
          ne.type && ne.type.defaultProps && (Us = ne.type.defaultProps);
          for (dt in Le)
            io.call(Le, dt) && !nr.hasOwnProperty(dt) && (Le[dt] === void 0 && Us !== void 0 ? Gt[dt] = Us[dt] : Gt[dt] = Le[dt]);
        }
        var zs = arguments.length - 2;
        if (zs === 1)
          Gt.children = tt;
        else if (zs > 1) {
          for (var Yi = Array(zs), so = 0; so < zs; so++)
            Yi[so] = arguments[so + 2];
          Gt.children = Yi;
        }
        return cn(ne.type, In, vn, Ei, sr, ys, Gt);
      }
      function lt(ne) {
        return typeof ne == "object" && ne !== null && ne.$$typeof === r;
      }
      var Bt = ".", Mn = ":";
      function gn(ne) {
        var Le = /[=:]/g, tt = {
          "=": "=0",
          ":": "=2"
        }, dt = ne.replace(Le, function(Gt) {
          return tt[Gt];
        });
        return "$" + dt;
      }
      var yi = !1, Ni = /\/+/g;
      function qi(ne) {
        return ne.replace(Ni, "$&/");
      }
      function Ur(ne, Le) {
        return typeof ne == "object" && ne !== null && ne.key != null ? (qr(ne.key), gn("" + ne.key)) : Le.toString(36);
      }
      function Ws(ne, Le, tt, dt, Gt) {
        var In = typeof ne;
        (In === "undefined" || In === "boolean") && (ne = null);
        var vn = !1;
        if (ne === null)
          vn = !0;
        else
          switch (In) {
            case "string":
            case "number":
              vn = !0;
              break;
            case "object":
              switch (ne.$$typeof) {
                case r:
                case s:
                  vn = !0;
              }
          }
        if (vn) {
          var Ei = ne, sr = Gt(Ei), ys = dt === "" ? Bt + Ur(Ei, 0) : dt;
          if (pi(sr)) {
            var Us = "";
            ys != null && (Us = qi(ys) + "/"), Ws(sr, Le, Us, "", function(M2) {
              return M2;
            });
          } else sr != null && (lt(sr) && (sr.key && (!Ei || Ei.key !== sr.key) && qr(sr.key), sr = ii(
            sr,
            // Keep both the (mapped) and old keys if they differ, just as
            // traverseAllChildren used to do for objects as children
            tt + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
            (sr.key && (!Ei || Ei.key !== sr.key) ? (
              // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
              // eslint-disable-next-line react-internal/safe-string-coercion
              qi("" + sr.key) + "/"
            ) : "") + ys
          )), Le.push(sr));
          return 1;
        }
        var zs, Yi, so = 0, ia = dt === "" ? Bt : dt + Mn;
        if (pi(ne))
          for (var $b = 0; $b < ne.length; $b++)
            zs = ne[$b], Yi = ia + Ur(zs, $b), so += Ws(zs, Le, tt, Yi, Gt);
        else {
          var $w = L(ne);
          if (typeof $w == "function") {
            var sp = ne;
            $w === sp.entries && (yi || oe("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), yi = !0);
            for (var jb = $w.call(sp), jw, O2 = 0; !(jw = jb.next()).done; )
              zs = jw.value, Yi = ia + Ur(zs, O2++), so += Ws(zs, Le, tt, Yi, Gt);
          } else if (In === "object") {
            var Ek = String(ne);
            throw new Error("Objects are not valid as a React child (found: " + (Ek === "[object Object]" ? "object with keys {" + Object.keys(ne).join(", ") + "}" : Ek) + "). If you meant to render a collection of children, use an array instead.");
          }
        }
        return so;
      }
      function El(ne, Le, tt) {
        if (ne == null)
          return ne;
        var dt = [], Gt = 0;
        return Ws(ne, dt, "", "", function(In) {
          return Le.call(tt, In, Gt++);
        }), dt;
      }
      function Ri(ne) {
        var Le = 0;
        return El(ne, function() {
          Le++;
        }), Le;
      }
      function So(ne, Le, tt) {
        El(ne, function() {
          Le.apply(this, arguments);
        }, tt);
      }
      function va(ne) {
        return El(ne, function(Le) {
          return Le;
        }) || [];
      }
      function xl(ne) {
        if (!lt(ne))
          throw new Error("React.Children.only expected to receive a single React element child.");
        return ne;
      }
      function ya(ne) {
        var Le = {
          $$typeof: u,
          // As a workaround to support multiple concurrent renderers, we categorize
          // some renderers as primary and others as secondary. We only expect
          // there to be two concurrent renderers at most: React Native (primary) and
          // Fabric (secondary); React DOM (primary) and React ART (secondary).
          // Secondary renderers store their context values on separate fields.
          _currentValue: ne,
          _currentValue2: ne,
          // Used to track how many concurrent renderers this context currently
          // supports within in a single renderer. Such as parallel server rendering.
          _threadCount: 0,
          // These are circular
          Provider: null,
          Consumer: null,
          // Add these to use same hidden class in VM as ServerContext
          _defaultValue: null,
          _globalName: null
        };
        Le.Provider = {
          $$typeof: c,
          _context: Le
        };
        var tt = !1, dt = !1, Gt = !1;
        {
          var In = {
            $$typeof: u,
            _context: Le
          };
          Object.defineProperties(In, {
            Provider: {
              get: function() {
                return dt || (dt = !0, Z("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")), Le.Provider;
              },
              set: function(vn) {
                Le.Provider = vn;
              }
            },
            _currentValue: {
              get: function() {
                return Le._currentValue;
              },
              set: function(vn) {
                Le._currentValue = vn;
              }
            },
            _currentValue2: {
              get: function() {
                return Le._currentValue2;
              },
              set: function(vn) {
                Le._currentValue2 = vn;
              }
            },
            _threadCount: {
              get: function() {
                return Le._threadCount;
              },
              set: function(vn) {
                Le._threadCount = vn;
              }
            },
            Consumer: {
              get: function() {
                return tt || (tt = !0, Z("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")), Le.Consumer;
              }
            },
            displayName: {
              get: function() {
                return Le.displayName;
              },
              set: function(vn) {
                Gt || (oe("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", vn), Gt = !0);
              }
            }
          }), Le.Consumer = In;
        }
        return Le._currentRenderer = null, Le._currentRenderer2 = null, Le;
      }
      var ro = -1, Eo = 0, po = 1, bs = 2;
      function na(ne) {
        if (ne._status === ro) {
          var Le = ne._result, tt = Le();
          if (tt.then(function(In) {
            if (ne._status === Eo || ne._status === ro) {
              var vn = ne;
              vn._status = po, vn._result = In;
            }
          }, function(In) {
            if (ne._status === Eo || ne._status === ro) {
              var vn = ne;
              vn._status = bs, vn._result = In;
            }
          }), ne._status === ro) {
            var dt = ne;
            dt._status = Eo, dt._result = tt;
          }
        }
        if (ne._status === po) {
          var Gt = ne._result;
          return Gt === void 0 && Z(`lazy: Expected the result of a dynamic import() call. Instead received: %s

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

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

Your code should look like: 
  const MyComponent = lazy(() => import('./MyComponent'))`, Gt), Gt.default;
        } else
          throw ne._result;
      }
      function sc(ne) {
        var Le = {
          // We use these fields to store the result.
          _status: ro,
          _result: ne
        }, tt = {
          $$typeof: _,
          _payload: Le,
          _init: na
        };
        {
          var dt, Gt;
          Object.defineProperties(tt, {
            defaultProps: {
              configurable: !0,
              get: function() {
                return dt;
              },
              set: function(In) {
                Z("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), dt = In, Object.defineProperty(tt, "defaultProps", {
                  enumerable: !0
                });
              }
            },
            propTypes: {
              configurable: !0,
              get: function() {
                return Gt;
              },
              set: function(In) {
                Z("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), Gt = In, Object.defineProperty(tt, "propTypes", {
                  enumerable: !0
                });
              }
            }
          });
        }
        return tt;
      }
      function Rc(ne) {
        ne != null && ne.$$typeof === m ? Z("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : typeof ne != "function" ? Z("forwardRef requires a render function but was given %s.", ne === null ? "null" : typeof ne) : ne.length !== 0 && ne.length !== 2 && Z("forwardRef render functions accept exactly two parameters: props and ref. %s", ne.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."), ne != null && (ne.defaultProps != null || ne.propTypes != null) && Z("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
        var Le = {
          $$typeof: d,
          render: ne
        };
        {
          var tt;
          Object.defineProperty(Le, "displayName", {
            enumerable: !1,
            configurable: !0,
            get: function() {
              return tt;
            },
            set: function(dt) {
              tt = dt, !ne.name && !ne.displayName && (ne.displayName = dt);
            }
          });
        }
        return Le;
      }
      var xe;
      xe = Symbol.for("react.module.reference");
      function mt(ne) {
        return !!(typeof ne == "string" || typeof ne == "function" || ne === o || ne === l || G || ne === a || ne === h || ne === g || Y || ne === v || j || K || X || typeof ne == "object" && ne !== null && (ne.$$typeof === _ || ne.$$typeof === m || ne.$$typeof === c || ne.$$typeof === u || ne.$$typeof === d || // This needs to include all possible module reference object
        // types supported by any Flight configuration anywhere since
        // we don't know which Flight build this will end up being used
        // with.
        ne.$$typeof === xe || ne.getModuleId !== void 0));
      }
      function jt(ne, Le) {
        mt(ne) || Z("memo: The first argument must be a component. Instead received: %s", ne === null ? "null" : typeof ne);
        var tt = {
          $$typeof: m,
          type: ne,
          compare: Le === void 0 ? null : Le
        };
        {
          var dt;
          Object.defineProperty(tt, "displayName", {
            enumerable: !1,
            configurable: !0,
            get: function() {
              return dt;
            },
            set: function(Gt) {
              dt = Gt, !ne.name && !ne.displayName && (ne.displayName = Gt);
            }
          });
        }
        return tt;
      }
      function nn() {
        var ne = T.current;
        return ne === null && Z(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`), ne;
      }
      function Wi(ne) {
        var Le = nn();
        if (ne._context !== void 0) {
          var tt = ne._context;
          tt.Consumer === ne ? Z("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?") : tt.Provider === ne && Z("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
        }
        return Le.useContext(ne);
      }
      function fi(ne) {
        var Le = nn();
        return Le.useState(ne);
      }
      function Ki(ne, Le, tt) {
        var dt = nn();
        return dt.useReducer(ne, Le, tt);
      }
      function Nt(ne) {
        var Le = nn();
        return Le.useRef(ne);
      }
      function ve(ne, Le) {
        var tt = nn();
        return tt.useEffect(ne, Le);
      }
      function fe(ne, Le) {
        var tt = nn();
        return tt.useInsertionEffect(ne, Le);
      }
      function Be(ne, Le) {
        var tt = nn();
        return tt.useLayoutEffect(ne, Le);
      }
      function Lt(ne, Le) {
        var tt = nn();
        return tt.useCallback(ne, Le);
      }
      function ci(ne, Le) {
        var tt = nn();
        return tt.useMemo(ne, Le);
      }
      function kn(ne, Le, tt) {
        var dt = nn();
        return dt.useImperativeHandle(ne, Le, tt);
      }
      function qn(ne, Le) {
        {
          var tt = nn();
          return tt.useDebugValue(ne, Le);
        }
      }
      function bn() {
        var ne = nn();
        return ne.useTransition();
      }
      function mo(ne) {
        var Le = nn();
        return Le.useDeferredValue(ne);
      }
      function ns() {
        var ne = nn();
        return ne.useId();
      }
      function tf(ne, Le, tt) {
        var dt = nn();
        return dt.useSyncExternalStore(ne, Le, tt);
      }
      var vs = 0, nf, Ll, Bw, Ac, Hw, Ck, wk;
      function tp() {
      }
      tp.__reactDisabledLog = !0;
      function Tm() {
        {
          if (vs === 0) {
            nf = console.log, Ll = console.info, Bw = console.warn, Ac = console.error, Hw = console.group, Ck = console.groupCollapsed, wk = console.groupEnd;
            var ne = {
              configurable: !0,
              enumerable: !0,
              value: tp,
              writable: !0
            };
            Object.defineProperties(console, {
              info: ne,
              log: ne,
              warn: ne,
              error: ne,
              group: ne,
              groupCollapsed: ne,
              groupEnd: ne
            });
          }
          vs++;
        }
      }
      function vu() {
        {
          if (vs--, vs === 0) {
            var ne = {
              configurable: !0,
              enumerable: !0,
              writable: !0
            };
            Object.defineProperties(console, {
              log: re({}, ne, {
                value: nf
              }),
              info: re({}, ne, {
                value: Ll
              }),
              warn: re({}, ne, {
                value: Bw
              }),
              error: re({}, ne, {
                value: Ac
              }),
              group: re({}, ne, {
                value: Hw
              }),
              groupCollapsed: re({}, ne, {
                value: Ck
              }),
              groupEnd: re({}, ne, {
                value: wk
              })
            });
          }
          vs < 0 && Z("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
        }
      }
      var sg = Q.ReactCurrentDispatcher, km;
      function y0(ne, Le, tt) {
        {
          if (km === void 0)
            try {
              throw Error();
            } catch (Gt) {
              var dt = Gt.stack.trim().match(/\n( *(at )?)/);
              km = dt && dt[1] || "";
            }
          return `
` + km + ne;
        }
      }
      var np = !1, Hb;
      {
        var Wb = typeof WeakMap == "function" ? WeakMap : Map;
        Hb = new Wb();
      }
      function Dm(ne, Le) {
        if (!ne || np)
          return "";
        {
          var tt = Hb.get(ne);
          if (tt !== void 0)
            return tt;
        }
        var dt;
        np = !0;
        var Gt = Error.prepareStackTrace;
        Error.prepareStackTrace = void 0;
        var In;
        In = sg.current, sg.current = null, Tm();
        try {
          if (Le) {
            var vn = function() {
              throw Error();
            };
            if (Object.defineProperty(vn.prototype, "props", {
              set: function() {
                throw Error();
              }
            }), typeof Reflect == "object" && Reflect.construct) {
              try {
                Reflect.construct(vn, []);
              } catch (ia) {
                dt = ia;
              }
              Reflect.construct(ne, [], vn);
            } else {
              try {
                vn.call();
              } catch (ia) {
                dt = ia;
              }
              ne.call(vn.prototype);
            }
          } else {
            try {
              throw Error();
            } catch (ia) {
              dt = ia;
            }
            ne();
          }
        } catch (ia) {
          if (ia && dt && typeof ia.stack == "string") {
            for (var Ei = ia.stack.split(`
`), sr = dt.stack.split(`
`), ys = Ei.length - 1, Us = sr.length - 1; ys >= 1 && Us >= 0 && Ei[ys] !== sr[Us]; )
              Us--;
            for (; ys >= 1 && Us >= 0; ys--, Us--)
              if (Ei[ys] !== sr[Us]) {
                if (ys !== 1 || Us !== 1)
                  do
                    if (ys--, Us--, Us < 0 || Ei[ys] !== sr[Us]) {
                      var zs = `
` + Ei[ys].replace(" at new ", " at ");
                      return ne.displayName && zs.includes("<anonymous>") && (zs = zs.replace("<anonymous>", ne.displayName)), typeof ne == "function" && Hb.set(ne, zs), zs;
                    }
                  while (ys >= 1 && Us >= 0);
                break;
              }
          }
        } finally {
          np = !1, sg.current = In, vu(), Error.prepareStackTrace = Gt;
        }
        var Yi = ne ? ne.displayName || ne.name : "", so = Yi ? y0(Yi) : "";
        return typeof ne == "function" && Hb.set(ne, so), so;
      }
      function Ww(ne, Le, tt) {
        return Dm(ne, !1);
      }
      function Vw(ne) {
        var Le = ne.prototype;
        return !!(Le && Le.isReactComponent);
      }
      function Nr(ne, Le, tt) {
        if (ne == null)
          return "";
        if (typeof ne == "function")
          return Dm(ne, Vw(ne));
        if (typeof ne == "string")
          return y0(ne);
        switch (ne) {
          case h:
            return y0("Suspense");
          case g:
            return y0("SuspenseList");
        }
        if (typeof ne == "object")
          switch (ne.$$typeof) {
            case d:
              return Ww(ne.render);
            case m:
              return Nr(ne.type, Le, tt);
            case _: {
              var dt = ne, Gt = dt._payload, In = dt._init;
              try {
                return Nr(In(Gt), Le, tt);
              } catch {
              }
            }
          }
        return "";
      }
      var Uw = {}, C0 = Q.ReactDebugCurrentFrame;
      function Rr(ne) {
        if (ne) {
          var Le = ne._owner, tt = Nr(ne.type, ne._source, Le ? Le.type : null);
          C0.setExtraStackFrame(tt);
        } else
          C0.setExtraStackFrame(null);
      }
      function Sk(ne, Le, tt, dt, Gt) {
        {
          var In = Function.call.bind(io);
          for (var vn in ne)
            if (In(ne, vn)) {
              var Ei = void 0;
              try {
                if (typeof ne[vn] != "function") {
                  var sr = Error((dt || "React class") + ": " + tt + " type `" + vn + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof ne[vn] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                  throw sr.name = "Invariant Violation", sr;
                }
                Ei = ne[vn](Le, vn, dt, tt, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
              } catch (ys) {
                Ei = ys;
              }
              Ei && !(Ei instanceof Error) && (Rr(Gt), Z("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", dt || "React class", tt, vn, typeof Ei), Rr(null)), Ei instanceof Error && !(Ei.message in Uw) && (Uw[Ei.message] = !0, Rr(Gt), Z("Failed %s type: %s", tt, Ei.message), Rr(null));
            }
        }
      }
      function og(ne) {
        if (ne) {
          var Le = ne._owner, tt = Nr(ne.type, ne._source, Le ? Le.type : null);
          H(tt);
        } else
          H(null);
      }
      var Ai;
      Ai = !1;
      function Vb() {
        if (R.current) {
          var ne = ts(R.current.type);
          if (ne)
            return `

Check the render method of \`` + ne + "`.";
        }
        return "";
      }
      function el(ne) {
        if (ne !== void 0) {
          var Le = ne.fileName.replace(/^.*[\\\/]/, ""), tt = ne.lineNumber;
          return `

Check your code at ` + Le + ":" + tt + ".";
        }
        return "";
      }
      function yu(ne) {
        return ne != null ? el(ne.__source) : "";
      }
      var Oc = {};
      function ag(ne) {
        var Le = Vb();
        if (!Le) {
          var tt = typeof ne == "string" ? ne : ne.displayName || ne.name;
          tt && (Le = `

Check the top-level render call using <` + tt + ">.");
        }
        return Le;
      }
      function Go(ne, Le) {
        if (!(!ne._store || ne._store.validated || ne.key != null)) {
          ne._store.validated = !0;
          var tt = ag(Le);
          if (!Oc[tt]) {
            Oc[tt] = !0;
            var dt = "";
            ne && ne._owner && ne._owner !== R.current && (dt = " It was passed a child from " + ts(ne._owner.type) + "."), og(ne), Z('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', tt, dt), og(null);
          }
        }
      }
      function Vs(ne, Le) {
        if (typeof ne == "object") {
          if (pi(ne))
            for (var tt = 0; tt < ne.length; tt++) {
              var dt = ne[tt];
              lt(dt) && Go(dt, Le);
            }
          else if (lt(ne))
            ne._store && (ne._store.validated = !0);
          else if (ne) {
            var Gt = L(ne);
            if (typeof Gt == "function" && Gt !== ne.entries)
              for (var In = Gt.call(ne), vn; !(vn = In.next()).done; )
                lt(vn.value) && Go(vn.value, Le);
          }
        }
      }
      function rf(ne) {
        {
          var Le = ne.type;
          if (Le == null || typeof Le == "string")
            return;
          var tt;
          if (typeof Le == "function")
            tt = Le.propTypes;
          else if (typeof Le == "object" && (Le.$$typeof === d || // Note: Memo only checks outer props here.
          // Inner props are checked in the reconciler.
          Le.$$typeof === m))
            tt = Le.propTypes;
          else
            return;
          if (tt) {
            var dt = ts(Le);
            Sk(tt, ne.props, "prop", dt, ne);
          } else if (Le.PropTypes !== void 0 && !Ai) {
            Ai = !0;
            var Gt = ts(Le);
            Z("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Gt || "Unknown");
          }
          typeof Le.getDefaultProps == "function" && !Le.getDefaultProps.isReactClassApproved && Z("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
        }
      }
      function Zd(ne) {
        {
          for (var Le = Object.keys(ne.props), tt = 0; tt < Le.length; tt++) {
            var dt = Le[tt];
            if (dt !== "children" && dt !== "key") {
              og(ne), Z("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", dt), og(null);
              break;
            }
          }
          ne.ref !== null && (og(ne), Z("Invalid attribute `ref` supplied to `React.Fragment`."), og(null));
        }
      }
      function oc(ne, Le, tt) {
        var dt = mt(ne);
        if (!dt) {
          var Gt = "";
          (ne === void 0 || typeof ne == "object" && ne !== null && Object.keys(ne).length === 0) && (Gt += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
          var In = yu(Le);
          In ? Gt += In : Gt += Vb();
          var vn;
          ne === null ? vn = "null" : pi(ne) ? vn = "array" : ne !== void 0 && ne.$$typeof === r ? (vn = "<" + (ts(ne.type) || "Unknown") + " />", Gt = " Did you accidentally export a JSX literal instead of a component?") : vn = typeof ne, Z("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", vn, Gt);
        }
        var Ei = En.apply(this, arguments);
        if (Ei == null)
          return Ei;
        if (dt)
          for (var sr = 2; sr < arguments.length; sr++)
            Vs(arguments[sr], ne);
        return ne === o ? Zd(Ei) : rf(Ei), Ei;
      }
      var Mc = !1;
      function A2(ne) {
        var Le = oc.bind(null, ne);
        return Le.type = ne, Mc || (Mc = !0, oe("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")), Object.defineProperty(Le, "type", {
          enumerable: !1,
          get: function() {
            return oe("Factory.type is deprecated. Access the class directly before passing it to createFactory."), Object.defineProperty(this, "type", {
              value: ne
            }), ne;
          }
        }), Le;
      }
      function w0(ne, Le, tt) {
        for (var dt = li.apply(this, arguments), Gt = 2; Gt < arguments.length; Gt++)
          Vs(arguments[Gt], dt.type);
        return rf(dt), dt;
      }
      function Ub(ne, Le) {
        var tt = D.transition;
        D.transition = {};
        var dt = D.transition;
        D.transition._updatedFibers = /* @__PURE__ */ new Set();
        try {
          ne();
        } finally {
          if (D.transition = tt, tt === null && dt._updatedFibers) {
            var Gt = dt._updatedFibers.size;
            Gt > 10 && oe("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), dt._updatedFibers.clear();
          }
        }
      }
      var S0 = !1, E0 = null;
      function zb(ne) {
        if (E0 === null)
          try {
            var Le = ("require" + Math.random()).slice(0, 7), tt = i && i[Le];
            E0 = tt.call(i, "timers").setImmediate;
          } catch {
            E0 = function(Gt) {
              S0 === !1 && (S0 = !0, typeof MessageChannel > "u" && Z("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));
              var In = new MessageChannel();
              In.port1.onmessage = Gt, In.port2.postMessage(void 0);
            };
          }
        return E0(ne);
      }
      var Qd = 0, Jd = !1;
      function Im(ne) {
        {
          var Le = Qd;
          Qd++, N.current === null && (N.current = []);
          var tt = N.isBatchingLegacy, dt;
          try {
            if (N.isBatchingLegacy = !0, dt = ne(), !tt && N.didScheduleLegacyUpdate) {
              var Gt = N.current;
              Gt !== null && (N.didScheduleLegacyUpdate = !1, rp(Gt));
            }
          } catch (Yi) {
            throw ip(Le), Yi;
          } finally {
            N.isBatchingLegacy = tt;
          }
          if (dt !== null && typeof dt == "object" && typeof dt.then == "function") {
            var In = dt, vn = !1, Ei = {
              then: function(Yi, so) {
                vn = !0, In.then(function(ia) {
                  ip(Le), Qd === 0 ? x0(ia, Yi, so) : Yi(ia);
                }, function(ia) {
                  ip(Le), so(ia);
                });
              }
            };
            return !Jd && typeof Promise < "u" && Promise.resolve().then(function() {
            }).then(function() {
              vn || (Jd = !0, Z("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
            }), Ei;
          } else {
            var sr = dt;
            if (ip(Le), Qd === 0) {
              var ys = N.current;
              ys !== null && (rp(ys), N.current = null);
              var Us = {
                then: function(Yi, so) {
                  N.current === null ? (N.current = [], x0(sr, Yi, so)) : Yi(sr);
                }
              };
              return Us;
            } else {
              var zs = {
                then: function(Yi, so) {
                  Yi(sr);
                }
              };
              return zs;
            }
          }
        }
      }
      function ip(ne) {
        ne !== Qd - 1 && Z("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "), Qd = ne;
      }
      function x0(ne, Le, tt) {
        {
          var dt = N.current;
          if (dt !== null)
            try {
              rp(dt), zb(function() {
                dt.length === 0 ? (N.current = null, Le(ne)) : x0(ne, Le, tt);
              });
            } catch (Gt) {
              tt(Gt);
            }
          else
            Le(ne);
        }
      }
      var Nm = !1;
      function rp(ne) {
        if (!Nm) {
          Nm = !0;
          var Le = 0;
          try {
            for (; Le < ne.length; Le++) {
              var tt = ne[Le];
              do
                tt = tt(!0);
              while (tt !== null);
            }
            ne.length = 0;
          } catch (dt) {
            throw ne = ne.slice(Le + 1), dt;
          } finally {
            Nm = !1;
          }
        }
      }
      var L0 = oc, zw = w0, eh = A2, T0 = {
        map: El,
        forEach: So,
        count: Ri,
        toArray: va,
        only: xl
      };
      e.Children = T0, e.Component = Ve, e.Fragment = o, e.Profiler = l, e.PureComponent = en, e.StrictMode = a, e.Suspense = h, e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Q, e.act = Im, e.cloneElement = zw, e.createContext = ya, e.createElement = L0, e.createFactory = eh, e.createRef = Vt, e.forwardRef = Rc, e.isValidElement = lt, e.lazy = sc, e.memo = jt, e.startTransition = Ub, e.unstable_act = Im, e.useCallback = Lt, e.useContext = Wi, e.useDebugValue = qn, e.useDeferredValue = mo, e.useEffect = ve, e.useId = ns, e.useImperativeHandle = kn, e.useInsertionEffect = fe, e.useLayoutEffect = Be, e.useMemo = ci, e.useReducer = Ki, e.useRef = Nt, e.useState = fi, e.useSyncExternalStore = tf, e.useTransition = bn, e.version = n, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
    })();
  })(HP, HP.exports)), HP.exports;
}
var UEe;
function lB() {
  if (UEe) return v7.exports;
  UEe = 1;
  var i = {};
  return i.NODE_ENV === "production" ? v7.exports = OQe() : v7.exports = MQe(), v7.exports;
}
/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var zEe;
function PQe() {
  if (zEe) return OM;
  zEe = 1;
  var i = lB(), e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
  function o(a, l, c) {
    var u, d = {}, h = null, g = null;
    c !== void 0 && (h = "" + c), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (g = l.ref);
    for (u in l) n.call(l, u) && !s.hasOwnProperty(u) && (d[u] = l[u]);
    if (a && a.defaultProps) for (u in l = a.defaultProps, l) d[u] === void 0 && (d[u] = l[u]);
    return { $$typeof: e, type: a, key: h, ref: g, props: d, _owner: r.current };
  }
  return OM.Fragment = t, OM.jsx = o, OM.jsxs = o, OM;
}
var MM = {}, $Ee;
function FQe() {
  if ($Ee) return MM;
  $Ee = 1;
  var i = {};
  /**
   * @license React
   * react-jsx-runtime.development.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  return i.NODE_ENV !== "production" && (function() {
    var e = lB(), t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), _ = Symbol.iterator, v = "@@iterator";
    function w(xe) {
      if (xe === null || typeof xe != "object")
        return null;
      var mt = _ && xe[_] || xe[v];
      return typeof mt == "function" ? mt : null;
    }
    var E = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function L(xe) {
      {
        for (var mt = arguments.length, jt = new Array(mt > 1 ? mt - 1 : 0), nn = 1; nn < mt; nn++)
          jt[nn - 1] = arguments[nn];
        T("error", xe, jt);
      }
    }
    function T(xe, mt, jt) {
      {
        var nn = E.ReactDebugCurrentFrame, Wi = nn.getStackAddendum();
        Wi !== "" && (mt += "%s", jt = jt.concat([Wi]));
        var fi = jt.map(function(Ki) {
          return String(Ki);
        });
        fi.unshift("Warning: " + mt), Function.prototype.apply.call(console[xe], console, fi);
      }
    }
    var D = !1, N = !1, R = !1, M = !1, B = !1, H;
    H = Symbol.for("react.module.reference");
    function j(xe) {
      return !!(typeof xe == "string" || typeof xe == "function" || xe === r || xe === o || B || xe === s || xe === u || xe === d || M || xe === m || D || N || R || typeof xe == "object" && xe !== null && (xe.$$typeof === g || xe.$$typeof === h || xe.$$typeof === a || xe.$$typeof === l || xe.$$typeof === c || // This needs to include all possible module reference object
      // types supported by any Flight configuration anywhere since
      // we don't know which Flight build this will end up being used
      // with.
      xe.$$typeof === H || xe.getModuleId !== void 0));
    }
    function K(xe, mt, jt) {
      var nn = xe.displayName;
      if (nn)
        return nn;
      var Wi = mt.displayName || mt.name || "";
      return Wi !== "" ? jt + "(" + Wi + ")" : jt;
    }
    function X(xe) {
      return xe.displayName || "Context";
    }
    function Y(xe) {
      if (xe == null)
        return null;
      if (typeof xe.tag == "number" && L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof xe == "function")
        return xe.displayName || xe.name || null;
      if (typeof xe == "string")
        return xe;
      switch (xe) {
        case r:
          return "Fragment";
        case n:
          return "Portal";
        case o:
          return "Profiler";
        case s:
          return "StrictMode";
        case u:
          return "Suspense";
        case d:
          return "SuspenseList";
      }
      if (typeof xe == "object")
        switch (xe.$$typeof) {
          case l:
            var mt = xe;
            return X(mt) + ".Consumer";
          case a:
            var jt = xe;
            return X(jt._context) + ".Provider";
          case c:
            return K(xe, xe.render, "ForwardRef");
          case h:
            var nn = xe.displayName || null;
            return nn !== null ? nn : Y(xe.type) || "Memo";
          case g: {
            var Wi = xe, fi = Wi._payload, Ki = Wi._init;
            try {
              return Y(Ki(fi));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    var G = Object.assign, Q = 0, oe, Z, pe, J, ae, be, re;
    function ze() {
    }
    ze.__reactDisabledLog = !0;
    function Ve() {
      {
        if (Q === 0) {
          oe = console.log, Z = console.info, pe = console.warn, J = console.error, ae = console.group, be = console.groupCollapsed, re = console.groupEnd;
          var xe = {
            configurable: !0,
            enumerable: !0,
            value: ze,
            writable: !0
          };
          Object.defineProperties(console, {
            info: xe,
            log: xe,
            warn: xe,
            error: xe,
            group: xe,
            groupCollapsed: xe,
            groupEnd: xe
          });
        }
        Q++;
      }
    }
    function st() {
      {
        if (Q--, Q === 0) {
          var xe = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: G({}, xe, {
              value: oe
            }),
            info: G({}, xe, {
              value: Z
            }),
            warn: G({}, xe, {
              value: pe
            }),
            error: G({}, xe, {
              value: J
            }),
            group: G({}, xe, {
              value: ae
            }),
            groupCollapsed: G({}, xe, {
              value: be
            }),
            groupEnd: G({}, xe, {
              value: re
            })
          });
        }
        Q < 0 && L("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var ot = E.ReactCurrentDispatcher, et;
    function at(xe, mt, jt) {
      {
        if (et === void 0)
          try {
            throw Error();
          } catch (Wi) {
            var nn = Wi.stack.trim().match(/\n( *(at )?)/);
            et = nn && nn[1] || "";
          }
        return `
` + et + xe;
      }
    }
    var en = !1, sn;
    {
      var Vt = typeof WeakMap == "function" ? WeakMap : Map;
      sn = new Vt();
    }
    function Bi(xe, mt) {
      if (!xe || en)
        return "";
      {
        var jt = sn.get(xe);
        if (jt !== void 0)
          return jt;
      }
      var nn;
      en = !0;
      var Wi = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var fi;
      fi = ot.current, ot.current = null, Ve();
      try {
        if (mt) {
          var Ki = function() {
            throw Error();
          };
          if (Object.defineProperty(Ki.prototype, "props", {
            set: function() {
              throw Error();
            }
          }), typeof Reflect == "object" && Reflect.construct) {
            try {
              Reflect.construct(Ki, []);
            } catch (qn) {
              nn = qn;
            }
            Reflect.construct(xe, [], Ki);
          } else {
            try {
              Ki.call();
            } catch (qn) {
              nn = qn;
            }
            xe.call(Ki.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (qn) {
            nn = qn;
          }
          xe();
        }
      } catch (qn) {
        if (qn && nn && typeof qn.stack == "string") {
          for (var Nt = qn.stack.split(`
`), ve = nn.stack.split(`
`), fe = Nt.length - 1, Be = ve.length - 1; fe >= 1 && Be >= 0 && Nt[fe] !== ve[Be]; )
            Be--;
          for (; fe >= 1 && Be >= 0; fe--, Be--)
            if (Nt[fe] !== ve[Be]) {
              if (fe !== 1 || Be !== 1)
                do
                  if (fe--, Be--, Be < 0 || Nt[fe] !== ve[Be]) {
                    var Lt = `
` + Nt[fe].replace(" at new ", " at ");
                    return xe.displayName && Lt.includes("<anonymous>") && (Lt = Lt.replace("<anonymous>", xe.displayName)), typeof xe == "function" && sn.set(xe, Lt), Lt;
                  }
                while (fe >= 1 && Be >= 0);
              break;
            }
        }
      } finally {
        en = !1, ot.current = fi, st(), Error.prepareStackTrace = Wi;
      }
      var ci = xe ? xe.displayName || xe.name : "", kn = ci ? at(ci) : "";
      return typeof xe == "function" && sn.set(xe, kn), kn;
    }
    function pi(xe, mt, jt) {
      return Bi(xe, !1);
    }
    function tn(xe) {
      var mt = xe.prototype;
      return !!(mt && mt.isReactComponent);
    }
    function Vr(xe, mt, jt) {
      if (xe == null)
        return "";
      if (typeof xe == "function")
        return Bi(xe, tn(xe));
      if (typeof xe == "string")
        return at(xe);
      switch (xe) {
        case u:
          return at("Suspense");
        case d:
          return at("SuspenseList");
      }
      if (typeof xe == "object")
        switch (xe.$$typeof) {
          case c:
            return pi(xe.render);
          case h:
            return Vr(xe.type, mt, jt);
          case g: {
            var nn = xe, Wi = nn._payload, fi = nn._init;
            try {
              return Vr(fi(Wi), mt, jt);
            } catch {
            }
          }
        }
      return "";
    }
    var tr = Object.prototype.hasOwnProperty, qr = {}, Bs = E.ReactDebugCurrentFrame;
    function Ts(xe) {
      if (xe) {
        var mt = xe._owner, jt = Vr(xe.type, xe._source, mt ? mt.type : null);
        Bs.setExtraStackFrame(jt);
      } else
        Bs.setExtraStackFrame(null);
    }
    function ts(xe, mt, jt, nn, Wi) {
      {
        var fi = Function.call.bind(tr);
        for (var Ki in xe)
          if (fi(xe, Ki)) {
            var Nt = void 0;
            try {
              if (typeof xe[Ki] != "function") {
                var ve = Error((nn || "React class") + ": " + jt + " type `" + Ki + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof xe[Ki] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                throw ve.name = "Invariant Violation", ve;
              }
              Nt = xe[Ki](mt, Ki, nn, jt, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (fe) {
              Nt = fe;
            }
            Nt && !(Nt instanceof Error) && (Ts(Wi), L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", nn || "React class", jt, Ki, typeof Nt), Ts(null)), Nt instanceof Error && !(Nt.message in qr) && (qr[Nt.message] = !0, Ts(Wi), L("Failed %s type: %s", jt, Nt.message), Ts(null));
          }
      }
    }
    var io = Array.isArray;
    function nr(xe) {
      return io(xe);
    }
    function _s(xe) {
      {
        var mt = typeof Symbol == "function" && Symbol.toStringTag, jt = mt && xe[Symbol.toStringTag] || xe.constructor.name || "Object";
        return jt;
      }
    }
    function Hs(xe) {
      try {
        return He(xe), !1;
      } catch {
        return !0;
      }
    }
    function He(xe) {
      return "" + xe;
    }
    function yt(xe) {
      if (Hs(xe))
        return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", _s(xe)), He(xe);
    }
    var Ln = E.ReactCurrentOwner, oi = {
      key: !0,
      ref: !0,
      __self: !0,
      __source: !0
    }, vi, Dt;
    function cn(xe) {
      if (tr.call(xe, "ref")) {
        var mt = Object.getOwnPropertyDescriptor(xe, "ref").get;
        if (mt && mt.isReactWarning)
          return !1;
      }
      return xe.ref !== void 0;
    }
    function En(xe) {
      if (tr.call(xe, "key")) {
        var mt = Object.getOwnPropertyDescriptor(xe, "key").get;
        if (mt && mt.isReactWarning)
          return !1;
      }
      return xe.key !== void 0;
    }
    function ii(xe, mt) {
      typeof xe.ref == "string" && Ln.current;
    }
    function li(xe, mt) {
      {
        var jt = function() {
          vi || (vi = !0, L("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", mt));
        };
        jt.isReactWarning = !0, Object.defineProperty(xe, "key", {
          get: jt,
          configurable: !0
        });
      }
    }
    function lt(xe, mt) {
      {
        var jt = function() {
          Dt || (Dt = !0, L("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", mt));
        };
        jt.isReactWarning = !0, Object.defineProperty(xe, "ref", {
          get: jt,
          configurable: !0
        });
      }
    }
    var Bt = function(xe, mt, jt, nn, Wi, fi, Ki) {
      var Nt = {
        // This tag allows us to uniquely identify this as a React Element
        $$typeof: t,
        // Built-in properties that belong on the element
        type: xe,
        key: mt,
        ref: jt,
        props: Ki,
        // Record the component responsible for creating this element.
        _owner: fi
      };
      return Nt._store = {}, Object.defineProperty(Nt._store, "validated", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: !1
      }), Object.defineProperty(Nt, "_self", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: nn
      }), Object.defineProperty(Nt, "_source", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: Wi
      }), Object.freeze && (Object.freeze(Nt.props), Object.freeze(Nt)), Nt;
    };
    function Mn(xe, mt, jt, nn, Wi) {
      {
        var fi, Ki = {}, Nt = null, ve = null;
        jt !== void 0 && (yt(jt), Nt = "" + jt), En(mt) && (yt(mt.key), Nt = "" + mt.key), cn(mt) && (ve = mt.ref, ii(mt, Wi));
        for (fi in mt)
          tr.call(mt, fi) && !oi.hasOwnProperty(fi) && (Ki[fi] = mt[fi]);
        if (xe && xe.defaultProps) {
          var fe = xe.defaultProps;
          for (fi in fe)
            Ki[fi] === void 0 && (Ki[fi] = fe[fi]);
        }
        if (Nt || ve) {
          var Be = typeof xe == "function" ? xe.displayName || xe.name || "Unknown" : xe;
          Nt && li(Ki, Be), ve && lt(Ki, Be);
        }
        return Bt(xe, Nt, ve, Wi, nn, Ln.current, Ki);
      }
    }
    var gn = E.ReactCurrentOwner, yi = E.ReactDebugCurrentFrame;
    function Ni(xe) {
      if (xe) {
        var mt = xe._owner, jt = Vr(xe.type, xe._source, mt ? mt.type : null);
        yi.setExtraStackFrame(jt);
      } else
        yi.setExtraStackFrame(null);
    }
    var qi;
    qi = !1;
    function Ur(xe) {
      return typeof xe == "object" && xe !== null && xe.$$typeof === t;
    }
    function Ws() {
      {
        if (gn.current) {
          var xe = Y(gn.current.type);
          if (xe)
            return `

Check the render method of \`` + xe + "`.";
        }
        return "";
      }
    }
    function El(xe) {
      return "";
    }
    var Ri = {};
    function So(xe) {
      {
        var mt = Ws();
        if (!mt) {
          var jt = typeof xe == "string" ? xe : xe.displayName || xe.name;
          jt && (mt = `

Check the top-level render call using <` + jt + ">.");
        }
        return mt;
      }
    }
    function va(xe, mt) {
      {
        if (!xe._store || xe._store.validated || xe.key != null)
          return;
        xe._store.validated = !0;
        var jt = So(mt);
        if (Ri[jt])
          return;
        Ri[jt] = !0;
        var nn = "";
        xe && xe._owner && xe._owner !== gn.current && (nn = " It was passed a child from " + Y(xe._owner.type) + "."), Ni(xe), L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', jt, nn), Ni(null);
      }
    }
    function xl(xe, mt) {
      {
        if (typeof xe != "object")
          return;
        if (nr(xe))
          for (var jt = 0; jt < xe.length; jt++) {
            var nn = xe[jt];
            Ur(nn) && va(nn, mt);
          }
        else if (Ur(xe))
          xe._store && (xe._store.validated = !0);
        else if (xe) {
          var Wi = w(xe);
          if (typeof Wi == "function" && Wi !== xe.entries)
            for (var fi = Wi.call(xe), Ki; !(Ki = fi.next()).done; )
              Ur(Ki.value) && va(Ki.value, mt);
        }
      }
    }
    function ya(xe) {
      {
        var mt = xe.type;
        if (mt == null || typeof mt == "string")
          return;
        var jt;
        if (typeof mt == "function")
          jt = mt.propTypes;
        else if (typeof mt == "object" && (mt.$$typeof === c || // Note: Memo only checks outer props here.
        // Inner props are checked in the reconciler.
        mt.$$typeof === h))
          jt = mt.propTypes;
        else
          return;
        if (jt) {
          var nn = Y(mt);
          ts(jt, xe.props, "prop", nn, xe);
        } else if (mt.PropTypes !== void 0 && !qi) {
          qi = !0;
          var Wi = Y(mt);
          L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Wi || "Unknown");
        }
        typeof mt.getDefaultProps == "function" && !mt.getDefaultProps.isReactClassApproved && L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
      }
    }
    function ro(xe) {
      {
        for (var mt = Object.keys(xe.props), jt = 0; jt < mt.length; jt++) {
          var nn = mt[jt];
          if (nn !== "children" && nn !== "key") {
            Ni(xe), L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", nn), Ni(null);
            break;
          }
        }
        xe.ref !== null && (Ni(xe), L("Invalid attribute `ref` supplied to `React.Fragment`."), Ni(null));
      }
    }
    var Eo = {};
    function po(xe, mt, jt, nn, Wi, fi) {
      {
        var Ki = j(xe);
        if (!Ki) {
          var Nt = "";
          (xe === void 0 || typeof xe == "object" && xe !== null && Object.keys(xe).length === 0) && (Nt += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
          var ve = El();
          ve ? Nt += ve : Nt += Ws();
          var fe;
          xe === null ? fe = "null" : nr(xe) ? fe = "array" : xe !== void 0 && xe.$$typeof === t ? (fe = "<" + (Y(xe.type) || "Unknown") + " />", Nt = " Did you accidentally export a JSX literal instead of a component?") : fe = typeof xe, L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", fe, Nt);
        }
        var Be = Mn(xe, mt, jt, Wi, fi);
        if (Be == null)
          return Be;
        if (Ki) {
          var Lt = mt.children;
          if (Lt !== void 0)
            if (nn)
              if (nr(Lt)) {
                for (var ci = 0; ci < Lt.length; ci++)
                  xl(Lt[ci], xe);
                Object.freeze && Object.freeze(Lt);
              } else
                L("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
            else
              xl(Lt, xe);
        }
        if (tr.call(mt, "key")) {
          var kn = Y(xe), qn = Object.keys(mt).filter(function(ns) {
            return ns !== "key";
          }), bn = qn.length > 0 ? "{key: someKey, " + qn.join(": ..., ") + ": ...}" : "{key: someKey}";
          if (!Eo[kn + bn]) {
            var mo = qn.length > 0 ? "{" + qn.join(": ..., ") + ": ...}" : "{}";
            L(`A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} />`, bn, kn, mo, kn), Eo[kn + bn] = !0;
          }
        }
        return xe === r ? ro(Be) : ya(Be), Be;
      }
    }
    function bs(xe, mt, jt) {
      return po(xe, mt, jt, !0);
    }
    function na(xe, mt, jt) {
      return po(xe, mt, jt, !1);
    }
    var sc = na, Rc = bs;
    MM.Fragment = r, MM.jsx = sc, MM.jsxs = Rc;
  })(), MM;
}
var jEe;
function BQe() {
  if (jEe) return b7.exports;
  jEe = 1;
  var i = {};
  return i.NODE_ENV === "production" ? b7.exports = PQe() : b7.exports = FQe(), b7.exports;
}
var hr = BQe(), Zn = lB();
const nb = /* @__PURE__ */ WA(Zn);
var cI = {}, y7 = { exports: {} }, fh = {}, C7 = { exports: {} }, CJ = {};
/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var GEe;
function HQe() {
  return GEe || (GEe = 1, (function(i) {
    function e(Z, pe) {
      var J = Z.length;
      Z.push(pe);
      e: for (; 0 < J; ) {
        var ae = J - 1 >>> 1, be = Z[ae];
        if (0 < r(be, pe)) Z[ae] = pe, Z[J] = be, J = ae;
        else break e;
      }
    }
    function t(Z) {
      return Z.length === 0 ? null : Z[0];
    }
    function n(Z) {
      if (Z.length === 0) return null;
      var pe = Z[0], J = Z.pop();
      if (J !== pe) {
        Z[0] = J;
        e: for (var ae = 0, be = Z.length, re = be >>> 1; ae < re; ) {
          var ze = 2 * (ae + 1) - 1, Ve = Z[ze], st = ze + 1, ot = Z[st];
          if (0 > r(Ve, J)) st < be && 0 > r(ot, Ve) ? (Z[ae] = ot, Z[st] = J, ae = st) : (Z[ae] = Ve, Z[ze] = J, ae = ze);
          else if (st < be && 0 > r(ot, J)) Z[ae] = ot, Z[st] = J, ae = st;
          else break e;
        }
      }
      return pe;
    }
    function r(Z, pe) {
      var J = Z.sortIndex - pe.sortIndex;
      return J !== 0 ? J : Z.id - pe.id;
    }
    if (typeof performance == "object" && typeof performance.now == "function") {
      var s = performance;
      i.unstable_now = function() {
        return s.now();
      };
    } else {
      var o = Date, a = o.now();
      i.unstable_now = function() {
        return o.now() - a;
      };
    }
    var l = [], c = [], u = 1, d = null, h = 3, g = !1, m = !1, _ = !1, v = typeof setTimeout == "function" ? setTimeout : null, w = typeof clearTimeout == "function" ? clearTimeout : null, E = typeof setImmediate < "u" ? setImmediate : null;
    typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling);
    function L(Z) {
      for (var pe = t(c); pe !== null; ) {
        if (pe.callback === null) n(c);
        else if (pe.startTime <= Z) n(c), pe.sortIndex = pe.expirationTime, e(l, pe);
        else break;
        pe = t(c);
      }
    }
    function T(Z) {
      if (_ = !1, L(Z), !m) if (t(l) !== null) m = !0, Q(D);
      else {
        var pe = t(c);
        pe !== null && oe(T, pe.startTime - Z);
      }
    }
    function D(Z, pe) {
      m = !1, _ && (_ = !1, w(M), M = -1), g = !0;
      var J = h;
      try {
        for (L(pe), d = t(l); d !== null && (!(d.expirationTime > pe) || Z && !j()); ) {
          var ae = d.callback;
          if (typeof ae == "function") {
            d.callback = null, h = d.priorityLevel;
            var be = ae(d.expirationTime <= pe);
            pe = i.unstable_now(), typeof be == "function" ? d.callback = be : d === t(l) && n(l), L(pe);
          } else n(l);
          d = t(l);
        }
        if (d !== null) var re = !0;
        else {
          var ze = t(c);
          ze !== null && oe(T, ze.startTime - pe), re = !1;
        }
        return re;
      } finally {
        d = null, h = J, g = !1;
      }
    }
    var N = !1, R = null, M = -1, B = 5, H = -1;
    function j() {
      return !(i.unstable_now() - H < B);
    }
    function K() {
      if (R !== null) {
        var Z = i.unstable_now();
        H = Z;
        var pe = !0;
        try {
          pe = R(!0, Z);
        } finally {
          pe ? X() : (N = !1, R = null);
        }
      } else N = !1;
    }
    var X;
    if (typeof E == "function") X = function() {
      E(K);
    };
    else if (typeof MessageChannel < "u") {
      var Y = new MessageChannel(), G = Y.port2;
      Y.port1.onmessage = K, X = function() {
        G.postMessage(null);
      };
    } else X = function() {
      v(K, 0);
    };
    function Q(Z) {
      R = Z, N || (N = !0, X());
    }
    function oe(Z, pe) {
      M = v(function() {
        Z(i.unstable_now());
      }, pe);
    }
    i.unstable_IdlePriority = 5, i.unstable_ImmediatePriority = 1, i.unstable_LowPriority = 4, i.unstable_NormalPriority = 3, i.unstable_Profiling = null, i.unstable_UserBlockingPriority = 2, i.unstable_cancelCallback = function(Z) {
      Z.callback = null;
    }, i.unstable_continueExecution = function() {
      m || g || (m = !0, Q(D));
    }, i.unstable_forceFrameRate = function(Z) {
      0 > Z || 125 < Z ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : B = 0 < Z ? Math.floor(1e3 / Z) : 5;
    }, i.unstable_getCurrentPriorityLevel = function() {
      return h;
    }, i.unstable_getFirstCallbackNode = function() {
      return t(l);
    }, i.unstable_next = function(Z) {
      switch (h) {
        case 1:
        case 2:
        case 3:
          var pe = 3;
          break;
        default:
          pe = h;
      }
      var J = h;
      h = pe;
      try {
        return Z();
      } finally {
        h = J;
      }
    }, i.unstable_pauseExecution = function() {
    }, i.unstable_requestPaint = function() {
    }, i.unstable_runWithPriority = function(Z, pe) {
      switch (Z) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
          break;
        default:
          Z = 3;
      }
      var J = h;
      h = Z;
      try {
        return pe();
      } finally {
        h = J;
      }
    }, i.unstable_scheduleCallback = function(Z, pe, J) {
      var ae = i.unstable_now();
      switch (typeof J == "object" && J !== null ? (J = J.delay, J = typeof J == "number" && 0 < J ? ae + J : ae) : J = ae, Z) {
        case 1:
          var be = -1;
          break;
        case 2:
          be = 250;
          break;
        case 5:
          be = 1073741823;
          break;
        case 4:
          be = 1e4;
          break;
        default:
          be = 5e3;
      }
      return be = J + be, Z = { id: u++, callback: pe, priorityLevel: Z, startTime: J, expirationTime: be, sortIndex: -1 }, J > ae ? (Z.sortIndex = J, e(c, Z), t(l) === null && Z === t(c) && (_ ? (w(M), M = -1) : _ = !0, oe(T, J - ae))) : (Z.sortIndex = be, e(l, Z), m || g || (m = !0, Q(D))), Z;
    }, i.unstable_shouldYield = j, i.unstable_wrapCallback = function(Z) {
      var pe = h;
      return function() {
        var J = h;
        h = pe;
        try {
          return Z.apply(this, arguments);
        } finally {
          h = J;
        }
      };
    };
  })(CJ)), CJ;
}
var wJ = {}, qEe;
function WQe() {
  return qEe || (qEe = 1, (function(i) {
    var e = {};
    /**
     * @license React
     * scheduler.development.js
     *
     * Copyright (c) Facebook, Inc. and its affiliates.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
     */
    e.NODE_ENV !== "production" && (function() {
      typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
      var t = !1, n = 5;
      function r(Dt, cn) {
        var En = Dt.length;
        Dt.push(cn), a(Dt, cn, En);
      }
      function s(Dt) {
        return Dt.length === 0 ? null : Dt[0];
      }
      function o(Dt) {
        if (Dt.length === 0)
          return null;
        var cn = Dt[0], En = Dt.pop();
        return En !== cn && (Dt[0] = En, l(Dt, En, 0)), cn;
      }
      function a(Dt, cn, En) {
        for (var ii = En; ii > 0; ) {
          var li = ii - 1 >>> 1, lt = Dt[li];
          if (c(lt, cn) > 0)
            Dt[li] = cn, Dt[ii] = lt, ii = li;
          else
            return;
        }
      }
      function l(Dt, cn, En) {
        for (var ii = En, li = Dt.length, lt = li >>> 1; ii < lt; ) {
          var Bt = (ii + 1) * 2 - 1, Mn = Dt[Bt], gn = Bt + 1, yi = Dt[gn];
          if (c(Mn, cn) < 0)
            gn < li && c(yi, Mn) < 0 ? (Dt[ii] = yi, Dt[gn] = cn, ii = gn) : (Dt[ii] = Mn, Dt[Bt] = cn, ii = Bt);
          else if (gn < li && c(yi, cn) < 0)
            Dt[ii] = yi, Dt[gn] = cn, ii = gn;
          else
            return;
        }
      }
      function c(Dt, cn) {
        var En = Dt.sortIndex - cn.sortIndex;
        return En !== 0 ? En : Dt.id - cn.id;
      }
      var u = 1, d = 2, h = 3, g = 4, m = 5;
      function _(Dt, cn) {
      }
      var v = typeof performance == "object" && typeof performance.now == "function";
      if (v) {
        var w = performance;
        i.unstable_now = function() {
          return w.now();
        };
      } else {
        var E = Date, L = E.now();
        i.unstable_now = function() {
          return E.now() - L;
        };
      }
      var T = 1073741823, D = -1, N = 250, R = 5e3, M = 1e4, B = T, H = [], j = [], K = 1, X = null, Y = h, G = !1, Q = !1, oe = !1, Z = typeof setTimeout == "function" ? setTimeout : null, pe = typeof clearTimeout == "function" ? clearTimeout : null, J = typeof setImmediate < "u" ? setImmediate : null;
      typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling);
      function ae(Dt) {
        for (var cn = s(j); cn !== null; ) {
          if (cn.callback === null)
            o(j);
          else if (cn.startTime <= Dt)
            o(j), cn.sortIndex = cn.expirationTime, r(H, cn);
          else
            return;
          cn = s(j);
        }
      }
      function be(Dt) {
        if (oe = !1, ae(Dt), !Q)
          if (s(H) !== null)
            Q = !0, He(re);
          else {
            var cn = s(j);
            cn !== null && yt(be, cn.startTime - Dt);
          }
      }
      function re(Dt, cn) {
        Q = !1, oe && (oe = !1, Ln()), G = !0;
        var En = Y;
        try {
          var ii;
          if (!t) return ze(Dt, cn);
        } finally {
          X = null, Y = En, G = !1;
        }
      }
      function ze(Dt, cn) {
        var En = cn;
        for (ae(En), X = s(H); X !== null && !(X.expirationTime > En && (!Dt || Bs())); ) {
          var ii = X.callback;
          if (typeof ii == "function") {
            X.callback = null, Y = X.priorityLevel;
            var li = X.expirationTime <= En, lt = ii(li);
            En = i.unstable_now(), typeof lt == "function" ? X.callback = lt : X === s(H) && o(H), ae(En);
          } else
            o(H);
          X = s(H);
        }
        if (X !== null)
          return !0;
        var Bt = s(j);
        return Bt !== null && yt(be, Bt.startTime - En), !1;
      }
      function Ve(Dt, cn) {
        switch (Dt) {
          case u:
          case d:
          case h:
          case g:
          case m:
            break;
          default:
            Dt = h;
        }
        var En = Y;
        Y = Dt;
        try {
          return cn();
        } finally {
          Y = En;
        }
      }
      function st(Dt) {
        var cn;
        switch (Y) {
          case u:
          case d:
          case h:
            cn = h;
            break;
          default:
            cn = Y;
            break;
        }
        var En = Y;
        Y = cn;
        try {
          return Dt();
        } finally {
          Y = En;
        }
      }
      function ot(Dt) {
        var cn = Y;
        return function() {
          var En = Y;
          Y = cn;
          try {
            return Dt.apply(this, arguments);
          } finally {
            Y = En;
          }
        };
      }
      function et(Dt, cn, En) {
        var ii = i.unstable_now(), li;
        if (typeof En == "object" && En !== null) {
          var lt = En.delay;
          typeof lt == "number" && lt > 0 ? li = ii + lt : li = ii;
        } else
          li = ii;
        var Bt;
        switch (Dt) {
          case u:
            Bt = D;
            break;
          case d:
            Bt = N;
            break;
          case m:
            Bt = B;
            break;
          case g:
            Bt = M;
            break;
          case h:
          default:
            Bt = R;
            break;
        }
        var Mn = li + Bt, gn = {
          id: K++,
          callback: cn,
          priorityLevel: Dt,
          startTime: li,
          expirationTime: Mn,
          sortIndex: -1
        };
        return li > ii ? (gn.sortIndex = li, r(j, gn), s(H) === null && gn === s(j) && (oe ? Ln() : oe = !0, yt(be, li - ii))) : (gn.sortIndex = Mn, r(H, gn), !Q && !G && (Q = !0, He(re))), gn;
      }
      function at() {
      }
      function en() {
        !Q && !G && (Q = !0, He(re));
      }
      function sn() {
        return s(H);
      }
      function Vt(Dt) {
        Dt.callback = null;
      }
      function Bi() {
        return Y;
      }
      var pi = !1, tn = null, Vr = -1, tr = n, qr = -1;
      function Bs() {
        var Dt = i.unstable_now() - qr;
        return !(Dt < tr);
      }
      function Ts() {
      }
      function ts(Dt) {
        if (Dt < 0 || Dt > 125) {
          console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");
          return;
        }
        Dt > 0 ? tr = Math.floor(1e3 / Dt) : tr = n;
      }
      var io = function() {
        if (tn !== null) {
          var Dt = i.unstable_now();
          qr = Dt;
          var cn = !0, En = !0;
          try {
            En = tn(cn, Dt);
          } finally {
            En ? nr() : (pi = !1, tn = null);
          }
        } else
          pi = !1;
      }, nr;
      if (typeof J == "function")
        nr = function() {
          J(io);
        };
      else if (typeof MessageChannel < "u") {
        var _s = new MessageChannel(), Hs = _s.port2;
        _s.port1.onmessage = io, nr = function() {
          Hs.postMessage(null);
        };
      } else
        nr = function() {
          Z(io, 0);
        };
      function He(Dt) {
        tn = Dt, pi || (pi = !0, nr());
      }
      function yt(Dt, cn) {
        Vr = Z(function() {
          Dt(i.unstable_now());
        }, cn);
      }
      function Ln() {
        pe(Vr), Vr = -1;
      }
      var oi = Ts, vi = null;
      i.unstable_IdlePriority = m, i.unstable_ImmediatePriority = u, i.unstable_LowPriority = g, i.unstable_NormalPriority = h, i.unstable_Profiling = vi, i.unstable_UserBlockingPriority = d, i.unstable_cancelCallback = Vt, i.unstable_continueExecution = en, i.unstable_forceFrameRate = ts, i.unstable_getCurrentPriorityLevel = Bi, i.unstable_getFirstCallbackNode = sn, i.unstable_next = st, i.unstable_pauseExecution = at, i.unstable_requestPaint = oi, i.unstable_runWithPriority = Ve, i.unstable_scheduleCallback = et, i.unstable_shouldYield = Bs, i.unstable_wrapCallback = ot, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
    })();
  })(wJ)), wJ;
}
var KEe;
function sMe() {
  if (KEe) return C7.exports;
  KEe = 1;
  var i = {};
  return i.NODE_ENV === "production" ? C7.exports = HQe() : C7.exports = WQe(), C7.exports;
}
/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var YEe;
function VQe() {
  if (YEe) return fh;
  YEe = 1;
  var i = lB(), e = sMe();
  function t(b) {
    for (var y = "https://reactjs.org/docs/error-decoder.html?invariant=" + b, k = 1; k < arguments.length; k++) y += "&args[]=" + encodeURIComponent(arguments[k]);
    return "Minified React error #" + b + "; visit " + y + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  var n = /* @__PURE__ */ new Set(), r = {};
  function s(b, y) {
    o(b, y), o(b + "Capture", y);
  }
  function o(b, y) {
    for (r[b] = y, b = 0; b < y.length; b++) n.add(y[b]);
  }
  var a = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), l = Object.prototype.hasOwnProperty, c = /^[: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]*$/, u = {}, d = {};
  function h(b) {
    return l.call(d, b) ? !0 : l.call(u, b) ? !1 : c.test(b) ? d[b] = !0 : (u[b] = !0, !1);
  }
  function g(b, y, k, A) {
    if (k !== null && k.type === 0) return !1;
    switch (typeof y) {
      case "function":
      case "symbol":
        return !0;
      case "boolean":
        return A ? !1 : k !== null ? !k.acceptsBooleans : (b = b.toLowerCase().slice(0, 5), b !== "data-" && b !== "aria-");
      default:
        return !1;
    }
  }
  function m(b, y, k, A) {
    if (y === null || typeof y > "u" || g(b, y, k, A)) return !0;
    if (A) return !1;
    if (k !== null) switch (k.type) {
      case 3:
        return !y;
      case 4:
        return y === !1;
      case 5:
        return isNaN(y);
      case 6:
        return isNaN(y) || 1 > y;
    }
    return !1;
  }
  function _(b, y, k, A, F, U, le) {
    this.acceptsBooleans = y === 2 || y === 3 || y === 4, this.attributeName = A, this.attributeNamespace = F, this.mustUseProperty = k, this.propertyName = b, this.type = y, this.sanitizeURL = U, this.removeEmptyString = le;
  }
  var v = {};
  "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(b) {
    v[b] = new _(b, 0, !1, b, null, !1, !1);
  }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(b) {
    var y = b[0];
    v[y] = new _(y, 1, !1, b[1], null, !1, !1);
  }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(b) {
    v[b] = new _(b, 2, !1, b.toLowerCase(), null, !1, !1);
  }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(b) {
    v[b] = new _(b, 2, !1, b, null, !1, !1);
  }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(b) {
    v[b] = new _(b, 3, !1, b.toLowerCase(), null, !1, !1);
  }), ["checked", "multiple", "muted", "selected"].forEach(function(b) {
    v[b] = new _(b, 3, !0, b, null, !1, !1);
  }), ["capture", "download"].forEach(function(b) {
    v[b] = new _(b, 4, !1, b, null, !1, !1);
  }), ["cols", "rows", "size", "span"].forEach(function(b) {
    v[b] = new _(b, 6, !1, b, null, !1, !1);
  }), ["rowSpan", "start"].forEach(function(b) {
    v[b] = new _(b, 5, !1, b.toLowerCase(), null, !1, !1);
  });
  var w = /[\-:]([a-z])/g;
  function E(b) {
    return b[1].toUpperCase();
  }
  "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(b) {
    var y = b.replace(
      w,
      E
    );
    v[y] = new _(y, 1, !1, b, null, !1, !1);
  }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(b) {
    var y = b.replace(w, E);
    v[y] = new _(y, 1, !1, b, "http://www.w3.org/1999/xlink", !1, !1);
  }), ["xml:base", "xml:lang", "xml:space"].forEach(function(b) {
    var y = b.replace(w, E);
    v[y] = new _(y, 1, !1, b, "http://www.w3.org/XML/1998/namespace", !1, !1);
  }), ["tabIndex", "crossOrigin"].forEach(function(b) {
    v[b] = new _(b, 1, !1, b.toLowerCase(), null, !1, !1);
  }), v.xlinkHref = new _("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(b) {
    v[b] = new _(b, 1, !1, b.toLowerCase(), null, !0, !0);
  });
  function L(b, y, k, A) {
    var F = v.hasOwnProperty(y) ? v[y] : null;
    (F !== null ? F.type !== 0 : A || !(2 < y.length) || y[0] !== "o" && y[0] !== "O" || y[1] !== "n" && y[1] !== "N") && (m(y, k, F, A) && (k = null), A || F === null ? h(y) && (k === null ? b.removeAttribute(y) : b.setAttribute(y, "" + k)) : F.mustUseProperty ? b[F.propertyName] = k === null ? F.type === 3 ? !1 : "" : k : (y = F.attributeName, A = F.attributeNamespace, k === null ? b.removeAttribute(y) : (F = F.type, k = F === 3 || F === 4 && k === !0 ? "" : "" + k, A ? b.setAttributeNS(A, y, k) : b.setAttribute(y, k))));
  }
  var T = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, D = Symbol.for("react.element"), N = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), M = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), H = Symbol.for("react.provider"), j = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), Q = Symbol.for("react.lazy"), oe = Symbol.for("react.offscreen"), Z = Symbol.iterator;
  function pe(b) {
    return b === null || typeof b != "object" ? null : (b = Z && b[Z] || b["@@iterator"], typeof b == "function" ? b : null);
  }
  var J = Object.assign, ae;
  function be(b) {
    if (ae === void 0) try {
      throw Error();
    } catch (k) {
      var y = k.stack.trim().match(/\n( *(at )?)/);
      ae = y && y[1] || "";
    }
    return `
` + ae + b;
  }
  var re = !1;
  function ze(b, y) {
    if (!b || re) return "";
    re = !0;
    var k = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      if (y) if (y = function() {
        throw Error();
      }, Object.defineProperty(y.prototype, "props", { set: function() {
        throw Error();
      } }), typeof Reflect == "object" && Reflect.construct) {
        try {
          Reflect.construct(y, []);
        } catch (it) {
          var A = it;
        }
        Reflect.construct(b, [], y);
      } else {
        try {
          y.call();
        } catch (it) {
          A = it;
        }
        b.call(y.prototype);
      }
      else {
        try {
          throw Error();
        } catch (it) {
          A = it;
        }
        b();
      }
    } catch (it) {
      if (it && A && typeof it.stack == "string") {
        for (var F = it.stack.split(`
`), U = A.stack.split(`
`), le = F.length - 1, we = U.length - 1; 1 <= le && 0 <= we && F[le] !== U[we]; ) we--;
        for (; 1 <= le && 0 <= we; le--, we--) if (F[le] !== U[we]) {
          if (le !== 1 || we !== 1)
            do
              if (le--, we--, 0 > we || F[le] !== U[we]) {
                var Te = `
` + F[le].replace(" at new ", " at ");
                return b.displayName && Te.includes("<anonymous>") && (Te = Te.replace("<anonymous>", b.displayName)), Te;
              }
            while (1 <= le && 0 <= we);
          break;
        }
      }
    } finally {
      re = !1, Error.prepareStackTrace = k;
    }
    return (b = b ? b.displayName || b.name : "") ? be(b) : "";
  }
  function Ve(b) {
    switch (b.tag) {
      case 5:
        return be(b.type);
      case 16:
        return be("Lazy");
      case 13:
        return be("Suspense");
      case 19:
        return be("SuspenseList");
      case 0:
      case 2:
      case 15:
        return b = ze(b.type, !1), b;
      case 11:
        return b = ze(b.type.render, !1), b;
      case 1:
        return b = ze(b.type, !0), b;
      default:
        return "";
    }
  }
  function st(b) {
    if (b == null) return null;
    if (typeof b == "function") return b.displayName || b.name || null;
    if (typeof b == "string") return b;
    switch (b) {
      case R:
        return "Fragment";
      case N:
        return "Portal";
      case B:
        return "Profiler";
      case M:
        return "StrictMode";
      case X:
        return "Suspense";
      case Y:
        return "SuspenseList";
    }
    if (typeof b == "object") switch (b.$$typeof) {
      case j:
        return (b.displayName || "Context") + ".Consumer";
      case H:
        return (b._context.displayName || "Context") + ".Provider";
      case K:
        var y = b.render;
        return b = b.displayName, b || (b = y.displayName || y.name || "", b = b !== "" ? "ForwardRef(" + b + ")" : "ForwardRef"), b;
      case G:
        return y = b.displayName || null, y !== null ? y : st(b.type) || "Memo";
      case Q:
        y = b._payload, b = b._init;
        try {
          return st(b(y));
        } catch {
        }
    }
    return null;
  }
  function ot(b) {
    var y = b.type;
    switch (b.tag) {
      case 24:
        return "Cache";
      case 9:
        return (y.displayName || "Context") + ".Consumer";
      case 10:
        return (y._context.displayName || "Context") + ".Provider";
      case 18:
        return "DehydratedFragment";
      case 11:
        return b = y.render, b = b.displayName || b.name || "", y.displayName || (b !== "" ? "ForwardRef(" + b + ")" : "ForwardRef");
      case 7:
        return "Fragment";
      case 5:
        return y;
      case 4:
        return "Portal";
      case 3:
        return "Root";
      case 6:
        return "Text";
      case 16:
        return st(y);
      case 8:
        return y === M ? "StrictMode" : "Mode";
      case 22:
        return "Offscreen";
      case 12:
        return "Profiler";
      case 21:
        return "Scope";
      case 13:
        return "Suspense";
      case 19:
        return "SuspenseList";
      case 25:
        return "TracingMarker";
      case 1:
      case 0:
      case 17:
      case 2:
      case 14:
      case 15:
        if (typeof y == "function") return y.displayName || y.name || null;
        if (typeof y == "string") return y;
    }
    return null;
  }
  function et(b) {
    switch (typeof b) {
      case "boolean":
      case "number":
      case "string":
      case "undefined":
        return b;
      case "object":
        return b;
      default:
        return "";
    }
  }
  function at(b) {
    var y = b.type;
    return (b = b.nodeName) && b.toLowerCase() === "input" && (y === "checkbox" || y === "radio");
  }
  function en(b) {
    var y = at(b) ? "checked" : "value", k = Object.getOwnPropertyDescriptor(b.constructor.prototype, y), A = "" + b[y];
    if (!b.hasOwnProperty(y) && typeof k < "u" && typeof k.get == "function" && typeof k.set == "function") {
      var F = k.get, U = k.set;
      return Object.defineProperty(b, y, { configurable: !0, get: function() {
        return F.call(this);
      }, set: function(le) {
        A = "" + le, U.call(this, le);
      } }), Object.defineProperty(b, y, { enumerable: k.enumerable }), { getValue: function() {
        return A;
      }, setValue: function(le) {
        A = "" + le;
      }, stopTracking: function() {
        b._valueTracker = null, delete b[y];
      } };
    }
  }
  function sn(b) {
    b._valueTracker || (b._valueTracker = en(b));
  }
  function Vt(b) {
    if (!b) return !1;
    var y = b._valueTracker;
    if (!y) return !0;
    var k = y.getValue(), A = "";
    return b && (A = at(b) ? b.checked ? "true" : "false" : b.value), b = A, b !== k ? (y.setValue(b), !0) : !1;
  }
  function Bi(b) {
    if (b = b || (typeof document < "u" ? document : void 0), typeof b > "u") return null;
    try {
      return b.activeElement || b.body;
    } catch {
      return b.body;
    }
  }
  function pi(b, y) {
    var k = y.checked;
    return J({}, y, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: k ?? b._wrapperState.initialChecked });
  }
  function tn(b, y) {
    var k = y.defaultValue == null ? "" : y.defaultValue, A = y.checked != null ? y.checked : y.defaultChecked;
    k = et(y.value != null ? y.value : k), b._wrapperState = { initialChecked: A, initialValue: k, controlled: y.type === "checkbox" || y.type === "radio" ? y.checked != null : y.value != null };
  }
  function Vr(b, y) {
    y = y.checked, y != null && L(b, "checked", y, !1);
  }
  function tr(b, y) {
    Vr(b, y);
    var k = et(y.value), A = y.type;
    if (k != null) A === "number" ? (k === 0 && b.value === "" || b.value != k) && (b.value = "" + k) : b.value !== "" + k && (b.value = "" + k);
    else if (A === "submit" || A === "reset") {
      b.removeAttribute("value");
      return;
    }
    y.hasOwnProperty("value") ? Bs(b, y.type, k) : y.hasOwnProperty("defaultValue") && Bs(b, y.type, et(y.defaultValue)), y.checked == null && y.defaultChecked != null && (b.defaultChecked = !!y.defaultChecked);
  }
  function qr(b, y, k) {
    if (y.hasOwnProperty("value") || y.hasOwnProperty("defaultValue")) {
      var A = y.type;
      if (!(A !== "submit" && A !== "reset" || y.value !== void 0 && y.value !== null)) return;
      y = "" + b._wrapperState.initialValue, k || y === b.value || (b.value = y), b.defaultValue = y;
    }
    k = b.name, k !== "" && (b.name = ""), b.defaultChecked = !!b._wrapperState.initialChecked, k !== "" && (b.name = k);
  }
  function Bs(b, y, k) {
    (y !== "number" || Bi(b.ownerDocument) !== b) && (k == null ? b.defaultValue = "" + b._wrapperState.initialValue : b.defaultValue !== "" + k && (b.defaultValue = "" + k));
  }
  var Ts = Array.isArray;
  function ts(b, y, k, A) {
    if (b = b.options, y) {
      y = {};
      for (var F = 0; F < k.length; F++) y["$" + k[F]] = !0;
      for (k = 0; k < b.length; k++) F = y.hasOwnProperty("$" + b[k].value), b[k].selected !== F && (b[k].selected = F), F && A && (b[k].defaultSelected = !0);
    } else {
      for (k = "" + et(k), y = null, F = 0; F < b.length; F++) {
        if (b[F].value === k) {
          b[F].selected = !0, A && (b[F].defaultSelected = !0);
          return;
        }
        y !== null || b[F].disabled || (y = b[F]);
      }
      y !== null && (y.selected = !0);
    }
  }
  function io(b, y) {
    if (y.dangerouslySetInnerHTML != null) throw Error(t(91));
    return J({}, y, { value: void 0, defaultValue: void 0, children: "" + b._wrapperState.initialValue });
  }
  function nr(b, y) {
    var k = y.value;
    if (k == null) {
      if (k = y.children, y = y.defaultValue, k != null) {
        if (y != null) throw Error(t(92));
        if (Ts(k)) {
          if (1 < k.length) throw Error(t(93));
          k = k[0];
        }
        y = k;
      }
      y == null && (y = ""), k = y;
    }
    b._wrapperState = { initialValue: et(k) };
  }
  function _s(b, y) {
    var k = et(y.value), A = et(y.defaultValue);
    k != null && (k = "" + k, k !== b.value && (b.value = k), y.defaultValue == null && b.defaultValue !== k && (b.defaultValue = k)), A != null && (b.defaultValue = "" + A);
  }
  function Hs(b) {
    var y = b.textContent;
    y === b._wrapperState.initialValue && y !== "" && y !== null && (b.value = y);
  }
  function He(b) {
    switch (b) {
      case "svg":
        return "http://www.w3.org/2000/svg";
      case "math":
        return "http://www.w3.org/1998/Math/MathML";
      default:
        return "http://www.w3.org/1999/xhtml";
    }
  }
  function yt(b, y) {
    return b == null || b === "http://www.w3.org/1999/xhtml" ? He(y) : b === "http://www.w3.org/2000/svg" && y === "foreignObject" ? "http://www.w3.org/1999/xhtml" : b;
  }
  var Ln, oi = (function(b) {
    return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(y, k, A, F) {
      MSApp.execUnsafeLocalFunction(function() {
        return b(y, k, A, F);
      });
    } : b;
  })(function(b, y) {
    if (b.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in b) b.innerHTML = y;
    else {
      for (Ln = Ln || document.createElement("div"), Ln.innerHTML = "<svg>" + y.valueOf().toString() + "</svg>", y = Ln.firstChild; b.firstChild; ) b.removeChild(b.firstChild);
      for (; y.firstChild; ) b.appendChild(y.firstChild);
    }
  });
  function vi(b, y) {
    if (y) {
      var k = b.firstChild;
      if (k && k === b.lastChild && k.nodeType === 3) {
        k.nodeValue = y;
        return;
      }
    }
    b.textContent = y;
  }
  var Dt = {
    animationIterationCount: !0,
    aspectRatio: !0,
    borderImageOutset: !0,
    borderImageSlice: !0,
    borderImageWidth: !0,
    boxFlex: !0,
    boxFlexGroup: !0,
    boxOrdinalGroup: !0,
    columnCount: !0,
    columns: !0,
    flex: !0,
    flexGrow: !0,
    flexPositive: !0,
    flexShrink: !0,
    flexNegative: !0,
    flexOrder: !0,
    gridArea: !0,
    gridRow: !0,
    gridRowEnd: !0,
    gridRowSpan: !0,
    gridRowStart: !0,
    gridColumn: !0,
    gridColumnEnd: !0,
    gridColumnSpan: !0,
    gridColumnStart: !0,
    fontWeight: !0,
    lineClamp: !0,
    lineHeight: !0,
    opacity: !0,
    order: !0,
    orphans: !0,
    tabSize: !0,
    widows: !0,
    zIndex: !0,
    zoom: !0,
    fillOpacity: !0,
    floodOpacity: !0,
    stopOpacity: !0,
    strokeDasharray: !0,
    strokeDashoffset: !0,
    strokeMiterlimit: !0,
    strokeOpacity: !0,
    strokeWidth: !0
  }, cn = ["Webkit", "ms", "Moz", "O"];
  Object.keys(Dt).forEach(function(b) {
    cn.forEach(function(y) {
      y = y + b.charAt(0).toUpperCase() + b.substring(1), Dt[y] = Dt[b];
    });
  });
  function En(b, y, k) {
    return y == null || typeof y == "boolean" || y === "" ? "" : k || typeof y != "number" || y === 0 || Dt.hasOwnProperty(b) && Dt[b] ? ("" + y).trim() : y + "px";
  }
  function ii(b, y) {
    b = b.style;
    for (var k in y) if (y.hasOwnProperty(k)) {
      var A = k.indexOf("--") === 0, F = En(k, y[k], A);
      k === "float" && (k = "cssFloat"), A ? b.setProperty(k, F) : b[k] = F;
    }
  }
  var li = J({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 });
  function lt(b, y) {
    if (y) {
      if (li[b] && (y.children != null || y.dangerouslySetInnerHTML != null)) throw Error(t(137, b));
      if (y.dangerouslySetInnerHTML != null) {
        if (y.children != null) throw Error(t(60));
        if (typeof y.dangerouslySetInnerHTML != "object" || !("__html" in y.dangerouslySetInnerHTML)) throw Error(t(61));
      }
      if (y.style != null && typeof y.style != "object") throw Error(t(62));
    }
  }
  function Bt(b, y) {
    if (b.indexOf("-") === -1) return typeof y.is == "string";
    switch (b) {
      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 Mn = null;
  function gn(b) {
    return b = b.target || b.srcElement || window, b.correspondingUseElement && (b = b.correspondingUseElement), b.nodeType === 3 ? b.parentNode : b;
  }
  var yi = null, Ni = null, qi = null;
  function Ur(b) {
    if (b = sS(b)) {
      if (typeof yi != "function") throw Error(t(280));
      var y = b.stateNode;
      y && (y = cp(y), yi(b.stateNode, b.type, y));
    }
  }
  function Ws(b) {
    Ni ? qi ? qi.push(b) : qi = [b] : Ni = b;
  }
  function El() {
    if (Ni) {
      var b = Ni, y = qi;
      if (qi = Ni = null, Ur(b), y) for (b = 0; b < y.length; b++) Ur(y[b]);
    }
  }
  function Ri(b, y) {
    return b(y);
  }
  function So() {
  }
  var va = !1;
  function xl(b, y, k) {
    if (va) return b(y, k);
    va = !0;
    try {
      return Ri(b, y, k);
    } finally {
      va = !1, (Ni !== null || qi !== null) && (So(), El());
    }
  }
  function ya(b, y) {
    var k = b.stateNode;
    if (k === null) return null;
    var A = cp(k);
    if (A === null) return null;
    k = A[y];
    e: switch (y) {
      case "onClick":
      case "onClickCapture":
      case "onDoubleClick":
      case "onDoubleClickCapture":
      case "onMouseDown":
      case "onMouseDownCapture":
      case "onMouseMove":
      case "onMouseMoveCapture":
      case "onMouseUp":
      case "onMouseUpCapture":
      case "onMouseEnter":
        (A = !A.disabled) || (b = b.type, A = !(b === "button" || b === "input" || b === "select" || b === "textarea")), b = !A;
        break e;
      default:
        b = !1;
    }
    if (b) return null;
    if (k && typeof k != "function") throw Error(t(231, y, typeof k));
    return k;
  }
  var ro = !1;
  if (a) try {
    var Eo = {};
    Object.defineProperty(Eo, "passive", { get: function() {
      ro = !0;
    } }), window.addEventListener("test", Eo, Eo), window.removeEventListener("test", Eo, Eo);
  } catch {
    ro = !1;
  }
  function po(b, y, k, A, F, U, le, we, Te) {
    var it = Array.prototype.slice.call(arguments, 3);
    try {
      y.apply(k, it);
    } catch (It) {
      this.onError(It);
    }
  }
  var bs = !1, na = null, sc = !1, Rc = null, xe = { onError: function(b) {
    bs = !0, na = b;
  } };
  function mt(b, y, k, A, F, U, le, we, Te) {
    bs = !1, na = null, po.apply(xe, arguments);
  }
  function jt(b, y, k, A, F, U, le, we, Te) {
    if (mt.apply(this, arguments), bs) {
      if (bs) {
        var it = na;
        bs = !1, na = null;
      } else throw Error(t(198));
      sc || (sc = !0, Rc = it);
    }
  }
  function nn(b) {
    var y = b, k = b;
    if (b.alternate) for (; y.return; ) y = y.return;
    else {
      b = y;
      do
        y = b, (y.flags & 4098) !== 0 && (k = y.return), b = y.return;
      while (b);
    }
    return y.tag === 3 ? k : null;
  }
  function Wi(b) {
    if (b.tag === 13) {
      var y = b.memoizedState;
      if (y === null && (b = b.alternate, b !== null && (y = b.memoizedState)), y !== null) return y.dehydrated;
    }
    return null;
  }
  function fi(b) {
    if (nn(b) !== b) throw Error(t(188));
  }
  function Ki(b) {
    var y = b.alternate;
    if (!y) {
      if (y = nn(b), y === null) throw Error(t(188));
      return y !== b ? null : b;
    }
    for (var k = b, A = y; ; ) {
      var F = k.return;
      if (F === null) break;
      var U = F.alternate;
      if (U === null) {
        if (A = F.return, A !== null) {
          k = A;
          continue;
        }
        break;
      }
      if (F.child === U.child) {
        for (U = F.child; U; ) {
          if (U === k) return fi(F), b;
          if (U === A) return fi(F), y;
          U = U.sibling;
        }
        throw Error(t(188));
      }
      if (k.return !== A.return) k = F, A = U;
      else {
        for (var le = !1, we = F.child; we; ) {
          if (we === k) {
            le = !0, k = F, A = U;
            break;
          }
          if (we === A) {
            le = !0, A = F, k = U;
            break;
          }
          we = we.sibling;
        }
        if (!le) {
          for (we = U.child; we; ) {
            if (we === k) {
              le = !0, k = U, A = F;
              break;
            }
            if (we === A) {
              le = !0, A = U, k = F;
              break;
            }
            we = we.sibling;
          }
          if (!le) throw Error(t(189));
        }
      }
      if (k.alternate !== A) throw Error(t(190));
    }
    if (k.tag !== 3) throw Error(t(188));
    return k.stateNode.current === k ? b : y;
  }
  function Nt(b) {
    return b = Ki(b), b !== null ? ve(b) : null;
  }
  function ve(b) {
    if (b.tag === 5 || b.tag === 6) return b;
    for (b = b.child; b !== null; ) {
      var y = ve(b);
      if (y !== null) return y;
      b = b.sibling;
    }
    return null;
  }
  var fe = e.unstable_scheduleCallback, Be = e.unstable_cancelCallback, Lt = e.unstable_shouldYield, ci = e.unstable_requestPaint, kn = e.unstable_now, qn = e.unstable_getCurrentPriorityLevel, bn = e.unstable_ImmediatePriority, mo = e.unstable_UserBlockingPriority, ns = e.unstable_NormalPriority, tf = e.unstable_LowPriority, vs = e.unstable_IdlePriority, nf = null, Ll = null;
  function Bw(b) {
    if (Ll && typeof Ll.onCommitFiberRoot == "function") try {
      Ll.onCommitFiberRoot(nf, b, void 0, (b.current.flags & 128) === 128);
    } catch {
    }
  }
  var Ac = Math.clz32 ? Math.clz32 : wk, Hw = Math.log, Ck = Math.LN2;
  function wk(b) {
    return b >>>= 0, b === 0 ? 32 : 31 - (Hw(b) / Ck | 0) | 0;
  }
  var tp = 64, Tm = 4194304;
  function vu(b) {
    switch (b & -b) {
      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:
      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 b & 4194240;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
      case 67108864:
        return b & 130023424;
      case 134217728:
        return 134217728;
      case 268435456:
        return 268435456;
      case 536870912:
        return 536870912;
      case 1073741824:
        return 1073741824;
      default:
        return b;
    }
  }
  function sg(b, y) {
    var k = b.pendingLanes;
    if (k === 0) return 0;
    var A = 0, F = b.suspendedLanes, U = b.pingedLanes, le = k & 268435455;
    if (le !== 0) {
      var we = le & ~F;
      we !== 0 ? A = vu(we) : (U &= le, U !== 0 && (A = vu(U)));
    } else le = k & ~F, le !== 0 ? A = vu(le) : U !== 0 && (A = vu(U));
    if (A === 0) return 0;
    if (y !== 0 && y !== A && (y & F) === 0 && (F = A & -A, U = y & -y, F >= U || F === 16 && (U & 4194240) !== 0)) return y;
    if ((A & 4) !== 0 && (A |= k & 16), y = b.entangledLanes, y !== 0) for (b = b.entanglements, y &= A; 0 < y; ) k = 31 - Ac(y), F = 1 << k, A |= b[k], y &= ~F;
    return A;
  }
  function km(b, y) {
    switch (b) {
      case 1:
      case 2:
      case 4:
        return y + 250;
      case 8:
      case 16:
      case 32:
      case 64:
      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 y + 5e3;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
      case 67108864:
        return -1;
      case 134217728:
      case 268435456:
      case 536870912:
      case 1073741824:
        return -1;
      default:
        return -1;
    }
  }
  function y0(b, y) {
    for (var k = b.suspendedLanes, A = b.pingedLanes, F = b.expirationTimes, U = b.pendingLanes; 0 < U; ) {
      var le = 31 - Ac(U), we = 1 << le, Te = F[le];
      Te === -1 ? ((we & k) === 0 || (we & A) !== 0) && (F[le] = km(we, y)) : Te <= y && (b.expiredLanes |= we), U &= ~we;
    }
  }
  function np(b) {
    return b = b.pendingLanes & -1073741825, b !== 0 ? b : b & 1073741824 ? 1073741824 : 0;
  }
  function Hb() {
    var b = tp;
    return tp <<= 1, (tp & 4194240) === 0 && (tp = 64), b;
  }
  function Wb(b) {
    for (var y = [], k = 0; 31 > k; k++) y.push(b);
    return y;
  }
  function Dm(b, y, k) {
    b.pendingLanes |= y, y !== 536870912 && (b.suspendedLanes = 0, b.pingedLanes = 0), b = b.eventTimes, y = 31 - Ac(y), b[y] = k;
  }
  function Ww(b, y) {
    var k = b.pendingLanes & ~y;
    b.pendingLanes = y, b.suspendedLanes = 0, b.pingedLanes = 0, b.expiredLanes &= y, b.mutableReadLanes &= y, b.entangledLanes &= y, y = b.entanglements;
    var A = b.eventTimes;
    for (b = b.expirationTimes; 0 < k; ) {
      var F = 31 - Ac(k), U = 1 << F;
      y[F] = 0, A[F] = -1, b[F] = -1, k &= ~U;
    }
  }
  function Vw(b, y) {
    var k = b.entangledLanes |= y;
    for (b = b.entanglements; k; ) {
      var A = 31 - Ac(k), F = 1 << A;
      F & y | b[A] & y && (b[A] |= y), k &= ~F;
    }
  }
  var Nr = 0;
  function Uw(b) {
    return b &= -b, 1 < b ? 4 < b ? (b & 268435455) !== 0 ? 16 : 536870912 : 4 : 1;
  }
  var C0, Rr, Sk, og, Ai, Vb = !1, el = [], yu = null, Oc = null, ag = null, Go = /* @__PURE__ */ new Map(), Vs = /* @__PURE__ */ new Map(), rf = [], Zd = "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 submit".split(" ");
  function oc(b, y) {
    switch (b) {
      case "focusin":
      case "focusout":
        yu = null;
        break;
      case "dragenter":
      case "dragleave":
        Oc = null;
        break;
      case "mouseover":
      case "mouseout":
        ag = null;
        break;
      case "pointerover":
      case "pointerout":
        Go.delete(y.pointerId);
        break;
      case "gotpointercapture":
      case "lostpointercapture":
        Vs.delete(y.pointerId);
    }
  }
  function Mc(b, y, k, A, F, U) {
    return b === null || b.nativeEvent !== U ? (b = { blockedOn: y, domEventName: k, eventSystemFlags: A, nativeEvent: U, targetContainers: [F] }, y !== null && (y = sS(y), y !== null && Rr(y)), b) : (b.eventSystemFlags |= A, y = b.targetContainers, F !== null && y.indexOf(F) === -1 && y.push(F), b);
  }
  function A2(b, y, k, A, F) {
    switch (y) {
      case "focusin":
        return yu = Mc(yu, b, y, k, A, F), !0;
      case "dragenter":
        return Oc = Mc(Oc, b, y, k, A, F), !0;
      case "mouseover":
        return ag = Mc(ag, b, y, k, A, F), !0;
      case "pointerover":
        var U = F.pointerId;
        return Go.set(U, Mc(Go.get(U) || null, b, y, k, A, F)), !0;
      case "gotpointercapture":
        return U = F.pointerId, Vs.set(U, Mc(Vs.get(U) || null, b, y, k, A, F)), !0;
    }
    return !1;
  }
  function w0(b) {
    var y = Xb(b.target);
    if (y !== null) {
      var k = nn(y);
      if (k !== null) {
        if (y = k.tag, y === 13) {
          if (y = Wi(k), y !== null) {
            b.blockedOn = y, Ai(b.priority, function() {
              Sk(k);
            });
            return;
          }
        } else if (y === 3 && k.stateNode.current.memoizedState.isDehydrated) {
          b.blockedOn = k.tag === 3 ? k.stateNode.containerInfo : null;
          return;
        }
      }
    }
    b.blockedOn = null;
  }
  function Ub(b) {
    if (b.blockedOn !== null) return !1;
    for (var y = b.targetContainers; 0 < y.length; ) {
      var k = L0(b.domEventName, b.eventSystemFlags, y[0], b.nativeEvent);
      if (k === null) {
        k = b.nativeEvent;
        var A = new k.constructor(k.type, k);
        Mn = A, k.target.dispatchEvent(A), Mn = null;
      } else return y = sS(k), y !== null && Rr(y), b.blockedOn = k, !1;
      y.shift();
    }
    return !0;
  }
  function S0(b, y, k) {
    Ub(b) && k.delete(y);
  }
  function E0() {
    Vb = !1, yu !== null && Ub(yu) && (yu = null), Oc !== null && Ub(Oc) && (Oc = null), ag !== null && Ub(ag) && (ag = null), Go.forEach(S0), Vs.forEach(S0);
  }
  function zb(b, y) {
    b.blockedOn === y && (b.blockedOn = null, Vb || (Vb = !0, e.unstable_scheduleCallback(e.unstable_NormalPriority, E0)));
  }
  function Qd(b) {
    function y(F) {
      return zb(F, b);
    }
    if (0 < el.length) {
      zb(el[0], b);
      for (var k = 1; k < el.length; k++) {
        var A = el[k];
        A.blockedOn === b && (A.blockedOn = null);
      }
    }
    for (yu !== null && zb(yu, b), Oc !== null && zb(Oc, b), ag !== null && zb(ag, b), Go.forEach(y), Vs.forEach(y), k = 0; k < rf.length; k++) A = rf[k], A.blockedOn === b && (A.blockedOn = null);
    for (; 0 < rf.length && (k = rf[0], k.blockedOn === null); ) w0(k), k.blockedOn === null && rf.shift();
  }
  var Jd = T.ReactCurrentBatchConfig, Im = !0;
  function ip(b, y, k, A) {
    var F = Nr, U = Jd.transition;
    Jd.transition = null;
    try {
      Nr = 1, Nm(b, y, k, A);
    } finally {
      Nr = F, Jd.transition = U;
    }
  }
  function x0(b, y, k, A) {
    var F = Nr, U = Jd.transition;
    Jd.transition = null;
    try {
      Nr = 4, Nm(b, y, k, A);
    } finally {
      Nr = F, Jd.transition = U;
    }
  }
  function Nm(b, y, k, A) {
    if (Im) {
      var F = L0(b, y, k, A);
      if (F === null) G2(b, y, A, rp, k), oc(b, A);
      else if (A2(F, b, y, k, A)) A.stopPropagation();
      else if (oc(b, A), y & 4 && -1 < Zd.indexOf(b)) {
        for (; F !== null; ) {
          var U = sS(F);
          if (U !== null && C0(U), U = L0(b, y, k, A), U === null && G2(b, y, A, rp, k), U === F) break;
          F = U;
        }
        F !== null && A.stopPropagation();
      } else G2(b, y, A, null, k);
    }
  }
  var rp = null;
  function L0(b, y, k, A) {
    if (rp = null, b = gn(A), b = Xb(b), b !== null) if (y = nn(b), y === null) b = null;
    else if (k = y.tag, k === 13) {
      if (b = Wi(y), b !== null) return b;
      b = null;
    } else if (k === 3) {
      if (y.stateNode.current.memoizedState.isDehydrated) return y.tag === 3 ? y.stateNode.containerInfo : null;
      b = null;
    } else y !== b && (b = null);
    return rp = b, null;
  }
  function zw(b) {
    switch (b) {
      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 "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 1;
      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 "toggle":
      case "touchmove":
      case "wheel":
      case "mouseenter":
      case "mouseleave":
      case "pointerenter":
      case "pointerleave":
        return 4;
      case "message":
        switch (qn()) {
          case bn:
            return 1;
          case mo:
            return 4;
          case ns:
          case tf:
            return 16;
          case vs:
            return 536870912;
          default:
            return 16;
        }
      default:
        return 16;
    }
  }
  var eh = null, T0 = null, ne = null;
  function Le() {
    if (ne) return ne;
    var b, y = T0, k = y.length, A, F = "value" in eh ? eh.value : eh.textContent, U = F.length;
    for (b = 0; b < k && y[b] === F[b]; b++) ;
    var le = k - b;
    for (A = 1; A <= le && y[k - A] === F[U - A]; A++) ;
    return ne = F.slice(b, 1 < A ? 1 - A : void 0);
  }
  function tt(b) {
    var y = b.keyCode;
    return "charCode" in b ? (b = b.charCode, b === 0 && y === 13 && (b = 13)) : b = y, b === 10 && (b = 13), 32 <= b || b === 13 ? b : 0;
  }
  function dt() {
    return !0;
  }
  function Gt() {
    return !1;
  }
  function In(b) {
    function y(k, A, F, U, le) {
      this._reactName = k, this._targetInst = F, this.type = A, this.nativeEvent = U, this.target = le, this.currentTarget = null;
      for (var we in b) b.hasOwnProperty(we) && (k = b[we], this[we] = k ? k(U) : U[we]);
      return this.isDefaultPrevented = (U.defaultPrevented != null ? U.defaultPrevented : U.returnValue === !1) ? dt : Gt, this.isPropagationStopped = Gt, this;
    }
    return J(y.prototype, { preventDefault: function() {
      this.defaultPrevented = !0;
      var k = this.nativeEvent;
      k && (k.preventDefault ? k.preventDefault() : typeof k.returnValue != "unknown" && (k.returnValue = !1), this.isDefaultPrevented = dt);
    }, stopPropagation: function() {
      var k = this.nativeEvent;
      k && (k.stopPropagation ? k.stopPropagation() : typeof k.cancelBubble != "unknown" && (k.cancelBubble = !0), this.isPropagationStopped = dt);
    }, persist: function() {
    }, isPersistent: dt }), y;
  }
  var vn = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(b) {
    return b.timeStamp || Date.now();
  }, defaultPrevented: 0, isTrusted: 0 }, Ei = In(vn), sr = J({}, vn, { view: 0, detail: 0 }), ys = In(sr), Us, zs, Yi, so = J({}, sr, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: sf, button: 0, buttons: 0, relatedTarget: function(b) {
    return b.relatedTarget === void 0 ? b.fromElement === b.srcElement ? b.toElement : b.fromElement : b.relatedTarget;
  }, movementX: function(b) {
    return "movementX" in b ? b.movementX : (b !== Yi && (Yi && b.type === "mousemove" ? (Us = b.screenX - Yi.screenX, zs = b.screenY - Yi.screenY) : zs = Us = 0, Yi = b), Us);
  }, movementY: function(b) {
    return "movementY" in b ? b.movementY : zs;
  } }), ia = In(so), $b = J({}, so, { dataTransfer: 0 }), $w = In($b), sp = J({}, sr, { relatedTarget: 0 }), jb = In(sp), jw = J({}, vn, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), O2 = In(jw), Ek = J({}, vn, { clipboardData: function(b) {
    return "clipboardData" in b ? b.clipboardData : window.clipboardData;
  } }), M2 = In(Ek), T6 = J({}, vn, { data: 0 }), xk = In(T6), k6 = {
    Esc: "Escape",
    Spacebar: " ",
    Left: "ArrowLeft",
    Up: "ArrowUp",
    Right: "ArrowRight",
    Down: "ArrowDown",
    Del: "Delete",
    Win: "OS",
    Menu: "ContextMenu",
    Apps: "ContextMenu",
    Scroll: "ScrollLock",
    MozPrintableKey: "Unidentified"
  }, D6 = {
    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"
  }, I6 = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
  function rX(b) {
    var y = this.nativeEvent;
    return y.getModifierState ? y.getModifierState(b) : (b = I6[b]) ? !!y[b] : !1;
  }
  function sf() {
    return rX;
  }
  var sX = J({}, sr, { key: function(b) {
    if (b.key) {
      var y = k6[b.key] || b.key;
      if (y !== "Unidentified") return y;
    }
    return b.type === "keypress" ? (b = tt(b), b === 13 ? "Enter" : String.fromCharCode(b)) : b.type === "keydown" || b.type === "keyup" ? D6[b.keyCode] || "Unidentified" : "";
  }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: sf, charCode: function(b) {
    return b.type === "keypress" ? tt(b) : 0;
  }, keyCode: function(b) {
    return b.type === "keydown" || b.type === "keyup" ? b.keyCode : 0;
  }, which: function(b) {
    return b.type === "keypress" ? tt(b) : b.type === "keydown" || b.type === "keyup" ? b.keyCode : 0;
  } }), P2 = In(sX), F2 = J({}, so, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Lk = In(F2), oX = J({}, sr, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: sf }), Tk = In(oX), N6 = J({}, vn, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Cu = In(N6), op = J({}, so, {
    deltaX: function(b) {
      return "deltaX" in b ? b.deltaX : "wheelDeltaX" in b ? -b.wheelDeltaX : 0;
    },
    deltaY: function(b) {
      return "deltaY" in b ? b.deltaY : "wheelDeltaY" in b ? -b.wheelDeltaY : "wheelDelta" in b ? -b.wheelDelta : 0;
    },
    deltaZ: 0,
    deltaMode: 0
  }), Ca = In(op), ap = [9, 13, 27, 32], Gw = a && "CompositionEvent" in window, Rm = null;
  a && "documentMode" in document && (Rm = document.documentMode);
  var aX = a && "TextEvent" in window && !Rm, k0 = a && (!Gw || Rm && 8 < Rm && 11 >= Rm), R6 = " ", A6 = !1;
  function kk(b, y) {
    switch (b) {
      case "keyup":
        return ap.indexOf(y.keyCode) !== -1;
      case "keydown":
        return y.keyCode !== 229;
      case "keypress":
      case "mousedown":
      case "focusout":
        return !0;
      default:
        return !1;
    }
  }
  function O6(b) {
    return b = b.detail, typeof b == "object" && "data" in b ? b.data : null;
  }
  var D0 = !1;
  function lX(b, y) {
    switch (b) {
      case "compositionend":
        return O6(y);
      case "keypress":
        return y.which !== 32 ? null : (A6 = !0, R6);
      case "textInput":
        return b = y.data, b === R6 && A6 ? null : b;
      default:
        return null;
    }
  }
  function M6(b, y) {
    if (D0) return b === "compositionend" || !Gw && kk(b, y) ? (b = Le(), ne = T0 = eh = null, D0 = !1, b) : null;
    switch (b) {
      case "paste":
        return null;
      case "keypress":
        if (!(y.ctrlKey || y.altKey || y.metaKey) || y.ctrlKey && y.altKey) {
          if (y.char && 1 < y.char.length) return y.char;
          if (y.which) return String.fromCharCode(y.which);
        }
        return null;
      case "compositionend":
        return k0 && y.locale !== "ko" ? null : y.data;
      default:
        return null;
    }
  }
  var cX = { 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 P6(b) {
    var y = b && b.nodeName && b.nodeName.toLowerCase();
    return y === "input" ? !!cX[b.type] : y === "textarea";
  }
  function F6(b, y, k, A) {
    Ws(A), y = nS(y, "onChange"), 0 < y.length && (k = new Ei("onChange", "change", null, k, A), b.push({ event: k, listeners: y }));
  }
  var I0 = null, lg = null;
  function B2(b) {
    Rk(b, 0);
  }
  function qw(b) {
    var y = Jn(b);
    if (Vt(y)) return b;
  }
  function B6(b, y) {
    if (b === "change") return y;
  }
  var H6 = !1;
  if (a) {
    var H2;
    if (a) {
      var W2 = "oninput" in document;
      if (!W2) {
        var W6 = document.createElement("div");
        W6.setAttribute("oninput", "return;"), W2 = typeof W6.oninput == "function";
      }
      H2 = W2;
    } else H2 = !1;
    H6 = H2 && (!document.documentMode || 9 < document.documentMode);
  }
  function V6() {
    I0 && (I0.detachEvent("onpropertychange", U6), lg = I0 = null);
  }
  function U6(b) {
    if (b.propertyName === "value" && qw(lg)) {
      var y = [];
      F6(y, lg, b, gn(b)), xl(B2, y);
    }
  }
  function uX(b, y, k) {
    b === "focusin" ? (V6(), I0 = y, lg = k, I0.attachEvent("onpropertychange", U6)) : b === "focusout" && V6();
  }
  function dX(b) {
    if (b === "selectionchange" || b === "keyup" || b === "keydown") return qw(lg);
  }
  function z6(b, y) {
    if (b === "click") return qw(y);
  }
  function hX(b, y) {
    if (b === "input" || b === "change") return qw(y);
  }
  function $6(b, y) {
    return b === y && (b !== 0 || 1 / b === 1 / y) || b !== b && y !== y;
  }
  var of = typeof Object.is == "function" ? Object.is : $6;
  function Kw(b, y) {
    if (of(b, y)) return !0;
    if (typeof b != "object" || b === null || typeof y != "object" || y === null) return !1;
    var k = Object.keys(b), A = Object.keys(y);
    if (k.length !== A.length) return !1;
    for (A = 0; A < k.length; A++) {
      var F = k[A];
      if (!l.call(y, F) || !of(b[F], y[F])) return !1;
    }
    return !0;
  }
  function j6(b) {
    for (; b && b.firstChild; ) b = b.firstChild;
    return b;
  }
  function G6(b, y) {
    var k = j6(b);
    b = 0;
    for (var A; k; ) {
      if (k.nodeType === 3) {
        if (A = b + k.textContent.length, b <= y && A >= y) return { node: k, offset: y - b };
        b = A;
      }
      e: {
        for (; k; ) {
          if (k.nextSibling) {
            k = k.nextSibling;
            break e;
          }
          k = k.parentNode;
        }
        k = void 0;
      }
      k = j6(k);
    }
  }
  function Dk(b, y) {
    return b && y ? b === y ? !0 : b && b.nodeType === 3 ? !1 : y && y.nodeType === 3 ? Dk(b, y.parentNode) : "contains" in b ? b.contains(y) : b.compareDocumentPosition ? !!(b.compareDocumentPosition(y) & 16) : !1 : !1;
  }
  function Am() {
    for (var b = window, y = Bi(); y instanceof b.HTMLIFrameElement; ) {
      try {
        var k = typeof y.contentWindow.location.href == "string";
      } catch {
        k = !1;
      }
      if (k) b = y.contentWindow;
      else break;
      y = Bi(b.document);
    }
    return y;
  }
  function N0(b) {
    var y = b && b.nodeName && b.nodeName.toLowerCase();
    return y && (y === "input" && (b.type === "text" || b.type === "search" || b.type === "tel" || b.type === "url" || b.type === "password") || y === "textarea" || b.contentEditable === "true");
  }
  function q6(b) {
    var y = Am(), k = b.focusedElem, A = b.selectionRange;
    if (y !== k && k && k.ownerDocument && Dk(k.ownerDocument.documentElement, k)) {
      if (A !== null && N0(k)) {
        if (y = A.start, b = A.end, b === void 0 && (b = y), "selectionStart" in k) k.selectionStart = y, k.selectionEnd = Math.min(b, k.value.length);
        else if (b = (y = k.ownerDocument || document) && y.defaultView || window, b.getSelection) {
          b = b.getSelection();
          var F = k.textContent.length, U = Math.min(A.start, F);
          A = A.end === void 0 ? U : Math.min(A.end, F), !b.extend && U > A && (F = A, A = U, U = F), F = G6(k, U);
          var le = G6(
            k,
            A
          );
          F && le && (b.rangeCount !== 1 || b.anchorNode !== F.node || b.anchorOffset !== F.offset || b.focusNode !== le.node || b.focusOffset !== le.offset) && (y = y.createRange(), y.setStart(F.node, F.offset), b.removeAllRanges(), U > A ? (b.addRange(y), b.extend(le.node, le.offset)) : (y.setEnd(le.node, le.offset), b.addRange(y)));
        }
      }
      for (y = [], b = k; b = b.parentNode; ) b.nodeType === 1 && y.push({ element: b, left: b.scrollLeft, top: b.scrollTop });
      for (typeof k.focus == "function" && k.focus(), k = 0; k < y.length; k++) b = y[k], b.element.scrollLeft = b.left, b.element.scrollTop = b.top;
    }
  }
  var R0 = a && "documentMode" in document && 11 >= document.documentMode, A0 = null, V2 = null, Yw = null, U2 = !1;
  function K6(b, y, k) {
    var A = k.window === k ? k.document : k.nodeType === 9 ? k : k.ownerDocument;
    U2 || A0 == null || A0 !== Bi(A) || (A = A0, "selectionStart" in A && N0(A) ? A = { start: A.selectionStart, end: A.selectionEnd } : (A = (A.ownerDocument && A.ownerDocument.defaultView || window).getSelection(), A = { anchorNode: A.anchorNode, anchorOffset: A.anchorOffset, focusNode: A.focusNode, focusOffset: A.focusOffset }), Yw && Kw(Yw, A) || (Yw = A, A = nS(V2, "onSelect"), 0 < A.length && (y = new Ei("onSelect", "select", null, y, k), b.push({ event: y, listeners: A }), y.target = A0)));
  }
  function Xw(b, y) {
    var k = {};
    return k[b.toLowerCase()] = y.toLowerCase(), k["Webkit" + b] = "webkit" + y, k["Moz" + b] = "moz" + y, k;
  }
  var O0 = { animationend: Xw("Animation", "AnimationEnd"), animationiteration: Xw("Animation", "AnimationIteration"), animationstart: Xw("Animation", "AnimationStart"), transitionend: Xw("Transition", "TransitionEnd") }, Ik = {}, ac = {};
  a && (ac = document.createElement("div").style, "AnimationEvent" in window || (delete O0.animationend.animation, delete O0.animationiteration.animation, delete O0.animationstart.animation), "TransitionEvent" in window || delete O0.transitionend.transition);
  function Zw(b) {
    if (Ik[b]) return Ik[b];
    if (!O0[b]) return b;
    var y = O0[b], k;
    for (k in y) if (y.hasOwnProperty(k) && k in ac) return Ik[b] = y[k];
    return b;
  }
  var Y6 = Zw("animationend"), X6 = Zw("animationiteration"), Z6 = Zw("animationstart"), Q6 = Zw("transitionend"), J6 = /* @__PURE__ */ new Map(), z2 = "abort auxClick 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(" ");
  function cg(b, y) {
    J6.set(b, y), s(y, [b]);
  }
  for (var Gb = 0; Gb < z2.length; Gb++) {
    var $2 = z2[Gb], Qw = $2.toLowerCase(), fX = $2[0].toUpperCase() + $2.slice(1);
    cg(Qw, "on" + fX);
  }
  cg(Y6, "onAnimationEnd"), cg(X6, "onAnimationIteration"), cg(Z6, "onAnimationStart"), cg("dblclick", "onDoubleClick"), cg("focusin", "onFocus"), cg("focusout", "onBlur"), cg(Q6, "onTransitionEnd"), o("onMouseEnter", ["mouseout", "mouseover"]), o("onMouseLeave", ["mouseout", "mouseover"]), o("onPointerEnter", ["pointerout", "pointerover"]), o("onPointerLeave", ["pointerout", "pointerover"]), s("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), s("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), s("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), s("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), s("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), s("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
  var Jw = "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(" "), gX = new Set("cancel close invalid load scroll toggle".split(" ").concat(Jw));
  function Nk(b, y, k) {
    var A = b.type || "unknown-event";
    b.currentTarget = k, jt(A, y, void 0, b), b.currentTarget = null;
  }
  function Rk(b, y) {
    y = (y & 4) !== 0;
    for (var k = 0; k < b.length; k++) {
      var A = b[k], F = A.event;
      A = A.listeners;
      e: {
        var U = void 0;
        if (y) for (var le = A.length - 1; 0 <= le; le--) {
          var we = A[le], Te = we.instance, it = we.currentTarget;
          if (we = we.listener, Te !== U && F.isPropagationStopped()) break e;
          Nk(F, we, it), U = Te;
        }
        else for (le = 0; le < A.length; le++) {
          if (we = A[le], Te = we.instance, it = we.currentTarget, we = we.listener, Te !== U && F.isPropagationStopped()) break e;
          Nk(F, we, it), U = Te;
        }
      }
    }
    if (sc) throw b = Rc, sc = !1, Rc = null, b;
  }
  function Cs(b, y) {
    var k = y[q2];
    k === void 0 && (k = y[q2] = /* @__PURE__ */ new Set());
    var A = b + "__bubble";
    k.has(A) || (j2(y, b, 2, !1), k.add(A));
  }
  function Om(b, y, k) {
    var A = 0;
    y && (A |= 4), j2(k, b, A, y);
  }
  var eS = "_reactListening" + Math.random().toString(36).slice(2);
  function tS(b) {
    if (!b[eS]) {
      b[eS] = !0, n.forEach(function(k) {
        k !== "selectionchange" && (gX.has(k) || Om(k, !1, b), Om(k, !0, b));
      });
      var y = b.nodeType === 9 ? b : b.ownerDocument;
      y === null || y[eS] || (y[eS] = !0, Om("selectionchange", !1, y));
    }
  }
  function j2(b, y, k, A) {
    switch (zw(y)) {
      case 1:
        var F = ip;
        break;
      case 4:
        F = x0;
        break;
      default:
        F = Nm;
    }
    k = F.bind(null, y, k, b), F = void 0, !ro || y !== "touchstart" && y !== "touchmove" && y !== "wheel" || (F = !0), A ? F !== void 0 ? b.addEventListener(y, k, { capture: !0, passive: F }) : b.addEventListener(y, k, !0) : F !== void 0 ? b.addEventListener(y, k, { passive: F }) : b.addEventListener(y, k, !1);
  }
  function G2(b, y, k, A, F) {
    var U = A;
    if ((y & 1) === 0 && (y & 2) === 0 && A !== null) e: for (; ; ) {
      if (A === null) return;
      var le = A.tag;
      if (le === 3 || le === 4) {
        var we = A.stateNode.containerInfo;
        if (we === F || we.nodeType === 8 && we.parentNode === F) break;
        if (le === 4) for (le = A.return; le !== null; ) {
          var Te = le.tag;
          if ((Te === 3 || Te === 4) && (Te = le.stateNode.containerInfo, Te === F || Te.nodeType === 8 && Te.parentNode === F)) return;
          le = le.return;
        }
        for (; we !== null; ) {
          if (le = Xb(we), le === null) return;
          if (Te = le.tag, Te === 5 || Te === 6) {
            A = U = le;
            continue e;
          }
          we = we.parentNode;
        }
      }
      A = A.return;
    }
    xl(function() {
      var it = U, It = gn(k), Mt = [];
      e: {
        var kt = J6.get(b);
        if (kt !== void 0) {
          var yn = Ei, Rn = b;
          switch (b) {
            case "keypress":
              if (tt(k) === 0) break e;
            case "keydown":
            case "keyup":
              yn = P2;
              break;
            case "focusin":
              Rn = "focus", yn = jb;
              break;
            case "focusout":
              Rn = "blur", yn = jb;
              break;
            case "beforeblur":
            case "afterblur":
              yn = jb;
              break;
            case "click":
              if (k.button === 2) break e;
            case "auxclick":
            case "dblclick":
            case "mousedown":
            case "mousemove":
            case "mouseup":
            case "mouseout":
            case "mouseover":
            case "contextmenu":
              yn = ia;
              break;
            case "drag":
            case "dragend":
            case "dragenter":
            case "dragexit":
            case "dragleave":
            case "dragover":
            case "dragstart":
            case "drop":
              yn = $w;
              break;
            case "touchcancel":
            case "touchend":
            case "touchmove":
            case "touchstart":
              yn = Tk;
              break;
            case Y6:
            case X6:
            case Z6:
              yn = O2;
              break;
            case Q6:
              yn = Cu;
              break;
            case "scroll":
              yn = ys;
              break;
            case "wheel":
              yn = Ca;
              break;
            case "copy":
            case "cut":
            case "paste":
              yn = M2;
              break;
            case "gotpointercapture":
            case "lostpointercapture":
            case "pointercancel":
            case "pointerdown":
            case "pointermove":
            case "pointerout":
            case "pointerover":
            case "pointerup":
              yn = Lk;
          }
          var Pn = (y & 4) !== 0, aa = !Pn && b === "scroll", $e = Pn ? kt !== null ? kt + "Capture" : null : kt;
          Pn = [];
          for (var Oe = it, Qe; Oe !== null; ) {
            Qe = Oe;
            var Ut = Qe.stateNode;
            if (Qe.tag === 5 && Ut !== null && (Qe = Ut, $e !== null && (Ut = ya(Oe, $e), Ut != null && Pn.push(M0(Oe, Ut, Qe)))), aa) break;
            Oe = Oe.return;
          }
          0 < Pn.length && (kt = new yn(kt, Rn, null, k, It), Mt.push({ event: kt, listeners: Pn }));
        }
      }
      if ((y & 7) === 0) {
        e: {
          if (kt = b === "mouseover" || b === "pointerover", yn = b === "mouseout" || b === "pointerout", kt && k !== Mn && (Rn = k.relatedTarget || k.fromElement) && (Xb(Rn) || Rn[lp])) break e;
          if ((yn || kt) && (kt = It.window === It ? It : (kt = It.ownerDocument) ? kt.defaultView || kt.parentWindow : window, yn ? (Rn = k.relatedTarget || k.toElement, yn = it, Rn = Rn ? Xb(Rn) : null, Rn !== null && (aa = nn(Rn), Rn !== aa || Rn.tag !== 5 && Rn.tag !== 6) && (Rn = null)) : (yn = null, Rn = it), yn !== Rn)) {
            if (Pn = ia, Ut = "onMouseLeave", $e = "onMouseEnter", Oe = "mouse", (b === "pointerout" || b === "pointerover") && (Pn = Lk, Ut = "onPointerLeave", $e = "onPointerEnter", Oe = "pointer"), aa = yn == null ? kt : Jn(yn), Qe = Rn == null ? kt : Jn(Rn), kt = new Pn(Ut, Oe + "leave", yn, k, It), kt.target = aa, kt.relatedTarget = Qe, Ut = null, Xb(It) === it && (Pn = new Pn($e, Oe + "enter", Rn, k, It), Pn.target = Qe, Pn.relatedTarget = aa, Ut = Pn), aa = Ut, yn && Rn) t: {
              for (Pn = yn, $e = Rn, Oe = 0, Qe = Pn; Qe; Qe = qb(Qe)) Oe++;
              for (Qe = 0, Ut = $e; Ut; Ut = qb(Ut)) Qe++;
              for (; 0 < Oe - Qe; ) Pn = qb(Pn), Oe--;
              for (; 0 < Qe - Oe; ) $e = qb($e), Qe--;
              for (; Oe--; ) {
                if (Pn === $e || $e !== null && Pn === $e.alternate) break t;
                Pn = qb(Pn), $e = qb($e);
              }
              Pn = null;
            }
            else Pn = null;
            yn !== null && Ak(Mt, kt, yn, Pn, !1), Rn !== null && aa !== null && Ak(Mt, aa, Rn, Pn, !0);
          }
        }
        e: {
          if (kt = it ? Jn(it) : window, yn = kt.nodeName && kt.nodeName.toLowerCase(), yn === "select" || yn === "input" && kt.type === "file") var mn = B6;
          else if (P6(kt)) if (H6) mn = hX;
          else {
            mn = dX;
            var ti = uX;
          }
          else (yn = kt.nodeName) && yn.toLowerCase() === "input" && (kt.type === "checkbox" || kt.type === "radio") && (mn = z6);
          if (mn && (mn = mn(b, it))) {
            F6(Mt, mn, k, It);
            break e;
          }
          ti && ti(b, kt, it), b === "focusout" && (ti = kt._wrapperState) && ti.controlled && kt.type === "number" && Bs(kt, "number", kt.value);
        }
        switch (ti = it ? Jn(it) : window, b) {
          case "focusin":
            (P6(ti) || ti.contentEditable === "true") && (A0 = ti, V2 = it, Yw = null);
            break;
          case "focusout":
            Yw = V2 = A0 = null;
            break;
          case "mousedown":
            U2 = !0;
            break;
          case "contextmenu":
          case "mouseup":
          case "dragend":
            U2 = !1, K6(Mt, k, It);
            break;
          case "selectionchange":
            if (R0) break;
          case "keydown":
          case "keyup":
            K6(Mt, k, It);
        }
        var ui;
        if (Gw) e: {
          switch (b) {
            case "compositionstart":
              var Oi = "onCompositionStart";
              break e;
            case "compositionend":
              Oi = "onCompositionEnd";
              break e;
            case "compositionupdate":
              Oi = "onCompositionUpdate";
              break e;
          }
          Oi = void 0;
        }
        else D0 ? kk(b, k) && (Oi = "onCompositionEnd") : b === "keydown" && k.keyCode === 229 && (Oi = "onCompositionStart");
        Oi && (k0 && k.locale !== "ko" && (D0 || Oi !== "onCompositionStart" ? Oi === "onCompositionEnd" && D0 && (ui = Le()) : (eh = It, T0 = "value" in eh ? eh.value : eh.textContent, D0 = !0)), ti = nS(it, Oi), 0 < ti.length && (Oi = new xk(Oi, b, null, k, It), Mt.push({ event: Oi, listeners: ti }), ui ? Oi.data = ui : (ui = O6(k), ui !== null && (Oi.data = ui)))), (ui = aX ? lX(b, k) : M6(b, k)) && (it = nS(it, "onBeforeInput"), 0 < it.length && (It = new xk("onBeforeInput", "beforeinput", null, k, It), Mt.push({ event: It, listeners: it }), It.data = ui));
      }
      Rk(Mt, y);
    });
  }
  function M0(b, y, k) {
    return { instance: b, listener: y, currentTarget: k };
  }
  function nS(b, y) {
    for (var k = y + "Capture", A = []; b !== null; ) {
      var F = b, U = F.stateNode;
      F.tag === 5 && U !== null && (F = U, U = ya(b, k), U != null && A.unshift(M0(b, U, F)), U = ya(b, y), U != null && A.push(M0(b, U, F))), b = b.return;
    }
    return A;
  }
  function qb(b) {
    if (b === null) return null;
    do
      b = b.return;
    while (b && b.tag !== 5);
    return b || null;
  }
  function Ak(b, y, k, A, F) {
    for (var U = y._reactName, le = []; k !== null && k !== A; ) {
      var we = k, Te = we.alternate, it = we.stateNode;
      if (Te !== null && Te === A) break;
      we.tag === 5 && it !== null && (we = it, F ? (Te = ya(k, U), Te != null && le.unshift(M0(k, Te, we))) : F || (Te = ya(k, U), Te != null && le.push(M0(k, Te, we)))), k = k.return;
    }
    le.length !== 0 && b.push({ event: y, listeners: le });
  }
  var pX = /\r\n?/g, e8 = /\u0000|\uFFFD/g;
  function t8(b) {
    return (typeof b == "string" ? b : "" + b).replace(pX, `
`).replace(e8, "");
  }
  function Ok(b, y, k) {
    if (y = t8(y), t8(b) !== y && k) throw Error(t(425));
  }
  function Mk() {
  }
  var Kb = null, iS = null;
  function Yb(b, y) {
    return b === "textarea" || b === "noscript" || typeof y.children == "string" || typeof y.children == "number" || typeof y.dangerouslySetInnerHTML == "object" && y.dangerouslySetInnerHTML !== null && y.dangerouslySetInnerHTML.__html != null;
  }
  var Pk = typeof setTimeout == "function" ? setTimeout : void 0, n8 = typeof clearTimeout == "function" ? clearTimeout : void 0, Fk = typeof Promise == "function" ? Promise : void 0, mX = typeof queueMicrotask == "function" ? queueMicrotask : typeof Fk < "u" ? function(b) {
    return Fk.resolve(null).then(b).catch(P0);
  } : Pk;
  function P0(b) {
    setTimeout(function() {
      throw b;
    });
  }
  function F0(b, y) {
    var k = y, A = 0;
    do {
      var F = k.nextSibling;
      if (b.removeChild(k), F && F.nodeType === 8) if (k = F.data, k === "/$") {
        if (A === 0) {
          b.removeChild(F), Qd(y);
          return;
        }
        A--;
      } else k !== "$" && k !== "$?" && k !== "$!" || A++;
      k = F;
    } while (k);
    Qd(y);
  }
  function af(b) {
    for (; b != null; b = b.nextSibling) {
      var y = b.nodeType;
      if (y === 1 || y === 3) break;
      if (y === 8) {
        if (y = b.data, y === "$" || y === "$!" || y === "$?") break;
        if (y === "/$") return null;
      }
    }
    return b;
  }
  function Bk(b) {
    b = b.previousSibling;
    for (var y = 0; b; ) {
      if (b.nodeType === 8) {
        var k = b.data;
        if (k === "$" || k === "$!" || k === "$?") {
          if (y === 0) return b;
          y--;
        } else k === "/$" && y++;
      }
      b = b.previousSibling;
    }
    return null;
  }
  var B0 = Math.random().toString(36).slice(2), th = "__reactFiber$" + B0, rS = "__reactProps$" + B0, lp = "__reactContainer$" + B0, q2 = "__reactEvents$" + B0, K2 = "__reactListeners$" + B0, H0 = "__reactHandles$" + B0;
  function Xb(b) {
    var y = b[th];
    if (y) return y;
    for (var k = b.parentNode; k; ) {
      if (y = k[lp] || k[th]) {
        if (k = y.alternate, y.child !== null || k !== null && k.child !== null) for (b = Bk(b); b !== null; ) {
          if (k = b[th]) return k;
          b = Bk(b);
        }
        return y;
      }
      b = k, k = b.parentNode;
    }
    return null;
  }
  function sS(b) {
    return b = b[th] || b[lp], !b || b.tag !== 5 && b.tag !== 6 && b.tag !== 13 && b.tag !== 3 ? null : b;
  }
  function Jn(b) {
    if (b.tag === 5 || b.tag === 6) return b.stateNode;
    throw Error(t(33));
  }
  function cp(b) {
    return b[rS] || null;
  }
  var qo = [], _r = -1;
  function wu(b) {
    return { current: b };
  }
  function ks(b) {
    0 > _r || (b.current = qo[_r], qo[_r] = null, _r--);
  }
  function oo(b, y) {
    _r++, qo[_r] = b.current, b.current = y;
  }
  var lr = {}, Ao = wu(lr), wa = wu(!1), nh = lr;
  function dd(b, y) {
    var k = b.type.contextTypes;
    if (!k) return lr;
    var A = b.stateNode;
    if (A && A.__reactInternalMemoizedUnmaskedChildContext === y) return A.__reactInternalMemoizedMaskedChildContext;
    var F = {}, U;
    for (U in k) F[U] = y[U];
    return A && (b = b.stateNode, b.__reactInternalMemoizedUnmaskedChildContext = y, b.__reactInternalMemoizedMaskedChildContext = F), F;
  }
  function Ko(b) {
    return b = b.childContextTypes, b != null;
  }
  function ug() {
    ks(wa), ks(Ao);
  }
  function Hk(b, y, k) {
    if (Ao.current !== lr) throw Error(t(168));
    oo(Ao, y), oo(wa, k);
  }
  function i8(b, y, k) {
    var A = b.stateNode;
    if (y = y.childContextTypes, typeof A.getChildContext != "function") return k;
    A = A.getChildContext();
    for (var F in A) if (!(F in y)) throw Error(t(108, ot(b) || "Unknown", F));
    return J({}, k, A);
  }
  function Zb(b) {
    return b = (b = b.stateNode) && b.__reactInternalMemoizedMergedChildContext || lr, nh = Ao.current, oo(Ao, b), oo(wa, wa.current), !0;
  }
  function lc(b, y, k) {
    var A = b.stateNode;
    if (!A) throw Error(t(169));
    k ? (b = i8(b, y, nh), A.__reactInternalMemoizedMergedChildContext = b, ks(wa), ks(Ao), oo(Ao, b)) : ks(wa), oo(wa, k);
  }
  var lf = null, oS = !1, aS = !1;
  function Mm(b) {
    lf === null ? lf = [b] : lf.push(b);
  }
  function Y2(b) {
    oS = !0, Mm(b);
  }
  function Pc() {
    if (!aS && lf !== null) {
      aS = !0;
      var b = 0, y = Nr;
      try {
        var k = lf;
        for (Nr = 1; b < k.length; b++) {
          var A = k[b];
          do
            A = A(!0);
          while (A !== null);
        }
        lf = null, oS = !1;
      } catch (F) {
        throw lf !== null && (lf = lf.slice(b + 1)), fe(bn, Pc), F;
      } finally {
        Nr = y, aS = !1;
      }
    }
    return null;
  }
  var Pm = [], Fm = 0, W0 = null, Bm = 0, Tl = [], Sa = 0, Qb = null, Fc = 1, dg = "";
  function Hm(b, y) {
    Pm[Fm++] = Bm, Pm[Fm++] = W0, W0 = b, Bm = y;
  }
  function r8(b, y, k) {
    Tl[Sa++] = Fc, Tl[Sa++] = dg, Tl[Sa++] = Qb, Qb = b;
    var A = Fc;
    b = dg;
    var F = 32 - Ac(A) - 1;
    A &= ~(1 << F), k += 1;
    var U = 32 - Ac(y) + F;
    if (30 < U) {
      var le = F - F % 5;
      U = (A & (1 << le) - 1).toString(32), A >>= le, F -= le, Fc = 1 << 32 - Ac(y) + F | k << F | A, dg = U + b;
    } else Fc = 1 << U | k << F | A, dg = b;
  }
  function X2(b) {
    b.return !== null && (Hm(b, 1), r8(b, 1, 0));
  }
  function Wk(b) {
    for (; b === W0; ) W0 = Pm[--Fm], Pm[Fm] = null, Bm = Pm[--Fm], Pm[Fm] = null;
    for (; b === Qb; ) Qb = Tl[--Sa], Tl[Sa] = null, dg = Tl[--Sa], Tl[Sa] = null, Fc = Tl[--Sa], Tl[Sa] = null;
  }
  var Su = null, Eu = null, xo = !1, cf = null;
  function Z2(b, y) {
    var k = ah(5, null, null, 0);
    k.elementType = "DELETED", k.stateNode = y, k.return = b, y = b.deletions, y === null ? (b.deletions = [k], b.flags |= 16) : y.push(k);
  }
  function Q2(b, y) {
    switch (b.tag) {
      case 5:
        var k = b.type;
        return y = y.nodeType !== 1 || k.toLowerCase() !== y.nodeName.toLowerCase() ? null : y, y !== null ? (b.stateNode = y, Su = b, Eu = af(y.firstChild), !0) : !1;
      case 6:
        return y = b.pendingProps === "" || y.nodeType !== 3 ? null : y, y !== null ? (b.stateNode = y, Su = b, Eu = null, !0) : !1;
      case 13:
        return y = y.nodeType !== 8 ? null : y, y !== null ? (k = Qb !== null ? { id: Fc, overflow: dg } : null, b.memoizedState = { dehydrated: y, treeContext: k, retryLane: 1073741824 }, k = ah(18, null, null, 0), k.stateNode = y, k.return = b, b.child = k, Su = b, Eu = null, !0) : !1;
      default:
        return !1;
    }
  }
  function J2(b) {
    return (b.mode & 1) !== 0 && (b.flags & 128) === 0;
  }
  function eO(b) {
    if (xo) {
      var y = Eu;
      if (y) {
        var k = y;
        if (!Q2(b, y)) {
          if (J2(b)) throw Error(t(418));
          y = af(k.nextSibling);
          var A = Su;
          y && Q2(b, y) ? Z2(A, k) : (b.flags = b.flags & -4097 | 2, xo = !1, Su = b);
        }
      } else {
        if (J2(b)) throw Error(t(418));
        b.flags = b.flags & -4097 | 2, xo = !1, Su = b;
      }
    }
  }
  function s8(b) {
    for (b = b.return; b !== null && b.tag !== 5 && b.tag !== 3 && b.tag !== 13; ) b = b.return;
    Su = b;
  }
  function ra(b) {
    if (b !== Su) return !1;
    if (!xo) return s8(b), xo = !0, !1;
    var y;
    if ((y = b.tag !== 3) && !(y = b.tag !== 5) && (y = b.type, y = y !== "head" && y !== "body" && !Yb(b.type, b.memoizedProps)), y && (y = Eu)) {
      if (J2(b)) throw o8(), Error(t(418));
      for (; y; ) Z2(b, y), y = af(y.nextSibling);
    }
    if (s8(b), b.tag === 13) {
      if (b = b.memoizedState, b = b !== null ? b.dehydrated : null, !b) throw Error(t(317));
      e: {
        for (b = b.nextSibling, y = 0; b; ) {
          if (b.nodeType === 8) {
            var k = b.data;
            if (k === "/$") {
              if (y === 0) {
                Eu = af(b.nextSibling);
                break e;
              }
              y--;
            } else k !== "$" && k !== "$!" && k !== "$?" || y++;
          }
          b = b.nextSibling;
        }
        Eu = null;
      }
    } else Eu = Su ? af(b.stateNode.nextSibling) : null;
    return !0;
  }
  function o8() {
    for (var b = Eu; b; ) b = af(b.nextSibling);
  }
  function up() {
    Eu = Su = null, xo = !1;
  }
  function lS(b) {
    cf === null ? cf = [b] : cf.push(b);
  }
  var Jb = T.ReactCurrentBatchConfig;
  function cS(b, y, k) {
    if (b = k.ref, b !== null && typeof b != "function" && typeof b != "object") {
      if (k._owner) {
        if (k = k._owner, k) {
          if (k.tag !== 1) throw Error(t(309));
          var A = k.stateNode;
        }
        if (!A) throw Error(t(147, b));
        var F = A, U = "" + b;
        return y !== null && y.ref !== null && typeof y.ref == "function" && y.ref._stringRef === U ? y.ref : (y = function(le) {
          var we = F.refs;
          le === null ? delete we[U] : we[U] = le;
        }, y._stringRef = U, y);
      }
      if (typeof b != "string") throw Error(t(284));
      if (!k._owner) throw Error(t(290, b));
    }
    return b;
  }
  function V0(b, y) {
    throw b = Object.prototype.toString.call(y), Error(t(31, b === "[object Object]" ? "object with keys {" + Object.keys(y).join(", ") + "}" : b));
  }
  function a8(b) {
    var y = b._init;
    return y(b._payload);
  }
  function l8(b) {
    function y($e, Oe) {
      if (b) {
        var Qe = $e.deletions;
        Qe === null ? ($e.deletions = [Oe], $e.flags |= 16) : Qe.push(Oe);
      }
    }
    function k($e, Oe) {
      if (!b) return null;
      for (; Oe !== null; ) y($e, Oe), Oe = Oe.sibling;
      return null;
    }
    function A($e, Oe) {
      for ($e = /* @__PURE__ */ new Map(); Oe !== null; ) Oe.key !== null ? $e.set(Oe.key, Oe) : $e.set(Oe.index, Oe), Oe = Oe.sibling;
      return $e;
    }
    function F($e, Oe) {
      return $e = Xm($e, Oe), $e.index = 0, $e.sibling = null, $e;
    }
    function U($e, Oe, Qe) {
      return $e.index = Qe, b ? (Qe = $e.alternate, Qe !== null ? (Qe = Qe.index, Qe < Oe ? ($e.flags |= 2, Oe) : Qe) : ($e.flags |= 2, Oe)) : ($e.flags |= 1048576, Oe);
    }
    function le($e) {
      return b && $e.alternate === null && ($e.flags |= 2), $e;
    }
    function we($e, Oe, Qe, Ut) {
      return Oe === null || Oe.tag !== 6 ? (Oe = mv(Qe, $e.mode, Ut), Oe.return = $e, Oe) : (Oe = F(Oe, Qe), Oe.return = $e, Oe);
    }
    function Te($e, Oe, Qe, Ut) {
      var mn = Qe.type;
      return mn === R ? It($e, Oe, Qe.props.children, Ut, Qe.key) : Oe !== null && (Oe.elementType === mn || typeof mn == "object" && mn !== null && mn.$$typeof === Q && a8(mn) === Oe.type) ? (Ut = F(Oe, Qe.props), Ut.ref = cS($e, Oe, Qe), Ut.return = $e, Ut) : (Ut = xD(Qe.type, Qe.key, Qe.props, null, $e.mode, Ut), Ut.ref = cS($e, Oe, Qe), Ut.return = $e, Ut);
    }
    function it($e, Oe, Qe, Ut) {
      return Oe === null || Oe.tag !== 4 || Oe.stateNode.containerInfo !== Qe.containerInfo || Oe.stateNode.implementation !== Qe.implementation ? (Oe = NO(Qe, $e.mode, Ut), Oe.return = $e, Oe) : (Oe = F(Oe, Qe.children || []), Oe.return = $e, Oe);
    }
    function It($e, Oe, Qe, Ut, mn) {
      return Oe === null || Oe.tag !== 7 ? (Oe = Zm(Qe, $e.mode, Ut, mn), Oe.return = $e, Oe) : (Oe = F(Oe, Qe), Oe.return = $e, Oe);
    }
    function Mt($e, Oe, Qe) {
      if (typeof Oe == "string" && Oe !== "" || typeof Oe == "number") return Oe = mv("" + Oe, $e.mode, Qe), Oe.return = $e, Oe;
      if (typeof Oe == "object" && Oe !== null) {
        switch (Oe.$$typeof) {
          case D:
            return Qe = xD(Oe.type, Oe.key, Oe.props, null, $e.mode, Qe), Qe.ref = cS($e, null, Oe), Qe.return = $e, Qe;
          case N:
            return Oe = NO(Oe, $e.mode, Qe), Oe.return = $e, Oe;
          case Q:
            var Ut = Oe._init;
            return Mt($e, Ut(Oe._payload), Qe);
        }
        if (Ts(Oe) || pe(Oe)) return Oe = Zm(Oe, $e.mode, Qe, null), Oe.return = $e, Oe;
        V0($e, Oe);
      }
      return null;
    }
    function kt($e, Oe, Qe, Ut) {
      var mn = Oe !== null ? Oe.key : null;
      if (typeof Qe == "string" && Qe !== "" || typeof Qe == "number") return mn !== null ? null : we($e, Oe, "" + Qe, Ut);
      if (typeof Qe == "object" && Qe !== null) {
        switch (Qe.$$typeof) {
          case D:
            return Qe.key === mn ? Te($e, Oe, Qe, Ut) : null;
          case N:
            return Qe.key === mn ? it($e, Oe, Qe, Ut) : null;
          case Q:
            return mn = Qe._init, kt(
              $e,
              Oe,
              mn(Qe._payload),
              Ut
            );
        }
        if (Ts(Qe) || pe(Qe)) return mn !== null ? null : It($e, Oe, Qe, Ut, null);
        V0($e, Qe);
      }
      return null;
    }
    function yn($e, Oe, Qe, Ut, mn) {
      if (typeof Ut == "string" && Ut !== "" || typeof Ut == "number") return $e = $e.get(Qe) || null, we(Oe, $e, "" + Ut, mn);
      if (typeof Ut == "object" && Ut !== null) {
        switch (Ut.$$typeof) {
          case D:
            return $e = $e.get(Ut.key === null ? Qe : Ut.key) || null, Te(Oe, $e, Ut, mn);
          case N:
            return $e = $e.get(Ut.key === null ? Qe : Ut.key) || null, it(Oe, $e, Ut, mn);
          case Q:
            var ti = Ut._init;
            return yn($e, Oe, Qe, ti(Ut._payload), mn);
        }
        if (Ts(Ut) || pe(Ut)) return $e = $e.get(Qe) || null, It(Oe, $e, Ut, mn, null);
        V0(Oe, Ut);
      }
      return null;
    }
    function Rn($e, Oe, Qe, Ut) {
      for (var mn = null, ti = null, ui = Oe, Oi = Oe = 0, Va = null; ui !== null && Oi < Qe.length; Oi++) {
        ui.index > Oi ? (Va = ui, ui = null) : Va = ui.sibling;
        var is = kt($e, ui, Qe[Oi], Ut);
        if (is === null) {
          ui === null && (ui = Va);
          break;
        }
        b && ui && is.alternate === null && y($e, ui), Oe = U(is, Oe, Oi), ti === null ? mn = is : ti.sibling = is, ti = is, ui = Va;
      }
      if (Oi === Qe.length) return k($e, ui), xo && Hm($e, Oi), mn;
      if (ui === null) {
        for (; Oi < Qe.length; Oi++) ui = Mt($e, Qe[Oi], Ut), ui !== null && (Oe = U(ui, Oe, Oi), ti === null ? mn = ui : ti.sibling = ui, ti = ui);
        return xo && Hm($e, Oi), mn;
      }
      for (ui = A($e, ui); Oi < Qe.length; Oi++) Va = yn(ui, $e, Oi, Qe[Oi], Ut), Va !== null && (b && Va.alternate !== null && ui.delete(Va.key === null ? Oi : Va.key), Oe = U(Va, Oe, Oi), ti === null ? mn = Va : ti.sibling = Va, ti = Va);
      return b && ui.forEach(function(Jm) {
        return y($e, Jm);
      }), xo && Hm($e, Oi), mn;
    }
    function Pn($e, Oe, Qe, Ut) {
      var mn = pe(Qe);
      if (typeof mn != "function") throw Error(t(150));
      if (Qe = mn.call(Qe), Qe == null) throw Error(t(151));
      for (var ti = mn = null, ui = Oe, Oi = Oe = 0, Va = null, is = Qe.next(); ui !== null && !is.done; Oi++, is = Qe.next()) {
        ui.index > Oi ? (Va = ui, ui = null) : Va = ui.sibling;
        var Jm = kt($e, ui, is.value, Ut);
        if (Jm === null) {
          ui === null && (ui = Va);
          break;
        }
        b && ui && Jm.alternate === null && y($e, ui), Oe = U(Jm, Oe, Oi), ti === null ? mn = Jm : ti.sibling = Jm, ti = Jm, ui = Va;
      }
      if (is.done) return k(
        $e,
        ui
      ), xo && Hm($e, Oi), mn;
      if (ui === null) {
        for (; !is.done; Oi++, is = Qe.next()) is = Mt($e, is.value, Ut), is !== null && (Oe = U(is, Oe, Oi), ti === null ? mn = is : ti.sibling = is, ti = is);
        return xo && Hm($e, Oi), mn;
      }
      for (ui = A($e, ui); !is.done; Oi++, is = Qe.next()) is = yn(ui, $e, Oi, is.value, Ut), is !== null && (b && is.alternate !== null && ui.delete(is.key === null ? Oi : is.key), Oe = U(is, Oe, Oi), ti === null ? mn = is : ti.sibling = is, ti = is);
      return b && ui.forEach(function(IX) {
        return y($e, IX);
      }), xo && Hm($e, Oi), mn;
    }
    function aa($e, Oe, Qe, Ut) {
      if (typeof Qe == "object" && Qe !== null && Qe.type === R && Qe.key === null && (Qe = Qe.props.children), typeof Qe == "object" && Qe !== null) {
        switch (Qe.$$typeof) {
          case D:
            e: {
              for (var mn = Qe.key, ti = Oe; ti !== null; ) {
                if (ti.key === mn) {
                  if (mn = Qe.type, mn === R) {
                    if (ti.tag === 7) {
                      k($e, ti.sibling), Oe = F(ti, Qe.props.children), Oe.return = $e, $e = Oe;
                      break e;
                    }
                  } else if (ti.elementType === mn || typeof mn == "object" && mn !== null && mn.$$typeof === Q && a8(mn) === ti.type) {
                    k($e, ti.sibling), Oe = F(ti, Qe.props), Oe.ref = cS($e, ti, Qe), Oe.return = $e, $e = Oe;
                    break e;
                  }
                  k($e, ti);
                  break;
                } else y($e, ti);
                ti = ti.sibling;
              }
              Qe.type === R ? (Oe = Zm(Qe.props.children, $e.mode, Ut, Qe.key), Oe.return = $e, $e = Oe) : (Ut = xD(Qe.type, Qe.key, Qe.props, null, $e.mode, Ut), Ut.ref = cS($e, Oe, Qe), Ut.return = $e, $e = Ut);
            }
            return le($e);
          case N:
            e: {
              for (ti = Qe.key; Oe !== null; ) {
                if (Oe.key === ti) if (Oe.tag === 4 && Oe.stateNode.containerInfo === Qe.containerInfo && Oe.stateNode.implementation === Qe.implementation) {
                  k($e, Oe.sibling), Oe = F(Oe, Qe.children || []), Oe.return = $e, $e = Oe;
                  break e;
                } else {
                  k($e, Oe);
                  break;
                }
                else y($e, Oe);
                Oe = Oe.sibling;
              }
              Oe = NO(Qe, $e.mode, Ut), Oe.return = $e, $e = Oe;
            }
            return le($e);
          case Q:
            return ti = Qe._init, aa($e, Oe, ti(Qe._payload), Ut);
        }
        if (Ts(Qe)) return Rn($e, Oe, Qe, Ut);
        if (pe(Qe)) return Pn($e, Oe, Qe, Ut);
        V0($e, Qe);
      }
      return typeof Qe == "string" && Qe !== "" || typeof Qe == "number" ? (Qe = "" + Qe, Oe !== null && Oe.tag === 6 ? (k($e, Oe.sibling), Oe = F(Oe, Qe), Oe.return = $e, $e = Oe) : (k($e, Oe), Oe = mv(Qe, $e.mode, Ut), Oe.return = $e, $e = Oe), le($e)) : k($e, Oe);
    }
    return aa;
  }
  var uf = l8(!0), kl = l8(!1), on = wu(null), hd = null, cc = null, tO = null;
  function nO() {
    tO = cc = hd = null;
  }
  function iO(b) {
    var y = on.current;
    ks(on), b._currentValue = y;
  }
  function rO(b, y, k) {
    for (; b !== null; ) {
      var A = b.alternate;
      if ((b.childLanes & y) !== y ? (b.childLanes |= y, A !== null && (A.childLanes |= y)) : A !== null && (A.childLanes & y) !== y && (A.childLanes |= y), b === k) break;
      b = b.return;
    }
  }
  function U0(b, y) {
    hd = b, tO = cc = null, b = b.dependencies, b !== null && b.firstContext !== null && ((b.lanes & y) !== 0 && (il = !0), b.firstContext = null);
  }
  function Ds(b) {
    var y = b._currentValue;
    if (tO !== b) if (b = { context: b, memoizedValue: y, next: null }, cc === null) {
      if (hd === null) throw Error(t(308));
      cc = b, hd.dependencies = { lanes: 0, firstContext: b };
    } else cc = cc.next = b;
    return y;
  }
  var ev = null;
  function sO(b) {
    ev === null ? ev = [b] : ev.push(b);
  }
  function c8(b, y, k, A) {
    var F = y.interleaved;
    return F === null ? (k.next = k, sO(y)) : (k.next = F.next, F.next = k), y.interleaved = k, hg(b, A);
  }
  function hg(b, y) {
    b.lanes |= y;
    var k = b.alternate;
    for (k !== null && (k.lanes |= y), k = b, b = b.return; b !== null; ) b.childLanes |= y, k = b.alternate, k !== null && (k.childLanes |= y), k = b, b = b.return;
    return k.tag === 3 ? k.stateNode : null;
  }
  var ih = !1;
  function Wm(b) {
    b.updateQueue = { baseState: b.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null };
  }
  function u8(b, y) {
    b = b.updateQueue, y.updateQueue === b && (y.updateQueue = { baseState: b.baseState, firstBaseUpdate: b.firstBaseUpdate, lastBaseUpdate: b.lastBaseUpdate, shared: b.shared, effects: b.effects });
  }
  function dp(b, y) {
    return { eventTime: b, lane: y, tag: 0, payload: null, callback: null, next: null };
  }
  function Vm(b, y, k) {
    var A = b.updateQueue;
    if (A === null) return null;
    if (A = A.shared, (br & 2) !== 0) {
      var F = A.pending;
      return F === null ? y.next = y : (y.next = F.next, F.next = y), A.pending = y, hg(b, k);
    }
    return F = A.interleaved, F === null ? (y.next = y, sO(A)) : (y.next = F.next, F.next = y), A.interleaved = y, hg(b, k);
  }
  function Vk(b, y, k) {
    if (y = y.updateQueue, y !== null && (y = y.shared, (k & 4194240) !== 0)) {
      var A = y.lanes;
      A &= b.pendingLanes, k |= A, y.lanes = k, Vw(b, k);
    }
  }
  function d8(b, y) {
    var k = b.updateQueue, A = b.alternate;
    if (A !== null && (A = A.updateQueue, k === A)) {
      var F = null, U = null;
      if (k = k.firstBaseUpdate, k !== null) {
        do {
          var le = { eventTime: k.eventTime, lane: k.lane, tag: k.tag, payload: k.payload, callback: k.callback, next: null };
          U === null ? F = U = le : U = U.next = le, k = k.next;
        } while (k !== null);
        U === null ? F = U = y : U = U.next = y;
      } else F = U = y;
      k = { baseState: A.baseState, firstBaseUpdate: F, lastBaseUpdate: U, shared: A.shared, effects: A.effects }, b.updateQueue = k;
      return;
    }
    b = k.lastBaseUpdate, b === null ? k.firstBaseUpdate = y : b.next = y, k.lastBaseUpdate = y;
  }
  function Uk(b, y, k, A) {
    var F = b.updateQueue;
    ih = !1;
    var U = F.firstBaseUpdate, le = F.lastBaseUpdate, we = F.shared.pending;
    if (we !== null) {
      F.shared.pending = null;
      var Te = we, it = Te.next;
      Te.next = null, le === null ? U = it : le.next = it, le = Te;
      var It = b.alternate;
      It !== null && (It = It.updateQueue, we = It.lastBaseUpdate, we !== le && (we === null ? It.firstBaseUpdate = it : we.next = it, It.lastBaseUpdate = Te));
    }
    if (U !== null) {
      var Mt = F.baseState;
      le = 0, It = it = Te = null, we = U;
      do {
        var kt = we.lane, yn = we.eventTime;
        if ((A & kt) === kt) {
          It !== null && (It = It.next = {
            eventTime: yn,
            lane: 0,
            tag: we.tag,
            payload: we.payload,
            callback: we.callback,
            next: null
          });
          e: {
            var Rn = b, Pn = we;
            switch (kt = y, yn = k, Pn.tag) {
              case 1:
                if (Rn = Pn.payload, typeof Rn == "function") {
                  Mt = Rn.call(yn, Mt, kt);
                  break e;
                }
                Mt = Rn;
                break e;
              case 3:
                Rn.flags = Rn.flags & -65537 | 128;
              case 0:
                if (Rn = Pn.payload, kt = typeof Rn == "function" ? Rn.call(yn, Mt, kt) : Rn, kt == null) break e;
                Mt = J({}, Mt, kt);
                break e;
              case 2:
                ih = !0;
            }
          }
          we.callback !== null && we.lane !== 0 && (b.flags |= 64, kt = F.effects, kt === null ? F.effects = [we] : kt.push(we));
        } else yn = { eventTime: yn, lane: kt, tag: we.tag, payload: we.payload, callback: we.callback, next: null }, It === null ? (it = It = yn, Te = Mt) : It = It.next = yn, le |= kt;
        if (we = we.next, we === null) {
          if (we = F.shared.pending, we === null) break;
          kt = we, we = kt.next, kt.next = null, F.lastBaseUpdate = kt, F.shared.pending = null;
        }
      } while (!0);
      if (It === null && (Te = Mt), F.baseState = Te, F.firstBaseUpdate = it, F.lastBaseUpdate = It, y = F.shared.interleaved, y !== null) {
        F = y;
        do
          le |= F.lane, F = F.next;
        while (F !== y);
      } else U === null && (F.shared.lanes = 0);
      uv |= le, b.lanes = le, b.memoizedState = Mt;
    }
  }
  function oO(b, y, k) {
    if (b = y.effects, y.effects = null, b !== null) for (y = 0; y < b.length; y++) {
      var A = b[y], F = A.callback;
      if (F !== null) {
        if (A.callback = null, A = k, typeof F != "function") throw Error(t(191, F));
        F.call(A);
      }
    }
  }
  var z0 = {}, fg = wu(z0), uS = wu(z0), dS = wu(z0);
  function tv(b) {
    if (b === z0) throw Error(t(174));
    return b;
  }
  function aO(b, y) {
    switch (oo(dS, y), oo(uS, b), oo(fg, z0), b = y.nodeType, b) {
      case 9:
      case 11:
        y = (y = y.documentElement) ? y.namespaceURI : yt(null, "");
        break;
      default:
        b = b === 8 ? y.parentNode : y, y = b.namespaceURI || null, b = b.tagName, y = yt(y, b);
    }
    ks(fg), oo(fg, y);
  }
  function $0() {
    ks(fg), ks(uS), ks(dS);
  }
  function lO(b) {
    tv(dS.current);
    var y = tv(fg.current), k = yt(y, b.type);
    y !== k && (oo(uS, b), oo(fg, k));
  }
  function cO(b) {
    uS.current === b && (ks(fg), ks(uS));
  }
  var Oo = wu(0);
  function zk(b) {
    for (var y = b; y !== null; ) {
      if (y.tag === 13) {
        var k = y.memoizedState;
        if (k !== null && (k = k.dehydrated, k === null || k.data === "$?" || k.data === "$!")) return y;
      } else if (y.tag === 19 && y.memoizedProps.revealOrder !== void 0) {
        if ((y.flags & 128) !== 0) return y;
      } else if (y.child !== null) {
        y.child.return = y, y = y.child;
        continue;
      }
      if (y === b) break;
      for (; y.sibling === null; ) {
        if (y.return === null || y.return === b) return null;
        y = y.return;
      }
      y.sibling.return = y.return, y = y.sibling;
    }
    return null;
  }
  var uO = [];
  function hS() {
    for (var b = 0; b < uO.length; b++) uO[b]._workInProgressVersionPrimary = null;
    uO.length = 0;
  }
  var ei = T.ReactCurrentDispatcher, gr = T.ReactCurrentBatchConfig, Lr = 0, zi = null, $s = null, Ba = null, $k = !1, fS = !1, gS = 0, dO = 0;
  function pt() {
    throw Error(t(321));
  }
  function Ea(b, y) {
    if (y === null) return !1;
    for (var k = 0; k < y.length && k < b.length; k++) if (!of(b[k], y[k])) return !1;
    return !0;
  }
  function Ci(b, y, k, A, F, U) {
    if (Lr = U, zi = y, y.memoizedState = null, y.updateQueue = null, y.lanes = 0, ei.current = b === null || b.memoizedState === null ? sD : oD, b = k(A, F), fS) {
      U = 0;
      do {
        if (fS = !1, gS = 0, 25 <= U) throw Error(t(301));
        U += 1, Ba = $s = null, y.updateQueue = null, ei.current = vS, b = k(A, F);
      } while (fS);
    }
    if (ei.current = Is, y = $s !== null && $s.next !== null, Lr = 0, Ba = $s = zi = null, $k = !1, y) throw Error(t(300));
    return b;
  }
  function Um() {
    var b = gS !== 0;
    return gS = 0, b;
  }
  function tl() {
    var b = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
    return Ba === null ? zi.memoizedState = Ba = b : Ba = Ba.next = b, Ba;
  }
  function nl() {
    if ($s === null) {
      var b = zi.alternate;
      b = b !== null ? b.memoizedState : null;
    } else b = $s.next;
    var y = Ba === null ? zi.memoizedState : Ba.next;
    if (y !== null) Ba = y, $s = b;
    else {
      if (b === null) throw Error(t(310));
      $s = b, b = { memoizedState: $s.memoizedState, baseState: $s.baseState, baseQueue: $s.baseQueue, queue: $s.queue, next: null }, Ba === null ? zi.memoizedState = Ba = b : Ba = Ba.next = b;
    }
    return Ba;
  }
  function xu(b, y) {
    return typeof y == "function" ? y(b) : y;
  }
  function nv(b) {
    var y = nl(), k = y.queue;
    if (k === null) throw Error(t(311));
    k.lastRenderedReducer = b;
    var A = $s, F = A.baseQueue, U = k.pending;
    if (U !== null) {
      if (F !== null) {
        var le = F.next;
        F.next = U.next, U.next = le;
      }
      A.baseQueue = F = U, k.pending = null;
    }
    if (F !== null) {
      U = F.next, A = A.baseState;
      var we = le = null, Te = null, it = U;
      do {
        var It = it.lane;
        if ((Lr & It) === It) Te !== null && (Te = Te.next = { lane: 0, action: it.action, hasEagerState: it.hasEagerState, eagerState: it.eagerState, next: null }), A = it.hasEagerState ? it.eagerState : b(A, it.action);
        else {
          var Mt = {
            lane: It,
            action: it.action,
            hasEagerState: it.hasEagerState,
            eagerState: it.eagerState,
            next: null
          };
          Te === null ? (we = Te = Mt, le = A) : Te = Te.next = Mt, zi.lanes |= It, uv |= It;
        }
        it = it.next;
      } while (it !== null && it !== U);
      Te === null ? le = A : Te.next = we, of(A, y.memoizedState) || (il = !0), y.memoizedState = A, y.baseState = le, y.baseQueue = Te, k.lastRenderedState = A;
    }
    if (b = k.interleaved, b !== null) {
      F = b;
      do
        U = F.lane, zi.lanes |= U, uv |= U, F = F.next;
      while (F !== b);
    } else F === null && (k.lanes = 0);
    return [y.memoizedState, k.dispatch];
  }
  function zm(b) {
    var y = nl(), k = y.queue;
    if (k === null) throw Error(t(311));
    k.lastRenderedReducer = b;
    var A = k.dispatch, F = k.pending, U = y.memoizedState;
    if (F !== null) {
      k.pending = null;
      var le = F = F.next;
      do
        U = b(U, le.action), le = le.next;
      while (le !== F);
      of(U, y.memoizedState) || (il = !0), y.memoizedState = U, y.baseQueue === null && (y.baseState = U), k.lastRenderedState = U;
    }
    return [U, A];
  }
  function j0() {
  }
  function jk(b, y) {
    var k = zi, A = nl(), F = y(), U = !of(A.memoizedState, F);
    if (U && (A.memoizedState = F, il = !0), A = A.queue, pS(Kk.bind(null, k, A, b), [b]), A.getSnapshot !== y || U || Ba !== null && Ba.memoizedState.tag & 1) {
      if (k.flags |= 2048, iv(9, qk.bind(null, k, A, F, y), void 0, null), xa === null) throw Error(t(349));
      (Lr & 30) !== 0 || Gk(k, y, F);
    }
    return F;
  }
  function Gk(b, y, k) {
    b.flags |= 16384, b = { getSnapshot: y, value: k }, y = zi.updateQueue, y === null ? (y = { lastEffect: null, stores: null }, zi.updateQueue = y, y.stores = [b]) : (k = y.stores, k === null ? y.stores = [b] : k.push(b));
  }
  function qk(b, y, k, A) {
    y.value = k, y.getSnapshot = A, Yk(y) && Xk(b);
  }
  function Kk(b, y, k) {
    return k(function() {
      Yk(y) && Xk(b);
    });
  }
  function Yk(b) {
    var y = b.getSnapshot;
    b = b.value;
    try {
      var k = y();
      return !of(b, k);
    } catch {
      return !0;
    }
  }
  function Xk(b) {
    var y = hg(b, 1);
    y !== null && md(y, b, 1, -1);
  }
  function Zk(b) {
    var y = tl();
    return typeof b == "function" && (b = b()), y.memoizedState = y.baseState = b, b = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: xu, lastRenderedState: b }, y.queue = b, b = b.dispatch = bS.bind(null, zi, b), [y.memoizedState, b];
  }
  function iv(b, y, k, A) {
    return b = { tag: b, create: y, destroy: k, deps: A, next: null }, y = zi.updateQueue, y === null ? (y = { lastEffect: null, stores: null }, zi.updateQueue = y, y.lastEffect = b.next = b) : (k = y.lastEffect, k === null ? y.lastEffect = b.next = b : (A = k.next, k.next = b, b.next = A, y.lastEffect = b)), b;
  }
  function Qk() {
    return nl().memoizedState;
  }
  function G0(b, y, k, A) {
    var F = tl();
    zi.flags |= b, F.memoizedState = iv(1 | y, k, void 0, A === void 0 ? null : A);
  }
  function q0(b, y, k, A) {
    var F = nl();
    A = A === void 0 ? null : A;
    var U = void 0;
    if ($s !== null) {
      var le = $s.memoizedState;
      if (U = le.destroy, A !== null && Ea(A, le.deps)) {
        F.memoizedState = iv(y, k, U, A);
        return;
      }
    }
    zi.flags |= b, F.memoizedState = iv(1 | y, k, U, A);
  }
  function Jk(b, y) {
    return G0(8390656, 8, b, y);
  }
  function pS(b, y) {
    return q0(2048, 8, b, y);
  }
  function eD(b, y) {
    return q0(4, 2, b, y);
  }
  function tD(b, y) {
    return q0(4, 4, b, y);
  }
  function mS(b, y) {
    if (typeof y == "function") return b = b(), y(b), function() {
      y(null);
    };
    if (y != null) return b = b(), y.current = b, function() {
      y.current = null;
    };
  }
  function rv(b, y, k) {
    return k = k != null ? k.concat([b]) : null, q0(4, 4, mS.bind(null, y, b), k);
  }
  function _S() {
  }
  function nD(b, y) {
    var k = nl();
    y = y === void 0 ? null : y;
    var A = k.memoizedState;
    return A !== null && y !== null && Ea(y, A[1]) ? A[0] : (k.memoizedState = [b, y], b);
  }
  function iD(b, y) {
    var k = nl();
    y = y === void 0 ? null : y;
    var A = k.memoizedState;
    return A !== null && y !== null && Ea(y, A[1]) ? A[0] : (b = b(), k.memoizedState = [b, y], b);
  }
  function rD(b, y, k) {
    return (Lr & 21) === 0 ? (b.baseState && (b.baseState = !1, il = !0), b.memoizedState = k) : (of(k, y) || (k = Hb(), zi.lanes |= k, uv |= k, b.baseState = !0), y);
  }
  function h8(b, y) {
    var k = Nr;
    Nr = k !== 0 && 4 > k ? k : 4, b(!0);
    var A = gr.transition;
    gr.transition = {};
    try {
      b(!1), y();
    } finally {
      Nr = k, gr.transition = A;
    }
  }
  function K0() {
    return nl().memoizedState;
  }
  function f8(b, y, k) {
    var A = pd(b);
    if (k = { lane: A, action: k, hasEagerState: !1, eagerState: null, next: null }, $m(b)) Lu(y, k);
    else if (k = c8(b, y, k, A), k !== null) {
      var F = ao();
      md(k, b, A, F), g8(k, y, A);
    }
  }
  function bS(b, y, k) {
    var A = pd(b), F = { lane: A, action: k, hasEagerState: !1, eagerState: null, next: null };
    if ($m(b)) Lu(y, F);
    else {
      var U = b.alternate;
      if (b.lanes === 0 && (U === null || U.lanes === 0) && (U = y.lastRenderedReducer, U !== null)) try {
        var le = y.lastRenderedState, we = U(le, k);
        if (F.hasEagerState = !0, F.eagerState = we, of(we, le)) {
          var Te = y.interleaved;
          Te === null ? (F.next = F, sO(y)) : (F.next = Te.next, Te.next = F), y.interleaved = F;
          return;
        }
      } catch {
      } finally {
      }
      k = c8(b, y, F, A), k !== null && (F = ao(), md(k, b, A, F), g8(k, y, A));
    }
  }
  function $m(b) {
    var y = b.alternate;
    return b === zi || y !== null && y === zi;
  }
  function Lu(b, y) {
    fS = $k = !0;
    var k = b.pending;
    k === null ? y.next = y : (y.next = k.next, k.next = y), b.pending = y;
  }
  function g8(b, y, k) {
    if ((k & 4194240) !== 0) {
      var A = y.lanes;
      A &= b.pendingLanes, k |= A, y.lanes = k, Vw(b, k);
    }
  }
  var Is = { readContext: Ds, useCallback: pt, useContext: pt, useEffect: pt, useImperativeHandle: pt, useInsertionEffect: pt, useLayoutEffect: pt, useMemo: pt, useReducer: pt, useRef: pt, useState: pt, useDebugValue: pt, useDeferredValue: pt, useTransition: pt, useMutableSource: pt, useSyncExternalStore: pt, useId: pt, unstable_isNewReconciler: !1 }, sD = { readContext: Ds, useCallback: function(b, y) {
    return tl().memoizedState = [b, y === void 0 ? null : y], b;
  }, useContext: Ds, useEffect: Jk, useImperativeHandle: function(b, y, k) {
    return k = k != null ? k.concat([b]) : null, G0(
      4194308,
      4,
      mS.bind(null, y, b),
      k
    );
  }, useLayoutEffect: function(b, y) {
    return G0(4194308, 4, b, y);
  }, useInsertionEffect: function(b, y) {
    return G0(4, 2, b, y);
  }, useMemo: function(b, y) {
    var k = tl();
    return y = y === void 0 ? null : y, b = b(), k.memoizedState = [b, y], b;
  }, useReducer: function(b, y, k) {
    var A = tl();
    return y = k !== void 0 ? k(y) : y, A.memoizedState = A.baseState = y, b = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: b, lastRenderedState: y }, A.queue = b, b = b.dispatch = f8.bind(null, zi, b), [A.memoizedState, b];
  }, useRef: function(b) {
    var y = tl();
    return b = { current: b }, y.memoizedState = b;
  }, useState: Zk, useDebugValue: _S, useDeferredValue: function(b) {
    return tl().memoizedState = b;
  }, useTransition: function() {
    var b = Zk(!1), y = b[0];
    return b = h8.bind(null, b[1]), tl().memoizedState = b, [y, b];
  }, useMutableSource: function() {
  }, useSyncExternalStore: function(b, y, k) {
    var A = zi, F = tl();
    if (xo) {
      if (k === void 0) throw Error(t(407));
      k = k();
    } else {
      if (k = y(), xa === null) throw Error(t(349));
      (Lr & 30) !== 0 || Gk(A, y, k);
    }
    F.memoizedState = k;
    var U = { value: k, getSnapshot: y };
    return F.queue = U, Jk(Kk.bind(
      null,
      A,
      U,
      b
    ), [b]), A.flags |= 2048, iv(9, qk.bind(null, A, U, k, y), void 0, null), k;
  }, useId: function() {
    var b = tl(), y = xa.identifierPrefix;
    if (xo) {
      var k = dg, A = Fc;
      k = (A & ~(1 << 32 - Ac(A) - 1)).toString(32) + k, y = ":" + y + "R" + k, k = gS++, 0 < k && (y += "H" + k.toString(32)), y += ":";
    } else k = dO++, y = ":" + y + "r" + k.toString(32) + ":";
    return b.memoizedState = y;
  }, unstable_isNewReconciler: !1 }, oD = {
    readContext: Ds,
    useCallback: nD,
    useContext: Ds,
    useEffect: pS,
    useImperativeHandle: rv,
    useInsertionEffect: eD,
    useLayoutEffect: tD,
    useMemo: iD,
    useReducer: nv,
    useRef: Qk,
    useState: function() {
      return nv(xu);
    },
    useDebugValue: _S,
    useDeferredValue: function(b) {
      var y = nl();
      return rD(y, $s.memoizedState, b);
    },
    useTransition: function() {
      var b = nv(xu)[0], y = nl().memoizedState;
      return [b, y];
    },
    useMutableSource: j0,
    useSyncExternalStore: jk,
    useId: K0,
    unstable_isNewReconciler: !1
  }, vS = { readContext: Ds, useCallback: nD, useContext: Ds, useEffect: pS, useImperativeHandle: rv, useInsertionEffect: eD, useLayoutEffect: tD, useMemo: iD, useReducer: zm, useRef: Qk, useState: function() {
    return zm(xu);
  }, useDebugValue: _S, useDeferredValue: function(b) {
    var y = nl();
    return $s === null ? y.memoizedState = b : rD(y, $s.memoizedState, b);
  }, useTransition: function() {
    var b = zm(xu)[0], y = nl().memoizedState;
    return [b, y];
  }, useMutableSource: j0, useSyncExternalStore: jk, useId: K0, unstable_isNewReconciler: !1 };
  function Tu(b, y) {
    if (b && b.defaultProps) {
      y = J({}, y), b = b.defaultProps;
      for (var k in b) y[k] === void 0 && (y[k] = b[k]);
      return y;
    }
    return y;
  }
  function hO(b, y, k, A) {
    y = b.memoizedState, k = k(A, y), k = k == null ? y : J({}, y, k), b.memoizedState = k, b.lanes === 0 && (b.updateQueue.baseState = k);
  }
  var aD = { isMounted: function(b) {
    return (b = b._reactInternals) ? nn(b) === b : !1;
  }, enqueueSetState: function(b, y, k) {
    b = b._reactInternals;
    var A = ao(), F = pd(b), U = dp(A, F);
    U.payload = y, k != null && (U.callback = k), y = Vm(b, U, F), y !== null && (md(y, b, F, A), Vk(y, b, F));
  }, enqueueReplaceState: function(b, y, k) {
    b = b._reactInternals;
    var A = ao(), F = pd(b), U = dp(A, F);
    U.tag = 1, U.payload = y, k != null && (U.callback = k), y = Vm(b, U, F), y !== null && (md(y, b, F, A), Vk(y, b, F));
  }, enqueueForceUpdate: function(b, y) {
    b = b._reactInternals;
    var k = ao(), A = pd(b), F = dp(k, A);
    F.tag = 2, y != null && (F.callback = y), y = Vm(b, F, A), y !== null && (md(y, b, A, k), Vk(y, b, A));
  } };
  function p8(b, y, k, A, F, U, le) {
    return b = b.stateNode, typeof b.shouldComponentUpdate == "function" ? b.shouldComponentUpdate(A, U, le) : y.prototype && y.prototype.isPureReactComponent ? !Kw(k, A) || !Kw(F, U) : !0;
  }
  function m8(b, y, k) {
    var A = !1, F = lr, U = y.contextType;
    return typeof U == "object" && U !== null ? U = Ds(U) : (F = Ko(y) ? nh : Ao.current, A = y.contextTypes, U = (A = A != null) ? dd(b, F) : lr), y = new y(k, U), b.memoizedState = y.state !== null && y.state !== void 0 ? y.state : null, y.updater = aD, b.stateNode = y, y._reactInternals = b, A && (b = b.stateNode, b.__reactInternalMemoizedUnmaskedChildContext = F, b.__reactInternalMemoizedMaskedChildContext = U), y;
  }
  function lD(b, y, k, A) {
    b = y.state, typeof y.componentWillReceiveProps == "function" && y.componentWillReceiveProps(k, A), typeof y.UNSAFE_componentWillReceiveProps == "function" && y.UNSAFE_componentWillReceiveProps(k, A), y.state !== b && aD.enqueueReplaceState(y, y.state, null);
  }
  function fO(b, y, k, A) {
    var F = b.stateNode;
    F.props = k, F.state = b.memoizedState, F.refs = {}, Wm(b);
    var U = y.contextType;
    typeof U == "object" && U !== null ? F.context = Ds(U) : (U = Ko(y) ? nh : Ao.current, F.context = dd(b, U)), F.state = b.memoizedState, U = y.getDerivedStateFromProps, typeof U == "function" && (hO(b, y, U, k), F.state = b.memoizedState), typeof y.getDerivedStateFromProps == "function" || typeof F.getSnapshotBeforeUpdate == "function" || typeof F.UNSAFE_componentWillMount != "function" && typeof F.componentWillMount != "function" || (y = F.state, typeof F.componentWillMount == "function" && F.componentWillMount(), typeof F.UNSAFE_componentWillMount == "function" && F.UNSAFE_componentWillMount(), y !== F.state && aD.enqueueReplaceState(F, F.state, null), Uk(b, k, F, A), F.state = b.memoizedState), typeof F.componentDidMount == "function" && (b.flags |= 4194308);
  }
  function jm(b, y) {
    try {
      var k = "", A = y;
      do
        k += Ve(A), A = A.return;
      while (A);
      var F = k;
    } catch (U) {
      F = `
Error generating stack: ` + U.message + `
` + U.stack;
    }
    return { value: b, source: y, stack: F, digest: null };
  }
  function cD(b, y, k) {
    return { value: b, source: null, stack: k ?? null, digest: y ?? null };
  }
  function gO(b, y) {
    try {
      console.error(y.value);
    } catch (k) {
      setTimeout(function() {
        throw k;
      });
    }
  }
  var _X = typeof WeakMap == "function" ? WeakMap : Map;
  function yS(b, y, k) {
    k = dp(-1, k), k.tag = 3, k.payload = { element: null };
    var A = y.value;
    return k.callback = function() {
      qm || (qm = !0, kS = A), gO(b, y);
    }, k;
  }
  function _8(b, y, k) {
    k = dp(-1, k), k.tag = 3;
    var A = b.type.getDerivedStateFromError;
    if (typeof A == "function") {
      var F = y.value;
      k.payload = function() {
        return A(F);
      }, k.callback = function() {
        gO(b, y);
      };
    }
    var U = b.stateNode;
    return U !== null && typeof U.componentDidCatch == "function" && (k.callback = function() {
      gO(b, y), typeof A != "function" && (oh === null ? oh = /* @__PURE__ */ new Set([this]) : oh.add(this));
      var le = y.stack;
      this.componentDidCatch(y.value, { componentStack: le !== null ? le : "" });
    }), k;
  }
  function pO(b, y, k) {
    var A = b.pingCache;
    if (A === null) {
      A = b.pingCache = new _X();
      var F = /* @__PURE__ */ new Set();
      A.set(y, F);
    } else F = A.get(y), F === void 0 && (F = /* @__PURE__ */ new Set(), A.set(y, F));
    F.has(k) || (F.add(k), b = kO.bind(null, b, y, k), y.then(b, b));
  }
  function mO(b) {
    do {
      var y;
      if ((y = b.tag === 13) && (y = b.memoizedState, y = y !== null ? y.dehydrated !== null : !0), y) return b;
      b = b.return;
    } while (b !== null);
    return null;
  }
  function b8(b, y, k, A, F) {
    return (b.mode & 1) === 0 ? (b === y ? b.flags |= 65536 : (b.flags |= 128, k.flags |= 131072, k.flags &= -52805, k.tag === 1 && (k.alternate === null ? k.tag = 17 : (y = dp(-1, 1), y.tag = 2, Vm(k, y, 1))), k.lanes |= 1), b) : (b.flags |= 65536, b.lanes = F, b);
  }
  var sv = T.ReactCurrentOwner, il = !1;
  function sa(b, y, k, A) {
    y.child = b === null ? kl(y, null, k, A) : uf(y, b.child, k, A);
  }
  function uD(b, y, k, A, F) {
    k = k.render;
    var U = y.ref;
    return U0(y, F), A = Ci(b, y, k, A, U, F), k = Um(), b !== null && !il ? (y.updateQueue = b.updateQueue, y.flags &= -2053, b.lanes &= ~F, Dl(b, y, F)) : (xo && k && X2(y), y.flags |= 1, sa(b, y, A, F), y.child);
  }
  function ku(b, y, k, A, F) {
    if (b === null) {
      var U = k.type;
      return typeof U == "function" && !IO(U) && U.defaultProps === void 0 && k.compare === null && k.defaultProps === void 0 ? (y.tag = 15, y.type = U, ov(b, y, U, A, F)) : (b = xD(k.type, null, A, y, y.mode, F), b.ref = y.ref, b.return = y, y.child = b);
    }
    if (U = b.child, (b.lanes & F) === 0) {
      var le = U.memoizedProps;
      if (k = k.compare, k = k !== null ? k : Kw, k(le, A) && b.ref === y.ref) return Dl(b, y, F);
    }
    return y.flags |= 1, b = Xm(U, A), b.ref = y.ref, b.return = y, y.child = b;
  }
  function ov(b, y, k, A, F) {
    if (b !== null) {
      var U = b.memoizedProps;
      if (Kw(U, A) && b.ref === y.ref) if (il = !1, y.pendingProps = A = U, (b.lanes & F) !== 0) (b.flags & 131072) !== 0 && (il = !0);
      else return y.lanes = b.lanes, Dl(b, y, F);
    }
    return dD(b, y, k, A, F);
  }
  function Xi(b, y, k) {
    var A = y.pendingProps, F = A.children, U = b !== null ? b.memoizedState : null;
    if (A.mode === "hidden") if ((y.mode & 1) === 0) y.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, oo(Q0, gd), gd |= k;
    else {
      if ((k & 1073741824) === 0) return b = U !== null ? U.baseLanes | k : k, y.lanes = y.childLanes = 1073741824, y.memoizedState = { baseLanes: b, cachePool: null, transitions: null }, y.updateQueue = null, oo(Q0, gd), gd |= b, null;
      y.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, A = U !== null ? U.baseLanes : k, oo(Q0, gd), gd |= A;
    }
    else U !== null ? (A = U.baseLanes | k, y.memoizedState = null) : A = k, oo(Q0, gd), gd |= A;
    return sa(b, y, F, k), y.child;
  }
  function CS(b, y) {
    var k = y.ref;
    (b === null && k !== null || b !== null && b.ref !== k) && (y.flags |= 512, y.flags |= 2097152);
  }
  function dD(b, y, k, A, F) {
    var U = Ko(k) ? nh : Ao.current;
    return U = dd(y, U), U0(y, F), k = Ci(b, y, k, A, U, F), A = Um(), b !== null && !il ? (y.updateQueue = b.updateQueue, y.flags &= -2053, b.lanes &= ~F, Dl(b, y, F)) : (xo && A && X2(y), y.flags |= 1, sa(b, y, k, F), y.child);
  }
  function bX(b, y, k, A, F) {
    if (Ko(k)) {
      var U = !0;
      Zb(y);
    } else U = !1;
    if (U0(y, F), y.stateNode === null) rh(b, y), m8(y, k, A), fO(y, k, A, F), A = !0;
    else if (b === null) {
      var le = y.stateNode, we = y.memoizedProps;
      le.props = we;
      var Te = le.context, it = k.contextType;
      typeof it == "object" && it !== null ? it = Ds(it) : (it = Ko(k) ? nh : Ao.current, it = dd(y, it));
      var It = k.getDerivedStateFromProps, Mt = typeof It == "function" || typeof le.getSnapshotBeforeUpdate == "function";
      Mt || typeof le.UNSAFE_componentWillReceiveProps != "function" && typeof le.componentWillReceiveProps != "function" || (we !== A || Te !== it) && lD(y, le, A, it), ih = !1;
      var kt = y.memoizedState;
      le.state = kt, Uk(y, A, le, F), Te = y.memoizedState, we !== A || kt !== Te || wa.current || ih ? (typeof It == "function" && (hO(y, k, It, A), Te = y.memoizedState), (we = ih || p8(y, k, we, A, kt, Te, it)) ? (Mt || typeof le.UNSAFE_componentWillMount != "function" && typeof le.componentWillMount != "function" || (typeof le.componentWillMount == "function" && le.componentWillMount(), typeof le.UNSAFE_componentWillMount == "function" && le.UNSAFE_componentWillMount()), typeof le.componentDidMount == "function" && (y.flags |= 4194308)) : (typeof le.componentDidMount == "function" && (y.flags |= 4194308), y.memoizedProps = A, y.memoizedState = Te), le.props = A, le.state = Te, le.context = it, A = we) : (typeof le.componentDidMount == "function" && (y.flags |= 4194308), A = !1);
    } else {
      le = y.stateNode, u8(b, y), we = y.memoizedProps, it = y.type === y.elementType ? we : Tu(y.type, we), le.props = it, Mt = y.pendingProps, kt = le.context, Te = k.contextType, typeof Te == "object" && Te !== null ? Te = Ds(Te) : (Te = Ko(k) ? nh : Ao.current, Te = dd(y, Te));
      var yn = k.getDerivedStateFromProps;
      (It = typeof yn == "function" || typeof le.getSnapshotBeforeUpdate == "function") || typeof le.UNSAFE_componentWillReceiveProps != "function" && typeof le.componentWillReceiveProps != "function" || (we !== Mt || kt !== Te) && lD(y, le, A, Te), ih = !1, kt = y.memoizedState, le.state = kt, Uk(y, A, le, F);
      var Rn = y.memoizedState;
      we !== Mt || kt !== Rn || wa.current || ih ? (typeof yn == "function" && (hO(y, k, yn, A), Rn = y.memoizedState), (it = ih || p8(y, k, it, A, kt, Rn, Te) || !1) ? (It || typeof le.UNSAFE_componentWillUpdate != "function" && typeof le.componentWillUpdate != "function" || (typeof le.componentWillUpdate == "function" && le.componentWillUpdate(A, Rn, Te), typeof le.UNSAFE_componentWillUpdate == "function" && le.UNSAFE_componentWillUpdate(A, Rn, Te)), typeof le.componentDidUpdate == "function" && (y.flags |= 4), typeof le.getSnapshotBeforeUpdate == "function" && (y.flags |= 1024)) : (typeof le.componentDidUpdate != "function" || we === b.memoizedProps && kt === b.memoizedState || (y.flags |= 4), typeof le.getSnapshotBeforeUpdate != "function" || we === b.memoizedProps && kt === b.memoizedState || (y.flags |= 1024), y.memoizedProps = A, y.memoizedState = Rn), le.props = A, le.state = Rn, le.context = Te, A = it) : (typeof le.componentDidUpdate != "function" || we === b.memoizedProps && kt === b.memoizedState || (y.flags |= 4), typeof le.getSnapshotBeforeUpdate != "function" || we === b.memoizedProps && kt === b.memoizedState || (y.flags |= 1024), A = !1);
    }
    return _O(b, y, k, A, U, F);
  }
  function _O(b, y, k, A, F, U) {
    CS(b, y);
    var le = (y.flags & 128) !== 0;
    if (!A && !le) return F && lc(y, k, !1), Dl(b, y, U);
    A = y.stateNode, sv.current = y;
    var we = le && typeof k.getDerivedStateFromError != "function" ? null : A.render();
    return y.flags |= 1, b !== null && le ? (y.child = uf(y, b.child, null, U), y.child = uf(y, null, we, U)) : sa(b, y, we, U), y.memoizedState = A.state, F && lc(y, k, !0), y.child;
  }
  function hD(b) {
    var y = b.stateNode;
    y.pendingContext ? Hk(b, y.pendingContext, y.pendingContext !== y.context) : y.context && Hk(b, y.context, !1), aO(b, y.containerInfo);
  }
  function Y0(b, y, k, A, F) {
    return up(), lS(F), y.flags |= 256, sa(b, y, k, A), y.child;
  }
  var bO = { dehydrated: null, treeContext: null, retryLane: 0 };
  function fD(b) {
    return { baseLanes: b, cachePool: null, transitions: null };
  }
  function v8(b, y, k) {
    var A = y.pendingProps, F = Oo.current, U = !1, le = (y.flags & 128) !== 0, we;
    if ((we = le) || (we = b !== null && b.memoizedState === null ? !1 : (F & 2) !== 0), we ? (U = !0, y.flags &= -129) : (b === null || b.memoizedState !== null) && (F |= 1), oo(Oo, F & 1), b === null)
      return eO(y), b = y.memoizedState, b !== null && (b = b.dehydrated, b !== null) ? ((y.mode & 1) === 0 ? y.lanes = 1 : b.data === "$!" ? y.lanes = 8 : y.lanes = 1073741824, null) : (le = A.children, b = A.fallback, U ? (A = y.mode, U = y.child, le = { mode: "hidden", children: le }, (A & 1) === 0 && U !== null ? (U.childLanes = 0, U.pendingProps = le) : U = rC(le, A, 0, null), b = Zm(b, A, k, null), U.return = y, b.return = y, U.sibling = b, y.child = U, y.child.memoizedState = fD(k), y.memoizedState = bO, b) : wS(y, le));
    if (F = b.memoizedState, F !== null && (we = F.dehydrated, we !== null)) return y8(b, y, le, A, we, F, k);
    if (U) {
      U = A.fallback, le = y.mode, F = b.child, we = F.sibling;
      var Te = { mode: "hidden", children: A.children };
      return (le & 1) === 0 && y.child !== F ? (A = y.child, A.childLanes = 0, A.pendingProps = Te, y.deletions = null) : (A = Xm(F, Te), A.subtreeFlags = F.subtreeFlags & 14680064), we !== null ? U = Xm(we, U) : (U = Zm(U, le, k, null), U.flags |= 2), U.return = y, A.return = y, A.sibling = U, y.child = A, A = U, U = y.child, le = b.child.memoizedState, le = le === null ? fD(k) : { baseLanes: le.baseLanes | k, cachePool: null, transitions: le.transitions }, U.memoizedState = le, U.childLanes = b.childLanes & ~k, y.memoizedState = bO, A;
    }
    return U = b.child, b = U.sibling, A = Xm(U, { mode: "visible", children: A.children }), (y.mode & 1) === 0 && (A.lanes = k), A.return = y, A.sibling = null, b !== null && (k = y.deletions, k === null ? (y.deletions = [b], y.flags |= 16) : k.push(b)), y.child = A, y.memoizedState = null, A;
  }
  function wS(b, y) {
    return y = rC({ mode: "visible", children: y }, b.mode, 0, null), y.return = b, b.child = y;
  }
  function gD(b, y, k, A) {
    return A !== null && lS(A), uf(y, b.child, null, k), b = wS(y, y.pendingProps.children), b.flags |= 2, y.memoizedState = null, b;
  }
  function y8(b, y, k, A, F, U, le) {
    if (k)
      return y.flags & 256 ? (y.flags &= -257, A = cD(Error(t(422))), gD(b, y, le, A)) : y.memoizedState !== null ? (y.child = b.child, y.flags |= 128, null) : (U = A.fallback, F = y.mode, A = rC({ mode: "visible", children: A.children }, F, 0, null), U = Zm(U, F, le, null), U.flags |= 2, A.return = y, U.return = y, A.sibling = U, y.child = A, (y.mode & 1) !== 0 && uf(y, b.child, null, le), y.child.memoizedState = fD(le), y.memoizedState = bO, U);
    if ((y.mode & 1) === 0) return gD(b, y, le, null);
    if (F.data === "$!") {
      if (A = F.nextSibling && F.nextSibling.dataset, A) var we = A.dgst;
      return A = we, U = Error(t(419)), A = cD(U, A, void 0), gD(b, y, le, A);
    }
    if (we = (le & b.childLanes) !== 0, il || we) {
      if (A = xa, A !== null) {
        switch (le & -le) {
          case 4:
            F = 2;
            break;
          case 16:
            F = 8;
            break;
          case 64:
          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:
          case 4194304:
          case 8388608:
          case 16777216:
          case 33554432:
          case 67108864:
            F = 32;
            break;
          case 536870912:
            F = 268435456;
            break;
          default:
            F = 0;
        }
        F = (F & (A.suspendedLanes | le)) !== 0 ? 0 : F, F !== 0 && F !== U.retryLane && (U.retryLane = F, hg(b, F), md(A, b, F, -1));
      }
      return LO(), A = cD(Error(t(421))), gD(b, y, le, A);
    }
    return F.data === "$?" ? (y.flags |= 128, y.child = b.child, y = EX.bind(null, b), F._reactRetry = y, null) : (b = U.treeContext, Eu = af(F.nextSibling), Su = y, xo = !0, cf = null, b !== null && (Tl[Sa++] = Fc, Tl[Sa++] = dg, Tl[Sa++] = Qb, Fc = b.id, dg = b.overflow, Qb = y), y = wS(y, A.children), y.flags |= 4096, y);
  }
  function vO(b, y, k) {
    b.lanes |= y;
    var A = b.alternate;
    A !== null && (A.lanes |= y), rO(b.return, y, k);
  }
  function pD(b, y, k, A, F) {
    var U = b.memoizedState;
    U === null ? b.memoizedState = { isBackwards: y, rendering: null, renderingStartTime: 0, last: A, tail: k, tailMode: F } : (U.isBackwards = y, U.rendering = null, U.renderingStartTime = 0, U.last = A, U.tail = k, U.tailMode = F);
  }
  function Du(b, y, k) {
    var A = y.pendingProps, F = A.revealOrder, U = A.tail;
    if (sa(b, y, A.children, k), A = Oo.current, (A & 2) !== 0) A = A & 1 | 2, y.flags |= 128;
    else {
      if (b !== null && (b.flags & 128) !== 0) e: for (b = y.child; b !== null; ) {
        if (b.tag === 13) b.memoizedState !== null && vO(b, k, y);
        else if (b.tag === 19) vO(b, k, y);
        else if (b.child !== null) {
          b.child.return = b, b = b.child;
          continue;
        }
        if (b === y) break e;
        for (; b.sibling === null; ) {
          if (b.return === null || b.return === y) break e;
          b = b.return;
        }
        b.sibling.return = b.return, b = b.sibling;
      }
      A &= 1;
    }
    if (oo(Oo, A), (y.mode & 1) === 0) y.memoizedState = null;
    else switch (F) {
      case "forwards":
        for (k = y.child, F = null; k !== null; ) b = k.alternate, b !== null && zk(b) === null && (F = k), k = k.sibling;
        k = F, k === null ? (F = y.child, y.child = null) : (F = k.sibling, k.sibling = null), pD(y, !1, F, k, U);
        break;
      case "backwards":
        for (k = null, F = y.child, y.child = null; F !== null; ) {
          if (b = F.alternate, b !== null && zk(b) === null) {
            y.child = F;
            break;
          }
          b = F.sibling, F.sibling = k, k = F, F = b;
        }
        pD(y, !0, k, null, U);
        break;
      case "together":
        pD(y, !1, null, null, void 0);
        break;
      default:
        y.memoizedState = null;
    }
    return y.child;
  }
  function rh(b, y) {
    (y.mode & 1) === 0 && b !== null && (b.alternate = null, y.alternate = null, y.flags |= 2);
  }
  function Dl(b, y, k) {
    if (b !== null && (y.dependencies = b.dependencies), uv |= y.lanes, (k & y.childLanes) === 0) return null;
    if (b !== null && y.child !== b.child) throw Error(t(153));
    if (y.child !== null) {
      for (b = y.child, k = Xm(b, b.pendingProps), y.child = k, k.return = y; b.sibling !== null; ) b = b.sibling, k = k.sibling = Xm(b, b.pendingProps), k.return = y;
      k.sibling = null;
    }
    return y.child;
  }
  function mD(b, y, k) {
    switch (y.tag) {
      case 3:
        hD(y), up();
        break;
      case 5:
        lO(y);
        break;
      case 1:
        Ko(y.type) && Zb(y);
        break;
      case 4:
        aO(y, y.stateNode.containerInfo);
        break;
      case 10:
        var A = y.type._context, F = y.memoizedProps.value;
        oo(on, A._currentValue), A._currentValue = F;
        break;
      case 13:
        if (A = y.memoizedState, A !== null)
          return A.dehydrated !== null ? (oo(Oo, Oo.current & 1), y.flags |= 128, null) : (k & y.child.childLanes) !== 0 ? v8(b, y, k) : (oo(Oo, Oo.current & 1), b = Dl(b, y, k), b !== null ? b.sibling : null);
        oo(Oo, Oo.current & 1);
        break;
      case 19:
        if (A = (k & y.childLanes) !== 0, (b.flags & 128) !== 0) {
          if (A) return Du(b, y, k);
          y.flags |= 128;
        }
        if (F = y.memoizedState, F !== null && (F.rendering = null, F.tail = null, F.lastEffect = null), oo(Oo, Oo.current), A) break;
        return null;
      case 22:
      case 23:
        return y.lanes = 0, Xi(b, y, k);
    }
    return Dl(b, y, k);
  }
  var X0, fd, Ha, C8;
  X0 = function(b, y) {
    for (var k = y.child; k !== null; ) {
      if (k.tag === 5 || k.tag === 6) b.appendChild(k.stateNode);
      else if (k.tag !== 4 && k.child !== null) {
        k.child.return = k, k = k.child;
        continue;
      }
      if (k === y) break;
      for (; k.sibling === null; ) {
        if (k.return === null || k.return === y) return;
        k = k.return;
      }
      k.sibling.return = k.return, k = k.sibling;
    }
  }, fd = function() {
  }, Ha = function(b, y, k, A) {
    var F = b.memoizedProps;
    if (F !== A) {
      b = y.stateNode, tv(fg.current);
      var U = null;
      switch (k) {
        case "input":
          F = pi(b, F), A = pi(b, A), U = [];
          break;
        case "select":
          F = J({}, F, { value: void 0 }), A = J({}, A, { value: void 0 }), U = [];
          break;
        case "textarea":
          F = io(b, F), A = io(b, A), U = [];
          break;
        default:
          typeof F.onClick != "function" && typeof A.onClick == "function" && (b.onclick = Mk);
      }
      lt(k, A);
      var le;
      k = null;
      for (it in F) if (!A.hasOwnProperty(it) && F.hasOwnProperty(it) && F[it] != null) if (it === "style") {
        var we = F[it];
        for (le in we) we.hasOwnProperty(le) && (k || (k = {}), k[le] = "");
      } else it !== "dangerouslySetInnerHTML" && it !== "children" && it !== "suppressContentEditableWarning" && it !== "suppressHydrationWarning" && it !== "autoFocus" && (r.hasOwnProperty(it) ? U || (U = []) : (U = U || []).push(it, null));
      for (it in A) {
        var Te = A[it];
        if (we = F != null ? F[it] : void 0, A.hasOwnProperty(it) && Te !== we && (Te != null || we != null)) if (it === "style") if (we) {
          for (le in we) !we.hasOwnProperty(le) || Te && Te.hasOwnProperty(le) || (k || (k = {}), k[le] = "");
          for (le in Te) Te.hasOwnProperty(le) && we[le] !== Te[le] && (k || (k = {}), k[le] = Te[le]);
        } else k || (U || (U = []), U.push(
          it,
          k
        )), k = Te;
        else it === "dangerouslySetInnerHTML" ? (Te = Te ? Te.__html : void 0, we = we ? we.__html : void 0, Te != null && we !== Te && (U = U || []).push(it, Te)) : it === "children" ? typeof Te != "string" && typeof Te != "number" || (U = U || []).push(it, "" + Te) : it !== "suppressContentEditableWarning" && it !== "suppressHydrationWarning" && (r.hasOwnProperty(it) ? (Te != null && it === "onScroll" && Cs("scroll", b), U || we === Te || (U = [])) : (U = U || []).push(it, Te));
      }
      k && (U = U || []).push("style", k);
      var it = U;
      (y.updateQueue = it) && (y.flags |= 4);
    }
  }, C8 = function(b, y, k, A) {
    k !== A && (y.flags |= 4);
  };
  function SS(b, y) {
    if (!xo) switch (b.tailMode) {
      case "hidden":
        y = b.tail;
        for (var k = null; y !== null; ) y.alternate !== null && (k = y), y = y.sibling;
        k === null ? b.tail = null : k.sibling = null;
        break;
      case "collapsed":
        k = b.tail;
        for (var A = null; k !== null; ) k.alternate !== null && (A = k), k = k.sibling;
        A === null ? y || b.tail === null ? b.tail = null : b.tail.sibling = null : A.sibling = null;
    }
  }
  function uc(b) {
    var y = b.alternate !== null && b.alternate.child === b.child, k = 0, A = 0;
    if (y) for (var F = b.child; F !== null; ) k |= F.lanes | F.childLanes, A |= F.subtreeFlags & 14680064, A |= F.flags & 14680064, F.return = b, F = F.sibling;
    else for (F = b.child; F !== null; ) k |= F.lanes | F.childLanes, A |= F.subtreeFlags, A |= F.flags, F.return = b, F = F.sibling;
    return b.subtreeFlags |= A, b.childLanes = k, y;
  }
  function yO(b, y, k) {
    var A = y.pendingProps;
    switch (Wk(y), y.tag) {
      case 2:
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return uc(y), null;
      case 1:
        return Ko(y.type) && ug(), uc(y), null;
      case 3:
        return A = y.stateNode, $0(), ks(wa), ks(Ao), hS(), A.pendingContext && (A.context = A.pendingContext, A.pendingContext = null), (b === null || b.child === null) && (ra(y) ? y.flags |= 4 : b === null || b.memoizedState.isDehydrated && (y.flags & 256) === 0 || (y.flags |= 1024, cf !== null && (RS(cf), cf = null))), fd(b, y), uc(y), null;
      case 5:
        cO(y);
        var F = tv(dS.current);
        if (k = y.type, b !== null && y.stateNode != null) Ha(b, y, k, A, F), b.ref !== y.ref && (y.flags |= 512, y.flags |= 2097152);
        else {
          if (!A) {
            if (y.stateNode === null) throw Error(t(166));
            return uc(y), null;
          }
          if (b = tv(fg.current), ra(y)) {
            A = y.stateNode, k = y.type;
            var U = y.memoizedProps;
            switch (A[th] = y, A[rS] = U, b = (y.mode & 1) !== 0, k) {
              case "dialog":
                Cs("cancel", A), Cs("close", A);
                break;
              case "iframe":
              case "object":
              case "embed":
                Cs("load", A);
                break;
              case "video":
              case "audio":
                for (F = 0; F < Jw.length; F++) Cs(Jw[F], A);
                break;
              case "source":
                Cs("error", A);
                break;
              case "img":
              case "image":
              case "link":
                Cs(
                  "error",
                  A
                ), Cs("load", A);
                break;
              case "details":
                Cs("toggle", A);
                break;
              case "input":
                tn(A, U), Cs("invalid", A);
                break;
              case "select":
                A._wrapperState = { wasMultiple: !!U.multiple }, Cs("invalid", A);
                break;
              case "textarea":
                nr(A, U), Cs("invalid", A);
            }
            lt(k, U), F = null;
            for (var le in U) if (U.hasOwnProperty(le)) {
              var we = U[le];
              le === "children" ? typeof we == "string" ? A.textContent !== we && (U.suppressHydrationWarning !== !0 && Ok(A.textContent, we, b), F = ["children", we]) : typeof we == "number" && A.textContent !== "" + we && (U.suppressHydrationWarning !== !0 && Ok(
                A.textContent,
                we,
                b
              ), F = ["children", "" + we]) : r.hasOwnProperty(le) && we != null && le === "onScroll" && Cs("scroll", A);
            }
            switch (k) {
              case "input":
                sn(A), qr(A, U, !0);
                break;
              case "textarea":
                sn(A), Hs(A);
                break;
              case "select":
              case "option":
                break;
              default:
                typeof U.onClick == "function" && (A.onclick = Mk);
            }
            A = F, y.updateQueue = A, A !== null && (y.flags |= 4);
          } else {
            le = F.nodeType === 9 ? F : F.ownerDocument, b === "http://www.w3.org/1999/xhtml" && (b = He(k)), b === "http://www.w3.org/1999/xhtml" ? k === "script" ? (b = le.createElement("div"), b.innerHTML = "<script><\/script>", b = b.removeChild(b.firstChild)) : typeof A.is == "string" ? b = le.createElement(k, { is: A.is }) : (b = le.createElement(k), k === "select" && (le = b, A.multiple ? le.multiple = !0 : A.size && (le.size = A.size))) : b = le.createElementNS(b, k), b[th] = y, b[rS] = A, X0(b, y, !1, !1), y.stateNode = b;
            e: {
              switch (le = Bt(k, A), k) {
                case "dialog":
                  Cs("cancel", b), Cs("close", b), F = A;
                  break;
                case "iframe":
                case "object":
                case "embed":
                  Cs("load", b), F = A;
                  break;
                case "video":
                case "audio":
                  for (F = 0; F < Jw.length; F++) Cs(Jw[F], b);
                  F = A;
                  break;
                case "source":
                  Cs("error", b), F = A;
                  break;
                case "img":
                case "image":
                case "link":
                  Cs(
                    "error",
                    b
                  ), Cs("load", b), F = A;
                  break;
                case "details":
                  Cs("toggle", b), F = A;
                  break;
                case "input":
                  tn(b, A), F = pi(b, A), Cs("invalid", b);
                  break;
                case "option":
                  F = A;
                  break;
                case "select":
                  b._wrapperState = { wasMultiple: !!A.multiple }, F = J({}, A, { value: void 0 }), Cs("invalid", b);
                  break;
                case "textarea":
                  nr(b, A), F = io(b, A), Cs("invalid", b);
                  break;
                default:
                  F = A;
              }
              lt(k, F), we = F;
              for (U in we) if (we.hasOwnProperty(U)) {
                var Te = we[U];
                U === "style" ? ii(b, Te) : U === "dangerouslySetInnerHTML" ? (Te = Te ? Te.__html : void 0, Te != null && oi(b, Te)) : U === "children" ? typeof Te == "string" ? (k !== "textarea" || Te !== "") && vi(b, Te) : typeof Te == "number" && vi(b, "" + Te) : U !== "suppressContentEditableWarning" && U !== "suppressHydrationWarning" && U !== "autoFocus" && (r.hasOwnProperty(U) ? Te != null && U === "onScroll" && Cs("scroll", b) : Te != null && L(b, U, Te, le));
              }
              switch (k) {
                case "input":
                  sn(b), qr(b, A, !1);
                  break;
                case "textarea":
                  sn(b), Hs(b);
                  break;
                case "option":
                  A.value != null && b.setAttribute("value", "" + et(A.value));
                  break;
                case "select":
                  b.multiple = !!A.multiple, U = A.value, U != null ? ts(b, !!A.multiple, U, !1) : A.defaultValue != null && ts(
                    b,
                    !!A.multiple,
                    A.defaultValue,
                    !0
                  );
                  break;
                default:
                  typeof F.onClick == "function" && (b.onclick = Mk);
              }
              switch (k) {
                case "button":
                case "input":
                case "select":
                case "textarea":
                  A = !!A.autoFocus;
                  break e;
                case "img":
                  A = !0;
                  break e;
                default:
                  A = !1;
              }
            }
            A && (y.flags |= 4);
          }
          y.ref !== null && (y.flags |= 512, y.flags |= 2097152);
        }
        return uc(y), null;
      case 6:
        if (b && y.stateNode != null) C8(b, y, b.memoizedProps, A);
        else {
          if (typeof A != "string" && y.stateNode === null) throw Error(t(166));
          if (k = tv(dS.current), tv(fg.current), ra(y)) {
            if (A = y.stateNode, k = y.memoizedProps, A[th] = y, (U = A.nodeValue !== k) && (b = Su, b !== null)) switch (b.tag) {
              case 3:
                Ok(A.nodeValue, k, (b.mode & 1) !== 0);
                break;
              case 5:
                b.memoizedProps.suppressHydrationWarning !== !0 && Ok(A.nodeValue, k, (b.mode & 1) !== 0);
            }
            U && (y.flags |= 4);
          } else A = (k.nodeType === 9 ? k : k.ownerDocument).createTextNode(A), A[th] = y, y.stateNode = A;
        }
        return uc(y), null;
      case 13:
        if (ks(Oo), A = y.memoizedState, b === null || b.memoizedState !== null && b.memoizedState.dehydrated !== null) {
          if (xo && Eu !== null && (y.mode & 1) !== 0 && (y.flags & 128) === 0) o8(), up(), y.flags |= 98560, U = !1;
          else if (U = ra(y), A !== null && A.dehydrated !== null) {
            if (b === null) {
              if (!U) throw Error(t(318));
              if (U = y.memoizedState, U = U !== null ? U.dehydrated : null, !U) throw Error(t(317));
              U[th] = y;
            } else up(), (y.flags & 128) === 0 && (y.memoizedState = null), y.flags |= 4;
            uc(y), U = !1;
          } else cf !== null && (RS(cf), cf = null), U = !0;
          if (!U) return y.flags & 65536 ? y : null;
        }
        return (y.flags & 128) !== 0 ? (y.lanes = k, y) : (A = A !== null, A !== (b !== null && b.memoizedState !== null) && A && (y.child.flags |= 8192, (y.mode & 1) !== 0 && (b === null || (Oo.current & 1) !== 0 ? Wa === 0 && (Wa = 3) : LO())), y.updateQueue !== null && (y.flags |= 4), uc(y), null);
      case 4:
        return $0(), fd(b, y), b === null && tS(y.stateNode.containerInfo), uc(y), null;
      case 10:
        return iO(y.type._context), uc(y), null;
      case 17:
        return Ko(y.type) && ug(), uc(y), null;
      case 19:
        if (ks(Oo), U = y.memoizedState, U === null) return uc(y), null;
        if (A = (y.flags & 128) !== 0, le = U.rendering, le === null) if (A) SS(U, !1);
        else {
          if (Wa !== 0 || b !== null && (b.flags & 128) !== 0) for (b = y.child; b !== null; ) {
            if (le = zk(b), le !== null) {
              for (y.flags |= 128, SS(U, !1), A = le.updateQueue, A !== null && (y.updateQueue = A, y.flags |= 4), y.subtreeFlags = 0, A = k, k = y.child; k !== null; ) U = k, b = A, U.flags &= 14680066, le = U.alternate, le === null ? (U.childLanes = 0, U.lanes = b, U.child = null, U.subtreeFlags = 0, U.memoizedProps = null, U.memoizedState = null, U.updateQueue = null, U.dependencies = null, U.stateNode = null) : (U.childLanes = le.childLanes, U.lanes = le.lanes, U.child = le.child, U.subtreeFlags = 0, U.deletions = null, U.memoizedProps = le.memoizedProps, U.memoizedState = le.memoizedState, U.updateQueue = le.updateQueue, U.type = le.type, b = le.dependencies, U.dependencies = b === null ? null : { lanes: b.lanes, firstContext: b.firstContext }), k = k.sibling;
              return oo(Oo, Oo.current & 1 | 2), y.child;
            }
            b = b.sibling;
          }
          U.tail !== null && kn() > eC && (y.flags |= 128, A = !0, SS(U, !1), y.lanes = 4194304);
        }
        else {
          if (!A) if (b = zk(le), b !== null) {
            if (y.flags |= 128, A = !0, k = b.updateQueue, k !== null && (y.updateQueue = k, y.flags |= 4), SS(U, !0), U.tail === null && U.tailMode === "hidden" && !le.alternate && !xo) return uc(y), null;
          } else 2 * kn() - U.renderingStartTime > eC && k !== 1073741824 && (y.flags |= 128, A = !0, SS(U, !1), y.lanes = 4194304);
          U.isBackwards ? (le.sibling = y.child, y.child = le) : (k = U.last, k !== null ? k.sibling = le : y.child = le, U.last = le);
        }
        return U.tail !== null ? (y = U.tail, U.rendering = y, U.tail = y.sibling, U.renderingStartTime = kn(), y.sibling = null, k = Oo.current, oo(Oo, A ? k & 1 | 2 : k & 1), y) : (uc(y), null);
      case 22:
      case 23:
        return xO(), A = y.memoizedState !== null, b !== null && b.memoizedState !== null !== A && (y.flags |= 8192), A && (y.mode & 1) !== 0 ? (gd & 1073741824) !== 0 && (uc(y), y.subtreeFlags & 6 && (y.flags |= 8192)) : uc(y), null;
      case 24:
        return null;
      case 25:
        return null;
    }
    throw Error(t(156, y.tag));
  }
  function w8(b, y) {
    switch (Wk(y), y.tag) {
      case 1:
        return Ko(y.type) && ug(), b = y.flags, b & 65536 ? (y.flags = b & -65537 | 128, y) : null;
      case 3:
        return $0(), ks(wa), ks(Ao), hS(), b = y.flags, (b & 65536) !== 0 && (b & 128) === 0 ? (y.flags = b & -65537 | 128, y) : null;
      case 5:
        return cO(y), null;
      case 13:
        if (ks(Oo), b = y.memoizedState, b !== null && b.dehydrated !== null) {
          if (y.alternate === null) throw Error(t(340));
          up();
        }
        return b = y.flags, b & 65536 ? (y.flags = b & -65537 | 128, y) : null;
      case 19:
        return ks(Oo), null;
      case 4:
        return $0(), null;
      case 10:
        return iO(y.type._context), null;
      case 22:
      case 23:
        return xO(), null;
      case 24:
        return null;
      default:
        return null;
    }
  }
  var av = !1, Il = !1, vX = typeof WeakSet == "function" ? WeakSet : Set, Dn = null;
  function Gm(b, y) {
    var k = b.ref;
    if (k !== null) if (typeof k == "function") try {
      k(null);
    } catch (A) {
      Yo(b, y, A);
    }
    else k.current = null;
  }
  function CO(b, y, k) {
    try {
      k();
    } catch (A) {
      Yo(b, y, A);
    }
  }
  var wO = !1;
  function yX(b, y) {
    if (Kb = Im, b = Am(), N0(b)) {
      if ("selectionStart" in b) var k = { start: b.selectionStart, end: b.selectionEnd };
      else e: {
        k = (k = b.ownerDocument) && k.defaultView || window;
        var A = k.getSelection && k.getSelection();
        if (A && A.rangeCount !== 0) {
          k = A.anchorNode;
          var F = A.anchorOffset, U = A.focusNode;
          A = A.focusOffset;
          try {
            k.nodeType, U.nodeType;
          } catch {
            k = null;
            break e;
          }
          var le = 0, we = -1, Te = -1, it = 0, It = 0, Mt = b, kt = null;
          t: for (; ; ) {
            for (var yn; Mt !== k || F !== 0 && Mt.nodeType !== 3 || (we = le + F), Mt !== U || A !== 0 && Mt.nodeType !== 3 || (Te = le + A), Mt.nodeType === 3 && (le += Mt.nodeValue.length), (yn = Mt.firstChild) !== null; )
              kt = Mt, Mt = yn;
            for (; ; ) {
              if (Mt === b) break t;
              if (kt === k && ++it === F && (we = le), kt === U && ++It === A && (Te = le), (yn = Mt.nextSibling) !== null) break;
              Mt = kt, kt = Mt.parentNode;
            }
            Mt = yn;
          }
          k = we === -1 || Te === -1 ? null : { start: we, end: Te };
        } else k = null;
      }
      k = k || { start: 0, end: 0 };
    } else k = null;
    for (iS = { focusedElem: b, selectionRange: k }, Im = !1, Dn = y; Dn !== null; ) if (y = Dn, b = y.child, (y.subtreeFlags & 1028) !== 0 && b !== null) b.return = y, Dn = b;
    else for (; Dn !== null; ) {
      y = Dn;
      try {
        var Rn = y.alternate;
        if ((y.flags & 1024) !== 0) switch (y.tag) {
          case 0:
          case 11:
          case 15:
            break;
          case 1:
            if (Rn !== null) {
              var Pn = Rn.memoizedProps, aa = Rn.memoizedState, $e = y.stateNode, Oe = $e.getSnapshotBeforeUpdate(y.elementType === y.type ? Pn : Tu(y.type, Pn), aa);
              $e.__reactInternalSnapshotBeforeUpdate = Oe;
            }
            break;
          case 3:
            var Qe = y.stateNode.containerInfo;
            Qe.nodeType === 1 ? Qe.textContent = "" : Qe.nodeType === 9 && Qe.documentElement && Qe.removeChild(Qe.documentElement);
            break;
          case 5:
          case 6:
          case 4:
          case 17:
            break;
          default:
            throw Error(t(163));
        }
      } catch (Ut) {
        Yo(y, y.return, Ut);
      }
      if (b = y.sibling, b !== null) {
        b.return = y.return, Dn = b;
        break;
      }
      Dn = y.return;
    }
    return Rn = wO, wO = !1, Rn;
  }
  function Z0(b, y, k) {
    var A = y.updateQueue;
    if (A = A !== null ? A.lastEffect : null, A !== null) {
      var F = A = A.next;
      do {
        if ((F.tag & b) === b) {
          var U = F.destroy;
          F.destroy = void 0, U !== void 0 && CO(y, k, U);
        }
        F = F.next;
      } while (F !== A);
    }
  }
  function _D(b, y) {
    if (y = y.updateQueue, y = y !== null ? y.lastEffect : null, y !== null) {
      var k = y = y.next;
      do {
        if ((k.tag & b) === b) {
          var A = k.create;
          k.destroy = A();
        }
        k = k.next;
      } while (k !== y);
    }
  }
  function bD(b) {
    var y = b.ref;
    if (y !== null) {
      var k = b.stateNode;
      switch (b.tag) {
        case 5:
          b = k;
          break;
        default:
          b = k;
      }
      typeof y == "function" ? y(b) : y.current = b;
    }
  }
  function S8(b) {
    var y = b.alternate;
    y !== null && (b.alternate = null, S8(y)), b.child = null, b.deletions = null, b.sibling = null, b.tag === 5 && (y = b.stateNode, y !== null && (delete y[th], delete y[rS], delete y[q2], delete y[K2], delete y[H0])), b.stateNode = null, b.return = null, b.dependencies = null, b.memoizedProps = null, b.memoizedState = null, b.pendingProps = null, b.stateNode = null, b.updateQueue = null;
  }
  function vD(b) {
    return b.tag === 5 || b.tag === 3 || b.tag === 4;
  }
  function ES(b) {
    e: for (; ; ) {
      for (; b.sibling === null; ) {
        if (b.return === null || vD(b.return)) return null;
        b = b.return;
      }
      for (b.sibling.return = b.return, b = b.sibling; b.tag !== 5 && b.tag !== 6 && b.tag !== 18; ) {
        if (b.flags & 2 || b.child === null || b.tag === 4) continue e;
        b.child.return = b, b = b.child;
      }
      if (!(b.flags & 2)) return b.stateNode;
    }
  }
  function gg(b, y, k) {
    var A = b.tag;
    if (A === 5 || A === 6) b = b.stateNode, y ? k.nodeType === 8 ? k.parentNode.insertBefore(b, y) : k.insertBefore(b, y) : (k.nodeType === 8 ? (y = k.parentNode, y.insertBefore(b, k)) : (y = k, y.appendChild(b)), k = k._reactRootContainer, k != null || y.onclick !== null || (y.onclick = Mk));
    else if (A !== 4 && (b = b.child, b !== null)) for (gg(b, y, k), b = b.sibling; b !== null; ) gg(b, y, k), b = b.sibling;
  }
  function pg(b, y, k) {
    var A = b.tag;
    if (A === 5 || A === 6) b = b.stateNode, y ? k.insertBefore(b, y) : k.appendChild(b);
    else if (A !== 4 && (b = b.child, b !== null)) for (pg(b, y, k), b = b.sibling; b !== null; ) pg(b, y, k), b = b.sibling;
  }
  var Mo = null, Bc = !1;
  function sh(b, y, k) {
    for (k = k.child; k !== null; ) hp(b, y, k), k = k.sibling;
  }
  function hp(b, y, k) {
    if (Ll && typeof Ll.onCommitFiberUnmount == "function") try {
      Ll.onCommitFiberUnmount(nf, k);
    } catch {
    }
    switch (k.tag) {
      case 5:
        Il || Gm(k, y);
      case 6:
        var A = Mo, F = Bc;
        Mo = null, sh(b, y, k), Mo = A, Bc = F, Mo !== null && (Bc ? (b = Mo, k = k.stateNode, b.nodeType === 8 ? b.parentNode.removeChild(k) : b.removeChild(k)) : Mo.removeChild(k.stateNode));
        break;
      case 18:
        Mo !== null && (Bc ? (b = Mo, k = k.stateNode, b.nodeType === 8 ? F0(b.parentNode, k) : b.nodeType === 1 && F0(b, k), Qd(b)) : F0(Mo, k.stateNode));
        break;
      case 4:
        A = Mo, F = Bc, Mo = k.stateNode.containerInfo, Bc = !0, sh(b, y, k), Mo = A, Bc = F;
        break;
      case 0:
      case 11:
      case 14:
      case 15:
        if (!Il && (A = k.updateQueue, A !== null && (A = A.lastEffect, A !== null))) {
          F = A = A.next;
          do {
            var U = F, le = U.destroy;
            U = U.tag, le !== void 0 && ((U & 2) !== 0 || (U & 4) !== 0) && CO(k, y, le), F = F.next;
          } while (F !== A);
        }
        sh(b, y, k);
        break;
      case 1:
        if (!Il && (Gm(k, y), A = k.stateNode, typeof A.componentWillUnmount == "function")) try {
          A.props = k.memoizedProps, A.state = k.memoizedState, A.componentWillUnmount();
        } catch (we) {
          Yo(k, y, we);
        }
        sh(b, y, k);
        break;
      case 21:
        sh(b, y, k);
        break;
      case 22:
        k.mode & 1 ? (Il = (A = Il) || k.memoizedState !== null, sh(b, y, k), Il = A) : sh(b, y, k);
        break;
      default:
        sh(b, y, k);
    }
  }
  function E8(b) {
    var y = b.updateQueue;
    if (y !== null) {
      b.updateQueue = null;
      var k = b.stateNode;
      k === null && (k = b.stateNode = new vX()), y.forEach(function(A) {
        var F = xX.bind(null, b, A);
        k.has(A) || (k.add(A), A.then(F, F));
      });
    }
  }
  function df(b, y) {
    var k = y.deletions;
    if (k !== null) for (var A = 0; A < k.length; A++) {
      var F = k[A];
      try {
        var U = b, le = y, we = le;
        e: for (; we !== null; ) {
          switch (we.tag) {
            case 5:
              Mo = we.stateNode, Bc = !1;
              break e;
            case 3:
              Mo = we.stateNode.containerInfo, Bc = !0;
              break e;
            case 4:
              Mo = we.stateNode.containerInfo, Bc = !0;
              break e;
          }
          we = we.return;
        }
        if (Mo === null) throw Error(t(160));
        hp(U, le, F), Mo = null, Bc = !1;
        var Te = F.alternate;
        Te !== null && (Te.return = null), F.return = null;
      } catch (it) {
        Yo(F, y, it);
      }
    }
    if (y.subtreeFlags & 12854) for (y = y.child; y !== null; ) x8(y, b), y = y.sibling;
  }
  function x8(b, y) {
    var k = b.alternate, A = b.flags;
    switch (b.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        if (df(y, b), hf(b), A & 4) {
          try {
            Z0(3, b, b.return), _D(3, b);
          } catch (Pn) {
            Yo(b, b.return, Pn);
          }
          try {
            Z0(5, b, b.return);
          } catch (Pn) {
            Yo(b, b.return, Pn);
          }
        }
        break;
      case 1:
        df(y, b), hf(b), A & 512 && k !== null && Gm(k, k.return);
        break;
      case 5:
        if (df(y, b), hf(b), A & 512 && k !== null && Gm(k, k.return), b.flags & 32) {
          var F = b.stateNode;
          try {
            vi(F, "");
          } catch (Pn) {
            Yo(b, b.return, Pn);
          }
        }
        if (A & 4 && (F = b.stateNode, F != null)) {
          var U = b.memoizedProps, le = k !== null ? k.memoizedProps : U, we = b.type, Te = b.updateQueue;
          if (b.updateQueue = null, Te !== null) try {
            we === "input" && U.type === "radio" && U.name != null && Vr(F, U), Bt(we, le);
            var it = Bt(we, U);
            for (le = 0; le < Te.length; le += 2) {
              var It = Te[le], Mt = Te[le + 1];
              It === "style" ? ii(F, Mt) : It === "dangerouslySetInnerHTML" ? oi(F, Mt) : It === "children" ? vi(F, Mt) : L(F, It, Mt, it);
            }
            switch (we) {
              case "input":
                tr(F, U);
                break;
              case "textarea":
                _s(F, U);
                break;
              case "select":
                var kt = F._wrapperState.wasMultiple;
                F._wrapperState.wasMultiple = !!U.multiple;
                var yn = U.value;
                yn != null ? ts(F, !!U.multiple, yn, !1) : kt !== !!U.multiple && (U.defaultValue != null ? ts(
                  F,
                  !!U.multiple,
                  U.defaultValue,
                  !0
                ) : ts(F, !!U.multiple, U.multiple ? [] : "", !1));
            }
            F[rS] = U;
          } catch (Pn) {
            Yo(b, b.return, Pn);
          }
        }
        break;
      case 6:
        if (df(y, b), hf(b), A & 4) {
          if (b.stateNode === null) throw Error(t(162));
          F = b.stateNode, U = b.memoizedProps;
          try {
            F.nodeValue = U;
          } catch (Pn) {
            Yo(b, b.return, Pn);
          }
        }
        break;
      case 3:
        if (df(y, b), hf(b), A & 4 && k !== null && k.memoizedState.isDehydrated) try {
          Qd(y.containerInfo);
        } catch (Pn) {
          Yo(b, b.return, Pn);
        }
        break;
      case 4:
        df(y, b), hf(b);
        break;
      case 13:
        df(y, b), hf(b), F = b.child, F.flags & 8192 && (U = F.memoizedState !== null, F.stateNode.isHidden = U, !U || F.alternate !== null && F.alternate.memoizedState !== null || (EO = kn())), A & 4 && E8(b);
        break;
      case 22:
        if (It = k !== null && k.memoizedState !== null, b.mode & 1 ? (Il = (it = Il) || It, df(y, b), Il = it) : df(y, b), hf(b), A & 8192) {
          if (it = b.memoizedState !== null, (b.stateNode.isHidden = it) && !It && (b.mode & 1) !== 0) for (Dn = b, It = b.child; It !== null; ) {
            for (Mt = Dn = It; Dn !== null; ) {
              switch (kt = Dn, yn = kt.child, kt.tag) {
                case 0:
                case 11:
                case 14:
                case 15:
                  Z0(4, kt, kt.return);
                  break;
                case 1:
                  Gm(kt, kt.return);
                  var Rn = kt.stateNode;
                  if (typeof Rn.componentWillUnmount == "function") {
                    A = kt, k = kt.return;
                    try {
                      y = A, Rn.props = y.memoizedProps, Rn.state = y.memoizedState, Rn.componentWillUnmount();
                    } catch (Pn) {
                      Yo(A, k, Pn);
                    }
                  }
                  break;
                case 5:
                  Gm(kt, kt.return);
                  break;
                case 22:
                  if (kt.memoizedState !== null) {
                    T8(Mt);
                    continue;
                  }
              }
              yn !== null ? (yn.return = kt, Dn = yn) : T8(Mt);
            }
            It = It.sibling;
          }
          e: for (It = null, Mt = b; ; ) {
            if (Mt.tag === 5) {
              if (It === null) {
                It = Mt;
                try {
                  F = Mt.stateNode, it ? (U = F.style, typeof U.setProperty == "function" ? U.setProperty("display", "none", "important") : U.display = "none") : (we = Mt.stateNode, Te = Mt.memoizedProps.style, le = Te != null && Te.hasOwnProperty("display") ? Te.display : null, we.style.display = En("display", le));
                } catch (Pn) {
                  Yo(b, b.return, Pn);
                }
              }
            } else if (Mt.tag === 6) {
              if (It === null) try {
                Mt.stateNode.nodeValue = it ? "" : Mt.memoizedProps;
              } catch (Pn) {
                Yo(b, b.return, Pn);
              }
            } else if ((Mt.tag !== 22 && Mt.tag !== 23 || Mt.memoizedState === null || Mt === b) && Mt.child !== null) {
              Mt.child.return = Mt, Mt = Mt.child;
              continue;
            }
            if (Mt === b) break e;
            for (; Mt.sibling === null; ) {
              if (Mt.return === null || Mt.return === b) break e;
              It === Mt && (It = null), Mt = Mt.return;
            }
            It === Mt && (It = null), Mt.sibling.return = Mt.return, Mt = Mt.sibling;
          }
        }
        break;
      case 19:
        df(y, b), hf(b), A & 4 && E8(b);
        break;
      case 21:
        break;
      default:
        df(
          y,
          b
        ), hf(b);
    }
  }
  function hf(b) {
    var y = b.flags;
    if (y & 2) {
      try {
        e: {
          for (var k = b.return; k !== null; ) {
            if (vD(k)) {
              var A = k;
              break e;
            }
            k = k.return;
          }
          throw Error(t(160));
        }
        switch (A.tag) {
          case 5:
            var F = A.stateNode;
            A.flags & 32 && (vi(F, ""), A.flags &= -33);
            var U = ES(b);
            pg(b, U, F);
            break;
          case 3:
          case 4:
            var le = A.stateNode.containerInfo, we = ES(b);
            gg(b, we, le);
            break;
          default:
            throw Error(t(161));
        }
      } catch (Te) {
        Yo(b, b.return, Te);
      }
      b.flags &= -3;
    }
    y & 4096 && (b.flags &= -4097);
  }
  function xS(b, y, k) {
    Dn = b, L8(b);
  }
  function L8(b, y, k) {
    for (var A = (b.mode & 1) !== 0; Dn !== null; ) {
      var F = Dn, U = F.child;
      if (F.tag === 22 && A) {
        var le = F.memoizedState !== null || av;
        if (!le) {
          var we = F.alternate, Te = we !== null && we.memoizedState !== null || Il;
          we = av;
          var it = Il;
          if (av = le, (Il = Te) && !it) for (Dn = F; Dn !== null; ) le = Dn, Te = le.child, le.tag === 22 && le.memoizedState !== null ? LS(F) : Te !== null ? (Te.return = le, Dn = Te) : LS(F);
          for (; U !== null; ) Dn = U, L8(U), U = U.sibling;
          Dn = F, av = we, Il = it;
        }
        SO(b);
      } else (F.subtreeFlags & 8772) !== 0 && U !== null ? (U.return = F, Dn = U) : SO(b);
    }
  }
  function SO(b) {
    for (; Dn !== null; ) {
      var y = Dn;
      if ((y.flags & 8772) !== 0) {
        var k = y.alternate;
        try {
          if ((y.flags & 8772) !== 0) switch (y.tag) {
            case 0:
            case 11:
            case 15:
              Il || _D(5, y);
              break;
            case 1:
              var A = y.stateNode;
              if (y.flags & 4 && !Il) if (k === null) A.componentDidMount();
              else {
                var F = y.elementType === y.type ? k.memoizedProps : Tu(y.type, k.memoizedProps);
                A.componentDidUpdate(F, k.memoizedState, A.__reactInternalSnapshotBeforeUpdate);
              }
              var U = y.updateQueue;
              U !== null && oO(y, U, A);
              break;
            case 3:
              var le = y.updateQueue;
              if (le !== null) {
                if (k = null, y.child !== null) switch (y.child.tag) {
                  case 5:
                    k = y.child.stateNode;
                    break;
                  case 1:
                    k = y.child.stateNode;
                }
                oO(y, le, k);
              }
              break;
            case 5:
              var we = y.stateNode;
              if (k === null && y.flags & 4) {
                k = we;
                var Te = y.memoizedProps;
                switch (y.type) {
                  case "button":
                  case "input":
                  case "select":
                  case "textarea":
                    Te.autoFocus && k.focus();
                    break;
                  case "img":
                    Te.src && (k.src = Te.src);
                }
              }
              break;
            case 6:
              break;
            case 4:
              break;
            case 12:
              break;
            case 13:
              if (y.memoizedState === null) {
                var it = y.alternate;
                if (it !== null) {
                  var It = it.memoizedState;
                  if (It !== null) {
                    var Mt = It.dehydrated;
                    Mt !== null && Qd(Mt);
                  }
                }
              }
              break;
            case 19:
            case 17:
            case 21:
            case 22:
            case 23:
            case 25:
              break;
            default:
              throw Error(t(163));
          }
          Il || y.flags & 512 && bD(y);
        } catch (kt) {
          Yo(y, y.return, kt);
        }
      }
      if (y === b) {
        Dn = null;
        break;
      }
      if (k = y.sibling, k !== null) {
        k.return = y.return, Dn = k;
        break;
      }
      Dn = y.return;
    }
  }
  function T8(b) {
    for (; Dn !== null; ) {
      var y = Dn;
      if (y === b) {
        Dn = null;
        break;
      }
      var k = y.sibling;
      if (k !== null) {
        k.return = y.return, Dn = k;
        break;
      }
      Dn = y.return;
    }
  }
  function LS(b) {
    for (; Dn !== null; ) {
      var y = Dn;
      try {
        switch (y.tag) {
          case 0:
          case 11:
          case 15:
            var k = y.return;
            try {
              _D(4, y);
            } catch (Te) {
              Yo(y, k, Te);
            }
            break;
          case 1:
            var A = y.stateNode;
            if (typeof A.componentDidMount == "function") {
              var F = y.return;
              try {
                A.componentDidMount();
              } catch (Te) {
                Yo(y, F, Te);
              }
            }
            var U = y.return;
            try {
              bD(y);
            } catch (Te) {
              Yo(y, U, Te);
            }
            break;
          case 5:
            var le = y.return;
            try {
              bD(y);
            } catch (Te) {
              Yo(y, le, Te);
            }
        }
      } catch (Te) {
        Yo(y, y.return, Te);
      }
      if (y === b) {
        Dn = null;
        break;
      }
      var we = y.sibling;
      if (we !== null) {
        we.return = y.return, Dn = we;
        break;
      }
      Dn = y.return;
    }
  }
  var k8 = Math.ceil, yD = T.ReactCurrentDispatcher, lv = T.ReactCurrentOwner, dc = T.ReactCurrentBatchConfig, br = 0, xa = null, oa = null, Nl = 0, gd = 0, Q0 = wu(0), Wa = 0, cv = null, uv = 0, dv = 0, TS = 0, J0 = null, Iu = null, EO = 0, eC = 1 / 0, fp = null, qm = !1, kS = null, oh = null, CD = !1, Km = null, DS = 0, tC = 0, nC = null, hv = -1, IS = 0;
  function ao() {
    return (br & 6) !== 0 ? kn() : hv !== -1 ? hv : hv = kn();
  }
  function pd(b) {
    return (b.mode & 1) === 0 ? 1 : (br & 2) !== 0 && Nl !== 0 ? Nl & -Nl : Jb.transition !== null ? (IS === 0 && (IS = Hb()), IS) : (b = Nr, b !== 0 || (b = window.event, b = b === void 0 ? 16 : zw(b.type)), b);
  }
  function md(b, y, k, A) {
    if (50 < tC) throw tC = 0, nC = null, Error(t(185));
    Dm(b, k, A), ((br & 2) === 0 || b !== xa) && (b === xa && ((br & 2) === 0 && (dv |= k), Wa === 4 && Ym(b, Nl)), rl(b, A), k === 1 && br === 0 && (y.mode & 1) === 0 && (eC = kn() + 500, oS && Pc()));
  }
  function rl(b, y) {
    var k = b.callbackNode;
    y0(b, y);
    var A = sg(b, b === xa ? Nl : 0);
    if (A === 0) k !== null && Be(k), b.callbackNode = null, b.callbackPriority = 0;
    else if (y = A & -A, b.callbackPriority !== y) {
      if (k != null && Be(k), y === 1) b.tag === 0 ? Y2(OS.bind(null, b)) : Mm(OS.bind(null, b)), mX(function() {
        (br & 6) === 0 && Pc();
      }), k = null;
      else {
        switch (Uw(A)) {
          case 1:
            k = bn;
            break;
          case 4:
            k = mo;
            break;
          case 16:
            k = ns;
            break;
          case 536870912:
            k = vs;
            break;
          default:
            k = ns;
        }
        k = O8(k, D8.bind(null, b));
      }
      b.callbackPriority = y, b.callbackNode = k;
    }
  }
  function D8(b, y) {
    if (hv = -1, IS = 0, (br & 6) !== 0) throw Error(t(327));
    var k = b.callbackNode;
    if (iC() && b.callbackNode !== k) return null;
    var A = sg(b, b === xa ? Nl : 0);
    if (A === 0) return null;
    if ((A & 30) !== 0 || (A & b.expiredLanes) !== 0 || y) y = ED(b, A);
    else {
      y = A;
      var F = br;
      br |= 2;
      var U = I8();
      (xa !== b || Nl !== y) && (fp = null, eC = kn() + 500, gv(b, y));
      do
        try {
          wX();
          break;
        } catch (we) {
          SD(b, we);
        }
      while (!0);
      nO(), yD.current = U, br = F, oa !== null ? y = 0 : (xa = null, Nl = 0, y = Wa);
    }
    if (y !== 0) {
      if (y === 2 && (F = np(b), F !== 0 && (A = F, y = NS(b, F))), y === 1) throw k = cv, gv(b, 0), Ym(b, A), rl(b, kn()), k;
      if (y === 6) Ym(b, A);
      else {
        if (F = b.current.alternate, (A & 30) === 0 && !AS(F) && (y = ED(b, A), y === 2 && (U = np(b), U !== 0 && (A = U, y = NS(b, U))), y === 1)) throw k = cv, gv(b, 0), Ym(b, A), rl(b, kn()), k;
        switch (b.finishedWork = F, b.finishedLanes = A, y) {
          case 0:
          case 1:
            throw Error(t(345));
          case 2:
            pv(b, Iu, fp);
            break;
          case 3:
            if (Ym(b, A), (A & 130023424) === A && (y = EO + 500 - kn(), 10 < y)) {
              if (sg(b, 0) !== 0) break;
              if (F = b.suspendedLanes, (F & A) !== A) {
                ao(), b.pingedLanes |= b.suspendedLanes & F;
                break;
              }
              b.timeoutHandle = Pk(pv.bind(null, b, Iu, fp), y);
              break;
            }
            pv(b, Iu, fp);
            break;
          case 4:
            if (Ym(b, A), (A & 4194240) === A) break;
            for (y = b.eventTimes, F = -1; 0 < A; ) {
              var le = 31 - Ac(A);
              U = 1 << le, le = y[le], le > F && (F = le), A &= ~U;
            }
            if (A = F, A = kn() - A, A = (120 > A ? 120 : 480 > A ? 480 : 1080 > A ? 1080 : 1920 > A ? 1920 : 3e3 > A ? 3e3 : 4320 > A ? 4320 : 1960 * k8(A / 1960)) - A, 10 < A) {
              b.timeoutHandle = Pk(pv.bind(null, b, Iu, fp), A);
              break;
            }
            pv(b, Iu, fp);
            break;
          case 5:
            pv(b, Iu, fp);
            break;
          default:
            throw Error(t(329));
        }
      }
    }
    return rl(b, kn()), b.callbackNode === k ? D8.bind(null, b) : null;
  }
  function NS(b, y) {
    var k = J0;
    return b.current.memoizedState.isDehydrated && (gv(b, y).flags |= 256), b = ED(b, y), b !== 2 && (y = Iu, Iu = k, y !== null && RS(y)), b;
  }
  function RS(b) {
    Iu === null ? Iu = b : Iu.push.apply(Iu, b);
  }
  function AS(b) {
    for (var y = b; ; ) {
      if (y.flags & 16384) {
        var k = y.updateQueue;
        if (k !== null && (k = k.stores, k !== null)) for (var A = 0; A < k.length; A++) {
          var F = k[A], U = F.getSnapshot;
          F = F.value;
          try {
            if (!of(U(), F)) return !1;
          } catch {
            return !1;
          }
        }
      }
      if (k = y.child, y.subtreeFlags & 16384 && k !== null) k.return = y, y = k;
      else {
        if (y === b) break;
        for (; y.sibling === null; ) {
          if (y.return === null || y.return === b) return !0;
          y = y.return;
        }
        y.sibling.return = y.return, y = y.sibling;
      }
    }
    return !0;
  }
  function Ym(b, y) {
    for (y &= ~TS, y &= ~dv, b.suspendedLanes |= y, b.pingedLanes &= ~y, b = b.expirationTimes; 0 < y; ) {
      var k = 31 - Ac(y), A = 1 << k;
      b[k] = -1, y &= ~A;
    }
  }
  function OS(b) {
    if ((br & 6) !== 0) throw Error(t(327));
    iC();
    var y = sg(b, 0);
    if ((y & 1) === 0) return rl(b, kn()), null;
    var k = ED(b, y);
    if (b.tag !== 0 && k === 2) {
      var A = np(b);
      A !== 0 && (y = A, k = NS(b, A));
    }
    if (k === 1) throw k = cv, gv(b, 0), Ym(b, y), rl(b, kn()), k;
    if (k === 6) throw Error(t(345));
    return b.finishedWork = b.current.alternate, b.finishedLanes = y, pv(b, Iu, fp), rl(b, kn()), null;
  }
  function wD(b, y) {
    var k = br;
    br |= 1;
    try {
      return b(y);
    } finally {
      br = k, br === 0 && (eC = kn() + 500, oS && Pc());
    }
  }
  function fv(b) {
    Km !== null && Km.tag === 0 && (br & 6) === 0 && iC();
    var y = br;
    br |= 1;
    var k = dc.transition, A = Nr;
    try {
      if (dc.transition = null, Nr = 1, b) return b();
    } finally {
      Nr = A, dc.transition = k, br = y, (br & 6) === 0 && Pc();
    }
  }
  function xO() {
    gd = Q0.current, ks(Q0);
  }
  function gv(b, y) {
    b.finishedWork = null, b.finishedLanes = 0;
    var k = b.timeoutHandle;
    if (k !== -1 && (b.timeoutHandle = -1, n8(k)), oa !== null) for (k = oa.return; k !== null; ) {
      var A = k;
      switch (Wk(A), A.tag) {
        case 1:
          A = A.type.childContextTypes, A != null && ug();
          break;
        case 3:
          $0(), ks(wa), ks(Ao), hS();
          break;
        case 5:
          cO(A);
          break;
        case 4:
          $0();
          break;
        case 13:
          ks(Oo);
          break;
        case 19:
          ks(Oo);
          break;
        case 10:
          iO(A.type._context);
          break;
        case 22:
        case 23:
          xO();
      }
      k = k.return;
    }
    if (xa = b, oa = b = Xm(b.current, null), Nl = gd = y, Wa = 0, cv = null, TS = dv = uv = 0, Iu = J0 = null, ev !== null) {
      for (y = 0; y < ev.length; y++) if (k = ev[y], A = k.interleaved, A !== null) {
        k.interleaved = null;
        var F = A.next, U = k.pending;
        if (U !== null) {
          var le = U.next;
          U.next = F, A.next = le;
        }
        k.pending = A;
      }
      ev = null;
    }
    return b;
  }
  function SD(b, y) {
    do {
      var k = oa;
      try {
        if (nO(), ei.current = Is, $k) {
          for (var A = zi.memoizedState; A !== null; ) {
            var F = A.queue;
            F !== null && (F.pending = null), A = A.next;
          }
          $k = !1;
        }
        if (Lr = 0, Ba = $s = zi = null, fS = !1, gS = 0, lv.current = null, k === null || k.return === null) {
          Wa = 1, cv = y, oa = null;
          break;
        }
        e: {
          var U = b, le = k.return, we = k, Te = y;
          if (y = Nl, we.flags |= 32768, Te !== null && typeof Te == "object" && typeof Te.then == "function") {
            var it = Te, It = we, Mt = It.tag;
            if ((It.mode & 1) === 0 && (Mt === 0 || Mt === 11 || Mt === 15)) {
              var kt = It.alternate;
              kt ? (It.updateQueue = kt.updateQueue, It.memoizedState = kt.memoizedState, It.lanes = kt.lanes) : (It.updateQueue = null, It.memoizedState = null);
            }
            var yn = mO(le);
            if (yn !== null) {
              yn.flags &= -257, b8(yn, le, we, U, y), yn.mode & 1 && pO(U, it, y), y = yn, Te = it;
              var Rn = y.updateQueue;
              if (Rn === null) {
                var Pn = /* @__PURE__ */ new Set();
                Pn.add(Te), y.updateQueue = Pn;
              } else Rn.add(Te);
              break e;
            } else {
              if ((y & 1) === 0) {
                pO(U, it, y), LO();
                break e;
              }
              Te = Error(t(426));
            }
          } else if (xo && we.mode & 1) {
            var aa = mO(le);
            if (aa !== null) {
              (aa.flags & 65536) === 0 && (aa.flags |= 256), b8(aa, le, we, U, y), lS(jm(Te, we));
              break e;
            }
          }
          U = Te = jm(Te, we), Wa !== 4 && (Wa = 2), J0 === null ? J0 = [U] : J0.push(U), U = le;
          do {
            switch (U.tag) {
              case 3:
                U.flags |= 65536, y &= -y, U.lanes |= y;
                var $e = yS(U, Te, y);
                d8(U, $e);
                break e;
              case 1:
                we = Te;
                var Oe = U.type, Qe = U.stateNode;
                if ((U.flags & 128) === 0 && (typeof Oe.getDerivedStateFromError == "function" || Qe !== null && typeof Qe.componentDidCatch == "function" && (oh === null || !oh.has(Qe)))) {
                  U.flags |= 65536, y &= -y, U.lanes |= y;
                  var Ut = _8(U, we, y);
                  d8(U, Ut);
                  break e;
                }
            }
            U = U.return;
          } while (U !== null);
        }
        N8(k);
      } catch (mn) {
        y = mn, oa === k && k !== null && (oa = k = k.return);
        continue;
      }
      break;
    } while (!0);
  }
  function I8() {
    var b = yD.current;
    return yD.current = Is, b === null ? Is : b;
  }
  function LO() {
    (Wa === 0 || Wa === 3 || Wa === 2) && (Wa = 4), xa === null || (uv & 268435455) === 0 && (dv & 268435455) === 0 || Ym(xa, Nl);
  }
  function ED(b, y) {
    var k = br;
    br |= 2;
    var A = I8();
    (xa !== b || Nl !== y) && (fp = null, gv(b, y));
    do
      try {
        CX();
        break;
      } catch (F) {
        SD(b, F);
      }
    while (!0);
    if (nO(), br = k, yD.current = A, oa !== null) throw Error(t(261));
    return xa = null, Nl = 0, Wa;
  }
  function CX() {
    for (; oa !== null; ) TO(oa);
  }
  function wX() {
    for (; oa !== null && !Lt(); ) TO(oa);
  }
  function TO(b) {
    var y = DO(b.alternate, b, gd);
    b.memoizedProps = b.pendingProps, y === null ? N8(b) : oa = y, lv.current = null;
  }
  function N8(b) {
    var y = b;
    do {
      var k = y.alternate;
      if (b = y.return, (y.flags & 32768) === 0) {
        if (k = yO(k, y, gd), k !== null) {
          oa = k;
          return;
        }
      } else {
        if (k = w8(k, y), k !== null) {
          k.flags &= 32767, oa = k;
          return;
        }
        if (b !== null) b.flags |= 32768, b.subtreeFlags = 0, b.deletions = null;
        else {
          Wa = 6, oa = null;
          return;
        }
      }
      if (y = y.sibling, y !== null) {
        oa = y;
        return;
      }
      oa = y = b;
    } while (y !== null);
    Wa === 0 && (Wa = 5);
  }
  function pv(b, y, k) {
    var A = Nr, F = dc.transition;
    try {
      dc.transition = null, Nr = 1, SX(b, y, k, A);
    } finally {
      dc.transition = F, Nr = A;
    }
    return null;
  }
  function SX(b, y, k, A) {
    do
      iC();
    while (Km !== null);
    if ((br & 6) !== 0) throw Error(t(327));
    k = b.finishedWork;
    var F = b.finishedLanes;
    if (k === null) return null;
    if (b.finishedWork = null, b.finishedLanes = 0, k === b.current) throw Error(t(177));
    b.callbackNode = null, b.callbackPriority = 0;
    var U = k.lanes | k.childLanes;
    if (Ww(b, U), b === xa && (oa = xa = null, Nl = 0), (k.subtreeFlags & 2064) === 0 && (k.flags & 2064) === 0 || CD || (CD = !0, O8(ns, function() {
      return iC(), null;
    })), U = (k.flags & 15990) !== 0, (k.subtreeFlags & 15990) !== 0 || U) {
      U = dc.transition, dc.transition = null;
      var le = Nr;
      Nr = 1;
      var we = br;
      br |= 4, lv.current = null, yX(b, k), x8(k, b), q6(iS), Im = !!Kb, iS = Kb = null, b.current = k, xS(k), ci(), br = we, Nr = le, dc.transition = U;
    } else b.current = k;
    if (CD && (CD = !1, Km = b, DS = F), U = b.pendingLanes, U === 0 && (oh = null), Bw(k.stateNode), rl(b, kn()), y !== null) for (A = b.onRecoverableError, k = 0; k < y.length; k++) F = y[k], A(F.value, { componentStack: F.stack, digest: F.digest });
    if (qm) throw qm = !1, b = kS, kS = null, b;
    return (DS & 1) !== 0 && b.tag !== 0 && iC(), U = b.pendingLanes, (U & 1) !== 0 ? b === nC ? tC++ : (tC = 0, nC = b) : tC = 0, Pc(), null;
  }
  function iC() {
    if (Km !== null) {
      var b = Uw(DS), y = dc.transition, k = Nr;
      try {
        if (dc.transition = null, Nr = 16 > b ? 16 : b, Km === null) var A = !1;
        else {
          if (b = Km, Km = null, DS = 0, (br & 6) !== 0) throw Error(t(331));
          var F = br;
          for (br |= 4, Dn = b.current; Dn !== null; ) {
            var U = Dn, le = U.child;
            if ((Dn.flags & 16) !== 0) {
              var we = U.deletions;
              if (we !== null) {
                for (var Te = 0; Te < we.length; Te++) {
                  var it = we[Te];
                  for (Dn = it; Dn !== null; ) {
                    var It = Dn;
                    switch (It.tag) {
                      case 0:
                      case 11:
                      case 15:
                        Z0(8, It, U);
                    }
                    var Mt = It.child;
                    if (Mt !== null) Mt.return = It, Dn = Mt;
                    else for (; Dn !== null; ) {
                      It = Dn;
                      var kt = It.sibling, yn = It.return;
                      if (S8(It), It === it) {
                        Dn = null;
                        break;
                      }
                      if (kt !== null) {
                        kt.return = yn, Dn = kt;
                        break;
                      }
                      Dn = yn;
                    }
                  }
                }
                var Rn = U.alternate;
                if (Rn !== null) {
                  var Pn = Rn.child;
                  if (Pn !== null) {
                    Rn.child = null;
                    do {
                      var aa = Pn.sibling;
                      Pn.sibling = null, Pn = aa;
                    } while (Pn !== null);
                  }
                }
                Dn = U;
              }
            }
            if ((U.subtreeFlags & 2064) !== 0 && le !== null) le.return = U, Dn = le;
            else e: for (; Dn !== null; ) {
              if (U = Dn, (U.flags & 2048) !== 0) switch (U.tag) {
                case 0:
                case 11:
                case 15:
                  Z0(9, U, U.return);
              }
              var $e = U.sibling;
              if ($e !== null) {
                $e.return = U.return, Dn = $e;
                break e;
              }
              Dn = U.return;
            }
          }
          var Oe = b.current;
          for (Dn = Oe; Dn !== null; ) {
            le = Dn;
            var Qe = le.child;
            if ((le.subtreeFlags & 2064) !== 0 && Qe !== null) Qe.return = le, Dn = Qe;
            else e: for (le = Oe; Dn !== null; ) {
              if (we = Dn, (we.flags & 2048) !== 0) try {
                switch (we.tag) {
                  case 0:
                  case 11:
                  case 15:
                    _D(9, we);
                }
              } catch (mn) {
                Yo(we, we.return, mn);
              }
              if (we === le) {
                Dn = null;
                break e;
              }
              var Ut = we.sibling;
              if (Ut !== null) {
                Ut.return = we.return, Dn = Ut;
                break e;
              }
              Dn = we.return;
            }
          }
          if (br = F, Pc(), Ll && typeof Ll.onPostCommitFiberRoot == "function") try {
            Ll.onPostCommitFiberRoot(nf, b);
          } catch {
          }
          A = !0;
        }
        return A;
      } finally {
        Nr = k, dc.transition = y;
      }
    }
    return !1;
  }
  function R8(b, y, k) {
    y = jm(k, y), y = yS(b, y, 1), b = Vm(b, y, 1), y = ao(), b !== null && (Dm(b, 1, y), rl(b, y));
  }
  function Yo(b, y, k) {
    if (b.tag === 3) R8(b, b, k);
    else for (; y !== null; ) {
      if (y.tag === 3) {
        R8(y, b, k);
        break;
      } else if (y.tag === 1) {
        var A = y.stateNode;
        if (typeof y.type.getDerivedStateFromError == "function" || typeof A.componentDidCatch == "function" && (oh === null || !oh.has(A))) {
          b = jm(k, b), b = _8(y, b, 1), y = Vm(y, b, 1), b = ao(), y !== null && (Dm(y, 1, b), rl(y, b));
          break;
        }
      }
      y = y.return;
    }
  }
  function kO(b, y, k) {
    var A = b.pingCache;
    A !== null && A.delete(y), y = ao(), b.pingedLanes |= b.suspendedLanes & k, xa === b && (Nl & k) === k && (Wa === 4 || Wa === 3 && (Nl & 130023424) === Nl && 500 > kn() - EO ? gv(b, 0) : TS |= k), rl(b, y);
  }
  function A8(b, y) {
    y === 0 && ((b.mode & 1) === 0 ? y = 1 : (y = Tm, Tm <<= 1, (Tm & 130023424) === 0 && (Tm = 4194304)));
    var k = ao();
    b = hg(b, y), b !== null && (Dm(b, y, k), rl(b, k));
  }
  function EX(b) {
    var y = b.memoizedState, k = 0;
    y !== null && (k = y.retryLane), A8(b, k);
  }
  function xX(b, y) {
    var k = 0;
    switch (b.tag) {
      case 13:
        var A = b.stateNode, F = b.memoizedState;
        F !== null && (k = F.retryLane);
        break;
      case 19:
        A = b.stateNode;
        break;
      default:
        throw Error(t(314));
    }
    A !== null && A.delete(y), A8(b, k);
  }
  var DO;
  DO = function(b, y, k) {
    if (b !== null) if (b.memoizedProps !== y.pendingProps || wa.current) il = !0;
    else {
      if ((b.lanes & k) === 0 && (y.flags & 128) === 0) return il = !1, mD(b, y, k);
      il = (b.flags & 131072) !== 0;
    }
    else il = !1, xo && (y.flags & 1048576) !== 0 && r8(y, Bm, y.index);
    switch (y.lanes = 0, y.tag) {
      case 2:
        var A = y.type;
        rh(b, y), b = y.pendingProps;
        var F = dd(y, Ao.current);
        U0(y, k), F = Ci(null, y, A, b, F, k);
        var U = Um();
        return y.flags |= 1, typeof F == "object" && F !== null && typeof F.render == "function" && F.$$typeof === void 0 ? (y.tag = 1, y.memoizedState = null, y.updateQueue = null, Ko(A) ? (U = !0, Zb(y)) : U = !1, y.memoizedState = F.state !== null && F.state !== void 0 ? F.state : null, Wm(y), F.updater = aD, y.stateNode = F, F._reactInternals = y, fO(y, A, b, k), y = _O(null, y, A, !0, U, k)) : (y.tag = 0, xo && U && X2(y), sa(null, y, F, k), y = y.child), y;
      case 16:
        A = y.elementType;
        e: {
          switch (rh(b, y), b = y.pendingProps, F = A._init, A = F(A._payload), y.type = A, F = y.tag = TX(A), b = Tu(A, b), F) {
            case 0:
              y = dD(null, y, A, b, k);
              break e;
            case 1:
              y = bX(null, y, A, b, k);
              break e;
            case 11:
              y = uD(null, y, A, b, k);
              break e;
            case 14:
              y = ku(null, y, A, Tu(A.type, b), k);
              break e;
          }
          throw Error(t(
            306,
            A,
            ""
          ));
        }
        return y;
      case 0:
        return A = y.type, F = y.pendingProps, F = y.elementType === A ? F : Tu(A, F), dD(b, y, A, F, k);
      case 1:
        return A = y.type, F = y.pendingProps, F = y.elementType === A ? F : Tu(A, F), bX(b, y, A, F, k);
      case 3:
        e: {
          if (hD(y), b === null) throw Error(t(387));
          A = y.pendingProps, U = y.memoizedState, F = U.element, u8(b, y), Uk(y, A, null, k);
          var le = y.memoizedState;
          if (A = le.element, U.isDehydrated) if (U = { element: A, isDehydrated: !1, cache: le.cache, pendingSuspenseBoundaries: le.pendingSuspenseBoundaries, transitions: le.transitions }, y.updateQueue.baseState = U, y.memoizedState = U, y.flags & 256) {
            F = jm(Error(t(423)), y), y = Y0(b, y, A, k, F);
            break e;
          } else if (A !== F) {
            F = jm(Error(t(424)), y), y = Y0(b, y, A, k, F);
            break e;
          } else for (Eu = af(y.stateNode.containerInfo.firstChild), Su = y, xo = !0, cf = null, k = kl(y, null, A, k), y.child = k; k; ) k.flags = k.flags & -3 | 4096, k = k.sibling;
          else {
            if (up(), A === F) {
              y = Dl(b, y, k);
              break e;
            }
            sa(b, y, A, k);
          }
          y = y.child;
        }
        return y;
      case 5:
        return lO(y), b === null && eO(y), A = y.type, F = y.pendingProps, U = b !== null ? b.memoizedProps : null, le = F.children, Yb(A, F) ? le = null : U !== null && Yb(A, U) && (y.flags |= 32), CS(b, y), sa(b, y, le, k), y.child;
      case 6:
        return b === null && eO(y), null;
      case 13:
        return v8(b, y, k);
      case 4:
        return aO(y, y.stateNode.containerInfo), A = y.pendingProps, b === null ? y.child = uf(y, null, A, k) : sa(b, y, A, k), y.child;
      case 11:
        return A = y.type, F = y.pendingProps, F = y.elementType === A ? F : Tu(A, F), uD(b, y, A, F, k);
      case 7:
        return sa(b, y, y.pendingProps, k), y.child;
      case 8:
        return sa(b, y, y.pendingProps.children, k), y.child;
      case 12:
        return sa(b, y, y.pendingProps.children, k), y.child;
      case 10:
        e: {
          if (A = y.type._context, F = y.pendingProps, U = y.memoizedProps, le = F.value, oo(on, A._currentValue), A._currentValue = le, U !== null) if (of(U.value, le)) {
            if (U.children === F.children && !wa.current) {
              y = Dl(b, y, k);
              break e;
            }
          } else for (U = y.child, U !== null && (U.return = y); U !== null; ) {
            var we = U.dependencies;
            if (we !== null) {
              le = U.child;
              for (var Te = we.firstContext; Te !== null; ) {
                if (Te.context === A) {
                  if (U.tag === 1) {
                    Te = dp(-1, k & -k), Te.tag = 2;
                    var it = U.updateQueue;
                    if (it !== null) {
                      it = it.shared;
                      var It = it.pending;
                      It === null ? Te.next = Te : (Te.next = It.next, It.next = Te), it.pending = Te;
                    }
                  }
                  U.lanes |= k, Te = U.alternate, Te !== null && (Te.lanes |= k), rO(
                    U.return,
                    k,
                    y
                  ), we.lanes |= k;
                  break;
                }
                Te = Te.next;
              }
            } else if (U.tag === 10) le = U.type === y.type ? null : U.child;
            else if (U.tag === 18) {
              if (le = U.return, le === null) throw Error(t(341));
              le.lanes |= k, we = le.alternate, we !== null && (we.lanes |= k), rO(le, k, y), le = U.sibling;
            } else le = U.child;
            if (le !== null) le.return = U;
            else for (le = U; le !== null; ) {
              if (le === y) {
                le = null;
                break;
              }
              if (U = le.sibling, U !== null) {
                U.return = le.return, le = U;
                break;
              }
              le = le.return;
            }
            U = le;
          }
          sa(b, y, F.children, k), y = y.child;
        }
        return y;
      case 9:
        return F = y.type, A = y.pendingProps.children, U0(y, k), F = Ds(F), A = A(F), y.flags |= 1, sa(b, y, A, k), y.child;
      case 14:
        return A = y.type, F = Tu(A, y.pendingProps), F = Tu(A.type, F), ku(b, y, A, F, k);
      case 15:
        return ov(b, y, y.type, y.pendingProps, k);
      case 17:
        return A = y.type, F = y.pendingProps, F = y.elementType === A ? F : Tu(A, F), rh(b, y), y.tag = 1, Ko(A) ? (b = !0, Zb(y)) : b = !1, U0(y, k), m8(y, A, F), fO(y, A, F, k), _O(null, y, A, !0, b, k);
      case 19:
        return Du(b, y, k);
      case 22:
        return Xi(b, y, k);
    }
    throw Error(t(156, y.tag));
  };
  function O8(b, y) {
    return fe(b, y);
  }
  function LX(b, y, k, A) {
    this.tag = b, this.key = k, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = y, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = A, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null;
  }
  function ah(b, y, k, A) {
    return new LX(b, y, k, A);
  }
  function IO(b) {
    return b = b.prototype, !(!b || !b.isReactComponent);
  }
  function TX(b) {
    if (typeof b == "function") return IO(b) ? 1 : 0;
    if (b != null) {
      if (b = b.$$typeof, b === K) return 11;
      if (b === G) return 14;
    }
    return 2;
  }
  function Xm(b, y) {
    var k = b.alternate;
    return k === null ? (k = ah(b.tag, y, b.key, b.mode), k.elementType = b.elementType, k.type = b.type, k.stateNode = b.stateNode, k.alternate = b, b.alternate = k) : (k.pendingProps = y, k.type = b.type, k.flags = 0, k.subtreeFlags = 0, k.deletions = null), k.flags = b.flags & 14680064, k.childLanes = b.childLanes, k.lanes = b.lanes, k.child = b.child, k.memoizedProps = b.memoizedProps, k.memoizedState = b.memoizedState, k.updateQueue = b.updateQueue, y = b.dependencies, k.dependencies = y === null ? null : { lanes: y.lanes, firstContext: y.firstContext }, k.sibling = b.sibling, k.index = b.index, k.ref = b.ref, k;
  }
  function xD(b, y, k, A, F, U) {
    var le = 2;
    if (A = b, typeof b == "function") IO(b) && (le = 1);
    else if (typeof b == "string") le = 5;
    else e: switch (b) {
      case R:
        return Zm(k.children, F, U, y);
      case M:
        le = 8, F |= 8;
        break;
      case B:
        return b = ah(12, k, y, F | 2), b.elementType = B, b.lanes = U, b;
      case X:
        return b = ah(13, k, y, F), b.elementType = X, b.lanes = U, b;
      case Y:
        return b = ah(19, k, y, F), b.elementType = Y, b.lanes = U, b;
      case oe:
        return rC(k, F, U, y);
      default:
        if (typeof b == "object" && b !== null) switch (b.$$typeof) {
          case H:
            le = 10;
            break e;
          case j:
            le = 9;
            break e;
          case K:
            le = 11;
            break e;
          case G:
            le = 14;
            break e;
          case Q:
            le = 16, A = null;
            break e;
        }
        throw Error(t(130, b == null ? b : typeof b, ""));
    }
    return y = ah(le, k, y, F), y.elementType = b, y.type = A, y.lanes = U, y;
  }
  function Zm(b, y, k, A) {
    return b = ah(7, b, A, y), b.lanes = k, b;
  }
  function rC(b, y, k, A) {
    return b = ah(22, b, A, y), b.elementType = oe, b.lanes = k, b.stateNode = { isHidden: !1 }, b;
  }
  function mv(b, y, k) {
    return b = ah(6, b, null, y), b.lanes = k, b;
  }
  function NO(b, y, k) {
    return y = ah(4, b.children !== null ? b.children : [], b.key, y), y.lanes = k, y.stateNode = { containerInfo: b.containerInfo, pendingChildren: null, implementation: b.implementation }, y;
  }
  function M8(b, y, k, A, F) {
    this.tag = y, this.containerInfo = b, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.callbackNode = this.pendingContext = this.context = null, this.callbackPriority = 0, this.eventTimes = Wb(0), this.expirationTimes = Wb(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = Wb(0), this.identifierPrefix = A, this.onRecoverableError = F, this.mutableSourceEagerHydrationData = null;
  }
  function LD(b, y, k, A, F, U, le, we, Te) {
    return b = new M8(b, y, k, we, Te), y === 1 ? (y = 1, U === !0 && (y |= 8)) : y = 0, U = ah(3, null, null, y), b.current = U, U.stateNode = b, U.memoizedState = { element: A, isDehydrated: k, cache: null, transitions: null, pendingSuspenseBoundaries: null }, Wm(U), b;
  }
  function P8(b, y, k) {
    var A = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
    return { $$typeof: N, key: A == null ? null : "" + A, children: b, containerInfo: y, implementation: k };
  }
  function F8(b) {
    if (!b) return lr;
    b = b._reactInternals;
    e: {
      if (nn(b) !== b || b.tag !== 1) throw Error(t(170));
      var y = b;
      do {
        switch (y.tag) {
          case 3:
            y = y.stateNode.context;
            break e;
          case 1:
            if (Ko(y.type)) {
              y = y.stateNode.__reactInternalMemoizedMergedChildContext;
              break e;
            }
        }
        y = y.return;
      } while (y !== null);
      throw Error(t(171));
    }
    if (b.tag === 1) {
      var k = b.type;
      if (Ko(k)) return i8(b, k, y);
    }
    return y;
  }
  function RO(b, y, k, A, F, U, le, we, Te) {
    return b = LD(k, A, !0, b, F, U, le, we, Te), b.context = F8(null), k = b.current, A = ao(), F = pd(k), U = dp(A, F), U.callback = y ?? null, Vm(k, U, F), b.current.lanes = F, Dm(b, F, A), rl(b, A), b;
  }
  function TD(b, y, k, A) {
    var F = y.current, U = ao(), le = pd(F);
    return k = F8(k), y.context === null ? y.context = k : y.pendingContext = k, y = dp(U, le), y.payload = { element: b }, A = A === void 0 ? null : A, A !== null && (y.callback = A), b = Vm(F, y, le), b !== null && (md(b, F, le, U), Vk(b, F, le)), le;
  }
  function kD(b) {
    if (b = b.current, !b.child) return null;
    switch (b.child.tag) {
      case 5:
        return b.child.stateNode;
      default:
        return b.child.stateNode;
    }
  }
  function B8(b, y) {
    if (b = b.memoizedState, b !== null && b.dehydrated !== null) {
      var k = b.retryLane;
      b.retryLane = k !== 0 && k < y ? k : y;
    }
  }
  function DD(b, y) {
    B8(b, y), (b = b.alternate) && B8(b, y);
  }
  function H8() {
    return null;
  }
  var AO = typeof reportError == "function" ? reportError : function(b) {
    console.error(b);
  };
  function Qm(b) {
    this._internalRoot = b;
  }
  ID.prototype.render = Qm.prototype.render = function(b) {
    var y = this._internalRoot;
    if (y === null) throw Error(t(409));
    TD(b, y, null, null);
  }, ID.prototype.unmount = Qm.prototype.unmount = function() {
    var b = this._internalRoot;
    if (b !== null) {
      this._internalRoot = null;
      var y = b.containerInfo;
      fv(function() {
        TD(null, b, null, null);
      }), y[lp] = null;
    }
  };
  function ID(b) {
    this._internalRoot = b;
  }
  ID.prototype.unstable_scheduleHydration = function(b) {
    if (b) {
      var y = og();
      b = { blockedOn: null, target: b, priority: y };
      for (var k = 0; k < rf.length && y !== 0 && y < rf[k].priority; k++) ;
      rf.splice(k, 0, b), k === 0 && w0(b);
    }
  };
  function OO(b) {
    return !(!b || b.nodeType !== 1 && b.nodeType !== 9 && b.nodeType !== 11);
  }
  function ND(b) {
    return !(!b || b.nodeType !== 1 && b.nodeType !== 9 && b.nodeType !== 11 && (b.nodeType !== 8 || b.nodeValue !== " react-mount-point-unstable "));
  }
  function W8() {
  }
  function kX(b, y, k, A, F) {
    if (F) {
      if (typeof A == "function") {
        var U = A;
        A = function() {
          var it = kD(le);
          U.call(it);
        };
      }
      var le = RO(y, A, b, 0, null, !1, !1, "", W8);
      return b._reactRootContainer = le, b[lp] = le.current, tS(b.nodeType === 8 ? b.parentNode : b), fv(), le;
    }
    for (; F = b.lastChild; ) b.removeChild(F);
    if (typeof A == "function") {
      var we = A;
      A = function() {
        var it = kD(Te);
        we.call(it);
      };
    }
    var Te = LD(b, 0, !1, null, null, !1, !1, "", W8);
    return b._reactRootContainer = Te, b[lp] = Te.current, tS(b.nodeType === 8 ? b.parentNode : b), fv(function() {
      TD(y, Te, k, A);
    }), Te;
  }
  function RD(b, y, k, A, F) {
    var U = k._reactRootContainer;
    if (U) {
      var le = U;
      if (typeof F == "function") {
        var we = F;
        F = function() {
          var Te = kD(le);
          we.call(Te);
        };
      }
      TD(y, le, b, F);
    } else le = kX(k, y, b, F, A);
    return kD(le);
  }
  C0 = function(b) {
    switch (b.tag) {
      case 3:
        var y = b.stateNode;
        if (y.current.memoizedState.isDehydrated) {
          var k = vu(y.pendingLanes);
          k !== 0 && (Vw(y, k | 1), rl(y, kn()), (br & 6) === 0 && (eC = kn() + 500, Pc()));
        }
        break;
      case 13:
        fv(function() {
          var A = hg(b, 1);
          if (A !== null) {
            var F = ao();
            md(A, b, 1, F);
          }
        }), DD(b, 1);
    }
  }, Rr = function(b) {
    if (b.tag === 13) {
      var y = hg(b, 134217728);
      if (y !== null) {
        var k = ao();
        md(y, b, 134217728, k);
      }
      DD(b, 134217728);
    }
  }, Sk = function(b) {
    if (b.tag === 13) {
      var y = pd(b), k = hg(b, y);
      if (k !== null) {
        var A = ao();
        md(k, b, y, A);
      }
      DD(b, y);
    }
  }, og = function() {
    return Nr;
  }, Ai = function(b, y) {
    var k = Nr;
    try {
      return Nr = b, y();
    } finally {
      Nr = k;
    }
  }, yi = function(b, y, k) {
    switch (y) {
      case "input":
        if (tr(b, k), y = k.name, k.type === "radio" && y != null) {
          for (k = b; k.parentNode; ) k = k.parentNode;
          for (k = k.querySelectorAll("input[name=" + JSON.stringify("" + y) + '][type="radio"]'), y = 0; y < k.length; y++) {
            var A = k[y];
            if (A !== b && A.form === b.form) {
              var F = cp(A);
              if (!F) throw Error(t(90));
              Vt(A), tr(A, F);
            }
          }
        }
        break;
      case "textarea":
        _s(b, k);
        break;
      case "select":
        y = k.value, y != null && ts(b, !!k.multiple, y, !1);
    }
  }, Ri = wD, So = fv;
  var V8 = { usingClientEntryPoint: !1, Events: [sS, Jn, cp, Ws, El, wD] }, MS = { findFiberByHostInstance: Xb, bundleType: 0, version: "18.3.1", rendererPackageName: "react-dom" }, DX = { bundleType: MS.bundleType, version: MS.version, rendererPackageName: MS.rendererPackageName, rendererConfig: MS.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: T.ReactCurrentDispatcher, findHostInstanceByFiber: function(b) {
    return b = Nt(b), b === null ? null : b.stateNode;
  }, findFiberByHostInstance: MS.findFiberByHostInstance || H8, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.3.1-next-f1338f8080-20240426" };
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
    var PS = __REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!PS.isDisabled && PS.supportsFiber) try {
      nf = PS.inject(DX), Ll = PS;
    } catch {
    }
  }
  return fh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = V8, fh.createPortal = function(b, y) {
    var k = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
    if (!OO(y)) throw Error(t(200));
    return P8(b, y, null, k);
  }, fh.createRoot = function(b, y) {
    if (!OO(b)) throw Error(t(299));
    var k = !1, A = "", F = AO;
    return y != null && (y.unstable_strictMode === !0 && (k = !0), y.identifierPrefix !== void 0 && (A = y.identifierPrefix), y.onRecoverableError !== void 0 && (F = y.onRecoverableError)), y = LD(b, 1, !1, null, null, k, !1, A, F), b[lp] = y.current, tS(b.nodeType === 8 ? b.parentNode : b), new Qm(y);
  }, fh.findDOMNode = function(b) {
    if (b == null) return null;
    if (b.nodeType === 1) return b;
    var y = b._reactInternals;
    if (y === void 0)
      throw typeof b.render == "function" ? Error(t(188)) : (b = Object.keys(b).join(","), Error(t(268, b)));
    return b = Nt(y), b = b === null ? null : b.stateNode, b;
  }, fh.flushSync = function(b) {
    return fv(b);
  }, fh.hydrate = function(b, y, k) {
    if (!ND(y)) throw Error(t(200));
    return RD(null, b, y, !0, k);
  }, fh.hydrateRoot = function(b, y, k) {
    if (!OO(b)) throw Error(t(405));
    var A = k != null && k.hydratedSources || null, F = !1, U = "", le = AO;
    if (k != null && (k.unstable_strictMode === !0 && (F = !0), k.identifierPrefix !== void 0 && (U = k.identifierPrefix), k.onRecoverableError !== void 0 && (le = k.onRecoverableError)), y = RO(y, null, b, 1, k ?? null, F, !1, U, le), b[lp] = y.current, tS(b), A) for (b = 0; b < A.length; b++) k = A[b], F = k._getVersion, F = F(k._source), y.mutableSourceEagerHydrationData == null ? y.mutableSourceEagerHydrationData = [k, F] : y.mutableSourceEagerHydrationData.push(
      k,
      F
    );
    return new ID(y);
  }, fh.render = function(b, y, k) {
    if (!ND(y)) throw Error(t(200));
    return RD(null, b, y, !1, k);
  }, fh.unmountComponentAtNode = function(b) {
    if (!ND(b)) throw Error(t(40));
    return b._reactRootContainer ? (fv(function() {
      RD(null, null, b, !1, function() {
        b._reactRootContainer = null, b[lp] = null;
      });
    }), !0) : !1;
  }, fh.unstable_batchedUpdates = wD, fh.unstable_renderSubtreeIntoContainer = function(b, y, k, A) {
    if (!ND(k)) throw Error(t(200));
    if (b == null || b._reactInternals === void 0) throw Error(t(38));
    return RD(b, y, k, !1, A);
  }, fh.version = "18.3.1-next-f1338f8080-20240426", fh;
}
var gh = {}, XEe;
function UQe() {
  if (XEe) return gh;
  XEe = 1;
  var i = {};
  /**
   * @license React
   * react-dom.development.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  return i.NODE_ENV !== "production" && (function() {
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
    var e = lB(), t = sMe(), n = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, r = !1;
    function s(f) {
      r = f;
    }
    function o(f) {
      if (!r) {
        for (var p = arguments.length, C = new Array(p > 1 ? p - 1 : 0), x = 1; x < p; x++)
          C[x - 1] = arguments[x];
        l("warn", f, C);
      }
    }
    function a(f) {
      if (!r) {
        for (var p = arguments.length, C = new Array(p > 1 ? p - 1 : 0), x = 1; x < p; x++)
          C[x - 1] = arguments[x];
        l("error", f, C);
      }
    }
    function l(f, p, C) {
      {
        var x = n.ReactDebugCurrentFrame, I = x.getStackAddendum();
        I !== "" && (p += "%s", C = C.concat([I]));
        var O = C.map(function(W) {
          return String(W);
        });
        O.unshift("Warning: " + p), Function.prototype.apply.call(console[f], console, O);
      }
    }
    var c = 0, u = 1, d = 2, h = 3, g = 4, m = 5, _ = 6, v = 7, w = 8, E = 9, L = 10, T = 11, D = 12, N = 13, R = 14, M = 15, B = 16, H = 17, j = 18, K = 19, X = 21, Y = 22, G = 23, Q = 24, oe = 25, Z = !0, pe = !1, J = !1, ae = !1, be = !1, re = !0, ze = !0, Ve = !0, st = !0, ot = /* @__PURE__ */ new Set(), et = {}, at = {};
    function en(f, p) {
      sn(f, p), sn(f + "Capture", p);
    }
    function sn(f, p) {
      et[f] && a("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", f), et[f] = p;
      {
        var C = f.toLowerCase();
        at[C] = f, f === "onDoubleClick" && (at.ondblclick = f);
      }
      for (var x = 0; x < p.length; x++)
        ot.add(p[x]);
    }
    var Vt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", Bi = Object.prototype.hasOwnProperty;
    function pi(f) {
      {
        var p = typeof Symbol == "function" && Symbol.toStringTag, C = p && f[Symbol.toStringTag] || f.constructor.name || "Object";
        return C;
      }
    }
    function tn(f) {
      try {
        return Vr(f), !1;
      } catch {
        return !0;
      }
    }
    function Vr(f) {
      return "" + f;
    }
    function tr(f, p) {
      if (tn(f))
        return a("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", p, pi(f)), Vr(f);
    }
    function qr(f) {
      if (tn(f))
        return a("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pi(f)), Vr(f);
    }
    function Bs(f, p) {
      if (tn(f))
        return a("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", p, pi(f)), Vr(f);
    }
    function Ts(f, p) {
      if (tn(f))
        return a("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", p, pi(f)), Vr(f);
    }
    function ts(f) {
      if (tn(f))
        return a("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", pi(f)), Vr(f);
    }
    function io(f) {
      if (tn(f))
        return a("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", pi(f)), Vr(f);
    }
    var nr = 0, _s = 1, Hs = 2, He = 3, yt = 4, Ln = 5, oi = 6, vi = ":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", Dt = vi + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", cn = new RegExp("^[" + vi + "][" + Dt + "]*$"), En = {}, ii = {};
    function li(f) {
      return Bi.call(ii, f) ? !0 : Bi.call(En, f) ? !1 : cn.test(f) ? (ii[f] = !0, !0) : (En[f] = !0, a("Invalid attribute name: `%s`", f), !1);
    }
    function lt(f, p, C) {
      return p !== null ? p.type === nr : C ? !1 : f.length > 2 && (f[0] === "o" || f[0] === "O") && (f[1] === "n" || f[1] === "N");
    }
    function Bt(f, p, C, x) {
      if (C !== null && C.type === nr)
        return !1;
      switch (typeof p) {
        case "function":
        // $FlowIssue symbol is perfectly valid here
        case "symbol":
          return !0;
        case "boolean": {
          if (x)
            return !1;
          if (C !== null)
            return !C.acceptsBooleans;
          var I = f.toLowerCase().slice(0, 5);
          return I !== "data-" && I !== "aria-";
        }
        default:
          return !1;
      }
    }
    function Mn(f, p, C, x) {
      if (p === null || typeof p > "u" || Bt(f, p, C, x))
        return !0;
      if (x)
        return !1;
      if (C !== null)
        switch (C.type) {
          case He:
            return !p;
          case yt:
            return p === !1;
          case Ln:
            return isNaN(p);
          case oi:
            return isNaN(p) || p < 1;
        }
      return !1;
    }
    function gn(f) {
      return Ni.hasOwnProperty(f) ? Ni[f] : null;
    }
    function yi(f, p, C, x, I, O, W) {
      this.acceptsBooleans = p === Hs || p === He || p === yt, this.attributeName = x, this.attributeNamespace = I, this.mustUseProperty = C, this.propertyName = f, this.type = p, this.sanitizeURL = O, this.removeEmptyString = W;
    }
    var Ni = {}, qi = [
      "children",
      "dangerouslySetInnerHTML",
      // TODO: This prevents the assignment of defaultValue to regular
      // elements (not just inputs). Now that ReactDOMInput assigns to the
      // defaultValue property -- do we need this?
      "defaultValue",
      "defaultChecked",
      "innerHTML",
      "suppressContentEditableWarning",
      "suppressHydrationWarning",
      "style"
    ];
    qi.forEach(function(f) {
      Ni[f] = new yi(
        f,
        nr,
        !1,
        // mustUseProperty
        f,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(f) {
      var p = f[0], C = f[1];
      Ni[p] = new yi(
        p,
        _s,
        !1,
        // mustUseProperty
        C,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(f) {
      Ni[f] = new yi(
        f,
        Hs,
        !1,
        // mustUseProperty
        f.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(f) {
      Ni[f] = new yi(
        f,
        Hs,
        !1,
        // mustUseProperty
        f,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "allowFullScreen",
      "async",
      // Note: there is a special case that prevents it from being written to the DOM
      // on the client side because the browsers are inconsistent. Instead we call focus().
      "autoFocus",
      "autoPlay",
      "controls",
      "default",
      "defer",
      "disabled",
      "disablePictureInPicture",
      "disableRemotePlayback",
      "formNoValidate",
      "hidden",
      "loop",
      "noModule",
      "noValidate",
      "open",
      "playsInline",
      "readOnly",
      "required",
      "reversed",
      "scoped",
      "seamless",
      // Microdata
      "itemScope"
    ].forEach(function(f) {
      Ni[f] = new yi(
        f,
        He,
        !1,
        // mustUseProperty
        f.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "checked",
      // Note: `option.selected` is not updated if `select.multiple` is
      // disabled with `removeAttribute`. We have special logic for handling this.
      "multiple",
      "muted",
      "selected"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(f) {
      Ni[f] = new yi(
        f,
        He,
        !0,
        // mustUseProperty
        f,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "capture",
      "download"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(f) {
      Ni[f] = new yi(
        f,
        yt,
        !1,
        // mustUseProperty
        f,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "cols",
      "rows",
      "size",
      "span"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(f) {
      Ni[f] = new yi(
        f,
        oi,
        !1,
        // mustUseProperty
        f,
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), ["rowSpan", "start"].forEach(function(f) {
      Ni[f] = new yi(
        f,
        Ln,
        !1,
        // mustUseProperty
        f.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    });
    var Ur = /[\-\:]([a-z])/g, Ws = function(f) {
      return f[1].toUpperCase();
    };
    [
      "accent-height",
      "alignment-baseline",
      "arabic-form",
      "baseline-shift",
      "cap-height",
      "clip-path",
      "clip-rule",
      "color-interpolation",
      "color-interpolation-filters",
      "color-profile",
      "color-rendering",
      "dominant-baseline",
      "enable-background",
      "fill-opacity",
      "fill-rule",
      "flood-color",
      "flood-opacity",
      "font-family",
      "font-size",
      "font-size-adjust",
      "font-stretch",
      "font-style",
      "font-variant",
      "font-weight",
      "glyph-name",
      "glyph-orientation-horizontal",
      "glyph-orientation-vertical",
      "horiz-adv-x",
      "horiz-origin-x",
      "image-rendering",
      "letter-spacing",
      "lighting-color",
      "marker-end",
      "marker-mid",
      "marker-start",
      "overline-position",
      "overline-thickness",
      "paint-order",
      "panose-1",
      "pointer-events",
      "rendering-intent",
      "shape-rendering",
      "stop-color",
      "stop-opacity",
      "strikethrough-position",
      "strikethrough-thickness",
      "stroke-dasharray",
      "stroke-dashoffset",
      "stroke-linecap",
      "stroke-linejoin",
      "stroke-miterlimit",
      "stroke-opacity",
      "stroke-width",
      "text-anchor",
      "text-decoration",
      "text-rendering",
      "underline-position",
      "underline-thickness",
      "unicode-bidi",
      "unicode-range",
      "units-per-em",
      "v-alphabetic",
      "v-hanging",
      "v-ideographic",
      "v-mathematical",
      "vector-effect",
      "vert-adv-y",
      "vert-origin-x",
      "vert-origin-y",
      "word-spacing",
      "writing-mode",
      "xmlns:xlink",
      "x-height"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(f) {
      var p = f.replace(Ur, Ws);
      Ni[p] = new yi(
        p,
        _s,
        !1,
        // mustUseProperty
        f,
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "xlink:actuate",
      "xlink:arcrole",
      "xlink:role",
      "xlink:show",
      "xlink:title",
      "xlink:type"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(f) {
      var p = f.replace(Ur, Ws);
      Ni[p] = new yi(
        p,
        _s,
        !1,
        // mustUseProperty
        f,
        "http://www.w3.org/1999/xlink",
        !1,
        // sanitizeURL
        !1
      );
    }), [
      "xml:base",
      "xml:lang",
      "xml:space"
      // NOTE: if you add a camelCased prop to this list,
      // you'll need to set attributeName to name.toLowerCase()
      // instead in the assignment below.
    ].forEach(function(f) {
      var p = f.replace(Ur, Ws);
      Ni[p] = new yi(
        p,
        _s,
        !1,
        // mustUseProperty
        f,
        "http://www.w3.org/XML/1998/namespace",
        !1,
        // sanitizeURL
        !1
      );
    }), ["tabIndex", "crossOrigin"].forEach(function(f) {
      Ni[f] = new yi(
        f,
        _s,
        !1,
        // mustUseProperty
        f.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !1,
        // sanitizeURL
        !1
      );
    });
    var El = "xlinkHref";
    Ni[El] = new yi(
      "xlinkHref",
      _s,
      !1,
      // mustUseProperty
      "xlink:href",
      "http://www.w3.org/1999/xlink",
      !0,
      // sanitizeURL
      !1
    ), ["src", "href", "action", "formAction"].forEach(function(f) {
      Ni[f] = new yi(
        f,
        _s,
        !1,
        // mustUseProperty
        f.toLowerCase(),
        // attributeName
        null,
        // attributeNamespace
        !0,
        // sanitizeURL
        !0
      );
    });
    var Ri = /^[\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, So = !1;
    function va(f) {
      !So && Ri.test(f) && (So = !0, a("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(f)));
    }
    function xl(f, p, C, x) {
      if (x.mustUseProperty) {
        var I = x.propertyName;
        return f[I];
      } else {
        tr(C, p), x.sanitizeURL && va("" + C);
        var O = x.attributeName, W = null;
        if (x.type === yt) {
          if (f.hasAttribute(O)) {
            var q = f.getAttribute(O);
            return q === "" ? !0 : Mn(p, C, x, !1) ? q : q === "" + C ? C : q;
          }
        } else if (f.hasAttribute(O)) {
          if (Mn(p, C, x, !1))
            return f.getAttribute(O);
          if (x.type === He)
            return C;
          W = f.getAttribute(O);
        }
        return Mn(p, C, x, !1) ? W === null ? C : W : W === "" + C ? C : W;
      }
    }
    function ya(f, p, C, x) {
      {
        if (!li(p))
          return;
        if (!f.hasAttribute(p))
          return C === void 0 ? void 0 : null;
        var I = f.getAttribute(p);
        return tr(C, p), I === "" + C ? C : I;
      }
    }
    function ro(f, p, C, x) {
      var I = gn(p);
      if (!lt(p, I, x)) {
        if (Mn(p, C, I, x) && (C = null), x || I === null) {
          if (li(p)) {
            var O = p;
            C === null ? f.removeAttribute(O) : (tr(C, p), f.setAttribute(O, "" + C));
          }
          return;
        }
        var W = I.mustUseProperty;
        if (W) {
          var q = I.propertyName;
          if (C === null) {
            var ee = I.type;
            f[q] = ee === He ? !1 : "";
          } else
            f[q] = C;
          return;
        }
        var ue = I.attributeName, me = I.attributeNamespace;
        if (C === null)
          f.removeAttribute(ue);
        else {
          var Me = I.type, Ae;
          Me === He || Me === yt && C === !0 ? Ae = "" : (tr(C, ue), Ae = "" + C, I.sanitizeURL && va(Ae.toString())), me ? f.setAttributeNS(me, ue, Ae) : f.setAttribute(ue, Ae);
        }
      }
    }
    var Eo = Symbol.for("react.element"), po = Symbol.for("react.portal"), bs = Symbol.for("react.fragment"), na = Symbol.for("react.strict_mode"), sc = Symbol.for("react.profiler"), Rc = Symbol.for("react.provider"), xe = Symbol.for("react.context"), mt = Symbol.for("react.forward_ref"), jt = Symbol.for("react.suspense"), nn = Symbol.for("react.suspense_list"), Wi = Symbol.for("react.memo"), fi = Symbol.for("react.lazy"), Ki = Symbol.for("react.scope"), Nt = Symbol.for("react.debug_trace_mode"), ve = Symbol.for("react.offscreen"), fe = Symbol.for("react.legacy_hidden"), Be = Symbol.for("react.cache"), Lt = Symbol.for("react.tracing_marker"), ci = Symbol.iterator, kn = "@@iterator";
    function qn(f) {
      if (f === null || typeof f != "object")
        return null;
      var p = ci && f[ci] || f[kn];
      return typeof p == "function" ? p : null;
    }
    var bn = Object.assign, mo = 0, ns, tf, vs, nf, Ll, Bw, Ac;
    function Hw() {
    }
    Hw.__reactDisabledLog = !0;
    function Ck() {
      {
        if (mo === 0) {
          ns = console.log, tf = console.info, vs = console.warn, nf = console.error, Ll = console.group, Bw = console.groupCollapsed, Ac = console.groupEnd;
          var f = {
            configurable: !0,
            enumerable: !0,
            value: Hw,
            writable: !0
          };
          Object.defineProperties(console, {
            info: f,
            log: f,
            warn: f,
            error: f,
            group: f,
            groupCollapsed: f,
            groupEnd: f
          });
        }
        mo++;
      }
    }
    function wk() {
      {
        if (mo--, mo === 0) {
          var f = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: bn({}, f, {
              value: ns
            }),
            info: bn({}, f, {
              value: tf
            }),
            warn: bn({}, f, {
              value: vs
            }),
            error: bn({}, f, {
              value: nf
            }),
            group: bn({}, f, {
              value: Ll
            }),
            groupCollapsed: bn({}, f, {
              value: Bw
            }),
            groupEnd: bn({}, f, {
              value: Ac
            })
          });
        }
        mo < 0 && a("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var tp = n.ReactCurrentDispatcher, Tm;
    function vu(f, p, C) {
      {
        if (Tm === void 0)
          try {
            throw Error();
          } catch (I) {
            var x = I.stack.trim().match(/\n( *(at )?)/);
            Tm = x && x[1] || "";
          }
        return `
` + Tm + f;
      }
    }
    var sg = !1, km;
    {
      var y0 = typeof WeakMap == "function" ? WeakMap : Map;
      km = new y0();
    }
    function np(f, p) {
      if (!f || sg)
        return "";
      {
        var C = km.get(f);
        if (C !== void 0)
          return C;
      }
      var x;
      sg = !0;
      var I = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var O;
      O = tp.current, tp.current = null, Ck();
      try {
        if (p) {
          var W = function() {
            throw Error();
          };
          if (Object.defineProperty(W.prototype, "props", {
            set: function() {
              throw Error();
            }
          }), typeof Reflect == "object" && Reflect.construct) {
            try {
              Reflect.construct(W, []);
            } catch (rt) {
              x = rt;
            }
            Reflect.construct(f, [], W);
          } else {
            try {
              W.call();
            } catch (rt) {
              x = rt;
            }
            f.call(W.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (rt) {
            x = rt;
          }
          f();
        }
      } catch (rt) {
        if (rt && x && typeof rt.stack == "string") {
          for (var q = rt.stack.split(`
`), ee = x.stack.split(`
`), ue = q.length - 1, me = ee.length - 1; ue >= 1 && me >= 0 && q[ue] !== ee[me]; )
            me--;
          for (; ue >= 1 && me >= 0; ue--, me--)
            if (q[ue] !== ee[me]) {
              if (ue !== 1 || me !== 1)
                do
                  if (ue--, me--, me < 0 || q[ue] !== ee[me]) {
                    var Me = `
` + q[ue].replace(" at new ", " at ");
                    return f.displayName && Me.includes("<anonymous>") && (Me = Me.replace("<anonymous>", f.displayName)), typeof f == "function" && km.set(f, Me), Me;
                  }
                while (ue >= 1 && me >= 0);
              break;
            }
        }
      } finally {
        sg = !1, tp.current = O, wk(), Error.prepareStackTrace = I;
      }
      var Ae = f ? f.displayName || f.name : "", nt = Ae ? vu(Ae) : "";
      return typeof f == "function" && km.set(f, nt), nt;
    }
    function Hb(f, p, C) {
      return np(f, !0);
    }
    function Wb(f, p, C) {
      return np(f, !1);
    }
    function Dm(f) {
      var p = f.prototype;
      return !!(p && p.isReactComponent);
    }
    function Ww(f, p, C) {
      if (f == null)
        return "";
      if (typeof f == "function")
        return np(f, Dm(f));
      if (typeof f == "string")
        return vu(f);
      switch (f) {
        case jt:
          return vu("Suspense");
        case nn:
          return vu("SuspenseList");
      }
      if (typeof f == "object")
        switch (f.$$typeof) {
          case mt:
            return Wb(f.render);
          case Wi:
            return Ww(f.type, p, C);
          case fi: {
            var x = f, I = x._payload, O = x._init;
            try {
              return Ww(O(I), p, C);
            } catch {
            }
          }
        }
      return "";
    }
    function Vw(f) {
      switch (f._debugOwner && f._debugOwner.type, f._debugSource, f.tag) {
        case m:
          return vu(f.type);
        case B:
          return vu("Lazy");
        case N:
          return vu("Suspense");
        case K:
          return vu("SuspenseList");
        case c:
        case d:
        case M:
          return Wb(f.type);
        case T:
          return Wb(f.type.render);
        case u:
          return Hb(f.type);
        default:
          return "";
      }
    }
    function Nr(f) {
      try {
        var p = "", C = f;
        do
          p += Vw(C), C = C.return;
        while (C);
        return p;
      } catch (x) {
        return `
Error generating stack: ` + x.message + `
` + x.stack;
      }
    }
    function Uw(f, p, C) {
      var x = f.displayName;
      if (x)
        return x;
      var I = p.displayName || p.name || "";
      return I !== "" ? C + "(" + I + ")" : C;
    }
    function C0(f) {
      return f.displayName || "Context";
    }
    function Rr(f) {
      if (f == null)
        return null;
      if (typeof f.tag == "number" && a("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof f == "function")
        return f.displayName || f.name || null;
      if (typeof f == "string")
        return f;
      switch (f) {
        case bs:
          return "Fragment";
        case po:
          return "Portal";
        case sc:
          return "Profiler";
        case na:
          return "StrictMode";
        case jt:
          return "Suspense";
        case nn:
          return "SuspenseList";
      }
      if (typeof f == "object")
        switch (f.$$typeof) {
          case xe:
            var p = f;
            return C0(p) + ".Consumer";
          case Rc:
            var C = f;
            return C0(C._context) + ".Provider";
          case mt:
            return Uw(f, f.render, "ForwardRef");
          case Wi:
            var x = f.displayName || null;
            return x !== null ? x : Rr(f.type) || "Memo";
          case fi: {
            var I = f, O = I._payload, W = I._init;
            try {
              return Rr(W(O));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    function Sk(f, p, C) {
      var x = p.displayName || p.name || "";
      return f.displayName || (x !== "" ? C + "(" + x + ")" : C);
    }
    function og(f) {
      return f.displayName || "Context";
    }
    function Ai(f) {
      var p = f.tag, C = f.type;
      switch (p) {
        case Q:
          return "Cache";
        case E:
          var x = C;
          return og(x) + ".Consumer";
        case L:
          var I = C;
          return og(I._context) + ".Provider";
        case j:
          return "DehydratedFragment";
        case T:
          return Sk(C, C.render, "ForwardRef");
        case v:
          return "Fragment";
        case m:
          return C;
        case g:
          return "Portal";
        case h:
          return "Root";
        case _:
          return "Text";
        case B:
          return Rr(C);
        case w:
          return C === na ? "StrictMode" : "Mode";
        case Y:
          return "Offscreen";
        case D:
          return "Profiler";
        case X:
          return "Scope";
        case N:
          return "Suspense";
        case K:
          return "SuspenseList";
        case oe:
          return "TracingMarker";
        // The display name for this tags come from the user-provided type:
        case u:
        case c:
        case H:
        case d:
        case R:
        case M:
          if (typeof C == "function")
            return C.displayName || C.name || null;
          if (typeof C == "string")
            return C;
          break;
      }
      return null;
    }
    var Vb = n.ReactDebugCurrentFrame, el = null, yu = !1;
    function Oc() {
      {
        if (el === null)
          return null;
        var f = el._debugOwner;
        if (f !== null && typeof f < "u")
          return Ai(f);
      }
      return null;
    }
    function ag() {
      return el === null ? "" : Nr(el);
    }
    function Go() {
      Vb.getCurrentStack = null, el = null, yu = !1;
    }
    function Vs(f) {
      Vb.getCurrentStack = f === null ? null : ag, el = f, yu = !1;
    }
    function rf() {
      return el;
    }
    function Zd(f) {
      yu = f;
    }
    function oc(f) {
      return "" + f;
    }
    function Mc(f) {
      switch (typeof f) {
        case "boolean":
        case "number":
        case "string":
        case "undefined":
          return f;
        case "object":
          return io(f), f;
        default:
          return "";
      }
    }
    var A2 = {
      button: !0,
      checkbox: !0,
      image: !0,
      hidden: !0,
      radio: !0,
      reset: !0,
      submit: !0
    };
    function w0(f, p) {
      A2[p.type] || p.onChange || p.onInput || p.readOnly || p.disabled || p.value == null || a("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."), p.onChange || p.readOnly || p.disabled || p.checked == null || a("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.");
    }
    function Ub(f) {
      var p = f.type, C = f.nodeName;
      return C && C.toLowerCase() === "input" && (p === "checkbox" || p === "radio");
    }
    function S0(f) {
      return f._valueTracker;
    }
    function E0(f) {
      f._valueTracker = null;
    }
    function zb(f) {
      var p = "";
      return f && (Ub(f) ? p = f.checked ? "true" : "false" : p = f.value), p;
    }
    function Qd(f) {
      var p = Ub(f) ? "checked" : "value", C = Object.getOwnPropertyDescriptor(f.constructor.prototype, p);
      io(f[p]);
      var x = "" + f[p];
      if (!(f.hasOwnProperty(p) || typeof C > "u" || typeof C.get != "function" || typeof C.set != "function")) {
        var I = C.get, O = C.set;
        Object.defineProperty(f, p, {
          configurable: !0,
          get: function() {
            return I.call(this);
          },
          set: function(q) {
            io(q), x = "" + q, O.call(this, q);
          }
        }), Object.defineProperty(f, p, {
          enumerable: C.enumerable
        });
        var W = {
          getValue: function() {
            return x;
          },
          setValue: function(q) {
            io(q), x = "" + q;
          },
          stopTracking: function() {
            E0(f), delete f[p];
          }
        };
        return W;
      }
    }
    function Jd(f) {
      S0(f) || (f._valueTracker = Qd(f));
    }
    function Im(f) {
      if (!f)
        return !1;
      var p = S0(f);
      if (!p)
        return !0;
      var C = p.getValue(), x = zb(f);
      return x !== C ? (p.setValue(x), !0) : !1;
    }
    function ip(f) {
      if (f = f || (typeof document < "u" ? document : void 0), typeof f > "u")
        return null;
      try {
        return f.activeElement || f.body;
      } catch {
        return f.body;
      }
    }
    var x0 = !1, Nm = !1, rp = !1, L0 = !1;
    function zw(f) {
      var p = f.type === "checkbox" || f.type === "radio";
      return p ? f.checked != null : f.value != null;
    }
    function eh(f, p) {
      var C = f, x = p.checked, I = bn({}, p, {
        defaultChecked: void 0,
        defaultValue: void 0,
        value: void 0,
        checked: x ?? C._wrapperState.initialChecked
      });
      return I;
    }
    function T0(f, p) {
      w0("input", p), p.checked !== void 0 && p.defaultChecked !== void 0 && !Nm && (a("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", Oc() || "A component", p.type), Nm = !0), p.value !== void 0 && p.defaultValue !== void 0 && !x0 && (a("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", Oc() || "A component", p.type), x0 = !0);
      var C = f, x = p.defaultValue == null ? "" : p.defaultValue;
      C._wrapperState = {
        initialChecked: p.checked != null ? p.checked : p.defaultChecked,
        initialValue: Mc(p.value != null ? p.value : x),
        controlled: zw(p)
      };
    }
    function ne(f, p) {
      var C = f, x = p.checked;
      x != null && ro(C, "checked", x, !1);
    }
    function Le(f, p) {
      var C = f;
      {
        var x = zw(p);
        !C._wrapperState.controlled && x && !L0 && (a("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), L0 = !0), C._wrapperState.controlled && !x && !rp && (a("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), rp = !0);
      }
      ne(f, p);
      var I = Mc(p.value), O = p.type;
      if (I != null)
        O === "number" ? (I === 0 && C.value === "" || // We explicitly want to coerce to number here if possible.
        // eslint-disable-next-line
        C.value != I) && (C.value = oc(I)) : C.value !== oc(I) && (C.value = oc(I));
      else if (O === "submit" || O === "reset") {
        C.removeAttribute("value");
        return;
      }
      p.hasOwnProperty("value") ? In(C, p.type, I) : p.hasOwnProperty("defaultValue") && In(C, p.type, Mc(p.defaultValue)), p.checked == null && p.defaultChecked != null && (C.defaultChecked = !!p.defaultChecked);
    }
    function tt(f, p, C) {
      var x = f;
      if (p.hasOwnProperty("value") || p.hasOwnProperty("defaultValue")) {
        var I = p.type, O = I === "submit" || I === "reset";
        if (O && (p.value === void 0 || p.value === null))
          return;
        var W = oc(x._wrapperState.initialValue);
        C || W !== x.value && (x.value = W), x.defaultValue = W;
      }
      var q = x.name;
      q !== "" && (x.name = ""), x.defaultChecked = !x.defaultChecked, x.defaultChecked = !!x._wrapperState.initialChecked, q !== "" && (x.name = q);
    }
    function dt(f, p) {
      var C = f;
      Le(C, p), Gt(C, p);
    }
    function Gt(f, p) {
      var C = p.name;
      if (p.type === "radio" && C != null) {
        for (var x = f; x.parentNode; )
          x = x.parentNode;
        tr(C, "name");
        for (var I = x.querySelectorAll("input[name=" + JSON.stringify("" + C) + '][type="radio"]'), O = 0; O < I.length; O++) {
          var W = I[O];
          if (!(W === f || W.form !== f.form)) {
            var q = r9(W);
            if (!q)
              throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
            Im(W), Le(W, q);
          }
        }
      }
    }
    function In(f, p, C) {
      // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
      (p !== "number" || ip(f.ownerDocument) !== f) && (C == null ? f.defaultValue = oc(f._wrapperState.initialValue) : f.defaultValue !== oc(C) && (f.defaultValue = oc(C)));
    }
    var vn = !1, Ei = !1, sr = !1;
    function ys(f, p) {
      p.value == null && (typeof p.children == "object" && p.children !== null ? e.Children.forEach(p.children, function(C) {
        C != null && (typeof C == "string" || typeof C == "number" || Ei || (Ei = !0, a("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")));
      }) : p.dangerouslySetInnerHTML != null && (sr || (sr = !0, a("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")))), p.selected != null && !vn && (a("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."), vn = !0);
    }
    function Us(f, p) {
      p.value != null && f.setAttribute("value", oc(Mc(p.value)));
    }
    var zs = Array.isArray;
    function Yi(f) {
      return zs(f);
    }
    var so;
    so = !1;
    function ia() {
      var f = Oc();
      return f ? `

Check the render method of \`` + f + "`." : "";
    }
    var $b = ["value", "defaultValue"];
    function $w(f) {
      {
        w0("select", f);
        for (var p = 0; p < $b.length; p++) {
          var C = $b[p];
          if (f[C] != null) {
            var x = Yi(f[C]);
            f.multiple && !x ? a("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", C, ia()) : !f.multiple && x && a("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", C, ia());
          }
        }
      }
    }
    function sp(f, p, C, x) {
      var I = f.options;
      if (p) {
        for (var O = C, W = {}, q = 0; q < O.length; q++)
          W["$" + O[q]] = !0;
        for (var ee = 0; ee < I.length; ee++) {
          var ue = W.hasOwnProperty("$" + I[ee].value);
          I[ee].selected !== ue && (I[ee].selected = ue), ue && x && (I[ee].defaultSelected = !0);
        }
      } else {
        for (var me = oc(Mc(C)), Me = null, Ae = 0; Ae < I.length; Ae++) {
          if (I[Ae].value === me) {
            I[Ae].selected = !0, x && (I[Ae].defaultSelected = !0);
            return;
          }
          Me === null && !I[Ae].disabled && (Me = I[Ae]);
        }
        Me !== null && (Me.selected = !0);
      }
    }
    function jb(f, p) {
      return bn({}, p, {
        value: void 0
      });
    }
    function jw(f, p) {
      var C = f;
      $w(p), C._wrapperState = {
        wasMultiple: !!p.multiple
      }, p.value !== void 0 && p.defaultValue !== void 0 && !so && (a("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"), so = !0);
    }
    function O2(f, p) {
      var C = f;
      C.multiple = !!p.multiple;
      var x = p.value;
      x != null ? sp(C, !!p.multiple, x, !1) : p.defaultValue != null && sp(C, !!p.multiple, p.defaultValue, !0);
    }
    function Ek(f, p) {
      var C = f, x = C._wrapperState.wasMultiple;
      C._wrapperState.wasMultiple = !!p.multiple;
      var I = p.value;
      I != null ? sp(C, !!p.multiple, I, !1) : x !== !!p.multiple && (p.defaultValue != null ? sp(C, !!p.multiple, p.defaultValue, !0) : sp(C, !!p.multiple, p.multiple ? [] : "", !1));
    }
    function M2(f, p) {
      var C = f, x = p.value;
      x != null && sp(C, !!p.multiple, x, !1);
    }
    var T6 = !1;
    function xk(f, p) {
      var C = f;
      if (p.dangerouslySetInnerHTML != null)
        throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
      var x = bn({}, p, {
        value: void 0,
        defaultValue: void 0,
        children: oc(C._wrapperState.initialValue)
      });
      return x;
    }
    function k6(f, p) {
      var C = f;
      w0("textarea", p), p.value !== void 0 && p.defaultValue !== void 0 && !T6 && (a("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", Oc() || "A component"), T6 = !0);
      var x = p.value;
      if (x == null) {
        var I = p.children, O = p.defaultValue;
        if (I != null) {
          a("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");
          {
            if (O != null)
              throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
            if (Yi(I)) {
              if (I.length > 1)
                throw new Error("<textarea> can only have at most one child.");
              I = I[0];
            }
            O = I;
          }
        }
        O == null && (O = ""), x = O;
      }
      C._wrapperState = {
        initialValue: Mc(x)
      };
    }
    function D6(f, p) {
      var C = f, x = Mc(p.value), I = Mc(p.defaultValue);
      if (x != null) {
        var O = oc(x);
        O !== C.value && (C.value = O), p.defaultValue == null && C.defaultValue !== O && (C.defaultValue = O);
      }
      I != null && (C.defaultValue = oc(I));
    }
    function I6(f, p) {
      var C = f, x = C.textContent;
      x === C._wrapperState.initialValue && x !== "" && x !== null && (C.value = x);
    }
    function rX(f, p) {
      D6(f, p);
    }
    var sf = "http://www.w3.org/1999/xhtml", sX = "http://www.w3.org/1998/Math/MathML", P2 = "http://www.w3.org/2000/svg";
    function F2(f) {
      switch (f) {
        case "svg":
          return P2;
        case "math":
          return sX;
        default:
          return sf;
      }
    }
    function Lk(f, p) {
      return f == null || f === sf ? F2(p) : f === P2 && p === "foreignObject" ? sf : f;
    }
    var oX = function(f) {
      return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(p, C, x, I) {
        MSApp.execUnsafeLocalFunction(function() {
          return f(p, C, x, I);
        });
      } : f;
    }, Tk, N6 = oX(function(f, p) {
      if (f.namespaceURI === P2 && !("innerHTML" in f)) {
        Tk = Tk || document.createElement("div"), Tk.innerHTML = "<svg>" + p.valueOf().toString() + "</svg>";
        for (var C = Tk.firstChild; f.firstChild; )
          f.removeChild(f.firstChild);
        for (; C.firstChild; )
          f.appendChild(C.firstChild);
        return;
      }
      f.innerHTML = p;
    }), Cu = 1, op = 3, Ca = 8, ap = 9, Gw = 11, Rm = function(f, p) {
      if (p) {
        var C = f.firstChild;
        if (C && C === f.lastChild && C.nodeType === op) {
          C.nodeValue = p;
          return;
        }
      }
      f.textContent = p;
    }, aX = {
      animation: ["animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationTimingFunction"],
      background: ["backgroundAttachment", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize"],
      backgroundPosition: ["backgroundPositionX", "backgroundPositionY"],
      border: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderTopColor", "borderTopStyle", "borderTopWidth"],
      borderBlockEnd: ["borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth"],
      borderBlockStart: ["borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth"],
      borderBottom: ["borderBottomColor", "borderBottomStyle", "borderBottomWidth"],
      borderColor: ["borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor"],
      borderImage: ["borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth"],
      borderInlineEnd: ["borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth"],
      borderInlineStart: ["borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth"],
      borderLeft: ["borderLeftColor", "borderLeftStyle", "borderLeftWidth"],
      borderRadius: ["borderBottomLeftRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderTopRightRadius"],
      borderRight: ["borderRightColor", "borderRightStyle", "borderRightWidth"],
      borderStyle: ["borderBottomStyle", "borderLeftStyle", "borderRightStyle", "borderTopStyle"],
      borderTop: ["borderTopColor", "borderTopStyle", "borderTopWidth"],
      borderWidth: ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth"],
      columnRule: ["columnRuleColor", "columnRuleStyle", "columnRuleWidth"],
      columns: ["columnCount", "columnWidth"],
      flex: ["flexBasis", "flexGrow", "flexShrink"],
      flexFlow: ["flexDirection", "flexWrap"],
      font: ["fontFamily", "fontFeatureSettings", "fontKerning", "fontLanguageOverride", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontWeight", "lineHeight"],
      fontVariant: ["fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition"],
      gap: ["columnGap", "rowGap"],
      grid: ["gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
      gridArea: ["gridColumnEnd", "gridColumnStart", "gridRowEnd", "gridRowStart"],
      gridColumn: ["gridColumnEnd", "gridColumnStart"],
      gridColumnGap: ["columnGap"],
      gridGap: ["columnGap", "rowGap"],
      gridRow: ["gridRowEnd", "gridRowStart"],
      gridRowGap: ["rowGap"],
      gridTemplate: ["gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows"],
      listStyle: ["listStyleImage", "listStylePosition", "listStyleType"],
      margin: ["marginBottom", "marginLeft", "marginRight", "marginTop"],
      marker: ["markerEnd", "markerMid", "markerStart"],
      mask: ["maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPositionX", "maskPositionY", "maskRepeat", "maskSize"],
      maskPosition: ["maskPositionX", "maskPositionY"],
      outline: ["outlineColor", "outlineStyle", "outlineWidth"],
      overflow: ["overflowX", "overflowY"],
      padding: ["paddingBottom", "paddingLeft", "paddingRight", "paddingTop"],
      placeContent: ["alignContent", "justifyContent"],
      placeItems: ["alignItems", "justifyItems"],
      placeSelf: ["alignSelf", "justifySelf"],
      textDecoration: ["textDecorationColor", "textDecorationLine", "textDecorationStyle"],
      textEmphasis: ["textEmphasisColor", "textEmphasisStyle"],
      transition: ["transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction"],
      wordWrap: ["overflowWrap"]
    }, k0 = {
      animationIterationCount: !0,
      aspectRatio: !0,
      borderImageOutset: !0,
      borderImageSlice: !0,
      borderImageWidth: !0,
      boxFlex: !0,
      boxFlexGroup: !0,
      boxOrdinalGroup: !0,
      columnCount: !0,
      columns: !0,
      flex: !0,
      flexGrow: !0,
      flexPositive: !0,
      flexShrink: !0,
      flexNegative: !0,
      flexOrder: !0,
      gridArea: !0,
      gridRow: !0,
      gridRowEnd: !0,
      gridRowSpan: !0,
      gridRowStart: !0,
      gridColumn: !0,
      gridColumnEnd: !0,
      gridColumnSpan: !0,
      gridColumnStart: !0,
      fontWeight: !0,
      lineClamp: !0,
      lineHeight: !0,
      opacity: !0,
      order: !0,
      orphans: !0,
      tabSize: !0,
      widows: !0,
      zIndex: !0,
      zoom: !0,
      // SVG-related properties
      fillOpacity: !0,
      floodOpacity: !0,
      stopOpacity: !0,
      strokeDasharray: !0,
      strokeDashoffset: !0,
      strokeMiterlimit: !0,
      strokeOpacity: !0,
      strokeWidth: !0
    };
    function R6(f, p) {
      return f + p.charAt(0).toUpperCase() + p.substring(1);
    }
    var A6 = ["Webkit", "ms", "Moz", "O"];
    Object.keys(k0).forEach(function(f) {
      A6.forEach(function(p) {
        k0[R6(p, f)] = k0[f];
      });
    });
    function kk(f, p, C) {
      var x = p == null || typeof p == "boolean" || p === "";
      return x ? "" : !C && typeof p == "number" && p !== 0 && !(k0.hasOwnProperty(f) && k0[f]) ? p + "px" : (Ts(p, f), ("" + p).trim());
    }
    var O6 = /([A-Z])/g, D0 = /^ms-/;
    function lX(f) {
      return f.replace(O6, "-$1").toLowerCase().replace(D0, "-ms-");
    }
    var M6 = function() {
    };
    {
      var cX = /^(?:webkit|moz|o)[A-Z]/, P6 = /^-ms-/, F6 = /-(.)/g, I0 = /;\s*$/, lg = {}, B2 = {}, qw = !1, B6 = !1, H6 = function(f) {
        return f.replace(F6, function(p, C) {
          return C.toUpperCase();
        });
      }, H2 = function(f) {
        lg.hasOwnProperty(f) && lg[f] || (lg[f] = !0, a(
          "Unsupported style property %s. Did you mean %s?",
          f,
          // As Andi Smith suggests
          // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
          // is converted to lowercase `ms`.
          H6(f.replace(P6, "ms-"))
        ));
      }, W2 = function(f) {
        lg.hasOwnProperty(f) && lg[f] || (lg[f] = !0, a("Unsupported vendor-prefixed style property %s. Did you mean %s?", f, f.charAt(0).toUpperCase() + f.slice(1)));
      }, W6 = function(f, p) {
        B2.hasOwnProperty(p) && B2[p] || (B2[p] = !0, a(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, f, p.replace(I0, "")));
      }, V6 = function(f, p) {
        qw || (qw = !0, a("`NaN` is an invalid value for the `%s` css style property.", f));
      }, U6 = function(f, p) {
        B6 || (B6 = !0, a("`Infinity` is an invalid value for the `%s` css style property.", f));
      };
      M6 = function(f, p) {
        f.indexOf("-") > -1 ? H2(f) : cX.test(f) ? W2(f) : I0.test(p) && W6(f, p), typeof p == "number" && (isNaN(p) ? V6(f, p) : isFinite(p) || U6(f, p));
      };
    }
    var uX = M6;
    function dX(f) {
      {
        var p = "", C = "";
        for (var x in f)
          if (f.hasOwnProperty(x)) {
            var I = f[x];
            if (I != null) {
              var O = x.indexOf("--") === 0;
              p += C + (O ? x : lX(x)) + ":", p += kk(x, I, O), C = ";";
            }
          }
        return p || null;
      }
    }
    function z6(f, p) {
      var C = f.style;
      for (var x in p)
        if (p.hasOwnProperty(x)) {
          var I = x.indexOf("--") === 0;
          I || uX(x, p[x]);
          var O = kk(x, p[x], I);
          x === "float" && (x = "cssFloat"), I ? C.setProperty(x, O) : C[x] = O;
        }
    }
    function hX(f) {
      return f == null || typeof f == "boolean" || f === "";
    }
    function $6(f) {
      var p = {};
      for (var C in f)
        for (var x = aX[C] || [C], I = 0; I < x.length; I++)
          p[x[I]] = C;
      return p;
    }
    function of(f, p) {
      {
        if (!p)
          return;
        var C = $6(f), x = $6(p), I = {};
        for (var O in C) {
          var W = C[O], q = x[O];
          if (q && W !== q) {
            var ee = W + "," + q;
            if (I[ee])
              continue;
            I[ee] = !0, a("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", hX(f[W]) ? "Removing" : "Updating", W, q);
          }
        }
      }
    }
    var Kw = {
      area: !0,
      base: !0,
      br: !0,
      col: !0,
      embed: !0,
      hr: !0,
      img: !0,
      input: !0,
      keygen: !0,
      link: !0,
      meta: !0,
      param: !0,
      source: !0,
      track: !0,
      wbr: !0
      // NOTE: menuitem's close tag should be omitted, but that causes problems.
    }, j6 = bn({
      menuitem: !0
    }, Kw), G6 = "__html";
    function Dk(f, p) {
      if (p) {
        if (j6[f] && (p.children != null || p.dangerouslySetInnerHTML != null))
          throw new Error(f + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
        if (p.dangerouslySetInnerHTML != null) {
          if (p.children != null)
            throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
          if (typeof p.dangerouslySetInnerHTML != "object" || !(G6 in p.dangerouslySetInnerHTML))
            throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");
        }
        if (!p.suppressContentEditableWarning && p.contentEditable && p.children != null && a("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."), p.style != null && typeof p.style != "object")
          throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
      }
    }
    function Am(f, p) {
      if (f.indexOf("-") === -1)
        return typeof p.is == "string";
      switch (f) {
        // These are reserved SVG and MathML elements.
        // We don't mind this list too much because we expect it to never grow.
        // The alternative is to track the namespace in a few places which is convoluted.
        // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
        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 N0 = {
      // HTML
      accept: "accept",
      acceptcharset: "acceptCharset",
      "accept-charset": "acceptCharset",
      accesskey: "accessKey",
      action: "action",
      allowfullscreen: "allowFullScreen",
      alt: "alt",
      as: "as",
      async: "async",
      autocapitalize: "autoCapitalize",
      autocomplete: "autoComplete",
      autocorrect: "autoCorrect",
      autofocus: "autoFocus",
      autoplay: "autoPlay",
      autosave: "autoSave",
      capture: "capture",
      cellpadding: "cellPadding",
      cellspacing: "cellSpacing",
      challenge: "challenge",
      charset: "charSet",
      checked: "checked",
      children: "children",
      cite: "cite",
      class: "className",
      classid: "classID",
      classname: "className",
      cols: "cols",
      colspan: "colSpan",
      content: "content",
      contenteditable: "contentEditable",
      contextmenu: "contextMenu",
      controls: "controls",
      controlslist: "controlsList",
      coords: "coords",
      crossorigin: "crossOrigin",
      dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
      data: "data",
      datetime: "dateTime",
      default: "default",
      defaultchecked: "defaultChecked",
      defaultvalue: "defaultValue",
      defer: "defer",
      dir: "dir",
      disabled: "disabled",
      disablepictureinpicture: "disablePictureInPicture",
      disableremoteplayback: "disableRemotePlayback",
      download: "download",
      draggable: "draggable",
      enctype: "encType",
      enterkeyhint: "enterKeyHint",
      for: "htmlFor",
      form: "form",
      formmethod: "formMethod",
      formaction: "formAction",
      formenctype: "formEncType",
      formnovalidate: "formNoValidate",
      formtarget: "formTarget",
      frameborder: "frameBorder",
      headers: "headers",
      height: "height",
      hidden: "hidden",
      high: "high",
      href: "href",
      hreflang: "hrefLang",
      htmlfor: "htmlFor",
      httpequiv: "httpEquiv",
      "http-equiv": "httpEquiv",
      icon: "icon",
      id: "id",
      imagesizes: "imageSizes",
      imagesrcset: "imageSrcSet",
      innerhtml: "innerHTML",
      inputmode: "inputMode",
      integrity: "integrity",
      is: "is",
      itemid: "itemID",
      itemprop: "itemProp",
      itemref: "itemRef",
      itemscope: "itemScope",
      itemtype: "itemType",
      keyparams: "keyParams",
      keytype: "keyType",
      kind: "kind",
      label: "label",
      lang: "lang",
      list: "list",
      loop: "loop",
      low: "low",
      manifest: "manifest",
      marginwidth: "marginWidth",
      marginheight: "marginHeight",
      max: "max",
      maxlength: "maxLength",
      media: "media",
      mediagroup: "mediaGroup",
      method: "method",
      min: "min",
      minlength: "minLength",
      multiple: "multiple",
      muted: "muted",
      name: "name",
      nomodule: "noModule",
      nonce: "nonce",
      novalidate: "noValidate",
      open: "open",
      optimum: "optimum",
      pattern: "pattern",
      placeholder: "placeholder",
      playsinline: "playsInline",
      poster: "poster",
      preload: "preload",
      profile: "profile",
      radiogroup: "radioGroup",
      readonly: "readOnly",
      referrerpolicy: "referrerPolicy",
      rel: "rel",
      required: "required",
      reversed: "reversed",
      role: "role",
      rows: "rows",
      rowspan: "rowSpan",
      sandbox: "sandbox",
      scope: "scope",
      scoped: "scoped",
      scrolling: "scrolling",
      seamless: "seamless",
      selected: "selected",
      shape: "shape",
      size: "size",
      sizes: "sizes",
      span: "span",
      spellcheck: "spellCheck",
      src: "src",
      srcdoc: "srcDoc",
      srclang: "srcLang",
      srcset: "srcSet",
      start: "start",
      step: "step",
      style: "style",
      summary: "summary",
      tabindex: "tabIndex",
      target: "target",
      title: "title",
      type: "type",
      usemap: "useMap",
      value: "value",
      width: "width",
      wmode: "wmode",
      wrap: "wrap",
      // SVG
      about: "about",
      accentheight: "accentHeight",
      "accent-height": "accentHeight",
      accumulate: "accumulate",
      additive: "additive",
      alignmentbaseline: "alignmentBaseline",
      "alignment-baseline": "alignmentBaseline",
      allowreorder: "allowReorder",
      alphabetic: "alphabetic",
      amplitude: "amplitude",
      arabicform: "arabicForm",
      "arabic-form": "arabicForm",
      ascent: "ascent",
      attributename: "attributeName",
      attributetype: "attributeType",
      autoreverse: "autoReverse",
      azimuth: "azimuth",
      basefrequency: "baseFrequency",
      baselineshift: "baselineShift",
      "baseline-shift": "baselineShift",
      baseprofile: "baseProfile",
      bbox: "bbox",
      begin: "begin",
      bias: "bias",
      by: "by",
      calcmode: "calcMode",
      capheight: "capHeight",
      "cap-height": "capHeight",
      clip: "clip",
      clippath: "clipPath",
      "clip-path": "clipPath",
      clippathunits: "clipPathUnits",
      cliprule: "clipRule",
      "clip-rule": "clipRule",
      color: "color",
      colorinterpolation: "colorInterpolation",
      "color-interpolation": "colorInterpolation",
      colorinterpolationfilters: "colorInterpolationFilters",
      "color-interpolation-filters": "colorInterpolationFilters",
      colorprofile: "colorProfile",
      "color-profile": "colorProfile",
      colorrendering: "colorRendering",
      "color-rendering": "colorRendering",
      contentscripttype: "contentScriptType",
      contentstyletype: "contentStyleType",
      cursor: "cursor",
      cx: "cx",
      cy: "cy",
      d: "d",
      datatype: "datatype",
      decelerate: "decelerate",
      descent: "descent",
      diffuseconstant: "diffuseConstant",
      direction: "direction",
      display: "display",
      divisor: "divisor",
      dominantbaseline: "dominantBaseline",
      "dominant-baseline": "dominantBaseline",
      dur: "dur",
      dx: "dx",
      dy: "dy",
      edgemode: "edgeMode",
      elevation: "elevation",
      enablebackground: "enableBackground",
      "enable-background": "enableBackground",
      end: "end",
      exponent: "exponent",
      externalresourcesrequired: "externalResourcesRequired",
      fill: "fill",
      fillopacity: "fillOpacity",
      "fill-opacity": "fillOpacity",
      fillrule: "fillRule",
      "fill-rule": "fillRule",
      filter: "filter",
      filterres: "filterRes",
      filterunits: "filterUnits",
      floodopacity: "floodOpacity",
      "flood-opacity": "floodOpacity",
      floodcolor: "floodColor",
      "flood-color": "floodColor",
      focusable: "focusable",
      fontfamily: "fontFamily",
      "font-family": "fontFamily",
      fontsize: "fontSize",
      "font-size": "fontSize",
      fontsizeadjust: "fontSizeAdjust",
      "font-size-adjust": "fontSizeAdjust",
      fontstretch: "fontStretch",
      "font-stretch": "fontStretch",
      fontstyle: "fontStyle",
      "font-style": "fontStyle",
      fontvariant: "fontVariant",
      "font-variant": "fontVariant",
      fontweight: "fontWeight",
      "font-weight": "fontWeight",
      format: "format",
      from: "from",
      fx: "fx",
      fy: "fy",
      g1: "g1",
      g2: "g2",
      glyphname: "glyphName",
      "glyph-name": "glyphName",
      glyphorientationhorizontal: "glyphOrientationHorizontal",
      "glyph-orientation-horizontal": "glyphOrientationHorizontal",
      glyphorientationvertical: "glyphOrientationVertical",
      "glyph-orientation-vertical": "glyphOrientationVertical",
      glyphref: "glyphRef",
      gradienttransform: "gradientTransform",
      gradientunits: "gradientUnits",
      hanging: "hanging",
      horizadvx: "horizAdvX",
      "horiz-adv-x": "horizAdvX",
      horizoriginx: "horizOriginX",
      "horiz-origin-x": "horizOriginX",
      ideographic: "ideographic",
      imagerendering: "imageRendering",
      "image-rendering": "imageRendering",
      in2: "in2",
      in: "in",
      inlist: "inlist",
      intercept: "intercept",
      k1: "k1",
      k2: "k2",
      k3: "k3",
      k4: "k4",
      k: "k",
      kernelmatrix: "kernelMatrix",
      kernelunitlength: "kernelUnitLength",
      kerning: "kerning",
      keypoints: "keyPoints",
      keysplines: "keySplines",
      keytimes: "keyTimes",
      lengthadjust: "lengthAdjust",
      letterspacing: "letterSpacing",
      "letter-spacing": "letterSpacing",
      lightingcolor: "lightingColor",
      "lighting-color": "lightingColor",
      limitingconeangle: "limitingConeAngle",
      local: "local",
      markerend: "markerEnd",
      "marker-end": "markerEnd",
      markerheight: "markerHeight",
      markermid: "markerMid",
      "marker-mid": "markerMid",
      markerstart: "markerStart",
      "marker-start": "markerStart",
      markerunits: "markerUnits",
      markerwidth: "markerWidth",
      mask: "mask",
      maskcontentunits: "maskContentUnits",
      maskunits: "maskUnits",
      mathematical: "mathematical",
      mode: "mode",
      numoctaves: "numOctaves",
      offset: "offset",
      opacity: "opacity",
      operator: "operator",
      order: "order",
      orient: "orient",
      orientation: "orientation",
      origin: "origin",
      overflow: "overflow",
      overlineposition: "overlinePosition",
      "overline-position": "overlinePosition",
      overlinethickness: "overlineThickness",
      "overline-thickness": "overlineThickness",
      paintorder: "paintOrder",
      "paint-order": "paintOrder",
      panose1: "panose1",
      "panose-1": "panose1",
      pathlength: "pathLength",
      patterncontentunits: "patternContentUnits",
      patterntransform: "patternTransform",
      patternunits: "patternUnits",
      pointerevents: "pointerEvents",
      "pointer-events": "pointerEvents",
      points: "points",
      pointsatx: "pointsAtX",
      pointsaty: "pointsAtY",
      pointsatz: "pointsAtZ",
      prefix: "prefix",
      preservealpha: "preserveAlpha",
      preserveaspectratio: "preserveAspectRatio",
      primitiveunits: "primitiveUnits",
      property: "property",
      r: "r",
      radius: "radius",
      refx: "refX",
      refy: "refY",
      renderingintent: "renderingIntent",
      "rendering-intent": "renderingIntent",
      repeatcount: "repeatCount",
      repeatdur: "repeatDur",
      requiredextensions: "requiredExtensions",
      requiredfeatures: "requiredFeatures",
      resource: "resource",
      restart: "restart",
      result: "result",
      results: "results",
      rotate: "rotate",
      rx: "rx",
      ry: "ry",
      scale: "scale",
      security: "security",
      seed: "seed",
      shaperendering: "shapeRendering",
      "shape-rendering": "shapeRendering",
      slope: "slope",
      spacing: "spacing",
      specularconstant: "specularConstant",
      specularexponent: "specularExponent",
      speed: "speed",
      spreadmethod: "spreadMethod",
      startoffset: "startOffset",
      stddeviation: "stdDeviation",
      stemh: "stemh",
      stemv: "stemv",
      stitchtiles: "stitchTiles",
      stopcolor: "stopColor",
      "stop-color": "stopColor",
      stopopacity: "stopOpacity",
      "stop-opacity": "stopOpacity",
      strikethroughposition: "strikethroughPosition",
      "strikethrough-position": "strikethroughPosition",
      strikethroughthickness: "strikethroughThickness",
      "strikethrough-thickness": "strikethroughThickness",
      string: "string",
      stroke: "stroke",
      strokedasharray: "strokeDasharray",
      "stroke-dasharray": "strokeDasharray",
      strokedashoffset: "strokeDashoffset",
      "stroke-dashoffset": "strokeDashoffset",
      strokelinecap: "strokeLinecap",
      "stroke-linecap": "strokeLinecap",
      strokelinejoin: "strokeLinejoin",
      "stroke-linejoin": "strokeLinejoin",
      strokemiterlimit: "strokeMiterlimit",
      "stroke-miterlimit": "strokeMiterlimit",
      strokewidth: "strokeWidth",
      "stroke-width": "strokeWidth",
      strokeopacity: "strokeOpacity",
      "stroke-opacity": "strokeOpacity",
      suppresscontenteditablewarning: "suppressContentEditableWarning",
      suppresshydrationwarning: "suppressHydrationWarning",
      surfacescale: "surfaceScale",
      systemlanguage: "systemLanguage",
      tablevalues: "tableValues",
      targetx: "targetX",
      targety: "targetY",
      textanchor: "textAnchor",
      "text-anchor": "textAnchor",
      textdecoration: "textDecoration",
      "text-decoration": "textDecoration",
      textlength: "textLength",
      textrendering: "textRendering",
      "text-rendering": "textRendering",
      to: "to",
      transform: "transform",
      typeof: "typeof",
      u1: "u1",
      u2: "u2",
      underlineposition: "underlinePosition",
      "underline-position": "underlinePosition",
      underlinethickness: "underlineThickness",
      "underline-thickness": "underlineThickness",
      unicode: "unicode",
      unicodebidi: "unicodeBidi",
      "unicode-bidi": "unicodeBidi",
      unicoderange: "unicodeRange",
      "unicode-range": "unicodeRange",
      unitsperem: "unitsPerEm",
      "units-per-em": "unitsPerEm",
      unselectable: "unselectable",
      valphabetic: "vAlphabetic",
      "v-alphabetic": "vAlphabetic",
      values: "values",
      vectoreffect: "vectorEffect",
      "vector-effect": "vectorEffect",
      version: "version",
      vertadvy: "vertAdvY",
      "vert-adv-y": "vertAdvY",
      vertoriginx: "vertOriginX",
      "vert-origin-x": "vertOriginX",
      vertoriginy: "vertOriginY",
      "vert-origin-y": "vertOriginY",
      vhanging: "vHanging",
      "v-hanging": "vHanging",
      videographic: "vIdeographic",
      "v-ideographic": "vIdeographic",
      viewbox: "viewBox",
      viewtarget: "viewTarget",
      visibility: "visibility",
      vmathematical: "vMathematical",
      "v-mathematical": "vMathematical",
      vocab: "vocab",
      widths: "widths",
      wordspacing: "wordSpacing",
      "word-spacing": "wordSpacing",
      writingmode: "writingMode",
      "writing-mode": "writingMode",
      x1: "x1",
      x2: "x2",
      x: "x",
      xchannelselector: "xChannelSelector",
      xheight: "xHeight",
      "x-height": "xHeight",
      xlinkactuate: "xlinkActuate",
      "xlink:actuate": "xlinkActuate",
      xlinkarcrole: "xlinkArcrole",
      "xlink:arcrole": "xlinkArcrole",
      xlinkhref: "xlinkHref",
      "xlink:href": "xlinkHref",
      xlinkrole: "xlinkRole",
      "xlink:role": "xlinkRole",
      xlinkshow: "xlinkShow",
      "xlink:show": "xlinkShow",
      xlinktitle: "xlinkTitle",
      "xlink:title": "xlinkTitle",
      xlinktype: "xlinkType",
      "xlink:type": "xlinkType",
      xmlbase: "xmlBase",
      "xml:base": "xmlBase",
      xmllang: "xmlLang",
      "xml:lang": "xmlLang",
      xmlns: "xmlns",
      "xml:space": "xmlSpace",
      xmlnsxlink: "xmlnsXlink",
      "xmlns:xlink": "xmlnsXlink",
      xmlspace: "xmlSpace",
      y1: "y1",
      y2: "y2",
      y: "y",
      ychannelselector: "yChannelSelector",
      z: "z",
      zoomandpan: "zoomAndPan"
    }, q6 = {
      "aria-current": 0,
      // state
      "aria-description": 0,
      "aria-details": 0,
      "aria-disabled": 0,
      // state
      "aria-hidden": 0,
      // state
      "aria-invalid": 0,
      // state
      "aria-keyshortcuts": 0,
      "aria-label": 0,
      "aria-roledescription": 0,
      // Widget Attributes
      "aria-autocomplete": 0,
      "aria-checked": 0,
      "aria-expanded": 0,
      "aria-haspopup": 0,
      "aria-level": 0,
      "aria-modal": 0,
      "aria-multiline": 0,
      "aria-multiselectable": 0,
      "aria-orientation": 0,
      "aria-placeholder": 0,
      "aria-pressed": 0,
      "aria-readonly": 0,
      "aria-required": 0,
      "aria-selected": 0,
      "aria-sort": 0,
      "aria-valuemax": 0,
      "aria-valuemin": 0,
      "aria-valuenow": 0,
      "aria-valuetext": 0,
      // Live Region Attributes
      "aria-atomic": 0,
      "aria-busy": 0,
      "aria-live": 0,
      "aria-relevant": 0,
      // Drag-and-Drop Attributes
      "aria-dropeffect": 0,
      "aria-grabbed": 0,
      // Relationship Attributes
      "aria-activedescendant": 0,
      "aria-colcount": 0,
      "aria-colindex": 0,
      "aria-colspan": 0,
      "aria-controls": 0,
      "aria-describedby": 0,
      "aria-errormessage": 0,
      "aria-flowto": 0,
      "aria-labelledby": 0,
      "aria-owns": 0,
      "aria-posinset": 0,
      "aria-rowcount": 0,
      "aria-rowindex": 0,
      "aria-rowspan": 0,
      "aria-setsize": 0
    }, R0 = {}, A0 = new RegExp("^(aria)-[" + Dt + "]*$"), V2 = new RegExp("^(aria)[A-Z][" + Dt + "]*$");
    function Yw(f, p) {
      {
        if (Bi.call(R0, p) && R0[p])
          return !0;
        if (V2.test(p)) {
          var C = "aria-" + p.slice(4).toLowerCase(), x = q6.hasOwnProperty(C) ? C : null;
          if (x == null)
            return a("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", p), R0[p] = !0, !0;
          if (p !== x)
            return a("Invalid ARIA attribute `%s`. Did you mean `%s`?", p, x), R0[p] = !0, !0;
        }
        if (A0.test(p)) {
          var I = p.toLowerCase(), O = q6.hasOwnProperty(I) ? I : null;
          if (O == null)
            return R0[p] = !0, !1;
          if (p !== O)
            return a("Unknown ARIA attribute `%s`. Did you mean `%s`?", p, O), R0[p] = !0, !0;
        }
      }
      return !0;
    }
    function U2(f, p) {
      {
        var C = [];
        for (var x in p) {
          var I = Yw(f, x);
          I || C.push(x);
        }
        var O = C.map(function(W) {
          return "`" + W + "`";
        }).join(", ");
        C.length === 1 ? a("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", O, f) : C.length > 1 && a("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", O, f);
      }
    }
    function K6(f, p) {
      Am(f, p) || U2(f, p);
    }
    var Xw = !1;
    function O0(f, p) {
      {
        if (f !== "input" && f !== "textarea" && f !== "select")
          return;
        p != null && p.value === null && !Xw && (Xw = !0, f === "select" && p.multiple ? a("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", f) : a("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", f));
      }
    }
    var Ik = function() {
    };
    {
      var ac = {}, Zw = /^on./, Y6 = /^on[^A-Z]/, X6 = new RegExp("^(aria)-[" + Dt + "]*$"), Z6 = new RegExp("^(aria)[A-Z][" + Dt + "]*$");
      Ik = function(f, p, C, x) {
        if (Bi.call(ac, p) && ac[p])
          return !0;
        var I = p.toLowerCase();
        if (I === "onfocusin" || I === "onfocusout")
          return a("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."), ac[p] = !0, !0;
        if (x != null) {
          var O = x.registrationNameDependencies, W = x.possibleRegistrationNames;
          if (O.hasOwnProperty(p))
            return !0;
          var q = W.hasOwnProperty(I) ? W[I] : null;
          if (q != null)
            return a("Invalid event handler property `%s`. Did you mean `%s`?", p, q), ac[p] = !0, !0;
          if (Zw.test(p))
            return a("Unknown event handler property `%s`. It will be ignored.", p), ac[p] = !0, !0;
        } else if (Zw.test(p))
          return Y6.test(p) && a("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", p), ac[p] = !0, !0;
        if (X6.test(p) || Z6.test(p))
          return !0;
        if (I === "innerhtml")
          return a("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."), ac[p] = !0, !0;
        if (I === "aria")
          return a("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."), ac[p] = !0, !0;
        if (I === "is" && C !== null && C !== void 0 && typeof C != "string")
          return a("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", typeof C), ac[p] = !0, !0;
        if (typeof C == "number" && isNaN(C))
          return a("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", p), ac[p] = !0, !0;
        var ee = gn(p), ue = ee !== null && ee.type === nr;
        if (N0.hasOwnProperty(I)) {
          var me = N0[I];
          if (me !== p)
            return a("Invalid DOM property `%s`. Did you mean `%s`?", p, me), ac[p] = !0, !0;
        } else if (!ue && p !== I)
          return a("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", p, I), ac[p] = !0, !0;
        return typeof C == "boolean" && Bt(p, C, ee, !1) ? (C ? a('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', C, p, p, C, p) : a('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', C, p, p, C, p, p, p), ac[p] = !0, !0) : ue ? !0 : Bt(p, C, ee, !1) ? (ac[p] = !0, !1) : ((C === "false" || C === "true") && ee !== null && ee.type === He && (a("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", C, p, C === "false" ? "The browser will interpret it as a truthy value." : 'Although this works, it will not work as expected if you pass the string "false".', p, C), ac[p] = !0), !0);
      };
    }
    var Q6 = function(f, p, C) {
      {
        var x = [];
        for (var I in p) {
          var O = Ik(f, I, p[I], C);
          O || x.push(I);
        }
        var W = x.map(function(q) {
          return "`" + q + "`";
        }).join(", ");
        x.length === 1 ? a("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", W, f) : x.length > 1 && a("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", W, f);
      }
    };
    function J6(f, p, C) {
      Am(f, p) || Q6(f, p, C);
    }
    var z2 = 1, cg = 2, Gb = 4, $2 = z2 | cg | Gb, Qw = null;
    function fX(f) {
      Qw !== null && a("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."), Qw = f;
    }
    function Jw() {
      Qw === null && a("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."), Qw = null;
    }
    function gX(f) {
      return f === Qw;
    }
    function Nk(f) {
      var p = f.target || f.srcElement || window;
      return p.correspondingUseElement && (p = p.correspondingUseElement), p.nodeType === op ? p.parentNode : p;
    }
    var Rk = null, Cs = null, Om = null;
    function eS(f) {
      var p = aC(f);
      if (p) {
        if (typeof Rk != "function")
          throw new Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
        var C = p.stateNode;
        if (C) {
          var x = r9(C);
          Rk(p.stateNode, p.type, x);
        }
      }
    }
    function tS(f) {
      Rk = f;
    }
    function j2(f) {
      Cs ? Om ? Om.push(f) : Om = [f] : Cs = f;
    }
    function G2() {
      return Cs !== null || Om !== null;
    }
    function M0() {
      if (Cs) {
        var f = Cs, p = Om;
        if (Cs = null, Om = null, eS(f), p)
          for (var C = 0; C < p.length; C++)
            eS(p[C]);
      }
    }
    var nS = function(f, p) {
      return f(p);
    }, qb = function() {
    }, Ak = !1;
    function pX() {
      var f = G2();
      f && (qb(), M0());
    }
    function e8(f, p, C) {
      if (Ak)
        return f(p, C);
      Ak = !0;
      try {
        return nS(f, p, C);
      } finally {
        Ak = !1, pX();
      }
    }
    function t8(f, p, C) {
      nS = f, qb = C;
    }
    function Ok(f) {
      return f === "button" || f === "input" || f === "select" || f === "textarea";
    }
    function Mk(f, p, C) {
      switch (f) {
        case "onClick":
        case "onClickCapture":
        case "onDoubleClick":
        case "onDoubleClickCapture":
        case "onMouseDown":
        case "onMouseDownCapture":
        case "onMouseMove":
        case "onMouseMoveCapture":
        case "onMouseUp":
        case "onMouseUpCapture":
        case "onMouseEnter":
          return !!(C.disabled && Ok(p));
        default:
          return !1;
      }
    }
    function Kb(f, p) {
      var C = f.stateNode;
      if (C === null)
        return null;
      var x = r9(C);
      if (x === null)
        return null;
      var I = x[p];
      if (Mk(p, f.type, x))
        return null;
      if (I && typeof I != "function")
        throw new Error("Expected `" + p + "` listener to be a function, instead got a value of `" + typeof I + "` type.");
      return I;
    }
    var iS = !1;
    if (Vt)
      try {
        var Yb = {};
        Object.defineProperty(Yb, "passive", {
          get: function() {
            iS = !0;
          }
        }), window.addEventListener("test", Yb, Yb), window.removeEventListener("test", Yb, Yb);
      } catch {
        iS = !1;
      }
    function Pk(f, p, C, x, I, O, W, q, ee) {
      var ue = Array.prototype.slice.call(arguments, 3);
      try {
        p.apply(C, ue);
      } catch (me) {
        this.onError(me);
      }
    }
    var n8 = Pk;
    if (typeof window < "u" && typeof window.dispatchEvent == "function" && typeof document < "u" && typeof document.createEvent == "function") {
      var Fk = document.createElement("react");
      n8 = function(p, C, x, I, O, W, q, ee, ue) {
        if (typeof document > "u" || document === null)
          throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
        var me = document.createEvent("Event"), Me = !1, Ae = !0, nt = window.event, rt = Object.getOwnPropertyDescriptor(window, "event");
        function ft() {
          Fk.removeEventListener(gt, ai, !1), typeof window.event < "u" && window.hasOwnProperty("event") && (window.event = nt);
        }
        var un = Array.prototype.slice.call(arguments, 3);
        function ai() {
          Me = !0, ft(), C.apply(x, un), Ae = !1;
        }
        var Xn, Or = !1, Sr = !1;
        function qe(Ke) {
          if (Xn = Ke.error, Or = !0, Xn === null && Ke.colno === 0 && Ke.lineno === 0 && (Sr = !0), Ke.defaultPrevented && Xn != null && typeof Xn == "object")
            try {
              Xn._suppressLogging = !0;
            } catch {
            }
        }
        var gt = "react-" + (p || "invokeguardedcallback");
        if (window.addEventListener("error", qe), Fk.addEventListener(gt, ai, !1), me.initEvent(gt, !1, !1), Fk.dispatchEvent(me), rt && Object.defineProperty(window, "event", rt), Me && Ae && (Or ? Sr && (Xn = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")) : Xn = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`), this.onError(Xn)), window.removeEventListener("error", qe), !Me)
          return ft(), Pk.apply(this, arguments);
      };
    }
    var mX = n8, P0 = !1, F0 = null, af = !1, Bk = null, B0 = {
      onError: function(f) {
        P0 = !0, F0 = f;
      }
    };
    function th(f, p, C, x, I, O, W, q, ee) {
      P0 = !1, F0 = null, mX.apply(B0, arguments);
    }
    function rS(f, p, C, x, I, O, W, q, ee) {
      if (th.apply(this, arguments), P0) {
        var ue = K2();
        af || (af = !0, Bk = ue);
      }
    }
    function lp() {
      if (af) {
        var f = Bk;
        throw af = !1, Bk = null, f;
      }
    }
    function q2() {
      return P0;
    }
    function K2() {
      if (P0) {
        var f = F0;
        return P0 = !1, F0 = null, f;
      } else
        throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
    }
    function H0(f) {
      return f._reactInternals;
    }
    function Xb(f) {
      return f._reactInternals !== void 0;
    }
    function sS(f, p) {
      f._reactInternals = p;
    }
    var Jn = (
      /*                      */
      0
    ), cp = (
      /*                */
      1
    ), qo = (
      /*                    */
      2
    ), _r = (
      /*                       */
      4
    ), wu = (
      /*                */
      16
    ), ks = (
      /*                 */
      32
    ), oo = (
      /*                     */
      64
    ), lr = (
      /*                   */
      128
    ), Ao = (
      /*            */
      256
    ), wa = (
      /*                          */
      512
    ), nh = (
      /*                     */
      1024
    ), dd = (
      /*                      */
      2048
    ), Ko = (
      /*                    */
      4096
    ), ug = (
      /*                   */
      8192
    ), Hk = (
      /*             */
      16384
    ), i8 = (
      /*               */
      32767
    ), Zb = (
      /*                   */
      32768
    ), lc = (
      /*                */
      65536
    ), lf = (
      /* */
      131072
    ), oS = (
      /*                       */
      1048576
    ), aS = (
      /*                    */
      2097152
    ), Mm = (
      /*                 */
      4194304
    ), Y2 = (
      /*                */
      8388608
    ), Pc = (
      /*               */
      16777216
    ), Pm = (
      /*              */
      33554432
    ), Fm = (
      // TODO: Remove Update flag from before mutation phase by re-landing Visibility
      // flag logic (see #20043)
      _r | nh | 0
    ), W0 = qo | _r | wu | ks | wa | Ko | ug, Bm = _r | oo | wa | ug, Tl = dd | wu, Sa = Mm | Y2 | aS, Qb = n.ReactCurrentOwner;
    function Fc(f) {
      var p = f, C = f;
      if (f.alternate)
        for (; p.return; )
          p = p.return;
      else {
        var x = p;
        do
          p = x, (p.flags & (qo | Ko)) !== Jn && (C = p.return), x = p.return;
        while (x);
      }
      return p.tag === h ? C : null;
    }
    function dg(f) {
      if (f.tag === N) {
        var p = f.memoizedState;
        if (p === null) {
          var C = f.alternate;
          C !== null && (p = C.memoizedState);
        }
        if (p !== null)
          return p.dehydrated;
      }
      return null;
    }
    function Hm(f) {
      return f.tag === h ? f.stateNode.containerInfo : null;
    }
    function r8(f) {
      return Fc(f) === f;
    }
    function X2(f) {
      {
        var p = Qb.current;
        if (p !== null && p.tag === u) {
          var C = p, x = C.stateNode;
          x._warnedAboutRefsInRender || a("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", Ai(C) || "A component"), x._warnedAboutRefsInRender = !0;
        }
      }
      var I = H0(f);
      return I ? Fc(I) === I : !1;
    }
    function Wk(f) {
      if (Fc(f) !== f)
        throw new Error("Unable to find node on an unmounted component.");
    }
    function Su(f) {
      var p = f.alternate;
      if (!p) {
        var C = Fc(f);
        if (C === null)
          throw new Error("Unable to find node on an unmounted component.");
        return C !== f ? null : f;
      }
      for (var x = f, I = p; ; ) {
        var O = x.return;
        if (O === null)
          break;
        var W = O.alternate;
        if (W === null) {
          var q = O.return;
          if (q !== null) {
            x = I = q;
            continue;
          }
          break;
        }
        if (O.child === W.child) {
          for (var ee = O.child; ee; ) {
            if (ee === x)
              return Wk(O), f;
            if (ee === I)
              return Wk(O), p;
            ee = ee.sibling;
          }
          throw new Error("Unable to find node on an unmounted component.");
        }
        if (x.return !== I.return)
          x = O, I = W;
        else {
          for (var ue = !1, me = O.child; me; ) {
            if (me === x) {
              ue = !0, x = O, I = W;
              break;
            }
            if (me === I) {
              ue = !0, I = O, x = W;
              break;
            }
            me = me.sibling;
          }
          if (!ue) {
            for (me = W.child; me; ) {
              if (me === x) {
                ue = !0, x = W, I = O;
                break;
              }
              if (me === I) {
                ue = !0, I = W, x = O;
                break;
              }
              me = me.sibling;
            }
            if (!ue)
              throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
          }
        }
        if (x.alternate !== I)
          throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
      }
      if (x.tag !== h)
        throw new Error("Unable to find node on an unmounted component.");
      return x.stateNode.current === x ? f : p;
    }
    function Eu(f) {
      var p = Su(f);
      return p !== null ? xo(p) : null;
    }
    function xo(f) {
      if (f.tag === m || f.tag === _)
        return f;
      for (var p = f.child; p !== null; ) {
        var C = xo(p);
        if (C !== null)
          return C;
        p = p.sibling;
      }
      return null;
    }
    function cf(f) {
      var p = Su(f);
      return p !== null ? Z2(p) : null;
    }
    function Z2(f) {
      if (f.tag === m || f.tag === _)
        return f;
      for (var p = f.child; p !== null; ) {
        if (p.tag !== g) {
          var C = Z2(p);
          if (C !== null)
            return C;
        }
        p = p.sibling;
      }
      return null;
    }
    var Q2 = t.unstable_scheduleCallback, J2 = t.unstable_cancelCallback, eO = t.unstable_shouldYield, s8 = t.unstable_requestPaint, ra = t.unstable_now, o8 = t.unstable_getCurrentPriorityLevel, up = t.unstable_ImmediatePriority, lS = t.unstable_UserBlockingPriority, Jb = t.unstable_NormalPriority, cS = t.unstable_LowPriority, V0 = t.unstable_IdlePriority, a8 = t.unstable_yieldValue, l8 = t.unstable_setDisableYieldValue, uf = null, kl = null, on = null, hd = !1, cc = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u";
    function tO(f) {
      if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u")
        return !1;
      var p = __REACT_DEVTOOLS_GLOBAL_HOOK__;
      if (p.isDisabled)
        return !0;
      if (!p.supportsFiber)
        return a("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"), !0;
      try {
        ze && (f = bn({}, f, {
          getLaneLabelMap: sO,
          injectProfilingHooks: ev
        })), uf = p.inject(f), kl = p;
      } catch (C) {
        a("React instrumentation encountered an error: %s.", C);
      }
      return !!p.checkDCE;
    }
    function nO(f, p) {
      if (kl && typeof kl.onScheduleFiberRoot == "function")
        try {
          kl.onScheduleFiberRoot(uf, f, p);
        } catch (C) {
          hd || (hd = !0, a("React instrumentation encountered an error: %s", C));
        }
    }
    function iO(f, p) {
      if (kl && typeof kl.onCommitFiberRoot == "function")
        try {
          var C = (f.current.flags & lr) === lr;
          if (Ve) {
            var x;
            switch (p) {
              case Du:
                x = up;
                break;
              case rh:
                x = lS;
                break;
              case Dl:
                x = Jb;
                break;
              case mD:
                x = V0;
                break;
              default:
                x = Jb;
                break;
            }
            kl.onCommitFiberRoot(uf, f, x, C);
          }
        } catch (I) {
          hd || (hd = !0, a("React instrumentation encountered an error: %s", I));
        }
    }
    function rO(f) {
      if (kl && typeof kl.onPostCommitFiberRoot == "function")
        try {
          kl.onPostCommitFiberRoot(uf, f);
        } catch (p) {
          hd || (hd = !0, a("React instrumentation encountered an error: %s", p));
        }
    }
    function U0(f) {
      if (kl && typeof kl.onCommitFiberUnmount == "function")
        try {
          kl.onCommitFiberUnmount(uf, f);
        } catch (p) {
          hd || (hd = !0, a("React instrumentation encountered an error: %s", p));
        }
    }
    function Ds(f) {
      if (typeof a8 == "function" && (l8(f), s(f)), kl && typeof kl.setStrictMode == "function")
        try {
          kl.setStrictMode(uf, f);
        } catch (p) {
          hd || (hd = !0, a("React instrumentation encountered an error: %s", p));
        }
    }
    function ev(f) {
      on = f;
    }
    function sO() {
      {
        for (var f = /* @__PURE__ */ new Map(), p = 1, C = 0; C < dO; C++) {
          var x = g8(p);
          f.set(p, x), p *= 2;
        }
        return f;
      }
    }
    function c8(f) {
      on !== null && typeof on.markCommitStarted == "function" && on.markCommitStarted(f);
    }
    function hg() {
      on !== null && typeof on.markCommitStopped == "function" && on.markCommitStopped();
    }
    function ih(f) {
      on !== null && typeof on.markComponentRenderStarted == "function" && on.markComponentRenderStarted(f);
    }
    function Wm() {
      on !== null && typeof on.markComponentRenderStopped == "function" && on.markComponentRenderStopped();
    }
    function u8(f) {
      on !== null && typeof on.markComponentPassiveEffectMountStarted == "function" && on.markComponentPassiveEffectMountStarted(f);
    }
    function dp() {
      on !== null && typeof on.markComponentPassiveEffectMountStopped == "function" && on.markComponentPassiveEffectMountStopped();
    }
    function Vm(f) {
      on !== null && typeof on.markComponentPassiveEffectUnmountStarted == "function" && on.markComponentPassiveEffectUnmountStarted(f);
    }
    function Vk() {
      on !== null && typeof on.markComponentPassiveEffectUnmountStopped == "function" && on.markComponentPassiveEffectUnmountStopped();
    }
    function d8(f) {
      on !== null && typeof on.markComponentLayoutEffectMountStarted == "function" && on.markComponentLayoutEffectMountStarted(f);
    }
    function Uk() {
      on !== null && typeof on.markComponentLayoutEffectMountStopped == "function" && on.markComponentLayoutEffectMountStopped();
    }
    function oO(f) {
      on !== null && typeof on.markComponentLayoutEffectUnmountStarted == "function" && on.markComponentLayoutEffectUnmountStarted(f);
    }
    function z0() {
      on !== null && typeof on.markComponentLayoutEffectUnmountStopped == "function" && on.markComponentLayoutEffectUnmountStopped();
    }
    function fg(f, p, C) {
      on !== null && typeof on.markComponentErrored == "function" && on.markComponentErrored(f, p, C);
    }
    function uS(f, p, C) {
      on !== null && typeof on.markComponentSuspended == "function" && on.markComponentSuspended(f, p, C);
    }
    function dS(f) {
      on !== null && typeof on.markLayoutEffectsStarted == "function" && on.markLayoutEffectsStarted(f);
    }
    function tv() {
      on !== null && typeof on.markLayoutEffectsStopped == "function" && on.markLayoutEffectsStopped();
    }
    function aO(f) {
      on !== null && typeof on.markPassiveEffectsStarted == "function" && on.markPassiveEffectsStarted(f);
    }
    function $0() {
      on !== null && typeof on.markPassiveEffectsStopped == "function" && on.markPassiveEffectsStopped();
    }
    function lO(f) {
      on !== null && typeof on.markRenderStarted == "function" && on.markRenderStarted(f);
    }
    function cO() {
      on !== null && typeof on.markRenderYielded == "function" && on.markRenderYielded();
    }
    function Oo() {
      on !== null && typeof on.markRenderStopped == "function" && on.markRenderStopped();
    }
    function zk(f) {
      on !== null && typeof on.markRenderScheduled == "function" && on.markRenderScheduled(f);
    }
    function uO(f, p) {
      on !== null && typeof on.markForceUpdateScheduled == "function" && on.markForceUpdateScheduled(f, p);
    }
    function hS(f, p) {
      on !== null && typeof on.markStateUpdateScheduled == "function" && on.markStateUpdateScheduled(f, p);
    }
    var ei = (
      /*                         */
      0
    ), gr = (
      /*                 */
      1
    ), Lr = (
      /*                    */
      2
    ), zi = (
      /*               */
      8
    ), $s = (
      /*              */
      16
    ), Ba = Math.clz32 ? Math.clz32 : gS, $k = Math.log, fS = Math.LN2;
    function gS(f) {
      var p = f >>> 0;
      return p === 0 ? 32 : 31 - ($k(p) / fS | 0) | 0;
    }
    var dO = 31, pt = (
      /*                        */
      0
    ), Ea = (
      /*                          */
      0
    ), Ci = (
      /*                        */
      1
    ), Um = (
      /*    */
      2
    ), tl = (
      /*             */
      4
    ), nl = (
      /*            */
      8
    ), xu = (
      /*                     */
      16
    ), nv = (
      /*                */
      32
    ), zm = (
      /*                       */
      4194240
    ), j0 = (
      /*                        */
      64
    ), jk = (
      /*                        */
      128
    ), Gk = (
      /*                        */
      256
    ), qk = (
      /*                        */
      512
    ), Kk = (
      /*                        */
      1024
    ), Yk = (
      /*                        */
      2048
    ), Xk = (
      /*                        */
      4096
    ), Zk = (
      /*                        */
      8192
    ), iv = (
      /*                        */
      16384
    ), Qk = (
      /*                       */
      32768
    ), G0 = (
      /*                       */
      65536
    ), q0 = (
      /*                       */
      131072
    ), Jk = (
      /*                       */
      262144
    ), pS = (
      /*                       */
      524288
    ), eD = (
      /*                       */
      1048576
    ), tD = (
      /*                       */
      2097152
    ), mS = (
      /*                            */
      130023424
    ), rv = (
      /*                             */
      4194304
    ), _S = (
      /*                             */
      8388608
    ), nD = (
      /*                             */
      16777216
    ), iD = (
      /*                             */
      33554432
    ), rD = (
      /*                             */
      67108864
    ), h8 = rv, K0 = (
      /*          */
      134217728
    ), f8 = (
      /*                          */
      268435455
    ), bS = (
      /*               */
      268435456
    ), $m = (
      /*                        */
      536870912
    ), Lu = (
      /*                   */
      1073741824
    );
    function g8(f) {
      {
        if (f & Ci)
          return "Sync";
        if (f & Um)
          return "InputContinuousHydration";
        if (f & tl)
          return "InputContinuous";
        if (f & nl)
          return "DefaultHydration";
        if (f & xu)
          return "Default";
        if (f & nv)
          return "TransitionHydration";
        if (f & zm)
          return "Transition";
        if (f & mS)
          return "Retry";
        if (f & K0)
          return "SelectiveHydration";
        if (f & bS)
          return "IdleHydration";
        if (f & $m)
          return "Idle";
        if (f & Lu)
          return "Offscreen";
      }
    }
    var Is = -1, sD = j0, oD = rv;
    function vS(f) {
      switch (sv(f)) {
        case Ci:
          return Ci;
        case Um:
          return Um;
        case tl:
          return tl;
        case nl:
          return nl;
        case xu:
          return xu;
        case nv:
          return nv;
        case j0:
        case jk:
        case Gk:
        case qk:
        case Kk:
        case Yk:
        case Xk:
        case Zk:
        case iv:
        case Qk:
        case G0:
        case q0:
        case Jk:
        case pS:
        case eD:
        case tD:
          return f & zm;
        case rv:
        case _S:
        case nD:
        case iD:
        case rD:
          return f & mS;
        case K0:
          return K0;
        case bS:
          return bS;
        case $m:
          return $m;
        case Lu:
          return Lu;
        default:
          return a("Should have found matching lanes. This is a bug in React."), f;
      }
    }
    function Tu(f, p) {
      var C = f.pendingLanes;
      if (C === pt)
        return pt;
      var x = pt, I = f.suspendedLanes, O = f.pingedLanes, W = C & f8;
      if (W !== pt) {
        var q = W & ~I;
        if (q !== pt)
          x = vS(q);
        else {
          var ee = W & O;
          ee !== pt && (x = vS(ee));
        }
      } else {
        var ue = C & ~I;
        ue !== pt ? x = vS(ue) : O !== pt && (x = vS(O));
      }
      if (x === pt)
        return pt;
      if (p !== pt && p !== x && // If we already suspended with a delay, then interrupting is fine. Don't
      // bother waiting until the root is complete.
      (p & I) === pt) {
        var me = sv(x), Me = sv(p);
        if (
          // Tests whether the next lane is equal or lower priority than the wip
          // one. This works because the bits decrease in priority as you go left.
          me >= Me || // Default priority updates should not interrupt transition updates. The
          // only difference between default updates and transition updates is that
          // default updates do not support refresh transitions.
          me === xu && (Me & zm) !== pt
        )
          return p;
      }
      (x & tl) !== pt && (x |= C & xu);
      var Ae = f.entangledLanes;
      if (Ae !== pt)
        for (var nt = f.entanglements, rt = x & Ae; rt > 0; ) {
          var ft = sa(rt), un = 1 << ft;
          x |= nt[ft], rt &= ~un;
        }
      return x;
    }
    function hO(f, p) {
      for (var C = f.eventTimes, x = Is; p > 0; ) {
        var I = sa(p), O = 1 << I, W = C[I];
        W > x && (x = W), p &= ~O;
      }
      return x;
    }
    function aD(f, p) {
      switch (f) {
        case Ci:
        case Um:
        case tl:
          return p + 250;
        case nl:
        case xu:
        case nv:
        case j0:
        case jk:
        case Gk:
        case qk:
        case Kk:
        case Yk:
        case Xk:
        case Zk:
        case iv:
        case Qk:
        case G0:
        case q0:
        case Jk:
        case pS:
        case eD:
        case tD:
          return p + 5e3;
        case rv:
        case _S:
        case nD:
        case iD:
        case rD:
          return Is;
        case K0:
        case bS:
        case $m:
        case Lu:
          return Is;
        default:
          return a("Should have found matching lanes. This is a bug in React."), Is;
      }
    }
    function p8(f, p) {
      for (var C = f.pendingLanes, x = f.suspendedLanes, I = f.pingedLanes, O = f.expirationTimes, W = C; W > 0; ) {
        var q = sa(W), ee = 1 << q, ue = O[q];
        ue === Is ? ((ee & x) === pt || (ee & I) !== pt) && (O[q] = aD(ee, p)) : ue <= p && (f.expiredLanes |= ee), W &= ~ee;
      }
    }
    function m8(f) {
      return vS(f.pendingLanes);
    }
    function lD(f) {
      var p = f.pendingLanes & ~Lu;
      return p !== pt ? p : p & Lu ? Lu : pt;
    }
    function fO(f) {
      return (f & Ci) !== pt;
    }
    function jm(f) {
      return (f & f8) !== pt;
    }
    function cD(f) {
      return (f & mS) === f;
    }
    function gO(f) {
      var p = Ci | tl | xu;
      return (f & p) === pt;
    }
    function _X(f) {
      return (f & zm) === f;
    }
    function yS(f, p) {
      var C = Um | tl | nl | xu;
      return (p & C) !== pt;
    }
    function _8(f, p) {
      return (p & f.expiredLanes) !== pt;
    }
    function pO(f) {
      return (f & zm) !== pt;
    }
    function mO() {
      var f = sD;
      return sD <<= 1, (sD & zm) === pt && (sD = j0), f;
    }
    function b8() {
      var f = oD;
      return oD <<= 1, (oD & mS) === pt && (oD = rv), f;
    }
    function sv(f) {
      return f & -f;
    }
    function il(f) {
      return sv(f);
    }
    function sa(f) {
      return 31 - Ba(f);
    }
    function uD(f) {
      return sa(f);
    }
    function ku(f, p) {
      return (f & p) !== pt;
    }
    function ov(f, p) {
      return (f & p) === p;
    }
    function Xi(f, p) {
      return f | p;
    }
    function CS(f, p) {
      return f & ~p;
    }
    function dD(f, p) {
      return f & p;
    }
    function bX(f) {
      return f;
    }
    function _O(f, p) {
      return f !== Ea && f < p ? f : p;
    }
    function hD(f) {
      for (var p = [], C = 0; C < dO; C++)
        p.push(f);
      return p;
    }
    function Y0(f, p, C) {
      f.pendingLanes |= p, p !== $m && (f.suspendedLanes = pt, f.pingedLanes = pt);
      var x = f.eventTimes, I = uD(p);
      x[I] = C;
    }
    function bO(f, p) {
      f.suspendedLanes |= p, f.pingedLanes &= ~p;
      for (var C = f.expirationTimes, x = p; x > 0; ) {
        var I = sa(x), O = 1 << I;
        C[I] = Is, x &= ~O;
      }
    }
    function fD(f, p, C) {
      f.pingedLanes |= f.suspendedLanes & p;
    }
    function v8(f, p) {
      var C = f.pendingLanes & ~p;
      f.pendingLanes = p, f.suspendedLanes = pt, f.pingedLanes = pt, f.expiredLanes &= p, f.mutableReadLanes &= p, f.entangledLanes &= p;
      for (var x = f.entanglements, I = f.eventTimes, O = f.expirationTimes, W = C; W > 0; ) {
        var q = sa(W), ee = 1 << q;
        x[q] = pt, I[q] = Is, O[q] = Is, W &= ~ee;
      }
    }
    function wS(f, p) {
      for (var C = f.entangledLanes |= p, x = f.entanglements, I = C; I; ) {
        var O = sa(I), W = 1 << O;
        // Is this one of the newly entangled lanes?
        W & p | // Is this lane transitively entangled with the newly entangled lanes?
        x[O] & p && (x[O] |= p), I &= ~W;
      }
    }
    function gD(f, p) {
      var C = sv(p), x;
      switch (C) {
        case tl:
          x = Um;
          break;
        case xu:
          x = nl;
          break;
        case j0:
        case jk:
        case Gk:
        case qk:
        case Kk:
        case Yk:
        case Xk:
        case Zk:
        case iv:
        case Qk:
        case G0:
        case q0:
        case Jk:
        case pS:
        case eD:
        case tD:
        case rv:
        case _S:
        case nD:
        case iD:
        case rD:
          x = nv;
          break;
        case $m:
          x = bS;
          break;
        default:
          x = Ea;
          break;
      }
      return (x & (f.suspendedLanes | p)) !== Ea ? Ea : x;
    }
    function y8(f, p, C) {
      if (cc)
        for (var x = f.pendingUpdatersLaneMap; C > 0; ) {
          var I = uD(C), O = 1 << I, W = x[I];
          W.add(p), C &= ~O;
        }
    }
    function vO(f, p) {
      if (cc)
        for (var C = f.pendingUpdatersLaneMap, x = f.memoizedUpdaters; p > 0; ) {
          var I = uD(p), O = 1 << I, W = C[I];
          W.size > 0 && (W.forEach(function(q) {
            var ee = q.alternate;
            (ee === null || !x.has(ee)) && x.add(q);
          }), W.clear()), p &= ~O;
        }
    }
    function pD(f, p) {
      return null;
    }
    var Du = Ci, rh = tl, Dl = xu, mD = $m, X0 = Ea;
    function fd() {
      return X0;
    }
    function Ha(f) {
      X0 = f;
    }
    function C8(f, p) {
      var C = X0;
      try {
        return X0 = f, p();
      } finally {
        X0 = C;
      }
    }
    function SS(f, p) {
      return f !== 0 && f < p ? f : p;
    }
    function uc(f, p) {
      return f > p ? f : p;
    }
    function yO(f, p) {
      return f !== 0 && f < p;
    }
    function w8(f) {
      var p = sv(f);
      return yO(Du, p) ? yO(rh, p) ? jm(p) ? Dl : mD : rh : Du;
    }
    function av(f) {
      var p = f.current.memoizedState;
      return p.isDehydrated;
    }
    var Il;
    function vX(f) {
      Il = f;
    }
    function Dn(f) {
      Il(f);
    }
    var Gm;
    function CO(f) {
      Gm = f;
    }
    var wO;
    function yX(f) {
      wO = f;
    }
    var Z0;
    function _D(f) {
      Z0 = f;
    }
    var bD;
    function S8(f) {
      bD = f;
    }
    var vD = !1, ES = [], gg = null, pg = null, Mo = null, Bc = /* @__PURE__ */ new Map(), sh = /* @__PURE__ */ new Map(), hp = [], E8 = [
      "mousedown",
      "mouseup",
      "touchcancel",
      "touchend",
      "touchstart",
      "auxclick",
      "dblclick",
      "pointercancel",
      "pointerdown",
      "pointerup",
      "dragend",
      "dragstart",
      "drop",
      "compositionend",
      "compositionstart",
      "keydown",
      "keypress",
      "keyup",
      "input",
      "textInput",
      // Intentionally camelCase
      "copy",
      "cut",
      "paste",
      "click",
      "change",
      "contextmenu",
      "reset",
      "submit"
    ];
    function df(f) {
      return E8.indexOf(f) > -1;
    }
    function x8(f, p, C, x, I) {
      return {
        blockedOn: f,
        domEventName: p,
        eventSystemFlags: C,
        nativeEvent: I,
        targetContainers: [x]
      };
    }
    function hf(f, p) {
      switch (f) {
        case "focusin":
        case "focusout":
          gg = null;
          break;
        case "dragenter":
        case "dragleave":
          pg = null;
          break;
        case "mouseover":
        case "mouseout":
          Mo = null;
          break;
        case "pointerover":
        case "pointerout": {
          var C = p.pointerId;
          Bc.delete(C);
          break;
        }
        case "gotpointercapture":
        case "lostpointercapture": {
          var x = p.pointerId;
          sh.delete(x);
          break;
        }
      }
    }
    function xS(f, p, C, x, I, O) {
      if (f === null || f.nativeEvent !== O) {
        var W = x8(p, C, x, I, O);
        if (p !== null) {
          var q = aC(p);
          q !== null && Gm(q);
        }
        return W;
      }
      f.eventSystemFlags |= x;
      var ee = f.targetContainers;
      return I !== null && ee.indexOf(I) === -1 && ee.push(I), f;
    }
    function L8(f, p, C, x, I) {
      switch (p) {
        case "focusin": {
          var O = I;
          return gg = xS(gg, f, p, C, x, O), !0;
        }
        case "dragenter": {
          var W = I;
          return pg = xS(pg, f, p, C, x, W), !0;
        }
        case "mouseover": {
          var q = I;
          return Mo = xS(Mo, f, p, C, x, q), !0;
        }
        case "pointerover": {
          var ee = I, ue = ee.pointerId;
          return Bc.set(ue, xS(Bc.get(ue) || null, f, p, C, x, ee)), !0;
        }
        case "gotpointercapture": {
          var me = I, Me = me.pointerId;
          return sh.set(Me, xS(sh.get(Me) || null, f, p, C, x, me)), !0;
        }
      }
      return !1;
    }
    function SO(f) {
      var p = HS(f.target);
      if (p !== null) {
        var C = Fc(p);
        if (C !== null) {
          var x = C.tag;
          if (x === N) {
            var I = dg(C);
            if (I !== null) {
              f.blockedOn = I, bD(f.priority, function() {
                wO(C);
              });
              return;
            }
          } else if (x === h) {
            var O = C.stateNode;
            if (av(O)) {
              f.blockedOn = Hm(C);
              return;
            }
          }
        }
      }
      f.blockedOn = null;
    }
    function T8(f) {
      for (var p = Z0(), C = {
        blockedOn: null,
        target: f,
        priority: p
      }, x = 0; x < hp.length && yO(p, hp[x].priority); x++)
        ;
      hp.splice(x, 0, C), x === 0 && SO(C);
    }
    function LS(f) {
      if (f.blockedOn !== null)
        return !1;
      for (var p = f.targetContainers; p.length > 0; ) {
        var C = p[0], x = TS(f.domEventName, f.eventSystemFlags, C, f.nativeEvent);
        if (x === null) {
          var I = f.nativeEvent, O = new I.constructor(I.type, I);
          fX(O), I.target.dispatchEvent(O), Jw();
        } else {
          var W = aC(x);
          return W !== null && Gm(W), f.blockedOn = x, !1;
        }
        p.shift();
      }
      return !0;
    }
    function k8(f, p, C) {
      LS(f) && C.delete(p);
    }
    function yD() {
      vD = !1, gg !== null && LS(gg) && (gg = null), pg !== null && LS(pg) && (pg = null), Mo !== null && LS(Mo) && (Mo = null), Bc.forEach(k8), sh.forEach(k8);
    }
    function lv(f, p) {
      f.blockedOn === p && (f.blockedOn = null, vD || (vD = !0, t.unstable_scheduleCallback(t.unstable_NormalPriority, yD)));
    }
    function dc(f) {
      if (ES.length > 0) {
        lv(ES[0], f);
        for (var p = 1; p < ES.length; p++) {
          var C = ES[p];
          C.blockedOn === f && (C.blockedOn = null);
        }
      }
      gg !== null && lv(gg, f), pg !== null && lv(pg, f), Mo !== null && lv(Mo, f);
      var x = function(q) {
        return lv(q, f);
      };
      Bc.forEach(x), sh.forEach(x);
      for (var I = 0; I < hp.length; I++) {
        var O = hp[I];
        O.blockedOn === f && (O.blockedOn = null);
      }
      for (; hp.length > 0; ) {
        var W = hp[0];
        if (W.blockedOn !== null)
          break;
        SO(W), W.blockedOn === null && hp.shift();
      }
    }
    var br = n.ReactCurrentBatchConfig, xa = !0;
    function oa(f) {
      xa = !!f;
    }
    function Nl() {
      return xa;
    }
    function gd(f, p, C) {
      var x = J0(p), I;
      switch (x) {
        case Du:
          I = Q0;
          break;
        case rh:
          I = Wa;
          break;
        case Dl:
        default:
          I = cv;
          break;
      }
      return I.bind(null, p, C, f);
    }
    function Q0(f, p, C, x) {
      var I = fd(), O = br.transition;
      br.transition = null;
      try {
        Ha(Du), cv(f, p, C, x);
      } finally {
        Ha(I), br.transition = O;
      }
    }
    function Wa(f, p, C, x) {
      var I = fd(), O = br.transition;
      br.transition = null;
      try {
        Ha(rh), cv(f, p, C, x);
      } finally {
        Ha(I), br.transition = O;
      }
    }
    function cv(f, p, C, x) {
      xa && uv(f, p, C, x);
    }
    function uv(f, p, C, x) {
      var I = TS(f, p, C, x);
      if (I === null) {
        FX(f, p, x, dv, C), hf(f, x);
        return;
      }
      if (L8(I, f, p, C, x)) {
        x.stopPropagation();
        return;
      }
      if (hf(f, x), p & Gb && df(f)) {
        for (; I !== null; ) {
          var O = aC(I);
          O !== null && Dn(O);
          var W = TS(f, p, C, x);
          if (W === null && FX(f, p, x, dv, C), W === I)
            break;
          I = W;
        }
        I !== null && x.stopPropagation();
        return;
      }
      FX(f, p, x, null, C);
    }
    var dv = null;
    function TS(f, p, C, x) {
      dv = null;
      var I = Nk(x), O = HS(I);
      if (O !== null) {
        var W = Fc(O);
        if (W === null)
          O = null;
        else {
          var q = W.tag;
          if (q === N) {
            var ee = dg(W);
            if (ee !== null)
              return ee;
            O = null;
          } else if (q === h) {
            var ue = W.stateNode;
            if (av(ue))
              return Hm(W);
            O = null;
          } else W !== O && (O = null);
        }
      }
      return dv = O, null;
    }
    function J0(f) {
      switch (f) {
        // Used by SimpleEventPlugin:
        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 "touchcancel":
        case "touchend":
        case "touchstart":
        case "volumechange":
        // Used by polyfills:
        // eslint-disable-next-line no-fallthrough
        case "change":
        case "selectionchange":
        case "textInput":
        case "compositionstart":
        case "compositionend":
        case "compositionupdate":
        // Only enableCreateEventHandleAPI:
        // eslint-disable-next-line no-fallthrough
        case "beforeblur":
        case "afterblur":
        // Not used by React but could be by user code:
        // eslint-disable-next-line no-fallthrough
        case "beforeinput":
        case "blur":
        case "fullscreenchange":
        case "focus":
        case "hashchange":
        case "popstate":
        case "select":
        case "selectstart":
          return Du;
        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 "toggle":
        case "touchmove":
        case "wheel":
        // Not used by React but could be by user code:
        // eslint-disable-next-line no-fallthrough
        case "mouseenter":
        case "mouseleave":
        case "pointerenter":
        case "pointerleave":
          return rh;
        case "message": {
          var p = o8();
          switch (p) {
            case up:
              return Du;
            case lS:
              return rh;
            case Jb:
            case cS:
              return Dl;
            case V0:
              return mD;
            default:
              return Dl;
          }
        }
        default:
          return Dl;
      }
    }
    function Iu(f, p, C) {
      return f.addEventListener(p, C, !1), C;
    }
    function EO(f, p, C) {
      return f.addEventListener(p, C, !0), C;
    }
    function eC(f, p, C, x) {
      return f.addEventListener(p, C, {
        capture: !0,
        passive: x
      }), C;
    }
    function fp(f, p, C, x) {
      return f.addEventListener(p, C, {
        passive: x
      }), C;
    }
    var qm = null, kS = null, oh = null;
    function CD(f) {
      return qm = f, kS = tC(), !0;
    }
    function Km() {
      qm = null, kS = null, oh = null;
    }
    function DS() {
      if (oh)
        return oh;
      var f, p = kS, C = p.length, x, I = tC(), O = I.length;
      for (f = 0; f < C && p[f] === I[f]; f++)
        ;
      var W = C - f;
      for (x = 1; x <= W && p[C - x] === I[O - x]; x++)
        ;
      var q = x > 1 ? 1 - x : void 0;
      return oh = I.slice(f, q), oh;
    }
    function tC() {
      return "value" in qm ? qm.value : qm.textContent;
    }
    function nC(f) {
      var p, C = f.keyCode;
      return "charCode" in f ? (p = f.charCode, p === 0 && C === 13 && (p = 13)) : p = C, p === 10 && (p = 13), p >= 32 || p === 13 ? p : 0;
    }
    function hv() {
      return !0;
    }
    function IS() {
      return !1;
    }
    function ao(f) {
      function p(C, x, I, O, W) {
        this._reactName = C, this._targetInst = I, this.type = x, this.nativeEvent = O, this.target = W, this.currentTarget = null;
        for (var q in f)
          if (f.hasOwnProperty(q)) {
            var ee = f[q];
            ee ? this[q] = ee(O) : this[q] = O[q];
          }
        var ue = O.defaultPrevented != null ? O.defaultPrevented : O.returnValue === !1;
        return ue ? this.isDefaultPrevented = hv : this.isDefaultPrevented = IS, this.isPropagationStopped = IS, this;
      }
      return bn(p.prototype, {
        preventDefault: function() {
          this.defaultPrevented = !0;
          var C = this.nativeEvent;
          C && (C.preventDefault ? C.preventDefault() : typeof C.returnValue != "unknown" && (C.returnValue = !1), this.isDefaultPrevented = hv);
        },
        stopPropagation: function() {
          var C = this.nativeEvent;
          C && (C.stopPropagation ? C.stopPropagation() : typeof C.cancelBubble != "unknown" && (C.cancelBubble = !0), this.isPropagationStopped = hv);
        },
        /**
         * We release all dispatched `SyntheticEvent`s after each event loop, adding
         * them back into the pool. This allows a way to hold onto a reference that
         * won't be added back into the pool.
         */
        persist: function() {
        },
        /**
         * Checks if this event should be released back into the pool.
         *
         * @return {boolean} True if this should not be released, false otherwise.
         */
        isPersistent: hv
      }), p;
    }
    var pd = {
      eventPhase: 0,
      bubbles: 0,
      cancelable: 0,
      timeStamp: function(f) {
        return f.timeStamp || Date.now();
      },
      defaultPrevented: 0,
      isTrusted: 0
    }, md = ao(pd), rl = bn({}, pd, {
      view: 0,
      detail: 0
    }), D8 = ao(rl), NS, RS, AS;
    function Ym(f) {
      f !== AS && (AS && f.type === "mousemove" ? (NS = f.screenX - AS.screenX, RS = f.screenY - AS.screenY) : (NS = 0, RS = 0), AS = f);
    }
    var OS = bn({}, rl, {
      screenX: 0,
      screenY: 0,
      clientX: 0,
      clientY: 0,
      pageX: 0,
      pageY: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      getModifierState: kO,
      button: 0,
      buttons: 0,
      relatedTarget: function(f) {
        return f.relatedTarget === void 0 ? f.fromElement === f.srcElement ? f.toElement : f.fromElement : f.relatedTarget;
      },
      movementX: function(f) {
        return "movementX" in f ? f.movementX : (Ym(f), NS);
      },
      movementY: function(f) {
        return "movementY" in f ? f.movementY : RS;
      }
    }), wD = ao(OS), fv = bn({}, OS, {
      dataTransfer: 0
    }), xO = ao(fv), gv = bn({}, rl, {
      relatedTarget: 0
    }), SD = ao(gv), I8 = bn({}, pd, {
      animationName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), LO = ao(I8), ED = bn({}, pd, {
      clipboardData: function(f) {
        return "clipboardData" in f ? f.clipboardData : window.clipboardData;
      }
    }), CX = ao(ED), wX = bn({}, pd, {
      data: 0
    }), TO = ao(wX), N8 = TO, pv = {
      Esc: "Escape",
      Spacebar: " ",
      Left: "ArrowLeft",
      Up: "ArrowUp",
      Right: "ArrowRight",
      Down: "ArrowDown",
      Del: "Delete",
      Win: "OS",
      Menu: "ContextMenu",
      Apps: "ContextMenu",
      Scroll: "ScrollLock",
      MozPrintableKey: "Unidentified"
    }, SX = {
      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"
    };
    function iC(f) {
      if (f.key) {
        var p = pv[f.key] || f.key;
        if (p !== "Unidentified")
          return p;
      }
      if (f.type === "keypress") {
        var C = nC(f);
        return C === 13 ? "Enter" : String.fromCharCode(C);
      }
      return f.type === "keydown" || f.type === "keyup" ? SX[f.keyCode] || "Unidentified" : "";
    }
    var R8 = {
      Alt: "altKey",
      Control: "ctrlKey",
      Meta: "metaKey",
      Shift: "shiftKey"
    };
    function Yo(f) {
      var p = this, C = p.nativeEvent;
      if (C.getModifierState)
        return C.getModifierState(f);
      var x = R8[f];
      return x ? !!C[x] : !1;
    }
    function kO(f) {
      return Yo;
    }
    var A8 = bn({}, rl, {
      key: iC,
      code: 0,
      location: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      repeat: 0,
      locale: 0,
      getModifierState: kO,
      // Legacy Interface
      charCode: function(f) {
        return f.type === "keypress" ? nC(f) : 0;
      },
      keyCode: function(f) {
        return f.type === "keydown" || f.type === "keyup" ? f.keyCode : 0;
      },
      which: function(f) {
        return f.type === "keypress" ? nC(f) : f.type === "keydown" || f.type === "keyup" ? f.keyCode : 0;
      }
    }), EX = ao(A8), xX = bn({}, OS, {
      pointerId: 0,
      width: 0,
      height: 0,
      pressure: 0,
      tangentialPressure: 0,
      tiltX: 0,
      tiltY: 0,
      twist: 0,
      pointerType: 0,
      isPrimary: 0
    }), DO = ao(xX), O8 = bn({}, rl, {
      touches: 0,
      targetTouches: 0,
      changedTouches: 0,
      altKey: 0,
      metaKey: 0,
      ctrlKey: 0,
      shiftKey: 0,
      getModifierState: kO
    }), LX = ao(O8), ah = bn({}, pd, {
      propertyName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), IO = ao(ah), TX = bn({}, OS, {
      deltaX: function(f) {
        return "deltaX" in f ? f.deltaX : (
          // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
          "wheelDeltaX" in f ? -f.wheelDeltaX : 0
        );
      },
      deltaY: function(f) {
        return "deltaY" in f ? f.deltaY : (
          // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
          "wheelDeltaY" in f ? -f.wheelDeltaY : (
            // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
            "wheelDelta" in f ? -f.wheelDelta : 0
          )
        );
      },
      deltaZ: 0,
      // Browsers without "deltaMode" is reporting in raw wheel delta where one
      // notch on the scroll is always +/- 120, roughly equivalent to pixels.
      // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
      // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
      deltaMode: 0
    }), Xm = ao(TX), xD = [9, 13, 27, 32], Zm = 229, rC = Vt && "CompositionEvent" in window, mv = null;
    Vt && "documentMode" in document && (mv = document.documentMode);
    var NO = Vt && "TextEvent" in window && !mv, M8 = Vt && (!rC || mv && mv > 8 && mv <= 11), LD = 32, P8 = String.fromCharCode(LD);
    function F8() {
      en("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), en("onCompositionEnd", ["compositionend", "focusout", "keydown", "keypress", "keyup", "mousedown"]), en("onCompositionStart", ["compositionstart", "focusout", "keydown", "keypress", "keyup", "mousedown"]), en("onCompositionUpdate", ["compositionupdate", "focusout", "keydown", "keypress", "keyup", "mousedown"]);
    }
    var RO = !1;
    function TD(f) {
      return (f.ctrlKey || f.altKey || f.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
      !(f.ctrlKey && f.altKey);
    }
    function kD(f) {
      switch (f) {
        case "compositionstart":
          return "onCompositionStart";
        case "compositionend":
          return "onCompositionEnd";
        case "compositionupdate":
          return "onCompositionUpdate";
      }
    }
    function B8(f, p) {
      return f === "keydown" && p.keyCode === Zm;
    }
    function DD(f, p) {
      switch (f) {
        case "keyup":
          return xD.indexOf(p.keyCode) !== -1;
        case "keydown":
          return p.keyCode !== Zm;
        case "keypress":
        case "mousedown":
        case "focusout":
          return !0;
        default:
          return !1;
      }
    }
    function H8(f) {
      var p = f.detail;
      return typeof p == "object" && "data" in p ? p.data : null;
    }
    function AO(f) {
      return f.locale === "ko";
    }
    var Qm = !1;
    function ID(f, p, C, x, I) {
      var O, W;
      if (rC ? O = kD(p) : Qm ? DD(p, x) && (O = "onCompositionEnd") : B8(p, x) && (O = "onCompositionStart"), !O)
        return null;
      M8 && !AO(x) && (!Qm && O === "onCompositionStart" ? Qm = CD(I) : O === "onCompositionEnd" && Qm && (W = DS()));
      var q = j8(C, O);
      if (q.length > 0) {
        var ee = new TO(O, p, null, x, I);
        if (f.push({
          event: ee,
          listeners: q
        }), W)
          ee.data = W;
        else {
          var ue = H8(x);
          ue !== null && (ee.data = ue);
        }
      }
    }
    function OO(f, p) {
      switch (f) {
        case "compositionend":
          return H8(p);
        case "keypress":
          var C = p.which;
          return C !== LD ? null : (RO = !0, P8);
        case "textInput":
          var x = p.data;
          return x === P8 && RO ? null : x;
        default:
          return null;
      }
    }
    function ND(f, p) {
      if (Qm) {
        if (f === "compositionend" || !rC && DD(f, p)) {
          var C = DS();
          return Km(), Qm = !1, C;
        }
        return null;
      }
      switch (f) {
        case "paste":
          return null;
        case "keypress":
          if (!TD(p)) {
            if (p.char && p.char.length > 1)
              return p.char;
            if (p.which)
              return String.fromCharCode(p.which);
          }
          return null;
        case "compositionend":
          return M8 && !AO(p) ? null : p.data;
        default:
          return null;
      }
    }
    function W8(f, p, C, x, I) {
      var O;
      if (NO ? O = OO(p, x) : O = ND(p, x), !O)
        return null;
      var W = j8(C, "onBeforeInput");
      if (W.length > 0) {
        var q = new N8("onBeforeInput", "beforeinput", null, x, I);
        f.push({
          event: q,
          listeners: W
        }), q.data = O;
      }
    }
    function kX(f, p, C, x, I, O, W) {
      ID(f, p, C, x, I), W8(f, p, C, x, I);
    }
    var RD = {
      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 V8(f) {
      var p = f && f.nodeName && f.nodeName.toLowerCase();
      return p === "input" ? !!RD[f.type] : p === "textarea";
    }
    /**
     * Checks if an event is supported in the current execution environment.
     *
     * NOTE: This will not work correctly for non-generic events such as `change`,
     * `reset`, `load`, `error`, and `select`.
     *
     * Borrows from Modernizr.
     *
     * @param {string} eventNameSuffix Event name, e.g. "click".
     * @return {boolean} True if the event is supported.
     * @internal
     * @license Modernizr 3.0.0pre (Custom Build) | MIT
     */
    function MS(f) {
      if (!Vt)
        return !1;
      var p = "on" + f, C = p in document;
      if (!C) {
        var x = document.createElement("div");
        x.setAttribute(p, "return;"), C = typeof x[p] == "function";
      }
      return C;
    }
    function DX() {
      en("onChange", ["change", "click", "focusin", "focusout", "input", "keydown", "keyup", "selectionchange"]);
    }
    function PS(f, p, C, x) {
      j2(x);
      var I = j8(p, "onChange");
      if (I.length > 0) {
        var O = new md("onChange", "change", null, C, x);
        f.push({
          event: O,
          listeners: I
        });
      }
    }
    var b = null, y = null;
    function k(f) {
      var p = f.nodeName && f.nodeName.toLowerCase();
      return p === "select" || p === "input" && f.type === "file";
    }
    function A(f) {
      var p = [];
      PS(p, y, f, Nk(f)), e8(F, p);
    }
    function F(f) {
      _1e(f, 0);
    }
    function U(f) {
      var p = BD(f);
      if (Im(p))
        return f;
    }
    function le(f, p) {
      if (f === "change")
        return p;
    }
    var we = !1;
    Vt && (we = MS("input") && (!document.documentMode || document.documentMode > 9));
    function Te(f, p) {
      b = f, y = p, b.attachEvent("onpropertychange", It);
    }
    function it() {
      b && (b.detachEvent("onpropertychange", It), b = null, y = null);
    }
    function It(f) {
      f.propertyName === "value" && U(y) && A(f);
    }
    function Mt(f, p, C) {
      f === "focusin" ? (it(), Te(p, C)) : f === "focusout" && it();
    }
    function kt(f, p) {
      if (f === "selectionchange" || f === "keyup" || f === "keydown")
        return U(y);
    }
    function yn(f) {
      var p = f.nodeName;
      return p && p.toLowerCase() === "input" && (f.type === "checkbox" || f.type === "radio");
    }
    function Rn(f, p) {
      if (f === "click")
        return U(p);
    }
    function Pn(f, p) {
      if (f === "input" || f === "change")
        return U(p);
    }
    function aa(f) {
      var p = f._wrapperState;
      !p || !p.controlled || f.type !== "number" || In(f, "number", f.value);
    }
    function $e(f, p, C, x, I, O, W) {
      var q = C ? BD(C) : window, ee, ue;
      if (k(q) ? ee = le : V8(q) ? we ? ee = Pn : (ee = kt, ue = Mt) : yn(q) && (ee = Rn), ee) {
        var me = ee(p, C);
        if (me) {
          PS(f, me, x, I);
          return;
        }
      }
      ue && ue(p, q, C), p === "focusout" && aa(q);
    }
    function Oe() {
      sn("onMouseEnter", ["mouseout", "mouseover"]), sn("onMouseLeave", ["mouseout", "mouseover"]), sn("onPointerEnter", ["pointerout", "pointerover"]), sn("onPointerLeave", ["pointerout", "pointerover"]);
    }
    function Qe(f, p, C, x, I, O, W) {
      var q = p === "mouseover" || p === "pointerover", ee = p === "mouseout" || p === "pointerout";
      if (q && !gX(x)) {
        var ue = x.relatedTarget || x.fromElement;
        if (ue && (HS(ue) || KO(ue)))
          return;
      }
      if (!(!ee && !q)) {
        var me;
        if (I.window === I)
          me = I;
        else {
          var Me = I.ownerDocument;
          Me ? me = Me.defaultView || Me.parentWindow : me = window;
        }
        var Ae, nt;
        if (ee) {
          var rt = x.relatedTarget || x.toElement;
          if (Ae = C, nt = rt ? HS(rt) : null, nt !== null) {
            var ft = Fc(nt);
            (nt !== ft || nt.tag !== m && nt.tag !== _) && (nt = null);
          }
        } else
          Ae = null, nt = C;
        if (Ae !== nt) {
          var un = wD, ai = "onMouseLeave", Xn = "onMouseEnter", Or = "mouse";
          (p === "pointerout" || p === "pointerover") && (un = DO, ai = "onPointerLeave", Xn = "onPointerEnter", Or = "pointer");
          var Sr = Ae == null ? me : BD(Ae), qe = nt == null ? me : BD(nt), gt = new un(ai, Or + "leave", Ae, x, I);
          gt.target = Sr, gt.relatedTarget = qe;
          var Ke = null, Pt = HS(I);
          if (Pt === C) {
            var wn = new un(Xn, Or + "enter", nt, x, I);
            wn.target = qe, wn.relatedTarget = Sr, Ke = wn;
          }
          uqe(f, gt, Ke, Ae, nt);
        }
      }
    }
    function Ut(f, p) {
      return f === p && (f !== 0 || 1 / f === 1 / p) || f !== f && p !== p;
    }
    var mn = typeof Object.is == "function" ? Object.is : Ut;
    function ti(f, p) {
      if (mn(f, p))
        return !0;
      if (typeof f != "object" || f === null || typeof p != "object" || p === null)
        return !1;
      var C = Object.keys(f), x = Object.keys(p);
      if (C.length !== x.length)
        return !1;
      for (var I = 0; I < C.length; I++) {
        var O = C[I];
        if (!Bi.call(p, O) || !mn(f[O], p[O]))
          return !1;
      }
      return !0;
    }
    function ui(f) {
      for (; f && f.firstChild; )
        f = f.firstChild;
      return f;
    }
    function Oi(f) {
      for (; f; ) {
        if (f.nextSibling)
          return f.nextSibling;
        f = f.parentNode;
      }
    }
    function Va(f, p) {
      for (var C = ui(f), x = 0, I = 0; C; ) {
        if (C.nodeType === op) {
          if (I = x + C.textContent.length, x <= p && I >= p)
            return {
              node: C,
              offset: p - x
            };
          x = I;
        }
        C = ui(Oi(C));
      }
    }
    function is(f) {
      var p = f.ownerDocument, C = p && p.defaultView || window, x = C.getSelection && C.getSelection();
      if (!x || x.rangeCount === 0)
        return null;
      var I = x.anchorNode, O = x.anchorOffset, W = x.focusNode, q = x.focusOffset;
      try {
        I.nodeType, W.nodeType;
      } catch {
        return null;
      }
      return Jm(f, I, O, W, q);
    }
    function Jm(f, p, C, x, I) {
      var O = 0, W = -1, q = -1, ee = 0, ue = 0, me = f, Me = null;
      e: for (; ; ) {
        for (var Ae = null; me === p && (C === 0 || me.nodeType === op) && (W = O + C), me === x && (I === 0 || me.nodeType === op) && (q = O + I), me.nodeType === op && (O += me.nodeValue.length), (Ae = me.firstChild) !== null; )
          Me = me, me = Ae;
        for (; ; ) {
          if (me === f)
            break e;
          if (Me === p && ++ee === C && (W = O), Me === x && ++ue === I && (q = O), (Ae = me.nextSibling) !== null)
            break;
          me = Me, Me = me.parentNode;
        }
        me = Ae;
      }
      return W === -1 || q === -1 ? null : {
        start: W,
        end: q
      };
    }
    function IX(f, p) {
      var C = f.ownerDocument || document, x = C && C.defaultView || window;
      if (x.getSelection) {
        var I = x.getSelection(), O = f.textContent.length, W = Math.min(p.start, O), q = p.end === void 0 ? W : Math.min(p.end, O);
        if (!I.extend && W > q) {
          var ee = q;
          q = W, W = ee;
        }
        var ue = Va(f, W), me = Va(f, q);
        if (ue && me) {
          if (I.rangeCount === 1 && I.anchorNode === ue.node && I.anchorOffset === ue.offset && I.focusNode === me.node && I.focusOffset === me.offset)
            return;
          var Me = C.createRange();
          Me.setStart(ue.node, ue.offset), I.removeAllRanges(), W > q ? (I.addRange(Me), I.extend(me.node, me.offset)) : (Me.setEnd(me.node, me.offset), I.addRange(Me));
        }
      }
    }
    function s1e(f) {
      return f && f.nodeType === op;
    }
    function o1e(f, p) {
      return !f || !p ? !1 : f === p ? !0 : s1e(f) ? !1 : s1e(p) ? o1e(f, p.parentNode) : "contains" in f ? f.contains(p) : f.compareDocumentPosition ? !!(f.compareDocumentPosition(p) & 16) : !1;
    }
    function GGe(f) {
      return f && f.ownerDocument && o1e(f.ownerDocument.documentElement, f);
    }
    function qGe(f) {
      try {
        return typeof f.contentWindow.location.href == "string";
      } catch {
        return !1;
      }
    }
    function a1e() {
      for (var f = window, p = ip(); p instanceof f.HTMLIFrameElement; ) {
        if (qGe(p))
          f = p.contentWindow;
        else
          return p;
        p = ip(f.document);
      }
      return p;
    }
    function NX(f) {
      var p = f && f.nodeName && f.nodeName.toLowerCase();
      return p && (p === "input" && (f.type === "text" || f.type === "search" || f.type === "tel" || f.type === "url" || f.type === "password") || p === "textarea" || f.contentEditable === "true");
    }
    function KGe() {
      var f = a1e();
      return {
        focusedElem: f,
        selectionRange: NX(f) ? XGe(f) : null
      };
    }
    function YGe(f) {
      var p = a1e(), C = f.focusedElem, x = f.selectionRange;
      if (p !== C && GGe(C)) {
        x !== null && NX(C) && ZGe(C, x);
        for (var I = [], O = C; O = O.parentNode; )
          O.nodeType === Cu && I.push({
            element: O,
            left: O.scrollLeft,
            top: O.scrollTop
          });
        typeof C.focus == "function" && C.focus();
        for (var W = 0; W < I.length; W++) {
          var q = I[W];
          q.element.scrollLeft = q.left, q.element.scrollTop = q.top;
        }
      }
    }
    function XGe(f) {
      var p;
      return "selectionStart" in f ? p = {
        start: f.selectionStart,
        end: f.selectionEnd
      } : p = is(f), p || {
        start: 0,
        end: 0
      };
    }
    function ZGe(f, p) {
      var C = p.start, x = p.end;
      x === void 0 && (x = C), "selectionStart" in f ? (f.selectionStart = C, f.selectionEnd = Math.min(x, f.value.length)) : IX(f, p);
    }
    var QGe = Vt && "documentMode" in document && document.documentMode <= 11;
    function JGe() {
      en("onSelect", ["focusout", "contextmenu", "dragend", "focusin", "keydown", "keyup", "mousedown", "mouseup", "selectionchange"]);
    }
    var AD = null, RX = null, MO = null, AX = !1;
    function eqe(f) {
      if ("selectionStart" in f && NX(f))
        return {
          start: f.selectionStart,
          end: f.selectionEnd
        };
      var p = f.ownerDocument && f.ownerDocument.defaultView || window, C = p.getSelection();
      return {
        anchorNode: C.anchorNode,
        anchorOffset: C.anchorOffset,
        focusNode: C.focusNode,
        focusOffset: C.focusOffset
      };
    }
    function tqe(f) {
      return f.window === f ? f.document : f.nodeType === ap ? f : f.ownerDocument;
    }
    function l1e(f, p, C) {
      var x = tqe(C);
      if (!(AX || AD == null || AD !== ip(x))) {
        var I = eqe(AD);
        if (!MO || !ti(MO, I)) {
          MO = I;
          var O = j8(RX, "onSelect");
          if (O.length > 0) {
            var W = new md("onSelect", "select", null, p, C);
            f.push({
              event: W,
              listeners: O
            }), W.target = AD;
          }
        }
      }
    }
    function nqe(f, p, C, x, I, O, W) {
      var q = C ? BD(C) : window;
      switch (p) {
        // Track the input node that has focus.
        case "focusin":
          (V8(q) || q.contentEditable === "true") && (AD = q, RX = C, MO = null);
          break;
        case "focusout":
          AD = null, RX = null, MO = null;
          break;
        // Don't fire the event while the user is dragging. This matches the
        // semantics of the native select event.
        case "mousedown":
          AX = !0;
          break;
        case "contextmenu":
        case "mouseup":
        case "dragend":
          AX = !1, l1e(f, x, I);
          break;
        // Chrome and IE fire non-standard event when selection is changed (and
        // sometimes when it hasn't). IE's event fires out of order with respect
        // to key and input events on deletion, so we discard it.
        //
        // Firefox doesn't support selectionchange, so check selection status
        // after each key entry. The selection changes after keydown and before
        // keyup, but we check on keydown as well in the case of holding down a
        // key, when multiple keydown events are fired but only one keyup is.
        // This is also our approach for IE handling, for the reason above.
        case "selectionchange":
          if (QGe)
            break;
        // falls through
        case "keydown":
        case "keyup":
          l1e(f, x, I);
      }
    }
    function U8(f, p) {
      var C = {};
      return C[f.toLowerCase()] = p.toLowerCase(), C["Webkit" + f] = "webkit" + p, C["Moz" + f] = "moz" + p, C;
    }
    var OD = {
      animationend: U8("Animation", "AnimationEnd"),
      animationiteration: U8("Animation", "AnimationIteration"),
      animationstart: U8("Animation", "AnimationStart"),
      transitionend: U8("Transition", "TransitionEnd")
    }, OX = {}, c1e = {};
    Vt && (c1e = document.createElement("div").style, "AnimationEvent" in window || (delete OD.animationend.animation, delete OD.animationiteration.animation, delete OD.animationstart.animation), "TransitionEvent" in window || delete OD.transitionend.transition);
    function z8(f) {
      if (OX[f])
        return OX[f];
      if (!OD[f])
        return f;
      var p = OD[f];
      for (var C in p)
        if (p.hasOwnProperty(C) && C in c1e)
          return OX[f] = p[C];
      return f;
    }
    var u1e = z8("animationend"), d1e = z8("animationiteration"), h1e = z8("animationstart"), f1e = z8("transitionend"), g1e = /* @__PURE__ */ new Map(), p1e = ["abort", "auxClick", "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"];
    function sC(f, p) {
      g1e.set(f, p), en(p, [f]);
    }
    function iqe() {
      for (var f = 0; f < p1e.length; f++) {
        var p = p1e[f], C = p.toLowerCase(), x = p[0].toUpperCase() + p.slice(1);
        sC(C, "on" + x);
      }
      sC(u1e, "onAnimationEnd"), sC(d1e, "onAnimationIteration"), sC(h1e, "onAnimationStart"), sC("dblclick", "onDoubleClick"), sC("focusin", "onFocus"), sC("focusout", "onBlur"), sC(f1e, "onTransitionEnd");
    }
    function rqe(f, p, C, x, I, O, W) {
      var q = g1e.get(p);
      if (q !== void 0) {
        var ee = md, ue = p;
        switch (p) {
          case "keypress":
            if (nC(x) === 0)
              return;
          /* falls through */
          case "keydown":
          case "keyup":
            ee = EX;
            break;
          case "focusin":
            ue = "focus", ee = SD;
            break;
          case "focusout":
            ue = "blur", ee = SD;
            break;
          case "beforeblur":
          case "afterblur":
            ee = SD;
            break;
          case "click":
            if (x.button === 2)
              return;
          /* falls through */
          case "auxclick":
          case "dblclick":
          case "mousedown":
          case "mousemove":
          case "mouseup":
          // TODO: Disabled elements should not respond to mouse events
          /* falls through */
          case "mouseout":
          case "mouseover":
          case "contextmenu":
            ee = wD;
            break;
          case "drag":
          case "dragend":
          case "dragenter":
          case "dragexit":
          case "dragleave":
          case "dragover":
          case "dragstart":
          case "drop":
            ee = xO;
            break;
          case "touchcancel":
          case "touchend":
          case "touchmove":
          case "touchstart":
            ee = LX;
            break;
          case u1e:
          case d1e:
          case h1e:
            ee = LO;
            break;
          case f1e:
            ee = IO;
            break;
          case "scroll":
            ee = D8;
            break;
          case "wheel":
            ee = Xm;
            break;
          case "copy":
          case "cut":
          case "paste":
            ee = CX;
            break;
          case "gotpointercapture":
          case "lostpointercapture":
          case "pointercancel":
          case "pointerdown":
          case "pointermove":
          case "pointerout":
          case "pointerover":
          case "pointerup":
            ee = DO;
            break;
        }
        var me = (O & Gb) !== 0;
        {
          var Me = !me && // TODO: ideally, we'd eventually add all events from
          // nonDelegatedEvents list in DOMPluginEventSystem.
          // Then we can remove this special list.
          // This is a breaking change that can wait until React 18.
          p === "scroll", Ae = lqe(C, q, x.type, me, Me);
          if (Ae.length > 0) {
            var nt = new ee(q, ue, null, x, I);
            f.push({
              event: nt,
              listeners: Ae
            });
          }
        }
      }
    }
    iqe(), Oe(), DX(), JGe(), F8();
    function sqe(f, p, C, x, I, O, W) {
      rqe(f, p, C, x, I, O);
      var q = (O & $2) === 0;
      q && (Qe(f, p, C, x, I), $e(f, p, C, x, I), nqe(f, p, C, x, I), kX(f, p, C, x, I));
    }
    var PO = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "resize", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"], MX = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(PO));
    function m1e(f, p, C) {
      var x = f.type || "unknown-event";
      f.currentTarget = C, rS(x, p, void 0, f), f.currentTarget = null;
    }
    function oqe(f, p, C) {
      var x;
      if (C)
        for (var I = p.length - 1; I >= 0; I--) {
          var O = p[I], W = O.instance, q = O.currentTarget, ee = O.listener;
          if (W !== x && f.isPropagationStopped())
            return;
          m1e(f, ee, q), x = W;
        }
      else
        for (var ue = 0; ue < p.length; ue++) {
          var me = p[ue], Me = me.instance, Ae = me.currentTarget, nt = me.listener;
          if (Me !== x && f.isPropagationStopped())
            return;
          m1e(f, nt, Ae), x = Me;
        }
    }
    function _1e(f, p) {
      for (var C = (p & Gb) !== 0, x = 0; x < f.length; x++) {
        var I = f[x], O = I.event, W = I.listeners;
        oqe(O, W, C);
      }
      lp();
    }
    function aqe(f, p, C, x, I) {
      var O = Nk(C), W = [];
      sqe(W, f, x, C, O, p), _1e(W, p);
    }
    function Uo(f, p) {
      MX.has(f) || a('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.', f);
      var C = !1, x = FKe(p), I = dqe(f);
      x.has(I) || (b1e(p, f, cg, C), x.add(I));
    }
    function PX(f, p, C) {
      MX.has(f) && !p && a('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.', f);
      var x = 0;
      p && (x |= Gb), b1e(C, f, x, p);
    }
    var $8 = "_reactListening" + Math.random().toString(36).slice(2);
    function FO(f) {
      if (!f[$8]) {
        f[$8] = !0, ot.forEach(function(C) {
          C !== "selectionchange" && (MX.has(C) || PX(C, !1, f), PX(C, !0, f));
        });
        var p = f.nodeType === ap ? f : f.ownerDocument;
        p !== null && (p[$8] || (p[$8] = !0, PX("selectionchange", !1, p)));
      }
    }
    function b1e(f, p, C, x, I) {
      var O = gd(f, p, C), W = void 0;
      iS && (p === "touchstart" || p === "touchmove" || p === "wheel") && (W = !0), f = f, x ? W !== void 0 ? eC(f, p, O, W) : EO(f, p, O) : W !== void 0 ? fp(f, p, O, W) : Iu(f, p, O);
    }
    function v1e(f, p) {
      return f === p || f.nodeType === Ca && f.parentNode === p;
    }
    function FX(f, p, C, x, I) {
      var O = x;
      if ((p & z2) === 0 && (p & cg) === 0) {
        var W = I;
        if (x !== null) {
          var q = x;
          e: for (; ; ) {
            if (q === null)
              return;
            var ee = q.tag;
            if (ee === h || ee === g) {
              var ue = q.stateNode.containerInfo;
              if (v1e(ue, W))
                break;
              if (ee === g)
                for (var me = q.return; me !== null; ) {
                  var Me = me.tag;
                  if (Me === h || Me === g) {
                    var Ae = me.stateNode.containerInfo;
                    if (v1e(Ae, W))
                      return;
                  }
                  me = me.return;
                }
              for (; ue !== null; ) {
                var nt = HS(ue);
                if (nt === null)
                  return;
                var rt = nt.tag;
                if (rt === m || rt === _) {
                  q = O = nt;
                  continue e;
                }
                ue = ue.parentNode;
              }
            }
            q = q.return;
          }
        }
      }
      e8(function() {
        return aqe(f, p, C, O);
      });
    }
    function BO(f, p, C) {
      return {
        instance: f,
        listener: p,
        currentTarget: C
      };
    }
    function lqe(f, p, C, x, I, O) {
      for (var W = p !== null ? p + "Capture" : null, q = x ? W : p, ee = [], ue = f, me = null; ue !== null; ) {
        var Me = ue, Ae = Me.stateNode, nt = Me.tag;
        if (nt === m && Ae !== null && (me = Ae, q !== null)) {
          var rt = Kb(ue, q);
          rt != null && ee.push(BO(ue, rt, me));
        }
        if (I)
          break;
        ue = ue.return;
      }
      return ee;
    }
    function j8(f, p) {
      for (var C = p + "Capture", x = [], I = f; I !== null; ) {
        var O = I, W = O.stateNode, q = O.tag;
        if (q === m && W !== null) {
          var ee = W, ue = Kb(I, C);
          ue != null && x.unshift(BO(I, ue, ee));
          var me = Kb(I, p);
          me != null && x.push(BO(I, me, ee));
        }
        I = I.return;
      }
      return x;
    }
    function MD(f) {
      if (f === null)
        return null;
      do
        f = f.return;
      while (f && f.tag !== m);
      return f || null;
    }
    function cqe(f, p) {
      for (var C = f, x = p, I = 0, O = C; O; O = MD(O))
        I++;
      for (var W = 0, q = x; q; q = MD(q))
        W++;
      for (; I - W > 0; )
        C = MD(C), I--;
      for (; W - I > 0; )
        x = MD(x), W--;
      for (var ee = I; ee--; ) {
        if (C === x || x !== null && C === x.alternate)
          return C;
        C = MD(C), x = MD(x);
      }
      return null;
    }
    function y1e(f, p, C, x, I) {
      for (var O = p._reactName, W = [], q = C; q !== null && q !== x; ) {
        var ee = q, ue = ee.alternate, me = ee.stateNode, Me = ee.tag;
        if (ue !== null && ue === x)
          break;
        if (Me === m && me !== null) {
          var Ae = me;
          if (I) {
            var nt = Kb(q, O);
            nt != null && W.unshift(BO(q, nt, Ae));
          } else if (!I) {
            var rt = Kb(q, O);
            rt != null && W.push(BO(q, rt, Ae));
          }
        }
        q = q.return;
      }
      W.length !== 0 && f.push({
        event: p,
        listeners: W
      });
    }
    function uqe(f, p, C, x, I) {
      var O = x && I ? cqe(x, I) : null;
      x !== null && y1e(f, p, x, O, !1), I !== null && C !== null && y1e(f, C, I, O, !0);
    }
    function dqe(f, p) {
      return f + "__bubble";
    }
    var lh = !1, HO = "dangerouslySetInnerHTML", G8 = "suppressContentEditableWarning", oC = "suppressHydrationWarning", C1e = "autoFocus", FS = "children", BS = "style", q8 = "__html", BX, K8, WO, w1e, Y8, S1e, E1e;
    BX = {
      // There are working polyfills for <dialog>. Let people use it.
      dialog: !0,
      // Electron ships a custom <webview> tag to display external web content in
      // an isolated frame and process.
      // This tag is not present in non Electron environments such as JSDom which
      // is often used for testing purposes.
      // @see https://electronjs.org/docs/api/webview-tag
      webview: !0
    }, K8 = function(f, p) {
      K6(f, p), O0(f, p), J6(f, p, {
        registrationNameDependencies: et,
        possibleRegistrationNames: at
      });
    }, S1e = Vt && !document.documentMode, WO = function(f, p, C) {
      if (!lh) {
        var x = X8(C), I = X8(p);
        I !== x && (lh = !0, a("Prop `%s` did not match. Server: %s Client: %s", f, JSON.stringify(I), JSON.stringify(x)));
      }
    }, w1e = function(f) {
      if (!lh) {
        lh = !0;
        var p = [];
        f.forEach(function(C) {
          p.push(C);
        }), a("Extra attributes from the server: %s", p);
      }
    }, Y8 = function(f, p) {
      p === !1 ? a("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.", f, f, f) : a("Expected `%s` listener to be a function, instead got a value of `%s` type.", f, typeof p);
    }, E1e = function(f, p) {
      var C = f.namespaceURI === sf ? f.ownerDocument.createElement(f.tagName) : f.ownerDocument.createElementNS(f.namespaceURI, f.tagName);
      return C.innerHTML = p, C.innerHTML;
    };
    var hqe = /\r\n?/g, fqe = /\u0000|\uFFFD/g;
    function X8(f) {
      ts(f);
      var p = typeof f == "string" ? f : "" + f;
      return p.replace(hqe, `
`).replace(fqe, "");
    }
    function Z8(f, p, C, x) {
      var I = X8(p), O = X8(f);
      if (O !== I && (x && (lh || (lh = !0, a('Text content did not match. Server: "%s" Client: "%s"', O, I))), C && Z))
        throw new Error("Text content does not match server-rendered HTML.");
    }
    function x1e(f) {
      return f.nodeType === ap ? f : f.ownerDocument;
    }
    function gqe() {
    }
    function Q8(f) {
      f.onclick = gqe;
    }
    function pqe(f, p, C, x, I) {
      for (var O in x)
        if (x.hasOwnProperty(O)) {
          var W = x[O];
          if (O === BS)
            W && Object.freeze(W), z6(p, W);
          else if (O === HO) {
            var q = W ? W[q8] : void 0;
            q != null && N6(p, q);
          } else if (O === FS)
            if (typeof W == "string") {
              var ee = f !== "textarea" || W !== "";
              ee && Rm(p, W);
            } else typeof W == "number" && Rm(p, "" + W);
          else O === G8 || O === oC || O === C1e || (et.hasOwnProperty(O) ? W != null && (typeof W != "function" && Y8(O, W), O === "onScroll" && Uo("scroll", p)) : W != null && ro(p, O, W, I));
        }
    }
    function mqe(f, p, C, x) {
      for (var I = 0; I < p.length; I += 2) {
        var O = p[I], W = p[I + 1];
        O === BS ? z6(f, W) : O === HO ? N6(f, W) : O === FS ? Rm(f, W) : ro(f, O, W, x);
      }
    }
    function _qe(f, p, C, x) {
      var I, O = x1e(C), W, q = x;
      if (q === sf && (q = F2(f)), q === sf) {
        if (I = Am(f, p), !I && f !== f.toLowerCase() && a("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", f), f === "script") {
          var ee = O.createElement("div");
          ee.innerHTML = "<script><\/script>";
          var ue = ee.firstChild;
          W = ee.removeChild(ue);
        } else if (typeof p.is == "string")
          W = O.createElement(f, {
            is: p.is
          });
        else if (W = O.createElement(f), f === "select") {
          var me = W;
          p.multiple ? me.multiple = !0 : p.size && (me.size = p.size);
        }
      } else
        W = O.createElementNS(q, f);
      return q === sf && !I && Object.prototype.toString.call(W) === "[object HTMLUnknownElement]" && !Bi.call(BX, f) && (BX[f] = !0, a("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", f)), W;
    }
    function bqe(f, p) {
      return x1e(p).createTextNode(f);
    }
    function vqe(f, p, C, x) {
      var I = Am(p, C);
      K8(p, C);
      var O;
      switch (p) {
        case "dialog":
          Uo("cancel", f), Uo("close", f), O = C;
          break;
        case "iframe":
        case "object":
        case "embed":
          Uo("load", f), O = C;
          break;
        case "video":
        case "audio":
          for (var W = 0; W < PO.length; W++)
            Uo(PO[W], f);
          O = C;
          break;
        case "source":
          Uo("error", f), O = C;
          break;
        case "img":
        case "image":
        case "link":
          Uo("error", f), Uo("load", f), O = C;
          break;
        case "details":
          Uo("toggle", f), O = C;
          break;
        case "input":
          T0(f, C), O = eh(f, C), Uo("invalid", f);
          break;
        case "option":
          ys(f, C), O = C;
          break;
        case "select":
          jw(f, C), O = jb(f, C), Uo("invalid", f);
          break;
        case "textarea":
          k6(f, C), O = xk(f, C), Uo("invalid", f);
          break;
        default:
          O = C;
      }
      switch (Dk(p, O), pqe(p, f, x, O, I), p) {
        case "input":
          Jd(f), tt(f, C, !1);
          break;
        case "textarea":
          Jd(f), I6(f);
          break;
        case "option":
          Us(f, C);
          break;
        case "select":
          O2(f, C);
          break;
        default:
          typeof O.onClick == "function" && Q8(f);
          break;
      }
    }
    function yqe(f, p, C, x, I) {
      K8(p, x);
      var O = null, W, q;
      switch (p) {
        case "input":
          W = eh(f, C), q = eh(f, x), O = [];
          break;
        case "select":
          W = jb(f, C), q = jb(f, x), O = [];
          break;
        case "textarea":
          W = xk(f, C), q = xk(f, x), O = [];
          break;
        default:
          W = C, q = x, typeof W.onClick != "function" && typeof q.onClick == "function" && Q8(f);
          break;
      }
      Dk(p, q);
      var ee, ue, me = null;
      for (ee in W)
        if (!(q.hasOwnProperty(ee) || !W.hasOwnProperty(ee) || W[ee] == null))
          if (ee === BS) {
            var Me = W[ee];
            for (ue in Me)
              Me.hasOwnProperty(ue) && (me || (me = {}), me[ue] = "");
          } else ee === HO || ee === FS || ee === G8 || ee === oC || ee === C1e || (et.hasOwnProperty(ee) ? O || (O = []) : (O = O || []).push(ee, null));
      for (ee in q) {
        var Ae = q[ee], nt = W != null ? W[ee] : void 0;
        if (!(!q.hasOwnProperty(ee) || Ae === nt || Ae == null && nt == null))
          if (ee === BS)
            if (Ae && Object.freeze(Ae), nt) {
              for (ue in nt)
                nt.hasOwnProperty(ue) && (!Ae || !Ae.hasOwnProperty(ue)) && (me || (me = {}), me[ue] = "");
              for (ue in Ae)
                Ae.hasOwnProperty(ue) && nt[ue] !== Ae[ue] && (me || (me = {}), me[ue] = Ae[ue]);
            } else
              me || (O || (O = []), O.push(ee, me)), me = Ae;
          else if (ee === HO) {
            var rt = Ae ? Ae[q8] : void 0, ft = nt ? nt[q8] : void 0;
            rt != null && ft !== rt && (O = O || []).push(ee, rt);
          } else ee === FS ? (typeof Ae == "string" || typeof Ae == "number") && (O = O || []).push(ee, "" + Ae) : ee === G8 || ee === oC || (et.hasOwnProperty(ee) ? (Ae != null && (typeof Ae != "function" && Y8(ee, Ae), ee === "onScroll" && Uo("scroll", f)), !O && nt !== Ae && (O = [])) : (O = O || []).push(ee, Ae));
      }
      return me && (of(me, q[BS]), (O = O || []).push(BS, me)), O;
    }
    function Cqe(f, p, C, x, I) {
      C === "input" && I.type === "radio" && I.name != null && ne(f, I);
      var O = Am(C, x), W = Am(C, I);
      switch (mqe(f, p, O, W), C) {
        case "input":
          Le(f, I);
          break;
        case "textarea":
          D6(f, I);
          break;
        case "select":
          Ek(f, I);
          break;
      }
    }
    function wqe(f) {
      {
        var p = f.toLowerCase();
        return N0.hasOwnProperty(p) && N0[p] || null;
      }
    }
    function Sqe(f, p, C, x, I, O, W) {
      var q, ee;
      switch (q = Am(p, C), K8(p, C), p) {
        case "dialog":
          Uo("cancel", f), Uo("close", f);
          break;
        case "iframe":
        case "object":
        case "embed":
          Uo("load", f);
          break;
        case "video":
        case "audio":
          for (var ue = 0; ue < PO.length; ue++)
            Uo(PO[ue], f);
          break;
        case "source":
          Uo("error", f);
          break;
        case "img":
        case "image":
        case "link":
          Uo("error", f), Uo("load", f);
          break;
        case "details":
          Uo("toggle", f);
          break;
        case "input":
          T0(f, C), Uo("invalid", f);
          break;
        case "option":
          ys(f, C);
          break;
        case "select":
          jw(f, C), Uo("invalid", f);
          break;
        case "textarea":
          k6(f, C), Uo("invalid", f);
          break;
      }
      Dk(p, C);
      {
        ee = /* @__PURE__ */ new Set();
        for (var me = f.attributes, Me = 0; Me < me.length; Me++) {
          var Ae = me[Me].name.toLowerCase();
          switch (Ae) {
            // Controlled attributes are not validated
            // TODO: Only ignore them on controlled tags.
            case "value":
              break;
            case "checked":
              break;
            case "selected":
              break;
            default:
              ee.add(me[Me].name);
          }
        }
      }
      var nt = null;
      for (var rt in C)
        if (C.hasOwnProperty(rt)) {
          var ft = C[rt];
          if (rt === FS)
            typeof ft == "string" ? f.textContent !== ft && (C[oC] !== !0 && Z8(f.textContent, ft, O, W), nt = [FS, ft]) : typeof ft == "number" && f.textContent !== "" + ft && (C[oC] !== !0 && Z8(f.textContent, ft, O, W), nt = [FS, "" + ft]);
          else if (et.hasOwnProperty(rt))
            ft != null && (typeof ft != "function" && Y8(rt, ft), rt === "onScroll" && Uo("scroll", f));
          else if (W && // Convince Flow we've calculated it (it's DEV-only in this method.)
          typeof q == "boolean") {
            var un = void 0, ai = gn(rt);
            if (C[oC] !== !0) {
              if (!(rt === G8 || rt === oC || // Controlled attributes are not validated
              // TODO: Only ignore them on controlled tags.
              rt === "value" || rt === "checked" || rt === "selected")) {
                if (rt === HO) {
                  var Xn = f.innerHTML, Or = ft ? ft[q8] : void 0;
                  if (Or != null) {
                    var Sr = E1e(f, Or);
                    Sr !== Xn && WO(rt, Xn, Sr);
                  }
                } else if (rt === BS) {
                  if (ee.delete(rt), S1e) {
                    var qe = dX(ft);
                    un = f.getAttribute("style"), qe !== un && WO(rt, un, qe);
                  }
                } else if (q && !be)
                  ee.delete(rt.toLowerCase()), un = ya(f, rt, ft), ft !== un && WO(rt, un, ft);
                else if (!lt(rt, ai, q) && !Mn(rt, ft, ai, q)) {
                  var gt = !1;
                  if (ai !== null)
                    ee.delete(ai.attributeName), un = xl(f, rt, ft, ai);
                  else {
                    var Ke = x;
                    if (Ke === sf && (Ke = F2(p)), Ke === sf)
                      ee.delete(rt.toLowerCase());
                    else {
                      var Pt = wqe(rt);
                      Pt !== null && Pt !== rt && (gt = !0, ee.delete(Pt)), ee.delete(rt);
                    }
                    un = ya(f, rt, ft);
                  }
                  var wn = be;
                  !wn && ft !== un && !gt && WO(rt, un, ft);
                }
              }
            }
          }
        }
      switch (W && // $FlowFixMe - Should be inferred as not undefined.
      ee.size > 0 && C[oC] !== !0 && w1e(ee), p) {
        case "input":
          Jd(f), tt(f, C, !0);
          break;
        case "textarea":
          Jd(f), I6(f);
          break;
        case "select":
        case "option":
          break;
        default:
          typeof C.onClick == "function" && Q8(f);
          break;
      }
      return nt;
    }
    function Eqe(f, p, C) {
      var x = f.nodeValue !== p;
      return x;
    }
    function HX(f, p) {
      {
        if (lh)
          return;
        lh = !0, a("Did not expect server HTML to contain a <%s> in <%s>.", p.nodeName.toLowerCase(), f.nodeName.toLowerCase());
      }
    }
    function WX(f, p) {
      {
        if (lh)
          return;
        lh = !0, a('Did not expect server HTML to contain the text node "%s" in <%s>.', p.nodeValue, f.nodeName.toLowerCase());
      }
    }
    function VX(f, p, C) {
      {
        if (lh)
          return;
        lh = !0, a("Expected server HTML to contain a matching <%s> in <%s>.", p, f.nodeName.toLowerCase());
      }
    }
    function UX(f, p) {
      {
        if (p === "" || lh)
          return;
        lh = !0, a('Expected server HTML to contain a matching text node for "%s" in <%s>.', p, f.nodeName.toLowerCase());
      }
    }
    function xqe(f, p, C) {
      switch (p) {
        case "input":
          dt(f, C);
          return;
        case "textarea":
          rX(f, C);
          return;
        case "select":
          M2(f, C);
          return;
      }
    }
    var VO = function() {
    }, UO = function() {
    };
    {
      var Lqe = ["address", "applet", "area", "article", "aside", "base", "basefont", "bgsound", "blockquote", "body", "br", "button", "caption", "center", "col", "colgroup", "dd", "details", "dir", "div", "dl", "dt", "embed", "fieldset", "figcaption", "figure", "footer", "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "isindex", "li", "link", "listing", "main", "marquee", "menu", "menuitem", "meta", "nav", "noembed", "noframes", "noscript", "object", "ol", "p", "param", "plaintext", "pre", "script", "section", "select", "source", "style", "summary", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "title", "tr", "track", "ul", "wbr", "xmp"], L1e = [
        "applet",
        "caption",
        "html",
        "table",
        "td",
        "th",
        "marquee",
        "object",
        "template",
        // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
        // TODO: Distinguish by namespace here -- for <title>, including it here
        // errs on the side of fewer warnings
        "foreignObject",
        "desc",
        "title"
      ], Tqe = L1e.concat(["button"]), kqe = ["dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"], T1e = {
        current: null,
        formTag: null,
        aTagInScope: null,
        buttonTagInScope: null,
        nobrTagInScope: null,
        pTagInButtonScope: null,
        listItemTagAutoclosing: null,
        dlItemTagAutoclosing: null
      };
      UO = function(f, p) {
        var C = bn({}, f || T1e), x = {
          tag: p
        };
        return L1e.indexOf(p) !== -1 && (C.aTagInScope = null, C.buttonTagInScope = null, C.nobrTagInScope = null), Tqe.indexOf(p) !== -1 && (C.pTagInButtonScope = null), Lqe.indexOf(p) !== -1 && p !== "address" && p !== "div" && p !== "p" && (C.listItemTagAutoclosing = null, C.dlItemTagAutoclosing = null), C.current = x, p === "form" && (C.formTag = x), p === "a" && (C.aTagInScope = x), p === "button" && (C.buttonTagInScope = x), p === "nobr" && (C.nobrTagInScope = x), p === "p" && (C.pTagInButtonScope = x), p === "li" && (C.listItemTagAutoclosing = x), (p === "dd" || p === "dt") && (C.dlItemTagAutoclosing = x), C;
      };
      var Dqe = function(f, p) {
        switch (p) {
          // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
          case "select":
            return f === "option" || f === "optgroup" || f === "#text";
          case "optgroup":
            return f === "option" || f === "#text";
          // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
          // but
          case "option":
            return f === "#text";
          // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
          // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
          // No special behavior since these rules fall back to "in body" mode for
          // all except special table nodes which cause bad parsing behavior anyway.
          // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
          case "tr":
            return f === "th" || f === "td" || f === "style" || f === "script" || f === "template";
          // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
          case "tbody":
          case "thead":
          case "tfoot":
            return f === "tr" || f === "style" || f === "script" || f === "template";
          // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
          case "colgroup":
            return f === "col" || f === "template";
          // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
          case "table":
            return f === "caption" || f === "colgroup" || f === "tbody" || f === "tfoot" || f === "thead" || f === "style" || f === "script" || f === "template";
          // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
          case "head":
            return f === "base" || f === "basefont" || f === "bgsound" || f === "link" || f === "meta" || f === "title" || f === "noscript" || f === "noframes" || f === "style" || f === "script" || f === "template";
          // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
          case "html":
            return f === "head" || f === "body" || f === "frameset";
          case "frameset":
            return f === "frame";
          case "#document":
            return f === "html";
        }
        switch (f) {
          case "h1":
          case "h2":
          case "h3":
          case "h4":
          case "h5":
          case "h6":
            return p !== "h1" && p !== "h2" && p !== "h3" && p !== "h4" && p !== "h5" && p !== "h6";
          case "rp":
          case "rt":
            return kqe.indexOf(p) === -1;
          case "body":
          case "caption":
          case "col":
          case "colgroup":
          case "frameset":
          case "frame":
          case "head":
          case "html":
          case "tbody":
          case "td":
          case "tfoot":
          case "th":
          case "thead":
          case "tr":
            return p == null;
        }
        return !0;
      }, Iqe = function(f, p) {
        switch (f) {
          case "address":
          case "article":
          case "aside":
          case "blockquote":
          case "center":
          case "details":
          case "dialog":
          case "dir":
          case "div":
          case "dl":
          case "fieldset":
          case "figcaption":
          case "figure":
          case "footer":
          case "header":
          case "hgroup":
          case "main":
          case "menu":
          case "nav":
          case "ol":
          case "p":
          case "section":
          case "summary":
          case "ul":
          case "pre":
          case "listing":
          case "table":
          case "hr":
          case "xmp":
          case "h1":
          case "h2":
          case "h3":
          case "h4":
          case "h5":
          case "h6":
            return p.pTagInButtonScope;
          case "form":
            return p.formTag || p.pTagInButtonScope;
          case "li":
            return p.listItemTagAutoclosing;
          case "dd":
          case "dt":
            return p.dlItemTagAutoclosing;
          case "button":
            return p.buttonTagInScope;
          case "a":
            return p.aTagInScope;
          case "nobr":
            return p.nobrTagInScope;
        }
        return null;
      }, k1e = {};
      VO = function(f, p, C) {
        C = C || T1e;
        var x = C.current, I = x && x.tag;
        p != null && (f != null && a("validateDOMNesting: when childText is passed, childTag should be null"), f = "#text");
        var O = Dqe(f, I) ? null : x, W = O ? null : Iqe(f, C), q = O || W;
        if (q) {
          var ee = q.tag, ue = !!O + "|" + f + "|" + ee;
          if (!k1e[ue]) {
            k1e[ue] = !0;
            var me = f, Me = "";
            if (f === "#text" ? /\S/.test(p) ? me = "Text nodes" : (me = "Whitespace text nodes", Me = " Make sure you don't have any extra whitespace between tags on each line of your source code.") : me = "<" + f + ">", O) {
              var Ae = "";
              ee === "table" && f === "tr" && (Ae += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."), a("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s", me, ee, Me, Ae);
            } else
              a("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.", me, ee);
          }
        }
      };
    }
    var J8 = "suppressHydrationWarning", e9 = "$", t9 = "/$", zO = "$?", $O = "$!", Nqe = "style", zX = null, $X = null;
    function Rqe(f) {
      var p, C, x = f.nodeType;
      switch (x) {
        case ap:
        case Gw: {
          p = x === ap ? "#document" : "#fragment";
          var I = f.documentElement;
          C = I ? I.namespaceURI : Lk(null, "");
          break;
        }
        default: {
          var O = x === Ca ? f.parentNode : f, W = O.namespaceURI || null;
          p = O.tagName, C = Lk(W, p);
          break;
        }
      }
      {
        var q = p.toLowerCase(), ee = UO(null, q);
        return {
          namespace: C,
          ancestorInfo: ee
        };
      }
    }
    function Aqe(f, p, C) {
      {
        var x = f, I = Lk(x.namespace, p), O = UO(x.ancestorInfo, p);
        return {
          namespace: I,
          ancestorInfo: O
        };
      }
    }
    function zrn(f) {
      return f;
    }
    function Oqe(f) {
      zX = Nl(), $X = KGe();
      var p = null;
      return oa(!1), p;
    }
    function Mqe(f) {
      YGe($X), oa(zX), zX = null, $X = null;
    }
    function Pqe(f, p, C, x, I) {
      var O;
      {
        var W = x;
        if (VO(f, null, W.ancestorInfo), typeof p.children == "string" || typeof p.children == "number") {
          var q = "" + p.children, ee = UO(W.ancestorInfo, f);
          VO(null, q, ee);
        }
        O = W.namespace;
      }
      var ue = _qe(f, p, C, O);
      return qO(I, ue), QX(ue, p), ue;
    }
    function Fqe(f, p) {
      f.appendChild(p);
    }
    function Bqe(f, p, C, x, I) {
      switch (vqe(f, p, C, x), p) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          return !!C.autoFocus;
        case "img":
          return !0;
        default:
          return !1;
      }
    }
    function Hqe(f, p, C, x, I, O) {
      {
        var W = O;
        if (typeof x.children != typeof C.children && (typeof x.children == "string" || typeof x.children == "number")) {
          var q = "" + x.children, ee = UO(W.ancestorInfo, p);
          VO(null, q, ee);
        }
      }
      return yqe(f, p, C, x);
    }
    function jX(f, p) {
      return f === "textarea" || f === "noscript" || typeof p.children == "string" || typeof p.children == "number" || typeof p.dangerouslySetInnerHTML == "object" && p.dangerouslySetInnerHTML !== null && p.dangerouslySetInnerHTML.__html != null;
    }
    function Wqe(f, p, C, x) {
      {
        var I = C;
        VO(null, f, I.ancestorInfo);
      }
      var O = bqe(f, p);
      return qO(x, O), O;
    }
    function Vqe() {
      var f = window.event;
      return f === void 0 ? Dl : J0(f.type);
    }
    var GX = typeof setTimeout == "function" ? setTimeout : void 0, Uqe = typeof clearTimeout == "function" ? clearTimeout : void 0, qX = -1, D1e = typeof Promise == "function" ? Promise : void 0, zqe = typeof queueMicrotask == "function" ? queueMicrotask : typeof D1e < "u" ? function(f) {
      return D1e.resolve(null).then(f).catch($qe);
    } : GX;
    function $qe(f) {
      setTimeout(function() {
        throw f;
      });
    }
    function jqe(f, p, C, x) {
      switch (p) {
        case "button":
        case "input":
        case "select":
        case "textarea":
          C.autoFocus && f.focus();
          return;
        case "img": {
          C.src && (f.src = C.src);
          return;
        }
      }
    }
    function Gqe(f, p, C, x, I, O) {
      Cqe(f, p, C, x, I), QX(f, I);
    }
    function I1e(f) {
      Rm(f, "");
    }
    function qqe(f, p, C) {
      f.nodeValue = C;
    }
    function Kqe(f, p) {
      f.appendChild(p);
    }
    function Yqe(f, p) {
      var C;
      f.nodeType === Ca ? (C = f.parentNode, C.insertBefore(p, f)) : (C = f, C.appendChild(p));
      var x = f._reactRootContainer;
      x == null && C.onclick === null && Q8(C);
    }
    function Xqe(f, p, C) {
      f.insertBefore(p, C);
    }
    function Zqe(f, p, C) {
      f.nodeType === Ca ? f.parentNode.insertBefore(p, C) : f.insertBefore(p, C);
    }
    function Qqe(f, p) {
      f.removeChild(p);
    }
    function Jqe(f, p) {
      f.nodeType === Ca ? f.parentNode.removeChild(p) : f.removeChild(p);
    }
    function KX(f, p) {
      var C = p, x = 0;
      do {
        var I = C.nextSibling;
        if (f.removeChild(C), I && I.nodeType === Ca) {
          var O = I.data;
          if (O === t9)
            if (x === 0) {
              f.removeChild(I), dc(p);
              return;
            } else
              x--;
          else (O === e9 || O === zO || O === $O) && x++;
        }
        C = I;
      } while (C);
      dc(p);
    }
    function eKe(f, p) {
      f.nodeType === Ca ? KX(f.parentNode, p) : f.nodeType === Cu && KX(f, p), dc(f);
    }
    function tKe(f) {
      f = f;
      var p = f.style;
      typeof p.setProperty == "function" ? p.setProperty("display", "none", "important") : p.display = "none";
    }
    function nKe(f) {
      f.nodeValue = "";
    }
    function iKe(f, p) {
      f = f;
      var C = p[Nqe], x = C != null && C.hasOwnProperty("display") ? C.display : null;
      f.style.display = kk("display", x);
    }
    function rKe(f, p) {
      f.nodeValue = p;
    }
    function sKe(f) {
      f.nodeType === Cu ? f.textContent = "" : f.nodeType === ap && f.documentElement && f.removeChild(f.documentElement);
    }
    function oKe(f, p, C) {
      return f.nodeType !== Cu || p.toLowerCase() !== f.nodeName.toLowerCase() ? null : f;
    }
    function aKe(f, p) {
      return p === "" || f.nodeType !== op ? null : f;
    }
    function lKe(f) {
      return f.nodeType !== Ca ? null : f;
    }
    function N1e(f) {
      return f.data === zO;
    }
    function YX(f) {
      return f.data === $O;
    }
    function cKe(f) {
      var p = f.nextSibling && f.nextSibling.dataset, C, x, I;
      return p && (C = p.dgst, x = p.msg, I = p.stck), {
        message: x,
        digest: C,
        stack: I
      };
    }
    function uKe(f, p) {
      f._reactRetry = p;
    }
    function n9(f) {
      for (; f != null; f = f.nextSibling) {
        var p = f.nodeType;
        if (p === Cu || p === op)
          break;
        if (p === Ca) {
          var C = f.data;
          if (C === e9 || C === $O || C === zO)
            break;
          if (C === t9)
            return null;
        }
      }
      return f;
    }
    function jO(f) {
      return n9(f.nextSibling);
    }
    function dKe(f) {
      return n9(f.firstChild);
    }
    function hKe(f) {
      return n9(f.firstChild);
    }
    function fKe(f) {
      return n9(f.nextSibling);
    }
    function gKe(f, p, C, x, I, O, W) {
      qO(O, f), QX(f, C);
      var q;
      {
        var ee = I;
        q = ee.namespace;
      }
      var ue = (O.mode & gr) !== ei;
      return Sqe(f, p, C, q, x, ue, W);
    }
    function pKe(f, p, C, x) {
      return qO(C, f), C.mode & gr, Eqe(f, p);
    }
    function mKe(f, p) {
      qO(p, f);
    }
    function _Ke(f) {
      for (var p = f.nextSibling, C = 0; p; ) {
        if (p.nodeType === Ca) {
          var x = p.data;
          if (x === t9) {
            if (C === 0)
              return jO(p);
            C--;
          } else (x === e9 || x === $O || x === zO) && C++;
        }
        p = p.nextSibling;
      }
      return null;
    }
    function R1e(f) {
      for (var p = f.previousSibling, C = 0; p; ) {
        if (p.nodeType === Ca) {
          var x = p.data;
          if (x === e9 || x === $O || x === zO) {
            if (C === 0)
              return p;
            C--;
          } else x === t9 && C++;
        }
        p = p.previousSibling;
      }
      return null;
    }
    function bKe(f) {
      dc(f);
    }
    function vKe(f) {
      dc(f);
    }
    function yKe(f) {
      return f !== "head" && f !== "body";
    }
    function CKe(f, p, C, x) {
      var I = !0;
      Z8(p.nodeValue, C, x, I);
    }
    function wKe(f, p, C, x, I, O) {
      if (p[J8] !== !0) {
        var W = !0;
        Z8(x.nodeValue, I, O, W);
      }
    }
    function SKe(f, p) {
      p.nodeType === Cu ? HX(f, p) : p.nodeType === Ca || WX(f, p);
    }
    function EKe(f, p) {
      {
        var C = f.parentNode;
        C !== null && (p.nodeType === Cu ? HX(C, p) : p.nodeType === Ca || WX(C, p));
      }
    }
    function xKe(f, p, C, x, I) {
      (I || p[J8] !== !0) && (x.nodeType === Cu ? HX(C, x) : x.nodeType === Ca || WX(C, x));
    }
    function LKe(f, p, C) {
      VX(f, p);
    }
    function TKe(f, p) {
      UX(f, p);
    }
    function kKe(f, p, C) {
      {
        var x = f.parentNode;
        x !== null && VX(x, p);
      }
    }
    function DKe(f, p) {
      {
        var C = f.parentNode;
        C !== null && UX(C, p);
      }
    }
    function IKe(f, p, C, x, I, O) {
      (O || p[J8] !== !0) && VX(C, x);
    }
    function NKe(f, p, C, x, I) {
      (I || p[J8] !== !0) && UX(C, x);
    }
    function RKe(f) {
      a("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", f.nodeName.toLowerCase());
    }
    function AKe(f) {
      FO(f);
    }
    var PD = Math.random().toString(36).slice(2), FD = "__reactFiber$" + PD, XX = "__reactProps$" + PD, GO = "__reactContainer$" + PD, ZX = "__reactEvents$" + PD, OKe = "__reactListeners$" + PD, MKe = "__reactHandles$" + PD;
    function PKe(f) {
      delete f[FD], delete f[XX], delete f[ZX], delete f[OKe], delete f[MKe];
    }
    function qO(f, p) {
      p[FD] = f;
    }
    function i9(f, p) {
      p[GO] = f;
    }
    function A1e(f) {
      f[GO] = null;
    }
    function KO(f) {
      return !!f[GO];
    }
    function HS(f) {
      var p = f[FD];
      if (p)
        return p;
      for (var C = f.parentNode; C; ) {
        if (p = C[GO] || C[FD], p) {
          var x = p.alternate;
          if (p.child !== null || x !== null && x.child !== null)
            for (var I = R1e(f); I !== null; ) {
              var O = I[FD];
              if (O)
                return O;
              I = R1e(I);
            }
          return p;
        }
        f = C, C = f.parentNode;
      }
      return null;
    }
    function aC(f) {
      var p = f[FD] || f[GO];
      return p && (p.tag === m || p.tag === _ || p.tag === N || p.tag === h) ? p : null;
    }
    function BD(f) {
      if (f.tag === m || f.tag === _)
        return f.stateNode;
      throw new Error("getNodeFromInstance: Invalid argument.");
    }
    function r9(f) {
      return f[XX] || null;
    }
    function QX(f, p) {
      f[XX] = p;
    }
    function FKe(f) {
      var p = f[ZX];
      return p === void 0 && (p = f[ZX] = /* @__PURE__ */ new Set()), p;
    }
    var O1e = {}, M1e = n.ReactDebugCurrentFrame;
    function s9(f) {
      if (f) {
        var p = f._owner, C = Ww(f.type, f._source, p ? p.type : null);
        M1e.setExtraStackFrame(C);
      } else
        M1e.setExtraStackFrame(null);
    }
    function gp(f, p, C, x, I) {
      {
        var O = Function.call.bind(Bi);
        for (var W in f)
          if (O(f, W)) {
            var q = void 0;
            try {
              if (typeof f[W] != "function") {
                var ee = Error((x || "React class") + ": " + C + " type `" + W + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof f[W] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                throw ee.name = "Invariant Violation", ee;
              }
              q = f[W](p, W, x, C, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (ue) {
              q = ue;
            }
            q && !(q instanceof Error) && (s9(I), a("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", x || "React class", C, W, typeof q), s9(null)), q instanceof Error && !(q.message in O1e) && (O1e[q.message] = !0, s9(I), a("Failed %s type: %s", C, q.message), s9(null));
          }
      }
    }
    var JX = [], o9;
    o9 = [];
    var _v = -1;
    function lC(f) {
      return {
        current: f
      };
    }
    function Nu(f, p) {
      if (_v < 0) {
        a("Unexpected pop.");
        return;
      }
      p !== o9[_v] && a("Unexpected Fiber popped."), f.current = JX[_v], JX[_v] = null, o9[_v] = null, _v--;
    }
    function Ru(f, p, C) {
      _v++, JX[_v] = f.current, o9[_v] = C, f.current = p;
    }
    var eZ;
    eZ = {};
    var ff = {};
    Object.freeze(ff);
    var bv = lC(ff), e_ = lC(!1), tZ = ff;
    function HD(f, p, C) {
      return C && t_(p) ? tZ : bv.current;
    }
    function P1e(f, p, C) {
      {
        var x = f.stateNode;
        x.__reactInternalMemoizedUnmaskedChildContext = p, x.__reactInternalMemoizedMaskedChildContext = C;
      }
    }
    function WD(f, p) {
      {
        var C = f.type, x = C.contextTypes;
        if (!x)
          return ff;
        var I = f.stateNode;
        if (I && I.__reactInternalMemoizedUnmaskedChildContext === p)
          return I.__reactInternalMemoizedMaskedChildContext;
        var O = {};
        for (var W in x)
          O[W] = p[W];
        {
          var q = Ai(f) || "Unknown";
          gp(x, O, "context", q);
        }
        return I && P1e(f, p, O), O;
      }
    }
    function a9() {
      return e_.current;
    }
    function t_(f) {
      {
        var p = f.childContextTypes;
        return p != null;
      }
    }
    function l9(f) {
      Nu(e_, f), Nu(bv, f);
    }
    function nZ(f) {
      Nu(e_, f), Nu(bv, f);
    }
    function F1e(f, p, C) {
      {
        if (bv.current !== ff)
          throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
        Ru(bv, p, f), Ru(e_, C, f);
      }
    }
    function B1e(f, p, C) {
      {
        var x = f.stateNode, I = p.childContextTypes;
        if (typeof x.getChildContext != "function") {
          {
            var O = Ai(f) || "Unknown";
            eZ[O] || (eZ[O] = !0, a("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", O, O));
          }
          return C;
        }
        var W = x.getChildContext();
        for (var q in W)
          if (!(q in I))
            throw new Error((Ai(f) || "Unknown") + '.getChildContext(): key "' + q + '" is not defined in childContextTypes.');
        {
          var ee = Ai(f) || "Unknown";
          gp(I, W, "child context", ee);
        }
        return bn({}, C, W);
      }
    }
    function c9(f) {
      {
        var p = f.stateNode, C = p && p.__reactInternalMemoizedMergedChildContext || ff;
        return tZ = bv.current, Ru(bv, C, f), Ru(e_, e_.current, f), !0;
      }
    }
    function H1e(f, p, C) {
      {
        var x = f.stateNode;
        if (!x)
          throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
        if (C) {
          var I = B1e(f, p, tZ);
          x.__reactInternalMemoizedMergedChildContext = I, Nu(e_, f), Nu(bv, f), Ru(bv, I, f), Ru(e_, C, f);
        } else
          Nu(e_, f), Ru(e_, C, f);
      }
    }
    function BKe(f) {
      {
        if (!r8(f) || f.tag !== u)
          throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
        var p = f;
        do {
          switch (p.tag) {
            case h:
              return p.stateNode.context;
            case u: {
              var C = p.type;
              if (t_(C))
                return p.stateNode.__reactInternalMemoizedMergedChildContext;
              break;
            }
          }
          p = p.return;
        } while (p !== null);
        throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
      }
    }
    var cC = 0, u9 = 1, vv = null, iZ = !1, rZ = !1;
    function W1e(f) {
      vv === null ? vv = [f] : vv.push(f);
    }
    function HKe(f) {
      iZ = !0, W1e(f);
    }
    function V1e() {
      iZ && uC();
    }
    function uC() {
      if (!rZ && vv !== null) {
        rZ = !0;
        var f = 0, p = fd();
        try {
          var C = !0, x = vv;
          for (Ha(Du); f < x.length; f++) {
            var I = x[f];
            do
              I = I(C);
            while (I !== null);
          }
          vv = null, iZ = !1;
        } catch (O) {
          throw vv !== null && (vv = vv.slice(f + 1)), Q2(up, uC), O;
        } finally {
          Ha(p), rZ = !1;
        }
      }
      return null;
    }
    var VD = [], UD = 0, d9 = null, h9 = 0, mg = [], _g = 0, WS = null, yv = 1, Cv = "";
    function WKe(f) {
      return US(), (f.flags & oS) !== Jn;
    }
    function VKe(f) {
      return US(), h9;
    }
    function UKe() {
      var f = Cv, p = yv, C = p & ~zKe(p);
      return C.toString(32) + f;
    }
    function VS(f, p) {
      US(), VD[UD++] = h9, VD[UD++] = d9, d9 = f, h9 = p;
    }
    function U1e(f, p, C) {
      US(), mg[_g++] = yv, mg[_g++] = Cv, mg[_g++] = WS, WS = f;
      var x = yv, I = Cv, O = f9(x) - 1, W = x & ~(1 << O), q = C + 1, ee = f9(p) + O;
      if (ee > 30) {
        var ue = O - O % 5, me = (1 << ue) - 1, Me = (W & me).toString(32), Ae = W >> ue, nt = O - ue, rt = f9(p) + nt, ft = q << nt, un = ft | Ae, ai = Me + I;
        yv = 1 << rt | un, Cv = ai;
      } else {
        var Xn = q << O, Or = Xn | W, Sr = I;
        yv = 1 << ee | Or, Cv = Sr;
      }
    }
    function sZ(f) {
      US();
      var p = f.return;
      if (p !== null) {
        var C = 1, x = 0;
        VS(f, C), U1e(f, C, x);
      }
    }
    function f9(f) {
      return 32 - Ba(f);
    }
    function zKe(f) {
      return 1 << f9(f) - 1;
    }
    function oZ(f) {
      for (; f === d9; )
        d9 = VD[--UD], VD[UD] = null, h9 = VD[--UD], VD[UD] = null;
      for (; f === WS; )
        WS = mg[--_g], mg[_g] = null, Cv = mg[--_g], mg[_g] = null, yv = mg[--_g], mg[_g] = null;
    }
    function $Ke() {
      return US(), WS !== null ? {
        id: yv,
        overflow: Cv
      } : null;
    }
    function jKe(f, p) {
      US(), mg[_g++] = yv, mg[_g++] = Cv, mg[_g++] = WS, yv = p.id, Cv = p.overflow, WS = f;
    }
    function US() {
      Wc() || a("Expected to be hydrating. This is a bug in React. Please file an issue.");
    }
    var Hc = null, bg = null, pp = !1, zS = !1, dC = null;
    function GKe() {
      pp && a("We should not be hydrating here. This is a bug in React. Please file a bug.");
    }
    function z1e() {
      zS = !0;
    }
    function qKe() {
      return zS;
    }
    function KKe(f) {
      var p = f.stateNode.containerInfo;
      return bg = hKe(p), Hc = f, pp = !0, dC = null, zS = !1, !0;
    }
    function YKe(f, p, C) {
      return bg = fKe(p), Hc = f, pp = !0, dC = null, zS = !1, C !== null && jKe(f, C), !0;
    }
    function $1e(f, p) {
      switch (f.tag) {
        case h: {
          SKe(f.stateNode.containerInfo, p);
          break;
        }
        case m: {
          var C = (f.mode & gr) !== ei;
          xKe(
            f.type,
            f.memoizedProps,
            f.stateNode,
            p,
            // TODO: Delete this argument when we remove the legacy root API.
            C
          );
          break;
        }
        case N: {
          var x = f.memoizedState;
          x.dehydrated !== null && EKe(x.dehydrated, p);
          break;
        }
      }
    }
    function j1e(f, p) {
      $1e(f, p);
      var C = JZe();
      C.stateNode = p, C.return = f;
      var x = f.deletions;
      x === null ? (f.deletions = [C], f.flags |= wu) : x.push(C);
    }
    function aZ(f, p) {
      {
        if (zS)
          return;
        switch (f.tag) {
          case h: {
            var C = f.stateNode.containerInfo;
            switch (p.tag) {
              case m:
                var x = p.type;
                p.pendingProps, LKe(C, x);
                break;
              case _:
                var I = p.pendingProps;
                TKe(C, I);
                break;
            }
            break;
          }
          case m: {
            var O = f.type, W = f.memoizedProps, q = f.stateNode;
            switch (p.tag) {
              case m: {
                var ee = p.type, ue = p.pendingProps, me = (f.mode & gr) !== ei;
                IKe(
                  O,
                  W,
                  q,
                  ee,
                  ue,
                  // TODO: Delete this argument when we remove the legacy root API.
                  me
                );
                break;
              }
              case _: {
                var Me = p.pendingProps, Ae = (f.mode & gr) !== ei;
                NKe(
                  O,
                  W,
                  q,
                  Me,
                  // TODO: Delete this argument when we remove the legacy root API.
                  Ae
                );
                break;
              }
            }
            break;
          }
          case N: {
            var nt = f.memoizedState, rt = nt.dehydrated;
            if (rt !== null) switch (p.tag) {
              case m:
                var ft = p.type;
                p.pendingProps, kKe(rt, ft);
                break;
              case _:
                var un = p.pendingProps;
                DKe(rt, un);
                break;
            }
            break;
          }
          default:
            return;
        }
      }
    }
    function G1e(f, p) {
      p.flags = p.flags & ~Ko | qo, aZ(f, p);
    }
    function q1e(f, p) {
      switch (f.tag) {
        case m: {
          var C = f.type;
          f.pendingProps;
          var x = oKe(p, C);
          return x !== null ? (f.stateNode = x, Hc = f, bg = dKe(x), !0) : !1;
        }
        case _: {
          var I = f.pendingProps, O = aKe(p, I);
          return O !== null ? (f.stateNode = O, Hc = f, bg = null, !0) : !1;
        }
        case N: {
          var W = lKe(p);
          if (W !== null) {
            var q = {
              dehydrated: W,
              treeContext: $Ke(),
              retryLane: Lu
            };
            f.memoizedState = q;
            var ee = eQe(W);
            return ee.return = f, f.child = ee, Hc = f, bg = null, !0;
          }
          return !1;
        }
        default:
          return !1;
      }
    }
    function lZ(f) {
      return (f.mode & gr) !== ei && (f.flags & lr) === Jn;
    }
    function cZ(f) {
      throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
    }
    function uZ(f) {
      if (pp) {
        var p = bg;
        if (!p) {
          lZ(f) && (aZ(Hc, f), cZ()), G1e(Hc, f), pp = !1, Hc = f;
          return;
        }
        var C = p;
        if (!q1e(f, p)) {
          lZ(f) && (aZ(Hc, f), cZ()), p = jO(C);
          var x = Hc;
          if (!p || !q1e(f, p)) {
            G1e(Hc, f), pp = !1, Hc = f;
            return;
          }
          j1e(x, C);
        }
      }
    }
    function XKe(f, p, C) {
      var x = f.stateNode, I = !zS, O = gKe(x, f.type, f.memoizedProps, p, C, f, I);
      return f.updateQueue = O, O !== null;
    }
    function ZKe(f) {
      var p = f.stateNode, C = f.memoizedProps, x = pKe(p, C, f);
      if (x) {
        var I = Hc;
        if (I !== null)
          switch (I.tag) {
            case h: {
              var O = I.stateNode.containerInfo, W = (I.mode & gr) !== ei;
              CKe(
                O,
                p,
                C,
                // TODO: Delete this argument when we remove the legacy root API.
                W
              );
              break;
            }
            case m: {
              var q = I.type, ee = I.memoizedProps, ue = I.stateNode, me = (I.mode & gr) !== ei;
              wKe(
                q,
                ee,
                ue,
                p,
                C,
                // TODO: Delete this argument when we remove the legacy root API.
                me
              );
              break;
            }
          }
      }
      return x;
    }
    function QKe(f) {
      var p = f.memoizedState, C = p !== null ? p.dehydrated : null;
      if (!C)
        throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
      mKe(C, f);
    }
    function JKe(f) {
      var p = f.memoizedState, C = p !== null ? p.dehydrated : null;
      if (!C)
        throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
      return _Ke(C);
    }
    function K1e(f) {
      for (var p = f.return; p !== null && p.tag !== m && p.tag !== h && p.tag !== N; )
        p = p.return;
      Hc = p;
    }
    function g9(f) {
      if (f !== Hc)
        return !1;
      if (!pp)
        return K1e(f), pp = !0, !1;
      if (f.tag !== h && (f.tag !== m || yKe(f.type) && !jX(f.type, f.memoizedProps))) {
        var p = bg;
        if (p)
          if (lZ(f))
            Y1e(f), cZ();
          else
            for (; p; )
              j1e(f, p), p = jO(p);
      }
      return K1e(f), f.tag === N ? bg = JKe(f) : bg = Hc ? jO(f.stateNode) : null, !0;
    }
    function eYe() {
      return pp && bg !== null;
    }
    function Y1e(f) {
      for (var p = bg; p; )
        $1e(f, p), p = jO(p);
    }
    function zD() {
      Hc = null, bg = null, pp = !1, zS = !1;
    }
    function X1e() {
      dC !== null && (zSe(dC), dC = null);
    }
    function Wc() {
      return pp;
    }
    function dZ(f) {
      dC === null ? dC = [f] : dC.push(f);
    }
    var tYe = n.ReactCurrentBatchConfig, nYe = null;
    function iYe() {
      return tYe.transition;
    }
    var mp = {
      recordUnsafeLifecycleWarnings: function(f, p) {
      },
      flushPendingUnsafeLifecycleWarnings: function() {
      },
      recordLegacyContextWarning: function(f, p) {
      },
      flushLegacyContextWarning: function() {
      },
      discardPendingWarnings: function() {
      }
    };
    {
      var rYe = function(f) {
        for (var p = null, C = f; C !== null; )
          C.mode & zi && (p = C), C = C.return;
        return p;
      }, $S = function(f) {
        var p = [];
        return f.forEach(function(C) {
          p.push(C);
        }), p.sort().join(", ");
      }, YO = [], XO = [], ZO = [], QO = [], JO = [], eM = [], jS = /* @__PURE__ */ new Set();
      mp.recordUnsafeLifecycleWarnings = function(f, p) {
        jS.has(f.type) || (typeof p.componentWillMount == "function" && // Don't warn about react-lifecycles-compat polyfilled components.
        p.componentWillMount.__suppressDeprecationWarning !== !0 && YO.push(f), f.mode & zi && typeof p.UNSAFE_componentWillMount == "function" && XO.push(f), typeof p.componentWillReceiveProps == "function" && p.componentWillReceiveProps.__suppressDeprecationWarning !== !0 && ZO.push(f), f.mode & zi && typeof p.UNSAFE_componentWillReceiveProps == "function" && QO.push(f), typeof p.componentWillUpdate == "function" && p.componentWillUpdate.__suppressDeprecationWarning !== !0 && JO.push(f), f.mode & zi && typeof p.UNSAFE_componentWillUpdate == "function" && eM.push(f));
      }, mp.flushPendingUnsafeLifecycleWarnings = function() {
        var f = /* @__PURE__ */ new Set();
        YO.length > 0 && (YO.forEach(function(Ae) {
          f.add(Ai(Ae) || "Component"), jS.add(Ae.type);
        }), YO = []);
        var p = /* @__PURE__ */ new Set();
        XO.length > 0 && (XO.forEach(function(Ae) {
          p.add(Ai(Ae) || "Component"), jS.add(Ae.type);
        }), XO = []);
        var C = /* @__PURE__ */ new Set();
        ZO.length > 0 && (ZO.forEach(function(Ae) {
          C.add(Ai(Ae) || "Component"), jS.add(Ae.type);
        }), ZO = []);
        var x = /* @__PURE__ */ new Set();
        QO.length > 0 && (QO.forEach(function(Ae) {
          x.add(Ai(Ae) || "Component"), jS.add(Ae.type);
        }), QO = []);
        var I = /* @__PURE__ */ new Set();
        JO.length > 0 && (JO.forEach(function(Ae) {
          I.add(Ai(Ae) || "Component"), jS.add(Ae.type);
        }), JO = []);
        var O = /* @__PURE__ */ new Set();
        if (eM.length > 0 && (eM.forEach(function(Ae) {
          O.add(Ai(Ae) || "Component"), jS.add(Ae.type);
        }), eM = []), p.size > 0) {
          var W = $S(p);
          a(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

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

Please update the following components: %s`, W);
        }
        if (x.size > 0) {
          var q = $S(x);
          a(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

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

Please update the following components: %s`, q);
        }
        if (O.size > 0) {
          var ee = $S(O);
          a(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.

Please update the following components: %s`, ee);
        }
        if (f.size > 0) {
          var ue = $S(f);
          o(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

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

Please update the following components: %s`, ue);
        }
        if (C.size > 0) {
          var me = $S(C);
          o(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

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

Please update the following components: %s`, me);
        }
        if (I.size > 0) {
          var Me = $S(I);
          o(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

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

Please update the following components: %s`, Me);
        }
      };
      var p9 = /* @__PURE__ */ new Map(), Z1e = /* @__PURE__ */ new Set();
      mp.recordLegacyContextWarning = function(f, p) {
        var C = rYe(f);
        if (C === null) {
          a("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");
          return;
        }
        if (!Z1e.has(f.type)) {
          var x = p9.get(C);
          (f.type.contextTypes != null || f.type.childContextTypes != null || p !== null && typeof p.getChildContext == "function") && (x === void 0 && (x = [], p9.set(C, x)), x.push(f));
        }
      }, mp.flushLegacyContextWarning = function() {
        p9.forEach(function(f, p) {
          if (f.length !== 0) {
            var C = f[0], x = /* @__PURE__ */ new Set();
            f.forEach(function(O) {
              x.add(Ai(O) || "Component"), Z1e.add(O.type);
            });
            var I = $S(x);
            try {
              Vs(C), a(`Legacy context API has been detected within a strict-mode tree.

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

Please update the following components: %s

Learn more about this warning here: https://reactjs.org/link/legacy-context`, I);
            } finally {
              Go();
            }
          }
        });
      }, mp.discardPendingWarnings = function() {
        YO = [], XO = [], ZO = [], QO = [], JO = [], eM = [], p9 = /* @__PURE__ */ new Map();
      };
    }
    var hZ, fZ, gZ, pZ, mZ, Q1e = function(f, p) {
    };
    hZ = !1, fZ = !1, gZ = {}, pZ = {}, mZ = {}, Q1e = function(f, p) {
      if (!(f === null || typeof f != "object") && !(!f._store || f._store.validated || f.key != null)) {
        if (typeof f._store != "object")
          throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
        f._store.validated = !0;
        var C = Ai(p) || "Component";
        pZ[C] || (pZ[C] = !0, a('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'));
      }
    };
    function sYe(f) {
      return f.prototype && f.prototype.isReactComponent;
    }
    function tM(f, p, C) {
      var x = C.ref;
      if (x !== null && typeof x != "function" && typeof x != "object") {
        if ((f.mode & zi || re) && // We warn in ReactElement.js if owner and self are equal for string refs
        // because these cannot be automatically converted to an arrow function
        // using a codemod. Therefore, we don't have to warn about string refs again.
        !(C._owner && C._self && C._owner.stateNode !== C._self) && // Will already throw with "Function components cannot have string refs"
        !(C._owner && C._owner.tag !== u) && // Will already warn with "Function components cannot be given refs"
        !(typeof C.type == "function" && !sYe(C.type)) && // Will already throw with "Element ref was specified as a string (someStringRef) but no owner was set"
        C._owner) {
          var I = Ai(f) || "Component";
          gZ[I] || (a('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', I, x), gZ[I] = !0);
        }
        if (C._owner) {
          var O = C._owner, W;
          if (O) {
            var q = O;
            if (q.tag !== u)
              throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");
            W = q.stateNode;
          }
          if (!W)
            throw new Error("Missing owner for string ref " + x + ". This error is likely caused by a bug in React. Please file an issue.");
          var ee = W;
          Bs(x, "ref");
          var ue = "" + x;
          if (p !== null && p.ref !== null && typeof p.ref == "function" && p.ref._stringRef === ue)
            return p.ref;
          var me = function(Me) {
            var Ae = ee.refs;
            Me === null ? delete Ae[ue] : Ae[ue] = Me;
          };
          return me._stringRef = ue, me;
        } else {
          if (typeof x != "string")
            throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
          if (!C._owner)
            throw new Error("Element ref was specified as a string (" + x + `) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded
See https://reactjs.org/link/refs-must-have-owner for more information.`);
        }
      }
      return x;
    }
    function m9(f, p) {
      var C = Object.prototype.toString.call(p);
      throw new Error("Objects are not valid as a React child (found: " + (C === "[object Object]" ? "object with keys {" + Object.keys(p).join(", ") + "}" : C) + "). If you meant to render a collection of children, use an array instead.");
    }
    function _9(f) {
      {
        var p = Ai(f) || "Component";
        if (mZ[p])
          return;
        mZ[p] = !0, a("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.");
      }
    }
    function J1e(f) {
      var p = f._payload, C = f._init;
      return C(p);
    }
    function ewe(f) {
      function p(qe, gt) {
        if (f) {
          var Ke = qe.deletions;
          Ke === null ? (qe.deletions = [gt], qe.flags |= wu) : Ke.push(gt);
        }
      }
      function C(qe, gt) {
        if (!f)
          return null;
        for (var Ke = gt; Ke !== null; )
          p(qe, Ke), Ke = Ke.sibling;
        return null;
      }
      function x(qe, gt) {
        for (var Ke = /* @__PURE__ */ new Map(), Pt = gt; Pt !== null; )
          Pt.key !== null ? Ke.set(Pt.key, Pt) : Ke.set(Pt.index, Pt), Pt = Pt.sibling;
        return Ke;
      }
      function I(qe, gt) {
        var Ke = eE(qe, gt);
        return Ke.index = 0, Ke.sibling = null, Ke;
      }
      function O(qe, gt, Ke) {
        if (qe.index = Ke, !f)
          return qe.flags |= oS, gt;
        var Pt = qe.alternate;
        if (Pt !== null) {
          var wn = Pt.index;
          return wn < gt ? (qe.flags |= qo, gt) : wn;
        } else
          return qe.flags |= qo, gt;
      }
      function W(qe) {
        return f && qe.alternate === null && (qe.flags |= qo), qe;
      }
      function q(qe, gt, Ke, Pt) {
        if (gt === null || gt.tag !== _) {
          var wn = dJ(Ke, qe.mode, Pt);
          return wn.return = qe, wn;
        } else {
          var _n = I(gt, Ke);
          return _n.return = qe, _n;
        }
      }
      function ee(qe, gt, Ke, Pt) {
        var wn = Ke.type;
        if (wn === bs)
          return me(qe, gt, Ke.props.children, Pt, Ke.key);
        if (gt !== null && (gt.elementType === wn || // Keep this check inline so it only runs on the false path:
        sEe(gt, Ke) || // Lazy types should reconcile their resolved type.
        // We need to do this after the Hot Reloading check above,
        // because hot reloading has different semantics than prod because
        // it doesn't resuspend. So we can't let the call below suspend.
        typeof wn == "object" && wn !== null && wn.$$typeof === fi && J1e(wn) === gt.type)) {
          var _n = I(gt, Ke.props);
          return _n.ref = tM(qe, gt, Ke), _n.return = qe, _n._debugSource = Ke._source, _n._debugOwner = Ke._owner, _n;
        }
        var xi = uJ(Ke, qe.mode, Pt);
        return xi.ref = tM(qe, gt, Ke), xi.return = qe, xi;
      }
      function ue(qe, gt, Ke, Pt) {
        if (gt === null || gt.tag !== g || gt.stateNode.containerInfo !== Ke.containerInfo || gt.stateNode.implementation !== Ke.implementation) {
          var wn = hJ(Ke, qe.mode, Pt);
          return wn.return = qe, wn;
        } else {
          var _n = I(gt, Ke.children || []);
          return _n.return = qe, _n;
        }
      }
      function me(qe, gt, Ke, Pt, wn) {
        if (gt === null || gt.tag !== v) {
          var _n = wC(Ke, qe.mode, Pt, wn);
          return _n.return = qe, _n;
        } else {
          var xi = I(gt, Ke);
          return xi.return = qe, xi;
        }
      }
      function Me(qe, gt, Ke) {
        if (typeof gt == "string" && gt !== "" || typeof gt == "number") {
          var Pt = dJ("" + gt, qe.mode, Ke);
          return Pt.return = qe, Pt;
        }
        if (typeof gt == "object" && gt !== null) {
          switch (gt.$$typeof) {
            case Eo: {
              var wn = uJ(gt, qe.mode, Ke);
              return wn.ref = tM(qe, null, gt), wn.return = qe, wn;
            }
            case po: {
              var _n = hJ(gt, qe.mode, Ke);
              return _n.return = qe, _n;
            }
            case fi: {
              var xi = gt._payload, Vi = gt._init;
              return Me(qe, Vi(xi), Ke);
            }
          }
          if (Yi(gt) || qn(gt)) {
            var Gs = wC(gt, qe.mode, Ke, null);
            return Gs.return = qe, Gs;
          }
          m9(qe, gt);
        }
        return typeof gt == "function" && _9(qe), null;
      }
      function Ae(qe, gt, Ke, Pt) {
        var wn = gt !== null ? gt.key : null;
        if (typeof Ke == "string" && Ke !== "" || typeof Ke == "number")
          return wn !== null ? null : q(qe, gt, "" + Ke, Pt);
        if (typeof Ke == "object" && Ke !== null) {
          switch (Ke.$$typeof) {
            case Eo:
              return Ke.key === wn ? ee(qe, gt, Ke, Pt) : null;
            case po:
              return Ke.key === wn ? ue(qe, gt, Ke, Pt) : null;
            case fi: {
              var _n = Ke._payload, xi = Ke._init;
              return Ae(qe, gt, xi(_n), Pt);
            }
          }
          if (Yi(Ke) || qn(Ke))
            return wn !== null ? null : me(qe, gt, Ke, Pt, null);
          m9(qe, Ke);
        }
        return typeof Ke == "function" && _9(qe), null;
      }
      function nt(qe, gt, Ke, Pt, wn) {
        if (typeof Pt == "string" && Pt !== "" || typeof Pt == "number") {
          var _n = qe.get(Ke) || null;
          return q(gt, _n, "" + Pt, wn);
        }
        if (typeof Pt == "object" && Pt !== null) {
          switch (Pt.$$typeof) {
            case Eo: {
              var xi = qe.get(Pt.key === null ? Ke : Pt.key) || null;
              return ee(gt, xi, Pt, wn);
            }
            case po: {
              var Vi = qe.get(Pt.key === null ? Ke : Pt.key) || null;
              return ue(gt, Vi, Pt, wn);
            }
            case fi:
              var Gs = Pt._payload, rs = Pt._init;
              return nt(qe, gt, Ke, rs(Gs), wn);
          }
          if (Yi(Pt) || qn(Pt)) {
            var Ua = qe.get(Ke) || null;
            return me(gt, Ua, Pt, wn, null);
          }
          m9(gt, Pt);
        }
        return typeof Pt == "function" && _9(gt), null;
      }
      function rt(qe, gt, Ke) {
        {
          if (typeof qe != "object" || qe === null)
            return gt;
          switch (qe.$$typeof) {
            case Eo:
            case po:
              Q1e(qe, Ke);
              var Pt = qe.key;
              if (typeof Pt != "string")
                break;
              if (gt === null) {
                gt = /* @__PURE__ */ new Set(), gt.add(Pt);
                break;
              }
              if (!gt.has(Pt)) {
                gt.add(Pt);
                break;
              }
              a("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.", Pt);
              break;
            case fi:
              var wn = qe._payload, _n = qe._init;
              rt(_n(wn), gt, Ke);
              break;
          }
        }
        return gt;
      }
      function ft(qe, gt, Ke, Pt) {
        for (var wn = null, _n = 0; _n < Ke.length; _n++) {
          var xi = Ke[_n];
          wn = rt(xi, wn, qe);
        }
        for (var Vi = null, Gs = null, rs = gt, Ua = 0, ss = 0, La = null; rs !== null && ss < Ke.length; ss++) {
          rs.index > ss ? (La = rs, rs = null) : La = rs.sibling;
          var Ou = Ae(qe, rs, Ke[ss], Pt);
          if (Ou === null) {
            rs === null && (rs = La);
            break;
          }
          f && rs && Ou.alternate === null && p(qe, rs), Ua = O(Ou, Ua, ss), Gs === null ? Vi = Ou : Gs.sibling = Ou, Gs = Ou, rs = La;
        }
        if (ss === Ke.length) {
          if (C(qe, rs), Wc()) {
            var qc = ss;
            VS(qe, qc);
          }
          return Vi;
        }
        if (rs === null) {
          for (; ss < Ke.length; ss++) {
            var pf = Me(qe, Ke[ss], Pt);
            pf !== null && (Ua = O(pf, Ua, ss), Gs === null ? Vi = pf : Gs.sibling = pf, Gs = pf);
          }
          if (Wc()) {
            var yd = ss;
            VS(qe, yd);
          }
          return Vi;
        }
        for (var Cd = x(qe, rs); ss < Ke.length; ss++) {
          var Mu = nt(Cd, qe, ss, Ke[ss], Pt);
          Mu !== null && (f && Mu.alternate !== null && Cd.delete(Mu.key === null ? ss : Mu.key), Ua = O(Mu, Ua, ss), Gs === null ? Vi = Mu : Gs.sibling = Mu, Gs = Mu);
        }
        if (f && Cd.forEach(function(lI) {
          return p(qe, lI);
        }), Wc()) {
          var kv = ss;
          VS(qe, kv);
        }
        return Vi;
      }
      function un(qe, gt, Ke, Pt) {
        var wn = qn(Ke);
        if (typeof wn != "function")
          throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
        {
          typeof Symbol == "function" && // $FlowFixMe Flow doesn't know about toStringTag
          Ke[Symbol.toStringTag] === "Generator" && (fZ || a("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."), fZ = !0), Ke.entries === wn && (hZ || a("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), hZ = !0);
          var _n = wn.call(Ke);
          if (_n)
            for (var xi = null, Vi = _n.next(); !Vi.done; Vi = _n.next()) {
              var Gs = Vi.value;
              xi = rt(Gs, xi, qe);
            }
        }
        var rs = wn.call(Ke);
        if (rs == null)
          throw new Error("An iterable object provided no iterator.");
        for (var Ua = null, ss = null, La = gt, Ou = 0, qc = 0, pf = null, yd = rs.next(); La !== null && !yd.done; qc++, yd = rs.next()) {
          La.index > qc ? (pf = La, La = null) : pf = La.sibling;
          var Cd = Ae(qe, La, yd.value, Pt);
          if (Cd === null) {
            La === null && (La = pf);
            break;
          }
          f && La && Cd.alternate === null && p(qe, La), Ou = O(Cd, Ou, qc), ss === null ? Ua = Cd : ss.sibling = Cd, ss = Cd, La = pf;
        }
        if (yd.done) {
          if (C(qe, La), Wc()) {
            var Mu = qc;
            VS(qe, Mu);
          }
          return Ua;
        }
        if (La === null) {
          for (; !yd.done; qc++, yd = rs.next()) {
            var kv = Me(qe, yd.value, Pt);
            kv !== null && (Ou = O(kv, Ou, qc), ss === null ? Ua = kv : ss.sibling = kv, ss = kv);
          }
          if (Wc()) {
            var lI = qc;
            VS(qe, lI);
          }
          return Ua;
        }
        for (var AM = x(qe, La); !yd.done; qc++, yd = rs.next()) {
          var c_ = nt(AM, qe, qc, yd.value, Pt);
          c_ !== null && (f && c_.alternate !== null && AM.delete(c_.key === null ? qc : c_.key), Ou = O(c_, Ou, qc), ss === null ? Ua = c_ : ss.sibling = c_, ss = c_);
        }
        if (f && AM.forEach(function(NQe) {
          return p(qe, NQe);
        }), Wc()) {
          var IQe = qc;
          VS(qe, IQe);
        }
        return Ua;
      }
      function ai(qe, gt, Ke, Pt) {
        if (gt !== null && gt.tag === _) {
          C(qe, gt.sibling);
          var wn = I(gt, Ke);
          return wn.return = qe, wn;
        }
        C(qe, gt);
        var _n = dJ(Ke, qe.mode, Pt);
        return _n.return = qe, _n;
      }
      function Xn(qe, gt, Ke, Pt) {
        for (var wn = Ke.key, _n = gt; _n !== null; ) {
          if (_n.key === wn) {
            var xi = Ke.type;
            if (xi === bs) {
              if (_n.tag === v) {
                C(qe, _n.sibling);
                var Vi = I(_n, Ke.props.children);
                return Vi.return = qe, Vi._debugSource = Ke._source, Vi._debugOwner = Ke._owner, Vi;
              }
            } else if (_n.elementType === xi || // Keep this check inline so it only runs on the false path:
            sEe(_n, Ke) || // Lazy types should reconcile their resolved type.
            // We need to do this after the Hot Reloading check above,
            // because hot reloading has different semantics than prod because
            // it doesn't resuspend. So we can't let the call below suspend.
            typeof xi == "object" && xi !== null && xi.$$typeof === fi && J1e(xi) === _n.type) {
              C(qe, _n.sibling);
              var Gs = I(_n, Ke.props);
              return Gs.ref = tM(qe, _n, Ke), Gs.return = qe, Gs._debugSource = Ke._source, Gs._debugOwner = Ke._owner, Gs;
            }
            C(qe, _n);
            break;
          } else
            p(qe, _n);
          _n = _n.sibling;
        }
        if (Ke.type === bs) {
          var rs = wC(Ke.props.children, qe.mode, Pt, Ke.key);
          return rs.return = qe, rs;
        } else {
          var Ua = uJ(Ke, qe.mode, Pt);
          return Ua.ref = tM(qe, gt, Ke), Ua.return = qe, Ua;
        }
      }
      function Or(qe, gt, Ke, Pt) {
        for (var wn = Ke.key, _n = gt; _n !== null; ) {
          if (_n.key === wn)
            if (_n.tag === g && _n.stateNode.containerInfo === Ke.containerInfo && _n.stateNode.implementation === Ke.implementation) {
              C(qe, _n.sibling);
              var xi = I(_n, Ke.children || []);
              return xi.return = qe, xi;
            } else {
              C(qe, _n);
              break;
            }
          else
            p(qe, _n);
          _n = _n.sibling;
        }
        var Vi = hJ(Ke, qe.mode, Pt);
        return Vi.return = qe, Vi;
      }
      function Sr(qe, gt, Ke, Pt) {
        var wn = typeof Ke == "object" && Ke !== null && Ke.type === bs && Ke.key === null;
        if (wn && (Ke = Ke.props.children), typeof Ke == "object" && Ke !== null) {
          switch (Ke.$$typeof) {
            case Eo:
              return W(Xn(qe, gt, Ke, Pt));
            case po:
              return W(Or(qe, gt, Ke, Pt));
            case fi:
              var _n = Ke._payload, xi = Ke._init;
              return Sr(qe, gt, xi(_n), Pt);
          }
          if (Yi(Ke))
            return ft(qe, gt, Ke, Pt);
          if (qn(Ke))
            return un(qe, gt, Ke, Pt);
          m9(qe, Ke);
        }
        return typeof Ke == "string" && Ke !== "" || typeof Ke == "number" ? W(ai(qe, gt, "" + Ke, Pt)) : (typeof Ke == "function" && _9(qe), C(qe, gt));
      }
      return Sr;
    }
    var $D = ewe(!0), twe = ewe(!1);
    function oYe(f, p) {
      if (f !== null && p.child !== f.child)
        throw new Error("Resuming work not yet implemented.");
      if (p.child !== null) {
        var C = p.child, x = eE(C, C.pendingProps);
        for (p.child = x, x.return = p; C.sibling !== null; )
          C = C.sibling, x = x.sibling = eE(C, C.pendingProps), x.return = p;
        x.sibling = null;
      }
    }
    function aYe(f, p) {
      for (var C = f.child; C !== null; )
        KZe(C, p), C = C.sibling;
    }
    var _Z = lC(null), bZ;
    bZ = {};
    var b9 = null, jD = null, vZ = null, v9 = !1;
    function y9() {
      b9 = null, jD = null, vZ = null, v9 = !1;
    }
    function nwe() {
      v9 = !0;
    }
    function iwe() {
      v9 = !1;
    }
    function rwe(f, p, C) {
      Ru(_Z, p._currentValue, f), p._currentValue = C, p._currentRenderer !== void 0 && p._currentRenderer !== null && p._currentRenderer !== bZ && a("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."), p._currentRenderer = bZ;
    }
    function yZ(f, p) {
      var C = _Z.current;
      Nu(_Z, p), f._currentValue = C;
    }
    function CZ(f, p, C) {
      for (var x = f; x !== null; ) {
        var I = x.alternate;
        if (ov(x.childLanes, p) ? I !== null && !ov(I.childLanes, p) && (I.childLanes = Xi(I.childLanes, p)) : (x.childLanes = Xi(x.childLanes, p), I !== null && (I.childLanes = Xi(I.childLanes, p))), x === C)
          break;
        x = x.return;
      }
      x !== C && a("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.");
    }
    function lYe(f, p, C) {
      cYe(f, p, C);
    }
    function cYe(f, p, C) {
      var x = f.child;
      for (x !== null && (x.return = f); x !== null; ) {
        var I = void 0, O = x.dependencies;
        if (O !== null) {
          I = x.child;
          for (var W = O.firstContext; W !== null; ) {
            if (W.context === p) {
              if (x.tag === u) {
                var q = il(C), ee = wv(Is, q);
                ee.tag = w9;
                var ue = x.updateQueue;
                if (ue !== null) {
                  var me = ue.shared, Me = me.pending;
                  Me === null ? ee.next = ee : (ee.next = Me.next, Me.next = ee), me.pending = ee;
                }
              }
              x.lanes = Xi(x.lanes, C);
              var Ae = x.alternate;
              Ae !== null && (Ae.lanes = Xi(Ae.lanes, C)), CZ(x.return, C, f), O.lanes = Xi(O.lanes, C);
              break;
            }
            W = W.next;
          }
        } else if (x.tag === L)
          I = x.type === f.type ? null : x.child;
        else if (x.tag === j) {
          var nt = x.return;
          if (nt === null)
            throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
          nt.lanes = Xi(nt.lanes, C);
          var rt = nt.alternate;
          rt !== null && (rt.lanes = Xi(rt.lanes, C)), CZ(nt, C, f), I = x.sibling;
        } else
          I = x.child;
        if (I !== null)
          I.return = x;
        else
          for (I = x; I !== null; ) {
            if (I === f) {
              I = null;
              break;
            }
            var ft = I.sibling;
            if (ft !== null) {
              ft.return = I.return, I = ft;
              break;
            }
            I = I.return;
          }
        x = I;
      }
    }
    function GD(f, p) {
      b9 = f, jD = null, vZ = null;
      var C = f.dependencies;
      if (C !== null) {
        var x = C.firstContext;
        x !== null && (ku(C.lanes, p) && mM(), C.firstContext = null);
      }
    }
    function sl(f) {
      v9 && a("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
      var p = f._currentValue;
      if (vZ !== f) {
        var C = {
          context: f,
          memoizedValue: p,
          next: null
        };
        if (jD === null) {
          if (b9 === null)
            throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
          jD = C, b9.dependencies = {
            lanes: pt,
            firstContext: C
          };
        } else
          jD = jD.next = C;
      }
      return p;
    }
    var GS = null;
    function wZ(f) {
      GS === null ? GS = [f] : GS.push(f);
    }
    function uYe() {
      if (GS !== null) {
        for (var f = 0; f < GS.length; f++) {
          var p = GS[f], C = p.interleaved;
          if (C !== null) {
            p.interleaved = null;
            var x = C.next, I = p.pending;
            if (I !== null) {
              var O = I.next;
              I.next = x, C.next = O;
            }
            p.pending = C;
          }
        }
        GS = null;
      }
    }
    function swe(f, p, C, x) {
      var I = p.interleaved;
      return I === null ? (C.next = C, wZ(p)) : (C.next = I.next, I.next = C), p.interleaved = C, C9(f, x);
    }
    function dYe(f, p, C, x) {
      var I = p.interleaved;
      I === null ? (C.next = C, wZ(p)) : (C.next = I.next, I.next = C), p.interleaved = C;
    }
    function hYe(f, p, C, x) {
      var I = p.interleaved;
      return I === null ? (C.next = C, wZ(p)) : (C.next = I.next, I.next = C), p.interleaved = C, C9(f, x);
    }
    function ch(f, p) {
      return C9(f, p);
    }
    var fYe = C9;
    function C9(f, p) {
      f.lanes = Xi(f.lanes, p);
      var C = f.alternate;
      C !== null && (C.lanes = Xi(C.lanes, p)), C === null && (f.flags & (qo | Ko)) !== Jn && tEe(f);
      for (var x = f, I = f.return; I !== null; )
        I.childLanes = Xi(I.childLanes, p), C = I.alternate, C !== null ? C.childLanes = Xi(C.childLanes, p) : (I.flags & (qo | Ko)) !== Jn && tEe(f), x = I, I = I.return;
      if (x.tag === h) {
        var O = x.stateNode;
        return O;
      } else
        return null;
    }
    var owe = 0, awe = 1, w9 = 2, SZ = 3, S9 = !1, EZ, E9;
    EZ = !1, E9 = null;
    function xZ(f) {
      var p = {
        baseState: f.memoizedState,
        firstBaseUpdate: null,
        lastBaseUpdate: null,
        shared: {
          pending: null,
          interleaved: null,
          lanes: pt
        },
        effects: null
      };
      f.updateQueue = p;
    }
    function lwe(f, p) {
      var C = p.updateQueue, x = f.updateQueue;
      if (C === x) {
        var I = {
          baseState: x.baseState,
          firstBaseUpdate: x.firstBaseUpdate,
          lastBaseUpdate: x.lastBaseUpdate,
          shared: x.shared,
          effects: x.effects
        };
        p.updateQueue = I;
      }
    }
    function wv(f, p) {
      var C = {
        eventTime: f,
        lane: p,
        tag: owe,
        payload: null,
        callback: null,
        next: null
      };
      return C;
    }
    function hC(f, p, C) {
      var x = f.updateQueue;
      if (x === null)
        return null;
      var I = x.shared;
      if (E9 === I && !EZ && (a("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."), EZ = !0), dZe()) {
        var O = I.pending;
        return O === null ? p.next = p : (p.next = O.next, O.next = p), I.pending = p, fYe(f, C);
      } else
        return hYe(f, I, p, C);
    }
    function x9(f, p, C) {
      var x = p.updateQueue;
      if (x !== null) {
        var I = x.shared;
        if (pO(C)) {
          var O = I.lanes;
          O = dD(O, f.pendingLanes);
          var W = Xi(O, C);
          I.lanes = W, wS(f, W);
        }
      }
    }
    function LZ(f, p) {
      var C = f.updateQueue, x = f.alternate;
      if (x !== null) {
        var I = x.updateQueue;
        if (C === I) {
          var O = null, W = null, q = C.firstBaseUpdate;
          if (q !== null) {
            var ee = q;
            do {
              var ue = {
                eventTime: ee.eventTime,
                lane: ee.lane,
                tag: ee.tag,
                payload: ee.payload,
                callback: ee.callback,
                next: null
              };
              W === null ? O = W = ue : (W.next = ue, W = ue), ee = ee.next;
            } while (ee !== null);
            W === null ? O = W = p : (W.next = p, W = p);
          } else
            O = W = p;
          C = {
            baseState: I.baseState,
            firstBaseUpdate: O,
            lastBaseUpdate: W,
            shared: I.shared,
            effects: I.effects
          }, f.updateQueue = C;
          return;
        }
      }
      var me = C.lastBaseUpdate;
      me === null ? C.firstBaseUpdate = p : me.next = p, C.lastBaseUpdate = p;
    }
    function gYe(f, p, C, x, I, O) {
      switch (C.tag) {
        case awe: {
          var W = C.payload;
          if (typeof W == "function") {
            nwe();
            var q = W.call(O, x, I);
            {
              if (f.mode & zi) {
                Ds(!0);
                try {
                  W.call(O, x, I);
                } finally {
                  Ds(!1);
                }
              }
              iwe();
            }
            return q;
          }
          return W;
        }
        case SZ:
          f.flags = f.flags & ~lc | lr;
        // Intentional fallthrough
        case owe: {
          var ee = C.payload, ue;
          if (typeof ee == "function") {
            nwe(), ue = ee.call(O, x, I);
            {
              if (f.mode & zi) {
                Ds(!0);
                try {
                  ee.call(O, x, I);
                } finally {
                  Ds(!1);
                }
              }
              iwe();
            }
          } else
            ue = ee;
          return ue == null ? x : bn({}, x, ue);
        }
        case w9:
          return S9 = !0, x;
      }
      return x;
    }
    function L9(f, p, C, x) {
      var I = f.updateQueue;
      S9 = !1, E9 = I.shared;
      var O = I.firstBaseUpdate, W = I.lastBaseUpdate, q = I.shared.pending;
      if (q !== null) {
        I.shared.pending = null;
        var ee = q, ue = ee.next;
        ee.next = null, W === null ? O = ue : W.next = ue, W = ee;
        var me = f.alternate;
        if (me !== null) {
          var Me = me.updateQueue, Ae = Me.lastBaseUpdate;
          Ae !== W && (Ae === null ? Me.firstBaseUpdate = ue : Ae.next = ue, Me.lastBaseUpdate = ee);
        }
      }
      if (O !== null) {
        var nt = I.baseState, rt = pt, ft = null, un = null, ai = null, Xn = O;
        do {
          var Or = Xn.lane, Sr = Xn.eventTime;
          if (ov(x, Or)) {
            if (ai !== null) {
              var gt = {
                eventTime: Sr,
                // This update is going to be committed so we never want uncommit
                // it. Using NoLane works because 0 is a subset of all bitmasks, so
                // this will never be skipped by the check above.
                lane: Ea,
                tag: Xn.tag,
                payload: Xn.payload,
                callback: Xn.callback,
                next: null
              };
              ai = ai.next = gt;
            }
            nt = gYe(f, I, Xn, nt, p, C);
            var Ke = Xn.callback;
            if (Ke !== null && // If the update was already committed, we should not queue its
            // callback again.
            Xn.lane !== Ea) {
              f.flags |= oo;
              var Pt = I.effects;
              Pt === null ? I.effects = [Xn] : Pt.push(Xn);
            }
          } else {
            var qe = {
              eventTime: Sr,
              lane: Or,
              tag: Xn.tag,
              payload: Xn.payload,
              callback: Xn.callback,
              next: null
            };
            ai === null ? (un = ai = qe, ft = nt) : ai = ai.next = qe, rt = Xi(rt, Or);
          }
          if (Xn = Xn.next, Xn === null) {
            if (q = I.shared.pending, q === null)
              break;
            var wn = q, _n = wn.next;
            wn.next = null, Xn = _n, I.lastBaseUpdate = wn, I.shared.pending = null;
          }
        } while (!0);
        ai === null && (ft = nt), I.baseState = ft, I.firstBaseUpdate = un, I.lastBaseUpdate = ai;
        var xi = I.shared.interleaved;
        if (xi !== null) {
          var Vi = xi;
          do
            rt = Xi(rt, Vi.lane), Vi = Vi.next;
          while (Vi !== xi);
        } else O === null && (I.shared.lanes = pt);
        kM(rt), f.lanes = rt, f.memoizedState = nt;
      }
      E9 = null;
    }
    function pYe(f, p) {
      if (typeof f != "function")
        throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + f));
      f.call(p);
    }
    function cwe() {
      S9 = !1;
    }
    function T9() {
      return S9;
    }
    function uwe(f, p, C) {
      var x = p.effects;
      if (p.effects = null, x !== null)
        for (var I = 0; I < x.length; I++) {
          var O = x[I], W = O.callback;
          W !== null && (O.callback = null, pYe(W, C));
        }
    }
    var nM = {}, fC = lC(nM), iM = lC(nM), k9 = lC(nM);
    function D9(f) {
      if (f === nM)
        throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
      return f;
    }
    function dwe() {
      var f = D9(k9.current);
      return f;
    }
    function TZ(f, p) {
      Ru(k9, p, f), Ru(iM, f, f), Ru(fC, nM, f);
      var C = Rqe(p);
      Nu(fC, f), Ru(fC, C, f);
    }
    function qD(f) {
      Nu(fC, f), Nu(iM, f), Nu(k9, f);
    }
    function kZ() {
      var f = D9(fC.current);
      return f;
    }
    function hwe(f) {
      D9(k9.current);
      var p = D9(fC.current), C = Aqe(p, f.type);
      p !== C && (Ru(iM, f, f), Ru(fC, C, f));
    }
    function DZ(f) {
      iM.current === f && (Nu(fC, f), Nu(iM, f));
    }
    var mYe = 0, fwe = 1, gwe = 1, rM = 2, _p = lC(mYe);
    function IZ(f, p) {
      return (f & p) !== 0;
    }
    function KD(f) {
      return f & fwe;
    }
    function NZ(f, p) {
      return f & fwe | p;
    }
    function _Ye(f, p) {
      return f | p;
    }
    function gC(f, p) {
      Ru(_p, p, f);
    }
    function YD(f) {
      Nu(_p, f);
    }
    function bYe(f, p) {
      var C = f.memoizedState;
      return C !== null ? C.dehydrated !== null : (f.memoizedProps, !0);
    }
    function I9(f) {
      for (var p = f; p !== null; ) {
        if (p.tag === N) {
          var C = p.memoizedState;
          if (C !== null) {
            var x = C.dehydrated;
            if (x === null || N1e(x) || YX(x))
              return p;
          }
        } else if (p.tag === K && // revealOrder undefined can't be trusted because it don't
        // keep track of whether it suspended or not.
        p.memoizedProps.revealOrder !== void 0) {
          var I = (p.flags & lr) !== Jn;
          if (I)
            return p;
        } else if (p.child !== null) {
          p.child.return = p, p = p.child;
          continue;
        }
        if (p === f)
          return null;
        for (; p.sibling === null; ) {
          if (p.return === null || p.return === f)
            return null;
          p = p.return;
        }
        p.sibling.return = p.return, p = p.sibling;
      }
      return null;
    }
    var uh = (
      /*   */
      0
    ), Rl = (
      /* */
      1
    ), n_ = (
      /*  */
      2
    ), Al = (
      /*    */
      4
    ), Vc = (
      /*   */
      8
    ), RZ = [];
    function AZ() {
      for (var f = 0; f < RZ.length; f++) {
        var p = RZ[f];
        p._workInProgressVersionPrimary = null;
      }
      RZ.length = 0;
    }
    function vYe(f, p) {
      var C = p._getVersion, x = C(p._source);
      f.mutableSourceEagerHydrationData == null ? f.mutableSourceEagerHydrationData = [p, x] : f.mutableSourceEagerHydrationData.push(p, x);
    }
    var Cn = n.ReactCurrentDispatcher, sM = n.ReactCurrentBatchConfig, OZ, XD;
    OZ = /* @__PURE__ */ new Set();
    var qS = pt, js = null, Ol = null, Ml = null, N9 = !1, oM = !1, aM = 0, yYe = 0, CYe = 25, _t = null, vg = null, pC = -1, MZ = !1;
    function ws() {
      {
        var f = _t;
        vg === null ? vg = [f] : vg.push(f);
      }
    }
    function rn() {
      {
        var f = _t;
        vg !== null && (pC++, vg[pC] !== f && wYe(f));
      }
    }
    function ZD(f) {
      f != null && !Yi(f) && a("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", _t, typeof f);
    }
    function wYe(f) {
      {
        var p = Ai(js);
        if (!OZ.has(p) && (OZ.add(p), vg !== null)) {
          for (var C = "", x = 30, I = 0; I <= pC; I++) {
            for (var O = vg[I], W = I === pC ? f : O, q = I + 1 + ". " + O; q.length < x; )
              q += " ";
            q += W + `
`, C += q;
          }
          a(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
%s   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`, p, C);
        }
      }
    }
    function Au() {
      throw new Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`);
    }
    function PZ(f, p) {
      if (MZ)
        return !1;
      if (p === null)
        return a("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", _t), !1;
      f.length !== p.length && a(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.

Previous: %s
Incoming: %s`, _t, "[" + p.join(", ") + "]", "[" + f.join(", ") + "]");
      for (var C = 0; C < p.length && C < f.length; C++)
        if (!mn(f[C], p[C]))
          return !1;
      return !0;
    }
    function QD(f, p, C, x, I, O) {
      qS = O, js = p, vg = f !== null ? f._debugHookTypes : null, pC = -1, MZ = f !== null && f.type !== p.type, p.memoizedState = null, p.updateQueue = null, p.lanes = pt, f !== null && f.memoizedState !== null ? Cn.current = Pwe : vg !== null ? Cn.current = Mwe : Cn.current = Owe;
      var W = C(x, I);
      if (oM) {
        var q = 0;
        do {
          if (oM = !1, aM = 0, q >= CYe)
            throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
          q += 1, MZ = !1, Ol = null, Ml = null, p.updateQueue = null, pC = -1, Cn.current = Fwe, W = C(x, I);
        } while (oM);
      }
      Cn.current = $9, p._debugHookTypes = vg;
      var ee = Ol !== null && Ol.next !== null;
      if (qS = pt, js = null, Ol = null, Ml = null, _t = null, vg = null, pC = -1, f !== null && (f.flags & Sa) !== (p.flags & Sa) && // Disable this warning in legacy mode, because legacy Suspense is weird
      // and creates false positives. To make this work in legacy mode, we'd
      // need to mark fibers that commit in an incomplete state, somehow. For
      // now I'll disable the warning that most of the bugs that would trigger
      // it are either exclusive to concurrent mode or exist in both.
      (f.mode & gr) !== ei && a("Internal React error: Expected static flag was missing. Please notify the React team."), N9 = !1, ee)
        throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
      return W;
    }
    function JD() {
      var f = aM !== 0;
      return aM = 0, f;
    }
    function pwe(f, p, C) {
      p.updateQueue = f.updateQueue, (p.mode & $s) !== ei ? p.flags &= -50333701 : p.flags &= -2053, f.lanes = CS(f.lanes, C);
    }
    function mwe() {
      if (Cn.current = $9, N9) {
        for (var f = js.memoizedState; f !== null; ) {
          var p = f.queue;
          p !== null && (p.pending = null), f = f.next;
        }
        N9 = !1;
      }
      qS = pt, js = null, Ol = null, Ml = null, vg = null, pC = -1, _t = null, Dwe = !1, oM = !1, aM = 0;
    }
    function i_() {
      var f = {
        memoizedState: null,
        baseState: null,
        baseQueue: null,
        queue: null,
        next: null
      };
      return Ml === null ? js.memoizedState = Ml = f : Ml = Ml.next = f, Ml;
    }
    function yg() {
      var f;
      if (Ol === null) {
        var p = js.alternate;
        p !== null ? f = p.memoizedState : f = null;
      } else
        f = Ol.next;
      var C;
      if (Ml === null ? C = js.memoizedState : C = Ml.next, C !== null)
        Ml = C, C = Ml.next, Ol = f;
      else {
        if (f === null)
          throw new Error("Rendered more hooks than during the previous render.");
        Ol = f;
        var x = {
          memoizedState: Ol.memoizedState,
          baseState: Ol.baseState,
          baseQueue: Ol.baseQueue,
          queue: Ol.queue,
          next: null
        };
        Ml === null ? js.memoizedState = Ml = x : Ml = Ml.next = x;
      }
      return Ml;
    }
    function _we() {
      return {
        lastEffect: null,
        stores: null
      };
    }
    function FZ(f, p) {
      return typeof p == "function" ? p(f) : p;
    }
    function BZ(f, p, C) {
      var x = i_(), I;
      C !== void 0 ? I = C(p) : I = p, x.memoizedState = x.baseState = I;
      var O = {
        pending: null,
        interleaved: null,
        lanes: pt,
        dispatch: null,
        lastRenderedReducer: f,
        lastRenderedState: I
      };
      x.queue = O;
      var W = O.dispatch = LYe.bind(null, js, O);
      return [x.memoizedState, W];
    }
    function HZ(f, p, C) {
      var x = yg(), I = x.queue;
      if (I === null)
        throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
      I.lastRenderedReducer = f;
      var O = Ol, W = O.baseQueue, q = I.pending;
      if (q !== null) {
        if (W !== null) {
          var ee = W.next, ue = q.next;
          W.next = ue, q.next = ee;
        }
        O.baseQueue !== W && a("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."), O.baseQueue = W = q, I.pending = null;
      }
      if (W !== null) {
        var me = W.next, Me = O.baseState, Ae = null, nt = null, rt = null, ft = me;
        do {
          var un = ft.lane;
          if (ov(qS, un)) {
            if (rt !== null) {
              var Xn = {
                // This update is going to be committed so we never want uncommit
                // it. Using NoLane works because 0 is a subset of all bitmasks, so
                // this will never be skipped by the check above.
                lane: Ea,
                action: ft.action,
                hasEagerState: ft.hasEagerState,
                eagerState: ft.eagerState,
                next: null
              };
              rt = rt.next = Xn;
            }
            if (ft.hasEagerState)
              Me = ft.eagerState;
            else {
              var Or = ft.action;
              Me = f(Me, Or);
            }
          } else {
            var ai = {
              lane: un,
              action: ft.action,
              hasEagerState: ft.hasEagerState,
              eagerState: ft.eagerState,
              next: null
            };
            rt === null ? (nt = rt = ai, Ae = Me) : rt = rt.next = ai, js.lanes = Xi(js.lanes, un), kM(un);
          }
          ft = ft.next;
        } while (ft !== null && ft !== me);
        rt === null ? Ae = Me : rt.next = nt, mn(Me, x.memoizedState) || mM(), x.memoizedState = Me, x.baseState = Ae, x.baseQueue = rt, I.lastRenderedState = Me;
      }
      var Sr = I.interleaved;
      if (Sr !== null) {
        var qe = Sr;
        do {
          var gt = qe.lane;
          js.lanes = Xi(js.lanes, gt), kM(gt), qe = qe.next;
        } while (qe !== Sr);
      } else W === null && (I.lanes = pt);
      var Ke = I.dispatch;
      return [x.memoizedState, Ke];
    }
    function WZ(f, p, C) {
      var x = yg(), I = x.queue;
      if (I === null)
        throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");
      I.lastRenderedReducer = f;
      var O = I.dispatch, W = I.pending, q = x.memoizedState;
      if (W !== null) {
        I.pending = null;
        var ee = W.next, ue = ee;
        do {
          var me = ue.action;
          q = f(q, me), ue = ue.next;
        } while (ue !== ee);
        mn(q, x.memoizedState) || mM(), x.memoizedState = q, x.baseQueue === null && (x.baseState = q), I.lastRenderedState = q;
      }
      return [q, O];
    }
    function $rn(f, p, C) {
    }
    function jrn(f, p, C) {
    }
    function VZ(f, p, C) {
      var x = js, I = i_(), O, W = Wc();
      if (W) {
        if (C === void 0)
          throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
        O = C(), XD || O !== C() && (a("The result of getServerSnapshot should be cached to avoid an infinite loop"), XD = !0);
      } else {
        if (O = p(), !XD) {
          var q = p();
          mn(O, q) || (a("The result of getSnapshot should be cached to avoid an infinite loop"), XD = !0);
        }
        var ee = c7();
        if (ee === null)
          throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
        yS(ee, qS) || bwe(x, p, O);
      }
      I.memoizedState = O;
      var ue = {
        value: O,
        getSnapshot: p
      };
      return I.queue = ue, P9(ywe.bind(null, x, ue, f), [f]), x.flags |= dd, lM(Rl | Vc, vwe.bind(null, x, ue, O, p), void 0, null), O;
    }
    function R9(f, p, C) {
      var x = js, I = yg(), O = p();
      if (!XD) {
        var W = p();
        mn(O, W) || (a("The result of getSnapshot should be cached to avoid an infinite loop"), XD = !0);
      }
      var q = I.memoizedState, ee = !mn(q, O);
      ee && (I.memoizedState = O, mM());
      var ue = I.queue;
      if (uM(ywe.bind(null, x, ue, f), [f]), ue.getSnapshot !== p || ee || // Check if the susbcribe function changed. We can save some memory by
      // checking whether we scheduled a subscription effect above.
      Ml !== null && Ml.memoizedState.tag & Rl) {
        x.flags |= dd, lM(Rl | Vc, vwe.bind(null, x, ue, O, p), void 0, null);
        var me = c7();
        if (me === null)
          throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
        yS(me, qS) || bwe(x, p, O);
      }
      return O;
    }
    function bwe(f, p, C) {
      f.flags |= Hk;
      var x = {
        getSnapshot: p,
        value: C
      }, I = js.updateQueue;
      if (I === null)
        I = _we(), js.updateQueue = I, I.stores = [x];
      else {
        var O = I.stores;
        O === null ? I.stores = [x] : O.push(x);
      }
    }
    function vwe(f, p, C, x) {
      p.value = C, p.getSnapshot = x, Cwe(p) && wwe(f);
    }
    function ywe(f, p, C) {
      var x = function() {
        Cwe(p) && wwe(f);
      };
      return C(x);
    }
    function Cwe(f) {
      var p = f.getSnapshot, C = f.value;
      try {
        var x = p();
        return !mn(C, x);
      } catch {
        return !0;
      }
    }
    function wwe(f) {
      var p = ch(f, Ci);
      p !== null && Hl(p, f, Ci, Is);
    }
    function A9(f) {
      var p = i_();
      typeof f == "function" && (f = f()), p.memoizedState = p.baseState = f;
      var C = {
        pending: null,
        interleaved: null,
        lanes: pt,
        dispatch: null,
        lastRenderedReducer: FZ,
        lastRenderedState: f
      };
      p.queue = C;
      var x = C.dispatch = TYe.bind(null, js, C);
      return [p.memoizedState, x];
    }
    function UZ(f) {
      return HZ(FZ);
    }
    function zZ(f) {
      return WZ(FZ);
    }
    function lM(f, p, C, x) {
      var I = {
        tag: f,
        create: p,
        destroy: C,
        deps: x,
        // Circular
        next: null
      }, O = js.updateQueue;
      if (O === null)
        O = _we(), js.updateQueue = O, O.lastEffect = I.next = I;
      else {
        var W = O.lastEffect;
        if (W === null)
          O.lastEffect = I.next = I;
        else {
          var q = W.next;
          W.next = I, I.next = q, O.lastEffect = I;
        }
      }
      return I;
    }
    function $Z(f) {
      var p = i_();
      {
        var C = {
          current: f
        };
        return p.memoizedState = C, C;
      }
    }
    function O9(f) {
      var p = yg();
      return p.memoizedState;
    }
    function cM(f, p, C, x) {
      var I = i_(), O = x === void 0 ? null : x;
      js.flags |= f, I.memoizedState = lM(Rl | p, C, void 0, O);
    }
    function M9(f, p, C, x) {
      var I = yg(), O = x === void 0 ? null : x, W = void 0;
      if (Ol !== null) {
        var q = Ol.memoizedState;
        if (W = q.destroy, O !== null) {
          var ee = q.deps;
          if (PZ(O, ee)) {
            I.memoizedState = lM(p, C, W, O);
            return;
          }
        }
      }
      js.flags |= f, I.memoizedState = lM(Rl | p, C, W, O);
    }
    function P9(f, p) {
      return (js.mode & $s) !== ei ? cM(Pm | dd | Y2, Vc, f, p) : cM(dd | Y2, Vc, f, p);
    }
    function uM(f, p) {
      return M9(dd, Vc, f, p);
    }
    function jZ(f, p) {
      return cM(_r, n_, f, p);
    }
    function F9(f, p) {
      return M9(_r, n_, f, p);
    }
    function GZ(f, p) {
      var C = _r;
      return C |= Mm, (js.mode & $s) !== ei && (C |= Pc), cM(C, Al, f, p);
    }
    function B9(f, p) {
      return M9(_r, Al, f, p);
    }
    function Swe(f, p) {
      if (typeof p == "function") {
        var C = p, x = f();
        return C(x), function() {
          C(null);
        };
      } else if (p != null) {
        var I = p;
        I.hasOwnProperty("current") || a("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(I).join(", ") + "}");
        var O = f();
        return I.current = O, function() {
          I.current = null;
        };
      }
    }
    function qZ(f, p, C) {
      typeof p != "function" && a("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", p !== null ? typeof p : "null");
      var x = C != null ? C.concat([f]) : null, I = _r;
      return I |= Mm, (js.mode & $s) !== ei && (I |= Pc), cM(I, Al, Swe.bind(null, p, f), x);
    }
    function H9(f, p, C) {
      typeof p != "function" && a("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", p !== null ? typeof p : "null");
      var x = C != null ? C.concat([f]) : null;
      return M9(_r, Al, Swe.bind(null, p, f), x);
    }
    function SYe(f, p) {
    }
    var W9 = SYe;
    function KZ(f, p) {
      var C = i_(), x = p === void 0 ? null : p;
      return C.memoizedState = [f, x], f;
    }
    function V9(f, p) {
      var C = yg(), x = p === void 0 ? null : p, I = C.memoizedState;
      if (I !== null && x !== null) {
        var O = I[1];
        if (PZ(x, O))
          return I[0];
      }
      return C.memoizedState = [f, x], f;
    }
    function YZ(f, p) {
      var C = i_(), x = p === void 0 ? null : p, I = f();
      return C.memoizedState = [I, x], I;
    }
    function U9(f, p) {
      var C = yg(), x = p === void 0 ? null : p, I = C.memoizedState;
      if (I !== null && x !== null) {
        var O = I[1];
        if (PZ(x, O))
          return I[0];
      }
      var W = f();
      return C.memoizedState = [W, x], W;
    }
    function XZ(f) {
      var p = i_();
      return p.memoizedState = f, f;
    }
    function Ewe(f) {
      var p = yg(), C = Ol, x = C.memoizedState;
      return Lwe(p, x, f);
    }
    function xwe(f) {
      var p = yg();
      if (Ol === null)
        return p.memoizedState = f, f;
      var C = Ol.memoizedState;
      return Lwe(p, C, f);
    }
    function Lwe(f, p, C) {
      var x = !gO(qS);
      if (x) {
        if (!mn(C, p)) {
          var I = mO();
          js.lanes = Xi(js.lanes, I), kM(I), f.baseState = !0;
        }
        return p;
      } else
        return f.baseState && (f.baseState = !1, mM()), f.memoizedState = C, C;
    }
    function EYe(f, p, C) {
      var x = fd();
      Ha(SS(x, rh)), f(!0);
      var I = sM.transition;
      sM.transition = {};
      var O = sM.transition;
      sM.transition._updatedFibers = /* @__PURE__ */ new Set();
      try {
        f(!1), p();
      } finally {
        if (Ha(x), sM.transition = I, I === null && O._updatedFibers) {
          var W = O._updatedFibers.size;
          W > 10 && o("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), O._updatedFibers.clear();
        }
      }
    }
    function ZZ() {
      var f = A9(!1), p = f[0], C = f[1], x = EYe.bind(null, C), I = i_();
      return I.memoizedState = x, [p, x];
    }
    function Twe() {
      var f = UZ(), p = f[0], C = yg(), x = C.memoizedState;
      return [p, x];
    }
    function kwe() {
      var f = zZ(), p = f[0], C = yg(), x = C.memoizedState;
      return [p, x];
    }
    var Dwe = !1;
    function xYe() {
      return Dwe;
    }
    function QZ() {
      var f = i_(), p = c7(), C = p.identifierPrefix, x;
      if (Wc()) {
        var I = UKe();
        x = ":" + C + "R" + I;
        var O = aM++;
        O > 0 && (x += "H" + O.toString(32)), x += ":";
      } else {
        var W = yYe++;
        x = ":" + C + "r" + W.toString(32) + ":";
      }
      return f.memoizedState = x, x;
    }
    function z9() {
      var f = yg(), p = f.memoizedState;
      return p;
    }
    function LYe(f, p, C) {
      typeof arguments[3] == "function" && a("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
      var x = yC(f), I = {
        lane: x,
        action: C,
        hasEagerState: !1,
        eagerState: null,
        next: null
      };
      if (Iwe(f))
        Nwe(p, I);
      else {
        var O = swe(f, p, I, x);
        if (O !== null) {
          var W = vd();
          Hl(O, f, x, W), Rwe(O, p, x);
        }
      }
      Awe(f, x);
    }
    function TYe(f, p, C) {
      typeof arguments[3] == "function" && a("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");
      var x = yC(f), I = {
        lane: x,
        action: C,
        hasEagerState: !1,
        eagerState: null,
        next: null
      };
      if (Iwe(f))
        Nwe(p, I);
      else {
        var O = f.alternate;
        if (f.lanes === pt && (O === null || O.lanes === pt)) {
          var W = p.lastRenderedReducer;
          if (W !== null) {
            var q;
            q = Cn.current, Cn.current = bp;
            try {
              var ee = p.lastRenderedState, ue = W(ee, C);
              if (I.hasEagerState = !0, I.eagerState = ue, mn(ue, ee)) {
                dYe(f, p, I, x);
                return;
              }
            } catch {
            } finally {
              Cn.current = q;
            }
          }
        }
        var me = swe(f, p, I, x);
        if (me !== null) {
          var Me = vd();
          Hl(me, f, x, Me), Rwe(me, p, x);
        }
      }
      Awe(f, x);
    }
    function Iwe(f) {
      var p = f.alternate;
      return f === js || p !== null && p === js;
    }
    function Nwe(f, p) {
      oM = N9 = !0;
      var C = f.pending;
      C === null ? p.next = p : (p.next = C.next, C.next = p), f.pending = p;
    }
    function Rwe(f, p, C) {
      if (pO(C)) {
        var x = p.lanes;
        x = dD(x, f.pendingLanes);
        var I = Xi(x, C);
        p.lanes = I, wS(f, I);
      }
    }
    function Awe(f, p, C) {
      hS(f, p);
    }
    var $9 = {
      readContext: sl,
      useCallback: Au,
      useContext: Au,
      useEffect: Au,
      useImperativeHandle: Au,
      useInsertionEffect: Au,
      useLayoutEffect: Au,
      useMemo: Au,
      useReducer: Au,
      useRef: Au,
      useState: Au,
      useDebugValue: Au,
      useDeferredValue: Au,
      useTransition: Au,
      useMutableSource: Au,
      useSyncExternalStore: Au,
      useId: Au,
      unstable_isNewReconciler: pe
    }, Owe = null, Mwe = null, Pwe = null, Fwe = null, r_ = null, bp = null, j9 = null;
    {
      var JZ = function() {
        a("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
      }, Hi = function() {
        a("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks");
      };
      Owe = {
        readContext: function(f) {
          return sl(f);
        },
        useCallback: function(f, p) {
          return _t = "useCallback", ws(), ZD(p), KZ(f, p);
        },
        useContext: function(f) {
          return _t = "useContext", ws(), sl(f);
        },
        useEffect: function(f, p) {
          return _t = "useEffect", ws(), ZD(p), P9(f, p);
        },
        useImperativeHandle: function(f, p, C) {
          return _t = "useImperativeHandle", ws(), ZD(C), qZ(f, p, C);
        },
        useInsertionEffect: function(f, p) {
          return _t = "useInsertionEffect", ws(), ZD(p), jZ(f, p);
        },
        useLayoutEffect: function(f, p) {
          return _t = "useLayoutEffect", ws(), ZD(p), GZ(f, p);
        },
        useMemo: function(f, p) {
          _t = "useMemo", ws(), ZD(p);
          var C = Cn.current;
          Cn.current = r_;
          try {
            return YZ(f, p);
          } finally {
            Cn.current = C;
          }
        },
        useReducer: function(f, p, C) {
          _t = "useReducer", ws();
          var x = Cn.current;
          Cn.current = r_;
          try {
            return BZ(f, p, C);
          } finally {
            Cn.current = x;
          }
        },
        useRef: function(f) {
          return _t = "useRef", ws(), $Z(f);
        },
        useState: function(f) {
          _t = "useState", ws();
          var p = Cn.current;
          Cn.current = r_;
          try {
            return A9(f);
          } finally {
            Cn.current = p;
          }
        },
        useDebugValue: function(f, p) {
          return _t = "useDebugValue", ws(), void 0;
        },
        useDeferredValue: function(f) {
          return _t = "useDeferredValue", ws(), XZ(f);
        },
        useTransition: function() {
          return _t = "useTransition", ws(), ZZ();
        },
        useMutableSource: function(f, p, C) {
          return _t = "useMutableSource", ws(), void 0;
        },
        useSyncExternalStore: function(f, p, C) {
          return _t = "useSyncExternalStore", ws(), VZ(f, p, C);
        },
        useId: function() {
          return _t = "useId", ws(), QZ();
        },
        unstable_isNewReconciler: pe
      }, Mwe = {
        readContext: function(f) {
          return sl(f);
        },
        useCallback: function(f, p) {
          return _t = "useCallback", rn(), KZ(f, p);
        },
        useContext: function(f) {
          return _t = "useContext", rn(), sl(f);
        },
        useEffect: function(f, p) {
          return _t = "useEffect", rn(), P9(f, p);
        },
        useImperativeHandle: function(f, p, C) {
          return _t = "useImperativeHandle", rn(), qZ(f, p, C);
        },
        useInsertionEffect: function(f, p) {
          return _t = "useInsertionEffect", rn(), jZ(f, p);
        },
        useLayoutEffect: function(f, p) {
          return _t = "useLayoutEffect", rn(), GZ(f, p);
        },
        useMemo: function(f, p) {
          _t = "useMemo", rn();
          var C = Cn.current;
          Cn.current = r_;
          try {
            return YZ(f, p);
          } finally {
            Cn.current = C;
          }
        },
        useReducer: function(f, p, C) {
          _t = "useReducer", rn();
          var x = Cn.current;
          Cn.current = r_;
          try {
            return BZ(f, p, C);
          } finally {
            Cn.current = x;
          }
        },
        useRef: function(f) {
          return _t = "useRef", rn(), $Z(f);
        },
        useState: function(f) {
          _t = "useState", rn();
          var p = Cn.current;
          Cn.current = r_;
          try {
            return A9(f);
          } finally {
            Cn.current = p;
          }
        },
        useDebugValue: function(f, p) {
          return _t = "useDebugValue", rn(), void 0;
        },
        useDeferredValue: function(f) {
          return _t = "useDeferredValue", rn(), XZ(f);
        },
        useTransition: function() {
          return _t = "useTransition", rn(), ZZ();
        },
        useMutableSource: function(f, p, C) {
          return _t = "useMutableSource", rn(), void 0;
        },
        useSyncExternalStore: function(f, p, C) {
          return _t = "useSyncExternalStore", rn(), VZ(f, p, C);
        },
        useId: function() {
          return _t = "useId", rn(), QZ();
        },
        unstable_isNewReconciler: pe
      }, Pwe = {
        readContext: function(f) {
          return sl(f);
        },
        useCallback: function(f, p) {
          return _t = "useCallback", rn(), V9(f, p);
        },
        useContext: function(f) {
          return _t = "useContext", rn(), sl(f);
        },
        useEffect: function(f, p) {
          return _t = "useEffect", rn(), uM(f, p);
        },
        useImperativeHandle: function(f, p, C) {
          return _t = "useImperativeHandle", rn(), H9(f, p, C);
        },
        useInsertionEffect: function(f, p) {
          return _t = "useInsertionEffect", rn(), F9(f, p);
        },
        useLayoutEffect: function(f, p) {
          return _t = "useLayoutEffect", rn(), B9(f, p);
        },
        useMemo: function(f, p) {
          _t = "useMemo", rn();
          var C = Cn.current;
          Cn.current = bp;
          try {
            return U9(f, p);
          } finally {
            Cn.current = C;
          }
        },
        useReducer: function(f, p, C) {
          _t = "useReducer", rn();
          var x = Cn.current;
          Cn.current = bp;
          try {
            return HZ(f, p, C);
          } finally {
            Cn.current = x;
          }
        },
        useRef: function(f) {
          return _t = "useRef", rn(), O9();
        },
        useState: function(f) {
          _t = "useState", rn();
          var p = Cn.current;
          Cn.current = bp;
          try {
            return UZ(f);
          } finally {
            Cn.current = p;
          }
        },
        useDebugValue: function(f, p) {
          return _t = "useDebugValue", rn(), W9();
        },
        useDeferredValue: function(f) {
          return _t = "useDeferredValue", rn(), Ewe(f);
        },
        useTransition: function() {
          return _t = "useTransition", rn(), Twe();
        },
        useMutableSource: function(f, p, C) {
          return _t = "useMutableSource", rn(), void 0;
        },
        useSyncExternalStore: function(f, p, C) {
          return _t = "useSyncExternalStore", rn(), R9(f, p);
        },
        useId: function() {
          return _t = "useId", rn(), z9();
        },
        unstable_isNewReconciler: pe
      }, Fwe = {
        readContext: function(f) {
          return sl(f);
        },
        useCallback: function(f, p) {
          return _t = "useCallback", rn(), V9(f, p);
        },
        useContext: function(f) {
          return _t = "useContext", rn(), sl(f);
        },
        useEffect: function(f, p) {
          return _t = "useEffect", rn(), uM(f, p);
        },
        useImperativeHandle: function(f, p, C) {
          return _t = "useImperativeHandle", rn(), H9(f, p, C);
        },
        useInsertionEffect: function(f, p) {
          return _t = "useInsertionEffect", rn(), F9(f, p);
        },
        useLayoutEffect: function(f, p) {
          return _t = "useLayoutEffect", rn(), B9(f, p);
        },
        useMemo: function(f, p) {
          _t = "useMemo", rn();
          var C = Cn.current;
          Cn.current = j9;
          try {
            return U9(f, p);
          } finally {
            Cn.current = C;
          }
        },
        useReducer: function(f, p, C) {
          _t = "useReducer", rn();
          var x = Cn.current;
          Cn.current = j9;
          try {
            return WZ(f, p, C);
          } finally {
            Cn.current = x;
          }
        },
        useRef: function(f) {
          return _t = "useRef", rn(), O9();
        },
        useState: function(f) {
          _t = "useState", rn();
          var p = Cn.current;
          Cn.current = j9;
          try {
            return zZ(f);
          } finally {
            Cn.current = p;
          }
        },
        useDebugValue: function(f, p) {
          return _t = "useDebugValue", rn(), W9();
        },
        useDeferredValue: function(f) {
          return _t = "useDeferredValue", rn(), xwe(f);
        },
        useTransition: function() {
          return _t = "useTransition", rn(), kwe();
        },
        useMutableSource: function(f, p, C) {
          return _t = "useMutableSource", rn(), void 0;
        },
        useSyncExternalStore: function(f, p, C) {
          return _t = "useSyncExternalStore", rn(), R9(f, p);
        },
        useId: function() {
          return _t = "useId", rn(), z9();
        },
        unstable_isNewReconciler: pe
      }, r_ = {
        readContext: function(f) {
          return JZ(), sl(f);
        },
        useCallback: function(f, p) {
          return _t = "useCallback", Hi(), ws(), KZ(f, p);
        },
        useContext: function(f) {
          return _t = "useContext", Hi(), ws(), sl(f);
        },
        useEffect: function(f, p) {
          return _t = "useEffect", Hi(), ws(), P9(f, p);
        },
        useImperativeHandle: function(f, p, C) {
          return _t = "useImperativeHandle", Hi(), ws(), qZ(f, p, C);
        },
        useInsertionEffect: function(f, p) {
          return _t = "useInsertionEffect", Hi(), ws(), jZ(f, p);
        },
        useLayoutEffect: function(f, p) {
          return _t = "useLayoutEffect", Hi(), ws(), GZ(f, p);
        },
        useMemo: function(f, p) {
          _t = "useMemo", Hi(), ws();
          var C = Cn.current;
          Cn.current = r_;
          try {
            return YZ(f, p);
          } finally {
            Cn.current = C;
          }
        },
        useReducer: function(f, p, C) {
          _t = "useReducer", Hi(), ws();
          var x = Cn.current;
          Cn.current = r_;
          try {
            return BZ(f, p, C);
          } finally {
            Cn.current = x;
          }
        },
        useRef: function(f) {
          return _t = "useRef", Hi(), ws(), $Z(f);
        },
        useState: function(f) {
          _t = "useState", Hi(), ws();
          var p = Cn.current;
          Cn.current = r_;
          try {
            return A9(f);
          } finally {
            Cn.current = p;
          }
        },
        useDebugValue: function(f, p) {
          return _t = "useDebugValue", Hi(), ws(), void 0;
        },
        useDeferredValue: function(f) {
          return _t = "useDeferredValue", Hi(), ws(), XZ(f);
        },
        useTransition: function() {
          return _t = "useTransition", Hi(), ws(), ZZ();
        },
        useMutableSource: function(f, p, C) {
          return _t = "useMutableSource", Hi(), ws(), void 0;
        },
        useSyncExternalStore: function(f, p, C) {
          return _t = "useSyncExternalStore", Hi(), ws(), VZ(f, p, C);
        },
        useId: function() {
          return _t = "useId", Hi(), ws(), QZ();
        },
        unstable_isNewReconciler: pe
      }, bp = {
        readContext: function(f) {
          return JZ(), sl(f);
        },
        useCallback: function(f, p) {
          return _t = "useCallback", Hi(), rn(), V9(f, p);
        },
        useContext: function(f) {
          return _t = "useContext", Hi(), rn(), sl(f);
        },
        useEffect: function(f, p) {
          return _t = "useEffect", Hi(), rn(), uM(f, p);
        },
        useImperativeHandle: function(f, p, C) {
          return _t = "useImperativeHandle", Hi(), rn(), H9(f, p, C);
        },
        useInsertionEffect: function(f, p) {
          return _t = "useInsertionEffect", Hi(), rn(), F9(f, p);
        },
        useLayoutEffect: function(f, p) {
          return _t = "useLayoutEffect", Hi(), rn(), B9(f, p);
        },
        useMemo: function(f, p) {
          _t = "useMemo", Hi(), rn();
          var C = Cn.current;
          Cn.current = bp;
          try {
            return U9(f, p);
          } finally {
            Cn.current = C;
          }
        },
        useReducer: function(f, p, C) {
          _t = "useReducer", Hi(), rn();
          var x = Cn.current;
          Cn.current = bp;
          try {
            return HZ(f, p, C);
          } finally {
            Cn.current = x;
          }
        },
        useRef: function(f) {
          return _t = "useRef", Hi(), rn(), O9();
        },
        useState: function(f) {
          _t = "useState", Hi(), rn();
          var p = Cn.current;
          Cn.current = bp;
          try {
            return UZ(f);
          } finally {
            Cn.current = p;
          }
        },
        useDebugValue: function(f, p) {
          return _t = "useDebugValue", Hi(), rn(), W9();
        },
        useDeferredValue: function(f) {
          return _t = "useDeferredValue", Hi(), rn(), Ewe(f);
        },
        useTransition: function() {
          return _t = "useTransition", Hi(), rn(), Twe();
        },
        useMutableSource: function(f, p, C) {
          return _t = "useMutableSource", Hi(), rn(), void 0;
        },
        useSyncExternalStore: function(f, p, C) {
          return _t = "useSyncExternalStore", Hi(), rn(), R9(f, p);
        },
        useId: function() {
          return _t = "useId", Hi(), rn(), z9();
        },
        unstable_isNewReconciler: pe
      }, j9 = {
        readContext: function(f) {
          return JZ(), sl(f);
        },
        useCallback: function(f, p) {
          return _t = "useCallback", Hi(), rn(), V9(f, p);
        },
        useContext: function(f) {
          return _t = "useContext", Hi(), rn(), sl(f);
        },
        useEffect: function(f, p) {
          return _t = "useEffect", Hi(), rn(), uM(f, p);
        },
        useImperativeHandle: function(f, p, C) {
          return _t = "useImperativeHandle", Hi(), rn(), H9(f, p, C);
        },
        useInsertionEffect: function(f, p) {
          return _t = "useInsertionEffect", Hi(), rn(), F9(f, p);
        },
        useLayoutEffect: function(f, p) {
          return _t = "useLayoutEffect", Hi(), rn(), B9(f, p);
        },
        useMemo: function(f, p) {
          _t = "useMemo", Hi(), rn();
          var C = Cn.current;
          Cn.current = bp;
          try {
            return U9(f, p);
          } finally {
            Cn.current = C;
          }
        },
        useReducer: function(f, p, C) {
          _t = "useReducer", Hi(), rn();
          var x = Cn.current;
          Cn.current = bp;
          try {
            return WZ(f, p, C);
          } finally {
            Cn.current = x;
          }
        },
        useRef: function(f) {
          return _t = "useRef", Hi(), rn(), O9();
        },
        useState: function(f) {
          _t = "useState", Hi(), rn();
          var p = Cn.current;
          Cn.current = bp;
          try {
            return zZ(f);
          } finally {
            Cn.current = p;
          }
        },
        useDebugValue: function(f, p) {
          return _t = "useDebugValue", Hi(), rn(), W9();
        },
        useDeferredValue: function(f) {
          return _t = "useDeferredValue", Hi(), rn(), xwe(f);
        },
        useTransition: function() {
          return _t = "useTransition", Hi(), rn(), kwe();
        },
        useMutableSource: function(f, p, C) {
          return _t = "useMutableSource", Hi(), rn(), void 0;
        },
        useSyncExternalStore: function(f, p, C) {
          return _t = "useSyncExternalStore", Hi(), rn(), R9(f, p);
        },
        useId: function() {
          return _t = "useId", Hi(), rn(), z9();
        },
        unstable_isNewReconciler: pe
      };
    }
    var mC = t.unstable_now, Bwe = 0, G9 = -1, dM = -1, q9 = -1, eQ = !1, K9 = !1;
    function Hwe() {
      return eQ;
    }
    function kYe() {
      K9 = !0;
    }
    function DYe() {
      eQ = !1, K9 = !1;
    }
    function IYe() {
      eQ = K9, K9 = !1;
    }
    function Wwe() {
      return Bwe;
    }
    function Vwe() {
      Bwe = mC();
    }
    function tQ(f) {
      dM = mC(), f.actualStartTime < 0 && (f.actualStartTime = mC());
    }
    function Uwe(f) {
      dM = -1;
    }
    function Y9(f, p) {
      if (dM >= 0) {
        var C = mC() - dM;
        f.actualDuration += C, p && (f.selfBaseDuration = C), dM = -1;
      }
    }
    function s_(f) {
      if (G9 >= 0) {
        var p = mC() - G9;
        G9 = -1;
        for (var C = f.return; C !== null; ) {
          switch (C.tag) {
            case h:
              var x = C.stateNode;
              x.effectDuration += p;
              return;
            case D:
              var I = C.stateNode;
              I.effectDuration += p;
              return;
          }
          C = C.return;
        }
      }
    }
    function nQ(f) {
      if (q9 >= 0) {
        var p = mC() - q9;
        q9 = -1;
        for (var C = f.return; C !== null; ) {
          switch (C.tag) {
            case h:
              var x = C.stateNode;
              x !== null && (x.passiveEffectDuration += p);
              return;
            case D:
              var I = C.stateNode;
              I !== null && (I.passiveEffectDuration += p);
              return;
          }
          C = C.return;
        }
      }
    }
    function o_() {
      G9 = mC();
    }
    function iQ() {
      q9 = mC();
    }
    function rQ(f) {
      for (var p = f.child; p; )
        f.actualDuration += p.actualDuration, p = p.sibling;
    }
    function vp(f, p) {
      if (f && f.defaultProps) {
        var C = bn({}, p), x = f.defaultProps;
        for (var I in x)
          C[I] === void 0 && (C[I] = x[I]);
        return C;
      }
      return p;
    }
    var sQ = {}, oQ, aQ, lQ, cQ, uQ, zwe, X9, dQ, hQ, fQ, hM;
    {
      oQ = /* @__PURE__ */ new Set(), aQ = /* @__PURE__ */ new Set(), lQ = /* @__PURE__ */ new Set(), cQ = /* @__PURE__ */ new Set(), dQ = /* @__PURE__ */ new Set(), uQ = /* @__PURE__ */ new Set(), hQ = /* @__PURE__ */ new Set(), fQ = /* @__PURE__ */ new Set(), hM = /* @__PURE__ */ new Set();
      var $we = /* @__PURE__ */ new Set();
      X9 = function(f, p) {
        if (!(f === null || typeof f == "function")) {
          var C = p + "_" + f;
          $we.has(C) || ($we.add(C), a("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", p, f));
        }
      }, zwe = function(f, p) {
        if (p === void 0) {
          var C = Rr(f) || "Component";
          uQ.has(C) || (uQ.add(C), a("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", C));
        }
      }, Object.defineProperty(sQ, "_processChildContext", {
        enumerable: !1,
        value: function() {
          throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
        }
      }), Object.freeze(sQ);
    }
    function gQ(f, p, C, x) {
      var I = f.memoizedState, O = C(x, I);
      {
        if (f.mode & zi) {
          Ds(!0);
          try {
            O = C(x, I);
          } finally {
            Ds(!1);
          }
        }
        zwe(p, O);
      }
      var W = O == null ? I : bn({}, I, O);
      if (f.memoizedState = W, f.lanes === pt) {
        var q = f.updateQueue;
        q.baseState = W;
      }
    }
    var pQ = {
      isMounted: X2,
      enqueueSetState: function(f, p, C) {
        var x = H0(f), I = vd(), O = yC(x), W = wv(I, O);
        W.payload = p, C != null && (X9(C, "setState"), W.callback = C);
        var q = hC(x, W, O);
        q !== null && (Hl(q, x, O, I), x9(q, x, O)), hS(x, O);
      },
      enqueueReplaceState: function(f, p, C) {
        var x = H0(f), I = vd(), O = yC(x), W = wv(I, O);
        W.tag = awe, W.payload = p, C != null && (X9(C, "replaceState"), W.callback = C);
        var q = hC(x, W, O);
        q !== null && (Hl(q, x, O, I), x9(q, x, O)), hS(x, O);
      },
      enqueueForceUpdate: function(f, p) {
        var C = H0(f), x = vd(), I = yC(C), O = wv(x, I);
        O.tag = w9, p != null && (X9(p, "forceUpdate"), O.callback = p);
        var W = hC(C, O, I);
        W !== null && (Hl(W, C, I, x), x9(W, C, I)), uO(C, I);
      }
    };
    function jwe(f, p, C, x, I, O, W) {
      var q = f.stateNode;
      if (typeof q.shouldComponentUpdate == "function") {
        var ee = q.shouldComponentUpdate(x, O, W);
        {
          if (f.mode & zi) {
            Ds(!0);
            try {
              ee = q.shouldComponentUpdate(x, O, W);
            } finally {
              Ds(!1);
            }
          }
          ee === void 0 && a("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", Rr(p) || "Component");
        }
        return ee;
      }
      return p.prototype && p.prototype.isPureReactComponent ? !ti(C, x) || !ti(I, O) : !0;
    }
    function NYe(f, p, C) {
      var x = f.stateNode;
      {
        var I = Rr(p) || "Component", O = x.render;
        O || (p.prototype && typeof p.prototype.render == "function" ? a("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", I) : a("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", I)), x.getInitialState && !x.getInitialState.isReactClassApproved && !x.state && a("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", I), x.getDefaultProps && !x.getDefaultProps.isReactClassApproved && a("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", I), x.propTypes && a("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", I), x.contextType && a("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", I), p.childContextTypes && !hM.has(p) && // Strict Mode has its own warning for legacy context, so we can skip
        // this one.
        (f.mode & zi) === ei && (hM.add(p), a(`%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead

.Learn more about this warning here: https://reactjs.org/link/legacy-context`, I)), p.contextTypes && !hM.has(p) && // Strict Mode has its own warning for legacy context, so we can skip
        // this one.
        (f.mode & zi) === ei && (hM.add(p), a(`%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.

Learn more about this warning here: https://reactjs.org/link/legacy-context`, I)), x.contextTypes && a("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", I), p.contextType && p.contextTypes && !hQ.has(p) && (hQ.add(p), a("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", I)), typeof x.componentShouldUpdate == "function" && a("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", I), p.prototype && p.prototype.isPureReactComponent && typeof x.shouldComponentUpdate < "u" && a("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", Rr(p) || "A pure component"), typeof x.componentDidUnmount == "function" && a("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", I), typeof x.componentDidReceiveProps == "function" && a("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", I), typeof x.componentWillRecieveProps == "function" && a("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", I), typeof x.UNSAFE_componentWillRecieveProps == "function" && a("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", I);
        var W = x.props !== C;
        x.props !== void 0 && W && a("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", I, I), x.defaultProps && a("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", I, I), typeof x.getSnapshotBeforeUpdate == "function" && typeof x.componentDidUpdate != "function" && !lQ.has(p) && (lQ.add(p), a("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", Rr(p))), typeof x.getDerivedStateFromProps == "function" && a("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", I), typeof x.getDerivedStateFromError == "function" && a("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", I), typeof p.getSnapshotBeforeUpdate == "function" && a("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", I);
        var q = x.state;
        q && (typeof q != "object" || Yi(q)) && a("%s.state: must be set to an object or null", I), typeof x.getChildContext == "function" && typeof p.childContextTypes != "object" && a("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", I);
      }
    }
    function Gwe(f, p) {
      p.updater = pQ, f.stateNode = p, sS(p, f), p._reactInternalInstance = sQ;
    }
    function qwe(f, p, C) {
      var x = !1, I = ff, O = ff, W = p.contextType;
      if ("contextType" in p) {
        var q = (
          // Allow null for conditional declaration
          W === null || W !== void 0 && W.$$typeof === xe && W._context === void 0
        );
        if (!q && !fQ.has(p)) {
          fQ.add(p);
          var ee = "";
          W === void 0 ? ee = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : typeof W != "object" ? ee = " However, it is set to a " + typeof W + "." : W.$$typeof === Rc ? ee = " Did you accidentally pass the Context.Provider instead?" : W._context !== void 0 ? ee = " Did you accidentally pass the Context.Consumer instead?" : ee = " However, it is set to an object with keys {" + Object.keys(W).join(", ") + "}.", a("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", Rr(p) || "Component", ee);
        }
      }
      if (typeof W == "object" && W !== null)
        O = sl(W);
      else {
        I = HD(f, p, !0);
        var ue = p.contextTypes;
        x = ue != null, O = x ? WD(f, I) : ff;
      }
      var me = new p(C, O);
      if (f.mode & zi) {
        Ds(!0);
        try {
          me = new p(C, O);
        } finally {
          Ds(!1);
        }
      }
      var Me = f.memoizedState = me.state !== null && me.state !== void 0 ? me.state : null;
      Gwe(f, me);
      {
        if (typeof p.getDerivedStateFromProps == "function" && Me === null) {
          var Ae = Rr(p) || "Component";
          aQ.has(Ae) || (aQ.add(Ae), a("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", Ae, me.state === null ? "null" : "undefined", Ae));
        }
        if (typeof p.getDerivedStateFromProps == "function" || typeof me.getSnapshotBeforeUpdate == "function") {
          var nt = null, rt = null, ft = null;
          if (typeof me.componentWillMount == "function" && me.componentWillMount.__suppressDeprecationWarning !== !0 ? nt = "componentWillMount" : typeof me.UNSAFE_componentWillMount == "function" && (nt = "UNSAFE_componentWillMount"), typeof me.componentWillReceiveProps == "function" && me.componentWillReceiveProps.__suppressDeprecationWarning !== !0 ? rt = "componentWillReceiveProps" : typeof me.UNSAFE_componentWillReceiveProps == "function" && (rt = "UNSAFE_componentWillReceiveProps"), typeof me.componentWillUpdate == "function" && me.componentWillUpdate.__suppressDeprecationWarning !== !0 ? ft = "componentWillUpdate" : typeof me.UNSAFE_componentWillUpdate == "function" && (ft = "UNSAFE_componentWillUpdate"), nt !== null || rt !== null || ft !== null) {
            var un = Rr(p) || "Component", ai = typeof p.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
            cQ.has(un) || (cQ.add(un), a(`Unsafe legacy lifecycles will not be called for components using new component APIs.

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

The above lifecycles should be removed. Learn more about this warning here:
https://reactjs.org/link/unsafe-component-lifecycles`, un, ai, nt !== null ? `
  ` + nt : "", rt !== null ? `
  ` + rt : "", ft !== null ? `
  ` + ft : ""));
          }
        }
      }
      return x && P1e(f, I, O), me;
    }
    function RYe(f, p) {
      var C = p.state;
      typeof p.componentWillMount == "function" && p.componentWillMount(), typeof p.UNSAFE_componentWillMount == "function" && p.UNSAFE_componentWillMount(), C !== p.state && (a("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", Ai(f) || "Component"), pQ.enqueueReplaceState(p, p.state, null));
    }
    function Kwe(f, p, C, x) {
      var I = p.state;
      if (typeof p.componentWillReceiveProps == "function" && p.componentWillReceiveProps(C, x), typeof p.UNSAFE_componentWillReceiveProps == "function" && p.UNSAFE_componentWillReceiveProps(C, x), p.state !== I) {
        {
          var O = Ai(f) || "Component";
          oQ.has(O) || (oQ.add(O), a("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", O));
        }
        pQ.enqueueReplaceState(p, p.state, null);
      }
    }
    function mQ(f, p, C, x) {
      NYe(f, p, C);
      var I = f.stateNode;
      I.props = C, I.state = f.memoizedState, I.refs = {}, xZ(f);
      var O = p.contextType;
      if (typeof O == "object" && O !== null)
        I.context = sl(O);
      else {
        var W = HD(f, p, !0);
        I.context = WD(f, W);
      }
      {
        if (I.state === C) {
          var q = Rr(p) || "Component";
          dQ.has(q) || (dQ.add(q), a("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", q));
        }
        f.mode & zi && mp.recordLegacyContextWarning(f, I), mp.recordUnsafeLifecycleWarnings(f, I);
      }
      I.state = f.memoizedState;
      var ee = p.getDerivedStateFromProps;
      if (typeof ee == "function" && (gQ(f, p, ee, C), I.state = f.memoizedState), typeof p.getDerivedStateFromProps != "function" && typeof I.getSnapshotBeforeUpdate != "function" && (typeof I.UNSAFE_componentWillMount == "function" || typeof I.componentWillMount == "function") && (RYe(f, I), L9(f, C, I, x), I.state = f.memoizedState), typeof I.componentDidMount == "function") {
        var ue = _r;
        ue |= Mm, (f.mode & $s) !== ei && (ue |= Pc), f.flags |= ue;
      }
    }
    function AYe(f, p, C, x) {
      var I = f.stateNode, O = f.memoizedProps;
      I.props = O;
      var W = I.context, q = p.contextType, ee = ff;
      if (typeof q == "object" && q !== null)
        ee = sl(q);
      else {
        var ue = HD(f, p, !0);
        ee = WD(f, ue);
      }
      var me = p.getDerivedStateFromProps, Me = typeof me == "function" || typeof I.getSnapshotBeforeUpdate == "function";
      !Me && (typeof I.UNSAFE_componentWillReceiveProps == "function" || typeof I.componentWillReceiveProps == "function") && (O !== C || W !== ee) && Kwe(f, I, C, ee), cwe();
      var Ae = f.memoizedState, nt = I.state = Ae;
      if (L9(f, C, I, x), nt = f.memoizedState, O === C && Ae === nt && !a9() && !T9()) {
        if (typeof I.componentDidMount == "function") {
          var rt = _r;
          rt |= Mm, (f.mode & $s) !== ei && (rt |= Pc), f.flags |= rt;
        }
        return !1;
      }
      typeof me == "function" && (gQ(f, p, me, C), nt = f.memoizedState);
      var ft = T9() || jwe(f, p, O, C, Ae, nt, ee);
      if (ft) {
        if (!Me && (typeof I.UNSAFE_componentWillMount == "function" || typeof I.componentWillMount == "function") && (typeof I.componentWillMount == "function" && I.componentWillMount(), typeof I.UNSAFE_componentWillMount == "function" && I.UNSAFE_componentWillMount()), typeof I.componentDidMount == "function") {
          var un = _r;
          un |= Mm, (f.mode & $s) !== ei && (un |= Pc), f.flags |= un;
        }
      } else {
        if (typeof I.componentDidMount == "function") {
          var ai = _r;
          ai |= Mm, (f.mode & $s) !== ei && (ai |= Pc), f.flags |= ai;
        }
        f.memoizedProps = C, f.memoizedState = nt;
      }
      return I.props = C, I.state = nt, I.context = ee, ft;
    }
    function OYe(f, p, C, x, I) {
      var O = p.stateNode;
      lwe(f, p);
      var W = p.memoizedProps, q = p.type === p.elementType ? W : vp(p.type, W);
      O.props = q;
      var ee = p.pendingProps, ue = O.context, me = C.contextType, Me = ff;
      if (typeof me == "object" && me !== null)
        Me = sl(me);
      else {
        var Ae = HD(p, C, !0);
        Me = WD(p, Ae);
      }
      var nt = C.getDerivedStateFromProps, rt = typeof nt == "function" || typeof O.getSnapshotBeforeUpdate == "function";
      !rt && (typeof O.UNSAFE_componentWillReceiveProps == "function" || typeof O.componentWillReceiveProps == "function") && (W !== ee || ue !== Me) && Kwe(p, O, x, Me), cwe();
      var ft = p.memoizedState, un = O.state = ft;
      if (L9(p, x, O, I), un = p.memoizedState, W === ee && ft === un && !a9() && !T9() && !J)
        return typeof O.componentDidUpdate == "function" && (W !== f.memoizedProps || ft !== f.memoizedState) && (p.flags |= _r), typeof O.getSnapshotBeforeUpdate == "function" && (W !== f.memoizedProps || ft !== f.memoizedState) && (p.flags |= nh), !1;
      typeof nt == "function" && (gQ(p, C, nt, x), un = p.memoizedState);
      var ai = T9() || jwe(p, C, q, x, ft, un, Me) || // TODO: In some cases, we'll end up checking if context has changed twice,
      // both before and after `shouldComponentUpdate` has been called. Not ideal,
      // but I'm loath to refactor this function. This only happens for memoized
      // components so it's not that common.
      J;
      return ai ? (!rt && (typeof O.UNSAFE_componentWillUpdate == "function" || typeof O.componentWillUpdate == "function") && (typeof O.componentWillUpdate == "function" && O.componentWillUpdate(x, un, Me), typeof O.UNSAFE_componentWillUpdate == "function" && O.UNSAFE_componentWillUpdate(x, un, Me)), typeof O.componentDidUpdate == "function" && (p.flags |= _r), typeof O.getSnapshotBeforeUpdate == "function" && (p.flags |= nh)) : (typeof O.componentDidUpdate == "function" && (W !== f.memoizedProps || ft !== f.memoizedState) && (p.flags |= _r), typeof O.getSnapshotBeforeUpdate == "function" && (W !== f.memoizedProps || ft !== f.memoizedState) && (p.flags |= nh), p.memoizedProps = x, p.memoizedState = un), O.props = x, O.state = un, O.context = Me, ai;
    }
    function KS(f, p) {
      return {
        value: f,
        source: p,
        stack: Nr(p),
        digest: null
      };
    }
    function _Q(f, p, C) {
      return {
        value: f,
        source: null,
        stack: C ?? null,
        digest: p ?? null
      };
    }
    function MYe(f, p) {
      return !0;
    }
    function bQ(f, p) {
      try {
        var C = MYe(f, p);
        if (C === !1)
          return;
        var x = p.value, I = p.source, O = p.stack, W = O !== null ? O : "";
        if (x != null && x._suppressLogging) {
          if (f.tag === u)
            return;
          console.error(x);
        }
        var q = I ? Ai(I) : null, ee = q ? "The above error occurred in the <" + q + "> component:" : "The above error occurred in one of your React components:", ue;
        if (f.tag === h)
          ue = `Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;
        else {
          var me = Ai(f) || "Anonymous";
          ue = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + me + ".");
        }
        var Me = ee + `
` + W + `

` + ("" + ue);
        console.error(Me);
      } catch (Ae) {
        setTimeout(function() {
          throw Ae;
        });
      }
    }
    var PYe = typeof WeakMap == "function" ? WeakMap : Map;
    function Ywe(f, p, C) {
      var x = wv(Is, C);
      x.tag = SZ, x.payload = {
        element: null
      };
      var I = p.value;
      return x.callback = function() {
        kZe(I), bQ(f, p);
      }, x;
    }
    function vQ(f, p, C) {
      var x = wv(Is, C);
      x.tag = SZ;
      var I = f.type.getDerivedStateFromError;
      if (typeof I == "function") {
        var O = p.value;
        x.payload = function() {
          return I(O);
        }, x.callback = function() {
          oEe(f), bQ(f, p);
        };
      }
      var W = f.stateNode;
      return W !== null && typeof W.componentDidCatch == "function" && (x.callback = function() {
        oEe(f), bQ(f, p), typeof I != "function" && LZe(this);
        var ee = p.value, ue = p.stack;
        this.componentDidCatch(ee, {
          componentStack: ue !== null ? ue : ""
        }), typeof I != "function" && (ku(f.lanes, Ci) || a("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", Ai(f) || "Unknown"));
      }), x;
    }
    function Xwe(f, p, C) {
      var x = f.pingCache, I;
      if (x === null ? (x = f.pingCache = new PYe(), I = /* @__PURE__ */ new Set(), x.set(p, I)) : (I = x.get(p), I === void 0 && (I = /* @__PURE__ */ new Set(), x.set(p, I))), !I.has(C)) {
        I.add(C);
        var O = DZe.bind(null, f, p, C);
        cc && DM(f, C), p.then(O, O);
      }
    }
    function FYe(f, p, C, x) {
      var I = f.updateQueue;
      if (I === null) {
        var O = /* @__PURE__ */ new Set();
        O.add(C), f.updateQueue = O;
      } else
        I.add(C);
    }
    function BYe(f, p) {
      var C = f.tag;
      if ((f.mode & gr) === ei && (C === c || C === T || C === M)) {
        var x = f.alternate;
        x ? (f.updateQueue = x.updateQueue, f.memoizedState = x.memoizedState, f.lanes = x.lanes) : (f.updateQueue = null, f.memoizedState = null);
      }
    }
    function Zwe(f) {
      var p = f;
      do {
        if (p.tag === N && bYe(p))
          return p;
        p = p.return;
      } while (p !== null);
      return null;
    }
    function Qwe(f, p, C, x, I) {
      if ((f.mode & gr) === ei) {
        if (f === p)
          f.flags |= lc;
        else {
          if (f.flags |= lr, C.flags |= lf, C.flags &= -52805, C.tag === u) {
            var O = C.alternate;
            if (O === null)
              C.tag = H;
            else {
              var W = wv(Is, Ci);
              W.tag = w9, hC(C, W, Ci);
            }
          }
          C.lanes = Xi(C.lanes, Ci);
        }
        return f;
      }
      return f.flags |= lc, f.lanes = I, f;
    }
    function HYe(f, p, C, x, I) {
      if (C.flags |= Zb, cc && DM(f, I), x !== null && typeof x == "object" && typeof x.then == "function") {
        var O = x;
        BYe(C), Wc() && C.mode & gr && z1e();
        var W = Zwe(p);
        if (W !== null) {
          W.flags &= ~Ao, Qwe(W, p, C, f, I), W.mode & gr && Xwe(f, O, I), FYe(W, f, O);
          return;
        } else {
          if (!fO(I)) {
            Xwe(f, O, I), QQ();
            return;
          }
          var q = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");
          x = q;
        }
      } else if (Wc() && C.mode & gr) {
        z1e();
        var ee = Zwe(p);
        if (ee !== null) {
          (ee.flags & lc) === Jn && (ee.flags |= Ao), Qwe(ee, p, C, f, I), dZ(KS(x, C));
          return;
        }
      }
      x = KS(x, C), bZe(x);
      var ue = p;
      do {
        switch (ue.tag) {
          case h: {
            var me = x;
            ue.flags |= lc;
            var Me = il(I);
            ue.lanes = Xi(ue.lanes, Me);
            var Ae = Ywe(ue, me, Me);
            LZ(ue, Ae);
            return;
          }
          case u:
            var nt = x, rt = ue.type, ft = ue.stateNode;
            if ((ue.flags & lr) === Jn && (typeof rt.getDerivedStateFromError == "function" || ft !== null && typeof ft.componentDidCatch == "function" && !ZSe(ft))) {
              ue.flags |= lc;
              var un = il(I);
              ue.lanes = Xi(ue.lanes, un);
              var ai = vQ(ue, nt, un);
              LZ(ue, ai);
              return;
            }
            break;
        }
        ue = ue.return;
      } while (ue !== null);
    }
    function WYe() {
      return null;
    }
    var fM = n.ReactCurrentOwner, yp = !1, yQ, gM, CQ, wQ, SQ, YS, EQ, Z9, pM;
    yQ = {}, gM = {}, CQ = {}, wQ = {}, SQ = {}, YS = !1, EQ = {}, Z9 = {}, pM = {};
    function _d(f, p, C, x) {
      f === null ? p.child = twe(p, null, C, x) : p.child = $D(p, f.child, C, x);
    }
    function VYe(f, p, C, x) {
      p.child = $D(p, f.child, null, x), p.child = $D(p, null, C, x);
    }
    function Jwe(f, p, C, x, I) {
      if (p.type !== p.elementType) {
        var O = C.propTypes;
        O && gp(
          O,
          x,
          // Resolved props
          "prop",
          Rr(C)
        );
      }
      var W = C.render, q = p.ref, ee, ue;
      GD(p, I), ih(p);
      {
        if (fM.current = p, Zd(!0), ee = QD(f, p, W, x, q, I), ue = JD(), p.mode & zi) {
          Ds(!0);
          try {
            ee = QD(f, p, W, x, q, I), ue = JD();
          } finally {
            Ds(!1);
          }
        }
        Zd(!1);
      }
      return Wm(), f !== null && !yp ? (pwe(f, p, I), Sv(f, p, I)) : (Wc() && ue && sZ(p), p.flags |= cp, _d(f, p, ee, I), p.child);
    }
    function eSe(f, p, C, x, I) {
      if (f === null) {
        var O = C.type;
        if (GZe(O) && C.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
        C.defaultProps === void 0) {
          var W = O;
          return W = aI(O), p.tag = M, p.type = W, TQ(p, O), tSe(f, p, W, x, I);
        }
        {
          var q = O.propTypes;
          if (q && gp(
            q,
            x,
            // Resolved props
            "prop",
            Rr(O)
          ), C.defaultProps !== void 0) {
            var ee = Rr(O) || "Unknown";
            pM[ee] || (a("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.", ee), pM[ee] = !0);
          }
        }
        var ue = cJ(C.type, null, x, p, p.mode, I);
        return ue.ref = p.ref, ue.return = p, p.child = ue, ue;
      }
      {
        var me = C.type, Me = me.propTypes;
        Me && gp(
          Me,
          x,
          // Resolved props
          "prop",
          Rr(me)
        );
      }
      var Ae = f.child, nt = AQ(f, I);
      if (!nt) {
        var rt = Ae.memoizedProps, ft = C.compare;
        if (ft = ft !== null ? ft : ti, ft(rt, x) && f.ref === p.ref)
          return Sv(f, p, I);
      }
      p.flags |= cp;
      var un = eE(Ae, x);
      return un.ref = p.ref, un.return = p, p.child = un, un;
    }
    function tSe(f, p, C, x, I) {
      if (p.type !== p.elementType) {
        var O = p.elementType;
        if (O.$$typeof === fi) {
          var W = O, q = W._payload, ee = W._init;
          try {
            O = ee(q);
          } catch {
            O = null;
          }
          var ue = O && O.propTypes;
          ue && gp(
            ue,
            x,
            // Resolved (SimpleMemoComponent has no defaultProps)
            "prop",
            Rr(O)
          );
        }
      }
      if (f !== null) {
        var me = f.memoizedProps;
        if (ti(me, x) && f.ref === p.ref && // Prevent bailout if the implementation changed due to hot reload.
        p.type === f.type)
          if (yp = !1, p.pendingProps = x = me, AQ(f, I))
            (f.flags & lf) !== Jn && (yp = !0);
          else return p.lanes = f.lanes, Sv(f, p, I);
      }
      return xQ(f, p, C, x, I);
    }
    function nSe(f, p, C) {
      var x = p.pendingProps, I = x.children, O = f !== null ? f.memoizedState : null;
      if (x.mode === "hidden" || ae)
        if ((p.mode & gr) === ei) {
          var W = {
            baseLanes: pt,
            cachePool: null,
            transitions: null
          };
          p.memoizedState = W, u7(p, C);
        } else if (ku(C, Lu)) {
          var Me = {
            baseLanes: pt,
            cachePool: null,
            transitions: null
          };
          p.memoizedState = Me;
          var Ae = O !== null ? O.baseLanes : C;
          u7(p, Ae);
        } else {
          var q = null, ee;
          if (O !== null) {
            var ue = O.baseLanes;
            ee = Xi(ue, C);
          } else
            ee = C;
          p.lanes = p.childLanes = Lu;
          var me = {
            baseLanes: ee,
            cachePool: q,
            transitions: null
          };
          return p.memoizedState = me, p.updateQueue = null, u7(p, ee), null;
        }
      else {
        var nt;
        O !== null ? (nt = Xi(O.baseLanes, C), p.memoizedState = null) : nt = C, u7(p, nt);
      }
      return _d(f, p, I, C), p.child;
    }
    function UYe(f, p, C) {
      var x = p.pendingProps;
      return _d(f, p, x, C), p.child;
    }
    function zYe(f, p, C) {
      var x = p.pendingProps.children;
      return _d(f, p, x, C), p.child;
    }
    function $Ye(f, p, C) {
      {
        p.flags |= _r;
        {
          var x = p.stateNode;
          x.effectDuration = 0, x.passiveEffectDuration = 0;
        }
      }
      var I = p.pendingProps, O = I.children;
      return _d(f, p, O, C), p.child;
    }
    function iSe(f, p) {
      var C = p.ref;
      (f === null && C !== null || f !== null && f.ref !== C) && (p.flags |= wa, p.flags |= aS);
    }
    function xQ(f, p, C, x, I) {
      if (p.type !== p.elementType) {
        var O = C.propTypes;
        O && gp(
          O,
          x,
          // Resolved props
          "prop",
          Rr(C)
        );
      }
      var W;
      {
        var q = HD(p, C, !0);
        W = WD(p, q);
      }
      var ee, ue;
      GD(p, I), ih(p);
      {
        if (fM.current = p, Zd(!0), ee = QD(f, p, C, x, W, I), ue = JD(), p.mode & zi) {
          Ds(!0);
          try {
            ee = QD(f, p, C, x, W, I), ue = JD();
          } finally {
            Ds(!1);
          }
        }
        Zd(!1);
      }
      return Wm(), f !== null && !yp ? (pwe(f, p, I), Sv(f, p, I)) : (Wc() && ue && sZ(p), p.flags |= cp, _d(f, p, ee, I), p.child);
    }
    function rSe(f, p, C, x, I) {
      {
        switch (aQe(p)) {
          case !1: {
            var O = p.stateNode, W = p.type, q = new W(p.memoizedProps, O.context), ee = q.state;
            O.updater.enqueueSetState(O, ee, null);
            break;
          }
          case !0: {
            p.flags |= lr, p.flags |= lc;
            var ue = new Error("Simulated error coming from DevTools"), me = il(I);
            p.lanes = Xi(p.lanes, me);
            var Me = vQ(p, KS(ue, p), me);
            LZ(p, Me);
            break;
          }
        }
        if (p.type !== p.elementType) {
          var Ae = C.propTypes;
          Ae && gp(
            Ae,
            x,
            // Resolved props
            "prop",
            Rr(C)
          );
        }
      }
      var nt;
      t_(C) ? (nt = !0, c9(p)) : nt = !1, GD(p, I);
      var rt = p.stateNode, ft;
      rt === null ? (J9(f, p), qwe(p, C, x), mQ(p, C, x, I), ft = !0) : f === null ? ft = AYe(p, C, x, I) : ft = OYe(f, p, C, x, I);
      var un = LQ(f, p, C, ft, nt, I);
      {
        var ai = p.stateNode;
        ft && ai.props !== x && (YS || a("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", Ai(p) || "a component"), YS = !0);
      }
      return un;
    }
    function LQ(f, p, C, x, I, O) {
      iSe(f, p);
      var W = (p.flags & lr) !== Jn;
      if (!x && !W)
        return I && H1e(p, C, !1), Sv(f, p, O);
      var q = p.stateNode;
      fM.current = p;
      var ee;
      if (W && typeof C.getDerivedStateFromError != "function")
        ee = null, Uwe();
      else {
        ih(p);
        {
          if (Zd(!0), ee = q.render(), p.mode & zi) {
            Ds(!0);
            try {
              q.render();
            } finally {
              Ds(!1);
            }
          }
          Zd(!1);
        }
        Wm();
      }
      return p.flags |= cp, f !== null && W ? VYe(f, p, ee, O) : _d(f, p, ee, O), p.memoizedState = q.state, I && H1e(p, C, !0), p.child;
    }
    function sSe(f) {
      var p = f.stateNode;
      p.pendingContext ? F1e(f, p.pendingContext, p.pendingContext !== p.context) : p.context && F1e(f, p.context, !1), TZ(f, p.containerInfo);
    }
    function jYe(f, p, C) {
      if (sSe(p), f === null)
        throw new Error("Should have a current fiber. This is a bug in React.");
      var x = p.pendingProps, I = p.memoizedState, O = I.element;
      lwe(f, p), L9(p, x, null, C);
      var W = p.memoizedState;
      p.stateNode;
      var q = W.element;
      if (I.isDehydrated) {
        var ee = {
          element: q,
          isDehydrated: !1,
          cache: W.cache,
          pendingSuspenseBoundaries: W.pendingSuspenseBoundaries,
          transitions: W.transitions
        }, ue = p.updateQueue;
        if (ue.baseState = ee, p.memoizedState = ee, p.flags & Ao) {
          var me = KS(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), p);
          return oSe(f, p, q, C, me);
        } else if (q !== O) {
          var Me = KS(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), p);
          return oSe(f, p, q, C, Me);
        } else {
          KKe(p);
          var Ae = twe(p, null, q, C);
          p.child = Ae;
          for (var nt = Ae; nt; )
            nt.flags = nt.flags & ~qo | Ko, nt = nt.sibling;
        }
      } else {
        if (zD(), q === O)
          return Sv(f, p, C);
        _d(f, p, q, C);
      }
      return p.child;
    }
    function oSe(f, p, C, x, I) {
      return zD(), dZ(I), p.flags |= Ao, _d(f, p, C, x), p.child;
    }
    function GYe(f, p, C) {
      hwe(p), f === null && uZ(p);
      var x = p.type, I = p.pendingProps, O = f !== null ? f.memoizedProps : null, W = I.children, q = jX(x, I);
      return q ? W = null : O !== null && jX(x, O) && (p.flags |= ks), iSe(f, p), _d(f, p, W, C), p.child;
    }
    function qYe(f, p) {
      return f === null && uZ(p), null;
    }
    function KYe(f, p, C, x) {
      J9(f, p);
      var I = p.pendingProps, O = C, W = O._payload, q = O._init, ee = q(W);
      p.type = ee;
      var ue = p.tag = qZe(ee), me = vp(ee, I), Me;
      switch (ue) {
        case c:
          return TQ(p, ee), p.type = ee = aI(ee), Me = xQ(null, p, ee, me, x), Me;
        case u:
          return p.type = ee = iJ(ee), Me = rSe(null, p, ee, me, x), Me;
        case T:
          return p.type = ee = rJ(ee), Me = Jwe(null, p, ee, me, x), Me;
        case R: {
          if (p.type !== p.elementType) {
            var Ae = ee.propTypes;
            Ae && gp(
              Ae,
              me,
              // Resolved for outer only
              "prop",
              Rr(ee)
            );
          }
          return Me = eSe(
            null,
            p,
            ee,
            vp(ee.type, me),
            // The inner type can have defaults too
            x
          ), Me;
        }
      }
      var nt = "";
      throw ee !== null && typeof ee == "object" && ee.$$typeof === fi && (nt = " Did you wrap a component in React.lazy() more than once?"), new Error("Element type is invalid. Received a promise that resolves to: " + ee + ". " + ("Lazy element type must resolve to a class or function." + nt));
    }
    function YYe(f, p, C, x, I) {
      J9(f, p), p.tag = u;
      var O;
      return t_(C) ? (O = !0, c9(p)) : O = !1, GD(p, I), qwe(p, C, x), mQ(p, C, x, I), LQ(null, p, C, !0, O, I);
    }
    function XYe(f, p, C, x) {
      J9(f, p);
      var I = p.pendingProps, O;
      {
        var W = HD(p, C, !1);
        O = WD(p, W);
      }
      GD(p, x);
      var q, ee;
      ih(p);
      {
        if (C.prototype && typeof C.prototype.render == "function") {
          var ue = Rr(C) || "Unknown";
          yQ[ue] || (a("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", ue, ue), yQ[ue] = !0);
        }
        p.mode & zi && mp.recordLegacyContextWarning(p, null), Zd(!0), fM.current = p, q = QD(null, p, C, I, O, x), ee = JD(), Zd(!1);
      }
      if (Wm(), p.flags |= cp, typeof q == "object" && q !== null && typeof q.render == "function" && q.$$typeof === void 0) {
        var me = Rr(C) || "Unknown";
        gM[me] || (a("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", me, me, me), gM[me] = !0);
      }
      if (
        // Run these checks in production only if the flag is off.
        // Eventually we'll delete this branch altogether.
        typeof q == "object" && q !== null && typeof q.render == "function" && q.$$typeof === void 0
      ) {
        {
          var Me = Rr(C) || "Unknown";
          gM[Me] || (a("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", Me, Me, Me), gM[Me] = !0);
        }
        p.tag = u, p.memoizedState = null, p.updateQueue = null;
        var Ae = !1;
        return t_(C) ? (Ae = !0, c9(p)) : Ae = !1, p.memoizedState = q.state !== null && q.state !== void 0 ? q.state : null, xZ(p), Gwe(p, q), mQ(p, C, I, x), LQ(null, p, C, !0, Ae, x);
      } else {
        if (p.tag = c, p.mode & zi) {
          Ds(!0);
          try {
            q = QD(null, p, C, I, O, x), ee = JD();
          } finally {
            Ds(!1);
          }
        }
        return Wc() && ee && sZ(p), _d(null, p, q, x), TQ(p, C), p.child;
      }
    }
    function TQ(f, p) {
      {
        if (p && p.childContextTypes && a("%s(...): childContextTypes cannot be defined on a function component.", p.displayName || p.name || "Component"), f.ref !== null) {
          var C = "", x = Oc();
          x && (C += `

Check the render method of \`` + x + "`.");
          var I = x || "", O = f._debugSource;
          O && (I = O.fileName + ":" + O.lineNumber), SQ[I] || (SQ[I] = !0, a("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", C));
        }
        if (p.defaultProps !== void 0) {
          var W = Rr(p) || "Unknown";
          pM[W] || (a("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.", W), pM[W] = !0);
        }
        if (typeof p.getDerivedStateFromProps == "function") {
          var q = Rr(p) || "Unknown";
          wQ[q] || (a("%s: Function components do not support getDerivedStateFromProps.", q), wQ[q] = !0);
        }
        if (typeof p.contextType == "object" && p.contextType !== null) {
          var ee = Rr(p) || "Unknown";
          CQ[ee] || (a("%s: Function components do not support contextType.", ee), CQ[ee] = !0);
        }
      }
    }
    var kQ = {
      dehydrated: null,
      treeContext: null,
      retryLane: Ea
    };
    function DQ(f) {
      return {
        baseLanes: f,
        cachePool: WYe(),
        transitions: null
      };
    }
    function ZYe(f, p) {
      var C = null;
      return {
        baseLanes: Xi(f.baseLanes, p),
        cachePool: C,
        transitions: f.transitions
      };
    }
    function QYe(f, p, C, x) {
      if (p !== null) {
        var I = p.memoizedState;
        if (I === null)
          return !1;
      }
      return IZ(f, rM);
    }
    function JYe(f, p) {
      return CS(f.childLanes, p);
    }
    function aSe(f, p, C) {
      var x = p.pendingProps;
      lQe(p) && (p.flags |= lr);
      var I = _p.current, O = !1, W = (p.flags & lr) !== Jn;
      if (W || QYe(I, f) ? (O = !0, p.flags &= ~lr) : (f === null || f.memoizedState !== null) && (I = _Ye(I, gwe)), I = KD(I), gC(p, I), f === null) {
        uZ(p);
        var q = p.memoizedState;
        if (q !== null) {
          var ee = q.dehydrated;
          if (ee !== null)
            return rXe(p, ee);
        }
        var ue = x.children, me = x.fallback;
        if (O) {
          var Me = eXe(p, ue, me, C), Ae = p.child;
          return Ae.memoizedState = DQ(C), p.memoizedState = kQ, Me;
        } else
          return IQ(p, ue);
      } else {
        var nt = f.memoizedState;
        if (nt !== null) {
          var rt = nt.dehydrated;
          if (rt !== null)
            return sXe(f, p, W, x, rt, nt, C);
        }
        if (O) {
          var ft = x.fallback, un = x.children, ai = nXe(f, p, un, ft, C), Xn = p.child, Or = f.child.memoizedState;
          return Xn.memoizedState = Or === null ? DQ(C) : ZYe(Or, C), Xn.childLanes = JYe(f, C), p.memoizedState = kQ, ai;
        } else {
          var Sr = x.children, qe = tXe(f, p, Sr, C);
          return p.memoizedState = null, qe;
        }
      }
    }
    function IQ(f, p, C) {
      var x = f.mode, I = {
        mode: "visible",
        children: p
      }, O = NQ(I, x);
      return O.return = f, f.child = O, O;
    }
    function eXe(f, p, C, x) {
      var I = f.mode, O = f.child, W = {
        mode: "hidden",
        children: p
      }, q, ee;
      return (I & gr) === ei && O !== null ? (q = O, q.childLanes = pt, q.pendingProps = W, f.mode & Lr && (q.actualDuration = 0, q.actualStartTime = -1, q.selfBaseDuration = 0, q.treeBaseDuration = 0), ee = wC(C, I, x, null)) : (q = NQ(W, I), ee = wC(C, I, x, null)), q.return = f, ee.return = f, q.sibling = ee, f.child = q, ee;
    }
    function NQ(f, p, C) {
      return lEe(f, p, pt, null);
    }
    function lSe(f, p) {
      return eE(f, p);
    }
    function tXe(f, p, C, x) {
      var I = f.child, O = I.sibling, W = lSe(I, {
        mode: "visible",
        children: C
      });
      if ((p.mode & gr) === ei && (W.lanes = x), W.return = p, W.sibling = null, O !== null) {
        var q = p.deletions;
        q === null ? (p.deletions = [O], p.flags |= wu) : q.push(O);
      }
      return p.child = W, W;
    }
    function nXe(f, p, C, x, I) {
      var O = p.mode, W = f.child, q = W.sibling, ee = {
        mode: "hidden",
        children: C
      }, ue;
      if (
        // In legacy mode, we commit the primary tree as if it successfully
        // completed, even though it's in an inconsistent state.
        (O & gr) === ei && // Make sure we're on the second pass, i.e. the primary child fragment was
        // already cloned. In legacy mode, the only case where this isn't true is
        // when DevTools forces us to display a fallback; we skip the first render
        // pass entirely and go straight to rendering the fallback. (In Concurrent
        // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
        // only codepath.)
        p.child !== W
      ) {
        var me = p.child;
        ue = me, ue.childLanes = pt, ue.pendingProps = ee, p.mode & Lr && (ue.actualDuration = 0, ue.actualStartTime = -1, ue.selfBaseDuration = W.selfBaseDuration, ue.treeBaseDuration = W.treeBaseDuration), p.deletions = null;
      } else
        ue = lSe(W, ee), ue.subtreeFlags = W.subtreeFlags & Sa;
      var Me;
      return q !== null ? Me = eE(q, x) : (Me = wC(x, O, I, null), Me.flags |= qo), Me.return = p, ue.return = p, ue.sibling = Me, p.child = ue, Me;
    }
    function Q9(f, p, C, x) {
      x !== null && dZ(x), $D(p, f.child, null, C);
      var I = p.pendingProps, O = I.children, W = IQ(p, O);
      return W.flags |= qo, p.memoizedState = null, W;
    }
    function iXe(f, p, C, x, I) {
      var O = p.mode, W = {
        mode: "visible",
        children: C
      }, q = NQ(W, O), ee = wC(x, O, I, null);
      return ee.flags |= qo, q.return = p, ee.return = p, q.sibling = ee, p.child = q, (p.mode & gr) !== ei && $D(p, f.child, null, I), ee;
    }
    function rXe(f, p, C) {
      return (f.mode & gr) === ei ? (a("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."), f.lanes = Ci) : YX(p) ? f.lanes = nl : f.lanes = Lu, null;
    }
    function sXe(f, p, C, x, I, O, W) {
      if (C)
        if (p.flags & Ao) {
          p.flags &= ~Ao;
          var qe = _Q(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
          return Q9(f, p, W, qe);
        } else {
          if (p.memoizedState !== null)
            return p.child = f.child, p.flags |= lr, null;
          var gt = x.children, Ke = x.fallback, Pt = iXe(f, p, gt, Ke, W), wn = p.child;
          return wn.memoizedState = DQ(W), p.memoizedState = kQ, Pt;
        }
      else {
        if (GKe(), (p.mode & gr) === ei)
          return Q9(
            f,
            p,
            W,
            // TODO: When we delete legacy mode, we should make this error argument
            // required — every concurrent mode path that causes hydration to
            // de-opt to client rendering should have an error message.
            null
          );
        if (YX(I)) {
          var q, ee, ue;
          {
            var me = cKe(I);
            q = me.digest, ee = me.message, ue = me.stack;
          }
          var Me;
          ee ? Me = new Error(ee) : Me = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");
          var Ae = _Q(Me, q, ue);
          return Q9(f, p, W, Ae);
        }
        var nt = ku(W, f.childLanes);
        if (yp || nt) {
          var rt = c7();
          if (rt !== null) {
            var ft = gD(rt, W);
            if (ft !== Ea && ft !== O.retryLane) {
              O.retryLane = ft;
              var un = Is;
              ch(f, ft), Hl(rt, f, ft, un);
            }
          }
          QQ();
          var ai = _Q(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));
          return Q9(f, p, W, ai);
        } else if (N1e(I)) {
          p.flags |= lr, p.child = f.child;
          var Xn = IZe.bind(null, f);
          return uKe(I, Xn), null;
        } else {
          YKe(p, I, O.treeContext);
          var Or = x.children, Sr = IQ(p, Or);
          return Sr.flags |= Ko, Sr;
        }
      }
    }
    function cSe(f, p, C) {
      f.lanes = Xi(f.lanes, p);
      var x = f.alternate;
      x !== null && (x.lanes = Xi(x.lanes, p)), CZ(f.return, p, C);
    }
    function oXe(f, p, C) {
      for (var x = p; x !== null; ) {
        if (x.tag === N) {
          var I = x.memoizedState;
          I !== null && cSe(x, C, f);
        } else if (x.tag === K)
          cSe(x, C, f);
        else if (x.child !== null) {
          x.child.return = x, x = x.child;
          continue;
        }
        if (x === f)
          return;
        for (; x.sibling === null; ) {
          if (x.return === null || x.return === f)
            return;
          x = x.return;
        }
        x.sibling.return = x.return, x = x.sibling;
      }
    }
    function aXe(f) {
      for (var p = f, C = null; p !== null; ) {
        var x = p.alternate;
        x !== null && I9(x) === null && (C = p), p = p.sibling;
      }
      return C;
    }
    function lXe(f) {
      if (f !== void 0 && f !== "forwards" && f !== "backwards" && f !== "together" && !EQ[f])
        if (EQ[f] = !0, typeof f == "string")
          switch (f.toLowerCase()) {
            case "together":
            case "forwards":
            case "backwards": {
              a('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.', f, f.toLowerCase());
              break;
            }
            case "forward":
            case "backward": {
              a('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.', f, f.toLowerCase());
              break;
            }
            default:
              a('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', f);
              break;
          }
        else
          a('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?', f);
    }
    function cXe(f, p) {
      f !== void 0 && !Z9[f] && (f !== "collapsed" && f !== "hidden" ? (Z9[f] = !0, a('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?', f)) : p !== "forwards" && p !== "backwards" && (Z9[f] = !0, a('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', f)));
    }
    function uSe(f, p) {
      {
        var C = Yi(f), x = !C && typeof qn(f) == "function";
        if (C || x) {
          var I = C ? "array" : "iterable";
          return a("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>", I, p, I), !1;
        }
      }
      return !0;
    }
    function uXe(f, p) {
      if ((p === "forwards" || p === "backwards") && f !== void 0 && f !== null && f !== !1)
        if (Yi(f)) {
          for (var C = 0; C < f.length; C++)
            if (!uSe(f[C], C))
              return;
        } else {
          var x = qn(f);
          if (typeof x == "function") {
            var I = x.call(f);
            if (I)
              for (var O = I.next(), W = 0; !O.done; O = I.next()) {
                if (!uSe(O.value, W))
                  return;
                W++;
              }
          } else
            a('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', p);
        }
    }
    function RQ(f, p, C, x, I) {
      var O = f.memoizedState;
      O === null ? f.memoizedState = {
        isBackwards: p,
        rendering: null,
        renderingStartTime: 0,
        last: x,
        tail: C,
        tailMode: I
      } : (O.isBackwards = p, O.rendering = null, O.renderingStartTime = 0, O.last = x, O.tail = C, O.tailMode = I);
    }
    function dSe(f, p, C) {
      var x = p.pendingProps, I = x.revealOrder, O = x.tail, W = x.children;
      lXe(I), cXe(O, I), uXe(W, I), _d(f, p, W, C);
      var q = _p.current, ee = IZ(q, rM);
      if (ee)
        q = NZ(q, rM), p.flags |= lr;
      else {
        var ue = f !== null && (f.flags & lr) !== Jn;
        ue && oXe(p, p.child, C), q = KD(q);
      }
      if (gC(p, q), (p.mode & gr) === ei)
        p.memoizedState = null;
      else
        switch (I) {
          case "forwards": {
            var me = aXe(p.child), Me;
            me === null ? (Me = p.child, p.child = null) : (Me = me.sibling, me.sibling = null), RQ(
              p,
              !1,
              // isBackwards
              Me,
              me,
              O
            );
            break;
          }
          case "backwards": {
            var Ae = null, nt = p.child;
            for (p.child = null; nt !== null; ) {
              var rt = nt.alternate;
              if (rt !== null && I9(rt) === null) {
                p.child = nt;
                break;
              }
              var ft = nt.sibling;
              nt.sibling = Ae, Ae = nt, nt = ft;
            }
            RQ(
              p,
              !0,
              // isBackwards
              Ae,
              null,
              // last
              O
            );
            break;
          }
          case "together": {
            RQ(
              p,
              !1,
              // isBackwards
              null,
              // tail
              null,
              // last
              void 0
            );
            break;
          }
          default:
            p.memoizedState = null;
        }
      return p.child;
    }
    function dXe(f, p, C) {
      TZ(p, p.stateNode.containerInfo);
      var x = p.pendingProps;
      return f === null ? p.child = $D(p, null, x, C) : _d(f, p, x, C), p.child;
    }
    var hSe = !1;
    function hXe(f, p, C) {
      var x = p.type, I = x._context, O = p.pendingProps, W = p.memoizedProps, q = O.value;
      {
        "value" in O || hSe || (hSe = !0, a("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));
        var ee = p.type.propTypes;
        ee && gp(ee, O, "prop", "Context.Provider");
      }
      if (rwe(p, I, q), W !== null) {
        var ue = W.value;
        if (mn(ue, q)) {
          if (W.children === O.children && !a9())
            return Sv(f, p, C);
        } else
          lYe(p, I, C);
      }
      var me = O.children;
      return _d(f, p, me, C), p.child;
    }
    var fSe = !1;
    function fXe(f, p, C) {
      var x = p.type;
      x._context === void 0 ? x !== x.Consumer && (fSe || (fSe = !0, a("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))) : x = x._context;
      var I = p.pendingProps, O = I.children;
      typeof O != "function" && a("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."), GD(p, C);
      var W = sl(x);
      ih(p);
      var q;
      return fM.current = p, Zd(!0), q = O(W), Zd(!1), Wm(), p.flags |= cp, _d(f, p, q, C), p.child;
    }
    function mM() {
      yp = !0;
    }
    function J9(f, p) {
      (p.mode & gr) === ei && f !== null && (f.alternate = null, p.alternate = null, p.flags |= qo);
    }
    function Sv(f, p, C) {
      return f !== null && (p.dependencies = f.dependencies), Uwe(), kM(p.lanes), ku(C, p.childLanes) ? (oYe(f, p), p.child) : null;
    }
    function gXe(f, p, C) {
      {
        var x = p.return;
        if (x === null)
          throw new Error("Cannot swap the root fiber.");
        if (f.alternate = null, p.alternate = null, C.index = p.index, C.sibling = p.sibling, C.return = p.return, C.ref = p.ref, p === x.child)
          x.child = C;
        else {
          var I = x.child;
          if (I === null)
            throw new Error("Expected parent to have a child.");
          for (; I.sibling !== p; )
            if (I = I.sibling, I === null)
              throw new Error("Expected to find the previous sibling.");
          I.sibling = C;
        }
        var O = x.deletions;
        return O === null ? (x.deletions = [f], x.flags |= wu) : O.push(f), C.flags |= qo, C;
      }
    }
    function AQ(f, p) {
      var C = f.lanes;
      return !!ku(C, p);
    }
    function pXe(f, p, C) {
      switch (p.tag) {
        case h:
          sSe(p), p.stateNode, zD();
          break;
        case m:
          hwe(p);
          break;
        case u: {
          var x = p.type;
          t_(x) && c9(p);
          break;
        }
        case g:
          TZ(p, p.stateNode.containerInfo);
          break;
        case L: {
          var I = p.memoizedProps.value, O = p.type._context;
          rwe(p, O, I);
          break;
        }
        case D:
          {
            var W = ku(C, p.childLanes);
            W && (p.flags |= _r);
            {
              var q = p.stateNode;
              q.effectDuration = 0, q.passiveEffectDuration = 0;
            }
          }
          break;
        case N: {
          var ee = p.memoizedState;
          if (ee !== null) {
            if (ee.dehydrated !== null)
              return gC(p, KD(_p.current)), p.flags |= lr, null;
            var ue = p.child, me = ue.childLanes;
            if (ku(C, me))
              return aSe(f, p, C);
            gC(p, KD(_p.current));
            var Me = Sv(f, p, C);
            return Me !== null ? Me.sibling : null;
          } else
            gC(p, KD(_p.current));
          break;
        }
        case K: {
          var Ae = (f.flags & lr) !== Jn, nt = ku(C, p.childLanes);
          if (Ae) {
            if (nt)
              return dSe(f, p, C);
            p.flags |= lr;
          }
          var rt = p.memoizedState;
          if (rt !== null && (rt.rendering = null, rt.tail = null, rt.lastEffect = null), gC(p, _p.current), nt)
            break;
          return null;
        }
        case Y:
        case G:
          return p.lanes = pt, nSe(f, p, C);
      }
      return Sv(f, p, C);
    }
    function gSe(f, p, C) {
      if (p._debugNeedsRemount && f !== null)
        return gXe(f, p, cJ(p.type, p.key, p.pendingProps, p._debugOwner || null, p.mode, p.lanes));
      if (f !== null) {
        var x = f.memoizedProps, I = p.pendingProps;
        if (x !== I || a9() || // Force a re-render if the implementation changed due to hot reload:
        p.type !== f.type)
          yp = !0;
        else {
          var O = AQ(f, C);
          if (!O && // If this is the second pass of an error or suspense boundary, there
          // may not be work scheduled on `current`, so we check for this flag.
          (p.flags & lr) === Jn)
            return yp = !1, pXe(f, p, C);
          (f.flags & lf) !== Jn ? yp = !0 : yp = !1;
        }
      } else if (yp = !1, Wc() && WKe(p)) {
        var W = p.index, q = VKe();
        U1e(p, q, W);
      }
      switch (p.lanes = pt, p.tag) {
        case d:
          return XYe(f, p, p.type, C);
        case B: {
          var ee = p.elementType;
          return KYe(f, p, ee, C);
        }
        case c: {
          var ue = p.type, me = p.pendingProps, Me = p.elementType === ue ? me : vp(ue, me);
          return xQ(f, p, ue, Me, C);
        }
        case u: {
          var Ae = p.type, nt = p.pendingProps, rt = p.elementType === Ae ? nt : vp(Ae, nt);
          return rSe(f, p, Ae, rt, C);
        }
        case h:
          return jYe(f, p, C);
        case m:
          return GYe(f, p, C);
        case _:
          return qYe(f, p);
        case N:
          return aSe(f, p, C);
        case g:
          return dXe(f, p, C);
        case T: {
          var ft = p.type, un = p.pendingProps, ai = p.elementType === ft ? un : vp(ft, un);
          return Jwe(f, p, ft, ai, C);
        }
        case v:
          return UYe(f, p, C);
        case w:
          return zYe(f, p, C);
        case D:
          return $Ye(f, p, C);
        case L:
          return hXe(f, p, C);
        case E:
          return fXe(f, p, C);
        case R: {
          var Xn = p.type, Or = p.pendingProps, Sr = vp(Xn, Or);
          if (p.type !== p.elementType) {
            var qe = Xn.propTypes;
            qe && gp(
              qe,
              Sr,
              // Resolved for outer only
              "prop",
              Rr(Xn)
            );
          }
          return Sr = vp(Xn.type, Sr), eSe(f, p, Xn, Sr, C);
        }
        case M:
          return tSe(f, p, p.type, p.pendingProps, C);
        case H: {
          var gt = p.type, Ke = p.pendingProps, Pt = p.elementType === gt ? Ke : vp(gt, Ke);
          return YYe(f, p, gt, Pt, C);
        }
        case K:
          return dSe(f, p, C);
        case X:
          break;
        case Y:
          return nSe(f, p, C);
      }
      throw new Error("Unknown unit of work tag (" + p.tag + "). This error is likely caused by a bug in React. Please file an issue.");
    }
    function eI(f) {
      f.flags |= _r;
    }
    function pSe(f) {
      f.flags |= wa, f.flags |= aS;
    }
    var mSe, OQ, _Se, bSe;
    mSe = function(f, p, C, x) {
      for (var I = p.child; I !== null; ) {
        if (I.tag === m || I.tag === _)
          Fqe(f, I.stateNode);
        else if (I.tag !== g) {
          if (I.child !== null) {
            I.child.return = I, I = I.child;
            continue;
          }
        }
        if (I === p)
          return;
        for (; I.sibling === null; ) {
          if (I.return === null || I.return === p)
            return;
          I = I.return;
        }
        I.sibling.return = I.return, I = I.sibling;
      }
    }, OQ = function(f, p) {
    }, _Se = function(f, p, C, x, I) {
      var O = f.memoizedProps;
      if (O !== x) {
        var W = p.stateNode, q = kZ(), ee = Hqe(W, C, O, x, I, q);
        p.updateQueue = ee, ee && eI(p);
      }
    }, bSe = function(f, p, C, x) {
      C !== x && eI(p);
    };
    function _M(f, p) {
      if (!Wc())
        switch (f.tailMode) {
          case "hidden": {
            for (var C = f.tail, x = null; C !== null; )
              C.alternate !== null && (x = C), C = C.sibling;
            x === null ? f.tail = null : x.sibling = null;
            break;
          }
          case "collapsed": {
            for (var I = f.tail, O = null; I !== null; )
              I.alternate !== null && (O = I), I = I.sibling;
            O === null ? !p && f.tail !== null ? f.tail.sibling = null : f.tail = null : O.sibling = null;
            break;
          }
        }
    }
    function Uc(f) {
      var p = f.alternate !== null && f.alternate.child === f.child, C = pt, x = Jn;
      if (p) {
        if ((f.mode & Lr) !== ei) {
          for (var ee = f.selfBaseDuration, ue = f.child; ue !== null; )
            C = Xi(C, Xi(ue.lanes, ue.childLanes)), x |= ue.subtreeFlags & Sa, x |= ue.flags & Sa, ee += ue.treeBaseDuration, ue = ue.sibling;
          f.treeBaseDuration = ee;
        } else
          for (var me = f.child; me !== null; )
            C = Xi(C, Xi(me.lanes, me.childLanes)), x |= me.subtreeFlags & Sa, x |= me.flags & Sa, me.return = f, me = me.sibling;
        f.subtreeFlags |= x;
      } else {
        if ((f.mode & Lr) !== ei) {
          for (var I = f.actualDuration, O = f.selfBaseDuration, W = f.child; W !== null; )
            C = Xi(C, Xi(W.lanes, W.childLanes)), x |= W.subtreeFlags, x |= W.flags, I += W.actualDuration, O += W.treeBaseDuration, W = W.sibling;
          f.actualDuration = I, f.treeBaseDuration = O;
        } else
          for (var q = f.child; q !== null; )
            C = Xi(C, Xi(q.lanes, q.childLanes)), x |= q.subtreeFlags, x |= q.flags, q.return = f, q = q.sibling;
        f.subtreeFlags |= x;
      }
      return f.childLanes = C, p;
    }
    function mXe(f, p, C) {
      if (eYe() && (p.mode & gr) !== ei && (p.flags & lr) === Jn)
        return Y1e(p), zD(), p.flags |= Ao | Zb | lc, !1;
      var x = g9(p);
      if (C !== null && C.dehydrated !== null)
        if (f === null) {
          if (!x)
            throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
          if (QKe(p), Uc(p), (p.mode & Lr) !== ei) {
            var I = C !== null;
            if (I) {
              var O = p.child;
              O !== null && (p.treeBaseDuration -= O.treeBaseDuration);
            }
          }
          return !1;
        } else {
          if (zD(), (p.flags & lr) === Jn && (p.memoizedState = null), p.flags |= _r, Uc(p), (p.mode & Lr) !== ei) {
            var W = C !== null;
            if (W) {
              var q = p.child;
              q !== null && (p.treeBaseDuration -= q.treeBaseDuration);
            }
          }
          return !1;
        }
      else
        return X1e(), !0;
    }
    function vSe(f, p, C) {
      var x = p.pendingProps;
      switch (oZ(p), p.tag) {
        case d:
        case B:
        case M:
        case c:
        case T:
        case v:
        case w:
        case D:
        case E:
        case R:
          return Uc(p), null;
        case u: {
          var I = p.type;
          return t_(I) && l9(p), Uc(p), null;
        }
        case h: {
          var O = p.stateNode;
          if (qD(p), nZ(p), AZ(), O.pendingContext && (O.context = O.pendingContext, O.pendingContext = null), f === null || f.child === null) {
            var W = g9(p);
            if (W)
              eI(p);
            else if (f !== null) {
              var q = f.memoizedState;
              // Check if this is a client root
              (!q.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error)
              (p.flags & Ao) !== Jn) && (p.flags |= nh, X1e());
            }
          }
          return OQ(f, p), Uc(p), null;
        }
        case m: {
          DZ(p);
          var ee = dwe(), ue = p.type;
          if (f !== null && p.stateNode != null)
            _Se(f, p, ue, x, ee), f.ref !== p.ref && pSe(p);
          else {
            if (!x) {
              if (p.stateNode === null)
                throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
              return Uc(p), null;
            }
            var me = kZ(), Me = g9(p);
            if (Me)
              XKe(p, ee, me) && eI(p);
            else {
              var Ae = Pqe(ue, x, ee, me, p);
              mSe(Ae, p, !1, !1), p.stateNode = Ae, Bqe(Ae, ue, x, ee) && eI(p);
            }
            p.ref !== null && pSe(p);
          }
          return Uc(p), null;
        }
        case _: {
          var nt = x;
          if (f && p.stateNode != null) {
            var rt = f.memoizedProps;
            bSe(f, p, rt, nt);
          } else {
            if (typeof nt != "string" && p.stateNode === null)
              throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
            var ft = dwe(), un = kZ(), ai = g9(p);
            ai ? ZKe(p) && eI(p) : p.stateNode = Wqe(nt, ft, un, p);
          }
          return Uc(p), null;
        }
        case N: {
          YD(p);
          var Xn = p.memoizedState;
          if (f === null || f.memoizedState !== null && f.memoizedState.dehydrated !== null) {
            var Or = mXe(f, p, Xn);
            if (!Or)
              return p.flags & lc ? p : null;
          }
          if ((p.flags & lr) !== Jn)
            return p.lanes = C, (p.mode & Lr) !== ei && rQ(p), p;
          var Sr = Xn !== null, qe = f !== null && f.memoizedState !== null;
          if (Sr !== qe && Sr) {
            var gt = p.child;
            if (gt.flags |= ug, (p.mode & gr) !== ei) {
              var Ke = f === null && (p.memoizedProps.unstable_avoidThisFallback !== !0 || !0);
              Ke || IZ(_p.current, gwe) ? _Ze() : QQ();
            }
          }
          var Pt = p.updateQueue;
          if (Pt !== null && (p.flags |= _r), Uc(p), (p.mode & Lr) !== ei && Sr) {
            var wn = p.child;
            wn !== null && (p.treeBaseDuration -= wn.treeBaseDuration);
          }
          return null;
        }
        case g:
          return qD(p), OQ(f, p), f === null && AKe(p.stateNode.containerInfo), Uc(p), null;
        case L:
          var _n = p.type._context;
          return yZ(_n, p), Uc(p), null;
        case H: {
          var xi = p.type;
          return t_(xi) && l9(p), Uc(p), null;
        }
        case K: {
          YD(p);
          var Vi = p.memoizedState;
          if (Vi === null)
            return Uc(p), null;
          var Gs = (p.flags & lr) !== Jn, rs = Vi.rendering;
          if (rs === null)
            if (Gs)
              _M(Vi, !1);
            else {
              var Ua = vZe() && (f === null || (f.flags & lr) === Jn);
              if (!Ua)
                for (var ss = p.child; ss !== null; ) {
                  var La = I9(ss);
                  if (La !== null) {
                    Gs = !0, p.flags |= lr, _M(Vi, !1);
                    var Ou = La.updateQueue;
                    return Ou !== null && (p.updateQueue = Ou, p.flags |= _r), p.subtreeFlags = Jn, aYe(p, C), gC(p, NZ(_p.current, rM)), p.child;
                  }
                  ss = ss.sibling;
                }
              Vi.tail !== null && ra() > WSe() && (p.flags |= lr, Gs = !0, _M(Vi, !1), p.lanes = h8);
            }
          else {
            if (!Gs) {
              var qc = I9(rs);
              if (qc !== null) {
                p.flags |= lr, Gs = !0;
                var pf = qc.updateQueue;
                if (pf !== null && (p.updateQueue = pf, p.flags |= _r), _M(Vi, !0), Vi.tail === null && Vi.tailMode === "hidden" && !rs.alternate && !Wc())
                  return Uc(p), null;
              } else // The time it took to render last row is greater than the remaining
              // time we have to render. So rendering one more row would likely
              // exceed it.
              ra() * 2 - Vi.renderingStartTime > WSe() && C !== Lu && (p.flags |= lr, Gs = !0, _M(Vi, !1), p.lanes = h8);
            }
            if (Vi.isBackwards)
              rs.sibling = p.child, p.child = rs;
            else {
              var yd = Vi.last;
              yd !== null ? yd.sibling = rs : p.child = rs, Vi.last = rs;
            }
          }
          if (Vi.tail !== null) {
            var Cd = Vi.tail;
            Vi.rendering = Cd, Vi.tail = Cd.sibling, Vi.renderingStartTime = ra(), Cd.sibling = null;
            var Mu = _p.current;
            return Gs ? Mu = NZ(Mu, rM) : Mu = KD(Mu), gC(p, Mu), Cd;
          }
          return Uc(p), null;
        }
        case X:
          break;
        case Y:
        case G: {
          ZQ(p);
          var kv = p.memoizedState, lI = kv !== null;
          if (f !== null) {
            var AM = f.memoizedState, c_ = AM !== null;
            c_ !== lI && // LegacyHidden doesn't do any hiding — it only pre-renders.
            !ae && (p.flags |= ug);
          }
          return !lI || (p.mode & gr) === ei ? Uc(p) : ku(l_, Lu) && (Uc(p), p.subtreeFlags & (qo | _r) && (p.flags |= ug)), null;
        }
        case Q:
          return null;
        case oe:
          return null;
      }
      throw new Error("Unknown unit of work tag (" + p.tag + "). This error is likely caused by a bug in React. Please file an issue.");
    }
    function _Xe(f, p, C) {
      switch (oZ(p), p.tag) {
        case u: {
          var x = p.type;
          t_(x) && l9(p);
          var I = p.flags;
          return I & lc ? (p.flags = I & ~lc | lr, (p.mode & Lr) !== ei && rQ(p), p) : null;
        }
        case h: {
          p.stateNode, qD(p), nZ(p), AZ();
          var O = p.flags;
          return (O & lc) !== Jn && (O & lr) === Jn ? (p.flags = O & ~lc | lr, p) : null;
        }
        case m:
          return DZ(p), null;
        case N: {
          YD(p);
          var W = p.memoizedState;
          if (W !== null && W.dehydrated !== null) {
            if (p.alternate === null)
              throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
            zD();
          }
          var q = p.flags;
          return q & lc ? (p.flags = q & ~lc | lr, (p.mode & Lr) !== ei && rQ(p), p) : null;
        }
        case K:
          return YD(p), null;
        case g:
          return qD(p), null;
        case L:
          var ee = p.type._context;
          return yZ(ee, p), null;
        case Y:
        case G:
          return ZQ(p), null;
        case Q:
          return null;
        default:
          return null;
      }
    }
    function ySe(f, p, C) {
      switch (oZ(p), p.tag) {
        case u: {
          var x = p.type.childContextTypes;
          x != null && l9(p);
          break;
        }
        case h: {
          p.stateNode, qD(p), nZ(p), AZ();
          break;
        }
        case m: {
          DZ(p);
          break;
        }
        case g:
          qD(p);
          break;
        case N:
          YD(p);
          break;
        case K:
          YD(p);
          break;
        case L:
          var I = p.type._context;
          yZ(I, p);
          break;
        case Y:
        case G:
          ZQ(p);
          break;
      }
    }
    var CSe = null;
    CSe = /* @__PURE__ */ new Set();
    var e7 = !1, zc = !1, bXe = typeof WeakSet == "function" ? WeakSet : Set, An = null, tI = null, nI = null;
    function vXe(f) {
      th(null, function() {
        throw f;
      }), K2();
    }
    var yXe = function(f, p) {
      if (p.props = f.memoizedProps, p.state = f.memoizedState, f.mode & Lr)
        try {
          o_(), p.componentWillUnmount();
        } finally {
          s_(f);
        }
      else
        p.componentWillUnmount();
    };
    function wSe(f, p) {
      try {
        _C(Al, f);
      } catch (C) {
        Lo(f, p, C);
      }
    }
    function MQ(f, p, C) {
      try {
        yXe(f, C);
      } catch (x) {
        Lo(f, p, x);
      }
    }
    function CXe(f, p, C) {
      try {
        C.componentDidMount();
      } catch (x) {
        Lo(f, p, x);
      }
    }
    function SSe(f, p) {
      try {
        xSe(f);
      } catch (C) {
        Lo(f, p, C);
      }
    }
    function iI(f, p) {
      var C = f.ref;
      if (C !== null)
        if (typeof C == "function") {
          var x;
          try {
            if (Ve && st && f.mode & Lr)
              try {
                o_(), x = C(null);
              } finally {
                s_(f);
              }
            else
              x = C(null);
          } catch (I) {
            Lo(f, p, I);
          }
          typeof x == "function" && a("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", Ai(f));
        } else
          C.current = null;
    }
    function t7(f, p, C) {
      try {
        C();
      } catch (x) {
        Lo(f, p, x);
      }
    }
    var ESe = !1;
    function wXe(f, p) {
      Oqe(f.containerInfo), An = p, SXe();
      var C = ESe;
      return ESe = !1, C;
    }
    function SXe() {
      for (; An !== null; ) {
        var f = An, p = f.child;
        (f.subtreeFlags & Fm) !== Jn && p !== null ? (p.return = f, An = p) : EXe();
      }
    }
    function EXe() {
      for (; An !== null; ) {
        var f = An;
        Vs(f);
        try {
          xXe(f);
        } catch (C) {
          Lo(f, f.return, C);
        }
        Go();
        var p = f.sibling;
        if (p !== null) {
          p.return = f.return, An = p;
          return;
        }
        An = f.return;
      }
    }
    function xXe(f) {
      var p = f.alternate, C = f.flags;
      if ((C & nh) !== Jn) {
        switch (Vs(f), f.tag) {
          case c:
          case T:
          case M:
            break;
          case u: {
            if (p !== null) {
              var x = p.memoizedProps, I = p.memoizedState, O = f.stateNode;
              f.type === f.elementType && !YS && (O.props !== f.memoizedProps && a("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Ai(f) || "instance"), O.state !== f.memoizedState && a("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Ai(f) || "instance"));
              var W = O.getSnapshotBeforeUpdate(f.elementType === f.type ? x : vp(f.type, x), I);
              {
                var q = CSe;
                W === void 0 && !q.has(f.type) && (q.add(f.type), a("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", Ai(f)));
              }
              O.__reactInternalSnapshotBeforeUpdate = W;
            }
            break;
          }
          case h: {
            {
              var ee = f.stateNode;
              sKe(ee.containerInfo);
            }
            break;
          }
          case m:
          case _:
          case g:
          case H:
            break;
          default:
            throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
        }
        Go();
      }
    }
    function Cp(f, p, C) {
      var x = p.updateQueue, I = x !== null ? x.lastEffect : null;
      if (I !== null) {
        var O = I.next, W = O;
        do {
          if ((W.tag & f) === f) {
            var q = W.destroy;
            W.destroy = void 0, q !== void 0 && ((f & Vc) !== uh ? Vm(p) : (f & Al) !== uh && oO(p), (f & n_) !== uh && IM(!0), t7(p, C, q), (f & n_) !== uh && IM(!1), (f & Vc) !== uh ? Vk() : (f & Al) !== uh && z0());
          }
          W = W.next;
        } while (W !== O);
      }
    }
    function _C(f, p) {
      var C = p.updateQueue, x = C !== null ? C.lastEffect : null;
      if (x !== null) {
        var I = x.next, O = I;
        do {
          if ((O.tag & f) === f) {
            (f & Vc) !== uh ? u8(p) : (f & Al) !== uh && d8(p);
            var W = O.create;
            (f & n_) !== uh && IM(!0), O.destroy = W(), (f & n_) !== uh && IM(!1), (f & Vc) !== uh ? dp() : (f & Al) !== uh && Uk();
            {
              var q = O.destroy;
              if (q !== void 0 && typeof q != "function") {
                var ee = void 0;
                (O.tag & Al) !== Jn ? ee = "useLayoutEffect" : (O.tag & n_) !== Jn ? ee = "useInsertionEffect" : ee = "useEffect";
                var ue = void 0;
                q === null ? ue = " You returned null. If your effect does not require clean up, return undefined (or nothing)." : typeof q.then == "function" ? ue = `

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

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

Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching` : ue = " You returned: " + q, a("%s must not return anything besides a function, which is used for clean-up.%s", ee, ue);
              }
            }
          }
          O = O.next;
        } while (O !== I);
      }
    }
    function LXe(f, p) {
      if ((p.flags & _r) !== Jn)
        switch (p.tag) {
          case D: {
            var C = p.stateNode.passiveEffectDuration, x = p.memoizedProps, I = x.id, O = x.onPostCommit, W = Wwe(), q = p.alternate === null ? "mount" : "update";
            Hwe() && (q = "nested-update"), typeof O == "function" && O(I, q, C, W);
            var ee = p.return;
            e: for (; ee !== null; ) {
              switch (ee.tag) {
                case h:
                  var ue = ee.stateNode;
                  ue.passiveEffectDuration += C;
                  break e;
                case D:
                  var me = ee.stateNode;
                  me.passiveEffectDuration += C;
                  break e;
              }
              ee = ee.return;
            }
            break;
          }
        }
    }
    function TXe(f, p, C, x) {
      if ((C.flags & Bm) !== Jn)
        switch (C.tag) {
          case c:
          case T:
          case M: {
            if (!zc)
              if (C.mode & Lr)
                try {
                  o_(), _C(Al | Rl, C);
                } finally {
                  s_(C);
                }
              else
                _C(Al | Rl, C);
            break;
          }
          case u: {
            var I = C.stateNode;
            if (C.flags & _r && !zc)
              if (p === null)
                if (C.type === C.elementType && !YS && (I.props !== C.memoizedProps && a("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Ai(C) || "instance"), I.state !== C.memoizedState && a("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Ai(C) || "instance")), C.mode & Lr)
                  try {
                    o_(), I.componentDidMount();
                  } finally {
                    s_(C);
                  }
                else
                  I.componentDidMount();
              else {
                var O = C.elementType === C.type ? p.memoizedProps : vp(C.type, p.memoizedProps), W = p.memoizedState;
                if (C.type === C.elementType && !YS && (I.props !== C.memoizedProps && a("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Ai(C) || "instance"), I.state !== C.memoizedState && a("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Ai(C) || "instance")), C.mode & Lr)
                  try {
                    o_(), I.componentDidUpdate(O, W, I.__reactInternalSnapshotBeforeUpdate);
                  } finally {
                    s_(C);
                  }
                else
                  I.componentDidUpdate(O, W, I.__reactInternalSnapshotBeforeUpdate);
              }
            var q = C.updateQueue;
            q !== null && (C.type === C.elementType && !YS && (I.props !== C.memoizedProps && a("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", Ai(C) || "instance"), I.state !== C.memoizedState && a("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", Ai(C) || "instance")), uwe(C, q, I));
            break;
          }
          case h: {
            var ee = C.updateQueue;
            if (ee !== null) {
              var ue = null;
              if (C.child !== null)
                switch (C.child.tag) {
                  case m:
                    ue = C.child.stateNode;
                    break;
                  case u:
                    ue = C.child.stateNode;
                    break;
                }
              uwe(C, ee, ue);
            }
            break;
          }
          case m: {
            var me = C.stateNode;
            if (p === null && C.flags & _r) {
              var Me = C.type, Ae = C.memoizedProps;
              jqe(me, Me, Ae);
            }
            break;
          }
          case _:
            break;
          case g:
            break;
          case D: {
            {
              var nt = C.memoizedProps, rt = nt.onCommit, ft = nt.onRender, un = C.stateNode.effectDuration, ai = Wwe(), Xn = p === null ? "mount" : "update";
              Hwe() && (Xn = "nested-update"), typeof ft == "function" && ft(C.memoizedProps.id, Xn, C.actualDuration, C.treeBaseDuration, C.actualStartTime, ai);
              {
                typeof rt == "function" && rt(C.memoizedProps.id, Xn, un, ai), EZe(C);
                var Or = C.return;
                e: for (; Or !== null; ) {
                  switch (Or.tag) {
                    case h:
                      var Sr = Or.stateNode;
                      Sr.effectDuration += un;
                      break e;
                    case D:
                      var qe = Or.stateNode;
                      qe.effectDuration += un;
                      break e;
                  }
                  Or = Or.return;
                }
              }
            }
            break;
          }
          case N: {
            MXe(f, C);
            break;
          }
          case K:
          case H:
          case X:
          case Y:
          case G:
          case oe:
            break;
          default:
            throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
        }
      zc || C.flags & wa && xSe(C);
    }
    function kXe(f) {
      switch (f.tag) {
        case c:
        case T:
        case M: {
          if (f.mode & Lr)
            try {
              o_(), wSe(f, f.return);
            } finally {
              s_(f);
            }
          else
            wSe(f, f.return);
          break;
        }
        case u: {
          var p = f.stateNode;
          typeof p.componentDidMount == "function" && CXe(f, f.return, p), SSe(f, f.return);
          break;
        }
        case m: {
          SSe(f, f.return);
          break;
        }
      }
    }
    function DXe(f, p) {
      for (var C = null, x = f; ; ) {
        if (x.tag === m) {
          if (C === null) {
            C = x;
            try {
              var I = x.stateNode;
              p ? tKe(I) : iKe(x.stateNode, x.memoizedProps);
            } catch (W) {
              Lo(f, f.return, W);
            }
          }
        } else if (x.tag === _) {
          if (C === null)
            try {
              var O = x.stateNode;
              p ? nKe(O) : rKe(O, x.memoizedProps);
            } catch (W) {
              Lo(f, f.return, W);
            }
        } else if (!((x.tag === Y || x.tag === G) && x.memoizedState !== null && x !== f)) {
          if (x.child !== null) {
            x.child.return = x, x = x.child;
            continue;
          }
        }
        if (x === f)
          return;
        for (; x.sibling === null; ) {
          if (x.return === null || x.return === f)
            return;
          C === x && (C = null), x = x.return;
        }
        C === x && (C = null), x.sibling.return = x.return, x = x.sibling;
      }
    }
    function xSe(f) {
      var p = f.ref;
      if (p !== null) {
        var C = f.stateNode, x;
        switch (f.tag) {
          case m:
            x = C;
            break;
          default:
            x = C;
        }
        if (typeof p == "function") {
          var I;
          if (f.mode & Lr)
            try {
              o_(), I = p(x);
            } finally {
              s_(f);
            }
          else
            I = p(x);
          typeof I == "function" && a("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", Ai(f));
        } else
          p.hasOwnProperty("current") || a("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", Ai(f)), p.current = x;
      }
    }
    function IXe(f) {
      var p = f.alternate;
      p !== null && (p.return = null), f.return = null;
    }
    function LSe(f) {
      var p = f.alternate;
      p !== null && (f.alternate = null, LSe(p));
      {
        if (f.child = null, f.deletions = null, f.sibling = null, f.tag === m) {
          var C = f.stateNode;
          C !== null && PKe(C);
        }
        f.stateNode = null, f._debugOwner = null, f.return = null, f.dependencies = null, f.memoizedProps = null, f.memoizedState = null, f.pendingProps = null, f.stateNode = null, f.updateQueue = null;
      }
    }
    function NXe(f) {
      for (var p = f.return; p !== null; ) {
        if (TSe(p))
          return p;
        p = p.return;
      }
      throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
    }
    function TSe(f) {
      return f.tag === m || f.tag === h || f.tag === g;
    }
    function kSe(f) {
      var p = f;
      e: for (; ; ) {
        for (; p.sibling === null; ) {
          if (p.return === null || TSe(p.return))
            return null;
          p = p.return;
        }
        for (p.sibling.return = p.return, p = p.sibling; p.tag !== m && p.tag !== _ && p.tag !== j; ) {
          if (p.flags & qo || p.child === null || p.tag === g)
            continue e;
          p.child.return = p, p = p.child;
        }
        if (!(p.flags & qo))
          return p.stateNode;
      }
    }
    function RXe(f) {
      var p = NXe(f);
      switch (p.tag) {
        case m: {
          var C = p.stateNode;
          p.flags & ks && (I1e(C), p.flags &= ~ks);
          var x = kSe(f);
          FQ(f, x, C);
          break;
        }
        case h:
        case g: {
          var I = p.stateNode.containerInfo, O = kSe(f);
          PQ(f, O, I);
          break;
        }
        // eslint-disable-next-line-no-fallthrough
        default:
          throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
      }
    }
    function PQ(f, p, C) {
      var x = f.tag, I = x === m || x === _;
      if (I) {
        var O = f.stateNode;
        p ? Zqe(C, O, p) : Yqe(C, O);
      } else if (x !== g) {
        var W = f.child;
        if (W !== null) {
          PQ(W, p, C);
          for (var q = W.sibling; q !== null; )
            PQ(q, p, C), q = q.sibling;
        }
      }
    }
    function FQ(f, p, C) {
      var x = f.tag, I = x === m || x === _;
      if (I) {
        var O = f.stateNode;
        p ? Xqe(C, O, p) : Kqe(C, O);
      } else if (x !== g) {
        var W = f.child;
        if (W !== null) {
          FQ(W, p, C);
          for (var q = W.sibling; q !== null; )
            FQ(q, p, C), q = q.sibling;
        }
      }
    }
    var $c = null, wp = !1;
    function AXe(f, p, C) {
      {
        var x = p;
        e: for (; x !== null; ) {
          switch (x.tag) {
            case m: {
              $c = x.stateNode, wp = !1;
              break e;
            }
            case h: {
              $c = x.stateNode.containerInfo, wp = !0;
              break e;
            }
            case g: {
              $c = x.stateNode.containerInfo, wp = !0;
              break e;
            }
          }
          x = x.return;
        }
        if ($c === null)
          throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
        DSe(f, p, C), $c = null, wp = !1;
      }
      IXe(C);
    }
    function bC(f, p, C) {
      for (var x = C.child; x !== null; )
        DSe(f, p, x), x = x.sibling;
    }
    function DSe(f, p, C) {
      switch (U0(C), C.tag) {
        case m:
          zc || iI(C, p);
        // eslint-disable-next-line-no-fallthrough
        case _: {
          {
            var x = $c, I = wp;
            $c = null, bC(f, p, C), $c = x, wp = I, $c !== null && (wp ? Jqe($c, C.stateNode) : Qqe($c, C.stateNode));
          }
          return;
        }
        case j: {
          $c !== null && (wp ? eKe($c, C.stateNode) : KX($c, C.stateNode));
          return;
        }
        case g: {
          {
            var O = $c, W = wp;
            $c = C.stateNode.containerInfo, wp = !0, bC(f, p, C), $c = O, wp = W;
          }
          return;
        }
        case c:
        case T:
        case R:
        case M: {
          if (!zc) {
            var q = C.updateQueue;
            if (q !== null) {
              var ee = q.lastEffect;
              if (ee !== null) {
                var ue = ee.next, me = ue;
                do {
                  var Me = me, Ae = Me.destroy, nt = Me.tag;
                  Ae !== void 0 && ((nt & n_) !== uh ? t7(C, p, Ae) : (nt & Al) !== uh && (oO(C), C.mode & Lr ? (o_(), t7(C, p, Ae), s_(C)) : t7(C, p, Ae), z0())), me = me.next;
                } while (me !== ue);
              }
            }
          }
          bC(f, p, C);
          return;
        }
        case u: {
          if (!zc) {
            iI(C, p);
            var rt = C.stateNode;
            typeof rt.componentWillUnmount == "function" && MQ(C, p, rt);
          }
          bC(f, p, C);
          return;
        }
        case X: {
          bC(f, p, C);
          return;
        }
        case Y: {
          if (
            // TODO: Remove this dead flag
            C.mode & gr
          ) {
            var ft = zc;
            zc = ft || C.memoizedState !== null, bC(f, p, C), zc = ft;
          } else
            bC(f, p, C);
          break;
        }
        default: {
          bC(f, p, C);
          return;
        }
      }
    }
    function OXe(f) {
      f.memoizedState;
    }
    function MXe(f, p) {
      var C = p.memoizedState;
      if (C === null) {
        var x = p.alternate;
        if (x !== null) {
          var I = x.memoizedState;
          if (I !== null) {
            var O = I.dehydrated;
            O !== null && vKe(O);
          }
        }
      }
    }
    function ISe(f) {
      var p = f.updateQueue;
      if (p !== null) {
        f.updateQueue = null;
        var C = f.stateNode;
        C === null && (C = f.stateNode = new bXe()), p.forEach(function(x) {
          var I = NZe.bind(null, f, x);
          if (!C.has(x)) {
            if (C.add(x), cc)
              if (tI !== null && nI !== null)
                DM(nI, tI);
              else
                throw Error("Expected finished root and lanes to be set. This is a bug in React.");
            x.then(I, I);
          }
        });
      }
    }
    function PXe(f, p, C) {
      tI = C, nI = f, Vs(p), NSe(p, f), Vs(p), tI = null, nI = null;
    }
    function Sp(f, p, C) {
      var x = p.deletions;
      if (x !== null)
        for (var I = 0; I < x.length; I++) {
          var O = x[I];
          try {
            AXe(f, p, O);
          } catch (ee) {
            Lo(O, p, ee);
          }
        }
      var W = rf();
      if (p.subtreeFlags & W0)
        for (var q = p.child; q !== null; )
          Vs(q), NSe(q, f), q = q.sibling;
      Vs(W);
    }
    function NSe(f, p, C) {
      var x = f.alternate, I = f.flags;
      switch (f.tag) {
        case c:
        case T:
        case R:
        case M: {
          if (Sp(p, f), a_(f), I & _r) {
            try {
              Cp(n_ | Rl, f, f.return), _C(n_ | Rl, f);
            } catch (xi) {
              Lo(f, f.return, xi);
            }
            if (f.mode & Lr) {
              try {
                o_(), Cp(Al | Rl, f, f.return);
              } catch (xi) {
                Lo(f, f.return, xi);
              }
              s_(f);
            } else
              try {
                Cp(Al | Rl, f, f.return);
              } catch (xi) {
                Lo(f, f.return, xi);
              }
          }
          return;
        }
        case u: {
          Sp(p, f), a_(f), I & wa && x !== null && iI(x, x.return);
          return;
        }
        case m: {
          Sp(p, f), a_(f), I & wa && x !== null && iI(x, x.return);
          {
            if (f.flags & ks) {
              var O = f.stateNode;
              try {
                I1e(O);
              } catch (xi) {
                Lo(f, f.return, xi);
              }
            }
            if (I & _r) {
              var W = f.stateNode;
              if (W != null) {
                var q = f.memoizedProps, ee = x !== null ? x.memoizedProps : q, ue = f.type, me = f.updateQueue;
                if (f.updateQueue = null, me !== null)
                  try {
                    Gqe(W, me, ue, ee, q, f);
                  } catch (xi) {
                    Lo(f, f.return, xi);
                  }
              }
            }
          }
          return;
        }
        case _: {
          if (Sp(p, f), a_(f), I & _r) {
            if (f.stateNode === null)
              throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
            var Me = f.stateNode, Ae = f.memoizedProps, nt = x !== null ? x.memoizedProps : Ae;
            try {
              qqe(Me, nt, Ae);
            } catch (xi) {
              Lo(f, f.return, xi);
            }
          }
          return;
        }
        case h: {
          if (Sp(p, f), a_(f), I & _r && x !== null) {
            var rt = x.memoizedState;
            if (rt.isDehydrated)
              try {
                bKe(p.containerInfo);
              } catch (xi) {
                Lo(f, f.return, xi);
              }
          }
          return;
        }
        case g: {
          Sp(p, f), a_(f);
          return;
        }
        case N: {
          Sp(p, f), a_(f);
          var ft = f.child;
          if (ft.flags & ug) {
            var un = ft.stateNode, ai = ft.memoizedState, Xn = ai !== null;
            if (un.isHidden = Xn, Xn) {
              var Or = ft.alternate !== null && ft.alternate.memoizedState !== null;
              Or || mZe();
            }
          }
          if (I & _r) {
            try {
              OXe(f);
            } catch (xi) {
              Lo(f, f.return, xi);
            }
            ISe(f);
          }
          return;
        }
        case Y: {
          var Sr = x !== null && x.memoizedState !== null;
          if (
            // TODO: Remove this dead flag
            f.mode & gr
          ) {
            var qe = zc;
            zc = qe || Sr, Sp(p, f), zc = qe;
          } else
            Sp(p, f);
          if (a_(f), I & ug) {
            var gt = f.stateNode, Ke = f.memoizedState, Pt = Ke !== null, wn = f;
            if (gt.isHidden = Pt, Pt && !Sr && (wn.mode & gr) !== ei) {
              An = wn;
              for (var _n = wn.child; _n !== null; )
                An = _n, BXe(_n), _n = _n.sibling;
            }
            DXe(wn, Pt);
          }
          return;
        }
        case K: {
          Sp(p, f), a_(f), I & _r && ISe(f);
          return;
        }
        case X:
          return;
        default: {
          Sp(p, f), a_(f);
          return;
        }
      }
    }
    function a_(f) {
      var p = f.flags;
      if (p & qo) {
        try {
          RXe(f);
        } catch (C) {
          Lo(f, f.return, C);
        }
        f.flags &= ~qo;
      }
      p & Ko && (f.flags &= ~Ko);
    }
    function FXe(f, p, C) {
      tI = C, nI = p, An = f, RSe(f, p, C), tI = null, nI = null;
    }
    function RSe(f, p, C) {
      for (var x = (f.mode & gr) !== ei; An !== null; ) {
        var I = An, O = I.child;
        if (I.tag === Y && x) {
          var W = I.memoizedState !== null, q = W || e7;
          if (q) {
            BQ(f, p, C);
            continue;
          } else {
            var ee = I.alternate, ue = ee !== null && ee.memoizedState !== null, me = ue || zc, Me = e7, Ae = zc;
            e7 = q, zc = me, zc && !Ae && (An = I, HXe(I));
            for (var nt = O; nt !== null; )
              An = nt, RSe(
                nt,
                // New root; bubble back up to here and stop.
                p,
                C
              ), nt = nt.sibling;
            An = I, e7 = Me, zc = Ae, BQ(f, p, C);
            continue;
          }
        }
        (I.subtreeFlags & Bm) !== Jn && O !== null ? (O.return = I, An = O) : BQ(f, p, C);
      }
    }
    function BQ(f, p, C) {
      for (; An !== null; ) {
        var x = An;
        if ((x.flags & Bm) !== Jn) {
          var I = x.alternate;
          Vs(x);
          try {
            TXe(p, I, x, C);
          } catch (W) {
            Lo(x, x.return, W);
          }
          Go();
        }
        if (x === f) {
          An = null;
          return;
        }
        var O = x.sibling;
        if (O !== null) {
          O.return = x.return, An = O;
          return;
        }
        An = x.return;
      }
    }
    function BXe(f) {
      for (; An !== null; ) {
        var p = An, C = p.child;
        switch (p.tag) {
          case c:
          case T:
          case R:
          case M: {
            if (p.mode & Lr)
              try {
                o_(), Cp(Al, p, p.return);
              } finally {
                s_(p);
              }
            else
              Cp(Al, p, p.return);
            break;
          }
          case u: {
            iI(p, p.return);
            var x = p.stateNode;
            typeof x.componentWillUnmount == "function" && MQ(p, p.return, x);
            break;
          }
          case m: {
            iI(p, p.return);
            break;
          }
          case Y: {
            var I = p.memoizedState !== null;
            if (I) {
              ASe(f);
              continue;
            }
            break;
          }
        }
        C !== null ? (C.return = p, An = C) : ASe(f);
      }
    }
    function ASe(f) {
      for (; An !== null; ) {
        var p = An;
        if (p === f) {
          An = null;
          return;
        }
        var C = p.sibling;
        if (C !== null) {
          C.return = p.return, An = C;
          return;
        }
        An = p.return;
      }
    }
    function HXe(f) {
      for (; An !== null; ) {
        var p = An, C = p.child;
        if (p.tag === Y) {
          var x = p.memoizedState !== null;
          if (x) {
            OSe(f);
            continue;
          }
        }
        C !== null ? (C.return = p, An = C) : OSe(f);
      }
    }
    function OSe(f) {
      for (; An !== null; ) {
        var p = An;
        Vs(p);
        try {
          kXe(p);
        } catch (x) {
          Lo(p, p.return, x);
        }
        if (Go(), p === f) {
          An = null;
          return;
        }
        var C = p.sibling;
        if (C !== null) {
          C.return = p.return, An = C;
          return;
        }
        An = p.return;
      }
    }
    function WXe(f, p, C, x) {
      An = p, VXe(p, f, C, x);
    }
    function VXe(f, p, C, x) {
      for (; An !== null; ) {
        var I = An, O = I.child;
        (I.subtreeFlags & Tl) !== Jn && O !== null ? (O.return = I, An = O) : UXe(f, p, C, x);
      }
    }
    function UXe(f, p, C, x) {
      for (; An !== null; ) {
        var I = An;
        if ((I.flags & dd) !== Jn) {
          Vs(I);
          try {
            zXe(p, I, C, x);
          } catch (W) {
            Lo(I, I.return, W);
          }
          Go();
        }
        if (I === f) {
          An = null;
          return;
        }
        var O = I.sibling;
        if (O !== null) {
          O.return = I.return, An = O;
          return;
        }
        An = I.return;
      }
    }
    function zXe(f, p, C, x) {
      switch (p.tag) {
        case c:
        case T:
        case M: {
          if (p.mode & Lr) {
            iQ();
            try {
              _C(Vc | Rl, p);
            } finally {
              nQ(p);
            }
          } else
            _C(Vc | Rl, p);
          break;
        }
      }
    }
    function $Xe(f) {
      An = f, jXe();
    }
    function jXe() {
      for (; An !== null; ) {
        var f = An, p = f.child;
        if ((An.flags & wu) !== Jn) {
          var C = f.deletions;
          if (C !== null) {
            for (var x = 0; x < C.length; x++) {
              var I = C[x];
              An = I, KXe(I, f);
            }
            {
              var O = f.alternate;
              if (O !== null) {
                var W = O.child;
                if (W !== null) {
                  O.child = null;
                  do {
                    var q = W.sibling;
                    W.sibling = null, W = q;
                  } while (W !== null);
                }
              }
            }
            An = f;
          }
        }
        (f.subtreeFlags & Tl) !== Jn && p !== null ? (p.return = f, An = p) : GXe();
      }
    }
    function GXe() {
      for (; An !== null; ) {
        var f = An;
        (f.flags & dd) !== Jn && (Vs(f), qXe(f), Go());
        var p = f.sibling;
        if (p !== null) {
          p.return = f.return, An = p;
          return;
        }
        An = f.return;
      }
    }
    function qXe(f) {
      switch (f.tag) {
        case c:
        case T:
        case M: {
          f.mode & Lr ? (iQ(), Cp(Vc | Rl, f, f.return), nQ(f)) : Cp(Vc | Rl, f, f.return);
          break;
        }
      }
    }
    function KXe(f, p) {
      for (; An !== null; ) {
        var C = An;
        Vs(C), XXe(C, p), Go();
        var x = C.child;
        x !== null ? (x.return = C, An = x) : YXe(f);
      }
    }
    function YXe(f) {
      for (; An !== null; ) {
        var p = An, C = p.sibling, x = p.return;
        if (LSe(p), p === f) {
          An = null;
          return;
        }
        if (C !== null) {
          C.return = x, An = C;
          return;
        }
        An = x;
      }
    }
    function XXe(f, p) {
      switch (f.tag) {
        case c:
        case T:
        case M: {
          f.mode & Lr ? (iQ(), Cp(Vc, f, p), nQ(f)) : Cp(Vc, f, p);
          break;
        }
      }
    }
    function ZXe(f) {
      switch (f.tag) {
        case c:
        case T:
        case M: {
          try {
            _C(Al | Rl, f);
          } catch (C) {
            Lo(f, f.return, C);
          }
          break;
        }
        case u: {
          var p = f.stateNode;
          try {
            p.componentDidMount();
          } catch (C) {
            Lo(f, f.return, C);
          }
          break;
        }
      }
    }
    function QXe(f) {
      switch (f.tag) {
        case c:
        case T:
        case M: {
          try {
            _C(Vc | Rl, f);
          } catch (p) {
            Lo(f, f.return, p);
          }
          break;
        }
      }
    }
    function JXe(f) {
      switch (f.tag) {
        case c:
        case T:
        case M: {
          try {
            Cp(Al | Rl, f, f.return);
          } catch (C) {
            Lo(f, f.return, C);
          }
          break;
        }
        case u: {
          var p = f.stateNode;
          typeof p.componentWillUnmount == "function" && MQ(f, f.return, p);
          break;
        }
      }
    }
    function eZe(f) {
      switch (f.tag) {
        case c:
        case T:
        case M:
          try {
            Cp(Vc | Rl, f, f.return);
          } catch (p) {
            Lo(f, f.return, p);
          }
      }
    }
    if (typeof Symbol == "function" && Symbol.for) {
      var bM = Symbol.for;
      bM("selector.component"), bM("selector.has_pseudo_class"), bM("selector.role"), bM("selector.test_id"), bM("selector.text");
    }
    var tZe = [];
    function nZe() {
      tZe.forEach(function(f) {
        return f();
      });
    }
    var iZe = n.ReactCurrentActQueue;
    function rZe(f) {
      {
        var p = (
          // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
          typeof IS_REACT_ACT_ENVIRONMENT < "u" ? IS_REACT_ACT_ENVIRONMENT : void 0
        ), C = typeof jest < "u";
        return C && p !== !1;
      }
    }
    function MSe() {
      {
        var f = (
          // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
          typeof IS_REACT_ACT_ENVIRONMENT < "u" ? IS_REACT_ACT_ENVIRONMENT : void 0
        );
        return !f && iZe.current !== null && a("The current testing environment is not configured to support act(...)"), f;
      }
    }
    var sZe = Math.ceil, HQ = n.ReactCurrentDispatcher, WQ = n.ReactCurrentOwner, jc = n.ReactCurrentBatchConfig, Ep = n.ReactCurrentActQueue, Pl = (
      /*             */
      0
    ), PSe = (
      /*               */
      1
    ), Gc = (
      /*                */
      2
    ), Cg = (
      /*                */
      4
    ), Ev = 0, vM = 1, XS = 2, n7 = 3, yM = 4, FSe = 5, VQ = 6, Ar = Pl, bd = null, la = null, Fl = pt, l_ = pt, UQ = lC(pt), Bl = Ev, CM = null, i7 = pt, wM = pt, r7 = pt, SM = null, dh = null, zQ = 0, BSe = 500, HSe = 1 / 0, oZe = 500, xv = null;
    function EM() {
      HSe = ra() + oZe;
    }
    function WSe() {
      return HSe;
    }
    var s7 = !1, $Q = null, rI = null, ZS = !1, vC = null, xM = pt, jQ = [], GQ = null, aZe = 50, LM = 0, qQ = null, KQ = !1, o7 = !1, lZe = 50, sI = 0, a7 = null, TM = Is, l7 = pt, VSe = !1;
    function c7() {
      return bd;
    }
    function vd() {
      return (Ar & (Gc | Cg)) !== Pl ? ra() : (TM !== Is || (TM = ra()), TM);
    }
    function yC(f) {
      var p = f.mode;
      if ((p & gr) === ei)
        return Ci;
      if ((Ar & Gc) !== Pl && Fl !== pt)
        return il(Fl);
      var C = iYe() !== nYe;
      if (C) {
        if (jc.transition !== null) {
          var x = jc.transition;
          x._updatedFibers || (x._updatedFibers = /* @__PURE__ */ new Set()), x._updatedFibers.add(f);
        }
        return l7 === Ea && (l7 = mO()), l7;
      }
      var I = fd();
      if (I !== Ea)
        return I;
      var O = Vqe();
      return O;
    }
    function cZe(f) {
      var p = f.mode;
      return (p & gr) === ei ? Ci : b8();
    }
    function Hl(f, p, C, x) {
      AZe(), VSe && a("useInsertionEffect must not schedule updates."), KQ && (o7 = !0), Y0(f, C, x), (Ar & Gc) !== pt && f === bd ? PZe(p) : (cc && y8(f, p, C), FZe(p), f === bd && ((Ar & Gc) === Pl && (wM = Xi(wM, C)), Bl === yM && CC(f, Fl)), hh(f, x), C === Ci && Ar === Pl && (p.mode & gr) === ei && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
      !Ep.isBatchingLegacy && (EM(), V1e()));
    }
    function uZe(f, p, C) {
      var x = f.current;
      x.lanes = p, Y0(f, p, C), hh(f, C);
    }
    function dZe(f) {
      return (
        // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
        // decided not to enable it.
        (Ar & Gc) !== Pl
      );
    }
    function hh(f, p) {
      var C = f.callbackNode;
      p8(f, p);
      var x = Tu(f, f === bd ? Fl : pt);
      if (x === pt) {
        C !== null && iEe(C), f.callbackNode = null, f.callbackPriority = Ea;
        return;
      }
      var I = sv(x), O = f.callbackPriority;
      if (O === I && // Special case related to `act`. If the currently scheduled task is a
      // Scheduler task, rather than an `act` task, cancel it and re-scheduled
      // on the `act` queue.
      !(Ep.current !== null && C !== tJ)) {
        C == null && O !== Ci && a("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
        return;
      }
      C != null && iEe(C);
      var W;
      if (I === Ci)
        f.tag === cC ? (Ep.isBatchingLegacy !== null && (Ep.didScheduleLegacyUpdate = !0), HKe($Se.bind(null, f))) : W1e($Se.bind(null, f)), Ep.current !== null ? Ep.current.push(uC) : zqe(function() {
          (Ar & (Gc | Cg)) === Pl && uC();
        }), W = null;
      else {
        var q;
        switch (w8(x)) {
          case Du:
            q = up;
            break;
          case rh:
            q = lS;
            break;
          case Dl:
            q = Jb;
            break;
          case mD:
            q = V0;
            break;
          default:
            q = Jb;
            break;
        }
        W = nJ(q, USe.bind(null, f));
      }
      f.callbackPriority = I, f.callbackNode = W;
    }
    function USe(f, p) {
      if (DYe(), TM = Is, l7 = pt, (Ar & (Gc | Cg)) !== Pl)
        throw new Error("Should not already be working.");
      var C = f.callbackNode, x = Tv();
      if (x && f.callbackNode !== C)
        return null;
      var I = Tu(f, f === bd ? Fl : pt);
      if (I === pt)
        return null;
      var O = !yS(f, I) && !_8(f, I) && !p, W = O ? CZe(f, I) : d7(f, I);
      if (W !== Ev) {
        if (W === XS) {
          var q = lD(f);
          q !== pt && (I = q, W = YQ(f, q));
        }
        if (W === vM) {
          var ee = CM;
          throw QS(f, pt), CC(f, I), hh(f, ra()), ee;
        }
        if (W === VQ)
          CC(f, I);
        else {
          var ue = !yS(f, I), me = f.current.alternate;
          if (ue && !fZe(me)) {
            if (W = d7(f, I), W === XS) {
              var Me = lD(f);
              Me !== pt && (I = Me, W = YQ(f, Me));
            }
            if (W === vM) {
              var Ae = CM;
              throw QS(f, pt), CC(f, I), hh(f, ra()), Ae;
            }
          }
          f.finishedWork = me, f.finishedLanes = I, hZe(f, W, I);
        }
      }
      return hh(f, ra()), f.callbackNode === C ? USe.bind(null, f) : null;
    }
    function YQ(f, p) {
      var C = SM;
      if (av(f)) {
        var x = QS(f, p);
        x.flags |= Ao, RKe(f.containerInfo);
      }
      var I = d7(f, p);
      if (I !== XS) {
        var O = dh;
        dh = C, O !== null && zSe(O);
      }
      return I;
    }
    function zSe(f) {
      dh === null ? dh = f : dh.push.apply(dh, f);
    }
    function hZe(f, p, C) {
      switch (p) {
        case Ev:
        case vM:
          throw new Error("Root did not complete. This is a bug in React.");
        // Flow knows about invariant, so it complains if I add a break
        // statement, but eslint doesn't know about invariant, so it complains
        // if I do. eslint-disable-next-line no-fallthrough
        case XS: {
          JS(f, dh, xv);
          break;
        }
        case n7: {
          if (CC(f, C), cD(C) && // do not delay if we're inside an act() scope
          !rEe()) {
            var x = zQ + BSe - ra();
            if (x > 10) {
              var I = Tu(f, pt);
              if (I !== pt)
                break;
              var O = f.suspendedLanes;
              if (!ov(O, C)) {
                vd(), fD(f, O);
                break;
              }
              f.timeoutHandle = GX(JS.bind(null, f, dh, xv), x);
              break;
            }
          }
          JS(f, dh, xv);
          break;
        }
        case yM: {
          if (CC(f, C), _X(C))
            break;
          if (!rEe()) {
            var W = hO(f, C), q = W, ee = ra() - q, ue = RZe(ee) - ee;
            if (ue > 10) {
              f.timeoutHandle = GX(JS.bind(null, f, dh, xv), ue);
              break;
            }
          }
          JS(f, dh, xv);
          break;
        }
        case FSe: {
          JS(f, dh, xv);
          break;
        }
        default:
          throw new Error("Unknown root exit status.");
      }
    }
    function fZe(f) {
      for (var p = f; ; ) {
        if (p.flags & Hk) {
          var C = p.updateQueue;
          if (C !== null) {
            var x = C.stores;
            if (x !== null)
              for (var I = 0; I < x.length; I++) {
                var O = x[I], W = O.getSnapshot, q = O.value;
                try {
                  if (!mn(W(), q))
                    return !1;
                } catch {
                  return !1;
                }
              }
          }
        }
        var ee = p.child;
        if (p.subtreeFlags & Hk && ee !== null) {
          ee.return = p, p = ee;
          continue;
        }
        if (p === f)
          return !0;
        for (; p.sibling === null; ) {
          if (p.return === null || p.return === f)
            return !0;
          p = p.return;
        }
        p.sibling.return = p.return, p = p.sibling;
      }
      return !0;
    }
    function CC(f, p) {
      p = CS(p, r7), p = CS(p, wM), bO(f, p);
    }
    function $Se(f) {
      if (IYe(), (Ar & (Gc | Cg)) !== Pl)
        throw new Error("Should not already be working.");
      Tv();
      var p = Tu(f, pt);
      if (!ku(p, Ci))
        return hh(f, ra()), null;
      var C = d7(f, p);
      if (f.tag !== cC && C === XS) {
        var x = lD(f);
        x !== pt && (p = x, C = YQ(f, x));
      }
      if (C === vM) {
        var I = CM;
        throw QS(f, pt), CC(f, p), hh(f, ra()), I;
      }
      if (C === VQ)
        throw new Error("Root did not complete. This is a bug in React.");
      var O = f.current.alternate;
      return f.finishedWork = O, f.finishedLanes = p, JS(f, dh, xv), hh(f, ra()), null;
    }
    function gZe(f, p) {
      p !== pt && (wS(f, Xi(p, Ci)), hh(f, ra()), (Ar & (Gc | Cg)) === Pl && (EM(), uC()));
    }
    function XQ(f, p) {
      var C = Ar;
      Ar |= PSe;
      try {
        return f(p);
      } finally {
        Ar = C, Ar === Pl && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
        !Ep.isBatchingLegacy && (EM(), V1e());
      }
    }
    function pZe(f, p, C, x, I) {
      var O = fd(), W = jc.transition;
      try {
        return jc.transition = null, Ha(Du), f(p, C, x, I);
      } finally {
        Ha(O), jc.transition = W, Ar === Pl && EM();
      }
    }
    function Lv(f) {
      vC !== null && vC.tag === cC && (Ar & (Gc | Cg)) === Pl && Tv();
      var p = Ar;
      Ar |= PSe;
      var C = jc.transition, x = fd();
      try {
        return jc.transition = null, Ha(Du), f ? f() : void 0;
      } finally {
        Ha(x), jc.transition = C, Ar = p, (Ar & (Gc | Cg)) === Pl && uC();
      }
    }
    function jSe() {
      return (Ar & (Gc | Cg)) !== Pl;
    }
    function u7(f, p) {
      Ru(UQ, l_, f), l_ = Xi(l_, p);
    }
    function ZQ(f) {
      l_ = UQ.current, Nu(UQ, f);
    }
    function QS(f, p) {
      f.finishedWork = null, f.finishedLanes = pt;
      var C = f.timeoutHandle;
      if (C !== qX && (f.timeoutHandle = qX, Uqe(C)), la !== null)
        for (var x = la.return; x !== null; ) {
          var I = x.alternate;
          ySe(I, x), x = x.return;
        }
      bd = f;
      var O = eE(f.current, null);
      return la = O, Fl = l_ = p, Bl = Ev, CM = null, i7 = pt, wM = pt, r7 = pt, SM = null, dh = null, uYe(), mp.discardPendingWarnings(), O;
    }
    function GSe(f, p) {
      do {
        var C = la;
        try {
          if (y9(), mwe(), Go(), WQ.current = null, C === null || C.return === null) {
            Bl = vM, CM = p, la = null;
            return;
          }
          if (Ve && C.mode & Lr && Y9(C, !0), ze)
            if (Wm(), p !== null && typeof p == "object" && typeof p.then == "function") {
              var x = p;
              uS(C, x, Fl);
            } else
              fg(C, p, Fl);
          HYe(f, C.return, C, p, Fl), XSe(C);
        } catch (I) {
          p = I, la === C && C !== null ? (C = C.return, la = C) : C = la;
          continue;
        }
        return;
      } while (!0);
    }
    function qSe() {
      var f = HQ.current;
      return HQ.current = $9, f === null ? $9 : f;
    }
    function KSe(f) {
      HQ.current = f;
    }
    function mZe() {
      zQ = ra();
    }
    function kM(f) {
      i7 = Xi(f, i7);
    }
    function _Ze() {
      Bl === Ev && (Bl = n7);
    }
    function QQ() {
      (Bl === Ev || Bl === n7 || Bl === XS) && (Bl = yM), bd !== null && (jm(i7) || jm(wM)) && CC(bd, Fl);
    }
    function bZe(f) {
      Bl !== yM && (Bl = XS), SM === null ? SM = [f] : SM.push(f);
    }
    function vZe() {
      return Bl === Ev;
    }
    function d7(f, p) {
      var C = Ar;
      Ar |= Gc;
      var x = qSe();
      if (bd !== f || Fl !== p) {
        if (cc) {
          var I = f.memoizedUpdaters;
          I.size > 0 && (DM(f, Fl), I.clear()), vO(f, p);
        }
        xv = pD(), QS(f, p);
      }
      lO(p);
      do
        try {
          yZe();
          break;
        } catch (O) {
          GSe(f, O);
        }
      while (!0);
      if (y9(), Ar = C, KSe(x), la !== null)
        throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
      return Oo(), bd = null, Fl = pt, Bl;
    }
    function yZe() {
      for (; la !== null; )
        YSe(la);
    }
    function CZe(f, p) {
      var C = Ar;
      Ar |= Gc;
      var x = qSe();
      if (bd !== f || Fl !== p) {
        if (cc) {
          var I = f.memoizedUpdaters;
          I.size > 0 && (DM(f, Fl), I.clear()), vO(f, p);
        }
        xv = pD(), EM(), QS(f, p);
      }
      lO(p);
      do
        try {
          wZe();
          break;
        } catch (O) {
          GSe(f, O);
        }
      while (!0);
      return y9(), KSe(x), Ar = C, la !== null ? (cO(), Ev) : (Oo(), bd = null, Fl = pt, Bl);
    }
    function wZe() {
      for (; la !== null && !eO(); )
        YSe(la);
    }
    function YSe(f) {
      var p = f.alternate;
      Vs(f);
      var C;
      (f.mode & Lr) !== ei ? (tQ(f), C = JQ(p, f, l_), Y9(f, !0)) : C = JQ(p, f, l_), Go(), f.memoizedProps = f.pendingProps, C === null ? XSe(f) : la = C, WQ.current = null;
    }
    function XSe(f) {
      var p = f;
      do {
        var C = p.alternate, x = p.return;
        if ((p.flags & Zb) === Jn) {
          Vs(p);
          var I = void 0;
          if ((p.mode & Lr) === ei ? I = vSe(C, p, l_) : (tQ(p), I = vSe(C, p, l_), Y9(p, !1)), Go(), I !== null) {
            la = I;
            return;
          }
        } else {
          var O = _Xe(C, p);
          if (O !== null) {
            O.flags &= i8, la = O;
            return;
          }
          if ((p.mode & Lr) !== ei) {
            Y9(p, !1);
            for (var W = p.actualDuration, q = p.child; q !== null; )
              W += q.actualDuration, q = q.sibling;
            p.actualDuration = W;
          }
          if (x !== null)
            x.flags |= Zb, x.subtreeFlags = Jn, x.deletions = null;
          else {
            Bl = VQ, la = null;
            return;
          }
        }
        var ee = p.sibling;
        if (ee !== null) {
          la = ee;
          return;
        }
        p = x, la = p;
      } while (p !== null);
      Bl === Ev && (Bl = FSe);
    }
    function JS(f, p, C) {
      var x = fd(), I = jc.transition;
      try {
        jc.transition = null, Ha(Du), SZe(f, p, C, x);
      } finally {
        jc.transition = I, Ha(x);
      }
      return null;
    }
    function SZe(f, p, C, x) {
      do
        Tv();
      while (vC !== null);
      if (OZe(), (Ar & (Gc | Cg)) !== Pl)
        throw new Error("Should not already be working.");
      var I = f.finishedWork, O = f.finishedLanes;
      if (c8(O), I === null)
        return hg(), null;
      if (O === pt && a("root.finishedLanes should not be empty during a commit. This is a bug in React."), f.finishedWork = null, f.finishedLanes = pt, I === f.current)
        throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
      f.callbackNode = null, f.callbackPriority = Ea;
      var W = Xi(I.lanes, I.childLanes);
      v8(f, W), f === bd && (bd = null, la = null, Fl = pt), ((I.subtreeFlags & Tl) !== Jn || (I.flags & Tl) !== Jn) && (ZS || (ZS = !0, GQ = C, nJ(Jb, function() {
        return Tv(), null;
      })));
      var q = (I.subtreeFlags & (Fm | W0 | Bm | Tl)) !== Jn, ee = (I.flags & (Fm | W0 | Bm | Tl)) !== Jn;
      if (q || ee) {
        var ue = jc.transition;
        jc.transition = null;
        var me = fd();
        Ha(Du);
        var Me = Ar;
        Ar |= Cg, WQ.current = null, wXe(f, I), Vwe(), PXe(f, I, O), Mqe(f.containerInfo), f.current = I, dS(O), FXe(I, f, O), tv(), s8(), Ar = Me, Ha(me), jc.transition = ue;
      } else
        f.current = I, Vwe();
      var Ae = ZS;
      if (ZS ? (ZS = !1, vC = f, xM = O) : (sI = 0, a7 = null), W = f.pendingLanes, W === pt && (rI = null), Ae || eEe(f.current, !1), iO(I.stateNode, x), cc && f.memoizedUpdaters.clear(), nZe(), hh(f, ra()), p !== null)
        for (var nt = f.onRecoverableError, rt = 0; rt < p.length; rt++) {
          var ft = p[rt], un = ft.stack, ai = ft.digest;
          nt(ft.value, {
            componentStack: un,
            digest: ai
          });
        }
      if (s7) {
        s7 = !1;
        var Xn = $Q;
        throw $Q = null, Xn;
      }
      return ku(xM, Ci) && f.tag !== cC && Tv(), W = f.pendingLanes, ku(W, Ci) ? (kYe(), f === qQ ? LM++ : (LM = 0, qQ = f)) : LM = 0, uC(), hg(), null;
    }
    function Tv() {
      if (vC !== null) {
        var f = w8(xM), p = uc(Dl, f), C = jc.transition, x = fd();
        try {
          return jc.transition = null, Ha(p), xZe();
        } finally {
          Ha(x), jc.transition = C;
        }
      }
      return !1;
    }
    function EZe(f) {
      jQ.push(f), ZS || (ZS = !0, nJ(Jb, function() {
        return Tv(), null;
      }));
    }
    function xZe() {
      if (vC === null)
        return !1;
      var f = GQ;
      GQ = null;
      var p = vC, C = xM;
      if (vC = null, xM = pt, (Ar & (Gc | Cg)) !== Pl)
        throw new Error("Cannot flush passive effects while already rendering.");
      KQ = !0, o7 = !1, aO(C);
      var x = Ar;
      Ar |= Cg, $Xe(p.current), WXe(p, p.current, C, f);
      {
        var I = jQ;
        jQ = [];
        for (var O = 0; O < I.length; O++) {
          var W = I[O];
          LXe(p, W);
        }
      }
      $0(), eEe(p.current, !0), Ar = x, uC(), o7 ? p === a7 ? sI++ : (sI = 0, a7 = p) : sI = 0, KQ = !1, o7 = !1, rO(p);
      {
        var q = p.current.stateNode;
        q.effectDuration = 0, q.passiveEffectDuration = 0;
      }
      return !0;
    }
    function ZSe(f) {
      return rI !== null && rI.has(f);
    }
    function LZe(f) {
      rI === null ? rI = /* @__PURE__ */ new Set([f]) : rI.add(f);
    }
    function TZe(f) {
      s7 || (s7 = !0, $Q = f);
    }
    var kZe = TZe;
    function QSe(f, p, C) {
      var x = KS(C, p), I = Ywe(f, x, Ci), O = hC(f, I, Ci), W = vd();
      O !== null && (Y0(O, Ci, W), hh(O, W));
    }
    function Lo(f, p, C) {
      if (vXe(C), IM(!1), f.tag === h) {
        QSe(f, f, C);
        return;
      }
      var x = null;
      for (x = p; x !== null; ) {
        if (x.tag === h) {
          QSe(x, f, C);
          return;
        } else if (x.tag === u) {
          var I = x.type, O = x.stateNode;
          if (typeof I.getDerivedStateFromError == "function" || typeof O.componentDidCatch == "function" && !ZSe(O)) {
            var W = KS(C, f), q = vQ(x, W, Ci), ee = hC(x, q, Ci), ue = vd();
            ee !== null && (Y0(ee, Ci, ue), hh(ee, ue));
            return;
          }
        }
        x = x.return;
      }
      a(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

%s`, C);
    }
    function DZe(f, p, C) {
      var x = f.pingCache;
      x !== null && x.delete(p);
      var I = vd();
      fD(f, C), BZe(f), bd === f && ov(Fl, C) && (Bl === yM || Bl === n7 && cD(Fl) && ra() - zQ < BSe ? QS(f, pt) : r7 = Xi(r7, C)), hh(f, I);
    }
    function JSe(f, p) {
      p === Ea && (p = cZe(f));
      var C = vd(), x = ch(f, p);
      x !== null && (Y0(x, p, C), hh(x, C));
    }
    function IZe(f) {
      var p = f.memoizedState, C = Ea;
      p !== null && (C = p.retryLane), JSe(f, C);
    }
    function NZe(f, p) {
      var C = Ea, x;
      switch (f.tag) {
        case N:
          x = f.stateNode;
          var I = f.memoizedState;
          I !== null && (C = I.retryLane);
          break;
        case K:
          x = f.stateNode;
          break;
        default:
          throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
      }
      x !== null && x.delete(p), JSe(f, C);
    }
    function RZe(f) {
      return f < 120 ? 120 : f < 480 ? 480 : f < 1080 ? 1080 : f < 1920 ? 1920 : f < 3e3 ? 3e3 : f < 4320 ? 4320 : sZe(f / 1960) * 1960;
    }
    function AZe() {
      if (LM > aZe)
        throw LM = 0, qQ = null, new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
      sI > lZe && (sI = 0, a7 = null, a("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."));
    }
    function OZe() {
      mp.flushLegacyContextWarning(), mp.flushPendingUnsafeLifecycleWarnings();
    }
    function eEe(f, p) {
      Vs(f), h7(f, Pc, JXe), p && h7(f, Pm, eZe), h7(f, Pc, ZXe), p && h7(f, Pm, QXe), Go();
    }
    function h7(f, p, C) {
      for (var x = f, I = null; x !== null; ) {
        var O = x.subtreeFlags & p;
        x !== I && x.child !== null && O !== Jn ? x = x.child : ((x.flags & p) !== Jn && C(x), x.sibling !== null ? x = x.sibling : x = I = x.return);
      }
    }
    var f7 = null;
    function tEe(f) {
      {
        if ((Ar & Gc) !== Pl || !(f.mode & gr))
          return;
        var p = f.tag;
        if (p !== d && p !== h && p !== u && p !== c && p !== T && p !== R && p !== M)
          return;
        var C = Ai(f) || "ReactComponent";
        if (f7 !== null) {
          if (f7.has(C))
            return;
          f7.add(C);
        } else
          f7 = /* @__PURE__ */ new Set([C]);
        var x = el;
        try {
          Vs(f), a("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.");
        } finally {
          x ? Vs(f) : Go();
        }
      }
    }
    var JQ;
    {
      var MZe = null;
      JQ = function(f, p, C) {
        var x = cEe(MZe, p);
        try {
          return gSe(f, p, C);
        } catch (O) {
          if (qKe() || O !== null && typeof O == "object" && typeof O.then == "function")
            throw O;
          if (y9(), mwe(), ySe(f, p), cEe(p, x), p.mode & Lr && tQ(p), th(null, gSe, null, f, p, C), q2()) {
            var I = K2();
            typeof I == "object" && I !== null && I._suppressLogging && typeof O == "object" && O !== null && !O._suppressLogging && (O._suppressLogging = !0);
          }
          throw O;
        }
      };
    }
    var nEe = !1, eJ;
    eJ = /* @__PURE__ */ new Set();
    function PZe(f) {
      if (yu && !xYe())
        switch (f.tag) {
          case c:
          case T:
          case M: {
            var p = la && Ai(la) || "Unknown", C = p;
            if (!eJ.has(C)) {
              eJ.add(C);
              var x = Ai(f) || "Unknown";
              a("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", x, p, p);
            }
            break;
          }
          case u: {
            nEe || (a("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."), nEe = !0);
            break;
          }
        }
    }
    function DM(f, p) {
      if (cc) {
        var C = f.memoizedUpdaters;
        C.forEach(function(x) {
          y8(f, x, p);
        });
      }
    }
    var tJ = {};
    function nJ(f, p) {
      {
        var C = Ep.current;
        return C !== null ? (C.push(p), tJ) : Q2(f, p);
      }
    }
    function iEe(f) {
      if (f !== tJ)
        return J2(f);
    }
    function rEe() {
      return Ep.current !== null;
    }
    function FZe(f) {
      {
        if (f.mode & gr) {
          if (!MSe())
            return;
        } else if (!rZe() || Ar !== Pl || f.tag !== c && f.tag !== T && f.tag !== M)
          return;
        if (Ep.current === null) {
          var p = el;
          try {
            Vs(f), a(`An update to %s inside a test was not wrapped in act(...).

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

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

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`, Ai(f));
          } finally {
            p ? Vs(f) : Go();
          }
        }
      }
    }
    function BZe(f) {
      f.tag !== cC && MSe() && Ep.current === null && a(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).

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

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

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`);
    }
    function IM(f) {
      VSe = f;
    }
    var wg = null, oI = null, HZe = function(f) {
      wg = f;
    };
    function aI(f) {
      {
        if (wg === null)
          return f;
        var p = wg(f);
        return p === void 0 ? f : p.current;
      }
    }
    function iJ(f) {
      return aI(f);
    }
    function rJ(f) {
      {
        if (wg === null)
          return f;
        var p = wg(f);
        if (p === void 0) {
          if (f != null && typeof f.render == "function") {
            var C = aI(f.render);
            if (f.render !== C) {
              var x = {
                $$typeof: mt,
                render: C
              };
              return f.displayName !== void 0 && (x.displayName = f.displayName), x;
            }
          }
          return f;
        }
        return p.current;
      }
    }
    function sEe(f, p) {
      {
        if (wg === null)
          return !1;
        var C = f.elementType, x = p.type, I = !1, O = typeof x == "object" && x !== null ? x.$$typeof : null;
        switch (f.tag) {
          case u: {
            typeof x == "function" && (I = !0);
            break;
          }
          case c: {
            (typeof x == "function" || O === fi) && (I = !0);
            break;
          }
          case T: {
            (O === mt || O === fi) && (I = !0);
            break;
          }
          case R:
          case M: {
            (O === Wi || O === fi) && (I = !0);
            break;
          }
          default:
            return !1;
        }
        if (I) {
          var W = wg(C);
          if (W !== void 0 && W === wg(x))
            return !0;
        }
        return !1;
      }
    }
    function oEe(f) {
      {
        if (wg === null || typeof WeakSet != "function")
          return;
        oI === null && (oI = /* @__PURE__ */ new WeakSet()), oI.add(f);
      }
    }
    var WZe = function(f, p) {
      {
        if (wg === null)
          return;
        var C = p.staleFamilies, x = p.updatedFamilies;
        Tv(), Lv(function() {
          sJ(f.current, x, C);
        });
      }
    }, VZe = function(f, p) {
      {
        if (f.context !== ff)
          return;
        Tv(), Lv(function() {
          NM(p, f, null, null);
        });
      }
    };
    function sJ(f, p, C) {
      {
        var x = f.alternate, I = f.child, O = f.sibling, W = f.tag, q = f.type, ee = null;
        switch (W) {
          case c:
          case M:
          case u:
            ee = q;
            break;
          case T:
            ee = q.render;
            break;
        }
        if (wg === null)
          throw new Error("Expected resolveFamily to be set during hot reload.");
        var ue = !1, me = !1;
        if (ee !== null) {
          var Me = wg(ee);
          Me !== void 0 && (C.has(Me) ? me = !0 : p.has(Me) && (W === u ? me = !0 : ue = !0));
        }
        if (oI !== null && (oI.has(f) || x !== null && oI.has(x)) && (me = !0), me && (f._debugNeedsRemount = !0), me || ue) {
          var Ae = ch(f, Ci);
          Ae !== null && Hl(Ae, f, Ci, Is);
        }
        I !== null && !me && sJ(I, p, C), O !== null && sJ(O, p, C);
      }
    }
    var UZe = function(f, p) {
      {
        var C = /* @__PURE__ */ new Set(), x = new Set(p.map(function(I) {
          return I.current;
        }));
        return oJ(f.current, x, C), C;
      }
    };
    function oJ(f, p, C) {
      {
        var x = f.child, I = f.sibling, O = f.tag, W = f.type, q = null;
        switch (O) {
          case c:
          case M:
          case u:
            q = W;
            break;
          case T:
            q = W.render;
            break;
        }
        var ee = !1;
        q !== null && p.has(q) && (ee = !0), ee ? zZe(f, C) : x !== null && oJ(x, p, C), I !== null && oJ(I, p, C);
      }
    }
    function zZe(f, p) {
      {
        var C = $Ze(f, p);
        if (C)
          return;
        for (var x = f; ; ) {
          switch (x.tag) {
            case m:
              p.add(x.stateNode);
              return;
            case g:
              p.add(x.stateNode.containerInfo);
              return;
            case h:
              p.add(x.stateNode.containerInfo);
              return;
          }
          if (x.return === null)
            throw new Error("Expected to reach root first.");
          x = x.return;
        }
      }
    }
    function $Ze(f, p) {
      for (var C = f, x = !1; ; ) {
        if (C.tag === m)
          x = !0, p.add(C.stateNode);
        else if (C.child !== null) {
          C.child.return = C, C = C.child;
          continue;
        }
        if (C === f)
          return x;
        for (; C.sibling === null; ) {
          if (C.return === null || C.return === f)
            return x;
          C = C.return;
        }
        C.sibling.return = C.return, C = C.sibling;
      }
      return !1;
    }
    var aJ;
    {
      aJ = !1;
      try {
        var aEe = Object.preventExtensions({});
      } catch {
        aJ = !0;
      }
    }
    function jZe(f, p, C, x) {
      this.tag = f, this.key = C, this.elementType = null, this.type = null, this.stateNode = null, this.return = null, this.child = null, this.sibling = null, this.index = 0, this.ref = null, this.pendingProps = p, this.memoizedProps = null, this.updateQueue = null, this.memoizedState = null, this.dependencies = null, this.mode = x, this.flags = Jn, this.subtreeFlags = Jn, this.deletions = null, this.lanes = pt, this.childLanes = pt, this.alternate = null, this.actualDuration = Number.NaN, this.actualStartTime = Number.NaN, this.selfBaseDuration = Number.NaN, this.treeBaseDuration = Number.NaN, this.actualDuration = 0, this.actualStartTime = -1, this.selfBaseDuration = 0, this.treeBaseDuration = 0, this._debugSource = null, this._debugOwner = null, this._debugNeedsRemount = !1, this._debugHookTypes = null, !aJ && typeof Object.preventExtensions == "function" && Object.preventExtensions(this);
    }
    var gf = function(f, p, C, x) {
      return new jZe(f, p, C, x);
    };
    function lJ(f) {
      var p = f.prototype;
      return !!(p && p.isReactComponent);
    }
    function GZe(f) {
      return typeof f == "function" && !lJ(f) && f.defaultProps === void 0;
    }
    function qZe(f) {
      if (typeof f == "function")
        return lJ(f) ? u : c;
      if (f != null) {
        var p = f.$$typeof;
        if (p === mt)
          return T;
        if (p === Wi)
          return R;
      }
      return d;
    }
    function eE(f, p) {
      var C = f.alternate;
      C === null ? (C = gf(f.tag, p, f.key, f.mode), C.elementType = f.elementType, C.type = f.type, C.stateNode = f.stateNode, C._debugSource = f._debugSource, C._debugOwner = f._debugOwner, C._debugHookTypes = f._debugHookTypes, C.alternate = f, f.alternate = C) : (C.pendingProps = p, C.type = f.type, C.flags = Jn, C.subtreeFlags = Jn, C.deletions = null, C.actualDuration = 0, C.actualStartTime = -1), C.flags = f.flags & Sa, C.childLanes = f.childLanes, C.lanes = f.lanes, C.child = f.child, C.memoizedProps = f.memoizedProps, C.memoizedState = f.memoizedState, C.updateQueue = f.updateQueue;
      var x = f.dependencies;
      switch (C.dependencies = x === null ? null : {
        lanes: x.lanes,
        firstContext: x.firstContext
      }, C.sibling = f.sibling, C.index = f.index, C.ref = f.ref, C.selfBaseDuration = f.selfBaseDuration, C.treeBaseDuration = f.treeBaseDuration, C._debugNeedsRemount = f._debugNeedsRemount, C.tag) {
        case d:
        case c:
        case M:
          C.type = aI(f.type);
          break;
        case u:
          C.type = iJ(f.type);
          break;
        case T:
          C.type = rJ(f.type);
          break;
      }
      return C;
    }
    function KZe(f, p) {
      f.flags &= Sa | qo;
      var C = f.alternate;
      if (C === null)
        f.childLanes = pt, f.lanes = p, f.child = null, f.subtreeFlags = Jn, f.memoizedProps = null, f.memoizedState = null, f.updateQueue = null, f.dependencies = null, f.stateNode = null, f.selfBaseDuration = 0, f.treeBaseDuration = 0;
      else {
        f.childLanes = C.childLanes, f.lanes = C.lanes, f.child = C.child, f.subtreeFlags = Jn, f.deletions = null, f.memoizedProps = C.memoizedProps, f.memoizedState = C.memoizedState, f.updateQueue = C.updateQueue, f.type = C.type;
        var x = C.dependencies;
        f.dependencies = x === null ? null : {
          lanes: x.lanes,
          firstContext: x.firstContext
        }, f.selfBaseDuration = C.selfBaseDuration, f.treeBaseDuration = C.treeBaseDuration;
      }
      return f;
    }
    function YZe(f, p, C) {
      var x;
      return f === u9 ? (x = gr, p === !0 && (x |= zi, x |= $s)) : x = ei, cc && (x |= Lr), gf(h, null, null, x);
    }
    function cJ(f, p, C, x, I, O) {
      var W = d, q = f;
      if (typeof f == "function")
        lJ(f) ? (W = u, q = iJ(q)) : q = aI(q);
      else if (typeof f == "string")
        W = m;
      else
        e: switch (f) {
          case bs:
            return wC(C.children, I, O, p);
          case na:
            W = w, I |= zi, (I & gr) !== ei && (I |= $s);
            break;
          case sc:
            return XZe(C, I, O, p);
          case jt:
            return ZZe(C, I, O, p);
          case nn:
            return QZe(C, I, O, p);
          case ve:
            return lEe(C, I, O, p);
          case fe:
          // eslint-disable-next-line no-fallthrough
          case Ki:
          // eslint-disable-next-line no-fallthrough
          case Be:
          // eslint-disable-next-line no-fallthrough
          case Lt:
          // eslint-disable-next-line no-fallthrough
          case Nt:
          // eslint-disable-next-line no-fallthrough
          default: {
            if (typeof f == "object" && f !== null)
              switch (f.$$typeof) {
                case Rc:
                  W = L;
                  break e;
                case xe:
                  W = E;
                  break e;
                case mt:
                  W = T, q = rJ(q);
                  break e;
                case Wi:
                  W = R;
                  break e;
                case fi:
                  W = B, q = null;
                  break e;
              }
            var ee = "";
            {
              (f === void 0 || typeof f == "object" && f !== null && Object.keys(f).length === 0) && (ee += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
              var ue = x ? Ai(x) : null;
              ue && (ee += `

Check the render method of \`` + ue + "`.");
            }
            throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (f == null ? f : typeof f) + "." + ee));
          }
        }
      var me = gf(W, C, p, I);
      return me.elementType = f, me.type = q, me.lanes = O, me._debugOwner = x, me;
    }
    function uJ(f, p, C) {
      var x = null;
      x = f._owner;
      var I = f.type, O = f.key, W = f.props, q = cJ(I, O, W, x, p, C);
      return q._debugSource = f._source, q._debugOwner = f._owner, q;
    }
    function wC(f, p, C, x) {
      var I = gf(v, f, x, p);
      return I.lanes = C, I;
    }
    function XZe(f, p, C, x) {
      typeof f.id != "string" && a('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof f.id);
      var I = gf(D, f, x, p | Lr);
      return I.elementType = sc, I.lanes = C, I.stateNode = {
        effectDuration: 0,
        passiveEffectDuration: 0
      }, I;
    }
    function ZZe(f, p, C, x) {
      var I = gf(N, f, x, p);
      return I.elementType = jt, I.lanes = C, I;
    }
    function QZe(f, p, C, x) {
      var I = gf(K, f, x, p);
      return I.elementType = nn, I.lanes = C, I;
    }
    function lEe(f, p, C, x) {
      var I = gf(Y, f, x, p);
      I.elementType = ve, I.lanes = C;
      var O = {
        isHidden: !1
      };
      return I.stateNode = O, I;
    }
    function dJ(f, p, C) {
      var x = gf(_, f, null, p);
      return x.lanes = C, x;
    }
    function JZe() {
      var f = gf(m, null, null, ei);
      return f.elementType = "DELETED", f;
    }
    function eQe(f) {
      var p = gf(j, null, null, ei);
      return p.stateNode = f, p;
    }
    function hJ(f, p, C) {
      var x = f.children !== null ? f.children : [], I = gf(g, x, f.key, p);
      return I.lanes = C, I.stateNode = {
        containerInfo: f.containerInfo,
        pendingChildren: null,
        // Used by persistent updates
        implementation: f.implementation
      }, I;
    }
    function cEe(f, p) {
      return f === null && (f = gf(d, null, null, ei)), f.tag = p.tag, f.key = p.key, f.elementType = p.elementType, f.type = p.type, f.stateNode = p.stateNode, f.return = p.return, f.child = p.child, f.sibling = p.sibling, f.index = p.index, f.ref = p.ref, f.pendingProps = p.pendingProps, f.memoizedProps = p.memoizedProps, f.updateQueue = p.updateQueue, f.memoizedState = p.memoizedState, f.dependencies = p.dependencies, f.mode = p.mode, f.flags = p.flags, f.subtreeFlags = p.subtreeFlags, f.deletions = p.deletions, f.lanes = p.lanes, f.childLanes = p.childLanes, f.alternate = p.alternate, f.actualDuration = p.actualDuration, f.actualStartTime = p.actualStartTime, f.selfBaseDuration = p.selfBaseDuration, f.treeBaseDuration = p.treeBaseDuration, f._debugSource = p._debugSource, f._debugOwner = p._debugOwner, f._debugNeedsRemount = p._debugNeedsRemount, f._debugHookTypes = p._debugHookTypes, f;
    }
    function tQe(f, p, C, x, I) {
      this.tag = p, this.containerInfo = f, this.pendingChildren = null, this.current = null, this.pingCache = null, this.finishedWork = null, this.timeoutHandle = qX, this.context = null, this.pendingContext = null, this.callbackNode = null, this.callbackPriority = Ea, this.eventTimes = hD(pt), this.expirationTimes = hD(Is), this.pendingLanes = pt, this.suspendedLanes = pt, this.pingedLanes = pt, this.expiredLanes = pt, this.mutableReadLanes = pt, this.finishedLanes = pt, this.entangledLanes = pt, this.entanglements = hD(pt), this.identifierPrefix = x, this.onRecoverableError = I, this.mutableSourceEagerHydrationData = null, this.effectDuration = 0, this.passiveEffectDuration = 0;
      {
        this.memoizedUpdaters = /* @__PURE__ */ new Set();
        for (var O = this.pendingUpdatersLaneMap = [], W = 0; W < dO; W++)
          O.push(/* @__PURE__ */ new Set());
      }
      switch (p) {
        case u9:
          this._debugRootType = C ? "hydrateRoot()" : "createRoot()";
          break;
        case cC:
          this._debugRootType = C ? "hydrate()" : "render()";
          break;
      }
    }
    function uEe(f, p, C, x, I, O, W, q, ee, ue) {
      var me = new tQe(f, p, C, q, ee), Me = YZe(p, O);
      me.current = Me, Me.stateNode = me;
      {
        var Ae = {
          element: x,
          isDehydrated: C,
          cache: null,
          // not enabled yet
          transitions: null,
          pendingSuspenseBoundaries: null
        };
        Me.memoizedState = Ae;
      }
      return xZ(Me), me;
    }
    var fJ = "18.3.1";
    function nQe(f, p, C) {
      var x = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
      return qr(x), {
        // This tag allow us to uniquely identify this as a React Portal
        $$typeof: po,
        key: x == null ? null : "" + x,
        children: f,
        containerInfo: p,
        implementation: C
      };
    }
    var gJ, pJ;
    gJ = !1, pJ = {};
    function dEe(f) {
      if (!f)
        return ff;
      var p = H0(f), C = BKe(p);
      if (p.tag === u) {
        var x = p.type;
        if (t_(x))
          return B1e(p, x, C);
      }
      return C;
    }
    function iQe(f, p) {
      {
        var C = H0(f);
        if (C === void 0) {
          if (typeof f.render == "function")
            throw new Error("Unable to find node on an unmounted component.");
          var x = Object.keys(f).join(",");
          throw new Error("Argument appears to not be a ReactComponent. Keys: " + x);
        }
        var I = Eu(C);
        if (I === null)
          return null;
        if (I.mode & zi) {
          var O = Ai(C) || "Component";
          if (!pJ[O]) {
            pJ[O] = !0;
            var W = el;
            try {
              Vs(I), C.mode & zi ? a("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", p, p, O) : a("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", p, p, O);
            } finally {
              W ? Vs(W) : Go();
            }
          }
        }
        return I.stateNode;
      }
    }
    function hEe(f, p, C, x, I, O, W, q) {
      var ee = !1, ue = null;
      return uEe(f, p, ee, ue, C, x, I, O, W);
    }
    function fEe(f, p, C, x, I, O, W, q, ee, ue) {
      var me = !0, Me = uEe(C, x, me, f, I, O, W, q, ee);
      Me.context = dEe(null);
      var Ae = Me.current, nt = vd(), rt = yC(Ae), ft = wv(nt, rt);
      return ft.callback = p ?? null, hC(Ae, ft, rt), uZe(Me, rt, nt), Me;
    }
    function NM(f, p, C, x) {
      nO(p, f);
      var I = p.current, O = vd(), W = yC(I);
      zk(W);
      var q = dEe(C);
      p.context === null ? p.context = q : p.pendingContext = q, yu && el !== null && !gJ && (gJ = !0, a(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

Check the render method of %s.`, Ai(el) || "Unknown"));
      var ee = wv(O, W);
      ee.payload = {
        element: f
      }, x = x === void 0 ? null : x, x !== null && (typeof x != "function" && a("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", x), ee.callback = x);
      var ue = hC(I, ee, W);
      return ue !== null && (Hl(ue, I, W, O), x9(ue, I, W)), W;
    }
    function g7(f) {
      var p = f.current;
      if (!p.child)
        return null;
      switch (p.child.tag) {
        case m:
          return p.child.stateNode;
        default:
          return p.child.stateNode;
      }
    }
    function rQe(f) {
      switch (f.tag) {
        case h: {
          var p = f.stateNode;
          if (av(p)) {
            var C = m8(p);
            gZe(p, C);
          }
          break;
        }
        case N: {
          Lv(function() {
            var I = ch(f, Ci);
            if (I !== null) {
              var O = vd();
              Hl(I, f, Ci, O);
            }
          });
          var x = Ci;
          mJ(f, x);
          break;
        }
      }
    }
    function gEe(f, p) {
      var C = f.memoizedState;
      C !== null && C.dehydrated !== null && (C.retryLane = _O(C.retryLane, p));
    }
    function mJ(f, p) {
      gEe(f, p);
      var C = f.alternate;
      C && gEe(C, p);
    }
    function sQe(f) {
      if (f.tag === N) {
        var p = K0, C = ch(f, p);
        if (C !== null) {
          var x = vd();
          Hl(C, f, p, x);
        }
        mJ(f, p);
      }
    }
    function oQe(f) {
      if (f.tag === N) {
        var p = yC(f), C = ch(f, p);
        if (C !== null) {
          var x = vd();
          Hl(C, f, p, x);
        }
        mJ(f, p);
      }
    }
    function pEe(f) {
      var p = cf(f);
      return p === null ? null : p.stateNode;
    }
    var mEe = function(f) {
      return null;
    };
    function aQe(f) {
      return mEe(f);
    }
    var _Ee = function(f) {
      return !1;
    };
    function lQe(f) {
      return _Ee(f);
    }
    var bEe = null, vEe = null, yEe = null, CEe = null, wEe = null, SEe = null, EEe = null, xEe = null, LEe = null;
    {
      var TEe = function(f, p, C) {
        var x = p[C], I = Yi(f) ? f.slice() : bn({}, f);
        return C + 1 === p.length ? (Yi(I) ? I.splice(x, 1) : delete I[x], I) : (I[x] = TEe(f[x], p, C + 1), I);
      }, kEe = function(f, p) {
        return TEe(f, p, 0);
      }, DEe = function(f, p, C, x) {
        var I = p[x], O = Yi(f) ? f.slice() : bn({}, f);
        if (x + 1 === p.length) {
          var W = C[x];
          O[W] = O[I], Yi(O) ? O.splice(I, 1) : delete O[I];
        } else
          O[I] = DEe(
            // $FlowFixMe number or string is fine here
            f[I],
            p,
            C,
            x + 1
          );
        return O;
      }, IEe = function(f, p, C) {
        if (p.length !== C.length) {
          o("copyWithRename() expects paths of the same length");
          return;
        } else
          for (var x = 0; x < C.length - 1; x++)
            if (p[x] !== C[x]) {
              o("copyWithRename() expects paths to be the same except for the deepest key");
              return;
            }
        return DEe(f, p, C, 0);
      }, NEe = function(f, p, C, x) {
        if (C >= p.length)
          return x;
        var I = p[C], O = Yi(f) ? f.slice() : bn({}, f);
        return O[I] = NEe(f[I], p, C + 1, x), O;
      }, REe = function(f, p, C) {
        return NEe(f, p, 0, C);
      }, _J = function(f, p) {
        for (var C = f.memoizedState; C !== null && p > 0; )
          C = C.next, p--;
        return C;
      };
      bEe = function(f, p, C, x) {
        var I = _J(f, p);
        if (I !== null) {
          var O = REe(I.memoizedState, C, x);
          I.memoizedState = O, I.baseState = O, f.memoizedProps = bn({}, f.memoizedProps);
          var W = ch(f, Ci);
          W !== null && Hl(W, f, Ci, Is);
        }
      }, vEe = function(f, p, C) {
        var x = _J(f, p);
        if (x !== null) {
          var I = kEe(x.memoizedState, C);
          x.memoizedState = I, x.baseState = I, f.memoizedProps = bn({}, f.memoizedProps);
          var O = ch(f, Ci);
          O !== null && Hl(O, f, Ci, Is);
        }
      }, yEe = function(f, p, C, x) {
        var I = _J(f, p);
        if (I !== null) {
          var O = IEe(I.memoizedState, C, x);
          I.memoizedState = O, I.baseState = O, f.memoizedProps = bn({}, f.memoizedProps);
          var W = ch(f, Ci);
          W !== null && Hl(W, f, Ci, Is);
        }
      }, CEe = function(f, p, C) {
        f.pendingProps = REe(f.memoizedProps, p, C), f.alternate && (f.alternate.pendingProps = f.pendingProps);
        var x = ch(f, Ci);
        x !== null && Hl(x, f, Ci, Is);
      }, wEe = function(f, p) {
        f.pendingProps = kEe(f.memoizedProps, p), f.alternate && (f.alternate.pendingProps = f.pendingProps);
        var C = ch(f, Ci);
        C !== null && Hl(C, f, Ci, Is);
      }, SEe = function(f, p, C) {
        f.pendingProps = IEe(f.memoizedProps, p, C), f.alternate && (f.alternate.pendingProps = f.pendingProps);
        var x = ch(f, Ci);
        x !== null && Hl(x, f, Ci, Is);
      }, EEe = function(f) {
        var p = ch(f, Ci);
        p !== null && Hl(p, f, Ci, Is);
      }, xEe = function(f) {
        mEe = f;
      }, LEe = function(f) {
        _Ee = f;
      };
    }
    function cQe(f) {
      var p = Eu(f);
      return p === null ? null : p.stateNode;
    }
    function uQe(f) {
      return null;
    }
    function dQe() {
      return el;
    }
    function hQe(f) {
      var p = f.findFiberByHostInstance, C = n.ReactCurrentDispatcher;
      return tO({
        bundleType: f.bundleType,
        version: f.version,
        rendererPackageName: f.rendererPackageName,
        rendererConfig: f.rendererConfig,
        overrideHookState: bEe,
        overrideHookStateDeletePath: vEe,
        overrideHookStateRenamePath: yEe,
        overrideProps: CEe,
        overridePropsDeletePath: wEe,
        overridePropsRenamePath: SEe,
        setErrorHandler: xEe,
        setSuspenseHandler: LEe,
        scheduleUpdate: EEe,
        currentDispatcherRef: C,
        findHostInstanceByFiber: cQe,
        findFiberByHostInstance: p || uQe,
        // React Refresh
        findHostInstancesForRefresh: UZe,
        scheduleRefresh: WZe,
        scheduleRoot: VZe,
        setRefreshHandler: HZe,
        // Enables DevTools to append owner stacks to error messages in DEV mode.
        getCurrentFiber: dQe,
        // Enables DevTools to detect reconciler version rather than renderer version
        // which may not match for third party renderers.
        reconcilerVersion: fJ
      });
    }
    var AEe = typeof reportError == "function" ? (
      // In modern browsers, reportError will dispatch an error event,
      // emulating an uncaught JavaScript error.
      reportError
    ) : function(f) {
      console.error(f);
    };
    function bJ(f) {
      this._internalRoot = f;
    }
    p7.prototype.render = bJ.prototype.render = function(f) {
      var p = this._internalRoot;
      if (p === null)
        throw new Error("Cannot update an unmounted root.");
      {
        typeof arguments[1] == "function" ? a("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().") : m7(arguments[1]) ? a("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root.") : typeof arguments[1] < "u" && a("You passed a second argument to root.render(...) but it only accepts one argument.");
        var C = p.containerInfo;
        if (C.nodeType !== Ca) {
          var x = pEe(p.current);
          x && x.parentNode !== C && a("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.");
        }
      }
      NM(f, p, null, null);
    }, p7.prototype.unmount = bJ.prototype.unmount = function() {
      typeof arguments[0] == "function" && a("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
      var f = this._internalRoot;
      if (f !== null) {
        this._internalRoot = null;
        var p = f.containerInfo;
        jSe() && a("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."), Lv(function() {
          NM(null, f, null, null);
        }), A1e(p);
      }
    };
    function fQe(f, p) {
      if (!m7(f))
        throw new Error("createRoot(...): Target container is not a DOM element.");
      OEe(f);
      var C = !1, x = !1, I = "", O = AEe;
      p != null && (p.hydrate ? o("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.") : typeof p == "object" && p !== null && p.$$typeof === Eo && a(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:

  let root = createRoot(domContainer);
  root.render(<App />);`), p.unstable_strictMode === !0 && (C = !0), p.identifierPrefix !== void 0 && (I = p.identifierPrefix), p.onRecoverableError !== void 0 && (O = p.onRecoverableError), p.transitionCallbacks !== void 0 && p.transitionCallbacks);
      var W = hEe(f, u9, null, C, x, I, O);
      i9(W.current, f);
      var q = f.nodeType === Ca ? f.parentNode : f;
      return FO(q), new bJ(W);
    }
    function p7(f) {
      this._internalRoot = f;
    }
    function gQe(f) {
      f && T8(f);
    }
    p7.prototype.unstable_scheduleHydration = gQe;
    function pQe(f, p, C) {
      if (!m7(f))
        throw new Error("hydrateRoot(...): Target container is not a DOM element.");
      OEe(f), p === void 0 && a("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");
      var x = C ?? null, I = C != null && C.hydratedSources || null, O = !1, W = !1, q = "", ee = AEe;
      C != null && (C.unstable_strictMode === !0 && (O = !0), C.identifierPrefix !== void 0 && (q = C.identifierPrefix), C.onRecoverableError !== void 0 && (ee = C.onRecoverableError));
      var ue = fEe(p, null, f, u9, x, O, W, q, ee);
      if (i9(ue.current, f), FO(f), I)
        for (var me = 0; me < I.length; me++) {
          var Me = I[me];
          vYe(ue, Me);
        }
      return new p7(ue);
    }
    function m7(f) {
      return !!(f && (f.nodeType === Cu || f.nodeType === ap || f.nodeType === Gw));
    }
    function RM(f) {
      return !!(f && (f.nodeType === Cu || f.nodeType === ap || f.nodeType === Gw || f.nodeType === Ca && f.nodeValue === " react-mount-point-unstable "));
    }
    function OEe(f) {
      f.nodeType === Cu && f.tagName && f.tagName.toUpperCase() === "BODY" && a("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."), KO(f) && (f._reactRootContainer ? a("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.") : a("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."));
    }
    var mQe = n.ReactCurrentOwner, MEe;
    MEe = function(f) {
      if (f._reactRootContainer && f.nodeType !== Ca) {
        var p = pEe(f._reactRootContainer.current);
        p && p.parentNode !== f && a("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.");
      }
      var C = !!f._reactRootContainer, x = vJ(f), I = !!(x && aC(x));
      I && !C && a("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."), f.nodeType === Cu && f.tagName && f.tagName.toUpperCase() === "BODY" && a("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.");
    };
    function vJ(f) {
      return f ? f.nodeType === ap ? f.documentElement : f.firstChild : null;
    }
    function PEe() {
    }
    function _Qe(f, p, C, x, I) {
      if (I) {
        if (typeof x == "function") {
          var O = x;
          x = function() {
            var Ae = g7(W);
            O.call(Ae);
          };
        }
        var W = fEe(
          p,
          x,
          f,
          cC,
          null,
          // hydrationCallbacks
          !1,
          // isStrictMode
          !1,
          // concurrentUpdatesByDefaultOverride,
          "",
          // identifierPrefix
          PEe
        );
        f._reactRootContainer = W, i9(W.current, f);
        var q = f.nodeType === Ca ? f.parentNode : f;
        return FO(q), Lv(), W;
      } else {
        for (var ee; ee = f.lastChild; )
          f.removeChild(ee);
        if (typeof x == "function") {
          var ue = x;
          x = function() {
            var Ae = g7(me);
            ue.call(Ae);
          };
        }
        var me = hEe(
          f,
          cC,
          null,
          // hydrationCallbacks
          !1,
          // isStrictMode
          !1,
          // concurrentUpdatesByDefaultOverride,
          "",
          // identifierPrefix
          PEe
        );
        f._reactRootContainer = me, i9(me.current, f);
        var Me = f.nodeType === Ca ? f.parentNode : f;
        return FO(Me), Lv(function() {
          NM(p, me, C, x);
        }), me;
      }
    }
    function bQe(f, p) {
      f !== null && typeof f != "function" && a("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", p, f);
    }
    function _7(f, p, C, x, I) {
      MEe(C), bQe(I === void 0 ? null : I, "render");
      var O = C._reactRootContainer, W;
      if (!O)
        W = _Qe(C, p, f, I, x);
      else {
        if (W = O, typeof I == "function") {
          var q = I;
          I = function() {
            var ee = g7(W);
            q.call(ee);
          };
        }
        NM(p, W, f, I);
      }
      return g7(W);
    }
    var FEe = !1;
    function vQe(f) {
      {
        FEe || (FEe = !0, a("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node"));
        var p = mQe.current;
        if (p !== null && p.stateNode !== null) {
          var C = p.stateNode._warnedAboutRefsInRender;
          C || a("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", Rr(p.type) || "A component"), p.stateNode._warnedAboutRefsInRender = !0;
        }
      }
      return f == null ? null : f.nodeType === Cu ? f : iQe(f, "findDOMNode");
    }
    function yQe(f, p, C) {
      if (a("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"), !RM(p))
        throw new Error("Target container is not a DOM element.");
      {
        var x = KO(p) && p._reactRootContainer === void 0;
        x && a("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?");
      }
      return _7(null, f, p, !0, C);
    }
    function CQe(f, p, C) {
      if (a("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"), !RM(p))
        throw new Error("Target container is not a DOM element.");
      {
        var x = KO(p) && p._reactRootContainer === void 0;
        x && a("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?");
      }
      return _7(null, f, p, !1, C);
    }
    function wQe(f, p, C, x) {
      if (a("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"), !RM(C))
        throw new Error("Target container is not a DOM element.");
      if (f == null || !Xb(f))
        throw new Error("parentComponent must be a valid React Component");
      return _7(f, p, C, !1, x);
    }
    var BEe = !1;
    function SQe(f) {
      if (BEe || (BEe = !0, a("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot")), !RM(f))
        throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");
      {
        var p = KO(f) && f._reactRootContainer === void 0;
        p && a("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?");
      }
      if (f._reactRootContainer) {
        {
          var C = vJ(f), x = C && !aC(C);
          x && a("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
        }
        return Lv(function() {
          _7(null, null, f, !1, function() {
            f._reactRootContainer = null, A1e(f);
          });
        }), !0;
      } else {
        {
          var I = vJ(f), O = !!(I && aC(I)), W = f.nodeType === Cu && RM(f.parentNode) && !!f.parentNode._reactRootContainer;
          O && a("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", W ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component.");
        }
        return !1;
      }
    }
    vX(rQe), CO(sQe), yX(oQe), _D(fd), S8(C8), (typeof Map != "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
    Map.prototype == null || typeof Map.prototype.forEach != "function" || typeof Set != "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
    Set.prototype == null || typeof Set.prototype.clear != "function" || typeof Set.prototype.forEach != "function") && a("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"), tS(xqe), t8(XQ, pZe, Lv);
    function EQe(f, p) {
      var C = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
      if (!m7(p))
        throw new Error("Target container is not a DOM element.");
      return nQe(f, p, null, C);
    }
    function xQe(f, p, C, x) {
      return wQe(f, p, C, x);
    }
    var yJ = {
      usingClientEntryPoint: !1,
      // Keep in sync with ReactTestUtils.js.
      // This is an array for better minification.
      Events: [aC, BD, r9, j2, M0, XQ]
    };
    function LQe(f, p) {
      return yJ.usingClientEntryPoint || a('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'), fQe(f, p);
    }
    function TQe(f, p, C) {
      return yJ.usingClientEntryPoint || a('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'), pQe(f, p, C);
    }
    function kQe(f) {
      return jSe() && a("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."), Lv(f);
    }
    var DQe = hQe({
      findFiberByHostInstance: HS,
      bundleType: 1,
      version: fJ,
      rendererPackageName: "react-dom"
    });
    if (!DQe && Vt && window.top === window.self && (navigator.userAgent.indexOf("Chrome") > -1 && navigator.userAgent.indexOf("Edge") === -1 || navigator.userAgent.indexOf("Firefox") > -1)) {
      var HEe = window.location.protocol;
      /^(https?|file):$/.test(HEe) && console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + (HEe === "file:" ? `
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq` : ""), "font-weight:bold");
    }
    gh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = yJ, gh.createPortal = EQe, gh.createRoot = LQe, gh.findDOMNode = vQe, gh.flushSync = kQe, gh.hydrate = yQe, gh.hydrateRoot = TQe, gh.render = CQe, gh.unmountComponentAtNode = SQe, gh.unstable_batchedUpdates = XQ, gh.unstable_renderSubtreeIntoContainer = xQe, gh.version = fJ, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
  })(), gh;
}
var ZEe;
function zQe() {
  if (ZEe) return y7.exports;
  ZEe = 1;
  var i = {};
  function e() {
    if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
      if (i.NODE_ENV !== "production")
        throw new Error("^_^");
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
      } catch (t) {
        console.error(t);
      }
    }
  }
  return i.NODE_ENV === "production" ? (e(), y7.exports = VQe()) : y7.exports = UQe(), y7.exports;
}
var QEe;
function $Qe() {
  if (QEe) return cI;
  QEe = 1;
  var i = {}, e = zQe();
  if (i.NODE_ENV === "production")
    cI.createRoot = e.createRoot, cI.hydrateRoot = e.hydrateRoot;
  else {
    var t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    cI.createRoot = function(n, r) {
      t.usingClientEntryPoint = !0;
      try {
        return e.createRoot(n, r);
      } finally {
        t.usingClientEntryPoint = !1;
      }
    }, cI.hydrateRoot = function(n, r, s) {
      t.usingClientEntryPoint = !0;
      try {
        return e.hydrateRoot(n, r, s);
      } finally {
        t.usingClientEntryPoint = !1;
      }
    };
  }
  return cI;
}
var jQe = $Qe();
let JI = null;
function GQe() {
  return JI || (JI = rMe({
    componentDescriptor: "extension/mendix-markdown",
    componentId: "editor",
    entryPointId: "editor"
  }), JI);
}
function qQe(i) {
  return JI = rMe(i), JI;
}
const KQe = "[Markdown]", Xp = {
  /**
   * Log debug messages (development only)
   */
  log: (...i) => {
  },
  /**
   * Log error messages (always, regardless of environment)
   */
  error: (...i) => {
    console.error(KQe, ...i);
  },
  /**
   * Log warning messages (development only)
   */
  warn: (...i) => {
  }
}, oMe = {
  /**
   * Delay before rendering Mermaid diagrams after content change.
   * Allows DOM to settle before querying for code blocks.
   */
  MERMAID_RENDER_DELAY_MS: 100,
  /**
   * Debounce delay before sending content updates to Mendix.
   * Prevents excessive API calls while typing.
   */
  MENDIX_UPDATE_DEBOUNCE_MS: 300
}, tE = {
  /** Font size in pixels */
  FONT_SIZE: 14,
  /** Tab width in spaces */
  TAB_SIZE: 2,
  /** Vertical padding (top and bottom) in pixels */
  PADDING_VERTICAL: 12,
  /** Scrollbar thickness in pixels */
  SCROLLBAR_SIZE: 10,
  /** Space for line decorations (gutter) in pixels */
  LINE_DECORATIONS_WIDTH: 8
}, JEe = {
  /**
   * Start index for substring when generating random IDs from base-36 string.
   * Skips the "0." prefix from Math.random().toString(36)
   */
  RANDOM_SUBSTRING_START: 2,
  /**
   * End index for substring when generating random IDs.
   * Results in a 9-character random string (2 to 11).
   */
  RANDOM_SUBSTRING_END: 11
};
function YQe() {
  return `mermaid-${Math.random().toString(36).substring(JEe.RANDOM_SUBSTRING_START, JEe.RANDOM_SUBSTRING_END)}`;
}
function XQe(i) {
  const [e, t] = Zn.useState(""), [n, r] = Zn.useState(null), [s, o] = Zn.useState(!0), a = Zn.useRef(), l = GQe();
  Zn.useEffect(() => {
    (async () => {
      var d;
      o(!0);
      try {
        Xp.log("Loading document:", i);
        const h = await l.app.model.customBlobDocuments.getDocumentById(i);
        if (h && "document" in h) {
          const g = ((d = h.document.contents) == null ? void 0 : d.content) || "";
          t(g), Xp.log("Document loaded successfully");
        } else if (h && "error" in h)
          throw new Error(h.error);
        r(null);
      } catch (h) {
        Xp.error("Failed to load document:", h), r(h instanceof Error ? h.message : "Failed to load document");
      } finally {
        o(!1);
      }
    })();
  }, [i, l]), Zn.useEffect(() => {
    const u = async (d) => {
      var g;
      if (d.documents.find((m) => m.id === i))
        try {
          const m = await l.app.model.customBlobDocuments.getDocumentById(i);
          if (m && "document" in m) {
            const _ = ((g = m.document.contents) == null ? void 0 : g.content) || "";
            t(_);
          }
        } catch (m) {
          Xp.error("Failed to reload document:", m);
        }
    };
    return l.app.model.customBlobDocuments.addEventListener(
      "documentsChanged",
      u
    ), () => {
      l.app.model.customBlobDocuments.removeEventListener(
        "documentsChanged",
        u
      );
    };
  }, [i, l]), Zn.useEffect(() => () => {
    a.current && clearTimeout(a.current);
  }, []);
  const c = Zn.useCallback((u) => {
    t(u), a.current && clearTimeout(a.current), a.current = setTimeout(async () => {
      try {
        await l.app.model.customBlobDocuments.updateDocumentContent(i, {
          content: u,
          version: 1
        });
      } catch (d) {
        Xp.error("Failed to update document:", d), r(d instanceof Error ? d.message : "Failed to update document");
      }
    }, oMe.MENDIX_UPDATE_DEBOUNCE_MS);
  }, [i, l]);
  return {
    content: e,
    setContent: c,
    error: n,
    isLoading: 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 ZQe = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), QQe = (i) => i.replace(
  /^([A-Z])|[\s-_]+(\w)/g,
  (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()
), exe = (i) => {
  const e = QQe(i);
  return e.charAt(0).toUpperCase() + e.slice(1);
}, aMe = (...i) => i.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), JQe = (i) => {
  for (const e in i)
    if (e.startsWith("aria-") || e === "role" || e === "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 eJe = {
  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 tJe = Zn.forwardRef(
  ({
    color: i = "currentColor",
    size: e = 24,
    strokeWidth: t = 2,
    absoluteStrokeWidth: n,
    className: r = "",
    children: s,
    iconNode: o,
    ...a
  }, l) => Zn.createElement(
    "svg",
    {
      ref: l,
      ...eJe,
      width: e,
      height: e,
      stroke: i,
      strokeWidth: n ? Number(t) * 24 / Number(e) : t,
      className: aMe("lucide", r),
      ...!s && !JQe(a) && { "aria-hidden": "true" },
      ...a
    },
    [
      ...o.map(([c, u]) => Zn.createElement(c, u)),
      ...Array.isArray(s) ? s : [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 lMe = (i, e) => {
  const t = Zn.forwardRef(
    ({ className: n, ...r }, s) => Zn.createElement(tJe, {
      ref: s,
      iconNode: e,
      className: aMe(
        `lucide-${ZQe(exe(i))}`,
        `lucide-${i}`,
        n
      ),
      ...r
    })
  );
  return t.displayName = exe(i), t;
};
/**
 * @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 nJe = [
  [
    "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" }]
], iJe = lMe("eye", nJe);
/**
 * @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 rJe = [
  ["path", { d: "M13 21h8", key: "1jsn5i" }],
  [
    "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"
    }
  ]
], sJe = lMe("pen-line", rJe);
function cMe(i) {
  var e, t, n = "";
  if (typeof i == "string" || typeof i == "number") n += i;
  else if (typeof i == "object") if (Array.isArray(i)) {
    var r = i.length;
    for (e = 0; e < r; e++) i[e] && (t = cMe(i[e])) && (n && (n += " "), n += t);
  } else for (t in i) i[t] && (n && (n += " "), n += t);
  return n;
}
function oJe() {
  for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e = cMe(i)) && (n && (n += " "), n += e);
  return n;
}
const aJe = (i, e) => {
  const t = new Array(i.length + e.length);
  for (let n = 0; n < i.length; n++)
    t[n] = i[n];
  for (let n = 0; n < e.length; n++)
    t[i.length + n] = e[n];
  return t;
}, lJe = (i, e) => ({
  classGroupId: i,
  validator: e
}), uMe = (i = /* @__PURE__ */ new Map(), e = null, t) => ({
  nextPart: i,
  validators: e,
  classGroupId: t
}), CV = "-", txe = [], cJe = "arbitrary..", uJe = (i) => {
  const e = hJe(i), {
    conflictingClassGroups: t,
    conflictingClassGroupModifiers: n
  } = i;
  return {
    getClassGroupId: (o) => {
      if (o.startsWith("[") && o.endsWith("]"))
        return dJe(o);
      const a = o.split(CV), l = a[0] === "" && a.length > 1 ? 1 : 0;
      return dMe(a, l, e);
    },
    getConflictingClassGroupIds: (o, a) => {
      if (a) {
        const l = n[o], c = t[o];
        return l ? c ? aJe(c, l) : l : c || txe;
      }
      return t[o] || txe;
    }
  };
}, dMe = (i, e, t) => {
  if (i.length - e === 0)
    return t.classGroupId;
  const r = i[e], s = t.nextPart.get(r);
  if (s) {
    const c = dMe(i, e + 1, s);
    if (c) return c;
  }
  const o = t.validators;
  if (o === null)
    return;
  const a = e === 0 ? i.join(CV) : i.slice(e).join(CV), l = o.length;
  for (let c = 0; c < l; c++) {
    const u = o[c];
    if (u.validator(a))
      return u.classGroupId;
  }
}, dJe = (i) => i.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
  const e = i.slice(1, -1), t = e.indexOf(":"), n = e.slice(0, t);
  return n ? cJe + n : void 0;
})(), hJe = (i) => {
  const {
    theme: e,
    classGroups: t
  } = i;
  return fJe(t, e);
}, fJe = (i, e) => {
  const t = uMe();
  for (const n in i) {
    const r = i[n];
    whe(r, t, n, e);
  }
  return t;
}, whe = (i, e, t, n) => {
  const r = i.length;
  for (let s = 0; s < r; s++) {
    const o = i[s];
    gJe(o, e, t, n);
  }
}, gJe = (i, e, t, n) => {
  if (typeof i == "string") {
    pJe(i, e, t);
    return;
  }
  if (typeof i == "function") {
    mJe(i, e, t, n);
    return;
  }
  _Je(i, e, t, n);
}, pJe = (i, e, t) => {
  const n = i === "" ? e : hMe(e, i);
  n.classGroupId = t;
}, mJe = (i, e, t, n) => {
  if (bJe(i)) {
    whe(i(n), e, t, n);
    return;
  }
  e.validators === null && (e.validators = []), e.validators.push(lJe(t, i));
}, _Je = (i, e, t, n) => {
  const r = Object.entries(i), s = r.length;
  for (let o = 0; o < s; o++) {
    const [a, l] = r[o];
    whe(l, hMe(e, a), t, n);
  }
}, hMe = (i, e) => {
  let t = i;
  const n = e.split(CV), r = n.length;
  for (let s = 0; s < r; s++) {
    const o = n[s];
    let a = t.nextPart.get(o);
    a || (a = uMe(), t.nextPart.set(o, a)), t = a;
  }
  return t;
}, bJe = (i) => "isThemeGetter" in i && i.isThemeGetter === !0, vJe = (i) => {
  if (i < 1)
    return {
      get: () => {
      },
      set: () => {
      }
    };
  let e = 0, t = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null);
  const r = (s, o) => {
    t[s] = o, e++, e > i && (e = 0, n = t, t = /* @__PURE__ */ Object.create(null));
  };
  return {
    get(s) {
      let o = t[s];
      if (o !== void 0)
        return o;
      if ((o = n[s]) !== void 0)
        return r(s, o), o;
    },
    set(s, o) {
      s in t ? t[s] = o : r(s, o);
    }
  };
}, $ne = "!", nxe = ":", yJe = [], ixe = (i, e, t, n, r) => ({
  modifiers: i,
  hasImportantModifier: e,
  baseClassName: t,
  maybePostfixModifierPosition: n,
  isExternal: r
}), CJe = (i) => {
  const {
    prefix: e,
    experimentalParseClassName: t
  } = i;
  let n = (r) => {
    const s = [];
    let o = 0, a = 0, l = 0, c;
    const u = r.length;
    for (let _ = 0; _ < u; _++) {
      const v = r[_];
      if (o === 0 && a === 0) {
        if (v === nxe) {
          s.push(r.slice(l, _)), l = _ + 1;
          continue;
        }
        if (v === "/") {
          c = _;
          continue;
        }
      }
      v === "[" ? o++ : v === "]" ? o-- : v === "(" ? a++ : v === ")" && a--;
    }
    const d = s.length === 0 ? r : r.slice(l);
    let h = d, g = !1;
    d.endsWith($ne) ? (h = d.slice(0, -1), g = !0) : (
      /**
       * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
       * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
       */
      d.startsWith($ne) && (h = d.slice(1), g = !0)
    );
    const m = c && c > l ? c - l : void 0;
    return ixe(s, g, h, m);
  };
  if (e) {
    const r = e + nxe, s = n;
    n = (o) => o.startsWith(r) ? s(o.slice(r.length)) : ixe(yJe, !1, o, void 0, !0);
  }
  if (t) {
    const r = n;
    n = (s) => t({
      className: s,
      parseClassName: r
    });
  }
  return n;
}, wJe = (i) => {
  const e = /* @__PURE__ */ new Map();
  return i.orderSensitiveModifiers.forEach((t, n) => {
    e.set(t, 1e6 + n);
  }), (t) => {
    const n = [];
    let r = [];
    for (let s = 0; s < t.length; s++) {
      const o = t[s], a = o[0] === "[", l = e.has(o);
      a || l ? (r.length > 0 && (r.sort(), n.push(...r), r = []), n.push(o)) : r.push(o);
    }
    return r.length > 0 && (r.sort(), n.push(...r)), n;
  };
}, SJe = (i) => ({
  cache: vJe(i.cacheSize),
  parseClassName: CJe(i),
  sortModifiers: wJe(i),
  ...uJe(i)
}), EJe = /\s+/, xJe = (i, e) => {
  const {
    parseClassName: t,
    getClassGroupId: n,
    getConflictingClassGroupIds: r,
    sortModifiers: s
  } = e, o = [], a = i.trim().split(EJe);
  let l = "";
  for (let c = a.length - 1; c >= 0; c -= 1) {
    const u = a[c], {
      isExternal: d,
      modifiers: h,
      hasImportantModifier: g,
      baseClassName: m,
      maybePostfixModifierPosition: _
    } = t(u);
    if (d) {
      l = u + (l.length > 0 ? " " + l : l);
      continue;
    }
    let v = !!_, w = n(v ? m.substring(0, _) : m);
    if (!w) {
      if (!v) {
        l = u + (l.length > 0 ? " " + l : l);
        continue;
      }
      if (w = n(m), !w) {
        l = u + (l.length > 0 ? " " + l : l);
        continue;
      }
      v = !1;
    }
    const E = h.length === 0 ? "" : h.length === 1 ? h[0] : s(h).join(":"), L = g ? E + $ne : E, T = L + w;
    if (o.indexOf(T) > -1)
      continue;
    o.push(T);
    const D = r(w, v);
    for (let N = 0; N < D.length; ++N) {
      const R = D[N];
      o.push(L + R);
    }
    l = u + (l.length > 0 ? " " + l : l);
  }
  return l;
}, LJe = (...i) => {
  let e = 0, t, n, r = "";
  for (; e < i.length; )
    (t = i[e++]) && (n = fMe(t)) && (r && (r += " "), r += n);
  return r;
}, fMe = (i) => {
  if (typeof i == "string")
    return i;
  let e, t = "";
  for (let n = 0; n < i.length; n++)
    i[n] && (e = fMe(i[n])) && (t && (t += " "), t += e);
  return t;
}, TJe = (i, ...e) => {
  let t, n, r, s;
  const o = (l) => {
    const c = e.reduce((u, d) => d(u), i());
    return t = SJe(c), n = t.cache.get, r = t.cache.set, s = a, a(l);
  }, a = (l) => {
    const c = n(l);
    if (c)
      return c;
    const u = xJe(l, t);
    return r(l, u), u;
  };
  return s = o, (...l) => s(LJe(...l));
}, kJe = [], Wl = (i) => {
  const e = (t) => t[i] || kJe;
  return e.isThemeGetter = !0, e;
}, gMe = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, pMe = /^\((?:(\w[\w-]*):)?(.+)\)$/i, DJe = /^\d+\/\d+$/, IJe = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, NJe = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, RJe = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, AJe = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, OJe = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, uI = (i) => DJe.test(i), Er = (i) => !!i && !Number.isNaN(Number(i)), SC = (i) => !!i && Number.isInteger(Number(i)), SJ = (i) => i.endsWith("%") && Er(i.slice(0, -1)), Dv = (i) => IJe.test(i), MJe = () => !0, PJe = (i) => (
  // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
  // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
  // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
  NJe.test(i) && !RJe.test(i)
), mMe = () => !1, FJe = (i) => AJe.test(i), BJe = (i) => OJe.test(i), HJe = (i) => !Fn(i) && !Bn(i), WJe = (i) => VA(i, vMe, mMe), Fn = (i) => gMe.test(i), nE = (i) => VA(i, yMe, PJe), EJ = (i) => VA(i, jJe, Er), rxe = (i) => VA(i, _Me, mMe), VJe = (i) => VA(i, bMe, BJe), w7 = (i) => VA(i, CMe, FJe), Bn = (i) => pMe.test(i), PM = (i) => UA(i, yMe), UJe = (i) => UA(i, GJe), sxe = (i) => UA(i, _Me), zJe = (i) => UA(i, vMe), $Je = (i) => UA(i, bMe), S7 = (i) => UA(i, CMe, !0), VA = (i, e, t) => {
  const n = gMe.exec(i);
  return n ? n[1] ? e(n[1]) : t(n[2]) : !1;
}, UA = (i, e, t = !1) => {
  const n = pMe.exec(i);
  return n ? n[1] ? e(n[1]) : t : !1;
}, _Me = (i) => i === "position" || i === "percentage", bMe = (i) => i === "image" || i === "url", vMe = (i) => i === "length" || i === "size" || i === "bg-size", yMe = (i) => i === "length", jJe = (i) => i === "number", GJe = (i) => i === "family-name", CMe = (i) => i === "shadow", qJe = () => {
  const i = Wl("color"), e = Wl("font"), t = Wl("text"), n = Wl("font-weight"), r = Wl("tracking"), s = Wl("leading"), o = Wl("breakpoint"), a = Wl("container"), l = Wl("spacing"), c = Wl("radius"), u = Wl("shadow"), d = Wl("inset-shadow"), h = Wl("text-shadow"), g = Wl("drop-shadow"), m = Wl("blur"), _ = Wl("perspective"), v = Wl("aspect"), w = Wl("ease"), E = Wl("animate"), L = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], T = () => [
    "center",
    "top",
    "bottom",
    "left",
    "right",
    "top-left",
    // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
    "left-top",
    "top-right",
    // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
    "right-top",
    "bottom-right",
    // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
    "right-bottom",
    "bottom-left",
    // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
    "left-bottom"
  ], D = () => [...T(), Bn, Fn], N = () => ["auto", "hidden", "clip", "visible", "scroll"], R = () => ["auto", "contain", "none"], M = () => [Bn, Fn, l], B = () => [uI, "full", "auto", ...M()], H = () => [SC, "none", "subgrid", Bn, Fn], j = () => ["auto", {
    span: ["full", SC, Bn, Fn]
  }, SC, Bn, Fn], K = () => [SC, "auto", Bn, Fn], X = () => ["auto", "min", "max", "fr", Bn, Fn], Y = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], G = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], Q = () => ["auto", ...M()], oe = () => [uI, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...M()], Z = () => [i, Bn, Fn], pe = () => [...T(), sxe, rxe, {
    position: [Bn, Fn]
  }], J = () => ["no-repeat", {
    repeat: ["", "x", "y", "space", "round"]
  }], ae = () => ["auto", "cover", "contain", zJe, WJe, {
    size: [Bn, Fn]
  }], be = () => [SJ, PM, nE], re = () => [
    // Deprecated since Tailwind CSS v4.0.0
    "",
    "none",
    "full",
    c,
    Bn,
    Fn
  ], ze = () => ["", Er, PM, nE], Ve = () => ["solid", "dashed", "dotted", "double"], st = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], ot = () => [Er, SJ, sxe, rxe], et = () => [
    // Deprecated since Tailwind CSS v4.0.0
    "",
    "none",
    m,
    Bn,
    Fn
  ], at = () => ["none", Er, Bn, Fn], en = () => ["none", Er, Bn, Fn], sn = () => [Er, Bn, Fn], Vt = () => [uI, "full", ...M()];
  return {
    cacheSize: 500,
    theme: {
      animate: ["spin", "ping", "pulse", "bounce"],
      aspect: ["video"],
      blur: [Dv],
      breakpoint: [Dv],
      color: [MJe],
      container: [Dv],
      "drop-shadow": [Dv],
      ease: ["in", "out", "in-out"],
      font: [HJe],
      "font-weight": ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"],
      "inset-shadow": [Dv],
      leading: ["none", "tight", "snug", "normal", "relaxed", "loose"],
      perspective: ["dramatic", "near", "normal", "midrange", "distant", "none"],
      radius: [Dv],
      shadow: [Dv],
      spacing: ["px", Er],
      text: [Dv],
      "text-shadow": [Dv],
      tracking: ["tighter", "tight", "normal", "wide", "wider", "widest"]
    },
    classGroups: {
      // --------------
      // --- Layout ---
      // --------------
      /**
       * Aspect Ratio
       * @see https://tailwindcss.com/docs/aspect-ratio
       */
      aspect: [{
        aspect: ["auto", "square", uI, Fn, Bn, v]
      }],
      /**
       * Container
       * @see https://tailwindcss.com/docs/container
       * @deprecated since Tailwind CSS v4.0.0
       */
      container: ["container"],
      /**
       * Columns
       * @see https://tailwindcss.com/docs/columns
       */
      columns: [{
        columns: [Er, Fn, Bn, a]
      }],
      /**
       * Break After
       * @see https://tailwindcss.com/docs/break-after
       */
      "break-after": [{
        "break-after": L()
      }],
      /**
       * Break Before
       * @see https://tailwindcss.com/docs/break-before
       */
      "break-before": [{
        "break-before": L()
      }],
      /**
       * Break Inside
       * @see https://tailwindcss.com/docs/break-inside
       */
      "break-inside": [{
        "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
      }],
      /**
       * Box Decoration Break
       * @see https://tailwindcss.com/docs/box-decoration-break
       */
      "box-decoration": [{
        "box-decoration": ["slice", "clone"]
      }],
      /**
       * Box Sizing
       * @see https://tailwindcss.com/docs/box-sizing
       */
      box: [{
        box: ["border", "content"]
      }],
      /**
       * Display
       * @see https://tailwindcss.com/docs/display
       */
      display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
      /**
       * Screen Reader Only
       * @see https://tailwindcss.com/docs/display#screen-reader-only
       */
      sr: ["sr-only", "not-sr-only"],
      /**
       * Floats
       * @see https://tailwindcss.com/docs/float
       */
      float: [{
        float: ["right", "left", "none", "start", "end"]
      }],
      /**
       * Clear
       * @see https://tailwindcss.com/docs/clear
       */
      clear: [{
        clear: ["left", "right", "both", "none", "start", "end"]
      }],
      /**
       * Isolation
       * @see https://tailwindcss.com/docs/isolation
       */
      isolation: ["isolate", "isolation-auto"],
      /**
       * Object Fit
       * @see https://tailwindcss.com/docs/object-fit
       */
      "object-fit": [{
        object: ["contain", "cover", "fill", "none", "scale-down"]
      }],
      /**
       * Object Position
       * @see https://tailwindcss.com/docs/object-position
       */
      "object-position": [{
        object: D()
      }],
      /**
       * Overflow
       * @see https://tailwindcss.com/docs/overflow
       */
      overflow: [{
        overflow: N()
      }],
      /**
       * Overflow X
       * @see https://tailwindcss.com/docs/overflow
       */
      "overflow-x": [{
        "overflow-x": N()
      }],
      /**
       * Overflow Y
       * @see https://tailwindcss.com/docs/overflow
       */
      "overflow-y": [{
        "overflow-y": N()
      }],
      /**
       * Overscroll Behavior
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      overscroll: [{
        overscroll: R()
      }],
      /**
       * Overscroll Behavior X
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      "overscroll-x": [{
        "overscroll-x": R()
      }],
      /**
       * Overscroll Behavior Y
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      "overscroll-y": [{
        "overscroll-y": R()
      }],
      /**
       * Position
       * @see https://tailwindcss.com/docs/position
       */
      position: ["static", "fixed", "absolute", "relative", "sticky"],
      /**
       * Top / Right / Bottom / Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      inset: [{
        inset: B()
      }],
      /**
       * Right / Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      "inset-x": [{
        "inset-x": B()
      }],
      /**
       * Top / Bottom
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      "inset-y": [{
        "inset-y": B()
      }],
      /**
       * Start
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      start: [{
        start: B()
      }],
      /**
       * End
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      end: [{
        end: B()
      }],
      /**
       * Top
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      top: [{
        top: B()
      }],
      /**
       * Right
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      right: [{
        right: B()
      }],
      /**
       * Bottom
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      bottom: [{
        bottom: B()
      }],
      /**
       * Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      left: [{
        left: B()
      }],
      /**
       * Visibility
       * @see https://tailwindcss.com/docs/visibility
       */
      visibility: ["visible", "invisible", "collapse"],
      /**
       * Z-Index
       * @see https://tailwindcss.com/docs/z-index
       */
      z: [{
        z: [SC, "auto", Bn, Fn]
      }],
      // ------------------------
      // --- Flexbox and Grid ---
      // ------------------------
      /**
       * Flex Basis
       * @see https://tailwindcss.com/docs/flex-basis
       */
      basis: [{
        basis: [uI, "full", "auto", a, ...M()]
      }],
      /**
       * Flex Direction
       * @see https://tailwindcss.com/docs/flex-direction
       */
      "flex-direction": [{
        flex: ["row", "row-reverse", "col", "col-reverse"]
      }],
      /**
       * Flex Wrap
       * @see https://tailwindcss.com/docs/flex-wrap
       */
      "flex-wrap": [{
        flex: ["nowrap", "wrap", "wrap-reverse"]
      }],
      /**
       * Flex
       * @see https://tailwindcss.com/docs/flex
       */
      flex: [{
        flex: [Er, uI, "auto", "initial", "none", Fn]
      }],
      /**
       * Flex Grow
       * @see https://tailwindcss.com/docs/flex-grow
       */
      grow: [{
        grow: ["", Er, Bn, Fn]
      }],
      /**
       * Flex Shrink
       * @see https://tailwindcss.com/docs/flex-shrink
       */
      shrink: [{
        shrink: ["", Er, Bn, Fn]
      }],
      /**
       * Order
       * @see https://tailwindcss.com/docs/order
       */
      order: [{
        order: [SC, "first", "last", "none", Bn, Fn]
      }],
      /**
       * Grid Template Columns
       * @see https://tailwindcss.com/docs/grid-template-columns
       */
      "grid-cols": [{
        "grid-cols": H()
      }],
      /**
       * Grid Column Start / End
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-start-end": [{
        col: j()
      }],
      /**
       * Grid Column Start
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-start": [{
        "col-start": K()
      }],
      /**
       * Grid Column End
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-end": [{
        "col-end": K()
      }],
      /**
       * Grid Template Rows
       * @see https://tailwindcss.com/docs/grid-template-rows
       */
      "grid-rows": [{
        "grid-rows": H()
      }],
      /**
       * Grid Row Start / End
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-start-end": [{
        row: j()
      }],
      /**
       * Grid Row Start
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-start": [{
        "row-start": K()
      }],
      /**
       * Grid Row End
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-end": [{
        "row-end": K()
      }],
      /**
       * Grid Auto Flow
       * @see https://tailwindcss.com/docs/grid-auto-flow
       */
      "grid-flow": [{
        "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
      }],
      /**
       * Grid Auto Columns
       * @see https://tailwindcss.com/docs/grid-auto-columns
       */
      "auto-cols": [{
        "auto-cols": X()
      }],
      /**
       * Grid Auto Rows
       * @see https://tailwindcss.com/docs/grid-auto-rows
       */
      "auto-rows": [{
        "auto-rows": X()
      }],
      /**
       * Gap
       * @see https://tailwindcss.com/docs/gap
       */
      gap: [{
        gap: M()
      }],
      /**
       * Gap X
       * @see https://tailwindcss.com/docs/gap
       */
      "gap-x": [{
        "gap-x": M()
      }],
      /**
       * Gap Y
       * @see https://tailwindcss.com/docs/gap
       */
      "gap-y": [{
        "gap-y": M()
      }],
      /**
       * Justify Content
       * @see https://tailwindcss.com/docs/justify-content
       */
      "justify-content": [{
        justify: [...Y(), "normal"]
      }],
      /**
       * Justify Items
       * @see https://tailwindcss.com/docs/justify-items
       */
      "justify-items": [{
        "justify-items": [...G(), "normal"]
      }],
      /**
       * Justify Self
       * @see https://tailwindcss.com/docs/justify-self
       */
      "justify-self": [{
        "justify-self": ["auto", ...G()]
      }],
      /**
       * Align Content
       * @see https://tailwindcss.com/docs/align-content
       */
      "align-content": [{
        content: ["normal", ...Y()]
      }],
      /**
       * Align Items
       * @see https://tailwindcss.com/docs/align-items
       */
      "align-items": [{
        items: [...G(), {
          baseline: ["", "last"]
        }]
      }],
      /**
       * Align Self
       * @see https://tailwindcss.com/docs/align-self
       */
      "align-self": [{
        self: ["auto", ...G(), {
          baseline: ["", "last"]
        }]
      }],
      /**
       * Place Content
       * @see https://tailwindcss.com/docs/place-content
       */
      "place-content": [{
        "place-content": Y()
      }],
      /**
       * Place Items
       * @see https://tailwindcss.com/docs/place-items
       */
      "place-items": [{
        "place-items": [...G(), "baseline"]
      }],
      /**
       * Place Self
       * @see https://tailwindcss.com/docs/place-self
       */
      "place-self": [{
        "place-self": ["auto", ...G()]
      }],
      // Spacing
      /**
       * Padding
       * @see https://tailwindcss.com/docs/padding
       */
      p: [{
        p: M()
      }],
      /**
       * Padding X
       * @see https://tailwindcss.com/docs/padding
       */
      px: [{
        px: M()
      }],
      /**
       * Padding Y
       * @see https://tailwindcss.com/docs/padding
       */
      py: [{
        py: M()
      }],
      /**
       * Padding Start
       * @see https://tailwindcss.com/docs/padding
       */
      ps: [{
        ps: M()
      }],
      /**
       * Padding End
       * @see https://tailwindcss.com/docs/padding
       */
      pe: [{
        pe: M()
      }],
      /**
       * Padding Top
       * @see https://tailwindcss.com/docs/padding
       */
      pt: [{
        pt: M()
      }],
      /**
       * Padding Right
       * @see https://tailwindcss.com/docs/padding
       */
      pr: [{
        pr: M()
      }],
      /**
       * Padding Bottom
       * @see https://tailwindcss.com/docs/padding
       */
      pb: [{
        pb: M()
      }],
      /**
       * Padding Left
       * @see https://tailwindcss.com/docs/padding
       */
      pl: [{
        pl: M()
      }],
      /**
       * Margin
       * @see https://tailwindcss.com/docs/margin
       */
      m: [{
        m: Q()
      }],
      /**
       * Margin X
       * @see https://tailwindcss.com/docs/margin
       */
      mx: [{
        mx: Q()
      }],
      /**
       * Margin Y
       * @see https://tailwindcss.com/docs/margin
       */
      my: [{
        my: Q()
      }],
      /**
       * Margin Start
       * @see https://tailwindcss.com/docs/margin
       */
      ms: [{
        ms: Q()
      }],
      /**
       * Margin End
       * @see https://tailwindcss.com/docs/margin
       */
      me: [{
        me: Q()
      }],
      /**
       * Margin Top
       * @see https://tailwindcss.com/docs/margin
       */
      mt: [{
        mt: Q()
      }],
      /**
       * Margin Right
       * @see https://tailwindcss.com/docs/margin
       */
      mr: [{
        mr: Q()
      }],
      /**
       * Margin Bottom
       * @see https://tailwindcss.com/docs/margin
       */
      mb: [{
        mb: Q()
      }],
      /**
       * Margin Left
       * @see https://tailwindcss.com/docs/margin
       */
      ml: [{
        ml: Q()
      }],
      /**
       * Space Between X
       * @see https://tailwindcss.com/docs/margin#adding-space-between-children
       */
      "space-x": [{
        "space-x": M()
      }],
      /**
       * Space Between X Reverse
       * @see https://tailwindcss.com/docs/margin#adding-space-between-children
       */
      "space-x-reverse": ["space-x-reverse"],
      /**
       * Space Between Y
       * @see https://tailwindcss.com/docs/margin#adding-space-between-children
       */
      "space-y": [{
        "space-y": M()
      }],
      /**
       * Space Between Y Reverse
       * @see https://tailwindcss.com/docs/margin#adding-space-between-children
       */
      "space-y-reverse": ["space-y-reverse"],
      // --------------
      // --- Sizing ---
      // --------------
      /**
       * Size
       * @see https://tailwindcss.com/docs/width#setting-both-width-and-height
       */
      size: [{
        size: oe()
      }],
      /**
       * Width
       * @see https://tailwindcss.com/docs/width
       */
      w: [{
        w: [a, "screen", ...oe()]
      }],
      /**
       * Min-Width
       * @see https://tailwindcss.com/docs/min-width
       */
      "min-w": [{
        "min-w": [
          a,
          "screen",
          /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
          "none",
          ...oe()
        ]
      }],
      /**
       * Max-Width
       * @see https://tailwindcss.com/docs/max-width
       */
      "max-w": [{
        "max-w": [
          a,
          "screen",
          "none",
          /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
          "prose",
          /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
          {
            screen: [o]
          },
          ...oe()
        ]
      }],
      /**
       * Height
       * @see https://tailwindcss.com/docs/height
       */
      h: [{
        h: ["screen", "lh", ...oe()]
      }],
      /**
       * Min-Height
       * @see https://tailwindcss.com/docs/min-height
       */
      "min-h": [{
        "min-h": ["screen", "lh", "none", ...oe()]
      }],
      /**
       * Max-Height
       * @see https://tailwindcss.com/docs/max-height
       */
      "max-h": [{
        "max-h": ["screen", "lh", ...oe()]
      }],
      // ------------------
      // --- Typography ---
      // ------------------
      /**
       * Font Size
       * @see https://tailwindcss.com/docs/font-size
       */
      "font-size": [{
        text: ["base", t, PM, nE]
      }],
      /**
       * Font Smoothing
       * @see https://tailwindcss.com/docs/font-smoothing
       */
      "font-smoothing": ["antialiased", "subpixel-antialiased"],
      /**
       * Font Style
       * @see https://tailwindcss.com/docs/font-style
       */
      "font-style": ["italic", "not-italic"],
      /**
       * Font Weight
       * @see https://tailwindcss.com/docs/font-weight
       */
      "font-weight": [{
        font: [n, Bn, EJ]
      }],
      /**
       * Font Stretch
       * @see https://tailwindcss.com/docs/font-stretch
       */
      "font-stretch": [{
        "font-stretch": ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded", SJ, Fn]
      }],
      /**
       * Font Family
       * @see https://tailwindcss.com/docs/font-family
       */
      "font-family": [{
        font: [UJe, Fn, e]
      }],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-normal": ["normal-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-ordinal": ["ordinal"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-slashed-zero": ["slashed-zero"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-figure": ["lining-nums", "oldstyle-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-spacing": ["proportional-nums", "tabular-nums"],
      /**
       * Font Variant Numeric
       * @see https://tailwindcss.com/docs/font-variant-numeric
       */
      "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
      /**
       * Letter Spacing
       * @see https://tailwindcss.com/docs/letter-spacing
       */
      tracking: [{
        tracking: [r, Bn, Fn]
      }],
      /**
       * Line Clamp
       * @see https://tailwindcss.com/docs/line-clamp
       */
      "line-clamp": [{
        "line-clamp": [Er, "none", Bn, EJ]
      }],
      /**
       * Line Height
       * @see https://tailwindcss.com/docs/line-height
       */
      leading: [{
        leading: [
          /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
          s,
          ...M()
        ]
      }],
      /**
       * List Style Image
       * @see https://tailwindcss.com/docs/list-style-image
       */
      "list-image": [{
        "list-image": ["none", Bn, Fn]
      }],
      /**
       * List Style Position
       * @see https://tailwindcss.com/docs/list-style-position
       */
      "list-style-position": [{
        list: ["inside", "outside"]
      }],
      /**
       * List Style Type
       * @see https://tailwindcss.com/docs/list-style-type
       */
      "list-style-type": [{
        list: ["disc", "decimal", "none", Bn, Fn]
      }],
      /**
       * Text Alignment
       * @see https://tailwindcss.com/docs/text-align
       */
      "text-alignment": [{
        text: ["left", "center", "right", "justify", "start", "end"]
      }],
      /**
       * Placeholder Color
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://v3.tailwindcss.com/docs/placeholder-color
       */
      "placeholder-color": [{
        placeholder: Z()
      }],
      /**
       * Text Color
       * @see https://tailwindcss.com/docs/text-color
       */
      "text-color": [{
        text: Z()
      }],
      /**
       * Text Decoration
       * @see https://tailwindcss.com/docs/text-decoration
       */
      "text-decoration": ["underline", "overline", "line-through", "no-underline"],
      /**
       * Text Decoration Style
       * @see https://tailwindcss.com/docs/text-decoration-style
       */
      "text-decoration-style": [{
        decoration: [...Ve(), "wavy"]
      }],
      /**
       * Text Decoration Thickness
       * @see https://tailwindcss.com/docs/text-decoration-thickness
       */
      "text-decoration-thickness": [{
        decoration: [Er, "from-font", "auto", Bn, nE]
      }],
      /**
       * Text Decoration Color
       * @see https://tailwindcss.com/docs/text-decoration-color
       */
      "text-decoration-color": [{
        decoration: Z()
      }],
      /**
       * Text Underline Offset
       * @see https://tailwindcss.com/docs/text-underline-offset
       */
      "underline-offset": [{
        "underline-offset": [Er, "auto", Bn, Fn]
      }],
      /**
       * Text Transform
       * @see https://tailwindcss.com/docs/text-transform
       */
      "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
      /**
       * Text Overflow
       * @see https://tailwindcss.com/docs/text-overflow
       */
      "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
      /**
       * Text Wrap
       * @see https://tailwindcss.com/docs/text-wrap
       */
      "text-wrap": [{
        text: ["wrap", "nowrap", "balance", "pretty"]
      }],
      /**
       * Text Indent
       * @see https://tailwindcss.com/docs/text-indent
       */
      indent: [{
        indent: M()
      }],
      /**
       * Vertical Alignment
       * @see https://tailwindcss.com/docs/vertical-align
       */
      "vertical-align": [{
        align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", Bn, Fn]
      }],
      /**
       * Whitespace
       * @see https://tailwindcss.com/docs/whitespace
       */
      whitespace: [{
        whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
      }],
      /**
       * Word Break
       * @see https://tailwindcss.com/docs/word-break
       */
      break: [{
        break: ["normal", "words", "all", "keep"]
      }],
      /**
       * Overflow Wrap
       * @see https://tailwindcss.com/docs/overflow-wrap
       */
      wrap: [{
        wrap: ["break-word", "anywhere", "normal"]
      }],
      /**
       * Hyphens
       * @see https://tailwindcss.com/docs/hyphens
       */
      hyphens: [{
        hyphens: ["none", "manual", "auto"]
      }],
      /**
       * Content
       * @see https://tailwindcss.com/docs/content
       */
      content: [{
        content: ["none", Bn, Fn]
      }],
      // -------------------
      // --- Backgrounds ---
      // -------------------
      /**
       * Background Attachment
       * @see https://tailwindcss.com/docs/background-attachment
       */
      "bg-attachment": [{
        bg: ["fixed", "local", "scroll"]
      }],
      /**
       * Background Clip
       * @see https://tailwindcss.com/docs/background-clip
       */
      "bg-clip": [{
        "bg-clip": ["border", "padding", "content", "text"]
      }],
      /**
       * Background Origin
       * @see https://tailwindcss.com/docs/background-origin
       */
      "bg-origin": [{
        "bg-origin": ["border", "padding", "content"]
      }],
      /**
       * Background Position
       * @see https://tailwindcss.com/docs/background-position
       */
      "bg-position": [{
        bg: pe()
      }],
      /**
       * Background Repeat
       * @see https://tailwindcss.com/docs/background-repeat
       */
      "bg-repeat": [{
        bg: J()
      }],
      /**
       * Background Size
       * @see https://tailwindcss.com/docs/background-size
       */
      "bg-size": [{
        bg: ae()
      }],
      /**
       * Background Image
       * @see https://tailwindcss.com/docs/background-image
       */
      "bg-image": [{
        bg: ["none", {
          linear: [{
            to: ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
          }, SC, Bn, Fn],
          radial: ["", Bn, Fn],
          conic: [SC, Bn, Fn]
        }, $Je, VJe]
      }],
      /**
       * Background Color
       * @see https://tailwindcss.com/docs/background-color
       */
      "bg-color": [{
        bg: Z()
      }],
      /**
       * Gradient Color Stops From Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-from-pos": [{
        from: be()
      }],
      /**
       * Gradient Color Stops Via Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-via-pos": [{
        via: be()
      }],
      /**
       * Gradient Color Stops To Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-to-pos": [{
        to: be()
      }],
      /**
       * Gradient Color Stops From
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-from": [{
        from: Z()
      }],
      /**
       * Gradient Color Stops Via
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-via": [{
        via: Z()
      }],
      /**
       * Gradient Color Stops To
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-to": [{
        to: Z()
      }],
      // ---------------
      // --- Borders ---
      // ---------------
      /**
       * Border Radius
       * @see https://tailwindcss.com/docs/border-radius
       */
      rounded: [{
        rounded: re()
      }],
      /**
       * Border Radius Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-s": [{
        "rounded-s": re()
      }],
      /**
       * Border Radius End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-e": [{
        "rounded-e": re()
      }],
      /**
       * Border Radius Top
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-t": [{
        "rounded-t": re()
      }],
      /**
       * Border Radius Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-r": [{
        "rounded-r": re()
      }],
      /**
       * Border Radius Bottom
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-b": [{
        "rounded-b": re()
      }],
      /**
       * Border Radius Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-l": [{
        "rounded-l": re()
      }],
      /**
       * Border Radius Start Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-ss": [{
        "rounded-ss": re()
      }],
      /**
       * Border Radius Start End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-se": [{
        "rounded-se": re()
      }],
      /**
       * Border Radius End End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-ee": [{
        "rounded-ee": re()
      }],
      /**
       * Border Radius End Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-es": [{
        "rounded-es": re()
      }],
      /**
       * Border Radius Top Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-tl": [{
        "rounded-tl": re()
      }],
      /**
       * Border Radius Top Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-tr": [{
        "rounded-tr": re()
      }],
      /**
       * Border Radius Bottom Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-br": [{
        "rounded-br": re()
      }],
      /**
       * Border Radius Bottom Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-bl": [{
        "rounded-bl": re()
      }],
      /**
       * Border Width
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w": [{
        border: ze()
      }],
      /**
       * Border Width X
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-x": [{
        "border-x": ze()
      }],
      /**
       * Border Width Y
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-y": [{
        "border-y": ze()
      }],
      /**
       * Border Width Start
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-s": [{
        "border-s": ze()
      }],
      /**
       * Border Width End
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-e": [{
        "border-e": ze()
      }],
      /**
       * Border Width Top
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-t": [{
        "border-t": ze()
      }],
      /**
       * Border Width Right
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-r": [{
        "border-r": ze()
      }],
      /**
       * Border Width Bottom
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-b": [{
        "border-b": ze()
      }],
      /**
       * Border Width Left
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-l": [{
        "border-l": ze()
      }],
      /**
       * Divide Width X
       * @see https://tailwindcss.com/docs/border-width#between-children
       */
      "divide-x": [{
        "divide-x": ze()
      }],
      /**
       * Divide Width X Reverse
       * @see https://tailwindcss.com/docs/border-width#between-children
       */
      "divide-x-reverse": ["divide-x-reverse"],
      /**
       * Divide Width Y
       * @see https://tailwindcss.com/docs/border-width#between-children
       */
      "divide-y": [{
        "divide-y": ze()
      }],
      /**
       * Divide Width Y Reverse
       * @see https://tailwindcss.com/docs/border-width#between-children
       */
      "divide-y-reverse": ["divide-y-reverse"],
      /**
       * Border Style
       * @see https://tailwindcss.com/docs/border-style
       */
      "border-style": [{
        border: [...Ve(), "hidden", "none"]
      }],
      /**
       * Divide Style
       * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
       */
      "divide-style": [{
        divide: [...Ve(), "hidden", "none"]
      }],
      /**
       * Border Color
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color": [{
        border: Z()
      }],
      /**
       * Border Color X
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-x": [{
        "border-x": Z()
      }],
      /**
       * Border Color Y
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-y": [{
        "border-y": Z()
      }],
      /**
       * Border Color S
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-s": [{
        "border-s": Z()
      }],
      /**
       * Border Color E
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-e": [{
        "border-e": Z()
      }],
      /**
       * Border Color Top
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-t": [{
        "border-t": Z()
      }],
      /**
       * Border Color Right
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-r": [{
        "border-r": Z()
      }],
      /**
       * Border Color Bottom
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-b": [{
        "border-b": Z()
      }],
      /**
       * Border Color Left
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-l": [{
        "border-l": Z()
      }],
      /**
       * Divide Color
       * @see https://tailwindcss.com/docs/divide-color
       */
      "divide-color": [{
        divide: Z()
      }],
      /**
       * Outline Style
       * @see https://tailwindcss.com/docs/outline-style
       */
      "outline-style": [{
        outline: [...Ve(), "none", "hidden"]
      }],
      /**
       * Outline Offset
       * @see https://tailwindcss.com/docs/outline-offset
       */
      "outline-offset": [{
        "outline-offset": [Er, Bn, Fn]
      }],
      /**
       * Outline Width
       * @see https://tailwindcss.com/docs/outline-width
       */
      "outline-w": [{
        outline: ["", Er, PM, nE]
      }],
      /**
       * Outline Color
       * @see https://tailwindcss.com/docs/outline-color
       */
      "outline-color": [{
        outline: Z()
      }],
      // ---------------
      // --- Effects ---
      // ---------------
      /**
       * Box Shadow
       * @see https://tailwindcss.com/docs/box-shadow
       */
      shadow: [{
        shadow: [
          // Deprecated since Tailwind CSS v4.0.0
          "",
          "none",
          u,
          S7,
          w7
        ]
      }],
      /**
       * Box Shadow Color
       * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color
       */
      "shadow-color": [{
        shadow: Z()
      }],
      /**
       * Inset Box Shadow
       * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
       */
      "inset-shadow": [{
        "inset-shadow": ["none", d, S7, w7]
      }],
      /**
       * Inset Box Shadow Color
       * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color
       */
      "inset-shadow-color": [{
        "inset-shadow": Z()
      }],
      /**
       * Ring Width
       * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
       */
      "ring-w": [{
        ring: ze()
      }],
      /**
       * Ring Width Inset
       * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings
       * @deprecated since Tailwind CSS v4.0.0
       * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
       */
      "ring-w-inset": ["ring-inset"],
      /**
       * Ring Color
       * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color
       */
      "ring-color": [{
        ring: Z()
      }],
      /**
       * Ring Offset Width
       * @see https://v3.tailwindcss.com/docs/ring-offset-width
       * @deprecated since Tailwind CSS v4.0.0
       * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
       */
      "ring-offset-w": [{
        "ring-offset": [Er, nE]
      }],
      /**
       * Ring Offset Color
       * @see https://v3.tailwindcss.com/docs/ring-offset-color
       * @deprecated since Tailwind CSS v4.0.0
       * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
       */
      "ring-offset-color": [{
        "ring-offset": Z()
      }],
      /**
       * Inset Ring Width
       * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
       */
      "inset-ring-w": [{
        "inset-ring": ze()
      }],
      /**
       * Inset Ring Color
       * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color
       */
      "inset-ring-color": [{
        "inset-ring": Z()
      }],
      /**
       * Text Shadow
       * @see https://tailwindcss.com/docs/text-shadow
       */
      "text-shadow": [{
        "text-shadow": ["none", h, S7, w7]
      }],
      /**
       * Text Shadow Color
       * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
       */
      "text-shadow-color": [{
        "text-shadow": Z()
      }],
      /**
       * Opacity
       * @see https://tailwindcss.com/docs/opacity
       */
      opacity: [{
        opacity: [Er, Bn, Fn]
      }],
      /**
       * Mix Blend Mode
       * @see https://tailwindcss.com/docs/mix-blend-mode
       */
      "mix-blend": [{
        "mix-blend": [...st(), "plus-darker", "plus-lighter"]
      }],
      /**
       * Background Blend Mode
       * @see https://tailwindcss.com/docs/background-blend-mode
       */
      "bg-blend": [{
        "bg-blend": st()
      }],
      /**
       * Mask Clip
       * @see https://tailwindcss.com/docs/mask-clip
       */
      "mask-clip": [{
        "mask-clip": ["border", "padding", "content", "fill", "stroke", "view"]
      }, "mask-no-clip"],
      /**
       * Mask Composite
       * @see https://tailwindcss.com/docs/mask-composite
       */
      "mask-composite": [{
        mask: ["add", "subtract", "intersect", "exclude"]
      }],
      /**
       * Mask Image
       * @see https://tailwindcss.com/docs/mask-image
       */
      "mask-image-linear-pos": [{
        "mask-linear": [Er]
      }],
      "mask-image-linear-from-pos": [{
        "mask-linear-from": ot()
      }],
      "mask-image-linear-to-pos": [{
        "mask-linear-to": ot()
      }],
      "mask-image-linear-from-color": [{
        "mask-linear-from": Z()
      }],
      "mask-image-linear-to-color": [{
        "mask-linear-to": Z()
      }],
      "mask-image-t-from-pos": [{
        "mask-t-from": ot()
      }],
      "mask-image-t-to-pos": [{
        "mask-t-to": ot()
      }],
      "mask-image-t-from-color": [{
        "mask-t-from": Z()
      }],
      "mask-image-t-to-color": [{
        "mask-t-to": Z()
      }],
      "mask-image-r-from-pos": [{
        "mask-r-from": ot()
      }],
      "mask-image-r-to-pos": [{
        "mask-r-to": ot()
      }],
      "mask-image-r-from-color": [{
        "mask-r-from": Z()
      }],
      "mask-image-r-to-color": [{
        "mask-r-to": Z()
      }],
      "mask-image-b-from-pos": [{
        "mask-b-from": ot()
      }],
      "mask-image-b-to-pos": [{
        "mask-b-to": ot()
      }],
      "mask-image-b-from-color": [{
        "mask-b-from": Z()
      }],
      "mask-image-b-to-color": [{
        "mask-b-to": Z()
      }],
      "mask-image-l-from-pos": [{
        "mask-l-from": ot()
      }],
      "mask-image-l-to-pos": [{
        "mask-l-to": ot()
      }],
      "mask-image-l-from-color": [{
        "mask-l-from": Z()
      }],
      "mask-image-l-to-color": [{
        "mask-l-to": Z()
      }],
      "mask-image-x-from-pos": [{
        "mask-x-from": ot()
      }],
      "mask-image-x-to-pos": [{
        "mask-x-to": ot()
      }],
      "mask-image-x-from-color": [{
        "mask-x-from": Z()
      }],
      "mask-image-x-to-color": [{
        "mask-x-to": Z()
      }],
      "mask-image-y-from-pos": [{
        "mask-y-from": ot()
      }],
      "mask-image-y-to-pos": [{
        "mask-y-to": ot()
      }],
      "mask-image-y-from-color": [{
        "mask-y-from": Z()
      }],
      "mask-image-y-to-color": [{
        "mask-y-to": Z()
      }],
      "mask-image-radial": [{
        "mask-radial": [Bn, Fn]
      }],
      "mask-image-radial-from-pos": [{
        "mask-radial-from": ot()
      }],
      "mask-image-radial-to-pos": [{
        "mask-radial-to": ot()
      }],
      "mask-image-radial-from-color": [{
        "mask-radial-from": Z()
      }],
      "mask-image-radial-to-color": [{
        "mask-radial-to": Z()
      }],
      "mask-image-radial-shape": [{
        "mask-radial": ["circle", "ellipse"]
      }],
      "mask-image-radial-size": [{
        "mask-radial": [{
          closest: ["side", "corner"],
          farthest: ["side", "corner"]
        }]
      }],
      "mask-image-radial-pos": [{
        "mask-radial-at": T()
      }],
      "mask-image-conic-pos": [{
        "mask-conic": [Er]
      }],
      "mask-image-conic-from-pos": [{
        "mask-conic-from": ot()
      }],
      "mask-image-conic-to-pos": [{
        "mask-conic-to": ot()
      }],
      "mask-image-conic-from-color": [{
        "mask-conic-from": Z()
      }],
      "mask-image-conic-to-color": [{
        "mask-conic-to": Z()
      }],
      /**
       * Mask Mode
       * @see https://tailwindcss.com/docs/mask-mode
       */
      "mask-mode": [{
        mask: ["alpha", "luminance", "match"]
      }],
      /**
       * Mask Origin
       * @see https://tailwindcss.com/docs/mask-origin
       */
      "mask-origin": [{
        "mask-origin": ["border", "padding", "content", "fill", "stroke", "view"]
      }],
      /**
       * Mask Position
       * @see https://tailwindcss.com/docs/mask-position
       */
      "mask-position": [{
        mask: pe()
      }],
      /**
       * Mask Repeat
       * @see https://tailwindcss.com/docs/mask-repeat
       */
      "mask-repeat": [{
        mask: J()
      }],
      /**
       * Mask Size
       * @see https://tailwindcss.com/docs/mask-size
       */
      "mask-size": [{
        mask: ae()
      }],
      /**
       * Mask Type
       * @see https://tailwindcss.com/docs/mask-type
       */
      "mask-type": [{
        "mask-type": ["alpha", "luminance"]
      }],
      /**
       * Mask Image
       * @see https://tailwindcss.com/docs/mask-image
       */
      "mask-image": [{
        mask: ["none", Bn, Fn]
      }],
      // ---------------
      // --- Filters ---
      // ---------------
      /**
       * Filter
       * @see https://tailwindcss.com/docs/filter
       */
      filter: [{
        filter: [
          // Deprecated since Tailwind CSS v3.0.0
          "",
          "none",
          Bn,
          Fn
        ]
      }],
      /**
       * Blur
       * @see https://tailwindcss.com/docs/blur
       */
      blur: [{
        blur: et()
      }],
      /**
       * Brightness
       * @see https://tailwindcss.com/docs/brightness
       */
      brightness: [{
        brightness: [Er, Bn, Fn]
      }],
      /**
       * Contrast
       * @see https://tailwindcss.com/docs/contrast
       */
      contrast: [{
        contrast: [Er, Bn, Fn]
      }],
      /**
       * Drop Shadow
       * @see https://tailwindcss.com/docs/drop-shadow
       */
      "drop-shadow": [{
        "drop-shadow": [
          // Deprecated since Tailwind CSS v4.0.0
          "",
          "none",
          g,
          S7,
          w7
        ]
      }],
      /**
       * Drop Shadow Color
       * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
       */
      "drop-shadow-color": [{
        "drop-shadow": Z()
      }],
      /**
       * Grayscale
       * @see https://tailwindcss.com/docs/grayscale
       */
      grayscale: [{
        grayscale: ["", Er, Bn, Fn]
      }],
      /**
       * Hue Rotate
       * @see https://tailwindcss.com/docs/hue-rotate
       */
      "hue-rotate": [{
        "hue-rotate": [Er, Bn, Fn]
      }],
      /**
       * Invert
       * @see https://tailwindcss.com/docs/invert
       */
      invert: [{
        invert: ["", Er, Bn, Fn]
      }],
      /**
       * Saturate
       * @see https://tailwindcss.com/docs/saturate
       */
      saturate: [{
        saturate: [Er, Bn, Fn]
      }],
      /**
       * Sepia
       * @see https://tailwindcss.com/docs/sepia
       */
      sepia: [{
        sepia: ["", Er, Bn, Fn]
      }],
      /**
       * Backdrop Filter
       * @see https://tailwindcss.com/docs/backdrop-filter
       */
      "backdrop-filter": [{
        "backdrop-filter": [
          // Deprecated since Tailwind CSS v3.0.0
          "",
          "none",
          Bn,
          Fn
        ]
      }],
      /**
       * Backdrop Blur
       * @see https://tailwindcss.com/docs/backdrop-blur
       */
      "backdrop-blur": [{
        "backdrop-blur": et()
      }],
      /**
       * Backdrop Brightness
       * @see https://tailwindcss.com/docs/backdrop-brightness
       */
      "backdrop-brightness": [{
        "backdrop-brightness": [Er, Bn, Fn]
      }],
      /**
       * Backdrop Contrast
       * @see https://tailwindcss.com/docs/backdrop-contrast
       */
      "backdrop-contrast": [{
        "backdrop-contrast": [Er, Bn, Fn]
      }],
      /**
       * Backdrop Grayscale
       * @see https://tailwindcss.com/docs/backdrop-grayscale
       */
      "backdrop-grayscale": [{
        "backdrop-grayscale": ["", Er, Bn, Fn]
      }],
      /**
       * Backdrop Hue Rotate
       * @see https://tailwindcss.com/docs/backdrop-hue-rotate
       */
      "backdrop-hue-rotate": [{
        "backdrop-hue-rotate": [Er, Bn, Fn]
      }],
      /**
       * Backdrop Invert
       * @see https://tailwindcss.com/docs/backdrop-invert
       */
      "backdrop-invert": [{
        "backdrop-invert": ["", Er, Bn, Fn]
      }],
      /**
       * Backdrop Opacity
       * @see https://tailwindcss.com/docs/backdrop-opacity
       */
      "backdrop-opacity": [{
        "backdrop-opacity": [Er, Bn, Fn]
      }],
      /**
       * Backdrop Saturate
       * @see https://tailwindcss.com/docs/backdrop-saturate
       */
      "backdrop-saturate": [{
        "backdrop-saturate": [Er, Bn, Fn]
      }],
      /**
       * Backdrop Sepia
       * @see https://tailwindcss.com/docs/backdrop-sepia
       */
      "backdrop-sepia": [{
        "backdrop-sepia": ["", Er, Bn, Fn]
      }],
      // --------------
      // --- Tables ---
      // --------------
      /**
       * Border Collapse
       * @see https://tailwindcss.com/docs/border-collapse
       */
      "border-collapse": [{
        border: ["collapse", "separate"]
      }],
      /**
       * Border Spacing
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing": [{
        "border-spacing": M()
      }],
      /**
       * Border Spacing X
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing-x": [{
        "border-spacing-x": M()
      }],
      /**
       * Border Spacing Y
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing-y": [{
        "border-spacing-y": M()
      }],
      /**
       * Table Layout
       * @see https://tailwindcss.com/docs/table-layout
       */
      "table-layout": [{
        table: ["auto", "fixed"]
      }],
      /**
       * Caption Side
       * @see https://tailwindcss.com/docs/caption-side
       */
      caption: [{
        caption: ["top", "bottom"]
      }],
      // ---------------------------------
      // --- Transitions and Animation ---
      // ---------------------------------
      /**
       * Transition Property
       * @see https://tailwindcss.com/docs/transition-property
       */
      transition: [{
        transition: ["", "all", "colors", "opacity", "shadow", "transform", "none", Bn, Fn]
      }],
      /**
       * Transition Behavior
       * @see https://tailwindcss.com/docs/transition-behavior
       */
      "transition-behavior": [{
        transition: ["normal", "discrete"]
      }],
      /**
       * Transition Duration
       * @see https://tailwindcss.com/docs/transition-duration
       */
      duration: [{
        duration: [Er, "initial", Bn, Fn]
      }],
      /**
       * Transition Timing Function
       * @see https://tailwindcss.com/docs/transition-timing-function
       */
      ease: [{
        ease: ["linear", "initial", w, Bn, Fn]
      }],
      /**
       * Transition Delay
       * @see https://tailwindcss.com/docs/transition-delay
       */
      delay: [{
        delay: [Er, Bn, Fn]
      }],
      /**
       * Animation
       * @see https://tailwindcss.com/docs/animation
       */
      animate: [{
        animate: ["none", E, Bn, Fn]
      }],
      // ------------------
      // --- Transforms ---
      // ------------------
      /**
       * Backface Visibility
       * @see https://tailwindcss.com/docs/backface-visibility
       */
      backface: [{
        backface: ["hidden", "visible"]
      }],
      /**
       * Perspective
       * @see https://tailwindcss.com/docs/perspective
       */
      perspective: [{
        perspective: [_, Bn, Fn]
      }],
      /**
       * Perspective Origin
       * @see https://tailwindcss.com/docs/perspective-origin
       */
      "perspective-origin": [{
        "perspective-origin": D()
      }],
      /**
       * Rotate
       * @see https://tailwindcss.com/docs/rotate
       */
      rotate: [{
        rotate: at()
      }],
      /**
       * Rotate X
       * @see https://tailwindcss.com/docs/rotate
       */
      "rotate-x": [{
        "rotate-x": at()
      }],
      /**
       * Rotate Y
       * @see https://tailwindcss.com/docs/rotate
       */
      "rotate-y": [{
        "rotate-y": at()
      }],
      /**
       * Rotate Z
       * @see https://tailwindcss.com/docs/rotate
       */
      "rotate-z": [{
        "rotate-z": at()
      }],
      /**
       * Scale
       * @see https://tailwindcss.com/docs/scale
       */
      scale: [{
        scale: en()
      }],
      /**
       * Scale X
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-x": [{
        "scale-x": en()
      }],
      /**
       * Scale Y
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-y": [{
        "scale-y": en()
      }],
      /**
       * Scale Z
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-z": [{
        "scale-z": en()
      }],
      /**
       * Scale 3D
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-3d": ["scale-3d"],
      /**
       * Skew
       * @see https://tailwindcss.com/docs/skew
       */
      skew: [{
        skew: sn()
      }],
      /**
       * Skew X
       * @see https://tailwindcss.com/docs/skew
       */
      "skew-x": [{
        "skew-x": sn()
      }],
      /**
       * Skew Y
       * @see https://tailwindcss.com/docs/skew
       */
      "skew-y": [{
        "skew-y": sn()
      }],
      /**
       * Transform
       * @see https://tailwindcss.com/docs/transform
       */
      transform: [{
        transform: [Bn, Fn, "", "none", "gpu", "cpu"]
      }],
      /**
       * Transform Origin
       * @see https://tailwindcss.com/docs/transform-origin
       */
      "transform-origin": [{
        origin: D()
      }],
      /**
       * Transform Style
       * @see https://tailwindcss.com/docs/transform-style
       */
      "transform-style": [{
        transform: ["3d", "flat"]
      }],
      /**
       * Translate
       * @see https://tailwindcss.com/docs/translate
       */
      translate: [{
        translate: Vt()
      }],
      /**
       * Translate X
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-x": [{
        "translate-x": Vt()
      }],
      /**
       * Translate Y
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-y": [{
        "translate-y": Vt()
      }],
      /**
       * Translate Z
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-z": [{
        "translate-z": Vt()
      }],
      /**
       * Translate None
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-none": ["translate-none"],
      // ---------------------
      // --- Interactivity ---
      // ---------------------
      /**
       * Accent Color
       * @see https://tailwindcss.com/docs/accent-color
       */
      accent: [{
        accent: Z()
      }],
      /**
       * Appearance
       * @see https://tailwindcss.com/docs/appearance
       */
      appearance: [{
        appearance: ["none", "auto"]
      }],
      /**
       * Caret Color
       * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
       */
      "caret-color": [{
        caret: Z()
      }],
      /**
       * Color Scheme
       * @see https://tailwindcss.com/docs/color-scheme
       */
      "color-scheme": [{
        scheme: ["normal", "dark", "light", "light-dark", "only-dark", "only-light"]
      }],
      /**
       * Cursor
       * @see https://tailwindcss.com/docs/cursor
       */
      cursor: [{
        cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", Bn, Fn]
      }],
      /**
       * Field Sizing
       * @see https://tailwindcss.com/docs/field-sizing
       */
      "field-sizing": [{
        "field-sizing": ["fixed", "content"]
      }],
      /**
       * Pointer Events
       * @see https://tailwindcss.com/docs/pointer-events
       */
      "pointer-events": [{
        "pointer-events": ["auto", "none"]
      }],
      /**
       * Resize
       * @see https://tailwindcss.com/docs/resize
       */
      resize: [{
        resize: ["none", "", "y", "x"]
      }],
      /**
       * Scroll Behavior
       * @see https://tailwindcss.com/docs/scroll-behavior
       */
      "scroll-behavior": [{
        scroll: ["auto", "smooth"]
      }],
      /**
       * Scroll Margin
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-m": [{
        "scroll-m": M()
      }],
      /**
       * Scroll Margin X
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mx": [{
        "scroll-mx": M()
      }],
      /**
       * Scroll Margin Y
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-my": [{
        "scroll-my": M()
      }],
      /**
       * Scroll Margin Start
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-ms": [{
        "scroll-ms": M()
      }],
      /**
       * Scroll Margin End
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-me": [{
        "scroll-me": M()
      }],
      /**
       * Scroll Margin Top
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mt": [{
        "scroll-mt": M()
      }],
      /**
       * Scroll Margin Right
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mr": [{
        "scroll-mr": M()
      }],
      /**
       * Scroll Margin Bottom
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mb": [{
        "scroll-mb": M()
      }],
      /**
       * Scroll Margin Left
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-ml": [{
        "scroll-ml": M()
      }],
      /**
       * Scroll Padding
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-p": [{
        "scroll-p": M()
      }],
      /**
       * Scroll Padding X
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-px": [{
        "scroll-px": M()
      }],
      /**
       * Scroll Padding Y
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-py": [{
        "scroll-py": M()
      }],
      /**
       * Scroll Padding Start
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-ps": [{
        "scroll-ps": M()
      }],
      /**
       * Scroll Padding End
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pe": [{
        "scroll-pe": M()
      }],
      /**
       * Scroll Padding Top
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pt": [{
        "scroll-pt": M()
      }],
      /**
       * Scroll Padding Right
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pr": [{
        "scroll-pr": M()
      }],
      /**
       * Scroll Padding Bottom
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pb": [{
        "scroll-pb": M()
      }],
      /**
       * Scroll Padding Left
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pl": [{
        "scroll-pl": M()
      }],
      /**
       * Scroll Snap Align
       * @see https://tailwindcss.com/docs/scroll-snap-align
       */
      "snap-align": [{
        snap: ["start", "end", "center", "align-none"]
      }],
      /**
       * Scroll Snap Stop
       * @see https://tailwindcss.com/docs/scroll-snap-stop
       */
      "snap-stop": [{
        snap: ["normal", "always"]
      }],
      /**
       * Scroll Snap Type
       * @see https://tailwindcss.com/docs/scroll-snap-type
       */
      "snap-type": [{
        snap: ["none", "x", "y", "both"]
      }],
      /**
       * Scroll Snap Type Strictness
       * @see https://tailwindcss.com/docs/scroll-snap-type
       */
      "snap-strictness": [{
        snap: ["mandatory", "proximity"]
      }],
      /**
       * Touch Action
       * @see https://tailwindcss.com/docs/touch-action
       */
      touch: [{
        touch: ["auto", "none", "manipulation"]
      }],
      /**
       * Touch Action X
       * @see https://tailwindcss.com/docs/touch-action
       */
      "touch-x": [{
        "touch-pan": ["x", "left", "right"]
      }],
      /**
       * Touch Action Y
       * @see https://tailwindcss.com/docs/touch-action
       */
      "touch-y": [{
        "touch-pan": ["y", "up", "down"]
      }],
      /**
       * Touch Action Pinch Zoom
       * @see https://tailwindcss.com/docs/touch-action
       */
      "touch-pz": ["touch-pinch-zoom"],
      /**
       * User Select
       * @see https://tailwindcss.com/docs/user-select
       */
      select: [{
        select: ["none", "text", "all", "auto"]
      }],
      /**
       * Will Change
       * @see https://tailwindcss.com/docs/will-change
       */
      "will-change": [{
        "will-change": ["auto", "scroll", "contents", "transform", Bn, Fn]
      }],
      // -----------
      // --- SVG ---
      // -----------
      /**
       * Fill
       * @see https://tailwindcss.com/docs/fill
       */
      fill: [{
        fill: ["none", ...Z()]
      }],
      /**
       * Stroke Width
       * @see https://tailwindcss.com/docs/stroke-width
       */
      "stroke-w": [{
        stroke: [Er, PM, nE, EJ]
      }],
      /**
       * Stroke
       * @see https://tailwindcss.com/docs/stroke
       */
      stroke: [{
        stroke: ["none", ...Z()]
      }],
      // ---------------------
      // --- Accessibility ---
      // ---------------------
      /**
       * Forced Color Adjust
       * @see https://tailwindcss.com/docs/forced-color-adjust
       */
      "forced-color-adjust": [{
        "forced-color-adjust": ["auto", "none"]
      }]
    },
    conflictingClassGroups: {
      overflow: ["overflow-x", "overflow-y"],
      overscroll: ["overscroll-x", "overscroll-y"],
      inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
      "inset-x": ["right", "left"],
      "inset-y": ["top", "bottom"],
      flex: ["basis", "grow", "shrink"],
      gap: ["gap-x", "gap-y"],
      p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
      px: ["pr", "pl"],
      py: ["pt", "pb"],
      m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
      mx: ["mr", "ml"],
      my: ["mt", "mb"],
      size: ["w", "h"],
      "font-size": ["leading"],
      "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
      "fvn-ordinal": ["fvn-normal"],
      "fvn-slashed-zero": ["fvn-normal"],
      "fvn-figure": ["fvn-normal"],
      "fvn-spacing": ["fvn-normal"],
      "fvn-fraction": ["fvn-normal"],
      "line-clamp": ["display", "overflow"],
      rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
      "rounded-s": ["rounded-ss", "rounded-es"],
      "rounded-e": ["rounded-se", "rounded-ee"],
      "rounded-t": ["rounded-tl", "rounded-tr"],
      "rounded-r": ["rounded-tr", "rounded-br"],
      "rounded-b": ["rounded-br", "rounded-bl"],
      "rounded-l": ["rounded-tl", "rounded-bl"],
      "border-spacing": ["border-spacing-x", "border-spacing-y"],
      "border-w": ["border-w-x", "border-w-y", "border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
      "border-w-x": ["border-w-r", "border-w-l"],
      "border-w-y": ["border-w-t", "border-w-b"],
      "border-color": ["border-color-x", "border-color-y", "border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
      "border-color-x": ["border-color-r", "border-color-l"],
      "border-color-y": ["border-color-t", "border-color-b"],
      translate: ["translate-x", "translate-y", "translate-none"],
      "translate-none": ["translate", "translate-x", "translate-y", "translate-z"],
      "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
      "scroll-mx": ["scroll-mr", "scroll-ml"],
      "scroll-my": ["scroll-mt", "scroll-mb"],
      "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
      "scroll-px": ["scroll-pr", "scroll-pl"],
      "scroll-py": ["scroll-pt", "scroll-pb"],
      touch: ["touch-x", "touch-y", "touch-pz"],
      "touch-x": ["touch"],
      "touch-y": ["touch"],
      "touch-pz": ["touch"]
    },
    conflictingClassGroupModifiers: {
      "font-size": ["leading"]
    },
    orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
  };
}, KJe = /* @__PURE__ */ TJe(qJe);
function YJe(...i) {
  return KJe(oJe(i));
}
const XJe = YJe(
  "flex items-center gap-1.5 px-3 h-[24px] text-xs font-medium rounded-sm",
  "bg-[var(--btn-primary)] text-white hover:bg-[var(--btn-primary-hover)] transition-colors",
  "focus:outline-none focus:ring-1 focus:ring-[var(--focus-ring)]"
);
function ZJe({ mode: i, onToggleMode: e }) {
  return /* @__PURE__ */ hr.jsx("div", { className: "flex items-center justify-end gap-2 h-[32px] px-3 bg-[var(--toolbar-bg)] border-b border-[var(--toolbar-border)]", children: /* @__PURE__ */ hr.jsx("button", { onClick: e, className: XJe, children: i === "edit" ? /* @__PURE__ */ hr.jsxs(hr.Fragment, { children: [
    /* @__PURE__ */ hr.jsx(iJe, { className: "h-3 w-3" }),
    /* @__PURE__ */ hr.jsx("span", { children: "Preview" })
  ] }) : /* @__PURE__ */ hr.jsxs(hr.Fragment, { children: [
    /* @__PURE__ */ hr.jsx(sJe, { className: "h-3 w-3" }),
    /* @__PURE__ */ hr.jsx("span", { children: "Edit" })
  ] }) }) });
}
function oxe(i, e) {
  (e == null || e > i.length) && (e = i.length);
  for (var t = 0, n = Array(e); t < e; t++) n[t] = i[t];
  return n;
}
function QJe(i) {
  if (Array.isArray(i)) return i;
}
function JJe(i, e, t) {
  return (e = oet(e)) in i ? Object.defineProperty(i, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : i[e] = t, i;
}
function eet(i, e) {
  var t = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
  if (t != null) {
    var n, r, s, o, a = [], l = !0, c = !1;
    try {
      if (s = (t = t.call(i)).next, e !== 0) for (; !(l = (n = s.call(t)).done) && (a.push(n.value), a.length !== e); l = !0) ;
    } catch (u) {
      c = !0, r = u;
    } finally {
      try {
        if (!l && t.return != null && (o = t.return(), Object(o) !== o)) return;
      } finally {
        if (c) throw r;
      }
    }
    return a;
  }
}
function tet() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function axe(i, e) {
  var t = Object.keys(i);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(i);
    e && (n = n.filter(function(r) {
      return Object.getOwnPropertyDescriptor(i, r).enumerable;
    })), t.push.apply(t, n);
  }
  return t;
}
function lxe(i) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? axe(Object(t), !0).forEach(function(n) {
      JJe(i, n, t[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : axe(Object(t)).forEach(function(n) {
      Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
    });
  }
  return i;
}
function net(i, e) {
  if (i == null) return {};
  var t, n, r = iet(i, e);
  if (Object.getOwnPropertySymbols) {
    var s = Object.getOwnPropertySymbols(i);
    for (n = 0; n < s.length; n++) t = s[n], e.indexOf(t) === -1 && {}.propertyIsEnumerable.call(i, t) && (r[t] = i[t]);
  }
  return r;
}
function iet(i, e) {
  if (i == null) return {};
  var t = {};
  for (var n in i) if ({}.hasOwnProperty.call(i, n)) {
    if (e.indexOf(n) !== -1) continue;
    t[n] = i[n];
  }
  return t;
}
function ret(i, e) {
  return QJe(i) || eet(i, e) || aet(i, e) || tet();
}
function set(i, e) {
  if (typeof i != "object" || !i) return i;
  var t = i[Symbol.toPrimitive];
  if (t !== void 0) {
    var n = t.call(i, e);
    if (typeof n != "object") return n;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (e === "string" ? String : Number)(i);
}
function oet(i) {
  var e = set(i, "string");
  return typeof e == "symbol" ? e : e + "";
}
function aet(i, e) {
  if (i) {
    if (typeof i == "string") return oxe(i, e);
    var t = {}.toString.call(i).slice(8, -1);
    return t === "Object" && i.constructor && (t = i.constructor.name), t === "Map" || t === "Set" ? Array.from(i) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? oxe(i, e) : void 0;
  }
}
function cet(i, e, t) {
  return e in i ? Object.defineProperty(i, e, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : i[e] = t, i;
}
function cxe(i, e) {
  var t = Object.keys(i);
  if (Object.getOwnPropertySymbols) {
    var n = Object.getOwnPropertySymbols(i);
    e && (n = n.filter(function(r) {
      return Object.getOwnPropertyDescriptor(i, r).enumerable;
    })), t.push.apply(t, n);
  }
  return t;
}
function uxe(i) {
  for (var e = 1; e < arguments.length; e++) {
    var t = arguments[e] != null ? arguments[e] : {};
    e % 2 ? cxe(Object(t), !0).forEach(function(n) {
      cet(i, n, t[n]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : cxe(Object(t)).forEach(function(n) {
      Object.defineProperty(i, n, Object.getOwnPropertyDescriptor(t, n));
    });
  }
  return i;
}
function uet() {
  for (var i = arguments.length, e = new Array(i), t = 0; t < i; t++)
    e[t] = arguments[t];
  return function(n) {
    return e.reduceRight(function(r, s) {
      return s(r);
    }, n);
  };
}
function WP(i) {
  return function e() {
    for (var t = this, n = arguments.length, r = new Array(n), s = 0; s < n; s++)
      r[s] = arguments[s];
    return r.length >= i.length ? i.apply(this, r) : function() {
      for (var o = arguments.length, a = new Array(o), l = 0; l < o; l++)
        a[l] = arguments[l];
      return e.apply(t, [].concat(r, a));
    };
  };
}
function wV(i) {
  return {}.toString.call(i).includes("Object");
}
function det(i) {
  return !Object.keys(i).length;
}
function q3(i) {
  return typeof i == "function";
}
function het(i, e) {
  return Object.prototype.hasOwnProperty.call(i, e);
}
function fet(i, e) {
  return wV(e) || S1("changeType"), Object.keys(e).some(function(t) {
    return !het(i, t);
  }) && S1("changeField"), e;
}
function get(i) {
  q3(i) || S1("selectorType");
}
function pet(i) {
  q3(i) || wV(i) || S1("handlerType"), wV(i) && Object.values(i).some(function(e) {
    return !q3(e);
  }) && S1("handlersType");
}
function met(i) {
  i || S1("initialIsRequired"), wV(i) || S1("initialType"), det(i) && S1("initialContent");
}
function _et(i, e) {
  throw new Error(i[e] || i.default);
}
var bet = {
  initialIsRequired: "initial state is required",
  initialType: "initial state should be an object",
  initialContent: "initial state shouldn't be an empty object",
  handlerType: "handler should be an object or a function",
  handlersType: "all handlers should be a functions",
  selectorType: "selector should be a function",
  changeType: "provided value of changes should be an object",
  changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
  default: "an unknown error accured in `state-local` package"
}, S1 = WP(_et)(bet), E7 = {
  changes: fet,
  selector: get,
  handler: pet,
  initial: met
};
function vet(i) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  E7.initial(i), E7.handler(e);
  var t = {
    current: i
  }, n = WP(wet)(t, e), r = WP(Cet)(t), s = WP(E7.changes)(i), o = WP(yet)(t);
  function a() {
    var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(u) {
      return u;
    };
    return E7.selector(c), c(t.current);
  }
  function l(c) {
    uet(n, r, s, o)(c);
  }
  return [a, l];
}
function yet(i, e) {
  return q3(e) ? e(i.current) : e;
}
function Cet(i, e) {
  return i.current = uxe(uxe({}, i.current), e), e;
}
function wet(i, e, t) {
  return q3(e) ? e(i.current) : Object.keys(t).forEach(function(n) {
    var r;
    return (r = e[n]) === null || r === void 0 ? void 0 : r.call(e, i.current[n]);
  }), t;
}
var Eet = {
  create: vet
}, xet = {
  paths: {
    vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
  }
};
function Let(i) {
  return function e() {
    for (var t = this, n = arguments.length, r = new Array(n), s = 0; s < n; s++)
      r[s] = arguments[s];
    return r.length >= i.length ? i.apply(this, r) : function() {
      for (var o = arguments.length, a = new Array(o), l = 0; l < o; l++)
        a[l] = arguments[l];
      return e.apply(t, [].concat(r, a));
    };
  };
}
function Tet(i) {
  return {}.toString.call(i).includes("Object");
}
function ket(i) {
  return i || dxe("configIsRequired"), Tet(i) || dxe("configType"), i.urls ? (Det(), {
    paths: {
      vs: i.urls.monacoBase
    }
  }) : i;
}
function Det() {
  console.warn(wMe.deprecation);
}
function Iet(i, e) {
  throw new Error(i[e] || i.default);
}
var wMe = {
  configIsRequired: "the configuration object is required",
  configType: "the configuration object should be an object",
  default: "an unknown error accured in `@monaco-editor/loader` package",
  deprecation: `Deprecation warning!
    You are using deprecated way of configuration.

    Instead of using
      monaco.config({ urls: { monacoBase: '...' } })
    use
      monaco.config({ paths: { vs: '...' } })

    For more please check the link https://github.com/suren-atoyan/monaco-loader#config
  `
}, dxe = Let(Iet)(wMe), Net = {
  config: ket
}, Ret = function() {
  for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
    t[n] = arguments[n];
  return function(r) {
    return t.reduceRight(function(s, o) {
      return o(s);
    }, r);
  };
};
function SMe(i, e) {
  return Object.keys(e).forEach(function(t) {
    e[t] instanceof Object && i[t] && Object.assign(e[t], SMe(i[t], e[t]));
  }), lxe(lxe({}, i), e);
}
var Aet = {
  type: "cancelation",
  msg: "operation is manually canceled"
};
function xJ(i) {
  var e = !1, t = new Promise(function(n, r) {
    i.then(function(s) {
      return e ? r(Aet) : n(s);
    }), i.catch(r);
  });
  return t.cancel = function() {
    return e = !0;
  }, t;
}
var Oet = ["monaco"], Met = Eet.create({
  config: xet,
  isInitialized: !1,
  resolve: null,
  reject: null,
  monaco: null
}), EMe = ret(Met, 2), cB = EMe[0], hq = EMe[1];
function Pet(i) {
  var e = Net.config(i), t = e.monaco, n = net(e, Oet);
  hq(function(r) {
    return {
      config: SMe(r.config, n),
      monaco: t
    };
  });
}
function Fet() {
  var i = cB(function(e) {
    var t = e.monaco, n = e.isInitialized, r = e.resolve;
    return {
      monaco: t,
      isInitialized: n,
      resolve: r
    };
  });
  if (!i.isInitialized) {
    if (hq({
      isInitialized: !0
    }), i.monaco)
      return i.resolve(i.monaco), xJ(LJ);
    if (window.monaco && window.monaco.editor)
      return xMe(window.monaco), i.resolve(window.monaco), xJ(LJ);
    Ret(Bet, Wet)(Vet);
  }
  return xJ(LJ);
}
function Bet(i) {
  return document.body.appendChild(i);
}
function Het(i) {
  var e = document.createElement("script");
  return i && (e.src = i), e;
}
function Wet(i) {
  var e = cB(function(n) {
    var r = n.config, s = n.reject;
    return {
      config: r,
      reject: s
    };
  }), t = Het("".concat(e.config.paths.vs, "/loader.js"));
  return t.onload = function() {
    return i();
  }, t.onerror = e.reject, t;
}
function Vet() {
  var i = cB(function(t) {
    var n = t.config, r = t.resolve, s = t.reject;
    return {
      config: n,
      resolve: r,
      reject: s
    };
  }), e = window.require;
  e.config(i.config), e(["vs/editor/editor.main"], function(t) {
    var n = t.m || t;
    xMe(n), i.resolve(n);
  }, function(t) {
    i.reject(t);
  });
}
function xMe(i) {
  cB().monaco || hq({
    monaco: i
  });
}
function Uet() {
  return cB(function(i) {
    var e = i.monaco;
    return e;
  });
}
var LJ = new Promise(function(i, e) {
  return hq({
    resolve: i,
    reject: e
  });
}), She = {
  config: Pet,
  init: Fet,
  __getMonacoInstance: Uet
}, zet = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, TJ = zet, $et = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, jet = $et;
function Get({ children: i }) {
  return nb.createElement("div", { style: jet.container }, i);
}
var qet = Get, Ket = qet;
function Yet({ width: i, height: e, isEditorReady: t, loading: n, _ref: r, className: s, wrapperProps: o }) {
  return nb.createElement("section", { style: { ...TJ.wrapper, width: i, height: e }, ...o }, !t && nb.createElement(Ket, null, n), nb.createElement("div", { ref: r, style: { ...TJ.fullWidth, ...!t && TJ.hide }, className: s }));
}
var Xet = Yet, LMe = Zn.memo(Xet);
function Zet(i) {
  Zn.useEffect(i, []);
}
var TMe = Zet;
function Qet(i, e, t = !0) {
  let n = Zn.useRef(!0);
  Zn.useEffect(n.current || !t ? () => {
    n.current = !1;
  } : i, e);
}
var Lf = Qet;
function bF() {
}
function eN(i, e, t, n) {
  return Jet(i, n) || ett(i, e, t, n);
}
function Jet(i, e) {
  return i.editor.getModel(kMe(i, e));
}
function ett(i, e, t, n) {
  return i.editor.createModel(e, t, n ? kMe(i, n) : void 0);
}
function kMe(i, e) {
  return i.Uri.parse(e);
}
function ttt({ original: i, modified: e, language: t, originalLanguage: n, modifiedLanguage: r, originalModelPath: s, modifiedModelPath: o, keepCurrentOriginalModel: a = !1, keepCurrentModifiedModel: l = !1, theme: c = "light", loading: u = "Loading...", options: d = {}, height: h = "100%", width: g = "100%", className: m, wrapperProps: _ = {}, beforeMount: v = bF, onMount: w = bF }) {
  let [E, L] = Zn.useState(!1), [T, D] = Zn.useState(!0), N = Zn.useRef(null), R = Zn.useRef(null), M = Zn.useRef(null), B = Zn.useRef(w), H = Zn.useRef(v), j = Zn.useRef(!1);
  TMe(() => {
    let G = She.init();
    return G.then((Q) => (R.current = Q) && D(!1)).catch((Q) => (Q == null ? void 0 : Q.type) !== "cancelation" && console.error("Monaco initialization: error:", Q)), () => N.current ? Y() : G.cancel();
  }), Lf(() => {
    if (N.current && R.current) {
      let G = N.current.getOriginalEditor(), Q = eN(R.current, i || "", n || t || "text", s || "");
      Q !== G.getModel() && G.setModel(Q);
    }
  }, [s], E), Lf(() => {
    if (N.current && R.current) {
      let G = N.current.getModifiedEditor(), Q = eN(R.current, e || "", r || t || "text", o || "");
      Q !== G.getModel() && G.setModel(Q);
    }
  }, [o], E), Lf(() => {
    let G = N.current.getModifiedEditor();
    G.getOption(R.current.editor.EditorOption.readOnly) ? G.setValue(e || "") : e !== G.getValue() && (G.executeEdits("", [{ range: G.getModel().getFullModelRange(), text: e || "", forceMoveMarkers: !0 }]), G.pushUndoStop());
  }, [e], E), Lf(() => {
    var G, Q;
    (Q = (G = N.current) == null ? void 0 : G.getModel()) == null || Q.original.setValue(i || "");
  }, [i], E), Lf(() => {
    let { original: G, modified: Q } = N.current.getModel();
    R.current.editor.setModelLanguage(G, n || t || "text"), R.current.editor.setModelLanguage(Q, r || t || "text");
  }, [t, n, r], E), Lf(() => {
    var G;
    (G = R.current) == null || G.editor.setTheme(c);
  }, [c], E), Lf(() => {
    var G;
    (G = N.current) == null || G.updateOptions(d);
  }, [d], E);
  let K = Zn.useCallback(() => {
    var oe;
    if (!R.current) return;
    H.current(R.current);
    let G = eN(R.current, i || "", n || t || "text", s || ""), Q = eN(R.current, e || "", r || t || "text", o || "");
    (oe = N.current) == null || oe.setModel({ original: G, modified: Q });
  }, [t, e, r, i, n, s, o]), X = Zn.useCallback(() => {
    var G;
    !j.current && M.current && (N.current = R.current.editor.createDiffEditor(M.current, { automaticLayout: !0, ...d }), K(), (G = R.current) == null || G.editor.setTheme(c), L(!0), j.current = !0);
  }, [d, c, K]);
  Zn.useEffect(() => {
    E && B.current(N.current, R.current);
  }, [E]), Zn.useEffect(() => {
    !T && !E && X();
  }, [T, E, X]);
  function Y() {
    var Q, oe, Z, pe;
    let G = (Q = N.current) == null ? void 0 : Q.getModel();
    a || ((oe = G == null ? void 0 : G.original) == null || oe.dispose()), l || ((Z = G == null ? void 0 : G.modified) == null || Z.dispose()), (pe = N.current) == null || pe.dispose();
  }
  return nb.createElement(LMe, { width: g, height: h, isEditorReady: E, loading: u, _ref: M, className: m, wrapperProps: _ });
}
var ntt = ttt;
Zn.memo(ntt);
function itt(i) {
  let e = Zn.useRef();
  return Zn.useEffect(() => {
    e.current = i;
  }, [i]), e.current;
}
var rtt = itt, x7 = /* @__PURE__ */ new Map();
function stt({ defaultValue: i, defaultLanguage: e, defaultPath: t, value: n, language: r, path: s, theme: o = "light", line: a, loading: l = "Loading...", options: c = {}, overrideServices: u = {}, saveViewState: d = !0, keepCurrentModel: h = !1, width: g = "100%", height: m = "100%", className: _, wrapperProps: v = {}, beforeMount: w = bF, onMount: E = bF, onChange: L, onValidate: T = bF }) {
  let [D, N] = Zn.useState(!1), [R, M] = Zn.useState(!0), B = Zn.useRef(null), H = Zn.useRef(null), j = Zn.useRef(null), K = Zn.useRef(E), X = Zn.useRef(w), Y = Zn.useRef(), G = Zn.useRef(n), Q = rtt(s), oe = Zn.useRef(!1), Z = Zn.useRef(!1);
  TMe(() => {
    let ae = She.init();
    return ae.then((be) => (B.current = be) && M(!1)).catch((be) => (be == null ? void 0 : be.type) !== "cancelation" && console.error("Monaco initialization: error:", be)), () => H.current ? J() : ae.cancel();
  }), Lf(() => {
    var be, re, ze, Ve;
    let ae = eN(B.current, i || n || "", e || r || "", s || t || "");
    ae !== ((be = H.current) == null ? void 0 : be.getModel()) && (d && x7.set(Q, (re = H.current) == null ? void 0 : re.saveViewState()), (ze = H.current) == null || ze.setModel(ae), d && ((Ve = H.current) == null || Ve.restoreViewState(x7.get(s))));
  }, [s], D), Lf(() => {
    var ae;
    (ae = H.current) == null || ae.updateOptions(c);
  }, [c], D), Lf(() => {
    !H.current || n === void 0 || (H.current.getOption(B.current.editor.EditorOption.readOnly) ? H.current.setValue(n) : n !== H.current.getValue() && (Z.current = !0, H.current.executeEdits("", [{ range: H.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), H.current.pushUndoStop(), Z.current = !1));
  }, [n], D), Lf(() => {
    var be, re;
    let ae = (be = H.current) == null ? void 0 : be.getModel();
    ae && r && ((re = B.current) == null || re.editor.setModelLanguage(ae, r));
  }, [r], D), Lf(() => {
    var ae;
    a !== void 0 && ((ae = H.current) == null || ae.revealLine(a));
  }, [a], D), Lf(() => {
    var ae;
    (ae = B.current) == null || ae.editor.setTheme(o);
  }, [o], D);
  let pe = Zn.useCallback(() => {
    var ae;
    if (!(!j.current || !B.current) && !oe.current) {
      X.current(B.current);
      let be = s || t, re = eN(B.current, n || i || "", e || r || "", be || "");
      H.current = (ae = B.current) == null ? void 0 : ae.editor.create(j.current, { model: re, automaticLayout: !0, ...c }, u), d && H.current.restoreViewState(x7.get(be)), B.current.editor.setTheme(o), a !== void 0 && H.current.revealLine(a), N(!0), oe.current = !0;
    }
  }, [i, e, t, n, r, s, c, u, d, o, a]);
  Zn.useEffect(() => {
    D && K.current(H.current, B.current);
  }, [D]), Zn.useEffect(() => {
    !R && !D && pe();
  }, [R, D, pe]), G.current = n, Zn.useEffect(() => {
    var ae, be;
    D && L && ((ae = Y.current) == null || ae.dispose(), Y.current = (be = H.current) == null ? void 0 : be.onDidChangeModelContent((re) => {
      Z.current || L(H.current.getValue(), re);
    }));
  }, [D, L]), Zn.useEffect(() => {
    if (D) {
      let ae = B.current.editor.onDidChangeMarkers((be) => {
        var ze;
        let re = (ze = H.current.getModel()) == null ? void 0 : ze.uri;
        if (re && be.find((Ve) => Ve.path === re.path)) {
          let Ve = B.current.editor.getModelMarkers({ resource: re });
          T == null || T(Ve);
        }
      });
      return () => {
        ae == null || ae.dispose();
      };
    }
    return () => {
    };
  }, [D, T]);
  function J() {
    var ae, be;
    (ae = Y.current) == null || ae.dispose(), h ? d && x7.set(s, H.current.saveViewState()) : (be = H.current.getModel()) == null || be.dispose(), H.current.dispose();
  }
  return nb.createElement(LMe, { width: g, height: m, isEditorReady: D, loading: l, _ref: j, className: _, wrapperProps: v });
}
var ott = stt, att = Zn.memo(ott), ltt = att;
function DMe() {
  return globalThis._VSCODE_NLS_MESSAGES;
}
function Ehe() {
  return globalThis._VSCODE_NLS_LANGUAGE;
}
const ctt = Ehe() === "pseudo" || typeof document < "u" && document.location && typeof document.location.hash == "string" && document.location.hash.indexOf("pseudo=true") >= 0;
function SV(i, e) {
  let t;
  return e.length === 0 ? t = i : t = i.replace(/\{(\d+)\}/g, (n, r) => {
    const s = r[0], o = e[s];
    let a = n;
    return typeof o == "string" ? a = o : (typeof o == "number" || typeof o == "boolean" || o === void 0 || o === null) && (a = String(o)), a;
  }), ctt && (t = "［" + t.replace(/[aouei]/g, "$&$&") + "］"), t;
}
function S(i, e, ...t) {
  return SV(typeof i == "number" ? IMe(i, e) : e, t);
}
function IMe(i, e) {
  var n;
  const t = (n = DMe()) == null ? void 0 : n[i];
  if (typeof t != "string") {
    if (typeof e == "string")
      return e;
    throw new Error(`!!! NLS MISSING: ${i} !!!`);
  }
  return t;
}
function Ee(i, e, ...t) {
  let n;
  typeof i == "number" ? n = IMe(i, e) : n = e;
  const r = SV(n, t);
  return {
    value: r,
    original: e === n ? r : SV(e, t)
  };
}
function utt(i, e) {
  const t = i;
  typeof t.vscodeWindowId != "number" && Object.defineProperty(t, "vscodeWindowId", {
    get: () => e
  });
}
const fr = window, Tj = class Tj {
  constructor() {
    this.mapWindowIdToZoomFactor = /* @__PURE__ */ new Map();
  }
  getZoomFactor(e) {
    return this.mapWindowIdToZoomFactor.get(this.getWindowId(e)) ?? 1;
  }
  getWindowId(e) {
    return e.vscodeWindowId;
  }
};
Tj.INSTANCE = new Tj();
let jne = Tj;
function NMe(i, e, t) {
  typeof e == "string" && (e = i.matchMedia(e)), e.addEventListener("change", t);
}
function Gne(i) {
  return jne.INSTANCE.getZoomFactor(i);
}
const zA = navigator.userAgent, Zu = zA.indexOf("Firefox") >= 0, fq = zA.indexOf("AppleWebKit") >= 0, uB = zA.indexOf("Chrome") >= 0, XL = !uB && zA.indexOf("Safari") >= 0, RMe = !uB && !XL && fq;
zA.indexOf("Electron/") >= 0;
const hxe = zA.indexOf("Android") >= 0;
let kJ = !1;
if (typeof fr.matchMedia == "function") {
  const i = fr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"), e = fr.matchMedia("(display-mode: fullscreen)");
  kJ = i.matches, NMe(fr, i, ({ matches: t }) => {
    kJ && e.matches || (kJ = t);
  });
}
class dtt {
  constructor() {
    this.listeners = [], this.unexpectedErrorHandler = function(e) {
      setTimeout(() => {
        throw e.stack ? zR.isErrorNoTelemetry(e) ? new zR(e.message + `

` + e.stack) : new Error(e.message + `

` + e.stack) : e;
      }, 0);
    };
  }
  emit(e) {
    this.listeners.forEach((t) => {
      t(e);
    });
  }
  onUnexpectedError(e) {
    this.unexpectedErrorHandler(e), this.emit(e);
  }
  // For external errors, we don't want the listeners to be called
  onUnexpectedExternalError(e) {
    this.unexpectedErrorHandler(e);
  }
}
const xhe = new dtt();
function EV(i) {
  xhe.onUnexpectedError(i);
}
function fn(i) {
  Xh(i) || xhe.onUnexpectedError(i);
}
function No(i) {
  Xh(i) || xhe.onUnexpectedExternalError(i);
}
function qne(i) {
  if (i instanceof Error) {
    const { name: e, message: t, cause: n } = i, r = i.stacktrace || i.stack;
    return {
      $isError: !0,
      name: e,
      message: t,
      stack: r,
      noTelemetry: zR.isErrorNoTelemetry(i),
      cause: n ? qne(n) : void 0,
      code: i.code
    };
  }
  return i;
}
const xV = "Canceled";
function Xh(i) {
  return i instanceof $f ? !0 : i instanceof Error && i.name === xV && i.message === xV;
}
class $f extends Error {
  constructor() {
    super(xV), this.name = this.message;
  }
}
function htt() {
  const i = new Error(xV);
  return i.name = i.message, i;
}
function Bf(i) {
  return i ? new Error(`Illegal argument: ${i}`) : new Error("Illegal argument");
}
function LV(i) {
  return i ? new Error(`Illegal state: ${i}`) : new Error("Illegal state");
}
class ftt extends Error {
  constructor(e) {
    super("NotSupported"), e && (this.message = e);
  }
}
class zR extends Error {
  constructor(e) {
    super(e), this.name = "CodeExpectedError";
  }
  static fromError(e) {
    if (e instanceof zR)
      return e;
    const t = new zR();
    return t.message = e.message, t.stack = e.stack, t;
  }
  static isErrorNoTelemetry(e) {
    return e.name === "CodeExpectedError";
  }
}
class Wt extends Error {
  constructor(e) {
    super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, Wt.prototype);
  }
}
function DJ(i, e) {
  if (!i)
    throw new Error(e ? `Assertion failed (${e})` : "Assertion Failed");
}
function dB(i, e = "Unreachable") {
  throw new Error(e);
}
function K3(i, e = "unexpected state") {
  if (!i)
    throw typeof e == "string" ? new Wt(`Assertion Failed: ${e}`) : e;
}
function fxe(i, e = "Soft Assertion Failed") {
  i || fn(new Wt(e));
}
function J1(i) {
  if (!i()) {
    debugger;
    i(), fn(new Wt("Assertion Failed"));
  }
}
function hB(i, e) {
  let t = 0;
  for (; t < i.length - 1; ) {
    const n = i[t], r = i[t + 1];
    if (!e(n, r))
      return !1;
    t++;
  }
  return !0;
}
function ga(i) {
  return typeof i == "string";
}
function Ra(i) {
  return typeof i == "object" && i !== null && !Array.isArray(i) && !(i instanceof RegExp) && !(i instanceof Date);
}
function gtt(i) {
  const e = Object.getPrototypeOf(Uint8Array);
  return typeof i == "object" && i instanceof e;
}
function zy(i) {
  return typeof i == "number" && !isNaN(i);
}
function Kne(i) {
  return !!i && typeof i[Symbol.iterator] == "function";
}
function AMe(i) {
  return i === !0 || i === !1;
}
function Ec(i) {
  return typeof i > "u";
}
function Aa(i) {
  return !If(i);
}
function If(i) {
  return Ec(i) || i === null;
}
function Ii(i, e) {
  if (!i)
    throw new Error(e ? `Unexpected type, expected '${e}'` : "Unexpected type");
}
function i1(i) {
  return K3(i != null, "Argument is `undefined` or `null`."), i;
}
function ZL(i) {
  return typeof i == "function";
}
function ptt(i, e) {
  const t = Math.min(i.length, e.length);
  for (let n = 0; n < t; n++)
    mtt(i[n], e[n]);
}
function mtt(i, e) {
  if (ga(e)) {
    if (typeof i !== e)
      throw new Error(`argument does not match constraint: typeof ${e}`);
  } else if (ZL(e)) {
    try {
      if (i instanceof e)
        return;
    } catch {
    }
    if (!If(i) && i.constructor === e || e.length === 1 && e.call(void 0, i) === !0)
      return;
    throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true");
  }
}
const lx = "en";
let Y3 = !1, X3 = !1, vF = !1, OMe = !1, Lhe = !1, The = !1, MMe = !1, L7, _W = lx, gxe = lx, _tt, Tp;
const Ay = globalThis;
let bc;
var eMe;
typeof Ay.vscode < "u" && typeof Ay.vscode.process < "u" ? bc = Ay.vscode.process : typeof process < "u" && typeof ((eMe = process == null ? void 0 : process.versions) == null ? void 0 : eMe.node) == "string" && (bc = process);
var tMe;
const btt = typeof ((tMe = bc == null ? void 0 : bc.versions) == null ? void 0 : tMe.electron) == "string", vtt = btt && (bc == null ? void 0 : bc.type) === "renderer";
var nMe;
if (typeof bc == "object") {
  Y3 = bc.platform === "win32", X3 = bc.platform === "darwin", vF = bc.platform === "linux", vF && bc.env.SNAP && bc.env.SNAP_REVISION, bc.env.CI || bc.env.BUILD_ARTIFACTSTAGINGDIRECTORY || bc.env.GITHUB_WORKSPACE, L7 = lx, _W = lx;
  const i = bc.env.VSCODE_NLS_CONFIG;
  if (i)
    try {
      const e = JSON.parse(i);
      L7 = e.userLocale, gxe = e.osLocale, _W = e.resolvedLanguage || lx, _tt = (nMe = e.languagePack) == null ? void 0 : nMe.translationsConfigFile;
    } catch {
    }
  OMe = !0;
} else typeof navigator == "object" && !vtt ? (Tp = navigator.userAgent, Y3 = Tp.indexOf("Windows") >= 0, X3 = Tp.indexOf("Macintosh") >= 0, The = (Tp.indexOf("Macintosh") >= 0 || Tp.indexOf("iPad") >= 0 || Tp.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0, vF = Tp.indexOf("Linux") >= 0, MMe = (Tp == null ? void 0 : Tp.indexOf("Mobi")) >= 0, Lhe = !0, _W = Ehe() || lx, L7 = navigator.language.toLowerCase(), gxe = L7) : console.error("Unable to resolve platform.");
let bW = 0;
X3 ? bW = 1 : Y3 ? bW = 3 : vF && (bW = 2);
const Za = Y3, Kn = X3, Qu = vF, hm = OMe, Lb = Lhe, ytt = Lhe && typeof Ay.importScripts == "function", Ctt = ytt ? Ay.origin : void 0, jf = The, PMe = MMe, IJ = bW, ub = Tp, wtt = _W, Stt = typeof Ay.postMessage == "function" && !Ay.importScripts, gq = (() => {
  if (Stt) {
    const i = [];
    Ay.addEventListener("message", (t) => {
      if (t.data && t.data.vscodeScheduleAsyncWork)
        for (let n = 0, r = i.length; n < r; n++) {
          const s = i[n];
          if (s.id === t.data.vscodeScheduleAsyncWork) {
            i.splice(n, 1), s.callback();
            return;
          }
        }
    });
    let e = 0;
    return (t) => {
      const n = ++e;
      i.push({
        id: n,
        callback: t
      }), Ay.postMessage({ vscodeScheduleAsyncWork: n }, "*");
    };
  }
  return (i) => setTimeout(i);
})(), Ad = X3 || The ? 2 : Y3 ? 1 : 3;
let pxe = !0, mxe = !1;
function FMe() {
  if (!mxe) {
    mxe = !0;
    const i = new Uint8Array(2);
    i[0] = 1, i[1] = 2, pxe = new Uint16Array(i.buffer)[0] === 513;
  }
  return pxe;
}
const khe = !!(ub && ub.indexOf("Chrome") >= 0), Ett = !!(ub && ub.indexOf("Firefox") >= 0), xtt = !!(!khe && ub && ub.indexOf("Safari") >= 0), BMe = !!(ub && ub.indexOf("Edg/") >= 0), Ltt = !!(ub && ub.indexOf("Android") >= 0), fB = {
  clipboard: {
    writeText: hm || document.queryCommandSupported && document.queryCommandSupported("copy") || !!(navigator && navigator.clipboard && navigator.clipboard.writeText),
    readText: hm || !!(navigator && navigator.clipboard && navigator.clipboard.readText)
  },
  pointerEvents: fr.PointerEvent && ("ontouchstart" in fr || navigator.maxTouchPoints > 0)
};
class Dhe {
  constructor() {
    this._keyCodeToStr = [], this._strToKeyCode = /* @__PURE__ */ Object.create(null);
  }
  define(e, t) {
    this._keyCodeToStr[e] = t, this._strToKeyCode[t.toLowerCase()] = e;
  }
  keyCodeToStr(e) {
    return this._keyCodeToStr[e];
  }
  strToKeyCode(e) {
    return this._strToKeyCode[e.toLowerCase()] || 0;
  }
}
const vW = new Dhe(), Yne = new Dhe(), Xne = new Dhe(), HMe = new Array(230), Ttt = /* @__PURE__ */ Object.create(null), ktt = /* @__PURE__ */ Object.create(null), Ihe = [];
for (let i = 0; i <= 193; i++)
  Ihe[i] = -1;
(function() {
  const e = [
    // immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel
    [1, 0, "None", 0, "unknown", 0, "VK_UNKNOWN", "", ""],
    [1, 1, "Hyper", 0, "", 0, "", "", ""],
    [1, 2, "Super", 0, "", 0, "", "", ""],
    [1, 3, "Fn", 0, "", 0, "", "", ""],
    [1, 4, "FnLock", 0, "", 0, "", "", ""],
    [1, 5, "Suspend", 0, "", 0, "", "", ""],
    [1, 6, "Resume", 0, "", 0, "", "", ""],
    [1, 7, "Turbo", 0, "", 0, "", "", ""],
    [1, 8, "Sleep", 0, "", 0, "VK_SLEEP", "", ""],
    [1, 9, "WakeUp", 0, "", 0, "", "", ""],
    [0, 10, "KeyA", 31, "A", 65, "VK_A", "", ""],
    [0, 11, "KeyB", 32, "B", 66, "VK_B", "", ""],
    [0, 12, "KeyC", 33, "C", 67, "VK_C", "", ""],
    [0, 13, "KeyD", 34, "D", 68, "VK_D", "", ""],
    [0, 14, "KeyE", 35, "E", 69, "VK_E", "", ""],
    [0, 15, "KeyF", 36, "F", 70, "VK_F", "", ""],
    [0, 16, "KeyG", 37, "G", 71, "VK_G", "", ""],
    [0, 17, "KeyH", 38, "H", 72, "VK_H", "", ""],
    [0, 18, "KeyI", 39, "I", 73, "VK_I", "", ""],
    [0, 19, "KeyJ", 40, "J", 74, "VK_J", "", ""],
    [0, 20, "KeyK", 41, "K", 75, "VK_K", "", ""],
    [0, 21, "KeyL", 42, "L", 76, "VK_L", "", ""],
    [0, 22, "KeyM", 43, "M", 77, "VK_M", "", ""],
    [0, 23, "KeyN", 44, "N", 78, "VK_N", "", ""],
    [0, 24, "KeyO", 45, "O", 79, "VK_O", "", ""],
    [0, 25, "KeyP", 46, "P", 80, "VK_P", "", ""],
    [0, 26, "KeyQ", 47, "Q", 81, "VK_Q", "", ""],
    [0, 27, "KeyR", 48, "R", 82, "VK_R", "", ""],
    [0, 28, "KeyS", 49, "S", 83, "VK_S", "", ""],
    [0, 29, "KeyT", 50, "T", 84, "VK_T", "", ""],
    [0, 30, "KeyU", 51, "U", 85, "VK_U", "", ""],
    [0, 31, "KeyV", 52, "V", 86, "VK_V", "", ""],
    [0, 32, "KeyW", 53, "W", 87, "VK_W", "", ""],
    [0, 33, "KeyX", 54, "X", 88, "VK_X", "", ""],
    [0, 34, "KeyY", 55, "Y", 89, "VK_Y", "", ""],
    [0, 35, "KeyZ", 56, "Z", 90, "VK_Z", "", ""],
    [0, 36, "Digit1", 22, "1", 49, "VK_1", "", ""],
    [0, 37, "Digit2", 23, "2", 50, "VK_2", "", ""],
    [0, 38, "Digit3", 24, "3", 51, "VK_3", "", ""],
    [0, 39, "Digit4", 25, "4", 52, "VK_4", "", ""],
    [0, 40, "Digit5", 26, "5", 53, "VK_5", "", ""],
    [0, 41, "Digit6", 27, "6", 54, "VK_6", "", ""],
    [0, 42, "Digit7", 28, "7", 55, "VK_7", "", ""],
    [0, 43, "Digit8", 29, "8", 56, "VK_8", "", ""],
    [0, 44, "Digit9", 30, "9", 57, "VK_9", "", ""],
    [0, 45, "Digit0", 21, "0", 48, "VK_0", "", ""],
    [1, 46, "Enter", 3, "Enter", 13, "VK_RETURN", "", ""],
    [1, 47, "Escape", 9, "Escape", 27, "VK_ESCAPE", "", ""],
    [1, 48, "Backspace", 1, "Backspace", 8, "VK_BACK", "", ""],
    [1, 49, "Tab", 2, "Tab", 9, "VK_TAB", "", ""],
    [1, 50, "Space", 10, "Space", 32, "VK_SPACE", "", ""],
    [0, 51, "Minus", 88, "-", 189, "VK_OEM_MINUS", "-", "OEM_MINUS"],
    [0, 52, "Equal", 86, "=", 187, "VK_OEM_PLUS", "=", "OEM_PLUS"],
    [0, 53, "BracketLeft", 92, "[", 219, "VK_OEM_4", "[", "OEM_4"],
    [0, 54, "BracketRight", 94, "]", 221, "VK_OEM_6", "]", "OEM_6"],
    [0, 55, "Backslash", 93, "\\", 220, "VK_OEM_5", "\\", "OEM_5"],
    [0, 56, "IntlHash", 0, "", 0, "", "", ""],
    // has been dropped from the w3c spec
    [0, 57, "Semicolon", 85, ";", 186, "VK_OEM_1", ";", "OEM_1"],
    [0, 58, "Quote", 95, "'", 222, "VK_OEM_7", "'", "OEM_7"],
    [0, 59, "Backquote", 91, "`", 192, "VK_OEM_3", "`", "OEM_3"],
    [0, 60, "Comma", 87, ",", 188, "VK_OEM_COMMA", ",", "OEM_COMMA"],
    [0, 61, "Period", 89, ".", 190, "VK_OEM_PERIOD", ".", "OEM_PERIOD"],
    [0, 62, "Slash", 90, "/", 191, "VK_OEM_2", "/", "OEM_2"],
    [1, 63, "CapsLock", 8, "CapsLock", 20, "VK_CAPITAL", "", ""],
    [1, 64, "F1", 59, "F1", 112, "VK_F1", "", ""],
    [1, 65, "F2", 60, "F2", 113, "VK_F2", "", ""],
    [1, 66, "F3", 61, "F3", 114, "VK_F3", "", ""],
    [1, 67, "F4", 62, "F4", 115, "VK_F4", "", ""],
    [1, 68, "F5", 63, "F5", 116, "VK_F5", "", ""],
    [1, 69, "F6", 64, "F6", 117, "VK_F6", "", ""],
    [1, 70, "F7", 65, "F7", 118, "VK_F7", "", ""],
    [1, 71, "F8", 66, "F8", 119, "VK_F8", "", ""],
    [1, 72, "F9", 67, "F9", 120, "VK_F9", "", ""],
    [1, 73, "F10", 68, "F10", 121, "VK_F10", "", ""],
    [1, 74, "F11", 69, "F11", 122, "VK_F11", "", ""],
    [1, 75, "F12", 70, "F12", 123, "VK_F12", "", ""],
    [1, 76, "PrintScreen", 0, "", 0, "", "", ""],
    [1, 77, "ScrollLock", 84, "ScrollLock", 145, "VK_SCROLL", "", ""],
    [1, 78, "Pause", 7, "PauseBreak", 19, "VK_PAUSE", "", ""],
    [1, 79, "Insert", 19, "Insert", 45, "VK_INSERT", "", ""],
    [1, 80, "Home", 14, "Home", 36, "VK_HOME", "", ""],
    [1, 81, "PageUp", 11, "PageUp", 33, "VK_PRIOR", "", ""],
    [1, 82, "Delete", 20, "Delete", 46, "VK_DELETE", "", ""],
    [1, 83, "End", 13, "End", 35, "VK_END", "", ""],
    [1, 84, "PageDown", 12, "PageDown", 34, "VK_NEXT", "", ""],
    [1, 85, "ArrowRight", 17, "RightArrow", 39, "VK_RIGHT", "Right", ""],
    [1, 86, "ArrowLeft", 15, "LeftArrow", 37, "VK_LEFT", "Left", ""],
    [1, 87, "ArrowDown", 18, "DownArrow", 40, "VK_DOWN", "Down", ""],
    [1, 88, "ArrowUp", 16, "UpArrow", 38, "VK_UP", "Up", ""],
    [1, 89, "NumLock", 83, "NumLock", 144, "VK_NUMLOCK", "", ""],
    [1, 90, "NumpadDivide", 113, "NumPad_Divide", 111, "VK_DIVIDE", "", ""],
    [1, 91, "NumpadMultiply", 108, "NumPad_Multiply", 106, "VK_MULTIPLY", "", ""],
    [1, 92, "NumpadSubtract", 111, "NumPad_Subtract", 109, "VK_SUBTRACT", "", ""],
    [1, 93, "NumpadAdd", 109, "NumPad_Add", 107, "VK_ADD", "", ""],
    [1, 94, "NumpadEnter", 3, "", 0, "", "", ""],
    [1, 95, "Numpad1", 99, "NumPad1", 97, "VK_NUMPAD1", "", ""],
    [1, 96, "Numpad2", 100, "NumPad2", 98, "VK_NUMPAD2", "", ""],
    [1, 97, "Numpad3", 101, "NumPad3", 99, "VK_NUMPAD3", "", ""],
    [1, 98, "Numpad4", 102, "NumPad4", 100, "VK_NUMPAD4", "", ""],
    [1, 99, "Numpad5", 103, "NumPad5", 101, "VK_NUMPAD5", "", ""],
    [1, 100, "Numpad6", 104, "NumPad6", 102, "VK_NUMPAD6", "", ""],
    [1, 101, "Numpad7", 105, "NumPad7", 103, "VK_NUMPAD7", "", ""],
    [1, 102, "Numpad8", 106, "NumPad8", 104, "VK_NUMPAD8", "", ""],
    [1, 103, "Numpad9", 107, "NumPad9", 105, "VK_NUMPAD9", "", ""],
    [1, 104, "Numpad0", 98, "NumPad0", 96, "VK_NUMPAD0", "", ""],
    [1, 105, "NumpadDecimal", 112, "NumPad_Decimal", 110, "VK_DECIMAL", "", ""],
    [0, 106, "IntlBackslash", 97, "OEM_102", 226, "VK_OEM_102", "", ""],
    [1, 107, "ContextMenu", 58, "ContextMenu", 93, "", "", ""],
    [1, 108, "Power", 0, "", 0, "", "", ""],
    [1, 109, "NumpadEqual", 0, "", 0, "", "", ""],
    [1, 110, "F13", 71, "F13", 124, "VK_F13", "", ""],
    [1, 111, "F14", 72, "F14", 125, "VK_F14", "", ""],
    [1, 112, "F15", 73, "F15", 126, "VK_F15", "", ""],
    [1, 113, "F16", 74, "F16", 127, "VK_F16", "", ""],
    [1, 114, "F17", 75, "F17", 128, "VK_F17", "", ""],
    [1, 115, "F18", 76, "F18", 129, "VK_F18", "", ""],
    [1, 116, "F19", 77, "F19", 130, "VK_F19", "", ""],
    [1, 117, "F20", 78, "F20", 131, "VK_F20", "", ""],
    [1, 118, "F21", 79, "F21", 132, "VK_F21", "", ""],
    [1, 119, "F22", 80, "F22", 133, "VK_F22", "", ""],
    [1, 120, "F23", 81, "F23", 134, "VK_F23", "", ""],
    [1, 121, "F24", 82, "F24", 135, "VK_F24", "", ""],
    [1, 122, "Open", 0, "", 0, "", "", ""],
    [1, 123, "Help", 0, "", 0, "", "", ""],
    [1, 124, "Select", 0, "", 0, "", "", ""],
    [1, 125, "Again", 0, "", 0, "", "", ""],
    [1, 126, "Undo", 0, "", 0, "", "", ""],
    [1, 127, "Cut", 0, "", 0, "", "", ""],
    [1, 128, "Copy", 0, "", 0, "", "", ""],
    [1, 129, "Paste", 0, "", 0, "", "", ""],
    [1, 130, "Find", 0, "", 0, "", "", ""],
    [1, 131, "AudioVolumeMute", 117, "AudioVolumeMute", 173, "VK_VOLUME_MUTE", "", ""],
    [1, 132, "AudioVolumeUp", 118, "AudioVolumeUp", 175, "VK_VOLUME_UP", "", ""],
    [1, 133, "AudioVolumeDown", 119, "AudioVolumeDown", 174, "VK_VOLUME_DOWN", "", ""],
    [1, 134, "NumpadComma", 110, "NumPad_Separator", 108, "VK_SEPARATOR", "", ""],
    [0, 135, "IntlRo", 115, "ABNT_C1", 193, "VK_ABNT_C1", "", ""],
    [1, 136, "KanaMode", 0, "", 0, "", "", ""],
    [0, 137, "IntlYen", 0, "", 0, "", "", ""],
    [1, 138, "Convert", 0, "", 0, "", "", ""],
    [1, 139, "NonConvert", 0, "", 0, "", "", ""],
    [1, 140, "Lang1", 0, "", 0, "", "", ""],
    [1, 141, "Lang2", 0, "", 0, "", "", ""],
    [1, 142, "Lang3", 0, "", 0, "", "", ""],
    [1, 143, "Lang4", 0, "", 0, "", "", ""],
    [1, 144, "Lang5", 0, "", 0, "", "", ""],
    [1, 145, "Abort", 0, "", 0, "", "", ""],
    [1, 146, "Props", 0, "", 0, "", "", ""],
    [1, 147, "NumpadParenLeft", 0, "", 0, "", "", ""],
    [1, 148, "NumpadParenRight", 0, "", 0, "", "", ""],
    [1, 149, "NumpadBackspace", 0, "", 0, "", "", ""],
    [1, 150, "NumpadMemoryStore", 0, "", 0, "", "", ""],
    [1, 151, "NumpadMemoryRecall", 0, "", 0, "", "", ""],
    [1, 152, "NumpadMemoryClear", 0, "", 0, "", "", ""],
    [1, 153, "NumpadMemoryAdd", 0, "", 0, "", "", ""],
    [1, 154, "NumpadMemorySubtract", 0, "", 0, "", "", ""],
    [1, 155, "NumpadClear", 131, "Clear", 12, "VK_CLEAR", "", ""],
    [1, 156, "NumpadClearEntry", 0, "", 0, "", "", ""],
    [1, 0, "", 5, "Ctrl", 17, "VK_CONTROL", "", ""],
    [1, 0, "", 4, "Shift", 16, "VK_SHIFT", "", ""],
    [1, 0, "", 6, "Alt", 18, "VK_MENU", "", ""],
    [1, 0, "", 57, "Meta", 91, "VK_COMMAND", "", ""],
    [1, 157, "ControlLeft", 5, "", 0, "VK_LCONTROL", "", ""],
    [1, 158, "ShiftLeft", 4, "", 0, "VK_LSHIFT", "", ""],
    [1, 159, "AltLeft", 6, "", 0, "VK_LMENU", "", ""],
    [1, 160, "MetaLeft", 57, "", 0, "VK_LWIN", "", ""],
    [1, 161, "ControlRight", 5, "", 0, "VK_RCONTROL", "", ""],
    [1, 162, "ShiftRight", 4, "", 0, "VK_RSHIFT", "", ""],
    [1, 163, "AltRight", 6, "", 0, "VK_RMENU", "", ""],
    [1, 164, "MetaRight", 57, "", 0, "VK_RWIN", "", ""],
    [1, 165, "BrightnessUp", 0, "", 0, "", "", ""],
    [1, 166, "BrightnessDown", 0, "", 0, "", "", ""],
    [1, 167, "MediaPlay", 0, "", 0, "", "", ""],
    [1, 168, "MediaRecord", 0, "", 0, "", "", ""],
    [1, 169, "MediaFastForward", 0, "", 0, "", "", ""],
    [1, 170, "MediaRewind", 0, "", 0, "", "", ""],
    [1, 171, "MediaTrackNext", 124, "MediaTrackNext", 176, "VK_MEDIA_NEXT_TRACK", "", ""],
    [1, 172, "MediaTrackPrevious", 125, "MediaTrackPrevious", 177, "VK_MEDIA_PREV_TRACK", "", ""],
    [1, 173, "MediaStop", 126, "MediaStop", 178, "VK_MEDIA_STOP", "", ""],
    [1, 174, "Eject", 0, "", 0, "", "", ""],
    [1, 175, "MediaPlayPause", 127, "MediaPlayPause", 179, "VK_MEDIA_PLAY_PAUSE", "", ""],
    [1, 176, "MediaSelect", 128, "LaunchMediaPlayer", 181, "VK_MEDIA_LAUNCH_MEDIA_SELECT", "", ""],
    [1, 177, "LaunchMail", 129, "LaunchMail", 180, "VK_MEDIA_LAUNCH_MAIL", "", ""],
    [1, 178, "LaunchApp2", 130, "LaunchApp2", 183, "VK_MEDIA_LAUNCH_APP2", "", ""],
    [1, 179, "LaunchApp1", 0, "", 0, "VK_MEDIA_LAUNCH_APP1", "", ""],
    [1, 180, "SelectTask", 0, "", 0, "", "", ""],
    [1, 181, "LaunchScreenSaver", 0, "", 0, "", "", ""],
    [1, 182, "BrowserSearch", 120, "BrowserSearch", 170, "VK_BROWSER_SEARCH", "", ""],
    [1, 183, "BrowserHome", 121, "BrowserHome", 172, "VK_BROWSER_HOME", "", ""],
    [1, 184, "BrowserBack", 122, "BrowserBack", 166, "VK_BROWSER_BACK", "", ""],
    [1, 185, "BrowserForward", 123, "BrowserForward", 167, "VK_BROWSER_FORWARD", "", ""],
    [1, 186, "BrowserStop", 0, "", 0, "VK_BROWSER_STOP", "", ""],
    [1, 187, "BrowserRefresh", 0, "", 0, "VK_BROWSER_REFRESH", "", ""],
    [1, 188, "BrowserFavorites", 0, "", 0, "VK_BROWSER_FAVORITES", "", ""],
    [1, 189, "ZoomToggle", 0, "", 0, "", "", ""],
    [1, 190, "MailReply", 0, "", 0, "", "", ""],
    [1, 191, "MailForward", 0, "", 0, "", "", ""],
    [1, 192, "MailSend", 0, "", 0, "", "", ""],
    // See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html
    // If an Input Method Editor is processing key input and the event is keydown, return 229.
    [1, 0, "", 114, "KeyInComposition", 229, "", "", ""],
    [1, 0, "", 116, "ABNT_C2", 194, "VK_ABNT_C2", "", ""],
    [1, 0, "", 96, "OEM_8", 223, "VK_OEM_8", "", ""],
    [1, 0, "", 0, "", 0, "VK_KANA", "", ""],
    [1, 0, "", 0, "", 0, "VK_HANGUL", "", ""],
    [1, 0, "", 0, "", 0, "VK_JUNJA", "", ""],
    [1, 0, "", 0, "", 0, "VK_FINAL", "", ""],
    [1, 0, "", 0, "", 0, "VK_HANJA", "", ""],
    [1, 0, "", 0, "", 0, "VK_KANJI", "", ""],
    [1, 0, "", 0, "", 0, "VK_CONVERT", "", ""],
    [1, 0, "", 0, "", 0, "VK_NONCONVERT", "", ""],
    [1, 0, "", 0, "", 0, "VK_ACCEPT", "", ""],
    [1, 0, "", 0, "", 0, "VK_MODECHANGE", "", ""],
    [1, 0, "", 0, "", 0, "VK_SELECT", "", ""],
    [1, 0, "", 0, "", 0, "VK_PRINT", "", ""],
    [1, 0, "", 0, "", 0, "VK_EXECUTE", "", ""],
    [1, 0, "", 0, "", 0, "VK_SNAPSHOT", "", ""],
    [1, 0, "", 0, "", 0, "VK_HELP", "", ""],
    [1, 0, "", 0, "", 0, "VK_APPS", "", ""],
    [1, 0, "", 0, "", 0, "VK_PROCESSKEY", "", ""],
    [1, 0, "", 0, "", 0, "VK_PACKET", "", ""],
    [1, 0, "", 0, "", 0, "VK_DBE_SBCSCHAR", "", ""],
    [1, 0, "", 0, "", 0, "VK_DBE_DBCSCHAR", "", ""],
    [1, 0, "", 0, "", 0, "VK_ATTN", "", ""],
    [1, 0, "", 0, "", 0, "VK_CRSEL", "", ""],
    [1, 0, "", 0, "", 0, "VK_EXSEL", "", ""],
    [1, 0, "", 0, "", 0, "VK_EREOF", "", ""],
    [1, 0, "", 0, "", 0, "VK_PLAY", "", ""],
    [1, 0, "", 0, "", 0, "VK_ZOOM", "", ""],
    [1, 0, "", 0, "", 0, "VK_NONAME", "", ""],
    [1, 0, "", 0, "", 0, "VK_PA1", "", ""],
    [1, 0, "", 0, "", 0, "VK_OEM_CLEAR", "", ""]
  ], t = [], n = [];
  for (const r of e) {
    const [s, o, a, l, c, u, d, h, g] = r;
    if (n[o] || (n[o] = !0, Ttt[a] = o, ktt[a.toLowerCase()] = o, s && (Ihe[o] = l)), !t[l]) {
      if (t[l] = !0, !c)
        throw new Error(`String representation missing for key code ${l} around scan code ${a}`);
      vW.define(l, c), Yne.define(l, h || c), Xne.define(l, g || h || c);
    }
    u && (HMe[u] = l);
  }
})();
var cy;
(function(i) {
  function e(a) {
    return vW.keyCodeToStr(a);
  }
  i.toString = e;
  function t(a) {
    return vW.strToKeyCode(a);
  }
  i.fromString = t;
  function n(a) {
    return Yne.keyCodeToStr(a);
  }
  i.toUserSettingsUS = n;
  function r(a) {
    return Xne.keyCodeToStr(a);
  }
  i.toUserSettingsGeneral = r;
  function s(a) {
    return Yne.strToKeyCode(a) || Xne.strToKeyCode(a);
  }
  i.fromUserSettings = s;
  function o(a) {
    if (a >= 98 && a <= 113)
      return null;
    switch (a) {
      case 16:
        return "Up";
      case 18:
        return "Down";
      case 15:
        return "Left";
      case 17:
        return "Right";
    }
    return vW.keyCodeToStr(a);
  }
  i.toElectronAccelerator = o;
})(cy || (cy = {}));
function Ro(i, e) {
  const t = (e & 65535) << 16 >>> 0;
  return (i | t) >>> 0;
}
function Zne(i, e) {
  if (typeof i == "number") {
    if (i === 0)
      return null;
    const t = (i & 65535) >>> 0, n = (i & 4294901760) >>> 16;
    return n !== 0 ? new NJ([
      T7(t, e),
      T7(n, e)
    ]) : new NJ([T7(t, e)]);
  } else {
    const t = [];
    for (let n = 0; n < i.length; n++)
      t.push(T7(i[n], e));
    return new NJ(t);
  }
}
function T7(i, e) {
  const t = !!(i & 2048), n = !!(i & 256), r = e === 2 ? n : t, s = !!(i & 1024), o = !!(i & 512), a = e === 2 ? t : n, l = i & 255;
  return new $y(r, s, o, a, l);
}
class $y {
  constructor(e, t, n, r, s) {
    this.ctrlKey = e, this.shiftKey = t, this.altKey = n, this.metaKey = r, this.keyCode = s;
  }
  equals(e) {
    return e instanceof $y && this.ctrlKey === e.ctrlKey && this.shiftKey === e.shiftKey && this.altKey === e.altKey && this.metaKey === e.metaKey && this.keyCode === e.keyCode;
  }
  isModifierKey() {
    return this.keyCode === 0 || this.keyCode === 5 || this.keyCode === 57 || this.keyCode === 6 || this.keyCode === 4;
  }
  /**
   * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?
   */
  isDuplicateModifierCase() {
    return this.ctrlKey && this.keyCode === 5 || this.shiftKey && this.keyCode === 4 || this.altKey && this.keyCode === 6 || this.metaKey && this.keyCode === 57;
  }
}
class NJ {
  constructor(e) {
    if (e.length === 0)
      throw Bf("chords");
    this.chords = e;
  }
}
class Dtt {
  constructor(e, t, n, r, s, o) {
    this.ctrlKey = e, this.shiftKey = t, this.altKey = n, this.metaKey = r, this.keyLabel = s, this.keyAriaLabel = o;
  }
}
class Itt {
}
function Ntt(i) {
  if (i.charCode) {
    const t = String.fromCharCode(i.charCode).toUpperCase();
    return cy.fromString(t);
  }
  const e = i.keyCode;
  if (e === 3)
    return 7;
  if (Zu)
    switch (e) {
      case 59:
        return 85;
      case 60:
        if (Qu)
          return 97;
        break;
      case 61:
        return 86;
      // based on: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#numpad_keys
      case 107:
        return 109;
      case 109:
        return 111;
      case 173:
        return 88;
      case 224:
        if (Kn)
          return 57;
        break;
    }
  else if (fq) {
    if (Kn && e === 93)
      return 57;
    if (!Kn && e === 92)
      return 57;
  }
  return HMe[e] || 0;
}
const Rtt = Kn ? 256 : 2048, Att = 512, Ott = 1024, Mtt = Kn ? 2048 : 256;
class wr {
  constructor(e) {
    var n;
    this._standardKeyboardEventBrand = !0;
    const t = e;
    this.browserEvent = t, this.target = t.target, this.ctrlKey = t.ctrlKey, this.shiftKey = t.shiftKey, this.altKey = t.altKey, this.metaKey = t.metaKey, this.altGraphKey = (n = t.getModifierState) == null ? void 0 : n.call(t, "AltGraph"), this.keyCode = Ntt(t), this.code = t.code, this.ctrlKey = this.ctrlKey || this.keyCode === 5, this.altKey = this.altKey || this.keyCode === 6, this.shiftKey = this.shiftKey || this.keyCode === 4, this.metaKey = this.metaKey || this.keyCode === 57, this._asKeybinding = this._computeKeybinding(), this._asKeyCodeChord = this._computeKeyCodeChord();
  }
  preventDefault() {
    this.browserEvent && this.browserEvent.preventDefault && this.browserEvent.preventDefault();
  }
  stopPropagation() {
    this.browserEvent && this.browserEvent.stopPropagation && this.browserEvent.stopPropagation();
  }
  toKeyCodeChord() {
    return this._asKeyCodeChord;
  }
  equals(e) {
    return this._asKeybinding === e;
  }
  _computeKeybinding() {
    let e = 0;
    this.keyCode !== 5 && this.keyCode !== 4 && this.keyCode !== 6 && this.keyCode !== 57 && (e = this.keyCode);
    let t = 0;
    return this.ctrlKey && (t |= Rtt), this.altKey && (t |= Att), this.shiftKey && (t |= Ott), this.metaKey && (t |= Mtt), t |= e, t;
  }
  _computeKeyCodeChord() {
    let e = 0;
    return this.keyCode !== 5 && this.keyCode !== 4 && this.keyCode !== 6 && this.keyCode !== 57 && (e = this.keyCode), new $y(this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, e);
  }
}
const _xe = /* @__PURE__ */ new WeakMap();
function Ptt(i) {
  if (!i.parent || i.parent === i)
    return null;
  try {
    const e = i.location, t = i.parent.location;
    if (e.origin !== "null" && t.origin !== "null" && e.origin !== t.origin)
      return null;
  } catch {
    return null;
  }
  return i.parent;
}
class Ftt {
  /**
   * Returns a chain of embedded windows with the same origin (which can be accessed programmatically).
   * Having a chain of length 1 might mean that the current execution environment is running outside of an iframe or inside an iframe embedded in a window with a different origin.
   */
  static getSameOriginWindowChain(e) {
    let t = _xe.get(e);
    if (!t) {
      t = [], _xe.set(e, t);
      let n = e, r;
      do
        r = Ptt(n), r ? t.push({
          window: new WeakRef(n),
          iframeElement: n.frameElement || null
        }) : t.push({
          window: new WeakRef(n),
          iframeElement: null
        }), n = r;
      while (n);
    }
    return t.slice(0);
  }
  /**
   * Returns the position of `childWindow` relative to `ancestorWindow`
   */
  static getPositionOfChildWindowRelativeToAncestorWindow(e, t) {
    if (!t || e === t)
      return {
        top: 0,
        left: 0
      };
    let n = 0, r = 0;
    const s = this.getSameOriginWindowChain(e);
    for (const o of s) {
      const a = o.window.deref();
      if (n += (a == null ? void 0 : a.scrollY) ?? 0, r += (a == null ? void 0 : a.scrollX) ?? 0, a === t || !o.iframeElement)
        break;
      const l = o.iframeElement.getBoundingClientRect();
      n += l.top, r += l.left;
    }
    return {
      top: n,
      left: r
    };
  }
}
class vl {
  constructor(e, t) {
    this.timestamp = Date.now(), this.browserEvent = t, this.leftButton = t.button === 0, this.middleButton = t.button === 1, this.rightButton = t.button === 2, this.buttons = t.buttons, this.defaultPrevented = t.defaultPrevented, this.target = t.target, this.detail = t.detail || 1, t.type === "dblclick" && (this.detail = 2), this.ctrlKey = t.ctrlKey, this.shiftKey = t.shiftKey, this.altKey = t.altKey, this.metaKey = t.metaKey, typeof t.pageX == "number" ? (this.posx = t.pageX, this.posy = t.pageY) : (this.posx = t.clientX + this.target.ownerDocument.body.scrollLeft + this.target.ownerDocument.documentElement.scrollLeft, this.posy = t.clientY + this.target.ownerDocument.body.scrollTop + this.target.ownerDocument.documentElement.scrollTop);
    const n = Ftt.getPositionOfChildWindowRelativeToAncestorWindow(e, t.view);
    this.posx -= n.left, this.posy -= n.top;
  }
  preventDefault() {
    this.browserEvent.preventDefault();
  }
  stopPropagation() {
    this.browserEvent.stopPropagation();
  }
}
class QL {
  constructor(e, t = 0, n = 0) {
    var s;
    this.browserEvent = e || null, this.target = e ? e.target || e.targetNode || e.srcElement : null, this.deltaY = n, this.deltaX = t;
    let r = !1;
    if (uB) {
      const o = navigator.userAgent.match(/Chrome\/(\d+)/);
      r = (o ? parseInt(o[1]) : 123) <= 122;
    }
    if (e) {
      const o = e, a = e, l = ((s = e.view) == null ? void 0 : s.devicePixelRatio) || 1;
      if (typeof o.wheelDeltaY < "u")
        r ? this.deltaY = o.wheelDeltaY / (120 * l) : this.deltaY = o.wheelDeltaY / 120;
      else if (typeof a.VERTICAL_AXIS < "u" && a.axis === a.VERTICAL_AXIS)
        this.deltaY = -a.detail / 3;
      else if (e.type === "wheel") {
        const c = e;
        c.deltaMode === c.DOM_DELTA_LINE ? Zu && !Kn ? this.deltaY = -e.deltaY / 3 : this.deltaY = -e.deltaY : this.deltaY = -e.deltaY / 40;
      }
      if (typeof o.wheelDeltaX < "u")
        XL && Za ? this.deltaX = -(o.wheelDeltaX / 120) : r ? this.deltaX = o.wheelDeltaX / (120 * l) : this.deltaX = o.wheelDeltaX / 120;
      else if (typeof a.HORIZONTAL_AXIS < "u" && a.axis === a.HORIZONTAL_AXIS)
        this.deltaX = -e.detail / 3;
      else if (e.type === "wheel") {
        const c = e;
        c.deltaMode === c.DOM_DELTA_LINE ? Zu && !Kn ? this.deltaX = -e.deltaX / 3 : this.deltaX = -e.deltaX : this.deltaX = -e.deltaX / 40;
      }
      this.deltaY === 0 && this.deltaX === 0 && e.wheelDelta && (r ? this.deltaY = e.wheelDelta / (120 * l) : this.deltaY = e.wheelDelta / 120);
    }
  }
  preventDefault() {
    var e;
    (e = this.browserEvent) == null || e.preventDefault();
  }
  stopPropagation() {
    var e;
    (e = this.browserEvent) == null || e.stopPropagation();
  }
}
function JL(i, e) {
  const t = this;
  let n = !1, r;
  return function() {
    return n || (n = !0, r = i.apply(t, arguments)), r;
  };
}
var gi;
(function(i) {
  function e(R) {
    return !!R && typeof R == "object" && typeof R[Symbol.iterator] == "function";
  }
  i.is = e;
  const t = Object.freeze([]);
  function n() {
    return t;
  }
  i.empty = n;
  function* r(R) {
    yield R;
  }
  i.single = r;
  function s(R) {
    return e(R) ? R : r(R);
  }
  i.wrap = s;
  function o(R) {
    return R || t;
  }
  i.from = o;
  function* a(R) {
    for (let M = R.length - 1; M >= 0; M--)
      yield R[M];
  }
  i.reverse = a;
  function l(R) {
    return !R || R[Symbol.iterator]().next().done === !0;
  }
  i.isEmpty = l;
  function c(R) {
    return R[Symbol.iterator]().next().value;
  }
  i.first = c;
  function u(R, M) {
    let B = 0;
    for (const H of R)
      if (M(H, B++))
        return !0;
    return !1;
  }
  i.some = u;
  function d(R, M) {
    let B = 0;
    for (const H of R)
      if (!M(H, B++))
        return !1;
    return !0;
  }
  i.every = d;
  function h(R, M) {
    for (const B of R)
      if (M(B))
        return B;
  }
  i.find = h;
  function* g(R, M) {
    for (const B of R)
      M(B) && (yield B);
  }
  i.filter = g;
  function* m(R, M) {
    let B = 0;
    for (const H of R)
      yield M(H, B++);
  }
  i.map = m;
  function* _(R, M) {
    let B = 0;
    for (const H of R)
      yield* M(H, B++);
  }
  i.flatMap = _;
  function* v(...R) {
    for (const M of R)
      Kne(M) ? yield* M : yield M;
  }
  i.concat = v;
  function w(R, M, B) {
    let H = B;
    for (const j of R)
      H = M(H, j);
    return H;
  }
  i.reduce = w;
  function E(R) {
    let M = 0;
    for (const B of R)
      M++;
    return M;
  }
  i.length = E;
  function* L(R, M, B = R.length) {
    for (M < -R.length && (M = 0), M < 0 && (M += R.length), B < 0 ? B += R.length : B > R.length && (B = R.length); M < B; M++)
      yield R[M];
  }
  i.slice = L;
  function T(R, M = Number.POSITIVE_INFINITY) {
    const B = [];
    if (M === 0)
      return [B, R];
    const H = R[Symbol.iterator]();
    for (let j = 0; j < M; j++) {
      const K = H.next();
      if (K.done)
        return [B, i.empty()];
      B.push(K.value);
    }
    return [B, { [Symbol.iterator]() {
      return H;
    } }];
  }
  i.consume = T;
  async function D(R) {
    const M = [];
    for await (const B of R)
      M.push(B);
    return M;
  }
  i.asyncToArray = D;
  async function N(R) {
    let M = [];
    for await (const B of R)
      M = M.concat(B);
    return M;
  }
  i.asyncToArrayFlat = N;
})(gi || (gi = {}));
function UT(i) {
  return typeof i == "object" && i !== null && typeof i.dispose == "function" && i.dispose.length === 0;
}
function or(i) {
  if (gi.is(i)) {
    const e = [];
    for (const t of i)
      if (t)
        try {
          t.dispose();
        } catch (n) {
          e.push(n);
        }
    if (e.length === 1)
      throw e[0];
    if (e.length > 1)
      throw new AggregateError(e, "Encountered errors while disposing of store");
    return Array.isArray(i) ? [] : i;
  } else if (i)
    return i.dispose(), i;
}
function Vg(...i) {
  return Et(() => or(i));
}
class Btt {
  constructor(e) {
    this._isDisposed = !1, this._fn = e;
  }
  dispose() {
    if (!this._isDisposed) {
      if (!this._fn)
        throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");
      this._isDisposed = !0, this._fn();
    }
  }
}
function Et(i) {
  return new Btt(i);
}
const kj = class kj {
  constructor() {
    this._toDispose = /* @__PURE__ */ new Set(), this._isDisposed = !1;
  }
  /**
   * Dispose of all registered disposables and mark this object as disposed.
   *
   * Any future disposables added to this object will be disposed of on `add`.
   */
  dispose() {
    this._isDisposed || (this._isDisposed = !0, this.clear());
  }
  /**
   * @return `true` if this object has been disposed of.
   */
  get isDisposed() {
    return this._isDisposed;
  }
  /**
   * Dispose of all registered disposables but do not mark this object as disposed.
   */
  clear() {
    if (this._toDispose.size !== 0)
      try {
        or(this._toDispose);
      } finally {
        this._toDispose.clear();
      }
  }
  /**
   * Add a new {@link IDisposable disposable} to the collection.
   */
  add(e) {
    if (!e || e === ge.None)
      return e;
    if (e === this)
      throw new Error("Cannot register a disposable on itself!");
    return this._isDisposed ? kj.DISABLE_DISPOSED_WARNING || console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack) : this._toDispose.add(e), e;
  }
  /**
   * Deletes a disposable from store and disposes of it. This will not throw or warn and proceed to dispose the
   * disposable even when the disposable is not part in the store.
   */
  delete(e) {
    if (e) {
      if (e === this)
        throw new Error("Cannot dispose a disposable on itself!");
      this._toDispose.delete(e), e.dispose();
    }
  }
};
kj.DISABLE_DISPOSED_WARNING = !1;
let ke = kj;
const GCe = class GCe {
  constructor() {
    this._store = new ke(), this._store;
  }
  dispose() {
    this._store.dispose();
  }
  /**
   * Adds `o` to the collection of disposables managed by this object.
   */
  _register(e) {
    if (e === this)
      throw new Error("Cannot register a disposable on itself!");
    return this._store.add(e);
  }
};
GCe.None = Object.freeze({ dispose() {
} });
let ge = GCe;
class er {
  constructor() {
    this._isDisposed = !1;
  }
  get value() {
    return this._isDisposed ? void 0 : this._value;
  }
  set value(e) {
    var t;
    this._isDisposed || e === this._value || ((t = this._value) == null || t.dispose(), this._value = e);
  }
  /**
   * Resets the stored value and disposed of the previously stored value.
   */
  clear() {
    this.value = void 0;
  }
  dispose() {
    var e;
    this._isDisposed = !0, (e = this._value) == null || e.dispose(), this._value = void 0;
  }
}
class Htt {
  constructor(e) {
    this._disposable = e, this._counter = 1;
  }
  acquire() {
    return this._counter++, this;
  }
  release() {
    return --this._counter === 0 && this._disposable.dispose(), this;
  }
}
class Wtt {
  constructor(e) {
    this.object = e;
  }
  dispose() {
  }
}
class pq {
  constructor() {
    this._store = /* @__PURE__ */ new Map(), this._isDisposed = !1;
  }
  /**
   * Disposes of all stored values and mark this object as disposed.
   *
   * Trying to use this object after it has been disposed of is an error.
   */
  dispose() {
    this._isDisposed = !0, this.clearAndDisposeAll();
  }
  /**
   * Disposes of all stored values and clear the map, but DO NOT mark this object as disposed.
   */
  clearAndDisposeAll() {
    if (this._store.size)
      try {
        or(this._store.values());
      } finally {
        this._store.clear();
      }
  }
  get(e) {
    return this._store.get(e);
  }
  set(e, t, n = !1) {
    var r;
    this._isDisposed && console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack), n || (r = this._store.get(e)) == null || r.dispose(), this._store.set(e, t);
  }
  /**
   * Delete the value stored for `key` from this map and also dispose of it.
   */
  deleteAndDispose(e) {
    var t;
    (t = this._store.get(e)) == null || t.dispose(), this._store.delete(e);
  }
  values() {
    return this._store.values();
  }
  [Symbol.iterator]() {
    return this._store[Symbol.iterator]();
  }
}
var xy;
let ca = (xy = class {
  constructor(e) {
    this.element = e, this.next = xy.Undefined, this.prev = xy.Undefined;
  }
}, xy.Undefined = new xy(void 0), xy), xc = class {
  constructor() {
    this._first = ca.Undefined, this._last = ca.Undefined, this._size = 0;
  }
  get size() {
    return this._size;
  }
  isEmpty() {
    return this._first === ca.Undefined;
  }
  clear() {
    let e = this._first;
    for (; e !== ca.Undefined; ) {
      const t = e.next;
      e.prev = ca.Undefined, e.next = ca.Undefined, e = t;
    }
    this._first = ca.Undefined, this._last = ca.Undefined, this._size = 0;
  }
  unshift(e) {
    return this._insert(e, !1);
  }
  push(e) {
    return this._insert(e, !0);
  }
  _insert(e, t) {
    const n = new ca(e);
    if (this._first === ca.Undefined)
      this._first = n, this._last = n;
    else if (t) {
      const s = this._last;
      this._last = n, n.prev = s, s.next = n;
    } else {
      const s = this._first;
      this._first = n, n.next = s, s.prev = n;
    }
    this._size += 1;
    let r = !1;
    return () => {
      r || (r = !0, this._remove(n));
    };
  }
  shift() {
    if (this._first !== ca.Undefined) {
      const e = this._first.element;
      return this._remove(this._first), e;
    }
  }
  pop() {
    if (this._last !== ca.Undefined) {
      const e = this._last.element;
      return this._remove(this._last), e;
    }
  }
  _remove(e) {
    if (e.prev !== ca.Undefined && e.next !== ca.Undefined) {
      const t = e.prev;
      t.next = e.next, e.next.prev = t;
    } else e.prev === ca.Undefined && e.next === ca.Undefined ? (this._first = ca.Undefined, this._last = ca.Undefined) : e.next === ca.Undefined ? (this._last = this._last.prev, this._last.next = ca.Undefined) : e.prev === ca.Undefined && (this._first = this._first.next, this._first.prev = ca.Undefined);
    this._size -= 1;
  }
  *[Symbol.iterator]() {
    let e = this._first;
    for (; e !== ca.Undefined; )
      yield e.element, e = e.next;
  }
};
const Vtt = globalThis.performance.now.bind(globalThis.performance);
class _a {
  static create(e) {
    return new _a(e);
  }
  constructor(e) {
    this._now = e === !1 ? Date.now : Vtt, this._startTime = this._now(), this._stopTime = -1;
  }
  stop() {
    this._stopTime = this._now();
  }
  reset() {
    this._startTime = this._now(), this._stopTime = -1;
  }
  elapsed() {
    return this._stopTime !== -1 ? this._stopTime - this._startTime : this._now() - this._startTime;
  }
}
var Ze;
(function(i) {
  i.None = () => ge.None;
  function e(K, X) {
    return h(K, () => {
    }, 0, void 0, !0, void 0, X);
  }
  i.defer = e;
  function t(K) {
    return (X, Y = null, G) => {
      let Q = !1, oe;
      return oe = K((Z) => {
        if (!Q)
          return oe ? oe.dispose() : Q = !0, X.call(Y, Z);
      }, null, G), Q && oe.dispose(), oe;
    };
  }
  i.once = t;
  function n(K, X) {
    return i.once(i.filter(K, X));
  }
  i.onceIf = n;
  function r(K, X, Y) {
    return u((G, Q = null, oe) => K((Z) => G.call(Q, X(Z)), null, oe), Y);
  }
  i.map = r;
  function s(K, X, Y) {
    return u((G, Q = null, oe) => K((Z) => {
      X(Z), G.call(Q, Z);
    }, null, oe), Y);
  }
  i.forEach = s;
  function o(K, X, Y) {
    return u((G, Q = null, oe) => K((Z) => X(Z) && G.call(Q, Z), null, oe), Y);
  }
  i.filter = o;
  function a(K) {
    return K;
  }
  i.signal = a;
  function l(...K) {
    return (X, Y = null, G) => {
      const Q = Vg(...K.map((oe) => oe((Z) => X.call(Y, Z))));
      return d(Q, G);
    };
  }
  i.any = l;
  function c(K, X, Y, G) {
    let Q = Y;
    return r(K, (oe) => (Q = X(Q, oe), Q), G);
  }
  i.reduce = c;
  function u(K, X) {
    let Y;
    const G = {
      onWillAddFirstListener() {
        Y = K(Q.fire, Q);
      },
      onDidRemoveLastListener() {
        Y == null || Y.dispose();
      }
    }, Q = new he(G);
    return X == null || X.add(Q), Q.event;
  }
  function d(K, X) {
    return X instanceof Array ? X.push(K) : X && X.add(K), K;
  }
  function h(K, X, Y = 100, G = !1, Q = !1, oe, Z) {
    let pe, J, ae, be = 0, re;
    const ze = {
      leakWarningThreshold: oe,
      onWillAddFirstListener() {
        pe = K((st) => {
          be++, J = X(J, st), G && !ae && (Ve.fire(J), J = void 0), re = () => {
            const ot = J;
            J = void 0, ae = void 0, (!G || be > 1) && Ve.fire(ot), be = 0;
          }, typeof Y == "number" ? (ae && clearTimeout(ae), ae = setTimeout(re, Y)) : ae === void 0 && (ae = null, queueMicrotask(re));
        });
      },
      onWillRemoveListener() {
        Q && be > 0 && (re == null || re());
      },
      onDidRemoveLastListener() {
        re = void 0, pe.dispose();
      }
    }, Ve = new he(ze);
    return Z == null || Z.add(Ve), Ve.event;
  }
  i.debounce = h;
  function g(K, X = 0, Y) {
    return i.debounce(K, (G, Q) => G ? (G.push(Q), G) : [Q], X, void 0, !0, void 0, Y);
  }
  i.accumulate = g;
  function m(K, X = (G, Q) => G === Q, Y) {
    let G = !0, Q;
    return o(K, (oe) => {
      const Z = G || !X(oe, Q);
      return G = !1, Q = oe, Z;
    }, Y);
  }
  i.latch = m;
  function _(K, X, Y) {
    return [
      i.filter(K, X, Y),
      i.filter(K, (G) => !X(G), Y)
    ];
  }
  i.split = _;
  function v(K, X = !1, Y = [], G) {
    let Q = Y.slice(), oe = K((J) => {
      Q ? Q.push(J) : pe.fire(J);
    });
    G && G.add(oe);
    const Z = () => {
      Q == null || Q.forEach((J) => pe.fire(J)), Q = null;
    }, pe = new he({
      onWillAddFirstListener() {
        oe || (oe = K((J) => pe.fire(J)), G && G.add(oe));
      },
      onDidAddFirstListener() {
        Q && (X ? setTimeout(Z) : Z());
      },
      onDidRemoveLastListener() {
        oe && oe.dispose(), oe = null;
      }
    });
    return G && G.add(pe), pe.event;
  }
  i.buffer = v;
  function w(K, X) {
    return (G, Q, oe) => {
      const Z = X(new L());
      return K(function(pe) {
        const J = Z.evaluate(pe);
        J !== E && G.call(Q, J);
      }, void 0, oe);
    };
  }
  i.chain = w;
  const E = Symbol("HaltChainable");
  class L {
    constructor() {
      this.steps = [];
    }
    map(X) {
      return this.steps.push(X), this;
    }
    forEach(X) {
      return this.steps.push((Y) => (X(Y), Y)), this;
    }
    filter(X) {
      return this.steps.push((Y) => X(Y) ? Y : E), this;
    }
    reduce(X, Y) {
      let G = Y;
      return this.steps.push((Q) => (G = X(G, Q), G)), this;
    }
    latch(X = (Y, G) => Y === G) {
      let Y = !0, G;
      return this.steps.push((Q) => {
        const oe = Y || !X(Q, G);
        return Y = !1, G = Q, oe ? Q : E;
      }), this;
    }
    evaluate(X) {
      for (const Y of this.steps)
        if (X = Y(X), X === E)
          break;
      return X;
    }
  }
  function T(K, X, Y = (G) => G) {
    const G = (...pe) => Z.fire(Y(...pe)), Q = () => K.on(X, G), oe = () => K.removeListener(X, G), Z = new he({ onWillAddFirstListener: Q, onDidRemoveLastListener: oe });
    return Z.event;
  }
  i.fromNodeEventEmitter = T;
  function D(K, X, Y = (G) => G) {
    const G = (...pe) => Z.fire(Y(...pe)), Q = () => K.addEventListener(X, G), oe = () => K.removeEventListener(X, G), Z = new he({ onWillAddFirstListener: Q, onDidRemoveLastListener: oe });
    return Z.event;
  }
  i.fromDOMEventEmitter = D;
  function N(K, X) {
    let Y;
    const G = new Promise((Q, oe) => {
      const Z = t(K)(Q, null, X);
      Y = () => Z.dispose();
    });
    return G.cancel = Y, G;
  }
  i.toPromise = N;
  function R(K, X) {
    return K((Y) => X.fire(Y));
  }
  i.forward = R;
  function M(K, X, Y) {
    return X(Y), K((G) => X(G));
  }
  i.runAndSubscribe = M;
  class B {
    constructor(X, Y) {
      this._observable = X, this._counter = 0, this._hasChanged = !1;
      const G = {
        onWillAddFirstListener: () => {
          X.addObserver(this), this._observable.reportChanges();
        },
        onDidRemoveLastListener: () => {
          X.removeObserver(this);
        }
      };
      this.emitter = new he(G), Y && Y.add(this.emitter);
    }
    beginUpdate(X) {
      this._counter++;
    }
    handlePossibleChange(X) {
    }
    handleChange(X, Y) {
      this._hasChanged = !0;
    }
    endUpdate(X) {
      this._counter--, this._counter === 0 && (this._observable.reportChanges(), this._hasChanged && (this._hasChanged = !1, this.emitter.fire(this._observable.get())));
    }
  }
  function H(K, X) {
    return new B(K, X).emitter.event;
  }
  i.fromObservable = H;
  function j(K) {
    return (X, Y, G) => {
      let Q = 0, oe = !1;
      const Z = {
        beginUpdate() {
          Q++;
        },
        endUpdate() {
          Q--, Q === 0 && (K.reportChanges(), oe && (oe = !1, X.call(Y)));
        },
        handlePossibleChange() {
        },
        handleChange() {
          oe = !0;
        }
      };
      K.addObserver(Z), K.reportChanges();
      const pe = {
        dispose() {
          K.removeObserver(Z);
        }
      };
      return G instanceof ke ? G.add(pe) : Array.isArray(G) && G.push(pe), pe;
    };
  }
  i.fromObservableLight = j;
})(Ze || (Ze = {}));
const TN = class TN {
  constructor(e) {
    this.listenerCount = 0, this.invocationCount = 0, this.elapsedOverall = 0, this.durations = [], this.name = `${e}_${TN._idPool++}`, TN.all.add(this);
  }
  start(e) {
    this._stopWatch = new _a(), this.listenerCount = e;
  }
  stop() {
    if (this._stopWatch) {
      const e = this._stopWatch.elapsed();
      this.durations.push(e), this.elapsedOverall += e, this.invocationCount += 1, this._stopWatch = void 0;
    }
  }
};
TN.all = /* @__PURE__ */ new Set(), TN._idPool = 0;
let Qne = TN, Utt = -1;
const Dj = class Dj {
  constructor(e, t, n = (Dj._idPool++).toString(16).padStart(3, "0")) {
    this._errorHandler = e, this.threshold = t, this.name = n, this._warnCountdown = 0;
  }
  dispose() {
    var e;
    (e = this._stacks) == null || e.clear();
  }
  check(e, t) {
    const n = this.threshold;
    if (n <= 0 || t < n)
      return;
    this._stacks || (this._stacks = /* @__PURE__ */ new Map());
    const r = this._stacks.get(e.value) || 0;
    if (this._stacks.set(e.value, r + 1), this._warnCountdown -= 1, this._warnCountdown <= 0) {
      this._warnCountdown = n * 0.5;
      const [s, o] = this.getMostFrequentStack(), a = `[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${o}):`;
      console.warn(a), console.warn(s);
      const l = new ztt(a, s);
      this._errorHandler(l);
    }
    return () => {
      const s = this._stacks.get(e.value) || 0;
      this._stacks.set(e.value, s - 1);
    };
  }
  getMostFrequentStack() {
    if (!this._stacks)
      return;
    let e, t = 0;
    for (const [n, r] of this._stacks)
      (!e || t < r) && (e = [n, r], t = r);
    return e;
  }
};
Dj._idPool = 1;
let Jne = Dj;
class Nhe {
  static create() {
    const e = new Error();
    return new Nhe(e.stack ?? "");
  }
  constructor(e) {
    this.value = e;
  }
  print() {
    console.warn(this.value.split(`
`).slice(2).join(`
`));
  }
}
class ztt extends Error {
  constructor(e, t) {
    super(e), this.name = "ListenerLeakError", this.stack = t;
  }
}
class $tt extends Error {
  constructor(e, t) {
    super(e), this.name = "ListenerRefusalError", this.stack = t;
  }
}
class RJ {
  constructor(e) {
    this.value = e;
  }
}
const jtt = 2;
let he = class {
  constructor(e) {
    var t, n, r, s;
    this._size = 0, this._options = e, this._leakageMon = (t = this._options) != null && t.leakWarningThreshold ? new Jne((e == null ? void 0 : e.onListenerError) ?? fn, ((n = this._options) == null ? void 0 : n.leakWarningThreshold) ?? Utt) : void 0, this._perfMon = (r = this._options) != null && r._profName ? new Qne(this._options._profName) : void 0, this._deliveryQueue = (s = this._options) == null ? void 0 : s.deliveryQueue;
  }
  dispose() {
    var e, t, n, r;
    this._disposed || (this._disposed = !0, ((e = this._deliveryQueue) == null ? void 0 : e.current) === this && this._deliveryQueue.reset(), this._listeners && (this._listeners = void 0, this._size = 0), (n = (t = this._options) == null ? void 0 : t.onDidRemoveLastListener) == null || n.call(t), (r = this._leakageMon) == null || r.dispose());
  }
  /**
   * For the public to allow to subscribe
   * to events from this Emitter
   */
  get event() {
    return this._event ?? (this._event = (e, t, n) => {
      var a, l, c, u, d, h, g;
      if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
        const m = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
        console.warn(m);
        const _ = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1], v = new $tt(`${m}. HINT: Stack shows most frequent listener (${_[1]}-times)`, _[0]);
        return (((a = this._options) == null ? void 0 : a.onListenerError) || fn)(v), ge.None;
      }
      if (this._disposed)
        return ge.None;
      t && (e = e.bind(t));
      const r = new RJ(e);
      let s;
      this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * 0.2) && (r.stack = Nhe.create(), s = this._leakageMon.check(r.stack, this._size + 1)), this._listeners ? this._listeners instanceof RJ ? (this._deliveryQueue ?? (this._deliveryQueue = new WMe()), this._listeners = [this._listeners, r]) : this._listeners.push(r) : ((c = (l = this._options) == null ? void 0 : l.onWillAddFirstListener) == null || c.call(l, this), this._listeners = r, (d = (u = this._options) == null ? void 0 : u.onDidAddFirstListener) == null || d.call(u, this)), (g = (h = this._options) == null ? void 0 : h.onDidAddListener) == null || g.call(h, this), this._size++;
      const o = Et(() => {
        s == null || s(), this._removeListener(r);
      });
      return n instanceof ke ? n.add(o) : Array.isArray(n) && n.push(o), o;
    }), this._event;
  }
  _removeListener(e) {
    var s, o, a, l;
    if ((o = (s = this._options) == null ? void 0 : s.onWillRemoveListener) == null || o.call(s, this), !this._listeners)
      return;
    if (this._size === 1) {
      this._listeners = void 0, (l = (a = this._options) == null ? void 0 : a.onDidRemoveLastListener) == null || l.call(a, this), this._size = 0;
      return;
    }
    const t = this._listeners, n = t.indexOf(e);
    if (n === -1)
      throw console.log("disposed?", this._disposed), console.log("size?", this._size), console.log("arr?", JSON.stringify(this._listeners)), new Error("Attempted to dispose unknown listener");
    this._size--, t[n] = void 0;
    const r = this._deliveryQueue.current === this;
    if (this._size * jtt <= t.length) {
      let c = 0;
      for (let u = 0; u < t.length; u++)
        t[u] ? t[c++] = t[u] : r && c < this._deliveryQueue.end && (this._deliveryQueue.end--, c < this._deliveryQueue.i && this._deliveryQueue.i--);
      t.length = c;
    }
  }
  _deliver(e, t) {
    var r;
    if (!e)
      return;
    const n = ((r = this._options) == null ? void 0 : r.onListenerError) || fn;
    if (!n) {
      e.value(t);
      return;
    }
    try {
      e.value(t);
    } catch (s) {
      n(s);
    }
  }
  /** Delivers items in the queue. Assumes the queue is ready to go. */
  _deliverQueue(e) {
    const t = e.current._listeners;
    for (; e.i < e.end; )
      this._deliver(t[e.i++], e.value);
    e.reset();
  }
  /**
   * To be kept private to fire an event to
   * subscribers
   */
  fire(e) {
    var t, n, r, s;
    if ((t = this._deliveryQueue) != null && t.current && (this._deliverQueue(this._deliveryQueue), (n = this._perfMon) == null || n.stop()), (r = this._perfMon) == null || r.start(this._size), this._listeners) if (this._listeners instanceof RJ)
      this._deliver(this._listeners, e);
    else {
      const o = this._deliveryQueue;
      o.enqueue(this, e, this._listeners.length), this._deliverQueue(o);
    }
    (s = this._perfMon) == null || s.stop();
  }
  hasListeners() {
    return this._size > 0;
  }
};
const Gtt = () => new WMe();
class WMe {
  constructor() {
    this.i = -1, this.end = 0;
  }
  enqueue(e, t, n) {
    this.i = 0, this.end = n, this.current = e, this.value = t;
  }
  reset() {
    this.i = this.end, this.current = void 0, this.value = void 0;
  }
}
class eT extends he {
  constructor(e) {
    super(e), this._isPaused = 0, this._eventQueue = new xc(), this._mergeFn = e == null ? void 0 : e.merge;
  }
  pause() {
    this._isPaused++;
  }
  resume() {
    if (this._isPaused !== 0 && --this._isPaused === 0)
      if (this._mergeFn) {
        if (this._eventQueue.size > 0) {
          const e = Array.from(this._eventQueue);
          this._eventQueue.clear(), super.fire(this._mergeFn(e));
        }
      } else
        for (; !this._isPaused && this._eventQueue.size !== 0; )
          super.fire(this._eventQueue.shift());
  }
  fire(e) {
    this._size && (this._isPaused !== 0 ? this._eventQueue.push(e) : super.fire(e));
  }
}
class VMe extends eT {
  constructor(e) {
    super(e), this._delay = e.delay ?? 100;
  }
  fire(e) {
    this._handle || (this.pause(), this._handle = setTimeout(() => {
      this._handle = void 0, this.resume();
    }, this._delay)), super.fire(e);
  }
}
class qtt extends he {
  constructor(e) {
    super(e), this._queuedEvents = [], this._mergeFn = e == null ? void 0 : e.merge;
  }
  fire(e) {
    this.hasListeners() && (this._queuedEvents.push(e), this._queuedEvents.length === 1 && queueMicrotask(() => {
      this._mergeFn ? super.fire(this._mergeFn(this._queuedEvents)) : this._queuedEvents.forEach((t) => super.fire(t)), this._queuedEvents = [];
    }));
  }
}
class Ktt {
  constructor() {
    this.hasListeners = !1, this.events = [], this.emitter = new he({
      onWillAddFirstListener: () => this.onFirstListenerAdd(),
      onDidRemoveLastListener: () => this.onLastListenerRemove()
    });
  }
  get event() {
    return this.emitter.event;
  }
  add(e) {
    const t = { event: e, listener: null };
    return this.events.push(t), this.hasListeners && this.hook(t), Et(JL(() => {
      this.hasListeners && this.unhook(t);
      const r = this.events.indexOf(t);
      this.events.splice(r, 1);
    }));
  }
  onFirstListenerAdd() {
    this.hasListeners = !0, this.events.forEach((e) => this.hook(e));
  }
  onLastListenerRemove() {
    this.hasListeners = !1, this.events.forEach((e) => this.unhook(e));
  }
  hook(e) {
    e.listener = e.event((t) => this.emitter.fire(t));
  }
  unhook(e) {
    var t;
    (t = e.listener) == null || t.dispose(), e.listener = null;
  }
  dispose() {
    var e;
    this.emitter.dispose();
    for (const t of this.events)
      (e = t.listener) == null || e.dispose();
    this.events = [];
  }
}
class gB {
  constructor() {
    this.data = [];
  }
  wrapEvent(e, t, n) {
    return (r, s, o) => e((a) => {
      const l = this.data[this.data.length - 1];
      if (!t) {
        l ? l.buffers.push(() => r.call(s, a)) : r.call(s, a);
        return;
      }
      const c = l;
      if (!c) {
        r.call(s, t(n, a));
        return;
      }
      c.items ?? (c.items = []), c.items.push(a), c.buffers.length === 0 && l.buffers.push(() => {
        c.reducedResult ?? (c.reducedResult = n ? c.items.reduce(t, n) : c.items.reduce(t)), r.call(s, c.reducedResult);
      });
    }, void 0, o);
  }
  bufferEvents(e) {
    const t = { buffers: new Array() };
    this.data.push(t);
    const n = e();
    return this.data.pop(), t.buffers.forEach((r) => r()), n;
  }
}
class FM {
  constructor() {
    this.listening = !1, this.inputEvent = Ze.None, this.inputEventListener = ge.None, this.emitter = new he({
      onDidAddFirstListener: () => {
        this.listening = !0, this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);
      },
      onDidRemoveLastListener: () => {
        this.listening = !1, this.inputEventListener.dispose();
      }
    }), this.event = this.emitter.event;
  }
  set input(e) {
    this.inputEvent = e, this.listening && (this.inputEventListener.dispose(), this.inputEventListener = e(this.emitter.fire, this.emitter));
  }
  dispose() {
    this.inputEventListener.dispose(), this.emitter.dispose();
  }
}
const UMe = Object.freeze(function(i, e) {
  const t = setTimeout(i.bind(e), 0);
  return { dispose() {
    clearTimeout(t);
  } };
});
var $n;
(function(i) {
  function e(t) {
    return t === i.None || t === i.Cancelled || t instanceof yW ? !0 : !t || typeof t != "object" ? !1 : typeof t.isCancellationRequested == "boolean" && typeof t.onCancellationRequested == "function";
  }
  i.isCancellationToken = e, i.None = Object.freeze({
    isCancellationRequested: !1,
    onCancellationRequested: Ze.None
  }), i.Cancelled = Object.freeze({
    isCancellationRequested: !0,
    onCancellationRequested: UMe
  });
})($n || ($n = {}));
class yW {
  constructor() {
    this._isCancelled = !1, this._emitter = null;
  }
  cancel() {
    this._isCancelled || (this._isCancelled = !0, this._emitter && (this._emitter.fire(void 0), this.dispose()));
  }
  get isCancellationRequested() {
    return this._isCancelled;
  }
  get onCancellationRequested() {
    return this._isCancelled ? UMe : (this._emitter || (this._emitter = new he()), this._emitter.event);
  }
  dispose() {
    this._emitter && (this._emitter.dispose(), this._emitter = null);
  }
}
let Ss = class {
  constructor(e) {
    this._token = void 0, this._parentListener = void 0, this._parentListener = e && e.onCancellationRequested(this.cancel, this);
  }
  get token() {
    return this._token || (this._token = new yW()), this._token;
  }
  cancel() {
    this._token ? this._token instanceof yW && this._token.cancel() : this._token = $n.Cancelled;
  }
  dispose(e = !1) {
    var t;
    e && this.cancel(), (t = this._parentListener) == null || t.dispose(), this._token ? this._token instanceof yW && this._token.dispose() : this._token = $n.None;
  }
};
function eie(i) {
  const e = new Ss();
  return i.add({ dispose() {
    e.cancel();
  } }), e.token;
}
const zMe = Symbol("MicrotaskDelay");
function tie(i) {
  return !!i && typeof i.then == "function";
}
function Jo(i) {
  const e = new Ss(), t = i(e.token);
  let n = !1;
  const r = new Promise((s, o) => {
    const a = e.token.onCancellationRequested(() => {
      n = !0, a.dispose(), o(new $f());
    });
    Promise.resolve(t).then((l) => {
      a.dispose(), e.dispose(), n ? UT(l) && l.dispose() : s(l);
    }, (l) => {
      a.dispose(), e.dispose(), o(l);
    });
  });
  return new class {
    cancel() {
      e.cancel(), e.dispose();
    }
    then(s, o) {
      return r.then(s, o);
    }
    catch(s) {
      return this.then(void 0, s);
    }
    finally(s) {
      return r.finally(s);
    }
  }();
}
function $R(i, e, t) {
  return new Promise((n, r) => {
    const s = e.onCancellationRequested(() => {
      s.dispose(), n(t);
    });
    i.then(n, r).finally(() => s.dispose());
  });
}
function Ytt(i, e) {
  return new Promise((t, n) => {
    const r = e.onCancellationRequested(() => {
      r.dispose(), n(new $f());
    });
    i.then(t, n).finally(() => r.dispose());
  });
}
let Xtt = class {
  constructor() {
    this.isDisposed = !1, this.activePromise = null, this.queuedPromise = null, this.queuedPromiseFactory = null;
  }
  queue(e) {
    if (this.isDisposed)
      return Promise.reject(new Error("Throttler is disposed"));
    if (this.activePromise) {
      if (this.queuedPromiseFactory = e, !this.queuedPromise) {
        const t = () => {
          if (this.queuedPromise = null, this.isDisposed)
            return;
          const n = this.queue(this.queuedPromiseFactory);
          return this.queuedPromiseFactory = null, n;
        };
        this.queuedPromise = new Promise((n) => {
          this.activePromise.then(t, t).then(n);
        });
      }
      return new Promise((t, n) => {
        this.queuedPromise.then(t, n);
      });
    }
    return this.activePromise = e(), new Promise((t, n) => {
      this.activePromise.then((r) => {
        this.activePromise = null, t(r);
      }, (r) => {
        this.activePromise = null, n(r);
      });
    });
  }
  dispose() {
    this.isDisposed = !0;
  }
};
const Ztt = (i, e) => {
  let t = !0;
  const n = setTimeout(() => {
    t = !1, e();
  }, i);
  return {
    isTriggered: () => t,
    dispose: () => {
      clearTimeout(n), t = !1;
    }
  };
}, Qtt = (i) => {
  let e = !0;
  return queueMicrotask(() => {
    e && (e = !1, i());
  }), {
    isTriggered: () => e,
    dispose: () => {
      e = !1;
    }
  };
};
class Gf {
  constructor(e) {
    this.defaultDelay = e, this.deferred = null, this.completionPromise = null, this.doResolve = null, this.doReject = null, this.task = null;
  }
  trigger(e, t = this.defaultDelay) {
    this.task = e, this.cancelTimeout(), this.completionPromise || (this.completionPromise = new Promise((r, s) => {
      this.doResolve = r, this.doReject = s;
    }).then(() => {
      if (this.completionPromise = null, this.doResolve = null, this.task) {
        const r = this.task;
        return this.task = null, r();
      }
    }));
    const n = () => {
      var r;
      this.deferred = null, (r = this.doResolve) == null || r.call(this, null);
    };
    return this.deferred = t === zMe ? Qtt(n) : Ztt(t, n), this.completionPromise;
  }
  isTriggered() {
    var e;
    return !!((e = this.deferred) != null && e.isTriggered());
  }
  cancel() {
    var e;
    this.cancelTimeout(), this.completionPromise && ((e = this.doReject) == null || e.call(this, new $f()), this.completionPromise = null);
  }
  cancelTimeout() {
    var e;
    (e = this.deferred) == null || e.dispose(), this.deferred = null;
  }
  dispose() {
    this.cancel();
  }
}
class $Me {
  constructor(e) {
    this.delayer = new Gf(e), this.throttler = new Xtt();
  }
  trigger(e, t) {
    return this.delayer.trigger(() => this.throttler.queue(e), t);
  }
  cancel() {
    this.delayer.cancel();
  }
  dispose() {
    this.delayer.dispose(), this.throttler.dispose();
  }
}
function db(i, e) {
  return e ? new Promise((t, n) => {
    const r = setTimeout(() => {
      s.dispose(), t();
    }, i), s = e.onCancellationRequested(() => {
      clearTimeout(r), s.dispose(), n(new $f());
    });
  }) : Jo((t) => db(i, t));
}
function jy(i, e = 0, t) {
  const n = setTimeout(() => {
    i(), t && r.dispose();
  }, e), r = Et(() => {
    clearTimeout(n), t == null || t.delete(r);
  });
  return t == null || t.add(r), r;
}
function Rhe(i, e = (n) => !!n, t = null) {
  let n = 0;
  const r = i.length, s = () => {
    if (n >= r)
      return Promise.resolve(t);
    const o = i[n++];
    return Promise.resolve(o()).then((l) => e(l) ? Promise.resolve(l) : s());
  };
  return s();
}
let Jtt = class {
  constructor() {
    this._runningTask = void 0, this._pendingTasks = [];
  }
  /**
   * Waits for the current and pending tasks to finish, then runs and awaits the given task.
   * If the task is skipped because of clearPending, the promise is rejected with a CancellationError.
  */
  schedule(e) {
    const t = new zT();
    return this._pendingTasks.push({ task: e, deferred: t, setUndefinedWhenCleared: !1 }), this._runIfNotRunning(), t.p;
  }
  _runIfNotRunning() {
    this._runningTask === void 0 && this._processQueue();
  }
  async _processQueue() {
    if (this._pendingTasks.length === 0)
      return;
    const e = this._pendingTasks.shift();
    if (e) {
      if (this._runningTask)
        throw new Wt();
      this._runningTask = e.task;
      try {
        const t = await e.task();
        e.deferred.complete(t);
      } catch (t) {
        e.deferred.error(t);
      } finally {
        this._runningTask = void 0, this._processQueue();
      }
    }
  }
  /**
   * Clears all pending tasks. Does not cancel the currently running task.
  */
  clearPending() {
    const e = this._pendingTasks;
    this._pendingTasks = [];
    for (const t of e)
      t.setUndefinedWhenCleared ? t.deferred.complete(void 0) : t.deferred.error(new $f());
  }
};
class Gh {
  constructor(e, t) {
    this._isDisposed = !1, this._token = void 0, typeof e == "function" && typeof t == "number" && this.setIfNotSet(e, t);
  }
  dispose() {
    this.cancel(), this._isDisposed = !0;
  }
  cancel() {
    this._token !== void 0 && (clearTimeout(this._token), this._token = void 0);
  }
  cancelAndSet(e, t) {
    if (this._isDisposed)
      throw new Wt("Calling 'cancelAndSet' on a disposed TimeoutTimer");
    this.cancel(), this._token = setTimeout(() => {
      this._token = void 0, e();
    }, t);
  }
  setIfNotSet(e, t) {
    if (this._isDisposed)
      throw new Wt("Calling 'setIfNotSet' on a disposed TimeoutTimer");
    this._token === void 0 && (this._token = setTimeout(() => {
      this._token = void 0, e();
    }, t));
  }
}
class Ahe {
  constructor() {
    this.disposable = void 0, this.isDisposed = !1;
  }
  cancel() {
    var e;
    (e = this.disposable) == null || e.dispose(), this.disposable = void 0;
  }
  cancelAndSet(e, t, n = globalThis) {
    if (this.isDisposed)
      throw new Wt("Calling 'cancelAndSet' on a disposed IntervalTimer");
    this.cancel();
    const r = n.setInterval(() => {
      e();
    }, t);
    this.disposable = Et(() => {
      n.clearInterval(r), this.disposable = void 0;
    });
  }
  dispose() {
    this.cancel(), this.isDisposed = !0;
  }
}
class mr {
  constructor(e, t) {
    this.timeoutToken = void 0, this.runner = e, this.timeout = t, this.timeoutHandler = this.onTimeout.bind(this);
  }
  /**
   * Dispose RunOnceScheduler
   */
  dispose() {
    this.cancel(), this.runner = null;
  }
  /**
   * Cancel current scheduled runner (if any).
   */
  cancel() {
    this.isScheduled() && (clearTimeout(this.timeoutToken), this.timeoutToken = void 0);
  }
  /**
   * Cancel previous runner (if any) & schedule a new runner.
   */
  schedule(e = this.timeout) {
    this.cancel(), this.timeoutToken = setTimeout(this.timeoutHandler, e);
  }
  get delay() {
    return this.timeout;
  }
  set delay(e) {
    this.timeout = e;
  }
  /**
   * Returns true if scheduled.
   */
  isScheduled() {
    return this.timeoutToken !== void 0;
  }
  onTimeout() {
    this.timeoutToken = void 0, this.runner && this.doRun();
  }
  doRun() {
    var e;
    (e = this.runner) == null || e.call(this);
  }
}
let Ohe, yF;
(function() {
  const i = globalThis;
  typeof i.requestIdleCallback != "function" || typeof i.cancelIdleCallback != "function" ? yF = (e, t, n) => {
    gq(() => {
      if (r)
        return;
      const s = Date.now() + 15;
      t(Object.freeze({
        didTimeout: !0,
        timeRemaining() {
          return Math.max(0, s - Date.now());
        }
      }));
    });
    let r = !1;
    return {
      dispose() {
        r || (r = !0);
      }
    };
  } : yF = (e, t, n) => {
    const r = e.requestIdleCallback(t, typeof n == "number" ? { timeout: n } : void 0);
    let s = !1;
    return {
      dispose() {
        s || (s = !0, e.cancelIdleCallback(r));
      }
    };
  }, Ohe = (e, t) => yF(globalThis, e, t);
})();
class jMe {
  constructor(e, t) {
    this._didRun = !1, this._executor = () => {
      try {
        this._value = t();
      } catch (n) {
        this._error = n;
      } finally {
        this._didRun = !0;
      }
    }, this._handle = yF(e, () => this._executor());
  }
  dispose() {
    this._handle.dispose();
  }
  get value() {
    if (this._didRun || (this._handle.dispose(), this._executor()), this._error)
      throw this._error;
    return this._value;
  }
  get isInitialized() {
    return this._didRun;
  }
}
class ent extends jMe {
  constructor(e) {
    super(globalThis, e);
  }
}
class zT {
  get isRejected() {
    var e;
    return ((e = this.outcome) == null ? void 0 : e.outcome) === 1;
  }
  get isSettled() {
    return !!this.outcome;
  }
  constructor() {
    this.p = new Promise((e, t) => {
      this.completeCallback = e, this.errorCallback = t;
    });
  }
  complete(e) {
    return this.isSettled ? Promise.resolve() : new Promise((t) => {
      this.completeCallback(e), this.outcome = { outcome: 0, value: e }, t();
    });
  }
  error(e) {
    return this.isSettled ? Promise.resolve() : new Promise((t) => {
      this.errorCallback(e), this.outcome = { outcome: 1, value: e }, t();
    });
  }
  cancel() {
    return this.error(new $f());
  }
}
var Z3;
(function(i) {
  async function e(n) {
    let r;
    const s = await Promise.all(n.map((o) => o.then((a) => a, (a) => {
      r || (r = a);
    })));
    if (typeof r < "u")
      throw r;
    return s;
  }
  i.settled = e;
  function t(n) {
    return new Promise(async (r, s) => {
      try {
        await n(r, s);
      } catch (o) {
        s(o);
      }
    });
  }
  i.withAsyncBody = t;
})(Z3 || (Z3 = {}));
function tnt(i) {
  const e = new Ss(), t = i(e.token);
  return new int(e, async (n) => {
    const r = e.token.onCancellationRequested(() => {
      r.dispose(), e.dispose(), n.reject(new $f());
    });
    try {
      for await (const s of t) {
        if (e.token.isCancellationRequested)
          return;
        n.emitOne(s);
      }
      r.dispose(), e.dispose();
    } catch (s) {
      r.dispose(), e.dispose(), n.reject(s);
    }
  });
}
class nnt {
  constructor() {
    this._unsatisfiedConsumers = [], this._unconsumedValues = [];
  }
  get hasFinalValue() {
    return !!this._finalValue;
  }
  produce(e) {
    if (this._ensureNoFinalValue(), this._unsatisfiedConsumers.length > 0) {
      const t = this._unsatisfiedConsumers.shift();
      this._resolveOrRejectDeferred(t, e);
    } else
      this._unconsumedValues.push(e);
  }
  produceFinal(e) {
    this._ensureNoFinalValue(), this._finalValue = e;
    for (const t of this._unsatisfiedConsumers)
      this._resolveOrRejectDeferred(t, e);
    this._unsatisfiedConsumers.length = 0;
  }
  _ensureNoFinalValue() {
    if (this._finalValue)
      throw new Wt("ProducerConsumer: cannot produce after final value has been set");
  }
  _resolveOrRejectDeferred(e, t) {
    t.ok ? e.complete(t.value) : e.error(t.error);
  }
  consume() {
    if (this._unconsumedValues.length > 0 || this._finalValue) {
      const e = this._unconsumedValues.length > 0 ? this._unconsumedValues.shift() : this._finalValue;
      return e.ok ? Promise.resolve(e.value) : Promise.reject(e.error);
    } else {
      const e = new zT();
      return this._unsatisfiedConsumers.push(e), e.p;
    }
  }
}
const wh = class wh {
  constructor(e, t) {
    this._onReturn = t, this._producerConsumer = new nnt(), this._iterator = {
      next: () => this._producerConsumer.consume(),
      return: () => {
        var n;
        return (n = this._onReturn) == null || n.call(this), Promise.resolve({ done: !0, value: void 0 });
      },
      throw: async (n) => (this._finishError(n), { done: !0, value: void 0 })
    }, queueMicrotask(async () => {
      const n = e({
        emitOne: (r) => this._producerConsumer.produce({ ok: !0, value: { done: !1, value: r } }),
        emitMany: (r) => {
          for (const s of r)
            this._producerConsumer.produce({ ok: !0, value: { done: !1, value: s } });
        },
        reject: (r) => this._finishError(r)
      });
      if (!this._producerConsumer.hasFinalValue)
        try {
          await n, this._finishOk();
        } catch (r) {
          this._finishError(r);
        }
    });
  }
  static fromArray(e) {
    return new wh((t) => {
      t.emitMany(e);
    });
  }
  static fromPromise(e) {
    return new wh(async (t) => {
      t.emitMany(await e);
    });
  }
  static fromPromisesResolveOrder(e) {
    return new wh(async (t) => {
      await Promise.all(e.map(async (n) => t.emitOne(await n)));
    });
  }
  static merge(e) {
    return new wh(async (t) => {
      await Promise.all(e.map(async (n) => {
        for await (const r of n)
          t.emitOne(r);
      }));
    });
  }
  static map(e, t) {
    return new wh(async (n) => {
      for await (const r of e)
        n.emitOne(t(r));
    });
  }
  map(e) {
    return wh.map(this, e);
  }
  static coalesce(e) {
    return wh.filter(e, (t) => !!t);
  }
  coalesce() {
    return wh.coalesce(this);
  }
  static filter(e, t) {
    return new wh(async (n) => {
      for await (const r of e)
        t(r) && n.emitOne(r);
    });
  }
  filter(e) {
    return wh.filter(this, e);
  }
  _finishOk() {
    this._producerConsumer.hasFinalValue || this._producerConsumer.produceFinal({ ok: !0, value: { done: !0, value: void 0 } });
  }
  _finishError(e) {
    this._producerConsumer.hasFinalValue || this._producerConsumer.produceFinal({ ok: !1, error: e });
  }
  [Symbol.asyncIterator]() {
    return this._iterator;
  }
};
wh.EMPTY = wh.fromArray([]);
let Hf = wh;
class int extends Hf {
  constructor(e, t) {
    super(t), this._source = e;
  }
  cancel() {
    this._source.cancel();
  }
}
function GMe(i) {
  return i;
}
class rnt {
  constructor(e, t) {
    this.lastCache = void 0, this.lastArgKey = void 0, typeof e == "function" ? (this._fn = e, this._computeKey = GMe) : (this._fn = t, this._computeKey = e.getCacheKey);
  }
  get(e) {
    const t = this._computeKey(e);
    return this.lastArgKey !== t && (this.lastArgKey = t, this.lastCache = this._fn(e)), this.lastCache;
  }
}
class nie {
  get cachedValues() {
    return this._map;
  }
  constructor(e, t) {
    this._map = /* @__PURE__ */ new Map(), this._map2 = /* @__PURE__ */ new Map(), typeof e == "function" ? (this._fn = e, this._computeKey = GMe) : (this._fn = t, this._computeKey = e.getCacheKey);
  }
  get(e) {
    const t = this._computeKey(e);
    if (this._map2.has(t))
      return this._map2.get(t);
    const n = this._fn(e);
    return this._map.set(e, n), this._map2.set(t, n), n;
  }
}
var ME;
(function(i) {
  i[i.Uninitialized = 0] = "Uninitialized", i[i.Running = 1] = "Running", i[i.Completed = 2] = "Completed";
})(ME || (ME = {}));
class _l {
  constructor(e) {
    this.executor = e, this._state = ME.Uninitialized;
  }
  /**
   * Get the wrapped value.
   *
   * This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only
   * resolved once. `getValue` will re-throw exceptions that are hit while resolving the value
   */
  get value() {
    if (this._state === ME.Uninitialized) {
      this._state = ME.Running;
      try {
        this._value = this.executor();
      } catch (e) {
        this._error = e;
      } finally {
        this._state = ME.Completed;
      }
    } else if (this._state === ME.Running)
      throw new Error("Cannot read the value of a lazy that is being initialized");
    if (this._error)
      throw this._error;
    return this._value;
  }
  /**
   * Get the wrapped value without forcing evaluation.
   */
  get rawValue() {
    return this._value;
  }
}
function qMe(i) {
  return !i || typeof i != "string" ? !0 : i.trim().length === 0;
}
const snt = /{(\d+)}/g;
function tT(i, ...e) {
  return e.length === 0 ? i : i.replace(snt, function(t, n) {
    const r = parseInt(n, 10);
    return isNaN(r) || r < 0 || r >= e.length ? t : e[r];
  });
}
function ont(i) {
  return i.replace(/[<>"'&]/g, (e) => {
    switch (e) {
      case "<":
        return "&lt;";
      case ">":
        return "&gt;";
      case '"':
        return "&quot;";
      case "'":
        return "&apos;";
      case "&":
        return "&amp;";
    }
    return e;
  });
}
function Ug(i) {
  return i.replace(/[<>&]/g, function(e) {
    switch (e) {
      case "<":
        return "&lt;";
      case ">":
        return "&gt;";
      case "&":
        return "&amp;";
      default:
        return e;
    }
  });
}
function zd(i) {
  return i.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, "\\$&");
}
function ant(i, e = " ") {
  const t = pB(i, e);
  return KMe(t, e);
}
function pB(i, e) {
  if (!i || !e)
    return i;
  const t = e.length;
  if (t === 0 || i.length === 0)
    return i;
  let n = 0;
  for (; i.indexOf(e, n) === n; )
    n = n + t;
  return i.substring(n);
}
function KMe(i, e) {
  if (!i || !e)
    return i;
  const t = e.length, n = i.length;
  if (t === 0 || n === 0)
    return i;
  let r = n, s = -1;
  for (; s = i.lastIndexOf(e, r - 1), !(s === -1 || s + t !== r); ) {
    if (s === 0)
      return "";
    r = s;
  }
  return i.substring(0, r);
}
function lnt(i) {
  return i.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&").replace(/[\*]/g, ".*");
}
function YMe(i, e, t = {}) {
  if (!i)
    throw new Error("Cannot create regex from empty string");
  e || (i = zd(i)), t.wholeWord && (/\B/.test(i.charAt(0)) || (i = "\\b" + i), /\B/.test(i.charAt(i.length - 1)) || (i = i + "\\b"));
  let n = "";
  return t.global && (n += "g"), t.matchCase || (n += "i"), t.multiline && (n += "m"), t.unicode && (n += "u"), new RegExp(i, n);
}
function XMe(i) {
  return i.source === "^" || i.source === "^$" || i.source === "$" || i.source === "^\\s*$" ? !1 : !!(i.exec("") && i.lastIndex === 0);
}
function $d(i) {
  return i.split(/\r\n|\r|\n/);
}
function Tc(i) {
  for (let e = 0, t = i.length; e < t; e++) {
    const n = i.charCodeAt(e);
    if (n !== 32 && n !== 9)
      return e;
  }
  return -1;
}
function Ir(i, e = 0, t = i.length) {
  for (let n = e; n < t; n++) {
    const r = i.charCodeAt(n);
    if (r !== 32 && r !== 9)
      return i.substring(e, n);
  }
  return i.substring(e, t);
}
function zg(i, e = i.length - 1) {
  for (let t = e; t >= 0; t--) {
    const n = i.charCodeAt(t);
    if (n !== 32 && n !== 9)
      return t;
  }
  return -1;
}
function Q3(i, e) {
  return i < e ? -1 : i > e ? 1 : 0;
}
function Mhe(i, e, t = 0, n = i.length, r = 0, s = e.length) {
  for (; t < n && r < s; t++, r++) {
    const l = i.charCodeAt(t), c = e.charCodeAt(r);
    if (l < c)
      return -1;
    if (l > c)
      return 1;
  }
  const o = n - t, a = s - r;
  return o < a ? -1 : o > a ? 1 : 0;
}
function iie(i, e) {
  return mB(i, e, 0, i.length, 0, e.length);
}
function mB(i, e, t = 0, n = i.length, r = 0, s = e.length) {
  for (; t < n && r < s; t++, r++) {
    let l = i.charCodeAt(t), c = e.charCodeAt(r);
    if (l === c)
      continue;
    if (l >= 128 || c >= 128)
      return Mhe(i.toLowerCase(), e.toLowerCase(), t, n, r, s);
    r1(l) && (l -= 32), r1(c) && (c -= 32);
    const u = l - c;
    if (u !== 0)
      return u;
  }
  const o = n - t, a = s - r;
  return o < a ? -1 : o > a ? 1 : 0;
}
function k7(i) {
  return i >= 48 && i <= 57;
}
function r1(i) {
  return i >= 97 && i <= 122;
}
function H_(i) {
  return i >= 65 && i <= 90;
}
function tN(i, e) {
  return i.length === e.length && mB(i, e) === 0;
}
function Phe(i, e) {
  const t = e.length;
  return e.length > i.length ? !1 : mB(i, e, 0, t) === 0;
}
function jg(i, e) {
  const t = Math.min(i.length, e.length);
  let n;
  for (n = 0; n < t; n++)
    if (i.charCodeAt(n) !== e.charCodeAt(n))
      return n;
  return t;
}
function Gy(i, e) {
  const t = Math.min(i.length, e.length);
  let n;
  const r = i.length - 1, s = e.length - 1;
  for (n = 0; n < t; n++)
    if (i.charCodeAt(r - n) !== e.charCodeAt(s - n))
      return n;
  return t;
}
function Qo(i) {
  return 55296 <= i && i <= 56319;
}
function ew(i) {
  return 56320 <= i && i <= 57343;
}
function Fhe(i, e) {
  return (i - 55296 << 10) + (e - 56320) + 65536;
}
function TV(i, e, t) {
  const n = i.charCodeAt(t);
  if (Qo(n) && t + 1 < e) {
    const r = i.charCodeAt(t + 1);
    if (ew(r))
      return Fhe(n, r);
  }
  return n;
}
function cnt(i, e) {
  const t = i.charCodeAt(e - 1);
  if (ew(t) && e > 1) {
    const n = i.charCodeAt(e - 2);
    if (Qo(n))
      return Fhe(n, t);
  }
  return t;
}
class Bhe {
  get offset() {
    return this._offset;
  }
  constructor(e, t = 0) {
    this._str = e, this._len = e.length, this._offset = t;
  }
  setOffset(e) {
    this._offset = e;
  }
  prevCodePoint() {
    const e = cnt(this._str, this._offset);
    return this._offset -= e >= 65536 ? 2 : 1, e;
  }
  nextCodePoint() {
    const e = TV(this._str, this._len, this._offset);
    return this._offset += e >= 65536 ? 2 : 1, e;
  }
  eol() {
    return this._offset >= this._len;
  }
}
class kV {
  get offset() {
    return this._iterator.offset;
  }
  constructor(e, t = 0) {
    this._iterator = new Bhe(e, t);
  }
  nextGraphemeLength() {
    const e = DV.getInstance(), t = this._iterator, n = t.offset;
    let r = e.getGraphemeBreakType(t.nextCodePoint());
    for (; !t.eol(); ) {
      const s = t.offset, o = e.getGraphemeBreakType(t.nextCodePoint());
      if (bxe(r, o)) {
        t.setOffset(s);
        break;
      }
      r = o;
    }
    return t.offset - n;
  }
  prevGraphemeLength() {
    const e = DV.getInstance(), t = this._iterator, n = t.offset;
    let r = e.getGraphemeBreakType(t.prevCodePoint());
    for (; t.offset > 0; ) {
      const s = t.offset, o = e.getGraphemeBreakType(t.prevCodePoint());
      if (bxe(o, r)) {
        t.setOffset(s);
        break;
      }
      r = o;
    }
    return n - t.offset;
  }
  eol() {
    return this._iterator.eol();
  }
}
function Hhe(i, e) {
  return new kV(i, e).nextGraphemeLength();
}
function ZMe(i, e) {
  return new kV(i, e).prevGraphemeLength();
}
function unt(i, e) {
  e > 0 && ew(i.charCodeAt(e)) && e--;
  const t = e + Hhe(i, e);
  return [t - ZMe(i, t), t];
}
let AJ;
function dnt() {
  return /(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;
}
function jR(i) {
  return AJ || (AJ = dnt()), AJ.test(i);
}
const hnt = /^[\t\n\r\x20-\x7E]*$/;
function _B(i) {
  return hnt.test(i);
}
const QMe = /[\u2028\u2029]/;
function JMe(i) {
  return QMe.test(i);
}
function tw(i) {
  return i >= 11904 && i <= 55215 || i >= 63744 && i <= 64255 || i >= 65281 && i <= 65374;
}
function Whe(i) {
  return i >= 127462 && i <= 127487 || i === 8986 || i === 8987 || i === 9200 || i === 9203 || i >= 9728 && i <= 10175 || i === 11088 || i === 11093 || i >= 127744 && i <= 128591 || i >= 128640 && i <= 128764 || i >= 128992 && i <= 129008 || i >= 129280 && i <= 129535 || i >= 129648 && i <= 129782;
}
const fnt = "\uFEFF";
function Vhe(i) {
  return !!(i && i.length > 0 && i.charCodeAt(0) === 65279);
}
function gnt(i, e = !1) {
  return i ? (e && (i = i.replace(/\\./g, "")), i.toLowerCase() !== i) : !1;
}
function ePe(i) {
  return i = i % 52, i < 26 ? String.fromCharCode(97 + i) : String.fromCharCode(65 + i - 26);
}
function bxe(i, e) {
  return i === 0 ? e !== 5 && e !== 7 : i === 2 && e === 3 ? !1 : i === 4 || i === 2 || i === 3 || e === 4 || e === 2 || e === 3 ? !0 : !(i === 8 && (e === 8 || e === 9 || e === 11 || e === 12) || (i === 11 || i === 9) && (e === 9 || e === 10) || (i === 12 || i === 10) && e === 10 || e === 5 || e === 13 || e === 7 || i === 1 || i === 13 && e === 14 || i === 6 && e === 6);
}
const QE = class QE {
  static getInstance() {
    return QE._INSTANCE || (QE._INSTANCE = new QE()), QE._INSTANCE;
  }
  constructor() {
    this._data = pnt();
  }
  getGraphemeBreakType(e) {
    if (e < 32)
      return e === 10 ? 3 : e === 13 ? 2 : 4;
    if (e < 127)
      return 0;
    const t = this._data, n = t.length / 3;
    let r = 1;
    for (; r <= n; )
      if (e < t[3 * r])
        r = 2 * r;
      else if (e > t[3 * r + 1])
        r = 2 * r + 1;
      else
        return t[3 * r + 2];
    return 0;
  }
};
QE._INSTANCE = null;
let DV = QE;
function pnt() {
  return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]");
}
function mnt(i, e) {
  if (i === 0)
    return 0;
  const t = _nt(i, e);
  if (t !== void 0)
    return t;
  const n = new Bhe(e, i);
  return n.prevCodePoint(), n.offset;
}
function _nt(i, e) {
  const t = new Bhe(e, i);
  let n = t.prevCodePoint();
  for (; bnt(n) || n === 65039 || n === 8419; ) {
    if (t.offset === 0)
      return;
    n = t.prevCodePoint();
  }
  if (!Whe(n))
    return;
  let r = t.offset;
  return r > 0 && t.prevCodePoint() === 8205 && (r = t.offset), r;
}
function bnt(i) {
  return 127995 <= i && i <= 127999;
}
const tPe = " ", D_ = class D_ {
  static getInstance(e) {
    return D_.cache.get(Array.from(e));
  }
  static getLocales() {
    return D_._locales.value;
  }
  constructor(e) {
    this.confusableDictionary = e;
  }
  isAmbiguous(e) {
    return this.confusableDictionary.has(e);
  }
  /**
   * Returns the non basic ASCII code point that the given code point can be confused,
   * or undefined if such code point does note exist.
   */
  getPrimaryConfusable(e) {
    return this.confusableDictionary.get(e);
  }
  getConfusableCodePoints() {
    return new Set(this.confusableDictionary.keys());
  }
};
D_.ambiguousCharacterData = new _l(() => JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}')), D_.cache = new rnt({ getCacheKey: JSON.stringify }, (e) => {
  function t(u) {
    const d = /* @__PURE__ */ new Map();
    for (let h = 0; h < u.length; h += 2)
      d.set(u[h], u[h + 1]);
    return d;
  }
  function n(u, d) {
    const h = new Map(u);
    for (const [g, m] of d)
      h.set(g, m);
    return h;
  }
  function r(u, d) {
    if (!u)
      return d;
    const h = /* @__PURE__ */ new Map();
    for (const [g, m] of u)
      d.has(g) && h.set(g, m);
    return h;
  }
  const s = D_.ambiguousCharacterData.value;
  let o = e.filter((u) => !u.startsWith("_") && u in s);
  o.length === 0 && (o = ["_default"]);
  let a;
  for (const u of o) {
    const d = t(s[u]);
    a = r(a, d);
  }
  const l = t(s._common), c = n(l, a);
  return new D_(c);
}), D_._locales = new _l(() => Object.keys(D_.ambiguousCharacterData.value).filter((e) => !e.startsWith("_")));
let J3 = D_;
const kN = class kN {
  static getRawData() {
    return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}');
  }
  static getData() {
    return this._data || (this._data = new Set([...Object.values(kN.getRawData())].flat())), this._data;
  }
  static isInvisibleCharacter(e) {
    return kN.getData().has(e);
  }
  static get codePoints() {
    return kN.getData();
  }
};
kN._data = void 0;
let Ix = kN;
var vxe = {};
let zN;
const OJ = globalThis.vscode;
var iMe;
if (typeof OJ < "u" && typeof OJ.process < "u") {
  const i = OJ.process;
  zN = {
    get platform() {
      return i.platform;
    },
    get arch() {
      return i.arch;
    },
    get env() {
      return i.env;
    },
    cwd() {
      return i.cwd();
    }
  };
} else typeof process < "u" && typeof ((iMe = process == null ? void 0 : process.versions) == null ? void 0 : iMe.node) == "string" ? zN = {
  get platform() {
    return process.platform;
  },
  get arch() {
    return process.arch;
  },
  get env() {
    return vxe;
  },
  cwd() {
    return vxe.VSCODE_CWD || process.cwd();
  }
} : zN = {
  // Supported
  get platform() {
    return Za ? "win32" : Kn ? "darwin" : "linux";
  },
  get arch() {
  },
  // Unsupported
  get env() {
    return {};
  },
  cwd() {
    return "/";
  }
};
const IV = zN.cwd, rie = zN.env, vnt = zN.platform, ynt = 65, Cnt = 97, wnt = 90, Snt = 122, Nx = 46, mc = 47, vh = 92, Iv = 58, Ent = 63;
class nPe extends Error {
  constructor(e, t, n) {
    let r;
    typeof t == "string" && t.indexOf("not ") === 0 ? (r = "must not be", t = t.replace(/^not /, "")) : r = "must be";
    const s = e.indexOf(".") !== -1 ? "property" : "argument";
    let o = `The "${e}" ${s} ${r} of type ${t}`;
    o += `. Received type ${typeof n}`, super(o), this.code = "ERR_INVALID_ARG_TYPE";
  }
}
function xnt(i, e) {
  if (i === null || typeof i != "object")
    throw new nPe(e, "Object", i);
}
function Da(i, e) {
  if (typeof i != "string")
    throw new nPe(e, "string", i);
}
const Cw = vnt === "win32";
function cr(i) {
  return i === mc || i === vh;
}
function sie(i) {
  return i === mc;
}
function Nv(i) {
  return i >= ynt && i <= wnt || i >= Cnt && i <= Snt;
}
function NV(i, e, t, n) {
  let r = "", s = 0, o = -1, a = 0, l = 0;
  for (let c = 0; c <= i.length; ++c) {
    if (c < i.length)
      l = i.charCodeAt(c);
    else {
      if (n(l))
        break;
      l = mc;
    }
    if (n(l)) {
      if (!(o === c - 1 || a === 1)) if (a === 2) {
        if (r.length < 2 || s !== 2 || r.charCodeAt(r.length - 1) !== Nx || r.charCodeAt(r.length - 2) !== Nx) {
          if (r.length > 2) {
            const u = r.lastIndexOf(t);
            u === -1 ? (r = "", s = 0) : (r = r.slice(0, u), s = r.length - 1 - r.lastIndexOf(t)), o = c, a = 0;
            continue;
          } else if (r.length !== 0) {
            r = "", s = 0, o = c, a = 0;
            continue;
          }
        }
        e && (r += r.length > 0 ? `${t}..` : "..", s = 2);
      } else
        r.length > 0 ? r += `${t}${i.slice(o + 1, c)}` : r = i.slice(o + 1, c), s = c - o - 1;
      o = c, a = 0;
    } else l === Nx && a !== -1 ? ++a : a = -1;
  }
  return r;
}
function Lnt(i) {
  return i ? `${i[0] === "." ? "" : "."}${i}` : "";
}
function iPe(i, e) {
  xnt(e, "pathObject");
  const t = e.dir || e.root, n = e.base || `${e.name || ""}${Lnt(e.ext)}`;
  return t ? t === e.root ? `${t}${n}` : `${t}${i}${n}` : n;
}
const Od = {
  // path.resolve([from ...], to)
  resolve(...i) {
    let e = "", t = "", n = !1;
    for (let r = i.length - 1; r >= -1; r--) {
      let s;
      if (r >= 0) {
        if (s = i[r], Da(s, `paths[${r}]`), s.length === 0)
          continue;
      } else e.length === 0 ? s = IV() : (s = rie[`=${e}`] || IV(), (s === void 0 || s.slice(0, 2).toLowerCase() !== e.toLowerCase() && s.charCodeAt(2) === vh) && (s = `${e}\\`));
      const o = s.length;
      let a = 0, l = "", c = !1;
      const u = s.charCodeAt(0);
      if (o === 1)
        cr(u) && (a = 1, c = !0);
      else if (cr(u))
        if (c = !0, cr(s.charCodeAt(1))) {
          let d = 2, h = d;
          for (; d < o && !cr(s.charCodeAt(d)); )
            d++;
          if (d < o && d !== h) {
            const g = s.slice(h, d);
            for (h = d; d < o && cr(s.charCodeAt(d)); )
              d++;
            if (d < o && d !== h) {
              for (h = d; d < o && !cr(s.charCodeAt(d)); )
                d++;
              (d === o || d !== h) && (l = `\\\\${g}\\${s.slice(h, d)}`, a = d);
            }
          }
        } else
          a = 1;
      else Nv(u) && s.charCodeAt(1) === Iv && (l = s.slice(0, 2), a = 2, o > 2 && cr(s.charCodeAt(2)) && (c = !0, a = 3));
      if (l.length > 0)
        if (e.length > 0) {
          if (l.toLowerCase() !== e.toLowerCase())
            continue;
        } else
          e = l;
      if (n) {
        if (e.length > 0)
          break;
      } else if (t = `${s.slice(a)}\\${t}`, n = c, c && e.length > 0)
        break;
    }
    return t = NV(t, !n, "\\", cr), n ? `${e}\\${t}` : `${e}${t}` || ".";
  },
  normalize(i) {
    Da(i, "path");
    const e = i.length;
    if (e === 0)
      return ".";
    let t = 0, n, r = !1;
    const s = i.charCodeAt(0);
    if (e === 1)
      return sie(s) ? "\\" : i;
    if (cr(s))
      if (r = !0, cr(i.charCodeAt(1))) {
        let a = 2, l = a;
        for (; a < e && !cr(i.charCodeAt(a)); )
          a++;
        if (a < e && a !== l) {
          const c = i.slice(l, a);
          for (l = a; a < e && cr(i.charCodeAt(a)); )
            a++;
          if (a < e && a !== l) {
            for (l = a; a < e && !cr(i.charCodeAt(a)); )
              a++;
            if (a === e)
              return `\\\\${c}\\${i.slice(l)}\\`;
            a !== l && (n = `\\\\${c}\\${i.slice(l, a)}`, t = a);
          }
        }
      } else
        t = 1;
    else Nv(s) && i.charCodeAt(1) === Iv && (n = i.slice(0, 2), t = 2, e > 2 && cr(i.charCodeAt(2)) && (r = !0, t = 3));
    let o = t < e ? NV(i.slice(t), !r, "\\", cr) : "";
    if (o.length === 0 && !r && (o = "."), o.length > 0 && cr(i.charCodeAt(e - 1)) && (o += "\\"), !r && n === void 0 && i.includes(":")) {
      if (o.length >= 2 && Nv(o.charCodeAt(0)) && o.charCodeAt(1) === Iv)
        return `.\\${o}`;
      let a = i.indexOf(":");
      do
        if (a === e - 1 || cr(i.charCodeAt(a + 1)))
          return `.\\${o}`;
      while ((a = i.indexOf(":", a + 1)) !== -1);
    }
    return n === void 0 ? r ? `\\${o}` : o : r ? `${n}\\${o}` : `${n}${o}`;
  },
  isAbsolute(i) {
    Da(i, "path");
    const e = i.length;
    if (e === 0)
      return !1;
    const t = i.charCodeAt(0);
    return cr(t) || // Possible device root
    e > 2 && Nv(t) && i.charCodeAt(1) === Iv && cr(i.charCodeAt(2));
  },
  join(...i) {
    if (i.length === 0)
      return ".";
    let e, t;
    for (let s = 0; s < i.length; ++s) {
      const o = i[s];
      Da(o, "path"), o.length > 0 && (e === void 0 ? e = t = o : e += `\\${o}`);
    }
    if (e === void 0)
      return ".";
    let n = !0, r = 0;
    if (typeof t == "string" && cr(t.charCodeAt(0))) {
      ++r;
      const s = t.length;
      s > 1 && cr(t.charCodeAt(1)) && (++r, s > 2 && (cr(t.charCodeAt(2)) ? ++r : n = !1));
    }
    if (n) {
      for (; r < e.length && cr(e.charCodeAt(r)); )
        r++;
      r >= 2 && (e = `\\${e.slice(r)}`);
    }
    return Od.normalize(e);
  },
  // It will solve the relative path from `from` to `to`, for instance:
  //  from = 'C:\\orandea\\test\\aaa'
  //  to = 'C:\\orandea\\impl\\bbb'
  // The output of the function should be: '..\\..\\impl\\bbb'
  relative(i, e) {
    if (Da(i, "from"), Da(e, "to"), i === e)
      return "";
    const t = Od.resolve(i), n = Od.resolve(e);
    if (t === n || (i = t.toLowerCase(), e = n.toLowerCase(), i === e))
      return "";
    if (t.length !== i.length || n.length !== e.length) {
      const m = t.split("\\"), _ = n.split("\\");
      m[m.length - 1] === "" && m.pop(), _[_.length - 1] === "" && _.pop();
      const v = m.length, w = _.length, E = v < w ? v : w;
      let L;
      for (L = 0; L < E && m[L].toLowerCase() === _[L].toLowerCase(); L++)
        ;
      return L === 0 ? n : L === E ? w > E ? _.slice(L).join("\\") : v > E ? "..\\".repeat(v - 1 - L) + ".." : "" : "..\\".repeat(v - L) + _.slice(L).join("\\");
    }
    let r = 0;
    for (; r < i.length && i.charCodeAt(r) === vh; )
      r++;
    let s = i.length;
    for (; s - 1 > r && i.charCodeAt(s - 1) === vh; )
      s--;
    const o = s - r;
    let a = 0;
    for (; a < e.length && e.charCodeAt(a) === vh; )
      a++;
    let l = e.length;
    for (; l - 1 > a && e.charCodeAt(l - 1) === vh; )
      l--;
    const c = l - a, u = o < c ? o : c;
    let d = -1, h = 0;
    for (; h < u; h++) {
      const m = i.charCodeAt(r + h);
      if (m !== e.charCodeAt(a + h))
        break;
      m === vh && (d = h);
    }
    if (h !== u) {
      if (d === -1)
        return n;
    } else {
      if (c > u) {
        if (e.charCodeAt(a + h) === vh)
          return n.slice(a + h + 1);
        if (h === 2)
          return n.slice(a + h);
      }
      o > u && (i.charCodeAt(r + h) === vh ? d = h : h === 2 && (d = 3)), d === -1 && (d = 0);
    }
    let g = "";
    for (h = r + d + 1; h <= s; ++h)
      (h === s || i.charCodeAt(h) === vh) && (g += g.length === 0 ? ".." : "\\..");
    return a += d, g.length > 0 ? `${g}${n.slice(a, l)}` : (n.charCodeAt(a) === vh && ++a, n.slice(a, l));
  },
  toNamespacedPath(i) {
    if (typeof i != "string" || i.length === 0)
      return i;
    const e = Od.resolve(i);
    if (e.length <= 2)
      return i;
    if (e.charCodeAt(0) === vh) {
      if (e.charCodeAt(1) === vh) {
        const t = e.charCodeAt(2);
        if (t !== Ent && t !== Nx)
          return `\\\\?\\UNC\\${e.slice(2)}`;
      }
    } else if (Nv(e.charCodeAt(0)) && e.charCodeAt(1) === Iv && e.charCodeAt(2) === vh)
      return `\\\\?\\${e}`;
    return e;
  },
  dirname(i) {
    Da(i, "path");
    const e = i.length;
    if (e === 0)
      return ".";
    let t = -1, n = 0;
    const r = i.charCodeAt(0);
    if (e === 1)
      return cr(r) ? i : ".";
    if (cr(r)) {
      if (t = n = 1, cr(i.charCodeAt(1))) {
        let a = 2, l = a;
        for (; a < e && !cr(i.charCodeAt(a)); )
          a++;
        if (a < e && a !== l) {
          for (l = a; a < e && cr(i.charCodeAt(a)); )
            a++;
          if (a < e && a !== l) {
            for (l = a; a < e && !cr(i.charCodeAt(a)); )
              a++;
            if (a === e)
              return i;
            a !== l && (t = n = a + 1);
          }
        }
      }
    } else Nv(r) && i.charCodeAt(1) === Iv && (t = e > 2 && cr(i.charCodeAt(2)) ? 3 : 2, n = t);
    let s = -1, o = !0;
    for (let a = e - 1; a >= n; --a)
      if (cr(i.charCodeAt(a))) {
        if (!o) {
          s = a;
          break;
        }
      } else
        o = !1;
    if (s === -1) {
      if (t === -1)
        return ".";
      s = t;
    }
    return i.slice(0, s);
  },
  basename(i, e) {
    e !== void 0 && Da(e, "suffix"), Da(i, "path");
    let t = 0, n = -1, r = !0, s;
    if (i.length >= 2 && Nv(i.charCodeAt(0)) && i.charCodeAt(1) === Iv && (t = 2), e !== void 0 && e.length > 0 && e.length <= i.length) {
      if (e === i)
        return "";
      let o = e.length - 1, a = -1;
      for (s = i.length - 1; s >= t; --s) {
        const l = i.charCodeAt(s);
        if (cr(l)) {
          if (!r) {
            t = s + 1;
            break;
          }
        } else
          a === -1 && (r = !1, a = s + 1), o >= 0 && (l === e.charCodeAt(o) ? --o === -1 && (n = s) : (o = -1, n = a));
      }
      return t === n ? n = a : n === -1 && (n = i.length), i.slice(t, n);
    }
    for (s = i.length - 1; s >= t; --s)
      if (cr(i.charCodeAt(s))) {
        if (!r) {
          t = s + 1;
          break;
        }
      } else n === -1 && (r = !1, n = s + 1);
    return n === -1 ? "" : i.slice(t, n);
  },
  extname(i) {
    Da(i, "path");
    let e = 0, t = -1, n = 0, r = -1, s = !0, o = 0;
    i.length >= 2 && i.charCodeAt(1) === Iv && Nv(i.charCodeAt(0)) && (e = n = 2);
    for (let a = i.length - 1; a >= e; --a) {
      const l = i.charCodeAt(a);
      if (cr(l)) {
        if (!s) {
          n = a + 1;
          break;
        }
        continue;
      }
      r === -1 && (s = !1, r = a + 1), l === Nx ? t === -1 ? t = a : o !== 1 && (o = 1) : t !== -1 && (o = -1);
    }
    return t === -1 || r === -1 || // We saw a non-dot character immediately before the dot
    o === 0 || // The (right-most) trimmed path component is exactly '..'
    o === 1 && t === r - 1 && t === n + 1 ? "" : i.slice(t, r);
  },
  format: iPe.bind(null, "\\"),
  parse(i) {
    Da(i, "path");
    const e = { root: "", dir: "", base: "", ext: "", name: "" };
    if (i.length === 0)
      return e;
    const t = i.length;
    let n = 0, r = i.charCodeAt(0);
    if (t === 1)
      return cr(r) ? (e.root = e.dir = i, e) : (e.base = e.name = i, e);
    if (cr(r)) {
      if (n = 1, cr(i.charCodeAt(1))) {
        let d = 2, h = d;
        for (; d < t && !cr(i.charCodeAt(d)); )
          d++;
        if (d < t && d !== h) {
          for (h = d; d < t && cr(i.charCodeAt(d)); )
            d++;
          if (d < t && d !== h) {
            for (h = d; d < t && !cr(i.charCodeAt(d)); )
              d++;
            d === t ? n = d : d !== h && (n = d + 1);
          }
        }
      }
    } else if (Nv(r) && i.charCodeAt(1) === Iv) {
      if (t <= 2)
        return e.root = e.dir = i, e;
      if (n = 2, cr(i.charCodeAt(2))) {
        if (t === 3)
          return e.root = e.dir = i, e;
        n = 3;
      }
    }
    n > 0 && (e.root = i.slice(0, n));
    let s = -1, o = n, a = -1, l = !0, c = i.length - 1, u = 0;
    for (; c >= n; --c) {
      if (r = i.charCodeAt(c), cr(r)) {
        if (!l) {
          o = c + 1;
          break;
        }
        continue;
      }
      a === -1 && (l = !1, a = c + 1), r === Nx ? s === -1 ? s = c : u !== 1 && (u = 1) : s !== -1 && (u = -1);
    }
    return a !== -1 && (s === -1 || // We saw a non-dot character immediately before the dot
    u === 0 || // The (right-most) trimmed path component is exactly '..'
    u === 1 && s === a - 1 && s === o + 1 ? e.base = e.name = i.slice(o, a) : (e.name = i.slice(o, s), e.base = i.slice(o, a), e.ext = i.slice(s, a))), o > 0 && o !== n ? e.dir = i.slice(0, o - 1) : e.dir = e.root, e;
  },
  sep: "\\",
  delimiter: ";",
  win32: null,
  posix: null
}, Tnt = (() => {
  if (Cw) {
    const i = /\\/g;
    return () => {
      const e = IV().replace(i, "/");
      return e.slice(e.indexOf("/"));
    };
  }
  return () => IV();
})(), Ho = {
  // path.resolve([from ...], to)
  resolve(...i) {
    let e = "", t = !1;
    for (let n = i.length - 1; n >= 0 && !t; n--) {
      const r = i[n];
      Da(r, `paths[${n}]`), r.length !== 0 && (e = `${r}/${e}`, t = r.charCodeAt(0) === mc);
    }
    if (!t) {
      const n = Tnt();
      e = `${n}/${e}`, t = n.charCodeAt(0) === mc;
    }
    return e = NV(e, !t, "/", sie), t ? `/${e}` : e.length > 0 ? e : ".";
  },
  normalize(i) {
    if (Da(i, "path"), i.length === 0)
      return ".";
    const e = i.charCodeAt(0) === mc, t = i.charCodeAt(i.length - 1) === mc;
    return i = NV(i, !e, "/", sie), i.length === 0 ? e ? "/" : t ? "./" : "." : (t && (i += "/"), e ? `/${i}` : i);
  },
  isAbsolute(i) {
    return Da(i, "path"), i.length > 0 && i.charCodeAt(0) === mc;
  },
  join(...i) {
    if (i.length === 0)
      return ".";
    const e = [];
    for (let t = 0; t < i.length; ++t) {
      const n = i[t];
      Da(n, "path"), n.length > 0 && e.push(n);
    }
    return e.length === 0 ? "." : Ho.normalize(e.join("/"));
  },
  relative(i, e) {
    if (Da(i, "from"), Da(e, "to"), i === e || (i = Ho.resolve(i), e = Ho.resolve(e), i === e))
      return "";
    const t = 1, n = i.length, r = n - t, s = 1, o = e.length - s, a = r < o ? r : o;
    let l = -1, c = 0;
    for (; c < a; c++) {
      const d = i.charCodeAt(t + c);
      if (d !== e.charCodeAt(s + c))
        break;
      d === mc && (l = c);
    }
    if (c === a)
      if (o > a) {
        if (e.charCodeAt(s + c) === mc)
          return e.slice(s + c + 1);
        if (c === 0)
          return e.slice(s + c);
      } else r > a && (i.charCodeAt(t + c) === mc ? l = c : c === 0 && (l = 0));
    let u = "";
    for (c = t + l + 1; c <= n; ++c)
      (c === n || i.charCodeAt(c) === mc) && (u += u.length === 0 ? ".." : "/..");
    return `${u}${e.slice(s + l)}`;
  },
  toNamespacedPath(i) {
    return i;
  },
  dirname(i) {
    if (Da(i, "path"), i.length === 0)
      return ".";
    const e = i.charCodeAt(0) === mc;
    let t = -1, n = !0;
    for (let r = i.length - 1; r >= 1; --r)
      if (i.charCodeAt(r) === mc) {
        if (!n) {
          t = r;
          break;
        }
      } else
        n = !1;
    return t === -1 ? e ? "/" : "." : e && t === 1 ? "//" : i.slice(0, t);
  },
  basename(i, e) {
    e !== void 0 && Da(e, "suffix"), Da(i, "path");
    let t = 0, n = -1, r = !0, s;
    if (e !== void 0 && e.length > 0 && e.length <= i.length) {
      if (e === i)
        return "";
      let o = e.length - 1, a = -1;
      for (s = i.length - 1; s >= 0; --s) {
        const l = i.charCodeAt(s);
        if (l === mc) {
          if (!r) {
            t = s + 1;
            break;
          }
        } else
          a === -1 && (r = !1, a = s + 1), o >= 0 && (l === e.charCodeAt(o) ? --o === -1 && (n = s) : (o = -1, n = a));
      }
      return t === n ? n = a : n === -1 && (n = i.length), i.slice(t, n);
    }
    for (s = i.length - 1; s >= 0; --s)
      if (i.charCodeAt(s) === mc) {
        if (!r) {
          t = s + 1;
          break;
        }
      } else n === -1 && (r = !1, n = s + 1);
    return n === -1 ? "" : i.slice(t, n);
  },
  extname(i) {
    Da(i, "path");
    let e = -1, t = 0, n = -1, r = !0, s = 0;
    for (let o = i.length - 1; o >= 0; --o) {
      const a = i[o];
      if (a === "/") {
        if (!r) {
          t = o + 1;
          break;
        }
        continue;
      }
      n === -1 && (r = !1, n = o + 1), a === "." ? e === -1 ? e = o : s !== 1 && (s = 1) : e !== -1 && (s = -1);
    }
    return e === -1 || n === -1 || // We saw a non-dot character immediately before the dot
    s === 0 || // The (right-most) trimmed path component is exactly '..'
    s === 1 && e === n - 1 && e === t + 1 ? "" : i.slice(e, n);
  },
  format: iPe.bind(null, "/"),
  parse(i) {
    Da(i, "path");
    const e = { root: "", dir: "", base: "", ext: "", name: "" };
    if (i.length === 0)
      return e;
    const t = i.charCodeAt(0) === mc;
    let n;
    t ? (e.root = "/", n = 1) : n = 0;
    let r = -1, s = 0, o = -1, a = !0, l = i.length - 1, c = 0;
    for (; l >= n; --l) {
      const u = i.charCodeAt(l);
      if (u === mc) {
        if (!a) {
          s = l + 1;
          break;
        }
        continue;
      }
      o === -1 && (a = !1, o = l + 1), u === Nx ? r === -1 ? r = l : c !== 1 && (c = 1) : r !== -1 && (c = -1);
    }
    if (o !== -1) {
      const u = s === 0 && t ? 1 : s;
      r === -1 || // We saw a non-dot character immediately before the dot
      c === 0 || // The (right-most) trimmed path component is exactly '..'
      c === 1 && r === o - 1 && r === s + 1 ? e.base = e.name = i.slice(u, o) : (e.name = i.slice(u, r), e.base = i.slice(u, o), e.ext = i.slice(r, o));
    }
    return s > 0 ? e.dir = i.slice(0, s - 1) : t && (e.dir = "/"), e;
  },
  sep: "/",
  delimiter: ":",
  win32: null,
  posix: null
};
Ho.win32 = Od.win32 = Od;
Ho.posix = Od.posix = Ho;
const rPe = Cw ? Od.normalize : Ho.normalize, knt = Cw ? Od.resolve : Ho.resolve, Dnt = Cw ? Od.relative : Ho.relative, sPe = Cw ? Od.dirname : Ho.dirname, E1 = Cw ? Od.basename : Ho.basename, Int = Cw ? Od.extname : Ho.extname, im = Cw ? Od.sep : Ho.sep, Nnt = /^\w[\w\d+.-]*$/, Rnt = /^\//, Ant = /^\/\//;
function Ont(i, e) {
  if (!i.scheme && e)
    throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${i.authority}", path: "${i.path}", query: "${i.query}", fragment: "${i.fragment}"}`);
  if (i.scheme && !Nnt.test(i.scheme))
    throw new Error("[UriError]: Scheme contains illegal characters.");
  if (i.path) {
    if (i.authority) {
      if (!Rnt.test(i.path))
        throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
    } else if (Ant.test(i.path))
      throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
  }
}
function Mnt(i, e) {
  return !i && !e ? "file" : i;
}
function Pnt(i, e) {
  switch (i) {
    case "https":
    case "http":
    case "file":
      e ? e[0] !== Vp && (e = Vp + e) : e = Vp;
      break;
  }
  return e;
}
const To = "", Vp = "/", Fnt = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
class Ht {
  static isUri(e) {
    return e instanceof Ht ? !0 : !e || typeof e != "object" ? !1 : typeof e.authority == "string" && typeof e.fragment == "string" && typeof e.path == "string" && typeof e.query == "string" && typeof e.scheme == "string" && typeof e.fsPath == "string" && typeof e.with == "function" && typeof e.toString == "function";
  }
  /**
   * @internal
   */
  constructor(e, t, n, r, s, o = !1) {
    typeof e == "object" ? (this.scheme = e.scheme || To, this.authority = e.authority || To, this.path = e.path || To, this.query = e.query || To, this.fragment = e.fragment || To) : (this.scheme = Mnt(e, o), this.authority = t || To, this.path = Pnt(this.scheme, n || To), this.query = r || To, this.fragment = s || To, Ont(this, o));
  }
  // ---- filesystem path -----------------------
  /**
   * Returns a string representing the corresponding file system path of this URI.
   * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
   * platform specific path separator.
   *
   * * Will *not* validate the path for invalid characters and semantics.
   * * Will *not* look at the scheme of this URI.
   * * The result shall *not* be used for display purposes but for accessing a file on disk.
   *
   *
   * The *difference* to `URI#path` is the use of the platform specific separator and the handling
   * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
   *
   * ```ts
      const u = URI.parse('file://server/c$/folder/file.txt')
      u.authority === 'server'
      u.path === '/shares/c$/file.txt'
      u.fsPath === '\\server\c$\folder\file.txt'
  ```
   *
   * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
   * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
   * with URIs that represent files on disk (`file` scheme).
   */
  get fsPath() {
    return RV(this, !1);
  }
  // ---- modify to new -------------------------
  with(e) {
    if (!e)
      return this;
    let { scheme: t, authority: n, path: r, query: s, fragment: o } = e;
    return t === void 0 ? t = this.scheme : t === null && (t = To), n === void 0 ? n = this.authority : n === null && (n = To), r === void 0 ? r = this.path : r === null && (r = To), s === void 0 ? s = this.query : s === null && (s = To), o === void 0 ? o = this.fragment : o === null && (o = To), t === this.scheme && n === this.authority && r === this.path && s === this.query && o === this.fragment ? this : new dI(t, n, r, s, o);
  }
  // ---- parse & validate ------------------------
  /**
   * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,
   * `file:///usr/home`, or `scheme:with/path`.
   *
   * @param value A string which represents an URI (see `URI#toString`).
   */
  static parse(e, t = !1) {
    const n = Fnt.exec(e);
    return n ? new dI(n[2] || To, D7(n[4] || To), D7(n[5] || To), D7(n[7] || To), D7(n[9] || To), t) : new dI(To, To, To, To, To);
  }
  /**
   * Creates a new URI from a file system path, e.g. `c:\my\files`,
   * `/usr/home`, or `\\server\share\some\path`.
   *
   * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
   * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
   * `URI.parse('file://' + path)` because the path might contain characters that are
   * interpreted (# and ?). See the following sample:
   * ```ts
  const good = URI.file('/coding/c#/project1');
  good.scheme === 'file';
  good.path === '/coding/c#/project1';
  good.fragment === '';
  const bad = URI.parse('file://' + '/coding/c#/project1');
  bad.scheme === 'file';
  bad.path === '/coding/c'; // path is now broken
  bad.fragment === '/project1';
  ```
   *
   * @param path A file system path (see `URI#fsPath`)
   */
  static file(e) {
    let t = To;
    if (Za && (e = e.replace(/\\/g, Vp)), e[0] === Vp && e[1] === Vp) {
      const n = e.indexOf(Vp, 2);
      n === -1 ? (t = e.substring(2), e = Vp) : (t = e.substring(2, n), e = e.substring(n) || Vp);
    }
    return new dI("file", t, e, To, To);
  }
  /**
   * Creates new URI from uri components.
   *
   * Unless `strict` is `true` the scheme is defaults to be `file`. This function performs
   * validation and should be used for untrusted uri components retrieved from storage,
   * user input, command arguments etc
   */
  static from(e, t) {
    return new dI(e.scheme, e.authority, e.path, e.query, e.fragment, t);
  }
  /**
   * Join a URI path with path fragments and normalizes the resulting path.
   *
   * @param uri The input URI.
   * @param pathFragment The path fragment to add to the URI path.
   * @returns The resulting URI.
   */
  static joinPath(e, ...t) {
    if (!e.path)
      throw new Error("[UriError]: cannot call joinPath on URI without path");
    let n;
    return Za && e.scheme === "file" ? n = Ht.file(Od.join(RV(e, !0), ...t)).path : n = Ho.join(e.path, ...t), e.with({ path: n });
  }
  // ---- printing/externalize ---------------------------
  /**
   * Creates a string representation for this URI. It's guaranteed that calling
   * `URI.parse` with the result of this function creates an URI which is equal
   * to this URI.
   *
   * * The result shall *not* be used for display purposes but for externalization or transport.
   * * The result will be encoded using the percentage encoding and encoding happens mostly
   * ignore the scheme-specific encoding rules.
   *
   * @param skipEncoding Do not encode the result, default is `false`
   */
  toString(e = !1) {
    return oie(this, e);
  }
  toJSON() {
    return this;
  }
  static revive(e) {
    if (e) {
      if (e instanceof Ht)
        return e;
      {
        const t = new dI(e);
        return t._formatted = e.external ?? null, t._fsPath = e._sep === oPe ? e.fsPath ?? null : null, t;
      }
    } else return e;
  }
}
const oPe = Za ? 1 : void 0;
let dI = class extends Ht {
  constructor() {
    super(...arguments), this._formatted = null, this._fsPath = null;
  }
  get fsPath() {
    return this._fsPath || (this._fsPath = RV(this, !1)), this._fsPath;
  }
  toString(e = !1) {
    return e ? oie(this, !0) : (this._formatted || (this._formatted = oie(this, !1)), this._formatted);
  }
  toJSON() {
    const e = {
      $mid: 1
      /* MarshalledId.Uri */
    };
    return this._fsPath && (e.fsPath = this._fsPath, e._sep = oPe), this._formatted && (e.external = this._formatted), this.path && (e.path = this.path), this.scheme && (e.scheme = this.scheme), this.authority && (e.authority = this.authority), this.query && (e.query = this.query), this.fragment && (e.fragment = this.fragment), e;
  }
};
const aPe = {
  58: "%3A",
  // gen-delims
  47: "%2F",
  63: "%3F",
  35: "%23",
  91: "%5B",
  93: "%5D",
  64: "%40",
  33: "%21",
  // sub-delims
  36: "%24",
  38: "%26",
  39: "%27",
  40: "%28",
  41: "%29",
  42: "%2A",
  43: "%2B",
  44: "%2C",
  59: "%3B",
  61: "%3D",
  32: "%20"
};
function yxe(i, e, t) {
  let n, r = -1;
  for (let s = 0; s < i.length; s++) {
    const o = i.charCodeAt(s);
    if (o >= 97 && o <= 122 || o >= 65 && o <= 90 || o >= 48 && o <= 57 || o === 45 || o === 46 || o === 95 || o === 126 || e && o === 47 || t && o === 91 || t && o === 93 || t && o === 58)
      r !== -1 && (n += encodeURIComponent(i.substring(r, s)), r = -1), n !== void 0 && (n += i.charAt(s));
    else {
      n === void 0 && (n = i.substr(0, s));
      const a = aPe[o];
      a !== void 0 ? (r !== -1 && (n += encodeURIComponent(i.substring(r, s)), r = -1), n += a) : r === -1 && (r = s);
    }
  }
  return r !== -1 && (n += encodeURIComponent(i.substring(r))), n !== void 0 ? n : i;
}
function Bnt(i) {
  let e;
  for (let t = 0; t < i.length; t++) {
    const n = i.charCodeAt(t);
    n === 35 || n === 63 ? (e === void 0 && (e = i.substr(0, t)), e += aPe[n]) : e !== void 0 && (e += i[t]);
  }
  return e !== void 0 ? e : i;
}
function RV(i, e) {
  let t;
  return i.authority && i.path.length > 1 && i.scheme === "file" ? t = `//${i.authority}${i.path}` : i.path.charCodeAt(0) === 47 && (i.path.charCodeAt(1) >= 65 && i.path.charCodeAt(1) <= 90 || i.path.charCodeAt(1) >= 97 && i.path.charCodeAt(1) <= 122) && i.path.charCodeAt(2) === 58 ? e ? t = i.path.substr(1) : t = i.path[1].toLowerCase() + i.path.substr(2) : t = i.path, Za && (t = t.replace(/\//g, "\\")), t;
}
function oie(i, e) {
  const t = e ? Bnt : yxe;
  let n = "", { scheme: r, authority: s, path: o, query: a, fragment: l } = i;
  if (r && (n += r, n += ":"), (s || r === "file") && (n += Vp, n += Vp), s) {
    let c = s.indexOf("@");
    if (c !== -1) {
      const u = s.substr(0, c);
      s = s.substr(c + 1), c = u.lastIndexOf(":"), c === -1 ? n += t(u, !1, !1) : (n += t(u.substr(0, c), !1, !1), n += ":", n += t(u.substr(c + 1), !1, !0)), n += "@";
    }
    s = s.toLowerCase(), c = s.lastIndexOf(":"), c === -1 ? n += t(s, !1, !0) : (n += t(s.substr(0, c), !1, !0), n += s.substr(c));
  }
  if (o) {
    if (o.length >= 3 && o.charCodeAt(0) === 47 && o.charCodeAt(2) === 58) {
      const c = o.charCodeAt(1);
      c >= 65 && c <= 90 && (o = `/${String.fromCharCode(c + 32)}:${o.substr(3)}`);
    } else if (o.length >= 2 && o.charCodeAt(1) === 58) {
      const c = o.charCodeAt(0);
      c >= 65 && c <= 90 && (o = `${String.fromCharCode(c + 32)}:${o.substr(2)}`);
    }
    n += t(o, !0, !1);
  }
  return a && (n += "?", n += t(a, !1, !1)), l && (n += "#", n += e ? l : yxe(l, !1, !1)), n;
}
function lPe(i) {
  try {
    return decodeURIComponent(i);
  } catch {
    return i.length > 3 ? i.substr(0, 3) + lPe(i.substr(3)) : i;
  }
}
const Cxe = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
function D7(i) {
  return i.match(Cxe) ? i.replace(Cxe, (e) => lPe(e)) : i;
}
var Yt;
(function(i) {
  i.inMemory = "inmemory", i.vscode = "vscode", i.internal = "private", i.walkThrough = "walkThrough", i.walkThroughSnippet = "walkThroughSnippet", i.http = "http", i.https = "https", i.file = "file", i.mailto = "mailto", i.untitled = "untitled", i.data = "data", i.command = "command", i.vscodeRemote = "vscode-remote", i.vscodeRemoteResource = "vscode-remote-resource", i.vscodeManagedRemoteResource = "vscode-managed-remote-resource", i.vscodeUserData = "vscode-userdata", i.vscodeCustomEditor = "vscode-custom-editor", i.vscodeNotebookCell = "vscode-notebook-cell", i.vscodeNotebookCellMetadata = "vscode-notebook-cell-metadata", i.vscodeNotebookCellMetadataDiff = "vscode-notebook-cell-metadata-diff", i.vscodeNotebookCellOutput = "vscode-notebook-cell-output", i.vscodeNotebookCellOutputDiff = "vscode-notebook-cell-output-diff", i.vscodeNotebookMetadata = "vscode-notebook-metadata", i.vscodeInteractiveInput = "vscode-interactive-input", i.vscodeSettings = "vscode-settings", i.vscodeWorkspaceTrust = "vscode-workspace-trust", i.vscodeTerminal = "vscode-terminal", i.vscodeChatCodeBlock = "vscode-chat-code-block", i.vscodeChatCodeCompareBlock = "vscode-chat-code-compare-block", i.vscodeChatEditor = "vscode-chat-editor", i.vscodeChatInput = "chatSessionInput", i.vscodeChatSession = "vscode-chat-session", i.webviewPanel = "webview-panel", i.vscodeWebview = "vscode-webview", i.extension = "extension", i.vscodeFileResource = "vscode-file", i.tmp = "tmp", i.vsls = "vsls", i.vscodeSourceControl = "vscode-scm", i.commentsInput = "comment", i.codeSetting = "code-setting", i.outputChannel = "output", i.accessibleView = "accessible-view", i.chatEditingSnapshotScheme = "chat-editing-snapshot-text-model", i.chatEditingModel = "chat-editing-text-model";
})(Yt || (Yt = {}));
function mq(i, e) {
  return Ht.isUri(i) ? tN(i.scheme, e) : Phe(i, e + ":");
}
function aie(i, ...e) {
  return e.some((t) => mq(i, t));
}
const Hnt = "tkn";
class Wnt {
  constructor() {
    this._hosts = /* @__PURE__ */ Object.create(null), this._ports = /* @__PURE__ */ Object.create(null), this._connectionTokens = /* @__PURE__ */ Object.create(null), this._preferredWebSchema = "http", this._delegate = null, this._serverRootPath = "/";
  }
  setPreferredWebSchema(e) {
    this._preferredWebSchema = e;
  }
  get _remoteResourcesPath() {
    return Ho.join(this._serverRootPath, Yt.vscodeRemoteResource);
  }
  rewrite(e) {
    if (this._delegate)
      try {
        return this._delegate(e);
      } catch (a) {
        return fn(a), e;
      }
    const t = e.authority;
    let n = this._hosts[t];
    n && n.indexOf(":") !== -1 && n.indexOf("[") === -1 && (n = `[${n}]`);
    const r = this._ports[t], s = this._connectionTokens[t];
    let o = `path=${encodeURIComponent(e.path)}`;
    return typeof s == "string" && (o += `&${Hnt}=${encodeURIComponent(s)}`), Ht.from({
      scheme: Lb ? this._preferredWebSchema : Yt.vscodeRemoteResource,
      authority: `${n}:${r}`,
      path: this._remoteResourcesPath,
      query: o
    });
  }
}
const cPe = new Wnt(), Vnt = "vscode-app", D3 = class D3 {
  /**
   * Returns a URI to use in contexts where the browser is responsible
   * for loading (e.g. fetch()) or when used within the DOM.
   *
   * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.
   */
  uriToBrowserUri(e) {
    return e.scheme === Yt.vscodeRemote ? cPe.rewrite(e) : (
      // ...only ever for `file` resources
      e.scheme === Yt.file && // ...and we run in native environments
      (hm || // ...or web worker extensions on desktop
      Ctt === `${Yt.vscodeFileResource}://${D3.FALLBACK_AUTHORITY}`) ? e.with({
        scheme: Yt.vscodeFileResource,
        // We need to provide an authority here so that it can serve
        // as origin for network and loading matters in chromium.
        // If the URI is not coming with an authority already, we
        // add our own
        authority: e.authority || D3.FALLBACK_AUTHORITY,
        query: null,
        fragment: null
      }) : e
    );
  }
};
D3.FALLBACK_AUTHORITY = Vnt;
let lie = D3;
const uPe = new lie();
var cie;
(function(i) {
  const e = /* @__PURE__ */ new Map([
    ["1", { "Cross-Origin-Opener-Policy": "same-origin" }],
    ["2", { "Cross-Origin-Embedder-Policy": "require-corp" }],
    ["3", { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp" }]
  ]);
  i.CoopAndCoep = Object.freeze(e.get("3"));
  const t = "vscode-coi";
  function n(s) {
    let o;
    typeof s == "string" ? o = new URL(s).searchParams : s instanceof URL ? o = s.searchParams : Ht.isUri(s) && (o = new URL(s.toString(!0)).searchParams);
    const a = o == null ? void 0 : o.get(t);
    if (a)
      return e.get(a);
  }
  i.getHeadersFromQuery = n;
  function r(s, o, a) {
    if (!globalThis.crossOriginIsolated)
      return;
    const l = o && a ? "3" : a ? "2" : "1";
    s instanceof URLSearchParams ? s.set(t, l) : s[t] = l;
  }
  i.addSearchParam = r;
})(cie || (cie = {}));
const wxe = typeof Buffer < "u";
new _l(() => new Uint8Array(256));
let MJ;
class x1 {
  /**
   * When running in a nodejs context, if `actual` is not a nodejs Buffer, the backing store for
   * the returned `VSBuffer` instance might use a nodejs Buffer allocated from node's Buffer pool,
   * which is not transferrable.
   */
  static wrap(e) {
    return wxe && !Buffer.isBuffer(e) && (e = Buffer.from(e.buffer, e.byteOffset, e.byteLength)), new x1(e);
  }
  constructor(e) {
    this.buffer = e, this.byteLength = this.buffer.byteLength;
  }
  toString() {
    return wxe ? this.buffer.toString() : (MJ || (MJ = new TextDecoder()), MJ.decode(this.buffer));
  }
}
function Unt(i, e) {
  return i[e + 0] << 0 >>> 0 | i[e + 1] << 8 >>> 0;
}
function znt(i, e, t) {
  i[t + 0] = e & 255, e = e >>> 8, i[t + 1] = e & 255;
}
function Pp(i, e) {
  return i[e] * 2 ** 24 + i[e + 1] * 2 ** 16 + i[e + 2] * 2 ** 8 + i[e + 3];
}
function Fp(i, e, t) {
  i[t + 3] = e, e = e >>> 8, i[t + 2] = e, e = e >>> 8, i[t + 1] = e, e = e >>> 8, i[t] = e;
}
function Sxe(i, e) {
  return i[e];
}
function Exe(i, e, t) {
  i[t] = e;
}
const xxe = "0123456789abcdef";
function $nt({ buffer: i }) {
  let e = "";
  for (let t = 0; t < i.length; t++) {
    const n = i[t];
    e += xxe[n >>> 4], e += xxe[n & 15];
  }
  return e;
}
function bB(i) {
  return _q(i, 0);
}
function _q(i, e) {
  switch (typeof i) {
    case "object":
      return i === null ? py(349, e) : Array.isArray(i) ? Gnt(i, e) : qnt(i, e);
    case "string":
      return Uhe(i, e);
    case "boolean":
      return jnt(i, e);
    case "number":
      return py(i, e);
    case "undefined":
      return py(937, e);
    default:
      return py(617, e);
  }
}
function py(i, e) {
  return (e << 5) - e + i | 0;
}
function jnt(i, e) {
  return py(i ? 433 : 863, e);
}
function Uhe(i, e) {
  e = py(149417, e);
  for (let t = 0, n = i.length; t < n; t++)
    e = py(i.charCodeAt(t), e);
  return e;
}
function Gnt(i, e) {
  return e = py(104579, e), i.reduce((t, n) => _q(n, t), e);
}
function qnt(i, e) {
  return e = py(181387, e), Object.keys(i).sort().reduce((t, n) => (t = Uhe(n, t), _q(i[n], t)), e);
}
function PJ(i, e, t = 32) {
  const n = t - e, r = ~((1 << n) - 1);
  return (i << e | (r & i) >>> n) >>> 0;
}
function BM(i, e = 32) {
  return i instanceof ArrayBuffer ? $nt(x1.wrap(new Uint8Array(i))) : (i >>> 0).toString(16).padStart(e / 4, "0");
}
const Ij = class Ij {
  // 80 * 4 = 320
  constructor() {
    this._h0 = 1732584193, this._h1 = 4023233417, this._h2 = 2562383102, this._h3 = 271733878, this._h4 = 3285377520, this._buff = new Uint8Array(
      67
      /* to fit any utf-8 */
    ), this._buffDV = new DataView(this._buff.buffer), this._buffLen = 0, this._totalLen = 0, this._leftoverHighSurrogate = 0, this._finished = !1;
  }
  update(e) {
    const t = e.length;
    if (t === 0)
      return;
    const n = this._buff;
    let r = this._buffLen, s = this._leftoverHighSurrogate, o, a;
    for (s !== 0 ? (o = s, a = -1, s = 0) : (o = e.charCodeAt(0), a = 0); ; ) {
      let l = o;
      if (Qo(o))
        if (a + 1 < t) {
          const c = e.charCodeAt(a + 1);
          ew(c) ? (a++, l = Fhe(o, c)) : l = 65533;
        } else {
          s = o;
          break;
        }
      else ew(o) && (l = 65533);
      if (r = this._push(n, r, l), a++, a < t)
        o = e.charCodeAt(a);
      else
        break;
    }
    this._buffLen = r, this._leftoverHighSurrogate = s;
  }
  _push(e, t, n) {
    return n < 128 ? e[t++] = n : n < 2048 ? (e[t++] = 192 | (n & 1984) >>> 6, e[t++] = 128 | (n & 63) >>> 0) : n < 65536 ? (e[t++] = 224 | (n & 61440) >>> 12, e[t++] = 128 | (n & 4032) >>> 6, e[t++] = 128 | (n & 63) >>> 0) : (e[t++] = 240 | (n & 1835008) >>> 18, e[t++] = 128 | (n & 258048) >>> 12, e[t++] = 128 | (n & 4032) >>> 6, e[t++] = 128 | (n & 63) >>> 0), t >= 64 && (this._step(), t -= 64, this._totalLen += 64, e[0] = e[64], e[1] = e[65], e[2] = e[66]), t;
  }
  digest() {
    return this._finished || (this._finished = !0, this._leftoverHighSurrogate && (this._leftoverHighSurrogate = 0, this._buffLen = this._push(
      this._buff,
      this._buffLen,
      65533
      /* SHA1Constant.UNICODE_REPLACEMENT */
    )), this._totalLen += this._buffLen, this._wrapUp()), BM(this._h0) + BM(this._h1) + BM(this._h2) + BM(this._h3) + BM(this._h4);
  }
  _wrapUp() {
    this._buff[this._buffLen++] = 128, this._buff.subarray(this._buffLen).fill(0), this._buffLen > 56 && (this._step(), this._buff.fill(0));
    const e = 8 * this._totalLen;
    this._buffDV.setUint32(56, Math.floor(e / 4294967296), !1), this._buffDV.setUint32(60, e % 4294967296, !1), this._step();
  }
  _step() {
    const e = Ij._bigBlock32, t = this._buffDV;
    for (let d = 0; d < 64; d += 4)
      e.setUint32(d, t.getUint32(d, !1), !1);
    for (let d = 64; d < 320; d += 4)
      e.setUint32(d, PJ(e.getUint32(d - 12, !1) ^ e.getUint32(d - 32, !1) ^ e.getUint32(d - 56, !1) ^ e.getUint32(d - 64, !1), 1), !1);
    let n = this._h0, r = this._h1, s = this._h2, o = this._h3, a = this._h4, l, c, u;
    for (let d = 0; d < 80; d++)
      d < 20 ? (l = r & s | ~r & o, c = 1518500249) : d < 40 ? (l = r ^ s ^ o, c = 1859775393) : d < 60 ? (l = r & s | r & o | s & o, c = 2400959708) : (l = r ^ s ^ o, c = 3395469782), u = PJ(n, 5) + l + a + c + e.getUint32(d * 4, !1) & 4294967295, a = o, o = s, s = PJ(r, 30), r = n, n = u;
    this._h0 = this._h0 + n & 4294967295, this._h1 = this._h1 + r & 4294967295, this._h2 = this._h2 + s & 4294967295, this._h3 = this._h3 + o & 4294967295, this._h4 = this._h4 + a & 4294967295;
  }
};
Ij._bigBlock32 = new DataView(new ArrayBuffer(320));
let uie = Ij;
class wl {
  constructor(e, t, n) {
    this.owner = e, this.debugNameSource = t, this.referenceFn = n;
  }
  getDebugName(e) {
    return Knt(e, this);
  }
}
const Lxe = /* @__PURE__ */ new Map(), die = /* @__PURE__ */ new WeakMap();
function Knt(i, e) {
  const t = die.get(i);
  if (t)
    return t;
  const n = Ynt(i, e);
  if (n) {
    let r = Lxe.get(n) ?? 0;
    r++, Lxe.set(n, r);
    const s = r === 1 ? n : `${n}#${r}`;
    return die.set(i, s), s;
  }
}
function Ynt(i, e) {
  const t = die.get(i);
  if (t)
    return t;
  const n = e.owner ? Znt(e.owner) + "." : "";
  let r;
  const s = e.debugNameSource;
  if (s !== void 0)
    if (typeof s == "function") {
      if (r = s(), r !== void 0)
        return n + r;
    } else
      return n + s;
  const o = e.referenceFn;
  if (o !== void 0 && (r = zhe(o), r !== void 0))
    return n + r;
  if (e.owner !== void 0) {
    const a = Xnt(e.owner, i);
    if (a !== void 0)
      return n + a;
  }
}
function Xnt(i, e) {
  for (const t in i)
    if (i[t] === e)
      return t;
}
const Txe = /* @__PURE__ */ new Map(), kxe = /* @__PURE__ */ new WeakMap();
function Znt(i) {
  const e = kxe.get(i);
  if (e)
    return e;
  const t = dPe(i) ?? "Object";
  let n = Txe.get(t) ?? 0;
  n++, Txe.set(t, n);
  const r = n === 1 ? t : `${t}#${n}`;
  return kxe.set(i, r), r;
}
function dPe(i) {
  const e = i.constructor;
  if (e)
    return e.name === "Object" ? void 0 : e.name;
}
function zhe(i) {
  const e = i.toString(), n = /\/\*\*\s*@description\s*([^*]*)\*\//.exec(e), r = n ? n[1] : void 0;
  return r == null ? void 0 : r.trim();
}
function Qnt(i) {
  if (i.length === 0)
    throw new Error("Invalid tail call");
  return [i.slice(0, i.length - 1), i[i.length - 1]];
}
function ds(i, e, t = (n, r) => n === r) {
  if (i === e)
    return !0;
  if (!i || !e || i.length !== e.length)
    return !1;
  for (let n = 0, r = i.length; n < r; n++)
    if (!t(i[n], e[n]))
      return !1;
  return !0;
}
function Jnt(i, e) {
  const t = i.length - 1;
  e < t && (i[e] = i[t]), i.pop();
}
function AV(i, e, t) {
  return $he(i.length, (n) => t(i[n], e));
}
function $he(i, e) {
  let t = 0, n = i - 1;
  for (; t <= n; ) {
    const r = (t + n) / 2 | 0, s = e(r);
    if (s < 0)
      t = r + 1;
    else if (s > 0)
      n = r - 1;
    else
      return r;
  }
  return -(t + 1);
}
function hie(i, e, t) {
  if (i = i | 0, i >= e.length)
    throw new TypeError("invalid index");
  const n = e[Math.floor(e.length * Math.random())], r = [], s = [], o = [];
  for (const a of e) {
    const l = t(a, n);
    l < 0 ? r.push(a) : l > 0 ? s.push(a) : o.push(a);
  }
  return i < r.length ? hie(i, r, t) : i < r.length + o.length ? o[0] : hie(i - (r.length + o.length), s, t);
}
function Dxe(i, e) {
  const t = [];
  let n;
  for (const r of i.slice(0).sort(e))
    !n || e(n[0], r) !== 0 ? (n = [r], t.push(n)) : n.push(r);
  return t;
}
function* jhe(i, e) {
  let t, n;
  for (const r of i)
    n !== void 0 && e(n, r) ? t.push(r) : (t && (yield t), t = [r]), n = r;
  t && (yield t);
}
function hPe(i, e) {
  for (let t = 0; t <= i.length; t++)
    e(t === 0 ? void 0 : i[t - 1], t === i.length ? void 0 : i[t]);
}
function eit(i, e) {
  for (let t = 0; t < i.length; t++)
    e(t === 0 ? void 0 : i[t - 1], i[t], t + 1 === i.length ? void 0 : i[t + 1]);
}
function ym(i) {
  return i.filter((e) => !!e);
}
function Ixe(i) {
  let e = 0;
  for (let t = 0; t < i.length; t++)
    i[t] && (i[e] = i[t], e += 1);
  i.length = e;
}
function fPe(i) {
  return !Array.isArray(i) || i.length === 0;
}
function kc(i) {
  return Array.isArray(i) && i.length > 0;
}
function qy(i, e = (t) => t) {
  const t = /* @__PURE__ */ new Set();
  return i.filter((n) => {
    const r = e(n);
    return t.has(r) ? !1 : (t.add(r), !0);
  });
}
function Hu(i, e) {
  let t = typeof e == "number" ? i : 0;
  typeof e == "number" ? t = i : (t = 0, e = i);
  const n = [];
  if (t <= e)
    for (let r = t; r < e; r++)
      n.push(r);
  else
    for (let r = t; r > e; r--)
      n.push(r);
  return n;
}
function bq(i, e, t) {
  const n = i.slice(0, e), r = i.slice(e);
  return n.concat(t, r);
}
function FJ(i, e) {
  const t = i.indexOf(e);
  t > -1 && (i.splice(t, 1), i.unshift(e));
}
function I7(i, e) {
  const t = i.indexOf(e);
  t > -1 && (i.splice(t, 1), i.push(e));
}
function fie(i, e) {
  for (const t of e)
    i.push(t);
}
function Ghe(i) {
  return Array.isArray(i) ? i : [i];
}
function tit(i, e, t) {
  const n = gPe(i, e), r = i.length, s = t.length;
  i.length = r + s;
  for (let o = r - 1; o >= n; o--)
    i[o + s] = i[o];
  for (let o = 0; o < s; o++)
    i[o + n] = t[o];
}
function OV(i, e, t, n) {
  const r = gPe(i, e);
  let s = i.splice(r, t);
  return s === void 0 && (s = []), tit(i, r, n), s;
}
function gPe(i, e) {
  return e < 0 ? Math.max(e + i.length, 0) : Math.min(e, i.length);
}
var L1;
(function(i) {
  function e(s) {
    return s < 0;
  }
  i.isLessThan = e;
  function t(s) {
    return s <= 0;
  }
  i.isLessThanOrEqual = t;
  function n(s) {
    return s > 0;
  }
  i.isGreaterThan = n;
  function r(s) {
    return s === 0;
  }
  i.isNeitherLessOrGreaterThan = r, i.greaterThan = 1, i.lessThan = -1, i.neitherLessOrGreaterThan = 0;
})(L1 || (L1 = {}));
function yl(i, e) {
  return (t, n) => e(i(t), i(n));
}
function nit(...i) {
  return (e, t) => {
    for (const n of i) {
      const r = n(e, t);
      if (!L1.isNeitherLessOrGreaterThan(r))
        return r;
    }
    return L1.neitherLessOrGreaterThan;
  };
}
const Hd = (i, e) => i - e, pPe = (i, e) => Hd(i ? 1 : 0, e ? 1 : 0);
function mPe(i) {
  return (e, t) => -i(e, t);
}
function iit(i) {
  return (e, t) => e === void 0 ? t === void 0 ? L1.neitherLessOrGreaterThan : L1.lessThan : t === void 0 ? L1.greaterThan : i(e, t);
}
class Ky {
  /**
   * Constructs a queue that is backed by the given array. Runtime is O(1).
  */
  constructor(e) {
    this.firstIdx = 0, this.items = e, this.lastIdx = this.items.length - 1;
  }
  get length() {
    return this.lastIdx - this.firstIdx + 1;
  }
  /**
   * Consumes elements from the beginning of the queue as long as the predicate returns true.
   * If no elements were consumed, `null` is returned. Has a runtime of O(result.length).
  */
  takeWhile(e) {
    let t = this.firstIdx;
    for (; t < this.items.length && e(this.items[t]); )
      t++;
    const n = t === this.firstIdx ? null : this.items.slice(this.firstIdx, t);
    return this.firstIdx = t, n;
  }
  /**
   * Consumes elements from the end of the queue as long as the predicate returns true.
   * If no elements were consumed, `null` is returned.
   * The result has the same order as the underlying array!
  */
  takeFromEndWhile(e) {
    let t = this.lastIdx;
    for (; t >= 0 && e(this.items[t]); )
      t--;
    const n = t === this.lastIdx ? null : this.items.slice(t + 1, this.lastIdx + 1);
    return this.lastIdx = t, n;
  }
  peek() {
    if (this.length !== 0)
      return this.items[this.firstIdx];
  }
  dequeue() {
    const e = this.items[this.firstIdx];
    return this.firstIdx++, e;
  }
  takeCount(e) {
    const t = this.items.slice(this.firstIdx, this.firstIdx + e);
    return this.firstIdx += e, t;
  }
}
const DN = class DN {
  constructor(e) {
    this.iterate = e;
  }
  toArray() {
    const e = [];
    return this.iterate((t) => (e.push(t), !0)), e;
  }
  filter(e) {
    return new DN((t) => this.iterate((n) => e(n) ? t(n) : !0));
  }
  map(e) {
    return new DN((t) => this.iterate((n) => t(e(n))));
  }
  findLast(e) {
    let t;
    return this.iterate((n) => (e(n) && (t = n), !0)), t;
  }
  findLastMaxBy(e) {
    let t, n = !0;
    return this.iterate((r) => ((n || L1.isGreaterThan(e(r, t))) && (n = !1, t = r), !0)), t;
  }
};
DN.empty = new DN((e) => {
});
let Rx = DN;
class MV {
  constructor(e) {
    this._indexMap = e;
  }
  /**
   * Returns a permutation that sorts the given array according to the given compare function.
   */
  static createSortPermutation(e, t) {
    const n = Array.from(e.keys()).sort((r, s) => t(e[r], e[s]));
    return new MV(n);
  }
  /**
   * Returns a new array with the elements of the given array re-arranged according to this permutation.
   */
  apply(e) {
    return e.map((t, n) => e[this._indexMap[n]]);
  }
  /**
   * Returns a new permutation that undoes the re-arrangement of this permutation.
  */
  inverse() {
    const e = this._indexMap.slice();
    for (let t = 0; t < this._indexMap.length; t++)
      e[this._indexMap[t]] = t;
    return new MV(e);
  }
}
function PV(i) {
  return i.reduce((e, t) => e + t, 0);
}
const qh = (i, e) => i === e;
function e4(i = qh) {
  return (e, t) => ds(e, t, i);
}
function qhe() {
  return (i, e) => i.equals(e);
}
function cx(i, e, t) {
  if (t !== void 0) {
    const n = i;
    return n == null || e === void 0 || e === null ? e === n : t(n, e);
  } else {
    const n = i;
    return (r, s) => r == null || s === void 0 || s === null ? s === r : n(r, s);
  }
}
function gie(i, e) {
  if (i === e)
    return !0;
  if (Array.isArray(i) && Array.isArray(e)) {
    if (i.length !== e.length)
      return !1;
    for (let t = 0; t < i.length; t++)
      if (!gie(i[t], e[t]))
        return !1;
    return !0;
  }
  if (i && typeof i == "object" && e && typeof e == "object" && Object.getPrototypeOf(i) === Object.prototype && Object.getPrototypeOf(e) === Object.prototype) {
    const t = i, n = e, r = Object.keys(t), s = Object.keys(n), o = new Set(s);
    if (r.length !== s.length)
      return !1;
    for (const a of r)
      if (!o.has(a) || !gie(t[a], n[a]))
        return !1;
    return !0;
  }
  return !1;
}
function Nxe(i) {
  const e = new Error("BugIndicatingErrorRecovery: " + i);
  fn(e), console.error("recovered from an error that indicates a bug", e);
}
let vE;
function rit(i) {
  vE ? vE instanceof Rxe ? vE.loggers.push(i) : vE = new Rxe([vE, i]) : vE = i;
}
function Yl() {
  return vE;
}
class Rxe {
  constructor(e) {
    this.loggers = e;
  }
  handleObservableCreated(e, t) {
    for (const n of this.loggers)
      n.handleObservableCreated(e, t);
  }
  handleOnListenerCountChanged(e, t) {
    for (const n of this.loggers)
      n.handleOnListenerCountChanged(e, t);
  }
  handleObservableUpdated(e, t) {
    for (const n of this.loggers)
      n.handleObservableUpdated(e, t);
  }
  handleAutorunCreated(e, t) {
    for (const n of this.loggers)
      n.handleAutorunCreated(e, t);
  }
  handleAutorunDisposed(e) {
    for (const t of this.loggers)
      t.handleAutorunDisposed(e);
  }
  handleAutorunDependencyChanged(e, t, n) {
    for (const r of this.loggers)
      r.handleAutorunDependencyChanged(e, t, n);
  }
  handleAutorunStarted(e) {
    for (const t of this.loggers)
      t.handleAutorunStarted(e);
  }
  handleAutorunFinished(e) {
    for (const t of this.loggers)
      t.handleAutorunFinished(e);
  }
  handleDerivedDependencyChanged(e, t, n) {
    for (const r of this.loggers)
      r.handleDerivedDependencyChanged(e, t, n);
  }
  handleDerivedCleared(e) {
    for (const t of this.loggers)
      t.handleDerivedCleared(e);
  }
  handleBeginTransaction(e) {
    for (const t of this.loggers)
      t.handleBeginTransaction(e);
  }
  handleEndTransaction(e) {
    for (const t of this.loggers)
      t.handleEndTransaction(e);
  }
}
function Fr(i, e) {
  const t = new $A(i, e);
  try {
    i(t);
  } finally {
    t.finish();
  }
}
let N7;
function VP(i) {
  if (N7)
    i(N7);
  else {
    const e = new $A(i, void 0);
    N7 = e;
    try {
      i(e);
    } finally {
      e.finish(), N7 = void 0;
    }
  }
}
async function sit(i, e) {
  const t = new $A(i, e);
  try {
    await i(t);
  } finally {
    t.finish();
  }
}
function Ax(i, e, t) {
  i ? e(i) : Fr(e, t);
}
class $A {
  constructor(e, t) {
    var n;
    this._fn = e, this._getDebugName = t, this._updatingObservers = [], (n = Yl()) == null || n.handleBeginTransaction(this);
  }
  getDebugName() {
    return this._getDebugName ? this._getDebugName() : zhe(this._fn);
  }
  updateObserver(e, t) {
    if (!this._updatingObservers) {
      Nxe("Transaction already finished!"), Fr((n) => {
        n.updateObserver(e, t);
      });
      return;
    }
    this._updatingObservers.push({ observer: e, observable: t }), e.beginUpdate(t);
  }
  finish() {
    var t;
    const e = this._updatingObservers;
    if (!e) {
      Nxe("transaction.finish() has already been called!");
      return;
    }
    for (let n = 0; n < e.length; n++) {
      const { observer: r, observable: s } = e[n];
      r.endUpdate(s);
    }
    this._updatingObservers = null, (t = Yl()) == null || t.handleEndTransaction(this);
  }
  debugGetUpdatingObservers() {
    return this._updatingObservers;
  }
}
var ba;
(function(i) {
  let e = !1;
  function t() {
    e = !0;
  }
  i.enable = t;
  function n() {
    if (!e)
      return;
    const r = Error, s = r.stackTraceLimit;
    r.stackTraceLimit = 3;
    const o = new Error().stack;
    return r.stackTraceLimit = s, Khe.fromStack(o, 2);
  }
  i.ofCaller = n;
})(ba || (ba = {}));
class Khe {
  static fromStack(e, t) {
    const n = e.split(`
`), r = oit(n[t + 1]);
    if (r)
      return new Khe(r.fileName, r.line, r.column, r.id);
  }
  constructor(e, t, n, r) {
    this.fileName = e, this.line = t, this.column = n, this.id = r;
  }
}
function oit(i) {
  const e = i.match(/\((.*):(\d+):(\d+)\)/);
  if (e)
    return {
      fileName: e[1],
      line: parseInt(e[2]),
      column: parseInt(e[3]),
      id: i
    };
  const t = i.match(/at ([^\(\)]*):(\d+):(\d+)/);
  if (t)
    return {
      fileName: t[1],
      line: parseInt(t[2]),
      column: parseInt(t[3]),
      id: i
    };
}
let pie;
function ait(i) {
  pie = i;
}
let _Pe;
function lit(i) {
  _Pe = i;
}
class bPe {
  get TChange() {
    return null;
  }
  reportChanges() {
    this.get();
  }
  /** @sealed */
  read(e) {
    return e ? e.readObservable(this) : this.get();
  }
  map(e, t, n = ba.ofCaller()) {
    const r = t === void 0 ? void 0 : e, s = t === void 0 ? e : t;
    return pie({
      owner: r,
      debugName: () => {
        const o = zhe(s);
        if (o !== void 0)
          return o;
        const l = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());
        if (l)
          return `${this.debugName}.${l[2]}`;
        if (!r)
          return `${this.debugName} (mapped)`;
      },
      debugReferenceFn: s
    }, (o) => s(this.read(o), o), n);
  }
  /**
   * @sealed
   * Converts an observable of an observable value into a direct observable of the value.
  */
  flatten() {
    return pie({
      owner: void 0,
      debugName: () => `${this.debugName} (flattened)`
    }, (e) => this.read(e).read(e));
  }
  recomputeInitiallyAndOnChange(e, t) {
    return e.add(_Pe(this, t)), this;
  }
}
class jA extends bPe {
  constructor(e) {
    var t;
    super(), this._observers = /* @__PURE__ */ new Set(), (t = Yl()) == null || t.handleObservableCreated(this, e);
  }
  addObserver(e) {
    var n;
    const t = this._observers.size;
    this._observers.add(e), t === 0 && this.onFirstObserverAdded(), t !== this._observers.size && ((n = Yl()) == null || n.handleOnListenerCountChanged(this, this._observers.size));
  }
  removeObserver(e) {
    var n;
    const t = this._observers.delete(e);
    t && this._observers.size === 0 && this.onLastObserverRemoved(), t && ((n = Yl()) == null || n.handleOnListenerCountChanged(this, this._observers.size));
  }
  onFirstObserverAdded() {
  }
  onLastObserverRemoved() {
  }
  debugGetObservers() {
    return this._observers;
  }
}
function Qt(i, e, t = ba.ofCaller()) {
  let n;
  return typeof i == "string" ? n = new wl(void 0, i, void 0) : n = new wl(i, void 0, void 0), new t4(n, e, qh, t);
}
class t4 extends jA {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? "ObservableValue";
  }
  constructor(e, t, n, r) {
    var s;
    super(r), this._debugNameData = e, this._equalityComparator = n, this._value = t, (s = Yl()) == null || s.handleObservableUpdated(this, { hadValue: !1, newValue: t, change: void 0, didChange: !0, oldValue: void 0 });
  }
  get() {
    return this._value;
  }
  set(e, t, n) {
    var s;
    if (n === void 0 && this._equalityComparator(this._value, e))
      return;
    let r;
    t || (t = r = new $A(() => {
    }, () => `Setting ${this.debugName}`));
    try {
      const o = this._value;
      this._setValue(e), (s = Yl()) == null || s.handleObservableUpdated(this, { oldValue: o, newValue: e, change: n, didChange: !0, hadValue: !0 });
      for (const a of this._observers)
        t.updateObserver(a, this), a.handleChange(this, n);
    } finally {
      r && r.finish();
    }
  }
  toString() {
    return `${this.debugName}: ${this._value}`;
  }
  _setValue(e) {
    this._value = e;
  }
  debugGetState() {
    return {
      value: this._value
    };
  }
  debugSetValue(e) {
    this._value = e;
  }
}
function Yhe(i, e, t = ba.ofCaller()) {
  let n;
  return typeof i == "string" ? n = new wl(void 0, i, void 0) : n = new wl(i, void 0, void 0), new cit(n, e, qh, t);
}
class cit extends t4 {
  _setValue(e) {
    this._value !== e && (this._value && this._value.dispose(), this._value = e);
  }
  dispose() {
    var e;
    (e = this._value) == null || e.dispose();
  }
}
class uit extends jA {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? "LazyObservableValue";
  }
  constructor(e, t, n, r) {
    super(r), this._debugNameData = e, this._equalityComparator = n, this._isUpToDate = !0, this._deltas = [], this._updateCounter = 0, this._value = t;
  }
  get() {
    return this._update(), this._value;
  }
  _update() {
    var e, t;
    if (!this._isUpToDate)
      if (this._isUpToDate = !0, this._deltas.length > 0) {
        for (const n of this._deltas) {
          (e = Yl()) == null || e.handleObservableUpdated(this, { change: n, didChange: !0, oldValue: "(unknown)", newValue: this._value, hadValue: !0 });
          for (const r of this._observers)
            r.handleChange(this, n);
        }
        this._deltas.length = 0;
      } else {
        (t = Yl()) == null || t.handleObservableUpdated(this, { change: void 0, didChange: !0, oldValue: "(unknown)", newValue: this._value, hadValue: !0 });
        for (const n of this._observers)
          n.handleChange(this, void 0);
      }
  }
  _beginUpdate() {
    if (this._updateCounter++, this._updateCounter === 1)
      for (const e of this._observers)
        e.beginUpdate(this);
  }
  _endUpdate() {
    if (this._updateCounter--, this._updateCounter === 0) {
      this._update();
      const e = [...this._observers];
      for (const t of e)
        t.endUpdate(this);
    }
  }
  addObserver(e) {
    const t = !this._observers.has(e) && this._updateCounter > 0;
    super.addObserver(e), t && e.beginUpdate(this);
  }
  removeObserver(e) {
    const t = this._observers.has(e) && this._updateCounter > 0;
    super.removeObserver(e), t && e.endUpdate(this);
  }
  set(e, t, n) {
    if (n === void 0 && this._equalityComparator(this._value, e))
      return;
    let r;
    t || (t = r = new $A(() => {
    }, () => `Setting ${this.debugName}`));
    try {
      if (this._isUpToDate = !1, this._setValue(e), n !== void 0 && this._deltas.push(n), t.updateObserver({
        beginUpdate: () => this._beginUpdate(),
        endUpdate: () => this._endUpdate(),
        handleChange: (s, o) => {
        },
        handlePossibleChange: (s) => {
        }
      }, this), this._updateCounter > 1)
        for (const s of this._observers)
          s.handlePossibleChange(this);
    } finally {
      r && r.finish();
    }
  }
  toString() {
    return `${this.debugName}: ${this._value}`;
  }
  _setValue(e) {
    this._value = e;
  }
}
function CF(i, e, t = ba.ofCaller()) {
  return i.lazy ? new uit(new wl(i.owner, i.debugName, void 0), e, i.equalsFn ?? qh, t) : new t4(new wl(i.owner, i.debugName, void 0), e, i.equalsFn ?? qh, t);
}
function dit(i) {
  switch (i) {
    case 1:
      return "dependenciesMightHaveChanged";
    case 2:
      return "stale";
    case 3:
      return "upToDate";
    default:
      return "<unknown>";
  }
}
class n4 {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? "(anonymous)";
  }
  constructor(e, t, n, r) {
    var s, o;
    this._debugNameData = e, this._runFn = t, this._changeTracker = n, this._state = 2, this._updateCount = 0, this._disposed = !1, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._isRunning = !1, this._store = void 0, this._delayedStore = void 0, this._changeSummary = (s = this._changeTracker) == null ? void 0 : s.createChangeSummary(void 0), (o = Yl()) == null || o.handleAutorunCreated(this, r), this._run();
  }
  dispose() {
    var e;
    if (!this._disposed) {
      this._disposed = !0;
      for (const t of this._dependencies)
        t.removeObserver(this);
      this._dependencies.clear(), this._store !== void 0 && this._store.dispose(), this._delayedStore !== void 0 && this._delayedStore.dispose(), (e = Yl()) == null || e.handleAutorunDisposed(this);
    }
  }
  _run() {
    var t, n, r, s;
    const e = this._dependenciesToBeRemoved;
    this._dependenciesToBeRemoved = this._dependencies, this._dependencies = e, this._state = 3;
    try {
      if (!this._disposed) {
        (t = Yl()) == null || t.handleAutorunStarted(this);
        const o = this._changeSummary, a = this._delayedStore;
        a !== void 0 && (this._delayedStore = void 0);
        try {
          this._isRunning = !0, this._changeTracker && ((r = (n = this._changeTracker).beforeUpdate) == null || r.call(n, this, o), this._changeSummary = this._changeTracker.createChangeSummary(o)), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._runFn(this, o);
        } catch (l) {
          EV(l);
        } finally {
          this._isRunning = !1, a !== void 0 && a.dispose();
        }
      }
    } finally {
      this._disposed || (s = Yl()) == null || s.handleAutorunFinished(this);
      for (const o of this._dependenciesToBeRemoved)
        o.removeObserver(this);
      this._dependenciesToBeRemoved.clear();
    }
  }
  toString() {
    return `Autorun<${this.debugName}>`;
  }
  // IObserver implementation
  beginUpdate(e) {
    this._state === 3 && (this._state = 1), this._updateCount++;
  }
  endUpdate(e) {
    try {
      if (this._updateCount === 1)
        do {
          if (this._state === 1) {
            this._state = 3;
            for (const t of this._dependencies)
              if (t.reportChanges(), this._state === 2)
                break;
          }
          this._state !== 3 && this._run();
        } while (this._state !== 3);
    } finally {
      this._updateCount--;
    }
    J1(() => this._updateCount >= 0);
  }
  handlePossibleChange(e) {
    this._state === 3 && this._isDependency(e) && (this._state = 1);
  }
  handleChange(e, t) {
    var n;
    if (this._isDependency(e)) {
      (n = Yl()) == null || n.handleAutorunDependencyChanged(this, e, t);
      try {
        (this._changeTracker ? this._changeTracker.handleChange({
          changedObservable: e,
          change: t,
          didChange: (s) => s === e
        }, this._changeSummary) : !0) && (this._state = 2);
      } catch (r) {
        EV(r);
      }
    }
  }
  _isDependency(e) {
    return this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e);
  }
  // IReader implementation
  _ensureNoRunning() {
    if (!this._isRunning)
      throw new Wt("The reader object cannot be used outside its compute function!");
  }
  readObservable(e) {
    if (this._ensureNoRunning(), this._disposed)
      return e.get();
    e.addObserver(this);
    const t = e.get();
    return this._dependencies.add(e), this._dependenciesToBeRemoved.delete(e), t;
  }
  get store() {
    if (this._ensureNoRunning(), this._disposed)
      throw new Wt("Cannot access store after dispose");
    return this._store === void 0 && (this._store = new ke()), this._store;
  }
  debugGetState() {
    return {
      isRunning: this._isRunning,
      updateCount: this._updateCount,
      dependencies: this._dependencies,
      state: this._state,
      stateStr: dit(this._state)
    };
  }
  debugRerun() {
    this._isRunning ? this._state = 2 : this._run();
  }
}
function Xt(i, e = ba.ofCaller()) {
  return new n4(new wl(void 0, void 0, i), i, void 0, e);
}
function vq(i, e, t = ba.ofCaller()) {
  return new n4(new wl(i.owner, i.debugName, i.debugReferenceFn ?? e), e, void 0, t);
}
function GA(i, e, t = ba.ofCaller()) {
  return new n4(new wl(i.owner, i.debugName, i.debugReferenceFn ?? e), e, i.changeTracker, t);
}
function hit(i, e) {
  const t = new ke(), n = GA({
    owner: i.owner,
    debugName: i.debugName,
    debugReferenceFn: i.debugReferenceFn ?? e,
    changeTracker: i.changeTracker
  }, (r, s) => {
    t.clear(), e(r, s, t);
  });
  return Et(() => {
    n.dispose(), t.dispose();
  });
}
function Ql(i) {
  const e = new ke(), t = vq({
    owner: void 0,
    debugName: void 0,
    debugReferenceFn: i
  }, (n) => {
    e.clear(), i(n, e);
  });
  return Et(() => {
    t.dispose(), e.dispose();
  });
}
function fit(i, e) {
  let t;
  return vq({ debugReferenceFn: e }, (n) => {
    const r = i.read(n), s = t;
    t = r, e({ lastValue: s, newValue: r });
  });
}
function git(i) {
  switch (i) {
    case 0:
      return "initial";
    case 1:
      return "dependenciesMightHaveChanged";
    case 2:
      return "stale";
    case 3:
      return "upToDate";
    default:
      return "<unknown>";
  }
}
class Tf extends jA {
  get debugName() {
    return this._debugNameData.getDebugName(this) ?? "(anonymous)";
  }
  constructor(e, t, n, r = void 0, s, o) {
    var a;
    super(o), this._debugNameData = e, this._computeFn = t, this._changeTracker = n, this._handleLastObserverRemoved = r, this._equalityComparator = s, this._state = 0, this._value = void 0, this._updateCount = 0, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._changeSummary = void 0, this._isUpdating = !1, this._isComputing = !1, this._didReportChange = !1, this._isInBeforeUpdate = !1, this._isReaderValid = !1, this._store = void 0, this._delayedStore = void 0, this._removedObserverToCallEndUpdateOn = null, this._changeSummary = (a = this._changeTracker) == null ? void 0 : a.createChangeSummary(void 0);
  }
  onLastObserverRemoved() {
    var e, t;
    this._state = 0, this._value = void 0, (e = Yl()) == null || e.handleDerivedCleared(this);
    for (const n of this._dependencies)
      n.removeObserver(this);
    this._dependencies.clear(), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._delayedStore !== void 0 && (this._delayedStore.dispose(), this._delayedStore = void 0), (t = this._handleLastObserverRemoved) == null || t.call(this);
  }
  get() {
    var t, n;
    if (this._isComputing, this._observers.size === 0) {
      let r;
      try {
        this._isReaderValid = !0;
        let s;
        this._changeTracker && (s = this._changeTracker.createChangeSummary(void 0), (n = (t = this._changeTracker).beforeUpdate) == null || n.call(t, this, s)), r = this._computeFn(this, s);
      } finally {
        this._isReaderValid = !1;
      }
      return this.onLastObserverRemoved(), r;
    } else {
      do {
        if (this._state === 1) {
          for (const r of this._dependencies)
            if (r.reportChanges(), this._state === 2)
              break;
        }
        this._state === 1 && (this._state = 3), this._state !== 3 && this._recompute();
      } while (this._state !== 3);
      return this._value;
    }
  }
  _recompute() {
    var n, r, s, o;
    let e = !1;
    this._isComputing = !0, this._didReportChange = !1;
    const t = this._dependenciesToBeRemoved;
    this._dependenciesToBeRemoved = this._dependencies, this._dependencies = t;
    try {
      const a = this._changeSummary;
      this._isReaderValid = !0, this._changeTracker && (this._isInBeforeUpdate = !0, (r = (n = this._changeTracker).beforeUpdate) == null || r.call(n, this, a), this._isInBeforeUpdate = !1, this._changeSummary = (s = this._changeTracker) == null ? void 0 : s.createChangeSummary(a));
      const l = this._state !== 0, c = this._value;
      this._state = 3;
      const u = this._delayedStore;
      u !== void 0 && (this._delayedStore = void 0);
      try {
        this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._value = this._computeFn(this, a);
      } finally {
        this._isReaderValid = !1;
        for (const d of this._dependenciesToBeRemoved)
          d.removeObserver(this);
        this._dependenciesToBeRemoved.clear(), u !== void 0 && u.dispose();
      }
      e = this._didReportChange || l && !this._equalityComparator(c, this._value), (o = Yl()) == null || o.handleObservableUpdated(this, {
        oldValue: c,
        newValue: this._value,
        change: void 0,
        didChange: e,
        hadValue: l
      });
    } catch (a) {
      EV(a);
    }
    if (this._isComputing = !1, !this._didReportChange && e)
      for (const a of this._observers)
        a.handleChange(this, void 0);
    else
      this._didReportChange = !1;
  }
  toString() {
    return `LazyDerived<${this.debugName}>`;
  }
  // IObserver Implementation
  beginUpdate(e) {
    if (this._isUpdating)
      throw new Wt("Cyclic deriveds are not supported yet!");
    this._updateCount++, this._isUpdating = !0;
    try {
      const t = this._updateCount === 1;
      if (this._state === 3 && (this._state = 1, !t))
        for (const n of this._observers)
          n.handlePossibleChange(this);
      if (t)
        for (const n of this._observers)
          n.beginUpdate(this);
    } finally {
      this._isUpdating = !1;
    }
  }
  endUpdate(e) {
    if (this._updateCount--, this._updateCount === 0) {
      const t = [...this._observers];
      for (const n of t)
        n.endUpdate(this);
      if (this._removedObserverToCallEndUpdateOn) {
        const n = [...this._removedObserverToCallEndUpdateOn];
        this._removedObserverToCallEndUpdateOn = null;
        for (const r of n)
          r.endUpdate(this);
      }
    }
    J1(() => this._updateCount >= 0);
  }
  handlePossibleChange(e) {
    if (this._state === 3 && this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e)) {
      this._state = 1;
      for (const t of this._observers)
        t.handlePossibleChange(this);
    }
  }
  handleChange(e, t) {
    var n;
    if (this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e) || this._isInBeforeUpdate) {
      (n = Yl()) == null || n.handleDerivedDependencyChanged(this, e, t);
      let r = !1;
      try {
        r = this._changeTracker ? this._changeTracker.handleChange({
          changedObservable: e,
          change: t,
          didChange: (o) => o === e
        }, this._changeSummary) : !0;
      } catch (o) {
        EV(o);
      }
      const s = this._state === 3;
      if (r && (this._state === 1 || s) && (this._state = 2, s))
        for (const o of this._observers)
          o.handlePossibleChange(this);
    }
  }
  // IReader Implementation
  _ensureReaderValid() {
    if (!this._isReaderValid)
      throw new Wt("The reader object cannot be used outside its compute function!");
  }
  readObservable(e) {
    this._ensureReaderValid(), e.addObserver(this);
    const t = e.get();
    return this._dependencies.add(e), this._dependenciesToBeRemoved.delete(e), t;
  }
  get store() {
    return this._ensureReaderValid(), this._store === void 0 && (this._store = new ke()), this._store;
  }
  addObserver(e) {
    const t = !this._observers.has(e) && this._updateCount > 0;
    super.addObserver(e), t && (this._removedObserverToCallEndUpdateOn && this._removedObserverToCallEndUpdateOn.has(e) ? this._removedObserverToCallEndUpdateOn.delete(e) : e.beginUpdate(this));
  }
  removeObserver(e) {
    this._observers.has(e) && this._updateCount > 0 && (this._removedObserverToCallEndUpdateOn || (this._removedObserverToCallEndUpdateOn = /* @__PURE__ */ new Set()), this._removedObserverToCallEndUpdateOn.add(e)), super.removeObserver(e);
  }
  debugGetState() {
    return {
      state: this._state,
      stateStr: git(this._state),
      updateCount: this._updateCount,
      isComputing: this._isComputing,
      dependencies: this._dependencies,
      value: this._value
    };
  }
  debugSetValue(e) {
    this._value = e;
  }
  debugRecompute() {
    this._isComputing ? this._state = 2 : this._recompute();
  }
  setValue(e, t, n) {
    this._value = e;
    const r = this._observers;
    t.updateObserver(this, this);
    for (const s of r)
      s.handleChange(this, n);
  }
}
class vPe extends Tf {
  constructor(e, t, n, r = void 0, s, o, a) {
    super(e, t, n, r, s, a), this.set = o;
  }
}
function Ie(i, e, t = ba.ofCaller()) {
  return e !== void 0 ? new Tf(new wl(i, void 0, e), e, void 0, void 0, qh, t) : new Tf(new wl(void 0, void 0, i), i, void 0, void 0, qh, t);
}
function Xhe(i, e, t, n = ba.ofCaller()) {
  return new vPe(new wl(i, void 0, e), e, void 0, void 0, qh, t, n);
}
function pl(i, e, t = ba.ofCaller()) {
  return new Tf(new wl(i.owner, i.debugName, i.debugReferenceFn), e, void 0, i.onLastObserverRemoved, i.equalsFn ?? qh, t);
}
ait(pl);
function Axe(i, e, t = ba.ofCaller()) {
  return new Tf(new wl(i.owner, i.debugName, void 0), e, i.changeTracker, void 0, i.equalityComparer ?? qh, t);
}
function xf(i, e, t = ba.ofCaller()) {
  let n, r;
  e === void 0 ? (n = i, r = void 0) : (r = i, n = e);
  let s;
  return new Tf(new wl(r, void 0, n), (o) => {
    s ? s.clear() : s = new ke();
    const a = n(o);
    return a && s.add(a), a;
  }, void 0, () => {
    s && (s.dispose(), s = void 0);
  }, qh, t);
}
class pit {
  constructor(e) {
    this._value = Qt(this, void 0), this.promiseResult = this._value, this.promise = e.then((t) => (Fr((n) => {
      this._value.set(new Oxe(t, void 0), n);
    }), t), (t) => {
      throw Fr((n) => {
        this._value.set(new Oxe(void 0, t), n);
      }), t;
    });
  }
}
class Oxe {
  constructor(e, t) {
    this.data = e, this.error = t;
  }
  /**
   * Returns the value if the promise resolved, otherwise throws the error.
   */
  getDataOrThrow() {
    if (this.error)
      throw this.error;
    return this.data;
  }
}
function yPe(i, e, t, n) {
  return e || (e = (r) => r != null), new Promise((r, s) => {
    let o = !0, a = !1;
    const l = i.map((u) => ({
      isFinished: e(u),
      error: t ? t(u) : !1,
      state: u
    })), c = Xt((u) => {
      const { isFinished: d, error: h, state: g } = l.read(u);
      (d || h) && (o ? a = !0 : c.dispose(), h ? s(h === !0 ? g : h) : r(g));
    });
    if (n) {
      const u = n.onCancellationRequested(() => {
        c.dispose(), u.dispose(), s(new $f());
      });
      if (n.isCancellationRequested) {
        c.dispose(), u.dispose(), s(new $f());
        return;
      }
    }
    o = !1, a && c.dispose();
  });
}
function ji(...i) {
  let e, t, n, r;
  return i.length === 2 ? [t, n] = i : [e, t, n, r] = i, new my(new wl(e, void 0, n), t, n, () => my.globalTransaction, qh, r ?? ba.ofCaller());
}
function CPe(i, e, t, n = ba.ofCaller()) {
  return new my(new wl(i.owner, i.debugName, i.debugReferenceFn ?? t), e, t, () => my.globalTransaction, i.equalsFn ?? qh, n);
}
class my extends jA {
  constructor(e, t, n, r, s, o) {
    super(o), this._debugNameData = e, this.event = t, this._getValue = n, this._getTransaction = r, this._equalityComparator = s, this._hasValue = !1, this.handleEvent = (a) => {
      var h;
      const l = this._getValue(a), c = this._value, u = !this._hasValue || !this._equalityComparator(c, l);
      let d = !1;
      u && (this._value = l, this._hasValue && (d = !0, Ax(this._getTransaction(), (g) => {
        var m;
        (m = Yl()) == null || m.handleObservableUpdated(this, { oldValue: c, newValue: l, change: void 0, didChange: u, hadValue: this._hasValue });
        for (const _ of this._observers)
          g.updateObserver(_, this), _.handleChange(this, void 0);
      }, () => {
        const g = this.getDebugName();
        return "Event fired" + (g ? `: ${g}` : "");
      })), this._hasValue = !0), d || (h = Yl()) == null || h.handleObservableUpdated(this, { oldValue: c, newValue: l, change: void 0, didChange: u, hadValue: this._hasValue });
    };
  }
  getDebugName() {
    return this._debugNameData.getDebugName(this);
  }
  get debugName() {
    const e = this.getDebugName();
    return "From Event" + (e ? `: ${e}` : "");
  }
  onFirstObserverAdded() {
    this._subscription = this.event(this.handleEvent);
  }
  onLastObserverRemoved() {
    this._subscription.dispose(), this._subscription = void 0, this._hasValue = !1, this._value = void 0;
  }
  get() {
    return this._subscription ? (this._hasValue || this.handleEvent(void 0), this._value) : this._getValue(void 0);
  }
  debugSetValue(e) {
    this._value = e;
  }
  debugGetState() {
    return { value: this._value, hasValue: this._hasValue };
  }
}
(function(i) {
  i.Observer = my;
  function e(t, n) {
    let r = !1;
    my.globalTransaction === void 0 && (my.globalTransaction = t, r = !0);
    try {
      n();
    } finally {
      r && (my.globalTransaction = void 0);
    }
  }
  i.batchEventsGlobally = e;
})(ji || (ji = {}));
function Nf(i, e = ba.ofCaller()) {
  return typeof i == "string" ? new Mxe(i, void 0, e) : new Mxe(void 0, i, e);
}
class Mxe extends jA {
  get debugName() {
    return new wl(this._owner, this._debugName, void 0).getDebugName(this) ?? "Observable Signal";
  }
  toString() {
    return this.debugName;
  }
  constructor(e, t, n) {
    super(n), this._debugName = e, this._owner = t;
  }
  trigger(e, t) {
    if (!e) {
      Fr((n) => {
        this.trigger(n, t);
      }, () => `Trigger signal ${this.debugName}`);
      return;
    }
    for (const n of this._observers)
      e.updateObserver(n, this), n.handleChange(this, t);
  }
  get() {
  }
}
function Pxe(i, e) {
  let t = !1, n, r;
  return ji((s) => {
    const o = Xt((a) => {
      const l = i.read(a);
      t ? (r && clearTimeout(r), r = setTimeout(() => {
        n = l, s();
      }, e)) : (t = !0, n = l);
    });
    return {
      dispose() {
        o.dispose(), t = !1, n = void 0;
      }
    };
  }, () => t ? n : i.get());
}
function GR(i, e) {
  const t = new mit(!0, e);
  i.addObserver(t);
  try {
    t.beginUpdate(i);
  } finally {
    t.endUpdate(i);
  }
  return Et(() => {
    i.removeObserver(t);
  });
}
lit(GR);
class mit {
  constructor(e, t) {
    this._forceRecompute = e, this._handleValue = t, this._counter = 0;
  }
  beginUpdate(e) {
    this._counter++;
  }
  endUpdate(e) {
    this._counter === 1 && this._forceRecompute && (this._handleValue ? this._handleValue(e.get()) : e.reportChanges()), this._counter--;
  }
  handlePossibleChange(e) {
  }
  handleChange(e, t) {
  }
}
function u0(i, e) {
  let t;
  return pl({ owner: i, debugReferenceFn: e }, (r) => (t = e(r, t), t));
}
function Zhe(i, e, t, n) {
  let r = new Fxe(t, n);
  return pl({
    debugReferenceFn: t,
    owner: i,
    onLastObserverRemoved: () => {
      r.dispose(), r = new Fxe(t);
    }
  }, (o) => (r.setItems(e.read(o)), r.getItems()));
}
let Fxe = class {
  constructor(e, t) {
    this._map = e, this._keySelector = t, this._cache = /* @__PURE__ */ new Map(), this._items = [];
  }
  dispose() {
    this._cache.forEach((e) => e.store.dispose()), this._cache.clear();
  }
  setItems(e) {
    const t = [], n = new Set(this._cache.keys());
    for (const r of e) {
      const s = this._keySelector ? this._keySelector(r) : r;
      let o = this._cache.get(s);
      if (o)
        n.delete(s);
      else {
        const a = new ke();
        o = { out: this._map(r, a), store: a }, this._cache.set(s, o);
      }
      t.push(o.out);
    }
    for (const r of n)
      this._cache.get(r).store.dispose(), this._cache.delete(r);
    this._items = t;
  }
  getItems() {
    return this._items;
  }
};
function _it(i) {
  return {
    createChangeSummary: (e) => ({
      changes: []
    }),
    handleChange(e, t) {
      for (const n in i)
        e.didChange(i[n]) && t.changes.push({ key: n, change: e.change });
      return !0;
    },
    beforeUpdate(e, t) {
      for (const n in i) {
        if (n === "changes")
          throw new Wt('property name "changes" is reserved for change tracking');
        t[n] = i[n].read(e);
      }
    }
  };
}
function bit(i) {
  let e;
  return {
    createChangeSummary: (t) => ({
      changes: []
    }),
    handleChange(t, n) {
      e || (e = i());
      for (const r in e)
        t.didChange(e[r]) && n.changes.push({ key: r, change: t.change });
      return !0;
    },
    beforeUpdate(t, n) {
      e || (e = i());
      for (const r in e) {
        if (r === "changes")
          throw new Wt('property name "changes" is reserved for change tracking');
        n[r] = e[r].read(t);
      }
    }
  };
}
function Br(i) {
  return new vit(i);
}
class vit extends bPe {
  constructor(e) {
    super(), this.value = e;
  }
  get debugName() {
    return this.toString();
  }
  get() {
    return this.value;
  }
  addObserver(e) {
  }
  removeObserver(e) {
  }
  toString() {
    return `Const: ${this.value}`;
  }
}
function Dd(i, e, t = ba.ofCaller()) {
  return new yit(typeof i == "string" ? i : new wl(i, void 0, void 0), e, t);
}
class yit extends jA {
  constructor(e, t, n) {
    super(n), this.event = t, this.handleEvent = () => {
      Fr((r) => {
        for (const s of this._observers)
          r.updateObserver(s, this), s.handleChange(this, void 0);
      }, () => this.debugName);
    }, this.debugName = typeof e == "string" ? e : e.getDebugName(this) ?? "Observable Signal From Event";
  }
  onFirstObserverAdded() {
    this.subscription = this.event(this.handleEvent);
  }
  onLastObserverRemoved() {
    this.subscription.dispose(), this.subscription = void 0;
  }
  get() {
  }
}
function rm(i, e) {
  let t, n = !0;
  return hit({
    changeTracker: {
      createChangeSummary: () => ({ deltas: [], didChange: !1 }),
      handleChange: (r, s) => {
        if (r.didChange(i)) {
          const o = r.change;
          o !== void 0 && s.deltas.push(o), s.didChange = !0;
        }
        return !0;
      }
    }
  }, (r, s) => {
    const o = i.read(r), a = t;
    s.didChange && (t = o, e(o, a, s.deltas)), n && (n = !1, t = o);
  });
}
function wPe(i, e) {
  const t = new ke(), n = rm(i, (r, s, o) => {
    t.clear(), e(r, s, o, t);
  });
  return {
    dispose() {
      n.dispose(), t.dispose();
    }
  };
}
function Cit(i, e) {
  return wPe(i, (t, n, r, s) => {
    e(t, n, r, eie(s));
  });
}
function wit(i, e) {
  return u0(i, (t, n) => n ?? e(t));
}
function nN(i, e) {
  switch (typeof i) {
    case "number":
      return "" + i;
    case "string":
      return i.length + 2 <= e ? `"${i}"` : `"${i.substr(0, e - 7)}"+...`;
    case "boolean":
      return i ? "true" : "false";
    case "undefined":
      return "undefined";
    case "object":
      return i === null ? "null" : Array.isArray(i) ? Sit(i, e) : Eit(i, e);
    case "symbol":
      return i.toString();
    case "function":
      return `[[Function${i.name ? " " + i.name : ""}]]`;
    default:
      return "" + i;
  }
}
function Sit(i, e) {
  let t = "[ ", n = !0;
  for (const r of i) {
    if (n || (t += ", "), t.length - 5 > e) {
      t += "...";
      break;
    }
    n = !1, t += `${nN(r, e - t.length)}`;
  }
  return t += " ]", t;
}
function Eit(i, e) {
  if (typeof i.toString == "function" && i.toString !== Object.prototype.toString) {
    const s = i.toString();
    return s.length <= e ? s : s.substring(0, e - 3) + "...";
  }
  const t = dPe(i);
  let n = t ? t + "(" : "{ ", r = !0;
  for (const [s, o] of Object.entries(i)) {
    if (r || (n += ", "), n.length - 5 > e) {
      n += "...";
      break;
    }
    r = !1, n += `${s}: ${nN(o, e - n.length)}`;
  }
  return n += t ? ")" : " }", n;
}
class Qhe {
  static createClient(e, t) {
    return new Qhe(e, t);
  }
  constructor(e, t) {
    this._channelFactory = e, this._getHandler = t, this._channel = this._channelFactory({
      handleNotification: (s) => {
        const o = s, a = this._getHandler().notifications[o[0]];
        if (!a)
          throw new Error(`Unknown notification "${o[0]}"!`);
        a(...o[1]);
      },
      handleRequest: (s) => {
        const o = s;
        try {
          return { type: "result", value: this._getHandler().requests[o[0]](...o[1]) };
        } catch (a) {
          return { type: "error", value: a };
        }
      }
    });
    const n = new Proxy({}, {
      get: (s, o) => async (...a) => {
        const l = await this._channel.sendRequest([o, a]);
        if (l.type === "error")
          throw l.value;
        return l.value;
      }
    }), r = new Proxy({}, {
      get: (s, o) => (...a) => {
        this._channel.sendNotification([o, a]);
      }
    });
    this.api = { notifications: r, requests: n };
  }
}
function xit(i, e) {
  const t = globalThis;
  let n = [], r;
  const { channel: s, handler: o } = Lit({
    sendNotification: (l) => {
      r ? r.sendNotification(l) : n.push(l);
    }
  });
  let a;
  return (t.$$debugValueEditor_debugChannels ?? (t.$$debugValueEditor_debugChannels = {}))[i] = (l) => {
    a = e(), r = l;
    for (const c of n)
      l.sendNotification(c);
    return n = [], o;
  }, Qhe.createClient(s, () => {
    if (!a)
      throw new Error("Not supported");
    return a;
  });
}
function Lit(i) {
  let e;
  return {
    channel: (n) => (e = n, {
      sendNotification: (r) => {
        i.sendNotification(r);
      },
      sendRequest: (r) => {
        throw new Error("not supported");
      }
    }),
    handler: {
      handleRequest: (n) => n.type === "notification" ? e == null ? void 0 : e.handleNotification(n.data) : e == null ? void 0 : e.handleRequest(n.data)
    }
  };
}
class Tit {
  constructor() {
    this._timeout = void 0;
  }
  throttle(e, t) {
    this._timeout === void 0 && (this._timeout = setTimeout(() => {
      this._timeout = void 0, e();
    }, t));
  }
  dispose() {
    this._timeout !== void 0 && clearTimeout(this._timeout);
  }
}
function SPe(i, e) {
  for (const t in e)
    i[t] && typeof i[t] == "object" && e[t] && typeof e[t] == "object" ? SPe(i[t], e[t]) : i[t] = e[t];
}
function EPe(i, e) {
  for (const t in e)
    e[t] === null ? delete i[t] : i[t] && typeof i[t] == "object" && e[t] && typeof e[t] == "object" ? EPe(i[t], e[t]) : i[t] = e[t];
}
const JE = class JE {
  static getInstance() {
    return JE._instance === void 0 && (JE._instance = new JE()), JE._instance;
  }
  getTransactionState() {
    const e = [], t = [...this._activeTransactions];
    if (t.length === 0)
      return;
    const n = t.flatMap((s) => s.debugGetUpdatingObservers() ?? []).map((s) => s.observer), r = /* @__PURE__ */ new Set();
    for (; n.length > 0; ) {
      const s = n.shift();
      if (r.has(s))
        continue;
      r.add(s);
      const o = this._getInfo(s, (a) => {
        r.has(a) || n.push(a);
      });
      o && e.push(o);
    }
    return { names: t.map((s) => s.getDebugName() ?? "tx"), affected: e };
  }
  _getObservableInfo(e) {
    const t = this._instanceInfos.get(e);
    if (!t) {
      fn(new Wt("No info found"));
      return;
    }
    return t;
  }
  _getAutorunInfo(e) {
    const t = this._instanceInfos.get(e);
    if (!t) {
      fn(new Wt("No info found"));
      return;
    }
    return t;
  }
  _getInfo(e, t) {
    if (e instanceof Tf) {
      const n = [...e.debugGetObservers()];
      for (const l of n)
        t(l);
      const r = this._getObservableInfo(e);
      if (!r)
        return;
      const s = e.debugGetState(), o = { name: e.debugName, instanceId: r.instanceId, updateCount: s.updateCount }, a = [...r.changedObservables].map((l) => {
        var c;
        return (c = this._instanceInfos.get(l)) == null ? void 0 : c.instanceId;
      }).filter(Aa);
      if (s.isComputing)
        return { ...o, type: "observable/derived", state: "updating", changedDependencies: a, initialComputation: !1 };
      switch (s.state) {
        case 0:
          return { ...o, type: "observable/derived", state: "noValue" };
        case 3:
          return { ...o, type: "observable/derived", state: "upToDate" };
        case 2:
          return { ...o, type: "observable/derived", state: "stale", changedDependencies: a };
        case 1:
          return { ...o, type: "observable/derived", state: "possiblyStale" };
      }
    } else if (e instanceof n4) {
      const n = this._getAutorunInfo(e);
      if (!n)
        return;
      const r = { name: e.debugName, instanceId: n.instanceId, updateCount: n.updateCount }, s = [...n.changedObservables].map((o) => this._instanceInfos.get(o).instanceId);
      if (e.debugGetState().isRunning)
        return { ...r, type: "autorun", state: "updating", changedDependencies: s };
      switch (e.debugGetState().state) {
        case 3:
          return { ...r, type: "autorun", state: "upToDate" };
        case 2:
          return { ...r, type: "autorun", state: "stale", changedDependencies: s };
        case 1:
          return { ...r, type: "autorun", state: "possiblyStale" };
      }
    }
  }
  _formatObservable(e) {
    const t = this._getObservableInfo(e);
    if (t)
      return { name: e.debugName, instanceId: t.instanceId };
  }
  _formatObserver(e) {
    var n;
    if (e instanceof Tf)
      return { name: e.toString(), instanceId: (n = this._getObservableInfo(e)) == null ? void 0 : n.instanceId };
    const t = this._getAutorunInfo(e);
    if (t)
      return { name: e.toString(), instanceId: t.instanceId };
  }
  constructor() {
    this._declarationId = 0, this._instanceId = 0, this._declarations = /* @__PURE__ */ new Map(), this._instanceInfos = /* @__PURE__ */ new WeakMap(), this._aliveInstances = /* @__PURE__ */ new Map(), this._activeTransactions = /* @__PURE__ */ new Set(), this._channel = xit("observableDevTools", () => ({
      notifications: {
        setDeclarationIdFilter: (e) => {
        },
        logObservableValue: (e) => {
          console.log("logObservableValue", e);
        },
        flushUpdates: () => {
          this._flushUpdates();
        },
        resetUpdates: () => {
          this._pendingChanges = null, this._channel.api.notifications.handleChange(this._fullState, !0);
        }
      },
      requests: {
        getDeclarations: () => {
          const e = {};
          for (const t of this._declarations.values())
            e[t.id] = t;
          return { decls: e };
        },
        getSummarizedInstances: () => null,
        getObservableValueInfo: (e) => ({
          observers: [...this._aliveInstances.get(e).debugGetObservers()].map((n) => this._formatObserver(n)).filter(Aa)
        }),
        getDerivedInfo: (e) => {
          const t = this._aliveInstances.get(e);
          return {
            dependencies: [...t.debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(Aa),
            observers: [...t.debugGetObservers()].map((n) => this._formatObserver(n)).filter(Aa)
          };
        },
        getAutorunInfo: (e) => ({
          dependencies: [...this._aliveInstances.get(e).debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(Aa)
        }),
        getTransactionState: () => this.getTransactionState(),
        setValue: (e, t) => {
          const n = this._aliveInstances.get(e);
          if (n instanceof Tf)
            n.debugSetValue(t);
          else if (n instanceof t4)
            n.debugSetValue(t);
          else if (n instanceof my)
            n.debugSetValue(t);
          else
            throw new Wt("Observable is not supported");
          const r = [...n.debugGetObservers()];
          for (const s of r)
            s.beginUpdate(n);
          for (const s of r)
            s.handleChange(n, void 0);
          for (const s of r)
            s.endUpdate(n);
        },
        getValue: (e) => {
          const t = this._aliveInstances.get(e);
          if (t instanceof Tf)
            return nN(t.debugGetState().value, 200);
          if (t instanceof t4)
            return nN(t.debugGetState().value, 200);
        },
        logValue: (e) => {
          const t = this._aliveInstances.get(e);
          if (t && "get" in t)
            console.log("Logged Value:", t.get());
          else
            throw new Wt("Observable is not supported");
        },
        rerun: (e) => {
          const t = this._aliveInstances.get(e);
          if (t instanceof Tf)
            t.debugRecompute();
          else if (t instanceof n4)
            t.debugRerun();
          else
            throw new Wt("Observable is not supported");
        }
      }
    })), this._pendingChanges = null, this._changeThrottler = new Tit(), this._fullState = {}, this._flushUpdates = () => {
      this._pendingChanges !== null && (this._channel.api.notifications.handleChange(this._pendingChanges, !1), this._pendingChanges = null);
    }, ba.enable();
  }
  _handleChange(e) {
    EPe(this._fullState, e), this._pendingChanges === null ? this._pendingChanges = e : SPe(this._pendingChanges, e), this._changeThrottler.throttle(this._flushUpdates, 10);
  }
  _getDeclarationId(e, t) {
    if (!t)
      return -1;
    let n = this._declarations.get(t.id);
    return n === void 0 && (n = {
      id: this._declarationId++,
      type: e,
      url: t.fileName,
      line: t.line,
      column: t.column
    }, this._declarations.set(t.id, n), this._handleChange({ decls: { [n.id]: n } })), n.id;
  }
  handleObservableCreated(e, t) {
    const r = {
      declarationId: this._getDeclarationId("observable/value", t),
      instanceId: this._instanceId++,
      listenerCount: 0,
      lastValue: void 0,
      updateCount: 0,
      changedObservables: /* @__PURE__ */ new Set()
    };
    this._instanceInfos.set(e, r);
  }
  handleOnListenerCountChanged(e, t) {
    const n = this._getObservableInfo(e);
    if (n) {
      if (n.listenerCount === 0 && t > 0) {
        const r = e instanceof Tf ? "observable/derived" : "observable/value";
        this._aliveInstances.set(n.instanceId, e), this._handleChange({
          instances: {
            [n.instanceId]: {
              instanceId: n.instanceId,
              declarationId: n.declarationId,
              formattedValue: n.lastValue,
              type: r,
              name: e.debugName
            }
          }
        });
      } else n.listenerCount > 0 && t === 0 && (this._handleChange({
        instances: { [n.instanceId]: null }
      }), this._aliveInstances.delete(n.instanceId));
      n.listenerCount = t;
    }
  }
  handleObservableUpdated(e, t) {
    if (e instanceof Tf) {
      this._handleDerivedRecomputed(e, t);
      return;
    }
    const n = this._getObservableInfo(e);
    n && t.didChange && (n.lastValue = nN(t.newValue, 30), n.listenerCount > 0 && this._handleChange({
      instances: { [n.instanceId]: { formattedValue: n.lastValue } }
    }));
  }
  handleAutorunCreated(e, t) {
    const r = {
      declarationId: this._getDeclarationId("autorun", t),
      instanceId: this._instanceId++,
      updateCount: 0,
      changedObservables: /* @__PURE__ */ new Set()
    };
    this._instanceInfos.set(e, r), this._aliveInstances.set(r.instanceId, e), r && this._handleChange({
      instances: {
        [r.instanceId]: {
          instanceId: r.instanceId,
          declarationId: r.declarationId,
          runCount: 0,
          type: "autorun",
          name: e.debugName
        }
      }
    });
  }
  handleAutorunDisposed(e) {
    const t = this._getAutorunInfo(e);
    t && (this._handleChange({
      instances: { [t.instanceId]: null }
    }), this._instanceInfos.delete(e), this._aliveInstances.delete(t.instanceId));
  }
  handleAutorunDependencyChanged(e, t, n) {
    const r = this._getAutorunInfo(e);
    r && r.changedObservables.add(t);
  }
  handleAutorunStarted(e) {
  }
  handleAutorunFinished(e) {
    const t = this._getAutorunInfo(e);
    t && (t.changedObservables.clear(), t.updateCount++, this._handleChange({
      instances: { [t.instanceId]: { runCount: t.updateCount } }
    }));
  }
  handleDerivedDependencyChanged(e, t, n) {
    const r = this._getObservableInfo(e);
    r && r.changedObservables.add(t);
  }
  _handleDerivedRecomputed(e, t) {
    const n = this._getObservableInfo(e);
    if (!n)
      return;
    const r = nN(t.newValue, 30);
    n.updateCount++, n.changedObservables.clear(), n.lastValue = r, n.listenerCount > 0 && this._handleChange({
      instances: { [n.instanceId]: { formattedValue: r, recomputationCount: n.updateCount } }
    });
  }
  handleDerivedCleared(e) {
    const t = this._getObservableInfo(e);
    t && (t.lastValue = void 0, t.changedObservables.clear(), t.listenerCount > 0 && this._handleChange({
      instances: {
        [t.instanceId]: {
          formattedValue: void 0
        }
      }
    }));
  }
  handleBeginTransaction(e) {
    this._activeTransactions.add(e);
  }
  handleEndTransaction(e) {
    this._activeTransactions.delete(e);
  }
};
JE._instance = void 0;
let mie = JE;
rie && rie.VSCODE_DEV_DEBUG_OBSERVABLES && rit(mie.getInstance());
const { getWindow: At, getDocument: kit, getWindows: xPe, getWindowsCount: Dit, getWindowId: i4, getWindowById: Bxe, onDidRegisterWindow: vB, onWillUnregisterWindow: Iit, onDidUnregisterWindow: Nit } = (function() {
  const i = /* @__PURE__ */ new Map();
  utt(fr, 1);
  const e = { window: fr, disposables: new ke() };
  i.set(fr.vscodeWindowId, e);
  const t = new he(), n = new he(), r = new he();
  function s(o, a) {
    return (typeof o == "number" ? i.get(o) : void 0) ?? (a ? e : void 0);
  }
  return {
    onDidRegisterWindow: t.event,
    onWillUnregisterWindow: r.event,
    onDidUnregisterWindow: n.event,
    registerWindow(o) {
      if (i.has(o.vscodeWindowId))
        return ge.None;
      const a = new ke(), l = {
        window: o,
        disposables: a.add(new ke())
      };
      return i.set(o.vscodeWindowId, l), a.add(Et(() => {
        i.delete(o.vscodeWindowId), n.fire(o);
      })), a.add(Ce(o, Xe.BEFORE_UNLOAD, () => {
        r.fire(o);
      })), t.fire(l), a;
    },
    getWindows() {
      return i.values();
    },
    getWindowsCount() {
      return i.size;
    },
    getWindowId(o) {
      return o.vscodeWindowId;
    },
    hasWindow(o) {
      return i.has(o);
    },
    getWindowById: s,
    getWindow(o) {
      var c;
      const a = o;
      if ((c = a == null ? void 0 : a.ownerDocument) != null && c.defaultView)
        return a.ownerDocument.defaultView.window;
      const l = o;
      return l != null && l.view ? l.view.window : fr;
    },
    getDocument(o) {
      return At(o).document;
    }
  };
})();
function Xa(i) {
  for (; i.firstChild; )
    i.firstChild.remove();
}
class Rit {
  constructor(e, t, n, r) {
    this._node = e, this._type = t, this._handler = n, this._options = r || !1, this._node.addEventListener(this._type, this._handler, this._options);
  }
  dispose() {
    this._handler && (this._node.removeEventListener(this._type, this._handler, this._options), this._node = null, this._handler = null);
  }
}
function Ce(i, e, t, n) {
  return new Rit(i, e, t, n);
}
function LPe(i, e) {
  return function(t) {
    return e(new vl(i, t));
  };
}
function Ait(i) {
  return function(e) {
    return i(new wr(e));
  };
}
const vo = function(e, t, n, r) {
  let s = n;
  return t === "click" || t === "mousedown" || t === "contextmenu" ? s = LPe(At(e), n) : (t === "keydown" || t === "keypress" || t === "keyup") && (s = Ait(n)), Ce(e, t, s, r);
}, Oit = function(e, t, n) {
  const r = LPe(At(e), t);
  return TPe(e, r, n);
};
function TPe(i, e, t) {
  return Ce(i, jf && fB.pointerEvents ? Xe.POINTER_DOWN : Xe.MOUSE_DOWN, e, t);
}
function Mit(i, e, t) {
  return Ce(i, jf && fB.pointerEvents ? Xe.POINTER_MOVE : Xe.MOUSE_MOVE, e, t);
}
function Hxe(i, e, t) {
  return Ce(i, jf && fB.pointerEvents ? Xe.POINTER_UP : Xe.MOUSE_UP, e, t);
}
function UP(i, e, t) {
  return yF(i, e, t);
}
class BJ extends jMe {
  constructor(e, t) {
    super(e, t);
  }
}
let FV, Ju;
class yq extends Ahe {
  /**
   *
   * @param node The optional node from which the target window is determined
   */
  constructor(e) {
    super(), this.defaultTarget = e && At(e);
  }
  cancelAndSet(e, t, n) {
    return super.cancelAndSet(e, t, n ?? this.defaultTarget);
  }
}
class HJ {
  constructor(e, t = 0) {
    this._runner = e, this.priority = t, this._canceled = !1;
  }
  dispose() {
    this._canceled = !0;
  }
  execute() {
    if (!this._canceled)
      try {
        this._runner();
      } catch (e) {
        fn(e);
      }
  }
  // Sort by priority (largest to lowest)
  static sort(e, t) {
    return t.priority - e.priority;
  }
}
(function() {
  const i = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = (s) => {
    t.set(s, !1);
    const o = i.get(s) ?? [];
    for (e.set(s, o), i.set(s, []), n.set(s, !0); o.length > 0; )
      o.sort(HJ.sort), o.shift().execute();
    n.set(s, !1);
  };
  Ju = (s, o, a = 0) => {
    const l = i4(s), c = new HJ(o, a);
    let u = i.get(l);
    return u || (u = [], i.set(l, u)), u.push(c), t.get(l) || (t.set(l, !0), s.requestAnimationFrame(() => r(l))), c;
  }, FV = (s, o, a) => {
    const l = i4(s);
    if (n.get(l)) {
      const c = new HJ(o, a);
      let u = e.get(l);
      return u || (u = [], e.set(l, u)), u.push(c), c;
    } else
      return Ju(s, o, a);
  };
})();
function Cq(i) {
  return At(i).getComputedStyle(i, null);
}
function nw(i, e, t) {
  const n = At(i), r = n.document;
  if (i !== r.body)
    return new Ji(i.clientWidth, i.clientHeight);
  if (jf && (n != null && n.visualViewport))
    return new Ji(n.visualViewport.width, n.visualViewport.height);
  if (n != null && n.innerWidth && n.innerHeight)
    return new Ji(n.innerWidth, n.innerHeight);
  if (r.body && r.body.clientWidth && r.body.clientHeight)
    return new Ji(r.body.clientWidth, r.body.clientHeight);
  if (r.documentElement && r.documentElement.clientWidth && r.documentElement.clientHeight)
    return new Ji(r.documentElement.clientWidth, r.documentElement.clientHeight);
  throw new Error("Unable to figure out browser width and height");
}
class bo {
  // Adapted from WinJS
  // Converts a CSS positioning string for the specified element to pixels.
  static convertToPixels(e, t) {
    return parseFloat(t) || 0;
  }
  static getDimension(e, t) {
    const n = Cq(e), r = n ? n.getPropertyValue(t) : "0";
    return bo.convertToPixels(e, r);
  }
  static getBorderLeftWidth(e) {
    return bo.getDimension(e, "border-left-width");
  }
  static getBorderRightWidth(e) {
    return bo.getDimension(e, "border-right-width");
  }
  static getBorderTopWidth(e) {
    return bo.getDimension(e, "border-top-width");
  }
  static getBorderBottomWidth(e) {
    return bo.getDimension(e, "border-bottom-width");
  }
  static getPaddingLeft(e) {
    return bo.getDimension(e, "padding-left");
  }
  static getPaddingRight(e) {
    return bo.getDimension(e, "padding-right");
  }
  static getPaddingTop(e) {
    return bo.getDimension(e, "padding-top");
  }
  static getPaddingBottom(e) {
    return bo.getDimension(e, "padding-bottom");
  }
  static getMarginLeft(e) {
    return bo.getDimension(e, "margin-left");
  }
  static getMarginTop(e) {
    return bo.getDimension(e, "margin-top");
  }
  static getMarginRight(e) {
    return bo.getDimension(e, "margin-right");
  }
  static getMarginBottom(e) {
    return bo.getDimension(e, "margin-bottom");
  }
}
const ex = class ex {
  constructor(e, t) {
    this.width = e, this.height = t;
  }
  with(e = this.width, t = this.height) {
    return e !== this.width || t !== this.height ? new ex(e, t) : this;
  }
  static is(e) {
    return typeof e == "object" && typeof e.height == "number" && typeof e.width == "number";
  }
  static lift(e) {
    return e instanceof ex ? e : new ex(e.width, e.height);
  }
  static equals(e, t) {
    return e === t ? !0 : !e || !t ? !1 : e.width === t.width && e.height === t.height;
  }
};
ex.None = new ex(0, 0);
let Ji = ex;
function kPe(i) {
  let e = i.offsetParent, t = i.offsetTop, n = i.offsetLeft;
  for (; (i = i.parentNode) !== null && i !== i.ownerDocument.body && i !== i.ownerDocument.documentElement; ) {
    t -= i.scrollTop;
    const r = IPe(i) ? null : Cq(i);
    r && (n -= r.direction !== "rtl" ? i.scrollLeft : -i.scrollLeft), i === e && (n += bo.getBorderLeftWidth(i), t += bo.getBorderTopWidth(i), t += i.offsetTop, n += i.offsetLeft, e = i.offsetParent);
  }
  return {
    left: n,
    top: t
  };
}
function Pit(i, e, t) {
  typeof e == "number" && (i.style.width = `${e}px`), typeof t == "number" && (i.style.height = `${t}px`);
}
function ho(i) {
  const e = i.getBoundingClientRect(), t = At(i);
  return {
    left: e.left + t.scrollX,
    top: e.top + t.scrollY,
    width: e.width,
    height: e.height
  };
}
function DPe(i) {
  let e = i, t = 1;
  do {
    const n = Cq(e).zoom;
    n != null && n !== "1" && (t *= n), e = e.parentElement;
  } while (e !== null && e !== e.ownerDocument.documentElement);
  return t;
}
function Td(i) {
  const e = bo.getMarginLeft(i) + bo.getMarginRight(i);
  return i.offsetWidth + e;
}
function WJ(i) {
  const e = bo.getBorderLeftWidth(i) + bo.getBorderRightWidth(i), t = bo.getPaddingLeft(i) + bo.getPaddingRight(i);
  return i.offsetWidth - e - t;
}
function Fit(i) {
  const e = bo.getBorderTopWidth(i) + bo.getBorderBottomWidth(i), t = bo.getPaddingTop(i) + bo.getPaddingBottom(i);
  return i.offsetHeight - e - t;
}
function _y(i) {
  const e = bo.getMarginTop(i) + bo.getMarginBottom(i);
  return i.offsetHeight + e;
}
function pa(i, e) {
  return !!(e != null && e.contains(i));
}
function Bit(i, e, t) {
  for (; i && i.nodeType === i.ELEMENT_NODE; ) {
    if (i.classList.contains(e))
      return i;
    if (t) {
      if (typeof t == "string") {
        if (i.classList.contains(t))
          return null;
      } else if (i === t)
        return null;
    }
    i = i.parentNode;
  }
  return null;
}
function VJ(i, e, t) {
  return !!Bit(i, e, t);
}
function IPe(i) {
  return i && !!i.host && !!i.mode;
}
function BV(i) {
  return !!iw(i);
}
function iw(i) {
  var e;
  for (; i.parentNode; ) {
    if (i === ((e = i.ownerDocument) == null ? void 0 : e.body))
      return null;
    i = i.parentNode;
  }
  return IPe(i) ? i : null;
}
function ea() {
  let i = yB().activeElement;
  for (; i != null && i.shadowRoot; )
    i = i.shadowRoot.activeElement;
  return i;
}
function wq(i) {
  return ea() === i;
}
function NPe(i) {
  return pa(ea(), i);
}
function yB() {
  return Dit() <= 1 ? fr.document : Array.from(xPe()).map(({ window: e }) => e.document).find((e) => e.hasFocus()) ?? fr.document;
}
function rr() {
  var e;
  return ((e = yB().defaultView) == null ? void 0 : e.window) ?? fr;
}
const Hit = new class {
  constructor() {
    this.mutationObservers = /* @__PURE__ */ new Map();
  }
  observe(i, e, t) {
    let n = this.mutationObservers.get(i);
    n || (n = /* @__PURE__ */ new Map(), this.mutationObservers.set(i, n));
    const r = bB(t);
    let s = n.get(r);
    if (s)
      s.users += 1;
    else {
      const o = new he(), a = new MutationObserver((c) => o.fire(c));
      a.observe(i, t);
      const l = s = {
        users: 1,
        observer: a,
        onDidMutate: o.event
      };
      e.add(Et(() => {
        l.users -= 1, l.users === 0 && (o.dispose(), a.disconnect(), n == null || n.delete(r), (n == null ? void 0 : n.size) === 0 && this.mutationObservers.delete(i));
      })), n.set(r, s);
    }
    return s.onDidMutate;
  }
}();
function eo(i) {
  return i instanceof HTMLElement || i instanceof At(i).HTMLElement;
}
function Wxe(i) {
  return i instanceof HTMLAnchorElement || i instanceof At(i).HTMLAnchorElement;
}
function RPe(i) {
  return i instanceof SVGElement || i instanceof At(i).SVGElement;
}
function Jhe(i) {
  return i instanceof MouseEvent || i instanceof At(i).MouseEvent;
}
function sy(i) {
  return i instanceof KeyboardEvent || i instanceof At(i).KeyboardEvent;
}
const Xe = {
  // Mouse
  CLICK: "click",
  AUXCLICK: "auxclick",
  DBLCLICK: "dblclick",
  MOUSE_UP: "mouseup",
  MOUSE_DOWN: "mousedown",
  MOUSE_OVER: "mouseover",
  MOUSE_MOVE: "mousemove",
  MOUSE_OUT: "mouseout",
  MOUSE_ENTER: "mouseenter",
  MOUSE_LEAVE: "mouseleave",
  MOUSE_WHEEL: "wheel",
  POINTER_UP: "pointerup",
  POINTER_DOWN: "pointerdown",
  POINTER_MOVE: "pointermove",
  POINTER_LEAVE: "pointerleave",
  CONTEXT_MENU: "contextmenu",
  // Keyboard
  KEY_DOWN: "keydown",
  KEY_UP: "keyup",
  BEFORE_UNLOAD: "beforeunload",
  FOCUS: "focus",
  FOCUS_IN: "focusin",
  FOCUS_OUT: "focusout",
  BLUR: "blur",
  INPUT: "input",
  // Drag
  DRAG_START: "dragstart",
  DRAG: "drag",
  DRAG_ENTER: "dragenter",
  DRAG_LEAVE: "dragleave",
  DRAG_OVER: "dragover",
  DROP: "drop",
  DRAG_END: "dragend"
};
function Wit(i) {
  const e = i;
  return !!(e && typeof e.preventDefault == "function" && typeof e.stopPropagation == "function");
}
const Mi = {
  stop: (i, e) => (i.preventDefault(), e && i.stopPropagation(), i)
};
function Vit(i) {
  const e = [];
  for (let t = 0; i && i.nodeType === i.ELEMENT_NODE; t++)
    e[t] = i.scrollTop, i = i.parentNode;
  return e;
}
function Uit(i, e) {
  for (let t = 0; i && i.nodeType === i.ELEMENT_NODE; t++)
    i.scrollTop !== e[t] && (i.scrollTop = e[t]), i = i.parentNode;
}
let zit = class _ie extends ge {
  get onDidFocus() {
    return this._onDidFocus.event;
  }
  get onDidBlur() {
    return this._onDidBlur.event;
  }
  static hasFocusWithin(e) {
    if (eo(e)) {
      const t = iw(e), n = t ? t.activeElement : e.ownerDocument.activeElement;
      return pa(n, e);
    } else {
      const t = e;
      return pa(t.document.activeElement, t.document);
    }
  }
  constructor(e) {
    super(), this._onDidFocus = this._register(new he()), this._onDidBlur = this._register(new he());
    let t = _ie.hasFocusWithin(e), n = !1;
    const r = () => {
      n = !1, t || (t = !0, this._onDidFocus.fire());
    }, s = () => {
      t && (n = !0, (eo(e) ? At(e) : e).setTimeout(() => {
        n && (n = !1, t = !1, this._onDidBlur.fire());
      }, 0));
    };
    this._refreshStateHandler = () => {
      _ie.hasFocusWithin(e) !== t && (t ? s() : r());
    }, this._register(Ce(e, Xe.FOCUS, r, !0)), this._register(Ce(e, Xe.BLUR, s, !0)), eo(e) && (this._register(Ce(e, Xe.FOCUS_IN, () => this._refreshStateHandler())), this._register(Ce(e, Xe.FOCUS_OUT, () => this._refreshStateHandler())));
  }
};
function qf(i) {
  return new zit(i);
}
function $it(i, e) {
  return i.after(e), e;
}
function Fe(i, ...e) {
  if (i.append(...e), e.length === 1 && typeof e[0] != "string")
    return e[0];
}
function Sq(i, e) {
  return i.insertBefore(e, i.firstChild), e;
}
function ma(i, ...e) {
  i.textContent = "", Fe(i, ...e);
}
const jit = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;
var r4;
(function(i) {
  i.HTML = "http://www.w3.org/1999/xhtml", i.SVG = "http://www.w3.org/2000/svg";
})(r4 || (r4 = {}));
function APe(i, e, t, ...n) {
  const r = jit.exec(e);
  if (!r)
    throw new Error("Bad use of emmet");
  const s = r[1] || "div";
  let o;
  return i !== r4.HTML ? o = document.createElementNS(i, s) : o = document.createElement(s), r[3] && (o.id = r[3]), r[4] && (o.className = r[4].replace(/\./g, " ").trim()), t && Object.entries(t).forEach(([a, l]) => {
    typeof l > "u" || (/^on\w+$/.test(a) ? o[a] = l : a === "selected" ? l && o.setAttribute(a, "true") : o.setAttribute(a, l));
  }), o.append(...n), o;
}
function Ge(i, e, ...t) {
  return APe(r4.HTML, i, e, ...t);
}
Ge.SVG = function(i, e, ...t) {
  return APe(r4.SVG, i, e, ...t);
};
function Git(i, ...e) {
  i ? Id(...e) : eu(...e);
}
function Id(...i) {
  for (const e of i)
    e.style.display = "", e.removeAttribute("aria-hidden");
}
function eu(...i) {
  for (const e of i)
    e.style.display = "none", e.setAttribute("aria-hidden", "true");
}
function Vxe(i, e) {
  const t = i.devicePixelRatio * e;
  return Math.max(1, Math.floor(t)) / i.devicePixelRatio;
}
function OPe(i) {
  fr.open(i, "_blank", "noopener");
}
function qit(i, e) {
  const t = () => {
    e(), n = Ju(i, t);
  };
  let n = Ju(i, t);
  return Et(() => n.dispose());
}
cPe.setPreferredWebSchema(/^https:/.test(fr.location.href) ? "https" : "http");
class by extends he {
  constructor() {
    super(), this._subscriptions = new ke(), this._keyStatus = {
      altKey: !1,
      shiftKey: !1,
      ctrlKey: !1,
      metaKey: !1
    }, this._subscriptions.add(Ze.runAndSubscribe(vB, ({ window: e, disposables: t }) => this.registerListeners(e, t), { window: fr, disposables: this._subscriptions }));
  }
  registerListeners(e, t) {
    t.add(Ce(e, "keydown", (n) => {
      if (n.defaultPrevented)
        return;
      const r = new wr(n);
      if (!(r.keyCode === 6 && n.repeat)) {
        if (n.altKey && !this._keyStatus.altKey)
          this._keyStatus.lastKeyPressed = "alt";
        else if (n.ctrlKey && !this._keyStatus.ctrlKey)
          this._keyStatus.lastKeyPressed = "ctrl";
        else if (n.metaKey && !this._keyStatus.metaKey)
          this._keyStatus.lastKeyPressed = "meta";
        else if (n.shiftKey && !this._keyStatus.shiftKey)
          this._keyStatus.lastKeyPressed = "shift";
        else if (r.keyCode !== 6)
          this._keyStatus.lastKeyPressed = void 0;
        else
          return;
        this._keyStatus.altKey = n.altKey, this._keyStatus.ctrlKey = n.ctrlKey, this._keyStatus.metaKey = n.metaKey, this._keyStatus.shiftKey = n.shiftKey, this._keyStatus.lastKeyPressed && (this._keyStatus.event = n, this.fire(this._keyStatus));
      }
    }, !0)), t.add(Ce(e, "keyup", (n) => {
      n.defaultPrevented || (!n.altKey && this._keyStatus.altKey ? this._keyStatus.lastKeyReleased = "alt" : !n.ctrlKey && this._keyStatus.ctrlKey ? this._keyStatus.lastKeyReleased = "ctrl" : !n.metaKey && this._keyStatus.metaKey ? this._keyStatus.lastKeyReleased = "meta" : !n.shiftKey && this._keyStatus.shiftKey ? this._keyStatus.lastKeyReleased = "shift" : this._keyStatus.lastKeyReleased = void 0, this._keyStatus.lastKeyPressed !== this._keyStatus.lastKeyReleased && (this._keyStatus.lastKeyPressed = void 0), this._keyStatus.altKey = n.altKey, this._keyStatus.ctrlKey = n.ctrlKey, this._keyStatus.metaKey = n.metaKey, this._keyStatus.shiftKey = n.shiftKey, this._keyStatus.lastKeyReleased && (this._keyStatus.event = n, this.fire(this._keyStatus)));
    }, !0)), t.add(Ce(e.document.body, "mousedown", () => {
      this._keyStatus.lastKeyPressed = void 0;
    }, !0)), t.add(Ce(e.document.body, "mouseup", () => {
      this._keyStatus.lastKeyPressed = void 0;
    }, !0)), t.add(Ce(e.document.body, "mousemove", (n) => {
      n.buttons && (this._keyStatus.lastKeyPressed = void 0);
    }, !0)), t.add(Ce(e, "blur", () => {
      this.resetKeyStatus();
    }));
  }
  get keyStatus() {
    return this._keyStatus;
  }
  /**
   * Allows to explicitly reset the key status based on more knowledge (#109062)
   */
  resetKeyStatus() {
    this.doResetKeyStatus(), this.fire(this._keyStatus);
  }
  doResetKeyStatus() {
    this._keyStatus = {
      altKey: !1,
      shiftKey: !1,
      ctrlKey: !1,
      metaKey: !1
    };
  }
  static getInstance() {
    return by.instance || (by.instance = new by()), by.instance;
  }
  dispose() {
    super.dispose(), this._subscriptions.dispose();
  }
}
class Kit extends ge {
  constructor(e, t) {
    super(), this.element = e, this.callbacks = t, this.counter = 0, this.dragStartTime = 0, this.registerListeners();
  }
  registerListeners() {
    this.callbacks.onDragStart && this._register(Ce(this.element, Xe.DRAG_START, (e) => {
      var t, n;
      (n = (t = this.callbacks).onDragStart) == null || n.call(t, e);
    })), this.callbacks.onDrag && this._register(Ce(this.element, Xe.DRAG, (e) => {
      var t, n;
      (n = (t = this.callbacks).onDrag) == null || n.call(t, e);
    })), this._register(Ce(this.element, Xe.DRAG_ENTER, (e) => {
      var t, n;
      this.counter++, this.dragStartTime = e.timeStamp, (n = (t = this.callbacks).onDragEnter) == null || n.call(t, e);
    })), this._register(Ce(this.element, Xe.DRAG_OVER, (e) => {
      var t, n;
      e.preventDefault(), (n = (t = this.callbacks).onDragOver) == null || n.call(t, e, e.timeStamp - this.dragStartTime);
    })), this._register(Ce(this.element, Xe.DRAG_LEAVE, (e) => {
      var t, n;
      this.counter--, this.counter === 0 && (this.dragStartTime = 0, (n = (t = this.callbacks).onDragLeave) == null || n.call(t, e));
    })), this._register(Ce(this.element, Xe.DRAG_END, (e) => {
      var t, n;
      this.counter = 0, this.dragStartTime = 0, (n = (t = this.callbacks).onDragEnd) == null || n.call(t, e);
    })), this._register(Ce(this.element, Xe.DROP, (e) => {
      var t, n;
      this.counter = 0, this.dragStartTime = 0, (n = (t = this.callbacks).onDrop) == null || n.call(t, e);
    }));
  }
}
const Yit = /(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;
function Li(i, ...e) {
  let t, n;
  Array.isArray(e[0]) ? (t = {}, n = e[0]) : (t = e[0] || {}, n = e[1]);
  const r = Yit.exec(i);
  if (!r || !r.groups)
    throw new Error("Bad use of h");
  const s = r.groups.tag || "div", o = document.createElement(s);
  r.groups.id && (o.id = r.groups.id);
  const a = [];
  if (r.groups.class)
    for (const c of r.groups.class.split("."))
      c !== "" && a.push(c);
  if (t.className !== void 0)
    for (const c of t.className.split("."))
      c !== "" && a.push(c);
  a.length > 0 && (o.className = a.join(" "));
  const l = {};
  if (r.groups.name && (l[r.groups.name] = o), n)
    for (const c of n)
      eo(c) ? o.appendChild(c) : typeof c == "string" ? o.append(c) : "root" in c && (Object.assign(l, c), o.appendChild(c.root));
  for (const [c, u] of Object.entries(t))
    if (c !== "className")
      if (c === "style")
        for (const [d, h] of Object.entries(u))
          o.style.setProperty(s4(d), typeof h == "number" ? h + "px" : "" + h);
      else c === "tabIndex" ? o.tabIndex = u : o.setAttribute(s4(c), u.toString());
  return l.root = o, l;
}
function s4(i) {
  return i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
}
function sm(i) {
  return i.tagName.toLowerCase() === "input" || i.tagName.toLowerCase() === "textarea" || eo(i) && !!i.editContext;
}
var Tn;
(function(i) {
  function e(r = void 0) {
    return (s, o, a) => {
      const l = o.class;
      delete o.class;
      const c = o.ref;
      delete o.ref;
      const u = o.obsRef;
      return delete o.obsRef, new Zit(s, c, u, r, l, o, a);
    };
  }
  function t(r, s = void 0) {
    const o = e(s);
    return (a, l) => o(r, a, l);
  }
  i.div = t("div"), i.elem = e(void 0), i.svg = t("svg", "http://www.w3.org/2000/svg"), i.svgElem = e("http://www.w3.org/2000/svg");
  function n() {
    let r;
    const s = function(o) {
      r = o;
    };
    return Object.defineProperty(s, "element", {
      get() {
        if (!r)
          throw new Wt("Make sure the ref is set before accessing the element. Maybe wrong initialization order?");
        return r;
      }
    }), s;
  }
  i.ref = n;
})(Tn || (Tn = {}));
class efe {
  constructor(e, t, n, r, s, o, a) {
    this._deriveds = [], this._element = r ? document.createElementNS(r, e) : document.createElement(e), t && t(this._element), n && this._deriveds.push(Ie((l) => {
      n(this), l.store.add({
        dispose: () => {
          n(null);
        }
      });
    })), s && (PPe(s) ? this._deriveds.push(Ie(this, (l) => {
      Uxe(this._element, zxe(s, l));
    })) : Uxe(this._element, zxe(s, void 0)));
    for (const [l, c] of Object.entries(o))
      if (l === "style")
        for (const [u, d] of Object.entries(c)) {
          const h = s4(u);
          ux(d) ? this._deriveds.push(pl({ owner: this, debugName: () => `set.style.${h}` }, (g) => {
            this._element.style.setProperty(h, $xe(d.read(g)));
          })) : this._element.style.setProperty(h, $xe(d));
        }
      else l === "tabIndex" ? ux(c) ? this._deriveds.push(Ie(this, (u) => {
        this._element.tabIndex = c.read(u);
      })) : this._element.tabIndex = c : l.startsWith("on") ? this._element[l] = c : ux(c) ? this._deriveds.push(pl({ owner: this, debugName: () => `set.${l}` }, (u) => {
        jxe(this._element, l, c.read(u));
      })) : jxe(this._element, l, c);
    if (a) {
      let l = function(u, d) {
        return ux(d) ? l(u, d.read(u)) : Array.isArray(d) ? d.flatMap((h) => l(u, h)) : d instanceof efe ? (u && d.readEffect(u), [d._element]) : d ? [d] : [];
      };
      const c = Ie(this, (u) => {
        this._element.replaceChildren(...l(u, a));
      });
      this._deriveds.push(c), FPe(a) || c.get();
    }
  }
  readEffect(e) {
    for (const t of this._deriveds)
      t.read(e);
  }
  keepUpdated(e) {
    return Ie((t) => {
      this.readEffect(t);
    }).recomputeInitiallyAndOnChange(e), this;
  }
  /**
   * Creates a live element that will keep the element updated as long as the returned object is not disposed.
  */
  toDisposableLiveElement() {
    const e = new ke();
    return this.keepUpdated(e), new Xit(this._element, e);
  }
}
function Uxe(i, e) {
  RPe(i) ? i.setAttribute("class", e) : i.className = e;
}
function MPe(i, e, t) {
  if (ux(i)) {
    t(i.read(e));
    return;
  }
  if (Array.isArray(i)) {
    for (const n of i)
      MPe(n, e, t);
    return;
  }
  t(i);
}
function zxe(i, e) {
  let t = "";
  return MPe(i, e, (n) => {
    n && (t.length === 0 ? t = n : t += " " + n);
  }), t;
}
function PPe(i) {
  return ux(i) ? !0 : Array.isArray(i) ? i.some((e) => PPe(e)) : !1;
}
function $xe(i) {
  return typeof i == "number" ? i + "px" : i;
}
function FPe(i) {
  return ux(i) ? !0 : Array.isArray(i) ? i.some((e) => FPe(e)) : !1;
}
class Xit {
  constructor(e, t) {
    this.element = e, this._disposable = t;
  }
  dispose() {
    this._disposable.dispose();
  }
}
class Zit extends efe {
  constructor() {
    super(...arguments), this._isHovered = void 0, this._didMouseMoveDuringHover = void 0;
  }
  get element() {
    return this._element;
  }
  get isHovered() {
    if (!this._isHovered) {
      const e = Qt("hovered", !1);
      this._element.addEventListener("mouseenter", (t) => e.set(!0, void 0)), this._element.addEventListener("mouseleave", (t) => e.set(!1, void 0)), this._isHovered = e;
    }
    return this._isHovered;
  }
  get didMouseMoveDuringHover() {
    if (!this._didMouseMoveDuringHover) {
      let e = !1;
      const t = Qt("didMouseMoveDuringHover", !1);
      this._element.addEventListener("mouseenter", (n) => {
        e = !0;
      }), this._element.addEventListener("mousemove", (n) => {
        e && t.set(!0, void 0);
      }), this._element.addEventListener("mouseleave", (n) => {
        e = !1, t.set(!1, void 0);
      }), this._didMouseMoveDuringHover = t;
    }
    return this._didMouseMoveDuringHover;
  }
}
function jxe(i, e, t) {
  t == null ? i.removeAttribute(s4(e)) : i.setAttribute(s4(e), String(t));
}
function ux(i) {
  return !!i && i.read !== void 0 && i.reportChanges !== void 0;
}
const Gxe = 2e4;
let PE, CW, bie, wW, vie;
function Qit(i) {
  PE = document.createElement("div"), PE.className = "monaco-aria-container";
  const e = () => {
    const n = document.createElement("div");
    return n.className = "monaco-alert", n.setAttribute("role", "alert"), n.setAttribute("aria-atomic", "true"), PE.appendChild(n), n;
  };
  CW = e(), bie = e();
  const t = () => {
    const n = document.createElement("div");
    return n.className = "monaco-status", n.setAttribute("aria-live", "polite"), n.setAttribute("aria-atomic", "true"), PE.appendChild(n), n;
  };
  wW = t(), vie = t(), i.appendChild(PE);
}
function lu(i) {
  PE && (CW.textContent !== i ? (Xa(bie), HV(CW, i)) : (Xa(CW), HV(bie, i)));
}
function hb(i) {
  PE && (wW.textContent !== i ? (Xa(vie), HV(wW, i)) : (Xa(wW), HV(vie, i)));
}
function HV(i, e) {
  Xa(i), e.length > Gxe && (e = e.substr(0, Gxe)), i.textContent = e, i.style.visibility = "hidden", i.style.visibility = "visible";
}
var em;
(function(i) {
  i.serviceIds = /* @__PURE__ */ new Map(), i.DI_TARGET = "$di$target", i.DI_DEPENDENCIES = "$di$dependencies";
  function e(t) {
    return t[i.DI_DEPENDENCIES] || [];
  }
  i.getServiceDependencies = e;
})(em || (em = {}));
const xt = Vn("instantiationService");
function Jit(i, e, t) {
  e[em.DI_TARGET] === e ? e[em.DI_DEPENDENCIES].push({ id: i, index: t }) : (e[em.DI_DEPENDENCIES] = [{ id: i, index: t }], e[em.DI_TARGET] = e);
}
function Vn(i) {
  if (em.serviceIds.has(i))
    return em.serviceIds.get(i);
  const e = function(t, n, r) {
    if (arguments.length !== 3)
      throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
    Jit(e, t, r);
  };
  return e.toString = () => i, em.serviceIds.set(i, e), e;
}
const Ti = Vn("codeEditorService");
let de = class yE {
  constructor(e, t) {
    this.lineNumber = e, this.column = t;
  }
  /**
   * Create a new position from this position.
   *
   * @param newLineNumber new line number
   * @param newColumn new column
   */
  with(e = this.lineNumber, t = this.column) {
    return e === this.lineNumber && t === this.column ? this : new yE(e, t);
  }
  /**
   * Derive a new position from this position.
   *
   * @param deltaLineNumber line number delta
   * @param deltaColumn column delta
   */
  delta(e = 0, t = 0) {
    return this.with(Math.max(1, this.lineNumber + e), Math.max(1, this.column + t));
  }
  /**
   * Test if this position equals other position
   */
  equals(e) {
    return yE.equals(this, e);
  }
  /**
   * Test if position `a` equals position `b`
   */
  static equals(e, t) {
    return !e && !t ? !0 : !!e && !!t && e.lineNumber === t.lineNumber && e.column === t.column;
  }
  /**
   * Test if this position is before other position.
   * If the two positions are equal, the result will be false.
   */
  isBefore(e) {
    return yE.isBefore(this, e);
  }
  /**
   * Test if position `a` is before position `b`.
   * If the two positions are equal, the result will be false.
   */
  static isBefore(e, t) {
    return e.lineNumber < t.lineNumber ? !0 : t.lineNumber < e.lineNumber ? !1 : e.column < t.column;
  }
  /**
   * Test if this position is before other position.
   * If the two positions are equal, the result will be true.
   */
  isBeforeOrEqual(e) {
    return yE.isBeforeOrEqual(this, e);
  }
  /**
   * Test if position `a` is before position `b`.
   * If the two positions are equal, the result will be true.
   */
  static isBeforeOrEqual(e, t) {
    return e.lineNumber < t.lineNumber ? !0 : t.lineNumber < e.lineNumber ? !1 : e.column <= t.column;
  }
  /**
   * A function that compares positions, useful for sorting
   */
  static compare(e, t) {
    const n = e.lineNumber | 0, r = t.lineNumber | 0;
    if (n === r) {
      const s = e.column | 0, o = t.column | 0;
      return s - o;
    }
    return n - r;
  }
  /**
   * Clone this position.
   */
  clone() {
    return new yE(this.lineNumber, this.column);
  }
  /**
   * Convert to a human-readable representation.
   */
  toString() {
    return "(" + this.lineNumber + "," + this.column + ")";
  }
  // ---
  /**
   * Create a `Position` from an `IPosition`.
   */
  static lift(e) {
    return new yE(e.lineNumber, e.column);
  }
  /**
   * Test if `obj` is an `IPosition`.
   */
  static isIPosition(e) {
    return e && typeof e.lineNumber == "number" && typeof e.column == "number";
  }
  toJSON() {
    return {
      lineNumber: this.lineNumber,
      column: this.column
    };
  }
};
const xs = Vn("modelService"), Ic = Vn("textModelService");
class Vh extends ge {
  get onDidChange() {
    return this._onDidChange.event;
  }
  constructor(e, t = "", n = "", r = !0, s) {
    super(), this._onDidChange = this._register(new he()), this._enabled = !0, this._id = e, this._label = t, this._cssClass = n, this._enabled = r, this._actionCallback = s;
  }
  get id() {
    return this._id;
  }
  get label() {
    return this._label;
  }
  set label(e) {
    this._setLabel(e);
  }
  _setLabel(e) {
    this._label !== e && (this._label = e, this._onDidChange.fire({ label: e }));
  }
  get tooltip() {
    return this._tooltip || "";
  }
  set tooltip(e) {
    this._setTooltip(e);
  }
  _setTooltip(e) {
    this._tooltip !== e && (this._tooltip = e, this._onDidChange.fire({ tooltip: e }));
  }
  get class() {
    return this._cssClass;
  }
  set class(e) {
    this._setClass(e);
  }
  _setClass(e) {
    this._cssClass !== e && (this._cssClass = e, this._onDidChange.fire({ class: e }));
  }
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    this._setEnabled(e);
  }
  _setEnabled(e) {
    this._enabled !== e && (this._enabled = e, this._onDidChange.fire({ enabled: e }));
  }
  get checked() {
    return this._checked;
  }
  set checked(e) {
    this._setChecked(e);
  }
  _setChecked(e) {
    this._checked !== e && (this._checked = e, this._onDidChange.fire({ checked: e }));
  }
  async run(e, t) {
    this._actionCallback && await this._actionCallback(e);
  }
}
class nT extends ge {
  constructor() {
    super(...arguments), this._onWillRun = this._register(new he()), this._onDidRun = this._register(new he());
  }
  get onWillRun() {
    return this._onWillRun.event;
  }
  get onDidRun() {
    return this._onDidRun.event;
  }
  async run(e, t) {
    if (!e.enabled)
      return;
    this._onWillRun.fire({ action: e });
    let n;
    try {
      await this.runAction(e, t);
    } catch (r) {
      n = r;
    }
    this._onDidRun.fire({ action: e, error: n });
  }
  async runAction(e, t) {
    await e.run(t);
  }
}
const I3 = class I3 {
  constructor() {
    this.id = I3.ID, this.label = "", this.tooltip = "", this.class = "separator", this.enabled = !1, this.checked = !1;
  }
  /**
   * Joins all non-empty lists of actions with separators.
   */
  static join(...e) {
    let t = [];
    for (const n of e)
      n.length && (t.length ? t = [...t, new I3(), ...n] : t = n);
    return t;
  }
  async run() {
  }
};
I3.ID = "vs.actions.separator";
let fa = I3;
class qR {
  get actions() {
    return this._actions;
  }
  constructor(e, t, n, r) {
    this.tooltip = "", this.enabled = !0, this.checked = void 0, this.id = e, this.label = t, this.class = r, this._actions = n;
  }
  async run() {
  }
}
const Nj = class Nj extends Vh {
  constructor() {
    super(Nj.ID, S(28, "(empty)"), void 0, !1);
  }
};
Nj.ID = "vs.actions.empty";
let yie = Nj;
function Ox(i) {
  return {
    id: i.id,
    label: i.label,
    tooltip: i.tooltip ?? i.label,
    class: i.class,
    enabled: i.enabled ?? !0,
    checked: i.checked,
    run: async (...e) => i.run(...e)
  };
}
const Cie = /* @__PURE__ */ Object.create(null);
function V(i, e) {
  if (ga(e)) {
    const t = Cie[e];
    if (t === void 0)
      throw new Error(`${i} references an unknown codicon: ${e}`);
    e = t;
  }
  return Cie[i] = e, { id: i };
}
function BPe() {
  return Cie;
}
const ert = {
  add: V("add", 6e4),
  plus: V("plus", 6e4),
  gistNew: V("gist-new", 6e4),
  repoCreate: V("repo-create", 6e4),
  lightbulb: V("lightbulb", 60001),
  lightBulb: V("light-bulb", 60001),
  repo: V("repo", 60002),
  repoDelete: V("repo-delete", 60002),
  gistFork: V("gist-fork", 60003),
  repoForked: V("repo-forked", 60003),
  gitPullRequest: V("git-pull-request", 60004),
  gitPullRequestAbandoned: V("git-pull-request-abandoned", 60004),
  recordKeys: V("record-keys", 60005),
  keyboard: V("keyboard", 60005),
  tag: V("tag", 60006),
  gitPullRequestLabel: V("git-pull-request-label", 60006),
  tagAdd: V("tag-add", 60006),
  tagRemove: V("tag-remove", 60006),
  person: V("person", 60007),
  personFollow: V("person-follow", 60007),
  personOutline: V("person-outline", 60007),
  personFilled: V("person-filled", 60007),
  gitBranch: V("git-branch", 60008),
  gitBranchCreate: V("git-branch-create", 60008),
  gitBranchDelete: V("git-branch-delete", 60008),
  sourceControl: V("source-control", 60008),
  mirror: V("mirror", 60009),
  mirrorPublic: V("mirror-public", 60009),
  star: V("star", 60010),
  starAdd: V("star-add", 60010),
  starDelete: V("star-delete", 60010),
  starEmpty: V("star-empty", 60010),
  comment: V("comment", 60011),
  commentAdd: V("comment-add", 60011),
  alert: V("alert", 60012),
  warning: V("warning", 60012),
  search: V("search", 60013),
  searchSave: V("search-save", 60013),
  logOut: V("log-out", 60014),
  signOut: V("sign-out", 60014),
  logIn: V("log-in", 60015),
  signIn: V("sign-in", 60015),
  eye: V("eye", 60016),
  eyeUnwatch: V("eye-unwatch", 60016),
  eyeWatch: V("eye-watch", 60016),
  circleFilled: V("circle-filled", 60017),
  primitiveDot: V("primitive-dot", 60017),
  closeDirty: V("close-dirty", 60017),
  debugBreakpoint: V("debug-breakpoint", 60017),
  debugBreakpointDisabled: V("debug-breakpoint-disabled", 60017),
  debugHint: V("debug-hint", 60017),
  terminalDecorationSuccess: V("terminal-decoration-success", 60017),
  primitiveSquare: V("primitive-square", 60018),
  edit: V("edit", 60019),
  pencil: V("pencil", 60019),
  info: V("info", 60020),
  issueOpened: V("issue-opened", 60020),
  gistPrivate: V("gist-private", 60021),
  gitForkPrivate: V("git-fork-private", 60021),
  lock: V("lock", 60021),
  mirrorPrivate: V("mirror-private", 60021),
  close: V("close", 60022),
  removeClose: V("remove-close", 60022),
  x: V("x", 60022),
  repoSync: V("repo-sync", 60023),
  sync: V("sync", 60023),
  clone: V("clone", 60024),
  desktopDownload: V("desktop-download", 60024),
  beaker: V("beaker", 60025),
  microscope: V("microscope", 60025),
  vm: V("vm", 60026),
  deviceDesktop: V("device-desktop", 60026),
  file: V("file", 60027),
  fileText: V("file-text", 60027),
  more: V("more", 60028),
  ellipsis: V("ellipsis", 60028),
  kebabHorizontal: V("kebab-horizontal", 60028),
  mailReply: V("mail-reply", 60029),
  reply: V("reply", 60029),
  organization: V("organization", 60030),
  organizationFilled: V("organization-filled", 60030),
  organizationOutline: V("organization-outline", 60030),
  newFile: V("new-file", 60031),
  fileAdd: V("file-add", 60031),
  newFolder: V("new-folder", 60032),
  fileDirectoryCreate: V("file-directory-create", 60032),
  trash: V("trash", 60033),
  trashcan: V("trashcan", 60033),
  history: V("history", 60034),
  clock: V("clock", 60034),
  folder: V("folder", 60035),
  fileDirectory: V("file-directory", 60035),
  symbolFolder: V("symbol-folder", 60035),
  logoGithub: V("logo-github", 60036),
  markGithub: V("mark-github", 60036),
  github: V("github", 60036),
  terminal: V("terminal", 60037),
  console: V("console", 60037),
  repl: V("repl", 60037),
  zap: V("zap", 60038),
  symbolEvent: V("symbol-event", 60038),
  error: V("error", 60039),
  stop: V("stop", 60039),
  variable: V("variable", 60040),
  symbolVariable: V("symbol-variable", 60040),
  array: V("array", 60042),
  symbolArray: V("symbol-array", 60042),
  symbolModule: V("symbol-module", 60043),
  symbolPackage: V("symbol-package", 60043),
  symbolNamespace: V("symbol-namespace", 60043),
  symbolObject: V("symbol-object", 60043),
  symbolMethod: V("symbol-method", 60044),
  symbolFunction: V("symbol-function", 60044),
  symbolConstructor: V("symbol-constructor", 60044),
  symbolBoolean: V("symbol-boolean", 60047),
  symbolNull: V("symbol-null", 60047),
  symbolNumeric: V("symbol-numeric", 60048),
  symbolNumber: V("symbol-number", 60048),
  symbolStructure: V("symbol-structure", 60049),
  symbolStruct: V("symbol-struct", 60049),
  symbolParameter: V("symbol-parameter", 60050),
  symbolTypeParameter: V("symbol-type-parameter", 60050),
  symbolKey: V("symbol-key", 60051),
  symbolText: V("symbol-text", 60051),
  symbolReference: V("symbol-reference", 60052),
  goToFile: V("go-to-file", 60052),
  symbolEnum: V("symbol-enum", 60053),
  symbolValue: V("symbol-value", 60053),
  symbolRuler: V("symbol-ruler", 60054),
  symbolUnit: V("symbol-unit", 60054),
  activateBreakpoints: V("activate-breakpoints", 60055),
  archive: V("archive", 60056),
  arrowBoth: V("arrow-both", 60057),
  arrowDown: V("arrow-down", 60058),
  arrowLeft: V("arrow-left", 60059),
  arrowRight: V("arrow-right", 60060),
  arrowSmallDown: V("arrow-small-down", 60061),
  arrowSmallLeft: V("arrow-small-left", 60062),
  arrowSmallRight: V("arrow-small-right", 60063),
  arrowSmallUp: V("arrow-small-up", 60064),
  arrowUp: V("arrow-up", 60065),
  bell: V("bell", 60066),
  bold: V("bold", 60067),
  book: V("book", 60068),
  bookmark: V("bookmark", 60069),
  debugBreakpointConditionalUnverified: V("debug-breakpoint-conditional-unverified", 60070),
  debugBreakpointConditional: V("debug-breakpoint-conditional", 60071),
  debugBreakpointConditionalDisabled: V("debug-breakpoint-conditional-disabled", 60071),
  debugBreakpointDataUnverified: V("debug-breakpoint-data-unverified", 60072),
  debugBreakpointData: V("debug-breakpoint-data", 60073),
  debugBreakpointDataDisabled: V("debug-breakpoint-data-disabled", 60073),
  debugBreakpointLogUnverified: V("debug-breakpoint-log-unverified", 60074),
  debugBreakpointLog: V("debug-breakpoint-log", 60075),
  debugBreakpointLogDisabled: V("debug-breakpoint-log-disabled", 60075),
  briefcase: V("briefcase", 60076),
  broadcast: V("broadcast", 60077),
  browser: V("browser", 60078),
  bug: V("bug", 60079),
  calendar: V("calendar", 60080),
  caseSensitive: V("case-sensitive", 60081),
  check: V("check", 60082),
  checklist: V("checklist", 60083),
  chevronDown: V("chevron-down", 60084),
  chevronLeft: V("chevron-left", 60085),
  chevronRight: V("chevron-right", 60086),
  chevronUp: V("chevron-up", 60087),
  chromeClose: V("chrome-close", 60088),
  chromeMaximize: V("chrome-maximize", 60089),
  chromeMinimize: V("chrome-minimize", 60090),
  chromeRestore: V("chrome-restore", 60091),
  circleOutline: V("circle-outline", 60092),
  circle: V("circle", 60092),
  debugBreakpointUnverified: V("debug-breakpoint-unverified", 60092),
  terminalDecorationIncomplete: V("terminal-decoration-incomplete", 60092),
  circleSlash: V("circle-slash", 60093),
  circuitBoard: V("circuit-board", 60094),
  clearAll: V("clear-all", 60095),
  clippy: V("clippy", 60096),
  closeAll: V("close-all", 60097),
  cloudDownload: V("cloud-download", 60098),
  cloudUpload: V("cloud-upload", 60099),
  code: V("code", 60100),
  collapseAll: V("collapse-all", 60101),
  colorMode: V("color-mode", 60102),
  commentDiscussion: V("comment-discussion", 60103),
  creditCard: V("credit-card", 60105),
  dash: V("dash", 60108),
  dashboard: V("dashboard", 60109),
  database: V("database", 60110),
  debugContinue: V("debug-continue", 60111),
  debugDisconnect: V("debug-disconnect", 60112),
  debugPause: V("debug-pause", 60113),
  debugRestart: V("debug-restart", 60114),
  debugStart: V("debug-start", 60115),
  debugStepInto: V("debug-step-into", 60116),
  debugStepOut: V("debug-step-out", 60117),
  debugStepOver: V("debug-step-over", 60118),
  debugStop: V("debug-stop", 60119),
  debug: V("debug", 60120),
  deviceCameraVideo: V("device-camera-video", 60121),
  deviceCamera: V("device-camera", 60122),
  deviceMobile: V("device-mobile", 60123),
  diffAdded: V("diff-added", 60124),
  diffIgnored: V("diff-ignored", 60125),
  diffModified: V("diff-modified", 60126),
  diffRemoved: V("diff-removed", 60127),
  diffRenamed: V("diff-renamed", 60128),
  diff: V("diff", 60129),
  diffSidebyside: V("diff-sidebyside", 60129),
  discard: V("discard", 60130),
  editorLayout: V("editor-layout", 60131),
  emptyWindow: V("empty-window", 60132),
  exclude: V("exclude", 60133),
  extensions: V("extensions", 60134),
  eyeClosed: V("eye-closed", 60135),
  fileBinary: V("file-binary", 60136),
  fileCode: V("file-code", 60137),
  fileMedia: V("file-media", 60138),
  filePdf: V("file-pdf", 60139),
  fileSubmodule: V("file-submodule", 60140),
  fileSymlinkDirectory: V("file-symlink-directory", 60141),
  fileSymlinkFile: V("file-symlink-file", 60142),
  fileZip: V("file-zip", 60143),
  files: V("files", 60144),
  filter: V("filter", 60145),
  flame: V("flame", 60146),
  foldDown: V("fold-down", 60147),
  foldUp: V("fold-up", 60148),
  fold: V("fold", 60149),
  folderActive: V("folder-active", 60150),
  folderOpened: V("folder-opened", 60151),
  gear: V("gear", 60152),
  gift: V("gift", 60153),
  gistSecret: V("gist-secret", 60154),
  gist: V("gist", 60155),
  gitCommit: V("git-commit", 60156),
  gitCompare: V("git-compare", 60157),
  compareChanges: V("compare-changes", 60157),
  gitMerge: V("git-merge", 60158),
  githubAction: V("github-action", 60159),
  githubAlt: V("github-alt", 60160),
  globe: V("globe", 60161),
  grabber: V("grabber", 60162),
  graph: V("graph", 60163),
  gripper: V("gripper", 60164),
  heart: V("heart", 60165),
  home: V("home", 60166),
  horizontalRule: V("horizontal-rule", 60167),
  hubot: V("hubot", 60168),
  inbox: V("inbox", 60169),
  issueReopened: V("issue-reopened", 60171),
  issues: V("issues", 60172),
  italic: V("italic", 60173),
  jersey: V("jersey", 60174),
  json: V("json", 60175),
  kebabVertical: V("kebab-vertical", 60176),
  key: V("key", 60177),
  law: V("law", 60178),
  lightbulbAutofix: V("lightbulb-autofix", 60179),
  linkExternal: V("link-external", 60180),
  link: V("link", 60181),
  listOrdered: V("list-ordered", 60182),
  listUnordered: V("list-unordered", 60183),
  liveShare: V("live-share", 60184),
  loading: V("loading", 60185),
  location: V("location", 60186),
  mailRead: V("mail-read", 60187),
  mail: V("mail", 60188),
  markdown: V("markdown", 60189),
  megaphone: V("megaphone", 60190),
  mention: V("mention", 60191),
  milestone: V("milestone", 60192),
  gitPullRequestMilestone: V("git-pull-request-milestone", 60192),
  mortarBoard: V("mortar-board", 60193),
  move: V("move", 60194),
  multipleWindows: V("multiple-windows", 60195),
  mute: V("mute", 60196),
  noNewline: V("no-newline", 60197),
  note: V("note", 60198),
  octoface: V("octoface", 60199),
  openPreview: V("open-preview", 60200),
  package: V("package", 60201),
  paintcan: V("paintcan", 60202),
  pin: V("pin", 60203),
  play: V("play", 60204),
  run: V("run", 60204),
  plug: V("plug", 60205),
  preserveCase: V("preserve-case", 60206),
  preview: V("preview", 60207),
  project: V("project", 60208),
  pulse: V("pulse", 60209),
  question: V("question", 60210),
  quote: V("quote", 60211),
  radioTower: V("radio-tower", 60212),
  reactions: V("reactions", 60213),
  references: V("references", 60214),
  refresh: V("refresh", 60215),
  regex: V("regex", 60216),
  remoteExplorer: V("remote-explorer", 60217),
  remote: V("remote", 60218),
  remove: V("remove", 60219),
  replaceAll: V("replace-all", 60220),
  replace: V("replace", 60221),
  repoClone: V("repo-clone", 60222),
  repoForcePush: V("repo-force-push", 60223),
  repoPull: V("repo-pull", 60224),
  repoPush: V("repo-push", 60225),
  report: V("report", 60226),
  requestChanges: V("request-changes", 60227),
  rocket: V("rocket", 60228),
  rootFolderOpened: V("root-folder-opened", 60229),
  rootFolder: V("root-folder", 60230),
  rss: V("rss", 60231),
  ruby: V("ruby", 60232),
  saveAll: V("save-all", 60233),
  saveAs: V("save-as", 60234),
  save: V("save", 60235),
  screenFull: V("screen-full", 60236),
  screenNormal: V("screen-normal", 60237),
  searchStop: V("search-stop", 60238),
  server: V("server", 60240),
  settingsGear: V("settings-gear", 60241),
  settings: V("settings", 60242),
  shield: V("shield", 60243),
  smiley: V("smiley", 60244),
  sortPrecedence: V("sort-precedence", 60245),
  splitHorizontal: V("split-horizontal", 60246),
  splitVertical: V("split-vertical", 60247),
  squirrel: V("squirrel", 60248),
  starFull: V("star-full", 60249),
  starHalf: V("star-half", 60250),
  symbolClass: V("symbol-class", 60251),
  symbolColor: V("symbol-color", 60252),
  symbolConstant: V("symbol-constant", 60253),
  symbolEnumMember: V("symbol-enum-member", 60254),
  symbolField: V("symbol-field", 60255),
  symbolFile: V("symbol-file", 60256),
  symbolInterface: V("symbol-interface", 60257),
  symbolKeyword: V("symbol-keyword", 60258),
  symbolMisc: V("symbol-misc", 60259),
  symbolOperator: V("symbol-operator", 60260),
  symbolProperty: V("symbol-property", 60261),
  wrench: V("wrench", 60261),
  wrenchSubaction: V("wrench-subaction", 60261),
  symbolSnippet: V("symbol-snippet", 60262),
  tasklist: V("tasklist", 60263),
  telescope: V("telescope", 60264),
  textSize: V("text-size", 60265),
  threeBars: V("three-bars", 60266),
  thumbsdown: V("thumbsdown", 60267),
  thumbsup: V("thumbsup", 60268),
  tools: V("tools", 60269),
  triangleDown: V("triangle-down", 60270),
  triangleLeft: V("triangle-left", 60271),
  triangleRight: V("triangle-right", 60272),
  triangleUp: V("triangle-up", 60273),
  twitter: V("twitter", 60274),
  unfold: V("unfold", 60275),
  unlock: V("unlock", 60276),
  unmute: V("unmute", 60277),
  unverified: V("unverified", 60278),
  verified: V("verified", 60279),
  versions: V("versions", 60280),
  vmActive: V("vm-active", 60281),
  vmOutline: V("vm-outline", 60282),
  vmRunning: V("vm-running", 60283),
  watch: V("watch", 60284),
  whitespace: V("whitespace", 60285),
  wholeWord: V("whole-word", 60286),
  window: V("window", 60287),
  wordWrap: V("word-wrap", 60288),
  zoomIn: V("zoom-in", 60289),
  zoomOut: V("zoom-out", 60290),
  listFilter: V("list-filter", 60291),
  listFlat: V("list-flat", 60292),
  listSelection: V("list-selection", 60293),
  selection: V("selection", 60293),
  listTree: V("list-tree", 60294),
  debugBreakpointFunctionUnverified: V("debug-breakpoint-function-unverified", 60295),
  debugBreakpointFunction: V("debug-breakpoint-function", 60296),
  debugBreakpointFunctionDisabled: V("debug-breakpoint-function-disabled", 60296),
  debugStackframeActive: V("debug-stackframe-active", 60297),
  circleSmallFilled: V("circle-small-filled", 60298),
  debugStackframeDot: V("debug-stackframe-dot", 60298),
  terminalDecorationMark: V("terminal-decoration-mark", 60298),
  debugStackframe: V("debug-stackframe", 60299),
  debugStackframeFocused: V("debug-stackframe-focused", 60299),
  debugBreakpointUnsupported: V("debug-breakpoint-unsupported", 60300),
  symbolString: V("symbol-string", 60301),
  debugReverseContinue: V("debug-reverse-continue", 60302),
  debugStepBack: V("debug-step-back", 60303),
  debugRestartFrame: V("debug-restart-frame", 60304),
  debugAlt: V("debug-alt", 60305),
  callIncoming: V("call-incoming", 60306),
  callOutgoing: V("call-outgoing", 60307),
  menu: V("menu", 60308),
  expandAll: V("expand-all", 60309),
  feedback: V("feedback", 60310),
  gitPullRequestReviewer: V("git-pull-request-reviewer", 60310),
  groupByRefType: V("group-by-ref-type", 60311),
  ungroupByRefType: V("ungroup-by-ref-type", 60312),
  account: V("account", 60313),
  gitPullRequestAssignee: V("git-pull-request-assignee", 60313),
  bellDot: V("bell-dot", 60314),
  debugConsole: V("debug-console", 60315),
  library: V("library", 60316),
  output: V("output", 60317),
  runAll: V("run-all", 60318),
  syncIgnored: V("sync-ignored", 60319),
  pinned: V("pinned", 60320),
  githubInverted: V("github-inverted", 60321),
  serverProcess: V("server-process", 60322),
  serverEnvironment: V("server-environment", 60323),
  pass: V("pass", 60324),
  issueClosed: V("issue-closed", 60324),
  stopCircle: V("stop-circle", 60325),
  playCircle: V("play-circle", 60326),
  record: V("record", 60327),
  debugAltSmall: V("debug-alt-small", 60328),
  vmConnect: V("vm-connect", 60329),
  cloud: V("cloud", 60330),
  merge: V("merge", 60331),
  export: V("export", 60332),
  graphLeft: V("graph-left", 60333),
  magnet: V("magnet", 60334),
  notebook: V("notebook", 60335),
  redo: V("redo", 60336),
  checkAll: V("check-all", 60337),
  pinnedDirty: V("pinned-dirty", 60338),
  passFilled: V("pass-filled", 60339),
  circleLargeFilled: V("circle-large-filled", 60340),
  circleLarge: V("circle-large", 60341),
  circleLargeOutline: V("circle-large-outline", 60341),
  combine: V("combine", 60342),
  gather: V("gather", 60342),
  table: V("table", 60343),
  variableGroup: V("variable-group", 60344),
  typeHierarchy: V("type-hierarchy", 60345),
  typeHierarchySub: V("type-hierarchy-sub", 60346),
  typeHierarchySuper: V("type-hierarchy-super", 60347),
  gitPullRequestCreate: V("git-pull-request-create", 60348),
  runAbove: V("run-above", 60349),
  runBelow: V("run-below", 60350),
  notebookTemplate: V("notebook-template", 60351),
  debugRerun: V("debug-rerun", 60352),
  workspaceTrusted: V("workspace-trusted", 60353),
  workspaceUntrusted: V("workspace-untrusted", 60354),
  workspaceUnknown: V("workspace-unknown", 60355),
  terminalCmd: V("terminal-cmd", 60356),
  terminalDebian: V("terminal-debian", 60357),
  terminalLinux: V("terminal-linux", 60358),
  terminalPowershell: V("terminal-powershell", 60359),
  terminalTmux: V("terminal-tmux", 60360),
  terminalUbuntu: V("terminal-ubuntu", 60361),
  terminalBash: V("terminal-bash", 60362),
  arrowSwap: V("arrow-swap", 60363),
  copy: V("copy", 60364),
  personAdd: V("person-add", 60365),
  filterFilled: V("filter-filled", 60366),
  wand: V("wand", 60367),
  debugLineByLine: V("debug-line-by-line", 60368),
  inspect: V("inspect", 60369),
  layers: V("layers", 60370),
  layersDot: V("layers-dot", 60371),
  layersActive: V("layers-active", 60372),
  compass: V("compass", 60373),
  compassDot: V("compass-dot", 60374),
  compassActive: V("compass-active", 60375),
  azure: V("azure", 60376),
  issueDraft: V("issue-draft", 60377),
  gitPullRequestClosed: V("git-pull-request-closed", 60378),
  gitPullRequestDraft: V("git-pull-request-draft", 60379),
  debugAll: V("debug-all", 60380),
  debugCoverage: V("debug-coverage", 60381),
  runErrors: V("run-errors", 60382),
  folderLibrary: V("folder-library", 60383),
  debugContinueSmall: V("debug-continue-small", 60384),
  beakerStop: V("beaker-stop", 60385),
  graphLine: V("graph-line", 60386),
  graphScatter: V("graph-scatter", 60387),
  pieChart: V("pie-chart", 60388),
  bracket: V("bracket", 60175),
  bracketDot: V("bracket-dot", 60389),
  bracketError: V("bracket-error", 60390),
  lockSmall: V("lock-small", 60391),
  azureDevops: V("azure-devops", 60392),
  verifiedFilled: V("verified-filled", 60393),
  newline: V("newline", 60394),
  layout: V("layout", 60395),
  layoutActivitybarLeft: V("layout-activitybar-left", 60396),
  layoutActivitybarRight: V("layout-activitybar-right", 60397),
  layoutPanelLeft: V("layout-panel-left", 60398),
  layoutPanelCenter: V("layout-panel-center", 60399),
  layoutPanelJustify: V("layout-panel-justify", 60400),
  layoutPanelRight: V("layout-panel-right", 60401),
  layoutPanel: V("layout-panel", 60402),
  layoutSidebarLeft: V("layout-sidebar-left", 60403),
  layoutSidebarRight: V("layout-sidebar-right", 60404),
  layoutStatusbar: V("layout-statusbar", 60405),
  layoutMenubar: V("layout-menubar", 60406),
  layoutCentered: V("layout-centered", 60407),
  target: V("target", 60408),
  indent: V("indent", 60409),
  recordSmall: V("record-small", 60410),
  errorSmall: V("error-small", 60411),
  terminalDecorationError: V("terminal-decoration-error", 60411),
  arrowCircleDown: V("arrow-circle-down", 60412),
  arrowCircleLeft: V("arrow-circle-left", 60413),
  arrowCircleRight: V("arrow-circle-right", 60414),
  arrowCircleUp: V("arrow-circle-up", 60415),
  layoutSidebarRightOff: V("layout-sidebar-right-off", 60416),
  layoutPanelOff: V("layout-panel-off", 60417),
  layoutSidebarLeftOff: V("layout-sidebar-left-off", 60418),
  blank: V("blank", 60419),
  heartFilled: V("heart-filled", 60420),
  map: V("map", 60421),
  mapHorizontal: V("map-horizontal", 60421),
  foldHorizontal: V("fold-horizontal", 60421),
  mapFilled: V("map-filled", 60422),
  mapHorizontalFilled: V("map-horizontal-filled", 60422),
  foldHorizontalFilled: V("fold-horizontal-filled", 60422),
  circleSmall: V("circle-small", 60423),
  bellSlash: V("bell-slash", 60424),
  bellSlashDot: V("bell-slash-dot", 60425),
  commentUnresolved: V("comment-unresolved", 60426),
  gitPullRequestGoToChanges: V("git-pull-request-go-to-changes", 60427),
  gitPullRequestNewChanges: V("git-pull-request-new-changes", 60428),
  searchFuzzy: V("search-fuzzy", 60429),
  commentDraft: V("comment-draft", 60430),
  send: V("send", 60431),
  sparkle: V("sparkle", 60432),
  insert: V("insert", 60433),
  mic: V("mic", 60434),
  thumbsdownFilled: V("thumbsdown-filled", 60435),
  thumbsupFilled: V("thumbsup-filled", 60436),
  coffee: V("coffee", 60437),
  snake: V("snake", 60438),
  game: V("game", 60439),
  vr: V("vr", 60440),
  chip: V("chip", 60441),
  piano: V("piano", 60442),
  music: V("music", 60443),
  micFilled: V("mic-filled", 60444),
  repoFetch: V("repo-fetch", 60445),
  copilot: V("copilot", 60446),
  lightbulbSparkle: V("lightbulb-sparkle", 60447),
  robot: V("robot", 60448),
  sparkleFilled: V("sparkle-filled", 60449),
  diffSingle: V("diff-single", 60450),
  diffMultiple: V("diff-multiple", 60451),
  surroundWith: V("surround-with", 60452),
  share: V("share", 60453),
  gitStash: V("git-stash", 60454),
  gitStashApply: V("git-stash-apply", 60455),
  gitStashPop: V("git-stash-pop", 60456),
  vscode: V("vscode", 60457),
  vscodeInsiders: V("vscode-insiders", 60458),
  codeOss: V("code-oss", 60459),
  runCoverage: V("run-coverage", 60460),
  runAllCoverage: V("run-all-coverage", 60461),
  coverage: V("coverage", 60462),
  githubProject: V("github-project", 60463),
  mapVertical: V("map-vertical", 60464),
  foldVertical: V("fold-vertical", 60464),
  mapVerticalFilled: V("map-vertical-filled", 60465),
  foldVerticalFilled: V("fold-vertical-filled", 60465),
  goToSearch: V("go-to-search", 60466),
  percentage: V("percentage", 60467),
  sortPercentage: V("sort-percentage", 60467),
  attach: V("attach", 60468),
  goToEditingSession: V("go-to-editing-session", 60469),
  editSession: V("edit-session", 60470),
  codeReview: V("code-review", 60471),
  copilotWarning: V("copilot-warning", 60472),
  python: V("python", 60473),
  copilotLarge: V("copilot-large", 60474),
  copilotWarningLarge: V("copilot-warning-large", 60475),
  keyboardTab: V("keyboard-tab", 60476),
  copilotBlocked: V("copilot-blocked", 60477),
  copilotNotConnected: V("copilot-not-connected", 60478),
  flag: V("flag", 60479),
  lightbulbEmpty: V("lightbulb-empty", 60480),
  symbolMethodArrow: V("symbol-method-arrow", 60481),
  copilotUnavailable: V("copilot-unavailable", 60482),
  repoPinned: V("repo-pinned", 60483),
  keyboardTabAbove: V("keyboard-tab-above", 60484),
  keyboardTabBelow: V("keyboard-tab-below", 60485),
  gitPullRequestDone: V("git-pull-request-done", 60486),
  mcp: V("mcp", 60487),
  extensionsLarge: V("extensions-large", 60488),
  layoutPanelDock: V("layout-panel-dock", 60489),
  layoutSidebarLeftDock: V("layout-sidebar-left-dock", 60490),
  layoutSidebarRightDock: V("layout-sidebar-right-dock", 60491),
  copilotInProgress: V("copilot-in-progress", 60492),
  copilotError: V("copilot-error", 60493),
  copilotSuccess: V("copilot-success", 60494),
  chatSparkle: V("chat-sparkle", 60495),
  searchSparkle: V("search-sparkle", 60496),
  editSparkle: V("edit-sparkle", 60497),
  copilotSnooze: V("copilot-snooze", 60498),
  sendToRemoteAgent: V("send-to-remote-agent", 60499),
  commentDiscussionSparkle: V("comment-discussion-sparkle", 60500),
  chatSparkleWarning: V("chat-sparkle-warning", 60501),
  chatSparkleError: V("chat-sparkle-error", 60502),
  collection: V("collection", 60503),
  newCollection: V("new-collection", 60504),
  thinking: V("thinking", 60505)
}, trt = {
  dialogError: V("dialog-error", "error"),
  dialogWarning: V("dialog-warning", "warning"),
  dialogInfo: V("dialog-info", "info"),
  dialogClose: V("dialog-close", "close"),
  treeItemExpanded: V("tree-item-expanded", "chevron-down"),
  // collapsed is done with rotation
  treeFilterOnTypeOn: V("tree-filter-on-type-on", "list-filter"),
  treeFilterOnTypeOff: V("tree-filter-on-type-off", "list-selection"),
  treeFilterClear: V("tree-filter-clear", "close"),
  treeItemLoading: V("tree-item-loading", "loading"),
  menuSelection: V("menu-selection", "check"),
  menuSubmenu: V("menu-submenu", "chevron-right"),
  menuBarMore: V("menubar-more", "more"),
  scrollbarButtonLeft: V("scrollbar-button-left", "triangle-left"),
  scrollbarButtonRight: V("scrollbar-button-right", "triangle-right"),
  scrollbarButtonUp: V("scrollbar-button-up", "triangle-up"),
  scrollbarButtonDown: V("scrollbar-button-down", "triangle-down"),
  toolBarMore: V("toolbar-more", "more"),
  quickInputBack: V("quick-input-back", "arrow-left"),
  dropDownButton: V("drop-down-button", 60084),
  symbolCustomColor: V("symbol-customcolor", 60252),
  exportIcon: V("export", 60332),
  workspaceUnspecified: V("workspace-unspecified", 60355),
  newLine: V("newline", 60394),
  thumbsDownFilled: V("thumbsdown-filled", 60435),
  thumbsUpFilled: V("thumbsup-filled", 60436),
  gitFetch: V("git-fetch", 60445),
  lightbulbSparkleAutofix: V("lightbulb-sparkle-autofix", 60447),
  debugBreakpointPending: V("debug-breakpoint-pending", 60377)
}, Pe = {
  ...ert,
  ...trt
};
var wie;
(function(i) {
  function e(t) {
    return !!t && typeof t == "object" && typeof t.id == "string";
  }
  i.isThemeColor = e;
})(wie || (wie = {}));
var qt;
(function(i) {
  i.iconNameSegment = "[A-Za-z0-9]+", i.iconNameExpression = "[A-Za-z0-9-]+", i.iconModifierExpression = "~[A-Za-z]+", i.iconNameCharacter = "[A-Za-z0-9~-]";
  const e = new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);
  function t(h) {
    const g = e.exec(h.id);
    if (!g)
      return t(Pe.error);
    const [, m, _] = g, v = ["codicon", "codicon-" + m];
    return _ && v.push("codicon-modifier-" + _.substring(1)), v;
  }
  i.asClassNameArray = t;
  function n(h) {
    return t(h).join(" ");
  }
  i.asClassName = n;
  function r(h) {
    return "." + t(h).join(".");
  }
  i.asCSSSelector = r;
  function s(h) {
    return !!h && typeof h == "object" && typeof h.id == "string" && (typeof h.color > "u" || wie.isThemeColor(h.color));
  }
  i.isThemeIcon = s;
  const o = new RegExp(`^\\$\\((${i.iconNameExpression}(?:${i.iconModifierExpression})?)\\)$`);
  function a(h) {
    const g = o.exec(h);
    if (!g)
      return;
    const [, m] = g;
    return { id: m };
  }
  i.fromString = a;
  function l(h) {
    return { id: h };
  }
  i.fromId = l;
  function c(h, g) {
    let m = h.id;
    const _ = m.lastIndexOf("~");
    return _ !== -1 && (m = m.substring(0, _)), g && (m = `${m}~${g}`), { id: m };
  }
  i.modify = c;
  function u(h) {
    const g = h.id.lastIndexOf("~");
    if (g !== -1)
      return h.id.substring(g + 1);
  }
  i.getModifier = u;
  function d(h, g) {
    var m, _;
    return h.id === g.id && ((m = h.color) == null ? void 0 : m.id) === ((_ = g.color) == null ? void 0 : _.id);
  }
  i.isEqual = d;
})(qt || (qt = {}));
const jr = Vn("commandService"), _i = new class {
  constructor() {
    this._commands = /* @__PURE__ */ new Map(), this._onDidRegisterCommand = new he(), this.onDidRegisterCommand = this._onDidRegisterCommand.event;
  }
  registerCommand(i, e) {
    if (!i)
      throw new Error("invalid command");
    if (typeof i == "string") {
      if (!e)
        throw new Error("invalid command");
      return this.registerCommand({ id: i, handler: e });
    }
    if (i.metadata && Array.isArray(i.metadata.args)) {
      const o = [];
      for (const l of i.metadata.args)
        o.push(l.constraint);
      const a = i.handler;
      i.handler = function(l, ...c) {
        return ptt(c, o), a(l, ...c);
      };
    }
    const { id: t } = i;
    let n = this._commands.get(t);
    n || (n = new xc(), this._commands.set(t, n));
    const r = n.unshift(i), s = Et(() => {
      r();
      const o = this._commands.get(t);
      o != null && o.isEmpty() && this._commands.delete(t);
    });
    return this._onDidRegisterCommand.fire(t), s;
  }
  registerCommandAlias(i, e) {
    return _i.registerCommand(i, (t, ...n) => t.get(jr).executeCommand(e, ...n));
  }
  getCommand(i) {
    const e = this._commands.get(i);
    if (!(!e || e.isEmpty()))
      return gi.first(e);
  }
  getCommands() {
    const i = /* @__PURE__ */ new Map();
    for (const e of this._commands.keys()) {
      const t = this.getCommand(e);
      t && i.set(e, t);
    }
    return i;
  }
}();
_i.registerCommand("noop", () => {
});
function UJ(...i) {
  switch (i.length) {
    case 1:
      return S(1678, "Did you mean {0}?", i[0]);
    case 2:
      return S(1679, "Did you mean {0} or {1}?", i[0], i[1]);
    case 3:
      return S(1680, "Did you mean {0}, {1} or {2}?", i[0], i[1], i[2]);
    default:
      return;
  }
}
const nrt = S(1681, "Did you forget to open or close the quote?"), irt = S(1682, "Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");
var Ly;
let HM = (Ly = class {
  constructor() {
    this._input = "", this._start = 0, this._current = 0, this._tokens = [], this._errors = [], this.stringRe = /[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy;
  }
  static getLexeme(e) {
    switch (e.type) {
      case 0:
        return "(";
      case 1:
        return ")";
      case 2:
        return "!";
      case 3:
        return e.isTripleEq ? "===" : "==";
      case 4:
        return e.isTripleEq ? "!==" : "!=";
      case 5:
        return "<";
      case 6:
        return "<=";
      case 7:
        return ">=";
      case 8:
        return ">=";
      case 9:
        return "=~";
      case 10:
        return e.lexeme;
      case 11:
        return "true";
      case 12:
        return "false";
      case 13:
        return "in";
      case 14:
        return "not";
      case 15:
        return "&&";
      case 16:
        return "||";
      case 17:
        return e.lexeme;
      case 18:
        return e.lexeme;
      case 19:
        return e.lexeme;
      case 20:
        return "EOF";
      default:
        throw LV(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`);
    }
  }
  reset(e) {
    return this._input = e, this._start = 0, this._current = 0, this._tokens = [], this._errors = [], this;
  }
  scan() {
    for (; !this._isAtEnd(); )
      switch (this._start = this._current, this._advance()) {
        case 40:
          this._addToken(
            0
            /* TokenType.LParen */
          );
          break;
        case 41:
          this._addToken(
            1
            /* TokenType.RParen */
          );
          break;
        case 33:
          if (this._match(
            61
            /* CharCode.Equals */
          )) {
            const t = this._match(
              61
              /* CharCode.Equals */
            );
            this._tokens.push({ type: 4, offset: this._start, isTripleEq: t });
          } else
            this._addToken(
              2
              /* TokenType.Neg */
            );
          break;
        case 39:
          this._quotedString();
          break;
        case 47:
          this._regex();
          break;
        case 61:
          if (this._match(
            61
            /* CharCode.Equals */
          )) {
            const t = this._match(
              61
              /* CharCode.Equals */
            );
            this._tokens.push({ type: 3, offset: this._start, isTripleEq: t });
          } else this._match(
            126
            /* CharCode.Tilde */
          ) ? this._addToken(
            9
            /* TokenType.RegexOp */
          ) : this._error(UJ("==", "=~"));
          break;
        case 60:
          this._addToken(
            this._match(
              61
              /* CharCode.Equals */
            ) ? 6 : 5
            /* TokenType.Lt */
          );
          break;
        case 62:
          this._addToken(
            this._match(
              61
              /* CharCode.Equals */
            ) ? 8 : 7
            /* TokenType.Gt */
          );
          break;
        case 38:
          this._match(
            38
            /* CharCode.Ampersand */
          ) ? this._addToken(
            15
            /* TokenType.And */
          ) : this._error(UJ("&&"));
          break;
        case 124:
          this._match(
            124
            /* CharCode.Pipe */
          ) ? this._addToken(
            16
            /* TokenType.Or */
          ) : this._error(UJ("||"));
          break;
        // TODO@ulugbekna: 1) rewrite using a regex 2) reconsider what characters are considered whitespace, including unicode, nbsp, etc.
        case 32:
        case 13:
        case 9:
        case 10:
        case 160:
          break;
        default:
          this._string();
      }
    return this._start = this._current, this._addToken(
      20
      /* TokenType.EOF */
    ), Array.from(this._tokens);
  }
  _match(e) {
    return this._isAtEnd() || this._input.charCodeAt(this._current) !== e ? !1 : (this._current++, !0);
  }
  _advance() {
    return this._input.charCodeAt(this._current++);
  }
  _peek() {
    return this._isAtEnd() ? 0 : this._input.charCodeAt(this._current);
  }
  _addToken(e) {
    this._tokens.push({ type: e, offset: this._start });
  }
  _error(e) {
    const t = this._start, n = this._input.substring(this._start, this._current), r = { type: 19, offset: this._start, lexeme: n };
    this._errors.push({ offset: t, lexeme: n, additionalInfo: e }), this._tokens.push(r);
  }
  _string() {
    this.stringRe.lastIndex = this._start;
    const e = this.stringRe.exec(this._input);
    if (e) {
      this._current = this._start + e[0].length;
      const t = this._input.substring(this._start, this._current), n = Ly._keywords.get(t);
      n ? this._addToken(n) : this._tokens.push({ type: 17, lexeme: t, offset: this._start });
    }
  }
  // captures the lexeme without the leading and trailing '
  _quotedString() {
    for (; this._peek() !== 39 && !this._isAtEnd(); )
      this._advance();
    if (this._isAtEnd()) {
      this._error(nrt);
      return;
    }
    this._advance(), this._tokens.push({ type: 18, lexeme: this._input.substring(this._start + 1, this._current - 1), offset: this._start + 1 });
  }
  /*
   * Lexing a regex expression: /.../[igsmyu]*
   * Based on https://github.com/microsoft/TypeScript/blob/9247ef115e617805983740ba795d7a8164babf89/src/compiler/scanner.ts#L2129-L2181
   *
   * Note that we want slashes within a regex to be escaped, e.g., /file:\\/\\/\\// should match `file:///`
   */
  _regex() {
    let e = this._current, t = !1, n = !1;
    for (; ; ) {
      if (e >= this._input.length) {
        this._current = e, this._error(irt);
        return;
      }
      const s = this._input.charCodeAt(e);
      if (t)
        t = !1;
      else if (s === 47 && !n) {
        e++;
        break;
      } else s === 91 ? n = !0 : s === 92 ? t = !0 : s === 93 && (n = !1);
      e++;
    }
    for (; e < this._input.length && Ly._regexFlags.has(this._input.charCodeAt(e)); )
      e++;
    this._current = e;
    const r = this._input.substring(this._start, this._current);
    this._tokens.push({ type: 10, lexeme: r, offset: this._start });
  }
  _isAtEnd() {
    return this._current >= this._input.length;
  }
}, Ly._regexFlags = new Set(["i", "g", "s", "m", "y", "u"].map((e) => e.charCodeAt(0))), Ly._keywords = /* @__PURE__ */ new Map([
  [
    "not",
    14
    /* TokenType.Not */
  ],
  [
    "in",
    13
    /* TokenType.In */
  ],
  [
    "false",
    12
    /* TokenType.False */
  ],
  [
    "true",
    11
    /* TokenType.True */
  ]
]), Ly);
const Jl = /* @__PURE__ */ new Map();
Jl.set("false", !1);
Jl.set("true", !0);
Jl.set("isMac", Kn);
Jl.set("isLinux", Qu);
Jl.set("isWindows", Za);
Jl.set("isWeb", Lb);
Jl.set("isMacNative", Kn && !Lb);
Jl.set("isEdge", BMe);
Jl.set("isFirefox", Ett);
Jl.set("isChrome", khe);
Jl.set("isSafari", xtt);
const rrt = Object.prototype.hasOwnProperty, srt = {
  regexParsingWithErrorRecovery: !0
}, ort = S(1660, "Empty context key expression"), art = S(1661, "Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."), lrt = S(1662, "'in' after 'not'."), qxe = S(1663, "closing parenthesis ')'"), crt = S(1664, "Unexpected token"), urt = S(1665, "Did you forget to put && or || before the token?"), drt = S(1666, "Unexpected end of expression"), hrt = S(1667, "Did you forget to put a context key?");
var Y_;
let frt = (Y_ = class {
  constructor(e = srt) {
    this._config = e, this._scanner = new HM(), this._tokens = [], this._current = 0, this._parsingErrors = [], this._flagsGYRe = /g|y/g;
  }
  /**
   * Parse a context key expression.
   *
   * @param input the expression to parse
   * @returns the parsed expression or `undefined` if there's an error - call `lexingErrors` and `parsingErrors` to see the errors
   */
  parse(e) {
    if (e === "") {
      this._parsingErrors.push({ message: ort, offset: 0, lexeme: "", additionalInfo: art });
      return;
    }
    this._tokens = this._scanner.reset(e).scan(), this._current = 0, this._parsingErrors = [];
    try {
      const t = this._expr();
      if (!this._isAtEnd()) {
        const n = this._peek(), r = n.type === 17 ? urt : void 0;
        throw this._parsingErrors.push({ message: crt, offset: n.offset, lexeme: HM.getLexeme(n), additionalInfo: r }), Y_._parseError;
      }
      return t;
    } catch (t) {
      if (t !== Y_._parseError)
        throw t;
      return;
    }
  }
  _expr() {
    return this._or();
  }
  _or() {
    const e = [this._and()];
    for (; this._matchOne(
      16
      /* TokenType.Or */
    ); ) {
      const t = this._and();
      e.push(t);
    }
    return e.length === 1 ? e[0] : Re.or(...e);
  }
  _and() {
    const e = [this._term()];
    for (; this._matchOne(
      15
      /* TokenType.And */
    ); ) {
      const t = this._term();
      e.push(t);
    }
    return e.length === 1 ? e[0] : Re.and(...e);
  }
  _term() {
    if (this._matchOne(
      2
      /* TokenType.Neg */
    )) {
      const e = this._peek();
      switch (e.type) {
        case 11:
          return this._advance(), cu.INSTANCE;
        case 12:
          return this._advance(), ed.INSTANCE;
        case 0: {
          this._advance();
          const t = this._expr();
          return this._consume(1, qxe), t == null ? void 0 : t.negate();
        }
        case 17:
          return this._advance(), jT.create(e.lexeme);
        default:
          throw this._errExpectedButGot("KEY | true | false | '(' expression ')'", e);
      }
    }
    return this._primary();
  }
  _primary() {
    const e = this._peek();
    switch (e.type) {
      case 11:
        return this._advance(), Re.true();
      case 12:
        return this._advance(), Re.false();
      case 0: {
        this._advance();
        const t = this._expr();
        return this._consume(1, qxe), t;
      }
      case 17: {
        const t = e.lexeme;
        if (this._advance(), this._matchOne(
          9
          /* TokenType.RegexOp */
        )) {
          const r = this._peek();
          if (!this._config.regexParsingWithErrorRecovery) {
            if (this._advance(), r.type !== 10)
              throw this._errExpectedButGot("REGEX", r);
            const s = r.lexeme, o = s.lastIndexOf("/"), a = o === s.length - 1 ? void 0 : this._removeFlagsGY(s.substring(o + 1));
            let l;
            try {
              l = new RegExp(s.substring(1, o), a);
            } catch {
              throw this._errExpectedButGot("REGEX", r);
            }
            return o4.create(t, l);
          }
          switch (r.type) {
            case 10:
            case 19: {
              const s = [r.lexeme];
              this._advance();
              let o = this._peek(), a = 0;
              for (let h = 0; h < r.lexeme.length; h++)
                r.lexeme.charCodeAt(h) === 40 ? a++ : r.lexeme.charCodeAt(h) === 41 && a--;
              for (; !this._isAtEnd() && o.type !== 15 && o.type !== 16; ) {
                switch (o.type) {
                  case 0:
                    a++;
                    break;
                  case 1:
                    a--;
                    break;
                  case 10:
                  case 18:
                    for (let h = 0; h < o.lexeme.length; h++)
                      o.lexeme.charCodeAt(h) === 40 ? a++ : r.lexeme.charCodeAt(h) === 41 && a--;
                }
                if (a < 0)
                  break;
                s.push(HM.getLexeme(o)), this._advance(), o = this._peek();
              }
              const l = s.join(""), c = l.lastIndexOf("/"), u = c === l.length - 1 ? void 0 : this._removeFlagsGY(l.substring(c + 1));
              let d;
              try {
                d = new RegExp(l.substring(1, c), u);
              } catch {
                throw this._errExpectedButGot("REGEX", r);
              }
              return Re.regex(t, d);
            }
            case 18: {
              const s = r.lexeme;
              this._advance();
              let o = null;
              if (!qMe(s)) {
                const a = s.indexOf("/"), l = s.lastIndexOf("/");
                if (a !== l && a >= 0) {
                  const c = s.slice(a + 1, l), u = s[l + 1] === "i" ? "i" : "";
                  try {
                    o = new RegExp(c, u);
                  } catch {
                    throw this._errExpectedButGot("REGEX", r);
                  }
                }
              }
              if (o === null)
                throw this._errExpectedButGot("REGEX", r);
              return o4.create(t, o);
            }
            default:
              throw this._errExpectedButGot("REGEX", this._peek());
          }
        }
        if (this._matchOne(
          14
          /* TokenType.Not */
        )) {
          this._consume(13, lrt);
          const r = this._value();
          return Re.notIn(t, r);
        }
        switch (this._peek().type) {
          case 3: {
            this._advance();
            const r = this._value();
            if (this._previous().type === 18)
              return Re.equals(t, r);
            switch (r) {
              case "true":
                return Re.has(t);
              case "false":
                return Re.not(t);
              default:
                return Re.equals(t, r);
            }
          }
          case 4: {
            this._advance();
            const r = this._value();
            if (this._previous().type === 18)
              return Re.notEquals(t, r);
            switch (r) {
              case "true":
                return Re.not(t);
              case "false":
                return Re.has(t);
              default:
                return Re.notEquals(t, r);
            }
          }
          // TODO: ContextKeyExpr.smaller(key, right) accepts only `number` as `right` AND during eval of this node, we just eval to `false` if `right` is not a number
          // consequently, package.json linter should _warn_ the user if they're passing undesired things to ops
          case 5:
            return this._advance(), Iq.create(t, this._value());
          case 6:
            return this._advance(), Nq.create(t, this._value());
          case 7:
            return this._advance(), kq.create(t, this._value());
          case 8:
            return this._advance(), Dq.create(t, this._value());
          case 13:
            return this._advance(), Re.in(t, this._value());
          default:
            return Re.has(t);
        }
      }
      case 20:
        throw this._parsingErrors.push({ message: drt, offset: e.offset, lexeme: "", additionalInfo: hrt }), Y_._parseError;
      default:
        throw this._errExpectedButGot(`true | false | KEY 
	| KEY '=~' REGEX 
	| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`, this._peek());
    }
  }
  _value() {
    const e = this._peek();
    switch (e.type) {
      case 17:
      case 18:
        return this._advance(), e.lexeme;
      case 11:
        return this._advance(), "true";
      case 12:
        return this._advance(), "false";
      case 13:
        return this._advance(), "in";
      default:
        return "";
    }
  }
  _removeFlagsGY(e) {
    return e.replaceAll(this._flagsGYRe, "");
  }
  // careful: this can throw if current token is the initial one (ie index = 0)
  _previous() {
    return this._tokens[this._current - 1];
  }
  _matchOne(e) {
    return this._check(e) ? (this._advance(), !0) : !1;
  }
  _advance() {
    return this._isAtEnd() || this._current++, this._previous();
  }
  _consume(e, t) {
    if (this._check(e))
      return this._advance();
    throw this._errExpectedButGot(t, this._peek());
  }
  _errExpectedButGot(e, t, n) {
    const r = S(1668, `Expected: {0}
Received: '{1}'.`, e, HM.getLexeme(t)), s = t.offset, o = HM.getLexeme(t);
    return this._parsingErrors.push({ message: r, offset: s, lexeme: o, additionalInfo: n }), Y_._parseError;
  }
  _check(e) {
    return this._peek().type === e;
  }
  _peek() {
    return this._tokens[this._current];
  }
  _isAtEnd() {
    return this._peek().type === 20;
  }
}, Y_._parseError = new Error(), Y_);
const qCe = class qCe {
  static false() {
    return cu.INSTANCE;
  }
  static true() {
    return ed.INSTANCE;
  }
  static has(e) {
    return $T.create(e);
  }
  static equals(e, t) {
    return qA.create(e, t);
  }
  static notEquals(e, t) {
    return Lq.create(e, t);
  }
  static regex(e, t) {
    return o4.create(e, t);
  }
  static in(e, t) {
    return Eq.create(e, t);
  }
  static notIn(e, t) {
    return xq.create(e, t);
  }
  static not(e) {
    return jT.create(e);
  }
  static and(...e) {
    return dx.create(e, null, !0);
  }
  static or(...e) {
    return uy.create(e, null, !0);
  }
  static deserialize(e) {
    return e == null ? void 0 : this._parser.parse(e);
  }
};
qCe._parser = new frt({ regexParsingWithErrorRecovery: !1 });
let Re = qCe;
function grt(i, e) {
  const t = i ? i.substituteConstants() : void 0, n = e ? e.substituteConstants() : void 0;
  return !t && !n ? !0 : !t || !n ? !1 : t.equals(n);
}
function wF(i, e) {
  return i.cmp(e);
}
const Rj = class Rj {
  constructor() {
    this.type = 0;
  }
  cmp(e) {
    return this.type - e.type;
  }
  equals(e) {
    return e.type === this.type;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return !1;
  }
  serialize() {
    return "false";
  }
  keys() {
    return [];
  }
  negate() {
    return ed.INSTANCE;
  }
};
Rj.INSTANCE = new Rj();
let cu = Rj;
const Aj = class Aj {
  constructor() {
    this.type = 1;
  }
  cmp(e) {
    return this.type - e.type;
  }
  equals(e) {
    return e.type === this.type;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return !0;
  }
  serialize() {
    return "true";
  }
  keys() {
    return [];
  }
  negate() {
    return cu.INSTANCE;
  }
};
Aj.INSTANCE = new Aj();
let ed = Aj;
class $T {
  static create(e, t = null) {
    const n = Jl.get(e);
    return typeof n == "boolean" ? n ? ed.INSTANCE : cu.INSTANCE : new $T(e, t);
  }
  constructor(e, t) {
    this.key = e, this.negated = t, this.type = 2;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : WPe(this.key, e.key);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key : !1;
  }
  substituteConstants() {
    const e = Jl.get(this.key);
    return typeof e == "boolean" ? e ? ed.INSTANCE : cu.INSTANCE : this;
  }
  evaluate(e) {
    return !!e.getValue(this.key);
  }
  serialize() {
    return this.key;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = jT.create(this.key, this)), this.negated;
  }
}
class qA {
  static create(e, t, n = null) {
    if (typeof t == "boolean")
      return t ? $T.create(e, n) : jT.create(e, n);
    const r = Jl.get(e);
    return typeof r == "boolean" ? t === (r ? "true" : "false") ? ed.INSTANCE : cu.INSTANCE : new qA(e, t, n);
  }
  constructor(e, t, n) {
    this.key = e, this.value = t, this.negated = n, this.type = 4;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : GT(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key && this.value === e.value : !1;
  }
  substituteConstants() {
    const e = Jl.get(this.key);
    if (typeof e == "boolean") {
      const t = e ? "true" : "false";
      return this.value === t ? ed.INSTANCE : cu.INSTANCE;
    }
    return this;
  }
  evaluate(e) {
    return e.getValue(this.key) == this.value;
  }
  serialize() {
    return `${this.key} == '${this.value}'`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Lq.create(this.key, this.value, this)), this.negated;
  }
}
class Eq {
  static create(e, t) {
    return new Eq(e, t);
  }
  constructor(e, t) {
    this.key = e, this.valueKey = t, this.type = 10, this.negated = null;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : GT(this.key, this.valueKey, e.key, e.valueKey);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key && this.valueKey === e.valueKey : !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    const t = e.getValue(this.valueKey), n = e.getValue(this.key);
    return Array.isArray(t) ? t.includes(n) : typeof n == "string" && typeof t == "object" && t !== null ? rrt.call(t, n) : !1;
  }
  serialize() {
    return `${this.key} in '${this.valueKey}'`;
  }
  keys() {
    return [this.key, this.valueKey];
  }
  negate() {
    return this.negated || (this.negated = xq.create(this.key, this.valueKey)), this.negated;
  }
}
class xq {
  static create(e, t) {
    return new xq(e, t);
  }
  constructor(e, t) {
    this.key = e, this.valueKey = t, this.type = 11, this._negated = Eq.create(e, t);
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : this._negated.cmp(e._negated);
  }
  equals(e) {
    return e.type === this.type ? this._negated.equals(e._negated) : !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return !this._negated.evaluate(e);
  }
  serialize() {
    return `${this.key} not in '${this.valueKey}'`;
  }
  keys() {
    return this._negated.keys();
  }
  negate() {
    return this._negated;
  }
}
class Lq {
  static create(e, t, n = null) {
    if (typeof t == "boolean")
      return t ? jT.create(e, n) : $T.create(e, n);
    const r = Jl.get(e);
    return typeof r == "boolean" ? t === (r ? "true" : "false") ? cu.INSTANCE : ed.INSTANCE : new Lq(e, t, n);
  }
  constructor(e, t, n) {
    this.key = e, this.value = t, this.negated = n, this.type = 5;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : GT(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key && this.value === e.value : !1;
  }
  substituteConstants() {
    const e = Jl.get(this.key);
    if (typeof e == "boolean") {
      const t = e ? "true" : "false";
      return this.value === t ? cu.INSTANCE : ed.INSTANCE;
    }
    return this;
  }
  evaluate(e) {
    return e.getValue(this.key) != this.value;
  }
  serialize() {
    return `${this.key} != '${this.value}'`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = qA.create(this.key, this.value, this)), this.negated;
  }
}
class jT {
  static create(e, t = null) {
    const n = Jl.get(e);
    return typeof n == "boolean" ? n ? cu.INSTANCE : ed.INSTANCE : new jT(e, t);
  }
  constructor(e, t) {
    this.key = e, this.negated = t, this.type = 3;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : WPe(this.key, e.key);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key : !1;
  }
  substituteConstants() {
    const e = Jl.get(this.key);
    return typeof e == "boolean" ? e ? cu.INSTANCE : ed.INSTANCE : this;
  }
  evaluate(e) {
    return !e.getValue(this.key);
  }
  serialize() {
    return `!${this.key}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = $T.create(this.key, this)), this.negated;
  }
}
function Tq(i, e) {
  if (typeof i == "string") {
    const t = parseFloat(i);
    isNaN(t) || (i = t);
  }
  return typeof i == "string" || typeof i == "number" ? e(i) : cu.INSTANCE;
}
class kq {
  static create(e, t, n = null) {
    return Tq(t, (r) => new kq(e, r, n));
  }
  constructor(e, t, n) {
    this.key = e, this.value = t, this.negated = n, this.type = 12;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : GT(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key && this.value === e.value : !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return typeof this.value == "string" ? !1 : parseFloat(e.getValue(this.key)) > this.value;
  }
  serialize() {
    return `${this.key} > ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Nq.create(this.key, this.value, this)), this.negated;
  }
}
class Dq {
  static create(e, t, n = null) {
    return Tq(t, (r) => new Dq(e, r, n));
  }
  constructor(e, t, n) {
    this.key = e, this.value = t, this.negated = n, this.type = 13;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : GT(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key && this.value === e.value : !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return typeof this.value == "string" ? !1 : parseFloat(e.getValue(this.key)) >= this.value;
  }
  serialize() {
    return `${this.key} >= ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Iq.create(this.key, this.value, this)), this.negated;
  }
}
class Iq {
  static create(e, t, n = null) {
    return Tq(t, (r) => new Iq(e, r, n));
  }
  constructor(e, t, n) {
    this.key = e, this.value = t, this.negated = n, this.type = 14;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : GT(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key && this.value === e.value : !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return typeof this.value == "string" ? !1 : parseFloat(e.getValue(this.key)) < this.value;
  }
  serialize() {
    return `${this.key} < ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = Dq.create(this.key, this.value, this)), this.negated;
  }
}
class Nq {
  static create(e, t, n = null) {
    return Tq(t, (r) => new Nq(e, r, n));
  }
  constructor(e, t, n) {
    this.key = e, this.value = t, this.negated = n, this.type = 15;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : GT(this.key, this.value, e.key, e.value);
  }
  equals(e) {
    return e.type === this.type ? this.key === e.key && this.value === e.value : !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return typeof this.value == "string" ? !1 : parseFloat(e.getValue(this.key)) <= this.value;
  }
  serialize() {
    return `${this.key} <= ${this.value}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = kq.create(this.key, this.value, this)), this.negated;
  }
}
class o4 {
  static create(e, t) {
    return new o4(e, t);
  }
  constructor(e, t) {
    this.key = e, this.regexp = t, this.type = 7, this.negated = null;
  }
  cmp(e) {
    if (e.type !== this.type)
      return this.type - e.type;
    if (this.key < e.key)
      return -1;
    if (this.key > e.key)
      return 1;
    const t = this.regexp ? this.regexp.source : "", n = e.regexp ? e.regexp.source : "";
    return t < n ? -1 : t > n ? 1 : 0;
  }
  equals(e) {
    if (e.type === this.type) {
      const t = this.regexp ? this.regexp.source : "", n = e.regexp ? e.regexp.source : "";
      return this.key === e.key && t === n;
    }
    return !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    const t = e.getValue(this.key);
    return this.regexp ? this.regexp.test(t) : !1;
  }
  serialize() {
    const e = this.regexp ? `/${this.regexp.source}/${this.regexp.flags}` : "/invalid/";
    return `${this.key} =~ ${e}`;
  }
  keys() {
    return [this.key];
  }
  negate() {
    return this.negated || (this.negated = tfe.create(this)), this.negated;
  }
}
class tfe {
  static create(e) {
    return new tfe(e);
  }
  constructor(e) {
    this._actual = e, this.type = 8;
  }
  cmp(e) {
    return e.type !== this.type ? this.type - e.type : this._actual.cmp(e._actual);
  }
  equals(e) {
    return e.type === this.type ? this._actual.equals(e._actual) : !1;
  }
  substituteConstants() {
    return this;
  }
  evaluate(e) {
    return !this._actual.evaluate(e);
  }
  serialize() {
    return `!(${this._actual.serialize()})`;
  }
  keys() {
    return this._actual.keys();
  }
  negate() {
    return this._actual;
  }
}
function HPe(i) {
  let e = null;
  for (let t = 0, n = i.length; t < n; t++) {
    const r = i[t].substituteConstants();
    if (i[t] !== r && e === null) {
      e = [];
      for (let s = 0; s < t; s++)
        e[s] = i[s];
    }
    e !== null && (e[t] = r);
  }
  return e === null ? i : e;
}
class dx {
  static create(e, t, n) {
    return dx._normalizeArr(e, t, n);
  }
  constructor(e, t) {
    this.expr = e, this.negated = t, this.type = 6;
  }
  cmp(e) {
    if (e.type !== this.type)
      return this.type - e.type;
    if (this.expr.length < e.expr.length)
      return -1;
    if (this.expr.length > e.expr.length)
      return 1;
    for (let t = 0, n = this.expr.length; t < n; t++) {
      const r = wF(this.expr[t], e.expr[t]);
      if (r !== 0)
        return r;
    }
    return 0;
  }
  equals(e) {
    if (e.type === this.type) {
      if (this.expr.length !== e.expr.length)
        return !1;
      for (let t = 0, n = this.expr.length; t < n; t++)
        if (!this.expr[t].equals(e.expr[t]))
          return !1;
      return !0;
    }
    return !1;
  }
  substituteConstants() {
    const e = HPe(this.expr);
    return e === this.expr ? this : dx.create(e, this.negated, !1);
  }
  evaluate(e) {
    for (let t = 0, n = this.expr.length; t < n; t++)
      if (!this.expr[t].evaluate(e))
        return !1;
    return !0;
  }
  static _normalizeArr(e, t, n) {
    const r = [];
    let s = !1;
    for (const o of e)
      if (o) {
        if (o.type === 1) {
          s = !0;
          continue;
        }
        if (o.type === 0)
          return cu.INSTANCE;
        if (o.type === 6) {
          r.push(...o.expr);
          continue;
        }
        r.push(o);
      }
    if (r.length === 0 && s)
      return ed.INSTANCE;
    if (r.length !== 0) {
      if (r.length === 1)
        return r[0];
      r.sort(wF);
      for (let o = 1; o < r.length; o++)
        r[o - 1].equals(r[o]) && (r.splice(o, 1), o--);
      if (r.length === 1)
        return r[0];
      for (; r.length > 1; ) {
        const o = r[r.length - 1];
        if (o.type !== 9)
          break;
        r.pop();
        const a = r.pop(), l = r.length === 0, c = uy.create(o.expr.map((u) => dx.create([u, a], null, n)), null, l);
        c && (r.push(c), r.sort(wF));
      }
      if (r.length === 1)
        return r[0];
      if (n) {
        for (let o = 0; o < r.length; o++)
          for (let a = o + 1; a < r.length; a++)
            if (r[o].negate().equals(r[a]))
              return cu.INSTANCE;
        if (r.length === 1)
          return r[0];
      }
      return new dx(r, t);
    }
  }
  serialize() {
    return this.expr.map((e) => e.serialize()).join(" && ");
  }
  keys() {
    const e = [];
    for (const t of this.expr)
      e.push(...t.keys());
    return e;
  }
  negate() {
    if (!this.negated) {
      const e = [];
      for (const t of this.expr)
        e.push(t.negate());
      this.negated = uy.create(e, this, !0);
    }
    return this.negated;
  }
}
class uy {
  static create(e, t, n) {
    return uy._normalizeArr(e, t, n);
  }
  constructor(e, t) {
    this.expr = e, this.negated = t, this.type = 9;
  }
  cmp(e) {
    if (e.type !== this.type)
      return this.type - e.type;
    if (this.expr.length < e.expr.length)
      return -1;
    if (this.expr.length > e.expr.length)
      return 1;
    for (let t = 0, n = this.expr.length; t < n; t++) {
      const r = wF(this.expr[t], e.expr[t]);
      if (r !== 0)
        return r;
    }
    return 0;
  }
  equals(e) {
    if (e.type === this.type) {
      if (this.expr.length !== e.expr.length)
        return !1;
      for (let t = 0, n = this.expr.length; t < n; t++)
        if (!this.expr[t].equals(e.expr[t]))
          return !1;
      return !0;
    }
    return !1;
  }
  substituteConstants() {
    const e = HPe(this.expr);
    return e === this.expr ? this : uy.create(e, this.negated, !1);
  }
  evaluate(e) {
    for (let t = 0, n = this.expr.length; t < n; t++)
      if (this.expr[t].evaluate(e))
        return !0;
    return !1;
  }
  static _normalizeArr(e, t, n) {
    let r = [], s = !1;
    if (e) {
      for (let o = 0, a = e.length; o < a; o++) {
        const l = e[o];
        if (l) {
          if (l.type === 0) {
            s = !0;
            continue;
          }
          if (l.type === 1)
            return ed.INSTANCE;
          if (l.type === 9) {
            r = r.concat(l.expr);
            continue;
          }
          r.push(l);
        }
      }
      if (r.length === 0 && s)
        return cu.INSTANCE;
      r.sort(wF);
    }
    if (r.length !== 0) {
      if (r.length === 1)
        return r[0];
      for (let o = 1; o < r.length; o++)
        r[o - 1].equals(r[o]) && (r.splice(o, 1), o--);
      if (r.length === 1)
        return r[0];
      if (n) {
        for (let o = 0; o < r.length; o++)
          for (let a = o + 1; a < r.length; a++)
            if (r[o].negate().equals(r[a]))
              return ed.INSTANCE;
        if (r.length === 1)
          return r[0];
      }
      return new uy(r, t);
    }
  }
  serialize() {
    return this.expr.map((e) => e.serialize()).join(" || ");
  }
  keys() {
    const e = [];
    for (const t of this.expr)
      e.push(...t.keys());
    return e;
  }
  negate() {
    if (!this.negated) {
      const e = [];
      for (const t of this.expr)
        e.push(t.negate());
      for (; e.length > 1; ) {
        const t = e.shift(), n = e.shift(), r = [];
        for (const s of Yxe(t))
          for (const o of Yxe(n))
            r.push(dx.create([s, o], null, !1));
        e.unshift(uy.create(r, null, !1));
      }
      this.negated = uy.create(e, this, !0);
    }
    return this.negated;
  }
}
const IN = class IN extends $T {
  static all() {
    return IN._info.values();
  }
  constructor(e, t, n) {
    super(e, null), this._defaultValue = t, typeof n == "object" ? IN._info.push({ ...n, key: e }) : n !== !0 && IN._info.push({ key: e, description: n, type: t != null ? typeof t : void 0 });
  }
  bindTo(e) {
    return e.createKey(this.key, this._defaultValue);
  }
  getValue(e) {
    return e.getContextKeyValue(this.key);
  }
  toNegated() {
    return this.negate();
  }
  isEqualTo(e) {
    return qA.create(this.key, e);
  }
};
IN._info = [];
let ut = IN;
const Jt = Vn("contextKeyService");
function WPe(i, e) {
  return i < e ? -1 : i > e ? 1 : 0;
}
function GT(i, e, t, n) {
  return i < t ? -1 : i > t ? 1 : e < n ? -1 : e > n ? 1 : 0;
}
function Sie(i, e) {
  if (i.type === 0 || e.type === 1)
    return !0;
  if (i.type === 9)
    return e.type === 9 ? Kxe(i.expr, e.expr) : !1;
  if (e.type === 9) {
    for (const t of e.expr)
      if (Sie(i, t))
        return !0;
    return !1;
  }
  if (i.type === 6) {
    if (e.type === 6)
      return Kxe(e.expr, i.expr);
    for (const t of i.expr)
      if (Sie(t, e))
        return !0;
    return !1;
  }
  return i.equals(e);
}
function Kxe(i, e) {
  let t = 0, n = 0;
  for (; t < i.length && n < e.length; ) {
    const r = i[t].cmp(e[n]);
    if (r < 0)
      return !1;
    r === 0 && t++, n++;
  }
  return t === i.length;
}
function Yxe(i) {
  return i.type === 9 ? i.expr : [i];
}
class prt {
  constructor() {
    this.data = /* @__PURE__ */ new Map();
  }
  add(e, t) {
    DJ(ga(e)), DJ(Ra(t)), DJ(!this.data.has(e), "There is already an extension with this id"), this.data.set(e, t);
  }
  as(e) {
    return this.data.get(e) || null;
  }
  dispose() {
    this.data.forEach((e) => {
      ZL(e.dispose) && e.dispose();
    }), this.data.clear();
  }
}
const Fs = new prt();
class nfe {
  constructor() {
    this._coreKeybindings = new xc(), this._extensionKeybindings = [], this._cachedMergedKeybindings = null;
  }
  /**
   * Take current platform into account and reduce to primary & secondary.
   */
  static bindToCurrentPlatform(e) {
    if (Ad === 1) {
      if (e && e.win)
        return e.win;
    } else if (Ad === 2) {
      if (e && e.mac)
        return e.mac;
    } else if (e && e.linux)
      return e.linux;
    return e;
  }
  registerKeybindingRule(e) {
    const t = nfe.bindToCurrentPlatform(e), n = new ke();
    if (t && t.primary) {
      const r = Zne(t.primary, Ad);
      r && n.add(this._registerDefaultKeybinding(r, e.id, e.args, e.weight, 0, e.when));
    }
    if (t && Array.isArray(t.secondary))
      for (let r = 0, s = t.secondary.length; r < s; r++) {
        const o = t.secondary[r], a = Zne(o, Ad);
        a && n.add(this._registerDefaultKeybinding(a, e.id, e.args, e.weight, -r - 1, e.when));
      }
    return n;
  }
  registerCommandAndKeybindingRule(e) {
    return Vg(this.registerKeybindingRule(e), _i.registerCommand(e));
  }
  _registerDefaultKeybinding(e, t, n, r, s, o) {
    const a = this._coreKeybindings.push({
      keybinding: e,
      command: t,
      commandArgs: n,
      when: o,
      weight1: r,
      weight2: s,
      extensionId: null,
      isBuiltinExtension: !1
    });
    return this._cachedMergedKeybindings = null, Et(() => {
      a(), this._cachedMergedKeybindings = null;
    });
  }
  getDefaultKeybindings() {
    return this._cachedMergedKeybindings || (this._cachedMergedKeybindings = Array.from(this._coreKeybindings).concat(this._extensionKeybindings), this._cachedMergedKeybindings.sort(_rt)), this._cachedMergedKeybindings.slice(0);
  }
}
const Pa = new nfe(), mrt = {
  EditorModes: "platform.keybindingsRegistry"
};
Fs.add(mrt.EditorModes, Pa);
function _rt(i, e) {
  if (i.weight1 !== e.weight1)
    return i.weight1 - e.weight1;
  if (i.command && e.command) {
    if (i.command < e.command)
      return -1;
    if (i.command > e.command)
      return 1;
  }
  return i.weight2 - e.weight2;
}
var brt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Xxe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, SW;
function $N(i) {
  return i.command !== void 0;
}
function vrt(i) {
  return i.submenu !== void 0;
}
const te = class te {
  /**
   * Create a new `MenuId` with the unique identifier. Will throw if a menu
   * with the identifier already exists, use `MenuId.for(ident)` or a unique
   * identifier
   */
  constructor(e) {
    if (te._instances.has(e))
      throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);
    te._instances.set(e, this), this.id = e;
  }
};
te._instances = /* @__PURE__ */ new Map(), te.CommandPalette = new te("CommandPalette"), te.DebugBreakpointsContext = new te("DebugBreakpointsContext"), te.DebugCallStackContext = new te("DebugCallStackContext"), te.DebugConsoleContext = new te("DebugConsoleContext"), te.DebugVariablesContext = new te("DebugVariablesContext"), te.NotebookVariablesContext = new te("NotebookVariablesContext"), te.DebugHoverContext = new te("DebugHoverContext"), te.DebugWatchContext = new te("DebugWatchContext"), te.DebugToolBar = new te("DebugToolBar"), te.DebugToolBarStop = new te("DebugToolBarStop"), te.DebugDisassemblyContext = new te("DebugDisassemblyContext"), te.DebugCallStackToolbar = new te("DebugCallStackToolbar"), te.DebugCreateConfiguration = new te("DebugCreateConfiguration"), te.EditorContext = new te("EditorContext"), te.SimpleEditorContext = new te("SimpleEditorContext"), te.EditorContent = new te("EditorContent"), te.EditorLineNumberContext = new te("EditorLineNumberContext"), te.EditorContextCopy = new te("EditorContextCopy"), te.EditorContextPeek = new te("EditorContextPeek"), te.EditorContextShare = new te("EditorContextShare"), te.EditorTitle = new te("EditorTitle"), te.CompactWindowEditorTitle = new te("CompactWindowEditorTitle"), te.EditorTitleRun = new te("EditorTitleRun"), te.EditorTitleContext = new te("EditorTitleContext"), te.EditorTitleContextShare = new te("EditorTitleContextShare"), te.EmptyEditorGroup = new te("EmptyEditorGroup"), te.EmptyEditorGroupContext = new te("EmptyEditorGroupContext"), te.EditorTabsBarContext = new te("EditorTabsBarContext"), te.EditorTabsBarShowTabsSubmenu = new te("EditorTabsBarShowTabsSubmenu"), te.EditorTabsBarShowTabsZenModeSubmenu = new te("EditorTabsBarShowTabsZenModeSubmenu"), te.EditorActionsPositionSubmenu = new te("EditorActionsPositionSubmenu"), te.EditorSplitMoveSubmenu = new te("EditorSplitMoveSubmenu"), te.ExplorerContext = new te("ExplorerContext"), te.ExplorerContextShare = new te("ExplorerContextShare"), te.ExtensionContext = new te("ExtensionContext"), te.ExtensionEditorContextMenu = new te("ExtensionEditorContextMenu"), te.GlobalActivity = new te("GlobalActivity"), te.CommandCenter = new te("CommandCenter"), te.CommandCenterCenter = new te("CommandCenterCenter"), te.LayoutControlMenuSubmenu = new te("LayoutControlMenuSubmenu"), te.LayoutControlMenu = new te("LayoutControlMenu"), te.MenubarMainMenu = new te("MenubarMainMenu"), te.MenubarAppearanceMenu = new te("MenubarAppearanceMenu"), te.MenubarDebugMenu = new te("MenubarDebugMenu"), te.MenubarEditMenu = new te("MenubarEditMenu"), te.MenubarCopy = new te("MenubarCopy"), te.MenubarFileMenu = new te("MenubarFileMenu"), te.MenubarGoMenu = new te("MenubarGoMenu"), te.MenubarHelpMenu = new te("MenubarHelpMenu"), te.MenubarLayoutMenu = new te("MenubarLayoutMenu"), te.MenubarNewBreakpointMenu = new te("MenubarNewBreakpointMenu"), te.PanelAlignmentMenu = new te("PanelAlignmentMenu"), te.PanelPositionMenu = new te("PanelPositionMenu"), te.ActivityBarPositionMenu = new te("ActivityBarPositionMenu"), te.MenubarPreferencesMenu = new te("MenubarPreferencesMenu"), te.MenubarRecentMenu = new te("MenubarRecentMenu"), te.MenubarSelectionMenu = new te("MenubarSelectionMenu"), te.MenubarShare = new te("MenubarShare"), te.MenubarSwitchEditorMenu = new te("MenubarSwitchEditorMenu"), te.MenubarSwitchGroupMenu = new te("MenubarSwitchGroupMenu"), te.MenubarTerminalMenu = new te("MenubarTerminalMenu"), te.MenubarTerminalSuggestStatusMenu = new te("MenubarTerminalSuggestStatusMenu"), te.MenubarViewMenu = new te("MenubarViewMenu"), te.MenubarHomeMenu = new te("MenubarHomeMenu"), te.OpenEditorsContext = new te("OpenEditorsContext"), te.OpenEditorsContextShare = new te("OpenEditorsContextShare"), te.ProblemsPanelContext = new te("ProblemsPanelContext"), te.SCMInputBox = new te("SCMInputBox"), te.SCMChangeContext = new te("SCMChangeContext"), te.SCMResourceContext = new te("SCMResourceContext"), te.SCMResourceContextShare = new te("SCMResourceContextShare"), te.SCMResourceFolderContext = new te("SCMResourceFolderContext"), te.SCMResourceGroupContext = new te("SCMResourceGroupContext"), te.SCMSourceControl = new te("SCMSourceControl"), te.SCMSourceControlInline = new te("SCMSourceControlInline"), te.SCMSourceControlTitle = new te("SCMSourceControlTitle"), te.SCMHistoryTitle = new te("SCMHistoryTitle"), te.SCMHistoryItemContext = new te("SCMHistoryItemContext"), te.SCMHistoryItemChangeContext = new te("SCMHistoryItemChangeContext"), te.SCMHistoryItemHover = new te("SCMHistoryItemHover"), te.SCMHistoryItemRefContext = new te("SCMHistoryItemRefContext"), te.SCMQuickDiffDecorations = new te("SCMQuickDiffDecorations"), te.SCMTitle = new te("SCMTitle"), te.SearchContext = new te("SearchContext"), te.SearchActionMenu = new te("SearchActionContext"), te.StatusBarWindowIndicatorMenu = new te("StatusBarWindowIndicatorMenu"), te.StatusBarRemoteIndicatorMenu = new te("StatusBarRemoteIndicatorMenu"), te.StickyScrollContext = new te("StickyScrollContext"), te.TestItem = new te("TestItem"), te.TestItemGutter = new te("TestItemGutter"), te.TestProfilesContext = new te("TestProfilesContext"), te.TestMessageContext = new te("TestMessageContext"), te.TestMessageContent = new te("TestMessageContent"), te.TestPeekElement = new te("TestPeekElement"), te.TestPeekTitle = new te("TestPeekTitle"), te.TestCallStack = new te("TestCallStack"), te.TestCoverageFilterItem = new te("TestCoverageFilterItem"), te.TouchBarContext = new te("TouchBarContext"), te.TitleBar = new te("TitleBar"), te.TitleBarContext = new te("TitleBarContext"), te.TitleBarTitleContext = new te("TitleBarTitleContext"), te.TunnelContext = new te("TunnelContext"), te.TunnelPrivacy = new te("TunnelPrivacy"), te.TunnelProtocol = new te("TunnelProtocol"), te.TunnelPortInline = new te("TunnelInline"), te.TunnelTitle = new te("TunnelTitle"), te.TunnelLocalAddressInline = new te("TunnelLocalAddressInline"), te.TunnelOriginInline = new te("TunnelOriginInline"), te.ViewItemContext = new te("ViewItemContext"), te.ViewContainerTitle = new te("ViewContainerTitle"), te.ViewContainerTitleContext = new te("ViewContainerTitleContext"), te.ViewTitle = new te("ViewTitle"), te.ViewTitleContext = new te("ViewTitleContext"), te.CommentEditorActions = new te("CommentEditorActions"), te.CommentThreadTitle = new te("CommentThreadTitle"), te.CommentThreadActions = new te("CommentThreadActions"), te.CommentThreadAdditionalActions = new te("CommentThreadAdditionalActions"), te.CommentThreadTitleContext = new te("CommentThreadTitleContext"), te.CommentThreadCommentContext = new te("CommentThreadCommentContext"), te.CommentTitle = new te("CommentTitle"), te.CommentActions = new te("CommentActions"), te.CommentsViewThreadActions = new te("CommentsViewThreadActions"), te.InteractiveToolbar = new te("InteractiveToolbar"), te.InteractiveCellTitle = new te("InteractiveCellTitle"), te.InteractiveCellDelete = new te("InteractiveCellDelete"), te.InteractiveCellExecute = new te("InteractiveCellExecute"), te.InteractiveInputExecute = new te("InteractiveInputExecute"), te.InteractiveInputConfig = new te("InteractiveInputConfig"), te.ReplInputExecute = new te("ReplInputExecute"), te.IssueReporter = new te("IssueReporter"), te.NotebookToolbar = new te("NotebookToolbar"), te.NotebookToolbarContext = new te("NotebookToolbarContext"), te.NotebookStickyScrollContext = new te("NotebookStickyScrollContext"), te.NotebookCellTitle = new te("NotebookCellTitle"), te.NotebookCellDelete = new te("NotebookCellDelete"), te.NotebookCellInsert = new te("NotebookCellInsert"), te.NotebookCellBetween = new te("NotebookCellBetween"), te.NotebookCellListTop = new te("NotebookCellTop"), te.NotebookCellExecute = new te("NotebookCellExecute"), te.NotebookCellExecuteGoTo = new te("NotebookCellExecuteGoTo"), te.NotebookCellExecutePrimary = new te("NotebookCellExecutePrimary"), te.NotebookDiffCellInputTitle = new te("NotebookDiffCellInputTitle"), te.NotebookDiffDocumentMetadata = new te("NotebookDiffDocumentMetadata"), te.NotebookDiffCellMetadataTitle = new te("NotebookDiffCellMetadataTitle"), te.NotebookDiffCellOutputsTitle = new te("NotebookDiffCellOutputsTitle"), te.NotebookOutputToolbar = new te("NotebookOutputToolbar"), te.NotebookOutlineFilter = new te("NotebookOutlineFilter"), te.NotebookOutlineActionMenu = new te("NotebookOutlineActionMenu"), te.NotebookEditorLayoutConfigure = new te("NotebookEditorLayoutConfigure"), te.NotebookKernelSource = new te("NotebookKernelSource"), te.BulkEditTitle = new te("BulkEditTitle"), te.BulkEditContext = new te("BulkEditContext"), te.TimelineItemContext = new te("TimelineItemContext"), te.TimelineTitle = new te("TimelineTitle"), te.TimelineTitleContext = new te("TimelineTitleContext"), te.TimelineFilterSubMenu = new te("TimelineFilterSubMenu"), te.AccountsContext = new te("AccountsContext"), te.SidebarTitle = new te("SidebarTitle"), te.PanelTitle = new te("PanelTitle"), te.AuxiliaryBarTitle = new te("AuxiliaryBarTitle"), te.TerminalInstanceContext = new te("TerminalInstanceContext"), te.TerminalEditorInstanceContext = new te("TerminalEditorInstanceContext"), te.TerminalNewDropdownContext = new te("TerminalNewDropdownContext"), te.TerminalTabContext = new te("TerminalTabContext"), te.TerminalTabEmptyAreaContext = new te("TerminalTabEmptyAreaContext"), te.TerminalStickyScrollContext = new te("TerminalStickyScrollContext"), te.WebviewContext = new te("WebviewContext"), te.InlineCompletionsActions = new te("InlineCompletionsActions"), te.InlineEditsActions = new te("InlineEditsActions"), te.NewFile = new te("NewFile"), te.MergeInput1Toolbar = new te("MergeToolbar1Toolbar"), te.MergeInput2Toolbar = new te("MergeToolbar2Toolbar"), te.MergeBaseToolbar = new te("MergeBaseToolbar"), te.MergeInputResultToolbar = new te("MergeToolbarResultToolbar"), te.InlineSuggestionToolbar = new te("InlineSuggestionToolbar"), te.InlineEditToolbar = new te("InlineEditToolbar"), te.ChatContext = new te("ChatContext"), te.ChatCodeBlock = new te("ChatCodeblock"), te.ChatCompareBlock = new te("ChatCompareBlock"), te.ChatMessageTitle = new te("ChatMessageTitle"), te.ChatHistory = new te("ChatHistory"), te.ChatWelcomeHistoryContext = new te("ChatWelcomeHistoryContext"), te.ChatMessageFooter = new te("ChatMessageFooter"), te.ChatExecute = new te("ChatExecute"), te.ChatExecuteSecondary = new te("ChatExecuteSecondary"), te.ChatInput = new te("ChatInput"), te.ChatInputSide = new te("ChatInputSide"), te.ChatModePicker = new te("ChatModePicker"), te.ChatEditingWidgetToolbar = new te("ChatEditingWidgetToolbar"), te.ChatEditingEditorContent = new te("ChatEditingEditorContent"), te.ChatEditingEditorHunk = new te("ChatEditingEditorHunk"), te.ChatEditingDeletedNotebookCell = new te("ChatEditingDeletedNotebookCell"), te.ChatInputAttachmentToolbar = new te("ChatInputAttachmentToolbar"), te.ChatEditingWidgetModifiedFilesToolbar = new te("ChatEditingWidgetModifiedFilesToolbar"), te.ChatInputResourceAttachmentContext = new te("ChatInputResourceAttachmentContext"), te.ChatInputSymbolAttachmentContext = new te("ChatInputSymbolAttachmentContext"), te.ChatInlineResourceAnchorContext = new te("ChatInlineResourceAnchorContext"), te.ChatInlineSymbolAnchorContext = new te("ChatInlineSymbolAnchorContext"), te.ChatMessageCheckpoint = new te("ChatMessageCheckpoint"), te.ChatMessageRestoreCheckpoint = new te("ChatMessageRestoreCheckpoint"), te.ChatEditingCodeBlockContext = new te("ChatEditingCodeBlockContext"), te.ChatTitleBarMenu = new te("ChatTitleBarMenu"), te.ChatAttachmentsContext = new te("ChatAttachmentsContext"), te.ChatToolOutputResourceToolbar = new te("ChatToolOutputResourceToolbar"), te.ChatTextEditorMenu = new te("ChatTextEditorMenu"), te.ChatToolOutputResourceContext = new te("ChatToolOutputResourceContext"), te.ChatMultiDiffContext = new te("ChatMultiDiffContext"), te.ChatSessionsMenu = new te("ChatSessionsMenu"), te.ChatConfirmationMenu = new te("ChatConfirmationMenu"), te.AccessibleView = new te("AccessibleView"), te.MultiDiffEditorFileToolbar = new te("MultiDiffEditorFileToolbar"), te.DiffEditorHunkToolbar = new te("DiffEditorHunkToolbar"), te.DiffEditorSelectionToolbar = new te("DiffEditorSelectionToolbar");
let wt = te;
const eg = Vn("menuService"), N3 = class N3 {
  static for(e) {
    let t = this._all.get(e);
    return t || (t = new N3(e), this._all.set(e, t)), t;
  }
  static merge(e) {
    const t = /* @__PURE__ */ new Set();
    for (const n of e)
      n instanceof N3 && t.add(n.id);
    return t;
  }
  constructor(e) {
    this.id = e, this.has = (t) => t === e;
  }
};
N3._all = /* @__PURE__ */ new Map();
let FE = N3;
const Oa = new class {
  constructor() {
    this._commands = /* @__PURE__ */ new Map(), this._menuItems = /* @__PURE__ */ new Map(), this._onDidChangeMenu = new qtt({
      merge: FE.merge
    }), this.onDidChangeMenu = this._onDidChangeMenu.event;
  }
  addCommand(i) {
    return this._commands.set(i.id, i), this._onDidChangeMenu.fire(FE.for(wt.CommandPalette)), Et(() => {
      this._commands.delete(i.id) && this._onDidChangeMenu.fire(FE.for(wt.CommandPalette));
    });
  }
  getCommand(i) {
    return this._commands.get(i);
  }
  getCommands() {
    const i = /* @__PURE__ */ new Map();
    return this._commands.forEach((e, t) => i.set(t, e)), i;
  }
  appendMenuItem(i, e) {
    let t = this._menuItems.get(i);
    t || (t = new xc(), this._menuItems.set(i, t));
    const n = t.push(e);
    return this._onDidChangeMenu.fire(FE.for(i)), Et(() => {
      n(), this._onDidChangeMenu.fire(FE.for(i));
    });
  }
  appendMenuItems(i) {
    const e = new ke();
    for (const { id: t, item: n } of i)
      e.add(this.appendMenuItem(t, n));
    return e;
  }
  getMenuItems(i) {
    let e;
    return this._menuItems.has(i) ? e = [...this._menuItems.get(i)] : e = [], i === wt.CommandPalette && this._appendImplicitItems(e), e;
  }
  _appendImplicitItems(i) {
    const e = /* @__PURE__ */ new Set();
    for (const t of i)
      $N(t) && (e.add(t.command.id), t.alt && e.add(t.alt.id));
    this._commands.forEach((t, n) => {
      e.has(n) || i.push({ command: t });
    });
  }
}();
class Mx extends qR {
  constructor(e, t, n) {
    super(`submenuitem.${e.submenu.id}`, typeof e.title == "string" ? e.title : e.title.value, n, "submenu"), this.item = e, this.hideActions = t;
  }
}
let Uh = SW = class {
  static label(e, t) {
    return t != null && t.renderShortTitle && e.shortTitle ? typeof e.shortTitle == "string" ? e.shortTitle : e.shortTitle.value : typeof e.title == "string" ? e.title : e.title.value;
  }
  constructor(e, t, n, r, s, o, a) {
    var c;
    this.hideActions = r, this.menuKeybinding = s, this._commandService = a, this.id = e.id, this.label = SW.label(e, n), this.tooltip = (typeof e.tooltip == "string" ? e.tooltip : (c = e.tooltip) == null ? void 0 : c.value) ?? "", this.enabled = !e.precondition || o.contextMatchesRules(e.precondition), this.checked = void 0;
    let l;
    if (e.toggled) {
      const u = e.toggled.condition ? e.toggled : { condition: e.toggled };
      this.checked = o.contextMatchesRules(u.condition), this.checked && u.tooltip && (this.tooltip = typeof u.tooltip == "string" ? u.tooltip : u.tooltip.value), this.checked && qt.isThemeIcon(u.icon) && (l = u.icon), this.checked && u.title && (this.label = typeof u.title == "string" ? u.title : u.title.value);
    }
    l || (l = qt.isThemeIcon(e.icon) ? e.icon : void 0), this.item = e, this.alt = t ? new SW(t, void 0, n, r, void 0, o, a) : void 0, this._options = n, this.class = l && qt.asClassName(l);
  }
  run(...e) {
    var n, r;
    let t = [];
    return (n = this._options) != null && n.arg && (t = [...t, this._options.arg]), (r = this._options) != null && r.shouldForwardArgs && (t = [...t, ...e]), this._commandService.executeCommand(this.id, ...t);
  }
};
Uh = SW = brt([
  Xxe(5, Jt),
  Xxe(6, jr)
], Uh);
class Fa {
  constructor(e) {
    this.desc = e;
  }
}
function ar(i) {
  const e = [], t = new i(), { f1: n, menu: r, keybinding: s, ...o } = t.desc;
  if (_i.getCommand(o.id))
    throw new Error(`Cannot register two commands with the same id: ${o.id}`);
  if (e.push(_i.registerCommand({
    id: o.id,
    handler: (a, ...l) => t.run(a, ...l),
    metadata: o.metadata ?? { description: t.desc.title }
  })), Array.isArray(r))
    for (const a of r)
      e.push(Oa.appendMenuItem(a.id, { command: { ...o, precondition: a.precondition === null ? void 0 : o.precondition }, ...a }));
  else r && e.push(Oa.appendMenuItem(r.id, { command: { ...o, precondition: r.precondition === null ? void 0 : o.precondition }, ...r }));
  if (n && (e.push(Oa.appendMenuItem(wt.CommandPalette, { command: o, when: o.precondition })), e.push(Oa.addCommand(o))), Array.isArray(s))
    for (const a of s)
      e.push(Pa.registerKeybindingRule({
        ...a,
        id: o.id,
        when: o.precondition ? Re.and(o.precondition, a.when) : a.when
      }));
  else s && e.push(Pa.registerKeybindingRule({
    ...s,
    id: o.id,
    when: o.precondition ? Re.and(o.precondition, s.when) : s.when
  }));
  return {
    dispose() {
      or(e);
    }
  };
}
const rc = Vn("telemetryService");
var Zxe, Qxe, Jxe;
class yrt {
  constructor(e, t) {
    this.uri = e, this.value = t;
  }
}
function Crt(i) {
  return Array.isArray(i);
}
const tx = class tx {
  constructor(e, t) {
    if (this[Zxe] = "ResourceMap", e instanceof tx)
      this.map = new Map(e.map), this.toKey = t ?? tx.defaultToKey;
    else if (Crt(e)) {
      this.map = /* @__PURE__ */ new Map(), this.toKey = t ?? tx.defaultToKey;
      for (const [n, r] of e)
        this.set(n, r);
    } else
      this.map = /* @__PURE__ */ new Map(), this.toKey = e ?? tx.defaultToKey;
  }
  set(e, t) {
    return this.map.set(this.toKey(e), new yrt(e, t)), this;
  }
  get(e) {
    var t;
    return (t = this.map.get(this.toKey(e))) == null ? void 0 : t.value;
  }
  has(e) {
    return this.map.has(this.toKey(e));
  }
  get size() {
    return this.map.size;
  }
  clear() {
    this.map.clear();
  }
  delete(e) {
    return this.map.delete(this.toKey(e));
  }
  forEach(e, t) {
    typeof t < "u" && (e = e.bind(t));
    for (const [n, r] of this.map)
      e(r.value, r.uri, this);
  }
  *values() {
    for (const e of this.map.values())
      yield e.value;
  }
  *keys() {
    for (const e of this.map.values())
      yield e.uri;
  }
  *entries() {
    for (const e of this.map.values())
      yield [e.uri, e.value];
  }
  *[(Zxe = Symbol.toStringTag, Symbol.iterator)]() {
    for (const [, e] of this.map)
      yield [e.uri, e.value];
  }
};
tx.defaultToKey = (e) => e.toString();
let Co = tx;
class wrt {
  constructor(e, t) {
    this[Qxe] = "ResourceSet", !e || typeof e == "function" ? this._map = new Co(e) : (this._map = new Co(t), e.forEach(this.add, this));
  }
  get size() {
    return this._map.size;
  }
  add(e) {
    return this._map.set(e, e), this;
  }
  clear() {
    this._map.clear();
  }
  delete(e) {
    return this._map.delete(e);
  }
  forEach(e, t) {
    this._map.forEach((n, r) => e.call(t, r, r, this));
  }
  has(e) {
    return this._map.has(e);
  }
  entries() {
    return this._map.entries();
  }
  keys() {
    return this._map.keys();
  }
  values() {
    return this._map.keys();
  }
  [(Qxe = Symbol.toStringTag, Symbol.iterator)]() {
    return this.keys();
  }
}
class Srt {
  constructor() {
    this[Jxe] = "LinkedMap", this._map = /* @__PURE__ */ new Map(), this._head = void 0, this._tail = void 0, this._size = 0, this._state = 0;
  }
  clear() {
    this._map.clear(), this._head = void 0, this._tail = void 0, this._size = 0, this._state++;
  }
  isEmpty() {
    return !this._head && !this._tail;
  }
  get size() {
    return this._size;
  }
  get first() {
    var e;
    return (e = this._head) == null ? void 0 : e.value;
  }
  get last() {
    var e;
    return (e = this._tail) == null ? void 0 : e.value;
  }
  has(e) {
    return this._map.has(e);
  }
  get(e, t = 0) {
    const n = this._map.get(e);
    if (n)
      return t !== 0 && this.touch(n, t), n.value;
  }
  set(e, t, n = 0) {
    let r = this._map.get(e);
    if (r)
      r.value = t, n !== 0 && this.touch(r, n);
    else {
      switch (r = { key: e, value: t, next: void 0, previous: void 0 }, n) {
        case 0:
          this.addItemLast(r);
          break;
        case 1:
          this.addItemFirst(r);
          break;
        case 2:
          this.addItemLast(r);
          break;
        default:
          this.addItemLast(r);
          break;
      }
      this._map.set(e, r), this._size++;
    }
    return this;
  }
  delete(e) {
    return !!this.remove(e);
  }
  remove(e) {
    const t = this._map.get(e);
    if (t)
      return this._map.delete(e), this.removeItem(t), this._size--, t.value;
  }
  shift() {
    if (!this._head && !this._tail)
      return;
    if (!this._head || !this._tail)
      throw new Error("Invalid list");
    const e = this._head;
    return this._map.delete(e.key), this.removeItem(e), this._size--, e.value;
  }
  forEach(e, t) {
    const n = this._state;
    let r = this._head;
    for (; r; ) {
      if (t ? e.bind(t)(r.value, r.key, this) : e(r.value, r.key, this), this._state !== n)
        throw new Error("LinkedMap got modified during iteration.");
      r = r.next;
    }
  }
  keys() {
    const e = this, t = this._state;
    let n = this._head;
    const r = {
      [Symbol.iterator]() {
        return r;
      },
      next() {
        if (e._state !== t)
          throw new Error("LinkedMap got modified during iteration.");
        if (n) {
          const s = { value: n.key, done: !1 };
          return n = n.next, s;
        } else
          return { value: void 0, done: !0 };
      }
    };
    return r;
  }
  values() {
    const e = this, t = this._state;
    let n = this._head;
    const r = {
      [Symbol.iterator]() {
        return r;
      },
      next() {
        if (e._state !== t)
          throw new Error("LinkedMap got modified during iteration.");
        if (n) {
          const s = { value: n.value, done: !1 };
          return n = n.next, s;
        } else
          return { value: void 0, done: !0 };
      }
    };
    return r;
  }
  entries() {
    const e = this, t = this._state;
    let n = this._head;
    const r = {
      [Symbol.iterator]() {
        return r;
      },
      next() {
        if (e._state !== t)
          throw new Error("LinkedMap got modified during iteration.");
        if (n) {
          const s = { value: [n.key, n.value], done: !1 };
          return n = n.next, s;
        } else
          return { value: void 0, done: !0 };
      }
    };
    return r;
  }
  [(Jxe = Symbol.toStringTag, Symbol.iterator)]() {
    return this.entries();
  }
  trimOld(e) {
    if (e >= this.size)
      return;
    if (e === 0) {
      this.clear();
      return;
    }
    let t = this._head, n = this.size;
    for (; t && n > e; )
      this._map.delete(t.key), t = t.next, n--;
    this._head = t, this._size = n, t && (t.previous = void 0), this._state++;
  }
  trimNew(e) {
    if (e >= this.size)
      return;
    if (e === 0) {
      this.clear();
      return;
    }
    let t = this._tail, n = this.size;
    for (; t && n > e; )
      this._map.delete(t.key), t = t.previous, n--;
    this._tail = t, this._size = n, t && (t.next = void 0), this._state++;
  }
  addItemFirst(e) {
    if (!this._head && !this._tail)
      this._tail = e;
    else if (this._head)
      e.next = this._head, this._head.previous = e;
    else
      throw new Error("Invalid list");
    this._head = e, this._state++;
  }
  addItemLast(e) {
    if (!this._head && !this._tail)
      this._head = e;
    else if (this._tail)
      e.previous = this._tail, this._tail.next = e;
    else
      throw new Error("Invalid list");
    this._tail = e, this._state++;
  }
  removeItem(e) {
    if (e === this._head && e === this._tail)
      this._head = void 0, this._tail = void 0;
    else if (e === this._head) {
      if (!e.next)
        throw new Error("Invalid list");
      e.next.previous = void 0, this._head = e.next;
    } else if (e === this._tail) {
      if (!e.previous)
        throw new Error("Invalid list");
      e.previous.next = void 0, this._tail = e.previous;
    } else {
      const t = e.next, n = e.previous;
      if (!t || !n)
        throw new Error("Invalid list");
      t.previous = n, n.next = t;
    }
    e.next = void 0, e.previous = void 0, this._state++;
  }
  touch(e, t) {
    if (!this._head || !this._tail)
      throw new Error("Invalid list");
    if (!(t !== 1 && t !== 2)) {
      if (t === 1) {
        if (e === this._head)
          return;
        const n = e.next, r = e.previous;
        e === this._tail ? (r.next = void 0, this._tail = r) : (n.previous = r, r.next = n), e.previous = void 0, e.next = this._head, this._head.previous = e, this._head = e, this._state++;
      } else if (t === 2) {
        if (e === this._tail)
          return;
        const n = e.next, r = e.previous;
        e === this._head ? (n.previous = void 0, this._head = n) : (n.previous = r, r.next = n), e.next = void 0, e.previous = this._tail, this._tail.next = e, this._tail = e, this._state++;
      }
    }
  }
  toJSON() {
    const e = [];
    return this.forEach((t, n) => {
      e.push([n, t]);
    }), e;
  }
  fromJSON(e) {
    this.clear();
    for (const [t, n] of e)
      this.set(t, n);
  }
}
class Ert extends Srt {
  constructor(e, t = 1) {
    super(), this._limit = e, this._ratio = Math.min(Math.max(0, t), 1);
  }
  get limit() {
    return this._limit;
  }
  set limit(e) {
    this._limit = e, this.checkTrim();
  }
  get(e, t = 2) {
    return super.get(e, t);
  }
  peek(e) {
    return super.get(
      e,
      0
      /* Touch.None */
    );
  }
  set(e, t) {
    return super.set(
      e,
      t,
      2
      /* Touch.AsNew */
    ), this;
  }
  checkTrim() {
    this.size > this._limit && this.trim(Math.round(this._limit * this._ratio));
  }
}
class Tb extends Ert {
  constructor(e, t = 1) {
    super(e, t);
  }
  trim(e) {
    this.trimOld(e);
  }
  set(e, t) {
    return super.set(e, t), this.checkTrim(), this;
  }
}
class xrt {
  constructor(e) {
    if (this._m1 = /* @__PURE__ */ new Map(), this._m2 = /* @__PURE__ */ new Map(), e)
      for (const [t, n] of e)
        this.set(t, n);
  }
  clear() {
    this._m1.clear(), this._m2.clear();
  }
  set(e, t) {
    this._m1.set(e, t), this._m2.set(t, e);
  }
  get(e) {
    return this._m1.get(e);
  }
  getKey(e) {
    return this._m2.get(e);
  }
  delete(e) {
    const t = this._m1.get(e);
    return t === void 0 ? !1 : (this._m1.delete(e), this._m2.delete(t), !0);
  }
  keys() {
    return this._m1.keys();
  }
  values() {
    return this._m1.values();
  }
}
class VPe {
  constructor() {
    this.map = /* @__PURE__ */ new Map();
  }
  add(e, t) {
    let n = this.map.get(e);
    n || (n = /* @__PURE__ */ new Set(), this.map.set(e, n)), n.add(t);
  }
  delete(e, t) {
    const n = this.map.get(e);
    n && (n.delete(t), n.size === 0 && this.map.delete(e));
  }
  forEach(e, t) {
    const n = this.map.get(e);
    n && n.forEach(t);
  }
}
class Rq {
  constructor() {
    this._data = /* @__PURE__ */ new Map();
  }
  /**
   * Sets a value on the map. Note that unlike a standard `Map`, the first argument is the value.
   * This is because the spread operator is used for the keys and must be last..
   * @param value The value to set.
   * @param keys The keys for the value.
   */
  set(e, ...t) {
    let n = this._data;
    for (let r = 0; r < t.length - 1; r++)
      n.has(t[r]) || n.set(t[r], /* @__PURE__ */ new Map()), n = n.get(t[r]);
    n.set(t[t.length - 1], e);
  }
  get(...e) {
    let t = this._data;
    for (let n = 0; n < e.length - 1; n++) {
      if (!t.has(e[n]))
        return;
      t = t.get(e[n]);
    }
    return t.get(e[e.length - 1]);
  }
  clear() {
    this._data.clear();
  }
  /**
   * Get a textual representation of the map for debugging purposes.
   */
  toString() {
    const e = (t, n) => {
      let r = "";
      for (const [s, o] of t)
        r += `${"  ".repeat(n)}${s}: `, o instanceof Map ? r += `
` + e(o, n + 1) : r += `${o}
`;
      return r;
    };
    return e(this._data, 0);
  }
}
function EC(i) {
  return i === 47 || i === 92;
}
function UPe(i) {
  return i.replace(/[\\/]/g, Ho.sep);
}
function Lrt(i) {
  return i.indexOf("/") === -1 && (i = UPe(i)), /^[a-zA-Z]:(\/|$)/.test(i) && (i = "/" + i), i;
}
function eLe(i, e = Ho.sep) {
  if (!i)
    return "";
  const t = i.length, n = i.charCodeAt(0);
  if (EC(n)) {
    if (EC(i.charCodeAt(1)) && !EC(i.charCodeAt(2))) {
      let s = 3;
      const o = s;
      for (; s < t && !EC(i.charCodeAt(s)); s++)
        ;
      if (o !== s && !EC(i.charCodeAt(s + 1))) {
        for (s += 1; s < t; s++)
          if (EC(i.charCodeAt(s)))
            return i.slice(0, s + 1).replace(/[\\/]/g, e);
      }
    }
    return e;
  } else if (zPe(n) && i.charCodeAt(1) === 58)
    return EC(i.charCodeAt(2)) ? i.slice(0, 2) + e : i.slice(0, 2);
  let r = i.indexOf("://");
  if (r !== -1) {
    for (r += 3; r < t; r++)
      if (EC(i.charCodeAt(r)))
        return i.slice(0, r + 1);
  }
  return "";
}
function Eie(i, e, t, n = im) {
  if (i === e)
    return !0;
  if (!i || !e || e.length > i.length)
    return !1;
  if (t) {
    if (!Phe(i, e))
      return !1;
    if (e.length === i.length)
      return !0;
    let s = e.length;
    return e.charAt(e.length - 1) === n && s--, i.charAt(s) === n;
  }
  return e.charAt(e.length - 1) !== n && (e += n), i.indexOf(e) === 0;
}
function zPe(i) {
  return i >= 65 && i <= 90 || i >= 97 && i <= 122;
}
function Trt(i, e = Za) {
  return e ? zPe(i.charCodeAt(0)) && i.charCodeAt(1) === 58 : !1;
}
function v_(i) {
  return RV(i, !0);
}
class krt {
  constructor(e) {
    this._ignorePathCasing = e;
  }
  compare(e, t, n = !1) {
    return e === t ? 0 : Q3(this.getComparisonKey(e, n), this.getComparisonKey(t, n));
  }
  isEqual(e, t, n = !1) {
    return e === t ? !0 : !e || !t ? !1 : this.getComparisonKey(e, n) === this.getComparisonKey(t, n);
  }
  getComparisonKey(e, t = !1) {
    return e.with({
      path: this._ignorePathCasing(e) ? e.path.toLowerCase() : void 0,
      fragment: t ? null : void 0
    }).toString();
  }
  isEqualOrParent(e, t, n = !1) {
    if (e.scheme === t.scheme) {
      if (e.scheme === Yt.file)
        return Eie(v_(e), v_(t), this._ignorePathCasing(e)) && e.query === t.query && (n || e.fragment === t.fragment);
      if (nLe(e.authority, t.authority))
        return Eie(e.path, t.path, this._ignorePathCasing(e), "/") && e.query === t.query && (n || e.fragment === t.fragment);
    }
    return !1;
  }
  // --- path math
  joinPath(e, ...t) {
    return Ht.joinPath(e, ...t);
  }
  basenameOrAuthority(e) {
    return Kf(e) || e.authority;
  }
  basename(e) {
    return Ho.basename(e.path);
  }
  extname(e) {
    return Ho.extname(e.path);
  }
  dirname(e) {
    if (e.path.length === 0)
      return e;
    let t;
    return e.scheme === Yt.file ? t = Ht.file(sPe(v_(e))).path : (t = Ho.dirname(e.path), e.authority && t.length && t.charCodeAt(0) !== 47 && (console.error(`dirname("${e.toString})) resulted in a relative path`), t = "/")), e.with({
      path: t
    });
  }
  normalizePath(e) {
    if (!e.path.length)
      return e;
    let t;
    return e.scheme === Yt.file ? t = Ht.file(rPe(v_(e))).path : t = Ho.normalize(e.path), e.with({
      path: t
    });
  }
  relativePath(e, t) {
    if (e.scheme !== t.scheme || !nLe(e.authority, t.authority))
      return;
    if (e.scheme === Yt.file) {
      const s = Dnt(v_(e), v_(t));
      return Za ? UPe(s) : s;
    }
    let n = e.path || "/";
    const r = t.path || "/";
    if (this._ignorePathCasing(e)) {
      let s = 0;
      for (const o = Math.min(n.length, r.length); s < o && !(n.charCodeAt(s) !== r.charCodeAt(s) && n.charAt(s).toLowerCase() !== r.charAt(s).toLowerCase()); s++)
        ;
      n = r.substr(0, s) + n.substr(s);
    }
    return Ho.relative(n, r);
  }
  resolvePath(e, t) {
    if (e.scheme === Yt.file) {
      const n = Ht.file(knt(v_(e), t));
      return e.with({
        authority: n.authority,
        path: n.path
      });
    }
    return t = Lrt(t), e.with({
      path: Ho.resolve(e.path, t)
    });
  }
  // --- misc
  isAbsolutePath(e) {
    return !!e.path && e.path[0] === "/";
  }
  isEqualAuthority(e, t) {
    return e === t || e !== void 0 && t !== void 0 && tN(e, t);
  }
  hasTrailingPathSeparator(e, t = im) {
    if (e.scheme === Yt.file) {
      const n = v_(e);
      return n.length > eLe(n).length && n[n.length - 1] === t;
    } else {
      const n = e.path;
      return n.length > 1 && n.charCodeAt(n.length - 1) === 47 && !/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath);
    }
  }
  removeTrailingPathSeparator(e, t = im) {
    return iLe(e, t) ? e.with({ path: e.path.substr(0, e.path.length - 1) }) : e;
  }
  addTrailingPathSeparator(e, t = im) {
    let n = !1;
    if (e.scheme === Yt.file) {
      const r = v_(e);
      n = r !== void 0 && r.length === eLe(r).length && r[r.length - 1] === t;
    } else {
      t = "/";
      const r = e.path;
      n = r.length === 1 && r.charCodeAt(r.length - 1) === 47;
    }
    return !n && !iLe(e, t) ? e.with({ path: e.path + "/" }) : e;
  }
}
const hs = new krt(() => !1), rw = hs.isEqual.bind(hs);
hs.isEqualOrParent.bind(hs);
hs.getComparisonKey.bind(hs);
const Drt = hs.basenameOrAuthority.bind(hs), Kf = hs.basename.bind(hs), Irt = hs.extname.bind(hs), Aq = hs.dirname.bind(hs), $Pe = hs.joinPath.bind(hs), Nrt = hs.normalizePath.bind(hs), Rrt = hs.relativePath.bind(hs), tLe = hs.resolvePath.bind(hs);
hs.isAbsolutePath.bind(hs);
const nLe = hs.isEqualAuthority.bind(hs), iLe = hs.hasTrailingPathSeparator.bind(hs);
hs.removeTrailingPathSeparator.bind(hs);
hs.addTrailingPathSeparator.bind(hs);
var sw;
(function(i) {
  i.META_DATA_LABEL = "label", i.META_DATA_DESCRIPTION = "description", i.META_DATA_SIZE = "size", i.META_DATA_MIME = "mime";
  function e(t) {
    const n = /* @__PURE__ */ new Map();
    t.path.substring(t.path.indexOf(";") + 1, t.path.lastIndexOf(";")).split(";").forEach((o) => {
      const [a, l] = o.split(":");
      a && l && n.set(a, l);
    });
    const s = t.path.substring(0, t.path.indexOf(";"));
    return s && n.set(i.META_DATA_MIME, s), n;
  }
  i.parseMetaData = e;
})(sw || (sw = {}));
const $r = Vn("logService"), jPe = Vn("loggerService");
var da;
(function(i) {
  i[i.Off = 0] = "Off", i[i.Trace = 1] = "Trace", i[i.Debug = 2] = "Debug", i[i.Info = 3] = "Info", i[i.Warning = 4] = "Warning", i[i.Error = 5] = "Error";
})(da || (da = {}));
const GPe = da.Info;
function qPe(i, e) {
  return i !== da.Off && i <= e;
}
class KPe extends ge {
  constructor() {
    super(...arguments), this.level = GPe, this._onDidChangeLogLevel = this._register(new he());
  }
  get onDidChangeLogLevel() {
    return this._onDidChangeLogLevel.event;
  }
  setLevel(e) {
    this.level !== e && (this.level = e, this._onDidChangeLogLevel.fire(this.level));
  }
  getLevel() {
    return this.level;
  }
  checkLogLevel(e) {
    return qPe(this.level, e);
  }
  canLog(e) {
    return this._store.isDisposed ? !1 : this.checkLogLevel(e);
  }
}
class Art extends KPe {
  constructor(e = GPe, t = !0) {
    super(), this.useColors = t, this.setLevel(e);
  }
  trace(e, ...t) {
    this.canLog(da.Trace) && (this.useColors ? console.log("%cTRACE", "color: #888", e, ...t) : console.log(e, ...t));
  }
  debug(e, ...t) {
    this.canLog(da.Debug) && (this.useColors ? console.log("%cDEBUG", "background: #eee; color: #888", e, ...t) : console.log(e, ...t));
  }
  info(e, ...t) {
    this.canLog(da.Info) && (this.useColors ? console.log("%c INFO", "color: #33f", e, ...t) : console.log(e, ...t));
  }
  warn(e, ...t) {
    this.canLog(da.Warning) && (this.useColors ? console.warn("%c WARN", "color: #993", e, ...t) : console.log(e, ...t));
  }
  error(e, ...t) {
    this.canLog(da.Error) && (this.useColors ? console.error("%c  ERR", "color: #f33", e, ...t) : console.error(e, ...t));
  }
}
class Ort extends KPe {
  constructor(e) {
    super(), this.loggers = e, e.length && this.setLevel(e[0].getLevel());
  }
  setLevel(e) {
    for (const t of this.loggers)
      t.setLevel(e);
    super.setLevel(e);
  }
  trace(e, ...t) {
    for (const n of this.loggers)
      n.trace(e, ...t);
  }
  debug(e, ...t) {
    for (const n of this.loggers)
      n.debug(e, ...t);
  }
  info(e, ...t) {
    for (const n of this.loggers)
      n.info(e, ...t);
  }
  warn(e, ...t) {
    for (const n of this.loggers)
      n.warn(e, ...t);
  }
  error(e, ...t) {
    for (const n of this.loggers)
      n.error(e, ...t);
  }
  dispose() {
    for (const e of this.loggers)
      e.dispose();
    super.dispose();
  }
}
class Mrt extends ge {
  constructor(e, t, n) {
    if (super(), this.logLevel = e, this.logsHome = t, this._loggers = new Co(), this._onDidChangeLoggers = this._register(new he()), this._onDidChangeVisibility = this._register(new he()), n)
      for (const r of n)
        this._loggers.set(r.resource, { logger: void 0, info: r });
  }
  getLoggerEntry(e) {
    return ga(e) ? [...this._loggers.values()].find((t) => t.info.id === e) : this._loggers.get(e);
  }
  createLogger(e, t) {
    var l;
    const n = this.toResource(e), r = ga(e) ? e : (t == null ? void 0 : t.id) ?? bB(n.toString()).toString(16);
    let s = (l = this._loggers.get(n)) == null ? void 0 : l.logger;
    const o = (t == null ? void 0 : t.logLevel) === "always" ? da.Trace : t == null ? void 0 : t.logLevel;
    s || (s = this.doCreateLogger(n, o ?? this.getLogLevel(n) ?? this.logLevel, { ...t, id: r }));
    const a = {
      logger: s,
      info: {
        resource: n,
        id: r,
        logLevel: o,
        name: t == null ? void 0 : t.name,
        hidden: t == null ? void 0 : t.hidden,
        group: t == null ? void 0 : t.group,
        extensionId: t == null ? void 0 : t.extensionId,
        when: t == null ? void 0 : t.when
      }
    };
    return this.registerLogger(a.info), this._loggers.set(n, a), s;
  }
  toResource(e) {
    return ga(e) ? $Pe(this.logsHome, `${e}.log`) : e;
  }
  setVisibility(e, t) {
    const n = this.getLoggerEntry(e);
    n && t !== !n.info.hidden && (n.info.hidden = !t, this._loggers.set(n.info.resource, n), this._onDidChangeVisibility.fire([n.info.resource, t]));
  }
  getLogLevel(e) {
    var n;
    let t;
    return e && (t = (n = this._loggers.get(e)) == null ? void 0 : n.info.logLevel), t ?? this.logLevel;
  }
  registerLogger(e) {
    const t = this._loggers.get(e.resource);
    t ? t.info.hidden !== e.hidden && this.setVisibility(e.resource, !e.hidden) : (this._loggers.set(e.resource, { info: e, logger: void 0 }), this._onDidChangeLoggers.fire({ added: [e], removed: [] }));
  }
  dispose() {
    this._loggers.forEach((e) => {
      var t;
      return (t = e.logger) == null ? void 0 : t.dispose();
    }), this._loggers.clear(), super.dispose();
  }
}
class Prt {
  constructor() {
    this.onDidChangeLogLevel = new he().event;
  }
  setLevel(e) {
  }
  getLevel() {
    return da.Info;
  }
  trace(e, ...t) {
  }
  debug(e, ...t) {
  }
  info(e, ...t) {
  }
  warn(e, ...t) {
  }
  error(e, ...t) {
  }
  dispose() {
  }
}
class Frt extends Mrt {
  constructor() {
    super(da.Off, Ht.parse("log:///log"));
  }
  doCreateLogger(e, t, n) {
    return new Prt();
  }
}
function Brt(i) {
  switch (i) {
    case da.Trace:
      return "trace";
    case da.Debug:
      return "debug";
    case da.Info:
      return "info";
    case da.Warning:
      return "warn";
    case da.Error:
      return "error";
    case da.Off:
      return "off";
  }
}
new ut("logLevel", Brt(da.Info));
let Oq = class {
  constructor(e) {
    this.id = e.id, this.precondition = e.precondition, this._kbOpts = e.kbOpts, this._menuOpts = e.menuOpts, this.metadata = e.metadata;
  }
  register() {
    if (Array.isArray(this._menuOpts) ? this._menuOpts.forEach(this._registerMenuItem, this) : this._menuOpts && this._registerMenuItem(this._menuOpts), this._kbOpts) {
      const e = Array.isArray(this._kbOpts) ? this._kbOpts : [this._kbOpts];
      for (const t of e) {
        let n = t.kbExpr;
        this.precondition && (n ? n = Re.and(n, this.precondition) : n = this.precondition);
        const r = {
          id: this.id,
          weight: t.weight,
          args: t.args,
          when: n,
          primary: t.primary,
          secondary: t.secondary,
          win: t.win,
          linux: t.linux,
          mac: t.mac
        };
        Pa.registerKeybindingRule(r);
      }
    }
    _i.registerCommand({
      id: this.id,
      handler: (e, t) => this.runCommand(e, t),
      metadata: this.metadata
    });
  }
  _registerMenuItem(e) {
    Oa.appendMenuItem(e.menuId, {
      group: e.group,
      command: {
        id: this.id,
        title: e.title,
        icon: e.icon,
        precondition: this.precondition
      },
      when: e.when,
      order: e.order
    });
  }
};
class KA extends Oq {
  constructor() {
    super(...arguments), this._implementations = [];
  }
  /**
   * A higher priority gets to be looked at first
   */
  addImplementation(e, t, n, r) {
    return this._implementations.push({ priority: e, name: t, implementation: n, when: r }), this._implementations.sort((s, o) => o.priority - s.priority), {
      dispose: () => {
        for (let s = 0; s < this._implementations.length; s++)
          if (this._implementations[s].implementation === n) {
            this._implementations.splice(s, 1);
            return;
          }
      }
    };
  }
  runCommand(e, t) {
    const n = e.get($r), r = e.get(Jt);
    n.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);
    for (const s of this._implementations) {
      if (s.when) {
        const a = r.getContext(ea());
        if (!s.when.evaluate(a))
          continue;
      }
      const o = s.implementation(e, t);
      if (o)
        return n.trace(`Command '${this.id}' was handled by '${s.name}'.`), typeof o == "boolean" ? void 0 : o;
    }
    n.trace(`The Command '${this.id}' was not handled by any implementation.`);
  }
}
class YPe extends Oq {
  constructor(e, t) {
    super(t), this.command = e;
  }
  runCommand(e, t) {
    return this.command.runCommand(e, t);
  }
}
class jo extends Oq {
  /**
   * Create a command class that is bound to a certain editor contribution.
   */
  static bindToContribution(e) {
    return class extends jo {
      constructor(n) {
        super(n), this._callback = n.handler;
      }
      runEditorCommand(n, r, s) {
        const o = e(r);
        o && this._callback(o, s);
      }
    };
  }
  static runEditorCommand(e, t, n, r) {
    const s = e.get(Ti), o = s.getFocusedCodeEditor() || s.getActiveCodeEditor();
    if (o)
      return o.invokeWithinContext((a) => {
        if (a.get(Jt).contextMatchesRules(n ?? void 0))
          return r(a, o, t);
      });
  }
  runCommand(e, t) {
    return jo.runEditorCommand(e, t, this.precondition, (n, r, s) => this.runEditorCommand(n, r, s));
  }
}
class vt extends jo {
  static convertOptions(e) {
    let t;
    Array.isArray(e.menuOpts) ? t = e.menuOpts : e.menuOpts ? t = [e.menuOpts] : t = [];
    function n(r) {
      return r.menuId || (r.menuId = wt.EditorContext), r.title || (r.title = typeof e.label == "string" ? e.label : e.label.value), r.when = Re.and(e.precondition, r.when), r;
    }
    return Array.isArray(e.contextMenuOpts) ? t.push(...e.contextMenuOpts.map(n)) : e.contextMenuOpts && t.push(n(e.contextMenuOpts)), e.menuOpts = t, e;
  }
  constructor(e) {
    super(vt.convertOptions(e)), typeof e.label == "string" ? (this.label = e.label, this.alias = e.alias ?? e.label) : (this.label = e.label.value, this.alias = e.alias ?? e.label.original);
  }
  runEditorCommand(e, t, n) {
    return this.reportTelemetry(e, t), this.run(e, t, n || {});
  }
  reportTelemetry(e, t) {
    e.get(rc).publicLog2("editorActionInvoked", { name: this.label, id: this.id });
  }
}
class XPe extends vt {
  constructor() {
    super(...arguments), this._implementations = [];
  }
  /**
   * A higher priority gets to be looked at first
   */
  addImplementation(e, t) {
    return this._implementations.push([e, t]), this._implementations.sort((n, r) => r[0] - n[0]), {
      dispose: () => {
        for (let n = 0; n < this._implementations.length; n++)
          if (this._implementations[n][1] === t) {
            this._implementations.splice(n, 1);
            return;
          }
      }
    };
  }
  run(e, t, n) {
    for (const r of this._implementations) {
      const s = r[1](e, t, n);
      if (s)
        return typeof s == "boolean" ? void 0 : s;
    }
  }
}
class Qg extends Fa {
  run(e, ...t) {
    const n = e.get(Ti), r = n.getFocusedCodeEditor() || n.getActiveCodeEditor();
    if (r)
      return r.invokeWithinContext((s) => {
        var c;
        const o = s.get(Jt), a = s.get($r);
        if (!o.contextMatchesRules(this.desc.precondition ?? void 0)) {
          a.debug("[EditorAction2] NOT running command because its precondition is FALSE", this.desc.id, (c = this.desc.precondition) == null ? void 0 : c.serialize());
          return;
        }
        return this.runEditorCommand(s, r, ...t);
      });
  }
}
function id(i, e) {
  _i.registerCommand(i, function(t, ...n) {
    const r = t.get(xt), [s, o] = n;
    Ii(Ht.isUri(s)), Ii(de.isIPosition(o));
    const a = t.get(xs).getModel(s);
    if (a) {
      const l = de.lift(o);
      return r.invokeFunction(e, a, l, ...n.slice(2));
    }
    return t.get(Ic).createModelReference(s).then((l) => new Promise((c, u) => {
      try {
        const d = r.invokeFunction(e, l.object.textEditorModel, de.lift(o), n.slice(2));
        c(d);
      } catch (d) {
        u(d);
      }
    }).finally(() => {
      l.dispose();
    }));
  });
}
function ct(i) {
  return Rf.INSTANCE.registerEditorCommand(i), i;
}
function Je(i) {
  const e = new i();
  return Rf.INSTANCE.registerEditorAction(e), e;
}
function ZPe(i) {
  return Rf.INSTANCE.registerEditorAction(i), i;
}
function Hrt(i) {
  Rf.INSTANCE.registerEditorAction(i);
}
function Si(i, e, t) {
  Rf.INSTANCE.registerEditorContribution(i, e, t);
}
var jN;
(function(i) {
  function e(o) {
    return Rf.INSTANCE.getEditorCommand(o);
  }
  i.getEditorCommand = e;
  function t() {
    return Rf.INSTANCE.getEditorActions();
  }
  i.getEditorActions = t;
  function n() {
    return Rf.INSTANCE.getEditorContributions();
  }
  i.getEditorContributions = n;
  function r(o) {
    return Rf.INSTANCE.getEditorContributions().filter((a) => o.indexOf(a.id) >= 0);
  }
  i.getSomeEditorContributions = r;
  function s() {
    return Rf.INSTANCE.getDiffEditorContributions();
  }
  i.getDiffEditorContributions = s;
})(jN || (jN = {}));
const Wrt = {
  EditorCommonContributions: "editor.contributions"
}, Oj = class Oj {
  constructor() {
    this.editorContributions = [], this.diffEditorContributions = [], this.editorActions = [], this.editorCommands = /* @__PURE__ */ Object.create(null);
  }
  registerEditorContribution(e, t, n) {
    this.editorContributions.push({ id: e, ctor: t, instantiation: n });
  }
  getEditorContributions() {
    return this.editorContributions.slice(0);
  }
  getDiffEditorContributions() {
    return this.diffEditorContributions.slice(0);
  }
  registerEditorAction(e) {
    e.register(), this.editorActions.push(e);
  }
  getEditorActions() {
    return this.editorActions;
  }
  registerEditorCommand(e) {
    e.register(), this.editorCommands[e.id] = e;
  }
  getEditorCommand(e) {
    return this.editorCommands[e] || null;
  }
};
Oj.INSTANCE = new Oj();
let Rf = Oj;
Fs.add(Wrt.EditorCommonContributions, Rf.INSTANCE);
function CB(i) {
  return i.register(), i;
}
const QPe = CB(new KA({
  id: "undo",
  precondition: void 0,
  kbOpts: {
    weight: 0,
    primary: 2104
    /* KeyCode.KeyZ */
  },
  menuOpts: [{
    menuId: wt.MenubarEditMenu,
    group: "1_do",
    title: S(64, "&&Undo"),
    order: 1
  }, {
    menuId: wt.CommandPalette,
    group: "",
    title: S(65, "Undo"),
    order: 1
  }, {
    menuId: wt.SimpleEditorContext,
    group: "1_do",
    title: S(66, "Undo"),
    order: 1
  }]
}));
CB(new YPe(QPe, { id: "default:undo", precondition: void 0 }));
const JPe = CB(new KA({
  id: "redo",
  precondition: void 0,
  kbOpts: {
    weight: 0,
    primary: 2103,
    secondary: [
      3128
      /* KeyCode.KeyZ */
    ],
    mac: {
      primary: 3128
      /* KeyCode.KeyZ */
    }
  },
  menuOpts: [{
    menuId: wt.MenubarEditMenu,
    group: "1_do",
    title: S(67, "&&Redo"),
    order: 2
  }, {
    menuId: wt.CommandPalette,
    group: "",
    title: S(68, "Redo"),
    order: 1
  }, {
    menuId: wt.SimpleEditorContext,
    group: "1_do",
    title: S(69, "Redo"),
    order: 2
  }]
}));
CB(new YPe(JPe, { id: "default:redo", precondition: void 0 }));
const Vrt = CB(new KA({
  id: "editor.action.selectAll",
  precondition: void 0,
  kbOpts: {
    weight: 0,
    kbExpr: null,
    primary: 2079
    /* KeyCode.KeyA */
  },
  menuOpts: [{
    menuId: wt.MenubarSelectionMenu,
    group: "1_basic",
    title: S(70, "&&Select All"),
    order: 1
  }, {
    menuId: wt.CommandPalette,
    group: "",
    title: S(71, "Select All"),
    order: 1
  }, {
    menuId: wt.SimpleEditorContext,
    group: "9_select",
    title: S(72, "Select All"),
    order: 1
  }]
}));
let z = class za {
  constructor(e, t, n, r) {
    e > n || e === n && t > r ? (this.startLineNumber = n, this.startColumn = r, this.endLineNumber = e, this.endColumn = t) : (this.startLineNumber = e, this.startColumn = t, this.endLineNumber = n, this.endColumn = r);
  }
  /**
   * Test if this range is empty.
   */
  isEmpty() {
    return za.isEmpty(this);
  }
  /**
   * Test if `range` is empty.
   */
  static isEmpty(e) {
    return e.startLineNumber === e.endLineNumber && e.startColumn === e.endColumn;
  }
  /**
   * Test if position is in this range. If the position is at the edges, will return true.
   */
  containsPosition(e) {
    return za.containsPosition(this, e);
  }
  /**
   * Test if `position` is in `range`. If the position is at the edges, will return true.
   */
  static containsPosition(e, t) {
    return !(t.lineNumber < e.startLineNumber || t.lineNumber > e.endLineNumber || t.lineNumber === e.startLineNumber && t.column < e.startColumn || t.lineNumber === e.endLineNumber && t.column > e.endColumn);
  }
  /**
   * Test if `position` is in `range`. If the position is at the edges, will return false.
   * @internal
   */
  static strictContainsPosition(e, t) {
    return !(t.lineNumber < e.startLineNumber || t.lineNumber > e.endLineNumber || t.lineNumber === e.startLineNumber && t.column <= e.startColumn || t.lineNumber === e.endLineNumber && t.column >= e.endColumn);
  }
  /**
   * Test if range is in this range. If the range is equal to this range, will return true.
   */
  containsRange(e) {
    return za.containsRange(this, e);
  }
  /**
   * Test if `otherRange` is in `range`. If the ranges are equal, will return true.
   */
  static containsRange(e, t) {
    return !(t.startLineNumber < e.startLineNumber || t.endLineNumber < e.startLineNumber || t.startLineNumber > e.endLineNumber || t.endLineNumber > e.endLineNumber || t.startLineNumber === e.startLineNumber && t.startColumn < e.startColumn || t.endLineNumber === e.endLineNumber && t.endColumn > e.endColumn);
  }
  /**
   * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.
   */
  strictContainsRange(e) {
    return za.strictContainsRange(this, e);
  }
  /**
   * Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false.
   */
  static strictContainsRange(e, t) {
    return !(t.startLineNumber < e.startLineNumber || t.endLineNumber < e.startLineNumber || t.startLineNumber > e.endLineNumber || t.endLineNumber > e.endLineNumber || t.startLineNumber === e.startLineNumber && t.startColumn <= e.startColumn || t.endLineNumber === e.endLineNumber && t.endColumn >= e.endColumn);
  }
  /**
   * A reunion of the two ranges.
   * The smallest position will be used as the start point, and the largest one as the end point.
   */
  plusRange(e) {
    return za.plusRange(this, e);
  }
  /**
   * A reunion of the two ranges.
   * The smallest position will be used as the start point, and the largest one as the end point.
   */
  static plusRange(e, t) {
    let n, r, s, o;
    return t.startLineNumber < e.startLineNumber ? (n = t.startLineNumber, r = t.startColumn) : t.startLineNumber === e.startLineNumber ? (n = t.startLineNumber, r = Math.min(t.startColumn, e.startColumn)) : (n = e.startLineNumber, r = e.startColumn), t.endLineNumber > e.endLineNumber ? (s = t.endLineNumber, o = t.endColumn) : t.endLineNumber === e.endLineNumber ? (s = t.endLineNumber, o = Math.max(t.endColumn, e.endColumn)) : (s = e.endLineNumber, o = e.endColumn), new za(n, r, s, o);
  }
  /**
   * A intersection of the two ranges.
   */
  intersectRanges(e) {
    return za.intersectRanges(this, e);
  }
  /**
   * A intersection of the two ranges.
   */
  static intersectRanges(e, t) {
    let n = e.startLineNumber, r = e.startColumn, s = e.endLineNumber, o = e.endColumn;
    const a = t.startLineNumber, l = t.startColumn, c = t.endLineNumber, u = t.endColumn;
    return n < a ? (n = a, r = l) : n === a && (r = Math.max(r, l)), s > c ? (s = c, o = u) : s === c && (o = Math.min(o, u)), n > s || n === s && r > o ? null : new za(n, r, s, o);
  }
  /**
   * Test if this range equals other.
   */
  equalsRange(e) {
    return za.equalsRange(this, e);
  }
  /**
   * Test if range `a` equals `b`.
   */
  static equalsRange(e, t) {
    return !e && !t ? !0 : !!e && !!t && e.startLineNumber === t.startLineNumber && e.startColumn === t.startColumn && e.endLineNumber === t.endLineNumber && e.endColumn === t.endColumn;
  }
  /**
   * Return the end position (which will be after or equal to the start position)
   */
  getEndPosition() {
    return za.getEndPosition(this);
  }
  /**
   * Return the end position (which will be after or equal to the start position)
   */
  static getEndPosition(e) {
    return new de(e.endLineNumber, e.endColumn);
  }
  /**
   * Return the start position (which will be before or equal to the end position)
   */
  getStartPosition() {
    return za.getStartPosition(this);
  }
  /**
   * Return the start position (which will be before or equal to the end position)
   */
  static getStartPosition(e) {
    return new de(e.startLineNumber, e.startColumn);
  }
  /**
   * Transform to a user presentable string representation.
   */
  toString() {
    return "[" + this.startLineNumber + "," + this.startColumn + " -> " + this.endLineNumber + "," + this.endColumn + "]";
  }
  /**
   * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.
   */
  setEndPosition(e, t) {
    return new za(this.startLineNumber, this.startColumn, e, t);
  }
  /**
   * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.
   */
  setStartPosition(e, t) {
    return new za(e, t, this.endLineNumber, this.endColumn);
  }
  /**
   * Create a new empty range using this range's start position.
   */
  collapseToStart() {
    return za.collapseToStart(this);
  }
  /**
   * Create a new empty range using this range's start position.
   */
  static collapseToStart(e) {
    return new za(e.startLineNumber, e.startColumn, e.startLineNumber, e.startColumn);
  }
  /**
   * Create a new empty range using this range's end position.
   */
  collapseToEnd() {
    return za.collapseToEnd(this);
  }
  /**
   * Create a new empty range using this range's end position.
   */
  static collapseToEnd(e) {
    return new za(e.endLineNumber, e.endColumn, e.endLineNumber, e.endColumn);
  }
  /**
   * Moves the range by the given amount of lines.
   */
  delta(e) {
    return new za(this.startLineNumber + e, this.startColumn, this.endLineNumber + e, this.endColumn);
  }
  isSingleLine() {
    return this.startLineNumber === this.endLineNumber;
  }
  // ---
  static fromPositions(e, t = e) {
    return new za(e.lineNumber, e.column, t.lineNumber, t.column);
  }
  static lift(e) {
    return e ? new za(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn) : null;
  }
  /**
   * Test if `obj` is an `IRange`.
   */
  static isIRange(e) {
    return e && typeof e.startLineNumber == "number" && typeof e.startColumn == "number" && typeof e.endLineNumber == "number" && typeof e.endColumn == "number";
  }
  /**
   * Test if the two ranges are touching in any way.
   */
  static areIntersectingOrTouching(e, t) {
    return !(e.endLineNumber < t.startLineNumber || e.endLineNumber === t.startLineNumber && e.endColumn < t.startColumn || t.endLineNumber < e.startLineNumber || t.endLineNumber === e.startLineNumber && t.endColumn < e.startColumn);
  }
  /**
   * Test if the two ranges are intersecting. If the ranges are touching it returns true.
   */
  static areIntersecting(e, t) {
    return !(e.endLineNumber < t.startLineNumber || e.endLineNumber === t.startLineNumber && e.endColumn <= t.startColumn || t.endLineNumber < e.startLineNumber || t.endLineNumber === e.startLineNumber && t.endColumn <= e.startColumn);
  }
  /**
   * Test if the two ranges are intersecting, but not touching at all.
   */
  static areOnlyIntersecting(e, t) {
    return !(e.endLineNumber < t.startLineNumber - 1 || e.endLineNumber === t.startLineNumber && e.endColumn < t.startColumn - 1 || t.endLineNumber < e.startLineNumber - 1 || t.endLineNumber === e.startLineNumber && t.endColumn < e.startColumn - 1);
  }
  /**
   * A function that compares ranges, useful for sorting ranges
   * It will first compare ranges on the startPosition and then on the endPosition
   */
  static compareRangesUsingStarts(e, t) {
    if (e && t) {
      const s = e.startLineNumber | 0, o = t.startLineNumber | 0;
      if (s === o) {
        const a = e.startColumn | 0, l = t.startColumn | 0;
        if (a === l) {
          const c = e.endLineNumber | 0, u = t.endLineNumber | 0;
          if (c === u) {
            const d = e.endColumn | 0, h = t.endColumn | 0;
            return d - h;
          }
          return c - u;
        }
        return a - l;
      }
      return s - o;
    }
    return (e ? 1 : 0) - (t ? 1 : 0);
  }
  /**
   * A function that compares ranges, useful for sorting ranges
   * It will first compare ranges on the endPosition and then on the startPosition
   */
  static compareRangesUsingEnds(e, t) {
    return e.endLineNumber === t.endLineNumber ? e.endColumn === t.endColumn ? e.startLineNumber === t.startLineNumber ? e.startColumn - t.startColumn : e.startLineNumber - t.startLineNumber : e.endColumn - t.endColumn : e.endLineNumber - t.endLineNumber;
  }
  /**
   * Test if the range spans multiple lines.
   */
  static spansMultipleLines(e) {
    return e.endLineNumber > e.startLineNumber;
  }
  toJSON() {
    return this;
  }
}, bt = class xg extends z {
  constructor(e, t, n, r) {
    super(e, t, n, r), this.selectionStartLineNumber = e, this.selectionStartColumn = t, this.positionLineNumber = n, this.positionColumn = r;
  }
  /**
   * Transform to a human-readable representation.
   */
  toString() {
    return "[" + this.selectionStartLineNumber + "," + this.selectionStartColumn + " -> " + this.positionLineNumber + "," + this.positionColumn + "]";
  }
  /**
   * Test if equals other selection.
   */
  equalsSelection(e) {
    return xg.selectionsEqual(this, e);
  }
  /**
   * Test if the two selections are equal.
   */
  static selectionsEqual(e, t) {
    return e.selectionStartLineNumber === t.selectionStartLineNumber && e.selectionStartColumn === t.selectionStartColumn && e.positionLineNumber === t.positionLineNumber && e.positionColumn === t.positionColumn;
  }
  /**
   * Get directions (LTR or RTL).
   */
  getDirection() {
    return this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn ? 0 : 1;
  }
  /**
   * Create a new selection with a different `positionLineNumber` and `positionColumn`.
   */
  setEndPosition(e, t) {
    return this.getDirection() === 0 ? new xg(this.startLineNumber, this.startColumn, e, t) : new xg(e, t, this.startLineNumber, this.startColumn);
  }
  /**
   * Get the position at `positionLineNumber` and `positionColumn`.
   */
  getPosition() {
    return new de(this.positionLineNumber, this.positionColumn);
  }
  /**
   * Get the position at the start of the selection.
  */
  getSelectionStart() {
    return new de(this.selectionStartLineNumber, this.selectionStartColumn);
  }
  /**
   * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.
   */
  setStartPosition(e, t) {
    return this.getDirection() === 0 ? new xg(e, t, this.endLineNumber, this.endColumn) : new xg(this.endLineNumber, this.endColumn, e, t);
  }
  // ----
  /**
   * Create a `Selection` from one or two positions
   */
  static fromPositions(e, t = e) {
    return new xg(e.lineNumber, e.column, t.lineNumber, t.column);
  }
  /**
   * Creates a `Selection` from a range, given a direction.
   */
  static fromRange(e, t) {
    return t === 0 ? new xg(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn) : new xg(e.endLineNumber, e.endColumn, e.startLineNumber, e.startColumn);
  }
  /**
   * Create a `Selection` from an `ISelection`.
   */
  static liftSelection(e) {
    return new xg(e.selectionStartLineNumber, e.selectionStartColumn, e.positionLineNumber, e.positionColumn);
  }
  /**
   * `a` equals `b`.
   */
  static selectionsArrEqual(e, t) {
    if (e && !t || !e && t)
      return !1;
    if (!e && !t)
      return !0;
    if (e.length !== t.length)
      return !1;
    for (let n = 0, r = e.length; n < r; n++)
      if (!this.selectionsEqual(e[n], t[n]))
        return !1;
    return !0;
  }
  /**
   * Test if `obj` is an `ISelection`.
   */
  static isISelection(e) {
    return e && typeof e.selectionStartLineNumber == "number" && typeof e.selectionStartColumn == "number" && typeof e.positionLineNumber == "number" && typeof e.positionColumn == "number";
  }
  /**
   * Create with a direction.
   */
  static createWithDirection(e, t, n, r, s) {
    return s === 0 ? new xg(e, t, n, r) : new xg(n, r, e, t);
  }
};
function hx(i, e) {
  const t = i.getCount(), n = i.findTokenIndexAtOffset(e), r = i.getLanguageId(n);
  let s = n;
  for (; s + 1 < t && i.getLanguageId(s + 1) === r; )
    s++;
  let o = n;
  for (; o > 0 && i.getLanguageId(o - 1) === r; )
    o--;
  return new Urt(i, r, o, s + 1, i.getStartOffset(o), i.getEndOffset(s));
}
class Urt {
  constructor(e, t, n, r, s, o) {
    this._scopedLineTokensBrand = void 0, this._actual = e, this.languageId = t, this._firstTokenIndex = n, this._lastTokenIndex = r, this.firstCharOffset = s, this._lastCharOffset = o, this.languageIdCodec = e.languageIdCodec;
  }
  getLineContent() {
    return this._actual.getLineContent().substring(this.firstCharOffset, this._lastCharOffset);
  }
  getLineLength() {
    return this._lastCharOffset - this.firstCharOffset;
  }
  getActualLineContentBefore(e) {
    return this._actual.getLineContent().substring(0, this.firstCharOffset + e);
  }
  getTokenCount() {
    return this._lastTokenIndex - this._firstTokenIndex;
  }
  findTokenIndexAtOffset(e) {
    return this._actual.findTokenIndexAtOffset(e + this.firstCharOffset) - this._firstTokenIndex;
  }
  getStandardTokenType(e) {
    return this._actual.getStandardTokenType(e + this._firstTokenIndex);
  }
  toIViewLineTokens() {
    return this._actual.sliceAndInflate(this.firstCharOffset, this._lastCharOffset, 0);
  }
}
function y_(i) {
  return (i & 3) !== 0;
}
class As {
  static _nextVisibleColumn(e, t, n) {
    return e === 9 ? As.nextRenderTabStop(t, n) : tw(e) || Whe(e) ? t + 2 : t + 1;
  }
  /**
   * Returns a visible column from a column.
   * @see {@link CursorColumns}
   */
  static visibleColumnFromColumn(e, t, n) {
    const r = Math.min(t - 1, e.length), s = e.substring(0, r), o = new kV(s);
    let a = 0;
    for (; !o.eol(); ) {
      const l = TV(s, r, o.offset);
      o.nextGraphemeLength(), a = this._nextVisibleColumn(l, a, n);
    }
    return a;
  }
  /**
   * Returns a column from a visible column.
   * @see {@link CursorColumns}
   */
  static columnFromVisibleColumn(e, t, n) {
    if (t <= 0)
      return 1;
    const r = e.length, s = new kV(e);
    let o = 0, a = 1;
    for (; !s.eol(); ) {
      const l = TV(e, r, s.offset);
      s.nextGraphemeLength();
      const c = this._nextVisibleColumn(l, o, n), u = s.offset + 1;
      if (c >= t) {
        const d = t - o;
        return c - t < d ? u : a;
      }
      o = c, a = u;
    }
    return r + 1;
  }
  /**
   * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)
   * @see {@link CursorColumns}
   */
  static nextRenderTabStop(e, t) {
    return e + t - e % t;
  }
  /**
   * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)
   * @see {@link CursorColumns}
   */
  static nextIndentTabStop(e, t) {
    return As.nextRenderTabStop(e, t);
  }
  /**
   * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)
   * @see {@link CursorColumns}
   */
  static prevRenderTabStop(e, t) {
    return Math.max(0, e - 1 - (e - 1) % t);
  }
  /**
   * ATTENTION: This works with 0-based columns (as opposed to the regular 1-based columns)
   * @see {@link CursorColumns}
   */
  static prevIndentTabStop(e, t) {
    return As.prevRenderTabStop(e, t);
  }
}
function zrt(i, e, t) {
  let n = 0;
  for (let s = 0; s < i.length; s++)
    i.charAt(s) === "	" ? n = As.nextIndentTabStop(n, e) : n++;
  let r = "";
  if (!t) {
    const s = Math.floor(n / e);
    n = n % e;
    for (let o = 0; o < s; o++)
      r += "	";
  }
  for (let s = 0; s < n; s++)
    r += " ";
  return r;
}
function ife(i, e, t) {
  let n = Tc(i);
  return n === -1 && (n = i.length), zrt(i.substring(0, n), e, t) + i.substring(n);
}
class $rt {
  constructor() {
    this._inputMode = "insert", this._onDidChangeInputMode = new he(), this.onDidChangeInputMode = this._onDidChangeInputMode.event;
  }
  getInputMode() {
    return this._inputMode;
  }
}
const xie = new $rt(), jrt = () => !0, Grt = () => !1, qrt = (i) => i === " " || i === "	";
class hI {
  static shouldRecreate(e) {
    return e.hasChanged(
      165
      /* EditorOption.layoutInfo */
    ) || e.hasChanged(
      148
      /* EditorOption.wordSeparators */
    ) || e.hasChanged(
      45
      /* EditorOption.emptySelectionClipboard */
    ) || e.hasChanged(
      85
      /* EditorOption.multiCursorMergeOverlapping */
    ) || e.hasChanged(
      88
      /* EditorOption.multiCursorPaste */
    ) || e.hasChanged(
      89
      /* EditorOption.multiCursorLimit */
    ) || e.hasChanged(
      10
      /* EditorOption.autoClosingBrackets */
    ) || e.hasChanged(
      11
      /* EditorOption.autoClosingComments */
    ) || e.hasChanged(
      15
      /* EditorOption.autoClosingQuotes */
    ) || e.hasChanged(
      13
      /* EditorOption.autoClosingDelete */
    ) || e.hasChanged(
      14
      /* EditorOption.autoClosingOvertype */
    ) || e.hasChanged(
      20
      /* EditorOption.autoSurround */
    ) || e.hasChanged(
      145
      /* EditorOption.useTabStops */
    ) || e.hasChanged(
      141
      /* EditorOption.trimWhitespaceOnDelete */
    ) || e.hasChanged(
      59
      /* EditorOption.fontInfo */
    ) || e.hasChanged(
      104
      /* EditorOption.readOnly */
    ) || e.hasChanged(
      147
      /* EditorOption.wordSegmenterLocales */
    ) || e.hasChanged(
      93
      /* EditorOption.overtypeOnPaste */
    );
  }
  constructor(e, t, n, r) {
    this.languageConfigurationService = r, this._cursorMoveConfigurationBrand = void 0, this._languageId = e;
    const s = n.options, o = s.get(
      165
      /* EditorOption.layoutInfo */
    ), a = s.get(
      59
      /* EditorOption.fontInfo */
    );
    this.readOnly = s.get(
      104
      /* EditorOption.readOnly */
    ), this.tabSize = t.tabSize, this.indentSize = t.indentSize, this.insertSpaces = t.insertSpaces, this.stickyTabStops = s.get(
      132
      /* EditorOption.stickyTabStops */
    ), this.lineHeight = a.lineHeight, this.typicalHalfwidthCharacterWidth = a.typicalHalfwidthCharacterWidth, this.pageSize = Math.max(1, Math.floor(o.height / this.lineHeight) - 2), this.useTabStops = s.get(
      145
      /* EditorOption.useTabStops */
    ), this.trimWhitespaceOnDelete = s.get(
      141
      /* EditorOption.trimWhitespaceOnDelete */
    ), this.wordSeparators = s.get(
      148
      /* EditorOption.wordSeparators */
    ), this.emptySelectionClipboard = s.get(
      45
      /* EditorOption.emptySelectionClipboard */
    ), this.copyWithSyntaxHighlighting = s.get(
      31
      /* EditorOption.copyWithSyntaxHighlighting */
    ), this.multiCursorMergeOverlapping = s.get(
      85
      /* EditorOption.multiCursorMergeOverlapping */
    ), this.multiCursorPaste = s.get(
      88
      /* EditorOption.multiCursorPaste */
    ), this.multiCursorLimit = s.get(
      89
      /* EditorOption.multiCursorLimit */
    ), this.autoClosingBrackets = s.get(
      10
      /* EditorOption.autoClosingBrackets */
    ), this.autoClosingComments = s.get(
      11
      /* EditorOption.autoClosingComments */
    ), this.autoClosingQuotes = s.get(
      15
      /* EditorOption.autoClosingQuotes */
    ), this.autoClosingDelete = s.get(
      13
      /* EditorOption.autoClosingDelete */
    ), this.autoClosingOvertype = s.get(
      14
      /* EditorOption.autoClosingOvertype */
    ), this.autoSurround = s.get(
      20
      /* EditorOption.autoSurround */
    ), this.autoIndent = s.get(
      16
      /* EditorOption.autoIndent */
    ), this.wordSegmenterLocales = s.get(
      147
      /* EditorOption.wordSegmenterLocales */
    ), this.overtypeOnPaste = s.get(
      93
      /* EditorOption.overtypeOnPaste */
    ), this.surroundingPairs = {}, this._electricChars = null, this.shouldAutoCloseBefore = {
      quote: this._getShouldAutoClose(e, this.autoClosingQuotes, !0),
      comment: this._getShouldAutoClose(e, this.autoClosingComments, !1),
      bracket: this._getShouldAutoClose(e, this.autoClosingBrackets, !1)
    }, this.autoClosingPairs = this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();
    const l = this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();
    if (l)
      for (const u of l)
        this.surroundingPairs[u.open] = u.close;
    const c = this.languageConfigurationService.getLanguageConfiguration(e).comments;
    this.blockCommentStartToken = (c == null ? void 0 : c.blockCommentStartToken) ?? null;
  }
  get electricChars() {
    var e;
    if (!this._electricChars) {
      this._electricChars = {};
      const t = (e = this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter) == null ? void 0 : e.getElectricCharacters();
      if (t)
        for (const n of t)
          this._electricChars[n] = !0;
    }
    return this._electricChars;
  }
  get inputMode() {
    return xie.getInputMode();
  }
  /**
   * Should return opening bracket type to match indentation with
   */
  onElectricCharacter(e, t, n) {
    const r = hx(t, n - 1), s = this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;
    return s ? s.onElectricCharacter(e, r, n - r.firstCharOffset) : null;
  }
  normalizeIndentation(e) {
    return ife(e, this.indentSize, this.insertSpaces);
  }
  _getShouldAutoClose(e, t, n) {
    switch (t) {
      case "beforeWhitespace":
        return qrt;
      case "languageDefined":
        return this._getLanguageDefinedShouldAutoClose(e, n);
      case "always":
        return jrt;
      case "never":
        return Grt;
    }
  }
  _getLanguageDefinedShouldAutoClose(e, t) {
    const n = this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);
    return (r) => n.indexOf(r) !== -1;
  }
  /**
   * Returns a visible column from a column.
   * @see {@link CursorColumns}
   */
  visibleColumnFromColumn(e, t) {
    return As.visibleColumnFromColumn(e.getLineContent(t.lineNumber), t.column, this.tabSize);
  }
  /**
   * Returns a visible column from a column.
   * @see {@link CursorColumns}
   */
  columnFromVisibleColumn(e, t, n) {
    const r = As.columnFromVisibleColumn(e.getLineContent(t), n, this.tabSize), s = e.getLineMinColumn(t);
    if (r < s)
      return s;
    const o = e.getLineMaxColumn(t);
    return r > o ? o : r;
  }
}
let Di = class eFe {
  static fromModelState(e) {
    return new Krt(e);
  }
  static fromViewState(e) {
    return new Yrt(e);
  }
  static fromModelSelection(e) {
    const t = bt.liftSelection(e), n = new ja(z.fromPositions(t.getSelectionStart()), 0, 0, t.getPosition(), 0);
    return eFe.fromModelState(n);
  }
  static fromModelSelections(e) {
    const t = [];
    for (let n = 0, r = e.length; n < r; n++)
      t[n] = this.fromModelSelection(e[n]);
    return t;
  }
  constructor(e, t) {
    this._cursorStateBrand = void 0, this.modelState = e, this.viewState = t;
  }
  equals(e) {
    return this.viewState.equals(e.viewState) && this.modelState.equals(e.modelState);
  }
};
class Krt {
  constructor(e) {
    this.modelState = e, this.viewState = null;
  }
}
class Yrt {
  constructor(e) {
    this.modelState = null, this.viewState = e;
  }
}
class ja {
  constructor(e, t, n, r, s) {
    this.selectionStart = e, this.selectionStartKind = t, this.selectionStartLeftoverVisibleColumns = n, this.position = r, this.leftoverVisibleColumns = s, this._singleCursorStateBrand = void 0, this.selection = ja._computeSelection(this.selectionStart, this.position);
  }
  equals(e) {
    return this.selectionStartLeftoverVisibleColumns === e.selectionStartLeftoverVisibleColumns && this.leftoverVisibleColumns === e.leftoverVisibleColumns && this.selectionStartKind === e.selectionStartKind && this.position.equals(e.position) && this.selectionStart.equalsRange(e.selectionStart);
  }
  hasSelection() {
    return !this.selection.isEmpty() || !this.selectionStart.isEmpty();
  }
  move(e, t, n, r) {
    return e ? new ja(this.selectionStart, this.selectionStartKind, this.selectionStartLeftoverVisibleColumns, new de(t, n), r) : new ja(new z(t, n, t, n), 0, r, new de(t, n), r);
  }
  static _computeSelection(e, t) {
    return e.isEmpty() || !t.isBeforeOrEqual(e.getStartPosition()) ? bt.fromPositions(e.getStartPosition(), t) : bt.fromPositions(e.getEndPosition(), t);
  }
}
class uu {
  constructor(e, t, n) {
    this._editOperationResultBrand = void 0, this.type = e, this.commands = t, this.shouldPushStackElementBefore = n.shouldPushStackElementBefore, this.shouldPushStackElementAfter = n.shouldPushStackElementAfter;
  }
}
function ow(i) {
  return i === "'" || i === '"' || i === "`";
}
class BE {
  static columnSelect(e, t, n, r, s, o) {
    const a = Math.abs(s - n) + 1, l = n > s, c = r > o, u = r < o, d = [];
    for (let h = 0; h < a; h++) {
      const g = n + (l ? -h : h), m = e.columnFromVisibleColumn(t, g, r), _ = e.columnFromVisibleColumn(t, g, o), v = e.visibleColumnFromColumn(t, new de(g, m)), w = e.visibleColumnFromColumn(t, new de(g, _));
      u && (v > o || w < r) || c && (w > r || v < o) || d.push(new ja(new z(g, m, g, m), 0, 0, new de(g, _), 0));
    }
    if (d.length === 0)
      for (let h = 0; h < a; h++) {
        const g = n + (l ? -h : h), m = t.getLineMaxColumn(g);
        d.push(new ja(new z(g, m, g, m), 0, 0, new de(g, m), 0));
      }
    return {
      viewStates: d,
      reversed: l,
      fromLineNumber: n,
      fromVisualColumn: r,
      toLineNumber: s,
      toVisualColumn: o
    };
  }
  static columnSelectLeft(e, t, n) {
    let r = n.toViewVisualColumn;
    return r > 0 && r--, BE.columnSelect(e, t, n.fromViewLineNumber, n.fromViewVisualColumn, n.toViewLineNumber, r);
  }
  static columnSelectRight(e, t, n) {
    let r = 0;
    const s = Math.min(n.fromViewLineNumber, n.toViewLineNumber), o = Math.max(n.fromViewLineNumber, n.toViewLineNumber);
    for (let l = s; l <= o; l++) {
      const c = t.getLineMaxColumn(l), u = e.visibleColumnFromColumn(t, new de(l, c));
      r = Math.max(r, u);
    }
    let a = n.toViewVisualColumn;
    return a < r && a++, this.columnSelect(e, t, n.fromViewLineNumber, n.fromViewVisualColumn, n.toViewLineNumber, a);
  }
  static columnSelectUp(e, t, n, r) {
    const s = r ? e.pageSize : 1, o = Math.max(1, n.toViewLineNumber - s);
    return this.columnSelect(e, t, n.fromViewLineNumber, n.fromViewVisualColumn, o, n.toViewVisualColumn);
  }
  static columnSelectDown(e, t, n, r) {
    const s = r ? e.pageSize : 1, o = Math.min(t.getLineCount(), n.toViewLineNumber + s);
    return this.columnSelect(e, t, n.fromViewLineNumber, n.fromViewVisualColumn, o, n.toViewVisualColumn);
  }
}
class bl {
  constructor(e, t, n = !1) {
    this._range = e, this._text = t, this.insertsAutoWhitespace = n;
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return bt.fromPositions(r.getEndPosition());
  }
}
class Lie {
  constructor(e, t, n = !1) {
    this._range = e, this._text = t, this.insertsAutoWhitespace = n;
  }
  getEditOperations(e, t) {
    const n = this._range.getStartPosition(), r = this._range.getEndPosition(), s = r.lineNumber, o = this._text.length + (this._range.isEmpty() ? 0 : -1);
    let a = tFe(e, r, o);
    a.lineNumber > s && (a = new de(s, e.getLineMaxColumn(s)));
    const l = z.fromPositions(n, a);
    t.addTrackedEditOperation(l, this._text);
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return bt.fromPositions(r.getEndPosition());
  }
}
class Xrt {
  constructor(e, t) {
    this._range = e, this._text = t;
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return bt.fromRange(
      r,
      0
      /* SelectionDirection.LTR */
    );
  }
}
class EW {
  constructor(e, t, n = !1) {
    this._range = e, this._text = t, this.insertsAutoWhitespace = n;
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return bt.fromPositions(r.getStartPosition());
  }
}
class WV {
  constructor(e, t, n, r, s = !1) {
    this._range = e, this._text = t, this._columnDeltaOffset = r, this._lineNumberDeltaOffset = n, this.insertsAutoWhitespace = s;
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text);
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return bt.fromPositions(r.getEndPosition().delta(this._lineNumberDeltaOffset, this._columnDeltaOffset));
  }
}
class Zrt {
  constructor(e) {
    this._range = e;
  }
  getEditOperations(e, t) {
    const n = e.getValueInRange(this._range), r = this._range.getEndPosition(), s = r.lineNumber;
    let o = tFe(e, r, n.length);
    o.lineNumber > s && (o = new de(s, e.getLineMaxColumn(s)));
    const a = z.fromPositions(r, o);
    t.addTrackedEditOperation(a, "");
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return bt.fromPositions(r.getEndPosition());
  }
}
class rfe {
  constructor(e, t, n, r = !1) {
    this._range = e, this._text = t, this._initialSelection = n, this._forceMoveMarkers = r, this._selectionId = null;
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._range, this._text, this._forceMoveMarkers), this._selectionId = t.trackSelection(this._initialSelection);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._selectionId);
  }
}
function tFe(i, e, t) {
  if (t < 0)
    throw new Error("Unexpected negative delta");
  const n = i.getLineCount();
  let r = new de(n, i.getLineMaxColumn(n));
  for (let s = e.lineNumber; s <= n; s++)
    if (s === e.lineNumber) {
      const o = t - i.getLineMaxColumn(e.lineNumber) + e.column;
      if (o <= 0) {
        r = new de(e.lineNumber, e.column + t);
        break;
      }
      t = o;
    } else {
      const o = t - i.getLineMaxColumn(s);
      if (o <= 0) {
        r = new de(s, t);
        break;
      }
      t = o;
    }
  return r;
}
class a4 {
  /**
   * Get the visible column at the position. If we get to a non-whitespace character first
   * or past the end of string then return -1.
   *
   * **Note** `position` and the return value are 0-based.
   */
  static whitespaceVisibleColumn(e, t, n) {
    const r = e.length;
    let s = 0, o = -1, a = -1;
    for (let l = 0; l < r; l++) {
      if (l === t)
        return [o, a, s];
      switch (s % n === 0 && (o = l, a = s), e.charCodeAt(l)) {
        case 32:
          s += 1;
          break;
        case 9:
          s = As.nextRenderTabStop(s, n);
          break;
        default:
          return [-1, -1, -1];
      }
    }
    return t === r ? [o, a, s] : [-1, -1, -1];
  }
  /**
   * Return the position that should result from a move left, right or to the
   * nearest tab, if atomic tabs are enabled. Left and right are used for the
   * arrow key movements, nearest is used for mouse selection. It returns
   * -1 if atomic tabs are not relevant and you should fall back to normal
   * behaviour.
   *
   * **Note**: `position` and the return value are 0-based.
   */
  static atomicPosition(e, t, n, r) {
    const s = e.length, [o, a, l] = a4.whitespaceVisibleColumn(e, t, n);
    if (l === -1)
      return -1;
    let c;
    switch (r) {
      case 0:
        c = !0;
        break;
      case 1:
        c = !1;
        break;
      case 2:
        if (l % n === 0)
          return t;
        c = l % n <= n / 2;
        break;
    }
    if (c) {
      if (o === -1)
        return -1;
      let h = a;
      for (let g = o; g < s; ++g) {
        if (h === a + n)
          return o;
        switch (e.charCodeAt(g)) {
          case 32:
            h += 1;
            break;
          case 9:
            h = As.nextRenderTabStop(h, n);
            break;
          default:
            return -1;
        }
      }
      return h === a + n ? o : -1;
    }
    const u = As.nextRenderTabStop(l, n);
    let d = l;
    for (let h = t; h < s; h++) {
      if (d === u)
        return h;
      switch (e.charCodeAt(h)) {
        case 32:
          d += 1;
          break;
        case 9:
          d = As.nextRenderTabStop(d, n);
          break;
        default:
          return -1;
      }
    }
    return d === u ? s : -1;
  }
}
class zJ {
  constructor(e, t, n) {
    this._cursorPositionBrand = void 0, this.lineNumber = e, this.column = t, this.leftoverVisibleColumns = n;
  }
}
class Zi {
  static leftPosition(e, t) {
    if (t.column > e.getLineMinColumn(t.lineNumber))
      return t.delta(void 0, -ZMe(e.getLineContent(t.lineNumber), t.column - 1));
    if (t.lineNumber > 1) {
      const n = t.lineNumber - 1;
      return new de(n, e.getLineMaxColumn(n));
    } else
      return t;
  }
  static leftPositionAtomicSoftTabs(e, t, n) {
    if (t.column <= e.getLineIndentColumn(t.lineNumber)) {
      const r = e.getLineMinColumn(t.lineNumber), s = e.getLineContent(t.lineNumber), o = a4.atomicPosition(
        s,
        t.column - 1,
        n,
        0
        /* Direction.Left */
      );
      if (o !== -1 && o + 1 >= r)
        return new de(t.lineNumber, o + 1);
    }
    return this.leftPosition(e, t);
  }
  static left(e, t, n) {
    const r = e.stickyTabStops ? Zi.leftPositionAtomicSoftTabs(t, n, e.tabSize) : Zi.leftPosition(t, n);
    return new zJ(r.lineNumber, r.column, 0);
  }
  /**
   * @param noOfColumns Must be either `1`
   * or `Math.round(viewModel.getLineContent(viewLineNumber).length / 2)` (for half lines).
  */
  static moveLeft(e, t, n, r, s) {
    let o, a;
    if (n.hasSelection() && !r)
      o = n.selection.startLineNumber, a = n.selection.startColumn;
    else {
      const l = n.position.delta(void 0, -(s - 1)), c = t.normalizePosition(
        Zi.clipPositionColumn(l, t),
        0
        /* PositionAffinity.Left */
      ), u = Zi.left(e, t, c);
      o = u.lineNumber, a = u.column;
    }
    return n.move(r, o, a, 0);
  }
  /**
   * Adjusts the column so that it is within min/max of the line.
  */
  static clipPositionColumn(e, t) {
    return new de(e.lineNumber, Zi.clipRange(e.column, t.getLineMinColumn(e.lineNumber), t.getLineMaxColumn(e.lineNumber)));
  }
  static clipRange(e, t, n) {
    return e < t ? t : e > n ? n : e;
  }
  static rightPosition(e, t, n) {
    return n < e.getLineMaxColumn(t) ? n = n + Hhe(e.getLineContent(t), n - 1) : t < e.getLineCount() && (t = t + 1, n = e.getLineMinColumn(t)), new de(t, n);
  }
  static rightPositionAtomicSoftTabs(e, t, n, r, s) {
    if (n < e.getLineIndentColumn(t)) {
      const o = e.getLineContent(t), a = a4.atomicPosition(
        o,
        n - 1,
        r,
        1
        /* Direction.Right */
      );
      if (a !== -1)
        return new de(t, a + 1);
    }
    return this.rightPosition(e, t, n);
  }
  static right(e, t, n) {
    const r = e.stickyTabStops ? Zi.rightPositionAtomicSoftTabs(t, n.lineNumber, n.column, e.tabSize, e.indentSize) : Zi.rightPosition(t, n.lineNumber, n.column);
    return new zJ(r.lineNumber, r.column, 0);
  }
  static moveRight(e, t, n, r, s) {
    let o, a;
    if (n.hasSelection() && !r)
      o = n.selection.endLineNumber, a = n.selection.endColumn;
    else {
      const l = n.position.delta(void 0, s - 1), c = t.normalizePosition(
        Zi.clipPositionColumn(l, t),
        1
        /* PositionAffinity.Right */
      ), u = Zi.right(e, t, c);
      o = u.lineNumber, a = u.column;
    }
    return n.move(r, o, a, 0);
  }
  static vertical(e, t, n, r, s, o, a, l) {
    const c = As.visibleColumnFromColumn(t.getLineContent(n), r, e.tabSize) + s, u = t.getLineCount(), d = n === 1 && r === 1, h = n === u && r === t.getLineMaxColumn(n), g = o < n ? d : h;
    if (n = o, n < 1 ? (n = 1, a ? r = t.getLineMinColumn(n) : r = Math.min(t.getLineMaxColumn(n), r)) : n > u ? (n = u, a ? r = t.getLineMaxColumn(n) : r = Math.min(t.getLineMaxColumn(n), r)) : r = e.columnFromVisibleColumn(t, n, c), g ? s = 0 : s = c - As.visibleColumnFromColumn(t.getLineContent(n), r, e.tabSize), l !== void 0) {
      const m = new de(n, r), _ = t.normalizePosition(m, l);
      s = s + (r - _.column), n = _.lineNumber, r = _.column;
    }
    return new zJ(n, r, s);
  }
  static down(e, t, n, r, s, o, a) {
    return this.vertical(
      e,
      t,
      n,
      r,
      s,
      n + o,
      a,
      4
      /* PositionAffinity.RightOfInjectedText */
    );
  }
  static moveDown(e, t, n, r, s) {
    let o, a;
    n.hasSelection() && !r ? (o = n.selection.endLineNumber, a = n.selection.endColumn) : (o = n.position.lineNumber, a = n.position.column);
    let l = 0, c;
    do
      if (c = Zi.down(e, t, o + l, a, n.leftoverVisibleColumns, s, !0), t.normalizePosition(
        new de(c.lineNumber, c.column),
        2
        /* PositionAffinity.None */
      ).lineNumber > o)
        break;
    while (l++ < 10 && o + l < t.getLineCount());
    return n.move(r, c.lineNumber, c.column, c.leftoverVisibleColumns);
  }
  static translateDown(e, t, n) {
    const r = n.selection, s = Zi.down(e, t, r.selectionStartLineNumber, r.selectionStartColumn, n.selectionStartLeftoverVisibleColumns, 1, !1), o = Zi.down(e, t, r.positionLineNumber, r.positionColumn, n.leftoverVisibleColumns, 1, !1);
    return new ja(new z(s.lineNumber, s.column, s.lineNumber, s.column), 0, s.leftoverVisibleColumns, new de(o.lineNumber, o.column), o.leftoverVisibleColumns);
  }
  static up(e, t, n, r, s, o, a) {
    return this.vertical(
      e,
      t,
      n,
      r,
      s,
      n - o,
      a,
      3
      /* PositionAffinity.LeftOfInjectedText */
    );
  }
  static moveUp(e, t, n, r, s) {
    let o, a;
    n.hasSelection() && !r ? (o = n.selection.startLineNumber, a = n.selection.startColumn) : (o = n.position.lineNumber, a = n.position.column);
    const l = Zi.up(e, t, o, a, n.leftoverVisibleColumns, s, !0);
    return n.move(r, l.lineNumber, l.column, l.leftoverVisibleColumns);
  }
  static translateUp(e, t, n) {
    const r = n.selection, s = Zi.up(e, t, r.selectionStartLineNumber, r.selectionStartColumn, n.selectionStartLeftoverVisibleColumns, 1, !1), o = Zi.up(e, t, r.positionLineNumber, r.positionColumn, n.leftoverVisibleColumns, 1, !1);
    return new ja(new z(s.lineNumber, s.column, s.lineNumber, s.column), 0, s.leftoverVisibleColumns, new de(o.lineNumber, o.column), o.leftoverVisibleColumns);
  }
  static _isBlankLine(e, t) {
    return e.getLineFirstNonWhitespaceColumn(t) === 0;
  }
  static moveToPrevBlankLine(e, t, n, r) {
    let s = n.position.lineNumber;
    for (; s > 1 && this._isBlankLine(t, s); )
      s--;
    for (; s > 1 && !this._isBlankLine(t, s); )
      s--;
    return n.move(r, s, t.getLineMinColumn(s), 0);
  }
  static moveToNextBlankLine(e, t, n, r) {
    const s = t.getLineCount();
    let o = n.position.lineNumber;
    for (; o < s && this._isBlankLine(t, o); )
      o++;
    for (; o < s && !this._isBlankLine(t, o); )
      o++;
    return n.move(r, o, t.getLineMinColumn(o), 0);
  }
  static moveToBeginningOfLine(e, t, n, r) {
    const s = n.position.lineNumber, o = t.getLineMinColumn(s), a = t.getLineFirstNonWhitespaceColumn(s) || o;
    let l;
    return n.position.column === a ? l = o : l = a, n.move(r, s, l, 0);
  }
  static moveToEndOfLine(e, t, n, r, s) {
    const o = n.position.lineNumber, a = t.getLineMaxColumn(o);
    return n.move(r, o, a, s ? 1073741824 - a : 0);
  }
  static moveToBeginningOfBuffer(e, t, n, r) {
    return n.move(r, 1, 1, 0);
  }
  static moveToEndOfBuffer(e, t, n, r) {
    const s = t.getLineCount(), o = t.getLineMaxColumn(s);
    return n.move(r, s, o, 0);
  }
}
class iT {
  static deleteRight(e, t, n, r) {
    const s = [];
    let o = e !== 3;
    for (let a = 0, l = r.length; a < l; a++) {
      const c = r[a], u = this.getDeleteRightRange(c, n, t);
      if (u.isEmpty()) {
        s[a] = null;
        continue;
      }
      u.startLineNumber !== u.endLineNumber && (o = !0), s[a] = new bl(u, "");
    }
    return [o, s];
  }
  static getDeleteRightRange(e, t, n) {
    if (!e.isEmpty())
      return e;
    const r = e.getPosition(), s = Zi.right(n, t, r);
    if (n.trimWhitespaceOnDelete && s.lineNumber !== r.lineNumber) {
      const o = t.getLineFirstNonWhitespaceColumn(r.lineNumber) > 0, a = t.getLineFirstNonWhitespaceColumn(s.lineNumber);
      if (o && a > 0)
        return new z(s.lineNumber, a, r.lineNumber, r.column);
    }
    return new z(s.lineNumber, s.column, r.lineNumber, r.column);
  }
  static isAutoClosingPairDelete(e, t, n, r, s, o, a) {
    if (t === "never" && n === "never" || e === "never")
      return !1;
    for (let l = 0, c = o.length; l < c; l++) {
      const u = o[l], d = u.getPosition();
      if (!u.isEmpty())
        return !1;
      const h = s.getLineContent(d.lineNumber);
      if (d.column < 2 || d.column >= h.length + 1)
        return !1;
      const g = h.charAt(d.column - 2), m = r.get(g);
      if (!m)
        return !1;
      if (ow(g)) {
        if (n === "never")
          return !1;
      } else if (t === "never")
        return !1;
      const _ = h.charAt(d.column - 1);
      let v = !1;
      for (const w of m)
        w.open === g && w.close === _ && (v = !0);
      if (!v)
        return !1;
      if (e === "auto") {
        let w = !1;
        for (let E = 0, L = a.length; E < L; E++) {
          const T = a[E];
          if (d.lineNumber === T.startLineNumber && d.column === T.startColumn) {
            w = !0;
            break;
          }
        }
        if (!w)
          return !1;
      }
    }
    return !0;
  }
  static _runAutoClosingPairDelete(e, t, n) {
    const r = [];
    for (let s = 0, o = n.length; s < o; s++) {
      const a = n[s].getPosition(), l = new z(a.lineNumber, a.column - 1, a.lineNumber, a.column + 1);
      r[s] = new bl(l, "");
    }
    return [!0, r];
  }
  static deleteLeft(e, t, n, r, s) {
    if (this.isAutoClosingPairDelete(t.autoClosingDelete, t.autoClosingBrackets, t.autoClosingQuotes, t.autoClosingPairs.autoClosingPairsOpenByEnd, n, r, s))
      return this._runAutoClosingPairDelete(t, n, r);
    const o = [];
    let a = e !== 2;
    for (let l = 0, c = r.length; l < c; l++) {
      const u = iT.getDeleteLeftRange(r[l], n, t);
      if (u.isEmpty()) {
        o[l] = null;
        continue;
      }
      u.startLineNumber !== u.endLineNumber && (a = !0), o[l] = new bl(u, "");
    }
    return [a, o];
  }
  static getDeleteLeftRange(e, t, n) {
    if (!e.isEmpty())
      return e;
    const r = e.getPosition();
    if (n.useTabStops && r.column > 1) {
      const s = t.getLineContent(r.lineNumber), o = Tc(s), a = o === -1 ? (
        /* entire string is whitespace */
        s.length + 1
      ) : o + 1;
      if (r.column <= a) {
        const l = n.visibleColumnFromColumn(t, r), c = As.prevIndentTabStop(l, n.indentSize), u = n.columnFromVisibleColumn(t, r.lineNumber, c);
        return new z(r.lineNumber, u, r.lineNumber, r.column);
      }
    }
    return z.fromPositions(iT.getPositionAfterDeleteLeft(r, t), r);
  }
  static getPositionAfterDeleteLeft(e, t) {
    if (e.column > 1) {
      const n = mnt(e.column - 1, t.getLineContent(e.lineNumber));
      return e.with(void 0, n + 1);
    } else if (e.lineNumber > 1) {
      const n = e.lineNumber - 1;
      return new de(n, t.getLineMaxColumn(n));
    } else
      return e;
  }
  static cut(e, t, n) {
    const r = [];
    let s = null;
    n.sort((o, a) => de.compare(o.getStartPosition(), a.getEndPosition()));
    for (let o = 0, a = n.length; o < a; o++) {
      const l = n[o];
      if (l.isEmpty())
        if (e.emptySelectionClipboard) {
          const c = l.getPosition();
          let u, d, h, g;
          c.lineNumber < t.getLineCount() ? (u = c.lineNumber, d = 1, h = c.lineNumber + 1, g = 1) : c.lineNumber > 1 && (s == null ? void 0 : s.endLineNumber) !== c.lineNumber ? (u = c.lineNumber - 1, d = t.getLineMaxColumn(c.lineNumber - 1), h = c.lineNumber, g = t.getLineMaxColumn(c.lineNumber)) : (u = c.lineNumber, d = 1, h = c.lineNumber, g = t.getLineMaxColumn(c.lineNumber));
          const m = new z(u, d, h, g);
          s = m, m.isEmpty() ? r[o] = null : r[o] = new bl(m, "");
        } else
          r[o] = null;
      else
        r[o] = new bl(l, "");
    }
    return new uu(0, r, {
      shouldPushStackElementBefore: !0,
      shouldPushStackElementAfter: !0
    });
  }
}
const qT = {
  DateTimeFormat(i, e) {
    return new _l(() => {
      try {
        return new Intl.DateTimeFormat(i, e);
      } catch {
        return new Intl.DateTimeFormat(void 0, e);
      }
    });
  },
  Collator(i, e) {
    return new _l(() => {
      try {
        return new Intl.Collator(i, e);
      } catch {
        return new Intl.Collator(void 0, e);
      }
    });
  },
  Segmenter(i, e) {
    return new _l(() => {
      try {
        return new Intl.Segmenter(i, e);
      } catch {
        return new Intl.Segmenter(void 0, e);
      }
    });
  },
  Locale(i, e) {
    return new _l(() => {
      try {
        return new Intl.Locale(i, e);
      } catch {
        return new Intl.Locale(lx, e);
      }
    });
  },
  NumberFormat(i, e) {
    return new _l(() => {
      try {
        return new Intl.NumberFormat(i, e);
      } catch {
        return new Intl.NumberFormat(void 0, e);
      }
    });
  }
};
function VV(i) {
  return i < 0 ? 0 : i > 255 ? 255 : i | 0;
}
function fI(i) {
  return i < 0 ? 0 : i > 4294967295 ? 4294967295 : i | 0;
}
class YA {
  constructor(e) {
    const t = VV(e);
    this._defaultValue = t, this._asciiMap = YA._createAsciiMap(t), this._map = /* @__PURE__ */ new Map();
  }
  static _createAsciiMap(e) {
    const t = new Uint8Array(256);
    return t.fill(e), t;
  }
  set(e, t) {
    const n = VV(t);
    e >= 0 && e < 256 ? this._asciiMap[e] = n : this._map.set(e, n);
  }
  get(e) {
    return e >= 0 && e < 256 ? this._asciiMap[e] : this._map.get(e) || this._defaultValue;
  }
  clear() {
    this._asciiMap.fill(this._defaultValue), this._map.clear();
  }
}
class UV {
  constructor() {
    this._actual = new YA(
      0
      /* Boolean.False */
    );
  }
  add(e) {
    this._actual.set(
      e,
      1
      /* Boolean.True */
    );
  }
  has(e) {
    return this._actual.get(e) === 1;
  }
  clear() {
    return this._actual.clear();
  }
}
class Qrt extends YA {
  constructor(e, t) {
    super(
      0
      /* WordCharacterClass.Regular */
    ), this._segmenter = null, this._cachedLine = null, this._cachedSegments = [], this.intlSegmenterLocales = t, this.intlSegmenterLocales.length > 0 ? this._segmenter = qT.Segmenter(this.intlSegmenterLocales, { granularity: "word" }) : this._segmenter = null;
    for (let n = 0, r = e.length; n < r; n++)
      this.set(
        e.charCodeAt(n),
        2
        /* WordCharacterClass.WordSeparator */
      );
    this.set(
      32,
      1
      /* WordCharacterClass.Whitespace */
    ), this.set(
      9,
      1
      /* WordCharacterClass.Whitespace */
    );
  }
  findPrevIntlWordBeforeOrAtOffset(e, t) {
    let n = null;
    for (const r of this._getIntlSegmenterWordsOnLine(e)) {
      if (r.index > t)
        break;
      n = r;
    }
    return n;
  }
  findNextIntlWordAtOrAfterOffset(e, t) {
    for (const n of this._getIntlSegmenterWordsOnLine(e))
      if (!(n.index < t))
        return n;
    return null;
  }
  _getIntlSegmenterWordsOnLine(e) {
    return this._segmenter ? this._cachedLine === e ? this._cachedSegments : (this._cachedLine = e, this._cachedSegments = this._filterWordSegments(this._segmenter.value.segment(e)), this._cachedSegments) : [];
  }
  _filterWordSegments(e) {
    const t = [];
    for (const n of e)
      this._isWordLike(n) && t.push(n);
    return t;
  }
  _isWordLike(e) {
    return !!e.isWordLike;
  }
}
const rLe = new Tb(10);
function Yf(i, e) {
  const t = `${i}/${e.join(",")}`;
  let n = rLe.get(t);
  return n || (n = new Qrt(i, e), rLe.set(t, n)), n;
}
class Qi {
  static _createWord(e, t, n, r, s) {
    return { start: r, end: s, wordType: t, nextCharClass: n };
  }
  static _createIntlWord(e, t) {
    return { start: e.index, end: e.index + e.segment.length, wordType: 1, nextCharClass: t };
  }
  static _findPreviousWordOnLine(e, t, n) {
    const r = t.getLineContent(n.lineNumber);
    return this._doFindPreviousWordOnLine(r, e, n);
  }
  static _doFindPreviousWordOnLine(e, t, n) {
    let r = 0;
    const s = t.findPrevIntlWordBeforeOrAtOffset(e, n.column - 2);
    for (let o = n.column - 2; o >= 0; o--) {
      const a = e.charCodeAt(o), l = t.get(a);
      if (s && o === s.index)
        return this._createIntlWord(s, l);
      if (l === 0) {
        if (r === 2)
          return this._createWord(e, r, l, o + 1, this._findEndOfWord(e, t, r, o + 1));
        r = 1;
      } else if (l === 2) {
        if (r === 1)
          return this._createWord(e, r, l, o + 1, this._findEndOfWord(e, t, r, o + 1));
        r = 2;
      } else if (l === 1 && r !== 0)
        return this._createWord(e, r, l, o + 1, this._findEndOfWord(e, t, r, o + 1));
    }
    return r !== 0 ? this._createWord(e, r, 1, 0, this._findEndOfWord(e, t, r, 0)) : null;
  }
  static _findEndOfWord(e, t, n, r) {
    const s = t.findNextIntlWordAtOrAfterOffset(e, r), o = e.length;
    for (let a = r; a < o; a++) {
      const l = e.charCodeAt(a), c = t.get(l);
      if (s && a === s.index + s.segment.length || c === 1 || n === 1 && c === 2 || n === 2 && c === 0)
        return a;
    }
    return o;
  }
  static _findNextWordOnLine(e, t, n) {
    const r = t.getLineContent(n.lineNumber);
    return this._doFindNextWordOnLine(r, e, n);
  }
  static _doFindNextWordOnLine(e, t, n) {
    let r = 0;
    const s = e.length, o = t.findNextIntlWordAtOrAfterOffset(e, n.column - 1);
    for (let a = n.column - 1; a < s; a++) {
      const l = e.charCodeAt(a), c = t.get(l);
      if (o && a === o.index)
        return this._createIntlWord(o, c);
      if (c === 0) {
        if (r === 2)
          return this._createWord(e, r, c, this._findStartOfWord(e, t, r, a - 1), a);
        r = 1;
      } else if (c === 2) {
        if (r === 1)
          return this._createWord(e, r, c, this._findStartOfWord(e, t, r, a - 1), a);
        r = 2;
      } else if (c === 1 && r !== 0)
        return this._createWord(e, r, c, this._findStartOfWord(e, t, r, a - 1), a);
    }
    return r !== 0 ? this._createWord(e, r, 1, this._findStartOfWord(e, t, r, s - 1), s) : null;
  }
  static _findStartOfWord(e, t, n, r) {
    const s = t.findPrevIntlWordBeforeOrAtOffset(e, r);
    for (let o = r; o >= 0; o--) {
      const a = e.charCodeAt(o), l = t.get(a);
      if (s && o === s.index)
        return o;
      if (l === 1 || n === 1 && l === 2 || n === 2 && l === 0)
        return o + 1;
    }
    return 0;
  }
  static moveWordLeft(e, t, n, r, s) {
    let o = n.lineNumber, a = n.column;
    a === 1 && o > 1 && (o = o - 1, a = t.getLineMaxColumn(o));
    let l = Qi._findPreviousWordOnLine(e, t, new de(o, a));
    if (r === 0)
      return new de(o, l ? l.start + 1 : 1);
    if (r === 1)
      return !s && l && l.wordType === 2 && l.end - l.start === 1 && l.nextCharClass === 0 && (l = Qi._findPreviousWordOnLine(e, t, new de(o, l.start + 1))), new de(o, l ? l.start + 1 : 1);
    if (r === 3) {
      for (; l && l.wordType === 2; )
        l = Qi._findPreviousWordOnLine(e, t, new de(o, l.start + 1));
      return new de(o, l ? l.start + 1 : 1);
    }
    return l && a <= l.end + 1 && (l = Qi._findPreviousWordOnLine(e, t, new de(o, l.start + 1))), new de(o, l ? l.end + 1 : 1);
  }
  static _moveWordPartLeft(e, t) {
    const n = t.lineNumber, r = e.getLineMaxColumn(n);
    if (t.column === 1)
      return n > 1 ? new de(n - 1, e.getLineMaxColumn(n - 1)) : t;
    const s = e.getLineContent(n);
    for (let o = t.column - 1; o > 1; o--) {
      const a = s.charCodeAt(o - 2), l = s.charCodeAt(o - 1);
      if (a === 95 && l !== 95)
        return new de(n, o);
      if (a === 45 && l !== 45)
        return new de(n, o);
      if ((r1(a) || k7(a)) && H_(l))
        return new de(n, o);
      if (H_(a) && H_(l) && o + 1 < r) {
        const c = s.charCodeAt(o);
        if (r1(c) || k7(c))
          return new de(n, o);
      }
    }
    return new de(n, 1);
  }
  static moveWordRight(e, t, n, r) {
    let s = n.lineNumber, o = n.column, a = !1;
    o === t.getLineMaxColumn(s) && s < t.getLineCount() && (a = !0, s = s + 1, o = 1);
    let l = Qi._findNextWordOnLine(e, t, new de(s, o));
    if (r === 2)
      l && l.wordType === 2 && l.end - l.start === 1 && l.nextCharClass === 0 && (l = Qi._findNextWordOnLine(e, t, new de(s, l.end + 1))), l ? o = l.end + 1 : o = t.getLineMaxColumn(s);
    else if (r === 3) {
      for (a && (o = 0); l && (l.wordType === 2 || l.start + 1 <= o); )
        l = Qi._findNextWordOnLine(e, t, new de(s, l.end + 1));
      l ? o = l.start + 1 : o = t.getLineMaxColumn(s);
    } else
      l && !a && o >= l.start + 1 && (l = Qi._findNextWordOnLine(e, t, new de(s, l.end + 1))), l ? o = l.start + 1 : o = t.getLineMaxColumn(s);
    return new de(s, o);
  }
  static _moveWordPartRight(e, t) {
    const n = t.lineNumber, r = e.getLineMaxColumn(n);
    if (t.column === r)
      return n < e.getLineCount() ? new de(n + 1, 1) : t;
    const s = e.getLineContent(n);
    for (let o = t.column + 1; o < r; o++) {
      const a = s.charCodeAt(o - 2), l = s.charCodeAt(o - 1);
      if (a !== 95 && l === 95)
        return new de(n, o);
      if (a !== 45 && l === 45)
        return new de(n, o);
      if ((r1(a) || k7(a)) && H_(l))
        return new de(n, o);
      if (H_(a) && H_(l) && o + 1 < r) {
        const c = s.charCodeAt(o);
        if (r1(c) || k7(c))
          return new de(n, o);
      }
    }
    return new de(n, r);
  }
  static _deleteWordLeftWhitespace(e, t) {
    const n = e.getLineContent(t.lineNumber), r = t.column - 2, s = zg(n, r);
    return s + 1 < r ? new z(t.lineNumber, s + 2, t.lineNumber, t.column) : null;
  }
  static deleteWordLeft(e, t) {
    const n = e.wordSeparators, r = e.model, s = e.selection, o = e.whitespaceHeuristics;
    if (!s.isEmpty())
      return s;
    if (iT.isAutoClosingPairDelete(e.autoClosingDelete, e.autoClosingBrackets, e.autoClosingQuotes, e.autoClosingPairs.autoClosingPairsOpenByEnd, e.model, [e.selection], e.autoClosedCharacters)) {
      const d = e.selection.getPosition();
      return new z(d.lineNumber, d.column - 1, d.lineNumber, d.column + 1);
    }
    const a = new de(s.positionLineNumber, s.positionColumn);
    let l = a.lineNumber, c = a.column;
    if (l === 1 && c === 1)
      return null;
    if (o) {
      const d = this._deleteWordLeftWhitespace(r, a);
      if (d)
        return d;
    }
    let u = Qi._findPreviousWordOnLine(n, r, a);
    return t === 0 ? u ? c = u.start + 1 : c > 1 ? c = 1 : (l--, c = r.getLineMaxColumn(l)) : (u && c <= u.end + 1 && (u = Qi._findPreviousWordOnLine(n, r, new de(l, u.start + 1))), u ? c = u.end + 1 : c > 1 ? c = 1 : (l--, c = r.getLineMaxColumn(l))), new z(l, c, a.lineNumber, a.column);
  }
  static deleteInsideWord(e, t, n) {
    if (!n.isEmpty())
      return n;
    const r = new de(n.positionLineNumber, n.positionColumn), s = this._deleteInsideWordWhitespace(t, r);
    return s || this._deleteInsideWordDetermineDeleteRange(e, t, r);
  }
  static _charAtIsWhitespace(e, t) {
    const n = e.charCodeAt(t);
    return n === 32 || n === 9;
  }
  static _deleteInsideWordWhitespace(e, t) {
    const n = e.getLineContent(t.lineNumber), r = n.length;
    if (r === 0)
      return null;
    let s = Math.max(t.column - 2, 0);
    if (!this._charAtIsWhitespace(n, s))
      return null;
    let o = Math.min(t.column - 1, r - 1);
    if (!this._charAtIsWhitespace(n, o))
      return null;
    for (; s > 0 && this._charAtIsWhitespace(n, s - 1); )
      s--;
    for (; o + 1 < r && this._charAtIsWhitespace(n, o + 1); )
      o++;
    return new z(t.lineNumber, s + 1, t.lineNumber, o + 2);
  }
  static _deleteInsideWordDetermineDeleteRange(e, t, n) {
    const r = t.getLineContent(n.lineNumber), s = r.length;
    if (s === 0)
      return n.lineNumber > 1 ? new z(n.lineNumber - 1, t.getLineMaxColumn(n.lineNumber - 1), n.lineNumber, 1) : n.lineNumber < t.getLineCount() ? new z(n.lineNumber, 1, n.lineNumber + 1, 1) : new z(n.lineNumber, 1, n.lineNumber, 1);
    const o = (d) => d.start + 1 <= n.column && n.column <= d.end + 1, a = (d, h) => (d = Math.min(d, n.column), h = Math.max(h, n.column), new z(n.lineNumber, d, n.lineNumber, h)), l = (d) => {
      let h = d.start + 1, g = d.end + 1, m = !1;
      for (; g - 1 < s && this._charAtIsWhitespace(r, g - 1); )
        m = !0, g++;
      if (!m)
        for (; h > 1 && this._charAtIsWhitespace(r, h - 2); )
          h--;
      return a(h, g);
    }, c = Qi._findPreviousWordOnLine(e, t, n);
    if (c && o(c))
      return l(c);
    const u = Qi._findNextWordOnLine(e, t, n);
    return u && o(u) ? l(u) : c && u ? a(c.end + 1, u.start + 1) : c ? a(c.start + 1, c.end + 1) : u ? a(u.start + 1, u.end + 1) : a(1, s + 1);
  }
  static _deleteWordPartLeft(e, t) {
    if (!t.isEmpty())
      return t;
    const n = t.getPosition(), r = Qi._moveWordPartLeft(e, n);
    return new z(n.lineNumber, n.column, r.lineNumber, r.column);
  }
  static _findFirstNonWhitespaceChar(e, t) {
    const n = e.length;
    for (let r = t; r < n; r++) {
      const s = e.charAt(r);
      if (s !== " " && s !== "	")
        return r;
    }
    return n;
  }
  static _deleteWordRightWhitespace(e, t) {
    const n = e.getLineContent(t.lineNumber), r = t.column - 1, s = this._findFirstNonWhitespaceChar(n, r);
    return r + 1 < s ? new z(t.lineNumber, t.column, t.lineNumber, s + 1) : null;
  }
  static deleteWordRight(e, t) {
    const n = e.wordSeparators, r = e.model, s = e.selection, o = e.whitespaceHeuristics;
    if (!s.isEmpty())
      return s;
    const a = new de(s.positionLineNumber, s.positionColumn);
    let l = a.lineNumber, c = a.column;
    const u = r.getLineCount(), d = r.getLineMaxColumn(l);
    if (l === u && c === d)
      return null;
    if (o) {
      const g = this._deleteWordRightWhitespace(r, a);
      if (g)
        return g;
    }
    let h = Qi._findNextWordOnLine(n, r, a);
    return t === 2 ? h ? c = h.end + 1 : c < d || l === u ? c = d : (l++, h = Qi._findNextWordOnLine(n, r, new de(l, 1)), h ? c = h.start + 1 : c = r.getLineMaxColumn(l)) : (h && c >= h.start + 1 && (h = Qi._findNextWordOnLine(n, r, new de(l, h.end + 1))), h ? c = h.start + 1 : c < d || l === u ? c = d : (l++, h = Qi._findNextWordOnLine(n, r, new de(l, 1)), h ? c = h.start + 1 : c = r.getLineMaxColumn(l))), new z(l, c, a.lineNumber, a.column);
  }
  static _deleteWordPartRight(e, t) {
    if (!t.isEmpty())
      return t;
    const n = t.getPosition(), r = Qi._moveWordPartRight(e, n);
    return new z(n.lineNumber, n.column, r.lineNumber, r.column);
  }
  static _createWordAtPosition(e, t, n) {
    const r = new z(t, n.start + 1, t, n.end + 1);
    return {
      word: e.getValueInRange(r),
      startColumn: r.startColumn,
      endColumn: r.endColumn
    };
  }
  static getWordAtPosition(e, t, n, r) {
    const s = Yf(t, n), o = Qi._findPreviousWordOnLine(s, e, r);
    if (o && o.wordType === 1 && o.start <= r.column - 1 && r.column - 1 <= o.end)
      return Qi._createWordAtPosition(e, r.lineNumber, o);
    const a = Qi._findNextWordOnLine(s, e, r);
    return a && a.wordType === 1 && a.start <= r.column - 1 && r.column - 1 <= a.end ? Qi._createWordAtPosition(e, r.lineNumber, a) : null;
  }
  static word(e, t, n, r, s) {
    const o = Yf(e.wordSeparators, e.wordSegmenterLocales), a = Qi._findPreviousWordOnLine(o, t, s), l = Qi._findNextWordOnLine(o, t, s);
    if (!r) {
      let g, m;
      return a && a.wordType === 1 && a.start <= s.column - 1 && s.column - 1 <= a.end ? (g = a.start + 1, m = a.end + 1) : l && l.wordType === 1 && l.start <= s.column - 1 && s.column - 1 <= l.end ? (g = l.start + 1, m = l.end + 1) : (a ? g = a.end + 1 : g = 1, l ? m = l.start + 1 : m = t.getLineMaxColumn(s.lineNumber)), new ja(new z(s.lineNumber, g, s.lineNumber, m), 1, 0, new de(s.lineNumber, m), 0);
    }
    let c, u;
    a && a.wordType === 1 && a.start < s.column - 1 && s.column - 1 < a.end ? (c = a.start + 1, u = a.end + 1) : l && l.wordType === 1 && l.start < s.column - 1 && s.column - 1 < l.end ? (c = l.start + 1, u = l.end + 1) : (c = s.column, u = s.column);
    const d = s.lineNumber;
    let h;
    if (n.selectionStart.containsPosition(s))
      h = n.selectionStart.endColumn;
    else if (s.isBeforeOrEqual(n.selectionStart.getStartPosition())) {
      h = c;
      const g = new de(d, h);
      n.selectionStart.containsPosition(g) && (h = n.selectionStart.endColumn);
    } else {
      h = u;
      const g = new de(d, h);
      n.selectionStart.containsPosition(g) && (h = n.selectionStart.startColumn);
    }
    return n.move(!0, d, h, 0);
  }
}
class Mq extends Qi {
  static deleteWordPartLeft(e) {
    const t = R7([
      Qi.deleteWordLeft(
        e,
        0
        /* WordNavigationType.WordStart */
      ),
      Qi.deleteWordLeft(
        e,
        2
        /* WordNavigationType.WordEnd */
      ),
      Qi._deleteWordPartLeft(e.model, e.selection)
    ]);
    return t.sort(z.compareRangesUsingEnds), t[2];
  }
  static deleteWordPartRight(e) {
    const t = R7([
      Qi.deleteWordRight(
        e,
        0
        /* WordNavigationType.WordStart */
      ),
      Qi.deleteWordRight(
        e,
        2
        /* WordNavigationType.WordEnd */
      ),
      Qi._deleteWordPartRight(e.model, e.selection)
    ]);
    return t.sort(z.compareRangesUsingStarts), t[0];
  }
  static moveWordPartLeft(e, t, n, r) {
    const s = R7([
      Qi.moveWordLeft(e, t, n, 0, r),
      Qi.moveWordLeft(e, t, n, 2, r),
      Qi._moveWordPartLeft(t, n)
    ]);
    return s.sort(de.compare), s[2];
  }
  static moveWordPartRight(e, t, n) {
    const r = R7([
      Qi.moveWordRight(
        e,
        t,
        n,
        0
        /* WordNavigationType.WordStart */
      ),
      Qi.moveWordRight(
        e,
        t,
        n,
        2
        /* WordNavigationType.WordEnd */
      ),
      Qi._moveWordPartRight(t, n)
    ]);
    return r.sort(de.compare), r[0];
  }
}
function R7(i) {
  return i.filter((e) => !!e);
}
function W_(i) {
  if (!i || typeof i != "object" || i instanceof RegExp)
    return i;
  const e = Array.isArray(i) ? [] : {};
  return Object.entries(i).forEach(([t, n]) => {
    e[t] = n && typeof n == "object" ? W_(n) : n;
  }), e;
}
function Jrt(i) {
  if (!i || typeof i != "object")
    return i;
  const e = [i];
  for (; e.length > 0; ) {
    const t = e.shift();
    Object.freeze(t);
    for (const n in t)
      if (nFe.call(t, n)) {
        const r = t[n];
        typeof r == "object" && !Object.isFrozen(r) && !gtt(r) && e.push(r);
      }
  }
  return i;
}
const nFe = Object.prototype.hasOwnProperty;
function iFe(i, e) {
  return Tie(i, e, /* @__PURE__ */ new Set());
}
function Tie(i, e, t) {
  if (If(i))
    return i;
  const n = e(i);
  if (typeof n < "u")
    return n;
  if (Array.isArray(i)) {
    const r = [];
    for (const s of i)
      r.push(Tie(s, e, t));
    return r;
  }
  if (Ra(i)) {
    if (t.has(i))
      throw new Error("Cannot clone recursive data-structure");
    t.add(i);
    const r = {};
    for (const s in i)
      nFe.call(i, s) && (r[s] = Tie(i[s], e, t));
    return t.delete(i), r;
  }
  return i;
}
function Pq(i, e, t = !0) {
  return Ra(i) ? (Ra(e) && Object.keys(e).forEach((n) => {
    n in i ? t && (Ra(i[n]) && Ra(e[n]) ? Pq(i[n], e[n], t) : i[n] = e[n]) : i[n] = e[n];
  }), i) : e;
}
function Wd(i, e) {
  if (i === e)
    return !0;
  if (i == null || e === null || e === void 0 || typeof i != typeof e || typeof i != "object" || Array.isArray(i) !== Array.isArray(e))
    return !1;
  let t, n;
  if (Array.isArray(i)) {
    if (i.length !== e.length)
      return !1;
    for (t = 0; t < i.length; t++)
      if (!Wd(i[t], e[t]))
        return !1;
  } else {
    const r = [];
    for (n in i)
      r.push(n);
    r.sort();
    const s = [];
    for (n in e)
      s.push(n);
    if (s.sort(), !Wd(r, s))
      return !1;
    for (t = 0; t < r.length; t++)
      if (!Wd(i[r[t]], e[r[t]]))
        return !1;
  }
  return !0;
}
var zh;
(function(i) {
  i[i.Left = 1] = "Left", i[i.Center = 2] = "Center", i[i.Right = 4] = "Right", i[i.Full = 7] = "Full";
})(zh || (zh = {}));
var fm;
(function(i) {
  i[i.Left = 1] = "Left", i[i.Center = 2] = "Center", i[i.Right = 3] = "Right";
})(fm || (fm = {}));
var Ph;
(function(i) {
  i[i.LTR = 0] = "LTR", i[i.RTL = 1] = "RTL";
})(Ph || (Ph = {}));
var Af;
(function(i) {
  i[i.Both = 0] = "Both", i[i.Right = 1] = "Right", i[i.Left = 2] = "Left", i[i.None = 3] = "None";
})(Af || (Af = {}));
class xW {
  get originalIndentSize() {
    return this._indentSizeIsTabSize ? "tabSize" : this.indentSize;
  }
  /**
   * @internal
   */
  constructor(e) {
    this._textModelResolvedOptionsBrand = void 0, this.tabSize = Math.max(1, e.tabSize | 0), e.indentSize === "tabSize" ? (this.indentSize = this.tabSize, this._indentSizeIsTabSize = !0) : (this.indentSize = Math.max(1, e.indentSize | 0), this._indentSizeIsTabSize = !1), this.insertSpaces = !!e.insertSpaces, this.defaultEOL = e.defaultEOL | 0, this.trimAutoWhitespace = !!e.trimAutoWhitespace, this.bracketPairColorizationOptions = e.bracketPairColorizationOptions;
  }
  /**
   * @internal
   */
  equals(e) {
    return this.tabSize === e.tabSize && this._indentSizeIsTabSize === e._indentSizeIsTabSize && this.indentSize === e.indentSize && this.insertSpaces === e.insertSpaces && this.defaultEOL === e.defaultEOL && this.trimAutoWhitespace === e.trimAutoWhitespace && Wd(this.bracketPairColorizationOptions, e.bracketPairColorizationOptions);
  }
  /**
   * @internal
   */
  createChangeEvent(e) {
    return {
      tabSize: this.tabSize !== e.tabSize,
      indentSize: this.indentSize !== e.indentSize,
      insertSpaces: this.insertSpaces !== e.insertSpaces,
      trimAutoWhitespace: this.trimAutoWhitespace !== e.trimAutoWhitespace
    };
  }
}
class l4 {
  /**
   * @internal
   */
  constructor(e, t) {
    this._findMatchBrand = void 0, this.range = e, this.matches = t;
  }
}
function est(i) {
  return i && typeof i.read == "function";
}
class $J {
  constructor(e, t, n, r, s, o) {
    this.identifier = e, this.range = t, this.text = n, this.forceMoveMarkers = r, this.isAutoWhitespaceEdit = s, this._isTracked = o;
  }
}
class tst {
  constructor(e, t, n) {
    this.regex = e, this.wordSeparators = t, this.simpleSearch = n;
  }
}
class nst {
  constructor(e, t, n) {
    this.reverseEdits = e, this.changes = t, this.trimAutoWhitespaceLineNumbers = n;
  }
}
function rFe(i) {
  return !i.isTooLargeForSyncing() && !i.isForSimpleWidget;
}
class $a {
  static addCursorDown(e, t, n) {
    const r = [];
    let s = 0;
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      r[s++] = new Di(l.modelState, l.viewState), n ? r[s++] = Di.fromModelState(Zi.translateDown(e.cursorConfig, e.model, l.modelState)) : r[s++] = Di.fromViewState(Zi.translateDown(e.cursorConfig, e, l.viewState));
    }
    return r;
  }
  static addCursorUp(e, t, n) {
    const r = [];
    let s = 0;
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      r[s++] = new Di(l.modelState, l.viewState), n ? r[s++] = Di.fromModelState(Zi.translateUp(e.cursorConfig, e.model, l.modelState)) : r[s++] = Di.fromViewState(Zi.translateUp(e.cursorConfig, e, l.viewState));
    }
    return r;
  }
  static moveToBeginningOfLine(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s];
      r[s] = this._moveToLineStart(e, a, n);
    }
    return r;
  }
  static _moveToLineStart(e, t, n) {
    const r = t.viewState.position.column, s = t.modelState.position.column, o = r === s, a = t.viewState.position.lineNumber, l = e.getLineFirstNonWhitespaceColumn(a);
    return !o && !(r === l) ? this._moveToLineStartByView(e, t, n) : this._moveToLineStartByModel(e, t, n);
  }
  static _moveToLineStartByView(e, t, n) {
    return Di.fromViewState(Zi.moveToBeginningOfLine(e.cursorConfig, e, t.viewState, n));
  }
  static _moveToLineStartByModel(e, t, n) {
    return Di.fromModelState(Zi.moveToBeginningOfLine(e.cursorConfig, e.model, t.modelState, n));
  }
  static moveToEndOfLine(e, t, n, r) {
    const s = [];
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      s[o] = this._moveToLineEnd(e, l, n, r);
    }
    return s;
  }
  static _moveToLineEnd(e, t, n, r) {
    const s = t.viewState.position, o = e.getLineMaxColumn(s.lineNumber), a = s.column === o, l = t.modelState.position, c = e.model.getLineMaxColumn(l.lineNumber), u = o - s.column === c - l.column;
    return a || u ? this._moveToLineEndByModel(e, t, n, r) : this._moveToLineEndByView(e, t, n, r);
  }
  static _moveToLineEndByView(e, t, n, r) {
    return Di.fromViewState(Zi.moveToEndOfLine(e.cursorConfig, e, t.viewState, n, r));
  }
  static _moveToLineEndByModel(e, t, n, r) {
    return Di.fromModelState(Zi.moveToEndOfLine(e.cursorConfig, e.model, t.modelState, n, r));
  }
  static expandLineSelection(e, t) {
    const n = [];
    for (let r = 0, s = t.length; r < s; r++) {
      const o = t[r], a = o.modelState.selection.startLineNumber, l = e.model.getLineCount();
      let c = o.modelState.selection.endLineNumber, u;
      c === l ? u = e.model.getLineMaxColumn(l) : (c++, u = 1), n[r] = Di.fromModelState(new ja(new z(a, 1, a, 1), 0, 0, new de(c, u), 0));
    }
    return n;
  }
  static moveToBeginningOfBuffer(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s];
      r[s] = Di.fromModelState(Zi.moveToBeginningOfBuffer(e.cursorConfig, e.model, a.modelState, n));
    }
    return r;
  }
  static moveToEndOfBuffer(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s];
      r[s] = Di.fromModelState(Zi.moveToEndOfBuffer(e.cursorConfig, e.model, a.modelState, n));
    }
    return r;
  }
  static selectAll(e, t) {
    const n = e.model.getLineCount(), r = e.model.getLineMaxColumn(n);
    return Di.fromModelState(new ja(new z(1, 1, 1, 1), 0, 0, new de(n, r), 0));
  }
  static line(e, t, n, r, s) {
    const o = e.model.validatePosition(r), a = s ? e.coordinatesConverter.validateViewPosition(new de(s.lineNumber, s.column), o) : e.coordinatesConverter.convertModelPositionToViewPosition(o);
    if (!n) {
      const c = e.model.getLineCount();
      let u = o.lineNumber + 1, d = 1;
      return u > c && (u = c, d = e.model.getLineMaxColumn(u)), Di.fromModelState(new ja(new z(o.lineNumber, 1, u, d), 2, 0, new de(u, d), 0));
    }
    const l = t.modelState.selectionStart.getStartPosition().lineNumber;
    if (o.lineNumber < l)
      return Di.fromViewState(t.viewState.move(!0, a.lineNumber, 1, 0));
    if (o.lineNumber > l) {
      const c = e.getLineCount();
      let u = a.lineNumber + 1, d = 1;
      return u > c && (u = c, d = e.getLineMaxColumn(u)), Di.fromViewState(t.viewState.move(!0, u, d, 0));
    } else {
      const c = t.modelState.selectionStart.getEndPosition();
      return Di.fromModelState(t.modelState.move(!0, c.lineNumber, c.column, 0));
    }
  }
  static word(e, t, n, r) {
    const s = e.model.validatePosition(r);
    return Di.fromModelState(Qi.word(e.cursorConfig, e.model, t.modelState, n, s));
  }
  static cancelSelection(e, t) {
    if (!t.modelState.hasSelection())
      return new Di(t.modelState, t.viewState);
    const n = t.viewState.position.lineNumber, r = t.viewState.position.column;
    return Di.fromViewState(new ja(new z(n, r, n, r), 0, 0, new de(n, r), 0));
  }
  static moveTo(e, t, n, r, s) {
    if (n) {
      if (t.modelState.selectionStartKind === 1)
        return this.word(e, t, n, r);
      if (t.modelState.selectionStartKind === 2)
        return this.line(e, t, n, r, s);
    }
    const o = e.model.validatePosition(r), a = s ? e.coordinatesConverter.validateViewPosition(new de(s.lineNumber, s.column), o) : e.coordinatesConverter.convertModelPositionToViewPosition(o);
    return Di.fromViewState(t.viewState.move(n, a.lineNumber, a.column, 0));
  }
  static simpleMove(e, t, n, r, s, o) {
    switch (n) {
      case 0:
        return o === 4 ? this._moveHalfLineLeft(e, t, r) : this._moveLeft(e, t, r, s);
      case 1:
        return o === 4 ? this._moveHalfLineRight(e, t, r) : this._moveRight(e, t, r, s);
      case 2:
        return o === 2 ? this._moveUpByViewLines(e, t, r, s) : this._moveUpByModelLines(e, t, r, s);
      case 3:
        return o === 2 ? this._moveDownByViewLines(e, t, r, s) : this._moveDownByModelLines(e, t, r, s);
      case 4:
        return o === 2 ? t.map((a) => Di.fromViewState(Zi.moveToPrevBlankLine(e.cursorConfig, e, a.viewState, r))) : t.map((a) => Di.fromModelState(Zi.moveToPrevBlankLine(e.cursorConfig, e.model, a.modelState, r)));
      case 5:
        return o === 2 ? t.map((a) => Di.fromViewState(Zi.moveToNextBlankLine(e.cursorConfig, e, a.viewState, r))) : t.map((a) => Di.fromModelState(Zi.moveToNextBlankLine(e.cursorConfig, e.model, a.modelState, r)));
      case 6:
        return this._moveToViewMinColumn(e, t, r);
      case 7:
        return this._moveToViewFirstNonWhitespaceColumn(e, t, r);
      case 8:
        return this._moveToViewCenterColumn(e, t, r);
      case 9:
        return this._moveToViewMaxColumn(e, t, r);
      case 10:
        return this._moveToViewLastNonWhitespaceColumn(e, t, r);
      default:
        return null;
    }
  }
  static viewportMove(e, t, n, r, s) {
    const o = e.getCompletelyVisibleViewRange(), a = e.coordinatesConverter.convertViewRangeToModelRange(o);
    switch (n) {
      case 11: {
        const l = this._firstLineNumberInRange(e.model, a, s), c = e.model.getLineFirstNonWhitespaceColumn(l);
        return [this._moveToModelPosition(e, t[0], r, l, c)];
      }
      case 13: {
        const l = this._lastLineNumberInRange(e.model, a, s), c = e.model.getLineFirstNonWhitespaceColumn(l);
        return [this._moveToModelPosition(e, t[0], r, l, c)];
      }
      case 12: {
        const l = Math.round((a.startLineNumber + a.endLineNumber) / 2), c = e.model.getLineFirstNonWhitespaceColumn(l);
        return [this._moveToModelPosition(e, t[0], r, l, c)];
      }
      case 14: {
        const l = [];
        for (let c = 0, u = t.length; c < u; c++) {
          const d = t[c];
          l[c] = this.findPositionInViewportIfOutside(e, d, o, r);
        }
        return l;
      }
      default:
        return null;
    }
  }
  static findPositionInViewportIfOutside(e, t, n, r) {
    const s = t.viewState.position.lineNumber;
    if (n.startLineNumber <= s && s <= n.endLineNumber - 1)
      return new Di(t.modelState, t.viewState);
    {
      let o;
      s > n.endLineNumber - 1 ? o = n.endLineNumber - 1 : s < n.startLineNumber ? o = n.startLineNumber : o = s;
      const a = Zi.vertical(e.cursorConfig, e, s, t.viewState.position.column, t.viewState.leftoverVisibleColumns, o, !1);
      return Di.fromViewState(t.viewState.move(r, a.lineNumber, a.column, a.leftoverVisibleColumns));
    }
  }
  /**
   * Find the nth line start included in the range (from the start).
   */
  static _firstLineNumberInRange(e, t, n) {
    let r = t.startLineNumber;
    return t.startColumn !== e.getLineMinColumn(r) && r++, Math.min(t.endLineNumber, r + n - 1);
  }
  /**
   * Find the nth line start included in the range (from the end).
   */
  static _lastLineNumberInRange(e, t, n) {
    let r = t.startLineNumber;
    return t.startColumn !== e.getLineMinColumn(r) && r++, Math.max(r, t.endLineNumber - n + 1);
  }
  static _moveLeft(e, t, n, r) {
    return t.map((s) => {
      const a = e.getTextDirection(s.viewState.position.lineNumber) === Ph.RTL;
      return Di.fromViewState(a ? Zi.moveRight(e.cursorConfig, e, s.viewState, n, r) : Zi.moveLeft(e.cursorConfig, e, s.viewState, n, r));
    });
  }
  static _moveHalfLineLeft(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.viewState.position.lineNumber, c = Math.round(e.getLineLength(l) / 2);
      r[s] = Di.fromViewState(Zi.moveLeft(e.cursorConfig, e, a.viewState, n, c));
    }
    return r;
  }
  static _moveRight(e, t, n, r) {
    return t.map((s) => {
      const a = e.getTextDirection(s.viewState.position.lineNumber) === Ph.RTL;
      return Di.fromViewState(a ? Zi.moveLeft(e.cursorConfig, e, s.viewState, n, r) : Zi.moveRight(e.cursorConfig, e, s.viewState, n, r));
    });
  }
  static _moveHalfLineRight(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.viewState.position.lineNumber, c = Math.round(e.getLineLength(l) / 2);
      r[s] = Di.fromViewState(Zi.moveRight(e.cursorConfig, e, a.viewState, n, c));
    }
    return r;
  }
  static _moveDownByViewLines(e, t, n, r) {
    const s = [];
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      s[o] = Di.fromViewState(Zi.moveDown(e.cursorConfig, e, l.viewState, n, r));
    }
    return s;
  }
  static _moveDownByModelLines(e, t, n, r) {
    const s = [];
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      s[o] = Di.fromModelState(Zi.moveDown(e.cursorConfig, e.model, l.modelState, n, r));
    }
    return s;
  }
  static _moveUpByViewLines(e, t, n, r) {
    const s = [];
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      s[o] = Di.fromViewState(Zi.moveUp(e.cursorConfig, e, l.viewState, n, r));
    }
    return s;
  }
  static _moveUpByModelLines(e, t, n, r) {
    const s = [];
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      s[o] = Di.fromModelState(Zi.moveUp(e.cursorConfig, e.model, l.modelState, n, r));
    }
    return s;
  }
  static _moveToViewPosition(e, t, n, r, s) {
    return Di.fromViewState(t.viewState.move(n, r, s, 0));
  }
  static _moveToModelPosition(e, t, n, r, s) {
    return Di.fromModelState(t.modelState.move(n, r, s, 0));
  }
  static _moveToViewMinColumn(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.viewState.position.lineNumber, c = e.getLineMinColumn(l);
      r[s] = this._moveToViewPosition(e, a, n, l, c);
    }
    return r;
  }
  static _moveToViewFirstNonWhitespaceColumn(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.viewState.position.lineNumber, c = e.getLineFirstNonWhitespaceColumn(l);
      r[s] = this._moveToViewPosition(e, a, n, l, c);
    }
    return r;
  }
  static _moveToViewCenterColumn(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.viewState.position.lineNumber, c = Math.round((e.getLineMaxColumn(l) + e.getLineMinColumn(l)) / 2);
      r[s] = this._moveToViewPosition(e, a, n, l, c);
    }
    return r;
  }
  static _moveToViewMaxColumn(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.viewState.position.lineNumber, c = e.getLineMaxColumn(l);
      r[s] = this._moveToViewPosition(e, a, n, l, c);
    }
    return r;
  }
  static _moveToViewLastNonWhitespaceColumn(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.viewState.position.lineNumber, c = e.getLineLastNonWhitespaceColumn(l);
      r[s] = this._moveToViewPosition(e, a, n, l, c);
    }
    return r;
  }
}
var zV;
(function(i) {
  const e = function(n) {
    if (!Ra(n))
      return !1;
    const r = n;
    return !(!ga(r.to) || !Ec(r.select) && !AMe(r.select) || !Ec(r.by) && !ga(r.by) || !Ec(r.value) && !zy(r.value));
  };
  i.metadata = {
    description: "Move cursor to a logical position in the view",
    args: [
      {
        name: "Cursor move argument object",
        description: `Property-value pairs that can be passed through this argument:
					* 'to': A mandatory logical position value providing where to move the cursor.
						\`\`\`
						'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
						'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
						'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
						'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
						\`\`\`
					* 'by': Unit to move. Default is computed based on 'to' value.
						\`\`\`
						'line', 'wrappedLine', 'character', 'halfLine'
						\`\`\`
					* 'value': Number of units to move. Default is '1'.
					* 'select': If 'true' makes the selection. Default is 'false'.
				`,
        constraint: e,
        schema: {
          type: "object",
          required: ["to"],
          properties: {
            to: {
              type: "string",
              enum: ["left", "right", "up", "down", "prevBlankLine", "nextBlankLine", "wrappedLineStart", "wrappedLineEnd", "wrappedLineColumnCenter", "wrappedLineFirstNonWhitespaceCharacter", "wrappedLineLastNonWhitespaceCharacter", "viewPortTop", "viewPortCenter", "viewPortBottom", "viewPortIfOutside"]
            },
            by: {
              type: "string",
              enum: ["line", "wrappedLine", "character", "halfLine"]
            },
            value: {
              type: "number",
              default: 1
            },
            select: {
              type: "boolean",
              default: !1
            }
          }
        }
      }
    ]
  }, i.RawDirection = {
    Left: "left",
    Right: "right",
    Up: "up",
    Down: "down",
    PrevBlankLine: "prevBlankLine",
    NextBlankLine: "nextBlankLine",
    WrappedLineStart: "wrappedLineStart",
    WrappedLineFirstNonWhitespaceCharacter: "wrappedLineFirstNonWhitespaceCharacter",
    WrappedLineColumnCenter: "wrappedLineColumnCenter",
    WrappedLineEnd: "wrappedLineEnd",
    WrappedLineLastNonWhitespaceCharacter: "wrappedLineLastNonWhitespaceCharacter",
    ViewPortTop: "viewPortTop",
    ViewPortCenter: "viewPortCenter",
    ViewPortBottom: "viewPortBottom",
    ViewPortIfOutside: "viewPortIfOutside"
  }, i.RawUnit = {
    Line: "line",
    WrappedLine: "wrappedLine",
    Character: "character",
    HalfLine: "halfLine"
  };
  function t(n) {
    if (!n.to)
      return null;
    let r;
    switch (n.to) {
      case i.RawDirection.Left:
        r = 0;
        break;
      case i.RawDirection.Right:
        r = 1;
        break;
      case i.RawDirection.Up:
        r = 2;
        break;
      case i.RawDirection.Down:
        r = 3;
        break;
      case i.RawDirection.PrevBlankLine:
        r = 4;
        break;
      case i.RawDirection.NextBlankLine:
        r = 5;
        break;
      case i.RawDirection.WrappedLineStart:
        r = 6;
        break;
      case i.RawDirection.WrappedLineFirstNonWhitespaceCharacter:
        r = 7;
        break;
      case i.RawDirection.WrappedLineColumnCenter:
        r = 8;
        break;
      case i.RawDirection.WrappedLineEnd:
        r = 9;
        break;
      case i.RawDirection.WrappedLineLastNonWhitespaceCharacter:
        r = 10;
        break;
      case i.RawDirection.ViewPortTop:
        r = 11;
        break;
      case i.RawDirection.ViewPortBottom:
        r = 13;
        break;
      case i.RawDirection.ViewPortCenter:
        r = 12;
        break;
      case i.RawDirection.ViewPortIfOutside:
        r = 14;
        break;
      default:
        return null;
    }
    let s = 0;
    switch (n.by) {
      case i.RawUnit.Line:
        s = 1;
        break;
      case i.RawUnit.WrappedLine:
        s = 2;
        break;
      case i.RawUnit.Character:
        s = 3;
        break;
      case i.RawUnit.HalfLine:
        s = 4;
        break;
    }
    return {
      direction: r,
      unit: s,
      select: !!n.select,
      value: n.value || 1
    };
  }
  i.parse = t;
})(zV || (zV = {}));
var Vo;
(function(i) {
  i[i.None = 0] = "None", i[i.Indent = 1] = "Indent", i[i.IndentOutdent = 2] = "IndentOutdent", i[i.Outdent = 3] = "Outdent";
})(Vo || (Vo = {}));
class jJ {
  constructor(e) {
    if (this._neutralCharacter = null, this._neutralCharacterSearched = !1, this.open = e.open, this.close = e.close, this._inString = !0, this._inComment = !0, this._inRegEx = !0, Array.isArray(e.notIn))
      for (let t = 0, n = e.notIn.length; t < n; t++)
        switch (e.notIn[t]) {
          case "string":
            this._inString = !1;
            break;
          case "comment":
            this._inComment = !1;
            break;
          case "regex":
            this._inRegEx = !1;
            break;
        }
  }
  isOK(e) {
    switch (e) {
      case 0:
        return !0;
      case 1:
        return this._inComment;
      case 2:
        return this._inString;
      case 3:
        return this._inRegEx;
    }
  }
  shouldAutoClose(e, t) {
    if (e.getTokenCount() === 0)
      return !0;
    const n = e.findTokenIndexAtOffset(t - 2), r = e.getStandardTokenType(n);
    return this.isOK(r);
  }
  _findNeutralCharacterInRange(e, t) {
    for (let n = e; n <= t; n++) {
      const r = String.fromCharCode(n);
      if (!this.open.includes(r) && !this.close.includes(r))
        return r;
    }
    return null;
  }
  /**
   * Find a character in the range [0-9a-zA-Z] that does not appear in the open or close
   */
  findNeutralCharacter() {
    return this._neutralCharacterSearched || (this._neutralCharacterSearched = !0, this._neutralCharacter || (this._neutralCharacter = this._findNeutralCharacterInRange(
      48,
      57
      /* CharCode.Digit9 */
    )), this._neutralCharacter || (this._neutralCharacter = this._findNeutralCharacterInRange(
      97,
      122
      /* CharCode.z */
    )), this._neutralCharacter || (this._neutralCharacter = this._findNeutralCharacterInRange(
      65,
      90
      /* CharCode.Z */
    ))), this._neutralCharacter;
  }
}
class ist {
  constructor(e) {
    this.autoClosingPairsOpenByStart = /* @__PURE__ */ new Map(), this.autoClosingPairsOpenByEnd = /* @__PURE__ */ new Map(), this.autoClosingPairsCloseByStart = /* @__PURE__ */ new Map(), this.autoClosingPairsCloseByEnd = /* @__PURE__ */ new Map(), this.autoClosingPairsCloseSingleChar = /* @__PURE__ */ new Map();
    for (const t of e)
      WM(this.autoClosingPairsOpenByStart, t.open.charAt(0), t), WM(this.autoClosingPairsOpenByEnd, t.open.charAt(t.open.length - 1), t), WM(this.autoClosingPairsCloseByStart, t.close.charAt(0), t), WM(this.autoClosingPairsCloseByEnd, t.close.charAt(t.close.length - 1), t), t.close.length === 1 && t.open.length === 1 && WM(this.autoClosingPairsCloseSingleChar, t.close, t);
  }
}
function WM(i, e, t) {
  i.has(e) ? i.get(e).push(t) : i.set(e, [t]);
}
const $V = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";
function rst(i = "") {
  let e = "(-?\\d*\\.\\d\\w*)|([^";
  for (const t of $V)
    i.indexOf(t) >= 0 || (e += "\\" + t);
  return e += "\\s]+)", new RegExp(e, "g");
}
const sfe = rst();
function ofe(i) {
  let e = sfe;
  if (i && i instanceof RegExp)
    if (i.global)
      e = i;
    else {
      let t = "g";
      i.ignoreCase && (t += "i"), i.multiline && (t += "m"), i.unicode && (t += "u"), e = new RegExp(i.source, t);
    }
  return e.lastIndex = 0, e;
}
const sFe = new xc();
sFe.unshift({
  maxLen: 1e3,
  windowSize: 15,
  timeBudget: 150
});
function c4(i, e, t, n, r) {
  if (e = ofe(e), r || (r = gi.first(sFe)), t.length > r.maxLen) {
    let c = i - r.maxLen / 2;
    return c < 0 ? c = 0 : n += c, t = t.substring(c, i + r.maxLen / 2), c4(i, e, t, n, r);
  }
  const s = Date.now(), o = i - 1 - n;
  let a = -1, l = null;
  for (let c = 1; !(Date.now() - s >= r.timeBudget); c++) {
    const u = o - r.windowSize * c;
    e.lastIndex = Math.max(0, u);
    const d = sst(e, t, o, a);
    if (!d && l || (l = d, u <= 0))
      break;
    a = u;
  }
  if (l) {
    const c = {
      word: l[0],
      startColumn: n + 1 + l.index,
      endColumn: n + 1 + l.index + l[0].length
    };
    return e.lastIndex = 0, c;
  }
  return null;
}
function sst(i, e, t, n) {
  let r;
  for (; r = i.exec(e); ) {
    const s = r.index || 0;
    if (s <= t && i.lastIndex >= t)
      return r;
    if (n > 0 && s > n)
      return null;
  }
  return null;
}
const NN = class NN {
  constructor(e) {
    if (e.autoClosingPairs ? this._autoClosingPairs = e.autoClosingPairs.map((t) => new jJ(t)) : e.brackets ? this._autoClosingPairs = e.brackets.map((t) => new jJ({ open: t[0], close: t[1] })) : this._autoClosingPairs = [], e.__electricCharacterSupport && e.__electricCharacterSupport.docComment) {
      const t = e.__electricCharacterSupport.docComment;
      this._autoClosingPairs.push(new jJ({ open: t.open, close: t.close || "" }));
    }
    this._autoCloseBeforeForQuotes = typeof e.autoCloseBefore == "string" ? e.autoCloseBefore : NN.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES, this._autoCloseBeforeForBrackets = typeof e.autoCloseBefore == "string" ? e.autoCloseBefore : NN.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS, this._surroundingPairs = e.surroundingPairs || this._autoClosingPairs;
  }
  getAutoClosingPairs() {
    return this._autoClosingPairs;
  }
  getAutoCloseBeforeSet(e) {
    return e ? this._autoCloseBeforeForQuotes : this._autoCloseBeforeForBrackets;
  }
  getSurroundingPairs() {
    return this._surroundingPairs;
  }
};
NN.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES = `;:.,=}])> 
	`, NN.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS = `'"\`;:.,=}])> 
	`;
let kie = NN, GJ;
function oFe() {
  return GJ || (GJ = new TextDecoder("UTF-16LE")), GJ;
}
let qJ;
function ost() {
  return qJ || (qJ = new TextDecoder("UTF-16BE")), qJ;
}
let KJ;
function aFe() {
  return KJ || (KJ = FMe() ? oFe() : ost()), KJ;
}
function ast(i, e, t) {
  const n = new Uint16Array(i.buffer, e, t);
  return t > 0 && (n[0] === 65279 || n[0] === 65534) ? lst(i, e, t) : oFe().decode(n);
}
function lst(i, e, t) {
  const n = [];
  let r = 0;
  for (let s = 0; s < t; s++) {
    const o = Unt(i, e);
    e += 2, n[r++] = String.fromCharCode(o);
  }
  return n.join("");
}
class ww {
  constructor(e) {
    this._capacity = e | 0, this._buffer = new Uint16Array(this._capacity), this._completedStrings = null, this._bufferLength = 0;
  }
  reset() {
    this._completedStrings = null, this._bufferLength = 0;
  }
  build() {
    return this._completedStrings !== null ? (this._flushBuffer(), this._completedStrings.join("")) : this._buildBuffer();
  }
  _buildBuffer() {
    if (this._bufferLength === 0)
      return "";
    const e = new Uint16Array(this._buffer.buffer, 0, this._bufferLength);
    return aFe().decode(e);
  }
  _flushBuffer() {
    const e = this._buildBuffer();
    this._bufferLength = 0, this._completedStrings === null ? this._completedStrings = [e] : this._completedStrings[this._completedStrings.length] = e;
  }
  /**
   * Append a char code (<2^16)
   */
  appendCharCode(e) {
    const t = this._capacity - this._bufferLength;
    t <= 1 && (t === 0 || Qo(e)) && this._flushBuffer(), this._buffer[this._bufferLength++] = e;
  }
  /**
   * Append an ASCII char code (<2^8)
   */
  appendASCIICharCode(e) {
    this._bufferLength === this._capacity && this._flushBuffer(), this._buffer[this._bufferLength++] = e;
  }
  appendString(e) {
    const t = e.length;
    if (this._bufferLength + t >= this._capacity) {
      this._flushBuffer(), this._completedStrings[this._completedStrings.length] = e;
      return;
    }
    for (let n = 0; n < t; n++)
      this._buffer[this._bufferLength++] = e.charCodeAt(n);
  }
}
class jV {
  constructor(e, t, n, r, s, o) {
    this._richEditBracketBrand = void 0, this.languageId = e, this.index = t, this.open = n, this.close = r, this.forwardRegex = s, this.reversedRegex = o, this._openSet = jV._toSet(this.open), this._closeSet = jV._toSet(this.close);
  }
  /**
   * Check if the provided `text` is an open bracket in this group.
   */
  isOpen(e) {
    return this._openSet.has(e);
  }
  /**
   * Check if the provided `text` is a close bracket in this group.
   */
  isClose(e) {
    return this._closeSet.has(e);
  }
  static _toSet(e) {
    const t = /* @__PURE__ */ new Set();
    for (const n of e)
      t.add(n);
    return t;
  }
}
function cst(i) {
  const e = i.length;
  i = i.map((o) => [o[0].toLowerCase(), o[1].toLowerCase()]);
  const t = [];
  for (let o = 0; o < e; o++)
    t[o] = o;
  const n = (o, a) => {
    const [l, c] = o, [u, d] = a;
    return l === u || l === d || c === u || c === d;
  }, r = (o, a) => {
    const l = Math.min(o, a), c = Math.max(o, a);
    for (let u = 0; u < e; u++)
      t[u] === c && (t[u] = l);
  };
  for (let o = 0; o < e; o++) {
    const a = i[o];
    for (let l = o + 1; l < e; l++) {
      const c = i[l];
      n(a, c) && r(t[o], t[l]);
    }
  }
  const s = [];
  for (let o = 0; o < e; o++) {
    const a = [], l = [];
    for (let c = 0; c < e; c++)
      if (t[c] === o) {
        const [u, d] = i[c];
        a.push(u), l.push(d);
      }
    a.length > 0 && s.push({
      open: a,
      close: l
    });
  }
  return s;
}
class ust {
  constructor(e, t) {
    this._richEditBracketsBrand = void 0;
    const n = cst(t);
    this.brackets = n.map((r, s) => new jV(e, s, r.open, r.close, dst(r.open, r.close, n, s), hst(r.open, r.close, n, s))), this.forwardRegex = fst(this.brackets), this.reversedRegex = gst(this.brackets), this.textIsBracket = {}, this.textIsOpenBracket = {}, this.maxBracketLength = 0;
    for (const r of this.brackets) {
      for (const s of r.open)
        this.textIsBracket[s] = r, this.textIsOpenBracket[s] = !0, this.maxBracketLength = Math.max(this.maxBracketLength, s.length);
      for (const s of r.close)
        this.textIsBracket[s] = r, this.textIsOpenBracket[s] = !1, this.maxBracketLength = Math.max(this.maxBracketLength, s.length);
    }
  }
}
function lFe(i, e, t, n) {
  for (let r = 0, s = e.length; r < s; r++) {
    if (r === t)
      continue;
    const o = e[r];
    for (const a of o.open)
      a.indexOf(i) >= 0 && n.push(a);
    for (const a of o.close)
      a.indexOf(i) >= 0 && n.push(a);
  }
}
function cFe(i, e) {
  return i.length - e.length;
}
function Fq(i) {
  if (i.length <= 1)
    return i;
  const e = [], t = /* @__PURE__ */ new Set();
  for (const n of i)
    t.has(n) || (e.push(n), t.add(n));
  return e;
}
function dst(i, e, t, n) {
  let r = [];
  r = r.concat(i), r = r.concat(e);
  for (let s = 0, o = r.length; s < o; s++)
    lFe(r[s], t, n, r);
  return r = Fq(r), r.sort(cFe), r.reverse(), wB(r);
}
function hst(i, e, t, n) {
  let r = [];
  r = r.concat(i), r = r.concat(e);
  for (let s = 0, o = r.length; s < o; s++)
    lFe(r[s], t, n, r);
  return r = Fq(r), r.sort(cFe), r.reverse(), wB(r.map(afe));
}
function fst(i) {
  let e = [];
  for (const t of i) {
    for (const n of t.open)
      e.push(n);
    for (const n of t.close)
      e.push(n);
  }
  return e = Fq(e), wB(e);
}
function gst(i) {
  let e = [];
  for (const t of i) {
    for (const n of t.open)
      e.push(n);
    for (const n of t.close)
      e.push(n);
  }
  return e = Fq(e), wB(e.map(afe));
}
function pst(i) {
  const e = /^[\w ]+$/.test(i);
  return i = zd(i), e ? `\\b${i}\\b` : i;
}
function wB(i, e) {
  const t = `(${i.map(pst).join(")|(")})`;
  return YMe(t, !0, e);
}
const afe = /* @__PURE__ */ (function() {
  function i(n) {
    const r = new Uint16Array(n.length);
    let s = 0;
    for (let o = n.length - 1; o >= 0; o--)
      r[s++] = n.charCodeAt(o);
    return aFe().decode(r);
  }
  let e = null, t = null;
  return function(r) {
    return e !== r && (e = r, t = i(e)), t;
  };
})();
class Lg {
  static _findPrevBracketInText(e, t, n, r) {
    const s = n.match(e);
    if (!s)
      return null;
    const o = n.length - (s.index || 0), a = s[0].length, l = r + o;
    return new z(t, l - a + 1, t, l + 1);
  }
  static findPrevBracketInRange(e, t, n, r, s) {
    const a = afe(n).substring(n.length - s, n.length - r);
    return this._findPrevBracketInText(e, t, a, r);
  }
  static findNextBracketInText(e, t, n, r) {
    const s = n.match(e);
    if (!s)
      return null;
    const o = s.index || 0, a = s[0].length;
    if (a === 0)
      return null;
    const l = r + o;
    return new z(t, l + 1, t, l + 1 + a);
  }
  static findNextBracketInRange(e, t, n, r, s) {
    const o = n.substring(r, s);
    return this.findNextBracketInText(e, t, o, r);
  }
}
class mst {
  constructor(e) {
    this._richEditBrackets = e;
  }
  getElectricCharacters() {
    const e = [];
    if (this._richEditBrackets)
      for (const t of this._richEditBrackets.brackets)
        for (const n of t.close) {
          const r = n.charAt(n.length - 1);
          e.push(r);
        }
    return qy(e);
  }
  onElectricCharacter(e, t, n) {
    if (!this._richEditBrackets || this._richEditBrackets.brackets.length === 0)
      return null;
    const r = t.findTokenIndexAtOffset(n - 1);
    if (y_(t.getStandardTokenType(r)))
      return null;
    const s = this._richEditBrackets.reversedRegex, o = t.getLineContent().substring(0, n - 1) + e, a = Lg.findPrevBracketInRange(s, 1, o, 0, o.length);
    if (!a)
      return null;
    const l = o.substring(a.startColumn - 1, a.endColumn - 1).toLowerCase();
    if (this._richEditBrackets.textIsOpenBracket[l])
      return null;
    const u = t.getActualLineContentBefore(a.startColumn - 1);
    return /^\s*$/.test(u) ? {
      matchOpenBracket: l
    } : null;
  }
}
function A7(i) {
  return i.global && (i.lastIndex = 0), !0;
}
class _st {
  constructor(e) {
    this._indentationRules = e;
  }
  shouldIncrease(e) {
    return !!(this._indentationRules && this._indentationRules.increaseIndentPattern && A7(this._indentationRules.increaseIndentPattern) && this._indentationRules.increaseIndentPattern.test(e));
  }
  shouldDecrease(e) {
    return !!(this._indentationRules && this._indentationRules.decreaseIndentPattern && A7(this._indentationRules.decreaseIndentPattern) && this._indentationRules.decreaseIndentPattern.test(e));
  }
  shouldIndentNextLine(e) {
    return !!(this._indentationRules && this._indentationRules.indentNextLinePattern && A7(this._indentationRules.indentNextLinePattern) && this._indentationRules.indentNextLinePattern.test(e));
  }
  shouldIgnore(e) {
    return !!(this._indentationRules && this._indentationRules.unIndentedLinePattern && A7(this._indentationRules.unIndentedLinePattern) && this._indentationRules.unIndentedLinePattern.test(e));
  }
  getIndentMetadata(e) {
    let t = 0;
    return this.shouldIncrease(e) && (t += 1), this.shouldDecrease(e) && (t += 2), this.shouldIndentNextLine(e) && (t += 4), this.shouldIgnore(e) && (t += 8), t;
  }
}
class iN {
  constructor(e) {
    e = e || {}, e.brackets = e.brackets || [
      ["(", ")"],
      ["{", "}"],
      ["[", "]"]
    ], this._brackets = [], e.brackets.forEach((t) => {
      const n = iN._createOpenBracketRegExp(t[0]), r = iN._createCloseBracketRegExp(t[1]);
      n && r && this._brackets.push({
        open: t[0],
        openRegExp: n,
        close: t[1],
        closeRegExp: r
      });
    }), this._regExpRules = e.onEnterRules || [];
  }
  onEnter(e, t, n, r) {
    if (e >= 3)
      for (let s = 0, o = this._regExpRules.length; s < o; s++) {
        const a = this._regExpRules[s];
        if ([{
          reg: a.beforeText,
          text: n
        }, {
          reg: a.afterText,
          text: r
        }, {
          reg: a.previousLineText,
          text: t
        }].every((c) => c.reg ? (c.reg.lastIndex = 0, c.reg.test(c.text)) : !0))
          return a.action;
      }
    if (e >= 2 && n.length > 0 && r.length > 0)
      for (let s = 0, o = this._brackets.length; s < o; s++) {
        const a = this._brackets[s];
        if (a.openRegExp.test(n) && a.closeRegExp.test(r))
          return { indentAction: Vo.IndentOutdent };
      }
    if (e >= 2 && n.length > 0) {
      for (let s = 0, o = this._brackets.length; s < o; s++)
        if (this._brackets[s].openRegExp.test(n))
          return { indentAction: Vo.Indent };
    }
    return null;
  }
  static _createOpenBracketRegExp(e) {
    let t = zd(e);
    return /\B/.test(t.charAt(0)) || (t = "\\b" + t), t += "\\s*$", iN._safeRegExp(t);
  }
  static _createCloseBracketRegExp(e) {
    let t = zd(e);
    return /\B/.test(t.charAt(t.length - 1)) || (t = t + "\\b"), t = "^\\s*" + t, iN._safeRegExp(t);
  }
  static _safeRegExp(e) {
    try {
      return new RegExp(e);
    } catch (t) {
      return fn(t), null;
    }
  }
}
const xn = Vn("configurationService");
function Die(i, e) {
  const t = /* @__PURE__ */ Object.create(null);
  for (const n in i)
    uFe(t, n, i[n], e);
  return t;
}
function uFe(i, e, t, n) {
  const r = e.split("."), s = r.pop();
  let o = i;
  for (let a = 0; a < r.length; a++) {
    const l = r[a];
    let c = o[l];
    switch (typeof c) {
      case "undefined":
        c = o[l] = /* @__PURE__ */ Object.create(null);
        break;
      case "object":
        if (c === null) {
          n(`Ignoring ${e} as ${r.slice(0, a + 1).join(".")} is null`);
          return;
        }
        break;
      default:
        n(`Ignoring ${e} as ${r.slice(0, a + 1).join(".")} is ${JSON.stringify(c)}`);
        return;
    }
    o = c;
  }
  if (typeof o == "object" && o !== null)
    try {
      o[s] = t;
    } catch {
      n(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(o)}`);
    }
  else
    n(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(o)}`);
}
function bst(i, e) {
  const t = e.split(".");
  dFe(i, t);
}
function dFe(i, e) {
  if (!i)
    return;
  const t = e.shift();
  if (e.length === 0) {
    delete i[t];
    return;
  }
  if (Object.keys(i).indexOf(t) !== -1) {
    const n = i[t];
    typeof n == "object" && !Array.isArray(n) && (dFe(n, e), Object.keys(n).length === 0 && delete i[t]);
  }
}
function sLe(i, e, t) {
  function n(o, a) {
    let l = o;
    for (const c of a) {
      if (typeof l != "object" || l === null)
        return;
      l = l[c];
    }
    return l;
  }
  const r = e.split("."), s = n(i, r);
  return typeof s > "u" ? t : s;
}
function vst(i) {
  return i.replace(/^\[/, "").replace(/]$/g, "").replace(/\]\[/g, ", ");
}
const Gr = Vn("languageService");
class V_ {
  constructor(e, t = [], n = !1) {
    this.ctor = e, this.staticArguments = t, this.supportsDelayedInstantiation = n;
  }
}
const hFe = [];
function ni(i, e, t) {
  e instanceof V_ || (e = new V_(e, [], !!t)), hFe.push([i, e]);
}
function oLe() {
  return hFe;
}
const co = Object.freeze({
  text: "text/plain",
  binary: "application/octet-stream",
  unknown: "application/unknown",
  markdown: "text/markdown",
  latex: "text/latex",
  uriList: "text/uri-list",
  html: "text/html"
}), Bq = {
  JSONContribution: "base.contributions.json"
};
function yst(i) {
  return i.length > 0 && i.charAt(i.length - 1) === "#" ? i.substring(0, i.length - 1) : i;
}
class Cst extends ge {
  constructor() {
    super(...arguments), this.schemasById = {}, this._onDidChangeSchema = this._register(new he());
  }
  registerSchema(e, t, n) {
    const r = yst(e);
    this.schemasById[r] = t, this._onDidChangeSchema.fire(e), n && n.add(Et(() => {
      delete this.schemasById[r], this._onDidChangeSchema.fire(e);
    }));
  }
  notifySchemaChanged(e) {
    this._onDidChangeSchema.fire(e);
  }
}
const wst = new Cst();
Fs.add(Bq.JSONContribution, wst);
const Cm = {
  Configuration: "base.contributions.configuration"
}, O7 = "vscode://schemas/settings/resourceLanguage", aLe = Fs.as(Bq.JSONContribution);
class Sst extends ge {
  constructor() {
    super(), this.registeredConfigurationDefaults = [], this.overrideIdentifiers = /* @__PURE__ */ new Set(), this._onDidSchemaChange = this._register(new he()), this._onDidUpdateConfiguration = this._register(new he()), this.configurationDefaultsOverrides = /* @__PURE__ */ new Map(), this.defaultLanguageConfigurationOverridesNode = {
      id: "defaultOverrides",
      title: S(1649, "Default Language Configuration Overrides"),
      properties: {}
    }, this.configurationContributors = [this.defaultLanguageConfigurationOverridesNode], this.resourceLanguageSettingsSchema = {
      properties: {},
      patternProperties: {},
      additionalProperties: !0,
      allowTrailingCommas: !0,
      allowComments: !0
    }, this.configurationProperties = {}, this.policyConfigurations = /* @__PURE__ */ new Map(), this.excludedConfigurationProperties = {}, aLe.registerSchema(O7, this.resourceLanguageSettingsSchema), this.registerOverridePropertyPatternKey();
  }
  registerConfiguration(e, t = !0) {
    return this.registerConfigurations([e], t), e;
  }
  registerConfigurations(e, t = !0) {
    const n = /* @__PURE__ */ new Set();
    this.doRegisterConfigurations(e, t, n), aLe.registerSchema(O7, this.resourceLanguageSettingsSchema), this._onDidSchemaChange.fire(), this._onDidUpdateConfiguration.fire({ properties: n });
  }
  registerDefaultConfigurations(e) {
    const t = /* @__PURE__ */ new Set();
    this.doRegisterDefaultConfigurations(e, t), this._onDidSchemaChange.fire(), this._onDidUpdateConfiguration.fire({ properties: t, defaultsOverrides: !0 });
  }
  doRegisterDefaultConfigurations(e, t) {
    this.registeredConfigurationDefaults.push(...e);
    const n = [];
    for (const { overrides: r, source: s } of e)
      for (const o in r) {
        t.add(o);
        const a = this.configurationDefaultsOverrides.get(o) ?? this.configurationDefaultsOverrides.set(o, { configurationDefaultOverrides: [] }).get(o), l = r[o];
        if (a.configurationDefaultOverrides.push({ value: l, source: s }), aw.test(o)) {
          const c = this.mergeDefaultConfigurationsForOverrideIdentifier(o, l, s, a.configurationDefaultOverrideValue);
          if (!c)
            continue;
          a.configurationDefaultOverrideValue = c, this.updateDefaultOverrideProperty(o, c, s), n.push(...GV(o));
        } else {
          const c = this.mergeDefaultConfigurationsForConfigurationProperty(o, l, s, a.configurationDefaultOverrideValue);
          if (!c)
            continue;
          a.configurationDefaultOverrideValue = c;
          const u = this.configurationProperties[o];
          u && (this.updatePropertyDefaultValue(o, u), this.updateSchema(o, u));
        }
      }
    this.doRegisterOverrideIdentifiers(n);
  }
  updateDefaultOverrideProperty(e, t, n) {
    const r = {
      type: "object",
      default: t.value,
      description: S(1650, "Configure settings to be overridden for {0}.", vst(e)),
      $ref: O7,
      defaultDefaultValue: t.value,
      source: n,
      defaultValueSource: n
    };
    this.configurationProperties[e] = r, this.defaultLanguageConfigurationOverridesNode.properties[e] = r;
  }
  mergeDefaultConfigurationsForOverrideIdentifier(e, t, n, r) {
    const s = (r == null ? void 0 : r.value) || {}, o = (r == null ? void 0 : r.source) ?? /* @__PURE__ */ new Map();
    if (!(o instanceof Map)) {
      console.error("objectConfigurationSources is not a Map");
      return;
    }
    for (const a of Object.keys(t)) {
      const l = t[a];
      if (Ra(l) && (Ec(s[a]) || Ra(s[a]))) {
        if (s[a] = { ...s[a] ?? {}, ...l }, n)
          for (const u in l)
            o.set(`${a}.${u}`, n);
      } else
        s[a] = l, n ? o.set(a, n) : o.delete(a);
    }
    return { value: s, source: o };
  }
  mergeDefaultConfigurationsForConfigurationProperty(e, t, n, r) {
    const s = this.configurationProperties[e], o = (r == null ? void 0 : r.value) ?? (s == null ? void 0 : s.defaultDefaultValue);
    let a = n;
    if (Ra(t) && (s !== void 0 && s.type === "object" || s === void 0 && (Ec(o) || Ra(o)))) {
      if (a = (r == null ? void 0 : r.source) ?? /* @__PURE__ */ new Map(), !(a instanceof Map)) {
        console.error("defaultValueSource is not a Map");
        return;
      }
      for (const c in t)
        n && a.set(`${e}.${c}`, n);
      t = { ...Ra(o) ? o : {}, ...t };
    }
    return { value: t, source: a };
  }
  registerOverrideIdentifiers(e) {
    this.doRegisterOverrideIdentifiers(e), this._onDidSchemaChange.fire();
  }
  doRegisterOverrideIdentifiers(e) {
    for (const t of e)
      this.overrideIdentifiers.add(t);
    this.updateOverridePropertyPatternKey();
  }
  doRegisterConfigurations(e, t, n) {
    e.forEach((r) => {
      this.validateAndRegisterProperties(r, t, r.extensionInfo, r.restrictedProperties, void 0, n), this.configurationContributors.push(r), this.registerJSONConfiguration(r);
    });
  }
  validateAndRegisterProperties(e, t = !0, n, r, s = 4, o) {
    var c, u, d;
    s = If(e.scope) ? s : e.scope;
    const a = e.properties;
    if (a)
      for (const h in a) {
        const g = a[h];
        if (t && Lst(h, g)) {
          delete a[h];
          continue;
        }
        g.source = n, g.defaultDefaultValue = a[h].default, this.updatePropertyDefaultValue(h, g), aw.test(h) ? g.scope = void 0 : (g.scope = If(g.scope) ? s : g.scope, g.restricted = If(g.restricted) ? !!(r != null && r.includes(h)) : g.restricted), g.experiment ? (c = g.tags) != null && c.some((v) => v.toLowerCase() === "onexp") || (g.tags = g.tags ?? [], g.tags.push("onExP")) : (u = g.tags) != null && u.some((v) => v.toLowerCase() === "onexp") && (console.error(`Invalid tag 'onExP' found for property '${h}'. Please use 'experiment' property instead.`), g.experiment = { mode: "startup" });
        const m = a[h].hasOwnProperty("included") && !a[h].included, _ = (d = a[h].policy) == null ? void 0 : d.name;
        m ? (this.excludedConfigurationProperties[h] = a[h], _ && (this.policyConfigurations.set(_, h), o.add(h)), delete a[h]) : (o.add(h), _ && this.policyConfigurations.set(_, h), this.configurationProperties[h] = a[h], !a[h].deprecationMessage && a[h].markdownDeprecationMessage && (a[h].deprecationMessage = a[h].markdownDeprecationMessage));
      }
    const l = e.allOf;
    if (l)
      for (const h of l)
        this.validateAndRegisterProperties(h, t, n, r, s, o);
  }
  getConfigurationProperties() {
    return this.configurationProperties;
  }
  getPolicyConfigurations() {
    return this.policyConfigurations;
  }
  getExcludedConfigurationProperties() {
    return this.excludedConfigurationProperties;
  }
  registerJSONConfiguration(e) {
    const t = (n) => {
      const r = n.properties;
      if (r)
        for (const o in r)
          this.updateSchema(o, r[o]);
      const s = n.allOf;
      s == null || s.forEach(t);
    };
    t(e);
  }
  updateSchema(e, t) {
    switch (t.scope) {
      case 1:
        break;
      case 2:
        break;
      case 3:
        break;
      case 7:
        break;
      case 4:
        break;
      case 5:
        break;
      case 6:
        this.resourceLanguageSettingsSchema.properties[e] = t;
        break;
    }
  }
  updateOverridePropertyPatternKey() {
    for (const e of this.overrideIdentifiers.values()) {
      const t = `[${e}]`, n = {
        type: "object",
        description: S(1651, "Configure editor settings to be overridden for a language."),
        errorMessage: S(1652, "This setting does not support per-language configuration."),
        $ref: O7
      };
      this.updatePropertyDefaultValue(t, n);
    }
  }
  registerOverridePropertyPatternKey() {
    S(1653, "Configure editor settings to be overridden for a language."), S(1654, "This setting does not support per-language configuration."), this._onDidSchemaChange.fire();
  }
  updatePropertyDefaultValue(e, t) {
    var o;
    const n = (o = this.configurationDefaultsOverrides.get(e)) == null ? void 0 : o.configurationDefaultOverrideValue;
    let r, s;
    n && (!t.disallowConfigurationDefault || !n.source) && (r = n.value, s = n.source), Ec(r) && (r = t.defaultDefaultValue, s = void 0), Ec(r) && (r = xst(t.type)), t.default = r, t.defaultValueSource = s;
  }
}
const fFe = "\\[([^\\]]+)\\]", lLe = new RegExp(fFe, "g"), Est = `^(${fFe})+$`, aw = new RegExp(Est);
function GV(i) {
  const e = [];
  if (aw.test(i)) {
    let t = lLe.exec(i);
    for (; t != null && t.length; ) {
      const n = t[1].trim();
      n && e.push(n), t = lLe.exec(i);
    }
  }
  return qy(e);
}
function xst(i) {
  switch (Array.isArray(i) ? i[0] : i) {
    case "boolean":
      return !1;
    case "integer":
    case "number":
      return 0;
    case "string":
      return "";
    case "array":
      return [];
    case "object":
      return {};
    default:
      return null;
  }
}
const LW = new Sst();
Fs.add(Cm.Configuration, LW);
function Lst(i, e) {
  var t, n, r, s;
  return i.trim() ? aw.test(i) ? S(1656, "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.", i) : LW.getConfigurationProperties()[i] !== void 0 ? S(1657, "Cannot register '{0}'. This property is already registered.", i) : (t = e.policy) != null && t.name && LW.getPolicyConfigurations().get((n = e.policy) == null ? void 0 : n.name) !== void 0 ? S(1658, "Cannot register '{0}'. The associated policy {1} is already registered with {2}.", i, (r = e.policy) == null ? void 0 : r.name, LW.getPolicyConfigurations().get((s = e.policy) == null ? void 0 : s.name)) : null : S(1655, "Cannot register an empty property");
}
const Tst = {
  ModesRegistry: "editor.modesRegistry"
};
class kst extends ge {
  constructor() {
    super(), this._onDidChangeLanguages = this._register(new he()), this.onDidChangeLanguages = this._onDidChangeLanguages.event, this._languages = [];
  }
  registerLanguage(e) {
    return this._languages.push(e), this._onDidChangeLanguages.fire(void 0), {
      dispose: () => {
        for (let t = 0, n = this._languages.length; t < n; t++)
          if (this._languages[t] === e) {
            this._languages.splice(t, 1);
            return;
          }
      }
    };
  }
  getLanguages() {
    return this._languages;
  }
}
const KR = new kst();
Fs.add(Tst.ModesRegistry, KR);
const $h = "plaintext", Dst = ".txt";
KR.registerLanguage({
  id: $h,
  extensions: [Dst],
  aliases: [S(780, "Plain Text"), "text"],
  mimetypes: [co.text]
});
Fs.as(Cm.Configuration).registerDefaultConfigurations([{
  overrides: {
    "[plaintext]": {
      "editor.unicodeHighlight.ambiguousCharacters": !1,
      "editor.unicodeHighlight.invisibleCharacters": !1
    },
    // TODO: Below is a workaround for: https://github.com/microsoft/vscode/issues/240567
    "[go]": {
      "editor.insertSpaces": !1
    },
    "[makefile]": {
      "editor.insertSpaces": !1
    },
    "[shellscript]": {
      "files.eol": `
`
    },
    "[yaml]": {
      "editor.insertSpaces": !0,
      "editor.tabSize": 2
    }
  }
}]);
class Ist {
  constructor(e, t) {
    this.languageId = e;
    const n = t.brackets ? cLe(t.brackets) : [], r = new nie((a) => {
      const l = /* @__PURE__ */ new Set();
      return {
        info: new Nst(this, a, l),
        closing: l
      };
    }), s = new nie((a) => {
      const l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
      return {
        info: new Rst(this, a, l, c),
        opening: l,
        openingColorized: c
      };
    });
    for (const [a, l] of n) {
      const c = r.get(a), u = s.get(l);
      c.closing.add(u.info), u.opening.add(c.info);
    }
    const o = t.colorizedBracketPairs ? cLe(t.colorizedBracketPairs) : n.filter((a) => !(a[0] === "<" && a[1] === ">"));
    for (const [a, l] of o) {
      const c = r.get(a), u = s.get(l);
      c.closing.add(u.info), u.openingColorized.add(c.info), u.opening.add(c.info);
    }
    this._openingBrackets = new Map([...r.cachedValues].map(([a, l]) => [a, l.info])), this._closingBrackets = new Map([...s.cachedValues].map(([a, l]) => [a, l.info]));
  }
  /**
   * No two brackets have the same bracket text.
  */
  get openingBrackets() {
    return [...this._openingBrackets.values()];
  }
  /**
   * No two brackets have the same bracket text.
  */
  get closingBrackets() {
    return [...this._closingBrackets.values()];
  }
  getOpeningBracketInfo(e) {
    return this._openingBrackets.get(e);
  }
  getClosingBracketInfo(e) {
    return this._closingBrackets.get(e);
  }
  getBracketInfo(e) {
    return this.getOpeningBracketInfo(e) || this.getClosingBracketInfo(e);
  }
  getBracketRegExp(e) {
    const t = Array.from([...this._openingBrackets.keys(), ...this._closingBrackets.keys()]);
    return wB(t, e);
  }
}
function cLe(i) {
  return i.filter(([e, t]) => e !== "" && t !== "");
}
class gFe {
  constructor(e, t) {
    this.config = e, this.bracketText = t;
  }
  get languageId() {
    return this.config.languageId;
  }
}
class Nst extends gFe {
  constructor(e, t, n) {
    super(e, t), this.openedBrackets = n, this.isOpeningBracket = !0;
  }
}
class Rst extends gFe {
  constructor(e, t, n, r) {
    super(e, t), this.openingBrackets = n, this.openingColorizedBrackets = r, this.isOpeningBracket = !1;
  }
  /**
   * Checks if this bracket closes the given other bracket.
   * If the bracket infos come from different configurations, this method will return false.
  */
  closes(e) {
    return e.config !== this.config ? !1 : this.openingBrackets.has(e);
  }
  closesColorized(e) {
    return e.config !== this.config ? !1 : this.openingColorizedBrackets.has(e);
  }
  getOpeningBrackets() {
    return [...this.openingBrackets];
  }
}
var Ast = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, uLe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class YJ {
  constructor(e) {
    this.languageId = e;
  }
  affects(e) {
    return this.languageId ? this.languageId === e : !0;
  }
}
const Ls = Vn("languageConfigurationService");
let Iie = class extends ge {
  constructor(e, t) {
    super(), this.configurationService = e, this.languageService = t, this._registry = this._register(new Fst()), this.onDidChangeEmitter = this._register(new he()), this.onDidChange = this.onDidChangeEmitter.event, this.configurations = /* @__PURE__ */ new Map();
    const n = new Set(Object.values(Nie));
    this._register(this.configurationService.onDidChangeConfiguration((r) => {
      const s = r.change.keys.some((a) => n.has(a)), o = r.change.overrides.filter(([a, l]) => l.some((c) => n.has(c))).map(([a]) => a);
      if (s)
        this.configurations.clear(), this.onDidChangeEmitter.fire(new YJ(void 0));
      else
        for (const a of o)
          this.languageService.isRegisteredLanguageId(a) && (this.configurations.delete(a), this.onDidChangeEmitter.fire(new YJ(a)));
    })), this._register(this._registry.onDidChange((r) => {
      this.configurations.delete(r.languageId), this.onDidChangeEmitter.fire(new YJ(r.languageId));
    }));
  }
  register(e, t, n) {
    return this._registry.register(e, t, n);
  }
  getLanguageConfiguration(e) {
    let t = this.configurations.get(e);
    return t || (t = Ost(e, this._registry, this.configurationService, this.languageService), this.configurations.set(e, t)), t;
  }
};
Iie = Ast([
  uLe(0, xn),
  uLe(1, Gr)
], Iie);
function Ost(i, e, t, n) {
  let r = e.getLanguageConfiguration(i);
  if (!r) {
    if (!n.isRegisteredLanguageId(i))
      return new GN(i, {});
    r = new GN(i, {});
  }
  const s = Mst(r.languageId, t), o = mFe([r.underlyingConfig, s]);
  return new GN(r.languageId, o);
}
const Nie = {
  brackets: "editor.language.brackets",
  colorizedBracketPairs: "editor.language.colorizedBracketPairs"
};
function Mst(i, e) {
  const t = e.getValue(Nie.brackets, {
    overrideIdentifier: i
  }), n = e.getValue(Nie.colorizedBracketPairs, {
    overrideIdentifier: i
  });
  return {
    brackets: dLe(t),
    colorizedBracketPairs: dLe(n)
  };
}
function dLe(i) {
  if (Array.isArray(i))
    return i.map((e) => {
      if (!(!Array.isArray(e) || e.length !== 2))
        return [e[0], e[1]];
    }).filter((e) => !!e);
}
function pFe(i, e, t) {
  const n = i.getLineContent(e);
  let r = Ir(n);
  return r.length > t - 1 && (r = r.substring(0, t - 1)), r;
}
class Pst {
  constructor(e) {
    this.languageId = e, this._resolved = null, this._entries = [], this._order = 0, this._resolved = null;
  }
  register(e, t) {
    const n = new hLe(e, t, ++this._order);
    return this._entries.push(n), this._resolved = null, Et(() => {
      for (let r = 0; r < this._entries.length; r++)
        if (this._entries[r] === n) {
          this._entries.splice(r, 1), this._resolved = null;
          break;
        }
    });
  }
  getResolvedConfiguration() {
    if (!this._resolved) {
      const e = this._resolve();
      e && (this._resolved = new GN(this.languageId, e));
    }
    return this._resolved;
  }
  _resolve() {
    return this._entries.length === 0 ? null : (this._entries.sort(hLe.cmp), mFe(this._entries.map((e) => e.configuration)));
  }
}
function mFe(i) {
  let e = {
    comments: void 0,
    brackets: void 0,
    wordPattern: void 0,
    indentationRules: void 0,
    onEnterRules: void 0,
    autoClosingPairs: void 0,
    surroundingPairs: void 0,
    autoCloseBefore: void 0,
    folding: void 0,
    colorizedBracketPairs: void 0,
    __electricCharacterSupport: void 0
  };
  for (const t of i)
    e = {
      comments: t.comments || e.comments,
      brackets: t.brackets || e.brackets,
      wordPattern: t.wordPattern || e.wordPattern,
      indentationRules: t.indentationRules || e.indentationRules,
      onEnterRules: t.onEnterRules || e.onEnterRules,
      autoClosingPairs: t.autoClosingPairs || e.autoClosingPairs,
      surroundingPairs: t.surroundingPairs || e.surroundingPairs,
      autoCloseBefore: t.autoCloseBefore || e.autoCloseBefore,
      folding: t.folding || e.folding,
      colorizedBracketPairs: t.colorizedBracketPairs || e.colorizedBracketPairs,
      __electricCharacterSupport: t.__electricCharacterSupport || e.__electricCharacterSupport
    };
  return e;
}
class hLe {
  constructor(e, t, n) {
    this.configuration = e, this.priority = t, this.order = n;
  }
  static cmp(e, t) {
    return e.priority === t.priority ? e.order - t.order : e.priority - t.priority;
  }
}
class fLe {
  constructor(e) {
    this.languageId = e;
  }
}
class Fst extends ge {
  constructor() {
    super(), this._entries = /* @__PURE__ */ new Map(), this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event, this._register(this.register($h, {
      brackets: [
        ["(", ")"],
        ["[", "]"],
        ["{", "}"]
      ],
      surroundingPairs: [
        { open: "{", close: "}" },
        { open: "[", close: "]" },
        { open: "(", close: ")" },
        { open: "<", close: ">" },
        { open: '"', close: '"' },
        { open: "'", close: "'" },
        { open: "`", close: "`" }
      ],
      colorizedBracketPairs: [],
      folding: {
        offSide: !0
      }
    }, 0));
  }
  /**
   * @param priority Use a higher number for higher priority
   */
  register(e, t, n = 0) {
    let r = this._entries.get(e);
    r || (r = new Pst(e), this._entries.set(e, r));
    const s = r.register(t, n);
    return this._onDidChange.fire(new fLe(e)), Et(() => {
      s.dispose(), this._onDidChange.fire(new fLe(e));
    });
  }
  getLanguageConfiguration(e) {
    const t = this._entries.get(e);
    return (t == null ? void 0 : t.getResolvedConfiguration()) || null;
  }
}
class GN {
  constructor(e, t) {
    this.languageId = e, this.underlyingConfig = t, this._brackets = null, this._electricCharacter = null, this._onEnterSupport = this.underlyingConfig.brackets || this.underlyingConfig.indentationRules || this.underlyingConfig.onEnterRules ? new iN(this.underlyingConfig) : null, this.comments = GN._handleComments(this.underlyingConfig), this.characterPair = new kie(this.underlyingConfig), this.wordDefinition = this.underlyingConfig.wordPattern || sfe, this.indentationRules = this.underlyingConfig.indentationRules, this.underlyingConfig.indentationRules ? this.indentRulesSupport = new _st(this.underlyingConfig.indentationRules) : this.indentRulesSupport = null, this.foldingRules = this.underlyingConfig.folding || {}, this.bracketsNew = new Ist(e, this.underlyingConfig);
  }
  getWordDefinition() {
    return ofe(this.wordDefinition);
  }
  get brackets() {
    return !this._brackets && this.underlyingConfig.brackets && (this._brackets = new ust(this.languageId, this.underlyingConfig.brackets)), this._brackets;
  }
  get electricCharacter() {
    return this._electricCharacter || (this._electricCharacter = new mst(this.brackets)), this._electricCharacter;
  }
  onEnter(e, t, n, r) {
    return this._onEnterSupport ? this._onEnterSupport.onEnter(e, t, n, r) : null;
  }
  getAutoClosingPairs() {
    return new ist(this.characterPair.getAutoClosingPairs());
  }
  getAutoCloseBeforeSet(e) {
    return this.characterPair.getAutoCloseBeforeSet(e);
  }
  getSurroundingPairs() {
    return this.characterPair.getSurroundingPairs();
  }
  static _handleComments(e) {
    const t = e.comments;
    if (!t)
      return null;
    const n = {};
    if (t.lineComment && (typeof t.lineComment == "string" ? n.lineCommentToken = t.lineComment : (n.lineCommentToken = t.lineComment.comment, n.lineCommentNoIndent = t.lineComment.noIndent)), t.blockComment) {
      const [r, s] = t.blockComment;
      n.blockCommentStartToken = r, n.blockCommentEndToken = s;
    }
    return n;
  }
}
ni(
  Ls,
  Iie,
  1
  /* InstantiationType.Delayed */
);
class jl {
  static getLanguageId(e) {
    return (e & 255) >>> 0;
  }
  static getTokenType(e) {
    return (e & 768) >>> 8;
  }
  static containsBalancedBrackets(e) {
    return (e & 1024) !== 0;
  }
  static getFontStyle(e) {
    return (e & 30720) >>> 11;
  }
  static getForeground(e) {
    return (e & 16744448) >>> 15;
  }
  static getBackground(e) {
    return (e & 4278190080) >>> 24;
  }
  static getClassNameFromMetadata(e) {
    let n = "mtk" + this.getForeground(e);
    const r = this.getFontStyle(e);
    return r & 1 && (n += " mtki"), r & 2 && (n += " mtkb"), r & 4 && (n += " mtku"), r & 8 && (n += " mtks"), n;
  }
  static getInlineStyleFromMetadata(e, t) {
    const n = this.getForeground(e), r = this.getFontStyle(e);
    let s = `color: ${t[n]};`;
    r & 1 && (s += "font-style: italic;"), r & 2 && (s += "font-weight: bold;");
    let o = "";
    return r & 4 && (o += " underline"), r & 8 && (o += " line-through"), o && (s += `text-decoration:${o};`), s;
  }
  static getPresentationFromMetadata(e) {
    const t = this.getForeground(e), n = this.getFontStyle(e);
    return {
      foreground: t,
      italic: !!(n & 1),
      bold: !!(n & 2),
      underline: !!(n & 4),
      strikethrough: !!(n & 8)
    };
  }
}
class Tt {
  static fromTo(e, t) {
    return new Tt(e, t);
  }
  static addRange(e, t) {
    let n = 0;
    for (; n < t.length && t[n].endExclusive < e.start; )
      n++;
    let r = n;
    for (; r < t.length && t[r].start <= e.endExclusive; )
      r++;
    if (n === r)
      t.splice(n, 0, e);
    else {
      const s = Math.min(e.start, t[n].start), o = Math.max(e.endExclusive, t[r - 1].endExclusive);
      t.splice(n, r - n, new Tt(s, o));
    }
  }
  static tryCreate(e, t) {
    if (!(e > t))
      return new Tt(e, t);
  }
  static ofLength(e) {
    return new Tt(0, e);
  }
  static ofStartAndLength(e, t) {
    return new Tt(e, e + t);
  }
  static emptyAt(e) {
    return new Tt(e, e);
  }
  constructor(e, t) {
    if (this.start = e, this.endExclusive = t, e > t)
      throw new Wt(`Invalid range: ${this.toString()}`);
  }
  get isEmpty() {
    return this.start === this.endExclusive;
  }
  delta(e) {
    return new Tt(this.start + e, this.endExclusive + e);
  }
  deltaStart(e) {
    return new Tt(this.start + e, this.endExclusive);
  }
  deltaEnd(e) {
    return new Tt(this.start, this.endExclusive + e);
  }
  get length() {
    return this.endExclusive - this.start;
  }
  toString() {
    return `[${this.start}, ${this.endExclusive})`;
  }
  equals(e) {
    return this.start === e.start && this.endExclusive === e.endExclusive;
  }
  contains(e) {
    return this.start <= e && e < this.endExclusive;
  }
  /**
   * for all numbers n: range1.contains(n) or range2.contains(n) => range1.join(range2).contains(n)
   * The joined range is the smallest range that contains both ranges.
   */
  join(e) {
    return new Tt(Math.min(this.start, e.start), Math.max(this.endExclusive, e.endExclusive));
  }
  /**
   * for all numbers n: range1.contains(n) and range2.contains(n) <=> range1.intersect(range2).contains(n)
   *
   * The resulting range is empty if the ranges do not intersect, but touch.
   * If the ranges don't even touch, the result is undefined.
   */
  intersect(e) {
    const t = Math.max(this.start, e.start), n = Math.min(this.endExclusive, e.endExclusive);
    if (t <= n)
      return new Tt(t, n);
  }
  intersectionLength(e) {
    const t = Math.max(this.start, e.start), n = Math.min(this.endExclusive, e.endExclusive);
    return Math.max(0, n - t);
  }
  intersects(e) {
    const t = Math.max(this.start, e.start), n = Math.min(this.endExclusive, e.endExclusive);
    return t < n;
  }
  intersectsOrTouches(e) {
    const t = Math.max(this.start, e.start), n = Math.min(this.endExclusive, e.endExclusive);
    return t <= n;
  }
  isBefore(e) {
    return this.endExclusive <= e.start;
  }
  isAfter(e) {
    return this.start >= e.endExclusive;
  }
  slice(e) {
    return e.slice(this.start, this.endExclusive);
  }
  substring(e) {
    return e.substring(this.start, this.endExclusive);
  }
  /**
   * Returns the given value if it is contained in this instance, otherwise the closest value that is contained.
   * The range must not be empty.
   */
  clip(e) {
    if (this.isEmpty)
      throw new Wt(`Invalid clipping range: ${this.toString()}`);
    return Math.max(this.start, Math.min(this.endExclusive - 1, e));
  }
  /**
   * Returns `r := value + k * length` such that `r` is contained in this range.
   * The range must not be empty.
   *
   * E.g. `[5, 10).clipCyclic(10) === 5`, `[5, 10).clipCyclic(11) === 6` and `[5, 10).clipCyclic(4) === 9`.
   */
  clipCyclic(e) {
    if (this.isEmpty)
      throw new Wt(`Invalid clipping range: ${this.toString()}`);
    return e < this.start ? this.endExclusive - (this.start - e) % this.length : e >= this.endExclusive ? this.start + (e - this.start) % this.length : e;
  }
  forEach(e) {
    for (let t = this.start; t < this.endExclusive; t++)
      e(t);
  }
  /**
   * this: [ 5, 10), range: [10, 15) => [5, 15)]
   * Throws if the ranges are not touching.
  */
  joinRightTouching(e) {
    if (this.endExclusive !== e.start)
      throw new Wt(`Invalid join: ${this.toString()} and ${e.toString()}`);
    return new Tt(this.start, e.endExclusive);
  }
}
class lfe {
  constructor() {
    this._sortedRanges = [];
  }
  addRange(e) {
    let t = 0;
    for (; t < this._sortedRanges.length && this._sortedRanges[t].endExclusive < e.start; )
      t++;
    let n = t;
    for (; n < this._sortedRanges.length && this._sortedRanges[n].start <= e.endExclusive; )
      n++;
    if (t === n)
      this._sortedRanges.splice(t, 0, e);
    else {
      const r = Math.min(e.start, this._sortedRanges[t].start), s = Math.max(e.endExclusive, this._sortedRanges[n - 1].endExclusive);
      this._sortedRanges.splice(t, n - t, new Tt(r, s));
    }
  }
  toString() {
    return this._sortedRanges.map((e) => e.toString()).join(", ");
  }
  /**
   * Returns of there is a value that is contained in this instance and the given range.
   */
  intersectsStrict(e) {
    let t = 0;
    for (; t < this._sortedRanges.length && this._sortedRanges[t].endExclusive <= e.start; )
      t++;
    return t < this._sortedRanges.length && this._sortedRanges[t].start < e.endExclusive;
  }
  intersectWithRange(e) {
    const t = new lfe();
    for (const n of this._sortedRanges) {
      const r = n.intersect(e);
      r && t.addRange(r);
    }
    return t;
  }
  intersectWithRangeLength(e) {
    return this.intersectWithRange(e).length;
  }
  get length() {
    return this._sortedRanges.reduce((e, t) => e + t.length, 0);
  }
}
const ey = class ey {
  static createEmpty(e, t) {
    const n = ey.defaultTokenMetadata, r = new Uint32Array(2);
    return r[0] = e.length, r[1] = n, new ey(r, e, t);
  }
  static createFromTextAndMetadata(e, t) {
    let n = 0, r = "";
    const s = new Array();
    for (const { text: o, metadata: a } of e)
      s.push(n + o.length, a), n += o.length, r += o;
    return new ey(new Uint32Array(s), r, t);
  }
  static convertToEndOffset(e, t) {
    const r = (e.length >>> 1) - 1;
    for (let s = 0; s < r; s++)
      e[s << 1] = e[s + 1 << 1];
    e[r << 1] = t;
  }
  static findIndexInTokensArray(e, t) {
    if (e.length <= 2)
      return 0;
    let n = 0, r = (e.length >>> 1) - 1;
    for (; n < r; ) {
      const s = n + Math.floor((r - n) / 2), o = e[s << 1];
      if (o === t)
        return s + 1;
      o < t ? n = s + 1 : o > t && (r = s);
    }
    return n;
  }
  constructor(e, t, n) {
    this._lineTokensBrand = void 0, (e.length > 1 ? e[e.length - 2] : 0) !== t.length && fn(new Error("Token length and text length do not match!")), this._tokens = e, this._tokensCount = this._tokens.length >>> 1, this._text = t, this.languageIdCodec = n;
  }
  getTextLength() {
    return this._text.length;
  }
  equals(e) {
    return e instanceof ey ? this.slicedEquals(e, 0, this._tokensCount) : !1;
  }
  slicedEquals(e, t, n) {
    if (this._text !== e._text || this._tokensCount !== e._tokensCount)
      return !1;
    const r = t << 1, s = r + (n << 1);
    for (let o = r; o < s; o++)
      if (this._tokens[o] !== e._tokens[o])
        return !1;
    return !0;
  }
  getLineContent() {
    return this._text;
  }
  getCount() {
    return this._tokensCount;
  }
  getStartOffset(e) {
    return e > 0 ? this._tokens[e - 1 << 1] : 0;
  }
  getMetadata(e) {
    return this._tokens[(e << 1) + 1];
  }
  getLanguageId(e) {
    const t = this._tokens[(e << 1) + 1], n = jl.getLanguageId(t);
    return this.languageIdCodec.decodeLanguageId(n);
  }
  getStandardTokenType(e) {
    const t = this._tokens[(e << 1) + 1];
    return jl.getTokenType(t);
  }
  getForeground(e) {
    const t = this._tokens[(e << 1) + 1];
    return jl.getForeground(t);
  }
  getClassName(e) {
    const t = this._tokens[(e << 1) + 1];
    return jl.getClassNameFromMetadata(t);
  }
  getInlineStyle(e, t) {
    const n = this._tokens[(e << 1) + 1];
    return jl.getInlineStyleFromMetadata(n, t);
  }
  getPresentation(e) {
    const t = this._tokens[(e << 1) + 1];
    return jl.getPresentationFromMetadata(t);
  }
  getEndOffset(e) {
    return this._tokens[e << 1];
  }
  /**
   * Find the token containing offset `offset`.
   * @param offset The search offset
   * @return The index of the token containing the offset.
   */
  findTokenIndexAtOffset(e) {
    return ey.findIndexInTokensArray(this._tokens, e);
  }
  inflate() {
    return this;
  }
  sliceAndInflate(e, t, n) {
    return new cfe(this, e, t, n);
  }
  sliceZeroCopy(e) {
    return this.sliceAndInflate(e.start, e.endExclusive, 0);
  }
  /**
   * @pure
   * @param insertTokens Must be sorted by offset.
  */
  withInserted(e) {
    if (e.length === 0)
      return this;
    let t = 0, n = 0, r = "";
    const s = new Array();
    let o = 0;
    for (; ; ) {
      const a = t < this._tokensCount ? this._tokens[t << 1] : -1, l = n < e.length ? e[n] : null;
      if (a !== -1 && (l === null || a <= l.offset)) {
        r += this._text.substring(o, a);
        const c = this._tokens[(t << 1) + 1];
        s.push(r.length, c), t++, o = a;
      } else if (l) {
        if (l.offset > o) {
          r += this._text.substring(o, l.offset);
          const c = this._tokens[(t << 1) + 1];
          s.push(r.length, c), o = l.offset;
        }
        r += l.text, s.push(r.length, l.tokenMetadata), n++;
      } else
        break;
    }
    return new ey(new Uint32Array(s), r, this.languageIdCodec);
  }
  getTokensInRange(e) {
    const t = new Hst(), n = this.findTokenIndexAtOffset(e.start), r = this.findTokenIndexAtOffset(e.endExclusive);
    for (let s = n; s <= r; s++) {
      const a = new Tt(this.getStartOffset(s), this.getEndOffset(s)).intersectionLength(e);
      a > 0 && t.add(a, this.getMetadata(s));
    }
    return t.build();
  }
  getTokenText(e) {
    const t = this.getStartOffset(e), n = this.getEndOffset(e);
    return this._text.substring(t, n);
  }
  forEach(e) {
    const t = this.getCount();
    for (let n = 0; n < t; n++)
      e(n);
  }
  toString() {
    let e = "";
    return this.forEach((t) => {
      e += `[${this.getTokenText(t)}]{${this.getClassName(t)}}`;
    }), e;
  }
};
ey.defaultTokenMetadata = (32768 | 2 << 24) >>> 0;
let fo = ey;
class cfe {
  constructor(e, t, n, r) {
    this._source = e, this._startOffset = t, this._endOffset = n, this._deltaOffset = r, this._firstTokenIndex = e.findTokenIndexAtOffset(t), this.languageIdCodec = e.languageIdCodec, this._tokensCount = 0;
    for (let s = this._firstTokenIndex, o = e.getCount(); s < o && !(e.getStartOffset(s) >= n); s++)
      this._tokensCount++;
  }
  getMetadata(e) {
    return this._source.getMetadata(this._firstTokenIndex + e);
  }
  getLanguageId(e) {
    return this._source.getLanguageId(this._firstTokenIndex + e);
  }
  getLineContent() {
    return this._source.getLineContent().substring(this._startOffset, this._endOffset);
  }
  equals(e) {
    return e instanceof cfe ? this._startOffset === e._startOffset && this._endOffset === e._endOffset && this._deltaOffset === e._deltaOffset && this._source.slicedEquals(e._source, this._firstTokenIndex, this._tokensCount) : !1;
  }
  getCount() {
    return this._tokensCount;
  }
  getStandardTokenType(e) {
    return this._source.getStandardTokenType(this._firstTokenIndex + e);
  }
  getForeground(e) {
    return this._source.getForeground(this._firstTokenIndex + e);
  }
  getEndOffset(e) {
    const t = this._source.getEndOffset(this._firstTokenIndex + e);
    return Math.min(this._endOffset, t) - this._startOffset + this._deltaOffset;
  }
  getClassName(e) {
    return this._source.getClassName(this._firstTokenIndex + e);
  }
  getInlineStyle(e, t) {
    return this._source.getInlineStyle(this._firstTokenIndex + e, t);
  }
  getPresentation(e) {
    return this._source.getPresentation(this._firstTokenIndex + e);
  }
  findTokenIndexAtOffset(e) {
    return this._source.findTokenIndexAtOffset(e + this._startOffset - this._deltaOffset) - this._firstTokenIndex;
  }
  getTokenText(e) {
    const t = this._firstTokenIndex + e, n = this._source.getStartOffset(t), r = this._source.getEndOffset(t);
    let s = this._source.getTokenText(t);
    return n < this._startOffset && (s = s.substring(this._startOffset - n)), r > this._endOffset && (s = s.substring(0, s.length - (r - this._endOffset))), s;
  }
  forEach(e) {
    for (let t = 0; t < this.getCount(); t++)
      e(t);
  }
}
function Bst(i, e) {
  const t = e.lineNumber;
  if (!i.tokenization.isCheapToTokenize(t))
    return;
  i.tokenization.forceTokenization(t);
  const n = i.tokenization.getLineTokens(t), r = n.findTokenIndexAtOffset(e.column - 1);
  return n.getStandardTokenType(r);
}
class Oy {
  static fromLineTokens(e) {
    const t = [];
    for (let n = 0; n < e.getCount(); n++)
      t.push(new Rie(e.getEndOffset(n) - e.getStartOffset(n), e.getMetadata(n)));
    return Oy.create(t);
  }
  static create(e) {
    return new Oy(e);
  }
  constructor(e) {
    this._tokenInfo = e;
  }
  toLineTokens(e, t) {
    return fo.createFromTextAndMetadata(this.map((n, r) => ({ text: n.substring(e), metadata: r.metadata })), t);
  }
  forEach(e) {
    let t = 0;
    for (const n of this._tokenInfo) {
      const r = new Tt(t, t + n.length);
      e(r, n), t += n.length;
    }
  }
  map(e) {
    const t = [];
    let n = 0;
    for (const r of this._tokenInfo) {
      const s = new Tt(n, n + r.length);
      t.push(e(s, r)), n += r.length;
    }
    return t;
  }
  slice(e) {
    const t = [];
    let n = 0;
    for (const r of this._tokenInfo) {
      const s = n, o = s + r.length;
      if (o > e.start) {
        if (s >= e.endExclusive)
          break;
        const a = Math.max(0, e.start - s), l = Math.max(0, o - e.endExclusive);
        t.push(new Rie(r.length - a - l, r.metadata));
      }
      n += r.length;
    }
    return Oy.create(t);
  }
}
class Rie {
  constructor(e, t) {
    this.length = e, this.metadata = t;
  }
}
class Hst {
  constructor() {
    this._tokens = [];
  }
  add(e, t) {
    this._tokens.push(new Rie(e, t));
  }
  build() {
    return Oy.create(this._tokens);
  }
}
class ufe {
  constructor(e, t, n) {
    this._indentRulesSupport = t, this._indentationLineProcessor = new _Fe(e, n);
  }
  /**
   * Apply the new indentation and return whether the indentation level should be increased after the given line number
   */
  shouldIncrease(e, t) {
    const n = this._indentationLineProcessor.getProcessedLine(e, t);
    return this._indentRulesSupport.shouldIncrease(n);
  }
  /**
   * Apply the new indentation and return whether the indentation level should be decreased after the given line number
   */
  shouldDecrease(e, t) {
    const n = this._indentationLineProcessor.getProcessedLine(e, t);
    return this._indentRulesSupport.shouldDecrease(n);
  }
  /**
   * Apply the new indentation and return whether the indentation level should remain unchanged at the given line number
   */
  shouldIgnore(e, t) {
    const n = this._indentationLineProcessor.getProcessedLine(e, t);
    return this._indentRulesSupport.shouldIgnore(n);
  }
  /**
   * Apply the new indentation and return whether the indentation level should increase on the line after the given line number
   */
  shouldIndentNextLine(e, t) {
    const n = this._indentationLineProcessor.getProcessedLine(e, t);
    return this._indentRulesSupport.shouldIndentNextLine(n);
  }
}
class dfe {
  constructor(e, t) {
    this.model = e, this.indentationLineProcessor = new _Fe(e, t);
  }
  /**
   * Returns the processed text, stripped from the language configuration brackets within the string, comment and regex tokens, around the given range
   */
  getProcessedTokenContextAroundRange(e) {
    const t = this._getProcessedTokensBeforeRange(e), n = this._getProcessedTokensAfterRange(e), r = this._getProcessedPreviousLineTokens(e);
    return { beforeRangeProcessedTokens: t, afterRangeProcessedTokens: n, previousLineProcessedTokens: r };
  }
  _getProcessedTokensBeforeRange(e) {
    this.model.tokenization.forceTokenization(e.startLineNumber);
    const t = this.model.tokenization.getLineTokens(e.startLineNumber), n = hx(t, e.startColumn - 1);
    let r;
    if (hfe(this.model, e.getStartPosition())) {
      const o = e.startColumn - 1 - n.firstCharOffset, a = n.firstCharOffset, l = a + o;
      r = t.sliceAndInflate(a, l, 0);
    } else {
      const o = e.startColumn - 1;
      r = t.sliceAndInflate(0, o, 0);
    }
    return this.indentationLineProcessor.getProcessedTokens(r);
  }
  _getProcessedTokensAfterRange(e) {
    const t = e.isEmpty() ? e.getStartPosition() : e.getEndPosition();
    this.model.tokenization.forceTokenization(t.lineNumber);
    const n = this.model.tokenization.getLineTokens(t.lineNumber), r = hx(n, t.column - 1), s = t.column - 1 - r.firstCharOffset, o = r.firstCharOffset + s, a = r.firstCharOffset + r.getLineLength(), l = n.sliceAndInflate(o, a, 0);
    return this.indentationLineProcessor.getProcessedTokens(l);
  }
  _getProcessedPreviousLineTokens(e) {
    const t = (g) => {
      this.model.tokenization.forceTokenization(g);
      const m = this.model.tokenization.getLineTokens(g), _ = this.model.getLineMaxColumn(g) - 1;
      return hx(m, _);
    };
    this.model.tokenization.forceTokenization(e.startLineNumber);
    const n = this.model.tokenization.getLineTokens(e.startLineNumber), r = hx(n, e.startColumn - 1), s = fo.createEmpty("", r.languageIdCodec), o = e.startLineNumber - 1;
    if (o === 0 || !(r.firstCharOffset === 0))
      return s;
    const c = t(o);
    if (!(r.languageId === c.languageId))
      return s;
    const d = c.toIViewLineTokens();
    return this.indentationLineProcessor.getProcessedTokens(d);
  }
}
class _Fe {
  constructor(e, t) {
    this.model = e, this.languageConfigurationService = t;
  }
  /**
   * Get the processed line for the given line number and potentially adjust the indentation level.
   * Remove the language configuration brackets from the regex, string and comment tokens.
   */
  getProcessedLine(e, t) {
    var o, a;
    const n = (l, c) => {
      const u = Ir(l);
      return c + l.substring(u.length);
    };
    (a = (o = this.model.tokenization).forceTokenization) == null || a.call(o, e);
    const r = this.model.tokenization.getLineTokens(e);
    let s = this.getProcessedTokens(r).getLineContent();
    return t !== void 0 && (s = n(s, t)), s;
  }
  /**
   * Process the line with the given tokens, remove the language configuration brackets from the regex, string and comment tokens.
   */
  getProcessedTokens(e) {
    const t = (l) => l === 2 || l === 3 || l === 1, n = e.getLanguageId(0), s = this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew.getBracketRegExp({ global: !0 }), o = [];
    return e.forEach((l) => {
      const c = e.getStandardTokenType(l);
      let u = e.getTokenText(l);
      t(c) && (u = u.replace(s, ""));
      const d = e.getMetadata(l);
      o.push({ text: u, metadata: d });
    }), fo.createFromTextAndMetadata(o, e.languageIdCodec);
  }
}
function hfe(i, e) {
  i.tokenization.forceTokenization(e.lineNumber);
  const t = i.tokenization.getLineTokens(e.lineNumber), n = hx(t, e.column - 1), r = n.firstCharOffset === 0, s = t.getLanguageId(0) === n.languageId;
  return !r && !s;
}
function qN(i, e, t, n) {
  e.tokenization.forceTokenization(t.startLineNumber);
  const r = e.getLanguageIdAtPosition(t.startLineNumber, t.startColumn), s = n.getLanguageConfiguration(r);
  if (!s)
    return null;
  const a = new dfe(e, n).getProcessedTokenContextAroundRange(t), l = a.previousLineProcessedTokens.getLineContent(), c = a.beforeRangeProcessedTokens.getLineContent(), u = a.afterRangeProcessedTokens.getLineContent(), d = s.onEnter(i, l, c, u);
  if (!d)
    return null;
  const h = d.indentAction;
  let g = d.appendText;
  const m = d.removeText || 0;
  g ? h === Vo.Indent && (g = "	" + g) : h === Vo.Indent || h === Vo.IndentOutdent ? g = "	" : g = "";
  let _ = pFe(e, t.startLineNumber, t.startColumn);
  return m && (_ = _.substring(0, _.length - m)), {
    indentAction: h,
    appendText: g,
    removeText: m,
    indentation: _
  };
}
var Wst = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Vst = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, TW;
const XJ = /* @__PURE__ */ Object.create(null);
function iE(i, e) {
  if (e <= 0)
    return "";
  XJ[i] || (XJ[i] = ["", i]);
  const t = XJ[i];
  for (let n = t.length; n <= e; n++)
    t[n] = t[n - 1] + i;
  return t[e];
}
let Xf = TW = class {
  static unshiftIndent(e, t, n, r, s) {
    const o = As.visibleColumnFromColumn(e, t, n);
    if (s) {
      const a = iE(" ", r), c = As.prevIndentTabStop(o, r) / r;
      return iE(a, c);
    } else {
      const c = As.prevRenderTabStop(o, n) / n;
      return iE("	", c);
    }
  }
  static shiftIndent(e, t, n, r, s) {
    const o = As.visibleColumnFromColumn(e, t, n);
    if (s) {
      const a = iE(" ", r), c = As.nextIndentTabStop(o, r) / r;
      return iE(a, c);
    } else {
      const c = As.nextRenderTabStop(o, n) / n;
      return iE("	", c);
    }
  }
  constructor(e, t, n) {
    this._languageConfigurationService = n, this._opts = t, this._selection = e, this._selectionId = null, this._useLastEditRangeForCursorEndPosition = !1, this._selectionStartColumnStaysPut = !1;
  }
  _addEditOperation(e, t, n) {
    this._useLastEditRangeForCursorEndPosition ? e.addTrackedEditOperation(t, n) : e.addEditOperation(t, n);
  }
  getEditOperations(e, t) {
    const n = this._selection.startLineNumber;
    let r = this._selection.endLineNumber;
    this._selection.endColumn === 1 && n !== r && (r = r - 1);
    const { tabSize: s, indentSize: o, insertSpaces: a } = this._opts, l = n === r;
    if (this._opts.useTabStops) {
      this._selection.isEmpty() && /^\s*$/.test(e.getLineContent(n)) && (this._useLastEditRangeForCursorEndPosition = !0);
      let c = 0, u = 0;
      for (let d = n; d <= r; d++, c = u) {
        u = 0;
        const h = e.getLineContent(d);
        let g = Tc(h);
        if (this._opts.isUnshift && (h.length === 0 || g === 0) || !l && !this._opts.isUnshift && h.length === 0)
          continue;
        if (g === -1 && (g = h.length), d > 1 && As.visibleColumnFromColumn(h, g + 1, s) % o !== 0 && e.tokenization.isCheapToTokenize(d - 1)) {
          const v = qN(this._opts.autoIndent, e, new z(d - 1, e.getLineMaxColumn(d - 1), d - 1, e.getLineMaxColumn(d - 1)), this._languageConfigurationService);
          if (v) {
            if (u = c, v.appendText)
              for (let w = 0, E = v.appendText.length; w < E && u < o && v.appendText.charCodeAt(w) === 32; w++)
                u++;
            v.removeText && (u = Math.max(0, u - v.removeText));
            for (let w = 0; w < u && !(g === 0 || h.charCodeAt(g - 1) !== 32); w++)
              g--;
          }
        }
        if (this._opts.isUnshift && g === 0)
          continue;
        let m;
        this._opts.isUnshift ? m = TW.unshiftIndent(h, g + 1, s, o, a) : m = TW.shiftIndent(h, g + 1, s, o, a), this._addEditOperation(t, new z(d, 1, d, g + 1), m), d === n && !this._selection.isEmpty() && (this._selectionStartColumnStaysPut = this._selection.startColumn <= g + 1);
      }
    } else {
      !this._opts.isUnshift && this._selection.isEmpty() && e.getLineLength(n) === 0 && (this._useLastEditRangeForCursorEndPosition = !0);
      const c = a ? iE(" ", o) : "	";
      for (let u = n; u <= r; u++) {
        const d = e.getLineContent(u);
        let h = Tc(d);
        if (!(this._opts.isUnshift && (d.length === 0 || h === 0)) && !(!l && !this._opts.isUnshift && d.length === 0) && (h === -1 && (h = d.length), !(this._opts.isUnshift && h === 0)))
          if (this._opts.isUnshift) {
            h = Math.min(h, o);
            for (let g = 0; g < h; g++)
              if (d.charCodeAt(g) === 9) {
                h = g + 1;
                break;
              }
            this._addEditOperation(t, new z(u, 1, u, h + 1), "");
          } else
            this._addEditOperation(t, new z(u, 1, u, 1), c), u === n && !this._selection.isEmpty() && (this._selectionStartColumnStaysPut = this._selection.startColumn === 1);
      }
    }
    this._selectionId = t.trackSelection(this._selection);
  }
  computeCursorState(e, t) {
    if (this._useLastEditRangeForCursorEndPosition) {
      const r = t.getInverseEditOperations()[0];
      return new bt(r.range.endLineNumber, r.range.endColumn, r.range.endLineNumber, r.range.endColumn);
    }
    const n = t.getTrackedSelection(this._selectionId);
    if (this._selectionStartColumnStaysPut) {
      const r = this._selection.startColumn;
      return n.startColumn <= r ? n : n.getDirection() === 0 ? new bt(n.startLineNumber, r, n.endLineNumber, n.endColumn) : new bt(n.endLineNumber, n.endColumn, n.startLineNumber, r);
    }
    return n;
  }
};
Xf = TW = Wst([
  Vst(2, Ls)
], Xf);
class Ust {
  constructor(e, t, n) {
    this._range = e, this._charBeforeSelection = t, this._charAfterSelection = n;
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(new z(this._range.startLineNumber, this._range.startColumn, this._range.startLineNumber, this._range.startColumn), this._charBeforeSelection), t.addTrackedEditOperation(new z(this._range.endLineNumber, this._range.endColumn, this._range.endLineNumber, this._range.endColumn), this._charAfterSelection || null);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations(), r = n[0].range, s = n[1].range;
    return new bt(r.endLineNumber, r.endColumn, s.endLineNumber, s.endColumn - this._charAfterSelection.length);
  }
}
class zst {
  constructor(e, t, n) {
    this._position = e, this._text = t, this._charAfter = n;
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(new z(this._position.lineNumber, this._position.column, this._position.lineNumber, this._position.column), this._text + this._charAfter);
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return new bt(r.endLineNumber, r.startColumn, r.endLineNumber, r.endColumn - this._charAfter.length);
  }
}
function $st(i, e, t) {
  const n = i.tokenization.getLanguageIdAtPosition(e, 0);
  if (e > 1) {
    let r, s = -1;
    for (r = e - 1; r >= 1; r--) {
      if (i.tokenization.getLanguageIdAtPosition(r, 0) !== n)
        return s;
      const o = i.getLineContent(r);
      if (t.shouldIgnore(r) || /^\s+$/.test(o) || o === "") {
        s = r;
        continue;
      }
      return r;
    }
  }
  return -1;
}
function u4(i, e, t, n = !0, r) {
  if (i < 4)
    return null;
  const s = r.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;
  if (!s)
    return null;
  const o = new ufe(e, s, r);
  if (t <= 1)
    return {
      indentation: "",
      action: null
    };
  for (let l = t - 1; l > 0 && e.getLineContent(l) === ""; l--)
    if (l === 1)
      return {
        indentation: "",
        action: null
      };
  const a = $st(e, t, o);
  if (a < 0)
    return null;
  if (a < 1)
    return {
      indentation: "",
      action: null
    };
  if (o.shouldIncrease(a) || o.shouldIndentNextLine(a)) {
    const l = e.getLineContent(a);
    return {
      indentation: Ir(l),
      action: Vo.Indent,
      line: a
    };
  } else if (o.shouldDecrease(a)) {
    const l = e.getLineContent(a);
    return {
      indentation: Ir(l),
      action: null,
      line: a
    };
  } else {
    if (a === 1)
      return {
        indentation: Ir(e.getLineContent(a)),
        action: null,
        line: a
      };
    const l = a - 1, c = s.getIndentMetadata(e.getLineContent(l));
    if (!(c & 3) && c & 4) {
      let u = 0;
      for (let d = l - 1; d > 0; d--)
        if (!o.shouldIndentNextLine(d)) {
          u = d;
          break;
        }
      return {
        indentation: Ir(e.getLineContent(u + 1)),
        action: null,
        line: u + 1
      };
    }
    if (n)
      return {
        indentation: Ir(e.getLineContent(a)),
        action: null,
        line: a
      };
    for (let u = a; u > 0; u--) {
      if (o.shouldIncrease(u))
        return {
          indentation: Ir(e.getLineContent(u)),
          action: Vo.Indent,
          line: u
        };
      if (o.shouldIndentNextLine(u)) {
        let d = 0;
        for (let h = u - 1; h > 0; h--)
          if (!o.shouldIndentNextLine(u)) {
            d = h;
            break;
          }
        return {
          indentation: Ir(e.getLineContent(d + 1)),
          action: null,
          line: d + 1
        };
      } else if (o.shouldDecrease(u))
        return {
          indentation: Ir(e.getLineContent(u)),
          action: null,
          line: u
        };
    }
    return {
      indentation: Ir(e.getLineContent(1)),
      action: null,
      line: 1
    };
  }
}
function SF(i, e, t, n, r, s) {
  if (i < 4)
    return null;
  const o = s.getLanguageConfiguration(t);
  if (!o)
    return null;
  const a = s.getLanguageConfiguration(t).indentRulesSupport;
  if (!a)
    return null;
  const l = new ufe(e, a, s), c = u4(i, e, n, void 0, s);
  if (c) {
    const u = c.line;
    if (u !== void 0) {
      let d = !0;
      for (let h = u; h < n - 1; h++)
        if (!/^\s*$/.test(e.getLineContent(h))) {
          d = !1;
          break;
        }
      if (d) {
        const h = o.onEnter(i, "", e.getLineContent(u), "");
        if (h) {
          let g = Ir(e.getLineContent(u));
          return h.removeText && (g = g.substring(0, g.length - h.removeText)), h.indentAction === Vo.Indent || h.indentAction === Vo.IndentOutdent ? g = r.shiftIndent(g) : h.indentAction === Vo.Outdent && (g = r.unshiftIndent(g)), l.shouldDecrease(n) && (g = r.unshiftIndent(g)), h.appendText && (g += h.appendText), Ir(g);
        }
      }
    }
    return l.shouldDecrease(n) ? c.action === Vo.Indent ? c.indentation : r.unshiftIndent(c.indentation) : c.action === Vo.Indent ? r.shiftIndent(c.indentation) : c.indentation;
  }
  return null;
}
function jst(i, e, t, n, r) {
  if (i < 4)
    return null;
  const s = e.getLanguageIdAtPosition(t.startLineNumber, t.startColumn), o = r.getLanguageConfiguration(s).indentRulesSupport;
  if (!o)
    return null;
  e.tokenization.forceTokenization(t.startLineNumber);
  const l = new dfe(e, r).getProcessedTokenContextAroundRange(t), c = l.afterRangeProcessedTokens, u = l.beforeRangeProcessedTokens, d = Ir(u.getLineContent()), h = qst(e, t.startLineNumber, u), g = hfe(e, t.getStartPosition()), m = e.getLineContent(t.startLineNumber), _ = Ir(m), v = u4(i, h, t.startLineNumber + 1, void 0, r);
  if (!v) {
    const E = g ? _ : d;
    return {
      beforeEnter: E,
      afterEnter: E
    };
  }
  let w = g ? _ : v.indentation;
  return v.action === Vo.Indent && (w = n.shiftIndent(w)), o.shouldDecrease(c.getLineContent()) && (w = n.unshiftIndent(w)), {
    beforeEnter: g ? _ : d,
    afterEnter: w
  };
}
function Gst(i, e, t, n, r, s) {
  const o = i.autoIndent;
  if (o < 4 || hfe(e, t.getStartPosition()))
    return null;
  const l = e.getLanguageIdAtPosition(t.startLineNumber, t.startColumn), c = s.getLanguageConfiguration(l).indentRulesSupport;
  if (!c)
    return null;
  const d = new dfe(e, s).getProcessedTokenContextAroundRange(t), h = d.beforeRangeProcessedTokens.getLineContent(), g = d.afterRangeProcessedTokens.getLineContent(), m = h + g, _ = h + n + g;
  if (!c.shouldDecrease(m) && c.shouldDecrease(_)) {
    const w = u4(o, e, t.startLineNumber, !1, s);
    if (!w)
      return null;
    let E = w.indentation;
    return w.action !== Vo.Indent && (E = r.unshiftIndent(E)), E;
  }
  const v = t.startLineNumber - 1;
  if (v > 0) {
    const w = e.getLineContent(v);
    if (c.shouldIndentNextLine(w) && c.shouldIncrease(_)) {
      const E = u4(o, e, t.startLineNumber, !1, s), L = E == null ? void 0 : E.indentation;
      if (L !== void 0) {
        const T = e.getLineContent(t.startLineNumber), D = Ir(T), R = r.shiftIndent(L) === D, M = /^\s*$/.test(m), B = i.autoClosingPairs.autoClosingPairsOpenByEnd.get(n), j = B && B.length > 0 && M;
        if (R && j)
          return L;
      }
    }
  }
  return null;
}
function bFe(i, e, t) {
  const n = t.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;
  return !n || e < 1 || e > i.getLineCount() ? null : n.getIndentMetadata(i.getLineContent(e));
}
function qst(i, e, t) {
  return {
    tokenization: {
      getLineTokens: (r) => r === e ? t : i.tokenization.getLineTokens(r),
      getLanguageId: () => i.getLanguageId(),
      getLanguageIdAtPosition: (r, s) => i.getLanguageIdAtPosition(r, s)
    },
    getLineContent: (r) => r === e ? t.getLineContent() : i.getLineContent(r)
  };
}
class Kst {
  static getEdits(e, t, n, r, s) {
    if (!s && this._isAutoIndentType(e, t, n)) {
      const o = [];
      for (const l of n) {
        const c = this._findActualIndentationForSelection(e, t, l, r);
        if (c === null)
          return;
        o.push({ selection: l, indentation: c });
      }
      const a = Aie.getAutoClosingPairClose(e, t, n, r, !1);
      return this._getIndentationAndAutoClosingPairEdits(e, t, o, r, a);
    }
  }
  static _isAutoIndentType(e, t, n) {
    if (e.autoIndent < 4)
      return !1;
    for (let r = 0, s = n.length; r < s; r++)
      if (!t.tokenization.isCheapToTokenize(n[r].getEndPosition().lineNumber))
        return !1;
    return !0;
  }
  static _findActualIndentationForSelection(e, t, n, r) {
    const s = Gst(e, t, n, r, {
      shiftIndent: (a) => pfe(e, a),
      unshiftIndent: (a) => qV(e, a)
    }, e.languageConfigurationService);
    if (s === null)
      return null;
    const o = pFe(t, n.startLineNumber, n.startColumn);
    return s === e.normalizeIndentation(o) ? null : s;
  }
  static _getIndentationAndAutoClosingPairEdits(e, t, n, r, s) {
    const o = n.map(({ selection: l, indentation: c }) => {
      if (s !== null) {
        const u = this._getEditFromIndentationAndSelection(e, t, c, l, r, !1);
        return new sot(u, l, r, s);
      } else {
        const u = this._getEditFromIndentationAndSelection(e, t, c, l, r, !0);
        return CE(u.range, u.text, !1);
      }
    }), a = { shouldPushStackElementBefore: !0, shouldPushStackElementAfter: !1 };
    return new uu(4, o, a);
  }
  static _getEditFromIndentationAndSelection(e, t, n, r, s, o = !0) {
    const a = r.startLineNumber, l = t.getLineFirstNonWhitespaceColumn(a);
    let c = e.normalizeIndentation(n);
    if (l !== 0) {
      const d = t.getLineContent(a);
      c += d.substring(l - 1, r.startColumn - 1);
    }
    return c += o ? s : "", { range: new z(a, 1, r.endLineNumber, r.endColumn), text: c };
  }
}
class Yst {
  static getEdits(e, t, n, r, s, o) {
    if (vFe(t, n, r, s, o))
      return this._runAutoClosingOvertype(e, r, o);
  }
  static _runAutoClosingOvertype(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const l = t[s].getPosition(), c = new z(l.lineNumber, l.column, l.lineNumber, l.column + 1);
      r[s] = new bl(c, n);
    }
    return new uu(4, r, {
      shouldPushStackElementBefore: Wq(
        e,
        4
        /* EditOperationType.TypingOther */
      ),
      shouldPushStackElementAfter: !1
    });
  }
}
class Xst {
  static getEdits(e, t, n, r, s) {
    if (vFe(e, t, n, r, s)) {
      const o = n.map((a) => new bl(new z(a.positionLineNumber, a.positionColumn, a.positionLineNumber, a.positionColumn + 1), "", !1));
      return new uu(4, o, {
        shouldPushStackElementBefore: !0,
        shouldPushStackElementAfter: !1
      });
    }
  }
}
class Aie {
  static getEdits(e, t, n, r, s, o) {
    if (!o) {
      const a = this.getAutoClosingPairClose(e, t, n, r, s);
      if (a !== null)
        return this._runAutoClosingOpenCharType(n, r, s, a);
    }
  }
  static _runAutoClosingOpenCharType(e, t, n, r) {
    const s = [];
    for (let o = 0, a = e.length; o < a; o++) {
      const l = e[o];
      s[o] = new rot(l, t, !n, r);
    }
    return new uu(4, s, {
      shouldPushStackElementBefore: !0,
      shouldPushStackElementAfter: !1
    });
  }
  static getAutoClosingPairClose(e, t, n, r, s) {
    for (const m of n)
      if (!m.isEmpty())
        return null;
    const o = n.map((m) => {
      const _ = m.getPosition();
      return s ? { lineNumber: _.lineNumber, beforeColumn: _.column - r.length, afterColumn: _.column } : { lineNumber: _.lineNumber, beforeColumn: _.column, afterColumn: _.column };
    }), a = this._findAutoClosingPairOpen(e, t, o.map((m) => new de(m.lineNumber, m.beforeColumn)), r);
    if (!a)
      return null;
    let l, c;
    if (ow(r) ? (l = e.autoClosingQuotes, c = e.shouldAutoCloseBefore.quote) : (e.blockCommentStartToken ? a.open.includes(e.blockCommentStartToken) : !1) ? (l = e.autoClosingComments, c = e.shouldAutoCloseBefore.comment) : (l = e.autoClosingBrackets, c = e.shouldAutoCloseBefore.bracket), l === "never")
      return null;
    const d = this._findContainedAutoClosingPair(e, a), h = d ? d.close : "";
    let g = !0;
    for (const m of o) {
      const { lineNumber: _, beforeColumn: v, afterColumn: w } = m, E = t.getLineContent(_), L = E.substring(0, v - 1), T = E.substring(w - 1);
      if (T.startsWith(h) || (g = !1), T.length > 0) {
        const M = T.charAt(0);
        if (!this._isBeforeClosingBrace(e, T) && !c(M))
          return null;
      }
      if (a.open.length === 1 && (r === "'" || r === '"') && l !== "always") {
        const M = Yf(e.wordSeparators, []);
        if (L.length > 0) {
          const B = L.charCodeAt(L.length - 1);
          if (M.get(B) === 0)
            return null;
        }
      }
      if (!t.tokenization.isCheapToTokenize(_))
        return null;
      t.tokenization.forceTokenization(_);
      const D = t.tokenization.getLineTokens(_), N = hx(D, v - 1);
      if (!a.shouldAutoClose(N, v - N.firstCharOffset))
        return null;
      const R = a.findNeutralCharacter();
      if (R) {
        const M = t.tokenization.getTokenTypeIfInsertingCharacter(_, v, R);
        if (!a.isOK(M))
          return null;
      }
    }
    return g ? a.close.substring(0, a.close.length - h.length) : a.close;
  }
  /**
   * Find another auto-closing pair that is contained by the one passed in.
   *
   * e.g. when having [(,)] and [(*,*)] as auto-closing pairs
   * this method will find [(,)] as a containment pair for [(*,*)]
   */
  static _findContainedAutoClosingPair(e, t) {
    if (t.open.length <= 1)
      return null;
    const n = t.close.charAt(t.close.length - 1), r = e.autoClosingPairs.autoClosingPairsCloseByEnd.get(n) || [];
    let s = null;
    for (const o of r)
      o.open !== t.open && t.open.includes(o.open) && t.close.endsWith(o.close) && (!s || o.open.length > s.open.length) && (s = o);
    return s;
  }
  /**
   * Determine if typing `ch` at all `positions` in the `model` results in an
   * auto closing open sequence being typed.
   *
   * Auto closing open sequences can consist of multiple characters, which
   * can lead to ambiguities. In such a case, the longest auto-closing open
   * sequence is returned.
   */
  static _findAutoClosingPairOpen(e, t, n, r) {
    const s = e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);
    if (!s)
      return null;
    let o = null;
    for (const a of s)
      if (o === null || a.open.length > o.open.length) {
        let l = !0;
        for (const c of n)
          if (t.getValueInRange(new z(c.lineNumber, c.column - a.open.length + 1, c.lineNumber, c.column)) + r !== a.open) {
            l = !1;
            break;
          }
        l && (o = a);
      }
    return o;
  }
  static _isBeforeClosingBrace(e, t) {
    const n = t.charAt(0), r = e.autoClosingPairs.autoClosingPairsOpenByStart.get(n) || [], s = e.autoClosingPairs.autoClosingPairsCloseByStart.get(n) || [], o = r.some((l) => t.startsWith(l.open)), a = s.some((l) => t.startsWith(l.close));
    return !o && a;
  }
}
class gLe {
  static getEdits(e, t) {
    if (!(e.inputMode === "overtype"))
      return null;
    const r = t.map((s) => new Zrt(s.insertedTextRange));
    return new uu(4, r, {
      shouldPushStackElementBefore: !0,
      shouldPushStackElementAfter: !1
    });
  }
}
class Zst {
  static getEdits(e, t, n, r, s) {
    if (!s && this._isSurroundSelectionType(e, t, n, r))
      return this._runSurroundSelectionType(e, n, r);
  }
  static _runSurroundSelectionType(e, t, n) {
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = e.surroundingPairs[n];
      r[s] = new Ust(a, n, l);
    }
    return new uu(0, r, {
      shouldPushStackElementBefore: !0,
      shouldPushStackElementAfter: !0
    });
  }
  static _isSurroundSelectionType(e, t, n, r) {
    if (!yFe(e, r) || !e.surroundingPairs.hasOwnProperty(r))
      return !1;
    const s = ow(r);
    for (const o of n) {
      if (o.isEmpty())
        return !1;
      let a = !0;
      for (let l = o.startLineNumber; l <= o.endLineNumber; l++) {
        const c = t.getLineContent(l), u = l === o.startLineNumber ? o.startColumn - 1 : 0, d = l === o.endLineNumber ? o.endColumn - 1 : c.length, h = c.substring(u, d);
        if (/[^ \t]/.test(h)) {
          a = !1;
          break;
        }
      }
      if (a)
        return !1;
      if (s && o.startLineNumber === o.endLineNumber && o.startColumn + 1 === o.endColumn) {
        const l = t.getValueInRange(o);
        if (ow(l))
          return !1;
      }
    }
    return !0;
  }
}
class Qst {
  static getEdits(e, t, n, r, s, o) {
    if (!o && this._isTypeInterceptorElectricChar(t, n, r)) {
      const a = this._typeInterceptorElectricChar(e, t, n, r[0], s);
      if (a)
        return a;
    }
  }
  static _isTypeInterceptorElectricChar(e, t, n) {
    return !!(n.length === 1 && t.tokenization.isCheapToTokenize(n[0].getEndPosition().lineNumber));
  }
  static _typeInterceptorElectricChar(e, t, n, r, s) {
    if (!t.electricChars.hasOwnProperty(s) || !r.isEmpty())
      return null;
    const o = r.getPosition();
    n.tokenization.forceTokenization(o.lineNumber);
    const a = n.tokenization.getLineTokens(o.lineNumber);
    let l;
    try {
      l = t.onElectricCharacter(s, a, o.column);
    } catch (c) {
      return fn(c), null;
    }
    if (!l)
      return null;
    if (l.matchOpenBracket) {
      const c = (a.getLineContent() + s).lastIndexOf(l.matchOpenBracket) + 1, u = n.bracketPairs.findMatchingBracketUp(
        l.matchOpenBracket,
        {
          lineNumber: o.lineNumber,
          column: c
        },
        500
        /* give at most 500ms to compute */
      );
      if (u) {
        if (u.startLineNumber === o.lineNumber)
          return null;
        const d = n.getLineContent(u.startLineNumber), h = Ir(d), g = t.normalizeIndentation(h), m = n.getLineContent(o.lineNumber), _ = n.getLineFirstNonWhitespaceColumn(o.lineNumber) || o.column, v = m.substring(_ - 1, o.column - 1), w = g + v + s, E = new z(o.lineNumber, 1, o.lineNumber, o.column), L = new bl(E, w);
        return new uu(gfe(w, e), [L], {
          shouldPushStackElementBefore: !1,
          shouldPushStackElementAfter: !0
        });
      }
    }
    return null;
  }
}
class Jst {
  static getEdits(e, t, n, r, s) {
    const o = [];
    for (let l = 0, c = n.length; l < c; l++) {
      const u = e.inputMode === "overtype" && !s ? Lie : bl;
      o[l] = new u(n[l], r);
    }
    const a = gfe(r, t);
    return new uu(a, o, {
      shouldPushStackElementBefore: Wq(t, a),
      shouldPushStackElementAfter: !1
    });
  }
}
class Hq {
  static getEdits(e, t, n, r, s) {
    if (!s && r === `
`) {
      const o = [];
      for (let a = 0, l = n.length; a < l; a++)
        o[a] = this._enter(e, t, !1, n[a]);
      return new uu(4, o, {
        shouldPushStackElementBefore: !0,
        shouldPushStackElementAfter: !1
      });
    }
  }
  static _enter(e, t, n, r) {
    if (e.autoIndent === 0)
      return CE(r, `
`, n);
    if (!t.tokenization.isCheapToTokenize(r.getStartPosition().lineNumber) || e.autoIndent === 1) {
      const l = t.getLineContent(r.startLineNumber), c = Ir(l).substring(0, r.startColumn - 1);
      return CE(r, `
` + e.normalizeIndentation(c), n);
    }
    const s = qN(e.autoIndent, t, r, e.languageConfigurationService);
    if (s) {
      if (s.indentAction === Vo.None)
        return CE(r, `
` + e.normalizeIndentation(s.indentation + s.appendText), n);
      if (s.indentAction === Vo.Indent)
        return CE(r, `
` + e.normalizeIndentation(s.indentation + s.appendText), n);
      if (s.indentAction === Vo.IndentOutdent) {
        const l = e.normalizeIndentation(s.indentation), c = e.normalizeIndentation(s.indentation + s.appendText), u = `
` + c + `
` + l;
        return n ? new EW(r, u, !0) : new WV(r, u, -1, c.length - l.length, !0);
      } else if (s.indentAction === Vo.Outdent) {
        const l = qV(e, s.indentation);
        return CE(r, `
` + e.normalizeIndentation(l + s.appendText), n);
      }
    }
    const o = t.getLineContent(r.startLineNumber), a = Ir(o).substring(0, r.startColumn - 1);
    if (e.autoIndent >= 4) {
      const l = jst(e.autoIndent, t, r, {
        unshiftIndent: (c) => qV(e, c),
        shiftIndent: (c) => pfe(e, c),
        normalizeIndentation: (c) => e.normalizeIndentation(c)
      }, e.languageConfigurationService);
      if (l) {
        let c = e.visibleColumnFromColumn(t, r.getEndPosition());
        const u = r.endColumn, d = t.getLineContent(r.endLineNumber), h = Tc(d);
        if (h >= 0 ? r = r.setEndPosition(r.endLineNumber, Math.max(r.endColumn, h + 1)) : r = r.setEndPosition(r.endLineNumber, t.getLineMaxColumn(r.endLineNumber)), n)
          return new EW(r, `
` + e.normalizeIndentation(l.afterEnter), !0);
        {
          let g = 0;
          return u <= h + 1 && (e.insertSpaces || (c = Math.ceil(c / e.indentSize)), g = Math.min(c + 1 - e.normalizeIndentation(l.afterEnter).length - 1, 0)), new WV(r, `
` + e.normalizeIndentation(l.afterEnter), 0, g, !0);
        }
      }
    }
    return CE(r, `
` + e.normalizeIndentation(a), n);
  }
  static lineInsertBefore(e, t, n) {
    if (t === null || n === null)
      return [];
    const r = [];
    for (let s = 0, o = n.length; s < o; s++) {
      let a = n[s].positionLineNumber;
      if (a === 1)
        r[s] = new EW(new z(1, 1, 1, 1), `
`);
      else {
        a--;
        const l = t.getLineMaxColumn(a);
        r[s] = this._enter(e, t, !1, new z(a, l, a, l));
      }
    }
    return r;
  }
  static lineInsertAfter(e, t, n) {
    if (t === null || n === null)
      return [];
    const r = [];
    for (let s = 0, o = n.length; s < o; s++) {
      const a = n[s].positionLineNumber, l = t.getLineMaxColumn(a);
      r[s] = this._enter(e, t, !1, new z(a, l, a, l));
    }
    return r;
  }
  static lineBreakInsert(e, t, n) {
    const r = [];
    for (let s = 0, o = n.length; s < o; s++)
      r[s] = this._enter(e, t, !0, n[s]);
    return r;
  }
}
class eot {
  static getEdits(e, t, n, r, s, o) {
    const a = this._distributePasteToCursors(e, n, r, s, o);
    return a ? (n = n.sort(z.compareRangesUsingStarts), this._distributedPaste(e, t, n, a)) : this._simplePaste(e, t, n, r, s);
  }
  static _distributePasteToCursors(e, t, n, r, s) {
    if (r || t.length === 1)
      return null;
    if (s && s.length === t.length)
      return s;
    if (e.multiCursorPaste === "spread") {
      n.charCodeAt(n.length - 1) === 10 && (n = n.substring(0, n.length - 1)), n.charCodeAt(n.length - 1) === 13 && (n = n.substring(0, n.length - 1));
      const o = $d(n);
      if (o.length === t.length)
        return o;
    }
    return null;
  }
  static _distributedPaste(e, t, n, r) {
    const s = [];
    for (let o = 0, a = n.length; o < a; o++) {
      const c = e.overtypeOnPaste && e.inputMode === "overtype" ? Lie : bl;
      s[o] = new c(n[o], r[o]);
    }
    return new uu(0, s, {
      shouldPushStackElementBefore: !0,
      shouldPushStackElementAfter: !0
    });
  }
  static _simplePaste(e, t, n, r, s) {
    const o = [];
    for (let a = 0, l = n.length; a < l; a++) {
      const c = n[a], u = c.getPosition();
      if (s && !c.isEmpty() && (s = !1), s && r.indexOf(`
`) !== r.length - 1 && (s = !1), s) {
        const d = new z(u.lineNumber, 1, u.lineNumber, 1);
        o[a] = new rfe(d, r, c, !0);
      } else {
        const h = e.overtypeOnPaste && e.inputMode === "overtype" ? Lie : bl;
        o[a] = new h(c, r);
      }
    }
    return new uu(0, o, {
      shouldPushStackElementBefore: !0,
      shouldPushStackElementAfter: !0
    });
  }
}
class tot {
  static getEdits(e, t, n, r, s, o, a, l) {
    const c = r.map((u) => this._compositionType(n, u, s, o, a, l));
    return new uu(4, c, {
      shouldPushStackElementBefore: Wq(
        e,
        4
        /* EditOperationType.TypingOther */
      ),
      shouldPushStackElementAfter: !1
    });
  }
  static _compositionType(e, t, n, r, s, o) {
    if (!t.isEmpty())
      return null;
    const a = t.getPosition(), l = Math.max(1, a.column - r), c = Math.min(e.getLineMaxColumn(a.lineNumber), a.column + s), u = new z(a.lineNumber, l, a.lineNumber, c);
    return new WV(u, n, 0, o);
  }
}
class not {
  static getEdits(e, t, n) {
    const r = [];
    for (let o = 0, a = t.length; o < a; o++)
      r[o] = new bl(t[o], n);
    const s = gfe(n, e);
    return new uu(s, r, {
      shouldPushStackElementBefore: Wq(e, s),
      shouldPushStackElementAfter: !1
    });
  }
}
class iot {
  static getCommands(e, t, n) {
    const r = [];
    for (let s = 0, o = n.length; s < o; s++) {
      const a = n[s];
      if (a.isEmpty()) {
        const l = t.getLineContent(a.startLineNumber);
        if (/^\s*$/.test(l) && t.tokenization.isCheapToTokenize(a.startLineNumber)) {
          let c = this._goodIndentForLine(e, t, a.startLineNumber);
          c = c || "	";
          const u = e.normalizeIndentation(c);
          if (!l.startsWith(u)) {
            r[s] = new bl(new z(a.startLineNumber, 1, a.startLineNumber, l.length + 1), u, !0);
            continue;
          }
        }
        r[s] = this._replaceJumpToNextIndent(e, t, a, !0);
      } else {
        if (a.startLineNumber === a.endLineNumber) {
          const l = t.getLineMaxColumn(a.startLineNumber);
          if (a.startColumn !== 1 || a.endColumn !== l) {
            r[s] = this._replaceJumpToNextIndent(e, t, a, !1);
            continue;
          }
        }
        r[s] = new Xf(a, {
          isUnshift: !1,
          tabSize: e.tabSize,
          indentSize: e.indentSize,
          insertSpaces: e.insertSpaces,
          useTabStops: e.useTabStops,
          autoIndent: e.autoIndent
        }, e.languageConfigurationService);
      }
    }
    return r;
  }
  static _goodIndentForLine(e, t, n) {
    let r = null, s = "";
    const o = u4(e.autoIndent, t, n, !1, e.languageConfigurationService);
    if (o)
      r = o.action, s = o.indentation;
    else if (n > 1) {
      let a;
      for (a = n - 1; a >= 1; a--) {
        const u = t.getLineContent(a);
        if (zg(u) >= 0)
          break;
      }
      if (a < 1)
        return null;
      const l = t.getLineMaxColumn(a), c = qN(e.autoIndent, t, new z(a, l, a, l), e.languageConfigurationService);
      c && (s = c.indentation + c.appendText);
    }
    return r && (r === Vo.Indent && (s = pfe(e, s)), r === Vo.Outdent && (s = qV(e, s)), s = e.normalizeIndentation(s)), s || null;
  }
  static _replaceJumpToNextIndent(e, t, n, r) {
    let s = "";
    const o = n.getStartPosition();
    if (e.insertSpaces) {
      const a = e.visibleColumnFromColumn(t, o), l = e.indentSize, c = l - a % l;
      for (let u = 0; u < c; u++)
        s += " ";
    } else
      s = "	";
    return new bl(n, s, r);
  }
}
class ffe extends WV {
  constructor(e, t, n, r, s, o) {
    super(e, t, n, r), this._openCharacter = s, this._closeCharacter = o, this.closeCharacterRange = null, this.enclosingRange = null;
  }
  _computeCursorStateWithRange(e, t, n) {
    return this.closeCharacterRange = new z(t.startLineNumber, t.endColumn - this._closeCharacter.length, t.endLineNumber, t.endColumn), this.enclosingRange = new z(t.startLineNumber, t.endColumn - this._openCharacter.length - this._closeCharacter.length, t.endLineNumber, t.endColumn), super.computeCursorState(e, n);
  }
}
class rot extends ffe {
  constructor(e, t, n, r) {
    const s = (n ? t : "") + r, o = 0, a = -r.length;
    super(e, s, o, a, t, r);
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return this._computeCursorStateWithRange(e, r, t);
  }
}
class sot extends ffe {
  constructor(e, t, n, r) {
    const s = n + r, o = 0, a = n.length;
    super(t, s, o, a, n, r), this._autoIndentationEdit = e, this._autoClosingEdit = { range: t, text: s };
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._autoIndentationEdit.range, this._autoIndentationEdit.text), t.addTrackedEditOperation(this._autoClosingEdit.range, this._autoClosingEdit.text);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations();
    if (n.length !== 2)
      throw new Error("There should be two inverse edit operations!");
    const r = n[0].range, s = n[1].range, o = r.plusRange(s);
    return this._computeCursorStateWithRange(e, o, t);
  }
}
function gfe(i, e) {
  return i === " " ? e === 5 || e === 6 ? 6 : 5 : 4;
}
function Wq(i, e) {
  return mLe(i) && !mLe(e) ? !0 : i === 5 ? !1 : pLe(i) !== pLe(e);
}
function pLe(i) {
  return i === 6 || i === 5 ? "space" : i;
}
function mLe(i) {
  return i === 4 || i === 5 || i === 6;
}
function vFe(i, e, t, n, r) {
  if (i.autoClosingOvertype === "never" || !i.autoClosingPairs.autoClosingPairsCloseSingleChar.has(r))
    return !1;
  for (let s = 0, o = t.length; s < o; s++) {
    const a = t[s];
    if (!a.isEmpty())
      return !1;
    const l = a.getPosition(), c = e.getLineContent(l.lineNumber);
    if (c.charAt(l.column - 1) !== r)
      return !1;
    const d = ow(r);
    if ((l.column > 2 ? c.charCodeAt(l.column - 2) : 0) === 92 && d)
      return !1;
    if (i.autoClosingOvertype === "auto") {
      let g = !1;
      for (let m = 0, _ = n.length; m < _; m++) {
        const v = n[m];
        if (l.lineNumber === v.startLineNumber && l.column === v.startColumn) {
          g = !0;
          break;
        }
      }
      if (!g)
        return !1;
    }
  }
  return !0;
}
function CE(i, e, t) {
  return t ? new EW(i, e, !0) : new bl(i, e, !0);
}
function pfe(i, e, t) {
  return t = t || 1, Xf.shiftIndent(e, e.length + t, i.tabSize, i.indentSize, i.insertSpaces);
}
function qV(i, e, t) {
  return t = t || 1, Xf.unshiftIndent(e, e.length + t, i.tabSize, i.indentSize, i.insertSpaces);
}
function yFe(i, e) {
  return ow(e) ? i.autoSurround === "quotes" || i.autoSurround === "languageDefined" : i.autoSurround === "brackets" || i.autoSurround === "languageDefined";
}
class YC {
  static indent(e, t, n) {
    if (t === null || n === null)
      return [];
    const r = [];
    for (let s = 0, o = n.length; s < o; s++)
      r[s] = new Xf(n[s], {
        isUnshift: !1,
        tabSize: e.tabSize,
        indentSize: e.indentSize,
        insertSpaces: e.insertSpaces,
        useTabStops: e.useTabStops,
        autoIndent: e.autoIndent
      }, e.languageConfigurationService);
    return r;
  }
  static outdent(e, t, n) {
    const r = [];
    for (let s = 0, o = n.length; s < o; s++)
      r[s] = new Xf(n[s], {
        isUnshift: !0,
        tabSize: e.tabSize,
        indentSize: e.indentSize,
        insertSpaces: e.insertSpaces,
        useTabStops: e.useTabStops,
        autoIndent: e.autoIndent
      }, e.languageConfigurationService);
    return r;
  }
  static paste(e, t, n, r, s, o) {
    return eot.getEdits(e, t, n, r, s, o);
  }
  static tab(e, t, n) {
    return iot.getCommands(e, t, n);
  }
  static compositionType(e, t, n, r, s, o, a, l) {
    return tot.getEdits(e, t, n, r, s, o, a, l);
  }
  /**
   * This is very similar with typing, but the character is already in the text buffer!
   */
  static compositionEndWithInterceptors(e, t, n, r, s, o) {
    if (!r)
      return null;
    let a = null;
    for (const h of r)
      if (a === null)
        a = h.insertedText;
      else if (a !== h.insertedText)
        return null;
    if (!a || a.length !== 1)
      return gLe.getEdits(t, r);
    const l = a;
    let c = !1;
    for (const h of r)
      if (h.deletedText.length !== 0) {
        c = !0;
        break;
      }
    if (c) {
      if (!yFe(t, l) || !t.surroundingPairs.hasOwnProperty(l))
        return null;
      const h = ow(l);
      for (const _ of r)
        if (_.deletedSelectionStart !== 0 || _.deletedSelectionEnd !== _.deletedText.length || /^[ \t]+$/.test(_.deletedText) || h && ow(_.deletedText))
          return null;
      const g = [];
      for (const _ of s) {
        if (!_.isEmpty())
          return null;
        g.push(_.getPosition());
      }
      if (g.length !== r.length)
        return null;
      const m = [];
      for (let _ = 0, v = g.length; _ < v; _++)
        m.push(new zst(g[_], r[_].deletedText, t.surroundingPairs[l]));
      return new uu(4, m, {
        shouldPushStackElementBefore: !0,
        shouldPushStackElementAfter: !1
      });
    }
    const u = Xst.getEdits(t, n, s, o, l);
    if (u !== void 0)
      return u;
    const d = Aie.getEdits(t, n, s, l, !0, !1);
    return d !== void 0 ? d : gLe.getEdits(t, r);
  }
  static typeWithInterceptors(e, t, n, r, s, o, a) {
    const l = Hq.getEdits(n, r, s, a, e);
    if (l !== void 0)
      return l;
    const c = Kst.getEdits(n, r, s, a, e);
    if (c !== void 0)
      return c;
    const u = Yst.getEdits(t, n, r, s, o, a);
    if (u !== void 0)
      return u;
    const d = Aie.getEdits(n, r, s, a, !1, e);
    if (d !== void 0)
      return d;
    const h = Zst.getEdits(n, r, s, a, e);
    if (h !== void 0)
      return h;
    const g = Qst.getEdits(t, n, r, s, a, e);
    return g !== void 0 ? g : Jst.getEdits(n, t, s, a, e);
  }
  static typeWithoutInterceptors(e, t, n, r, s) {
    return not.getEdits(e, r, s);
  }
}
class oot {
  constructor(e, t, n, r, s, o, a) {
    this.deletedText = e, this.deletedSelectionStart = t, this.deletedSelectionEnd = n, this.insertedText = r, this.insertedSelectionStart = s, this.insertedSelectionEnd = o, this.insertedTextRange = a;
  }
}
var se;
(function(i) {
  i.editorSimpleInput = new ut("editorSimpleInput", !1, !0), i.editorTextFocus = new ut("editorTextFocus", !1, S(678, "Whether the editor text has focus (cursor is blinking)")), i.focus = new ut("editorFocus", !1, S(679, "Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")), i.textInputFocus = new ut("textInputFocus", !1, S(680, "Whether an editor or a rich text input has focus (cursor is blinking)")), i.readOnly = new ut("editorReadonly", !1, S(681, "Whether the editor is read-only")), i.inDiffEditor = new ut("inDiffEditor", !1, S(682, "Whether the context is a diff editor")), i.isEmbeddedDiffEditor = new ut("isEmbeddedDiffEditor", !1, S(683, "Whether the context is an embedded diff editor")), i.multiDiffEditorAllCollapsed = new ut("multiDiffEditorAllCollapsed", void 0, S(684, "Whether all files in multi diff editor are collapsed")), i.hasChanges = new ut("diffEditorHasChanges", !1, S(685, "Whether the diff editor has changes")), i.comparingMovedCode = new ut("comparingMovedCode", !1, S(686, "Whether a moved code block is selected for comparison")), i.accessibleDiffViewerVisible = new ut("accessibleDiffViewerVisible", !1, S(687, "Whether the accessible diff viewer is visible")), i.diffEditorRenderSideBySideInlineBreakpointReached = new ut("diffEditorRenderSideBySideInlineBreakpointReached", !1, S(688, "Whether the diff editor render side by side inline breakpoint is reached")), i.diffEditorInlineMode = new ut("diffEditorInlineMode", !1, S(689, "Whether inline mode is active")), i.diffEditorOriginalWritable = new ut("diffEditorOriginalWritable", !1, S(690, "Whether modified is writable in the diff editor")), i.diffEditorModifiedWritable = new ut("diffEditorModifiedWritable", !1, S(691, "Whether modified is writable in the diff editor")), i.diffEditorOriginalUri = new ut("diffEditorOriginalUri", "", S(692, "The uri of the original document")), i.diffEditorModifiedUri = new ut("diffEditorModifiedUri", "", S(693, "The uri of the modified document")), i.columnSelection = new ut("editorColumnSelection", !1, S(694, "Whether `editor.columnSelection` is enabled")), i.writable = i.readOnly.toNegated(), i.hasNonEmptySelection = new ut("editorHasSelection", !1, S(695, "Whether the editor has text selected")), i.hasOnlyEmptySelection = i.hasNonEmptySelection.toNegated(), i.hasMultipleSelections = new ut("editorHasMultipleSelections", !1, S(696, "Whether the editor has multiple selections")), i.hasSingleSelection = i.hasMultipleSelections.toNegated(), i.tabMovesFocus = new ut("editorTabMovesFocus", !1, S(697, "Whether `Tab` will move focus out of the editor")), i.tabDoesNotMoveFocus = i.tabMovesFocus.toNegated(), i.isInEmbeddedEditor = new ut("isInEmbeddedEditor", !1, !0), i.canUndo = new ut("canUndo", !1, !0), i.canRedo = new ut("canRedo", !1, !0), i.hoverVisible = new ut("editorHoverVisible", !1, S(698, "Whether the editor hover is visible")), i.hoverFocused = new ut("editorHoverFocused", !1, S(699, "Whether the editor hover is focused")), i.stickyScrollFocused = new ut("stickyScrollFocused", !1, S(700, "Whether the sticky scroll is focused")), i.stickyScrollVisible = new ut("stickyScrollVisible", !1, S(701, "Whether the sticky scroll is visible")), i.standaloneColorPickerVisible = new ut("standaloneColorPickerVisible", !1, S(702, "Whether the standalone color picker is visible")), i.standaloneColorPickerFocused = new ut("standaloneColorPickerFocused", !1, S(703, "Whether the standalone color picker is focused")), i.inCompositeEditor = new ut("inCompositeEditor", void 0, S(704, "Whether the editor is part of a larger editor (e.g. notebooks)")), i.notInCompositeEditor = i.inCompositeEditor.toNegated(), i.languageId = new ut("editorLangId", "", S(705, "The language identifier of the editor")), i.hasCompletionItemProvider = new ut("editorHasCompletionItemProvider", !1, S(706, "Whether the editor has a completion item provider")), i.hasCodeActionsProvider = new ut("editorHasCodeActionsProvider", !1, S(707, "Whether the editor has a code actions provider")), i.hasCodeLensProvider = new ut("editorHasCodeLensProvider", !1, S(708, "Whether the editor has a code lens provider")), i.hasDefinitionProvider = new ut("editorHasDefinitionProvider", !1, S(709, "Whether the editor has a definition provider")), i.hasDeclarationProvider = new ut("editorHasDeclarationProvider", !1, S(710, "Whether the editor has a declaration provider")), i.hasImplementationProvider = new ut("editorHasImplementationProvider", !1, S(711, "Whether the editor has an implementation provider")), i.hasTypeDefinitionProvider = new ut("editorHasTypeDefinitionProvider", !1, S(712, "Whether the editor has a type definition provider")), i.hasHoverProvider = new ut("editorHasHoverProvider", !1, S(713, "Whether the editor has a hover provider")), i.hasDocumentHighlightProvider = new ut("editorHasDocumentHighlightProvider", !1, S(714, "Whether the editor has a document highlight provider")), i.hasDocumentSymbolProvider = new ut("editorHasDocumentSymbolProvider", !1, S(715, "Whether the editor has a document symbol provider")), i.hasReferenceProvider = new ut("editorHasReferenceProvider", !1, S(716, "Whether the editor has a reference provider")), i.hasRenameProvider = new ut("editorHasRenameProvider", !1, S(717, "Whether the editor has a rename provider")), i.hasSignatureHelpProvider = new ut("editorHasSignatureHelpProvider", !1, S(718, "Whether the editor has a signature help provider")), i.hasInlayHintsProvider = new ut("editorHasInlayHintsProvider", !1, S(719, "Whether the editor has an inline hints provider")), i.hasDocumentFormattingProvider = new ut("editorHasDocumentFormattingProvider", !1, S(720, "Whether the editor has a document formatting provider")), i.hasDocumentSelectionFormattingProvider = new ut("editorHasDocumentSelectionFormattingProvider", !1, S(721, "Whether the editor has a document selection formatting provider")), i.hasMultipleDocumentFormattingProvider = new ut("editorHasMultipleDocumentFormattingProvider", !1, S(722, "Whether the editor has multiple document formatting providers")), i.hasMultipleDocumentSelectionFormattingProvider = new ut("editorHasMultipleDocumentSelectionFormattingProvider", !1, S(723, "Whether the editor has multiple document selection formatting providers"));
})(se || (se = {}));
const $i = 0;
class lo extends jo {
  runEditorCommand(e, t, n) {
    const r = t._getViewModel();
    r && this.runCoreEditorCommand(r, n || {});
  }
}
var al;
(function(i) {
  const e = function(n) {
    if (!Ra(n))
      return !1;
    const r = n;
    return !(!ga(r.to) || !Ec(r.by) && !ga(r.by) || !Ec(r.value) && !zy(r.value) || !Ec(r.revealCursor) && !AMe(r.revealCursor));
  };
  i.metadata = {
    description: "Scroll editor in the given direction",
    args: [
      {
        name: "Editor scroll argument object",
        description: "Property-value pairs that can be passed through this argument:\n					* 'to': A mandatory direction value.\n						```\n						'up', 'down'\n						```\n					* 'by': Unit to move. Default is computed based on 'to' value.\n						```\n						'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n						```\n					* 'value': Number of units to move. Default is '1'.\n					* 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n				",
        constraint: e,
        schema: {
          type: "object",
          required: ["to"],
          properties: {
            to: {
              type: "string",
              enum: ["up", "down"]
            },
            by: {
              type: "string",
              enum: ["line", "wrappedLine", "page", "halfPage", "editor"]
            },
            value: {
              type: "number",
              default: 1
            },
            revealCursor: {
              type: "boolean"
            }
          }
        }
      }
    ]
  }, i.RawDirection = {
    Up: "up",
    Right: "right",
    Down: "down",
    Left: "left"
  }, i.RawUnit = {
    Line: "line",
    WrappedLine: "wrappedLine",
    Page: "page",
    HalfPage: "halfPage",
    Editor: "editor",
    Column: "column"
  };
  function t(n) {
    let r;
    switch (n.to) {
      case i.RawDirection.Up:
        r = 1;
        break;
      case i.RawDirection.Right:
        r = 2;
        break;
      case i.RawDirection.Down:
        r = 3;
        break;
      case i.RawDirection.Left:
        r = 4;
        break;
      default:
        return null;
    }
    let s;
    switch (n.by) {
      case i.RawUnit.Line:
        s = 1;
        break;
      case i.RawUnit.WrappedLine:
        s = 2;
        break;
      case i.RawUnit.Page:
        s = 3;
        break;
      case i.RawUnit.HalfPage:
        s = 4;
        break;
      case i.RawUnit.Editor:
        s = 5;
        break;
      case i.RawUnit.Column:
        s = 6;
        break;
      default:
        s = 2;
    }
    const o = Math.floor(n.value || 1), a = !!n.revealCursor;
    return {
      direction: r,
      unit: s,
      value: o,
      revealCursor: a,
      select: !!n.select
    };
  }
  i.parse = t;
})(al || (al = {}));
var rN;
(function(i) {
  const e = function(t) {
    if (!Ra(t))
      return !1;
    const n = t;
    return !(!zy(n.lineNumber) && !ga(n.lineNumber) || !Ec(n.at) && !ga(n.at));
  };
  i.metadata = {
    description: "Reveal the given line at the given logical position",
    args: [
      {
        name: "Reveal line argument object",
        description: "Property-value pairs that can be passed through this argument:\n					* 'lineNumber': A mandatory line number value.\n					* 'at': Logical position at which line has to be revealed.\n						```\n						'top', 'center', 'bottom'\n						```\n				",
        constraint: e,
        schema: {
          type: "object",
          required: ["lineNumber"],
          properties: {
            lineNumber: {
              type: ["number", "string"]
            },
            at: {
              type: "string",
              enum: ["top", "center", "bottom"]
            }
          }
        }
      }
    ]
  }, i.RawAtArgument = {
    Top: "top",
    Center: "center",
    Bottom: "bottom"
  };
})(rN || (rN = {}));
class Oie {
  constructor(e) {
    e.addImplementation(1e4, "code-editor", (t, n) => {
      const r = t.get(Ti).getFocusedCodeEditor();
      return r && r.hasTextFocus() ? this._runEditorCommand(t, r, n) : !1;
    }), e.addImplementation(1e3, "generic-dom-input-textarea", (t, n) => {
      const r = ea();
      return r && sm(r) ? (this.runDOMCommand(r), !0) : !1;
    }), e.addImplementation(0, "generic-dom", (t, n) => {
      const r = t.get(Ti).getActiveCodeEditor();
      return r ? (r.focus(), this._runEditorCommand(t, r, n)) : !1;
    });
  }
  _runEditorCommand(e, t, n) {
    const r = this.runEditorCommand(e, t, n);
    return r || !0;
  }
}
var Ta;
(function(i) {
  class e extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      if (!L.position)
        return;
      E.model.pushStackElement(), E.setCursorStates(L.source, 3, [
        $a.moveTo(E, E.getPrimaryCursorState(), this._inSelectionMode, L.position, L.viewPosition)
      ]) && L.revealType !== 2 && E.revealAllCursors(L.source, !0, !0);
    }
  }
  i.MoveTo = ct(new e({
    id: "_moveTo",
    inSelectionMode: !1,
    precondition: void 0
  })), i.MoveToSelect = ct(new e({
    id: "_moveToSelect",
    inSelectionMode: !0,
    precondition: void 0
  }));
  class t extends lo {
    runCoreEditorCommand(E, L) {
      E.model.pushStackElement();
      const T = this._getColumnSelectResult(E, E.getPrimaryCursorState(), E.getCursorColumnSelectData(), L);
      T !== null && (E.setCursorStates(L.source, 3, T.viewStates.map((D) => Di.fromViewState(D))), E.setCursorColumnSelectData({
        isReal: !0,
        fromViewLineNumber: T.fromLineNumber,
        fromViewVisualColumn: T.fromVisualColumn,
        toViewLineNumber: T.toLineNumber,
        toViewVisualColumn: T.toVisualColumn
      }), T.reversed ? E.revealTopMostCursor(L.source) : E.revealBottomMostCursor(L.source));
    }
  }
  i.ColumnSelect = ct(new class extends t {
    constructor() {
      super({
        id: "columnSelect",
        precondition: void 0
      });
    }
    _getColumnSelectResult(w, E, L, T) {
      if (typeof T.position > "u" || typeof T.viewPosition > "u" || typeof T.mouseColumn > "u")
        return null;
      const D = w.model.validatePosition(T.position), N = w.coordinatesConverter.validateViewPosition(new de(T.viewPosition.lineNumber, T.viewPosition.column), D), R = T.doColumnSelect ? L.fromViewLineNumber : N.lineNumber, M = T.doColumnSelect ? L.fromViewVisualColumn : T.mouseColumn - 1;
      return BE.columnSelect(w.cursorConfig, w, R, M, N.lineNumber, T.mouseColumn - 1);
    }
  }()), i.CursorColumnSelectLeft = ct(new class extends t {
    constructor() {
      super({
        id: "cursorColumnSelectLeft",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 3599,
          linux: { primary: 0 }
        }
      });
    }
    _getColumnSelectResult(w, E, L, T) {
      return BE.columnSelectLeft(w.cursorConfig, w, L);
    }
  }()), i.CursorColumnSelectRight = ct(new class extends t {
    constructor() {
      super({
        id: "cursorColumnSelectRight",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 3601,
          linux: { primary: 0 }
        }
      });
    }
    _getColumnSelectResult(w, E, L, T) {
      return BE.columnSelectRight(w.cursorConfig, w, L);
    }
  }());
  class n extends t {
    constructor(E) {
      super(E), this._isPaged = E.isPaged;
    }
    _getColumnSelectResult(E, L, T, D) {
      return BE.columnSelectUp(E.cursorConfig, E, T, this._isPaged);
    }
  }
  i.CursorColumnSelectUp = ct(new n({
    isPaged: !1,
    id: "cursorColumnSelectUp",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 3600,
      linux: { primary: 0 }
    }
  })), i.CursorColumnSelectPageUp = ct(new n({
    isPaged: !0,
    id: "cursorColumnSelectPageUp",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 3595,
      linux: { primary: 0 }
    }
  }));
  class r extends t {
    constructor(E) {
      super(E), this._isPaged = E.isPaged;
    }
    _getColumnSelectResult(E, L, T, D) {
      return BE.columnSelectDown(E.cursorConfig, E, T, this._isPaged);
    }
  }
  i.CursorColumnSelectDown = ct(new r({
    isPaged: !1,
    id: "cursorColumnSelectDown",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 3602,
      linux: { primary: 0 }
    }
  })), i.CursorColumnSelectPageDown = ct(new r({
    isPaged: !0,
    id: "cursorColumnSelectPageDown",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 3596,
      linux: { primary: 0 }
    }
  }));
  class s extends lo {
    constructor() {
      super({
        id: "cursorMove",
        precondition: void 0,
        metadata: zV.metadata
      });
    }
    runCoreEditorCommand(E, L) {
      const T = zV.parse(L);
      T && this._runCursorMove(E, L.source, T);
    }
    _runCursorMove(E, L, T) {
      E.model.pushStackElement(), E.setCursorStates(L, 3, s._move(E, E.getCursorStates(), T)), E.revealAllCursors(L, !0);
    }
    static _move(E, L, T) {
      const D = T.select, N = T.value;
      switch (T.direction) {
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        case 10:
          return $a.simpleMove(E, L, T.direction, D, N, T.unit);
        case 11:
        case 13:
        case 12:
        case 14:
          return $a.viewportMove(E, L, T.direction, D, N);
        default:
          return null;
      }
    }
  }
  i.CursorMoveImpl = s, i.CursorMove = ct(new s());
  class o extends lo {
    constructor(E) {
      super(E), this._staticArgs = E.args;
    }
    runCoreEditorCommand(E, L) {
      let T = this._staticArgs;
      this._staticArgs.value === -1 && (T = {
        direction: this._staticArgs.direction,
        unit: this._staticArgs.unit,
        select: this._staticArgs.select,
        value: L.pageSize || E.cursorConfig.pageSize
      }), E.model.pushStackElement(), E.setCursorStates(L.source, 3, $a.simpleMove(E, E.getCursorStates(), T.direction, T.select, T.value, T.unit)), E.revealAllCursors(L.source, !0);
    }
  }
  i.CursorLeft = ct(new o({
    args: {
      direction: 0,
      unit: 0,
      select: !1,
      value: 1
    },
    id: "cursorLeft",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 15,
      mac: { primary: 15, secondary: [
        288
        /* KeyCode.KeyB */
      ] }
    }
  })), i.CursorLeftSelect = ct(new o({
    args: {
      direction: 0,
      unit: 0,
      select: !0,
      value: 1
    },
    id: "cursorLeftSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 1039
      /* KeyCode.LeftArrow */
    }
  })), i.CursorRight = ct(new o({
    args: {
      direction: 1,
      unit: 0,
      select: !1,
      value: 1
    },
    id: "cursorRight",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 17,
      mac: { primary: 17, secondary: [
        292
        /* KeyCode.KeyF */
      ] }
    }
  })), i.CursorRightSelect = ct(new o({
    args: {
      direction: 1,
      unit: 0,
      select: !0,
      value: 1
    },
    id: "cursorRightSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 1041
      /* KeyCode.RightArrow */
    }
  })), i.CursorUp = ct(new o({
    args: {
      direction: 2,
      unit: 2,
      select: !1,
      value: 1
    },
    id: "cursorUp",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 16,
      mac: { primary: 16, secondary: [
        302
        /* KeyCode.KeyP */
      ] }
    }
  })), i.CursorUpSelect = ct(new o({
    args: {
      direction: 2,
      unit: 2,
      select: !0,
      value: 1
    },
    id: "cursorUpSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 1040,
      secondary: [
        3088
        /* KeyCode.UpArrow */
      ],
      mac: {
        primary: 1040
        /* KeyCode.UpArrow */
      },
      linux: {
        primary: 1040
        /* KeyCode.UpArrow */
      }
    }
  })), i.CursorPageUp = ct(new o({
    args: {
      direction: 2,
      unit: 2,
      select: !1,
      value: -1
      /* Constants.PAGE_SIZE_MARKER */
    },
    id: "cursorPageUp",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 11
      /* KeyCode.PageUp */
    }
  })), i.CursorPageUpSelect = ct(new o({
    args: {
      direction: 2,
      unit: 2,
      select: !0,
      value: -1
      /* Constants.PAGE_SIZE_MARKER */
    },
    id: "cursorPageUpSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 1035
      /* KeyCode.PageUp */
    }
  })), i.CursorDown = ct(new o({
    args: {
      direction: 3,
      unit: 2,
      select: !1,
      value: 1
    },
    id: "cursorDown",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 18,
      mac: { primary: 18, secondary: [
        300
        /* KeyCode.KeyN */
      ] }
    }
  })), i.CursorDownSelect = ct(new o({
    args: {
      direction: 3,
      unit: 2,
      select: !0,
      value: 1
    },
    id: "cursorDownSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 1042,
      secondary: [
        3090
        /* KeyCode.DownArrow */
      ],
      mac: {
        primary: 1042
        /* KeyCode.DownArrow */
      },
      linux: {
        primary: 1042
        /* KeyCode.DownArrow */
      }
    }
  })), i.CursorPageDown = ct(new o({
    args: {
      direction: 3,
      unit: 2,
      select: !1,
      value: -1
      /* Constants.PAGE_SIZE_MARKER */
    },
    id: "cursorPageDown",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 12
      /* KeyCode.PageDown */
    }
  })), i.CursorPageDownSelect = ct(new o({
    args: {
      direction: 3,
      unit: 2,
      select: !0,
      value: -1
      /* Constants.PAGE_SIZE_MARKER */
    },
    id: "cursorPageDownSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 1036
      /* KeyCode.PageDown */
    }
  })), i.CreateCursor = ct(new class extends lo {
    constructor() {
      super({
        id: "createCursor",
        precondition: void 0
      });
    }
    runCoreEditorCommand(w, E) {
      if (!E.position)
        return;
      let L;
      E.wholeLine ? L = $a.line(w, w.getPrimaryCursorState(), !1, E.position, E.viewPosition) : L = $a.moveTo(w, w.getPrimaryCursorState(), !1, E.position, E.viewPosition);
      const T = w.getCursorStates();
      if (T.length > 1) {
        const D = L.modelState ? L.modelState.position : null, N = L.viewState ? L.viewState.position : null;
        for (let R = 0, M = T.length; R < M; R++) {
          const B = T[R];
          if (!(D && !B.modelState.selection.containsPosition(D)) && !(N && !B.viewState.selection.containsPosition(N))) {
            T.splice(R, 1), w.model.pushStackElement(), w.setCursorStates(E.source, 3, T);
            return;
          }
        }
      }
      T.push(L), w.model.pushStackElement(), w.setCursorStates(E.source, 3, T);
    }
  }()), i.LastCursorMoveToSelect = ct(new class extends lo {
    constructor() {
      super({
        id: "_lastCursorMoveToSelect",
        precondition: void 0
      });
    }
    runCoreEditorCommand(w, E) {
      if (!E.position)
        return;
      const L = w.getLastAddedCursorIndex(), T = w.getCursorStates(), D = T.slice(0);
      D[L] = $a.moveTo(w, T[L], !0, E.position, E.viewPosition), w.model.pushStackElement(), w.setCursorStates(E.source, 3, D);
    }
  }());
  class a extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      E.model.pushStackElement(), E.setCursorStates(L.source, 3, $a.moveToBeginningOfLine(E, E.getCursorStates(), this._inSelectionMode)), E.revealAllCursors(L.source, !0);
    }
  }
  i.CursorHome = ct(new a({
    inSelectionMode: !1,
    id: "cursorHome",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 14,
      mac: { primary: 14, secondary: [
        2063
        /* KeyCode.LeftArrow */
      ] }
    }
  })), i.CursorHomeSelect = ct(new a({
    inSelectionMode: !0,
    id: "cursorHomeSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 1038,
      mac: { primary: 1038, secondary: [
        3087
        /* KeyCode.LeftArrow */
      ] }
    }
  }));
  class l extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      E.model.pushStackElement(), E.setCursorStates(L.source, 3, this._exec(E.getCursorStates())), E.revealAllCursors(L.source, !0);
    }
    _exec(E) {
      const L = [];
      for (let T = 0, D = E.length; T < D; T++) {
        const N = E[T], R = N.modelState.position.lineNumber;
        L[T] = Di.fromModelState(N.modelState.move(this._inSelectionMode, R, 1, 0));
      }
      return L;
    }
  }
  i.CursorLineStart = ct(new l({
    inSelectionMode: !1,
    id: "cursorLineStart",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 0,
      mac: {
        primary: 287
        /* KeyCode.KeyA */
      }
    }
  })), i.CursorLineStartSelect = ct(new l({
    inSelectionMode: !0,
    id: "cursorLineStartSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 0,
      mac: {
        primary: 1311
        /* KeyCode.KeyA */
      }
    }
  }));
  class c extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      E.model.pushStackElement(), E.setCursorStates(L.source, 3, $a.moveToEndOfLine(E, E.getCursorStates(), this._inSelectionMode, L.sticky || !1)), E.revealAllCursors(L.source, !0);
    }
  }
  i.CursorEnd = ct(new c({
    inSelectionMode: !1,
    id: "cursorEnd",
    precondition: void 0,
    kbOpts: {
      args: { sticky: !1 },
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 13,
      mac: { primary: 13, secondary: [
        2065
        /* KeyCode.RightArrow */
      ] }
    },
    metadata: {
      description: "Go to End",
      args: [{
        name: "args",
        schema: {
          type: "object",
          properties: {
            sticky: {
              description: S(61, "Stick to the end even when going to longer lines"),
              type: "boolean",
              default: !1
            }
          }
        }
      }]
    }
  })), i.CursorEndSelect = ct(new c({
    inSelectionMode: !0,
    id: "cursorEndSelect",
    precondition: void 0,
    kbOpts: {
      args: { sticky: !1 },
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 1037,
      mac: { primary: 1037, secondary: [
        3089
        /* KeyCode.RightArrow */
      ] }
    },
    metadata: {
      description: "Select to End",
      args: [{
        name: "args",
        schema: {
          type: "object",
          properties: {
            sticky: {
              description: S(62, "Stick to the end even when going to longer lines"),
              type: "boolean",
              default: !1
            }
          }
        }
      }]
    }
  }));
  class u extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      E.model.pushStackElement(), E.setCursorStates(L.source, 3, this._exec(E, E.getCursorStates())), E.revealAllCursors(L.source, !0);
    }
    _exec(E, L) {
      const T = [];
      for (let D = 0, N = L.length; D < N; D++) {
        const R = L[D], M = R.modelState.position.lineNumber, B = E.model.getLineMaxColumn(M);
        T[D] = Di.fromModelState(R.modelState.move(this._inSelectionMode, M, B, 0));
      }
      return T;
    }
  }
  i.CursorLineEnd = ct(new u({
    inSelectionMode: !1,
    id: "cursorLineEnd",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 0,
      mac: {
        primary: 291
        /* KeyCode.KeyE */
      }
    }
  })), i.CursorLineEndSelect = ct(new u({
    inSelectionMode: !0,
    id: "cursorLineEndSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 0,
      mac: {
        primary: 1315
        /* KeyCode.KeyE */
      }
    }
  }));
  class d extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      E.model.pushStackElement(), E.setCursorStates(L.source, 3, $a.moveToBeginningOfBuffer(E, E.getCursorStates(), this._inSelectionMode)), E.revealAllCursors(L.source, !0);
    }
  }
  i.CursorTop = ct(new d({
    inSelectionMode: !1,
    id: "cursorTop",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 2062,
      mac: {
        primary: 2064
        /* KeyCode.UpArrow */
      }
    }
  })), i.CursorTopSelect = ct(new d({
    inSelectionMode: !0,
    id: "cursorTopSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 3086,
      mac: {
        primary: 3088
        /* KeyCode.UpArrow */
      }
    }
  }));
  class h extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      E.model.pushStackElement(), E.setCursorStates(L.source, 3, $a.moveToEndOfBuffer(E, E.getCursorStates(), this._inSelectionMode)), E.revealAllCursors(L.source, !0);
    }
  }
  i.CursorBottom = ct(new h({
    inSelectionMode: !1,
    id: "cursorBottom",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 2061,
      mac: {
        primary: 2066
        /* KeyCode.DownArrow */
      }
    }
  })), i.CursorBottomSelect = ct(new h({
    inSelectionMode: !0,
    id: "cursorBottomSelect",
    precondition: void 0,
    kbOpts: {
      weight: $i,
      kbExpr: se.textInputFocus,
      primary: 3085,
      mac: {
        primary: 3090
        /* KeyCode.DownArrow */
      }
    }
  }));
  class g extends lo {
    constructor() {
      super({
        id: "editorScroll",
        precondition: void 0,
        metadata: al.metadata
      });
    }
    determineScrollMethod(E) {
      const L = [
        6
        /* EditorScroll_.Unit.Column */
      ], T = [
        1,
        2,
        3,
        4,
        5,
        6
        /* EditorScroll_.Unit.Column */
      ], D = [
        4,
        2
        /* EditorScroll_.Direction.Right */
      ], N = [
        1,
        3
        /* EditorScroll_.Direction.Down */
      ];
      return L.includes(E.unit) && D.includes(E.direction) ? this._runHorizontalEditorScroll.bind(this) : T.includes(E.unit) && N.includes(E.direction) ? this._runVerticalEditorScroll.bind(this) : null;
    }
    runCoreEditorCommand(E, L) {
      const T = al.parse(L);
      if (!T)
        return;
      const D = this.determineScrollMethod(T);
      D && D(E, L.source, T);
    }
    _runVerticalEditorScroll(E, L, T) {
      const D = this._computeDesiredScrollTop(E, T);
      if (T.revealCursor) {
        const N = E.getCompletelyVisibleViewRangeAtScrollTop(D);
        E.setCursorStates(L, 3, [
          $a.findPositionInViewportIfOutside(E, E.getPrimaryCursorState(), N, T.select)
        ]);
      }
      E.viewLayout.setScrollPosition(
        { scrollTop: D },
        0
        /* ScrollType.Smooth */
      );
    }
    _computeDesiredScrollTop(E, L) {
      if (L.unit === 1) {
        const N = E.viewLayout.getFutureViewport(), R = E.getCompletelyVisibleViewRangeAtScrollTop(N.top), M = E.coordinatesConverter.convertViewRangeToModelRange(R);
        let B;
        L.direction === 1 ? B = Math.max(1, M.startLineNumber - L.value) : B = Math.min(E.model.getLineCount(), M.startLineNumber + L.value);
        const H = E.coordinatesConverter.convertModelPositionToViewPosition(new de(B, 1));
        return E.viewLayout.getVerticalOffsetForLineNumber(H.lineNumber);
      }
      if (L.unit === 5) {
        let N = 0;
        return L.direction === 3 && (N = E.model.getLineCount() - E.cursorConfig.pageSize), E.viewLayout.getVerticalOffsetForLineNumber(N);
      }
      let T;
      L.unit === 3 ? T = E.cursorConfig.pageSize * L.value : L.unit === 4 ? T = Math.round(E.cursorConfig.pageSize / 2) * L.value : T = L.value;
      const D = (L.direction === 1 ? -1 : 1) * T;
      return E.viewLayout.getCurrentScrollTop() + D * E.cursorConfig.lineHeight;
    }
    _runHorizontalEditorScroll(E, L, T) {
      const D = this._computeDesiredScrollLeft(E, T);
      E.viewLayout.setScrollPosition(
        { scrollLeft: D },
        0
        /* ScrollType.Smooth */
      );
    }
    _computeDesiredScrollLeft(E, L) {
      const T = (L.direction === 4 ? -1 : 1) * L.value;
      return E.viewLayout.getCurrentScrollLeft() + T * E.cursorConfig.typicalHalfwidthCharacterWidth;
    }
  }
  i.EditorScrollImpl = g, i.EditorScroll = ct(new g()), i.ScrollLineUp = ct(new class extends lo {
    constructor() {
      super({
        id: "scrollLineUp",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 2064,
          mac: {
            primary: 267
            /* KeyCode.PageUp */
          }
        }
      });
    }
    runCoreEditorCommand(w, E) {
      i.EditorScroll.runCoreEditorCommand(w, {
        to: al.RawDirection.Up,
        by: al.RawUnit.WrappedLine,
        value: 1,
        revealCursor: !1,
        select: !1,
        source: E.source
      });
    }
  }()), i.ScrollPageUp = ct(new class extends lo {
    constructor() {
      super({
        id: "scrollPageUp",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 2059,
          win: {
            primary: 523
            /* KeyCode.PageUp */
          },
          linux: {
            primary: 523
            /* KeyCode.PageUp */
          }
        }
      });
    }
    runCoreEditorCommand(w, E) {
      i.EditorScroll.runCoreEditorCommand(w, {
        to: al.RawDirection.Up,
        by: al.RawUnit.Page,
        value: 1,
        revealCursor: !1,
        select: !1,
        source: E.source
      });
    }
  }()), i.ScrollEditorTop = ct(new class extends lo {
    constructor() {
      super({
        id: "scrollEditorTop",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus
        }
      });
    }
    runCoreEditorCommand(w, E) {
      i.EditorScroll.runCoreEditorCommand(w, {
        to: al.RawDirection.Up,
        by: al.RawUnit.Editor,
        value: 1,
        revealCursor: !1,
        select: !1,
        source: E.source
      });
    }
  }()), i.ScrollLineDown = ct(new class extends lo {
    constructor() {
      super({
        id: "scrollLineDown",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 2066,
          mac: {
            primary: 268
            /* KeyCode.PageDown */
          }
        }
      });
    }
    runCoreEditorCommand(w, E) {
      i.EditorScroll.runCoreEditorCommand(w, {
        to: al.RawDirection.Down,
        by: al.RawUnit.WrappedLine,
        value: 1,
        revealCursor: !1,
        select: !1,
        source: E.source
      });
    }
  }()), i.ScrollPageDown = ct(new class extends lo {
    constructor() {
      super({
        id: "scrollPageDown",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 2060,
          win: {
            primary: 524
            /* KeyCode.PageDown */
          },
          linux: {
            primary: 524
            /* KeyCode.PageDown */
          }
        }
      });
    }
    runCoreEditorCommand(w, E) {
      i.EditorScroll.runCoreEditorCommand(w, {
        to: al.RawDirection.Down,
        by: al.RawUnit.Page,
        value: 1,
        revealCursor: !1,
        select: !1,
        source: E.source
      });
    }
  }()), i.ScrollEditorBottom = ct(new class extends lo {
    constructor() {
      super({
        id: "scrollEditorBottom",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus
        }
      });
    }
    runCoreEditorCommand(w, E) {
      i.EditorScroll.runCoreEditorCommand(w, {
        to: al.RawDirection.Down,
        by: al.RawUnit.Editor,
        value: 1,
        revealCursor: !1,
        select: !1,
        source: E.source
      });
    }
  }()), i.ScrollLeft = ct(new class extends lo {
    constructor() {
      super({
        id: "scrollLeft",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus
        }
      });
    }
    runCoreEditorCommand(w, E) {
      i.EditorScroll.runCoreEditorCommand(w, {
        to: al.RawDirection.Left,
        by: al.RawUnit.Column,
        value: 2,
        revealCursor: !1,
        select: !1,
        source: E.source
      });
    }
  }()), i.ScrollRight = ct(new class extends lo {
    constructor() {
      super({
        id: "scrollRight",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus
        }
      });
    }
    runCoreEditorCommand(w, E) {
      i.EditorScroll.runCoreEditorCommand(w, {
        to: al.RawDirection.Right,
        by: al.RawUnit.Column,
        value: 2,
        revealCursor: !1,
        select: !1,
        source: E.source
      });
    }
  }());
  class m extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      L.position && (E.model.pushStackElement(), E.setCursorStates(L.source, 3, [
        $a.word(E, E.getPrimaryCursorState(), this._inSelectionMode, L.position)
      ]), L.revealType !== 2 && E.revealAllCursors(L.source, !0, !0));
    }
  }
  i.WordSelect = ct(new m({
    inSelectionMode: !1,
    id: "_wordSelect",
    precondition: void 0
  })), i.WordSelectDrag = ct(new m({
    inSelectionMode: !0,
    id: "_wordSelectDrag",
    precondition: void 0
  })), i.LastCursorWordSelect = ct(new class extends lo {
    constructor() {
      super({
        id: "lastCursorWordSelect",
        precondition: void 0
      });
    }
    runCoreEditorCommand(w, E) {
      if (!E.position)
        return;
      const L = w.getLastAddedCursorIndex(), T = w.getCursorStates(), D = T.slice(0), N = T[L];
      D[L] = $a.word(w, N, N.modelState.hasSelection(), E.position), w.model.pushStackElement(), w.setCursorStates(E.source, 3, D);
    }
  }());
  class _ extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      L.position && (E.model.pushStackElement(), E.setCursorStates(L.source, 3, [
        $a.line(E, E.getPrimaryCursorState(), this._inSelectionMode, L.position, L.viewPosition)
      ]), L.revealType !== 2 && E.revealAllCursors(L.source, !1, !0));
    }
  }
  i.LineSelect = ct(new _({
    inSelectionMode: !1,
    id: "_lineSelect",
    precondition: void 0
  })), i.LineSelectDrag = ct(new _({
    inSelectionMode: !0,
    id: "_lineSelectDrag",
    precondition: void 0
  }));
  class v extends lo {
    constructor(E) {
      super(E), this._inSelectionMode = E.inSelectionMode;
    }
    runCoreEditorCommand(E, L) {
      if (!L.position)
        return;
      const T = E.getLastAddedCursorIndex(), D = E.getCursorStates(), N = D.slice(0);
      N[T] = $a.line(E, D[T], this._inSelectionMode, L.position, L.viewPosition), E.model.pushStackElement(), E.setCursorStates(L.source, 3, N);
    }
  }
  i.LastCursorLineSelect = ct(new v({
    inSelectionMode: !1,
    id: "lastCursorLineSelect",
    precondition: void 0
  })), i.LastCursorLineSelectDrag = ct(new v({
    inSelectionMode: !0,
    id: "lastCursorLineSelectDrag",
    precondition: void 0
  })), i.CancelSelection = ct(new class extends lo {
    constructor() {
      super({
        id: "cancelSelection",
        precondition: se.hasNonEmptySelection,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 9,
          secondary: [
            1033
            /* KeyCode.Escape */
          ]
        }
      });
    }
    runCoreEditorCommand(w, E) {
      w.model.pushStackElement(), w.setCursorStates(E.source, 3, [
        $a.cancelSelection(w, w.getPrimaryCursorState())
      ]), w.revealAllCursors(E.source, !0);
    }
  }()), i.RemoveSecondaryCursors = ct(new class extends lo {
    constructor() {
      super({
        id: "removeSecondaryCursors",
        precondition: se.hasMultipleSelections,
        kbOpts: {
          weight: $i + 1,
          kbExpr: se.textInputFocus,
          primary: 9,
          secondary: [
            1033
            /* KeyCode.Escape */
          ]
        }
      });
    }
    runCoreEditorCommand(w, E) {
      w.model.pushStackElement(), w.setCursorStates(E.source, 3, [
        w.getPrimaryCursorState()
      ]), w.revealAllCursors(E.source, !0), hb(S(63, "Removed secondary cursors"));
    }
  }()), i.RevealLine = ct(new class extends lo {
    constructor() {
      super({
        id: "revealLine",
        precondition: void 0,
        metadata: rN.metadata
      });
    }
    runCoreEditorCommand(w, E) {
      const L = E, T = L.lineNumber || 0;
      let D = typeof T == "number" ? T + 1 : parseInt(T) + 1;
      D < 1 && (D = 1);
      const N = w.model.getLineCount();
      D > N && (D = N);
      const R = new z(D, 1, D, w.model.getLineMaxColumn(D));
      let M = 0;
      if (L.at)
        switch (L.at) {
          case rN.RawAtArgument.Top:
            M = 3;
            break;
          case rN.RawAtArgument.Center:
            M = 1;
            break;
          case rN.RawAtArgument.Bottom:
            M = 4;
            break;
        }
      const B = w.coordinatesConverter.convertModelRangeToViewRange(R);
      w.revealRange(
        E.source,
        !1,
        B,
        M,
        0
        /* ScrollType.Smooth */
      );
    }
  }()), i.SelectAll = new class extends Oie {
    constructor() {
      super(Vrt);
    }
    runDOMCommand(w) {
      Zu && (w.focus(), w.select()), w.ownerDocument.execCommand("selectAll");
    }
    runEditorCommand(w, E, L) {
      const T = E._getViewModel();
      T && this.runCoreEditorCommand(T, L);
    }
    runCoreEditorCommand(w, E) {
      w.model.pushStackElement(), w.setCursorStates("keyboard", 3, [
        $a.selectAll(w, w.getPrimaryCursorState())
      ]);
    }
  }(), i.SetSelection = ct(new class extends lo {
    constructor() {
      super({
        id: "setSelection",
        precondition: void 0
      });
    }
    runCoreEditorCommand(w, E) {
      E.selection && (w.model.pushStackElement(), w.setCursorStates(E.source, 3, [
        Di.fromModelSelection(E.selection)
      ]));
    }
  }());
})(Ta || (Ta = {}));
const aot = Re.and(se.textInputFocus, se.columnSelection);
function XA(i, e) {
  Pa.registerKeybindingRule({
    id: i,
    primary: e,
    when: aot,
    weight: $i + 1
  });
}
XA(
  Ta.CursorColumnSelectLeft.id,
  1039
  /* KeyCode.LeftArrow */
);
XA(
  Ta.CursorColumnSelectRight.id,
  1041
  /* KeyCode.RightArrow */
);
XA(
  Ta.CursorColumnSelectUp.id,
  1040
  /* KeyCode.UpArrow */
);
XA(
  Ta.CursorColumnSelectPageUp.id,
  1035
  /* KeyCode.PageUp */
);
XA(
  Ta.CursorColumnSelectDown.id,
  1042
  /* KeyCode.DownArrow */
);
XA(
  Ta.CursorColumnSelectPageDown.id,
  1036
  /* KeyCode.PageDown */
);
function _Le(i) {
  return i.register(), i;
}
var KN;
(function(i) {
  class e extends jo {
    runEditorCommand(n, r, s) {
      const o = r._getViewModel();
      o && this.runCoreEditingCommand(r, o, s || {});
    }
  }
  i.CoreEditingCommand = e, i.LineBreakInsert = ct(new class extends e {
    constructor() {
      super({
        id: "lineBreakInsert",
        precondition: se.writable,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 0,
          mac: {
            primary: 301
            /* KeyCode.KeyO */
          }
        }
      });
    }
    runCoreEditingCommand(t, n, r) {
      t.pushUndoStop(), t.executeCommands(this.id, Hq.lineBreakInsert(n.cursorConfig, n.model, n.getCursorStates().map((s) => s.modelState.selection)));
    }
  }()), i.Outdent = ct(new class extends e {
    constructor() {
      super({
        id: "outdent",
        precondition: se.writable,
        kbOpts: {
          weight: $i,
          kbExpr: Re.and(se.editorTextFocus, se.tabDoesNotMoveFocus),
          primary: 1026
          /* KeyCode.Tab */
        }
      });
    }
    runCoreEditingCommand(t, n, r) {
      t.pushUndoStop(), t.executeCommands(this.id, YC.outdent(n.cursorConfig, n.model, n.getCursorStates().map((s) => s.modelState.selection))), t.pushUndoStop();
    }
  }()), i.Tab = ct(new class extends e {
    constructor() {
      super({
        id: "tab",
        precondition: se.writable,
        kbOpts: {
          weight: $i,
          kbExpr: Re.and(se.editorTextFocus, se.tabDoesNotMoveFocus),
          primary: 2
          /* KeyCode.Tab */
        }
      });
    }
    runCoreEditingCommand(t, n, r) {
      t.pushUndoStop(), t.executeCommands(this.id, YC.tab(n.cursorConfig, n.model, n.getCursorStates().map((s) => s.modelState.selection))), t.pushUndoStop();
    }
  }()), i.DeleteLeft = ct(new class extends e {
    constructor() {
      super({
        id: "deleteLeft",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 1,
          secondary: [
            1025
            /* KeyCode.Backspace */
          ],
          mac: { primary: 1, secondary: [
            1025,
            294,
            257
            /* KeyCode.Backspace */
          ] }
        }
      });
    }
    runCoreEditingCommand(t, n, r) {
      const [s, o] = iT.deleteLeft(n.getPrevEditOperationType(), n.cursorConfig, n.model, n.getCursorStates().map((a) => a.modelState.selection), n.getCursorAutoClosedCharacters());
      s && t.pushUndoStop(), t.executeCommands(this.id, o), n.setPrevEditOperationType(
        2
        /* EditOperationType.DeletingLeft */
      );
    }
  }()), i.DeleteRight = ct(new class extends e {
    constructor() {
      super({
        id: "deleteRight",
        precondition: void 0,
        kbOpts: {
          weight: $i,
          kbExpr: se.textInputFocus,
          primary: 20,
          mac: { primary: 20, secondary: [
            290,
            276
            /* KeyCode.Delete */
          ] }
        }
      });
    }
    runCoreEditingCommand(t, n, r) {
      const [s, o] = iT.deleteRight(n.getPrevEditOperationType(), n.cursorConfig, n.model, n.getCursorStates().map((a) => a.modelState.selection));
      s && t.pushUndoStop(), t.executeCommands(this.id, o), n.setPrevEditOperationType(
        3
        /* EditOperationType.DeletingRight */
      );
    }
  }()), i.Undo = new class extends Oie {
    constructor() {
      super(QPe);
    }
    runDOMCommand(t) {
      t.ownerDocument.execCommand("undo");
    }
    runEditorCommand(t, n, r) {
      if (!(!n.hasModel() || n.getOption(
        104
        /* EditorOption.readOnly */
      ) === !0))
        return n.getModel().undo();
    }
  }(), i.Redo = new class extends Oie {
    constructor() {
      super(JPe);
    }
    runDOMCommand(t) {
      t.ownerDocument.execCommand("redo");
    }
    runEditorCommand(t, n, r) {
      if (!(!n.hasModel() || n.getOption(
        104
        /* EditorOption.readOnly */
      ) === !0))
        return n.getModel().redo();
    }
  }();
})(KN || (KN = {}));
class bLe extends Oq {
  constructor(e, t, n) {
    super({
      id: e,
      precondition: void 0,
      metadata: n
    }), this._handlerId = t;
  }
  runCommand(e, t) {
    const n = e.get(Ti).getFocusedCodeEditor();
    n && n.trigger("keyboard", this._handlerId, t);
  }
}
function KT(i, e) {
  _Le(new bLe("default:" + i, i)), _Le(new bLe(i, i, e));
}
KT("type", {
  description: "Type",
  args: [{
    name: "args",
    schema: {
      type: "object",
      required: ["text"],
      properties: {
        text: {
          type: "string"
        }
      }
    }
  }]
});
KT(
  "replacePreviousChar"
  /* Handler.ReplacePreviousChar */
);
KT(
  "compositionType"
  /* Handler.CompositionType */
);
KT(
  "compositionStart"
  /* Handler.CompositionStart */
);
KT(
  "compositionEnd"
  /* Handler.CompositionEnd */
);
KT(
  "paste"
  /* Handler.Paste */
);
KT(
  "cut"
  /* Handler.Cut */
);
const mfe = Vn("markerDecorationsService");
var lot = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, cot = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, CR;
let KV = (CR = class {
  constructor(e, t) {
  }
  dispose() {
  }
}, CR.ID = "editor.contrib.markerDecorations", CR);
KV = lot([
  cot(1, mfe)
], KV);
Si(
  KV.ID,
  KV,
  0
  /* EditorContributionInstantiation.Eager */
);
class YV {
  constructor(e) {
    this.domNode = e, this._maxWidth = "", this._width = "", this._height = "", this._top = "", this._left = "", this._bottom = "", this._right = "", this._paddingLeft = "", this._fontFamily = "", this._fontWeight = "", this._fontSize = "", this._fontStyle = "", this._fontFeatureSettings = "", this._fontVariationSettings = "", this._textDecoration = "", this._lineHeight = "", this._letterSpacing = "", this._className = "", this._display = "", this._position = "", this._visibility = "", this._color = "", this._backgroundColor = "", this._layerHint = !1, this._contain = "none", this._boxShadow = "";
  }
  focus() {
    this.domNode.focus();
  }
  setMaxWidth(e) {
    const t = xp(e);
    this._maxWidth !== t && (this._maxWidth = t, this.domNode.style.maxWidth = this._maxWidth);
  }
  setWidth(e) {
    const t = xp(e);
    this._width !== t && (this._width = t, this.domNode.style.width = this._width);
  }
  setHeight(e) {
    const t = xp(e);
    this._height !== t && (this._height = t, this.domNode.style.height = this._height);
  }
  setTop(e) {
    const t = xp(e);
    this._top !== t && (this._top = t, this.domNode.style.top = this._top);
  }
  setLeft(e) {
    const t = xp(e);
    this._left !== t && (this._left = t, this.domNode.style.left = this._left);
  }
  setBottom(e) {
    const t = xp(e);
    this._bottom !== t && (this._bottom = t, this.domNode.style.bottom = this._bottom);
  }
  setRight(e) {
    const t = xp(e);
    this._right !== t && (this._right = t, this.domNode.style.right = this._right);
  }
  setPaddingLeft(e) {
    const t = xp(e);
    this._paddingLeft !== t && (this._paddingLeft = t, this.domNode.style.paddingLeft = this._paddingLeft);
  }
  setFontFamily(e) {
    this._fontFamily !== e && (this._fontFamily = e, this.domNode.style.fontFamily = this._fontFamily);
  }
  setFontWeight(e) {
    this._fontWeight !== e && (this._fontWeight = e, this.domNode.style.fontWeight = this._fontWeight);
  }
  setFontSize(e) {
    const t = xp(e);
    this._fontSize !== t && (this._fontSize = t, this.domNode.style.fontSize = this._fontSize);
  }
  setFontStyle(e) {
    this._fontStyle !== e && (this._fontStyle = e, this.domNode.style.fontStyle = this._fontStyle);
  }
  setFontFeatureSettings(e) {
    this._fontFeatureSettings !== e && (this._fontFeatureSettings = e, this.domNode.style.fontFeatureSettings = this._fontFeatureSettings);
  }
  setFontVariationSettings(e) {
    this._fontVariationSettings !== e && (this._fontVariationSettings = e, this.domNode.style.fontVariationSettings = this._fontVariationSettings);
  }
  setTextDecoration(e) {
    this._textDecoration !== e && (this._textDecoration = e, this.domNode.style.textDecoration = this._textDecoration);
  }
  setLineHeight(e) {
    const t = xp(e);
    this._lineHeight !== t && (this._lineHeight = t, this.domNode.style.lineHeight = this._lineHeight);
  }
  setLetterSpacing(e) {
    const t = xp(e);
    this._letterSpacing !== t && (this._letterSpacing = t, this.domNode.style.letterSpacing = this._letterSpacing);
  }
  setClassName(e) {
    this._className !== e && (this._className = e, this.domNode.className = this._className);
  }
  toggleClassName(e, t) {
    this.domNode.classList.toggle(e, t), this._className = this.domNode.className;
  }
  setDisplay(e) {
    this._display !== e && (this._display = e, this.domNode.style.display = this._display);
  }
  setPosition(e) {
    this._position !== e && (this._position = e, this.domNode.style.position = this._position);
  }
  setVisibility(e) {
    this._visibility !== e && (this._visibility = e, this.domNode.style.visibility = this._visibility);
  }
  setColor(e) {
    this._color !== e && (this._color = e, this.domNode.style.color = this._color);
  }
  setBackgroundColor(e) {
    this._backgroundColor !== e && (this._backgroundColor = e, this.domNode.style.backgroundColor = this._backgroundColor);
  }
  setLayerHinting(e) {
    this._layerHint !== e && (this._layerHint = e, this.domNode.style.transform = this._layerHint ? "translate3d(0px, 0px, 0px)" : "");
  }
  setBoxShadow(e) {
    this._boxShadow !== e && (this._boxShadow = e, this.domNode.style.boxShadow = e);
  }
  setContain(e) {
    this._contain !== e && (this._contain = e, this.domNode.style.contain = this._contain);
  }
  setAttribute(e, t) {
    this.domNode.setAttribute(e, t);
  }
  removeAttribute(e) {
    this.domNode.removeAttribute(e);
  }
  appendChild(e) {
    this.domNode.appendChild(e.domNode);
  }
  removeChild(e) {
    this.domNode.removeChild(e.domNode);
  }
}
function xp(i) {
  return typeof i == "number" ? `${i}px` : i;
}
function Gi(i) {
  return new YV(i);
}
function Ma(i, e) {
  i instanceof YV ? (i.setFontFamily(e.getMassagedFontFamily()), i.setFontWeight(e.fontWeight), i.setFontSize(e.fontSize), i.setFontFeatureSettings(e.fontFeatureSettings), i.setFontVariationSettings(e.fontVariationSettings), i.setLineHeight(e.lineHeight), i.setLetterSpacing(e.letterSpacing)) : (i.style.fontFamily = e.getMassagedFontFamily(), i.style.fontWeight = e.fontWeight, i.style.fontSize = e.fontSize + "px", i.style.fontFeatureSettings = e.fontFeatureSettings, i.style.fontVariationSettings = e.fontVariationSettings, i.style.lineHeight = e.lineHeight + "px", i.style.letterSpacing = e.letterSpacing + "px");
}
class CFe extends ge {
  constructor(e, t) {
    super(), this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event, this._referenceDomElement = e, this._width = -1, this._height = -1, this._resizeObserver = null, this.measureReferenceDomElement(!1, t);
  }
  dispose() {
    this.stopObserving(), super.dispose();
  }
  getWidth() {
    return this._width;
  }
  getHeight() {
    return this._height;
  }
  startObserving() {
    if (!this._resizeObserver && this._referenceDomElement) {
      let e = null;
      const t = () => {
        e ? this.observe({ width: e.width, height: e.height }) : this.observe();
      };
      let n = !1, r = !1;
      const s = () => {
        if (n && !r)
          try {
            n = !1, r = !0, t();
          } finally {
            Ju(At(this._referenceDomElement), () => {
              r = !1, s();
            });
          }
      };
      this._resizeObserver = new ResizeObserver((o) => {
        o && o[0] && o[0].contentRect ? e = { width: o[0].contentRect.width, height: o[0].contentRect.height } : e = null, n = !0, s();
      }), this._resizeObserver.observe(this._referenceDomElement);
    }
  }
  stopObserving() {
    this._resizeObserver && (this._resizeObserver.disconnect(), this._resizeObserver = null);
  }
  observe(e) {
    this.measureReferenceDomElement(!0, e);
  }
  measureReferenceDomElement(e, t) {
    let n = 0, r = 0;
    t ? (n = t.width, r = t.height) : this._referenceDomElement && (n = this._referenceDomElement.clientWidth, r = this._referenceDomElement.clientHeight), n = Math.max(5, n), r = Math.max(5, r), (this._width !== n || this._height !== r) && (this._width = n, this._height = r, e && this._onDidChange.fire());
  }
}
class uot extends ge {
  constructor(e) {
    super(), this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event, this._listener = () => this._handleChange(e, !0), this._mediaQueryList = null, this._handleChange(e, !1);
  }
  _handleChange(e, t) {
    var n;
    (n = this._mediaQueryList) == null || n.removeEventListener("change", this._listener), this._mediaQueryList = e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`), this._mediaQueryList.addEventListener("change", this._listener), t && this._onDidChange.fire();
  }
}
class dot extends ge {
  get value() {
    return this._value;
  }
  constructor(e) {
    super(), this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event, this._value = this._getPixelRatio(e);
    const t = this._register(new uot(e));
    this._register(t.onDidChange(() => {
      this._value = this._getPixelRatio(e), this._onDidChange.fire(this._value);
    }));
  }
  _getPixelRatio(e) {
    const t = document.createElement("canvas").getContext("2d"), n = e.devicePixelRatio || 1, r = t.webkitBackingStorePixelRatio || t.mozBackingStorePixelRatio || t.msBackingStorePixelRatio || t.oBackingStorePixelRatio || t.backingStorePixelRatio || 1;
    return n / r;
  }
}
class hot {
  constructor() {
    this.mapWindowIdToPixelRatioMonitor = /* @__PURE__ */ new Map();
  }
  _getOrCreatePixelRatioMonitor(e) {
    const t = i4(e);
    let n = this.mapWindowIdToPixelRatioMonitor.get(t);
    return n || (n = new dot(e), this.mapWindowIdToPixelRatioMonitor.set(t, n), Ze.once(Nit)(({ vscodeWindowId: r }) => {
      r === t && (n == null || n.dispose(), this.mapWindowIdToPixelRatioMonitor.delete(t));
    })), n;
  }
  getInstance(e) {
    return this._getOrCreatePixelRatioMonitor(e);
  }
}
const d4 = new hot();
class fot {
  constructor(e, t) {
    this.chr = e, this.type = t, this.width = 0;
  }
  fulfill(e) {
    this.width = e;
  }
}
class _fe {
  constructor(e, t) {
    this._bareFontInfo = e, this._requests = t, this._container = null, this._testElements = null;
  }
  read(e) {
    var t;
    this._createDomElements(), e.document.body.appendChild(this._container), this._readFromDomElements(), (t = this._container) == null || t.remove(), this._container = null, this._testElements = null;
  }
  _createDomElements() {
    const e = document.createElement("div");
    e.style.position = "absolute", e.style.top = "-50000px", e.style.width = "50000px";
    const t = document.createElement("div");
    Ma(t, this._bareFontInfo), e.appendChild(t);
    const n = document.createElement("div");
    Ma(n, this._bareFontInfo), n.style.fontWeight = "bold", e.appendChild(n);
    const r = document.createElement("div");
    Ma(r, this._bareFontInfo), r.style.fontStyle = "italic", e.appendChild(r);
    const s = [];
    for (const o of this._requests) {
      let a;
      o.type === 0 && (a = t), o.type === 2 && (a = n), o.type === 1 && (a = r), a.appendChild(document.createElement("br"));
      const l = document.createElement("span");
      _fe._render(l, o), a.appendChild(l), s.push(l);
    }
    this._container = e, this._testElements = s;
  }
  static _render(e, t) {
    if (t.chr === " ") {
      let n = " ";
      for (let r = 0; r < 8; r++)
        n += n;
      e.innerText = n;
    } else {
      let n = t.chr;
      for (let r = 0; r < 8; r++)
        n += n;
      e.textContent = n;
    }
  }
  _readFromDomElements() {
    for (let e = 0, t = this._requests.length; e < t; e++) {
      const n = this._requests[e], r = this._testElements[e];
      n.fulfill(r.offsetWidth / 256);
    }
  }
}
function got(i, e, t) {
  new _fe(e, t).read(i);
}
const Gl = {
  tabSize: 4,
  indentSize: 4,
  insertSpaces: !0,
  detectIndentation: !0,
  trimAutoWhitespace: !0,
  largeFileOptimizations: !0,
  bracketPairColorizationOptions: {
    enabled: !0,
    independentColorPoolPerBracketType: !1
  }
}, C_ = 8;
class wFe {
  /**
   * @internal
   */
  constructor(e) {
    this._values = e;
  }
  hasChanged(e) {
    return this._values[e];
  }
}
class SFe {
  constructor() {
    this.stableMinimapLayoutInput = null, this.stableFitMaxMinimapScale = 0, this.stableFitRemainingWidth = 0;
  }
}
class ms {
  constructor(e, t, n, r) {
    this.id = e, this.name = t, this.defaultValue = n, this.schema = r;
  }
  applyUpdate(e, t) {
    return Vq(e, t);
  }
  compute(e, t, n) {
    return n;
  }
}
class EF {
  constructor(e, t) {
    this.newValue = e, this.didChange = t;
  }
}
function Vq(i, e) {
  if (typeof i != "object" || typeof e != "object" || !i || !e)
    return new EF(e, i !== e);
  if (Array.isArray(i) || Array.isArray(e)) {
    const n = Array.isArray(i) && Array.isArray(e) && ds(i, e);
    return new EF(e, !n);
  }
  let t = !1;
  for (const n in e)
    if (e.hasOwnProperty(n)) {
      const r = Vq(i[n], e[n]);
      r.didChange && (i[n] = r.newValue, t = !0);
    }
  return new EF(i, t);
}
class Sw {
  constructor(e) {
    this.schema = void 0, this.id = e, this.name = "_never_", this.defaultValue = void 0;
  }
  applyUpdate(e, t) {
    return Vq(e, t);
  }
  validate(e) {
    return this.defaultValue;
  }
}
class ZA {
  constructor(e, t, n, r) {
    this.id = e, this.name = t, this.defaultValue = n, this.schema = r;
  }
  applyUpdate(e, t) {
    return Vq(e, t);
  }
  validate(e) {
    return typeof e > "u" ? this.defaultValue : e;
  }
  compute(e, t, n) {
    return n;
  }
}
function Ot(i, e) {
  return typeof i > "u" ? e : i === "false" ? !1 : !!i;
}
class zn extends ZA {
  constructor(e, t, n, r = void 0) {
    typeof r < "u" && (r.type = "boolean", r.default = n), super(e, t, n, r);
  }
  validate(e) {
    return Ot(e, this.defaultValue);
  }
}
function wE(i, e, t, n) {
  if (typeof i > "u")
    return e;
  let r = parseInt(i, 10);
  return isNaN(r) ? e : (r = Math.max(t, r), r = Math.min(n, r), r | 0);
}
class dr extends ZA {
  static clampedInt(e, t, n, r) {
    return wE(e, t, n, r);
  }
  constructor(e, t, n, r, s, o = void 0) {
    typeof o < "u" && (o.type = "integer", o.default = n, o.minimum = r, o.maximum = s), super(e, t, n, o), this.minimum = r, this.maximum = s;
  }
  validate(e) {
    return dr.clampedInt(e, this.defaultValue, this.minimum, this.maximum);
  }
}
function pot(i, e, t, n) {
  if (typeof i > "u")
    return e;
  const r = Fh.float(i, e);
  return Fh.clamp(r, t, n);
}
class Fh extends ZA {
  static clamp(e, t, n) {
    return e < t ? t : e > n ? n : e;
  }
  static float(e, t) {
    if (typeof e == "number")
      return e;
    if (typeof e > "u")
      return t;
    const n = parseFloat(e);
    return isNaN(n) ? t : n;
  }
  constructor(e, t, n, r, s, o, a) {
    typeof s < "u" && (s.type = "number", s.default = n, s.minimum = o, s.maximum = a), super(e, t, n, s), this.validationFn = r, this.minimum = o, this.maximum = a;
  }
  validate(e) {
    return this.validationFn(Fh.float(e, this.defaultValue));
  }
}
class yc extends ZA {
  static string(e, t) {
    return typeof e != "string" ? t : e;
  }
  constructor(e, t, n, r = void 0) {
    typeof r < "u" && (r.type = "string", r.default = n), super(e, t, n, r);
  }
  validate(e) {
    return yc.string(e, this.defaultValue);
  }
}
function Zr(i, e, t, n) {
  return typeof i != "string" ? e : n && i in n ? n[i] : t.indexOf(i) === -1 ? e : i;
}
class gs extends ZA {
  constructor(e, t, n, r, s = void 0) {
    typeof s < "u" && (s.type = "string", s.enum = r, s.default = n), super(e, t, n, s), this._allowedValues = r;
  }
  validate(e) {
    return Zr(e, this.defaultValue, this._allowedValues);
  }
}
class VM extends ms {
  constructor(e, t, n, r, s, o, a = void 0) {
    typeof a < "u" && (a.type = "string", a.enum = s, a.default = r), super(e, t, n, a), this._allowedValues = s, this._convert = o;
  }
  validate(e) {
    return typeof e != "string" ? this.defaultValue : this._allowedValues.indexOf(e) === -1 ? this.defaultValue : this._convert(e);
  }
}
function mot(i) {
  switch (i) {
    case "none":
      return 0;
    case "keep":
      return 1;
    case "brackets":
      return 2;
    case "advanced":
      return 3;
    case "full":
      return 4;
  }
}
class _ot extends ms {
  constructor() {
    super(2, "accessibilitySupport", 0, {
      type: "string",
      enum: ["auto", "on", "off"],
      enumDescriptions: [
        S(198, "Use platform APIs to detect when a Screen Reader is attached."),
        S(199, "Optimize for usage with a Screen Reader."),
        S(200, "Assume a screen reader is not attached.")
      ],
      default: "auto",
      tags: ["accessibility"],
      description: S(201, "Controls if the UI should run in a mode where it is optimized for screen readers.")
    });
  }
  validate(e) {
    switch (e) {
      case "auto":
        return 0;
      case "off":
        return 1;
      case "on":
        return 2;
    }
    return this.defaultValue;
  }
  compute(e, t, n) {
    return n === 0 ? e.accessibilitySupport : n;
  }
}
class bot extends ms {
  constructor() {
    const e = {
      insertSpace: !0,
      ignoreEmptyLines: !0
    };
    super(29, "comments", e, {
      "editor.comments.insertSpace": {
        type: "boolean",
        default: e.insertSpace,
        description: S(202, "Controls whether a space character is inserted when commenting.")
      },
      "editor.comments.ignoreEmptyLines": {
        type: "boolean",
        default: e.ignoreEmptyLines,
        description: S(203, "Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      insertSpace: Ot(t.insertSpace, this.defaultValue.insertSpace),
      ignoreEmptyLines: Ot(t.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines)
    };
  }
}
function vot(i) {
  switch (i) {
    case "blink":
      return 1;
    case "smooth":
      return 2;
    case "phase":
      return 3;
    case "expand":
      return 4;
    case "solid":
      return 5;
  }
}
var Ia;
(function(i) {
  i[i.Line = 1] = "Line", i[i.Block = 2] = "Block", i[i.Underline = 3] = "Underline", i[i.LineThin = 4] = "LineThin", i[i.BlockOutline = 5] = "BlockOutline", i[i.UnderlineThin = 6] = "UnderlineThin";
})(Ia || (Ia = {}));
function vLe(i) {
  switch (i) {
    case "line":
      return Ia.Line;
    case "block":
      return Ia.Block;
    case "underline":
      return Ia.Underline;
    case "line-thin":
      return Ia.LineThin;
    case "block-outline":
      return Ia.BlockOutline;
    case "underline-thin":
      return Ia.UnderlineThin;
  }
}
class yot extends Sw {
  constructor() {
    super(
      162
      /* EditorOption.editorClassName */
    );
  }
  compute(e, t, n) {
    const r = ["monaco-editor"];
    return t.get(
      48
      /* EditorOption.extraEditorClassName */
    ) && r.push(t.get(
      48
      /* EditorOption.extraEditorClassName */
    )), e.extraEditorClassName && r.push(e.extraEditorClassName), t.get(
      82
      /* EditorOption.mouseStyle */
    ) === "default" ? r.push("mouse-default") : t.get(
      82
      /* EditorOption.mouseStyle */
    ) === "copy" && r.push("mouse-copy"), t.get(
      127
      /* EditorOption.showUnused */
    ) && r.push("showUnused"), t.get(
      157
      /* EditorOption.showDeprecated */
    ) && r.push("showDeprecated"), r.join(" ");
  }
}
class Cot extends zn {
  constructor() {
    super(45, "emptySelectionClipboard", !0, { description: S(204, "Controls whether copying without a selection copies the current line.") });
  }
  compute(e, t, n) {
    return n && e.emptySelectionClipboard;
  }
}
class wot extends ms {
  constructor() {
    const e = {
      cursorMoveOnType: !0,
      findOnType: !0,
      seedSearchStringFromSelection: "always",
      autoFindInSelection: "never",
      globalFindClipboard: !1,
      addExtraSpaceOnTop: !0,
      loop: !0,
      history: "workspace",
      replaceHistory: "workspace"
    };
    super(50, "find", e, {
      "editor.find.cursorMoveOnType": {
        type: "boolean",
        default: e.cursorMoveOnType,
        description: S(205, "Controls whether the cursor should jump to find matches while typing.")
      },
      "editor.find.seedSearchStringFromSelection": {
        type: "string",
        enum: ["never", "always", "selection"],
        default: e.seedSearchStringFromSelection,
        enumDescriptions: [
          S(206, "Never seed search string from the editor selection."),
          S(207, "Always seed search string from the editor selection, including word at cursor position."),
          S(208, "Only seed search string from the editor selection.")
        ],
        description: S(209, "Controls whether the search string in the Find Widget is seeded from the editor selection.")
      },
      "editor.find.autoFindInSelection": {
        type: "string",
        enum: ["never", "always", "multiline"],
        default: e.autoFindInSelection,
        enumDescriptions: [
          S(210, "Never turn on Find in Selection automatically (default)."),
          S(211, "Always turn on Find in Selection automatically."),
          S(212, "Turn on Find in Selection automatically when multiple lines of content are selected.")
        ],
        description: S(213, "Controls the condition for turning on Find in Selection automatically.")
      },
      "editor.find.globalFindClipboard": {
        type: "boolean",
        default: e.globalFindClipboard,
        description: S(214, "Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),
        included: Kn
      },
      "editor.find.addExtraSpaceOnTop": {
        type: "boolean",
        default: e.addExtraSpaceOnTop,
        description: S(215, "Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")
      },
      "editor.find.loop": {
        type: "boolean",
        default: e.loop,
        description: S(216, "Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")
      },
      "editor.find.history": {
        type: "string",
        enum: ["never", "workspace"],
        default: "workspace",
        enumDescriptions: [
          S(217, "Do not store search history from the find widget."),
          S(218, "Store search history across the active workspace")
        ],
        description: S(219, "Controls how the find widget history should be stored")
      },
      "editor.find.replaceHistory": {
        type: "string",
        enum: ["never", "workspace"],
        default: "workspace",
        enumDescriptions: [
          S(220, "Do not store history from the replace widget."),
          S(221, "Store replace history across the active workspace")
        ],
        description: S(222, "Controls how the replace widget history should be stored")
      },
      "editor.find.findOnType": {
        type: "boolean",
        default: e.findOnType,
        description: S(223, "Controls whether the Find Widget should search as you type.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      cursorMoveOnType: Ot(t.cursorMoveOnType, this.defaultValue.cursorMoveOnType),
      findOnType: Ot(t.findOnType, this.defaultValue.findOnType),
      seedSearchStringFromSelection: typeof e.seedSearchStringFromSelection == "boolean" ? e.seedSearchStringFromSelection ? "always" : "never" : Zr(t.seedSearchStringFromSelection, this.defaultValue.seedSearchStringFromSelection, ["never", "always", "selection"]),
      autoFindInSelection: typeof e.autoFindInSelection == "boolean" ? e.autoFindInSelection ? "always" : "never" : Zr(t.autoFindInSelection, this.defaultValue.autoFindInSelection, ["never", "always", "multiline"]),
      globalFindClipboard: Ot(t.globalFindClipboard, this.defaultValue.globalFindClipboard),
      addExtraSpaceOnTop: Ot(t.addExtraSpaceOnTop, this.defaultValue.addExtraSpaceOnTop),
      loop: Ot(t.loop, this.defaultValue.loop),
      history: Zr(t.history, this.defaultValue.history, ["never", "workspace"]),
      replaceHistory: Zr(t.replaceHistory, this.defaultValue.replaceHistory, ["never", "workspace"])
    };
  }
}
const ty = class ty extends ms {
  constructor() {
    super(60, "fontLigatures", ty.OFF, {
      anyOf: [
        {
          type: "boolean",
          description: S(224, "Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")
        },
        {
          type: "string",
          description: S(225, "Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")
        }
      ],
      description: S(226, "Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),
      default: !1
    });
  }
  validate(e) {
    return typeof e > "u" ? this.defaultValue : typeof e == "string" ? e === "false" || e.length === 0 ? ty.OFF : e === "true" ? ty.ON : e : e ? ty.ON : ty.OFF;
  }
};
ty.OFF = '"liga" off, "calt" off', ty.ON = '"liga" on, "calt" on';
let Yy = ty;
const ny = class ny extends ms {
  constructor() {
    super(63, "fontVariations", ny.OFF, {
      anyOf: [
        {
          type: "boolean",
          description: S(227, "Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")
        },
        {
          type: "string",
          description: S(228, "Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")
        }
      ],
      description: S(229, "Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),
      default: !1
    });
  }
  validate(e) {
    return typeof e > "u" ? this.defaultValue : typeof e == "string" ? e === "false" ? ny.OFF : e === "true" ? ny.TRANSLATE : e : e ? ny.TRANSLATE : ny.OFF;
  }
  compute(e, t, n) {
    return e.fontInfo.fontVariationSettings;
  }
};
ny.OFF = "normal", ny.TRANSLATE = "translate";
let h4 = ny;
class Sot extends Sw {
  constructor() {
    super(
      59
      /* EditorOption.fontInfo */
    );
  }
  compute(e, t, n) {
    return e.fontInfo;
  }
}
class Eot extends Sw {
  constructor() {
    super(
      161
      /* EditorOption.effectiveCursorStyle */
    );
  }
  compute(e, t, n) {
    return e.inputMode === "overtype" ? t.get(
      92
      /* EditorOption.overtypeCursorStyle */
    ) : t.get(
      34
      /* EditorOption.cursorStyle */
    );
  }
}
class xot extends Sw {
  constructor() {
    super(
      170
      /* EditorOption.effectiveEditContext */
    );
  }
  compute(e, t) {
    return e.editContextSupported && t.get(
      44
      /* EditorOption.editContext */
    );
  }
}
class Lot extends Sw {
  constructor() {
    super(
      172
      /* EditorOption.effectiveAllowVariableFonts */
    );
  }
  compute(e, t) {
    return e.accessibilitySupport === 2 ? t.get(
      7
      /* EditorOption.allowVariableFontsInAccessibilityMode */
    ) : t.get(
      6
      /* EditorOption.allowVariableFonts */
    );
  }
}
class Tot extends ZA {
  constructor() {
    super(61, "fontSize", au.fontSize, {
      type: "number",
      minimum: 6,
      maximum: 100,
      default: au.fontSize,
      description: S(230, "Controls the font size in pixels.")
    });
  }
  validate(e) {
    const t = Fh.float(e, this.defaultValue);
    return t === 0 ? au.fontSize : Fh.clamp(t, 6, 100);
  }
  compute(e, t, n) {
    return e.fontInfo.fontSize;
  }
}
const I_ = class I_ extends ms {
  constructor() {
    super(62, "fontWeight", au.fontWeight, {
      anyOf: [
        {
          type: "number",
          minimum: I_.MINIMUM_VALUE,
          maximum: I_.MAXIMUM_VALUE,
          errorMessage: S(231, 'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')
        },
        {
          type: "string",
          pattern: "^(normal|bold|1000|[1-9][0-9]{0,2})$"
        },
        {
          enum: I_.SUGGESTION_VALUES
        }
      ],
      default: au.fontWeight,
      description: S(232, 'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')
    });
  }
  validate(e) {
    return e === "normal" || e === "bold" ? e : String(dr.clampedInt(e, au.fontWeight, I_.MINIMUM_VALUE, I_.MAXIMUM_VALUE));
  }
};
I_.SUGGESTION_VALUES = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"], I_.MINIMUM_VALUE = 1, I_.MAXIMUM_VALUE = 1e3;
let Mie = I_;
class kot extends ms {
  constructor() {
    const e = {
      multiple: "peek",
      multipleDefinitions: "peek",
      multipleTypeDefinitions: "peek",
      multipleDeclarations: "peek",
      multipleImplementations: "peek",
      multipleReferences: "peek",
      multipleTests: "peek",
      alternativeDefinitionCommand: "editor.action.goToReferences",
      alternativeTypeDefinitionCommand: "editor.action.goToReferences",
      alternativeDeclarationCommand: "editor.action.goToReferences",
      alternativeImplementationCommand: "",
      alternativeReferenceCommand: "",
      alternativeTestsCommand: ""
    }, t = {
      type: "string",
      enum: ["peek", "gotoAndPeek", "goto"],
      default: e.multiple,
      enumDescriptions: [
        S(233, "Show Peek view of the results (default)"),
        S(234, "Go to the primary result and show a Peek view"),
        S(235, "Go to the primary result and enable Peek-less navigation to others")
      ]
    }, n = ["", "editor.action.referenceSearch.trigger", "editor.action.goToReferences", "editor.action.peekImplementation", "editor.action.goToImplementation", "editor.action.peekTypeDefinition", "editor.action.goToTypeDefinition", "editor.action.peekDeclaration", "editor.action.revealDeclaration", "editor.action.peekDefinition", "editor.action.revealDefinitionAside", "editor.action.revealDefinition"];
    super(67, "gotoLocation", e, {
      "editor.gotoLocation.multiple": {
        deprecationMessage: S(236, "This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")
      },
      "editor.gotoLocation.multipleDefinitions": {
        description: S(237, "Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),
        ...t
      },
      "editor.gotoLocation.multipleTypeDefinitions": {
        description: S(238, "Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),
        ...t
      },
      "editor.gotoLocation.multipleDeclarations": {
        description: S(239, "Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),
        ...t
      },
      "editor.gotoLocation.multipleImplementations": {
        description: S(240, "Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),
        ...t
      },
      "editor.gotoLocation.multipleReferences": {
        description: S(241, "Controls the behavior the 'Go to References'-command when multiple target locations exist."),
        ...t
      },
      "editor.gotoLocation.alternativeDefinitionCommand": {
        type: "string",
        default: e.alternativeDefinitionCommand,
        enum: n,
        description: S(242, "Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")
      },
      "editor.gotoLocation.alternativeTypeDefinitionCommand": {
        type: "string",
        default: e.alternativeTypeDefinitionCommand,
        enum: n,
        description: S(243, "Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")
      },
      "editor.gotoLocation.alternativeDeclarationCommand": {
        type: "string",
        default: e.alternativeDeclarationCommand,
        enum: n,
        description: S(244, "Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")
      },
      "editor.gotoLocation.alternativeImplementationCommand": {
        type: "string",
        default: e.alternativeImplementationCommand,
        enum: n,
        description: S(245, "Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")
      },
      "editor.gotoLocation.alternativeReferenceCommand": {
        type: "string",
        default: e.alternativeReferenceCommand,
        enum: n,
        description: S(246, "Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      multiple: Zr(t.multiple, this.defaultValue.multiple, ["peek", "gotoAndPeek", "goto"]),
      multipleDefinitions: t.multipleDefinitions ?? Zr(t.multipleDefinitions, "peek", ["peek", "gotoAndPeek", "goto"]),
      multipleTypeDefinitions: t.multipleTypeDefinitions ?? Zr(t.multipleTypeDefinitions, "peek", ["peek", "gotoAndPeek", "goto"]),
      multipleDeclarations: t.multipleDeclarations ?? Zr(t.multipleDeclarations, "peek", ["peek", "gotoAndPeek", "goto"]),
      multipleImplementations: t.multipleImplementations ?? Zr(t.multipleImplementations, "peek", ["peek", "gotoAndPeek", "goto"]),
      multipleReferences: t.multipleReferences ?? Zr(t.multipleReferences, "peek", ["peek", "gotoAndPeek", "goto"]),
      multipleTests: t.multipleTests ?? Zr(t.multipleTests, "peek", ["peek", "gotoAndPeek", "goto"]),
      alternativeDefinitionCommand: yc.string(t.alternativeDefinitionCommand, this.defaultValue.alternativeDefinitionCommand),
      alternativeTypeDefinitionCommand: yc.string(t.alternativeTypeDefinitionCommand, this.defaultValue.alternativeTypeDefinitionCommand),
      alternativeDeclarationCommand: yc.string(t.alternativeDeclarationCommand, this.defaultValue.alternativeDeclarationCommand),
      alternativeImplementationCommand: yc.string(t.alternativeImplementationCommand, this.defaultValue.alternativeImplementationCommand),
      alternativeReferenceCommand: yc.string(t.alternativeReferenceCommand, this.defaultValue.alternativeReferenceCommand),
      alternativeTestsCommand: yc.string(t.alternativeTestsCommand, this.defaultValue.alternativeTestsCommand)
    };
  }
}
class Dot extends ms {
  constructor() {
    const e = {
      enabled: !0,
      delay: 300,
      hidingDelay: 300,
      sticky: !0,
      above: !0
    };
    super(69, "hover", e, {
      "editor.hover.enabled": {
        type: "boolean",
        default: e.enabled,
        description: S(247, "Controls whether the hover is shown.")
      },
      "editor.hover.delay": {
        type: "number",
        default: e.delay,
        minimum: 0,
        maximum: 1e4,
        description: S(248, "Controls the delay in milliseconds after which the hover is shown.")
      },
      "editor.hover.sticky": {
        type: "boolean",
        default: e.sticky,
        description: S(249, "Controls whether the hover should remain visible when mouse is moved over it.")
      },
      "editor.hover.hidingDelay": {
        type: "integer",
        minimum: 0,
        default: e.hidingDelay,
        markdownDescription: S(250, "Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")
      },
      "editor.hover.above": {
        type: "boolean",
        default: e.above,
        description: S(251, "Prefer showing hovers above the line, if there's space.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      enabled: Ot(t.enabled, this.defaultValue.enabled),
      delay: dr.clampedInt(t.delay, this.defaultValue.delay, 0, 1e4),
      sticky: Ot(t.sticky, this.defaultValue.sticky),
      hidingDelay: dr.clampedInt(t.hidingDelay, this.defaultValue.hidingDelay, 0, 6e5),
      above: Ot(t.above, this.defaultValue.above)
    };
  }
}
class YN extends Sw {
  constructor() {
    super(
      165
      /* EditorOption.layoutInfo */
    );
  }
  compute(e, t, n) {
    return YN.computeLayout(t, {
      memory: e.memory,
      outerWidth: e.outerWidth,
      outerHeight: e.outerHeight,
      isDominatedByLongLines: e.isDominatedByLongLines,
      lineHeight: e.fontInfo.lineHeight,
      viewLineCount: e.viewLineCount,
      lineNumbersDigitCount: e.lineNumbersDigitCount,
      typicalHalfwidthCharacterWidth: e.fontInfo.typicalHalfwidthCharacterWidth,
      maxDigitWidth: e.fontInfo.maxDigitWidth,
      pixelRatio: e.pixelRatio,
      glyphMarginDecorationLaneCount: e.glyphMarginDecorationLaneCount
    });
  }
  static computeContainedMinimapLineCount(e) {
    const t = e.height / e.lineHeight, n = Math.floor(e.paddingTop / e.lineHeight);
    let r = Math.floor(e.paddingBottom / e.lineHeight);
    e.scrollBeyondLastLine && (r = Math.max(r, t - 1));
    const s = (n + e.viewLineCount + r) / (e.pixelRatio * e.height), o = Math.floor(e.viewLineCount / s);
    return { typicalViewportLineCount: t, extraLinesBeforeFirstLine: n, extraLinesBeyondLastLine: r, desiredRatio: s, minimapLineCount: o };
  }
  static _computeMinimapLayout(e, t) {
    const n = e.outerWidth, r = e.outerHeight, s = e.pixelRatio;
    if (!e.minimap.enabled)
      return {
        renderMinimap: 0,
        minimapLeft: 0,
        minimapWidth: 0,
        minimapHeightIsEditorHeight: !1,
        minimapIsSampling: !1,
        minimapScale: 1,
        minimapLineHeight: 1,
        minimapCanvasInnerWidth: 0,
        minimapCanvasInnerHeight: Math.floor(s * r),
        minimapCanvasOuterWidth: 0,
        minimapCanvasOuterHeight: r
      };
    const o = t.stableMinimapLayoutInput, a = o && e.outerHeight === o.outerHeight && e.lineHeight === o.lineHeight && e.typicalHalfwidthCharacterWidth === o.typicalHalfwidthCharacterWidth && e.pixelRatio === o.pixelRatio && e.scrollBeyondLastLine === o.scrollBeyondLastLine && e.paddingTop === o.paddingTop && e.paddingBottom === o.paddingBottom && e.minimap.enabled === o.minimap.enabled && e.minimap.side === o.minimap.side && e.minimap.size === o.minimap.size && e.minimap.showSlider === o.minimap.showSlider && e.minimap.renderCharacters === o.minimap.renderCharacters && e.minimap.maxColumn === o.minimap.maxColumn && e.minimap.scale === o.minimap.scale && e.verticalScrollbarWidth === o.verticalScrollbarWidth && e.isViewportWrapping === o.isViewportWrapping, l = e.lineHeight, c = e.typicalHalfwidthCharacterWidth, u = e.scrollBeyondLastLine, d = e.minimap.renderCharacters;
    let h = s >= 2 ? Math.round(e.minimap.scale * 2) : e.minimap.scale;
    const g = e.minimap.maxColumn, m = e.minimap.size, _ = e.minimap.side, v = e.verticalScrollbarWidth, w = e.viewLineCount, E = e.remainingWidth, L = e.isViewportWrapping, T = d ? 2 : 3;
    let D = Math.floor(s * r);
    const N = D / s;
    let R = !1, M = !1, B = T * h, H = h / s, j = 1;
    if (m === "fill" || m === "fit") {
      const { typicalViewportLineCount: Z, extraLinesBeforeFirstLine: pe, extraLinesBeyondLastLine: J, desiredRatio: ae, minimapLineCount: be } = YN.computeContainedMinimapLineCount({
        viewLineCount: w,
        scrollBeyondLastLine: u,
        paddingTop: e.paddingTop,
        paddingBottom: e.paddingBottom,
        height: r,
        lineHeight: l,
        pixelRatio: s
      });
      if (w / be > 1)
        R = !0, M = !0, h = 1, B = 1, H = h / s;
      else {
        let ze = !1, Ve = h + 1;
        if (m === "fit") {
          const st = Math.ceil((pe + w + J) * B);
          L && a && E <= t.stableFitRemainingWidth ? (ze = !0, Ve = t.stableFitMaxMinimapScale) : ze = st > D;
        }
        if (m === "fill" || ze) {
          R = !0;
          const st = h;
          B = Math.min(l * s, Math.max(1, Math.floor(1 / ae))), L && a && E <= t.stableFitRemainingWidth && (Ve = t.stableFitMaxMinimapScale), h = Math.min(Ve, Math.max(1, Math.floor(B / T))), h > st && (j = Math.min(2, h / st)), H = h / s / j, D = Math.ceil(Math.max(Z, pe + w + J) * B), L ? (t.stableMinimapLayoutInput = e, t.stableFitRemainingWidth = E, t.stableFitMaxMinimapScale = h) : (t.stableMinimapLayoutInput = null, t.stableFitRemainingWidth = 0);
        }
      }
    }
    const K = Math.floor(g * H), X = Math.min(K, Math.max(0, Math.floor((E - v - 2) * H / (c + H))) + C_);
    let Y = Math.floor(s * X);
    const G = Y / s;
    Y = Math.floor(Y * j);
    const Q = d ? 1 : 2, oe = _ === "left" ? 0 : n - X - v;
    return {
      renderMinimap: Q,
      minimapLeft: oe,
      minimapWidth: X,
      minimapHeightIsEditorHeight: R,
      minimapIsSampling: M,
      minimapScale: h,
      minimapLineHeight: B,
      minimapCanvasInnerWidth: Y,
      minimapCanvasInnerHeight: D,
      minimapCanvasOuterWidth: G,
      minimapCanvasOuterHeight: N
    };
  }
  static computeLayout(e, t) {
    const n = t.outerWidth | 0, r = t.outerHeight | 0, s = t.lineHeight | 0, o = t.lineNumbersDigitCount | 0, a = t.typicalHalfwidthCharacterWidth, l = t.maxDigitWidth, c = t.pixelRatio, u = t.viewLineCount, d = e.get(
      154
      /* EditorOption.wordWrapOverride2 */
    ), h = d === "inherit" ? e.get(
      153
      /* EditorOption.wordWrapOverride1 */
    ) : d, g = h === "inherit" ? e.get(
      149
      /* EditorOption.wordWrap */
    ) : h, m = e.get(
      152
      /* EditorOption.wordWrapColumn */
    ), _ = t.isDominatedByLongLines, v = e.get(
      66
      /* EditorOption.glyphMargin */
    ), w = e.get(
      76
      /* EditorOption.lineNumbers */
    ).renderType !== 0, E = e.get(
      77
      /* EditorOption.lineNumbersMinChars */
    ), L = e.get(
      119
      /* EditorOption.scrollBeyondLastLine */
    ), T = e.get(
      96
      /* EditorOption.padding */
    ), D = e.get(
      81
      /* EditorOption.minimap */
    ), N = e.get(
      117
      /* EditorOption.scrollbar */
    ), R = N.verticalScrollbarSize, M = N.verticalHasArrows, B = N.arrowSize, H = N.horizontalScrollbarSize, j = e.get(
      52
      /* EditorOption.folding */
    ), K = e.get(
      126
      /* EditorOption.showFoldingControls */
    ) !== "never";
    let X = e.get(
      74
      /* EditorOption.lineDecorationsWidth */
    );
    j && K && (X += 16);
    let Y = 0;
    if (w) {
      const et = Math.max(o, E);
      Y = Math.round(et * l);
    }
    let G = 0;
    v && (G = s * t.glyphMarginDecorationLaneCount);
    let Q = 0, oe = Q + G, Z = oe + Y, pe = Z + X;
    const J = n - G - Y - X;
    let ae = !1, be = !1, re = -1;
    e.get(
      2
      /* EditorOption.accessibilitySupport */
    ) === 2 && h === "inherit" && _ ? (ae = !0, be = !0) : g === "on" || g === "bounded" ? be = !0 : g === "wordWrapColumn" && (re = m);
    const ze = YN._computeMinimapLayout({
      outerWidth: n,
      outerHeight: r,
      lineHeight: s,
      typicalHalfwidthCharacterWidth: a,
      pixelRatio: c,
      scrollBeyondLastLine: L,
      paddingTop: T.top,
      paddingBottom: T.bottom,
      minimap: D,
      verticalScrollbarWidth: R,
      viewLineCount: u,
      remainingWidth: J,
      isViewportWrapping: be
    }, t.memory || new SFe());
    ze.renderMinimap !== 0 && ze.minimapLeft === 0 && (Q += ze.minimapWidth, oe += ze.minimapWidth, Z += ze.minimapWidth, pe += ze.minimapWidth);
    const Ve = J - ze.minimapWidth, st = Math.max(1, Math.floor((Ve - R - 2) / a)), ot = M ? B : 0;
    return be && (re = Math.max(1, st), g === "bounded" && (re = Math.min(re, m))), {
      width: n,
      height: r,
      glyphMarginLeft: Q,
      glyphMarginWidth: G,
      glyphMarginDecorationLaneCount: t.glyphMarginDecorationLaneCount,
      lineNumbersLeft: oe,
      lineNumbersWidth: Y,
      decorationsLeft: Z,
      decorationsWidth: X,
      contentLeft: pe,
      contentWidth: Ve,
      minimap: ze,
      viewportColumn: st,
      isWordWrapMinified: ae,
      isViewportWrapping: be,
      wrappingColumn: re,
      verticalScrollbarWidth: R,
      horizontalScrollbarHeight: H,
      overviewRuler: {
        top: ot,
        width: R,
        height: r - 2 * ot,
        right: 0
      }
    };
  }
}
class Iot extends ms {
  constructor() {
    super(156, "wrappingStrategy", "simple", {
      "editor.wrappingStrategy": {
        enumDescriptions: [
          S(252, "Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),
          S(253, "Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")
        ],
        type: "string",
        enum: ["simple", "advanced"],
        default: "simple",
        description: S(254, "Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")
      }
    });
  }
  validate(e) {
    return Zr(e, "simple", ["simple", "advanced"]);
  }
  compute(e, t, n) {
    return t.get(
      2
      /* EditorOption.accessibilitySupport */
    ) === 2 ? "advanced" : n;
  }
}
var Ag;
(function(i) {
  i.Off = "off", i.OnCode = "onCode", i.On = "on";
})(Ag || (Ag = {}));
class Not extends ms {
  constructor() {
    const e = { enabled: Ag.OnCode };
    super(73, "lightbulb", e, {
      "editor.lightbulb.enabled": {
        type: "string",
        enum: [Ag.Off, Ag.OnCode, Ag.On],
        default: e.enabled,
        enumDescriptions: [
          S(255, "Disable the code action menu."),
          S(256, "Show the code action menu when the cursor is on lines with code."),
          S(257, "Show the code action menu when the cursor is on lines with code or on empty lines.")
        ],
        description: S(258, "Enables the Code Action lightbulb in the editor.")
      }
    });
  }
  validate(e) {
    return !e || typeof e != "object" ? this.defaultValue : {
      enabled: Zr(e.enabled, this.defaultValue.enabled, [Ag.Off, Ag.OnCode, Ag.On])
    };
  }
}
class Rot extends ms {
  constructor() {
    const e = { enabled: !0, maxLineCount: 5, defaultModel: "outlineModel", scrollWithEditor: !0 };
    super(131, "stickyScroll", e, {
      "editor.stickyScroll.enabled": {
        type: "boolean",
        default: e.enabled,
        description: S(259, "Shows the nested current scopes during the scroll at the top of the editor.")
      },
      "editor.stickyScroll.maxLineCount": {
        type: "number",
        default: e.maxLineCount,
        minimum: 1,
        maximum: 20,
        description: S(260, "Defines the maximum number of sticky lines to show.")
      },
      "editor.stickyScroll.defaultModel": {
        type: "string",
        enum: ["outlineModel", "foldingProviderModel", "indentationModel"],
        default: e.defaultModel,
        description: S(261, "Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")
      },
      "editor.stickyScroll.scrollWithEditor": {
        type: "boolean",
        default: e.scrollWithEditor,
        description: S(262, "Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      enabled: Ot(t.enabled, this.defaultValue.enabled),
      maxLineCount: dr.clampedInt(t.maxLineCount, this.defaultValue.maxLineCount, 1, 20),
      defaultModel: Zr(t.defaultModel, this.defaultValue.defaultModel, ["outlineModel", "foldingProviderModel", "indentationModel"]),
      scrollWithEditor: Ot(t.scrollWithEditor, this.defaultValue.scrollWithEditor)
    };
  }
}
class Aot extends ms {
  constructor() {
    const e = { enabled: "on", fontSize: 0, fontFamily: "", padding: !1, maximumLength: 43 };
    super(159, "inlayHints", e, {
      "editor.inlayHints.enabled": {
        type: "string",
        default: e.enabled,
        description: S(263, "Enables the inlay hints in the editor."),
        enum: ["on", "onUnlessPressed", "offUnlessPressed", "off"],
        markdownEnumDescriptions: [
          S(264, "Inlay hints are enabled"),
          S(265, "Inlay hints are showing by default and hide when holding {0}", Kn ? "Ctrl+Option" : "Ctrl+Alt"),
          S(266, "Inlay hints are hidden by default and show when holding {0}", Kn ? "Ctrl+Option" : "Ctrl+Alt"),
          S(267, "Inlay hints are disabled")
        ]
      },
      "editor.inlayHints.fontSize": {
        type: "number",
        default: e.fontSize,
        markdownDescription: S(268, "Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.", "`#editor.fontSize#`", "`5`")
      },
      "editor.inlayHints.fontFamily": {
        type: "string",
        default: e.fontFamily,
        markdownDescription: S(269, "Controls font family of inlay hints in the editor. When set to empty, the {0} is used.", "`#editor.fontFamily#`")
      },
      "editor.inlayHints.padding": {
        type: "boolean",
        default: e.padding,
        description: S(270, "Enables the padding around the inlay hints in the editor.")
      },
      "editor.inlayHints.maximumLength": {
        type: "number",
        default: e.maximumLength,
        markdownDescription: S(271, "Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return typeof t.enabled == "boolean" && (t.enabled = t.enabled ? "on" : "off"), {
      enabled: Zr(t.enabled, this.defaultValue.enabled, ["on", "off", "offUnlessPressed", "onUnlessPressed"]),
      fontSize: dr.clampedInt(t.fontSize, this.defaultValue.fontSize, 0, 100),
      fontFamily: yc.string(t.fontFamily, this.defaultValue.fontFamily),
      padding: Ot(t.padding, this.defaultValue.padding),
      maximumLength: dr.clampedInt(t.maximumLength, this.defaultValue.maximumLength, 0, Number.MAX_SAFE_INTEGER)
    };
  }
}
class Oot extends ms {
  constructor() {
    super(74, "lineDecorationsWidth", 10);
  }
  validate(e) {
    return typeof e == "string" && /^\d+(\.\d+)?ch$/.test(e) ? -parseFloat(e.substring(0, e.length - 2)) : dr.clampedInt(e, this.defaultValue, 0, 1e3);
  }
  compute(e, t, n) {
    return n < 0 ? dr.clampedInt(-n * e.fontInfo.typicalHalfwidthCharacterWidth, this.defaultValue, 0, 1e3) : n;
  }
}
class Mot extends Fh {
  constructor() {
    super(75, "lineHeight", au.lineHeight, (e) => Fh.clamp(e, 0, 150), { markdownDescription: S(272, `Controls the line height. 
 - Use 0 to automatically compute the line height from the font size.
 - Values between 0 and 8 will be used as a multiplier with the font size.
 - Values greater than or equal to 8 will be used as effective values.`) }, 0, 150);
  }
  compute(e, t, n) {
    return e.fontInfo.lineHeight;
  }
}
class Pot extends ms {
  constructor() {
    const e = {
      enabled: !0,
      size: "proportional",
      side: "right",
      showSlider: "mouseover",
      autohide: "none",
      renderCharacters: !0,
      maxColumn: 120,
      scale: 1,
      showRegionSectionHeaders: !0,
      showMarkSectionHeaders: !0,
      markSectionHeaderRegex: "\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",
      sectionHeaderFontSize: 9,
      sectionHeaderLetterSpacing: 1
    };
    super(81, "minimap", e, {
      "editor.minimap.enabled": {
        type: "boolean",
        default: e.enabled,
        description: S(273, "Controls whether the minimap is shown.")
      },
      "editor.minimap.autohide": {
        type: "string",
        enum: ["none", "mouseover", "scroll"],
        enumDescriptions: [
          S(274, "The minimap is always shown."),
          S(275, "The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap."),
          S(276, "The minimap is only shown when the editor is scrolled")
        ],
        default: e.autohide,
        description: S(277, "Controls whether the minimap is hidden automatically.")
      },
      "editor.minimap.size": {
        type: "string",
        enum: ["proportional", "fill", "fit"],
        enumDescriptions: [
          S(278, "The minimap has the same size as the editor contents (and might scroll)."),
          S(279, "The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),
          S(280, "The minimap will shrink as necessary to never be larger than the editor (no scrolling).")
        ],
        default: e.size,
        description: S(281, "Controls the size of the minimap.")
      },
      "editor.minimap.side": {
        type: "string",
        enum: ["left", "right"],
        default: e.side,
        description: S(282, "Controls the side where to render the minimap.")
      },
      "editor.minimap.showSlider": {
        type: "string",
        enum: ["always", "mouseover"],
        default: e.showSlider,
        description: S(283, "Controls when the minimap slider is shown.")
      },
      "editor.minimap.scale": {
        type: "number",
        default: e.scale,
        minimum: 1,
        maximum: 3,
        enum: [1, 2, 3],
        description: S(284, "Scale of content drawn in the minimap: 1, 2 or 3.")
      },
      "editor.minimap.renderCharacters": {
        type: "boolean",
        default: e.renderCharacters,
        description: S(285, "Render the actual characters on a line as opposed to color blocks.")
      },
      "editor.minimap.maxColumn": {
        type: "number",
        default: e.maxColumn,
        description: S(286, "Limit the width of the minimap to render at most a certain number of columns.")
      },
      "editor.minimap.showRegionSectionHeaders": {
        type: "boolean",
        default: e.showRegionSectionHeaders,
        description: S(287, "Controls whether named regions are shown as section headers in the minimap.")
      },
      "editor.minimap.showMarkSectionHeaders": {
        type: "boolean",
        default: e.showMarkSectionHeaders,
        description: S(288, "Controls whether MARK: comments are shown as section headers in the minimap.")
      },
      "editor.minimap.markSectionHeaderRegex": {
        type: "string",
        default: e.markSectionHeaderRegex,
        description: S(289, "Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")
      },
      "editor.minimap.sectionHeaderFontSize": {
        type: "number",
        default: e.sectionHeaderFontSize,
        description: S(290, "Controls the font size of section headers in the minimap.")
      },
      "editor.minimap.sectionHeaderLetterSpacing": {
        type: "number",
        default: e.sectionHeaderLetterSpacing,
        description: S(291, "Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    let n = this.defaultValue.markSectionHeaderRegex;
    const r = e.markSectionHeaderRegex;
    if (typeof r == "string")
      try {
        new RegExp(r, "d"), n = r;
      } catch {
      }
    return {
      enabled: Ot(t.enabled, this.defaultValue.enabled),
      autohide: Zr(t.autohide, this.defaultValue.autohide, ["none", "mouseover", "scroll"]),
      size: Zr(t.size, this.defaultValue.size, ["proportional", "fill", "fit"]),
      side: Zr(t.side, this.defaultValue.side, ["right", "left"]),
      showSlider: Zr(t.showSlider, this.defaultValue.showSlider, ["always", "mouseover"]),
      renderCharacters: Ot(t.renderCharacters, this.defaultValue.renderCharacters),
      scale: dr.clampedInt(t.scale, 1, 1, 3),
      maxColumn: dr.clampedInt(t.maxColumn, this.defaultValue.maxColumn, 1, 1e4),
      showRegionSectionHeaders: Ot(t.showRegionSectionHeaders, this.defaultValue.showRegionSectionHeaders),
      showMarkSectionHeaders: Ot(t.showMarkSectionHeaders, this.defaultValue.showMarkSectionHeaders),
      markSectionHeaderRegex: n,
      sectionHeaderFontSize: Fh.clamp(t.sectionHeaderFontSize ?? this.defaultValue.sectionHeaderFontSize, 4, 32),
      sectionHeaderLetterSpacing: Fh.clamp(t.sectionHeaderLetterSpacing ?? this.defaultValue.sectionHeaderLetterSpacing, 0, 5)
    };
  }
}
function Fot(i) {
  return i === "ctrlCmd" ? Kn ? "metaKey" : "ctrlKey" : "altKey";
}
class Bot extends ms {
  constructor() {
    super(96, "padding", { top: 0, bottom: 0 }, {
      "editor.padding.top": {
        type: "number",
        default: 0,
        minimum: 0,
        maximum: 1e3,
        description: S(292, "Controls the amount of space between the top edge of the editor and the first line.")
      },
      "editor.padding.bottom": {
        type: "number",
        default: 0,
        minimum: 0,
        maximum: 1e3,
        description: S(293, "Controls the amount of space between the bottom edge of the editor and the last line.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      top: dr.clampedInt(t.top, 0, 0, 1e3),
      bottom: dr.clampedInt(t.bottom, 0, 0, 1e3)
    };
  }
}
class Hot extends ms {
  constructor() {
    const e = {
      enabled: !0,
      cycle: !0
    };
    super(98, "parameterHints", e, {
      "editor.parameterHints.enabled": {
        type: "boolean",
        default: e.enabled,
        description: S(294, "Enables a pop-up that shows parameter documentation and type information as you type.")
      },
      "editor.parameterHints.cycle": {
        type: "boolean",
        default: e.cycle,
        description: S(295, "Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      enabled: Ot(t.enabled, this.defaultValue.enabled),
      cycle: Ot(t.cycle, this.defaultValue.cycle)
    };
  }
}
class Wot extends Sw {
  constructor() {
    super(
      163
      /* EditorOption.pixelRatio */
    );
  }
  compute(e, t, n) {
    return e.pixelRatio;
  }
}
class Vot extends ms {
  constructor() {
    super(100, "placeholder", void 0);
  }
  validate(e) {
    return typeof e > "u" ? this.defaultValue : typeof e == "string" ? e : this.defaultValue;
  }
}
class Uot extends ms {
  constructor() {
    const e = {
      other: "on",
      comments: "off",
      strings: "off"
    }, t = [
      { type: "boolean" },
      {
        type: "string",
        enum: ["on", "inline", "off"],
        enumDescriptions: [S(296, "Quick suggestions show inside the suggest widget"), S(297, "Quick suggestions show as ghost text"), S(298, "Quick suggestions are disabled")]
      }
    ];
    super(102, "quickSuggestions", e, {
      type: "object",
      additionalProperties: !1,
      properties: {
        strings: {
          anyOf: t,
          default: e.strings,
          description: S(299, "Enable quick suggestions inside strings.")
        },
        comments: {
          anyOf: t,
          default: e.comments,
          description: S(300, "Enable quick suggestions inside comments.")
        },
        other: {
          anyOf: t,
          default: e.other,
          description: S(301, "Enable quick suggestions outside of strings and comments.")
        }
      },
      default: e,
      markdownDescription: S(302, "Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.", "`#editor.suggestOnTriggerCharacters#`")
    }), this.defaultValue = e;
  }
  validate(e) {
    if (typeof e == "boolean") {
      const c = e ? "on" : "off";
      return { comments: c, strings: c, other: c };
    }
    if (!e || typeof e != "object")
      return this.defaultValue;
    const { other: t, comments: n, strings: r } = e, s = ["on", "inline", "off"];
    let o, a, l;
    return typeof t == "boolean" ? o = t ? "on" : "off" : o = Zr(t, this.defaultValue.other, s), typeof n == "boolean" ? a = n ? "on" : "off" : a = Zr(n, this.defaultValue.comments, s), typeof r == "boolean" ? l = r ? "on" : "off" : l = Zr(r, this.defaultValue.strings, s), {
      other: o,
      comments: a,
      strings: l
    };
  }
}
class zot extends ms {
  constructor() {
    super(76, "lineNumbers", { renderType: 1, renderFn: null }, {
      type: "string",
      enum: ["off", "on", "relative", "interval"],
      enumDescriptions: [
        S(303, "Line numbers are not rendered."),
        S(304, "Line numbers are rendered as absolute number."),
        S(305, "Line numbers are rendered as distance in lines to cursor position."),
        S(306, "Line numbers are rendered every 10 lines.")
      ],
      default: "on",
      description: S(307, "Controls the display of line numbers.")
    });
  }
  validate(e) {
    let t = this.defaultValue.renderType, n = this.defaultValue.renderFn;
    return typeof e < "u" && (typeof e == "function" ? (t = 4, n = e) : e === "interval" ? t = 3 : e === "relative" ? t = 2 : e === "on" ? t = 1 : t = 0), {
      renderType: t,
      renderFn: n
    };
  }
}
function XV(i) {
  const e = i.get(
    112
    /* EditorOption.renderValidationDecorations */
  );
  return e === "editable" ? i.get(
    104
    /* EditorOption.readOnly */
  ) : e !== "on";
}
function ZV(i) {
  return !i.get(
    172
    /* EditorOption.effectiveAllowVariableFonts */
  );
}
class $ot extends ms {
  constructor() {
    const e = [], t = { type: "number", description: S(308, "Number of monospace characters at which this editor ruler will render.") };
    super(116, "rulers", e, {
      type: "array",
      items: {
        anyOf: [
          t,
          {
            type: [
              "object"
            ],
            properties: {
              column: t,
              color: {
                type: "string",
                description: S(309, "Color of this editor ruler."),
                format: "color-hex"
              }
            }
          }
        ]
      },
      default: e,
      description: S(310, "Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")
    });
  }
  validate(e) {
    if (Array.isArray(e)) {
      const t = [];
      for (const n of e)
        if (typeof n == "number")
          t.push({
            column: dr.clampedInt(n, 0, 0, 1e4),
            color: null
          });
        else if (n && typeof n == "object") {
          const r = n;
          t.push({
            column: dr.clampedInt(r.column, 0, 0, 1e4),
            color: r.color
          });
        }
      return t.sort((n, r) => n.column - r.column), t;
    }
    return this.defaultValue;
  }
}
class jot extends ms {
  constructor() {
    super(105, "readOnlyMessage", void 0);
  }
  validate(e) {
    return !e || typeof e != "object" ? this.defaultValue : e;
  }
}
function yLe(i, e) {
  if (typeof i != "string")
    return e;
  switch (i) {
    case "hidden":
      return 2;
    case "visible":
      return 3;
    default:
      return 1;
  }
}
let Got = class extends ms {
  constructor() {
    const e = {
      vertical: 1,
      horizontal: 1,
      arrowSize: 11,
      useShadows: !0,
      verticalHasArrows: !1,
      horizontalHasArrows: !1,
      horizontalScrollbarSize: 12,
      horizontalSliderSize: 12,
      verticalScrollbarSize: 14,
      verticalSliderSize: 14,
      handleMouseWheel: !0,
      alwaysConsumeMouseWheel: !0,
      scrollByPage: !1,
      ignoreHorizontalScrollbarInContentHeight: !1
    };
    super(117, "scrollbar", e, {
      "editor.scrollbar.vertical": {
        type: "string",
        enum: ["auto", "visible", "hidden"],
        enumDescriptions: [
          S(311, "The vertical scrollbar will be visible only when necessary."),
          S(312, "The vertical scrollbar will always be visible."),
          S(313, "The vertical scrollbar will always be hidden.")
        ],
        default: "auto",
        description: S(314, "Controls the visibility of the vertical scrollbar.")
      },
      "editor.scrollbar.horizontal": {
        type: "string",
        enum: ["auto", "visible", "hidden"],
        enumDescriptions: [
          S(315, "The horizontal scrollbar will be visible only when necessary."),
          S(316, "The horizontal scrollbar will always be visible."),
          S(317, "The horizontal scrollbar will always be hidden.")
        ],
        default: "auto",
        description: S(318, "Controls the visibility of the horizontal scrollbar.")
      },
      "editor.scrollbar.verticalScrollbarSize": {
        type: "number",
        default: e.verticalScrollbarSize,
        description: S(319, "The width of the vertical scrollbar.")
      },
      "editor.scrollbar.horizontalScrollbarSize": {
        type: "number",
        default: e.horizontalScrollbarSize,
        description: S(320, "The height of the horizontal scrollbar.")
      },
      "editor.scrollbar.scrollByPage": {
        type: "boolean",
        default: e.scrollByPage,
        description: S(321, "Controls whether clicks scroll by page or jump to click position.")
      },
      "editor.scrollbar.ignoreHorizontalScrollbarInContentHeight": {
        type: "boolean",
        default: e.ignoreHorizontalScrollbarInContentHeight,
        description: S(322, "When set, the horizontal scrollbar will not increase the size of the editor's content.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e, n = dr.clampedInt(t.horizontalScrollbarSize, this.defaultValue.horizontalScrollbarSize, 0, 1e3), r = dr.clampedInt(t.verticalScrollbarSize, this.defaultValue.verticalScrollbarSize, 0, 1e3);
    return {
      arrowSize: dr.clampedInt(t.arrowSize, this.defaultValue.arrowSize, 0, 1e3),
      vertical: yLe(t.vertical, this.defaultValue.vertical),
      horizontal: yLe(t.horizontal, this.defaultValue.horizontal),
      useShadows: Ot(t.useShadows, this.defaultValue.useShadows),
      verticalHasArrows: Ot(t.verticalHasArrows, this.defaultValue.verticalHasArrows),
      horizontalHasArrows: Ot(t.horizontalHasArrows, this.defaultValue.horizontalHasArrows),
      handleMouseWheel: Ot(t.handleMouseWheel, this.defaultValue.handleMouseWheel),
      alwaysConsumeMouseWheel: Ot(t.alwaysConsumeMouseWheel, this.defaultValue.alwaysConsumeMouseWheel),
      horizontalScrollbarSize: n,
      horizontalSliderSize: dr.clampedInt(t.horizontalSliderSize, n, 0, 1e3),
      verticalScrollbarSize: r,
      verticalSliderSize: dr.clampedInt(t.verticalSliderSize, r, 0, 1e3),
      scrollByPage: Ot(t.scrollByPage, this.defaultValue.scrollByPage),
      ignoreHorizontalScrollbarInContentHeight: Ot(t.ignoreHorizontalScrollbarInContentHeight, this.defaultValue.ignoreHorizontalScrollbarInContentHeight)
    };
  }
};
const xh = "inUntrustedWorkspace", zu = {
  allowedCharacters: "editor.unicodeHighlight.allowedCharacters",
  invisibleCharacters: "editor.unicodeHighlight.invisibleCharacters",
  nonBasicASCII: "editor.unicodeHighlight.nonBasicASCII",
  ambiguousCharacters: "editor.unicodeHighlight.ambiguousCharacters",
  includeComments: "editor.unicodeHighlight.includeComments",
  includeStrings: "editor.unicodeHighlight.includeStrings",
  allowedLocales: "editor.unicodeHighlight.allowedLocales"
};
class qot extends ms {
  constructor() {
    const e = {
      nonBasicASCII: xh,
      invisibleCharacters: !0,
      ambiguousCharacters: !0,
      includeComments: xh,
      includeStrings: !0,
      allowedCharacters: {},
      allowedLocales: { _os: !0, _vscode: !0 }
    };
    super(142, "unicodeHighlight", e, {
      [zu.nonBasicASCII]: {
        restricted: !0,
        type: ["boolean", "string"],
        enum: [!0, !1, xh],
        default: e.nonBasicASCII,
        description: S(323, "Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")
      },
      [zu.invisibleCharacters]: {
        restricted: !0,
        type: "boolean",
        default: e.invisibleCharacters,
        description: S(324, "Controls whether characters that just reserve space or have no width at all are highlighted.")
      },
      [zu.ambiguousCharacters]: {
        restricted: !0,
        type: "boolean",
        default: e.ambiguousCharacters,
        description: S(325, "Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")
      },
      [zu.includeComments]: {
        restricted: !0,
        type: ["boolean", "string"],
        enum: [!0, !1, xh],
        default: e.includeComments,
        description: S(326, "Controls whether characters in comments should also be subject to Unicode highlighting.")
      },
      [zu.includeStrings]: {
        restricted: !0,
        type: ["boolean", "string"],
        enum: [!0, !1, xh],
        default: e.includeStrings,
        description: S(327, "Controls whether characters in strings should also be subject to Unicode highlighting.")
      },
      [zu.allowedCharacters]: {
        restricted: !0,
        type: "object",
        default: e.allowedCharacters,
        description: S(328, "Defines allowed characters that are not being highlighted."),
        additionalProperties: {
          type: "boolean"
        }
      },
      [zu.allowedLocales]: {
        restricted: !0,
        type: "object",
        additionalProperties: {
          type: "boolean"
        },
        default: e.allowedLocales,
        description: S(329, "Unicode characters that are common in allowed locales are not being highlighted.")
      }
    });
  }
  applyUpdate(e, t) {
    let n = !1;
    t.allowedCharacters && e && (Wd(e.allowedCharacters, t.allowedCharacters) || (e = { ...e, allowedCharacters: t.allowedCharacters }, n = !0)), t.allowedLocales && e && (Wd(e.allowedLocales, t.allowedLocales) || (e = { ...e, allowedLocales: t.allowedLocales }, n = !0));
    const r = super.applyUpdate(e, t);
    return n ? new EF(r.newValue, !0) : r;
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      nonBasicASCII: XN(t.nonBasicASCII, xh, [!0, !1, xh]),
      invisibleCharacters: Ot(t.invisibleCharacters, this.defaultValue.invisibleCharacters),
      ambiguousCharacters: Ot(t.ambiguousCharacters, this.defaultValue.ambiguousCharacters),
      includeComments: XN(t.includeComments, xh, [!0, !1, xh]),
      includeStrings: XN(t.includeStrings, xh, [!0, !1, xh]),
      allowedCharacters: this.validateBooleanMap(e.allowedCharacters, this.defaultValue.allowedCharacters),
      allowedLocales: this.validateBooleanMap(e.allowedLocales, this.defaultValue.allowedLocales)
    };
  }
  validateBooleanMap(e, t) {
    if (typeof e != "object" || !e)
      return t;
    const n = {};
    for (const [r, s] of Object.entries(e))
      s === !0 && (n[r] = !0);
    return n;
  }
}
class Kot extends ms {
  constructor() {
    const e = {
      enabled: !0,
      mode: "subwordSmart",
      showToolbar: "onHover",
      suppressSuggestions: !1,
      keepOnBlur: !1,
      fontFamily: "default",
      syntaxHighlightingEnabled: !0,
      minShowDelay: 0,
      suppressInSnippetMode: !1,
      edits: {
        enabled: !0,
        showCollapsed: !1,
        renderSideBySide: "auto",
        allowCodeShifting: "always"
      },
      triggerCommandOnProviderChange: !0,
      experimental: {
        suppressInlineSuggestions: "",
        showOnSuggestConflict: "never",
        emptyResponseInformation: !0
      }
    };
    super(71, "inlineSuggest", e, {
      "editor.inlineSuggest.enabled": {
        type: "boolean",
        default: e.enabled,
        description: S(330, "Controls whether to automatically show inline suggestions in the editor.")
      },
      "editor.inlineSuggest.showToolbar": {
        type: "string",
        default: e.showToolbar,
        enum: ["always", "onHover", "never"],
        enumDescriptions: [
          S(331, "Show the inline suggestion toolbar whenever an inline suggestion is shown."),
          S(332, "Show the inline suggestion toolbar when hovering over an inline suggestion."),
          S(333, "Never show the inline suggestion toolbar.")
        ],
        description: S(334, "Controls when to show the inline suggestion toolbar.")
      },
      "editor.inlineSuggest.syntaxHighlightingEnabled": {
        type: "boolean",
        default: e.syntaxHighlightingEnabled,
        description: S(335, "Controls whether to show syntax highlighting for inline suggestions in the editor.")
      },
      "editor.inlineSuggest.suppressSuggestions": {
        type: "boolean",
        default: e.suppressSuggestions,
        description: S(336, "Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")
      },
      "editor.inlineSuggest.suppressInSnippetMode": {
        type: "boolean",
        default: e.suppressInSnippetMode,
        description: S(337, "Controls whether inline suggestions are suppressed when in snippet mode.")
      },
      "editor.inlineSuggest.minShowDelay": {
        type: "number",
        default: 0,
        minimum: 0,
        maximum: 1e4,
        description: S(338, "Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.")
      },
      "editor.inlineSuggest.experimental.suppressInlineSuggestions": {
        type: "string",
        default: e.experimental.suppressInlineSuggestions,
        tags: ["experimental"],
        description: S(339, "Suppresses inline completions for specified extension IDs -- comma separated."),
        experiment: {
          mode: "auto"
        }
      },
      "editor.inlineSuggest.experimental.emptyResponseInformation": {
        type: "boolean",
        default: e.experimental.emptyResponseInformation,
        tags: ["experimental"],
        description: S(340, "Controls whether to send request information from the inline suggestion provider."),
        experiment: {
          mode: "auto"
        }
      },
      "editor.inlineSuggest.triggerCommandOnProviderChange": {
        type: "boolean",
        default: e.triggerCommandOnProviderChange,
        tags: ["experimental"],
        description: S(341, "Controls whether to trigger a command when the inline suggestion provider changes."),
        experiment: {
          mode: "auto"
        }
      },
      "editor.inlineSuggest.experimental.showOnSuggestConflict": {
        type: "string",
        default: e.experimental.showOnSuggestConflict,
        tags: ["experimental"],
        enum: ["always", "never", "whenSuggestListIsIncomplete"],
        description: S(342, "Controls whether to show inline suggestions when there is a suggest conflict."),
        experiment: {
          mode: "auto"
        }
      },
      "editor.inlineSuggest.fontFamily": {
        type: "string",
        default: e.fontFamily,
        description: S(343, "Controls the font family of the inline suggestions.")
      },
      "editor.inlineSuggest.edits.allowCodeShifting": {
        type: "string",
        default: e.edits.allowCodeShifting,
        description: S(344, "Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),
        enum: ["always", "horizontal", "never"],
        tags: ["nextEditSuggestions"]
      },
      "editor.inlineSuggest.edits.renderSideBySide": {
        type: "string",
        default: e.edits.renderSideBySide,
        description: S(345, "Controls whether larger suggestions can be shown side by side."),
        enum: ["auto", "never"],
        enumDescriptions: [
          S(346, "Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),
          S(347, "Larger suggestions are never shown side by side and will always be shown below.")
        ],
        tags: ["nextEditSuggestions"]
      },
      "editor.inlineSuggest.edits.showCollapsed": {
        type: "boolean",
        default: e.edits.showCollapsed,
        description: S(348, "Controls whether the suggestion will show as collapsed until jumping to it."),
        tags: ["nextEditSuggestions"]
      }
    });
  }
  validate(e) {
    var n, r, s, o, a, l, c;
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      enabled: Ot(t.enabled, this.defaultValue.enabled),
      mode: Zr(t.mode, this.defaultValue.mode, ["prefix", "subword", "subwordSmart"]),
      showToolbar: Zr(t.showToolbar, this.defaultValue.showToolbar, ["always", "onHover", "never"]),
      suppressSuggestions: Ot(t.suppressSuggestions, this.defaultValue.suppressSuggestions),
      keepOnBlur: Ot(t.keepOnBlur, this.defaultValue.keepOnBlur),
      fontFamily: yc.string(t.fontFamily, this.defaultValue.fontFamily),
      syntaxHighlightingEnabled: Ot(t.syntaxHighlightingEnabled, this.defaultValue.syntaxHighlightingEnabled),
      minShowDelay: dr.clampedInt(t.minShowDelay, 0, 0, 1e4),
      suppressInSnippetMode: Ot(t.suppressInSnippetMode, this.defaultValue.suppressInSnippetMode),
      edits: {
        enabled: Ot((n = t.edits) == null ? void 0 : n.enabled, this.defaultValue.edits.enabled),
        showCollapsed: Ot((r = t.edits) == null ? void 0 : r.showCollapsed, this.defaultValue.edits.showCollapsed),
        allowCodeShifting: Zr((s = t.edits) == null ? void 0 : s.allowCodeShifting, this.defaultValue.edits.allowCodeShifting, ["always", "horizontal", "never"]),
        renderSideBySide: Zr((o = t.edits) == null ? void 0 : o.renderSideBySide, this.defaultValue.edits.renderSideBySide, ["never", "auto"])
      },
      triggerCommandOnProviderChange: Ot(t.triggerCommandOnProviderChange, this.defaultValue.triggerCommandOnProviderChange),
      experimental: {
        suppressInlineSuggestions: yc.string((a = t.experimental) == null ? void 0 : a.suppressInlineSuggestions, this.defaultValue.experimental.suppressInlineSuggestions),
        showOnSuggestConflict: Zr((l = t.experimental) == null ? void 0 : l.showOnSuggestConflict, this.defaultValue.experimental.showOnSuggestConflict, ["always", "never", "whenSuggestListIsIncomplete"]),
        emptyResponseInformation: Ot((c = t.experimental) == null ? void 0 : c.emptyResponseInformation, this.defaultValue.experimental.emptyResponseInformation)
      }
    };
  }
}
class Yot extends ms {
  constructor() {
    const e = {
      enabled: Gl.bracketPairColorizationOptions.enabled,
      independentColorPoolPerBracketType: Gl.bracketPairColorizationOptions.independentColorPoolPerBracketType
    };
    super(21, "bracketPairColorization", e, {
      "editor.bracketPairColorization.enabled": {
        type: "boolean",
        default: e.enabled,
        markdownDescription: S(349, "Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.", "`#workbench.colorCustomizations#`")
      },
      "editor.bracketPairColorization.independentColorPoolPerBracketType": {
        type: "boolean",
        default: e.independentColorPoolPerBracketType,
        description: S(350, "Controls whether each bracket type has its own independent color pool.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      enabled: Ot(t.enabled, this.defaultValue.enabled),
      independentColorPoolPerBracketType: Ot(t.independentColorPoolPerBracketType, this.defaultValue.independentColorPoolPerBracketType)
    };
  }
}
class Xot extends ms {
  constructor() {
    const e = {
      bracketPairs: !1,
      bracketPairsHorizontal: "active",
      highlightActiveBracketPair: !0,
      indentation: !0,
      highlightActiveIndentation: !0
    };
    super(22, "guides", e, {
      "editor.guides.bracketPairs": {
        type: ["boolean", "string"],
        enum: [!0, "active", !1],
        enumDescriptions: [
          S(351, "Enables bracket pair guides."),
          S(352, "Enables bracket pair guides only for the active bracket pair."),
          S(353, "Disables bracket pair guides.")
        ],
        default: e.bracketPairs,
        description: S(354, "Controls whether bracket pair guides are enabled or not.")
      },
      "editor.guides.bracketPairsHorizontal": {
        type: ["boolean", "string"],
        enum: [!0, "active", !1],
        enumDescriptions: [
          S(355, "Enables horizontal guides as addition to vertical bracket pair guides."),
          S(356, "Enables horizontal guides only for the active bracket pair."),
          S(357, "Disables horizontal bracket pair guides.")
        ],
        default: e.bracketPairsHorizontal,
        description: S(358, "Controls whether horizontal bracket pair guides are enabled or not.")
      },
      "editor.guides.highlightActiveBracketPair": {
        type: "boolean",
        default: e.highlightActiveBracketPair,
        description: S(359, "Controls whether the editor should highlight the active bracket pair.")
      },
      "editor.guides.indentation": {
        type: "boolean",
        default: e.indentation,
        description: S(360, "Controls whether the editor should render indent guides.")
      },
      "editor.guides.highlightActiveIndentation": {
        type: ["boolean", "string"],
        enum: [!0, "always", !1],
        enumDescriptions: [
          S(361, "Highlights the active indent guide."),
          S(362, "Highlights the active indent guide even if bracket guides are highlighted."),
          S(363, "Do not highlight the active indent guide.")
        ],
        default: e.highlightActiveIndentation,
        description: S(364, "Controls whether the editor should highlight the active indent guide.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      bracketPairs: XN(t.bracketPairs, this.defaultValue.bracketPairs, [!0, !1, "active"]),
      bracketPairsHorizontal: XN(t.bracketPairsHorizontal, this.defaultValue.bracketPairsHorizontal, [!0, !1, "active"]),
      highlightActiveBracketPair: Ot(t.highlightActiveBracketPair, this.defaultValue.highlightActiveBracketPair),
      indentation: Ot(t.indentation, this.defaultValue.indentation),
      highlightActiveIndentation: XN(t.highlightActiveIndentation, this.defaultValue.highlightActiveIndentation, [!0, !1, "always"])
    };
  }
}
function XN(i, e, t) {
  const n = t.indexOf(i);
  return n === -1 ? e : t[n];
}
class Zot extends ms {
  constructor() {
    const e = {
      insertMode: "insert",
      filterGraceful: !0,
      snippetsPreventQuickSuggestions: !1,
      localityBonus: !1,
      shareSuggestSelections: !1,
      selectionMode: "always",
      showIcons: !0,
      showStatusBar: !1,
      preview: !1,
      previewMode: "subwordSmart",
      showInlineDetails: !0,
      showMethods: !0,
      showFunctions: !0,
      showConstructors: !0,
      showDeprecated: !0,
      matchOnWordStartOnly: !0,
      showFields: !0,
      showVariables: !0,
      showClasses: !0,
      showStructs: !0,
      showInterfaces: !0,
      showModules: !0,
      showProperties: !0,
      showEvents: !0,
      showOperators: !0,
      showUnits: !0,
      showValues: !0,
      showConstants: !0,
      showEnums: !0,
      showEnumMembers: !0,
      showKeywords: !0,
      showWords: !0,
      showColors: !0,
      showFiles: !0,
      showReferences: !0,
      showFolders: !0,
      showTypeParameters: !0,
      showSnippets: !0,
      showUsers: !0,
      showIssues: !0
    };
    super(134, "suggest", e, {
      "editor.suggest.insertMode": {
        type: "string",
        enum: ["insert", "replace"],
        enumDescriptions: [
          S(365, "Insert suggestion without overwriting text right of the cursor."),
          S(366, "Insert suggestion and overwrite text right of the cursor.")
        ],
        default: e.insertMode,
        description: S(367, "Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")
      },
      "editor.suggest.filterGraceful": {
        type: "boolean",
        default: e.filterGraceful,
        description: S(368, "Controls whether filtering and sorting suggestions accounts for small typos.")
      },
      "editor.suggest.localityBonus": {
        type: "boolean",
        default: e.localityBonus,
        description: S(369, "Controls whether sorting favors words that appear close to the cursor.")
      },
      "editor.suggest.shareSuggestSelections": {
        type: "boolean",
        default: e.shareSuggestSelections,
        markdownDescription: S(370, "Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")
      },
      "editor.suggest.selectionMode": {
        type: "string",
        enum: ["always", "never", "whenTriggerCharacter", "whenQuickSuggestion"],
        enumDescriptions: [
          S(371, "Always select a suggestion when automatically triggering IntelliSense."),
          S(372, "Never select a suggestion when automatically triggering IntelliSense."),
          S(373, "Select a suggestion only when triggering IntelliSense from a trigger character."),
          S(374, "Select a suggestion only when triggering IntelliSense as you type.")
        ],
        default: e.selectionMode,
        markdownDescription: S(375, "Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.", "`#editor.quickSuggestions#`", "`#editor.suggestOnTriggerCharacters#`")
      },
      "editor.suggest.snippetsPreventQuickSuggestions": {
        type: "boolean",
        default: e.snippetsPreventQuickSuggestions,
        description: S(376, "Controls whether an active snippet prevents quick suggestions.")
      },
      "editor.suggest.showIcons": {
        type: "boolean",
        default: e.showIcons,
        description: S(377, "Controls whether to show or hide icons in suggestions.")
      },
      "editor.suggest.showStatusBar": {
        type: "boolean",
        default: e.showStatusBar,
        description: S(378, "Controls the visibility of the status bar at the bottom of the suggest widget.")
      },
      "editor.suggest.preview": {
        type: "boolean",
        default: e.preview,
        description: S(379, "Controls whether to preview the suggestion outcome in the editor.")
      },
      "editor.suggest.showInlineDetails": {
        type: "boolean",
        default: e.showInlineDetails,
        description: S(380, "Controls whether suggest details show inline with the label or only in the details widget.")
      },
      "editor.suggest.maxVisibleSuggestions": {
        type: "number",
        deprecationMessage: S(381, "This setting is deprecated. The suggest widget can now be resized.")
      },
      "editor.suggest.filteredTypes": {
        type: "object",
        deprecationMessage: S(382, "This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")
      },
      "editor.suggest.showMethods": {
        type: "boolean",
        default: !0,
        markdownDescription: S(383, "When enabled IntelliSense shows `method`-suggestions.")
      },
      "editor.suggest.showFunctions": {
        type: "boolean",
        default: !0,
        markdownDescription: S(384, "When enabled IntelliSense shows `function`-suggestions.")
      },
      "editor.suggest.showConstructors": {
        type: "boolean",
        default: !0,
        markdownDescription: S(385, "When enabled IntelliSense shows `constructor`-suggestions.")
      },
      "editor.suggest.showDeprecated": {
        type: "boolean",
        default: !0,
        markdownDescription: S(386, "When enabled IntelliSense shows `deprecated`-suggestions.")
      },
      "editor.suggest.matchOnWordStartOnly": {
        type: "boolean",
        default: !0,
        markdownDescription: S(387, "When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")
      },
      "editor.suggest.showFields": {
        type: "boolean",
        default: !0,
        markdownDescription: S(388, "When enabled IntelliSense shows `field`-suggestions.")
      },
      "editor.suggest.showVariables": {
        type: "boolean",
        default: !0,
        markdownDescription: S(389, "When enabled IntelliSense shows `variable`-suggestions.")
      },
      "editor.suggest.showClasses": {
        type: "boolean",
        default: !0,
        markdownDescription: S(390, "When enabled IntelliSense shows `class`-suggestions.")
      },
      "editor.suggest.showStructs": {
        type: "boolean",
        default: !0,
        markdownDescription: S(391, "When enabled IntelliSense shows `struct`-suggestions.")
      },
      "editor.suggest.showInterfaces": {
        type: "boolean",
        default: !0,
        markdownDescription: S(392, "When enabled IntelliSense shows `interface`-suggestions.")
      },
      "editor.suggest.showModules": {
        type: "boolean",
        default: !0,
        markdownDescription: S(393, "When enabled IntelliSense shows `module`-suggestions.")
      },
      "editor.suggest.showProperties": {
        type: "boolean",
        default: !0,
        markdownDescription: S(394, "When enabled IntelliSense shows `property`-suggestions.")
      },
      "editor.suggest.showEvents": {
        type: "boolean",
        default: !0,
        markdownDescription: S(395, "When enabled IntelliSense shows `event`-suggestions.")
      },
      "editor.suggest.showOperators": {
        type: "boolean",
        default: !0,
        markdownDescription: S(396, "When enabled IntelliSense shows `operator`-suggestions.")
      },
      "editor.suggest.showUnits": {
        type: "boolean",
        default: !0,
        markdownDescription: S(397, "When enabled IntelliSense shows `unit`-suggestions.")
      },
      "editor.suggest.showValues": {
        type: "boolean",
        default: !0,
        markdownDescription: S(398, "When enabled IntelliSense shows `value`-suggestions.")
      },
      "editor.suggest.showConstants": {
        type: "boolean",
        default: !0,
        markdownDescription: S(399, "When enabled IntelliSense shows `constant`-suggestions.")
      },
      "editor.suggest.showEnums": {
        type: "boolean",
        default: !0,
        markdownDescription: S(400, "When enabled IntelliSense shows `enum`-suggestions.")
      },
      "editor.suggest.showEnumMembers": {
        type: "boolean",
        default: !0,
        markdownDescription: S(401, "When enabled IntelliSense shows `enumMember`-suggestions.")
      },
      "editor.suggest.showKeywords": {
        type: "boolean",
        default: !0,
        markdownDescription: S(402, "When enabled IntelliSense shows `keyword`-suggestions.")
      },
      "editor.suggest.showWords": {
        type: "boolean",
        default: !0,
        markdownDescription: S(403, "When enabled IntelliSense shows `text`-suggestions.")
      },
      "editor.suggest.showColors": {
        type: "boolean",
        default: !0,
        markdownDescription: S(404, "When enabled IntelliSense shows `color`-suggestions.")
      },
      "editor.suggest.showFiles": {
        type: "boolean",
        default: !0,
        markdownDescription: S(405, "When enabled IntelliSense shows `file`-suggestions.")
      },
      "editor.suggest.showReferences": {
        type: "boolean",
        default: !0,
        markdownDescription: S(406, "When enabled IntelliSense shows `reference`-suggestions.")
      },
      "editor.suggest.showCustomcolors": {
        type: "boolean",
        default: !0,
        markdownDescription: S(407, "When enabled IntelliSense shows `customcolor`-suggestions.")
      },
      "editor.suggest.showFolders": {
        type: "boolean",
        default: !0,
        markdownDescription: S(408, "When enabled IntelliSense shows `folder`-suggestions.")
      },
      "editor.suggest.showTypeParameters": {
        type: "boolean",
        default: !0,
        markdownDescription: S(409, "When enabled IntelliSense shows `typeParameter`-suggestions.")
      },
      "editor.suggest.showSnippets": {
        type: "boolean",
        default: !0,
        markdownDescription: S(410, "When enabled IntelliSense shows `snippet`-suggestions.")
      },
      "editor.suggest.showUsers": {
        type: "boolean",
        default: !0,
        markdownDescription: S(411, "When enabled IntelliSense shows `user`-suggestions.")
      },
      "editor.suggest.showIssues": {
        type: "boolean",
        default: !0,
        markdownDescription: S(412, "When enabled IntelliSense shows `issues`-suggestions.")
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      insertMode: Zr(t.insertMode, this.defaultValue.insertMode, ["insert", "replace"]),
      filterGraceful: Ot(t.filterGraceful, this.defaultValue.filterGraceful),
      snippetsPreventQuickSuggestions: Ot(t.snippetsPreventQuickSuggestions, this.defaultValue.filterGraceful),
      localityBonus: Ot(t.localityBonus, this.defaultValue.localityBonus),
      shareSuggestSelections: Ot(t.shareSuggestSelections, this.defaultValue.shareSuggestSelections),
      selectionMode: Zr(t.selectionMode, this.defaultValue.selectionMode, ["always", "never", "whenQuickSuggestion", "whenTriggerCharacter"]),
      showIcons: Ot(t.showIcons, this.defaultValue.showIcons),
      showStatusBar: Ot(t.showStatusBar, this.defaultValue.showStatusBar),
      preview: Ot(t.preview, this.defaultValue.preview),
      previewMode: Zr(t.previewMode, this.defaultValue.previewMode, ["prefix", "subword", "subwordSmart"]),
      showInlineDetails: Ot(t.showInlineDetails, this.defaultValue.showInlineDetails),
      showMethods: Ot(t.showMethods, this.defaultValue.showMethods),
      showFunctions: Ot(t.showFunctions, this.defaultValue.showFunctions),
      showConstructors: Ot(t.showConstructors, this.defaultValue.showConstructors),
      showDeprecated: Ot(t.showDeprecated, this.defaultValue.showDeprecated),
      matchOnWordStartOnly: Ot(t.matchOnWordStartOnly, this.defaultValue.matchOnWordStartOnly),
      showFields: Ot(t.showFields, this.defaultValue.showFields),
      showVariables: Ot(t.showVariables, this.defaultValue.showVariables),
      showClasses: Ot(t.showClasses, this.defaultValue.showClasses),
      showStructs: Ot(t.showStructs, this.defaultValue.showStructs),
      showInterfaces: Ot(t.showInterfaces, this.defaultValue.showInterfaces),
      showModules: Ot(t.showModules, this.defaultValue.showModules),
      showProperties: Ot(t.showProperties, this.defaultValue.showProperties),
      showEvents: Ot(t.showEvents, this.defaultValue.showEvents),
      showOperators: Ot(t.showOperators, this.defaultValue.showOperators),
      showUnits: Ot(t.showUnits, this.defaultValue.showUnits),
      showValues: Ot(t.showValues, this.defaultValue.showValues),
      showConstants: Ot(t.showConstants, this.defaultValue.showConstants),
      showEnums: Ot(t.showEnums, this.defaultValue.showEnums),
      showEnumMembers: Ot(t.showEnumMembers, this.defaultValue.showEnumMembers),
      showKeywords: Ot(t.showKeywords, this.defaultValue.showKeywords),
      showWords: Ot(t.showWords, this.defaultValue.showWords),
      showColors: Ot(t.showColors, this.defaultValue.showColors),
      showFiles: Ot(t.showFiles, this.defaultValue.showFiles),
      showReferences: Ot(t.showReferences, this.defaultValue.showReferences),
      showFolders: Ot(t.showFolders, this.defaultValue.showFolders),
      showTypeParameters: Ot(t.showTypeParameters, this.defaultValue.showTypeParameters),
      showSnippets: Ot(t.showSnippets, this.defaultValue.showSnippets),
      showUsers: Ot(t.showUsers, this.defaultValue.showUsers),
      showIssues: Ot(t.showIssues, this.defaultValue.showIssues)
    };
  }
}
class Qot extends ms {
  constructor() {
    super(129, "smartSelect", {
      selectLeadingAndTrailingWhitespace: !0,
      selectSubwords: !0
    }, {
      "editor.smartSelect.selectLeadingAndTrailingWhitespace": {
        description: S(413, "Whether leading and trailing whitespace should always be selected."),
        default: !0,
        type: "boolean"
      },
      "editor.smartSelect.selectSubwords": {
        description: S(414, "Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),
        default: !0,
        type: "boolean"
      }
    });
  }
  validate(e) {
    return !e || typeof e != "object" ? this.defaultValue : {
      selectLeadingAndTrailingWhitespace: Ot(e.selectLeadingAndTrailingWhitespace, this.defaultValue.selectLeadingAndTrailingWhitespace),
      selectSubwords: Ot(e.selectSubwords, this.defaultValue.selectSubwords)
    };
  }
}
class Jot extends ms {
  constructor() {
    const e = [];
    super(147, "wordSegmenterLocales", e, {
      anyOf: [
        {
          type: "string"
        },
        {
          type: "array",
          items: {
            type: "string"
          }
        }
      ],
      description: S(415, "Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),
      type: "array",
      items: {
        type: "string"
      },
      default: e
    });
  }
  validate(e) {
    if (typeof e == "string" && (e = [e]), Array.isArray(e)) {
      const t = [];
      for (const n of e)
        if (typeof n == "string")
          try {
            Intl.Segmenter.supportedLocalesOf(n).length > 0 && t.push(n);
          } catch {
          }
      return t;
    }
    return this.defaultValue;
  }
}
class eat extends ms {
  constructor() {
    super(155, "wrappingIndent", 1, {
      "editor.wrappingIndent": {
        type: "string",
        enum: ["none", "same", "indent", "deepIndent"],
        enumDescriptions: [
          S(416, "No indentation. Wrapped lines begin at column 1."),
          S(417, "Wrapped lines get the same indentation as the parent."),
          S(418, "Wrapped lines get +1 indentation toward the parent."),
          S(419, "Wrapped lines get +2 indentation toward the parent.")
        ],
        description: S(420, "Controls the indentation of wrapped lines."),
        default: "same"
      }
    });
  }
  validate(e) {
    switch (e) {
      case "none":
        return 0;
      case "same":
        return 1;
      case "indent":
        return 2;
      case "deepIndent":
        return 3;
    }
    return 1;
  }
  compute(e, t, n) {
    return t.get(
      2
      /* EditorOption.accessibilitySupport */
    ) === 2 ? 0 : n;
  }
}
class tat extends Sw {
  constructor() {
    super(
      166
      /* EditorOption.wrappingInfo */
    );
  }
  compute(e, t, n) {
    const r = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    return {
      isDominatedByLongLines: e.isDominatedByLongLines,
      isWordWrapMinified: r.isWordWrapMinified,
      isViewportWrapping: r.isViewportWrapping,
      wrappingColumn: r.wrappingColumn
    };
  }
}
class nat extends ms {
  constructor() {
    const e = { enabled: !0, showDropSelector: "afterDrop" };
    super(43, "dropIntoEditor", e, {
      "editor.dropIntoEditor.enabled": {
        type: "boolean",
        default: e.enabled,
        markdownDescription: S(421, "Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")
      },
      "editor.dropIntoEditor.showDropSelector": {
        type: "string",
        markdownDescription: S(422, "Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),
        enum: [
          "afterDrop",
          "never"
        ],
        enumDescriptions: [
          S(423, "Show the drop selector widget after a file is dropped into the editor."),
          S(424, "Never show the drop selector widget. Instead the default drop provider is always used.")
        ],
        default: "afterDrop"
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      enabled: Ot(t.enabled, this.defaultValue.enabled),
      showDropSelector: Zr(t.showDropSelector, this.defaultValue.showDropSelector, ["afterDrop", "never"])
    };
  }
}
class iat extends ms {
  constructor() {
    const e = { enabled: !0, showPasteSelector: "afterPaste" };
    super(97, "pasteAs", e, {
      "editor.pasteAs.enabled": {
        type: "boolean",
        default: e.enabled,
        markdownDescription: S(425, "Controls whether you can paste content in different ways.")
      },
      "editor.pasteAs.showPasteSelector": {
        type: "string",
        markdownDescription: S(426, "Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),
        enum: [
          "afterPaste",
          "never"
        ],
        enumDescriptions: [
          S(427, "Show the paste selector widget after content is pasted into the editor."),
          S(428, "Never show the paste selector widget. Instead the default pasting behavior is always used.")
        ],
        default: "afterPaste"
      }
    });
  }
  validate(e) {
    if (!e || typeof e != "object")
      return this.defaultValue;
    const t = e;
    return {
      enabled: Ot(t.enabled, this.defaultValue.enabled),
      showPasteSelector: Zr(t.showPasteSelector, this.defaultValue.showPasteSelector, ["afterPaste", "never"])
    };
  }
}
const rat = "Consolas, 'Courier New', monospace", sat = "Menlo, Monaco, 'Courier New', monospace", oat = "'Droid Sans Mono', 'monospace', monospace", au = {
  fontFamily: Kn ? sat : Za ? rat : oat,
  fontWeight: "normal",
  fontSize: Kn ? 12 : 14,
  lineHeight: 0,
  letterSpacing: 0
}, sN = [];
function We(i) {
  return sN[i.id] = i, i;
}
const wm = {
  acceptSuggestionOnCommitCharacter: We(new zn(0, "acceptSuggestionOnCommitCharacter", !0, { markdownDescription: S(429, "Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.") })),
  acceptSuggestionOnEnter: We(new gs(1, "acceptSuggestionOnEnter", "on", ["on", "smart", "off"], {
    markdownEnumDescriptions: [
      "",
      S(430, "Only accept a suggestion with `Enter` when it makes a textual change."),
      ""
    ],
    markdownDescription: S(431, "Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")
  })),
  accessibilitySupport: We(new _ot()),
  accessibilityPageSize: We(new dr(3, "accessibilityPageSize", 500, 1, 1073741824, {
    description: S(432, "Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),
    tags: ["accessibility"]
  })),
  allowOverflow: We(new zn(4, "allowOverflow", !0)),
  allowVariableLineHeights: We(new zn(5, "allowVariableLineHeights", !0, {
    description: S(433, "Controls whether to allow using variable line heights in the editor.")
  })),
  allowVariableFonts: We(new zn(6, "allowVariableFonts", !0, {
    description: S(434, "Controls whether to allow using variable fonts in the editor.")
  })),
  allowVariableFontsInAccessibilityMode: We(new zn(7, "allowVariableFontsInAccessibilityMode", !1, {
    description: S(435, "Controls whether to allow using variable fonts in the editor in the accessibility mode."),
    tags: ["accessibility"]
  })),
  ariaLabel: We(new yc(8, "ariaLabel", S(436, "Editor content"))),
  ariaRequired: We(new zn(9, "ariaRequired", !1, void 0)),
  screenReaderAnnounceInlineSuggestion: We(new zn(12, "screenReaderAnnounceInlineSuggestion", !0, {
    description: S(437, "Control whether inline suggestions are announced by a screen reader."),
    tags: ["accessibility"]
  })),
  autoClosingBrackets: We(new gs(10, "autoClosingBrackets", "languageDefined", ["always", "languageDefined", "beforeWhitespace", "never"], {
    enumDescriptions: [
      "",
      S(438, "Use language configurations to determine when to autoclose brackets."),
      S(439, "Autoclose brackets only when the cursor is to the left of whitespace."),
      ""
    ],
    description: S(440, "Controls whether the editor should automatically close brackets after the user adds an opening bracket.")
  })),
  autoClosingComments: We(new gs(11, "autoClosingComments", "languageDefined", ["always", "languageDefined", "beforeWhitespace", "never"], {
    enumDescriptions: [
      "",
      S(441, "Use language configurations to determine when to autoclose comments."),
      S(442, "Autoclose comments only when the cursor is to the left of whitespace."),
      ""
    ],
    description: S(443, "Controls whether the editor should automatically close comments after the user adds an opening comment.")
  })),
  autoClosingDelete: We(new gs(13, "autoClosingDelete", "auto", ["always", "auto", "never"], {
    enumDescriptions: [
      "",
      S(444, "Remove adjacent closing quotes or brackets only if they were automatically inserted."),
      ""
    ],
    description: S(445, "Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")
  })),
  autoClosingOvertype: We(new gs(14, "autoClosingOvertype", "auto", ["always", "auto", "never"], {
    enumDescriptions: [
      "",
      S(446, "Type over closing quotes or brackets only if they were automatically inserted."),
      ""
    ],
    description: S(447, "Controls whether the editor should type over closing quotes or brackets.")
  })),
  autoClosingQuotes: We(new gs(15, "autoClosingQuotes", "languageDefined", ["always", "languageDefined", "beforeWhitespace", "never"], {
    enumDescriptions: [
      "",
      S(448, "Use language configurations to determine when to autoclose quotes."),
      S(449, "Autoclose quotes only when the cursor is to the left of whitespace."),
      ""
    ],
    description: S(450, "Controls whether the editor should automatically close quotes after the user adds an opening quote.")
  })),
  autoIndent: We(new VM(16, "autoIndent", 4, "full", ["none", "keep", "brackets", "advanced", "full"], mot, {
    enumDescriptions: [
      S(451, "The editor will not insert indentation automatically."),
      S(452, "The editor will keep the current line's indentation."),
      S(453, "The editor will keep the current line's indentation and honor language defined brackets."),
      S(454, "The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),
      S(455, "The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")
    ],
    description: S(456, "Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")
  })),
  autoIndentOnPaste: We(new zn(17, "autoIndentOnPaste", !1, { description: S(457, "Controls whether the editor should automatically auto-indent the pasted content.") })),
  autoIndentOnPasteWithinString: We(new zn(18, "autoIndentOnPasteWithinString", !0, { description: S(458, "Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.") })),
  automaticLayout: We(new zn(19, "automaticLayout", !1)),
  autoSurround: We(new gs(20, "autoSurround", "languageDefined", ["languageDefined", "quotes", "brackets", "never"], {
    enumDescriptions: [
      S(459, "Use language configurations to determine when to automatically surround selections."),
      S(460, "Surround with quotes but not brackets."),
      S(461, "Surround with brackets but not quotes."),
      ""
    ],
    description: S(462, "Controls whether the editor should automatically surround selections when typing quotes or brackets.")
  })),
  bracketPairColorization: We(new Yot()),
  bracketPairGuides: We(new Xot()),
  stickyTabStops: We(new zn(132, "stickyTabStops", !1, { description: S(463, "Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.") })),
  codeLens: We(new zn(23, "codeLens", !0, { description: S(464, "Controls whether the editor shows CodeLens.") })),
  codeLensFontFamily: We(new yc(24, "codeLensFontFamily", "", { description: S(465, "Controls the font family for CodeLens.") })),
  codeLensFontSize: We(new dr(25, "codeLensFontSize", 0, 0, 100, {
    type: "number",
    default: 0,
    minimum: 0,
    maximum: 100,
    markdownDescription: S(466, "Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")
  })),
  colorDecorators: We(new zn(26, "colorDecorators", !0, { description: S(467, "Controls whether the editor should render the inline color decorators and color picker.") })),
  colorDecoratorActivatedOn: We(new gs(168, "colorDecoratorsActivatedOn", "clickAndHover", ["clickAndHover", "hover", "click"], {
    enumDescriptions: [
      S(468, "Make the color picker appear both on click and hover of the color decorator"),
      S(469, "Make the color picker appear on hover of the color decorator"),
      S(470, "Make the color picker appear on click of the color decorator")
    ],
    description: S(471, "Controls the condition to make a color picker appear from a color decorator.")
  })),
  colorDecoratorsLimit: We(new dr(27, "colorDecoratorsLimit", 500, 1, 1e6, {
    markdownDescription: S(472, "Controls the max number of color decorators that can be rendered in an editor at once.")
  })),
  columnSelection: We(new zn(28, "columnSelection", !1, { description: S(473, "Enable that the selection with the mouse and keys is doing column selection.") })),
  comments: We(new bot()),
  contextmenu: We(new zn(30, "contextmenu", !0)),
  copyWithSyntaxHighlighting: We(new zn(31, "copyWithSyntaxHighlighting", !0, { description: S(474, "Controls whether syntax highlighting should be copied into the clipboard.") })),
  cursorBlinking: We(new VM(32, "cursorBlinking", 1, "blink", ["blink", "smooth", "phase", "expand", "solid"], vot, { description: S(475, "Control the cursor animation style.") })),
  cursorSmoothCaretAnimation: We(new gs(33, "cursorSmoothCaretAnimation", "off", ["off", "explicit", "on"], {
    enumDescriptions: [
      S(476, "Smooth caret animation is disabled."),
      S(477, "Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),
      S(478, "Smooth caret animation is always enabled.")
    ],
    description: S(479, "Controls whether the smooth caret animation should be enabled.")
  })),
  cursorStyle: We(new VM(34, "cursorStyle", Ia.Line, "line", ["line", "block", "underline", "line-thin", "block-outline", "underline-thin"], vLe, { description: S(480, "Controls the cursor style in insert input mode.") })),
  overtypeCursorStyle: We(new VM(92, "overtypeCursorStyle", Ia.Block, "block", ["line", "block", "underline", "line-thin", "block-outline", "underline-thin"], vLe, { description: S(481, "Controls the cursor style in overtype input mode.") })),
  cursorSurroundingLines: We(new dr(35, "cursorSurroundingLines", 0, 0, 1073741824, { description: S(482, "Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.") })),
  cursorSurroundingLinesStyle: We(new gs(36, "cursorSurroundingLinesStyle", "default", ["default", "all"], {
    enumDescriptions: [
      S(483, "`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),
      S(484, "`cursorSurroundingLines` is enforced always.")
    ],
    markdownDescription: S(485, "Controls when `#editor.cursorSurroundingLines#` should be enforced.")
  })),
  cursorWidth: We(new dr(37, "cursorWidth", 0, 0, 1073741824, { markdownDescription: S(486, "Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.") })),
  cursorHeight: We(new dr(38, "cursorHeight", 0, 0, 1073741824, { markdownDescription: S(487, "Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.") })),
  disableLayerHinting: We(new zn(39, "disableLayerHinting", !1)),
  disableMonospaceOptimizations: We(new zn(40, "disableMonospaceOptimizations", !1)),
  domReadOnly: We(new zn(41, "domReadOnly", !1)),
  dragAndDrop: We(new zn(42, "dragAndDrop", !0, { description: S(488, "Controls whether the editor should allow moving selections via drag and drop.") })),
  emptySelectionClipboard: We(new Cot()),
  dropIntoEditor: We(new nat()),
  editContext: We(new zn(44, "editContext", !0, {
    description: S(489, "Sets whether the EditContext API should be used instead of the text area to power input in the editor."),
    included: khe || BMe || hm
  })),
  renderRichScreenReaderContent: We(new zn(107, "renderRichScreenReaderContent", !1, {
    markdownDescription: S(490, "Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")
  })),
  stickyScroll: We(new Rot()),
  experimentalGpuAcceleration: We(new gs(46, "experimentalGpuAcceleration", "off", ["off", "on"], {
    tags: ["experimental"],
    enumDescriptions: [
      S(491, "Use regular DOM-based rendering."),
      S(492, "Use GPU acceleration.")
    ],
    description: S(493, "Controls whether to use the experimental GPU acceleration to render the editor.")
  })),
  experimentalWhitespaceRendering: We(new gs(47, "experimentalWhitespaceRendering", "svg", ["svg", "font", "off"], {
    enumDescriptions: [
      S(494, "Use a new rendering method with svgs."),
      S(495, "Use a new rendering method with font characters."),
      S(496, "Use the stable rendering method.")
    ],
    description: S(497, "Controls whether whitespace is rendered with a new, experimental method.")
  })),
  extraEditorClassName: We(new yc(48, "extraEditorClassName", "")),
  fastScrollSensitivity: We(new Fh(49, "fastScrollSensitivity", 5, (i) => i <= 0 ? 5 : i, { markdownDescription: S(498, "Scrolling speed multiplier when pressing `Alt`.") })),
  find: We(new wot()),
  fixedOverflowWidgets: We(new zn(51, "fixedOverflowWidgets", !1)),
  folding: We(new zn(52, "folding", !0, { description: S(499, "Controls whether the editor has code folding enabled.") })),
  foldingStrategy: We(new gs(53, "foldingStrategy", "auto", ["auto", "indentation"], {
    enumDescriptions: [
      S(500, "Use a language-specific folding strategy if available, else the indentation-based one."),
      S(501, "Use the indentation-based folding strategy.")
    ],
    description: S(502, "Controls the strategy for computing folding ranges.")
  })),
  foldingHighlight: We(new zn(54, "foldingHighlight", !0, { description: S(503, "Controls whether the editor should highlight folded ranges.") })),
  foldingImportsByDefault: We(new zn(55, "foldingImportsByDefault", !1, { description: S(504, "Controls whether the editor automatically collapses import ranges.") })),
  foldingMaximumRegions: We(new dr(
    56,
    "foldingMaximumRegions",
    5e3,
    10,
    65e3,
    // limit must be less than foldingRanges MAX_FOLDING_REGIONS
    { description: S(505, "The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.") }
  )),
  unfoldOnClickAfterEndOfLine: We(new zn(57, "unfoldOnClickAfterEndOfLine", !1, { description: S(506, "Controls whether clicking on the empty content after a folded line will unfold the line.") })),
  fontFamily: We(new yc(58, "fontFamily", au.fontFamily, { description: S(507, "Controls the font family.") })),
  fontInfo: We(new Sot()),
  fontLigatures2: We(new Yy()),
  fontSize: We(new Tot()),
  fontWeight: We(new Mie()),
  fontVariations: We(new h4()),
  formatOnPaste: We(new zn(64, "formatOnPaste", !1, { description: S(508, "Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.") })),
  formatOnType: We(new zn(65, "formatOnType", !1, { description: S(509, "Controls whether the editor should automatically format the line after typing.") })),
  glyphMargin: We(new zn(66, "glyphMargin", !0, { description: S(510, "Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.") })),
  gotoLocation: We(new kot()),
  hideCursorInOverviewRuler: We(new zn(68, "hideCursorInOverviewRuler", !1, { description: S(511, "Controls whether the cursor should be hidden in the overview ruler.") })),
  hover: We(new Dot()),
  inDiffEditor: We(new zn(70, "inDiffEditor", !1)),
  inertialScroll: We(new zn(158, "inertialScroll", !1, { description: S(512, "Make scrolling inertial - mostly useful with touchpad on linux.") })),
  letterSpacing: We(new Fh(72, "letterSpacing", au.letterSpacing, (i) => Fh.clamp(i, -5, 20), { description: S(513, "Controls the letter spacing in pixels.") })),
  lightbulb: We(new Not()),
  lineDecorationsWidth: We(new Oot()),
  lineHeight: We(new Mot()),
  lineNumbers: We(new zot()),
  lineNumbersMinChars: We(new dr(77, "lineNumbersMinChars", 5, 1, 300)),
  linkedEditing: We(new zn(78, "linkedEditing", !1, { description: S(514, "Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.") })),
  links: We(new zn(79, "links", !0, { description: S(515, "Controls whether the editor should detect links and make them clickable.") })),
  matchBrackets: We(new gs(80, "matchBrackets", "always", ["always", "near", "never"], { description: S(516, "Highlight matching brackets.") })),
  minimap: We(new Pot()),
  mouseStyle: We(new gs(82, "mouseStyle", "text", ["text", "default", "copy"])),
  mouseWheelScrollSensitivity: We(new Fh(83, "mouseWheelScrollSensitivity", 1, (i) => i === 0 ? 1 : i, { markdownDescription: S(517, "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.") })),
  mouseWheelZoom: We(new zn(84, "mouseWheelZoom", !1, {
    markdownDescription: Kn ? S(518, "Zoom the font of the editor when using mouse wheel and holding `Cmd`.") : S(519, "Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")
  })),
  multiCursorMergeOverlapping: We(new zn(85, "multiCursorMergeOverlapping", !0, { description: S(520, "Merge multiple cursors when they are overlapping.") })),
  multiCursorModifier: We(new VM(86, "multiCursorModifier", "altKey", "alt", ["ctrlCmd", "alt"], Fot, {
    markdownEnumDescriptions: [
      S(521, "Maps to `Control` on Windows and Linux and to `Command` on macOS."),
      S(522, "Maps to `Alt` on Windows and Linux and to `Option` on macOS.")
    ],
    markdownDescription: S(523, "The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")
  })),
  mouseMiddleClickAction: We(new gs(87, "mouseMiddleClickAction", "default", ["default", "openLink", "ctrlLeftClick"], { description: S(524, "Controls what happens when middle mouse button is clicked in the editor.") })),
  multiCursorPaste: We(new gs(88, "multiCursorPaste", "spread", ["spread", "full"], {
    markdownEnumDescriptions: [
      S(525, "Each cursor pastes a single line of the text."),
      S(526, "Each cursor pastes the full text.")
    ],
    markdownDescription: S(527, "Controls pasting when the line count of the pasted text matches the cursor count.")
  })),
  multiCursorLimit: We(new dr(89, "multiCursorLimit", 1e4, 1, 1e5, {
    markdownDescription: S(528, "Controls the max number of cursors that can be in an active editor at once.")
  })),
  occurrencesHighlight: We(new gs(90, "occurrencesHighlight", "singleFile", ["off", "singleFile", "multiFile"], {
    markdownEnumDescriptions: [
      S(529, "Does not highlight occurrences."),
      S(530, "Highlights occurrences only in the current file."),
      S(531, "Experimental: Highlights occurrences across all valid open files.")
    ],
    markdownDescription: S(532, "Controls whether occurrences should be highlighted across open files.")
  })),
  occurrencesHighlightDelay: We(new dr(91, "occurrencesHighlightDelay", 0, 0, 2e3, {
    description: S(533, "Controls the delay in milliseconds after which occurrences are highlighted."),
    tags: ["preview"]
  })),
  overtypeOnPaste: We(new zn(93, "overtypeOnPaste", !0, { description: S(534, "Controls whether pasting should overtype.") })),
  overviewRulerBorder: We(new zn(94, "overviewRulerBorder", !0, { description: S(535, "Controls whether a border should be drawn around the overview ruler.") })),
  overviewRulerLanes: We(new dr(95, "overviewRulerLanes", 3, 0, 3)),
  padding: We(new Bot()),
  pasteAs: We(new iat()),
  parameterHints: We(new Hot()),
  peekWidgetDefaultFocus: We(new gs(99, "peekWidgetDefaultFocus", "tree", ["tree", "editor"], {
    enumDescriptions: [
      S(536, "Focus the tree when opening peek"),
      S(537, "Focus the editor when opening peek")
    ],
    description: S(538, "Controls whether to focus the inline editor or the tree in the peek widget.")
  })),
  placeholder: We(new Vot()),
  definitionLinkOpensInPeek: We(new zn(101, "definitionLinkOpensInPeek", !1, { description: S(539, "Controls whether the Go to Definition mouse gesture always opens the peek widget.") })),
  quickSuggestions: We(new Uot()),
  quickSuggestionsDelay: We(new dr(103, "quickSuggestionsDelay", 10, 0, 1073741824, {
    description: S(540, "Controls the delay in milliseconds after which quick suggestions will show up."),
    experiment: {
      mode: "auto"
    }
  })),
  readOnly: We(new zn(104, "readOnly", !1)),
  readOnlyMessage: We(new jot()),
  renameOnType: We(new zn(106, "renameOnType", !1, { description: S(541, "Controls whether the editor auto renames on type."), markdownDeprecationMessage: S(542, "Deprecated, use `#editor.linkedEditing#` instead.") })),
  renderControlCharacters: We(new zn(108, "renderControlCharacters", !0, { description: S(543, "Controls whether the editor should render control characters."), restricted: !0 })),
  renderFinalNewline: We(new gs(109, "renderFinalNewline", Qu ? "dimmed" : "on", ["off", "on", "dimmed"], { description: S(544, "Render last line number when the file ends with a newline.") })),
  renderLineHighlight: We(new gs(110, "renderLineHighlight", "line", ["none", "gutter", "line", "all"], {
    enumDescriptions: [
      "",
      "",
      "",
      S(545, "Highlights both the gutter and the current line.")
    ],
    description: S(546, "Controls how the editor should render the current line highlight.")
  })),
  renderLineHighlightOnlyWhenFocus: We(new zn(111, "renderLineHighlightOnlyWhenFocus", !1, { description: S(547, "Controls if the editor should render the current line highlight only when the editor is focused.") })),
  renderValidationDecorations: We(new gs(112, "renderValidationDecorations", "editable", ["editable", "on", "off"])),
  renderWhitespace: We(new gs(113, "renderWhitespace", "selection", ["none", "boundary", "selection", "trailing", "all"], {
    enumDescriptions: [
      "",
      S(548, "Render whitespace characters except for single spaces between words."),
      S(549, "Render whitespace characters only on selected text."),
      S(550, "Render only trailing whitespace characters."),
      ""
    ],
    description: S(551, "Controls how the editor should render whitespace characters.")
  })),
  revealHorizontalRightPadding: We(new dr(114, "revealHorizontalRightPadding", 15, 0, 1e3)),
  roundedSelection: We(new zn(115, "roundedSelection", !0, { description: S(552, "Controls whether selections should have rounded corners.") })),
  rulers: We(new $ot()),
  scrollbar: We(new Got()),
  scrollBeyondLastColumn: We(new dr(118, "scrollBeyondLastColumn", 4, 0, 1073741824, { description: S(553, "Controls the number of extra characters beyond which the editor will scroll horizontally.") })),
  scrollBeyondLastLine: We(new zn(119, "scrollBeyondLastLine", !0, { description: S(554, "Controls whether the editor will scroll beyond the last line.") })),
  scrollOnMiddleClick: We(new zn(171, "scrollOnMiddleClick", !1, { description: S(555, "Controls whether the editor will scroll when the middle button is pressed.") })),
  scrollPredominantAxis: We(new zn(120, "scrollPredominantAxis", !0, { description: S(556, "Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.") })),
  selectionClipboard: We(new zn(121, "selectionClipboard", !0, {
    description: S(557, "Controls whether the Linux primary clipboard should be supported."),
    included: Qu
  })),
  selectionHighlight: We(new zn(122, "selectionHighlight", !0, { description: S(558, "Controls whether the editor should highlight matches similar to the selection.") })),
  selectionHighlightMaxLength: We(new dr(123, "selectionHighlightMaxLength", 200, 0, 1073741824, { description: S(559, "Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.") })),
  selectionHighlightMultiline: We(new zn(124, "selectionHighlightMultiline", !1, { description: S(560, "Controls whether the editor should highlight selection matches that span multiple lines.") })),
  selectOnLineNumbers: We(new zn(125, "selectOnLineNumbers", !0)),
  showFoldingControls: We(new gs(126, "showFoldingControls", "mouseover", ["always", "never", "mouseover"], {
    enumDescriptions: [
      S(561, "Always show the folding controls."),
      S(562, "Never show the folding controls and reduce the gutter size."),
      S(563, "Only show the folding controls when the mouse is over the gutter.")
    ],
    description: S(564, "Controls when the folding controls on the gutter are shown.")
  })),
  showUnused: We(new zn(127, "showUnused", !0, { description: S(565, "Controls fading out of unused code.") })),
  showDeprecated: We(new zn(157, "showDeprecated", !0, { description: S(566, "Controls strikethrough deprecated variables.") })),
  inlayHints: We(new Aot()),
  snippetSuggestions: We(new gs(128, "snippetSuggestions", "inline", ["top", "bottom", "inline", "none"], {
    enumDescriptions: [
      S(567, "Show snippet suggestions on top of other suggestions."),
      S(568, "Show snippet suggestions below other suggestions."),
      S(569, "Show snippets suggestions with other suggestions."),
      S(570, "Do not show snippet suggestions.")
    ],
    description: S(571, "Controls whether snippets are shown with other suggestions and how they are sorted.")
  })),
  smartSelect: We(new Qot()),
  smoothScrolling: We(new zn(130, "smoothScrolling", !1, { description: S(572, "Controls whether the editor will scroll using an animation.") })),
  stopRenderingLineAfter: We(new dr(
    133,
    "stopRenderingLineAfter",
    1e4,
    -1,
    1073741824
    /* Constants.MAX_SAFE_SMALL_INTEGER */
  )),
  suggest: We(new Zot()),
  inlineSuggest: We(new Kot()),
  inlineCompletionsAccessibilityVerbose: We(new zn(169, "inlineCompletionsAccessibilityVerbose", !1, { description: S(573, "Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.") })),
  suggestFontSize: We(new dr(135, "suggestFontSize", 0, 0, 1e3, { markdownDescription: S(574, "Font size for the suggest widget. When set to {0}, the value of {1} is used.", "`0`", "`#editor.fontSize#`") })),
  suggestLineHeight: We(new dr(136, "suggestLineHeight", 0, 0, 1e3, { markdownDescription: S(575, "Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.", "`0`", "`#editor.lineHeight#`") })),
  suggestOnTriggerCharacters: We(new zn(137, "suggestOnTriggerCharacters", !0, { description: S(576, "Controls whether suggestions should automatically show up when typing trigger characters.") })),
  suggestSelection: We(new gs(138, "suggestSelection", "first", ["first", "recentlyUsed", "recentlyUsedByPrefix"], {
    markdownEnumDescriptions: [
      S(577, "Always select the first suggestion."),
      S(578, "Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),
      S(579, "Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")
    ],
    description: S(580, "Controls how suggestions are pre-selected when showing the suggest list.")
  })),
  tabCompletion: We(new gs(139, "tabCompletion", "off", ["on", "off", "onlySnippets"], {
    enumDescriptions: [
      S(581, "Tab complete will insert the best matching suggestion when pressing tab."),
      S(582, "Disable tab completions."),
      S(583, "Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")
    ],
    description: S(584, "Enables tab completions.")
  })),
  tabIndex: We(new dr(
    140,
    "tabIndex",
    0,
    -1,
    1073741824
    /* Constants.MAX_SAFE_SMALL_INTEGER */
  )),
  trimWhitespaceOnDelete: We(new zn(141, "trimWhitespaceOnDelete", !1, { description: S(585, "Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.") })),
  unicodeHighlight: We(new qot()),
  unusualLineTerminators: We(new gs(143, "unusualLineTerminators", "prompt", ["auto", "off", "prompt"], {
    enumDescriptions: [
      S(586, "Unusual line terminators are automatically removed."),
      S(587, "Unusual line terminators are ignored."),
      S(588, "Unusual line terminators prompt to be removed.")
    ],
    description: S(589, "Remove unusual line terminators that might cause problems.")
  })),
  useShadowDOM: We(new zn(144, "useShadowDOM", !0)),
  useTabStops: We(new zn(145, "useTabStops", !0, { description: S(590, "Spaces and tabs are inserted and deleted in alignment with tab stops.") })),
  wordBreak: We(new gs(146, "wordBreak", "normal", ["normal", "keepAll"], {
    markdownEnumDescriptions: [
      S(591, "Use the default line break rule."),
      S(592, "Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")
    ],
    description: S(593, "Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")
  })),
  wordSegmenterLocales: We(new Jot()),
  wordSeparators: We(new yc(148, "wordSeparators", $V, { description: S(594, "Characters that will be used as word separators when doing word related navigations or operations.") })),
  wordWrap: We(new gs(149, "wordWrap", "off", ["off", "on", "wordWrapColumn", "bounded"], {
    markdownEnumDescriptions: [
      S(595, "Lines will never wrap."),
      S(596, "Lines will wrap at the viewport width."),
      S(597, "Lines will wrap at `#editor.wordWrapColumn#`."),
      S(598, "Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")
    ],
    description: S(599, "Controls how lines should wrap.")
  })),
  wordWrapBreakAfterCharacters: We(new yc(
    150,
    "wordWrapBreakAfterCharacters",
    // allow-any-unicode-next-line
    " 	})]?|/&.,;¢°′″‰℃、。｡､￠，．：；？！％・･ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ｧｨｩｪｫｬｭｮｯｰ”〉》」』】〕）］｝｣"
  )),
  wordWrapBreakBeforeCharacters: We(new yc(
    151,
    "wordWrapBreakBeforeCharacters",
    // allow-any-unicode-next-line
    "([{‘“〈《「『【〔（［｛｢£¥＄￡￥+＋"
  )),
  wordWrapColumn: We(new dr(152, "wordWrapColumn", 80, 1, 1073741824, {
    markdownDescription: S(600, "Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")
  })),
  wordWrapOverride1: We(new gs(153, "wordWrapOverride1", "inherit", ["off", "on", "inherit"])),
  wordWrapOverride2: We(new gs(154, "wordWrapOverride2", "inherit", ["off", "on", "inherit"])),
  wrapOnEscapedLineFeeds: We(new zn(160, "wrapOnEscapedLineFeeds", !1, { markdownDescription: S(601, 'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n           world"\n```') })),
  // Leave these at the end (because they have dependencies!)
  effectiveCursorStyle: We(new Eot()),
  editorClassName: We(new yot()),
  defaultColorDecorators: We(new gs(167, "defaultColorDecorators", "auto", ["auto", "always", "never"], {
    enumDescriptions: [
      S(602, "Show default color decorators only when no extension provides colors decorators."),
      S(603, "Always show default color decorators."),
      S(604, "Never show default color decorators.")
    ],
    description: S(605, "Controls whether inline color decorations should be shown using the default document color provider.")
  })),
  pixelRatio: We(new Wot()),
  tabFocusMode: We(new zn(164, "tabFocusMode", !1, { markdownDescription: S(606, "Controls whether the editor receives tabs or defers them to the workbench for navigation.") })),
  layoutInfo: We(new YN()),
  wrappingInfo: We(new tat()),
  wrappingIndent: We(new eat()),
  wrappingStrategy: We(new Iot()),
  effectiveEditContextEnabled: We(new xot()),
  effectiveAllowVariableFonts: We(new Lot())
}, Of = new class {
  constructor() {
    this._zoomLevel = 0, this._onDidChangeZoomLevel = new he(), this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event;
  }
  getZoomLevel() {
    return this._zoomLevel;
  }
  setZoomLevel(i) {
    i = Math.min(Math.max(-5, i), 20), this._zoomLevel !== i && (this._zoomLevel = i, this._onDidChangeZoomLevel.fire(this._zoomLevel));
  }
}(), aat = Kn ? 1.5 : 1.35, ZJ = 8;
class Px {
  /**
   * @internal
   */
  static createFromValidatedSettings(e, t, n) {
    const r = e.get(
      58
      /* EditorOption.fontFamily */
    ), s = e.get(
      62
      /* EditorOption.fontWeight */
    ), o = e.get(
      61
      /* EditorOption.fontSize */
    ), a = e.get(
      60
      /* EditorOption.fontLigatures */
    ), l = e.get(
      63
      /* EditorOption.fontVariations */
    ), c = e.get(
      75
      /* EditorOption.lineHeight */
    ), u = e.get(
      72
      /* EditorOption.letterSpacing */
    );
    return Px._create(r, s, o, a, l, c, u, t, n);
  }
  /**
   * @internal
   */
  static _create(e, t, n, r, s, o, a, l, c) {
    o === 0 ? o = aat * n : o < ZJ && (o = o * n), o = Math.round(o), o < ZJ && (o = ZJ);
    const u = 1 + (c ? 0 : Of.getZoomLevel() * 0.1);
    return n *= u, o *= u, s === h4.TRANSLATE && (t === "normal" || t === "bold" ? s = h4.OFF : (s = `'wght' ${parseInt(t, 10)}`, t = "normal")), new Px({
      pixelRatio: l,
      fontFamily: e,
      fontWeight: t,
      fontSize: n,
      fontFeatureSettings: r,
      fontVariationSettings: s,
      lineHeight: o,
      letterSpacing: a
    });
  }
  /**
   * @internal
   */
  constructor(e) {
    this._bareFontInfoBrand = void 0, this.pixelRatio = e.pixelRatio, this.fontFamily = String(e.fontFamily), this.fontWeight = String(e.fontWeight), this.fontSize = e.fontSize, this.fontFeatureSettings = e.fontFeatureSettings, this.fontVariationSettings = e.fontVariationSettings, this.lineHeight = e.lineHeight | 0, this.letterSpacing = e.letterSpacing;
  }
  /**
   * @internal
   */
  getId() {
    return `${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`;
  }
  /**
   * @internal
   */
  getMassagedFontFamily() {
    const e = au.fontFamily, t = Px._wrapInQuotes(this.fontFamily);
    return this.fontFamily !== e ? `${t}, ${e}` : t;
  }
  static _wrapInQuotes(e) {
    return /[,"']/.test(e) ? e : /[+ ]/.test(e) ? `"${e}"` : e;
  }
}
const lat = 2;
class Pie extends Px {
  /**
   * @internal
   */
  constructor(e, t) {
    super(e), this._editorStylingBrand = void 0, this.version = lat, this.isTrusted = t, this.isMonospace = e.isMonospace, this.typicalHalfwidthCharacterWidth = e.typicalHalfwidthCharacterWidth, this.typicalFullwidthCharacterWidth = e.typicalFullwidthCharacterWidth, this.canUseHalfwidthRightwardsArrow = e.canUseHalfwidthRightwardsArrow, this.spaceWidth = e.spaceWidth, this.middotWidth = e.middotWidth, this.wsmiddotWidth = e.wsmiddotWidth, this.maxDigitWidth = e.maxDigitWidth;
  }
  /**
   * @internal
   */
  equals(e) {
    return this.fontFamily === e.fontFamily && this.fontWeight === e.fontWeight && this.fontSize === e.fontSize && this.fontFeatureSettings === e.fontFeatureSettings && this.fontVariationSettings === e.fontVariationSettings && this.lineHeight === e.lineHeight && this.letterSpacing === e.letterSpacing && this.typicalHalfwidthCharacterWidth === e.typicalHalfwidthCharacterWidth && this.typicalFullwidthCharacterWidth === e.typicalFullwidthCharacterWidth && this.canUseHalfwidthRightwardsArrow === e.canUseHalfwidthRightwardsArrow && this.spaceWidth === e.spaceWidth && this.middotWidth === e.middotWidth && this.wsmiddotWidth === e.wsmiddotWidth && this.maxDigitWidth === e.maxDigitWidth;
  }
}
class cat extends ge {
  constructor() {
    super(...arguments), this._cache = /* @__PURE__ */ new Map(), this._evictUntrustedReadingsTimeout = -1, this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event;
  }
  dispose() {
    this._evictUntrustedReadingsTimeout !== -1 && (clearTimeout(this._evictUntrustedReadingsTimeout), this._evictUntrustedReadingsTimeout = -1), super.dispose();
  }
  /**
   * Clear all cached font information and trigger a change event.
   */
  clearAllFontInfos() {
    this._cache.clear(), this._onDidChange.fire();
  }
  _ensureCache(e) {
    const t = i4(e);
    let n = this._cache.get(t);
    return n || (n = new uat(), this._cache.set(t, n)), n;
  }
  _writeToCache(e, t, n) {
    this._ensureCache(e).put(t, n), !n.isTrusted && this._evictUntrustedReadingsTimeout === -1 && (this._evictUntrustedReadingsTimeout = e.setTimeout(() => {
      this._evictUntrustedReadingsTimeout = -1, this._evictUntrustedReadings(e);
    }, 5e3));
  }
  _evictUntrustedReadings(e) {
    const t = this._ensureCache(e), n = t.getValues();
    let r = !1;
    for (const s of n)
      s.isTrusted || (r = !0, t.remove(s));
    r && this._onDidChange.fire();
  }
  /**
   * Read font information.
   */
  readFontInfo(e, t) {
    const n = this._ensureCache(e);
    if (!n.has(t)) {
      let r = this._actualReadFontInfo(e, t);
      (r.typicalHalfwidthCharacterWidth <= 2 || r.typicalFullwidthCharacterWidth <= 2 || r.spaceWidth <= 2 || r.maxDigitWidth <= 2) && (r = new Pie({
        pixelRatio: d4.getInstance(e).value,
        fontFamily: r.fontFamily,
        fontWeight: r.fontWeight,
        fontSize: r.fontSize,
        fontFeatureSettings: r.fontFeatureSettings,
        fontVariationSettings: r.fontVariationSettings,
        lineHeight: r.lineHeight,
        letterSpacing: r.letterSpacing,
        isMonospace: r.isMonospace,
        typicalHalfwidthCharacterWidth: Math.max(r.typicalHalfwidthCharacterWidth, 5),
        typicalFullwidthCharacterWidth: Math.max(r.typicalFullwidthCharacterWidth, 5),
        canUseHalfwidthRightwardsArrow: r.canUseHalfwidthRightwardsArrow,
        spaceWidth: Math.max(r.spaceWidth, 5),
        middotWidth: Math.max(r.middotWidth, 5),
        wsmiddotWidth: Math.max(r.wsmiddotWidth, 5),
        maxDigitWidth: Math.max(r.maxDigitWidth, 5)
      }, !1)), this._writeToCache(e, t, r);
    }
    return n.get(t);
  }
  _createRequest(e, t, n, r) {
    const s = new fot(e, t);
    return n.push(s), r == null || r.push(s), s;
  }
  _actualReadFontInfo(e, t) {
    const n = [], r = [], s = this._createRequest("n", 0, n, r), o = this._createRequest("ｍ", 0, n, null), a = this._createRequest(" ", 0, n, r), l = this._createRequest("0", 0, n, r), c = this._createRequest("1", 0, n, r), u = this._createRequest("2", 0, n, r), d = this._createRequest("3", 0, n, r), h = this._createRequest("4", 0, n, r), g = this._createRequest("5", 0, n, r), m = this._createRequest("6", 0, n, r), _ = this._createRequest("7", 0, n, r), v = this._createRequest("8", 0, n, r), w = this._createRequest("9", 0, n, r), E = this._createRequest("→", 0, n, r), L = this._createRequest("￫", 0, n, null), T = this._createRequest("·", 0, n, r), D = this._createRequest("⸱", 0, n, null), N = "|/-_ilm%";
    for (let j = 0, K = N.length; j < K; j++)
      this._createRequest(N.charAt(j), 0, n, r), this._createRequest(N.charAt(j), 1, n, r), this._createRequest(N.charAt(j), 2, n, r);
    got(e, t, n);
    const R = Math.max(l.width, c.width, u.width, d.width, h.width, g.width, m.width, _.width, v.width, w.width);
    let M = t.fontFeatureSettings === Yy.OFF;
    const B = r[0].width;
    for (let j = 1, K = r.length; M && j < K; j++) {
      const X = B - r[j].width;
      if (X < -1e-3 || X > 1e-3) {
        M = !1;
        break;
      }
    }
    let H = !0;
    return M && L.width !== B && (H = !1), L.width > E.width && (H = !1), new Pie({
      pixelRatio: d4.getInstance(e).value,
      fontFamily: t.fontFamily,
      fontWeight: t.fontWeight,
      fontSize: t.fontSize,
      fontFeatureSettings: t.fontFeatureSettings,
      fontVariationSettings: t.fontVariationSettings,
      lineHeight: t.lineHeight,
      letterSpacing: t.letterSpacing,
      isMonospace: M,
      typicalHalfwidthCharacterWidth: s.width,
      typicalFullwidthCharacterWidth: o.width,
      canUseHalfwidthRightwardsArrow: H,
      spaceWidth: a.width,
      middotWidth: T.width,
      wsmiddotWidth: D.width,
      maxDigitWidth: R
    }, !0);
  }
}
class uat {
  constructor() {
    this._keys = /* @__PURE__ */ Object.create(null), this._values = /* @__PURE__ */ Object.create(null);
  }
  has(e) {
    const t = e.getId();
    return !!this._values[t];
  }
  get(e) {
    const t = e.getId();
    return this._values[t];
  }
  put(e, t) {
    const n = e.getId();
    this._keys[n] = e, this._values[n] = t;
  }
  remove(e) {
    const t = e.getId();
    delete this._keys[t], delete this._values[t];
  }
  getValues() {
    return Object.keys(this._keys).map((e) => this._values[e]);
  }
}
const Fie = new cat(), RN = class RN {
  constructor(e, t) {
    this.key = e, this.migrate = t;
  }
  apply(e) {
    const t = RN._read(e, this.key), n = (s) => RN._read(e, s), r = (s, o) => RN._write(e, s, o);
    this.migrate(t, n, r);
  }
  static _read(e, t) {
    if (typeof e > "u")
      return;
    const n = t.indexOf(".");
    if (n >= 0) {
      const r = t.substring(0, n);
      return this._read(e[r], t.substring(n + 1));
    }
    return e[t];
  }
  static _write(e, t, n) {
    const r = t.indexOf(".");
    if (r >= 0) {
      const s = t.substring(0, r);
      e[s] = e[s] || {}, this._write(e[s], t.substring(r + 1), n);
      return;
    }
    e[t] = n;
  }
};
RN.items = [];
let f4 = RN;
function tg(i, e) {
  f4.items.push(new f4(i, e));
}
function hu(i, e) {
  tg(i, (t, n, r) => {
    if (typeof t < "u") {
      for (const [s, o] of e)
        if (t === s) {
          r(i, o);
          return;
        }
    }
  });
}
function dat(i) {
  f4.items.forEach((e) => e.apply(i));
}
hu("wordWrap", [[!0, "on"], [!1, "off"]]);
hu("lineNumbers", [[!0, "on"], [!1, "off"]]);
hu("cursorBlinking", [["visible", "solid"]]);
hu("renderWhitespace", [[!0, "boundary"], [!1, "none"]]);
hu("renderLineHighlight", [[!0, "line"], [!1, "none"]]);
hu("acceptSuggestionOnEnter", [[!0, "on"], [!1, "off"]]);
hu("tabCompletion", [[!1, "off"], [!0, "onlySnippets"]]);
hu("hover", [[!0, { enabled: !0 }], [!1, { enabled: !1 }]]);
hu("parameterHints", [[!0, { enabled: !0 }], [!1, { enabled: !1 }]]);
hu("autoIndent", [[!1, "advanced"], [!0, "full"]]);
hu("matchBrackets", [[!0, "always"], [!1, "never"]]);
hu("renderFinalNewline", [[!0, "on"], [!1, "off"]]);
hu("cursorSmoothCaretAnimation", [[!0, "on"], [!1, "off"]]);
hu("occurrencesHighlight", [[!0, "singleFile"], [!1, "off"]]);
hu("wordBasedSuggestions", [[!0, "matchingDocuments"], [!1, "off"]]);
hu("defaultColorDecorators", [[!0, "auto"], [!1, "never"]]);
hu("minimap.autohide", [[!0, "mouseover"], [!1, "none"]]);
tg("autoClosingBrackets", (i, e, t) => {
  i === !1 && (t("autoClosingBrackets", "never"), typeof e("autoClosingQuotes") > "u" && t("autoClosingQuotes", "never"), typeof e("autoSurround") > "u" && t("autoSurround", "never"));
});
tg("renderIndentGuides", (i, e, t) => {
  typeof i < "u" && (t("renderIndentGuides", void 0), typeof e("guides.indentation") > "u" && t("guides.indentation", !!i));
});
tg("highlightActiveIndentGuide", (i, e, t) => {
  typeof i < "u" && (t("highlightActiveIndentGuide", void 0), typeof e("guides.highlightActiveIndentation") > "u" && t("guides.highlightActiveIndentation", !!i));
});
const hat = {
  method: "showMethods",
  function: "showFunctions",
  constructor: "showConstructors",
  deprecated: "showDeprecated",
  field: "showFields",
  variable: "showVariables",
  class: "showClasses",
  struct: "showStructs",
  interface: "showInterfaces",
  module: "showModules",
  property: "showProperties",
  event: "showEvents",
  operator: "showOperators",
  unit: "showUnits",
  value: "showValues",
  constant: "showConstants",
  enum: "showEnums",
  enumMember: "showEnumMembers",
  keyword: "showKeywords",
  text: "showWords",
  color: "showColors",
  file: "showFiles",
  reference: "showReferences",
  folder: "showFolders",
  typeParameter: "showTypeParameters",
  snippet: "showSnippets"
};
tg("suggest.filteredTypes", (i, e, t) => {
  if (i && typeof i == "object") {
    for (const n of Object.entries(hat))
      i[n[0]] === !1 && typeof e(`suggest.${n[1]}`) > "u" && t(`suggest.${n[1]}`, !1);
    t("suggest.filteredTypes", void 0);
  }
});
tg("quickSuggestions", (i, e, t) => {
  if (typeof i == "boolean") {
    const n = i ? "on" : "off";
    t("quickSuggestions", { comments: n, strings: n, other: n });
  }
});
tg("experimental.stickyScroll.enabled", (i, e, t) => {
  typeof i == "boolean" && (t("experimental.stickyScroll.enabled", void 0), typeof e("stickyScroll.enabled") > "u" && t("stickyScroll.enabled", i));
});
tg("experimental.stickyScroll.maxLineCount", (i, e, t) => {
  typeof i == "number" && (t("experimental.stickyScroll.maxLineCount", void 0), typeof e("stickyScroll.maxLineCount") > "u" && t("stickyScroll.maxLineCount", i));
});
tg("editor.experimentalEditContextEnabled", (i, e, t) => {
  typeof i == "boolean" && (t("editor.experimentalEditContextEnabled", void 0), typeof e("editor.editContext") > "u" && t("editor.editContext", i));
});
tg("codeActionsOnSave", (i, e, t) => {
  if (i && typeof i == "object") {
    let n = !1;
    const r = {};
    for (const s of Object.entries(i))
      typeof s[1] == "boolean" ? (n = !0, r[s[0]] = s[1] ? "explicit" : "never") : r[s[0]] = s[1];
    n && t("codeActionsOnSave", r);
  }
});
tg("codeActionWidget.includeNearbyQuickfixes", (i, e, t) => {
  typeof i == "boolean" && (t("codeActionWidget.includeNearbyQuickfixes", void 0), typeof e("codeActionWidget.includeNearbyQuickFixes") > "u" && t("codeActionWidget.includeNearbyQuickFixes", i));
});
tg("lightbulb.enabled", (i, e, t) => {
  typeof i == "boolean" && t("lightbulb.enabled", i ? void 0 : "off");
});
tg("inlineSuggest.edits.codeShifting", (i, e, t) => {
  typeof i == "boolean" && (t("inlineSuggest.edits.codeShifting", void 0), t("inlineSuggest.edits.allowCodeShifting", i ? "always" : "never"));
});
class fat {
  constructor() {
    this._tabFocus = !1, this._onDidChangeTabFocus = new he(), this.onDidChangeTabFocus = this._onDidChangeTabFocus.event;
  }
  getTabFocusMode() {
    return this._tabFocus;
  }
  setTabFocusMode(e) {
    this._tabFocus = e, this._onDidChangeTabFocus.fire(this._tabFocus);
  }
}
const YR = new fat(), Qa = Vn("accessibilityService"), QA = new ut("accessibilityModeEnabled", !1);
var gat = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, pat = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Bie = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._accessibilityService = s, this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event, this._onDidChangeFast = this._register(new he()), this.onDidChangeFast = this._onDidChangeFast.event, this._isDominatedByLongLines = !1, this._viewLineCount = 1, this._lineNumbersDigitCount = 1, this._reservedHeight = 0, this._glyphMarginDecorationLaneCount = 1, this._computeOptionsMemory = new SFe(), this.isSimpleWidget = e, this.contextMenuId = t, this._containerObserver = this._register(new CFe(r, n.dimension)), this._targetWindowId = At(r).vscodeWindowId, this._rawOptions = CLe(n), this._validatedOptions = XC.validateOptions(this._rawOptions), this.options = this._computeOptions(), this.options.get(
      19
      /* EditorOption.automaticLayout */
    ) && this._containerObserver.startObserving(), this._register(Of.onDidChangeZoomLevel(() => this._recomputeOptions())), this._register(YR.onDidChangeTabFocus(() => this._recomputeOptions())), this._register(this._containerObserver.onDidChange(() => this._recomputeOptions())), this._register(Fie.onDidChange(() => this._recomputeOptions())), this._register(d4.getInstance(At(r)).onDidChange(() => this._recomputeOptions())), this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(() => this._recomputeOptions())), this._register(xie.onDidChangeInputMode(() => this._recomputeOptions()));
  }
  _recomputeOptions() {
    const e = this._computeOptions(), t = XC.checkEquals(this.options, e);
    t !== null && (this.options = e, this._onDidChangeFast.fire(t), this._onDidChange.fire(t));
  }
  _computeOptions() {
    const e = this._readEnvConfiguration(), t = Px.createFromValidatedSettings(this._validatedOptions, e.pixelRatio, this.isSimpleWidget), n = this._readFontInfo(t), r = {
      memory: this._computeOptionsMemory,
      outerWidth: e.outerWidth,
      outerHeight: e.outerHeight - this._reservedHeight,
      fontInfo: n,
      extraEditorClassName: e.extraEditorClassName,
      isDominatedByLongLines: this._isDominatedByLongLines,
      viewLineCount: this._viewLineCount,
      lineNumbersDigitCount: this._lineNumbersDigitCount,
      emptySelectionClipboard: e.emptySelectionClipboard,
      pixelRatio: e.pixelRatio,
      tabFocusMode: this._validatedOptions.get(
        164
        /* EditorOption.tabFocusMode */
      ) || YR.getTabFocusMode(),
      inputMode: xie.getInputMode(),
      accessibilitySupport: e.accessibilitySupport,
      glyphMarginDecorationLaneCount: this._glyphMarginDecorationLaneCount,
      editContextSupported: e.editContextSupported
    };
    return XC.computeOptions(this._validatedOptions, r);
  }
  _readEnvConfiguration() {
    return {
      extraEditorClassName: _at(),
      outerWidth: this._containerObserver.getWidth(),
      outerHeight: this._containerObserver.getHeight(),
      emptySelectionClipboard: fq || Zu,
      pixelRatio: d4.getInstance(Bxe(this._targetWindowId, !0).window).value,
      editContextSupported: typeof globalThis.EditContext == "function",
      accessibilitySupport: this._accessibilityService.isScreenReaderOptimized() ? 2 : this._accessibilityService.getAccessibilitySupport()
    };
  }
  _readFontInfo(e) {
    return Fie.readFontInfo(Bxe(this._targetWindowId, !0).window, e);
  }
  getRawOptions() {
    return this._rawOptions;
  }
  updateOptions(e) {
    const t = CLe(e);
    XC.applyUpdate(this._rawOptions, t) && (this._validatedOptions = XC.validateOptions(this._rawOptions), this._recomputeOptions());
  }
  observeContainer(e) {
    this._containerObserver.observe(e);
  }
  setIsDominatedByLongLines(e) {
    this._isDominatedByLongLines !== e && (this._isDominatedByLongLines = e, this._recomputeOptions());
  }
  setModelLineCount(e) {
    const t = mat(e);
    this._lineNumbersDigitCount !== t && (this._lineNumbersDigitCount = t, this._recomputeOptions());
  }
  setViewLineCount(e) {
    this._viewLineCount !== e && (this._viewLineCount = e, this._recomputeOptions());
  }
  setReservedHeight(e) {
    this._reservedHeight !== e && (this._reservedHeight = e, this._recomputeOptions());
  }
  setGlyphMarginDecorationLaneCount(e) {
    this._glyphMarginDecorationLaneCount !== e && (this._glyphMarginDecorationLaneCount = e, this._recomputeOptions());
  }
};
Bie = gat([
  pat(4, Qa)
], Bie);
function mat(i) {
  let e = 0;
  for (; i; )
    i = Math.floor(i / 10), e++;
  return e || 1;
}
function _at() {
  let i = "";
  return XL || RMe ? (i += "no-minimap-shadow ", i += "enable-user-select ") : i += "no-user-select ", Kn && (i += "mac "), i;
}
class bat {
  constructor() {
    this._values = [];
  }
  _read(e) {
    return this._values[e];
  }
  get(e) {
    return this._values[e];
  }
  _write(e, t) {
    this._values[e] = t;
  }
}
class vat {
  constructor() {
    this._values = [];
  }
  _read(e) {
    if (e >= this._values.length)
      throw new Error("Cannot read uninitialized value");
    return this._values[e];
  }
  get(e) {
    return this._read(e);
  }
  _write(e, t) {
    this._values[e] = t;
  }
}
class XC {
  static validateOptions(e) {
    const t = new bat();
    for (const n of sN) {
      const r = n.name === "_never_" ? void 0 : e[n.name];
      t._write(n.id, n.validate(r));
    }
    return t;
  }
  static computeOptions(e, t) {
    const n = new vat();
    for (const r of sN)
      n._write(r.id, r.compute(t, n, e._read(r.id)));
    return n;
  }
  static _deepEquals(e, t) {
    if (typeof e != "object" || typeof t != "object" || !e || !t)
      return e === t;
    if (Array.isArray(e) || Array.isArray(t))
      return Array.isArray(e) && Array.isArray(t) ? ds(e, t) : !1;
    if (Object.keys(e).length !== Object.keys(t).length)
      return !1;
    for (const n in e)
      if (!XC._deepEquals(e[n], t[n]))
        return !1;
    return !0;
  }
  static checkEquals(e, t) {
    const n = [];
    let r = !1;
    for (const s of sN) {
      const o = !XC._deepEquals(e._read(s.id), t._read(s.id));
      n[s.id] = o, o && (r = !0);
    }
    return r ? new wFe(n) : null;
  }
  /**
   * Returns true if something changed.
   * Modifies `options`.
  */
  static applyUpdate(e, t) {
    let n = !1;
    for (const r of sN)
      if (t.hasOwnProperty(r.name)) {
        const s = r.applyUpdate(e[r.name], t[r.name]);
        e[r.name] = s.newValue, n = n || s.didChange;
      }
    return n;
  }
}
function CLe(i) {
  const e = W_(i);
  return dat(e), e;
}
var s1;
(function(i) {
  const e = { total: 0, min: Number.MAX_VALUE, max: 0 }, t = { ...e }, n = { ...e }, r = { ...e };
  let s = 0;
  const o = {
    keydown: 0,
    input: 0,
    render: 0
  };
  function a() {
    w(), performance.mark("inputlatency/start"), performance.mark("keydown/start"), o.keydown = 1, queueMicrotask(l);
  }
  i.onKeyDown = a;
  function l() {
    o.keydown === 1 && (performance.mark("keydown/end"), o.keydown = 2);
  }
  function c() {
    performance.mark("input/start"), o.input = 1, v();
  }
  i.onBeforeInput = c;
  function u() {
    o.input === 0 && c(), queueMicrotask(d);
  }
  i.onInput = u;
  function d() {
    o.input === 1 && (performance.mark("input/end"), o.input = 2);
  }
  function h() {
    w();
  }
  i.onKeyUp = h;
  function g() {
    w();
  }
  i.onSelectionChange = g;
  function m() {
    o.keydown === 2 && o.input === 2 && o.render === 0 && (performance.mark("render/start"), o.render = 1, queueMicrotask(_), v());
  }
  i.onRenderStart = m;
  function _() {
    o.render === 1 && (performance.mark("render/end"), o.render = 2);
  }
  function v() {
    setTimeout(w);
  }
  function w() {
    o.keydown === 2 && o.input === 2 && o.render === 2 && (performance.mark("inputlatency/end"), performance.measure("keydown", "keydown/start", "keydown/end"), performance.measure("input", "input/start", "input/end"), performance.measure("render", "render/start", "render/end"), performance.measure("inputlatency", "inputlatency/start", "inputlatency/end"), E("keydown", e), E("input", t), E("render", n), E("inputlatency", r), s++, L());
  }
  function E(R, M) {
    const B = performance.getEntriesByName(R)[0].duration;
    M.total += B, M.min = Math.min(M.min, B), M.max = Math.max(M.max, B);
  }
  function L() {
    performance.clearMarks("keydown/start"), performance.clearMarks("keydown/end"), performance.clearMarks("input/start"), performance.clearMarks("input/end"), performance.clearMarks("render/start"), performance.clearMarks("render/end"), performance.clearMarks("inputlatency/start"), performance.clearMarks("inputlatency/end"), performance.clearMeasures("keydown"), performance.clearMeasures("input"), performance.clearMeasures("render"), performance.clearMeasures("inputlatency"), o.keydown = 0, o.input = 0, o.render = 0;
  }
  function T() {
    if (s === 0)
      return;
    const R = {
      keydown: D(e),
      input: D(t),
      render: D(n),
      total: D(r),
      sampleCount: s
    };
    return N(e), N(t), N(n), N(r), s = 0, R;
  }
  i.getAndClearMeasurements = T;
  function D(R) {
    return {
      average: R.total / s,
      max: R.max,
      min: R.min
    };
  }
  function N(R) {
    R.total = 0, R.min = Number.MAX_VALUE, R.max = 0;
  }
})(s1 || (s1 = {}));
const QV = /* @__PURE__ */ new Map();
function yat() {
  return new Cat();
}
class Cat {
  constructor() {
    this._currentCssStyle = "", this._styleSheet = void 0;
  }
  setStyle(e) {
    e !== this._currentCssStyle && (this._currentCssStyle = e, this._styleSheet ? this._styleSheet.textContent = e : this._styleSheet = Zf(fr.document.head, (t) => t.textContent = e));
  }
  dispose() {
    this._styleSheet && (this._styleSheet.remove(), this._styleSheet = void 0);
  }
}
function Zf(i = fr.document.head, e, t) {
  const n = document.createElement("style");
  if (n.type = "text/css", n.media = "screen", e == null || e(n), i.appendChild(n), t && t.add(Et(() => n.remove())), i === fr.document.head) {
    const r = /* @__PURE__ */ new Set();
    QV.set(n, r), t && t.add(Et(() => QV.delete(n)));
    for (const { window: s, disposables: o } of xPe()) {
      if (s === fr)
        continue;
      const a = o.add(wat(n, r, s));
      t == null || t.add(a);
    }
  }
  return n;
}
function wat(i, e, t) {
  var s, o;
  const n = new ke(), r = i.cloneNode(!0);
  t.document.head.appendChild(r), n.add(Et(() => r.remove()));
  for (const a of xFe(i))
    (o = r.sheet) == null || o.insertRule(a.cssText, (s = r.sheet) == null ? void 0 : s.cssRules.length);
  return n.add(Hit.observe(i, n, { childList: !0, subtree: Zu, characterData: Zu })(() => {
    r.textContent = i.textContent;
  })), e.add(r), n.add(Et(() => e.delete(r))), n;
}
let QJ = null;
function EFe() {
  return QJ || (QJ = Zf()), QJ;
}
function xFe(i) {
  var e, t;
  return (e = i == null ? void 0 : i.sheet) != null && e.rules ? i.sheet.rules : (t = i == null ? void 0 : i.sheet) != null && t.cssRules ? i.sheet.cssRules : [];
}
function JV(i, e, t = EFe()) {
  var n;
  if (!(!t || !e)) {
    (n = t.sheet) == null || n.insertRule(`${i} {${e}}`, 0);
    for (const r of QV.get(t) ?? [])
      JV(i, e, r);
  }
}
function Hie(i, e = EFe()) {
  var r;
  if (!e)
    return;
  const t = xFe(e), n = [];
  for (let s = 0; s < t.length; s++) {
    const o = t[s];
    Sat(o) && o.selectorText.indexOf(i) !== -1 && n.push(s);
  }
  for (let s = n.length - 1; s >= 0; s--)
    (r = e.sheet) == null || r.deleteRule(n[s]);
  for (const s of QV.get(e) ?? [])
    Hie(i, s);
}
function Sat(i) {
  return typeof i.selectorText == "string";
}
function Eat(i) {
  const e = new ke(), t = e.add(yat());
  return e.add(Xt((n) => {
    t.setStyle(i.read(n));
  })), e;
}
class JA {
  constructor() {
    this._hooks = new ke(), this._pointerMoveCallback = null, this._onStopCallback = null;
  }
  dispose() {
    this.stopMonitoring(!1), this._hooks.dispose();
  }
  stopMonitoring(e, t) {
    if (!this.isMonitoring())
      return;
    this._hooks.clear(), this._pointerMoveCallback = null;
    const n = this._onStopCallback;
    this._onStopCallback = null, e && n && n(t);
  }
  isMonitoring() {
    return !!this._pointerMoveCallback;
  }
  startMonitoring(e, t, n, r, s) {
    this.isMonitoring() && this.stopMonitoring(!1), this._pointerMoveCallback = r, this._onStopCallback = s;
    let o = e;
    try {
      e.setPointerCapture(t), this._hooks.add(Et(() => {
        try {
          e.releasePointerCapture(t);
        } catch {
        }
      }));
    } catch {
      o = At(e);
    }
    this._hooks.add(Ce(o, Xe.POINTER_MOVE, (a) => {
      if (a.buttons !== n) {
        this.stopMonitoring(!0);
        return;
      }
      a.preventDefault(), this._pointerMoveCallback(a);
    })), this._hooks.add(Ce(o, Xe.POINTER_UP, (a) => this.stopMonitoring(!0)));
  }
}
function T1(i, e) {
  const t = Math.pow(10, e);
  return Math.round(i * t) / t;
}
class Ne {
  constructor(e, t, n, r = 1) {
    this._rgbaBrand = void 0, this.r = Math.min(255, Math.max(0, e)) | 0, this.g = Math.min(255, Math.max(0, t)) | 0, this.b = Math.min(255, Math.max(0, n)) | 0, this.a = T1(Math.max(Math.min(1, r), 0), 3);
  }
  static equals(e, t) {
    return e.r === t.r && e.g === t.g && e.b === t.b && e.a === t.a;
  }
}
class Pg {
  constructor(e, t, n, r) {
    this._hslaBrand = void 0, this.h = Math.max(Math.min(360, e), 0) | 0, this.s = T1(Math.max(Math.min(1, t), 0), 3), this.l = T1(Math.max(Math.min(1, n), 0), 3), this.a = T1(Math.max(Math.min(1, r), 0), 3);
  }
  static equals(e, t) {
    return e.h === t.h && e.s === t.s && e.l === t.l && e.a === t.a;
  }
  /**
   * Converts an RGB color value to HSL. Conversion formula
   * adapted from http://en.wikipedia.org/wiki/HSL_color_space.
   * Assumes r, g, and b are contained in the set [0, 255] and
   * returns h in the set [0, 360], s, and l in the set [0, 1].
   */
  static fromRGBA(e) {
    const t = e.r / 255, n = e.g / 255, r = e.b / 255, s = e.a, o = Math.max(t, n, r), a = Math.min(t, n, r);
    let l = 0, c = 0;
    const u = (a + o) / 2, d = o - a;
    if (d > 0) {
      switch (c = Math.min(u <= 0.5 ? d / (2 * u) : d / (2 - 2 * u), 1), o) {
        case t:
          l = (n - r) / d + (n < r ? 6 : 0);
          break;
        case n:
          l = (r - t) / d + 2;
          break;
        case r:
          l = (t - n) / d + 4;
          break;
      }
      l *= 60, l = Math.round(l);
    }
    return new Pg(l, c, u, s);
  }
  static _hue2rgb(e, t, n) {
    return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
  }
  /**
   * Converts an HSL color value to RGB. Conversion formula
   * adapted from http://en.wikipedia.org/wiki/HSL_color_space.
   * Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and
   * returns r, g, and b in the set [0, 255].
   */
  static toRGBA(e) {
    const t = e.h / 360, { s: n, l: r, a: s } = e;
    let o, a, l;
    if (n === 0)
      o = a = l = r;
    else {
      const c = r < 0.5 ? r * (1 + n) : r + n - r * n, u = 2 * r - c;
      o = Pg._hue2rgb(u, c, t + 1 / 3), a = Pg._hue2rgb(u, c, t), l = Pg._hue2rgb(u, c, t - 1 / 3);
    }
    return new Ne(Math.round(o * 255), Math.round(a * 255), Math.round(l * 255), s);
  }
}
class Q_ {
  constructor(e, t, n, r) {
    this._hsvaBrand = void 0, this.h = Math.max(Math.min(360, e), 0) | 0, this.s = T1(Math.max(Math.min(1, t), 0), 3), this.v = T1(Math.max(Math.min(1, n), 0), 3), this.a = T1(Math.max(Math.min(1, r), 0), 3);
  }
  static equals(e, t) {
    return e.h === t.h && e.s === t.s && e.v === t.v && e.a === t.a;
  }
  // from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm
  static fromRGBA(e) {
    const t = e.r / 255, n = e.g / 255, r = e.b / 255, s = Math.max(t, n, r), o = Math.min(t, n, r), a = s - o, l = s === 0 ? 0 : a / s;
    let c;
    return a === 0 ? c = 0 : s === t ? c = ((n - r) / a % 6 + 6) % 6 : s === n ? c = (r - t) / a + 2 : c = (t - n) / a + 4, new Q_(Math.round(c * 60), l, s, e.a);
  }
  // from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm
  static toRGBA(e) {
    const { h: t, s: n, v: r, a: s } = e, o = r * n, a = o * (1 - Math.abs(t / 60 % 2 - 1)), l = r - o;
    let [c, u, d] = [0, 0, 0];
    return t < 60 ? (c = o, u = a) : t < 120 ? (c = a, u = o) : t < 180 ? (u = o, d = a) : t < 240 ? (u = a, d = o) : t < 300 ? (c = a, d = o) : t <= 360 && (c = o, d = a), c = Math.round((c + l) * 255), u = Math.round((u + l) * 255), d = Math.round((d + l) * 255), new Ne(c, u, d, s);
  }
}
var ps;
let De = (ps = class {
  static fromHex(e) {
    return ps.Format.CSS.parseHex(e) || ps.red;
  }
  static equals(e, t) {
    return !e && !t ? !0 : !e || !t ? !1 : e.equals(t);
  }
  get hsla() {
    return this._hsla ? this._hsla : Pg.fromRGBA(this.rgba);
  }
  get hsva() {
    return this._hsva ? this._hsva : Q_.fromRGBA(this.rgba);
  }
  constructor(e) {
    if (e)
      if (e instanceof Ne)
        this.rgba = e;
      else if (e instanceof Pg)
        this._hsla = e, this.rgba = Pg.toRGBA(e);
      else if (e instanceof Q_)
        this._hsva = e, this.rgba = Q_.toRGBA(e);
      else
        throw new Error("Invalid color ctor argument");
    else throw new Error("Color needs a value");
  }
  equals(e) {
    return !!e && Ne.equals(this.rgba, e.rgba) && Pg.equals(this.hsla, e.hsla) && Q_.equals(this.hsva, e.hsva);
  }
  /**
   * http://www.w3.org/TR/WCAG20/#relativeluminancedef
   * Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white.
   */
  getRelativeLuminance() {
    const e = ps._relativeLuminanceForComponent(this.rgba.r), t = ps._relativeLuminanceForComponent(this.rgba.g), n = ps._relativeLuminanceForComponent(this.rgba.b), r = 0.2126 * e + 0.7152 * t + 0.0722 * n;
    return T1(r, 4);
  }
  static _relativeLuminanceForComponent(e) {
    const t = e / 255;
    return t <= 0.03928 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
  }
  /**
   *	http://24ways.org/2010/calculating-color-contrast
   *  Return 'true' if lighter color otherwise 'false'
   */
  isLighter() {
    return (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1e3 >= 128;
  }
  isLighterThan(e) {
    const t = this.getRelativeLuminance(), n = e.getRelativeLuminance();
    return t > n;
  }
  isDarkerThan(e) {
    const t = this.getRelativeLuminance(), n = e.getRelativeLuminance();
    return t < n;
  }
  lighten(e) {
    return new ps(new Pg(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * e, this.hsla.a));
  }
  darken(e) {
    return new ps(new Pg(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * e, this.hsla.a));
  }
  transparent(e) {
    const { r: t, g: n, b: r, a: s } = this.rgba;
    return new ps(new Ne(t, n, r, s * e));
  }
  isTransparent() {
    return this.rgba.a === 0;
  }
  isOpaque() {
    return this.rgba.a === 1;
  }
  opposite() {
    return new ps(new Ne(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a));
  }
  /**
   * Mixes the current color with the provided color based on the given factor.
   * @param color The color to mix with
   * @param factor The factor of mixing (0 means this color, 1 means the input color, 0.5 means equal mix)
   * @returns A new color representing the mix
   */
  mix(e, t = 0.5) {
    const n = Math.min(Math.max(t, 0), 1), r = this.rgba, s = e.rgba, o = r.r + (s.r - r.r) * n, a = r.g + (s.g - r.g) * n, l = r.b + (s.b - r.b) * n, c = r.a + (s.a - r.a) * n;
    return new ps(new Ne(o, a, l, c));
  }
  makeOpaque(e) {
    if (this.isOpaque() || e.rgba.a !== 1)
      return this;
    const { r: t, g: n, b: r, a: s } = this.rgba;
    return new ps(new Ne(e.rgba.r - s * (e.rgba.r - t), e.rgba.g - s * (e.rgba.g - n), e.rgba.b - s * (e.rgba.b - r), 1));
  }
  toString() {
    return this._toString || (this._toString = ps.Format.CSS.format(this)), this._toString;
  }
  toNumber32Bit() {
    return this._toNumber32Bit || (this._toNumber32Bit = (this.rgba.r << 24 | this.rgba.g << 16 | this.rgba.b << 8 | this.rgba.a * 255 << 0) >>> 0), this._toNumber32Bit;
  }
  static getLighterColor(e, t, n) {
    if (e.isLighterThan(t))
      return e;
    n = n || 0.5;
    const r = e.getRelativeLuminance(), s = t.getRelativeLuminance();
    return n = n * (s - r) / s, e.lighten(n);
  }
  static getDarkerColor(e, t, n) {
    if (e.isDarkerThan(t))
      return e;
    n = n || 0.5;
    const r = e.getRelativeLuminance(), s = t.getRelativeLuminance();
    return n = n * (r - s) / r, e.darken(n);
  }
}, ps.white = new ps(new Ne(255, 255, 255, 1)), ps.black = new ps(new Ne(0, 0, 0, 1)), ps.red = new ps(new Ne(255, 0, 0, 1)), ps.blue = new ps(new Ne(0, 0, 255, 1)), ps.green = new ps(new Ne(0, 255, 0, 1)), ps.cyan = new ps(new Ne(0, 255, 255, 1)), ps.lightgrey = new ps(new Ne(211, 211, 211, 1)), ps.transparent = new ps(new Ne(0, 0, 0, 0)), ps);
(function(i) {
  (function(e) {
    (function(t) {
      function n(_) {
        return _.rgba.a === 1 ? `rgb(${_.rgba.r}, ${_.rgba.g}, ${_.rgba.b})` : i.Format.CSS.formatRGBA(_);
      }
      t.formatRGB = n;
      function r(_) {
        return `rgba(${_.rgba.r}, ${_.rgba.g}, ${_.rgba.b}, ${+_.rgba.a.toFixed(2)})`;
      }
      t.formatRGBA = r;
      function s(_) {
        return _.hsla.a === 1 ? `hsl(${_.hsla.h}, ${Math.round(_.hsla.s * 100)}%, ${Math.round(_.hsla.l * 100)}%)` : i.Format.CSS.formatHSLA(_);
      }
      t.formatHSL = s;
      function o(_) {
        return `hsla(${_.hsla.h}, ${Math.round(_.hsla.s * 100)}%, ${Math.round(_.hsla.l * 100)}%, ${_.hsla.a.toFixed(2)})`;
      }
      t.formatHSLA = o;
      function a(_) {
        const v = _.toString(16);
        return v.length !== 2 ? "0" + v : v;
      }
      function l(_) {
        return `#${a(_.rgba.r)}${a(_.rgba.g)}${a(_.rgba.b)}`;
      }
      t.formatHex = l;
      function c(_, v = !1) {
        return v && _.rgba.a === 1 ? i.Format.CSS.formatHex(_) : `#${a(_.rgba.r)}${a(_.rgba.g)}${a(_.rgba.b)}${a(Math.round(_.rgba.a * 255))}`;
      }
      t.formatHexA = c;
      function u(_) {
        return _.isOpaque() ? i.Format.CSS.formatHex(_) : i.Format.CSS.formatRGBA(_);
      }
      t.format = u;
      function d(_) {
        var v, w, E, L, T, D, N;
        if (_ === "transparent")
          return i.transparent;
        if (_.startsWith("#"))
          return g(_);
        if (_.startsWith("rgba(")) {
          const R = _.match(/rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/);
          if (!R)
            throw new Error("Invalid color format " + _);
          const M = parseInt(((v = R.groups) == null ? void 0 : v.r) ?? "0"), B = parseInt(((w = R.groups) == null ? void 0 : w.g) ?? "0"), H = parseInt(((E = R.groups) == null ? void 0 : E.b) ?? "0"), j = parseFloat(((L = R.groups) == null ? void 0 : L.a) ?? "0");
          return new i(new Ne(M, B, H, j));
        }
        if (_.startsWith("rgb(")) {
          const R = _.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);
          if (!R)
            throw new Error("Invalid color format " + _);
          const M = parseInt(((T = R.groups) == null ? void 0 : T.r) ?? "0"), B = parseInt(((D = R.groups) == null ? void 0 : D.g) ?? "0"), H = parseInt(((N = R.groups) == null ? void 0 : N.b) ?? "0");
          return new i(new Ne(M, B, H));
        }
        return h(_);
      }
      t.parse = d;
      function h(_) {
        switch (_) {
          case "aliceblue":
            return new i(new Ne(240, 248, 255, 1));
          case "antiquewhite":
            return new i(new Ne(250, 235, 215, 1));
          case "aqua":
            return new i(new Ne(0, 255, 255, 1));
          case "aquamarine":
            return new i(new Ne(127, 255, 212, 1));
          case "azure":
            return new i(new Ne(240, 255, 255, 1));
          case "beige":
            return new i(new Ne(245, 245, 220, 1));
          case "bisque":
            return new i(new Ne(255, 228, 196, 1));
          case "black":
            return new i(new Ne(0, 0, 0, 1));
          case "blanchedalmond":
            return new i(new Ne(255, 235, 205, 1));
          case "blue":
            return new i(new Ne(0, 0, 255, 1));
          case "blueviolet":
            return new i(new Ne(138, 43, 226, 1));
          case "brown":
            return new i(new Ne(165, 42, 42, 1));
          case "burlywood":
            return new i(new Ne(222, 184, 135, 1));
          case "cadetblue":
            return new i(new Ne(95, 158, 160, 1));
          case "chartreuse":
            return new i(new Ne(127, 255, 0, 1));
          case "chocolate":
            return new i(new Ne(210, 105, 30, 1));
          case "coral":
            return new i(new Ne(255, 127, 80, 1));
          case "cornflowerblue":
            return new i(new Ne(100, 149, 237, 1));
          case "cornsilk":
            return new i(new Ne(255, 248, 220, 1));
          case "crimson":
            return new i(new Ne(220, 20, 60, 1));
          case "cyan":
            return new i(new Ne(0, 255, 255, 1));
          case "darkblue":
            return new i(new Ne(0, 0, 139, 1));
          case "darkcyan":
            return new i(new Ne(0, 139, 139, 1));
          case "darkgoldenrod":
            return new i(new Ne(184, 134, 11, 1));
          case "darkgray":
            return new i(new Ne(169, 169, 169, 1));
          case "darkgreen":
            return new i(new Ne(0, 100, 0, 1));
          case "darkgrey":
            return new i(new Ne(169, 169, 169, 1));
          case "darkkhaki":
            return new i(new Ne(189, 183, 107, 1));
          case "darkmagenta":
            return new i(new Ne(139, 0, 139, 1));
          case "darkolivegreen":
            return new i(new Ne(85, 107, 47, 1));
          case "darkorange":
            return new i(new Ne(255, 140, 0, 1));
          case "darkorchid":
            return new i(new Ne(153, 50, 204, 1));
          case "darkred":
            return new i(new Ne(139, 0, 0, 1));
          case "darksalmon":
            return new i(new Ne(233, 150, 122, 1));
          case "darkseagreen":
            return new i(new Ne(143, 188, 143, 1));
          case "darkslateblue":
            return new i(new Ne(72, 61, 139, 1));
          case "darkslategray":
            return new i(new Ne(47, 79, 79, 1));
          case "darkslategrey":
            return new i(new Ne(47, 79, 79, 1));
          case "darkturquoise":
            return new i(new Ne(0, 206, 209, 1));
          case "darkviolet":
            return new i(new Ne(148, 0, 211, 1));
          case "deeppink":
            return new i(new Ne(255, 20, 147, 1));
          case "deepskyblue":
            return new i(new Ne(0, 191, 255, 1));
          case "dimgray":
            return new i(new Ne(105, 105, 105, 1));
          case "dimgrey":
            return new i(new Ne(105, 105, 105, 1));
          case "dodgerblue":
            return new i(new Ne(30, 144, 255, 1));
          case "firebrick":
            return new i(new Ne(178, 34, 34, 1));
          case "floralwhite":
            return new i(new Ne(255, 250, 240, 1));
          case "forestgreen":
            return new i(new Ne(34, 139, 34, 1));
          case "fuchsia":
            return new i(new Ne(255, 0, 255, 1));
          case "gainsboro":
            return new i(new Ne(220, 220, 220, 1));
          case "ghostwhite":
            return new i(new Ne(248, 248, 255, 1));
          case "gold":
            return new i(new Ne(255, 215, 0, 1));
          case "goldenrod":
            return new i(new Ne(218, 165, 32, 1));
          case "gray":
            return new i(new Ne(128, 128, 128, 1));
          case "green":
            return new i(new Ne(0, 128, 0, 1));
          case "greenyellow":
            return new i(new Ne(173, 255, 47, 1));
          case "grey":
            return new i(new Ne(128, 128, 128, 1));
          case "honeydew":
            return new i(new Ne(240, 255, 240, 1));
          case "hotpink":
            return new i(new Ne(255, 105, 180, 1));
          case "indianred":
            return new i(new Ne(205, 92, 92, 1));
          case "indigo":
            return new i(new Ne(75, 0, 130, 1));
          case "ivory":
            return new i(new Ne(255, 255, 240, 1));
          case "khaki":
            return new i(new Ne(240, 230, 140, 1));
          case "lavender":
            return new i(new Ne(230, 230, 250, 1));
          case "lavenderblush":
            return new i(new Ne(255, 240, 245, 1));
          case "lawngreen":
            return new i(new Ne(124, 252, 0, 1));
          case "lemonchiffon":
            return new i(new Ne(255, 250, 205, 1));
          case "lightblue":
            return new i(new Ne(173, 216, 230, 1));
          case "lightcoral":
            return new i(new Ne(240, 128, 128, 1));
          case "lightcyan":
            return new i(new Ne(224, 255, 255, 1));
          case "lightgoldenrodyellow":
            return new i(new Ne(250, 250, 210, 1));
          case "lightgray":
            return new i(new Ne(211, 211, 211, 1));
          case "lightgreen":
            return new i(new Ne(144, 238, 144, 1));
          case "lightgrey":
            return new i(new Ne(211, 211, 211, 1));
          case "lightpink":
            return new i(new Ne(255, 182, 193, 1));
          case "lightsalmon":
            return new i(new Ne(255, 160, 122, 1));
          case "lightseagreen":
            return new i(new Ne(32, 178, 170, 1));
          case "lightskyblue":
            return new i(new Ne(135, 206, 250, 1));
          case "lightslategray":
            return new i(new Ne(119, 136, 153, 1));
          case "lightslategrey":
            return new i(new Ne(119, 136, 153, 1));
          case "lightsteelblue":
            return new i(new Ne(176, 196, 222, 1));
          case "lightyellow":
            return new i(new Ne(255, 255, 224, 1));
          case "lime":
            return new i(new Ne(0, 255, 0, 1));
          case "limegreen":
            return new i(new Ne(50, 205, 50, 1));
          case "linen":
            return new i(new Ne(250, 240, 230, 1));
          case "magenta":
            return new i(new Ne(255, 0, 255, 1));
          case "maroon":
            return new i(new Ne(128, 0, 0, 1));
          case "mediumaquamarine":
            return new i(new Ne(102, 205, 170, 1));
          case "mediumblue":
            return new i(new Ne(0, 0, 205, 1));
          case "mediumorchid":
            return new i(new Ne(186, 85, 211, 1));
          case "mediumpurple":
            return new i(new Ne(147, 112, 219, 1));
          case "mediumseagreen":
            return new i(new Ne(60, 179, 113, 1));
          case "mediumslateblue":
            return new i(new Ne(123, 104, 238, 1));
          case "mediumspringgreen":
            return new i(new Ne(0, 250, 154, 1));
          case "mediumturquoise":
            return new i(new Ne(72, 209, 204, 1));
          case "mediumvioletred":
            return new i(new Ne(199, 21, 133, 1));
          case "midnightblue":
            return new i(new Ne(25, 25, 112, 1));
          case "mintcream":
            return new i(new Ne(245, 255, 250, 1));
          case "mistyrose":
            return new i(new Ne(255, 228, 225, 1));
          case "moccasin":
            return new i(new Ne(255, 228, 181, 1));
          case "navajowhite":
            return new i(new Ne(255, 222, 173, 1));
          case "navy":
            return new i(new Ne(0, 0, 128, 1));
          case "oldlace":
            return new i(new Ne(253, 245, 230, 1));
          case "olive":
            return new i(new Ne(128, 128, 0, 1));
          case "olivedrab":
            return new i(new Ne(107, 142, 35, 1));
          case "orange":
            return new i(new Ne(255, 165, 0, 1));
          case "orangered":
            return new i(new Ne(255, 69, 0, 1));
          case "orchid":
            return new i(new Ne(218, 112, 214, 1));
          case "palegoldenrod":
            return new i(new Ne(238, 232, 170, 1));
          case "palegreen":
            return new i(new Ne(152, 251, 152, 1));
          case "paleturquoise":
            return new i(new Ne(175, 238, 238, 1));
          case "palevioletred":
            return new i(new Ne(219, 112, 147, 1));
          case "papayawhip":
            return new i(new Ne(255, 239, 213, 1));
          case "peachpuff":
            return new i(new Ne(255, 218, 185, 1));
          case "peru":
            return new i(new Ne(205, 133, 63, 1));
          case "pink":
            return new i(new Ne(255, 192, 203, 1));
          case "plum":
            return new i(new Ne(221, 160, 221, 1));
          case "powderblue":
            return new i(new Ne(176, 224, 230, 1));
          case "purple":
            return new i(new Ne(128, 0, 128, 1));
          case "rebeccapurple":
            return new i(new Ne(102, 51, 153, 1));
          case "red":
            return new i(new Ne(255, 0, 0, 1));
          case "rosybrown":
            return new i(new Ne(188, 143, 143, 1));
          case "royalblue":
            return new i(new Ne(65, 105, 225, 1));
          case "saddlebrown":
            return new i(new Ne(139, 69, 19, 1));
          case "salmon":
            return new i(new Ne(250, 128, 114, 1));
          case "sandybrown":
            return new i(new Ne(244, 164, 96, 1));
          case "seagreen":
            return new i(new Ne(46, 139, 87, 1));
          case "seashell":
            return new i(new Ne(255, 245, 238, 1));
          case "sienna":
            return new i(new Ne(160, 82, 45, 1));
          case "silver":
            return new i(new Ne(192, 192, 192, 1));
          case "skyblue":
            return new i(new Ne(135, 206, 235, 1));
          case "slateblue":
            return new i(new Ne(106, 90, 205, 1));
          case "slategray":
            return new i(new Ne(112, 128, 144, 1));
          case "slategrey":
            return new i(new Ne(112, 128, 144, 1));
          case "snow":
            return new i(new Ne(255, 250, 250, 1));
          case "springgreen":
            return new i(new Ne(0, 255, 127, 1));
          case "steelblue":
            return new i(new Ne(70, 130, 180, 1));
          case "tan":
            return new i(new Ne(210, 180, 140, 1));
          case "teal":
            return new i(new Ne(0, 128, 128, 1));
          case "thistle":
            return new i(new Ne(216, 191, 216, 1));
          case "tomato":
            return new i(new Ne(255, 99, 71, 1));
          case "turquoise":
            return new i(new Ne(64, 224, 208, 1));
          case "violet":
            return new i(new Ne(238, 130, 238, 1));
          case "wheat":
            return new i(new Ne(245, 222, 179, 1));
          case "white":
            return new i(new Ne(255, 255, 255, 1));
          case "whitesmoke":
            return new i(new Ne(245, 245, 245, 1));
          case "yellow":
            return new i(new Ne(255, 255, 0, 1));
          case "yellowgreen":
            return new i(new Ne(154, 205, 50, 1));
          default:
            return null;
        }
      }
      function g(_) {
        const v = _.length;
        if (v === 0 || _.charCodeAt(0) !== 35)
          return null;
        if (v === 7) {
          const w = 16 * m(_.charCodeAt(1)) + m(_.charCodeAt(2)), E = 16 * m(_.charCodeAt(3)) + m(_.charCodeAt(4)), L = 16 * m(_.charCodeAt(5)) + m(_.charCodeAt(6));
          return new i(new Ne(w, E, L, 1));
        }
        if (v === 9) {
          const w = 16 * m(_.charCodeAt(1)) + m(_.charCodeAt(2)), E = 16 * m(_.charCodeAt(3)) + m(_.charCodeAt(4)), L = 16 * m(_.charCodeAt(5)) + m(_.charCodeAt(6)), T = 16 * m(_.charCodeAt(7)) + m(_.charCodeAt(8));
          return new i(new Ne(w, E, L, T / 255));
        }
        if (v === 4) {
          const w = m(_.charCodeAt(1)), E = m(_.charCodeAt(2)), L = m(_.charCodeAt(3));
          return new i(new Ne(16 * w + w, 16 * E + E, 16 * L + L));
        }
        if (v === 5) {
          const w = m(_.charCodeAt(1)), E = m(_.charCodeAt(2)), L = m(_.charCodeAt(3)), T = m(_.charCodeAt(4));
          return new i(new Ne(16 * w + w, 16 * E + E, 16 * L + L, (16 * T + T) / 255));
        }
        return null;
      }
      t.parseHex = g;
      function m(_) {
        switch (_) {
          case 48:
            return 0;
          case 49:
            return 1;
          case 50:
            return 2;
          case 51:
            return 3;
          case 52:
            return 4;
          case 53:
            return 5;
          case 54:
            return 6;
          case 55:
            return 7;
          case 56:
            return 8;
          case 57:
            return 9;
          case 97:
            return 10;
          case 65:
            return 10;
          case 98:
            return 11;
          case 66:
            return 11;
          case 99:
            return 12;
          case 67:
            return 12;
          case 100:
            return 13;
          case 68:
            return 13;
          case 101:
            return 14;
          case 69:
            return 14;
          case 102:
            return 15;
          case 70:
            return 15;
        }
        return 0;
      }
    })(e.CSS || (e.CSS = {}));
  })(i.Format || (i.Format = {}));
})(De || (De = {}));
function bfe(i) {
  return `--vscode-${i.replace(/\./g, "-")}`;
}
function je(i) {
  return `var(${bfe(i)})`;
}
function LFe(i, e) {
  return `var(${bfe(i)}, ${e})`;
}
function xat(i) {
  return i !== null && typeof i == "object" && "light" in i && "dark" in i;
}
const TFe = {
  ColorContribution: "base.contributions.colors"
}, Lat = "default";
class Tat extends ge {
  constructor() {
    super(), this._onDidChangeSchema = this._register(new he()), this.onDidChangeSchema = this._onDidChangeSchema.event, this.colorSchema = { type: "object", properties: {} }, this.colorReferenceSchema = { type: "string", enum: [], enumDescriptions: [] }, this.colorsById = {};
  }
  registerColor(e, t, n, r = !1, s) {
    const o = { id: e, description: n, defaults: t, needsTransparency: r, deprecationMessage: s };
    this.colorsById[e] = o;
    const a = { type: "string", format: "color-hex", defaultSnippets: [{ body: "${1:#ff0000}" }] };
    return s && (a.deprecationMessage = s), r && (a.pattern = "^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$", a.patternErrorMessage = S(2004, "This color must be transparent or it will obscure content")), this.colorSchema.properties[e] = {
      description: n,
      oneOf: [
        a,
        { type: "string", const: Lat, description: S(2005, "Use the default color.") }
      ]
    }, this.colorReferenceSchema.enum.push(e), this.colorReferenceSchema.enumDescriptions.push(n), this._onDidChangeSchema.fire(), e;
  }
  getColors() {
    return Object.keys(this.colorsById).map((e) => this.colorsById[e]);
  }
  resolveDefaultColor(e, t) {
    const n = this.colorsById[e];
    if (n != null && n.defaults) {
      const r = xat(n.defaults) ? n.defaults[t.type] : n.defaults;
      return _f(r, t);
    }
  }
  getColorSchema() {
    return this.colorSchema;
  }
  toString() {
    const e = (t, n) => {
      const r = t.indexOf(".") === -1 ? 0 : 1, s = n.indexOf(".") === -1 ? 0 : 1;
      return r !== s ? r - s : t.localeCompare(n);
    };
    return Object.keys(this.colorsById).sort(e).map((t) => `- \`${t}\`: ${this.colorsById[t].description}`).join(`
`);
  }
}
const Uq = new Tat();
Fs.add(TFe.ColorContribution, Uq);
function ie(i, e, t, n, r) {
  return Uq.registerColor(i, e, t, n, r);
}
function kat(i, e) {
  var t, n, r, s;
  switch (i.op) {
    case 0:
      return (t = _f(i.value, e)) == null ? void 0 : t.darken(i.factor);
    case 1:
      return (n = _f(i.value, e)) == null ? void 0 : n.lighten(i.factor);
    case 2:
      return (r = _f(i.value, e)) == null ? void 0 : r.transparent(i.factor);
    case 7: {
      const o = _f(i.color, e) || De.transparent, a = _f(i.with, e) || De.transparent;
      return o.mix(a, i.ratio);
    }
    case 3: {
      const o = _f(i.background, e);
      return o ? (s = _f(i.value, e)) == null ? void 0 : s.makeOpaque(o) : _f(i.value, e);
    }
    case 4:
      for (const o of i.values) {
        const a = _f(o, e);
        if (a)
          return a;
      }
      return;
    case 6:
      return _f(e.defines(i.if) ? i.then : i.else, e);
    case 5: {
      const o = _f(i.value, e);
      if (!o)
        return;
      const a = _f(i.background, e);
      return a ? o.isDarkerThan(a) ? De.getLighterColor(o, a, i.factor).transparent(i.transparency) : De.getDarkerColor(o, a, i.factor).transparent(i.transparency) : o.transparent(i.factor * i.transparency);
    }
    default:
      throw dB();
  }
}
function ju(i, e) {
  return { op: 0, value: i, factor: e };
}
function om(i, e) {
  return { op: 1, value: i, factor: e };
}
function hn(i, e) {
  return { op: 2, value: i, factor: e };
}
function g4(...i) {
  return { op: 4, values: i };
}
function Dat(i, e, t) {
  return { op: 6, if: i, then: e, else: t };
}
function wLe(i, e, t, n) {
  return { op: 5, value: i, background: e, factor: t, transparency: n };
}
function _f(i, e) {
  if (i !== null) {
    if (typeof i == "string")
      return i[0] === "#" ? De.fromHex(i) : e.getColor(i);
    if (i instanceof De)
      return i;
    if (typeof i == "object")
      return kat(i, e);
  }
}
const kFe = "vscode://schemas/workbench-colors", DFe = Fs.as(Bq.JSONContribution);
DFe.registerSchema(kFe, Uq.getColorSchema());
const SLe = new mr(() => DFe.notifySchemaChanged(kFe), 200);
Uq.onDidChangeSchema(() => {
  SLe.isScheduled() || SLe.schedule();
});
const Qn = ie("foreground", { dark: "#CCCCCC", light: "#616161", hcDark: "#FFFFFF", hcLight: "#292929" }, S(1756, "Overall foreground color. This color is only used if not overridden by a component."));
ie("disabledForeground", { dark: "#CCCCCC80", light: "#61616180", hcDark: "#A5A5A5", hcLight: "#7F7F7F" }, S(1757, "Overall foreground for disabled elements. This color is only used if not overridden by a component."));
ie("errorForeground", { dark: "#F48771", light: "#A1260D", hcDark: "#F48771", hcLight: "#B5200D" }, S(1758, "Overall foreground color for error messages. This color is only used if not overridden by a component."));
const IFe = ie("descriptionForeground", { light: "#717171", dark: hn(Qn, 0.7), hcDark: hn(Qn, 0.7), hcLight: hn(Qn, 0.7) }, S(1759, "Foreground color for description text providing additional information, for example for a label.")), eU = ie("icon.foreground", { dark: "#C5C5C5", light: "#424242", hcDark: "#FFFFFF", hcLight: "#292929" }, S(1760, "The default color for icons in the workbench.")), fb = ie("focusBorder", { dark: "#007FD4", light: "#0090F1", hcDark: "#F38518", hcLight: "#006BBD" }, S(1761, "Overall border color for focused elements. This color is only used if not overridden by a component.")), hi = ie("contrastBorder", { light: null, dark: null, hcDark: "#6FC3DF", hcLight: "#0F4A85" }, S(1762, "An extra border around elements to separate them from others for greater contrast.")), fs = ie("contrastActiveBorder", { light: null, dark: null, hcDark: fb, hcLight: fb }, S(1763, "An extra border around active elements to separate them from others for greater contrast."));
ie("selection.background", null, S(1764, "The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));
const Iat = ie("textLink.foreground", { light: "#006AB1", dark: "#3794FF", hcDark: "#21A6FF", hcLight: "#0F4A85" }, S(1765, "Foreground color for links in text."));
ie("textLink.activeForeground", { light: "#006AB1", dark: "#3794FF", hcDark: "#21A6FF", hcLight: "#0F4A85" }, S(1766, "Foreground color for links in text when clicked on and on mouse hover."));
ie("textSeparator.foreground", { light: "#0000002e", dark: "#ffffff2e", hcDark: De.black, hcLight: "#292929" }, S(1767, "Color for text separators."));
ie("textPreformat.foreground", { light: "#A31515", dark: "#D7BA7D", hcDark: "#000000", hcLight: "#FFFFFF" }, S(1768, "Foreground color for preformatted text segments."));
ie("textPreformat.background", { light: "#0000001A", dark: "#FFFFFF1A", hcDark: "#FFFFFF", hcLight: "#09345f" }, S(1769, "Background color for preformatted text segments."));
ie("textBlockQuote.background", { light: "#f2f2f2", dark: "#222222", hcDark: null, hcLight: "#F2F2F2" }, S(1770, "Background color for block quotes in text."));
ie("textBlockQuote.border", { light: "#007acc80", dark: "#007acc80", hcDark: De.white, hcLight: "#292929" }, S(1771, "Border color for block quotes in text."));
ie("textCodeBlock.background", { light: "#dcdcdc66", dark: "#0a0a0a66", hcDark: De.black, hcLight: "#F2F2F2" }, S(1772, "Background color for code blocks in text."));
ie("sash.hoverBorder", fb, S(1977, "Border color of active sashes."));
const kW = ie("badge.background", { dark: "#4D4D4D", light: "#C4C4C4", hcDark: De.black, hcLight: "#0F4A85" }, S(1978, "Badge background color. Badges are small information labels, e.g. for search results count.")), Nat = ie("badge.foreground", { dark: De.white, light: "#333", hcDark: De.white, hcLight: De.white }, S(1979, "Badge foreground color. Badges are small information labels, e.g. for search results count."));
ie("activityWarningBadge.foreground", { dark: De.black.lighten(0.2), light: De.white, hcDark: null, hcLight: De.black.lighten(0.2) }, S(1980, "Foreground color of the warning activity badge"));
ie("activityWarningBadge.background", { dark: "#CCA700", light: "#BF8803", hcDark: null, hcLight: "#CCA700" }, S(1981, "Background color of the warning activity badge"));
ie("activityErrorBadge.foreground", { dark: De.black.lighten(0.2), light: De.white, hcDark: null, hcLight: De.black.lighten(0.2) }, S(1982, "Foreground color of the error activity badge"));
ie("activityErrorBadge.background", { dark: "#F14C4C", light: "#E51400", hcDark: null, hcLight: "#F14C4C" }, S(1983, "Background color of the error activity badge"));
const zq = ie("scrollbar.shadow", { dark: "#000000", light: "#DDDDDD", hcDark: null, hcLight: null }, S(1984, "Scrollbar shadow to indicate that the view is scrolled.")), NFe = ie("scrollbarSlider.background", { dark: De.fromHex("#797979").transparent(0.4), light: De.fromHex("#646464").transparent(0.4), hcDark: hn(hi, 0.6), hcLight: hn(hi, 0.4) }, S(1985, "Scrollbar slider background color.")), RFe = ie("scrollbarSlider.hoverBackground", { dark: De.fromHex("#646464").transparent(0.7), light: De.fromHex("#646464").transparent(0.7), hcDark: hn(hi, 0.8), hcLight: hn(hi, 0.8) }, S(1986, "Scrollbar slider background color when hovering.")), AFe = ie("scrollbarSlider.activeBackground", { dark: De.fromHex("#BFBFBF").transparent(0.4), light: De.fromHex("#000000").transparent(0.6), hcDark: hi, hcLight: hi }, S(1987, "Scrollbar slider background color when clicked on.")), Rat = ie("progressBar.background", { dark: De.fromHex("#0E70C0"), light: De.fromHex("#0E70C0"), hcDark: hi, hcLight: hi }, S(1988, "Background color of the progress bar that can show for long running operations."));
ie("chart.line", { dark: "#236B8E", light: "#236B8E", hcDark: "#236B8E", hcLight: "#236B8E" }, S(1989, "Line color for the chart."));
ie("chart.axis", { dark: De.fromHex("#BFBFBF").transparent(0.4), light: De.fromHex("#000000").transparent(0.6), hcDark: hi, hcLight: hi }, S(1990, "Axis color for the chart."));
ie("chart.guide", { dark: De.fromHex("#BFBFBF").transparent(0.2), light: De.fromHex("#000000").transparent(0.2), hcDark: hi, hcLight: hi }, S(1991, "Guide line for the chart."));
const yo = ie("editor.background", { light: "#ffffff", dark: "#1E1E1E", hcDark: De.black, hcLight: De.white }, S(1781, "Editor background color.")), kb = ie("editor.foreground", { light: "#333333", dark: "#BBBBBB", hcDark: De.white, hcLight: Qn }, S(1782, "Editor default foreground color."));
ie("editorStickyScroll.background", yo, S(1783, "Background color of sticky scroll in the editor"));
ie("editorStickyScrollGutter.background", yo, S(1784, "Background color of the gutter part of sticky scroll in the editor"));
ie("editorStickyScrollHover.background", { dark: "#2A2D2E", light: "#F0F0F0", hcDark: null, hcLight: De.fromHex("#0F4A85").transparent(0.1) }, S(1785, "Background color of sticky scroll on hover in the editor"));
ie("editorStickyScroll.border", { dark: null, light: null, hcDark: hi, hcLight: hi }, S(1786, "Border color of sticky scroll in the editor"));
ie("editorStickyScroll.shadow", zq, S(1787, " Shadow color of sticky scroll in the editor"));
const Bh = ie("editorWidget.background", { dark: "#252526", light: "#F3F3F3", hcDark: "#0C141F", hcLight: De.white }, S(1788, "Background color of editor widgets, such as find/replace.")), $q = ie("editorWidget.foreground", Qn, S(1789, "Foreground color of editor widgets, such as find/replace.")), vfe = ie("editorWidget.border", { dark: "#454545", light: "#C8C8C8", hcDark: hi, hcLight: hi }, S(1790, "Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));
ie("editorWidget.resizeBorder", null, S(1791, "Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget."));
ie("editorError.background", null, S(1792, "Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."), !0);
const jq = ie("editorError.foreground", { dark: "#F14C4C", light: "#E51400", hcDark: "#F48771", hcLight: "#B5200D" }, S(1793, "Foreground color of error squigglies in the editor.")), Aat = ie("editorError.border", { dark: null, light: null, hcDark: De.fromHex("#E47777").transparent(0.8), hcLight: "#B5200D" }, S(1794, "If set, color of double underlines for errors in the editor.")), Oat = ie("editorWarning.background", null, S(1795, "Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."), !0), Xy = ie("editorWarning.foreground", { dark: "#CCA700", light: "#BF8803", hcDark: "#FFD370", hcLight: "#895503" }, S(1796, "Foreground color of warning squigglies in the editor.")), p4 = ie("editorWarning.border", { dark: null, light: null, hcDark: De.fromHex("#FFCC00").transparent(0.8), hcLight: De.fromHex("#FFCC00").transparent(0.8) }, S(1797, "If set, color of double underlines for warnings in the editor."));
ie("editorInfo.background", null, S(1798, "Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."), !0);
const gb = ie("editorInfo.foreground", { dark: "#3794FF", light: "#1a85ff", hcDark: "#3794FF", hcLight: "#1a85ff" }, S(1799, "Foreground color of info squigglies in the editor.")), m4 = ie("editorInfo.border", { dark: null, light: null, hcDark: De.fromHex("#3794FF").transparent(0.8), hcLight: "#292929" }, S(1800, "If set, color of double underlines for infos in the editor.")), Mat = ie("editorHint.foreground", { dark: De.fromHex("#eeeeee").transparent(0.7), light: "#6c6c6c", hcDark: null, hcLight: null }, S(1801, "Foreground color of hint squigglies in the editor."));
ie("editorHint.border", { dark: null, light: null, hcDark: De.fromHex("#eeeeee").transparent(0.8), hcLight: "#292929" }, S(1802, "If set, color of double underlines for hints in the editor."));
const Pat = ie("editorLink.activeForeground", { dark: "#4E94CE", light: De.blue, hcDark: De.cyan, hcLight: "#292929" }, S(1803, "Color of active links.")), o1 = ie("editor.selectionBackground", { light: "#ADD6FF", dark: "#264F78", hcDark: "#f3f518", hcLight: "#0F4A85" }, S(1804, "Color of the editor selection.")), Fat = ie("editor.selectionForeground", { light: null, dark: null, hcDark: "#000000", hcLight: De.white }, S(1805, "Color of the selected text for high contrast.")), OFe = ie("editor.inactiveSelectionBackground", { light: hn(o1, 0.5), dark: hn(o1, 0.5), hcDark: hn(o1, 0.7), hcLight: hn(o1, 0.5) }, S(1806, "Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."), !0), yfe = ie("editor.selectionHighlightBackground", { light: wLe(o1, yo, 0.3, 0.6), dark: wLe(o1, yo, 0.3, 0.6), hcDark: null, hcLight: null }, S(1807, "Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("editor.selectionHighlightBorder", { light: null, dark: null, hcDark: fs, hcLight: fs }, S(1808, "Border color for regions with the same content as the selection."));
ie("editor.compositionBorder", { light: "#000000", dark: "#ffffff", hcLight: "#000000", hcDark: "#ffffff" }, S(1809, "The border color for an IME composition."));
ie("editor.findMatchBackground", { light: "#A8AC94", dark: "#515C6A", hcDark: null, hcLight: null }, S(1810, "Color of the current search match."));
const Bat = ie("editor.findMatchForeground", null, S(1811, "Text color of the current search match.")), vy = ie("editor.findMatchHighlightBackground", { light: "#EA5C0055", dark: "#EA5C0055", hcDark: null, hcLight: null }, S(1812, "Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."), !0), Hat = ie("editor.findMatchHighlightForeground", null, S(1813, "Foreground color of the other search matches."), !0);
ie("editor.findRangeHighlightBackground", { dark: "#3a3d4166", light: "#b4b4b44d", hcDark: null, hcLight: null }, S(1814, "Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("editor.findMatchBorder", { light: null, dark: null, hcDark: fs, hcLight: fs }, S(1815, "Border color of the current search match."));
const a1 = ie("editor.findMatchHighlightBorder", { light: null, dark: null, hcDark: fs, hcLight: fs }, S(1816, "Border color of the other search matches.")), Wat = ie("editor.findRangeHighlightBorder", { dark: null, light: null, hcDark: hn(fs, 0.4), hcLight: hn(fs, 0.4) }, S(1817, "Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("editor.hoverHighlightBackground", { light: "#ADD6FF26", dark: "#264f7840", hcDark: "#ADD6FF26", hcLight: null }, S(1818, "Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."), !0);
const tU = ie("editorHoverWidget.background", Bh, S(1819, "Background color of the editor hover.")), ELe = ie("editorHoverWidget.foreground", $q, S(1820, "Foreground color of the editor hover.")), Cfe = ie("editorHoverWidget.border", vfe, S(1821, "Border color of the editor hover."));
ie("editorHoverWidget.statusBarBackground", { dark: om(tU, 0.2), light: ju(tU, 0.05), hcDark: Bh, hcLight: Bh }, S(1822, "Background color of the editor hover status bar."));
const wfe = ie("editorInlayHint.foreground", { dark: "#969696", light: "#969696", hcDark: De.white, hcLight: De.black }, S(1823, "Foreground color of inline hints")), Sfe = ie("editorInlayHint.background", { dark: hn(kW, 0.1), light: hn(kW, 0.1), hcDark: hn(De.white, 0.1), hcLight: hn(kW, 0.1) }, S(1824, "Background color of inline hints")), Vat = ie("editorInlayHint.typeForeground", wfe, S(1825, "Foreground color of inline hints for types")), Uat = ie("editorInlayHint.typeBackground", Sfe, S(1826, "Background color of inline hints for types")), zat = ie("editorInlayHint.parameterForeground", wfe, S(1827, "Foreground color of inline hints for parameters")), $at = ie("editorInlayHint.parameterBackground", Sfe, S(1828, "Background color of inline hints for parameters")), jat = ie("editorLightBulb.foreground", { dark: "#FFCC00", light: "#DDB100", hcDark: "#FFCC00", hcLight: "#007ACC" }, S(1829, "The color used for the lightbulb actions icon."));
ie("editorLightBulbAutoFix.foreground", { dark: "#75BEFF", light: "#007ACC", hcDark: "#75BEFF", hcLight: "#007ACC" }, S(1830, "The color used for the lightbulb auto fix actions icon."));
ie("editorLightBulbAi.foreground", jat, S(1831, "The color used for the lightbulb AI icon."));
ie("editor.snippetTabstopHighlightBackground", { dark: new De(new Ne(124, 124, 124, 0.3)), light: new De(new Ne(10, 50, 100, 0.2)), hcDark: new De(new Ne(124, 124, 124, 0.3)), hcLight: new De(new Ne(10, 50, 100, 0.2)) }, S(1832, "Highlight background color of a snippet tabstop."));
ie("editor.snippetTabstopHighlightBorder", null, S(1833, "Highlight border color of a snippet tabstop."));
ie("editor.snippetFinalTabstopHighlightBackground", null, S(1834, "Highlight background color of the final tabstop of a snippet."));
ie("editor.snippetFinalTabstopHighlightBorder", { dark: "#525252", light: new De(new Ne(10, 50, 100, 0.5)), hcDark: "#525252", hcLight: "#292929" }, S(1835, "Highlight border color of the final tabstop of a snippet."));
const Wie = new De(new Ne(155, 185, 85, 0.2)), Vie = new De(new Ne(255, 0, 0, 0.2)), fx = ie("diffEditor.insertedTextBackground", { dark: "#9ccc2c33", light: "#9ccc2c40", hcDark: null, hcLight: null }, S(1836, "Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."), !0), l1 = ie("diffEditor.removedTextBackground", { dark: "#ff000033", light: "#ff000033", hcDark: null, hcLight: null }, S(1837, "Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."), !0), M7 = ie("diffEditor.insertedLineBackground", { dark: Wie, light: Wie, hcDark: null, hcLight: null }, S(1838, "Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("diffEditor.removedLineBackground", { dark: Vie, light: Vie, hcDark: null, hcLight: null }, S(1839, "Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("diffEditorGutter.insertedLineBackground", null, S(1840, "Background color for the margin where lines got inserted."));
ie("diffEditorGutter.removedLineBackground", null, S(1841, "Background color for the margin where lines got removed."));
const Gat = ie("diffEditorOverview.insertedForeground", null, S(1842, "Diff overview ruler foreground for inserted content.")), qat = ie("diffEditorOverview.removedForeground", null, S(1843, "Diff overview ruler foreground for removed content."));
ie("diffEditor.insertedTextBorder", { dark: null, light: null, hcDark: "#33ff2eff", hcLight: "#374E06" }, S(1844, "Outline color for the text that got inserted."));
ie("diffEditor.removedTextBorder", { dark: null, light: null, hcDark: "#FF008F", hcLight: "#AD0707" }, S(1845, "Outline color for text that got removed."));
ie("diffEditor.border", { dark: null, light: null, hcDark: hi, hcLight: hi }, S(1846, "Border color between the two text editors."));
ie("diffEditor.diagonalFill", { dark: "#cccccc33", light: "#22222233", hcDark: null, hcLight: null }, S(1847, "Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));
ie("diffEditor.unchangedRegionBackground", "sideBar.background", S(1848, "The background color of unchanged blocks in the diff editor."));
ie("diffEditor.unchangedRegionForeground", "foreground", S(1849, "The foreground color of unchanged blocks in the diff editor."));
ie("diffEditor.unchangedCodeBackground", { dark: "#74747429", light: "#b8b8b829", hcDark: null, hcLight: null }, S(1850, "The background color of unchanged code in the diff editor."));
const e2 = ie("widget.shadow", { dark: hn(De.black, 0.36), light: hn(De.black, 0.16), hcDark: null, hcLight: null }, S(1851, "Shadow color of widgets such as find/replace inside the editor.")), Efe = ie("widget.border", { dark: null, light: null, hcDark: hi, hcLight: hi }, S(1852, "Border color of widgets such as find/replace inside the editor.")), xLe = ie("toolbar.hoverBackground", { dark: "#5a5d5e50", light: "#b8b8b850", hcDark: null, hcLight: null }, S(1853, "Toolbar background when hovering over actions using the mouse"));
ie("toolbar.hoverOutline", { dark: null, light: null, hcDark: fs, hcLight: fs }, S(1854, "Toolbar outline when hovering over actions using the mouse"));
ie("toolbar.activeBackground", { dark: om(xLe, 0.1), light: ju(xLe, 0.1), hcDark: null, hcLight: null }, S(1855, "Toolbar background when holding the mouse over actions"));
const Kat = ie("breadcrumb.foreground", hn(Qn, 0.8), S(1856, "Color of focused breadcrumb items.")), Yat = ie("breadcrumb.background", yo, S(1857, "Background color of breadcrumb items.")), LLe = ie("breadcrumb.focusForeground", { light: ju(Qn, 0.2), dark: om(Qn, 0.1), hcDark: om(Qn, 0.1), hcLight: om(Qn, 0.1) }, S(1858, "Color of focused breadcrumb items.")), Xat = ie("breadcrumb.activeSelectionForeground", { light: ju(Qn, 0.2), dark: om(Qn, 0.1), hcDark: om(Qn, 0.1), hcLight: om(Qn, 0.1) }, S(1859, "Color of selected breadcrumb items."));
ie("breadcrumbPicker.background", Bh, S(1860, "Background color of breadcrumb item picker."));
const MFe = 0.5, TLe = De.fromHex("#40C8AE").transparent(MFe), kLe = De.fromHex("#40A6FF").transparent(MFe), DLe = De.fromHex("#606060").transparent(0.4), xfe = 0.4, XR = 1, Uie = ie("merge.currentHeaderBackground", { dark: TLe, light: TLe, hcDark: null, hcLight: null }, S(1861, "Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("merge.currentContentBackground", hn(Uie, xfe), S(1862, "Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), !0);
const zie = ie("merge.incomingHeaderBackground", { dark: kLe, light: kLe, hcDark: null, hcLight: null }, S(1863, "Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("merge.incomingContentBackground", hn(zie, xfe), S(1864, "Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), !0);
const $ie = ie("merge.commonHeaderBackground", { dark: DLe, light: DLe, hcDark: null, hcLight: null }, S(1865, "Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("merge.commonContentBackground", hn($ie, xfe), S(1866, "Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."), !0);
const ZR = ie("merge.border", { dark: null, light: null, hcDark: "#C3DF6F", hcLight: "#007ACC" }, S(1867, "Border color on headers and the splitter in inline merge-conflicts."));
ie("editorOverviewRuler.currentContentForeground", { dark: hn(Uie, XR), light: hn(Uie, XR), hcDark: ZR, hcLight: ZR }, S(1868, "Current overview ruler foreground for inline merge-conflicts."));
ie("editorOverviewRuler.incomingContentForeground", { dark: hn(zie, XR), light: hn(zie, XR), hcDark: ZR, hcLight: ZR }, S(1869, "Incoming overview ruler foreground for inline merge-conflicts."));
ie("editorOverviewRuler.commonContentForeground", { dark: hn($ie, XR), light: hn($ie, XR), hcDark: ZR, hcLight: ZR }, S(1870, "Common ancestor overview ruler foreground for inline merge-conflicts."));
const JJ = ie("editorOverviewRuler.findMatchForeground", { dark: "#d186167e", light: "#d186167e", hcDark: "#AB5A00", hcLight: "#AB5A00" }, S(1871, "Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."), !0), PFe = ie("editorOverviewRuler.selectionHighlightForeground", "#A0A0A0CC", S(1872, "Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."), !0), Zat = ie("problemsErrorIcon.foreground", jq, S(1873, "The color used for the problems error icon.")), Qat = ie("problemsWarningIcon.foreground", Xy, S(1874, "The color used for the problems warning icon.")), Jat = ie("problemsInfoIcon.foreground", gb, S(1875, "The color used for the problems info icon.")), jie = ie("minimap.findMatchHighlight", { light: "#d18616", dark: "#d18616", hcDark: "#AB5A00", hcLight: "#0F4A85" }, S(1966, "Minimap marker color for find matches."), !0), Gq = ie("minimap.selectionOccurrenceHighlight", { light: "#c9c9c9", dark: "#676767", hcDark: "#ffffff", hcLight: "#0F4A85" }, S(1967, "Minimap marker color for repeating editor selections."), !0), ILe = ie("minimap.selectionHighlight", { light: "#ADD6FF", dark: "#264F78", hcDark: "#ffffff", hcLight: "#0F4A85" }, S(1968, "Minimap marker color for the editor selection."), !0), elt = ie("minimap.infoHighlight", { dark: gb, light: gb, hcDark: m4, hcLight: m4 }, S(1969, "Minimap marker color for infos.")), tlt = ie("minimap.warningHighlight", { dark: Xy, light: Xy, hcDark: p4, hcLight: p4 }, S(1970, "Minimap marker color for warnings.")), nlt = ie("minimap.errorHighlight", { dark: new De(new Ne(255, 18, 18, 0.7)), light: new De(new Ne(255, 18, 18, 0.7)), hcDark: new De(new Ne(255, 50, 50, 1)), hcLight: "#B5200D" }, S(1971, "Minimap marker color for errors.")), ilt = ie("minimap.background", null, S(1972, "Minimap background color.")), rlt = ie("minimap.foregroundOpacity", De.fromHex("#000f"), S(1973, 'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));
ie("minimapSlider.background", hn(NFe, 0.5), S(1974, "Minimap slider background color."));
ie("minimapSlider.hoverBackground", hn(RFe, 0.5), S(1975, "Minimap slider background color when hovering."));
ie("minimapSlider.activeBackground", hn(AFe, 0.5), S(1976, "Minimap slider background color when clicked on."));
ie("charts.foreground", Qn, S(1773, "The foreground color used in charts."));
ie("charts.lines", hn(Qn, 0.5), S(1774, "The color used for horizontal lines in charts."));
ie("charts.red", jq, S(1775, "The red color used in chart visualizations."));
ie("charts.blue", gb, S(1776, "The blue color used in chart visualizations."));
ie("charts.yellow", Xy, S(1777, "The yellow color used in chart visualizations."));
ie("charts.orange", jie, S(1778, "The orange color used in chart visualizations."));
ie("charts.green", { dark: "#89D185", light: "#388A34", hcDark: "#89D185", hcLight: "#374e06" }, S(1779, "The green color used in chart visualizations."));
ie("charts.purple", { dark: "#B180D7", light: "#652D90", hcDark: "#B180D7", hcLight: "#652D90" }, S(1780, "The purple color used in chart visualizations."));
const Gie = ie("input.background", { dark: "#3C3C3C", light: De.white, hcDark: De.black, hcLight: De.white }, S(1876, "Input box background.")), FFe = ie("input.foreground", Qn, S(1877, "Input box foreground.")), BFe = ie("input.border", { dark: null, light: null, hcDark: hi, hcLight: hi }, S(1878, "Input box border.")), qq = ie("inputOption.activeBorder", { dark: "#007ACC", light: "#007ACC", hcDark: hi, hcLight: hi }, S(1879, "Border color of activated options in input fields.")), slt = ie("inputOption.hoverBackground", { dark: "#5a5d5e80", light: "#b8b8b850", hcDark: null, hcLight: null }, S(1880, "Background color of activated options in input fields.")), SB = ie("inputOption.activeBackground", { dark: hn(fb, 0.4), light: hn(fb, 0.2), hcDark: De.transparent, hcLight: De.transparent }, S(1881, "Background hover color of options in input fields.")), Kq = ie("inputOption.activeForeground", { dark: De.white, light: De.black, hcDark: Qn, hcLight: Qn }, S(1882, "Foreground color of activated options in input fields."));
ie("input.placeholderForeground", { light: hn(Qn, 0.5), dark: hn(Qn, 0.5), hcDark: hn(Qn, 0.7), hcLight: hn(Qn, 0.7) }, S(1883, "Input box foreground color for placeholder text."));
const olt = ie("inputValidation.infoBackground", { dark: "#063B49", light: "#D6ECF2", hcDark: De.black, hcLight: De.white }, S(1884, "Input validation background color for information severity.")), alt = ie("inputValidation.infoForeground", { dark: null, light: null, hcDark: null, hcLight: Qn }, S(1885, "Input validation foreground color for information severity.")), llt = ie("inputValidation.infoBorder", { dark: "#007acc", light: "#007acc", hcDark: hi, hcLight: hi }, S(1886, "Input validation border color for information severity.")), clt = ie("inputValidation.warningBackground", { dark: "#352A05", light: "#F6F5D2", hcDark: De.black, hcLight: De.white }, S(1887, "Input validation background color for warning severity.")), ult = ie("inputValidation.warningForeground", { dark: null, light: null, hcDark: null, hcLight: Qn }, S(1888, "Input validation foreground color for warning severity.")), dlt = ie("inputValidation.warningBorder", { dark: "#B89500", light: "#B89500", hcDark: hi, hcLight: hi }, S(1889, "Input validation border color for warning severity.")), hlt = ie("inputValidation.errorBackground", { dark: "#5A1D1D", light: "#F2DEDE", hcDark: De.black, hcLight: De.white }, S(1890, "Input validation background color for error severity.")), flt = ie("inputValidation.errorForeground", { dark: null, light: null, hcDark: null, hcLight: Qn }, S(1891, "Input validation foreground color for error severity.")), glt = ie("inputValidation.errorBorder", { dark: "#BE1100", light: "#BE1100", hcDark: hi, hcLight: hi }, S(1892, "Input validation border color for error severity.")), Yq = ie("dropdown.background", { dark: "#3C3C3C", light: De.white, hcDark: De.black, hcLight: De.white }, S(1893, "Dropdown background.")), plt = ie("dropdown.listBackground", { dark: null, light: null, hcDark: De.black, hcLight: De.white }, S(1894, "Dropdown list background.")), Lfe = ie("dropdown.foreground", { dark: "#F0F0F0", light: Qn, hcDark: De.white, hcLight: Qn }, S(1895, "Dropdown foreground.")), Tfe = ie("dropdown.border", { dark: Yq, light: "#CECECE", hcDark: hi, hcLight: hi }, S(1896, "Dropdown border.")), Xq = ie("button.foreground", De.white, S(1897, "Button foreground color.")), mlt = ie("button.separator", hn(Xq, 0.4), S(1898, "Button separator color.")), gx = ie("button.background", { dark: "#0E639C", light: "#007ACC", hcDark: null, hcLight: "#0F4A85" }, S(1899, "Button background color.")), _lt = ie("button.hoverBackground", { dark: om(gx, 0.2), light: ju(gx, 0.2), hcDark: gx, hcLight: gx }, S(1900, "Button background color when hovering.")), blt = ie("button.border", hi, S(1901, "Button border color.")), HFe = ie("button.secondaryForeground", { dark: De.white, light: De.white, hcDark: De.white, hcLight: Qn }, S(1902, "Secondary button foreground color.")), nU = ie("button.secondaryBackground", { dark: "#3A3D41", light: "#5F6A79", hcDark: null, hcLight: De.white }, S(1903, "Secondary button background color.")), vlt = ie("button.secondaryHoverBackground", { dark: om(nU, 0.2), light: ju(nU, 0.2), hcDark: null, hcLight: null }, S(1904, "Secondary button background color when hovering.")), zP = ie("radio.activeForeground", Kq, S(1905, "Foreground color of active radio option.")), ylt = ie("radio.activeBackground", SB, S(1906, "Background color of active radio option.")), Clt = ie("radio.activeBorder", qq, S(1907, "Border color of the active radio option.")), wlt = ie("radio.inactiveForeground", null, S(1908, "Foreground color of inactive radio option.")), Slt = ie("radio.inactiveBackground", null, S(1909, "Background color of inactive radio option.")), Elt = ie("radio.inactiveBorder", { light: hn(zP, 0.2), dark: hn(zP, 0.2), hcDark: hn(zP, 0.4), hcLight: hn(zP, 0.2) }, S(1910, "Border color of the inactive radio option.")), xlt = ie("radio.inactiveHoverBackground", slt, S(1911, "Background color of inactive active radio option when hovering.")), kfe = ie("checkbox.background", Yq, S(1912, "Background color of checkbox widget."));
ie("checkbox.selectBackground", Bh, S(1913, "Background color of checkbox widget when the element it's in is selected."));
const Dfe = ie("checkbox.foreground", Lfe, S(1914, "Foreground color of checkbox widget.")), Llt = ie("checkbox.border", Tfe, S(1915, "Border color of checkbox widget."));
ie("checkbox.selectBorder", eU, S(1916, "Border color of checkbox widget when the element it's in is selected."));
const Tlt = ie("checkbox.disabled.background", { op: 7, color: kfe, with: Dfe, ratio: 0.33 }, S(1917, "Background of a disabled checkbox.")), klt = ie("checkbox.disabled.foreground", { op: 7, color: Dfe, with: kfe, ratio: 0.33 }, S(1918, "Foreground of a disabled checkbox.")), Dlt = ie("keybindingLabel.background", { dark: new De(new Ne(128, 128, 128, 0.17)), light: new De(new Ne(221, 221, 221, 0.4)), hcDark: De.transparent, hcLight: De.transparent }, S(1919, "Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")), Ilt = ie("keybindingLabel.foreground", { dark: De.fromHex("#CCCCCC"), light: De.fromHex("#555555"), hcDark: De.white, hcLight: Qn }, S(1920, "Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")), Nlt = ie("keybindingLabel.border", { dark: new De(new Ne(51, 51, 51, 0.6)), light: new De(new Ne(204, 204, 204, 0.4)), hcDark: new De(new Ne(111, 195, 223)), hcLight: hi }, S(1921, "Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")), Rlt = ie("keybindingLabel.bottomBorder", { dark: new De(new Ne(68, 68, 68, 0.6)), light: new De(new Ne(187, 187, 187, 0.4)), hcDark: new De(new Ne(111, 195, 223)), hcLight: Qn }, S(1922, "Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")), Alt = ie("list.focusBackground", null, S(1923, "List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")), Olt = ie("list.focusForeground", null, S(1924, "List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")), Mlt = ie("list.focusOutline", { dark: fb, light: fb, hcDark: fs, hcLight: fs }, S(1925, "List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")), Plt = ie("list.focusAndSelectionOutline", null, S(1926, "List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")), rT = ie("list.activeSelectionBackground", { dark: "#04395E", light: "#0060C0", hcDark: null, hcLight: De.fromHex("#0F4A85").transparent(0.1) }, S(1927, "List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")), _4 = ie("list.activeSelectionForeground", { dark: De.white, light: De.white, hcDark: null, hcLight: null }, S(1928, "List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")), WFe = ie("list.activeSelectionIconForeground", null, S(1929, "List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")), Flt = ie("list.inactiveSelectionBackground", { dark: "#37373D", light: "#E4E6F1", hcDark: null, hcLight: De.fromHex("#0F4A85").transparent(0.1) }, S(1930, "List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")), Blt = ie("list.inactiveSelectionForeground", null, S(1931, "List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")), Hlt = ie("list.inactiveSelectionIconForeground", null, S(1932, "List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")), Wlt = ie("list.inactiveFocusBackground", null, S(1933, "List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")), Vlt = ie("list.inactiveFocusOutline", null, S(1934, "List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")), VFe = ie("list.hoverBackground", { dark: "#2A2D2E", light: "#F0F0F0", hcDark: De.white.transparent(0.1), hcLight: De.fromHex("#0F4A85").transparent(0.1) }, S(1935, "List/Tree background when hovering over items using the mouse.")), UFe = ie("list.hoverForeground", null, S(1936, "List/Tree foreground when hovering over items using the mouse.")), Ult = ie("list.dropBackground", { dark: "#062F4A", light: "#D6EBFF", hcDark: null, hcLight: null }, S(1937, "List/Tree drag and drop background when moving items over other items when using the mouse.")), zlt = ie("list.dropBetweenBackground", { dark: eU, light: eU, hcDark: null, hcLight: null }, S(1938, "List/Tree drag and drop border color when moving items between items when using the mouse.")), oN = ie("list.highlightForeground", { dark: "#2AAAFF", light: "#0066BF", hcDark: fb, hcLight: fb }, S(1939, "List/Tree foreground color of the match highlights when searching inside the list/tree.")), $lt = ie("list.focusHighlightForeground", { dark: oN, light: Dat(rT, oN, "#BBE7FF"), hcDark: oN, hcLight: oN }, S(1940, "List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));
ie("list.invalidItemForeground", { dark: "#B89500", light: "#B89500", hcDark: "#B89500", hcLight: "#B5200D" }, S(1941, "List/Tree foreground color for invalid items, for example an unresolved root in explorer."));
ie("list.errorForeground", { dark: "#F88070", light: "#B01011", hcDark: null, hcLight: null }, S(1942, "Foreground color of list items containing errors."));
ie("list.warningForeground", { dark: "#CCA700", light: "#855F00", hcDark: null, hcLight: null }, S(1943, "Foreground color of list items containing warnings."));
const jlt = ie("listFilterWidget.background", { light: ju(Bh, 0), dark: om(Bh, 0), hcDark: Bh, hcLight: Bh }, S(1944, "Background color of the type filter widget in lists and trees.")), Glt = ie("listFilterWidget.outline", { dark: De.transparent, light: De.transparent, hcDark: "#f38518", hcLight: "#007ACC" }, S(1945, "Outline color of the type filter widget in lists and trees.")), qlt = ie("listFilterWidget.noMatchesOutline", { dark: "#BE1100", light: "#BE1100", hcDark: hi, hcLight: hi }, S(1946, "Outline color of the type filter widget in lists and trees, when there are no matches.")), Klt = ie("listFilterWidget.shadow", e2, S(1947, "Shadow color of the type filter widget in lists and trees."));
ie("list.filterMatchBackground", { dark: vy, light: vy, hcDark: null, hcLight: null }, S(1948, "Background color of the filtered match."));
ie("list.filterMatchBorder", { dark: a1, light: a1, hcDark: hi, hcLight: fs }, S(1949, "Border color of the filtered match."));
ie("list.deemphasizedForeground", { dark: "#8C8C8C", light: "#8E8E90", hcDark: "#A7A8A9", hcLight: "#666666" }, S(1950, "List/Tree foreground color for items that are deemphasized."));
const zFe = ie("tree.indentGuidesStroke", { dark: "#585858", light: "#a9a9a9", hcDark: "#a9a9a9", hcLight: "#a5a5a5" }, S(1951, "Tree stroke color for the indentation guides.")), Ylt = ie("tree.inactiveIndentGuidesStroke", hn(zFe, 0.4), S(1952, "Tree stroke color for the indentation guides that are not active.")), Xlt = ie("tree.tableColumnsBorder", { dark: "#CCCCCC20", light: "#61616120", hcDark: null, hcLight: null }, S(1953, "Table border color between columns.")), Zlt = ie("tree.tableOddRowsBackground", { dark: hn(Qn, 0.04), light: hn(Qn, 0.04), hcDark: null, hcLight: null }, S(1954, "Background color for odd table rows."));
ie("editorActionList.background", Bh, S(1955, "Action List background color."));
const Qlt = ie("editorActionList.foreground", $q, S(1956, "Action List foreground color."));
ie("editorActionList.focusForeground", _4, S(1957, "Action List foreground color for the focused item."));
ie("editorActionList.focusBackground", rT, S(1958, "Action List background color for the focused item."));
const Jlt = ie("menu.border", { dark: null, light: null, hcDark: hi, hcLight: hi }, S(1959, "Border color of menus.")), ect = ie("menu.foreground", Lfe, S(1960, "Foreground color of menu items.")), tct = ie("menu.background", Yq, S(1961, "Background color of menu items.")), nct = ie("menu.selectionForeground", _4, S(1962, "Foreground color of the selected menu item in menus.")), ict = ie("menu.selectionBackground", rT, S(1963, "Background color of the selected menu item in menus.")), rct = ie("menu.selectionBorder", { dark: null, light: null, hcDark: fs, hcLight: fs }, S(1964, "Border color of the selected menu item in menus.")), sct = ie("menu.separatorBackground", { dark: "#606060", light: "#D4D4D4", hcDark: hi, hcLight: hi }, S(1965, "Color of a separator menu item in menus.")), eee = ie("quickInput.background", Bh, S(1992, "Quick picker background color. The quick picker widget is the container for pickers like the command palette.")), oct = ie("quickInput.foreground", $q, S(1993, "Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")), act = ie("quickInputTitle.background", { dark: new De(new Ne(255, 255, 255, 0.105)), light: new De(new Ne(0, 0, 0, 0.06)), hcDark: "#000000", hcLight: De.white }, S(1994, "Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")), $Fe = ie("pickerGroup.foreground", { dark: "#3794FF", light: "#0066BF", hcDark: De.white, hcLight: "#0F4A85" }, S(1995, "Quick picker color for grouping labels.")), lct = ie("pickerGroup.border", { dark: "#3F3F46", light: "#CCCEDB", hcDark: De.white, hcLight: "#0F4A85" }, S(1996, "Quick picker color for grouping borders.")), NLe = ie("quickInput.list.focusBackground", null, "", void 0, S(1997, "Please use quickInputList.focusBackground instead")), b4 = ie("quickInputList.focusForeground", _4, S(1998, "Quick picker foreground color for the focused item.")), Ife = ie("quickInputList.focusIconForeground", WFe, S(1999, "Quick picker icon foreground color for the focused item.")), v4 = ie("quickInputList.focusBackground", { dark: g4(NLe, rT), light: g4(NLe, rT), hcDark: null, hcLight: null }, S(2e3, "Quick picker background color for the focused item."));
ie("search.resultsInfoForeground", { light: Qn, dark: hn(Qn, 0.65), hcDark: Qn, hcLight: Qn }, S(2001, "Color of the text in the search viewlet's completion message."));
ie("searchEditor.findMatchBackground", { light: hn(vy, 0.66), dark: hn(vy, 0.66), hcDark: vy, hcLight: vy }, S(2002, "Color of the Search Editor query matches."));
ie("searchEditor.findMatchBorder", { light: hn(a1, 0.66), dark: hn(a1, 0.66), hcDark: a1, hcLight: a1 }, S(2003, "Border color of the Search Editor query matches."));
class EB {
  constructor(e, t) {
    this.x = e, this.y = t, this._pageCoordinatesBrand = void 0;
  }
  toClientCoordinates(e) {
    return new jFe(this.x - e.scrollX, this.y - e.scrollY);
  }
}
class jFe {
  constructor(e, t) {
    this.clientX = e, this.clientY = t, this._clientCoordinatesBrand = void 0;
  }
  toPageCoordinates(e) {
    return new EB(this.clientX + e.scrollX, this.clientY + e.scrollY);
  }
}
class cct {
  constructor(e, t, n, r) {
    this.x = e, this.y = t, this.width = n, this.height = r, this._editorPagePositionBrand = void 0;
  }
}
class uct {
  constructor(e, t) {
    this.x = e, this.y = t, this._positionRelativeToEditorBrand = void 0;
  }
}
function Zq(i) {
  const e = ho(i);
  return new cct(e.left, e.top, e.width, e.height);
}
function Qq(i, e, t) {
  const n = e.width / i.offsetWidth, r = e.height / i.offsetHeight, s = (t.x - e.x) / n, o = (t.y - e.y) / r;
  return new uct(s, o);
}
class Zy extends vl {
  constructor(e, t, n) {
    super(At(n), e), this._editorMouseEventBrand = void 0, this.isFromPointerCapture = t, this.pos = new EB(this.posx, this.posy), this.editorPos = Zq(n), this.relativePos = Qq(n, this.editorPos, this.pos);
  }
}
class dct {
  constructor(e) {
    this._editorViewDomNode = e;
  }
  _create(e) {
    return new Zy(e, !1, this._editorViewDomNode);
  }
  onContextMenu(e, t) {
    return Ce(e, Xe.CONTEXT_MENU, (n) => {
      t(this._create(n));
    });
  }
  onMouseUp(e, t) {
    return Ce(e, Xe.MOUSE_UP, (n) => {
      t(this._create(n));
    });
  }
  onMouseDown(e, t) {
    return Ce(e, Xe.MOUSE_DOWN, (n) => {
      t(this._create(n));
    });
  }
  onPointerDown(e, t) {
    return Ce(e, Xe.POINTER_DOWN, (n) => {
      t(this._create(n), n.pointerId);
    });
  }
  onMouseLeave(e, t) {
    return Ce(e, Xe.MOUSE_LEAVE, (n) => {
      t(this._create(n));
    });
  }
  onMouseMove(e, t) {
    return Ce(e, Xe.MOUSE_MOVE, (n) => t(this._create(n)));
  }
}
class hct {
  constructor(e) {
    this._editorViewDomNode = e;
  }
  _create(e) {
    return new Zy(e, !1, this._editorViewDomNode);
  }
  onPointerUp(e, t) {
    return Ce(e, "pointerup", (n) => {
      t(this._create(n));
    });
  }
  onPointerDown(e, t) {
    return Ce(e, Xe.POINTER_DOWN, (n) => {
      t(this._create(n), n.pointerId);
    });
  }
  onPointerLeave(e, t) {
    return Ce(e, Xe.POINTER_LEAVE, (n) => {
      t(this._create(n));
    });
  }
  onPointerMove(e, t) {
    return Ce(e, "pointermove", (n) => t(this._create(n)));
  }
}
class fct extends ge {
  constructor(e) {
    super(), this._editorViewDomNode = e, this._globalPointerMoveMonitor = this._register(new JA()), this._keydownListener = null;
  }
  startMonitoring(e, t, n, r, s) {
    this._keydownListener = vo(e.ownerDocument, "keydown", (o) => {
      o.toKeyCodeChord().isModifierKey() || this._globalPointerMoveMonitor.stopMonitoring(!0, o.browserEvent);
    }, !0), this._globalPointerMoveMonitor.startMonitoring(e, t, n, (o) => {
      r(new Zy(o, !0, this._editorViewDomNode));
    }, (o) => {
      this._keydownListener.dispose(), s(o);
    });
  }
  stopMonitoring() {
    this._globalPointerMoveMonitor.stopMonitoring(!0);
  }
}
const Mj = class Mj {
  constructor(e) {
    this._editor = e, this._instanceId = ++Mj._idPool, this._counter = 0, this._rules = new pq(), this._garbageCollectionScheduler = new mr(() => this.garbageCollect(), 1e3);
  }
  dispose() {
    this._rules.dispose(), this._garbageCollectionScheduler.dispose();
  }
  createClassNameRef(e) {
    const t = this.getOrCreateRule(e);
    return t.increaseRefCount(), {
      className: t.className,
      dispose: () => {
        t.decreaseRefCount(), this._garbageCollectionScheduler.schedule();
      }
    };
  }
  getOrCreateRule(e) {
    const t = this.computeUniqueKey(e);
    let n = this._rules.get(t);
    if (!n) {
      const r = this._counter++;
      n = new gct(t, `dyn-rule-${this._instanceId}-${r}`, BV(this._editor.getContainerDomNode()) ? this._editor.getContainerDomNode() : void 0, e), this._rules.set(t, n);
    }
    return n;
  }
  computeUniqueKey(e) {
    return JSON.stringify(e);
  }
  garbageCollect() {
    for (const e of this._rules.values())
      e.hasReferences() || this._rules.deleteAndDispose(e.key);
  }
};
Mj._idPool = 0;
let iU = Mj;
class gct {
  constructor(e, t, n, r) {
    this.key = e, this.className = t, this.properties = r, this._referenceCount = 0, this._styleElementDisposables = new ke(), this._styleElement = Zf(n, void 0, this._styleElementDisposables), this._styleElement.textContent = this.getCssText(this.className, this.properties);
  }
  getCssText(e, t) {
    let n = `.${e} {`;
    for (const r in t) {
      const s = t[r];
      let o;
      typeof s == "object" ? o = je(s.id) : o = s;
      const a = pct(r);
      n += `
	${a}: ${o};`;
    }
    return n += `
}`, n;
  }
  dispose() {
    this._styleElementDisposables.dispose(), this._styleElement = void 0;
  }
  increaseRefCount() {
    this._referenceCount++;
  }
  decreaseRefCount() {
    this._referenceCount--;
  }
  hasReferences() {
    return this._referenceCount > 0;
  }
}
function pct(i) {
  return i.replace(/(^[A-Z])/, ([e]) => e.toLowerCase()).replace(/([A-Z])/g, ([e]) => `-${e.toLowerCase()}`);
}
class YT extends ge {
  constructor() {
    super(), this._shouldRender = !0;
  }
  shouldRender() {
    return this._shouldRender;
  }
  forceShouldRender() {
    this._shouldRender = !0;
  }
  setShouldRender() {
    this._shouldRender = !0;
  }
  onDidRender() {
    this._shouldRender = !1;
  }
  // --- begin event handlers
  onCompositionStart(e) {
    return !1;
  }
  onCompositionEnd(e) {
    return !1;
  }
  onConfigurationChanged(e) {
    return !1;
  }
  onCursorStateChanged(e) {
    return !1;
  }
  onDecorationsChanged(e) {
    return !1;
  }
  onFlushed(e) {
    return !1;
  }
  onFocusChanged(e) {
    return !1;
  }
  onLanguageConfigurationChanged(e) {
    return !1;
  }
  onLineMappingChanged(e) {
    return !1;
  }
  onLinesChanged(e) {
    return !1;
  }
  onLinesDeleted(e) {
    return !1;
  }
  onLinesInserted(e) {
    return !1;
  }
  onRevealRangeRequest(e) {
    return !1;
  }
  onScrollChanged(e) {
    return !1;
  }
  onThemeChanged(e) {
    return !1;
  }
  onTokensChanged(e) {
    return !1;
  }
  onTokensColorsChanged(e) {
    return !1;
  }
  onZonesChanged(e) {
    return !1;
  }
  // --- end event handlers
  handleEvents(e) {
    let t = !1;
    for (let n = 0, r = e.length; n < r; n++) {
      const s = e[n];
      switch (s.type) {
        case 0:
          this.onCompositionStart(s) && (t = !0);
          break;
        case 1:
          this.onCompositionEnd(s) && (t = !0);
          break;
        case 2:
          this.onConfigurationChanged(s) && (t = !0);
          break;
        case 3:
          this.onCursorStateChanged(s) && (t = !0);
          break;
        case 4:
          this.onDecorationsChanged(s) && (t = !0);
          break;
        case 5:
          this.onFlushed(s) && (t = !0);
          break;
        case 6:
          this.onFocusChanged(s) && (t = !0);
          break;
        case 7:
          this.onLanguageConfigurationChanged(s) && (t = !0);
          break;
        case 8:
          this.onLineMappingChanged(s) && (t = !0);
          break;
        case 9:
          this.onLinesChanged(s) && (t = !0);
          break;
        case 10:
          this.onLinesDeleted(s) && (t = !0);
          break;
        case 11:
          this.onLinesInserted(s) && (t = !0);
          break;
        case 12:
          this.onRevealRangeRequest(s) && (t = !0);
          break;
        case 13:
          this.onScrollChanged(s) && (t = !0);
          break;
        case 15:
          this.onTokensChanged(s) && (t = !0);
          break;
        case 14:
          this.onThemeChanged(s) && (t = !0);
          break;
        case 16:
          this.onTokensColorsChanged(s) && (t = !0);
          break;
        case 17:
          this.onZonesChanged(s) && (t = !0);
          break;
        default:
          console.info("View received unknown event: "), console.info(s);
      }
    }
    t && (this._shouldRender = !0);
  }
}
class fu extends YT {
  constructor(e) {
    super(), this._context = e, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), super.dispose();
  }
}
class gm {
  static write(e, t) {
    e.setAttribute("data-mprt", String(t));
  }
  static read(e) {
    const t = e.getAttribute("data-mprt");
    return t === null ? 0 : parseInt(t, 10);
  }
  static collect(e, t) {
    const n = [];
    let r = 0;
    for (; e && e !== e.ownerDocument.body && e !== t; )
      e.nodeType === e.ELEMENT_NODE && (n[r++] = this.read(e)), e = e.parentElement;
    const s = new Uint8Array(r);
    for (let o = 0; o < r; o++)
      s[o] = n[r - o - 1];
    return s;
  }
}
class mct {
  constructor(e, t) {
    this._restrictedRenderingContextBrand = void 0, this._viewLayout = e, this.viewportData = t, this.scrollWidth = this._viewLayout.getScrollWidth(), this.scrollHeight = this._viewLayout.getScrollHeight(), this.visibleRange = this.viewportData.visibleRange, this.bigNumbersDelta = this.viewportData.bigNumbersDelta;
    const n = this._viewLayout.getCurrentViewport();
    this.scrollTop = n.top, this.scrollLeft = n.left, this.viewportWidth = n.width, this.viewportHeight = n.height;
  }
  getScrolledTopFromAbsoluteTop(e) {
    return e - this.scrollTop;
  }
  getVerticalOffsetForLineNumber(e, t) {
    return this._viewLayout.getVerticalOffsetForLineNumber(e, t);
  }
  getVerticalOffsetAfterLineNumber(e, t) {
    return this._viewLayout.getVerticalOffsetAfterLineNumber(e, t);
  }
  getLineHeightForLineNumber(e) {
    return this._viewLayout.getLineHeightForLineNumber(e);
  }
  getDecorationsInViewport() {
    return this.viewportData.getDecorationsInViewport();
  }
}
class _ct extends mct {
  constructor(e, t, n, r) {
    super(e, t), this._renderingContextBrand = void 0, this._viewLines = n, this._viewLinesGpu = r;
  }
  linesVisibleRangesForRange(e, t) {
    const n = this._viewLines.linesVisibleRangesForRange(e, t);
    if (!this._viewLinesGpu)
      return n ?? null;
    const r = this._viewLinesGpu.linesVisibleRangesForRange(e, t);
    return n ? r ? n.concat(r).sort((s, o) => s.lineNumber - o.lineNumber) : n : r;
  }
  visibleRangeForPosition(e) {
    var t;
    return this._viewLines.visibleRangeForPosition(e) ?? ((t = this._viewLinesGpu) == null ? void 0 : t.visibleRangeForPosition(e)) ?? null;
  }
}
class GFe {
  constructor(e, t, n, r) {
    this.outsideRenderedLine = e, this.lineNumber = t, this.ranges = n, this.continuesOnNextLine = r;
  }
}
class xB {
  static from(e) {
    const t = new Array(e.length);
    for (let n = 0, r = e.length; n < r; n++) {
      const s = e[n];
      t[n] = new xB(s.left, s.width);
    }
    return t;
  }
  constructor(e, t) {
    this._horizontalRangeBrand = void 0, this.left = Math.round(e), this.width = Math.round(t);
  }
  toString() {
    return `[${this.left},${this.width}]`;
  }
}
class k1 {
  constructor(e, t) {
    this._floatHorizontalRangeBrand = void 0, this.left = e, this.width = t;
  }
  toString() {
    return `[${this.left},${this.width}]`;
  }
  static compare(e, t) {
    return e.left - t.left;
  }
}
class qFe {
  constructor(e, t) {
    this.outsideRenderedLine = e, this.originalLeft = t, this.left = Math.round(this.originalLeft);
  }
}
class qie {
  constructor(e, t) {
    this.outsideRenderedLine = e, this.ranges = t;
  }
}
class DW {
  static _createRange() {
    return this._handyReadyRange || (this._handyReadyRange = document.createRange()), this._handyReadyRange;
  }
  static _detachRange(e, t) {
    e.selectNodeContents(t);
  }
  static _readClientRects(e, t, n, r, s) {
    const o = this._createRange();
    try {
      return o.setStart(e, t), o.setEnd(n, r), o.getClientRects();
    } catch {
      return null;
    } finally {
      this._detachRange(o, s);
    }
  }
  static _mergeAdjacentRanges(e) {
    if (e.length === 1)
      return e;
    e.sort(k1.compare);
    const t = [];
    let n = 0, r = e[0];
    for (let s = 1, o = e.length; s < o; s++) {
      const a = e[s];
      r.left + r.width + 0.9 >= a.left ? r.width = Math.max(r.width, a.left + a.width - r.left) : (t[n++] = r, r = a);
    }
    return t[n++] = r, t;
  }
  static _createHorizontalRangesFromClientRects(e, t, n) {
    if (!e || e.length === 0)
      return null;
    const r = [];
    for (let s = 0, o = e.length; s < o; s++) {
      const a = e[s];
      r[s] = new k1(Math.max(0, (a.left - t) / n), a.width / n);
    }
    return this._mergeAdjacentRanges(r);
  }
  static readHorizontalRanges(e, t, n, r, s, o) {
    const l = e.children.length - 1;
    if (0 > l)
      return null;
    if (t = Math.min(l, Math.max(0, t)), r = Math.min(l, Math.max(0, r)), t === r && n === s && n === 0 && !e.children[t].firstChild) {
      const h = e.children[t].getClientRects();
      return o.markDidDomLayout(), this._createHorizontalRangesFromClientRects(h, o.clientRectDeltaLeft, o.clientRectScale);
    }
    t !== r && r > 0 && s === 0 && (r--, s = 1073741824);
    let c = e.children[t].firstChild, u = e.children[r].firstChild;
    if ((!c || !u) && (!c && n === 0 && t > 0 && (c = e.children[t - 1].firstChild, n = 1073741824), !u && s === 0 && r > 0 && (u = e.children[r - 1].firstChild, s = 1073741824)), !c || !u)
      return null;
    n = Math.min(c.textContent.length, Math.max(0, n)), s = Math.min(u.textContent.length, Math.max(0, s));
    const d = this._readClientRects(c, n, u, s, o.endNode);
    return o.markDidDomLayout(), this._createHorizontalRangesFromClientRects(d, o.clientRectDeltaLeft, o.clientRectScale);
  }
}
class Lc {
  constructor(e, t, n, r) {
    this.startColumn = e, this.endColumn = t, this.className = n, this.type = r, this._lineDecorationBrand = void 0;
  }
  static _equals(e, t) {
    return e.startColumn === t.startColumn && e.endColumn === t.endColumn && e.className === t.className && e.type === t.type;
  }
  static equalsArr(e, t) {
    const n = e.length, r = t.length;
    if (n !== r)
      return !1;
    for (let s = 0; s < n; s++)
      if (!Lc._equals(e[s], t[s]))
        return !1;
    return !0;
  }
  static extractWrapped(e, t, n) {
    if (e.length === 0)
      return e;
    const r = t + 1, s = n + 1, o = n - t, a = [];
    let l = 0;
    for (const c of e)
      c.endColumn <= r || c.startColumn >= s || (a[l++] = new Lc(Math.max(1, c.startColumn - r + 1), Math.min(o + 1, c.endColumn - r + 1), c.className, c.type));
    return a;
  }
  static filter(e, t, n, r) {
    if (e.length === 0)
      return [];
    const s = [];
    let o = 0;
    for (let a = 0, l = e.length; a < l; a++) {
      const c = e[a], u = c.range;
      if (u.endLineNumber < t || u.startLineNumber > t || u.isEmpty() && (c.type === 0 || c.type === 3))
        continue;
      const d = u.startLineNumber === t ? u.startColumn : n, h = u.endLineNumber === t ? u.endColumn : r;
      s[o++] = new Lc(d, h, c.inlineClassName, c.type);
    }
    return s;
  }
  static _typeCompare(e, t) {
    const n = [2, 0, 1, 3];
    return n[e] - n[t];
  }
  static compare(e, t) {
    if (e.startColumn !== t.startColumn)
      return e.startColumn - t.startColumn;
    if (e.endColumn !== t.endColumn)
      return e.endColumn - t.endColumn;
    const n = Lc._typeCompare(e.type, t.type);
    return n !== 0 ? n : e.className !== t.className ? e.className < t.className ? -1 : 1 : 0;
  }
}
class RLe {
  constructor(e, t, n, r) {
    this.startOffset = e, this.endOffset = t, this.className = n, this.metadata = r;
  }
}
let bct = class Kie {
  constructor() {
    this.stopOffsets = [], this.classNames = [], this.metadata = [], this.count = 0;
  }
  static _metadata(e) {
    let t = 0;
    for (let n = 0, r = e.length; n < r; n++)
      t |= e[n];
    return t;
  }
  consumeLowerThan(e, t, n) {
    for (; this.count > 0 && this.stopOffsets[0] < e; ) {
      let r = 0;
      for (; r + 1 < this.count && this.stopOffsets[r] === this.stopOffsets[r + 1]; )
        r++;
      n.push(new RLe(t, this.stopOffsets[r], this.classNames.join(" "), Kie._metadata(this.metadata))), t = this.stopOffsets[r] + 1, this.stopOffsets.splice(0, r + 1), this.classNames.splice(0, r + 1), this.metadata.splice(0, r + 1), this.count -= r + 1;
    }
    return this.count > 0 && t < e && (n.push(new RLe(t, e - 1, this.classNames.join(" "), Kie._metadata(this.metadata))), t = e), t;
  }
  insert(e, t, n) {
    if (this.count === 0 || this.stopOffsets[this.count - 1] <= e)
      this.stopOffsets.push(e), this.classNames.push(t), this.metadata.push(n);
    else
      for (let r = 0; r < this.count; r++)
        if (this.stopOffsets[r] >= e) {
          this.stopOffsets.splice(r, 0, e), this.classNames.splice(r, 0, t), this.metadata.splice(r, 0, n);
          break;
        }
    this.count++;
  }
};
class vct {
  /**
   * Normalize line decorations. Overlapping decorations will generate multiple segments
   */
  static normalize(e, t) {
    if (t.length === 0)
      return [];
    const n = [], r = new bct();
    let s = 0;
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      let c = l.startColumn, u = l.endColumn;
      const d = l.className, h = l.type === 1 ? 2 : l.type === 2 ? 4 : 0;
      if (c > 1) {
        const _ = e.charCodeAt(c - 2);
        Qo(_) && c--;
      }
      if (u > 1) {
        const _ = e.charCodeAt(u - 2);
        Qo(_) && u--;
      }
      const g = c - 1, m = u - 2;
      s = r.consumeLowerThan(g, s, n), r.count === 0 && (s = g), r.insert(m, d, h);
    }
    return r.consumeLowerThan(1073741824, s, n), n;
  }
}
class Na {
  constructor(e, t, n, r) {
    this.endIndex = e, this.type = t, this.metadata = n, this.containsRTL = r, this._linePartBrand = void 0;
  }
  isWhitespace() {
    return !!(this.metadata & 1);
  }
  isPseudoAfter() {
    return !!(this.metadata & 4);
  }
}
class d0 {
  get isLTR() {
    return !this.containsRTL && this.textDirection !== Ph.RTL;
  }
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g, m, _, v, w, E, L, T, D, N = !1) {
    this.useMonospaceOptimizations = e, this.canUseHalfwidthRightwardsArrow = t, this.lineContent = n, this.continuesWithWrappedLine = r, this.isBasicASCII = s, this.containsRTL = o, this.fauxIndentLength = a, this.lineTokens = l, this.lineDecorations = c.sort(Lc.compare), this.tabSize = u, this.startVisibleColumn = d, this.spaceWidth = h, this.stopRenderingLineAfter = _, this.renderWhitespace = v === "all" ? 4 : v === "boundary" ? 1 : v === "selection" ? 2 : v === "trailing" ? 3 : 0, this.renderControlCharacters = w, this.fontLigatures = E, this.selectionsOnLine = L && L.sort((B, H) => B.start < H.start ? -1 : 1), this.renderNewLineWhenEmpty = N, this.textDirection = T, this.verticalScrollbarSize = D;
    const R = Math.abs(m - h), M = Math.abs(g - h);
    R < M ? (this.renderSpaceWidth = m, this.renderSpaceCharCode = 11825) : (this.renderSpaceWidth = g, this.renderSpaceCharCode = 183);
  }
  sameSelection(e) {
    if (this.selectionsOnLine === null)
      return e === null;
    if (e === null || e.length !== this.selectionsOnLine.length)
      return !1;
    for (let t = 0; t < this.selectionsOnLine.length; t++)
      if (!this.selectionsOnLine[t].equals(e[t]))
        return !1;
    return !0;
  }
  equals(e) {
    return this.useMonospaceOptimizations === e.useMonospaceOptimizations && this.canUseHalfwidthRightwardsArrow === e.canUseHalfwidthRightwardsArrow && this.lineContent === e.lineContent && this.continuesWithWrappedLine === e.continuesWithWrappedLine && this.isBasicASCII === e.isBasicASCII && this.containsRTL === e.containsRTL && this.fauxIndentLength === e.fauxIndentLength && this.tabSize === e.tabSize && this.startVisibleColumn === e.startVisibleColumn && this.spaceWidth === e.spaceWidth && this.renderSpaceWidth === e.renderSpaceWidth && this.renderSpaceCharCode === e.renderSpaceCharCode && this.stopRenderingLineAfter === e.stopRenderingLineAfter && this.renderWhitespace === e.renderWhitespace && this.renderControlCharacters === e.renderControlCharacters && this.fontLigatures === e.fontLigatures && Lc.equalsArr(this.lineDecorations, e.lineDecorations) && this.lineTokens.equals(e.lineTokens) && this.sameSelection(e.selectionsOnLine) && this.textDirection === e.textDirection && this.verticalScrollbarSize === e.verticalScrollbarSize && this.renderNewLineWhenEmpty === e.renderNewLineWhenEmpty;
  }
}
class KFe {
  constructor(e, t) {
    this.partIndex = e, this.charIndex = t;
  }
}
class U_ {
  static getPartIndex(e) {
    return (e & 4294901760) >>> 16;
  }
  static getCharIndex(e) {
    return (e & 65535) >>> 0;
  }
  constructor(e, t) {
    this.length = e, this._data = new Uint32Array(this.length), this._horizontalOffset = new Uint32Array(this.length);
  }
  setColumnInfo(e, t, n, r) {
    const s = (t << 16 | n << 0) >>> 0;
    this._data[e - 1] = s, this._horizontalOffset[e - 1] = r;
  }
  getHorizontalOffset(e) {
    return this._horizontalOffset.length === 0 ? 0 : this._horizontalOffset[e - 1];
  }
  charOffsetToPartData(e) {
    return this.length === 0 ? 0 : e < 0 ? this._data[0] : e >= this.length ? this._data[this.length - 1] : this._data[e];
  }
  getDomPosition(e) {
    const t = this.charOffsetToPartData(e - 1), n = U_.getPartIndex(t), r = U_.getCharIndex(t);
    return new KFe(n, r);
  }
  getColumn(e, t) {
    return this.partDataToCharOffset(e.partIndex, t, e.charIndex) + 1;
  }
  partDataToCharOffset(e, t, n) {
    if (this.length === 0)
      return 0;
    const r = (e << 16 | n << 0) >>> 0;
    let s = 0, o = this.length - 1;
    for (; s + 1 < o; ) {
      const _ = s + o >>> 1, v = this._data[_];
      if (v === r)
        return _;
      v > r ? o = _ : s = _;
    }
    if (s === o)
      return s;
    const a = this._data[s], l = this._data[o];
    if (a === r)
      return s;
    if (l === r)
      return o;
    const c = U_.getPartIndex(a), u = U_.getCharIndex(a), d = U_.getPartIndex(l);
    let h;
    c !== d ? h = t : h = U_.getCharIndex(l);
    const g = n - u, m = h - n;
    return g <= m ? s : o;
  }
}
class Yie {
  constructor(e, t) {
    this._renderLineOutputBrand = void 0, this.characterMapping = e, this.containsForeignElements = t;
  }
}
function t2(i, e) {
  if (i.lineContent.length === 0) {
    if (i.lineDecorations.length > 0) {
      e.appendString("<span>");
      let t = 0, n = 0, r = 0;
      for (const o of i.lineDecorations)
        (o.type === 1 || o.type === 2) && (e.appendString('<span class="'), e.appendString(o.className), e.appendString('"></span>'), o.type === 1 && (r |= 1, t++), o.type === 2 && (r |= 2, n++));
      e.appendString("</span>");
      const s = new U_(1, t + n);
      return s.setColumnInfo(1, t, 0, 0), new Yie(s, r);
    }
    return i.renderNewLineWhenEmpty ? e.appendString(`<span><span>
</span></span>`) : e.appendString("<span><span></span></span>"), new Yie(
      new U_(0, 0),
      0
      /* ForeignElementType.None */
    );
  }
  return kct(wct(i), e);
}
class yct {
  constructor(e, t, n) {
    this.characterMapping = e, this.html = t, this.containsForeignElements = n;
  }
}
function Jq(i) {
  const e = new ww(1e4), t = t2(i, e);
  return new yct(t.characterMapping, e.build(), t.containsForeignElements);
}
class Cct {
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g, m, _) {
    this.fontIsMonospace = e, this.canUseHalfwidthRightwardsArrow = t, this.lineContent = n, this.len = r, this.isOverflowing = s, this.overflowingCharCount = o, this.parts = a, this.containsForeignElements = l, this.fauxIndentLength = c, this.tabSize = u, this.startVisibleColumn = d, this.spaceWidth = h, this.renderSpaceCharCode = g, this.renderWhitespace = m, this.renderControlCharacters = _;
  }
}
function wct(i) {
  const e = i.lineContent;
  let t, n, r;
  i.stopRenderingLineAfter !== -1 && i.stopRenderingLineAfter < e.length ? (t = !0, n = e.length - i.stopRenderingLineAfter, r = i.stopRenderingLineAfter) : (t = !1, n = 0, r = e.length);
  let s = Sct(e, i.containsRTL, i.lineTokens, i.fauxIndentLength, r);
  i.renderControlCharacters && !i.isBasicASCII && (s = xct(e, s)), (i.renderWhitespace === 4 || i.renderWhitespace === 1 || i.renderWhitespace === 2 && i.selectionsOnLine || i.renderWhitespace === 3 && !i.continuesWithWrappedLine) && (s = Lct(i, e, r, s));
  let o = 0;
  if (i.lineDecorations.length > 0) {
    for (let a = 0, l = i.lineDecorations.length; a < l; a++) {
      const c = i.lineDecorations[a];
      c.type === 3 || c.type === 1 ? o |= 1 : c.type === 2 && (o |= 2);
    }
    s = Tct(e, r, s, i.lineDecorations);
  }
  return i.containsRTL || (s = Ect(e, s, !i.isBasicASCII || i.fontLigatures)), new Cct(i.useMonospaceOptimizations, i.canUseHalfwidthRightwardsArrow, e, r, t, n, s, o, i.fauxIndentLength, i.tabSize, i.startVisibleColumn, i.spaceWidth, i.renderSpaceCharCode, i.renderWhitespace, i.renderControlCharacters);
}
function Sct(i, e, t, n, r) {
  const s = [];
  let o = 0;
  n > 0 && (s[o++] = new Na(n, "", 0, !1));
  let a = n;
  for (let l = 0, c = t.getCount(); l < c; l++) {
    const u = t.getEndOffset(l);
    if (u <= n)
      continue;
    const d = t.getClassName(l);
    if (u >= r) {
      const g = e ? jR(i.substring(a, r)) : !1;
      s[o++] = new Na(r, d, 0, g);
      break;
    }
    const h = e ? jR(i.substring(a, u)) : !1;
    s[o++] = new Na(u, d, 0, h), a = u;
  }
  return s;
}
function Ect(i, e, t) {
  let n = 0;
  const r = [];
  let s = 0;
  if (t)
    for (let o = 0, a = e.length; o < a; o++) {
      const l = e[o], c = l.endIndex;
      if (n + 50 < c) {
        const u = l.type, d = l.metadata, h = l.containsRTL;
        let g = -1, m = n;
        for (let _ = n; _ < c; _++)
          i.charCodeAt(_) === 32 && (g = _), g !== -1 && _ - m >= 50 && (r[s++] = new Na(g + 1, u, d, h), m = g + 1, g = -1);
        m !== c && (r[s++] = new Na(c, u, d, h));
      } else
        r[s++] = l;
      n = c;
    }
  else
    for (let o = 0, a = e.length; o < a; o++) {
      const l = e[o], c = l.endIndex, u = c - n;
      if (u > 50) {
        const d = l.type, h = l.metadata, g = l.containsRTL, m = Math.ceil(
          u / 50
          /* Constants.LongToken */
        );
        for (let _ = 1; _ < m; _++) {
          const v = n + _ * 50;
          r[s++] = new Na(v, d, h, g);
        }
        r[s++] = new Na(c, d, h, g);
      } else
        r[s++] = l;
      n = c;
    }
  return r;
}
function YFe(i) {
  return i < 32 ? i !== 9 : i === 127 || i >= 8234 && i <= 8238 || i >= 8294 && i <= 8297 || i >= 8206 && i <= 8207 || i === 1564;
}
function xct(i, e) {
  const t = [];
  let n = new Na(0, "", 0, !1), r = 0;
  for (const s of e) {
    const o = s.endIndex;
    for (; r < o; r++) {
      const a = i.charCodeAt(r);
      YFe(a) && (r > n.endIndex && (n = new Na(r, s.type, s.metadata, s.containsRTL), t.push(n)), n = new Na(r + 1, "mtkcontrol", s.metadata, !1), t.push(n));
    }
    r > n.endIndex && (n = new Na(o, s.type, s.metadata, s.containsRTL), t.push(n));
  }
  return t;
}
function Lct(i, e, t, n) {
  const r = i.continuesWithWrappedLine, s = i.fauxIndentLength, o = i.tabSize, a = i.startVisibleColumn, l = i.useMonospaceOptimizations, c = i.selectionsOnLine, u = i.renderWhitespace === 1, d = i.renderWhitespace === 3, h = i.renderSpaceWidth !== i.spaceWidth, g = [];
  let m = 0, _ = 0, v = n[_].type, w = n[_].containsRTL, E = n[_].endIndex;
  const L = n.length;
  let T = !1, D = Tc(e), N;
  D === -1 ? (T = !0, D = t, N = t) : N = zg(e);
  let R = !1, M = 0, B = c && c[M], H = a % o;
  for (let K = s; K < t; K++) {
    const X = e.charCodeAt(K);
    B && B.endExclusive <= K && (M++, B = c && c[M]);
    let Y;
    if (K < D || K > N)
      Y = !0;
    else if (X === 9)
      Y = !0;
    else if (X === 32)
      if (u)
        if (R)
          Y = !0;
        else {
          const G = K + 1 < t ? e.charCodeAt(K + 1) : 0;
          Y = G === 32 || G === 9;
        }
      else
        Y = !0;
    else
      Y = !1;
    if (Y && c && (Y = !!B && B.start <= K && K < B.endExclusive), Y && d && (Y = T || K > N), Y && w && K >= D && K <= N && (Y = !1), R) {
      if (!Y || !l && H >= o) {
        if (h) {
          const G = m > 0 ? g[m - 1].endIndex : s;
          for (let Q = G + 1; Q <= K; Q++)
            g[m++] = new Na(Q, "mtkw", 1, !1);
        } else
          g[m++] = new Na(K, "mtkw", 1, !1);
        H = H % o;
      }
    } else
      (K === E || Y && K > s) && (g[m++] = new Na(K, v, 0, w), H = H % o);
    for (X === 9 ? H = o : tw(X) ? H += 2 : H++, R = Y; K === E && (_++, _ < L); )
      v = n[_].type, w = n[_].containsRTL, E = n[_].endIndex;
  }
  let j = !1;
  if (R)
    if (r && u) {
      const K = t > 0 ? e.charCodeAt(t - 1) : 0, X = t > 1 ? e.charCodeAt(t - 2) : 0;
      K === 32 && X !== 32 && X !== 9 || (j = !0);
    } else
      j = !0;
  if (j)
    if (h) {
      const K = m > 0 ? g[m - 1].endIndex : s;
      for (let X = K + 1; X <= t; X++)
        g[m++] = new Na(X, "mtkw", 1, !1);
    } else
      g[m++] = new Na(t, "mtkw", 1, !1);
  else
    g[m++] = new Na(t, v, 0, w);
  return g;
}
function Tct(i, e, t, n) {
  n.sort(Lc.compare);
  const r = vct.normalize(i, n), s = r.length;
  let o = 0;
  const a = [];
  let l = 0, c = 0;
  for (let d = 0, h = t.length; d < h; d++) {
    const g = t[d], m = g.endIndex, _ = g.type, v = g.metadata, w = g.containsRTL;
    for (; o < s && r[o].startOffset < m; ) {
      const E = r[o];
      if (E.startOffset > c && (c = E.startOffset, a[l++] = new Na(c, _, v, w)), E.endOffset + 1 <= m)
        c = E.endOffset + 1, a[l++] = new Na(c, _ + " " + E.className, v | E.metadata, w), o++;
      else {
        c = m, a[l++] = new Na(c, _ + " " + E.className, v | E.metadata, w);
        break;
      }
    }
    m > c && (c = m, a[l++] = new Na(c, _, v, w));
  }
  const u = t[t.length - 1].endIndex;
  if (o < s && r[o].startOffset === u)
    for (; o < s && r[o].startOffset === u; ) {
      const d = r[o];
      a[l++] = new Na(c, d.className, d.metadata, !1), o++;
    }
  return a;
}
function kct(i, e) {
  const t = i.fontIsMonospace, n = i.canUseHalfwidthRightwardsArrow, r = i.containsForeignElements, s = i.lineContent, o = i.len, a = i.isOverflowing, l = i.overflowingCharCount, c = i.parts, u = i.fauxIndentLength, d = i.tabSize, h = i.startVisibleColumn, g = i.spaceWidth, m = i.renderSpaceCharCode, _ = i.renderWhitespace, v = i.renderControlCharacters, w = new U_(o + 1, c.length);
  let E = !1, L = 0, T = h, D = 0, N = 0, R = 0;
  e.appendString("<span>");
  for (let M = 0, B = c.length; M < B; M++) {
    const H = c[M], j = H.endIndex, K = H.type, X = H.containsRTL, Y = _ !== 0 && H.isWhitespace(), G = Y && !t && (K === "mtkw" || !r), Q = L === j && H.isPseudoAfter();
    if (D = 0, e.appendString("<span "), X && e.appendString('style="unicode-bidi:isolate" '), e.appendString('class="'), e.appendString(G ? "mtkz" : K), e.appendASCIICharCode(
      34
      /* CharCode.DoubleQuote */
    ), Y) {
      let oe = 0;
      {
        let Z = L, pe = T;
        for (; Z < j; Z++) {
          const ae = (s.charCodeAt(Z) === 9 ? d - pe % d : 1) | 0;
          oe += ae, Z >= u && (pe += ae);
        }
      }
      for (G && (e.appendString(' style="width:'), e.appendString(String(g * oe)), e.appendString('px"')), e.appendASCIICharCode(
        62
        /* CharCode.GreaterThan */
      ); L < j; L++) {
        w.setColumnInfo(L + 1, M - R, D, N), R = 0;
        const Z = s.charCodeAt(L);
        let pe, J;
        if (Z === 9) {
          pe = d - T % d | 0, J = pe, !n || J > 1 ? e.appendCharCode(8594) : e.appendCharCode(65515);
          for (let ae = 2; ae <= J; ae++)
            e.appendCharCode(160);
        } else
          pe = 2, J = 1, e.appendCharCode(m), e.appendCharCode(8204);
        D += pe, N += J, L >= u && (T += J);
      }
    } else
      for (e.appendASCIICharCode(
        62
        /* CharCode.GreaterThan */
      ); L < j; L++) {
        w.setColumnInfo(L + 1, M - R, D, N), R = 0;
        const oe = s.charCodeAt(L);
        let Z = 1, pe = 1;
        switch (oe) {
          case 9:
            Z = d - T % d, pe = Z;
            for (let J = 1; J <= Z; J++)
              e.appendCharCode(160);
            break;
          case 32:
            e.appendCharCode(160);
            break;
          case 60:
            e.appendString("&lt;");
            break;
          case 62:
            e.appendString("&gt;");
            break;
          case 38:
            e.appendString("&amp;");
            break;
          case 0:
            v ? e.appendCharCode(9216) : e.appendString("&#00;");
            break;
          case 65279:
          case 8232:
          case 8233:
          case 133:
            e.appendCharCode(65533);
            break;
          default:
            tw(oe) && pe++, v && oe < 32 ? e.appendCharCode(9216 + oe) : v && oe === 127 ? e.appendCharCode(9249) : v && YFe(oe) ? (e.appendString("[U+"), e.appendString(Dct(oe)), e.appendString("]"), Z = 8, pe = Z) : e.appendCharCode(oe);
        }
        D += Z, N += pe, L >= u && (T += pe);
      }
    Q ? R++ : R = 0, L >= o && !E && H.isPseudoAfter() && (E = !0, w.setColumnInfo(L + 1, M, D, N)), e.appendString("</span>");
  }
  return E || w.setColumnInfo(o + 1, c.length - 1, D, N), a && (e.appendString('<span class="mtkoverflow">'), e.appendString(S(792, "Show more ({0})", Ict(l))), e.appendString("</span>")), e.appendString("</span>"), new Yie(w, r);
}
function Dct(i) {
  return i.toString(16).toUpperCase().padStart(4, "0");
}
function Ict(i) {
  return i < 1024 ? S(793, "{0} chars", i) : i < 1024 * 1024 ? `${(i / 1024).toFixed(1)} KB` : `${(i / 1024 / 1024).toFixed(1)} MB`;
}
var Ff;
(function(i) {
  i.DARK = "dark", i.LIGHT = "light", i.HIGH_CONTRAST_DARK = "hcDark", i.HIGH_CONTRAST_LIGHT = "hcLight";
})(Ff || (Ff = {}));
var aN;
(function(i) {
  i.VS = "vs", i.VS_DARK = "vs-dark", i.HC_BLACK = "hc-black", i.HC_LIGHT = "hc-light";
})(aN || (aN = {}));
function am(i) {
  return i === Ff.HIGH_CONTRAST_DARK || i === Ff.HIGH_CONTRAST_LIGHT;
}
function sT(i) {
  return i === Ff.DARK || i === Ff.HIGH_CONTRAST_DARK;
}
const Nct = /* @__PURE__ */ (function() {
  return hm ? !0 : !(Qu || Zu || XL);
})();
let ZN = !0;
const Pj = class Pj {
  constructor(e, t) {
    this._viewGpuContext = e, this._options = t, this._isMaybeInvalid = !0, this._renderedViewLine = null;
  }
  // --- begin IVisibleLineData
  getDomNode() {
    return this._renderedViewLine && this._renderedViewLine.domNode ? this._renderedViewLine.domNode.domNode : null;
  }
  setDomNode(e) {
    if (this._renderedViewLine)
      this._renderedViewLine.domNode = Gi(e);
    else
      throw new Error("I have no rendered view line to set the dom node to...");
  }
  onContentChanged() {
    this._isMaybeInvalid = !0;
  }
  onTokensChanged() {
    this._isMaybeInvalid = !0;
  }
  onDecorationsChanged() {
    this._isMaybeInvalid = !0;
  }
  onOptionsChanged(e) {
    this._isMaybeInvalid = !0, this._options = e;
  }
  onSelectionChanged() {
    var e;
    return am(this._options.themeType) || ((e = this._renderedViewLine) == null ? void 0 : e.input.renderWhitespace) === 2 ? (this._isMaybeInvalid = !0, !0) : !1;
  }
  renderLine(e, t, n, r, s) {
    var _, v, w;
    if (this._options.useGpu && ((_ = this._viewGpuContext) != null && _.canRender(this._options, r, e)))
      return (w = (v = this._renderedViewLine) == null ? void 0 : v.domNode) == null || w.domNode.remove(), this._renderedViewLine = null, !1;
    if (this._isMaybeInvalid === !1)
      return !1;
    this._isMaybeInvalid = !1;
    const o = r.getViewLineRenderingData(e), a = this._options, l = Lc.filter(o.inlineDecorations, e, o.minColumn, o.maxColumn), c = o.hasVariableFonts || a.experimentalWhitespaceRendering === "off" ? a.renderWhitespace : "none", u = !o.hasVariableFonts;
    let d = null;
    if (am(a.themeType) || c === "selection") {
      const E = r.selections;
      for (const L of E) {
        if (L.endLineNumber < e || L.startLineNumber > e)
          continue;
        const T = L.startLineNumber === e ? L.startColumn : o.minColumn, D = L.endLineNumber === e ? L.endColumn : o.maxColumn;
        T < D && (am(a.themeType) && l.push(new Lc(
          T,
          D,
          "inline-selected-text",
          0
          /* InlineDecorationType.Regular */
        )), c === "selection" && (d || (d = []), d.push(new Tt(T - 1, D - 1))));
      }
    }
    const h = new d0(a.useMonospaceOptimizations, a.canUseHalfwidthRightwardsArrow, o.content, o.continuesWithWrappedLine, o.isBasicASCII, o.containsRTL, o.minColumn - 1, o.tokens, l, o.tabSize, o.startVisibleColumn, a.spaceWidth, a.middotWidth, a.wsmiddotWidth, a.stopRenderingLineAfter, c, a.renderControlCharacters, a.fontLigatures !== Yy.OFF, d, o.textDirection, a.verticalScrollbarSize);
    if (this._renderedViewLine && this._renderedViewLine.input.equals(h))
      return !1;
    s.appendString("<div "), o.textDirection === Ph.RTL ? s.appendString('dir="rtl" ') : o.containsRTL && s.appendString('dir="ltr" '), s.appendString('style="top:'), s.appendString(String(t)), s.appendString("px;height:"), s.appendString(String(n)), s.appendString("px;line-height:"), s.appendString(String(n)), o.textDirection === Ph.RTL && (s.appendString("px;padding-right:"), s.appendString(String(a.verticalScrollbarSize))), s.appendString('px;" class="'), s.appendString(Pj.CLASS_NAME), s.appendString('">');
    const g = t2(h, s);
    s.appendString("</div>");
    let m = null;
    return u && ZN && Nct && o.isBasicASCII && h.isLTR && a.useMonospaceOptimizations && g.containsForeignElements === 0 && (m = new P7(this._renderedViewLine ? this._renderedViewLine.domNode : null, h, g.characterMapping)), m || (m = ZFe(this._renderedViewLine ? this._renderedViewLine.domNode : null, h, g.characterMapping, g.containsForeignElements)), this._renderedViewLine = m, !0;
  }
  layoutLine(e, t, n) {
    this._renderedViewLine && this._renderedViewLine.domNode && (this._renderedViewLine.domNode.setTop(t), this._renderedViewLine.domNode.setHeight(n), this._renderedViewLine.domNode.setLineHeight(n));
  }
  // --- end IVisibleLineData
  isRenderedRTL() {
    return this._renderedViewLine ? this._renderedViewLine.input.textDirection === Ph.RTL : !1;
  }
  getWidth(e) {
    return this._renderedViewLine ? this._renderedViewLine.getWidth(e) : 0;
  }
  getWidthIsFast() {
    return this._renderedViewLine ? this._renderedViewLine.getWidthIsFast() : !0;
  }
  needsMonospaceFontCheck() {
    return this._renderedViewLine ? this._renderedViewLine instanceof P7 : !1;
  }
  monospaceAssumptionsAreValid() {
    return this._renderedViewLine && this._renderedViewLine instanceof P7 ? this._renderedViewLine.monospaceAssumptionsAreValid() : ZN;
  }
  onMonospaceAssumptionsInvalidated() {
    this._renderedViewLine && this._renderedViewLine instanceof P7 && (this._renderedViewLine = this._renderedViewLine.toSlowRenderedLine());
  }
  getVisibleRangesForRange(e, t, n, r) {
    if (!this._renderedViewLine)
      return null;
    t = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, t)), n = Math.min(this._renderedViewLine.input.lineContent.length + 1, Math.max(1, n));
    const s = this._renderedViewLine.input.stopRenderingLineAfter;
    if (s !== -1 && t > s + 1 && n > s + 1)
      return new qie(!0, [new k1(this.getWidth(r), 0)]);
    s !== -1 && t > s + 1 && (t = s + 1), s !== -1 && n > s + 1 && (n = s + 1);
    const o = this._renderedViewLine.getVisibleRangesForRange(e, t, n, r);
    return o && o.length > 0 ? new qie(!1, o) : null;
  }
  getColumnOfNodeOffset(e, t) {
    return this._renderedViewLine ? this._renderedViewLine.getColumnOfNodeOffset(e, t) : 1;
  }
};
Pj.CLASS_NAME = "view-line";
let dy = Pj;
class P7 {
  constructor(e, t, n) {
    this._cachedWidth = -1, this.domNode = e, this.input = t;
    const r = Math.floor(
      t.lineContent.length / 300
      /* Constants.MaxMonospaceDistance */
    );
    if (r > 0) {
      this._keyColumnPixelOffsetCache = new Float32Array(r);
      for (let s = 0; s < r; s++)
        this._keyColumnPixelOffsetCache[s] = -1;
    } else
      this._keyColumnPixelOffsetCache = null;
    this._characterMapping = n, this._charWidth = t.spaceWidth;
  }
  getWidth(e) {
    if (!this.domNode || this.input.lineContent.length < 300) {
      const t = this._characterMapping.getHorizontalOffset(this._characterMapping.length);
      return Math.round(this._charWidth * t);
    }
    return this._cachedWidth === -1 && (this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth, e == null || e.markDidDomLayout()), this._cachedWidth;
  }
  getWidthIsFast() {
    return this.input.lineContent.length < 300 || this._cachedWidth !== -1;
  }
  monospaceAssumptionsAreValid() {
    if (!this.domNode)
      return ZN;
    if (this.input.lineContent.length < 300) {
      const e = this.getWidth(null), t = this.domNode.domNode.firstChild.offsetWidth;
      Math.abs(e - t) >= 2 && (console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"), ZN = !1);
    }
    return ZN;
  }
  toSlowRenderedLine() {
    return ZFe(
      this.domNode,
      this.input,
      this._characterMapping,
      0
      /* ForeignElementType.None */
    );
  }
  getVisibleRangesForRange(e, t, n, r) {
    const s = this._getColumnPixelOffset(e, t, r), o = this._getColumnPixelOffset(e, n, r);
    return [new k1(s, o - s)];
  }
  _getColumnPixelOffset(e, t, n) {
    if (t <= 300) {
      const c = this._characterMapping.getHorizontalOffset(t);
      return this._charWidth * c;
    }
    const r = Math.floor(
      (t - 1) / 300
      /* Constants.MaxMonospaceDistance */
    ) - 1, s = (r + 1) * 300 + 1;
    let o = -1;
    if (this._keyColumnPixelOffsetCache && (o = this._keyColumnPixelOffsetCache[r], o === -1 && (o = this._actualReadPixelOffset(e, s, n), this._keyColumnPixelOffsetCache[r] = o)), o === -1) {
      const c = this._characterMapping.getHorizontalOffset(t);
      return this._charWidth * c;
    }
    const a = this._characterMapping.getHorizontalOffset(s), l = this._characterMapping.getHorizontalOffset(t);
    return o + this._charWidth * (l - a);
  }
  _getReadingTarget(e) {
    return e.domNode.firstChild;
  }
  _actualReadPixelOffset(e, t, n) {
    if (!this.domNode)
      return -1;
    const r = this._characterMapping.getDomPosition(t), s = DW.readHorizontalRanges(this._getReadingTarget(this.domNode), r.partIndex, r.charIndex, r.partIndex, r.charIndex, n);
    return !s || s.length === 0 ? -1 : s[0].left;
  }
  getColumnOfNodeOffset(e, t) {
    return y4(this._characterMapping, e, t);
  }
}
class XFe {
  constructor(e, t, n, r) {
    if (this.domNode = e, this.input = t, this._characterMapping = n, this._isWhitespaceOnly = /^\s*$/.test(t.lineContent), this._containsForeignElements = r, this._cachedWidth = -1, this._pixelOffsetCache = null, t.isLTR) {
      this._pixelOffsetCache = new Float32Array(Math.max(2, this._characterMapping.length + 1));
      for (let s = 0, o = this._characterMapping.length; s <= o; s++)
        this._pixelOffsetCache[s] = -1;
    }
  }
  // --- Reading from the DOM methods
  _getReadingTarget(e) {
    return e.domNode.firstChild;
  }
  /**
   * Width of the line in pixels
   */
  getWidth(e) {
    return this.domNode ? (this._cachedWidth === -1 && (this._cachedWidth = this._getReadingTarget(this.domNode).offsetWidth, e == null || e.markDidDomLayout()), this._cachedWidth) : 0;
  }
  getWidthIsFast() {
    return this._cachedWidth !== -1;
  }
  /**
   * Visible ranges for a model range
   */
  getVisibleRangesForRange(e, t, n, r) {
    if (!this.domNode)
      return null;
    if (this._pixelOffsetCache !== null) {
      const s = this._readPixelOffset(this.domNode, e, t, r);
      if (s === -1)
        return null;
      const o = this._readPixelOffset(this.domNode, e, n, r);
      return o === -1 ? null : [new k1(s, o - s)];
    }
    return this._readVisibleRangesForRange(this.domNode, e, t, n, r);
  }
  _readVisibleRangesForRange(e, t, n, r, s) {
    if (n === r) {
      const o = this._readPixelOffset(e, t, n, s);
      return o === -1 ? null : [new k1(o, 0)];
    } else
      return this._readRawVisibleRangesForRange(e, n, r, s);
  }
  _readPixelOffset(e, t, n, r) {
    if (this.input.isLTR && this._characterMapping.length === 0) {
      if (this._containsForeignElements === 0 || this._containsForeignElements === 2)
        return 0;
      if (this._containsForeignElements === 1)
        return this.getWidth(r);
      const s = this._getReadingTarget(e);
      return s.firstChild ? (r.markDidDomLayout(), s.firstChild.offsetWidth) : 0;
    }
    if (this._pixelOffsetCache !== null) {
      const s = this._pixelOffsetCache[n];
      if (s !== -1)
        return s;
      const o = this._actualReadPixelOffset(e, t, n, r);
      return this._pixelOffsetCache[n] = o, o;
    }
    return this._actualReadPixelOffset(e, t, n, r);
  }
  _actualReadPixelOffset(e, t, n, r) {
    if (this._characterMapping.length === 0) {
      const l = DW.readHorizontalRanges(this._getReadingTarget(e), 0, 0, 0, 0, r);
      return !l || l.length === 0 ? -1 : l[0].left;
    }
    if (this.input.isLTR && n === this._characterMapping.length && this._isWhitespaceOnly && this._containsForeignElements === 0)
      return this.getWidth(r);
    const s = this._characterMapping.getDomPosition(n), o = DW.readHorizontalRanges(this._getReadingTarget(e), s.partIndex, s.charIndex, s.partIndex, s.charIndex, r);
    if (!o || o.length === 0)
      return -1;
    const a = o[0].left;
    if (this.input.isBasicASCII) {
      const l = this._characterMapping.getHorizontalOffset(n), c = Math.round(this.input.spaceWidth * l);
      if (Math.abs(c - a) <= 1)
        return c;
    }
    return a;
  }
  _readRawVisibleRangesForRange(e, t, n, r) {
    if (this.input.isLTR && t === 1 && n === this._characterMapping.length)
      return [new k1(0, this.getWidth(r))];
    const s = this._characterMapping.getDomPosition(t), o = this._characterMapping.getDomPosition(n);
    return DW.readHorizontalRanges(this._getReadingTarget(e), s.partIndex, s.charIndex, o.partIndex, o.charIndex, r);
  }
  /**
   * Returns the column for the text found at a specific offset inside a rendered dom node
   */
  getColumnOfNodeOffset(e, t) {
    return y4(this._characterMapping, e, t);
  }
}
class Rct extends XFe {
  _readVisibleRangesForRange(e, t, n, r, s) {
    const o = super._readVisibleRangesForRange(e, t, n, r, s);
    if (!o || o.length === 0 || n === r || n === 1 && r === this._characterMapping.length)
      return o;
    if (this.input.isLTR) {
      const a = this._readPixelOffset(e, t, r, s);
      if (a !== -1) {
        const l = o[o.length - 1];
        l.left < a && (l.width = a - l.left);
      }
    }
    return o;
  }
}
const ZFe = /* @__PURE__ */ (function() {
  return fq ? Act : Oct;
})();
function Act(i, e, t, n) {
  return new Rct(i, e, t, n);
}
function Oct(i, e, t, n) {
  return new XFe(i, e, t, n);
}
function y4(i, e, t) {
  const n = e.textContent.length;
  let r = -1;
  for (; e; )
    e = e.previousSibling, r++;
  return i.getColumn(new KFe(r, t), n);
}
class IC {
  constructor(e = null) {
    this.hitTarget = e, this.type = 0;
  }
}
class QFe {
  get hitTarget() {
    return this.spanNode;
  }
  constructor(e, t, n) {
    this.position = e, this.spanNode = t, this.injectedText = n, this.type = 1;
  }
}
var HE;
(function(i) {
  function e(t, n, r) {
    const s = t.getPositionFromDOMInfo(n, r);
    return s ? new QFe(s, n, null) : new IC(n);
  }
  i.createFromDOMInfo = e;
})(HE || (HE = {}));
class Mct {
  constructor(e, t) {
    this.lastViewCursorsRenderData = e, this.lastTextareaPosition = t;
  }
}
class fl {
  static _deduceRage(e, t = null) {
    return !t && e ? new z(e.lineNumber, e.column, e.lineNumber, e.column) : t ?? null;
  }
  static createUnknown(e, t, n) {
    return { type: 0, element: e, mouseColumn: t, position: n, range: this._deduceRage(n) };
  }
  static createTextarea(e, t) {
    return { type: 1, element: e, mouseColumn: t, position: null, range: null };
  }
  static createMargin(e, t, n, r, s, o) {
    return { type: e, element: t, mouseColumn: n, position: r, range: s, detail: o };
  }
  static createViewZone(e, t, n, r, s) {
    return { type: e, element: t, mouseColumn: n, position: r, range: this._deduceRage(r), detail: s };
  }
  static createContentText(e, t, n, r, s) {
    return { type: 6, element: e, mouseColumn: t, position: n, range: this._deduceRage(n, r), detail: s };
  }
  static createContentEmpty(e, t, n, r) {
    return { type: 7, element: e, mouseColumn: t, position: n, range: this._deduceRage(n), detail: r };
  }
  static createContentWidget(e, t, n) {
    return { type: 9, element: e, mouseColumn: t, position: null, range: null, detail: n };
  }
  static createScrollbar(e, t, n) {
    return { type: 11, element: e, mouseColumn: t, position: n, range: this._deduceRage(n) };
  }
  static createOverlayWidget(e, t, n) {
    return { type: 12, element: e, mouseColumn: t, position: null, range: null, detail: n };
  }
  static createOutsideEditor(e, t, n, r) {
    return { type: 13, element: null, mouseColumn: e, position: t, range: this._deduceRage(t), outsidePosition: n, outsideDistance: r };
  }
  static _typeToString(e) {
    return e === 1 ? "TEXTAREA" : e === 2 ? "GUTTER_GLYPH_MARGIN" : e === 3 ? "GUTTER_LINE_NUMBERS" : e === 4 ? "GUTTER_LINE_DECORATIONS" : e === 5 ? "GUTTER_VIEW_ZONE" : e === 6 ? "CONTENT_TEXT" : e === 7 ? "CONTENT_EMPTY" : e === 8 ? "CONTENT_VIEW_ZONE" : e === 9 ? "CONTENT_WIDGET" : e === 10 ? "OVERVIEW_RULER" : e === 11 ? "SCROLLBAR" : e === 12 ? "OVERLAY_WIDGET" : "UNKNOWN";
  }
  static toString(e) {
    return this._typeToString(e.type) + ": " + e.position + " - " + e.range + " - " + JSON.stringify(e.detail);
  }
}
class Kc {
  static isTextArea(e) {
    return e.length === 2 && e[0] === 3 && e[1] === 7;
  }
  static isChildOfViewLines(e) {
    return e.length >= 4 && e[0] === 3 && e[3] === 8;
  }
  static isStrictChildOfViewLines(e) {
    return e.length > 4 && e[0] === 3 && e[3] === 8;
  }
  static isChildOfScrollableElement(e) {
    return e.length >= 2 && e[0] === 3 && e[1] === 6;
  }
  static isChildOfMinimap(e) {
    return e.length >= 2 && e[0] === 3 && e[1] === 9;
  }
  static isChildOfContentWidgets(e) {
    return e.length >= 4 && e[0] === 3 && e[3] === 1;
  }
  static isChildOfOverflowGuard(e) {
    return e.length >= 1 && e[0] === 3;
  }
  static isChildOfOverflowingContentWidgets(e) {
    return e.length >= 1 && e[0] === 2;
  }
  static isChildOfOverlayWidgets(e) {
    return e.length >= 2 && e[0] === 3 && e[1] === 4;
  }
  static isChildOfOverflowingOverlayWidgets(e) {
    return e.length >= 1 && e[0] === 5;
  }
}
class QR {
  constructor(e, t, n) {
    this.viewModel = e.viewModel;
    const r = e.configuration.options;
    this.layoutInfo = r.get(
      165
      /* EditorOption.layoutInfo */
    ), this.viewDomNode = t.viewDomNode, this.viewLinesGpu = t.viewLinesGpu, this.lineHeight = r.get(
      75
      /* EditorOption.lineHeight */
    ), this.stickyTabStops = r.get(
      132
      /* EditorOption.stickyTabStops */
    ), this.typicalHalfwidthCharacterWidth = r.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth, this.lastRenderData = n, this._context = e, this._viewHelper = t;
  }
  getZoneAtCoord(e) {
    return QR.getZoneAtCoord(this._context, e);
  }
  static getZoneAtCoord(e, t) {
    const n = e.viewLayout.getWhitespaceAtVerticalOffset(t);
    if (n) {
      const r = n.verticalOffset + n.height / 2, s = e.viewModel.getLineCount();
      let o = null, a, l = null;
      return n.afterLineNumber !== s && (l = new de(n.afterLineNumber + 1, 1)), n.afterLineNumber > 0 && (o = new de(n.afterLineNumber, e.viewModel.getLineMaxColumn(n.afterLineNumber))), l === null ? a = o : o === null ? a = l : t < r ? a = o : a = l, {
        viewZoneId: n.id,
        afterLineNumber: n.afterLineNumber,
        positionBefore: o,
        positionAfter: l,
        position: a
      };
    }
    return null;
  }
  getFullLineRangeAtCoord(e) {
    if (this._context.viewLayout.isAfterLines(e)) {
      const r = this._context.viewModel.getLineCount(), s = this._context.viewModel.getLineMaxColumn(r);
      return {
        range: new z(r, s, r, s),
        isAfterLines: !0
      };
    }
    const t = this._context.viewLayout.getLineNumberAtVerticalOffset(e), n = this._context.viewModel.getLineMaxColumn(t);
    return {
      range: new z(t, 1, t, n),
      isAfterLines: !1
    };
  }
  getLineNumberAtVerticalOffset(e) {
    return this._context.viewLayout.getLineNumberAtVerticalOffset(e);
  }
  isAfterLines(e) {
    return this._context.viewLayout.isAfterLines(e);
  }
  isInTopPadding(e) {
    return this._context.viewLayout.isInTopPadding(e);
  }
  isInBottomPadding(e) {
    return this._context.viewLayout.isInBottomPadding(e);
  }
  getVerticalOffsetForLineNumber(e) {
    return this._context.viewLayout.getVerticalOffsetForLineNumber(e);
  }
  findAttribute(e, t) {
    return QR._findAttribute(e, t, this._viewHelper.viewDomNode);
  }
  static _findAttribute(e, t, n) {
    for (; e && e !== e.ownerDocument.body; ) {
      if (e.hasAttribute && e.hasAttribute(t))
        return e.getAttribute(t);
      if (e === n)
        return null;
      e = e.parentNode;
    }
    return null;
  }
  getLineWidth(e) {
    return this._viewHelper.getLineWidth(e);
  }
  isRtl(e) {
    return this.viewModel.getTextDirection(e) === Ph.RTL;
  }
  visibleRangeForPosition(e, t) {
    return this._viewHelper.visibleRangeForPosition(e, t);
  }
  getPositionFromDOMInfo(e, t) {
    return this._viewHelper.getPositionFromDOMInfo(e, t);
  }
  getCurrentScrollTop() {
    return this._context.viewLayout.getCurrentScrollTop();
  }
  getCurrentScrollLeft() {
    return this._context.viewLayout.getCurrentScrollLeft();
  }
}
class Pct {
  constructor(e, t, n, r) {
    this.editorPos = t, this.pos = n, this.relativePos = r, this.mouseVerticalOffset = Math.max(0, e.getCurrentScrollTop() + this.relativePos.y), this.mouseContentHorizontalOffset = e.getCurrentScrollLeft() + this.relativePos.x - e.layoutInfo.contentLeft, this.isInMarginArea = this.relativePos.x < e.layoutInfo.contentLeft && this.relativePos.x >= e.layoutInfo.glyphMarginLeft, this.isInContentArea = !this.isInMarginArea, this.mouseColumn = Math.max(0, _c._getMouseColumn(this.mouseContentHorizontalOffset, e.typicalHalfwidthCharacterWidth));
  }
}
class Fct extends Pct {
  get target() {
    return this._useHitTestTarget ? this.hitTestResult.value.hitTarget : this._eventTarget;
  }
  get targetPath() {
    return this._targetPathCacheElement !== this.target && (this._targetPathCacheElement = this.target, this._targetPathCacheValue = gm.collect(this.target, this._ctx.viewDomNode)), this._targetPathCacheValue;
  }
  constructor(e, t, n, r, s) {
    super(e, t, n, r), this.hitTestResult = new _l(() => _c.doHitTest(this._ctx, this)), this._targetPathCacheElement = null, this._targetPathCacheValue = new Uint8Array(0), this._ctx = e, this._eventTarget = s;
    const o = !!this._eventTarget;
    this._useHitTestTarget = !o;
  }
  toString() {
    return `pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
	target: ${this.target ? this.target.outerHTML : null}`;
  }
  get wouldBenefitFromHitTestTargetSwitch() {
    return !this._useHitTestTarget && this.hitTestResult.value.hitTarget !== null && this.target !== this.hitTestResult.value.hitTarget;
  }
  switchToHitTestTarget() {
    this._useHitTestTarget = !0;
  }
  _getMouseColumn(e = null) {
    return e && e.column < this._ctx.viewModel.getLineMaxColumn(e.lineNumber) ? As.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber), e.column, this._ctx.viewModel.model.getOptions().tabSize) + 1 : this.mouseColumn;
  }
  fulfillUnknown(e = null) {
    return fl.createUnknown(this.target, this._getMouseColumn(e), e);
  }
  fulfillTextarea() {
    return fl.createTextarea(this.target, this._getMouseColumn());
  }
  fulfillMargin(e, t, n, r) {
    return fl.createMargin(e, this.target, this._getMouseColumn(t), t, n, r);
  }
  fulfillViewZone(e, t, n) {
    return fl.createViewZone(e, this.target, this._getMouseColumn(t), t, n);
  }
  fulfillContentText(e, t, n) {
    return fl.createContentText(this.target, this._getMouseColumn(e), e, t, n);
  }
  fulfillContentEmpty(e, t) {
    return fl.createContentEmpty(this.target, this._getMouseColumn(e), e, t);
  }
  fulfillContentWidget(e) {
    return fl.createContentWidget(this.target, this._getMouseColumn(), e);
  }
  fulfillScrollbar(e) {
    return fl.createScrollbar(this.target, this._getMouseColumn(e), e);
  }
  fulfillOverlayWidget(e) {
    return fl.createOverlayWidget(this.target, this._getMouseColumn(), e);
  }
}
const ALe = { isAfterLines: !0 };
function rE(i) {
  return {
    isAfterLines: !1,
    horizontalDistanceToText: i
  };
}
class _c {
  constructor(e, t) {
    this._context = e, this._viewHelper = t;
  }
  mouseTargetIsWidget(e) {
    const t = e.target, n = gm.collect(t, this._viewHelper.viewDomNode);
    return !!(Kc.isChildOfContentWidgets(n) || Kc.isChildOfOverflowingContentWidgets(n) || Kc.isChildOfOverlayWidgets(n) || Kc.isChildOfOverflowingOverlayWidgets(n));
  }
  createMouseTarget(e, t, n, r, s) {
    const o = new QR(this._context, this._viewHelper, e), a = new Fct(o, t, n, r, s);
    try {
      const l = _c._createMouseTarget(o, a);
      if (l.type === 6 && o.stickyTabStops && l.position !== null) {
        const c = _c._snapToSoftTabBoundary(l.position, o.viewModel), u = z.fromPositions(c, c).plusRange(l.range);
        return a.fulfillContentText(c, u, l.detail);
      }
      return l;
    } catch {
      return a.fulfillUnknown();
    }
  }
  static _createMouseTarget(e, t) {
    if (t.target === null)
      return t.fulfillUnknown();
    const n = t;
    let r = null;
    return !Kc.isChildOfOverflowGuard(t.targetPath) && !Kc.isChildOfOverflowingContentWidgets(t.targetPath) && !Kc.isChildOfOverflowingOverlayWidgets(t.targetPath) && (r = r || t.fulfillUnknown()), r = r || _c._hitTestContentWidget(e, n), r = r || _c._hitTestOverlayWidget(e, n), r = r || _c._hitTestMinimap(e, n), r = r || _c._hitTestScrollbarSlider(e, n), r = r || _c._hitTestViewZone(e, n), r = r || _c._hitTestMargin(e, n), r = r || _c._hitTestViewCursor(e, n), r = r || _c._hitTestTextArea(e, n), r = r || _c._hitTestViewLines(e, n), r = r || _c._hitTestScrollbar(e, n), r || t.fulfillUnknown();
  }
  static _hitTestContentWidget(e, t) {
    if (Kc.isChildOfContentWidgets(t.targetPath) || Kc.isChildOfOverflowingContentWidgets(t.targetPath)) {
      const n = e.findAttribute(t.target, "widgetId");
      return n ? t.fulfillContentWidget(n) : t.fulfillUnknown();
    }
    return null;
  }
  static _hitTestOverlayWidget(e, t) {
    if (Kc.isChildOfOverlayWidgets(t.targetPath) || Kc.isChildOfOverflowingOverlayWidgets(t.targetPath)) {
      const n = e.findAttribute(t.target, "widgetId");
      return n ? t.fulfillOverlayWidget(n) : t.fulfillUnknown();
    }
    return null;
  }
  static _hitTestViewCursor(e, t) {
    if (t.target) {
      const n = e.lastRenderData.lastViewCursorsRenderData;
      for (const r of n)
        if (t.target === r.domNode)
          return t.fulfillContentText(r.position, null, { mightBeForeignElement: !1, injectedText: null });
    }
    if (t.isInContentArea) {
      const n = e.lastRenderData.lastViewCursorsRenderData, r = t.mouseContentHorizontalOffset, s = t.mouseVerticalOffset;
      for (const o of n) {
        if (r < o.contentLeft || r > o.contentLeft + o.width)
          continue;
        const a = e.getVerticalOffsetForLineNumber(o.position.lineNumber);
        if (a <= s && s <= a + o.height)
          return t.fulfillContentText(o.position, null, { mightBeForeignElement: !1, injectedText: null });
      }
    }
    return null;
  }
  static _hitTestViewZone(e, t) {
    const n = e.getZoneAtCoord(t.mouseVerticalOffset);
    if (n) {
      const r = t.isInContentArea ? 8 : 5;
      return t.fulfillViewZone(r, n.position, n);
    }
    return null;
  }
  static _hitTestTextArea(e, t) {
    return Kc.isTextArea(t.targetPath) ? e.lastRenderData.lastTextareaPosition ? t.fulfillContentText(e.lastRenderData.lastTextareaPosition, null, { mightBeForeignElement: !1, injectedText: null }) : t.fulfillTextarea() : null;
  }
  static _hitTestMargin(e, t) {
    if (t.isInMarginArea) {
      const n = e.getFullLineRangeAtCoord(t.mouseVerticalOffset), r = n.range.getStartPosition();
      let s = Math.abs(t.relativePos.x);
      const o = {
        isAfterLines: n.isAfterLines,
        glyphMarginLeft: e.layoutInfo.glyphMarginLeft,
        glyphMarginWidth: e.layoutInfo.glyphMarginWidth,
        lineNumbersWidth: e.layoutInfo.lineNumbersWidth,
        offsetX: s
      };
      if (s -= e.layoutInfo.glyphMarginLeft, s <= e.layoutInfo.glyphMarginWidth) {
        const a = e.viewModel.coordinatesConverter.convertViewPositionToModelPosition(n.range.getStartPosition()), l = e.viewModel.glyphLanes.getLanesAtLine(a.lineNumber);
        return o.glyphMarginLane = l[Math.floor(s / e.lineHeight)], t.fulfillMargin(2, r, n.range, o);
      }
      return s -= e.layoutInfo.glyphMarginWidth, s <= e.layoutInfo.lineNumbersWidth ? t.fulfillMargin(3, r, n.range, o) : (s -= e.layoutInfo.lineNumbersWidth, t.fulfillMargin(4, r, n.range, o));
    }
    return null;
  }
  static _hitTestViewLines(e, t) {
    if (!Kc.isChildOfViewLines(t.targetPath))
      return null;
    if (e.isInTopPadding(t.mouseVerticalOffset))
      return t.fulfillContentEmpty(new de(1, 1), ALe);
    if (e.isAfterLines(t.mouseVerticalOffset) || e.isInBottomPadding(t.mouseVerticalOffset)) {
      const r = e.viewModel.getLineCount(), s = e.viewModel.getLineMaxColumn(r);
      return t.fulfillContentEmpty(new de(r, s), ALe);
    }
    if (Kc.isStrictChildOfViewLines(t.targetPath)) {
      const r = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset), s = e.viewModel.getLineLength(r), o = e.getLineWidth(r);
      if (s === 0) {
        const l = rE(t.mouseContentHorizontalOffset - o);
        return t.fulfillContentEmpty(new de(r, 1), l);
      }
      if (e.isRtl(r)) {
        if (t.mouseContentHorizontalOffset + o <= e.layoutInfo.contentWidth - e.layoutInfo.verticalScrollbarWidth) {
          const l = rE(t.mouseContentHorizontalOffset - o), c = new de(r, e.viewModel.getLineMaxColumn(r));
          return t.fulfillContentEmpty(c, l);
        }
      } else if (t.mouseContentHorizontalOffset >= o) {
        const l = rE(t.mouseContentHorizontalOffset - o), c = new de(r, e.viewModel.getLineMaxColumn(r));
        return t.fulfillContentEmpty(c, l);
      }
    } else if (e.viewLinesGpu) {
      const r = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);
      if (e.viewModel.getLineLength(r) === 0) {
        const l = e.getLineWidth(r), c = rE(t.mouseContentHorizontalOffset - l);
        return t.fulfillContentEmpty(new de(r, 1), c);
      }
      const s = e.getLineWidth(r);
      if (e.isRtl(r)) {
        if (t.mouseContentHorizontalOffset + s <= e.layoutInfo.contentWidth - e.layoutInfo.verticalScrollbarWidth) {
          const l = rE(t.mouseContentHorizontalOffset - s), c = new de(r, e.viewModel.getLineMaxColumn(r));
          return t.fulfillContentEmpty(c, l);
        }
      } else if (t.mouseContentHorizontalOffset >= s) {
        const l = rE(t.mouseContentHorizontalOffset - s), c = new de(r, e.viewModel.getLineMaxColumn(r));
        return t.fulfillContentEmpty(c, l);
      }
      const a = e.viewLinesGpu.getPositionAtCoordinate(r, t.mouseContentHorizontalOffset);
      if (a) {
        const l = {
          injectedText: null,
          mightBeForeignElement: !1
        };
        return t.fulfillContentText(a, z.fromPositions(a, a), l);
      }
    }
    const n = t.hitTestResult.value;
    return n.type === 1 ? _c.createMouseTargetFromHitTestPosition(e, t, n.spanNode, n.position, n.injectedText) : t.wouldBenefitFromHitTestTargetSwitch ? (t.switchToHitTestTarget(), this._createMouseTarget(e, t)) : t.fulfillUnknown();
  }
  static _hitTestMinimap(e, t) {
    if (Kc.isChildOfMinimap(t.targetPath)) {
      const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset), r = e.viewModel.getLineMaxColumn(n);
      return t.fulfillScrollbar(new de(n, r));
    }
    return null;
  }
  static _hitTestScrollbarSlider(e, t) {
    if (Kc.isChildOfScrollableElement(t.targetPath) && t.target && t.target.nodeType === 1) {
      const n = t.target.className;
      if (n && /\b(slider|scrollbar)\b/.test(n)) {
        const r = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset), s = e.viewModel.getLineMaxColumn(r);
        return t.fulfillScrollbar(new de(r, s));
      }
    }
    return null;
  }
  static _hitTestScrollbar(e, t) {
    if (Kc.isChildOfScrollableElement(t.targetPath)) {
      const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset), r = e.viewModel.getLineMaxColumn(n);
      return t.fulfillScrollbar(new de(n, r));
    }
    return null;
  }
  getMouseColumn(e) {
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    ), r = this._context.viewLayout.getCurrentScrollLeft() + e.x - n.contentLeft;
    return _c._getMouseColumn(r, t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth);
  }
  static _getMouseColumn(e, t) {
    return e < 0 ? 1 : Math.round(e / t) + 1;
  }
  static createMouseTargetFromHitTestPosition(e, t, n, r, s) {
    const o = r.lineNumber, a = r.column, l = e.getLineWidth(o);
    if (t.mouseContentHorizontalOffset > l) {
      const w = rE(t.mouseContentHorizontalOffset - l);
      return t.fulfillContentEmpty(r, w);
    }
    const c = e.visibleRangeForPosition(o, a);
    if (!c)
      return t.fulfillUnknown(r);
    const u = c.left;
    if (Math.abs(t.mouseContentHorizontalOffset - u) < 1)
      return t.fulfillContentText(r, null, { mightBeForeignElement: !!s, injectedText: s });
    const d = [];
    if (d.push({ offset: c.left, column: a }), a > 1) {
      const w = e.visibleRangeForPosition(o, a - 1);
      w && d.push({ offset: w.left, column: a - 1 });
    }
    const h = e.viewModel.getLineMaxColumn(o);
    if (a < h) {
      const w = e.visibleRangeForPosition(o, a + 1);
      w && d.push({ offset: w.left, column: a + 1 });
    }
    d.sort((w, E) => w.offset - E.offset);
    const g = t.pos.toClientCoordinates(At(e.viewDomNode)), m = n.getBoundingClientRect(), _ = m.left <= g.clientX && g.clientX <= m.right;
    let v = null;
    for (let w = 1; w < d.length; w++) {
      const E = d[w - 1], L = d[w];
      if (E.offset <= t.mouseContentHorizontalOffset && t.mouseContentHorizontalOffset <= L.offset) {
        v = new z(o, E.column, o, L.column);
        const T = Math.abs(E.offset - t.mouseContentHorizontalOffset), D = Math.abs(L.offset - t.mouseContentHorizontalOffset);
        r = T < D ? new de(o, E.column) : new de(o, L.column);
        break;
      }
    }
    return t.fulfillContentText(r, v, { mightBeForeignElement: !_ || !!s, injectedText: s });
  }
  /**
   * Most probably WebKit browsers and Edge
   */
  static _doHitTestWithCaretRangeFromPoint(e, t) {
    const n = e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset), r = e.getVerticalOffsetForLineNumber(n), s = r + e.lineHeight;
    if (!(n === e.viewModel.getLineCount() && t.mouseVerticalOffset > s)) {
      const a = Math.floor((r + s) / 2);
      let l = t.pos.y + (a - t.mouseVerticalOffset);
      l <= t.editorPos.y && (l = t.editorPos.y + 1), l >= t.editorPos.y + t.editorPos.height && (l = t.editorPos.y + t.editorPos.height - 1);
      const c = new EB(t.pos.x, l), u = this._actualDoHitTestWithCaretRangeFromPoint(e, c.toClientCoordinates(At(e.viewDomNode)));
      if (u.type === 1)
        return u;
    }
    return this._actualDoHitTestWithCaretRangeFromPoint(e, t.pos.toClientCoordinates(At(e.viewDomNode)));
  }
  static _actualDoHitTestWithCaretRangeFromPoint(e, t) {
    const n = iw(e.viewDomNode);
    let r;
    if (n ? typeof n.caretRangeFromPoint > "u" ? r = Bct(n, t.clientX, t.clientY) : r = n.caretRangeFromPoint(t.clientX, t.clientY) : r = e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX, t.clientY), !r || !r.startContainer)
      return new IC();
    const s = r.startContainer;
    if (s.nodeType === s.TEXT_NODE) {
      const o = s.parentNode, a = o ? o.parentNode : null, l = a ? a.parentNode : null;
      return (l && l.nodeType === l.ELEMENT_NODE ? l.className : null) === dy.CLASS_NAME ? HE.createFromDOMInfo(e, o, r.startOffset) : new IC(s.parentNode);
    } else if (s.nodeType === s.ELEMENT_NODE) {
      const o = s.parentNode, a = o ? o.parentNode : null;
      return (a && a.nodeType === a.ELEMENT_NODE ? a.className : null) === dy.CLASS_NAME ? HE.createFromDOMInfo(e, s, s.textContent.length) : new IC(s);
    }
    return new IC();
  }
  /**
   * Most probably Gecko
   */
  static _doHitTestWithCaretPositionFromPoint(e, t) {
    const n = e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX, t.clientY);
    if (n.offsetNode.nodeType === n.offsetNode.TEXT_NODE) {
      const r = n.offsetNode.parentNode, s = r ? r.parentNode : null, o = s ? s.parentNode : null;
      return (o && o.nodeType === o.ELEMENT_NODE ? o.className : null) === dy.CLASS_NAME ? HE.createFromDOMInfo(e, n.offsetNode.parentNode, n.offset) : new IC(n.offsetNode.parentNode);
    }
    if (n.offsetNode.nodeType === n.offsetNode.ELEMENT_NODE) {
      const r = n.offsetNode.parentNode, s = r && r.nodeType === r.ELEMENT_NODE ? r.className : null, o = r ? r.parentNode : null, a = o && o.nodeType === o.ELEMENT_NODE ? o.className : null;
      if (s === dy.CLASS_NAME) {
        const l = n.offsetNode.childNodes[Math.min(n.offset, n.offsetNode.childNodes.length - 1)];
        if (l)
          return HE.createFromDOMInfo(e, l, 0);
      } else if (a === dy.CLASS_NAME)
        return HE.createFromDOMInfo(e, n.offsetNode, 0);
    }
    return new IC(n.offsetNode);
  }
  static _snapToSoftTabBoundary(e, t) {
    const n = t.getLineContent(e.lineNumber), { tabSize: r } = t.model.getOptions(), s = a4.atomicPosition(
      n,
      e.column - 1,
      r,
      2
      /* Direction.Nearest */
    );
    return s !== -1 ? new de(e.lineNumber, s + 1) : e;
  }
  static doHitTest(e, t) {
    let n = new IC();
    if (typeof e.viewDomNode.ownerDocument.caretRangeFromPoint == "function" ? n = this._doHitTestWithCaretRangeFromPoint(e, t) : e.viewDomNode.ownerDocument.caretPositionFromPoint && (n = this._doHitTestWithCaretPositionFromPoint(e, t.pos.toClientCoordinates(At(e.viewDomNode)))), n.type === 1) {
      const r = e.viewModel.getInjectedTextAt(n.position), s = e.viewModel.normalizePosition(
        n.position,
        2
        /* PositionAffinity.None */
      );
      (r || !s.equals(n.position)) && (n = new QFe(s, n.spanNode, r));
    }
    return n;
  }
}
function Bct(i, e, t) {
  const n = document.createRange();
  let r = i.elementFromPoint(e, t);
  if (r != null && r.hasChildNodes()) {
    for (; r && r.firstChild && r.firstChild.nodeType !== r.firstChild.TEXT_NODE && r.lastChild && r.lastChild.firstChild; )
      r = r.lastChild;
    const s = r.getBoundingClientRect(), o = At(r), a = o.getComputedStyle(r, null).getPropertyValue("font-style"), l = o.getComputedStyle(r, null).getPropertyValue("font-variant"), c = o.getComputedStyle(r, null).getPropertyValue("font-weight"), u = o.getComputedStyle(r, null).getPropertyValue("font-size"), d = o.getComputedStyle(r, null).getPropertyValue("line-height"), h = o.getComputedStyle(r, null).getPropertyValue("font-family"), g = `${a} ${l} ${c} ${u}/${d} ${h}`, m = r.innerText;
    let _ = s.left, v = 0, w;
    if (e > s.left + s.width)
      v = m.length;
    else {
      const E = Xie.getInstance();
      for (let L = 0; L < m.length + 1; L++) {
        if (w = E.getCharWidth(m.charAt(L), g) / 2, _ += w, e < _) {
          v = L;
          break;
        }
        _ += w;
      }
    }
    n.setStart(r.firstChild, v), n.setEnd(r.firstChild, v);
  }
  return n;
}
const nx = class nx {
  static getInstance() {
    return nx._INSTANCE || (nx._INSTANCE = new nx()), nx._INSTANCE;
  }
  constructor() {
    this._cache = {}, this._canvas = document.createElement("canvas");
  }
  getCharWidth(e, t) {
    const n = e + t;
    if (this._cache[n])
      return this._cache[n];
    const r = this._canvas.getContext("2d");
    r.font = t;
    const o = r.measureText(e).width;
    return this._cache[n] = o, o;
  }
};
nx._INSTANCE = null;
let Xie = nx;
function go(i, e, t) {
  let n = null, r = null;
  if (typeof t.value == "function" ? (n = "value", r = t.value, r.length !== 0 && console.warn("Memoize should only be used in functions with zero parameters")) : typeof t.get == "function" && (n = "get", r = t.get), !r)
    throw new Error("not supported");
  const s = `$memoize$${e}`;
  t[n] = function(...o) {
    return this.hasOwnProperty(s) || Object.defineProperty(this, s, {
      configurable: !1,
      enumerable: !1,
      writable: !1,
      value: r.apply(this, o)
    }), this[s];
  };
}
var Hct = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, zr;
(function(i) {
  i.Tap = "-monaco-gesturetap", i.Change = "-monaco-gesturechange", i.Start = "-monaco-gesturestart", i.End = "-monaco-gesturesend", i.Contextmenu = "-monaco-gesturecontextmenu";
})(zr || (zr = {}));
const cl = class cl extends ge {
  // ms
  constructor() {
    super(), this.dispatched = !1, this.targets = new xc(), this.ignoreTargets = new xc(), this.activeTouches = {}, this.handle = null, this._lastSetTapCountTime = 0, this._register(Ze.runAndSubscribe(vB, ({ window: e, disposables: t }) => {
      t.add(Ce(e.document, "touchstart", (n) => this.onTouchStart(n), { passive: !1 })), t.add(Ce(e.document, "touchend", (n) => this.onTouchEnd(e, n))), t.add(Ce(e.document, "touchmove", (n) => this.onTouchMove(n), { passive: !1 }));
    }, { window: fr, disposables: this._store }));
  }
  static addTarget(e) {
    if (!cl.isTouchDevice())
      return ge.None;
    cl.INSTANCE || (cl.INSTANCE = new cl());
    const t = cl.INSTANCE.targets.push(e);
    return Et(t);
  }
  static ignoreTarget(e) {
    if (!cl.isTouchDevice())
      return ge.None;
    cl.INSTANCE || (cl.INSTANCE = new cl());
    const t = cl.INSTANCE.ignoreTargets.push(e);
    return Et(t);
  }
  static isTouchDevice() {
    return "ontouchstart" in fr || navigator.maxTouchPoints > 0;
  }
  dispose() {
    this.handle && (this.handle.dispose(), this.handle = null), super.dispose();
  }
  onTouchStart(e) {
    const t = Date.now();
    this.handle && (this.handle.dispose(), this.handle = null);
    for (let n = 0, r = e.targetTouches.length; n < r; n++) {
      const s = e.targetTouches.item(n);
      this.activeTouches[s.identifier] = {
        id: s.identifier,
        initialTarget: s.target,
        initialTimeStamp: t,
        initialPageX: s.pageX,
        initialPageY: s.pageY,
        rollingTimestamps: [t],
        rollingPageX: [s.pageX],
        rollingPageY: [s.pageY]
      };
      const o = this.newGestureEvent(zr.Start, s.target);
      o.pageX = s.pageX, o.pageY = s.pageY, this.dispatchEvent(o);
    }
    this.dispatched && (e.preventDefault(), e.stopPropagation(), this.dispatched = !1);
  }
  onTouchEnd(e, t) {
    const n = Date.now(), r = Object.keys(this.activeTouches).length;
    for (let s = 0, o = t.changedTouches.length; s < o; s++) {
      const a = t.changedTouches.item(s);
      if (!this.activeTouches.hasOwnProperty(String(a.identifier))) {
        console.warn("move of an UNKNOWN touch", a);
        continue;
      }
      const l = this.activeTouches[a.identifier], c = Date.now() - l.initialTimeStamp;
      if (c < cl.HOLD_DELAY && Math.abs(l.initialPageX - l.rollingPageX.at(-1)) < 30 && Math.abs(l.initialPageY - l.rollingPageY.at(-1)) < 30) {
        const u = this.newGestureEvent(zr.Tap, l.initialTarget);
        u.pageX = l.rollingPageX.at(-1), u.pageY = l.rollingPageY.at(-1), this.dispatchEvent(u);
      } else if (c >= cl.HOLD_DELAY && Math.abs(l.initialPageX - l.rollingPageX.at(-1)) < 30 && Math.abs(l.initialPageY - l.rollingPageY.at(-1)) < 30) {
        const u = this.newGestureEvent(zr.Contextmenu, l.initialTarget);
        u.pageX = l.rollingPageX.at(-1), u.pageY = l.rollingPageY.at(-1), this.dispatchEvent(u);
      } else if (r === 1) {
        const u = l.rollingPageX.at(-1), d = l.rollingPageY.at(-1), h = l.rollingTimestamps.at(-1) - l.rollingTimestamps[0], g = u - l.rollingPageX[0], m = d - l.rollingPageY[0], _ = [...this.targets].filter((v) => l.initialTarget instanceof Node && v.contains(l.initialTarget));
        this.inertia(
          e,
          _,
          n,
          // time now
          Math.abs(g) / h,
          // speed
          g > 0 ? 1 : -1,
          // x direction
          u,
          // x now
          Math.abs(m) / h,
          // y speed
          m > 0 ? 1 : -1,
          // y direction
          d
          // y now
        );
      }
      this.dispatchEvent(this.newGestureEvent(zr.End, l.initialTarget)), delete this.activeTouches[a.identifier];
    }
    this.dispatched && (t.preventDefault(), t.stopPropagation(), this.dispatched = !1);
  }
  newGestureEvent(e, t) {
    const n = document.createEvent("CustomEvent");
    return n.initEvent(e, !1, !0), n.initialTarget = t, n.tapCount = 0, n;
  }
  dispatchEvent(e) {
    if (e.type === zr.Tap) {
      const t = (/* @__PURE__ */ new Date()).getTime();
      let n = 0;
      t - this._lastSetTapCountTime > cl.CLEAR_TAP_COUNT_TIME ? n = 1 : n = 2, this._lastSetTapCountTime = t, e.tapCount = n;
    } else (e.type === zr.Change || e.type === zr.Contextmenu) && (this._lastSetTapCountTime = 0);
    if (e.initialTarget instanceof Node) {
      for (const n of this.ignoreTargets)
        if (n.contains(e.initialTarget))
          return;
      const t = [];
      for (const n of this.targets)
        if (n.contains(e.initialTarget)) {
          let r = 0, s = e.initialTarget;
          for (; s && s !== n; )
            r++, s = s.parentElement;
          t.push([r, n]);
        }
      t.sort((n, r) => n[0] - r[0]);
      for (const [n, r] of t)
        r.dispatchEvent(e), this.dispatched = !0;
    }
  }
  inertia(e, t, n, r, s, o, a, l, c) {
    this.handle = Ju(e, () => {
      const u = Date.now(), d = u - n;
      let h = 0, g = 0, m = !0;
      r += cl.SCROLL_FRICTION * d, a += cl.SCROLL_FRICTION * d, r > 0 && (m = !1, h = s * r * d), a > 0 && (m = !1, g = l * a * d);
      const _ = this.newGestureEvent(zr.Change);
      _.translationX = h, _.translationY = g, t.forEach((v) => v.dispatchEvent(_)), m || this.inertia(e, t, u, r, s, o + h, a, l, c + g);
    });
  }
  onTouchMove(e) {
    const t = Date.now();
    for (let n = 0, r = e.changedTouches.length; n < r; n++) {
      const s = e.changedTouches.item(n);
      if (!this.activeTouches.hasOwnProperty(String(s.identifier))) {
        console.warn("end of an UNKNOWN touch", s);
        continue;
      }
      const o = this.activeTouches[s.identifier], a = this.newGestureEvent(zr.Change, o.initialTarget);
      a.translationX = s.pageX - o.rollingPageX.at(-1), a.translationY = s.pageY - o.rollingPageY.at(-1), a.pageX = s.pageX, a.pageY = s.pageY, this.dispatchEvent(a), o.rollingPageX.length > 3 && (o.rollingPageX.shift(), o.rollingPageY.shift(), o.rollingTimestamps.shift()), o.rollingPageX.push(s.pageX), o.rollingPageY.push(s.pageY), o.rollingTimestamps.push(t);
    }
    this.dispatched && (e.preventDefault(), e.stopPropagation(), this.dispatched = !1);
  }
};
cl.SCROLL_FRICTION = -5e-3, cl.HOLD_DELAY = 700, cl.CLEAR_TAP_COUNT_TIME = 400;
let ec = cl;
Hct([
  go
], ec, "isTouchDevice", null);
let Xd = class extends ge {
  onclick(e, t) {
    this._register(Ce(e, Xe.CLICK, (n) => t(new vl(At(e), n))));
  }
  onmousedown(e, t) {
    this._register(Ce(e, Xe.MOUSE_DOWN, (n) => t(new vl(At(e), n))));
  }
  onmouseover(e, t) {
    this._register(Ce(e, Xe.MOUSE_OVER, (n) => t(new vl(At(e), n))));
  }
  onmouseleave(e, t) {
    this._register(Ce(e, Xe.MOUSE_LEAVE, (n) => t(new vl(At(e), n))));
  }
  onkeydown(e, t) {
    this._register(Ce(e, Xe.KEY_DOWN, (n) => t(new wr(n))));
  }
  onkeyup(e, t) {
    this._register(Ce(e, Xe.KEY_UP, (n) => t(new wr(n))));
  }
  oninput(e, t) {
    this._register(Ce(e, Xe.INPUT, t));
  }
  onblur(e, t) {
    this._register(Ce(e, Xe.BLUR, t));
  }
  onfocus(e, t) {
    this._register(Ce(e, Xe.FOCUS, t));
  }
  ignoreGesture(e) {
    return ec.ignoreTarget(e);
  }
};
const JR = 11;
class Wct extends Xd {
  constructor(e) {
    super(), this._onActivate = e.onActivate, this.bgDomNode = document.createElement("div"), this.bgDomNode.className = "arrow-background", this.bgDomNode.style.position = "absolute", this.bgDomNode.style.width = e.bgWidth + "px", this.bgDomNode.style.height = e.bgHeight + "px", typeof e.top < "u" && (this.bgDomNode.style.top = "0px"), typeof e.left < "u" && (this.bgDomNode.style.left = "0px"), typeof e.bottom < "u" && (this.bgDomNode.style.bottom = "0px"), typeof e.right < "u" && (this.bgDomNode.style.right = "0px"), this.domNode = document.createElement("div"), this.domNode.className = e.className, this.domNode.classList.add(...qt.asClassNameArray(e.icon)), this.domNode.style.position = "absolute", this.domNode.style.width = JR + "px", this.domNode.style.height = JR + "px", typeof e.top < "u" && (this.domNode.style.top = e.top + "px"), typeof e.left < "u" && (this.domNode.style.left = e.left + "px"), typeof e.bottom < "u" && (this.domNode.style.bottom = e.bottom + "px"), typeof e.right < "u" && (this.domNode.style.right = e.right + "px"), this._pointerMoveMonitor = this._register(new JA()), this._register(vo(this.bgDomNode, Xe.POINTER_DOWN, (t) => this._arrowPointerDown(t))), this._register(vo(this.domNode, Xe.POINTER_DOWN, (t) => this._arrowPointerDown(t))), this._pointerdownRepeatTimer = this._register(new yq()), this._pointerdownScheduleRepeatTimer = this._register(new Gh());
  }
  _arrowPointerDown(e) {
    if (!e.target || !(e.target instanceof Element))
      return;
    const t = () => {
      this._pointerdownRepeatTimer.cancelAndSet(() => this._onActivate(), 1e3 / 24, At(e));
    };
    this._onActivate(), this._pointerdownRepeatTimer.cancel(), this._pointerdownScheduleRepeatTimer.cancelAndSet(t, 200), this._pointerMoveMonitor.startMonitoring(e.target, e.pointerId, e.buttons, (n) => {
    }, () => {
      this._pointerdownRepeatTimer.cancel(), this._pointerdownScheduleRepeatTimer.cancel();
    }), e.preventDefault();
  }
}
class Vct extends ge {
  constructor(e, t, n) {
    super(), this._visibility = e, this._visibleClassName = t, this._invisibleClassName = n, this._domNode = null, this._isVisible = !1, this._isNeeded = !1, this._rawShouldBeVisible = !1, this._shouldBeVisible = !1, this._revealTimer = this._register(new Gh());
  }
  setVisibility(e) {
    this._visibility !== e && (this._visibility = e, this._updateShouldBeVisible());
  }
  // ----------------- Hide / Reveal
  setShouldBeVisible(e) {
    this._rawShouldBeVisible = e, this._updateShouldBeVisible();
  }
  _applyVisibilitySetting() {
    return this._visibility === 2 ? !1 : this._visibility === 3 ? !0 : this._rawShouldBeVisible;
  }
  _updateShouldBeVisible() {
    const e = this._applyVisibilitySetting();
    this._shouldBeVisible !== e && (this._shouldBeVisible = e, this.ensureVisibility());
  }
  setIsNeeded(e) {
    this._isNeeded !== e && (this._isNeeded = e, this.ensureVisibility());
  }
  setDomNode(e) {
    this._domNode = e, this._domNode.setClassName(this._invisibleClassName), this.setShouldBeVisible(!1);
  }
  ensureVisibility() {
    if (!this._isNeeded) {
      this._hide(!1);
      return;
    }
    this._shouldBeVisible ? this._reveal() : this._hide(!0);
  }
  _reveal() {
    this._isVisible || (this._isVisible = !0, this._revealTimer.setIfNotSet(() => {
      var e;
      (e = this._domNode) == null || e.setClassName(this._visibleClassName);
    }, 0));
  }
  _hide(e) {
    var t;
    this._revealTimer.cancel(), this._isVisible && (this._isVisible = !1, (t = this._domNode) == null || t.setClassName(this._invisibleClassName + (e ? " fade" : "")));
  }
}
const Uct = 140;
class JFe extends Xd {
  constructor(e) {
    super(), this._lazyRender = e.lazyRender, this._host = e.host, this._scrollable = e.scrollable, this._scrollByPage = e.scrollByPage, this._scrollbarState = e.scrollbarState, this._visibilityController = this._register(new Vct(e.visibility, "visible scrollbar " + e.extraScrollbarClassName, "invisible scrollbar " + e.extraScrollbarClassName)), this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._pointerMoveMonitor = this._register(new JA()), this._shouldRender = !0, this.domNode = Gi(document.createElement("div")), this.domNode.setAttribute("role", "presentation"), this.domNode.setAttribute("aria-hidden", "true"), this._visibilityController.setDomNode(this.domNode), this.domNode.setPosition("absolute"), this._register(Ce(this.domNode.domNode, Xe.POINTER_DOWN, (t) => this._domNodePointerDown(t)));
  }
  // ----------------- creation
  /**
   * Creates the dom node for an arrow & adds it to the container
   */
  _createArrow(e) {
    const t = this._register(new Wct(e));
    this.domNode.domNode.appendChild(t.bgDomNode), this.domNode.domNode.appendChild(t.domNode);
  }
  /**
   * Creates the slider dom node, adds it to the container & hooks up the events
   */
  _createSlider(e, t, n, r) {
    this.slider = Gi(document.createElement("div")), this.slider.setClassName("slider"), this.slider.setPosition("absolute"), this.slider.setTop(e), this.slider.setLeft(t), typeof n == "number" && this.slider.setWidth(n), typeof r == "number" && this.slider.setHeight(r), this.slider.setLayerHinting(!0), this.slider.setContain("strict"), this.domNode.domNode.appendChild(this.slider.domNode), this._register(Ce(this.slider.domNode, Xe.POINTER_DOWN, (s) => {
      s.button === 0 && (s.preventDefault(), this._sliderPointerDown(s));
    })), this.onclick(this.slider.domNode, (s) => {
      s.leftButton && s.stopPropagation();
    });
  }
  // ----------------- Update state
  _onElementSize(e) {
    return this._scrollbarState.setVisibleSize(e) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = !0, this._lazyRender || this.render()), this._shouldRender;
  }
  _onElementScrollSize(e) {
    return this._scrollbarState.setScrollSize(e) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = !0, this._lazyRender || this.render()), this._shouldRender;
  }
  _onElementScrollPosition(e) {
    return this._scrollbarState.setScrollPosition(e) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = !0, this._lazyRender || this.render()), this._shouldRender;
  }
  // ----------------- rendering
  beginReveal() {
    this._visibilityController.setShouldBeVisible(!0);
  }
  beginHide() {
    this._visibilityController.setShouldBeVisible(!1);
  }
  render() {
    this._shouldRender && (this._shouldRender = !1, this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize()), this._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition()));
  }
  // ----------------- DOM events
  _domNodePointerDown(e) {
    e.target === this.domNode.domNode && this._onPointerDown(e);
  }
  delegatePointerDown(e) {
    const t = this.domNode.domNode.getClientRects()[0].top, n = t + this._scrollbarState.getSliderPosition(), r = t + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize(), s = this._sliderPointerPosition(e);
    n <= s && s <= r ? e.button === 0 && (e.preventDefault(), this._sliderPointerDown(e)) : this._onPointerDown(e);
  }
  _onPointerDown(e) {
    let t, n;
    if (e.target === this.domNode.domNode && typeof e.offsetX == "number" && typeof e.offsetY == "number")
      t = e.offsetX, n = e.offsetY;
    else {
      const o = ho(this.domNode.domNode);
      t = e.pageX - o.left, n = e.pageY - o.top;
    }
    const r = e.pointerType === "mouse", s = e.button === 0;
    if (s || !r) {
      const o = this._pointerDownRelativePosition(t, n);
      this._setDesiredScrollPositionNow(this._scrollByPage ? this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(o) : this._scrollbarState.getDesiredScrollPositionFromOffset(o));
    }
    s && (e.preventDefault(), this._sliderPointerDown(e));
  }
  _sliderPointerDown(e) {
    if (!e.target || !(e.target instanceof Element))
      return;
    const t = this._sliderPointerPosition(e), n = this._sliderOrthogonalPointerPosition(e), r = this._scrollbarState.clone();
    this.slider.toggleClassName("active", !0), this._pointerMoveMonitor.startMonitoring(e.target, e.pointerId, e.buttons, (s) => {
      const o = this._sliderOrthogonalPointerPosition(s), a = Math.abs(o - n);
      if (Za && a > Uct) {
        this._setDesiredScrollPositionNow(r.getScrollPosition());
        return;
      }
      const c = this._sliderPointerPosition(s) - t;
      this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c));
    }, () => {
      this.slider.toggleClassName("active", !1), this._host.onDragEnd();
    }), this._host.onDragStart();
  }
  _setDesiredScrollPositionNow(e) {
    const t = {};
    this.writeScrollPosition(t, e), this._scrollable.setScrollPositionNow(t);
  }
  updateScrollbarSize(e) {
    this._updateScrollbarSize(e), this._scrollbarState.setScrollbarSize(e), this._shouldRender = !0, this._lazyRender || this.render();
  }
  isNeeded() {
    return this._scrollbarState.isNeeded();
  }
}
const zct = 20;
class eA {
  constructor(e, t, n, r, s, o) {
    this._scrollbarSize = Math.round(t), this._oppositeScrollbarSize = Math.round(n), this._arrowSize = Math.round(e), this._visibleSize = r, this._scrollSize = s, this._scrollPosition = o, this._computedAvailableSize = 0, this._computedIsNeeded = !1, this._computedSliderSize = 0, this._computedSliderRatio = 0, this._computedSliderPosition = 0, this._refreshComputedValues();
  }
  clone() {
    return new eA(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition);
  }
  setVisibleSize(e) {
    const t = Math.round(e);
    return this._visibleSize !== t ? (this._visibleSize = t, this._refreshComputedValues(), !0) : !1;
  }
  setScrollSize(e) {
    const t = Math.round(e);
    return this._scrollSize !== t ? (this._scrollSize = t, this._refreshComputedValues(), !0) : !1;
  }
  setScrollPosition(e) {
    const t = Math.round(e);
    return this._scrollPosition !== t ? (this._scrollPosition = t, this._refreshComputedValues(), !0) : !1;
  }
  setScrollbarSize(e) {
    this._scrollbarSize = Math.round(e);
  }
  setOppositeScrollbarSize(e) {
    this._oppositeScrollbarSize = Math.round(e);
  }
  static _computeValues(e, t, n, r, s) {
    const o = Math.max(0, n - e), a = Math.max(0, o - 2 * t), l = r > 0 && r > n;
    if (!l)
      return {
        computedAvailableSize: Math.round(o),
        computedIsNeeded: l,
        computedSliderSize: Math.round(a),
        computedSliderRatio: 0,
        computedSliderPosition: 0
      };
    const c = Math.round(Math.max(zct, Math.floor(n * a / r))), u = (a - c) / (r - n), d = s * u;
    return {
      computedAvailableSize: Math.round(o),
      computedIsNeeded: l,
      computedSliderSize: Math.round(c),
      computedSliderRatio: u,
      computedSliderPosition: Math.round(d)
    };
  }
  _refreshComputedValues() {
    const e = eA._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition);
    this._computedAvailableSize = e.computedAvailableSize, this._computedIsNeeded = e.computedIsNeeded, this._computedSliderSize = e.computedSliderSize, this._computedSliderRatio = e.computedSliderRatio, this._computedSliderPosition = e.computedSliderPosition;
  }
  getArrowSize() {
    return this._arrowSize;
  }
  getScrollPosition() {
    return this._scrollPosition;
  }
  getRectangleLargeSize() {
    return this._computedAvailableSize;
  }
  getRectangleSmallSize() {
    return this._scrollbarSize;
  }
  isNeeded() {
    return this._computedIsNeeded;
  }
  getSliderSize() {
    return this._computedSliderSize;
  }
  getSliderPosition() {
    return this._computedSliderPosition;
  }
  /**
   * Compute a desired `scrollPosition` such that `offset` ends up in the center of the slider.
   * `offset` is based on the same coordinate system as the `sliderPosition`.
   */
  getDesiredScrollPositionFromOffset(e) {
    if (!this._computedIsNeeded)
      return 0;
    const t = e - this._arrowSize - this._computedSliderSize / 2;
    return Math.round(t / this._computedSliderRatio);
  }
  /**
   * Compute a desired `scrollPosition` from if offset is before or after the slider position.
   * If offset is before slider, treat as a page up (or left).  If after, page down (or right).
   * `offset` and `_computedSliderPosition` are based on the same coordinate system.
   * `_visibleSize` corresponds to a "page" of lines in the returned coordinate system.
   */
  getDesiredScrollPositionFromOffsetPaged(e) {
    if (!this._computedIsNeeded)
      return 0;
    const t = e - this._arrowSize;
    let n = this._scrollPosition;
    return t < this._computedSliderPosition ? n -= this._visibleSize : n += this._visibleSize, n;
  }
  /**
   * Compute a desired `scrollPosition` such that the slider moves by `delta`.
   */
  getDesiredScrollPositionFromDelta(e) {
    if (!this._computedIsNeeded)
      return 0;
    const t = this._computedSliderPosition + e;
    return Math.round(t / this._computedSliderRatio);
  }
}
class $ct extends JFe {
  constructor(e, t, n) {
    const r = e.getScrollDimensions(), s = e.getCurrentScrollPosition();
    if (super({
      lazyRender: t.lazyRender,
      host: n,
      scrollbarState: new eA(t.horizontalHasArrows ? t.arrowSize : 0, t.horizontal === 2 ? 0 : t.horizontalScrollbarSize, t.vertical === 2 ? 0 : t.verticalScrollbarSize, r.width, r.scrollWidth, s.scrollLeft),
      visibility: t.horizontal,
      extraScrollbarClassName: "horizontal",
      scrollable: e,
      scrollByPage: t.scrollByPage
    }), t.horizontalHasArrows) {
      const o = (t.arrowSize - JR) / 2, a = (t.horizontalScrollbarSize - JR) / 2;
      this._createArrow({
        className: "scra",
        icon: Pe.scrollbarButtonLeft,
        top: a,
        left: o,
        bottom: void 0,
        right: void 0,
        bgWidth: t.arrowSize,
        bgHeight: t.horizontalScrollbarSize,
        onActivate: () => this._host.onMouseWheel(new QL(null, 1, 0))
      }), this._createArrow({
        className: "scra",
        icon: Pe.scrollbarButtonRight,
        top: a,
        left: void 0,
        bottom: void 0,
        right: o,
        bgWidth: t.arrowSize,
        bgHeight: t.horizontalScrollbarSize,
        onActivate: () => this._host.onMouseWheel(new QL(null, -1, 0))
      });
    }
    this._createSlider(Math.floor((t.horizontalScrollbarSize - t.horizontalSliderSize) / 2), 0, void 0, t.horizontalSliderSize);
  }
  _updateSlider(e, t) {
    this.slider.setWidth(e), this.slider.setLeft(t);
  }
  _renderDomNode(e, t) {
    this.domNode.setWidth(e), this.domNode.setHeight(t), this.domNode.setLeft(0), this.domNode.setBottom(0);
  }
  onDidScroll(e) {
    return this._shouldRender = this._onElementScrollSize(e.scrollWidth) || this._shouldRender, this._shouldRender = this._onElementScrollPosition(e.scrollLeft) || this._shouldRender, this._shouldRender = this._onElementSize(e.width) || this._shouldRender, this._shouldRender;
  }
  _pointerDownRelativePosition(e, t) {
    return e;
  }
  _sliderPointerPosition(e) {
    return e.pageX;
  }
  _sliderOrthogonalPointerPosition(e) {
    return e.pageY;
  }
  _updateScrollbarSize(e) {
    this.slider.setHeight(e);
  }
  writeScrollPosition(e, t) {
    e.scrollLeft = t;
  }
  updateOptions(e) {
    this.updateScrollbarSize(e.horizontal === 2 ? 0 : e.horizontalScrollbarSize), this._scrollbarState.setOppositeScrollbarSize(e.vertical === 2 ? 0 : e.verticalScrollbarSize), this._visibilityController.setVisibility(e.horizontal), this._scrollByPage = e.scrollByPage;
  }
}
class jct extends JFe {
  constructor(e, t, n) {
    const r = e.getScrollDimensions(), s = e.getCurrentScrollPosition();
    if (super({
      lazyRender: t.lazyRender,
      host: n,
      scrollbarState: new eA(
        t.verticalHasArrows ? t.arrowSize : 0,
        t.vertical === 2 ? 0 : t.verticalScrollbarSize,
        // give priority to vertical scroll bar over horizontal and let it scroll all the way to the bottom
        0,
        r.height,
        r.scrollHeight,
        s.scrollTop
      ),
      visibility: t.vertical,
      extraScrollbarClassName: "vertical",
      scrollable: e,
      scrollByPage: t.scrollByPage
    }), t.verticalHasArrows) {
      const o = (t.arrowSize - JR) / 2, a = (t.verticalScrollbarSize - JR) / 2;
      this._createArrow({
        className: "scra",
        icon: Pe.scrollbarButtonUp,
        top: o,
        left: a,
        bottom: void 0,
        right: void 0,
        bgWidth: t.verticalScrollbarSize,
        bgHeight: t.arrowSize,
        onActivate: () => this._host.onMouseWheel(new QL(null, 0, 1))
      }), this._createArrow({
        className: "scra",
        icon: Pe.scrollbarButtonDown,
        top: void 0,
        left: a,
        bottom: o,
        right: void 0,
        bgWidth: t.verticalScrollbarSize,
        bgHeight: t.arrowSize,
        onActivate: () => this._host.onMouseWheel(new QL(null, 0, -1))
      });
    }
    this._createSlider(0, Math.floor((t.verticalScrollbarSize - t.verticalSliderSize) / 2), t.verticalSliderSize, void 0);
  }
  _updateSlider(e, t) {
    this.slider.setHeight(e), this.slider.setTop(t);
  }
  _renderDomNode(e, t) {
    this.domNode.setWidth(t), this.domNode.setHeight(e), this.domNode.setRight(0), this.domNode.setTop(0);
  }
  onDidScroll(e) {
    return this._shouldRender = this._onElementScrollSize(e.scrollHeight) || this._shouldRender, this._shouldRender = this._onElementScrollPosition(e.scrollTop) || this._shouldRender, this._shouldRender = this._onElementSize(e.height) || this._shouldRender, this._shouldRender;
  }
  _pointerDownRelativePosition(e, t) {
    return t;
  }
  _sliderPointerPosition(e) {
    return e.pageY;
  }
  _sliderOrthogonalPointerPosition(e) {
    return e.pageX;
  }
  _updateScrollbarSize(e) {
    this.slider.setWidth(e);
  }
  writeScrollPosition(e, t) {
    e.scrollTop = t;
  }
  updateOptions(e) {
    this.updateScrollbarSize(e.vertical === 2 ? 0 : e.verticalScrollbarSize), this._scrollbarState.setOppositeScrollbarSize(0), this._visibilityController.setVisibility(e.vertical), this._scrollByPage = e.scrollByPage;
  }
}
class rU {
  constructor(e, t, n, r, s, o, a) {
    this._forceIntegerValues = e, this._scrollStateBrand = void 0, this._forceIntegerValues && (t = t | 0, n = n | 0, r = r | 0, s = s | 0, o = o | 0, a = a | 0), this.rawScrollLeft = r, this.rawScrollTop = a, t < 0 && (t = 0), r + t > n && (r = n - t), r < 0 && (r = 0), s < 0 && (s = 0), a + s > o && (a = o - s), a < 0 && (a = 0), this.width = t, this.scrollWidth = n, this.scrollLeft = r, this.height = s, this.scrollHeight = o, this.scrollTop = a;
  }
  equals(e) {
    return this.rawScrollLeft === e.rawScrollLeft && this.rawScrollTop === e.rawScrollTop && this.width === e.width && this.scrollWidth === e.scrollWidth && this.scrollLeft === e.scrollLeft && this.height === e.height && this.scrollHeight === e.scrollHeight && this.scrollTop === e.scrollTop;
  }
  withScrollDimensions(e, t) {
    return new rU(this._forceIntegerValues, typeof e.width < "u" ? e.width : this.width, typeof e.scrollWidth < "u" ? e.scrollWidth : this.scrollWidth, t ? this.rawScrollLeft : this.scrollLeft, typeof e.height < "u" ? e.height : this.height, typeof e.scrollHeight < "u" ? e.scrollHeight : this.scrollHeight, t ? this.rawScrollTop : this.scrollTop);
  }
  withScrollPosition(e) {
    return new rU(this._forceIntegerValues, this.width, this.scrollWidth, typeof e.scrollLeft < "u" ? e.scrollLeft : this.rawScrollLeft, this.height, this.scrollHeight, typeof e.scrollTop < "u" ? e.scrollTop : this.rawScrollTop);
  }
  createScrollEvent(e, t) {
    const n = this.width !== e.width, r = this.scrollWidth !== e.scrollWidth, s = this.scrollLeft !== e.scrollLeft, o = this.height !== e.height, a = this.scrollHeight !== e.scrollHeight, l = this.scrollTop !== e.scrollTop;
    return {
      inSmoothScrolling: t,
      oldWidth: e.width,
      oldScrollWidth: e.scrollWidth,
      oldScrollLeft: e.scrollLeft,
      width: this.width,
      scrollWidth: this.scrollWidth,
      scrollLeft: this.scrollLeft,
      oldHeight: e.height,
      oldScrollHeight: e.scrollHeight,
      oldScrollTop: e.scrollTop,
      height: this.height,
      scrollHeight: this.scrollHeight,
      scrollTop: this.scrollTop,
      widthChanged: n,
      scrollWidthChanged: r,
      scrollLeftChanged: s,
      heightChanged: o,
      scrollHeightChanged: a,
      scrollTopChanged: l
    };
  }
}
class n2 extends ge {
  constructor(e) {
    super(), this._scrollableBrand = void 0, this._onScroll = this._register(new he()), this.onScroll = this._onScroll.event, this._smoothScrollDuration = e.smoothScrollDuration, this._scheduleAtNextAnimationFrame = e.scheduleAtNextAnimationFrame, this._state = new rU(e.forceIntegerValues, 0, 0, 0, 0, 0, 0), this._smoothScrolling = null;
  }
  dispose() {
    this._smoothScrolling && (this._smoothScrolling.dispose(), this._smoothScrolling = null), super.dispose();
  }
  setSmoothScrollDuration(e) {
    this._smoothScrollDuration = e;
  }
  validateScrollPosition(e) {
    return this._state.withScrollPosition(e);
  }
  getScrollDimensions() {
    return this._state;
  }
  setScrollDimensions(e, t) {
    var r;
    const n = this._state.withScrollDimensions(e, t);
    this._setState(n, !!this._smoothScrolling), (r = this._smoothScrolling) == null || r.acceptScrollDimensions(this._state);
  }
  /**
   * Returns the final scroll position that the instance will have once the smooth scroll animation concludes.
   * If no scroll animation is occurring, it will return the current scroll position instead.
   */
  getFutureScrollPosition() {
    return this._smoothScrolling ? this._smoothScrolling.to : this._state;
  }
  /**
   * Returns the current scroll position.
   * Note: This result might be an intermediate scroll position, as there might be an ongoing smooth scroll animation.
   */
  getCurrentScrollPosition() {
    return this._state;
  }
  setScrollPositionNow(e) {
    const t = this._state.withScrollPosition(e);
    this._smoothScrolling && (this._smoothScrolling.dispose(), this._smoothScrolling = null), this._setState(t, !1);
  }
  setScrollPositionSmooth(e, t) {
    if (this._smoothScrollDuration === 0)
      return this.setScrollPositionNow(e);
    if (this._smoothScrolling) {
      e = {
        scrollLeft: typeof e.scrollLeft > "u" ? this._smoothScrolling.to.scrollLeft : e.scrollLeft,
        scrollTop: typeof e.scrollTop > "u" ? this._smoothScrolling.to.scrollTop : e.scrollTop
      };
      const n = this._state.withScrollPosition(e);
      if (this._smoothScrolling.to.scrollLeft === n.scrollLeft && this._smoothScrolling.to.scrollTop === n.scrollTop)
        return;
      let r;
      t ? r = new C4(this._smoothScrolling.from, n, this._smoothScrolling.startTime, this._smoothScrolling.duration) : r = this._smoothScrolling.combine(this._state, n, this._smoothScrollDuration), this._smoothScrolling.dispose(), this._smoothScrolling = r;
    } else {
      const n = this._state.withScrollPosition(e);
      this._smoothScrolling = C4.start(this._state, n, this._smoothScrollDuration);
    }
    this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
      this._smoothScrolling && (this._smoothScrolling.animationFrameDisposable = null, this._performSmoothScrolling());
    });
  }
  hasPendingScrollAnimation() {
    return !!this._smoothScrolling;
  }
  _performSmoothScrolling() {
    if (!this._smoothScrolling)
      return;
    const e = this._smoothScrolling.tick(), t = this._state.withScrollPosition(e);
    if (this._setState(t, !0), !!this._smoothScrolling) {
      if (e.isDone) {
        this._smoothScrolling.dispose(), this._smoothScrolling = null;
        return;
      }
      this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
        this._smoothScrolling && (this._smoothScrolling.animationFrameDisposable = null, this._performSmoothScrolling());
      });
    }
  }
  _setState(e, t) {
    const n = this._state;
    n.equals(e) || (this._state = e, this._onScroll.fire(this._state.createScrollEvent(n, t)));
  }
}
class OLe {
  constructor(e, t, n) {
    this.scrollLeft = e, this.scrollTop = t, this.isDone = n;
  }
}
function tee(i, e) {
  const t = e - i;
  return function(n) {
    return i + t * Kct(n);
  };
}
function Gct(i, e, t) {
  return function(n) {
    return n < t ? i(n / t) : e((n - t) / (1 - t));
  };
}
class C4 {
  constructor(e, t, n, r) {
    this.from = e, this.to = t, this.duration = r, this.startTime = n, this.animationFrameDisposable = null, this._initAnimations();
  }
  _initAnimations() {
    this.scrollLeft = this._initAnimation(this.from.scrollLeft, this.to.scrollLeft, this.to.width), this.scrollTop = this._initAnimation(this.from.scrollTop, this.to.scrollTop, this.to.height);
  }
  _initAnimation(e, t, n) {
    if (Math.abs(e - t) > 2.5 * n) {
      let s, o;
      return e < t ? (s = e + 0.75 * n, o = t - 0.75 * n) : (s = e - 0.75 * n, o = t + 0.75 * n), Gct(tee(e, s), tee(o, t), 0.33);
    }
    return tee(e, t);
  }
  dispose() {
    this.animationFrameDisposable !== null && (this.animationFrameDisposable.dispose(), this.animationFrameDisposable = null);
  }
  acceptScrollDimensions(e) {
    this.to = e.withScrollPosition(this.to), this._initAnimations();
  }
  tick() {
    return this._tick(Date.now());
  }
  _tick(e) {
    const t = (e - this.startTime) / this.duration;
    if (t < 1) {
      const n = this.scrollLeft(t), r = this.scrollTop(t);
      return new OLe(n, r, !1);
    }
    return new OLe(this.to.scrollLeft, this.to.scrollTop, !0);
  }
  combine(e, t, n) {
    return C4.start(e, t, n);
  }
  static start(e, t, n) {
    n = n + 10;
    const r = Date.now() - 10;
    return new C4(e, t, r, n);
  }
}
function qct(i) {
  return Math.pow(i, 3);
}
function Kct(i) {
  return 1 - qct(1 - i);
}
const Yct = 500, MLe = 50;
class Xct {
  constructor(e, t, n) {
    this.timestamp = e, this.deltaX = t, this.deltaY = n, this.score = 0;
  }
}
const Fj = class Fj {
  constructor() {
    this._capacity = 5, this._memory = [], this._front = -1, this._rear = -1;
  }
  isPhysicalMouseWheel() {
    if (this._front === -1 && this._rear === -1)
      return !1;
    let e = 1, t = 0, n = 1, r = this._rear;
    do {
      const s = r === this._front ? e : Math.pow(2, -n);
      if (e -= s, t += this._memory[r].score * s, r === this._front)
        break;
      r = (this._capacity + r - 1) % this._capacity, n++;
    } while (!0);
    return t <= 0.5;
  }
  acceptStandardWheelEvent(e) {
    if (uB) {
      const t = At(e.browserEvent), n = Gne(t);
      this.accept(Date.now(), e.deltaX * n, e.deltaY * n);
    } else
      this.accept(Date.now(), e.deltaX, e.deltaY);
  }
  accept(e, t, n) {
    let r = null;
    const s = new Xct(e, t, n);
    this._front === -1 && this._rear === -1 ? (this._memory[0] = s, this._front = 0, this._rear = 0) : (r = this._memory[this._rear], this._rear = (this._rear + 1) % this._capacity, this._rear === this._front && (this._front = (this._front + 1) % this._capacity), this._memory[this._rear] = s), s.score = this._computeScore(s, r);
  }
  /**
   * A score between 0 and 1 for `item`.
   *  - a score towards 0 indicates that the source appears to be a physical mouse wheel
   *  - a score towards 1 indicates that the source appears to be a touchpad or magic mouse, etc.
   */
  _computeScore(e, t) {
    if (Math.abs(e.deltaX) > 0 && Math.abs(e.deltaY) > 0)
      return 1;
    let n = 0.5;
    if ((!this._isAlmostInt(e.deltaX) || !this._isAlmostInt(e.deltaY)) && (n += 0.25), t) {
      const r = Math.abs(e.deltaX), s = Math.abs(e.deltaY), o = Math.abs(t.deltaX), a = Math.abs(t.deltaY), l = Math.max(Math.min(r, o), 1), c = Math.max(Math.min(s, a), 1), u = Math.max(r, o), d = Math.max(s, a);
      u % l === 0 && d % c === 0 && (n -= 0.5);
    }
    return Math.min(Math.max(n, 0), 1);
  }
  _isAlmostInt(e) {
    const t = Number.EPSILON * 100;
    return Math.abs(Math.round(e) - e) < 0.01 + t;
  }
};
Fj.INSTANCE = new Fj();
let sU = Fj;
class Nfe extends Xd {
  get onScroll() {
    return this._onScroll.event;
  }
  get options() {
    return this._options;
  }
  constructor(e, t, n) {
    super(), this._inertialTimeout = null, this._inertialSpeed = { X: 0, Y: 0 }, this._onScroll = this._register(new he()), this._onWillScroll = this._register(new he()), e.style.overflow = "hidden", this._options = Zct(t), this._scrollable = n, this._register(this._scrollable.onScroll((s) => {
      this._onWillScroll.fire(s), this._onDidScroll(s), this._onScroll.fire(s);
    }));
    const r = {
      onMouseWheel: (s) => this._onMouseWheel(s),
      onDragStart: () => this._onDragStart(),
      onDragEnd: () => this._onDragEnd()
    };
    this._verticalScrollbar = this._register(new jct(this._scrollable, this._options, r)), this._horizontalScrollbar = this._register(new $ct(this._scrollable, this._options, r)), this._domNode = document.createElement("div"), this._domNode.className = "monaco-scrollable-element " + this._options.className, this._domNode.setAttribute("role", "presentation"), this._domNode.style.position = "relative", this._domNode.style.overflow = "hidden", this._domNode.appendChild(e), this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode), this._domNode.appendChild(this._verticalScrollbar.domNode.domNode), this._options.useShadows ? (this._leftShadowDomNode = Gi(document.createElement("div")), this._leftShadowDomNode.setClassName("shadow"), this._domNode.appendChild(this._leftShadowDomNode.domNode), this._topShadowDomNode = Gi(document.createElement("div")), this._topShadowDomNode.setClassName("shadow"), this._domNode.appendChild(this._topShadowDomNode.domNode), this._topLeftShadowDomNode = Gi(document.createElement("div")), this._topLeftShadowDomNode.setClassName("shadow"), this._domNode.appendChild(this._topLeftShadowDomNode.domNode)) : (this._leftShadowDomNode = null, this._topShadowDomNode = null, this._topLeftShadowDomNode = null), this._listenOnDomNode = this._options.listenOnDomNode || this._domNode, this._mouseWheelToDispose = [], this._setListeningToMouseWheel(this._options.handleMouseWheel), this.onmouseover(this._listenOnDomNode, (s) => this._onMouseOver(s)), this.onmouseleave(this._listenOnDomNode, (s) => this._onMouseLeave(s)), this._hideTimeout = this._register(new Gh()), this._isDragging = !1, this._mouseIsOver = !1, this._shouldRender = !0, this._revealOnScroll = !0;
  }
  dispose() {
    this._mouseWheelToDispose = or(this._mouseWheelToDispose), this._inertialTimeout && (this._inertialTimeout.dispose(), this._inertialTimeout = null), super.dispose();
  }
  /**
   * Get the generated 'scrollable' dom node
   */
  getDomNode() {
    return this._domNode;
  }
  getOverviewRulerLayoutInfo() {
    return {
      parent: this._domNode,
      insertBefore: this._verticalScrollbar.domNode.domNode
    };
  }
  /**
   * Delegate a pointer down event to the vertical scrollbar.
   * This is to help with clicking somewhere else and having the scrollbar react.
   */
  delegateVerticalScrollbarPointerDown(e) {
    this._verticalScrollbar.delegatePointerDown(e);
  }
  getScrollDimensions() {
    return this._scrollable.getScrollDimensions();
  }
  setScrollDimensions(e) {
    this._scrollable.setScrollDimensions(e, !1);
  }
  /**
   * Update the class name of the scrollable element.
   */
  updateClassName(e) {
    this._options.className = e, Kn && (this._options.className += " mac"), this._domNode.className = "monaco-scrollable-element " + this._options.className;
  }
  /**
   * Update configuration options for the scrollbar.
   */
  updateOptions(e) {
    typeof e.handleMouseWheel < "u" && (this._options.handleMouseWheel = e.handleMouseWheel, this._setListeningToMouseWheel(this._options.handleMouseWheel)), typeof e.mouseWheelScrollSensitivity < "u" && (this._options.mouseWheelScrollSensitivity = e.mouseWheelScrollSensitivity), typeof e.fastScrollSensitivity < "u" && (this._options.fastScrollSensitivity = e.fastScrollSensitivity), typeof e.scrollPredominantAxis < "u" && (this._options.scrollPredominantAxis = e.scrollPredominantAxis), typeof e.horizontal < "u" && (this._options.horizontal = e.horizontal), typeof e.vertical < "u" && (this._options.vertical = e.vertical), typeof e.horizontalScrollbarSize < "u" && (this._options.horizontalScrollbarSize = e.horizontalScrollbarSize), typeof e.verticalScrollbarSize < "u" && (this._options.verticalScrollbarSize = e.verticalScrollbarSize), typeof e.scrollByPage < "u" && (this._options.scrollByPage = e.scrollByPage), this._horizontalScrollbar.updateOptions(this._options), this._verticalScrollbar.updateOptions(this._options), this._options.lazyRender || this._render();
  }
  delegateScrollFromMouseWheelEvent(e) {
    this._onMouseWheel(new QL(e));
  }
  async _periodicSync() {
    var t;
    let e = !1;
    (this._inertialSpeed.X !== 0 || this._inertialSpeed.Y !== 0) && (this._scrollable.setScrollPositionNow({
      scrollTop: this._scrollable.getCurrentScrollPosition().scrollTop - this._inertialSpeed.Y * 100,
      scrollLeft: this._scrollable.getCurrentScrollPosition().scrollLeft - this._inertialSpeed.X * 100
    }), this._inertialSpeed.X *= 0.9, this._inertialSpeed.Y *= 0.9, Math.abs(this._inertialSpeed.X) < 0.01 && (this._inertialSpeed.X = 0), Math.abs(this._inertialSpeed.Y) < 0.01 && (this._inertialSpeed.Y = 0), e = this._inertialSpeed.X !== 0 || this._inertialSpeed.Y !== 0), e ? (this._inertialTimeout || (this._inertialTimeout = new Gh()), this._inertialTimeout.cancelAndSet(() => this._periodicSync(), 1e3 / 60)) : ((t = this._inertialTimeout) == null || t.dispose(), this._inertialTimeout = null);
  }
  // -------------------- mouse wheel scrolling --------------------
  _setListeningToMouseWheel(e) {
    if (this._mouseWheelToDispose.length > 0 !== e && (this._mouseWheelToDispose = or(this._mouseWheelToDispose), e)) {
      const n = (r) => {
        this._onMouseWheel(new QL(r));
      };
      this._mouseWheelToDispose.push(Ce(this._listenOnDomNode, Xe.MOUSE_WHEEL, n, { passive: !1 }));
    }
  }
  _onMouseWheel(e) {
    var s;
    if ((s = e.browserEvent) != null && s.defaultPrevented)
      return;
    const t = sU.INSTANCE;
    t.acceptStandardWheelEvent(e);
    let n = !1;
    if (e.deltaY || e.deltaX) {
      let o = e.deltaY * this._options.mouseWheelScrollSensitivity, a = e.deltaX * this._options.mouseWheelScrollSensitivity;
      this._options.scrollPredominantAxis && (this._options.scrollYToX && a + o === 0 ? a = o = 0 : Math.abs(o) >= Math.abs(a) ? a = 0 : o = 0), this._options.flipAxes && ([o, a] = [a, o]);
      const l = !Kn && e.browserEvent && e.browserEvent.shiftKey;
      (this._options.scrollYToX || l) && !a && (a = o, o = 0), e.browserEvent && e.browserEvent.altKey && (a = a * this._options.fastScrollSensitivity, o = o * this._options.fastScrollSensitivity);
      const c = this._scrollable.getFutureScrollPosition();
      let u = {};
      if (o) {
        const d = MLe * o, h = c.scrollTop - (d < 0 ? Math.floor(d) : Math.ceil(d));
        this._verticalScrollbar.writeScrollPosition(u, h);
      }
      if (a) {
        const d = MLe * a, h = c.scrollLeft - (d < 0 ? Math.floor(d) : Math.ceil(d));
        this._horizontalScrollbar.writeScrollPosition(u, h);
      }
      if (u = this._scrollable.validateScrollPosition(u), this._options.inertialScroll && (a || o)) {
        let d = !1;
        this._inertialSpeed.X === 0 && this._inertialSpeed.Y === 0 && (d = !0), this._inertialSpeed.Y = (o < 0 ? -1 : 1) * Math.abs(o) ** 1.02, this._inertialSpeed.X = (a < 0 ? -1 : 1) * Math.abs(a) ** 1.02, d && this._periodicSync();
      }
      (c.scrollLeft !== u.scrollLeft || c.scrollTop !== u.scrollTop) && (this._options.mouseWheelSmoothScroll && t.isPhysicalMouseWheel() ? this._scrollable.setScrollPositionSmooth(u) : this._scrollable.setScrollPositionNow(u), n = !0);
    }
    let r = n;
    !r && this._options.alwaysConsumeMouseWheel && (r = !0), !r && this._options.consumeMouseWheelIfScrollbarIsNeeded && (this._verticalScrollbar.isNeeded() || this._horizontalScrollbar.isNeeded()) && (r = !0), r && (e.preventDefault(), e.stopPropagation());
  }
  _onDidScroll(e) {
    this._shouldRender = this._horizontalScrollbar.onDidScroll(e) || this._shouldRender, this._shouldRender = this._verticalScrollbar.onDidScroll(e) || this._shouldRender, this._options.useShadows && (this._shouldRender = !0), this._revealOnScroll && this._reveal(), this._options.lazyRender || this._render();
  }
  /**
   * Render / mutate the DOM now.
   * Should be used together with the ctor option `lazyRender`.
   */
  renderNow() {
    if (!this._options.lazyRender)
      throw new Error("Please use `lazyRender` together with `renderNow`!");
    this._render();
  }
  _render() {
    if (this._shouldRender && (this._shouldRender = !1, this._horizontalScrollbar.render(), this._verticalScrollbar.render(), this._options.useShadows)) {
      const e = this._scrollable.getCurrentScrollPosition(), t = e.scrollTop > 0, n = e.scrollLeft > 0, r = n ? " left" : "", s = t ? " top" : "", o = n || t ? " top-left-corner" : "";
      this._leftShadowDomNode.setClassName(`shadow${r}`), this._topShadowDomNode.setClassName(`shadow${s}`), this._topLeftShadowDomNode.setClassName(`shadow${o}${s}${r}`);
    }
  }
  // -------------------- fade in / fade out --------------------
  _onDragStart() {
    this._isDragging = !0, this._reveal();
  }
  _onDragEnd() {
    this._isDragging = !1, this._hide();
  }
  _onMouseLeave(e) {
    this._mouseIsOver = !1, this._hide();
  }
  _onMouseOver(e) {
    this._mouseIsOver = !0, this._reveal();
  }
  _reveal() {
    this._verticalScrollbar.beginReveal(), this._horizontalScrollbar.beginReveal(), this._scheduleHide();
  }
  _hide() {
    !this._mouseIsOver && !this._isDragging && (this._verticalScrollbar.beginHide(), this._horizontalScrollbar.beginHide());
  }
  _scheduleHide() {
    !this._mouseIsOver && !this._isDragging && this._hideTimeout.cancelAndSet(() => this._hide(), Yct);
  }
}
class e3e extends Nfe {
  constructor(e, t) {
    t = t || {}, t.mouseWheelSmoothScroll = !1;
    const n = new n2({
      forceIntegerValues: !0,
      smoothScrollDuration: 0,
      scheduleAtNextAnimationFrame: (r) => Ju(At(e), r)
    });
    super(e, t, n), this._register(n);
  }
  setScrollPosition(e) {
    this._scrollable.setScrollPositionNow(e);
  }
}
class eK extends Nfe {
  constructor(e, t, n) {
    super(e, t, n);
  }
  setScrollPosition(e) {
    e.reuseAnimation ? this._scrollable.setScrollPositionSmooth(e, e.reuseAnimation) : this._scrollable.setScrollPositionNow(e);
  }
  getScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
}
class LB extends Nfe {
  constructor(e, t) {
    t = t || {}, t.mouseWheelSmoothScroll = !1;
    const n = new n2({
      forceIntegerValues: !1,
      // See https://github.com/microsoft/vscode/issues/139877
      smoothScrollDuration: 0,
      scheduleAtNextAnimationFrame: (r) => Ju(At(e), r)
    });
    super(e, t, n), this._register(n), this._element = e, this._register(this.onScroll((r) => {
      r.scrollTopChanged && (this._element.scrollTop = r.scrollTop), r.scrollLeftChanged && (this._element.scrollLeft = r.scrollLeft);
    })), this.scanDomNode();
  }
  setScrollPosition(e) {
    this._scrollable.setScrollPositionNow(e);
  }
  getScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
  scanDomNode() {
    this.setScrollDimensions({
      width: this._element.clientWidth,
      scrollWidth: this._element.scrollWidth,
      height: this._element.clientHeight,
      scrollHeight: this._element.scrollHeight
    }), this.setScrollPosition({
      scrollLeft: this._element.scrollLeft,
      scrollTop: this._element.scrollTop
    });
  }
}
function Zct(i) {
  const e = {
    lazyRender: typeof i.lazyRender < "u" ? i.lazyRender : !1,
    className: typeof i.className < "u" ? i.className : "",
    useShadows: typeof i.useShadows < "u" ? i.useShadows : !0,
    handleMouseWheel: typeof i.handleMouseWheel < "u" ? i.handleMouseWheel : !0,
    flipAxes: typeof i.flipAxes < "u" ? i.flipAxes : !1,
    consumeMouseWheelIfScrollbarIsNeeded: typeof i.consumeMouseWheelIfScrollbarIsNeeded < "u" ? i.consumeMouseWheelIfScrollbarIsNeeded : !1,
    alwaysConsumeMouseWheel: typeof i.alwaysConsumeMouseWheel < "u" ? i.alwaysConsumeMouseWheel : !1,
    scrollYToX: typeof i.scrollYToX < "u" ? i.scrollYToX : !1,
    mouseWheelScrollSensitivity: typeof i.mouseWheelScrollSensitivity < "u" ? i.mouseWheelScrollSensitivity : 1,
    fastScrollSensitivity: typeof i.fastScrollSensitivity < "u" ? i.fastScrollSensitivity : 5,
    scrollPredominantAxis: typeof i.scrollPredominantAxis < "u" ? i.scrollPredominantAxis : !0,
    mouseWheelSmoothScroll: typeof i.mouseWheelSmoothScroll < "u" ? i.mouseWheelSmoothScroll : !0,
    inertialScroll: typeof i.inertialScroll < "u" ? i.inertialScroll : !1,
    arrowSize: typeof i.arrowSize < "u" ? i.arrowSize : 11,
    listenOnDomNode: typeof i.listenOnDomNode < "u" ? i.listenOnDomNode : null,
    horizontal: typeof i.horizontal < "u" ? i.horizontal : 1,
    horizontalScrollbarSize: typeof i.horizontalScrollbarSize < "u" ? i.horizontalScrollbarSize : 10,
    horizontalSliderSize: typeof i.horizontalSliderSize < "u" ? i.horizontalSliderSize : 0,
    horizontalHasArrows: typeof i.horizontalHasArrows < "u" ? i.horizontalHasArrows : !1,
    vertical: typeof i.vertical < "u" ? i.vertical : 1,
    verticalScrollbarSize: typeof i.verticalScrollbarSize < "u" ? i.verticalScrollbarSize : 10,
    verticalHasArrows: typeof i.verticalHasArrows < "u" ? i.verticalHasArrows : !1,
    verticalSliderSize: typeof i.verticalSliderSize < "u" ? i.verticalSliderSize : 0,
    scrollByPage: typeof i.scrollByPage < "u" ? i.scrollByPage : !1
  };
  return e.horizontalSliderSize = typeof i.horizontalSliderSize < "u" ? i.horizontalSliderSize : e.horizontalScrollbarSize, e.verticalSliderSize = typeof i.verticalSliderSize < "u" ? i.verticalSliderSize : e.verticalScrollbarSize, Kn && (e.className += " mac"), e;
}
class t3e extends ge {
  constructor(e, t, n, r) {
    super(), this._context = e, this._viewHelper = t, this._mouseTargetFactory = n, this._dispatchMouse = r, this._operation = null;
  }
  dispose() {
    super.dispose(), this.stop();
  }
  start(e, t) {
    this._operation ? this._operation.setPosition(e, t) : this._operation = this._createDragScrollingOperation(e, t);
  }
  stop() {
    this._operation && (this._operation.dispose(), this._operation = null);
  }
}
class n3e extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._context = e, this._viewHelper = t, this._mouseTargetFactory = n, this._dispatchMouse = r, this._position = s, this._mouseEvent = o, this._lastTime = Date.now(), this._animationFrameDisposable = Ju(At(o.browserEvent), () => this._execute());
  }
  dispose() {
    this._animationFrameDisposable.dispose(), super.dispose();
  }
  setPosition(e, t) {
    this._position = e, this._mouseEvent = t;
  }
  /**
   * update internal state and return elapsed ms since last time
   */
  _tick() {
    const e = Date.now(), t = e - this._lastTime;
    return this._lastTime = e, t;
  }
}
class Qct extends t3e {
  _createDragScrollingOperation(e, t) {
    return new Jct(this._context, this._viewHelper, this._mouseTargetFactory, this._dispatchMouse, e, t);
  }
}
class Jct extends n3e {
  /**
   * get the number of lines per second to auto-scroll
   */
  _getScrollSpeed() {
    const e = this._context.configuration.options.get(
      75
      /* EditorOption.lineHeight */
    ), t = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ).height / e, n = this._position.outsideDistance / e;
    return n <= 1.5 ? Math.max(30, t * (1 + n)) : n <= 3 ? Math.max(60, t * (2 + n)) : Math.max(200, t * (7 + n));
  }
  _execute() {
    const e = this._context.configuration.options.get(
      75
      /* EditorOption.lineHeight */
    ), t = this._getScrollSpeed(), n = this._tick(), r = t * (n / 1e3) * e, s = this._position.outsidePosition === "above" ? -r : r;
    this._context.viewModel.viewLayout.deltaScrollNow(0, s), this._viewHelper.renderNow();
    const o = this._context.viewLayout.getLinesViewportData(), a = this._position.outsidePosition === "above" ? o.startLineNumber : o.endLineNumber;
    let l;
    {
      const c = Zq(this._viewHelper.viewDomNode), u = this._context.configuration.options.get(
        165
        /* EditorOption.layoutInfo */
      ).horizontalScrollbarHeight, d = new EB(this._mouseEvent.pos.x, c.y + c.height - u - 0.1), h = Qq(this._viewHelper.viewDomNode, c, d);
      l = this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(), c, d, h, null);
    }
    (!l.position || l.position.lineNumber !== a) && (this._position.outsidePosition === "above" ? l = fl.createOutsideEditor(this._position.mouseColumn, new de(a, 1), "above", this._position.outsideDistance) : l = fl.createOutsideEditor(this._position.mouseColumn, new de(a, this._context.viewModel.getLineMaxColumn(a)), "below", this._position.outsideDistance)), this._dispatchMouse(
      l,
      !0,
      2
      /* NavigationCommandRevealType.None */
    ), this._animationFrameDisposable = Ju(At(l.element), () => this._execute());
  }
}
class eut extends t3e {
  _createDragScrollingOperation(e, t) {
    return new tut(this._context, this._viewHelper, this._mouseTargetFactory, this._dispatchMouse, e, t);
  }
}
class tut extends n3e {
  /**
   * get the number of cols per second to auto-scroll
   */
  _getScrollSpeed() {
    const e = this._context.configuration.options.get(
      59
      /* EditorOption.fontInfo */
    ).typicalFullwidthCharacterWidth, t = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ).contentWidth / e, n = this._position.outsideDistance / e;
    return n <= 1.5 ? Math.max(30, t * (1 + n)) : n <= 3 ? Math.max(60, t * (2 + n)) : Math.max(200, t * (7 + n));
  }
  _execute() {
    const e = this._context.configuration.options.get(
      59
      /* EditorOption.fontInfo */
    ).typicalFullwidthCharacterWidth, t = this._getScrollSpeed(), n = this._tick(), r = t * (n / 1e3) * e * 0.5, s = this._position.outsidePosition === "left" ? -r : r;
    if (this._context.viewModel.viewLayout.deltaScrollNow(s, 0), this._viewHelper.renderNow(), !this._position.position)
      return;
    const o = this._position.position.lineNumber;
    let a;
    {
      const l = Zq(this._viewHelper.viewDomNode), c = this._context.configuration.options.get(
        165
        /* EditorOption.layoutInfo */
      ).horizontalScrollbarHeight, u = new EB(this._mouseEvent.pos.x, l.y + l.height - c - 0.1), d = Qq(this._viewHelper.viewDomNode, l, u);
      a = this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(), l, u, d, null);
    }
    this._position.outsidePosition === "left" ? a = fl.createOutsideEditor(a.mouseColumn, new de(o, a.mouseColumn), "left", this._position.outsideDistance) : a = fl.createOutsideEditor(a.mouseColumn, new de(o, a.mouseColumn), "right", this._position.outsideDistance), this._dispatchMouse(
      a,
      !0,
      2
      /* NavigationCommandRevealType.None */
    ), this._animationFrameDisposable = Ju(At(a.element), () => this._execute());
  }
}
class Rfe extends YT {
  constructor(e, t, n) {
    super(), this._mouseLeaveMonitor = null, this._context = e, this.viewController = t, this.viewHelper = n, this.mouseTargetFactory = new _c(this._context, n), this._mouseDownOperation = this._register(new nut(this._context, this.viewController, this.viewHelper, this.mouseTargetFactory, (o, a) => this._createMouseTarget(o, a), (o) => this._getMouseColumn(o))), this.lastMouseLeaveTime = -1, this._height = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ).height;
    const r = new dct(this.viewHelper.viewDomNode);
    this._register(r.onContextMenu(this.viewHelper.viewDomNode, (o) => this._onContextMenu(o, !0))), this._register(r.onMouseMove(this.viewHelper.viewDomNode, (o) => {
      this._onMouseMove(o), this._mouseLeaveMonitor || (this._mouseLeaveMonitor = Ce(this.viewHelper.viewDomNode.ownerDocument, "mousemove", (a) => {
        this.viewHelper.viewDomNode.contains(a.target) || this._onMouseLeave(new Zy(a, !1, this.viewHelper.viewDomNode));
      }));
    })), this._register(r.onMouseUp(this.viewHelper.viewDomNode, (o) => this._onMouseUp(o))), this._register(r.onMouseLeave(this.viewHelper.viewDomNode, (o) => this._onMouseLeave(o)));
    let s = 0;
    this._register(r.onPointerDown(this.viewHelper.viewDomNode, (o, a) => {
      s = a;
    })), this._register(Ce(this.viewHelper.viewDomNode, Xe.POINTER_UP, (o) => {
      this._mouseDownOperation.onPointerUp();
    })), this._register(r.onMouseDown(this.viewHelper.viewDomNode, (o) => this._onMouseDown(o, s))), this._setupMouseWheelZoomListener(), this._context.addEventHandler(this);
  }
  _setupMouseWheelZoomListener() {
    const e = sU.INSTANCE;
    let t = 0, n = Of.getZoomLevel(), r = !1, s = 0;
    const o = (l) => {
      if (this.viewController.emitMouseWheel(l), !this._context.configuration.options.get(
        84
        /* EditorOption.mouseWheelZoom */
      ))
        return;
      const c = new QL(l);
      if (e.acceptStandardWheelEvent(c), e.isPhysicalMouseWheel()) {
        if (a(l)) {
          const u = Of.getZoomLevel(), d = c.deltaY > 0 ? 1 : -1;
          Of.setZoomLevel(u + d), c.preventDefault(), c.stopPropagation();
        }
      } else
        Date.now() - t > 50 && (n = Of.getZoomLevel(), r = a(l), s = 0), t = Date.now(), s += c.deltaY, r && (Of.setZoomLevel(n + s / 5), c.preventDefault(), c.stopPropagation());
    };
    this._register(Ce(this.viewHelper.viewDomNode, Xe.MOUSE_WHEEL, o, { capture: !0, passive: !1 }));
    function a(l) {
      return Kn ? (l.metaKey || l.ctrlKey) && !l.shiftKey && !l.altKey : l.ctrlKey && !l.metaKey && !l.shiftKey && !l.altKey;
    }
  }
  dispose() {
    this._context.removeEventHandler(this), this._mouseLeaveMonitor && (this._mouseLeaveMonitor.dispose(), this._mouseLeaveMonitor = null), super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    if (e.hasChanged(
      165
      /* EditorOption.layoutInfo */
    )) {
      const t = this._context.configuration.options.get(
        165
        /* EditorOption.layoutInfo */
      ).height;
      this._height !== t && (this._height = t, this._mouseDownOperation.onHeightChanged());
    }
    return !1;
  }
  onCursorStateChanged(e) {
    return this._mouseDownOperation.onCursorStateChanged(e), !1;
  }
  onFocusChanged(e) {
    return !1;
  }
  // --- end event handlers
  getTargetAtClientPoint(e, t) {
    const r = new jFe(e, t).toPageCoordinates(At(this.viewHelper.viewDomNode)), s = Zq(this.viewHelper.viewDomNode);
    if (r.y < s.y || r.y > s.y + s.height || r.x < s.x || r.x > s.x + s.width)
      return null;
    const o = Qq(this.viewHelper.viewDomNode, s, r);
    return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), s, r, o, null);
  }
  _createMouseTarget(e, t) {
    let n = e.target;
    if (!this.viewHelper.viewDomNode.contains(n)) {
      const r = iw(this.viewHelper.viewDomNode);
      r && (n = r.elementsFromPoint(e.posx, e.posy).find((s) => this.viewHelper.viewDomNode.contains(s)));
    }
    return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, e.relativePos, t ? n : null);
  }
  _getMouseColumn(e) {
    return this.mouseTargetFactory.getMouseColumn(e.relativePos);
  }
  _onContextMenu(e, t) {
    this.viewController.emitContextMenu({
      event: e,
      target: this._createMouseTarget(e, t)
    });
  }
  _onMouseMove(e) {
    this.mouseTargetFactory.mouseTargetIsWidget(e) || e.preventDefault(), !(this._mouseDownOperation.isActive() || e.timestamp < this.lastMouseLeaveTime) && this.viewController.emitMouseMove({
      event: e,
      target: this._createMouseTarget(e, !0)
    });
  }
  _onMouseLeave(e) {
    this._mouseLeaveMonitor && (this._mouseLeaveMonitor.dispose(), this._mouseLeaveMonitor = null), this.lastMouseLeaveTime = (/* @__PURE__ */ new Date()).getTime(), this.viewController.emitMouseLeave({
      event: e,
      target: null
    });
  }
  _onMouseUp(e) {
    this.viewController.emitMouseUp({
      event: e,
      target: this._createMouseTarget(e, !0)
    });
  }
  _onMouseDown(e, t) {
    const n = this._createMouseTarget(e, !0), r = n.type === 6 || n.type === 7, s = n.type === 2 || n.type === 3 || n.type === 4, o = n.type === 3, a = this._context.configuration.options.get(
      125
      /* EditorOption.selectOnLineNumbers */
    ), l = n.type === 8 || n.type === 5, c = n.type === 9;
    let u = e.leftButton || e.middleButton;
    Kn && e.leftButton && e.ctrlKey && (u = !1);
    const d = () => {
      e.preventDefault(), this.viewHelper.focusTextArea();
    };
    if (u && (r || o && a))
      d(), this._mouseDownOperation.start(n.type, e, t);
    else if (s)
      e.preventDefault();
    else if (l) {
      const h = n.detail;
      u && this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId) && (d(), this._mouseDownOperation.start(n.type, e, t), e.preventDefault());
    } else c && this.viewHelper.shouldSuppressMouseDownOnWidget(n.detail) && (d(), e.preventDefault());
    this.viewController.emitMouseDown({
      event: e,
      target: n
    });
  }
}
class nut extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._context = e, this._viewController = t, this._viewHelper = n, this._mouseTargetFactory = r, this._createMouseTarget = s, this._getMouseColumn = o, this._mouseMoveMonitor = this._register(new fct(this._viewHelper.viewDomNode)), this._topBottomDragScrolling = this._register(new Qct(this._context, this._viewHelper, this._mouseTargetFactory, (a, l, c) => this._dispatchMouse(a, l, c))), this._leftRightDragScrolling = this._register(new eut(this._context, this._viewHelper, this._mouseTargetFactory, (a, l, c) => this._dispatchMouse(a, l, c))), this._mouseState = new Zie(), this._currentSelection = new bt(1, 1, 1, 1), this._isActive = !1, this._lastMouseEvent = null;
  }
  dispose() {
    super.dispose();
  }
  isActive() {
    return this._isActive;
  }
  _onMouseDownThenMove(e) {
    this._lastMouseEvent = e, this._mouseState.setModifiers(e);
    const t = this._findMousePosition(e, !1);
    t && (this._mouseState.isDragAndDrop ? this._viewController.emitMouseDrag({
      event: e,
      target: t
    }) : t.type === 13 ? t.outsidePosition === "above" || t.outsidePosition === "below" ? (this._topBottomDragScrolling.start(t, e), this._leftRightDragScrolling.stop()) : (this._leftRightDragScrolling.start(t, e), this._topBottomDragScrolling.stop()) : (this._topBottomDragScrolling.stop(), this._leftRightDragScrolling.stop(), this._dispatchMouse(
      t,
      !0,
      1
      /* NavigationCommandRevealType.Minimal */
    )));
  }
  start(e, t, n) {
    this._lastMouseEvent = t, this._mouseState.setStartedOnLineNumbers(
      e === 3
      /* MouseTargetType.GUTTER_LINE_NUMBERS */
    ), this._mouseState.setStartButtons(t), this._mouseState.setModifiers(t);
    const r = this._findMousePosition(t, !0);
    if (!r || !r.position)
      return;
    this._mouseState.trySetCount(t.detail, r.position), t.detail = this._mouseState.count;
    const s = this._context.configuration.options;
    if (!s.get(
      104
      /* EditorOption.readOnly */
    ) && s.get(
      42
      /* EditorOption.dragAndDrop */
    ) && !s.get(
      28
      /* EditorOption.columnSelection */
    ) && !this._mouseState.altKey && t.detail < 2 && !this._isActive && !this._currentSelection.isEmpty() && r.type === 6 && r.position && this._currentSelection.containsPosition(r.position)) {
      this._mouseState.isDragAndDrop = !0, this._isActive = !0, this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode, n, t.buttons, (o) => this._onMouseDownThenMove(o), (o) => {
        const a = this._findMousePosition(this._lastMouseEvent, !1);
        sy(o) ? this._viewController.emitMouseDropCanceled() : this._viewController.emitMouseDrop({
          event: this._lastMouseEvent,
          target: a ? this._createMouseTarget(this._lastMouseEvent, !0) : null
          // Ignoring because position is unknown, e.g., Content View Zone
        }), this._stop();
      });
      return;
    }
    this._mouseState.isDragAndDrop = !1, this._dispatchMouse(
      r,
      t.shiftKey,
      1
      /* NavigationCommandRevealType.Minimal */
    ), this._isActive || (this._isActive = !0, this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode, n, t.buttons, (o) => this._onMouseDownThenMove(o), () => this._stop()));
  }
  _stop() {
    this._isActive = !1, this._topBottomDragScrolling.stop(), this._leftRightDragScrolling.stop();
  }
  onHeightChanged() {
    this._mouseMoveMonitor.stopMonitoring();
  }
  onPointerUp() {
    this._mouseMoveMonitor.stopMonitoring();
  }
  onCursorStateChanged(e) {
    this._currentSelection = e.selections[0];
  }
  _getPositionOutsideEditor(e) {
    const t = e.editorPos, n = this._context.viewModel, r = this._context.viewLayout, s = this._getMouseColumn(e);
    if (e.posy < t.y) {
      const d = t.y - e.posy, h = Math.max(r.getCurrentScrollTop() - d, 0), g = QR.getZoneAtCoord(this._context, h);
      if (g) {
        const _ = this._helpPositionJumpOverViewZone(g);
        if (_)
          return fl.createOutsideEditor(s, _, "above", d);
      }
      const m = r.getLineNumberAtVerticalOffset(h);
      return fl.createOutsideEditor(s, new de(m, 1), "above", d);
    }
    if (e.posy > t.y + t.height) {
      const d = e.posy - t.y - t.height, h = r.getCurrentScrollTop() + e.relativePos.y, g = QR.getZoneAtCoord(this._context, h);
      if (g) {
        const _ = this._helpPositionJumpOverViewZone(g);
        if (_)
          return fl.createOutsideEditor(s, _, "below", d);
      }
      const m = r.getLineNumberAtVerticalOffset(h);
      return fl.createOutsideEditor(s, new de(m, n.getLineMaxColumn(m)), "below", d);
    }
    const o = r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop() + e.relativePos.y), a = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ), l = a.contentLeft;
    if (e.relativePos.x <= l) {
      const d = l - e.relativePos.x;
      return fl.createOutsideEditor(s, new de(o, 1), "left", d);
    }
    const u = a.minimap.minimapLeft === 0 ? a.width - a.verticalScrollbarWidth : a.minimap.minimapLeft;
    if (e.relativePos.x >= u) {
      const d = e.relativePos.x - u;
      return fl.createOutsideEditor(s, new de(o, n.getLineMaxColumn(o)), "right", d);
    }
    return null;
  }
  _findMousePosition(e, t) {
    const n = this._getPositionOutsideEditor(e);
    if (n)
      return n;
    const r = this._createMouseTarget(e, t);
    if (!r.position)
      return null;
    if (r.type === 8 || r.type === 5) {
      const o = this._helpPositionJumpOverViewZone(r.detail);
      if (o)
        return fl.createViewZone(r.type, r.element, r.mouseColumn, o, r.detail);
    }
    return r;
  }
  _helpPositionJumpOverViewZone(e) {
    const t = new de(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn), n = e.positionBefore, r = e.positionAfter;
    return n && r ? n.isBefore(t) ? n : r : null;
  }
  _dispatchMouse(e, t, n) {
    e.position && this._viewController.dispatchMouse({
      position: e.position,
      mouseColumn: e.mouseColumn,
      startedOnLineNumbers: this._mouseState.startedOnLineNumbers,
      revealType: n,
      inSelectionMode: t,
      mouseDownCount: this._mouseState.count,
      altKey: this._mouseState.altKey,
      ctrlKey: this._mouseState.ctrlKey,
      metaKey: this._mouseState.metaKey,
      shiftKey: this._mouseState.shiftKey,
      leftButton: this._mouseState.leftButton,
      middleButton: this._mouseState.middleButton,
      onInjectedText: e.type === 6 && e.detail.injectedText !== null
    });
  }
}
const Bj = class Bj {
  // ms
  get altKey() {
    return this._altKey;
  }
  get ctrlKey() {
    return this._ctrlKey;
  }
  get metaKey() {
    return this._metaKey;
  }
  get shiftKey() {
    return this._shiftKey;
  }
  get leftButton() {
    return this._leftButton;
  }
  get middleButton() {
    return this._middleButton;
  }
  get startedOnLineNumbers() {
    return this._startedOnLineNumbers;
  }
  constructor() {
    this._altKey = !1, this._ctrlKey = !1, this._metaKey = !1, this._shiftKey = !1, this._leftButton = !1, this._middleButton = !1, this._startedOnLineNumbers = !1, this._lastMouseDownPosition = null, this._lastMouseDownPositionEqualCount = 0, this._lastMouseDownCount = 0, this._lastSetMouseDownCountTime = 0, this.isDragAndDrop = !1;
  }
  get count() {
    return this._lastMouseDownCount;
  }
  setModifiers(e) {
    this._altKey = e.altKey, this._ctrlKey = e.ctrlKey, this._metaKey = e.metaKey, this._shiftKey = e.shiftKey;
  }
  setStartButtons(e) {
    this._leftButton = e.leftButton, this._middleButton = e.middleButton;
  }
  setStartedOnLineNumbers(e) {
    this._startedOnLineNumbers = e;
  }
  trySetCount(e, t) {
    const n = (/* @__PURE__ */ new Date()).getTime();
    n - this._lastSetMouseDownCountTime > Bj.CLEAR_MOUSE_DOWN_COUNT_TIME && (e = 1), this._lastSetMouseDownCountTime = n, e > this._lastMouseDownCount + 1 && (e = this._lastMouseDownCount + 1), this._lastMouseDownPosition && this._lastMouseDownPosition.equals(t) ? this._lastMouseDownPositionEqualCount++ : this._lastMouseDownPositionEqualCount = 1, this._lastMouseDownPosition = t, this._lastMouseDownCount = Math.min(e, this._lastMouseDownPositionEqualCount);
  }
};
Bj.CLEAR_MOUSE_DOWN_COUNT_TIME = 400;
let Zie = Bj;
class ir {
  get event() {
    return this.emitter.event;
  }
  constructor(e, t, n) {
    const r = (s) => this.emitter.fire(s);
    this.emitter = new he({
      onWillAddFirstListener: () => e.addEventListener(t, r, n),
      onDidRemoveLastListener: () => e.removeEventListener(t, r, n)
    });
  }
  dispose() {
    this.emitter.dispose();
  }
}
function i3e(i, e, t, n) {
  const r = i.getPlainTextToCopy(e, t, Za), s = i.model.getEOL(), o = t && e.length === 1 && e[0].isEmpty(), a = Array.isArray(r) ? r : null, l = Array.isArray(r) ? r.join(s) : r;
  let c, u = null;
  if (Qie.forceCopyWithSyntaxHighlighting || n && l.length < 65536) {
    const h = i.getRichTextToCopy(e, t);
    h && (c = h.html, u = h.mode);
  }
  return {
    isFromEmptySelection: o,
    multicursorText: a,
    text: l,
    html: c,
    mode: u
  };
}
const Hj = class Hj {
  constructor() {
    this._lastState = null;
  }
  set(e, t) {
    this._lastState = { lastCopiedValue: e, data: t };
  }
  get(e) {
    return this._lastState && this._lastState.lastCopiedValue === e ? this._lastState.data : (this._lastState = null, null);
  }
};
Hj.INSTANCE = new Hj();
let ib = Hj;
const Qie = {
  forceCopyWithSyntaxHighlighting: !1
}, Fx = {
  getTextData(i) {
    const e = i.getData(co.text);
    let t = null;
    const n = i.getData("vscode-editor-data");
    if (typeof n == "string")
      try {
        t = JSON.parse(n), t.version !== 1 && (t = null);
      } catch {
      }
    return e.length === 0 && t === null && i.files.length > 0 ? [Array.prototype.slice.call(i.files, 0).map((s) => s.name).join(`
`), null] : [e, t];
  },
  setTextData(i, e, t, n) {
    i.setData(co.text, e), typeof t == "string" && i.setData("text/html", t), i.setData("vscode-editor-data", JSON.stringify(n));
  }
}, ix = class ix {
  constructor(e, t, n, r, s) {
    this.value = e, this.selectionStart = t, this.selectionEnd = n, this.selection = r, this.newlineCountBeforeSelection = s;
  }
  toString() {
    return `[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`;
  }
  static readFromTextArea(e, t) {
    const n = e.getValue(), r = e.getSelectionStart(), s = e.getSelectionEnd();
    let o;
    if (t) {
      const a = n.substring(0, r), l = t.value.substring(0, t.selectionStart);
      a === l && (o = t.newlineCountBeforeSelection);
    }
    return new ix(n, r, s, null, o);
  }
  collapseSelection() {
    return this.selectionStart === this.value.length ? this : new ix(this.value, this.value.length, this.value.length, null, void 0);
  }
  isWrittenToTextArea(e, t) {
    const n = this.value === e.getValue();
    return t ? this.selectionStart === e.getSelectionStart() && this.selectionEnd === e.getSelectionEnd() && n : n;
  }
  writeToTextArea(e, t, n) {
    t.setValue(e, this.value), n && t.setSelectionRange(e, this.selectionStart, this.selectionEnd);
  }
  deduceEditorPosition(e) {
    var r, s, o, a;
    if (e <= this.selectionStart) {
      const l = this.value.substring(e, this.selectionStart);
      return this._finishDeduceEditorPosition(((r = this.selection) == null ? void 0 : r.getStartPosition()) ?? null, l, -1);
    }
    if (e >= this.selectionEnd) {
      const l = this.value.substring(this.selectionEnd, e);
      return this._finishDeduceEditorPosition(((s = this.selection) == null ? void 0 : s.getEndPosition()) ?? null, l, 1);
    }
    const t = this.value.substring(this.selectionStart, e);
    if (t.indexOf("…") === -1)
      return this._finishDeduceEditorPosition(((o = this.selection) == null ? void 0 : o.getStartPosition()) ?? null, t, 1);
    const n = this.value.substring(e, this.selectionEnd);
    return this._finishDeduceEditorPosition(((a = this.selection) == null ? void 0 : a.getEndPosition()) ?? null, n, -1);
  }
  _finishDeduceEditorPosition(e, t, n) {
    let r = 0, s = -1;
    for (; (s = t.indexOf(`
`, s + 1)) !== -1; )
      r++;
    return [e, n * t.length, r];
  }
  static deduceInput(e, t, n) {
    if (!e)
      return {
        text: "",
        replacePrevCharCnt: 0,
        replaceNextCharCnt: 0,
        positionDelta: 0
      };
    const r = Math.min(jg(e.value, t.value), e.selectionStart, t.selectionStart), s = Math.min(Gy(e.value, t.value), e.value.length - e.selectionEnd, t.value.length - t.selectionEnd);
    e.value.substring(r, e.value.length - s);
    const o = t.value.substring(r, t.value.length - s), a = e.selectionStart - r, l = e.selectionEnd - r, c = t.selectionStart - r, u = t.selectionEnd - r;
    if (c === u) {
      const h = e.selectionStart - r;
      return {
        text: o,
        replacePrevCharCnt: h,
        replaceNextCharCnt: 0,
        positionDelta: 0
      };
    }
    const d = l - a;
    return {
      text: o,
      replacePrevCharCnt: d,
      replaceNextCharCnt: 0,
      positionDelta: 0
    };
  }
  static deduceAndroidCompositionInput(e, t) {
    if (!e)
      return {
        text: "",
        replacePrevCharCnt: 0,
        replaceNextCharCnt: 0,
        positionDelta: 0
      };
    if (e.value === t.value)
      return {
        text: "",
        replacePrevCharCnt: 0,
        replaceNextCharCnt: 0,
        positionDelta: t.selectionEnd - e.selectionEnd
      };
    const n = Math.min(jg(e.value, t.value), e.selectionEnd), r = Math.min(Gy(e.value, t.value), e.value.length - e.selectionEnd), s = e.value.substring(n, e.value.length - r), o = t.value.substring(n, t.value.length - r);
    e.selectionStart - n;
    const a = e.selectionEnd - n;
    t.selectionStart - n;
    const l = t.selectionEnd - n;
    return {
      text: o,
      replacePrevCharCnt: a,
      replaceNextCharCnt: s.length - a,
      positionDelta: l - o.length
    };
  }
  static fromScreenReaderContentState(e) {
    return new ix(e.value, e.selectionStart, e.selectionEnd, e.selection, e.newlineCountBeforeSelection);
  }
};
ix.EMPTY = new ix("", 0, 0, null, void 0);
let vc = ix;
const XT = (function() {
  if (typeof crypto.randomUUID == "function")
    return crypto.randomUUID.bind(crypto);
  const i = new Uint8Array(16), e = [];
  for (let t = 0; t < 256; t++)
    e.push(t.toString(16).padStart(2, "0"));
  return function() {
    crypto.getRandomValues(i), i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128;
    let n = 0, r = "";
    return r += e[i[n++]], r += e[i[n++]], r += e[i[n++]], r += e[i[n++]], r += "-", r += e[i[n++]], r += e[i[n++]], r += "-", r += e[i[n++]], r += e[i[n++]], r += "-", r += e[i[n++]], r += e[i[n++]], r += "-", r += e[i[n++]], r += e[i[n++]], r += e[i[n++]], r += e[i[n++]], r += e[i[n++]], r += e[i[n++]], r;
  };
})();
function r3e(i) {
  return `${i}-${XT()}`;
}
var iut = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, PLe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, oU;
(function(i) {
  i.Tap = "-monaco-textarea-synthetic-tap";
})(oU || (oU = {}));
class rut {
  constructor() {
    this._lastTypeTextLength = 0;
  }
  handleCompositionUpdate(e) {
    e = e || "";
    const t = {
      text: e,
      replacePrevCharCnt: this._lastTypeTextLength,
      replaceNextCharCnt: 0,
      positionDelta: 0
    };
    return this._lastTypeTextLength = e.length, t;
  }
}
let Jie = class extends ge {
  get textAreaState() {
    return this._textAreaState;
  }
  constructor(e, t, n, r, s, o) {
    super(), this._host = e, this._textArea = t, this._OS = n, this._browser = r, this._accessibilityService = s, this._logService = o, this._onFocus = this._register(new he()), this.onFocus = this._onFocus.event, this._onBlur = this._register(new he()), this.onBlur = this._onBlur.event, this._onKeyDown = this._register(new he()), this.onKeyDown = this._onKeyDown.event, this._onKeyUp = this._register(new he()), this.onKeyUp = this._onKeyUp.event, this._onCut = this._register(new he()), this.onCut = this._onCut.event, this._onPaste = this._register(new he()), this.onPaste = this._onPaste.event, this._onType = this._register(new he()), this.onType = this._onType.event, this._onCompositionStart = this._register(new he()), this.onCompositionStart = this._onCompositionStart.event, this._onCompositionUpdate = this._register(new he()), this.onCompositionUpdate = this._onCompositionUpdate.event, this._onCompositionEnd = this._register(new he()), this.onCompositionEnd = this._onCompositionEnd.event, this._onSelectionChangeRequest = this._register(new he()), this.onSelectionChangeRequest = this._onSelectionChangeRequest.event, this._asyncFocusGainWriteScreenReaderContent = this._register(new er()), this._asyncTriggerCut = this._register(new mr(() => this._onCut.fire(), 0)), this._textAreaState = vc.EMPTY, this._selectionChangeListener = null, this._accessibilityService.isScreenReaderOptimized() && this.writeNativeTextAreaContent("ctor"), this._register(Ze.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized, () => {
      this._accessibilityService.isScreenReaderOptimized() && !this._asyncFocusGainWriteScreenReaderContent.value ? this._asyncFocusGainWriteScreenReaderContent.value = this._register(new mr(() => this.writeNativeTextAreaContent("asyncFocusGain"), 0)) : this._asyncFocusGainWriteScreenReaderContent.clear();
    })), this._hasFocus = !1, this._currentComposition = null;
    let a = null;
    this._register(this._textArea.onKeyDown((l) => {
      const c = new wr(l);
      (c.keyCode === 114 || this._currentComposition && c.keyCode === 1) && c.stopPropagation(), c.equals(
        9
        /* KeyCode.Escape */
      ) && c.preventDefault(), a = c, this._onKeyDown.fire(c);
    })), this._register(this._textArea.onKeyUp((l) => {
      const c = new wr(l);
      this._onKeyUp.fire(c);
    })), this._register(this._textArea.onCompositionStart((l) => {
      const c = new rut();
      if (this._currentComposition) {
        this._currentComposition = c;
        return;
      }
      if (this._currentComposition = c, this._OS === 2 && a && a.equals(
        114
        /* KeyCode.KEY_IN_COMPOSITION */
      ) && this._textAreaState.selectionStart === this._textAreaState.selectionEnd && this._textAreaState.selectionStart > 0 && this._textAreaState.value.substr(this._textAreaState.selectionStart - 1, 1) === l.data && (a.code === "ArrowRight" || a.code === "ArrowLeft")) {
        c.handleCompositionUpdate("x"), this._onCompositionStart.fire({ data: l.data });
        return;
      }
      if (this._browser.isAndroid) {
        this._onCompositionStart.fire({ data: l.data });
        return;
      }
      this._onCompositionStart.fire({ data: l.data });
    })), this._register(this._textArea.onCompositionUpdate((l) => {
      const c = this._currentComposition;
      if (!c)
        return;
      if (this._browser.isAndroid) {
        const d = vc.readFromTextArea(this._textArea, this._textAreaState), h = vc.deduceAndroidCompositionInput(this._textAreaState, d);
        this._textAreaState = d, this._onType.fire(h), this._onCompositionUpdate.fire(l);
        return;
      }
      const u = c.handleCompositionUpdate(l.data);
      this._textAreaState = vc.readFromTextArea(this._textArea, this._textAreaState), this._onType.fire(u), this._onCompositionUpdate.fire(l);
    })), this._register(this._textArea.onCompositionEnd((l) => {
      const c = this._currentComposition;
      if (!c)
        return;
      if (this._currentComposition = null, this._browser.isAndroid) {
        const d = vc.readFromTextArea(this._textArea, this._textAreaState), h = vc.deduceAndroidCompositionInput(this._textAreaState, d);
        this._textAreaState = d, this._onType.fire(h), this._onCompositionEnd.fire();
        return;
      }
      const u = c.handleCompositionUpdate(l.data);
      this._textAreaState = vc.readFromTextArea(this._textArea, this._textAreaState), this._onType.fire(u), this._onCompositionEnd.fire();
    })), this._register(this._textArea.onInput((l) => {
      if (this._textArea.setIgnoreSelectionChangeTime("received input event"), this._currentComposition)
        return;
      const c = vc.readFromTextArea(this._textArea, this._textAreaState), u = vc.deduceInput(
        this._textAreaState,
        c,
        /*couldBeEmojiInput*/
        this._OS === 2
        /* OperatingSystem.Macintosh */
      );
      u.replacePrevCharCnt === 0 && u.text.length === 1 && (Qo(u.text.charCodeAt(0)) || u.text.charCodeAt(0) === 127) || (this._textAreaState = c, (u.text !== "" || u.replacePrevCharCnt !== 0 || u.replaceNextCharCnt !== 0 || u.positionDelta !== 0) && (l.inputType === "insertFromPaste" ? this._onPaste.fire({
        text: u.text,
        metadata: ib.INSTANCE.get(u.text)
      }) : this._onType.fire(u)));
    })), this._register(this._textArea.onCut((l) => {
      this._logService.trace("TextAreaInput#onCut", l), this._textArea.setIgnoreSelectionChangeTime("received cut event"), this._ensureClipboardGetsEditorSelection(l), this._asyncTriggerCut.schedule();
    })), this._register(this._textArea.onCopy((l) => {
      this._logService.trace("TextAreaInput#onCopy", l), this._ensureClipboardGetsEditorSelection(l);
    })), this._register(this._textArea.onPaste((l) => {
      if (this._logService.trace("TextAreaInput#onPaste", l), this._textArea.setIgnoreSelectionChangeTime("received paste event"), l.preventDefault(), !l.clipboardData)
        return;
      let [c, u] = Fx.getTextData(l.clipboardData);
      this._logService.trace("TextAreaInput#onPaste with id : ", u == null ? void 0 : u.id, " with text.length: ", c.length), c && (u = u || ib.INSTANCE.get(c), this._logService.trace("TextAreaInput#onPaste (before onPaste)"), this._onPaste.fire({
        text: c,
        metadata: u
      }));
    })), this._register(this._textArea.onFocus(() => {
      const l = this._hasFocus;
      this._setHasFocus(!0), this._accessibilityService.isScreenReaderOptimized() && this._browser.isSafari && !l && this._hasFocus && (this._asyncFocusGainWriteScreenReaderContent.value || (this._asyncFocusGainWriteScreenReaderContent.value = new mr(() => this.writeNativeTextAreaContent("asyncFocusGain"), 0)), this._asyncFocusGainWriteScreenReaderContent.value.schedule());
    })), this._register(this._textArea.onBlur(() => {
      this._currentComposition && (this._currentComposition = null, this.writeNativeTextAreaContent("blurWithoutCompositionEnd"), this._onCompositionEnd.fire()), this._setHasFocus(!1);
    })), this._register(this._textArea.onSyntheticTap(() => {
      this._browser.isAndroid && this._currentComposition && (this._currentComposition = null, this.writeNativeTextAreaContent("tapWithoutCompositionEnd"), this._onCompositionEnd.fire());
    }));
  }
  _installSelectionChangeListener() {
    let e = 0;
    return Ce(this._textArea.ownerDocument, "selectionchange", (t) => {
      if (s1.onSelectionChange(), !this._hasFocus || this._currentComposition || !this._browser.isChrome)
        return;
      const n = Date.now(), r = n - e;
      if (e = n, r < 5)
        return;
      const s = n - this._textArea.getIgnoreSelectionChangeTime();
      if (this._textArea.resetSelectionChangeTime(), s < 100 || !this._textAreaState.selection)
        return;
      const o = this._textArea.getValue();
      if (this._textAreaState.value !== o)
        return;
      const a = this._textArea.getSelectionStart(), l = this._textArea.getSelectionEnd();
      if (this._textAreaState.selectionStart === a && this._textAreaState.selectionEnd === l)
        return;
      const c = this._textAreaState.deduceEditorPosition(a), u = this._host.deduceModelPosition(c[0], c[1], c[2]), d = this._textAreaState.deduceEditorPosition(l), h = this._host.deduceModelPosition(d[0], d[1], d[2]), g = new bt(u.lineNumber, u.column, h.lineNumber, h.column);
      this._onSelectionChangeRequest.fire(g);
    });
  }
  dispose() {
    super.dispose(), this._selectionChangeListener && (this._selectionChangeListener.dispose(), this._selectionChangeListener = null);
  }
  focusTextArea() {
    this._setHasFocus(!0), this.refreshFocusState();
  }
  isFocused() {
    return this._hasFocus;
  }
  refreshFocusState() {
    this._setHasFocus(this._textArea.hasFocus());
  }
  _setHasFocus(e) {
    this._hasFocus !== e && (this._hasFocus = e, this._selectionChangeListener && (this._selectionChangeListener.dispose(), this._selectionChangeListener = null), this._hasFocus && (this._selectionChangeListener = this._installSelectionChangeListener()), this._hasFocus && this.writeNativeTextAreaContent("focusgain"), this._hasFocus ? this._onFocus.fire() : this._onBlur.fire());
  }
  _setAndWriteTextAreaState(e, t) {
    this._hasFocus || (t = t.collapseSelection()), t.isWrittenToTextArea(this._textArea, this._hasFocus) || this._logService.trace(`writeTextAreaState(reason: ${e})`), t.writeToTextArea(e, this._textArea, this._hasFocus), this._textAreaState = t;
  }
  writeNativeTextAreaContent(e) {
    !this._accessibilityService.isScreenReaderOptimized() && e === "render" || this._currentComposition || this._setAndWriteTextAreaState(e, this._host.getScreenReaderContent());
  }
  _ensureClipboardGetsEditorSelection(e) {
    const t = this._host.getDataToCopy();
    let n;
    this._logService.getLevel() === da.Trace && (n = XT());
    const r = {
      version: 1,
      id: n,
      isFromEmptySelection: t.isFromEmptySelection,
      multicursorText: t.multicursorText,
      mode: t.mode
    };
    ib.INSTANCE.set(
      // When writing "LINE\r\n" to the clipboard and then pasting,
      // Firefox pastes "LINE\n", so let's work around this quirk
      this._browser.isFirefox ? t.text.replace(/\r\n/g, `
`) : t.text,
      r
    ), e.preventDefault(), e.clipboardData && Fx.setTextData(e.clipboardData, t.text, t.html, r), this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ", n, " with text.length: ", t.text.length);
  }
};
Jie = iut([
  PLe(4, Qa),
  PLe(5, $r)
], Jie);
class sut extends ge {
  get ownerDocument() {
    return this._actual.ownerDocument;
  }
  constructor(e) {
    super(), this._actual = e, this._onSyntheticTap = this._register(new he()), this.onSyntheticTap = this._onSyntheticTap.event, this._ignoreSelectionChangeTime = 0, this.onKeyDown = this._register(new ir(this._actual, "keydown")).event, this.onKeyPress = this._register(new ir(this._actual, "keypress")).event, this.onKeyUp = this._register(new ir(this._actual, "keyup")).event, this.onCompositionStart = this._register(new ir(this._actual, "compositionstart")).event, this.onCompositionUpdate = this._register(new ir(this._actual, "compositionupdate")).event, this.onCompositionEnd = this._register(new ir(this._actual, "compositionend")).event, this.onBeforeInput = this._register(new ir(this._actual, "beforeinput")).event, this.onInput = this._register(new ir(this._actual, "input")).event, this.onCut = this._register(new ir(this._actual, "cut")).event, this.onCopy = this._register(new ir(this._actual, "copy")).event, this.onPaste = this._register(new ir(this._actual, "paste")).event, this.onFocus = this._register(new ir(this._actual, "focus")).event, this.onBlur = this._register(new ir(this._actual, "blur")).event, this._register(this.onKeyDown(() => s1.onKeyDown())), this._register(this.onBeforeInput(() => s1.onBeforeInput())), this._register(this.onInput(() => s1.onInput())), this._register(this.onKeyUp(() => s1.onKeyUp())), this._register(Ce(this._actual, oU.Tap, () => this._onSyntheticTap.fire()));
  }
  hasFocus() {
    const e = iw(this._actual);
    return e ? e.activeElement === this._actual : this._actual.isConnected ? ea() === this._actual : !1;
  }
  setIgnoreSelectionChangeTime(e) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  getIgnoreSelectionChangeTime() {
    return this._ignoreSelectionChangeTime;
  }
  resetSelectionChangeTime() {
    this._ignoreSelectionChangeTime = 0;
  }
  getValue() {
    return this._actual.value;
  }
  setValue(e, t) {
    const n = this._actual;
    n.value !== t && (this.setIgnoreSelectionChangeTime("setValue"), n.value = t);
  }
  getSelectionStart() {
    return this._actual.selectionDirection === "backward" ? this._actual.selectionEnd : this._actual.selectionStart;
  }
  getSelectionEnd() {
    return this._actual.selectionDirection === "backward" ? this._actual.selectionStart : this._actual.selectionEnd;
  }
  setSelectionRange(e, t, n) {
    const r = this._actual;
    let s = null;
    const o = iw(r);
    o ? s = o.activeElement : s = ea();
    const a = At(s), l = s === r, c = r.selectionStart, u = r.selectionEnd;
    if (l && c === t && u === n) {
      Zu && a.parent !== a && r.focus();
      return;
    }
    if (l) {
      this.setIgnoreSelectionChangeTime("setSelectionRange"), r.setSelectionRange(t, n), Zu && a.parent !== a && r.focus();
      return;
    }
    try {
      const d = Vit(r);
      this.setIgnoreSelectionChangeTime("setSelectionRange"), r.focus(), r.setSelectionRange(t, n), Uit(r, d);
    } catch {
    }
  }
}
class out extends Rfe {
  constructor(e, t, n) {
    super(e, t, n), this._register(ec.addTarget(this.viewHelper.linesContentDomNode)), this._register(Ce(this.viewHelper.linesContentDomNode, zr.Tap, (s) => this.onTap(s))), this._register(Ce(this.viewHelper.linesContentDomNode, zr.Change, (s) => this.onChange(s))), this._register(Ce(this.viewHelper.linesContentDomNode, zr.Contextmenu, (s) => this._onContextMenu(new Zy(s, !1, this.viewHelper.viewDomNode), !1))), this._lastPointerType = "mouse", this._register(Ce(this.viewHelper.linesContentDomNode, "pointerdown", (s) => {
      const o = s.pointerType;
      if (o === "mouse") {
        this._lastPointerType = "mouse";
        return;
      } else o === "touch" ? this._lastPointerType = "touch" : this._lastPointerType = "pen";
    }));
    const r = new hct(this.viewHelper.viewDomNode);
    this._register(r.onPointerMove(this.viewHelper.viewDomNode, (s) => this._onMouseMove(s))), this._register(r.onPointerUp(this.viewHelper.viewDomNode, (s) => this._onMouseUp(s))), this._register(r.onPointerLeave(this.viewHelper.viewDomNode, (s) => this._onMouseLeave(s))), this._register(r.onPointerDown(this.viewHelper.viewDomNode, (s, o) => this._onMouseDown(s, o)));
  }
  onTap(e) {
    !e.initialTarget || !this.viewHelper.linesContentDomNode.contains(e.initialTarget) || (e.preventDefault(), this.viewHelper.focusTextArea(), this._dispatchGesture(
      e,
      /*inSelectionMode*/
      !1
    ));
  }
  onChange(e) {
    this._lastPointerType === "touch" && this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX, -e.translationY), this._lastPointerType === "pen" && this._dispatchGesture(
      e,
      /*inSelectionMode*/
      !0
    );
  }
  _dispatchGesture(e, t) {
    const n = this._createMouseTarget(new Zy(e, !1, this.viewHelper.viewDomNode), !1);
    n.position && this.viewController.dispatchMouse({
      position: n.position,
      mouseColumn: n.position.column,
      startedOnLineNumbers: !1,
      revealType: 1,
      mouseDownCount: e.tapCount,
      inSelectionMode: t,
      altKey: !1,
      ctrlKey: !1,
      metaKey: !1,
      shiftKey: !1,
      leftButton: !1,
      middleButton: !1,
      onInjectedText: n.type === 6 && n.detail.injectedText !== null
    });
  }
  _onMouseDown(e, t) {
    e.browserEvent.pointerType !== "touch" && super._onMouseDown(e, t);
  }
}
class aut extends Rfe {
  constructor(e, t, n) {
    super(e, t, n), this._register(ec.addTarget(this.viewHelper.linesContentDomNode)), this._register(Ce(this.viewHelper.linesContentDomNode, zr.Tap, (r) => this.onTap(r))), this._register(Ce(this.viewHelper.linesContentDomNode, zr.Change, (r) => this.onChange(r))), this._register(Ce(this.viewHelper.linesContentDomNode, zr.Contextmenu, (r) => this._onContextMenu(new Zy(r, !1, this.viewHelper.viewDomNode), !1)));
  }
  onTap(e) {
    e.preventDefault(), this.viewHelper.focusTextArea();
    const t = this._createMouseTarget(new Zy(e, !1, this.viewHelper.viewDomNode), !1);
    if (t.position) {
      const n = document.createEvent("CustomEvent");
      n.initEvent(oU.Tap, !1, !0), this.viewHelper.dispatchTextAreaEvent(n), this.viewController.moveTo(
        t.position,
        1
        /* NavigationCommandRevealType.Minimal */
      );
    }
  }
  onChange(e) {
    this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX, -e.translationY);
  }
}
class lut extends ge {
  constructor(e, t, n) {
    super(), (jf || Ltt && PMe) && fB.pointerEvents ? this.handler = this._register(new out(e, t, n)) : fr.TouchEvent ? this.handler = this._register(new aut(e, t, n)) : this.handler = this._register(new Rfe(e, t, n));
  }
  getTargetAtClientPoint(e, t) {
    return this.handler.getTargetAtClientPoint(e, t);
  }
}
class cut {
  constructor(e, t, n, r) {
    this.configuration = e, this.viewModel = t, this.userInputEvents = n, this.commandDelegate = r;
  }
  paste(e, t, n, r) {
    this.commandDelegate.paste(e, t, n, r);
  }
  type(e) {
    this.commandDelegate.type(e);
  }
  compositionType(e, t, n, r) {
    this.commandDelegate.compositionType(e, t, n, r);
  }
  compositionStart() {
    this.commandDelegate.startComposition();
  }
  compositionEnd() {
    this.commandDelegate.endComposition();
  }
  cut() {
    this.commandDelegate.cut();
  }
  setSelection(e) {
    Ta.SetSelection.runCoreEditorCommand(this.viewModel, {
      source: "keyboard",
      selection: e
    });
  }
  _validateViewColumn(e) {
    const t = this.viewModel.getLineMinColumn(e.lineNumber);
    return e.column < t ? new de(e.lineNumber, t) : e;
  }
  _hasMulticursorModifier(e) {
    switch (this.configuration.options.get(
      86
      /* EditorOption.multiCursorModifier */
    )) {
      case "altKey":
        return e.altKey;
      case "ctrlKey":
        return e.ctrlKey;
      case "metaKey":
        return e.metaKey;
      default:
        return !1;
    }
  }
  _hasNonMulticursorModifier(e) {
    switch (this.configuration.options.get(
      86
      /* EditorOption.multiCursorModifier */
    )) {
      case "altKey":
        return e.ctrlKey || e.metaKey;
      case "ctrlKey":
        return e.altKey || e.metaKey;
      case "metaKey":
        return e.ctrlKey || e.altKey;
      default:
        return !1;
    }
  }
  dispatchMouse(e) {
    const t = this.configuration.options, n = Qu && t.get(
      121
      /* EditorOption.selectionClipboard */
    ), r = t.get(
      28
      /* EditorOption.columnSelection */
    ), s = t.get(
      171
      /* EditorOption.scrollOnMiddleClick */
    );
    e.middleButton && !n ? s || this._columnSelect(e.position, e.mouseColumn, e.inSelectionMode) : e.startedOnLineNumbers ? this._hasMulticursorModifier(e) ? e.inSelectionMode ? this._lastCursorLineSelect(e.position, e.revealType) : this._createCursor(e.position, !0) : e.inSelectionMode ? this._lineSelectDrag(e.position, e.revealType) : this._lineSelect(e.position, e.revealType) : e.mouseDownCount >= 4 ? this._selectAll() : e.mouseDownCount === 3 ? this._hasMulticursorModifier(e) ? e.inSelectionMode ? this._lastCursorLineSelectDrag(e.position, e.revealType) : this._lastCursorLineSelect(e.position, e.revealType) : e.inSelectionMode ? this._lineSelectDrag(e.position, e.revealType) : this._lineSelect(e.position, e.revealType) : e.mouseDownCount === 2 ? e.onInjectedText || (this._hasMulticursorModifier(e) ? this._lastCursorWordSelect(e.position, e.revealType) : e.inSelectionMode ? this._wordSelectDrag(e.position, e.revealType) : this._wordSelect(e.position, e.revealType)) : this._hasMulticursorModifier(e) ? this._hasNonMulticursorModifier(e) || (e.shiftKey ? this._columnSelect(e.position, e.mouseColumn, !0) : e.inSelectionMode ? this._lastCursorMoveToSelect(e.position, e.revealType) : this._createCursor(e.position, !1)) : e.inSelectionMode ? e.altKey ? this._columnSelect(e.position, e.mouseColumn, !0) : r ? this._columnSelect(e.position, e.mouseColumn, !0) : this._moveToSelect(e.position, e.revealType) : this.moveTo(e.position, e.revealType);
  }
  _usualArgs(e, t) {
    return e = this._validateViewColumn(e), {
      source: "mouse",
      position: this._convertViewToModelPosition(e),
      viewPosition: e,
      revealType: t
    };
  }
  moveTo(e, t) {
    Ta.MoveTo.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _moveToSelect(e, t) {
    Ta.MoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _columnSelect(e, t, n) {
    e = this._validateViewColumn(e), Ta.ColumnSelect.runCoreEditorCommand(this.viewModel, {
      source: "mouse",
      position: this._convertViewToModelPosition(e),
      viewPosition: e,
      mouseColumn: t,
      doColumnSelect: n
    });
  }
  _createCursor(e, t) {
    e = this._validateViewColumn(e), Ta.CreateCursor.runCoreEditorCommand(this.viewModel, {
      source: "mouse",
      position: this._convertViewToModelPosition(e),
      viewPosition: e,
      wholeLine: t
    });
  }
  _lastCursorMoveToSelect(e, t) {
    Ta.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _wordSelect(e, t) {
    Ta.WordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _wordSelectDrag(e, t) {
    Ta.WordSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lastCursorWordSelect(e, t) {
    Ta.LastCursorWordSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lineSelect(e, t) {
    Ta.LineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lineSelectDrag(e, t) {
    Ta.LineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lastCursorLineSelect(e, t) {
    Ta.LastCursorLineSelect.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _lastCursorLineSelectDrag(e, t) {
    Ta.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel, this._usualArgs(e, t));
  }
  _selectAll() {
    Ta.SelectAll.runCoreEditorCommand(this.viewModel, { source: "mouse" });
  }
  // ----------------------
  _convertViewToModelPosition(e) {
    return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e);
  }
  emitKeyDown(e) {
    this.userInputEvents.emitKeyDown(e);
  }
  emitKeyUp(e) {
    this.userInputEvents.emitKeyUp(e);
  }
  emitContextMenu(e) {
    this.userInputEvents.emitContextMenu(e);
  }
  emitMouseMove(e) {
    this.userInputEvents.emitMouseMove(e);
  }
  emitMouseLeave(e) {
    this.userInputEvents.emitMouseLeave(e);
  }
  emitMouseUp(e) {
    this.userInputEvents.emitMouseUp(e);
  }
  emitMouseDown(e) {
    this.userInputEvents.emitMouseDown(e);
  }
  emitMouseDrag(e) {
    this.userInputEvents.emitMouseDrag(e);
  }
  emitMouseDrop(e) {
    this.userInputEvents.emitMouseDrop(e);
  }
  emitMouseDropCanceled() {
    this.userInputEvents.emitMouseDropCanceled();
  }
  emitMouseWheel(e) {
    this.userInputEvents.emitMouseWheel(e);
  }
}
function Db(i, e) {
  var n;
  const t = globalThis.MonacoEnvironment;
  if (t != null && t.createTrustedTypesPolicy)
    try {
      return t.createTrustedTypesPolicy(i, e);
    } catch (r) {
      fn(r);
      return;
    }
  try {
    return (n = globalThis.trustedTypes) == null ? void 0 : n.createPolicy(i, e);
  } catch (r) {
    fn(r);
    return;
  }
}
class s3e {
  constructor(e) {
    this._lineFactory = e, this._set(1, []);
  }
  flush() {
    this._set(1, []);
  }
  _set(e, t) {
    this._lines = t, this._rendLineNumberStart = e;
  }
  _get() {
    return {
      rendLineNumberStart: this._rendLineNumberStart,
      lines: this._lines
    };
  }
  /**
   * @returns Inclusive line number that is inside this collection
   */
  getStartLineNumber() {
    return this._rendLineNumberStart;
  }
  /**
   * @returns Inclusive line number that is inside this collection
   */
  getEndLineNumber() {
    return this._rendLineNumberStart + this._lines.length - 1;
  }
  getCount() {
    return this._lines.length;
  }
  getLine(e) {
    const t = e - this._rendLineNumberStart;
    if (t < 0 || t >= this._lines.length)
      throw new Wt("Illegal value for lineNumber");
    return this._lines[t];
  }
  /**
   * @returns Lines that were removed from this collection
   */
  onLinesDeleted(e, t) {
    if (this.getCount() === 0)
      return null;
    const n = this.getStartLineNumber(), r = this.getEndLineNumber();
    if (t < n) {
      const l = t - e + 1;
      return this._rendLineNumberStart -= l, null;
    }
    if (e > r)
      return null;
    let s = 0, o = 0;
    for (let l = n; l <= r; l++) {
      const c = l - this._rendLineNumberStart;
      e <= l && l <= t && (o === 0 ? (s = c, o = 1) : o++);
    }
    if (e < n) {
      let l = 0;
      t < n ? l = t - e + 1 : l = n - e, this._rendLineNumberStart -= l;
    }
    return this._lines.splice(s, o);
  }
  onLinesChanged(e, t) {
    const n = e + t - 1;
    if (this.getCount() === 0)
      return !1;
    const r = this.getStartLineNumber(), s = this.getEndLineNumber();
    let o = !1;
    for (let a = e; a <= n; a++)
      a >= r && a <= s && (this._lines[a - this._rendLineNumberStart].onContentChanged(), o = !0);
    return o;
  }
  onLinesInserted(e, t) {
    if (this.getCount() === 0)
      return null;
    const n = t - e + 1, r = this.getStartLineNumber(), s = this.getEndLineNumber();
    if (e <= r)
      return this._rendLineNumberStart += n, null;
    if (e > s)
      return null;
    if (n + e > s)
      return this._lines.splice(e - this._rendLineNumberStart, s - e + 1);
    const o = [];
    for (let d = 0; d < n; d++)
      o[d] = this._lineFactory.createLine();
    const a = e - this._rendLineNumberStart, l = this._lines.slice(0, a), c = this._lines.slice(a, this._lines.length - n), u = this._lines.slice(this._lines.length - n, this._lines.length);
    return this._lines = l.concat(o).concat(c), u;
  }
  onTokensChanged(e) {
    if (this.getCount() === 0)
      return !1;
    const t = this.getStartLineNumber(), n = this.getEndLineNumber();
    let r = !1;
    for (let s = 0, o = e.length; s < o; s++) {
      const a = e[s];
      if (a.toLineNumber < t || a.fromLineNumber > n)
        continue;
      const l = Math.max(t, a.fromLineNumber), c = Math.min(n, a.toLineNumber);
      for (let u = l; u <= c; u++) {
        const d = u - this._rendLineNumberStart;
        this._lines[d].onTokensChanged(), r = !0;
      }
    }
    return r;
  }
}
class o3e {
  constructor(e, t) {
    this._viewContext = e, this._lineFactory = t, this.domNode = this._createDomNode(), this._linesCollection = new s3e(this._lineFactory);
  }
  _createDomNode() {
    const e = Gi(document.createElement("div"));
    return e.setClassName("view-layer"), e.setPosition("absolute"), e.domNode.setAttribute("role", "presentation"), e.domNode.setAttribute("aria-hidden", "true"), e;
  }
  // ---- begin view event handlers
  onConfigurationChanged(e) {
    return !!e.hasChanged(
      165
      /* EditorOption.layoutInfo */
    );
  }
  onFlushed(e, t) {
    var n;
    if (t) {
      const r = this._linesCollection.getStartLineNumber(), s = this._linesCollection.getEndLineNumber();
      for (let o = r; o <= s; o++)
        (n = this._linesCollection.getLine(o).getDomNode()) == null || n.remove();
    }
    return this._linesCollection.flush(), !0;
  }
  onLinesChanged(e) {
    return this._linesCollection.onLinesChanged(e.fromLineNumber, e.count);
  }
  onLinesDeleted(e) {
    const t = this._linesCollection.onLinesDeleted(e.fromLineNumber, e.toLineNumber);
    if (t)
      for (let n = 0, r = t.length; n < r; n++) {
        const s = t[n].getDomNode();
        s == null || s.remove();
      }
    return !0;
  }
  onLinesInserted(e) {
    const t = this._linesCollection.onLinesInserted(e.fromLineNumber, e.toLineNumber);
    if (t)
      for (let n = 0, r = t.length; n < r; n++) {
        const s = t[n].getDomNode();
        s == null || s.remove();
      }
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onTokensChanged(e) {
    return this._linesCollection.onTokensChanged(e.ranges);
  }
  onZonesChanged(e) {
    return !0;
  }
  // ---- end view event handlers
  getStartLineNumber() {
    return this._linesCollection.getStartLineNumber();
  }
  getEndLineNumber() {
    return this._linesCollection.getEndLineNumber();
  }
  getVisibleLine(e) {
    return this._linesCollection.getLine(e);
  }
  renderLines(e) {
    const t = this._linesCollection._get(), n = new ere(this.domNode.domNode, this._lineFactory, e, this._viewContext), r = {
      rendLineNumberStart: t.rendLineNumberStart,
      lines: t.lines,
      linesLength: t.lines.length
    }, s = n.render(r, e.startLineNumber, e.endLineNumber, e.relativeVerticalOffset);
    this._linesCollection._set(s.rendLineNumberStart, s.lines);
  }
}
const iy = class iy {
  constructor(e, t, n, r) {
    this._domNode = e, this._lineFactory = t, this._viewportData = n, this._viewContext = r;
  }
  render(e, t, n, r) {
    const s = {
      rendLineNumberStart: e.rendLineNumberStart,
      lines: e.lines.slice(0),
      linesLength: e.linesLength
    };
    if (s.rendLineNumberStart + s.linesLength - 1 < t || n < s.rendLineNumberStart) {
      s.rendLineNumberStart = t, s.linesLength = n - t + 1, s.lines = [];
      for (let o = t; o <= n; o++)
        s.lines[o - t] = this._lineFactory.createLine();
      return this._finishRendering(s, !0, r), s;
    }
    if (this._renderUntouchedLines(s, Math.max(t - s.rendLineNumberStart, 0), Math.min(n - s.rendLineNumberStart, s.linesLength - 1), r, t), s.rendLineNumberStart > t) {
      const o = t, a = Math.min(n, s.rendLineNumberStart - 1);
      o <= a && (this._insertLinesBefore(s, o, a, r, t), s.linesLength += a - o + 1);
    } else if (s.rendLineNumberStart < t) {
      const o = Math.min(s.linesLength, t - s.rendLineNumberStart);
      o > 0 && (this._removeLinesBefore(s, o), s.linesLength -= o);
    }
    if (s.rendLineNumberStart = t, s.rendLineNumberStart + s.linesLength - 1 < n) {
      const o = s.rendLineNumberStart + s.linesLength, a = n;
      o <= a && (this._insertLinesAfter(s, o, a, r, t), s.linesLength += a - o + 1);
    } else if (s.rendLineNumberStart + s.linesLength - 1 > n) {
      const o = Math.max(0, n - s.rendLineNumberStart + 1), l = s.linesLength - 1 - o + 1;
      l > 0 && (this._removeLinesAfter(s, l), s.linesLength -= l);
    }
    return this._finishRendering(s, !1, r), s;
  }
  _renderUntouchedLines(e, t, n, r, s) {
    const o = e.rendLineNumberStart, a = e.lines;
    for (let l = t; l <= n; l++) {
      const c = o + l;
      a[l].layoutLine(c, r[c - s], this._lineHeightForLineNumber(c));
    }
  }
  _insertLinesBefore(e, t, n, r, s) {
    const o = [];
    let a = 0;
    for (let l = t; l <= n; l++)
      o[a++] = this._lineFactory.createLine();
    e.lines = o.concat(e.lines);
  }
  _removeLinesBefore(e, t) {
    for (let n = 0; n < t; n++) {
      const r = e.lines[n].getDomNode();
      r == null || r.remove();
    }
    e.lines.splice(0, t);
  }
  _insertLinesAfter(e, t, n, r, s) {
    const o = [];
    let a = 0;
    for (let l = t; l <= n; l++)
      o[a++] = this._lineFactory.createLine();
    e.lines = e.lines.concat(o);
  }
  _removeLinesAfter(e, t) {
    const n = e.linesLength - t;
    for (let r = 0; r < t; r++) {
      const s = e.lines[n + r].getDomNode();
      s == null || s.remove();
    }
    e.lines.splice(n, t);
  }
  _finishRenderingNewLines(e, t, n, r) {
    iy._ttPolicy && (n = iy._ttPolicy.createHTML(n));
    const s = this._domNode.lastChild;
    t || !s ? this._domNode.innerHTML = n : s.insertAdjacentHTML("afterend", n);
    let o = this._domNode.lastChild;
    for (let a = e.linesLength - 1; a >= 0; a--) {
      const l = e.lines[a];
      r[a] && (l.setDomNode(o), o = o.previousSibling);
    }
  }
  _finishRenderingInvalidLines(e, t, n) {
    const r = document.createElement("div");
    iy._ttPolicy && (t = iy._ttPolicy.createHTML(t)), r.innerHTML = t;
    for (let s = 0; s < e.linesLength; s++) {
      const o = e.lines[s];
      if (n[s]) {
        const a = r.firstChild, l = o.getDomNode();
        l.parentNode.replaceChild(a, l), o.setDomNode(a);
      }
    }
  }
  _finishRendering(e, t, n) {
    const r = iy._sb, s = e.linesLength, o = e.lines, a = e.rendLineNumberStart, l = [];
    {
      r.reset();
      let c = !1;
      for (let u = 0; u < s; u++) {
        const d = o[u];
        if (l[u] = !1, d.getDomNode())
          continue;
        const g = u + a;
        d.renderLine(g, n[u], this._lineHeightForLineNumber(g), this._viewportData, r) && (l[u] = !0, c = !0);
      }
      c && this._finishRenderingNewLines(e, t, r.build(), l);
    }
    {
      r.reset();
      let c = !1;
      const u = [];
      for (let d = 0; d < s; d++) {
        const h = o[d];
        if (u[d] = !1, l[d])
          continue;
        const g = d + a;
        h.renderLine(g, n[d], this._lineHeightForLineNumber(g), this._viewportData, r) && (u[d] = !0, c = !0);
      }
      c && this._finishRenderingInvalidLines(e, r.build(), u);
    }
  }
  _lineHeightForLineNumber(e) {
    return this._viewContext.viewLayout.getLineHeightForLineNumber(e);
  }
};
iy._ttPolicy = Db("editorViewLayer", { createHTML: (e) => e }), iy._sb = new ww(1e5);
let ere = iy;
class a3e extends fu {
  constructor(e) {
    super(e), this._dynamicOverlays = [], this._isFocused = !1, this._visibleLines = new o3e(this._context, {
      createLine: () => new uut(this._dynamicOverlays)
    }), this.domNode = this._visibleLines.domNode;
    const n = this._context.configuration.options.get(
      59
      /* EditorOption.fontInfo */
    );
    Ma(this.domNode, n), this.domNode.setClassName("view-overlays");
  }
  shouldRender() {
    if (super.shouldRender())
      return !0;
    for (let e = 0, t = this._dynamicOverlays.length; e < t; e++)
      if (this._dynamicOverlays[e].shouldRender())
        return !0;
    return !1;
  }
  dispose() {
    super.dispose();
    for (let e = 0, t = this._dynamicOverlays.length; e < t; e++)
      this._dynamicOverlays[e].dispose();
    this._dynamicOverlays = [];
  }
  getDomNode() {
    return this.domNode;
  }
  addDynamicOverlay(e) {
    this._dynamicOverlays.push(e);
  }
  // ----- event handlers
  onConfigurationChanged(e) {
    this._visibleLines.onConfigurationChanged(e);
    const n = this._context.configuration.options.get(
      59
      /* EditorOption.fontInfo */
    );
    return Ma(this.domNode, n), !0;
  }
  onFlushed(e) {
    return this._visibleLines.onFlushed(e);
  }
  onFocusChanged(e) {
    return this._isFocused = e.isFocused, !0;
  }
  onLinesChanged(e) {
    return this._visibleLines.onLinesChanged(e);
  }
  onLinesDeleted(e) {
    return this._visibleLines.onLinesDeleted(e);
  }
  onLinesInserted(e) {
    return this._visibleLines.onLinesInserted(e);
  }
  onScrollChanged(e) {
    return this._visibleLines.onScrollChanged(e) || !0;
  }
  onTokensChanged(e) {
    return this._visibleLines.onTokensChanged(e);
  }
  onZonesChanged(e) {
    return this._visibleLines.onZonesChanged(e);
  }
  // ----- end event handlers
  prepareRender(e) {
    const t = this._dynamicOverlays.filter((n) => n.shouldRender());
    for (let n = 0, r = t.length; n < r; n++) {
      const s = t[n];
      s.prepareRender(e), s.onDidRender();
    }
  }
  render(e) {
    this._viewOverlaysRender(e), this.domNode.toggleClassName("focused", this._isFocused);
  }
  _viewOverlaysRender(e) {
    this._visibleLines.renderLines(e.viewportData);
  }
}
class uut {
  constructor(e) {
    this._dynamicOverlays = e, this._domNode = null, this._renderedContent = null;
  }
  getDomNode() {
    return this._domNode ? this._domNode.domNode : null;
  }
  setDomNode(e) {
    this._domNode = Gi(e);
  }
  onContentChanged() {
  }
  onTokensChanged() {
  }
  renderLine(e, t, n, r, s) {
    let o = "";
    for (let a = 0, l = this._dynamicOverlays.length; a < l; a++) {
      const c = this._dynamicOverlays[a];
      o += c.render(r.startLineNumber, e);
    }
    return this._renderedContent === o ? !1 : (this._renderedContent = o, s.appendString('<div style="top:'), s.appendString(String(t)), s.appendString("px;height:"), s.appendString(String(n)), s.appendString("px;line-height:"), s.appendString(String(n)), s.appendString('px;">'), s.appendString(o), s.appendString("</div>"), !0);
  }
  layoutLine(e, t, n) {
    this._domNode && (this._domNode.setTop(t), this._domNode.setHeight(n), this._domNode.setLineHeight(n));
  }
}
class dut extends a3e {
  constructor(e) {
    super(e);
    const n = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._contentWidth = n.contentWidth, this.domNode.setHeight(0);
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const n = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
    return this._contentWidth = n.contentWidth, super.onConfigurationChanged(e) || !0;
  }
  onScrollChanged(e) {
    return super.onScrollChanged(e) || e.scrollWidthChanged;
  }
  // --- end event handlers
  _viewOverlaysRender(e) {
    super._viewOverlaysRender(e), this.domNode.setWidth(Math.max(e.scrollWidth, this._contentWidth));
  }
}
class hut extends a3e {
  constructor(e) {
    super(e);
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._contentLeft = n.contentLeft, this.domNode.setClassName("margin-view-overlays"), this.domNode.setWidth(1), Ma(this.domNode, t.get(
      59
      /* EditorOption.fontInfo */
    ));
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    Ma(this.domNode, t.get(
      59
      /* EditorOption.fontInfo */
    ));
    const n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    return this._contentLeft = n.contentLeft, super.onConfigurationChanged(e) || !0;
  }
  onScrollChanged(e) {
    return super.onScrollChanged(e) || e.scrollHeightChanged;
  }
  _viewOverlaysRender(e) {
    super._viewOverlaysRender(e);
    const t = Math.min(e.scrollHeight, 1e6);
    this.domNode.setHeight(t), this.domNode.setWidth(this._contentLeft);
  }
}
class tK {
  constructor(e) {
    this.onKeyDown = null, this.onKeyUp = null, this.onContextMenu = null, this.onMouseMove = null, this.onMouseLeave = null, this.onMouseDown = null, this.onMouseUp = null, this.onMouseDrag = null, this.onMouseDrop = null, this.onMouseDropCanceled = null, this.onMouseWheel = null, this._coordinatesConverter = e;
  }
  emitKeyDown(e) {
    var t;
    (t = this.onKeyDown) == null || t.call(this, e);
  }
  emitKeyUp(e) {
    var t;
    (t = this.onKeyUp) == null || t.call(this, e);
  }
  emitContextMenu(e) {
    var t;
    (t = this.onContextMenu) == null || t.call(this, this._convertViewToModelMouseEvent(e));
  }
  emitMouseMove(e) {
    var t;
    (t = this.onMouseMove) == null || t.call(this, this._convertViewToModelMouseEvent(e));
  }
  emitMouseLeave(e) {
    var t;
    (t = this.onMouseLeave) == null || t.call(this, this._convertViewToModelMouseEvent(e));
  }
  emitMouseDown(e) {
    var t;
    (t = this.onMouseDown) == null || t.call(this, this._convertViewToModelMouseEvent(e));
  }
  emitMouseUp(e) {
    var t;
    (t = this.onMouseUp) == null || t.call(this, this._convertViewToModelMouseEvent(e));
  }
  emitMouseDrag(e) {
    var t;
    (t = this.onMouseDrag) == null || t.call(this, this._convertViewToModelMouseEvent(e));
  }
  emitMouseDrop(e) {
    var t;
    (t = this.onMouseDrop) == null || t.call(this, this._convertViewToModelMouseEvent(e));
  }
  emitMouseDropCanceled() {
    var e;
    (e = this.onMouseDropCanceled) == null || e.call(this);
  }
  emitMouseWheel(e) {
    var t;
    (t = this.onMouseWheel) == null || t.call(this, e);
  }
  _convertViewToModelMouseEvent(e) {
    return e.target ? {
      event: e.event,
      target: this._convertViewToModelMouseTarget(e.target)
    } : e;
  }
  _convertViewToModelMouseTarget(e) {
    return tK.convertViewToModelMouseTarget(e, this._coordinatesConverter);
  }
  static convertViewToModelMouseTarget(e, t) {
    const n = { ...e };
    return n.position && (n.position = t.convertViewPositionToModelPosition(n.position)), n.range && (n.range = t.convertViewRangeToModelRange(n.range)), (n.type === 5 || n.type === 8) && (n.detail = this.convertViewToModelViewZoneData(n.detail, t)), n;
  }
  static convertViewToModelViewZoneData(e, t) {
    return {
      viewZoneId: e.viewZoneId,
      positionBefore: e.positionBefore ? t.convertViewPositionToModelPosition(e.positionBefore) : e.positionBefore,
      positionAfter: e.positionAfter ? t.convertViewPositionToModelPosition(e.positionAfter) : e.positionAfter,
      position: t.convertViewPositionToModelPosition(e.position),
      afterLineNumber: t.convertViewPositionToModelPosition(new de(e.afterLineNumber, 1)).lineNumber
    };
  }
}
class fut extends fu {
  constructor(e) {
    super(e), this.blocks = [], this.contentWidth = -1, this.contentLeft = 0, this.domNode = Gi(document.createElement("div")), this.domNode.setAttribute("role", "presentation"), this.domNode.setAttribute("aria-hidden", "true"), this.domNode.setClassName("blockDecorations-container"), this.update();
  }
  update() {
    let e = !1;
    const n = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ), r = n.contentWidth - n.verticalScrollbarWidth;
    this.contentWidth !== r && (this.contentWidth = r, e = !0);
    const s = n.contentLeft;
    return this.contentLeft !== s && (this.contentLeft = s, e = !0), e;
  }
  dispose() {
    super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    return this.update();
  }
  onScrollChanged(e) {
    return e.scrollTopChanged || e.scrollLeftChanged;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  prepareRender(e) {
  }
  render(e) {
    let t = 0;
    const n = e.getDecorationsInViewport();
    for (const r of n) {
      if (!r.options.blockClassName)
        continue;
      let s = this.blocks[t];
      s || (s = this.blocks[t] = Gi(document.createElement("div")), this.domNode.appendChild(s));
      let o, a;
      r.options.blockIsAfterEnd ? (o = e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber, !1), a = e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber, !0)) : (o = e.getVerticalOffsetForLineNumber(r.range.startLineNumber, !0), a = r.range.isEmpty() && !r.options.blockDoesNotCollapse ? e.getVerticalOffsetForLineNumber(r.range.startLineNumber, !1) : e.getVerticalOffsetAfterLineNumber(r.range.endLineNumber, !0));
      const [l, c, u, d] = r.options.blockPadding ?? [0, 0, 0, 0];
      s.setClassName("blockDecorations-block " + r.options.blockClassName), s.setLeft(this.contentLeft - d), s.setWidth(this.contentWidth + d + c), s.setTop(o - e.scrollTop - l), s.setHeight(a - o + l + u), t++;
    }
    for (let r = t; r < this.blocks.length; r++)
      this.blocks[r].domNode.remove();
    this.blocks.length = t;
  }
}
class gut extends fu {
  constructor(e, t) {
    super(e), this._viewDomNode = t, this._widgets = {}, this.domNode = Gi(document.createElement("div")), gm.write(
      this.domNode,
      1
      /* PartFingerprint.ContentWidgets */
    ), this.domNode.setClassName("contentWidgets"), this.domNode.setPosition("absolute"), this.domNode.setTop(0), this.overflowingContentWidgetsDomNode = Gi(document.createElement("div")), gm.write(
      this.overflowingContentWidgetsDomNode,
      2
      /* PartFingerprint.OverflowingContentWidgets */
    ), this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets");
  }
  dispose() {
    super.dispose(), this._widgets = {};
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = Object.keys(this._widgets);
    for (const n of t)
      this._widgets[n].onConfigurationChanged(e);
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLineMappingChanged(e) {
    return this._updateAnchorsViewPositions(), !0;
  }
  onLinesChanged(e) {
    return this._updateAnchorsViewPositions(), !0;
  }
  onLinesDeleted(e) {
    return this._updateAnchorsViewPositions(), !0;
  }
  onLinesInserted(e) {
    return this._updateAnchorsViewPositions(), !0;
  }
  onScrollChanged(e) {
    return !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  // ---- end view event handlers
  _updateAnchorsViewPositions() {
    const e = Object.keys(this._widgets);
    for (const t of e)
      this._widgets[t].updateAnchorViewPosition();
  }
  addWidget(e) {
    const t = new put(this._context, this._viewDomNode, e);
    this._widgets[t.id] = t, t.allowEditorOverflow ? this.overflowingContentWidgetsDomNode.appendChild(t.domNode) : this.domNode.appendChild(t.domNode), this.setShouldRender();
  }
  setWidgetPosition(e, t, n, r, s) {
    this._widgets[e.getId()].setPosition(t, n, r, s), this.setShouldRender();
  }
  removeWidget(e) {
    const t = e.getId();
    if (this._widgets.hasOwnProperty(t)) {
      const n = this._widgets[t];
      delete this._widgets[t];
      const r = n.domNode.domNode;
      r.remove(), r.removeAttribute("monaco-visible-content-widget"), this.setShouldRender();
    }
  }
  shouldSuppressMouseDownOnWidget(e) {
    return this._widgets.hasOwnProperty(e) ? this._widgets[e].suppressMouseDown : !1;
  }
  onBeforeRender(e) {
    const t = Object.keys(this._widgets);
    for (const n of t)
      this._widgets[n].onBeforeRender(e);
  }
  prepareRender(e) {
    const t = Object.keys(this._widgets);
    for (const n of t)
      this._widgets[n].prepareRender(e);
  }
  render(e) {
    const t = Object.keys(this._widgets);
    for (const n of t)
      this._widgets[n].render(e);
  }
}
class put {
  constructor(e, t, n) {
    this._primaryAnchor = new UM(null, null), this._secondaryAnchor = new UM(null, null), this._context = e, this._viewDomNode = t, this._actual = n;
    const r = this._context.configuration.options, s = r.get(
      165
      /* EditorOption.layoutInfo */
    ), o = r.get(
      4
      /* EditorOption.allowOverflow */
    );
    this.domNode = Gi(this._actual.getDomNode()), this.id = this._actual.getId(), this.allowEditorOverflow = (this._actual.allowEditorOverflow || !1) && o, this.suppressMouseDown = this._actual.suppressMouseDown || !1, this._fixedOverflowWidgets = r.get(
      51
      /* EditorOption.fixedOverflowWidgets */
    ), this._contentWidth = s.contentWidth, this._contentLeft = s.contentLeft, this._affinity = null, this._preference = [], this._cachedDomNodeOffsetWidth = -1, this._cachedDomNodeOffsetHeight = -1, this._maxWidth = this._getMaxWidth(), this._isVisible = !1, this._renderData = null, this.domNode.setPosition(this._fixedOverflowWidgets && this.allowEditorOverflow ? "fixed" : "absolute"), this.domNode.setDisplay("none"), this.domNode.setVisibility("hidden"), this.domNode.setAttribute("widgetId", this.id), this.domNode.setMaxWidth(this._maxWidth);
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    if (e.hasChanged(
      165
      /* EditorOption.layoutInfo */
    )) {
      const n = t.get(
        165
        /* EditorOption.layoutInfo */
      );
      this._contentLeft = n.contentLeft, this._contentWidth = n.contentWidth, this._maxWidth = this._getMaxWidth();
    }
  }
  updateAnchorViewPosition() {
    this._setPosition(this._affinity, this._primaryAnchor.modelPosition, this._secondaryAnchor.modelPosition);
  }
  _setPosition(e, t, n) {
    this._affinity = e, this._primaryAnchor = r(t, this._context.viewModel, this._affinity), this._secondaryAnchor = r(n, this._context.viewModel, this._affinity);
    function r(s, o, a) {
      if (!s)
        return new UM(null, null);
      const l = o.model.validatePosition(s);
      if (o.coordinatesConverter.modelPositionIsVisible(l)) {
        const c = o.coordinatesConverter.convertModelPositionToViewPosition(l, a ?? void 0);
        return new UM(s, c);
      }
      return new UM(s, null);
    }
  }
  _getMaxWidth() {
    const e = this.domNode.domNode.ownerDocument, t = e.defaultView;
    return this.allowEditorOverflow ? (t == null ? void 0 : t.innerWidth) || e.documentElement.offsetWidth || e.body.offsetWidth : this._contentWidth;
  }
  setPosition(e, t, n, r) {
    this._setPosition(r, e, t), this._preference = n, this._primaryAnchor.viewPosition && this._preference && this._preference.length > 0 ? this.domNode.setDisplay("block") : this.domNode.setDisplay("none"), this._cachedDomNodeOffsetWidth = -1, this._cachedDomNodeOffsetHeight = -1;
  }
  _layoutBoxInViewport(e, t, n, r) {
    const s = e.top, o = s, a = e.top + e.height, l = r.viewportHeight - a, c = s - n, u = o >= n, d = a, h = l >= n;
    let g = e.left;
    return g + t > r.scrollLeft + r.viewportWidth && (g = r.scrollLeft + r.viewportWidth - t), g < r.scrollLeft && (g = r.scrollLeft), { fitsAbove: u, aboveTop: c, fitsBelow: h, belowTop: d, left: g };
  }
  _layoutHorizontalSegmentInPage(e, t, n, r) {
    const a = Math.max(15, t.left - r), l = Math.min(t.left + t.width + r, e.width - 15), u = this._viewDomNode.domNode.ownerDocument.defaultView;
    let d = t.left + n - ((u == null ? void 0 : u.scrollX) ?? 0);
    if (d + r > l) {
      const h = d - (l - r);
      d -= h, n -= h;
    }
    if (d < a) {
      const h = d - a;
      d -= h, n -= h;
    }
    return [n, d];
  }
  _layoutBoxInPage(e, t, n, r) {
    const s = e.top - n, o = e.top + e.height, a = ho(this._viewDomNode.domNode), l = this._viewDomNode.domNode.ownerDocument, c = l.defaultView, u = a.top + s - ((c == null ? void 0 : c.scrollY) ?? 0), d = a.top + o - ((c == null ? void 0 : c.scrollY) ?? 0), h = nw(l.body), [g, m] = this._layoutHorizontalSegmentInPage(h, a, e.left - r.scrollLeft + this._contentLeft, t), _ = 22, v = 22, w = u >= _, E = d + n <= h.height - v;
    return this._fixedOverflowWidgets ? {
      fitsAbove: w,
      aboveTop: Math.max(u, _),
      fitsBelow: E,
      belowTop: d,
      left: m
    } : { fitsAbove: w, aboveTop: s, fitsBelow: E, belowTop: o, left: g };
  }
  _prepareRenderWidgetAtExactPositionOverflowing(e) {
    return new zM(e.top, e.left + this._contentLeft);
  }
  /**
   * Compute the coordinates above and below the primary and secondary anchors.
   * The content widget *must* touch the primary anchor.
   * The content widget should touch if possible the secondary anchor.
   */
  _getAnchorsCoordinates(e) {
    var o, a;
    const t = s(this._primaryAnchor.viewPosition, this._affinity), n = ((o = this._secondaryAnchor.viewPosition) == null ? void 0 : o.lineNumber) === ((a = this._primaryAnchor.viewPosition) == null ? void 0 : a.lineNumber) ? this._secondaryAnchor.viewPosition : null, r = s(n, this._affinity);
    return { primary: t, secondary: r };
    function s(l, c) {
      if (!l)
        return null;
      const u = e.visibleRangeForPosition(l);
      if (!u)
        return null;
      const d = l.column === 1 && c === 3 ? 0 : u.left, h = e.getVerticalOffsetForLineNumber(l.lineNumber) - e.scrollTop, g = e.getLineHeightForLineNumber(l.lineNumber);
      return new FLe(h, d, g);
    }
  }
  _reduceAnchorCoordinates(e, t, n) {
    if (!t)
      return e;
    const r = this._context.configuration.options.get(
      59
      /* EditorOption.fontInfo */
    );
    let s = t.left;
    return s < e.left ? s = Math.max(s, e.left - n + r.typicalFullwidthCharacterWidth) : s = Math.min(s, e.left + n - r.typicalFullwidthCharacterWidth), new FLe(e.top, s, e.height);
  }
  _prepareRenderWidget(e) {
    if (!this._preference || this._preference.length === 0)
      return null;
    const { primary: t, secondary: n } = this._getAnchorsCoordinates(e);
    if (!t)
      return {
        kind: "offViewport",
        preserveFocus: this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)
      };
    if (this._cachedDomNodeOffsetWidth === -1 || this._cachedDomNodeOffsetHeight === -1) {
      let o = null;
      if (typeof this._actual.beforeRender == "function" && (o = nee(this._actual.beforeRender, this._actual)), o)
        this._cachedDomNodeOffsetWidth = o.width, this._cachedDomNodeOffsetHeight = o.height;
      else {
        const l = this.domNode.domNode.getBoundingClientRect();
        this._cachedDomNodeOffsetWidth = Math.round(l.width), this._cachedDomNodeOffsetHeight = Math.round(l.height);
      }
    }
    const r = this._reduceAnchorCoordinates(t, n, this._cachedDomNodeOffsetWidth);
    let s;
    this.allowEditorOverflow ? s = this._layoutBoxInPage(r, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, e) : s = this._layoutBoxInViewport(r, this._cachedDomNodeOffsetWidth, this._cachedDomNodeOffsetHeight, e);
    for (let o = 1; o <= 2; o++)
      for (const a of this._preference)
        if (a === 1) {
          if (!s)
            return null;
          if (o === 2 || s.fitsAbove)
            return {
              kind: "inViewport",
              coordinate: new zM(s.aboveTop, s.left),
              position: 1
              /* ContentWidgetPositionPreference.ABOVE */
            };
        } else if (a === 2) {
          if (!s)
            return null;
          if (o === 2 || s.fitsBelow)
            return {
              kind: "inViewport",
              coordinate: new zM(s.belowTop, s.left),
              position: 2
              /* ContentWidgetPositionPreference.BELOW */
            };
        } else
          return this.allowEditorOverflow ? {
            kind: "inViewport",
            coordinate: this._prepareRenderWidgetAtExactPositionOverflowing(new zM(r.top, r.left)),
            position: 0
            /* ContentWidgetPositionPreference.EXACT */
          } : {
            kind: "inViewport",
            coordinate: new zM(r.top, r.left),
            position: 0
            /* ContentWidgetPositionPreference.EXACT */
          };
    return null;
  }
  /**
   * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.
   */
  onBeforeRender(e) {
    !this._primaryAnchor.viewPosition || !this._preference || this._primaryAnchor.viewPosition.lineNumber < e.startLineNumber || this._primaryAnchor.viewPosition.lineNumber > e.endLineNumber || this.domNode.setMaxWidth(this._maxWidth);
  }
  prepareRender(e) {
    this._renderData = this._prepareRenderWidget(e);
  }
  render(e) {
    var t;
    if (!this._renderData || this._renderData.kind === "offViewport") {
      this._isVisible && (this.domNode.removeAttribute("monaco-visible-content-widget"), this._isVisible = !1, ((t = this._renderData) == null ? void 0 : t.kind) === "offViewport" && this._renderData.preserveFocus ? this.domNode.setTop(-1e3) : this.domNode.setVisibility("hidden")), typeof this._actual.afterRender == "function" && nee(this._actual.afterRender, this._actual, null, null);
      return;
    }
    this.allowEditorOverflow ? (this.domNode.setTop(this._renderData.coordinate.top), this.domNode.setLeft(this._renderData.coordinate.left)) : (this.domNode.setTop(this._renderData.coordinate.top + e.scrollTop - e.bigNumbersDelta), this.domNode.setLeft(this._renderData.coordinate.left)), this._isVisible || (this.domNode.setVisibility("inherit"), this.domNode.setAttribute("monaco-visible-content-widget", "true"), this._isVisible = !0), typeof this._actual.afterRender == "function" && nee(this._actual.afterRender, this._actual, this._renderData.position, this._renderData.coordinate);
  }
}
class UM {
  constructor(e, t) {
    this.modelPosition = e, this.viewPosition = t;
  }
}
class zM {
  constructor(e, t) {
    this.top = e, this.left = t, this._coordinateBrand = void 0;
  }
}
class FLe {
  constructor(e, t, n) {
    this.top = e, this.left = t, this.height = n, this._anchorCoordinateBrand = void 0;
  }
}
function nee(i, e, ...t) {
  try {
    return i.call(e, ...t);
  } catch {
    return null;
  }
}
class Ew extends YT {
}
const to = Vn("themeService");
function Ks(i) {
  return { id: i };
}
function tre(i) {
  switch (i) {
    case Ff.DARK:
      return aN.VS_DARK;
    case Ff.HIGH_CONTRAST_DARK:
      return aN.HC_BLACK;
    case Ff.HIGH_CONTRAST_LIGHT:
      return aN.HC_LIGHT;
    default:
      return aN.VS;
  }
}
const l3e = {
  ThemingContribution: "base.contributions.theming"
};
class mut extends ge {
  constructor() {
    super(), this.themingParticipants = [], this.themingParticipants = [], this.onThemingParticipantAddedEmitter = this._register(new he());
  }
  onColorThemeChange(e) {
    return this.themingParticipants.push(e), this.onThemingParticipantAddedEmitter.fire(e), Et(() => {
      const t = this.themingParticipants.indexOf(e);
      this.themingParticipants.splice(t, 1);
    });
  }
  getThemingParticipants() {
    return this.themingParticipants;
  }
}
const c3e = new mut();
Fs.add(l3e.ThemingContribution, c3e);
function ng(i) {
  return c3e.onColorThemeChange(i);
}
class _ut extends ge {
  constructor(e) {
    super(), this.themeService = e, this.theme = e.getColorTheme(), this._register(this.themeService.onDidColorThemeChange((t) => this.onThemeChange(t)));
  }
  onThemeChange(e) {
    this.theme = e, this.updateStyles();
  }
  updateStyles() {
  }
}
const u3e = ie("editor.lineHighlightBackground", null, S(607, "Background color for the highlight of line at the cursor position.")), BLe = ie("editor.lineHighlightBorder", { dark: "#282828", light: "#eeeeee", hcDark: "#f38518", hcLight: hi }, S(608, "Background color for the border around the line at the cursor position."));
ie("editor.rangeHighlightBackground", { dark: "#ffffff0b", light: "#fdff0033", hcDark: null, hcLight: null }, S(609, "Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("editor.rangeHighlightBorder", { dark: null, light: null, hcDark: fs, hcLight: fs }, S(610, "Background color of the border around highlighted ranges."));
ie("editor.symbolHighlightBackground", { dark: vy, light: vy, hcDark: null, hcLight: null }, S(611, "Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("editor.symbolHighlightBorder", { dark: null, light: null, hcDark: fs, hcLight: fs }, S(612, "Background color of the border around highlighted symbols."));
const nK = ie("editorCursor.foreground", { dark: "#AEAFAD", light: De.black, hcDark: De.white, hcLight: "#0F4A85" }, S(613, "Color of the editor cursor.")), Afe = ie("editorCursor.background", null, S(614, "The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")), d3e = ie("editorMultiCursor.primary.foreground", nK, S(615, "Color of the primary editor cursor when multiple cursors are present.")), but = ie("editorMultiCursor.primary.background", Afe, S(616, "The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")), h3e = ie("editorMultiCursor.secondary.foreground", nK, S(617, "Color of secondary editor cursors when multiple cursors are present.")), vut = ie("editorMultiCursor.secondary.background", Afe, S(618, "The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")), Ofe = ie("editorWhitespace.foreground", { dark: "#e3e4e229", light: "#33333333", hcDark: "#e3e4e229", hcLight: "#CCCCCC" }, S(619, "Color of whitespace characters in the editor.")), yut = ie("editorLineNumber.foreground", { dark: "#858585", light: "#237893", hcDark: De.white, hcLight: "#292929" }, S(620, "Color of editor line numbers.")), Cut = ie("editorIndentGuide.background", Ofe, S(621, "Color of the editor indentation guides."), !1, S(622, "'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")), wut = ie("editorIndentGuide.activeBackground", Ofe, S(623, "Color of the active editor indentation guides."), !1, S(624, "'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")), TB = ie("editorIndentGuide.background1", Cut, S(625, "Color of the editor indentation guides (1).")), Sut = ie("editorIndentGuide.background2", "#00000000", S(626, "Color of the editor indentation guides (2).")), Eut = ie("editorIndentGuide.background3", "#00000000", S(627, "Color of the editor indentation guides (3).")), xut = ie("editorIndentGuide.background4", "#00000000", S(628, "Color of the editor indentation guides (4).")), Lut = ie("editorIndentGuide.background5", "#00000000", S(629, "Color of the editor indentation guides (5).")), Tut = ie("editorIndentGuide.background6", "#00000000", S(630, "Color of the editor indentation guides (6).")), kB = ie("editorIndentGuide.activeBackground1", wut, S(631, "Color of the active editor indentation guides (1).")), kut = ie("editorIndentGuide.activeBackground2", "#00000000", S(632, "Color of the active editor indentation guides (2).")), Dut = ie("editorIndentGuide.activeBackground3", "#00000000", S(633, "Color of the active editor indentation guides (3).")), Iut = ie("editorIndentGuide.activeBackground4", "#00000000", S(634, "Color of the active editor indentation guides (4).")), Nut = ie("editorIndentGuide.activeBackground5", "#00000000", S(635, "Color of the active editor indentation guides (5).")), Rut = ie("editorIndentGuide.activeBackground6", "#00000000", S(636, "Color of the active editor indentation guides (6).")), Aut = ie("editorActiveLineNumber.foreground", { dark: "#c6c6c6", light: "#0B216F", hcDark: fs, hcLight: fs }, S(637, "Color of editor active line number"), !1, S(638, "Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));
ie("editorLineNumber.activeForeground", Aut, S(639, "Color of editor active line number"));
const Out = ie("editorLineNumber.dimmedForeground", null, S(640, "Color of the final editor line when editor.renderFinalNewline is set to dimmed.")), Mut = ie("editorRuler.foreground", { dark: "#5A5A5A", light: De.lightgrey, hcDark: De.white, hcLight: "#292929" }, S(641, "Color of the editor rulers."));
ie("editorCodeLens.foreground", { dark: "#999999", light: "#919191", hcDark: "#999999", hcLight: "#292929" }, S(642, "Foreground color of editor CodeLens"));
ie("editorBracketMatch.background", { dark: "#0064001a", light: "#0064001a", hcDark: "#0064001a", hcLight: "#0000" }, S(643, "Background color behind matching brackets"));
ie("editorBracketMatch.border", { dark: "#888", light: "#B9B9B9", hcDark: hi, hcLight: hi }, S(644, "Color for matching brackets boxes"));
const Put = ie("editorOverviewRuler.border", { dark: "#7f7f7f4d", light: "#7f7f7f4d", hcDark: "#7f7f7f4d", hcLight: "#666666" }, S(645, "Color of the overview ruler border.")), Fut = ie("editorOverviewRuler.background", null, S(646, "Background color of the editor overview ruler."));
ie("editorGutter.background", yo, S(647, "Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));
ie("editorUnnecessaryCode.border", { dark: null, light: null, hcDark: De.fromHex("#fff").transparent(0.8), hcLight: hi }, S(648, "Border color of unnecessary (unused) source code in the editor."));
const But = ie("editorUnnecessaryCode.opacity", { dark: De.fromHex("#000a"), light: De.fromHex("#0007"), hcDark: null, hcLight: null }, S(649, `Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the  'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));
ie("editorGhostText.border", { dark: null, light: null, hcDark: De.fromHex("#fff").transparent(0.8), hcLight: De.fromHex("#292929").transparent(0.8) }, S(650, "Border color of ghost text in the editor."));
const Hut = ie("editorGhostText.foreground", { dark: De.fromHex("#ffffff56"), light: De.fromHex("#0007"), hcDark: null, hcLight: null }, S(651, "Foreground color of the ghost text in the editor."));
ie("editorGhostText.background", null, S(652, "Background color of the ghost text in the editor."));
const Wut = new De(new Ne(0, 122, 204, 0.6)), f3e = ie("editorOverviewRuler.rangeHighlightForeground", Wut, S(653, "Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."), !0), Vut = ie("editorOverviewRuler.errorForeground", { dark: new De(new Ne(255, 18, 18, 0.7)), light: new De(new Ne(255, 18, 18, 0.7)), hcDark: new De(new Ne(255, 50, 50, 1)), hcLight: "#B5200D" }, S(654, "Overview ruler marker color for errors.")), Uut = ie("editorOverviewRuler.warningForeground", { dark: Xy, light: Xy, hcDark: p4, hcLight: p4 }, S(655, "Overview ruler marker color for warnings.")), zut = ie("editorOverviewRuler.infoForeground", { dark: gb, light: gb, hcDark: m4, hcLight: m4 }, S(656, "Overview ruler marker color for infos.")), g3e = ie("editorBracketHighlight.foreground1", { dark: "#FFD700", light: "#0431FAFF", hcDark: "#FFD700", hcLight: "#0431FAFF" }, S(657, "Foreground color of brackets (1). Requires enabling bracket pair colorization.")), p3e = ie("editorBracketHighlight.foreground2", { dark: "#DA70D6", light: "#319331FF", hcDark: "#DA70D6", hcLight: "#319331FF" }, S(658, "Foreground color of brackets (2). Requires enabling bracket pair colorization.")), m3e = ie("editorBracketHighlight.foreground3", { dark: "#179FFF", light: "#7B3814FF", hcDark: "#87CEFA", hcLight: "#7B3814FF" }, S(659, "Foreground color of brackets (3). Requires enabling bracket pair colorization.")), _3e = ie("editorBracketHighlight.foreground4", "#00000000", S(660, "Foreground color of brackets (4). Requires enabling bracket pair colorization.")), b3e = ie("editorBracketHighlight.foreground5", "#00000000", S(661, "Foreground color of brackets (5). Requires enabling bracket pair colorization.")), v3e = ie("editorBracketHighlight.foreground6", "#00000000", S(662, "Foreground color of brackets (6). Requires enabling bracket pair colorization.")), $ut = ie("editorBracketHighlight.unexpectedBracket.foreground", { dark: new De(new Ne(255, 18, 18, 0.8)), light: new De(new Ne(255, 18, 18, 0.8)), hcDark: new De(new Ne(255, 50, 50, 1)), hcLight: "#B5200D" }, S(663, "Foreground color of unexpected brackets.")), jut = ie("editorBracketPairGuide.background1", "#00000000", S(664, "Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")), Gut = ie("editorBracketPairGuide.background2", "#00000000", S(665, "Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")), qut = ie("editorBracketPairGuide.background3", "#00000000", S(666, "Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")), Kut = ie("editorBracketPairGuide.background4", "#00000000", S(667, "Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")), Yut = ie("editorBracketPairGuide.background5", "#00000000", S(668, "Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")), Xut = ie("editorBracketPairGuide.background6", "#00000000", S(669, "Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")), Zut = ie("editorBracketPairGuide.activeBackground1", "#00000000", S(670, "Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")), Qut = ie("editorBracketPairGuide.activeBackground2", "#00000000", S(671, "Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")), Jut = ie("editorBracketPairGuide.activeBackground3", "#00000000", S(672, "Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")), edt = ie("editorBracketPairGuide.activeBackground4", "#00000000", S(673, "Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")), tdt = ie("editorBracketPairGuide.activeBackground5", "#00000000", S(674, "Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")), ndt = ie("editorBracketPairGuide.activeBackground6", "#00000000", S(675, "Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));
ie("editorUnicodeHighlight.border", Xy, S(676, "Border color used to highlight unicode characters."));
ie("editorUnicodeHighlight.background", Oat, S(677, "Background color used to highlight unicode characters."));
ng((i, e) => {
  const t = i.getColor(yo), n = i.getColor(u3e), r = n && !n.isTransparent() ? n : t;
  r && e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`);
});
class y3e extends Ew {
  constructor(e) {
    super(), this._context = e;
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._renderLineHighlight = t.get(
      110
      /* EditorOption.renderLineHighlight */
    ), this._renderLineHighlightOnlyWhenFocus = t.get(
      111
      /* EditorOption.renderLineHighlightOnlyWhenFocus */
    ), this._wordWrap = n.isViewportWrapping, this._contentLeft = n.contentLeft, this._contentWidth = n.contentWidth, this._selectionIsEmpty = !0, this._focused = !1, this._cursorLineNumbers = [1], this._selections = [new bt(1, 1, 1, 1)], this._renderData = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), super.dispose();
  }
  _readFromSelections() {
    let e = !1;
    const t = /* @__PURE__ */ new Set();
    for (const s of this._selections)
      t.add(s.positionLineNumber);
    const n = Array.from(t);
    n.sort((s, o) => s - o), ds(this._cursorLineNumbers, n) || (this._cursorLineNumbers = n, e = !0);
    const r = this._selections.every((s) => s.isEmpty());
    return this._selectionIsEmpty !== r && (this._selectionIsEmpty = r, e = !0), e;
  }
  // --- begin event handlers
  onThemeChanged(e) {
    return this._readFromSelections();
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    return this._renderLineHighlight = t.get(
      110
      /* EditorOption.renderLineHighlight */
    ), this._renderLineHighlightOnlyWhenFocus = t.get(
      111
      /* EditorOption.renderLineHighlightOnlyWhenFocus */
    ), this._wordWrap = n.isViewportWrapping, this._contentLeft = n.contentLeft, this._contentWidth = n.contentWidth, !0;
  }
  onCursorStateChanged(e) {
    return this._selections = e.selections, this._readFromSelections();
  }
  onFlushed(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollWidthChanged || e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onFocusChanged(e) {
    return this._renderLineHighlightOnlyWhenFocus ? (this._focused = e.isFocused, !0) : !1;
  }
  // --- end event handlers
  prepareRender(e) {
    if (!this._shouldRenderThis()) {
      this._renderData = null;
      return;
    }
    const t = e.visibleRange.startLineNumber, n = e.visibleRange.endLineNumber, r = [];
    for (let o = t; o <= n; o++) {
      const a = o - t;
      r[a] = "";
    }
    if (this._wordWrap) {
      const o = this._renderOne(e, !1);
      for (const a of this._cursorLineNumbers) {
        const l = this._context.viewModel.coordinatesConverter, c = l.convertViewPositionToModelPosition(new de(a, 1)).lineNumber, u = l.convertModelPositionToViewPosition(new de(c, 1)).lineNumber, d = l.convertModelPositionToViewPosition(new de(c, this._context.viewModel.model.getLineMaxColumn(c))).lineNumber, h = Math.max(u, t), g = Math.min(d, n);
        for (let m = h; m <= g; m++) {
          const _ = m - t;
          r[_] = o;
        }
      }
    }
    const s = this._renderOne(e, !0);
    for (const o of this._cursorLineNumbers) {
      if (o < t || o > n)
        continue;
      const a = o - t;
      r[a] = s;
    }
    this._renderData = r;
  }
  render(e, t) {
    if (!this._renderData)
      return "";
    const n = t - e;
    return n >= this._renderData.length ? "" : this._renderData[n];
  }
  _shouldRenderInMargin() {
    return (this._renderLineHighlight === "gutter" || this._renderLineHighlight === "all") && (!this._renderLineHighlightOnlyWhenFocus || this._focused);
  }
  _shouldRenderInContent() {
    return (this._renderLineHighlight === "line" || this._renderLineHighlight === "all") && this._selectionIsEmpty && (!this._renderLineHighlightOnlyWhenFocus || this._focused);
  }
}
class idt extends y3e {
  _renderOne(e, t) {
    return `<div class="${"current-line" + (this._shouldRenderInMargin() ? " current-line-both" : "") + (t ? " current-line-exact" : "")}" style="width:${Math.max(e.scrollWidth, this._contentWidth)}px;"></div>`;
  }
  _shouldRenderThis() {
    return this._shouldRenderInContent();
  }
  _shouldRenderOther() {
    return this._shouldRenderInMargin();
  }
}
class rdt extends y3e {
  _renderOne(e, t) {
    return `<div class="${"current-line" + (this._shouldRenderInMargin() ? " current-line-margin" : "") + (this._shouldRenderOther() ? " current-line-margin-both" : "") + (this._shouldRenderInMargin() && t ? " current-line-exact-margin" : "")}" style="width:${this._contentLeft}px"></div>`;
  }
  _shouldRenderThis() {
    return !0;
  }
  _shouldRenderOther() {
    return this._shouldRenderInContent();
  }
}
ng((i, e) => {
  const t = i.getColor(u3e);
  if (t && (e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`), e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)), !t || t.isTransparent() || i.defines(BLe)) {
    const n = i.getColor(BLe);
    n && (e.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${n}; }`), e.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${n}; }`), am(i.type) && (e.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"), e.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")));
  }
});
class sdt extends Ew {
  constructor(e) {
    super(), this._context = e;
    const t = this._context.configuration.options;
    this._typicalHalfwidthCharacterWidth = t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth, this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    return this._typicalHalfwidthCharacterWidth = t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth, !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged || e.scrollWidthChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  prepareRender(e) {
    const t = e.getDecorationsInViewport();
    let n = [], r = 0;
    for (let l = 0, c = t.length; l < c; l++) {
      const u = t[l];
      u.options.className && (n[r++] = u);
    }
    n = n.sort((l, c) => {
      if (l.options.zIndex < c.options.zIndex)
        return -1;
      if (l.options.zIndex > c.options.zIndex)
        return 1;
      const u = l.options.className, d = c.options.className;
      return u < d ? -1 : u > d ? 1 : z.compareRangesUsingStarts(l.range, c.range);
    });
    const s = e.visibleRange.startLineNumber, o = e.visibleRange.endLineNumber, a = [];
    for (let l = s; l <= o; l++) {
      const c = l - s;
      a[c] = "";
    }
    this._renderWholeLineDecorations(e, n, a), this._renderNormalDecorations(e, n, a), this._renderResult = a;
  }
  _renderWholeLineDecorations(e, t, n) {
    const r = e.visibleRange.startLineNumber, s = e.visibleRange.endLineNumber;
    for (let o = 0, a = t.length; o < a; o++) {
      const l = t[o];
      if (!l.options.isWholeLine)
        continue;
      const c = '<div class="cdr ' + l.options.className + '" style="left:0;width:100%;"></div>', u = Math.max(l.range.startLineNumber, r), d = Math.min(l.range.endLineNumber, s);
      for (let h = u; h <= d; h++) {
        const g = h - r;
        n[g] += c;
      }
    }
  }
  _renderNormalDecorations(e, t, n) {
    const r = e.visibleRange.startLineNumber;
    let s = null, o = !1, a = null, l = !1;
    for (let c = 0, u = t.length; c < u; c++) {
      const d = t[c];
      if (d.options.isWholeLine)
        continue;
      const h = d.options.className, g = !!d.options.showIfCollapsed;
      let m = d.range;
      if (g && m.endColumn === 1 && m.endLineNumber !== m.startLineNumber && (m = new z(m.startLineNumber, m.startColumn, m.endLineNumber - 1, this._context.viewModel.getLineMaxColumn(m.endLineNumber - 1))), s === h && o === g && z.areIntersectingOrTouching(a, m)) {
        a = z.plusRange(a, m);
        continue;
      }
      s !== null && this._renderNormalDecoration(e, a, s, l, o, r, n), s = h, o = g, a = m, l = d.options.shouldFillLineOnLineBreak ?? !1;
    }
    s !== null && this._renderNormalDecoration(e, a, s, l, o, r, n);
  }
  _renderNormalDecoration(e, t, n, r, s, o, a) {
    const l = e.linesVisibleRangesForRange(
      t,
      /*TODO@Alex*/
      n === "findMatch"
    );
    if (l)
      for (let c = 0, u = l.length; c < u; c++) {
        const d = l[c];
        if (d.outsideRenderedLine)
          continue;
        const h = d.lineNumber - o;
        if (s && d.ranges.length === 1) {
          const g = d.ranges[0];
          if (g.width < this._typicalHalfwidthCharacterWidth) {
            const m = Math.round(g.left + g.width / 2), _ = Math.max(0, Math.round(m - this._typicalHalfwidthCharacterWidth / 2));
            d.ranges[0] = new xB(_, this._typicalHalfwidthCharacterWidth);
          }
        }
        for (let g = 0, m = d.ranges.length; g < m; g++) {
          const _ = r && d.continuesOnNextLine && m === 1, v = d.ranges[g], w = '<div class="cdr ' + n + '" style="left:' + String(v.left) + "px;width:" + (_ ? "100%;" : String(v.width) + "px;") + '"></div>';
          a[h] += w;
        }
      }
  }
  render(e, t) {
    if (!this._renderResult)
      return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
class odt extends fu {
  constructor(e, t, n, r) {
    super(e);
    const s = this._context.configuration.options, o = s.get(
      117
      /* EditorOption.scrollbar */
    ), a = s.get(
      83
      /* EditorOption.mouseWheelScrollSensitivity */
    ), l = s.get(
      49
      /* EditorOption.fastScrollSensitivity */
    ), c = s.get(
      120
      /* EditorOption.scrollPredominantAxis */
    ), u = s.get(
      158
      /* EditorOption.inertialScroll */
    ), d = {
      listenOnDomNode: n.domNode,
      className: "editor-scrollable " + tre(e.theme.type),
      useShadows: !1,
      lazyRender: !0,
      vertical: o.vertical,
      horizontal: o.horizontal,
      verticalHasArrows: o.verticalHasArrows,
      horizontalHasArrows: o.horizontalHasArrows,
      verticalScrollbarSize: o.verticalScrollbarSize,
      verticalSliderSize: o.verticalSliderSize,
      horizontalScrollbarSize: o.horizontalScrollbarSize,
      horizontalSliderSize: o.horizontalSliderSize,
      handleMouseWheel: o.handleMouseWheel,
      alwaysConsumeMouseWheel: o.alwaysConsumeMouseWheel,
      arrowSize: o.arrowSize,
      mouseWheelScrollSensitivity: a,
      fastScrollSensitivity: l,
      scrollPredominantAxis: c,
      scrollByPage: o.scrollByPage,
      inertialScroll: u
    };
    this.scrollbar = this._register(new eK(t.domNode, d, this._context.viewLayout.getScrollable())), gm.write(
      this.scrollbar.getDomNode(),
      6
      /* PartFingerprint.ScrollableElement */
    ), this.scrollbarDomNode = Gi(this.scrollbar.getDomNode()), this.scrollbarDomNode.setPosition("absolute"), this._setLayout();
    const h = (g, m, _) => {
      const v = {};
      {
        const w = g.scrollTop;
        w && (v.scrollTop = this._context.viewLayout.getCurrentScrollTop() + w, g.scrollTop = 0);
      }
      if (_) {
        const w = g.scrollLeft;
        w && (v.scrollLeft = this._context.viewLayout.getCurrentScrollLeft() + w, g.scrollLeft = 0);
      }
      this._context.viewModel.viewLayout.setScrollPosition(
        v,
        1
        /* ScrollType.Immediate */
      );
    };
    this._register(Ce(n.domNode, "scroll", (g) => h(n.domNode, !0, !0))), this._register(Ce(t.domNode, "scroll", (g) => h(t.domNode, !0, !1))), this._register(Ce(r.domNode, "scroll", (g) => h(r.domNode, !0, !1))), this._register(Ce(this.scrollbarDomNode.domNode, "scroll", (g) => h(this.scrollbarDomNode.domNode, !0, !1)));
  }
  dispose() {
    super.dispose();
  }
  _setLayout() {
    const e = this._context.configuration.options, t = e.get(
      165
      /* EditorOption.layoutInfo */
    );
    this.scrollbarDomNode.setLeft(t.contentLeft), e.get(
      81
      /* EditorOption.minimap */
    ).side === "right" ? this.scrollbarDomNode.setWidth(t.contentWidth + t.minimap.minimapWidth) : this.scrollbarDomNode.setWidth(t.contentWidth), this.scrollbarDomNode.setHeight(t.height);
  }
  getOverviewRulerLayoutInfo() {
    return this.scrollbar.getOverviewRulerLayoutInfo();
  }
  getDomNode() {
    return this.scrollbarDomNode;
  }
  delegateVerticalScrollbarPointerDown(e) {
    this.scrollbar.delegateVerticalScrollbarPointerDown(e);
  }
  delegateScrollFromMouseWheelEvent(e) {
    this.scrollbar.delegateScrollFromMouseWheelEvent(e);
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    if (e.hasChanged(
      117
      /* EditorOption.scrollbar */
    ) || e.hasChanged(
      83
      /* EditorOption.mouseWheelScrollSensitivity */
    ) || e.hasChanged(
      49
      /* EditorOption.fastScrollSensitivity */
    )) {
      const t = this._context.configuration.options, n = t.get(
        117
        /* EditorOption.scrollbar */
      ), r = t.get(
        83
        /* EditorOption.mouseWheelScrollSensitivity */
      ), s = t.get(
        49
        /* EditorOption.fastScrollSensitivity */
      ), o = t.get(
        120
        /* EditorOption.scrollPredominantAxis */
      ), a = {
        vertical: n.vertical,
        horizontal: n.horizontal,
        verticalScrollbarSize: n.verticalScrollbarSize,
        horizontalScrollbarSize: n.horizontalScrollbarSize,
        scrollByPage: n.scrollByPage,
        handleMouseWheel: n.handleMouseWheel,
        mouseWheelScrollSensitivity: r,
        fastScrollSensitivity: s,
        scrollPredominantAxis: o
      };
      this.scrollbar.updateOptions(a);
    }
    return e.hasChanged(
      165
      /* EditorOption.layoutInfo */
    ) && this._setLayout(), !0;
  }
  onScrollChanged(e) {
    return !0;
  }
  onThemeChanged(e) {
    return this.scrollbar.updateClassName("editor-scrollable " + tre(this._context.theme.type)), !0;
  }
  // --- end event handlers
  prepareRender(e) {
  }
  render(e) {
    this.scrollbar.renderNow();
  }
}
class nre {
  constructor(e, t, n, r, s) {
    this.startLineNumber = e, this.endLineNumber = t, this.className = n, this.tooltip = r, this._decorationToRenderBrand = void 0, this.zIndex = s ?? 0;
  }
}
class adt {
  constructor(e, t, n) {
    this.className = e, this.zIndex = t, this.tooltip = n;
  }
}
class ldt {
  constructor() {
    this.decorations = [];
  }
  add(e) {
    this.decorations.push(e);
  }
  getDecorations() {
    return this.decorations;
  }
}
class C3e extends Ew {
  /**
   * Returns an array with an element for each visible line number.
   */
  _render(e, t, n) {
    const r = [];
    for (let a = e; a <= t; a++) {
      const l = a - e;
      r[l] = new ldt();
    }
    if (n.length === 0)
      return r;
    n.sort((a, l) => a.className === l.className ? a.startLineNumber === l.startLineNumber ? a.endLineNumber - l.endLineNumber : a.startLineNumber - l.startLineNumber : a.className < l.className ? -1 : 1);
    let s = null, o = 0;
    for (let a = 0, l = n.length; a < l; a++) {
      const c = n[a], u = c.className, d = c.zIndex;
      let h = Math.max(c.startLineNumber, e) - e;
      const g = Math.min(c.endLineNumber, t) - e;
      s === u ? (h = Math.max(o + 1, h), o = Math.max(o, g)) : (s = u, o = g);
      for (let m = h; m <= o; m++)
        r[m].add(new adt(u, d, c.tooltip));
    }
    return r;
  }
}
class cdt extends fu {
  constructor(e) {
    super(e), this._widgets = {}, this._context = e;
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    this.domNode = Gi(document.createElement("div")), this.domNode.setClassName("glyph-margin-widgets"), this.domNode.setPosition("absolute"), this.domNode.setTop(0), this._lineHeight = t.get(
      75
      /* EditorOption.lineHeight */
    ), this._glyphMargin = t.get(
      66
      /* EditorOption.glyphMargin */
    ), this._glyphMarginLeft = n.glyphMarginLeft, this._glyphMarginWidth = n.glyphMarginWidth, this._glyphMarginDecorationLaneCount = n.glyphMarginDecorationLaneCount, this._managedDomNodes = [], this._decorationGlyphsToRender = [];
  }
  dispose() {
    this._managedDomNodes = [], this._decorationGlyphsToRender = [], this._widgets = {}, super.dispose();
  }
  getWidgets() {
    return Object.values(this._widgets);
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    return this._lineHeight = t.get(
      75
      /* EditorOption.lineHeight */
    ), this._glyphMargin = t.get(
      66
      /* EditorOption.glyphMargin */
    ), this._glyphMarginLeft = n.glyphMarginLeft, this._glyphMarginWidth = n.glyphMarginWidth, this._glyphMarginDecorationLaneCount = n.glyphMarginDecorationLaneCount, !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  // --- begin widget management
  addWidget(e) {
    const t = Gi(e.getDomNode());
    this._widgets[e.getId()] = {
      widget: e,
      preference: e.getPosition(),
      domNode: t,
      renderInfo: null
    }, t.setPosition("absolute"), t.setDisplay("none"), t.setAttribute("widgetId", e.getId()), this.domNode.appendChild(t), this.setShouldRender();
  }
  setWidgetPosition(e, t) {
    const n = this._widgets[e.getId()];
    return n.preference.lane === t.lane && n.preference.zIndex === t.zIndex && z.equalsRange(n.preference.range, t.range) ? !1 : (n.preference = t, this.setShouldRender(), !0);
  }
  removeWidget(e) {
    const t = e.getId();
    if (this._widgets[t]) {
      const r = this._widgets[t].domNode.domNode;
      delete this._widgets[t], r.remove(), this.setShouldRender();
    }
  }
  // --- end widget management
  _collectDecorationBasedGlyphRenderRequest(e, t) {
    var o;
    const n = e.visibleRange.startLineNumber, r = e.visibleRange.endLineNumber, s = e.getDecorationsInViewport();
    for (const a of s) {
      const l = a.options.glyphMarginClassName;
      if (!l)
        continue;
      const c = Math.max(a.range.startLineNumber, n), u = Math.min(a.range.endLineNumber, r), d = ((o = a.options.glyphMargin) == null ? void 0 : o.position) ?? fm.Center, h = a.options.zIndex ?? 0;
      for (let g = c; g <= u; g++) {
        const m = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new de(g, 0)), _ = this._context.viewModel.glyphLanes.getLanesAtLine(m.lineNumber).indexOf(d);
        t.push(new udt(g, _, h, l));
      }
    }
  }
  _collectWidgetBasedGlyphRenderRequest(e, t) {
    const n = e.visibleRange.startLineNumber, r = e.visibleRange.endLineNumber;
    for (const s of Object.values(this._widgets)) {
      const o = s.preference.range, { startLineNumber: a, endLineNumber: l } = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(z.lift(o));
      if (!a || !l || l < n || a > r)
        continue;
      const c = Math.max(a, n), u = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new de(c, 0)), d = this._context.viewModel.glyphLanes.getLanesAtLine(u.lineNumber).indexOf(s.preference.lane);
      t.push(new ddt(c, d, s.preference.zIndex, s));
    }
  }
  _collectSortedGlyphRenderRequests(e) {
    const t = [];
    return this._collectDecorationBasedGlyphRenderRequest(e, t), this._collectWidgetBasedGlyphRenderRequest(e, t), t.sort((n, r) => n.lineNumber === r.lineNumber ? n.laneIndex === r.laneIndex ? n.zIndex === r.zIndex ? r.type === n.type ? n.type === 0 && r.type === 0 ? n.className < r.className ? -1 : 1 : 0 : r.type - n.type : r.zIndex - n.zIndex : n.laneIndex - r.laneIndex : n.lineNumber - r.lineNumber), t;
  }
  /**
   * Will store render information in each widget's renderInfo and in `_decorationGlyphsToRender`.
   */
  prepareRender(e) {
    if (!this._glyphMargin) {
      this._decorationGlyphsToRender = [];
      return;
    }
    for (const r of Object.values(this._widgets))
      r.renderInfo = null;
    const t = new Ky(this._collectSortedGlyphRenderRequests(e)), n = [];
    for (; t.length > 0; ) {
      const r = t.peek();
      if (!r)
        break;
      const s = t.takeWhile((a) => a.lineNumber === r.lineNumber && a.laneIndex === r.laneIndex);
      if (!s || s.length === 0)
        break;
      const o = s[0];
      if (o.type === 0) {
        const a = [];
        for (const l of s) {
          if (l.zIndex !== o.zIndex || l.type !== o.type)
            break;
          (a.length === 0 || a[a.length - 1] !== l.className) && a.push(l.className);
        }
        n.push(o.accept(a.join(" ")));
      } else
        o.widget.renderInfo = {
          lineNumber: o.lineNumber,
          laneIndex: o.laneIndex
        };
    }
    this._decorationGlyphsToRender = n;
  }
  render(e) {
    if (!this._glyphMargin) {
      for (const n of Object.values(this._widgets))
        n.domNode.setDisplay("none");
      for (; this._managedDomNodes.length > 0; ) {
        const n = this._managedDomNodes.pop();
        n == null || n.domNode.remove();
      }
      return;
    }
    const t = Math.round(this._glyphMarginWidth / this._glyphMarginDecorationLaneCount);
    for (const n of Object.values(this._widgets))
      if (!n.renderInfo)
        n.domNode.setDisplay("none");
      else {
        const r = e.viewportData.relativeVerticalOffset[n.renderInfo.lineNumber - e.viewportData.startLineNumber], s = this._glyphMarginLeft + n.renderInfo.laneIndex * this._lineHeight;
        n.domNode.setDisplay("block"), n.domNode.setTop(r), n.domNode.setLeft(s), n.domNode.setWidth(t), n.domNode.setHeight(this._lineHeight);
      }
    for (let n = 0; n < this._decorationGlyphsToRender.length; n++) {
      const r = this._decorationGlyphsToRender[n], s = r.lineNumber, o = e.viewportData.relativeVerticalOffset[s - e.viewportData.startLineNumber], a = this._glyphMarginLeft + r.laneIndex * this._lineHeight;
      let l;
      n < this._managedDomNodes.length ? l = this._managedDomNodes[n] : (l = Gi(document.createElement("div")), this._managedDomNodes.push(l), this.domNode.appendChild(l));
      const c = this._context.viewLayout.getLineHeightForLineNumber(s);
      l.setClassName("cgmr codicon " + r.combinedClassName), l.setPosition("absolute"), l.setTop(o), l.setLeft(a), l.setWidth(t), l.setHeight(c);
    }
    for (; this._managedDomNodes.length > this._decorationGlyphsToRender.length; ) {
      const n = this._managedDomNodes.pop();
      n == null || n.domNode.remove();
    }
  }
}
class udt {
  constructor(e, t, n, r) {
    this.lineNumber = e, this.laneIndex = t, this.zIndex = n, this.className = r, this.type = 0;
  }
  accept(e) {
    return new hdt(this.lineNumber, this.laneIndex, e);
  }
}
class ddt {
  constructor(e, t, n, r) {
    this.lineNumber = e, this.laneIndex = t, this.zIndex = n, this.widget = r, this.type = 1;
  }
}
class hdt {
  constructor(e, t, n) {
    this.lineNumber = e, this.laneIndex = t, this.combinedClassName = n;
  }
}
function w4(i, e, t = i.length - 1) {
  const n = fdt(i, e, t);
  if (n !== -1)
    return i[n];
}
function fdt(i, e, t = i.length - 1) {
  for (let n = t; n >= 0; n--) {
    const r = i[n];
    if (e(r))
      return n;
  }
  return -1;
}
function tA(i, e) {
  const t = nA(i, e);
  return t === -1 ? void 0 : i[t];
}
function nA(i, e, t = 0, n = i.length) {
  let r = t, s = n;
  for (; r < s; ) {
    const o = Math.floor((r + s) / 2);
    e(i[o]) ? r = o + 1 : s = o;
  }
  return r - 1;
}
function gdt(i, e) {
  const t = S4(i, e);
  return t === i.length ? void 0 : i[t];
}
function S4(i, e, t = 0, n = i.length) {
  let r = t, s = n;
  for (; r < s; ) {
    const o = Math.floor((r + s) / 2);
    e(i[o]) ? s = o : r = o + 1;
  }
  return r;
}
const Wj = class Wj {
  constructor(e) {
    this._array = e, this._findLastMonotonousLastIdx = 0;
  }
  /**
   * The predicate must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!
   * For subsequent calls, current predicate must be weaker than (or equal to) the previous predicate, i.e. more entries must be `true`.
   */
  findLastMonotonous(e) {
    if (Wj.assertInvariants) {
      if (this._prevFindLastPredicate) {
        for (const n of this._array)
          if (this._prevFindLastPredicate(n) && !e(n))
            throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");
      }
      this._prevFindLastPredicate = e;
    }
    const t = nA(this._array, e, this._findLastMonotonousLastIdx);
    return this._findLastMonotonousLastIdx = t + 1, t === -1 ? void 0 : this._array[t];
  }
};
Wj.assertInvariants = !1;
let aU = Wj;
function Mfe(i, e) {
  if (i.length === 0)
    return;
  let t = i[0];
  for (let n = 1; n < i.length; n++) {
    const r = i[n];
    e(r, t) > 0 && (t = r);
  }
  return t;
}
function w3e(i, e) {
  if (i.length === 0)
    return;
  let t = i[0];
  for (let n = 1; n < i.length; n++) {
    const r = i[n];
    e(r, t) >= 0 && (t = r);
  }
  return t;
}
function S3e(i, e) {
  return Mfe(i, (t, n) => -e(t, n));
}
function pdt(i, e) {
  if (i.length === 0)
    return -1;
  let t = 0;
  for (let n = 1; n < i.length; n++) {
    const r = i[n];
    e(r, i[t]) > 0 && (t = n);
  }
  return t;
}
function mdt(i, e) {
  for (const t of i) {
    const n = e(t);
    if (n !== void 0)
      return n;
  }
}
class E3e extends ge {
  constructor() {
    super(...arguments), this._isDisposed = !1;
  }
  dispose() {
    super.dispose(), this._isDisposed = !0;
  }
  assertNotDisposed() {
    if (this._isDisposed)
      throw new Error("TextModelPart is disposed!");
  }
}
function iK(i, e) {
  let t = 0, n = 0;
  const r = i.length;
  for (; n < r; ) {
    const s = i.charCodeAt(n);
    if (s === 32)
      t++;
    else if (s === 9)
      t = t - t % e + e;
    else
      break;
    n++;
  }
  return n === r ? -1 : t;
}
var Bx;
(function(i) {
  i[i.Disabled = 0] = "Disabled", i[i.EnabledForActive = 1] = "EnabledForActive", i[i.Enabled = 2] = "Enabled";
})(Bx || (Bx = {}));
class px {
  constructor(e, t, n, r, s, o) {
    if (this.visibleColumn = e, this.column = t, this.className = n, this.horizontalLine = r, this.forWrappedLinesAfterColumn = s, this.forWrappedLinesBeforeOrAtColumn = o, e !== -1 == (t !== -1))
      throw new Error();
  }
}
class xF {
  constructor(e, t) {
    this.top = e, this.endColumn = t;
  }
}
class _dt extends E3e {
  constructor(e, t) {
    super(), this.textModel = e, this.languageConfigurationService = t;
  }
  getLanguageConfiguration(e) {
    return this.languageConfigurationService.getLanguageConfiguration(e);
  }
  _computeIndentLevel(e) {
    return iK(this.textModel.getLineContent(e + 1), this.textModel.getOptions().tabSize);
  }
  getActiveIndentGuide(e, t, n) {
    this.assertNotDisposed();
    const r = this.textModel.getLineCount();
    if (e < 1 || e > r)
      throw new Wt("Illegal value for lineNumber");
    const s = this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules, o = !!(s && s.offSide);
    let a = -2, l = -1, c = -2, u = -1;
    const d = (R) => {
      if (a !== -1 && (a === -2 || a > R - 1)) {
        a = -1, l = -1;
        for (let M = R - 2; M >= 0; M--) {
          const B = this._computeIndentLevel(M);
          if (B >= 0) {
            a = M, l = B;
            break;
          }
        }
      }
      if (c === -2) {
        c = -1, u = -1;
        for (let M = R; M < r; M++) {
          const B = this._computeIndentLevel(M);
          if (B >= 0) {
            c = M, u = B;
            break;
          }
        }
      }
    };
    let h = -2, g = -1, m = -2, _ = -1;
    const v = (R) => {
      if (h === -2) {
        h = -1, g = -1;
        for (let M = R - 2; M >= 0; M--) {
          const B = this._computeIndentLevel(M);
          if (B >= 0) {
            h = M, g = B;
            break;
          }
        }
      }
      if (m !== -1 && (m === -2 || m < R - 1)) {
        m = -1, _ = -1;
        for (let M = R; M < r; M++) {
          const B = this._computeIndentLevel(M);
          if (B >= 0) {
            m = M, _ = B;
            break;
          }
        }
      }
    };
    let w = 0, E = !0, L = 0, T = !0, D = 0, N = 0;
    for (let R = 0; E || T; R++) {
      const M = e - R, B = e + R;
      R > 1 && (M < 1 || M < t) && (E = !1), R > 1 && (B > r || B > n) && (T = !1), R > 5e4 && (E = !1, T = !1);
      let H = -1;
      if (E && M >= 1) {
        const K = this._computeIndentLevel(M - 1);
        K >= 0 ? (c = M - 1, u = K, H = Math.ceil(K / this.textModel.getOptions().indentSize)) : (d(M), H = this._getIndentLevelForWhitespaceLine(o, l, u));
      }
      let j = -1;
      if (T && B <= r) {
        const K = this._computeIndentLevel(B - 1);
        K >= 0 ? (h = B - 1, g = K, j = Math.ceil(K / this.textModel.getOptions().indentSize)) : (v(B), j = this._getIndentLevelForWhitespaceLine(o, g, _));
      }
      if (R === 0) {
        N = H;
        continue;
      }
      if (R === 1) {
        if (B <= r && j >= 0 && N + 1 === j) {
          E = !1, w = B, L = B, D = j;
          continue;
        }
        if (M >= 1 && H >= 0 && H - 1 === N) {
          T = !1, w = M, L = M, D = H;
          continue;
        }
        if (w = e, L = e, D = N, D === 0)
          return { startLineNumber: w, endLineNumber: L, indent: D };
      }
      E && (H >= D ? w = M : E = !1), T && (j >= D ? L = B : T = !1);
    }
    return { startLineNumber: w, endLineNumber: L, indent: D };
  }
  getLinesBracketGuides(e, t, n, r) {
    var d;
    const s = [];
    for (let h = e; h <= t; h++)
      s.push([]);
    const o = !0, a = this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new z(e, 1, t, this.textModel.getLineMaxColumn(t))).toArray();
    let l;
    if (n && a.length > 0) {
      const h = (e <= n.lineNumber && n.lineNumber <= t ? a : this.textModel.bracketPairs.getBracketPairsInRange(z.fromPositions(n)).toArray()).filter((g) => z.strictContainsPosition(g.range, n));
      l = (d = w4(h, (g) => o)) == null ? void 0 : d.range;
    }
    const c = this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType, u = new x3e();
    for (const h of a) {
      if (!h.closingBracketRange)
        continue;
      const g = l && h.range.equalsRange(l);
      if (!g && !r.includeInactive)
        continue;
      const m = u.getInlineClassName(h.nestingLevel, h.nestingLevelOfEqualBracketType, c) + (r.highlightActive && g ? " " + u.activeClassName : ""), _ = h.openingBracketRange.getStartPosition(), v = h.closingBracketRange.getStartPosition(), w = r.horizontalGuides === Bx.Enabled || r.horizontalGuides === Bx.EnabledForActive && g;
      if (h.range.startLineNumber === h.range.endLineNumber) {
        w && s[h.range.startLineNumber - e].push(new px(-1, h.openingBracketRange.getEndPosition().column, m, new xF(!1, v.column), -1, -1));
        continue;
      }
      const E = this.getVisibleColumnFromPosition(v), L = this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()), T = Math.min(L, E, h.minVisibleColumnIndentation + 1);
      let D = !1;
      Tc(this.textModel.getLineContent(h.closingBracketRange.startLineNumber)) < h.closingBracketRange.startColumn - 1 && (D = !0);
      const M = Math.max(_.lineNumber, e), B = Math.min(v.lineNumber, t), H = D ? 1 : 0;
      for (let j = M; j < B + H; j++)
        s[j - e].push(new px(T, -1, m, null, j === _.lineNumber ? _.column : -1, j === v.lineNumber ? v.column : -1));
      w && (_.lineNumber >= e && L > T && s[_.lineNumber - e].push(new px(T, -1, m, new xF(!1, _.column), -1, -1)), v.lineNumber <= t && E > T && s[v.lineNumber - e].push(new px(T, -1, m, new xF(!D, v.column), -1, -1)));
    }
    for (const h of s)
      h.sort((g, m) => g.visibleColumn - m.visibleColumn);
    return s;
  }
  getVisibleColumnFromPosition(e) {
    return As.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber), e.column, this.textModel.getOptions().tabSize) + 1;
  }
  getLinesIndentGuides(e, t) {
    this.assertNotDisposed();
    const n = this.textModel.getLineCount();
    if (e < 1 || e > n)
      throw new Error("Illegal value for startLineNumber");
    if (t < 1 || t > n)
      throw new Error("Illegal value for endLineNumber");
    const r = this.textModel.getOptions(), s = this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules, o = !!(s && s.offSide), a = new Array(t - e + 1);
    let l = -2, c = -1, u = -2, d = -1;
    for (let h = e; h <= t; h++) {
      const g = h - e, m = this._computeIndentLevel(h - 1);
      if (m >= 0) {
        l = h - 1, c = m, a[g] = Math.ceil(m / r.indentSize);
        continue;
      }
      if (l === -2) {
        l = -1, c = -1;
        for (let _ = h - 2; _ >= 0; _--) {
          const v = this._computeIndentLevel(_);
          if (v >= 0) {
            l = _, c = v;
            break;
          }
        }
      }
      if (u !== -1 && (u === -2 || u < h - 1)) {
        u = -1, d = -1;
        for (let _ = h; _ < n; _++) {
          const v = this._computeIndentLevel(_);
          if (v >= 0) {
            u = _, d = v;
            break;
          }
        }
      }
      a[g] = this._getIndentLevelForWhitespaceLine(o, c, d);
    }
    return a;
  }
  _getIndentLevelForWhitespaceLine(e, t, n) {
    const r = this.textModel.getOptions();
    return t === -1 || n === -1 ? 0 : t < n ? 1 + Math.floor(t / r.indentSize) : t === n || e ? Math.ceil(n / r.indentSize) : 1 + Math.floor(n / r.indentSize);
  }
}
class x3e {
  constructor() {
    this.activeClassName = "indent-active";
  }
  getInlineClassName(e, t, n) {
    return this.getInlineClassNameOfLevel(n ? t : e);
  }
  getInlineClassNameOfLevel(e) {
    return `bracket-indent-guide lvl-${e % 30}`;
  }
}
class bdt extends Ew {
  constructor(e) {
    super(), this._context = e, this._primaryPosition = null;
    const t = this._context.configuration.options, n = t.get(
      166
      /* EditorOption.wrappingInfo */
    ), r = t.get(
      59
      /* EditorOption.fontInfo */
    );
    this._spaceWidth = r.spaceWidth, this._maxIndentLeft = n.wrappingColumn === -1 ? -1 : n.wrappingColumn * r.typicalHalfwidthCharacterWidth, this._bracketPairGuideOptions = t.get(
      22
      /* EditorOption.guides */
    ), this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = this._context.configuration.options, n = t.get(
      166
      /* EditorOption.wrappingInfo */
    ), r = t.get(
      59
      /* EditorOption.fontInfo */
    );
    return this._spaceWidth = r.spaceWidth, this._maxIndentLeft = n.wrappingColumn === -1 ? -1 : n.wrappingColumn * r.typicalHalfwidthCharacterWidth, this._bracketPairGuideOptions = t.get(
      22
      /* EditorOption.guides */
    ), !0;
  }
  onCursorStateChanged(e) {
    var r;
    const n = e.selections[0].getPosition();
    return (r = this._primaryPosition) != null && r.equals(n) ? !1 : (this._primaryPosition = n, !0);
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onLanguageConfigurationChanged(e) {
    return !0;
  }
  // --- end event handlers
  prepareRender(e) {
    var l, c;
    if (!this._bracketPairGuideOptions.indentation && this._bracketPairGuideOptions.bracketPairs === !1) {
      this._renderResult = null;
      return;
    }
    const t = e.visibleRange.startLineNumber, n = e.visibleRange.endLineNumber, r = e.scrollWidth, s = this._primaryPosition, o = this.getGuidesByLine(t, Math.min(n + 1, this._context.viewModel.getLineCount()), s), a = [];
    for (let u = t; u <= n; u++) {
      const d = u - t, h = o[d];
      let g = "";
      const m = ((l = e.visibleRangeForPosition(new de(u, 1))) == null ? void 0 : l.left) ?? 0;
      for (const _ of h) {
        const v = _.column === -1 ? m + (_.visibleColumn - 1) * this._spaceWidth : e.visibleRangeForPosition(new de(u, _.column)).left;
        if (v > r || this._maxIndentLeft > 0 && v > this._maxIndentLeft)
          break;
        const w = _.horizontalLine ? _.horizontalLine.top ? "horizontal-top" : "horizontal-bottom" : "vertical", E = _.horizontalLine ? (((c = e.visibleRangeForPosition(new de(u, _.horizontalLine.endColumn))) == null ? void 0 : c.left) ?? v + this._spaceWidth) - v : this._spaceWidth;
        g += `<div class="core-guide ${_.className} ${w}" style="left:${v}px;width:${E}px"></div>`;
      }
      a[d] = g;
    }
    this._renderResult = a;
  }
  getGuidesByLine(e, t, n) {
    const r = this._bracketPairGuideOptions.bracketPairs !== !1 ? this._context.viewModel.getBracketGuidesInRangeByLine(e, t, n, {
      highlightActive: this._bracketPairGuideOptions.highlightActiveBracketPair,
      horizontalGuides: this._bracketPairGuideOptions.bracketPairsHorizontal === !0 ? Bx.Enabled : this._bracketPairGuideOptions.bracketPairsHorizontal === "active" ? Bx.EnabledForActive : Bx.Disabled,
      includeInactive: this._bracketPairGuideOptions.bracketPairs === !0
    }) : null, s = this._bracketPairGuideOptions.indentation ? this._context.viewModel.getLinesIndentGuides(e, t) : null;
    let o = 0, a = 0, l = 0;
    if (this._bracketPairGuideOptions.highlightActiveIndentation !== !1 && n) {
      const d = this._context.viewModel.getActiveIndentGuide(n.lineNumber, e, t);
      o = d.startLineNumber, a = d.endLineNumber, l = d.indent;
    }
    const { indentSize: c } = this._context.viewModel.model.getOptions(), u = [];
    for (let d = e; d <= t; d++) {
      const h = new Array();
      u.push(h);
      const g = r ? r[d - e] : [], m = new Ky(g), _ = s ? s[d - e] : 0;
      for (let v = 1; v <= _; v++) {
        const w = (v - 1) * c + 1, E = (
          // Disable active indent guide if there are bracket guides.
          (this._bracketPairGuideOptions.highlightActiveIndentation === "always" || g.length === 0) && o <= d && d <= a && v === l
        );
        h.push(...m.takeWhile((T) => T.visibleColumn < w) || []);
        const L = m.peek();
        (!L || L.visibleColumn !== w || L.horizontalLine) && h.push(new px(w, -1, `core-guide-indent lvl-${(v - 1) % 30}` + (E ? " indent-active" : ""), null, -1, -1));
      }
      h.push(...m.takeWhile((v) => !0) || []);
    }
    return u;
  }
  render(e, t) {
    if (!this._renderResult)
      return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
function gI(i) {
  if (!(i && i.isTransparent()))
    return i;
}
ng((i, e) => {
  const t = [
    { bracketColor: g3e, guideColor: jut, guideColorActive: Zut },
    { bracketColor: p3e, guideColor: Gut, guideColorActive: Qut },
    { bracketColor: m3e, guideColor: qut, guideColorActive: Jut },
    { bracketColor: _3e, guideColor: Kut, guideColorActive: edt },
    { bracketColor: b3e, guideColor: Yut, guideColorActive: tdt },
    { bracketColor: v3e, guideColor: Xut, guideColorActive: ndt }
  ], n = new x3e(), r = [
    { indentColor: TB, indentColorActive: kB },
    { indentColor: Sut, indentColorActive: kut },
    { indentColor: Eut, indentColorActive: Dut },
    { indentColor: xut, indentColorActive: Iut },
    { indentColor: Lut, indentColorActive: Nut },
    { indentColor: Tut, indentColorActive: Rut }
  ], s = t.map((a) => {
    const l = i.getColor(a.bracketColor), c = i.getColor(a.guideColor), u = i.getColor(a.guideColorActive), d = gI(gI(c) ?? (l == null ? void 0 : l.transparent(0.3))), h = gI(gI(u) ?? l);
    if (!(!d || !h))
      return {
        guideColor: d,
        guideColorActive: h
      };
  }).filter(Aa), o = r.map((a) => {
    const l = i.getColor(a.indentColor), c = i.getColor(a.indentColorActive), u = gI(l), d = gI(c);
    if (!(!u || !d))
      return {
        indentColor: u,
        indentColorActive: d
      };
  }).filter(Aa);
  if (s.length > 0) {
    for (let a = 0; a < 30; a++) {
      const l = s[a % s.length];
      e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(a).replace(/ /g, ".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`);
    }
    e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"), e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"), e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"), e.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`), e.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`), e.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`);
  }
  if (o.length > 0) {
    for (let a = 0; a < 30; a++) {
      const l = o[a % o.length];
      e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`);
    }
    e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"), e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }");
  }
});
const Vj = class Vj extends Ew {
  constructor(e) {
    super(), this._context = e, this._readConfig(), this._lastCursorModelPosition = new de(1, 1), this._renderResult = null, this._activeModelLineNumber = 1, this._context.addEventHandler(this);
  }
  _readConfig() {
    const e = this._context.configuration.options;
    this._lineHeight = e.get(
      75
      /* EditorOption.lineHeight */
    );
    const t = e.get(
      76
      /* EditorOption.lineNumbers */
    );
    this._renderLineNumbers = t.renderType, this._renderCustomLineNumbers = t.renderFn, this._renderFinalNewline = e.get(
      109
      /* EditorOption.renderFinalNewline */
    );
    const n = e.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._lineNumbersLeft = n.lineNumbersLeft, this._lineNumbersWidth = n.lineNumbersWidth;
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    return this._readConfig(), !0;
  }
  onCursorStateChanged(e) {
    const t = e.selections[0].getPosition();
    this._lastCursorModelPosition = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);
    let n = !1;
    return this._activeModelLineNumber !== this._lastCursorModelPosition.lineNumber && (this._activeModelLineNumber = this._lastCursorModelPosition.lineNumber, n = !0), (this._renderLineNumbers === 2 || this._renderLineNumbers === 3) && (n = !0), n;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return e.affectsLineNumber;
  }
  // --- end event handlers
  _getLineRenderLineNumber(e) {
    const t = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new de(e, 1));
    if (t.column !== 1)
      return "";
    const n = t.lineNumber;
    if (this._renderCustomLineNumbers)
      return this._renderCustomLineNumbers(n);
    if (this._renderLineNumbers === 2) {
      const r = Math.abs(this._lastCursorModelPosition.lineNumber - n);
      return r === 0 ? '<span class="relative-current-line-number">' + n + "</span>" : String(r);
    }
    if (this._renderLineNumbers === 3) {
      if (this._lastCursorModelPosition.lineNumber === n || n % 10 === 0)
        return String(n);
      const r = this._context.viewModel.getLineCount();
      return n === r ? String(n) : "";
    }
    return String(n);
  }
  prepareRender(e) {
    if (this._renderLineNumbers === 0) {
      this._renderResult = null;
      return;
    }
    const t = Qu ? this._lineHeight % 2 === 0 ? " lh-even" : " lh-odd" : "", n = e.visibleRange.startLineNumber, r = e.visibleRange.endLineNumber, s = this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter((c) => !!c.options.lineNumberClassName);
    s.sort((c, u) => z.compareRangesUsingEnds(c.range, u.range));
    let o = 0;
    const a = this._context.viewModel.getLineCount(), l = [];
    for (let c = n; c <= r; c++) {
      const u = c - n, d = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new de(c, 1)).lineNumber;
      let h = this._getLineRenderLineNumber(c), g = "";
      for (; o < s.length && s[o].range.endLineNumber < c; )
        o++;
      for (let m = o; m < s.length; m++) {
        const { range: _, options: v } = s[m];
        _.startLineNumber <= c && (g += " " + v.lineNumberClassName);
      }
      if (!h && !g) {
        l[u] = "";
        continue;
      }
      c === a && this._context.viewModel.getLineLength(c) === 0 && (this._renderFinalNewline === "off" && (h = ""), this._renderFinalNewline === "dimmed" && (g += " dimmed-line-number")), d === this._activeModelLineNumber && (g += " active-line-number"), l[u] = `<div class="${Vj.CLASS_NAME}${t}${g}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${h}</div>`;
    }
    this._renderResult = l;
  }
  render(e, t) {
    if (!this._renderResult)
      return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
};
Vj.CLASS_NAME = "line-numbers";
let lU = Vj;
ng((i, e) => {
  const t = i.getColor(yut), n = i.getColor(Out);
  n ? e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`) : t && e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(0.4)}; }`);
});
const QN = "monaco-mouse-cursor-text";
class iee {
  get didDomLayout() {
    return this._didDomLayout;
  }
  readClientRect() {
    if (!this._clientRectRead) {
      this._clientRectRead = !0;
      const e = this._domNode.getBoundingClientRect();
      this.markDidDomLayout(), this._clientRectDeltaLeft = e.left, this._clientRectScale = e.width / this._domNode.offsetWidth;
    }
  }
  get clientRectDeltaLeft() {
    return this._clientRectRead || this.readClientRect(), this._clientRectDeltaLeft;
  }
  get clientRectScale() {
    return this._clientRectRead || this.readClientRect(), this._clientRectScale;
  }
  constructor(e, t) {
    this._domNode = e, this.endNode = t, this._didDomLayout = !1, this._clientRectDeltaLeft = 0, this._clientRectScale = 1, this._clientRectRead = !1;
  }
  markDidDomLayout() {
    this._didDomLayout = !0;
  }
}
class cU {
  constructor(e, t) {
    this.themeType = t;
    const n = e.options, r = n.get(
      59
      /* EditorOption.fontInfo */
    );
    this.renderWhitespace = n.get(
      113
      /* EditorOption.renderWhitespace */
    ), this.experimentalWhitespaceRendering = n.get(
      47
      /* EditorOption.experimentalWhitespaceRendering */
    ), this.renderControlCharacters = n.get(
      108
      /* EditorOption.renderControlCharacters */
    ), this.spaceWidth = r.spaceWidth, this.middotWidth = r.middotWidth, this.wsmiddotWidth = r.wsmiddotWidth, this.useMonospaceOptimizations = r.isMonospace && !n.get(
      40
      /* EditorOption.disableMonospaceOptimizations */
    ), this.canUseHalfwidthRightwardsArrow = r.canUseHalfwidthRightwardsArrow, this.lineHeight = n.get(
      75
      /* EditorOption.lineHeight */
    ), this.stopRenderingLineAfter = n.get(
      133
      /* EditorOption.stopRenderingLineAfter */
    ), this.fontLigatures = n.get(
      60
      /* EditorOption.fontLigatures */
    ), this.verticalScrollbarSize = n.get(
      117
      /* EditorOption.scrollbar */
    ).verticalScrollbarSize, this.useGpu = n.get(
      46
      /* EditorOption.experimentalGpuAcceleration */
    ) === "on";
  }
  equals(e) {
    return this.themeType === e.themeType && this.renderWhitespace === e.renderWhitespace && this.experimentalWhitespaceRendering === e.experimentalWhitespaceRendering && this.renderControlCharacters === e.renderControlCharacters && this.spaceWidth === e.spaceWidth && this.middotWidth === e.middotWidth && this.wsmiddotWidth === e.wsmiddotWidth && this.useMonospaceOptimizations === e.useMonospaceOptimizations && this.canUseHalfwidthRightwardsArrow === e.canUseHalfwidthRightwardsArrow && this.lineHeight === e.lineHeight && this.stopRenderingLineAfter === e.stopRenderingLineAfter && this.fontLigatures === e.fontLigatures && this.verticalScrollbarSize === e.verticalScrollbarSize && this.useGpu === e.useGpu;
  }
}
class vdt {
  constructor() {
    this._currentVisibleRange = new z(1, 1, 1, 1);
  }
  getCurrentVisibleRange() {
    return this._currentVisibleRange;
  }
  setCurrentVisibleRange(e) {
    this._currentVisibleRange = e;
  }
}
class ydt {
  constructor(e, t, n, r, s, o, a) {
    this.minimalReveal = e, this.lineNumber = t, this.startColumn = n, this.endColumn = r, this.startScrollTop = s, this.stopScrollTop = o, this.scrollType = a, this.type = "range", this.minLineNumber = t, this.maxLineNumber = t;
  }
}
class Cdt {
  constructor(e, t, n, r, s) {
    this.minimalReveal = e, this.selections = t, this.startScrollTop = n, this.stopScrollTop = r, this.scrollType = s, this.type = "selections";
    let o = t[0].startLineNumber, a = t[0].endLineNumber;
    for (let l = 1, c = t.length; l < c; l++) {
      const u = t[l];
      o = Math.min(o, u.startLineNumber), a = Math.max(a, u.endLineNumber);
    }
    this.minLineNumber = o, this.maxLineNumber = a;
  }
}
const Uj = class Uj extends fu {
  constructor(e, t, n) {
    super(e);
    const r = this._context.configuration, s = this._context.configuration.options, o = s.get(
      59
      /* EditorOption.fontInfo */
    ), a = s.get(
      166
      /* EditorOption.wrappingInfo */
    );
    this._lineHeight = s.get(
      75
      /* EditorOption.lineHeight */
    ), this._typicalHalfwidthCharacterWidth = o.typicalHalfwidthCharacterWidth, this._isViewportWrapping = a.isViewportWrapping, this._revealHorizontalRightPadding = s.get(
      114
      /* EditorOption.revealHorizontalRightPadding */
    ), this._cursorSurroundingLines = s.get(
      35
      /* EditorOption.cursorSurroundingLines */
    ), this._cursorSurroundingLinesStyle = s.get(
      36
      /* EditorOption.cursorSurroundingLinesStyle */
    ), this._canUseLayerHinting = !s.get(
      39
      /* EditorOption.disableLayerHinting */
    ), this._viewLineOptions = new cU(r, this._context.theme.type), this._linesContent = n, this._textRangeRestingSpot = document.createElement("div"), this._visibleLines = new o3e(this._context, {
      createLine: () => new dy(t, this._viewLineOptions)
    }), this.domNode = this._visibleLines.domNode, gm.write(
      this.domNode,
      8
      /* PartFingerprint.ViewLines */
    ), this.domNode.setClassName(`view-lines ${QN}`), Ma(this.domNode, o), this._maxLineWidth = 0, this._asyncUpdateLineWidths = new mr(() => {
      this._updateLineWidthsSlow();
    }, 200), this._asyncCheckMonospaceFontAssumptions = new mr(() => {
      this._checkMonospaceFontAssumptions();
    }, 2e3), this._lastRenderedData = new vdt(), this._horizontalRevealRequest = null, this._stickyScrollEnabled = s.get(
      131
      /* EditorOption.stickyScroll */
    ).enabled, this._maxNumberStickyLines = s.get(
      131
      /* EditorOption.stickyScroll */
    ).maxLineCount;
  }
  dispose() {
    this._asyncUpdateLineWidths.dispose(), this._asyncCheckMonospaceFontAssumptions.dispose(), super.dispose();
  }
  getDomNode() {
    return this.domNode;
  }
  // ---- begin view event handlers
  onConfigurationChanged(e) {
    this._visibleLines.onConfigurationChanged(e), e.hasChanged(
      166
      /* EditorOption.wrappingInfo */
    ) && (this._maxLineWidth = 0);
    const t = this._context.configuration.options, n = t.get(
      59
      /* EditorOption.fontInfo */
    ), r = t.get(
      166
      /* EditorOption.wrappingInfo */
    );
    return this._lineHeight = t.get(
      75
      /* EditorOption.lineHeight */
    ), this._typicalHalfwidthCharacterWidth = n.typicalHalfwidthCharacterWidth, this._isViewportWrapping = r.isViewportWrapping, this._revealHorizontalRightPadding = t.get(
      114
      /* EditorOption.revealHorizontalRightPadding */
    ), this._cursorSurroundingLines = t.get(
      35
      /* EditorOption.cursorSurroundingLines */
    ), this._cursorSurroundingLinesStyle = t.get(
      36
      /* EditorOption.cursorSurroundingLinesStyle */
    ), this._canUseLayerHinting = !t.get(
      39
      /* EditorOption.disableLayerHinting */
    ), this._stickyScrollEnabled = t.get(
      131
      /* EditorOption.stickyScroll */
    ).enabled, this._maxNumberStickyLines = t.get(
      131
      /* EditorOption.stickyScroll */
    ).maxLineCount, Ma(this.domNode, n), this._onOptionsMaybeChanged(), e.hasChanged(
      165
      /* EditorOption.layoutInfo */
    ) && (this._maxLineWidth = 0), !0;
  }
  _onOptionsMaybeChanged() {
    const e = this._context.configuration, t = new cU(e, this._context.theme.type);
    if (!this._viewLineOptions.equals(t)) {
      this._viewLineOptions = t;
      const n = this._visibleLines.getStartLineNumber(), r = this._visibleLines.getEndLineNumber();
      for (let s = n; s <= r; s++)
        this._visibleLines.getVisibleLine(s).onOptionsChanged(this._viewLineOptions);
      return !0;
    }
    return !1;
  }
  onCursorStateChanged(e) {
    const t = this._visibleLines.getStartLineNumber(), n = this._visibleLines.getEndLineNumber();
    let r = !1;
    for (let s = t; s <= n; s++)
      r = this._visibleLines.getVisibleLine(s).onSelectionChanged() || r;
    return r;
  }
  onDecorationsChanged(e) {
    {
      const t = this._visibleLines.getStartLineNumber(), n = this._visibleLines.getEndLineNumber();
      for (let r = t; r <= n; r++)
        this._visibleLines.getVisibleLine(r).onDecorationsChanged();
    }
    return !0;
  }
  onFlushed(e) {
    const t = this._visibleLines.onFlushed(e, this._viewLineOptions.useGpu);
    return this._maxLineWidth = 0, t;
  }
  onLinesChanged(e) {
    return this._visibleLines.onLinesChanged(e);
  }
  onLinesDeleted(e) {
    return this._visibleLines.onLinesDeleted(e);
  }
  onLinesInserted(e) {
    return this._visibleLines.onLinesInserted(e);
  }
  onRevealRangeRequest(e) {
    const t = this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(), e.source, e.minimalReveal, e.range, e.selections, e.verticalType);
    if (t === -1)
      return !1;
    let n = this._context.viewLayout.validateScrollPosition({ scrollTop: t });
    e.revealHorizontal ? e.range && e.range.startLineNumber !== e.range.endLineNumber ? n = {
      scrollTop: n.scrollTop,
      scrollLeft: 0
    } : e.range ? this._horizontalRevealRequest = new ydt(e.minimalReveal, e.range.startLineNumber, e.range.startColumn, e.range.endColumn, this._context.viewLayout.getCurrentScrollTop(), n.scrollTop, e.scrollType) : e.selections && e.selections.length > 0 && (this._horizontalRevealRequest = new Cdt(e.minimalReveal, e.selections, this._context.viewLayout.getCurrentScrollTop(), n.scrollTop, e.scrollType)) : this._horizontalRevealRequest = null;
    const s = Math.abs(this._context.viewLayout.getCurrentScrollTop() - n.scrollTop) <= this._lineHeight ? 1 : e.scrollType;
    return this._context.viewModel.viewLayout.setScrollPosition(n, s), !0;
  }
  onScrollChanged(e) {
    if (this._horizontalRevealRequest && e.scrollLeftChanged && (this._horizontalRevealRequest = null), this._horizontalRevealRequest && e.scrollTopChanged) {
      const t = Math.min(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop), n = Math.max(this._horizontalRevealRequest.startScrollTop, this._horizontalRevealRequest.stopScrollTop);
      (e.scrollTop < t || e.scrollTop > n) && (this._horizontalRevealRequest = null);
    }
    return this.domNode.setWidth(e.scrollWidth), this._visibleLines.onScrollChanged(e) || !0;
  }
  onTokensChanged(e) {
    return this._visibleLines.onTokensChanged(e);
  }
  onZonesChanged(e) {
    return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth), this._visibleLines.onZonesChanged(e);
  }
  onThemeChanged(e) {
    return this._onOptionsMaybeChanged();
  }
  // ---- end view event handlers
  // ----------- HELPERS FOR OTHERS
  getPositionFromDOMInfo(e, t) {
    const n = this._getViewLineDomNode(e);
    if (n === null)
      return null;
    const r = this._getLineNumberFor(n);
    if (r === -1 || r < 1 || r > this._context.viewModel.getLineCount())
      return null;
    if (this._context.viewModel.getLineMaxColumn(r) === 1)
      return new de(r, 1);
    const s = this._visibleLines.getStartLineNumber(), o = this._visibleLines.getEndLineNumber();
    if (r < s || r > o)
      return null;
    let a = this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e, t);
    const l = this._context.viewModel.getLineMinColumn(r);
    return a < l && (a = l), new de(r, a);
  }
  _getViewLineDomNode(e) {
    for (; e && e.nodeType === 1; ) {
      if (e.className === dy.CLASS_NAME)
        return e;
      e = e.parentElement;
    }
    return null;
  }
  /**
   * @returns the line number of this view line dom node.
   */
  _getLineNumberFor(e) {
    const t = this._visibleLines.getStartLineNumber(), n = this._visibleLines.getEndLineNumber();
    for (let r = t; r <= n; r++) {
      const s = this._visibleLines.getVisibleLine(r);
      if (e === s.getDomNode())
        return r;
    }
    return -1;
  }
  getLineWidth(e) {
    const t = this._visibleLines.getStartLineNumber(), n = this._visibleLines.getEndLineNumber();
    if (e < t || e > n)
      return -1;
    const r = new iee(this.domNode.domNode, this._textRangeRestingSpot), s = this._visibleLines.getVisibleLine(e).getWidth(r);
    return this._updateLineWidthsSlowIfDomDidLayout(r), s;
  }
  linesVisibleRangesForRange(e, t) {
    if (this.shouldRender())
      return null;
    const n = e.endLineNumber, r = z.intersectRanges(e, this._lastRenderedData.getCurrentVisibleRange());
    if (!r)
      return null;
    const s = [];
    let o = 0;
    const a = new iee(this.domNode.domNode, this._textRangeRestingSpot);
    let l = 0;
    t && (l = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new de(r.startLineNumber, 1)).lineNumber);
    const c = this._visibleLines.getStartLineNumber(), u = this._visibleLines.getEndLineNumber();
    for (let d = r.startLineNumber; d <= r.endLineNumber; d++) {
      if (d < c || d > u)
        continue;
      const h = d === r.startLineNumber ? r.startColumn : 1, g = d !== n, m = g ? this._context.viewModel.getLineMaxColumn(d) : r.endColumn, v = this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d, h, m, a);
      if (v) {
        if (t && d < n) {
          const w = l;
          if (l = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new de(d + 1, 1)).lineNumber, w !== l) {
            const E = v.ranges[v.ranges.length - 1];
            E.width += this._typicalHalfwidthCharacterWidth, this._context.viewModel.getTextDirection(w) === Ph.RTL && (E.left -= this._typicalHalfwidthCharacterWidth);
          }
        }
        s[o++] = new GFe(v.outsideRenderedLine, d, xB.from(v.ranges), g);
      }
    }
    return this._updateLineWidthsSlowIfDomDidLayout(a), o === 0 ? null : s;
  }
  _visibleRangesForLineRange(e, t, n) {
    if (this.shouldRender() || e < this._visibleLines.getStartLineNumber() || e > this._visibleLines.getEndLineNumber())
      return null;
    const r = new iee(this.domNode.domNode, this._textRangeRestingSpot), s = this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e, t, n, r);
    return this._updateLineWidthsSlowIfDomDidLayout(r), s;
  }
  _lineIsRenderedRTL(e) {
    return e < this._visibleLines.getStartLineNumber() || e > this._visibleLines.getEndLineNumber() ? !1 : this._visibleLines.getVisibleLine(e).isRenderedRTL();
  }
  visibleRangeForPosition(e) {
    const t = this._visibleRangesForLineRange(e.lineNumber, e.column, e.column);
    return t ? new qFe(t.outsideRenderedLine, t.ranges[0].left) : null;
  }
  /**
   * Updates the max line width if it is fast to compute.
   * Returns true if all lines were taken into account.
   * Returns false if some lines need to be reevaluated (in a slow fashion).
   */
  _updateLineWidthsFast() {
    return this._updateLineWidths(!0);
  }
  _updateLineWidthsSlow() {
    this._updateLineWidths(!1);
  }
  /**
   * Update the line widths using DOM layout information after someone else
   * has caused a synchronous layout.
   */
  _updateLineWidthsSlowIfDomDidLayout(e) {
    e.didDomLayout && (this._asyncUpdateLineWidths.isScheduled() || (this._asyncUpdateLineWidths.cancel(), this._updateLineWidthsSlow()));
  }
  _updateLineWidths(e) {
    const t = this._visibleLines.getStartLineNumber(), n = this._visibleLines.getEndLineNumber();
    let r = 1, s = !0;
    for (let o = t; o <= n; o++) {
      const a = this._visibleLines.getVisibleLine(o);
      if (e && !a.getWidthIsFast()) {
        s = !1;
        continue;
      }
      r = Math.max(r, a.getWidth(null));
    }
    return s && t === 1 && n === this._context.viewModel.getLineCount() && (this._maxLineWidth = 0), this._ensureMaxLineWidth(r), s;
  }
  _checkMonospaceFontAssumptions() {
    let e = -1, t = -1;
    const n = this._visibleLines.getStartLineNumber(), r = this._visibleLines.getEndLineNumber();
    for (let s = n; s <= r; s++) {
      const o = this._visibleLines.getVisibleLine(s);
      if (o.needsMonospaceFontCheck()) {
        const a = o.getWidth(null);
        a > t && (t = a, e = s);
      }
    }
    if (e !== -1 && !this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())
      for (let s = n; s <= r; s++)
        this._visibleLines.getVisibleLine(s).onMonospaceAssumptionsInvalidated();
  }
  prepareRender() {
    throw new Error("Not supported");
  }
  render() {
    throw new Error("Not supported");
  }
  renderText(e) {
    if (this._visibleLines.renderLines(e), this._lastRenderedData.setCurrentVisibleRange(e.visibleRange), this.domNode.setWidth(this._context.viewLayout.getScrollWidth()), this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(), 1e6)), this._horizontalRevealRequest) {
      const n = this._horizontalRevealRequest;
      if (e.startLineNumber <= n.minLineNumber && n.maxLineNumber <= e.endLineNumber) {
        this._horizontalRevealRequest = null, this.onDidRender();
        const r = this._computeScrollLeftToReveal(n);
        r && (!this._isViewportWrapping && !r.hasRTL && this._ensureMaxLineWidth(r.maxHorizontalOffset), this._context.viewModel.viewLayout.setScrollPosition({
          scrollLeft: r.scrollLeft
        }, n.scrollType));
      }
    }
    if (this._updateLineWidthsFast() ? this._asyncUpdateLineWidths.cancel() : this._asyncUpdateLineWidths.schedule(), Qu && !this._asyncCheckMonospaceFontAssumptions.isScheduled()) {
      const n = this._visibleLines.getStartLineNumber(), r = this._visibleLines.getEndLineNumber();
      for (let s = n; s <= r; s++)
        if (this._visibleLines.getVisibleLine(s).needsMonospaceFontCheck()) {
          this._asyncCheckMonospaceFontAssumptions.schedule();
          break;
        }
    }
    this._linesContent.setLayerHinting(this._canUseLayerHinting), this._linesContent.setContain("strict");
    const t = this._context.viewLayout.getCurrentScrollTop() - e.bigNumbersDelta;
    this._linesContent.setTop(-t), this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft());
  }
  // --- width
  _ensureMaxLineWidth(e) {
    const t = Math.ceil(e);
    this._maxLineWidth < t && (this._maxLineWidth = t, this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth));
  }
  _computeScrollTopToRevealRange(e, t, n, r, s, o) {
    const a = e.top, l = e.height, c = a + l;
    let u, d, h;
    if (s && s.length > 0) {
      let w = s[0].startLineNumber, E = s[0].endLineNumber;
      for (let L = 1, T = s.length; L < T; L++) {
        const D = s[L];
        w = Math.min(w, D.startLineNumber), E = Math.max(E, D.endLineNumber);
      }
      u = !1, d = this._context.viewLayout.getVerticalOffsetForLineNumber(w), h = this._context.viewLayout.getVerticalOffsetForLineNumber(E) + this._lineHeight;
    } else if (r)
      u = !0, d = this._context.viewLayout.getVerticalOffsetForLineNumber(r.startLineNumber), h = this._context.viewLayout.getVerticalOffsetForLineNumber(r.endLineNumber) + this._lineHeight;
    else
      return -1;
    const g = (t === "mouse" || n) && this._cursorSurroundingLinesStyle === "default";
    let m = 0, _ = 0;
    if (g)
      n || (m = this._lineHeight);
    else {
      const w = l / this._lineHeight, E = Math.max(this._cursorSurroundingLines, this._stickyScrollEnabled ? this._maxNumberStickyLines : 0), L = Math.min(w / 2, E);
      m = L * this._lineHeight, _ = Math.max(0, L - 1) * this._lineHeight;
    }
    n || (o === 0 || o === 4) && (_ += this._lineHeight), d -= m, h += _;
    let v;
    if (h - d > l) {
      if (!u)
        return -1;
      v = d;
    } else if (o === 5 || o === 6)
      if (o === 6 && a <= d && h <= c)
        v = a;
      else {
        const w = Math.max(5 * this._lineHeight, l * 0.2), E = d - w, L = h - l;
        v = Math.max(L, E);
      }
    else if (o === 1 || o === 2)
      if (o === 2 && a <= d && h <= c)
        v = a;
      else {
        const w = (d + h) / 2;
        v = Math.max(0, w - l / 2);
      }
    else
      v = this._computeMinimumScrolling(
        a,
        c,
        d,
        h,
        o === 3,
        o === 4
        /* viewEvents.VerticalRevealType.Bottom */
      );
    return v;
  }
  _computeScrollLeftToReveal(e) {
    const t = this._context.viewLayout.getCurrentViewport(), n = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ), r = t.left, s = r + t.width - n.verticalScrollbarWidth;
    let o = 1073741824, a = 0, l = !1;
    if (e.type === "range") {
      l = this._lineIsRenderedRTL(e.lineNumber);
      const u = this._visibleRangesForLineRange(e.lineNumber, e.startColumn, e.endColumn);
      if (!u)
        return null;
      for (const d of u.ranges)
        o = Math.min(o, Math.round(d.left)), a = Math.max(a, Math.round(d.left + d.width));
    } else
      for (const u of e.selections) {
        if (u.startLineNumber !== u.endLineNumber)
          return null;
        const d = this._visibleRangesForLineRange(u.startLineNumber, u.startColumn, u.endColumn);
        if (l || (l = this._lineIsRenderedRTL(u.startLineNumber)), !d)
          return null;
        for (const h of d.ranges)
          o = Math.min(o, Math.round(h.left)), a = Math.max(a, Math.round(h.left + h.width));
      }
    return e.minimalReveal || (o = Math.max(0, o - Uj.HORIZONTAL_EXTRA_PX), a += this._revealHorizontalRightPadding), e.type === "selections" && a - o > t.width ? null : {
      scrollLeft: this._computeMinimumScrolling(r, s, o, a),
      maxHorizontalOffset: a,
      hasRTL: l
    };
  }
  _computeMinimumScrolling(e, t, n, r, s, o) {
    e = e | 0, t = t | 0, n = n | 0, r = r | 0, s = !!s, o = !!o;
    const a = t - e;
    if (r - n < a) {
      if (s)
        return n;
      if (o)
        return Math.max(0, r - a);
      if (n < e)
        return n;
      if (r > t)
        return Math.max(0, r - a);
    } else
      return n;
    return e;
  }
};
Uj.HORIZONTAL_EXTRA_PX = 30;
let ire = Uj;
class wdt extends C3e {
  constructor(e) {
    super(), this._context = e;
    const n = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._decorationsLeft = n.decorationsLeft, this._decorationsWidth = n.decorationsWidth, this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const n = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
    return this._decorationsLeft = n.decorationsLeft, this._decorationsWidth = n.decorationsWidth, !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  _getDecorations(e) {
    const t = e.getDecorationsInViewport(), n = [];
    let r = 0;
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.options.linesDecorationsClassName, c = a.options.zIndex;
      l && (n[r++] = new nre(a.range.startLineNumber, a.range.endLineNumber, l, a.options.linesDecorationsTooltip ?? null, c));
      const u = a.options.firstLineDecorationClassName;
      u && (n[r++] = new nre(a.range.startLineNumber, a.range.startLineNumber, u, a.options.linesDecorationsTooltip ?? null, c));
    }
    return n;
  }
  prepareRender(e) {
    const t = e.visibleRange.startLineNumber, n = e.visibleRange.endLineNumber, r = this._render(t, n, this._getDecorations(e)), s = this._decorationsLeft.toString(), o = this._decorationsWidth.toString(), a = '" style="left:' + s + "px;width:" + o + 'px;"></div>', l = [];
    for (let c = t; c <= n; c++) {
      const u = c - t, d = r[u].getDecorations();
      let h = "";
      for (const g of d) {
        let m = '<div class="cldr ' + g.className;
        g.tooltip !== null && (m += '" title="' + g.tooltip), m += a, h += m;
      }
      l[u] = h;
    }
    this._renderResult = l;
  }
  render(e, t) {
    return this._renderResult ? this._renderResult[t - e] : "";
  }
}
const AN = class AN extends fu {
  constructor(e) {
    super(e);
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._canUseLayerHinting = !t.get(
      39
      /* EditorOption.disableLayerHinting */
    ), this._contentLeft = n.contentLeft, this._glyphMarginLeft = n.glyphMarginLeft, this._glyphMarginWidth = n.glyphMarginWidth, this._domNode = Gi(document.createElement("div")), this._domNode.setClassName(AN.OUTER_CLASS_NAME), this._domNode.setPosition("absolute"), this._domNode.setAttribute("role", "presentation"), this._domNode.setAttribute("aria-hidden", "true"), this._glyphMarginBackgroundDomNode = Gi(document.createElement("div")), this._glyphMarginBackgroundDomNode.setClassName(AN.CLASS_NAME), this._domNode.appendChild(this._glyphMarginBackgroundDomNode);
  }
  dispose() {
    super.dispose();
  }
  getDomNode() {
    return this._domNode;
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    return this._canUseLayerHinting = !t.get(
      39
      /* EditorOption.disableLayerHinting */
    ), this._contentLeft = n.contentLeft, this._glyphMarginLeft = n.glyphMarginLeft, this._glyphMarginWidth = n.glyphMarginWidth, !0;
  }
  onScrollChanged(e) {
    return super.onScrollChanged(e) || e.scrollTopChanged;
  }
  // --- end event handlers
  prepareRender(e) {
  }
  render(e) {
    this._domNode.setLayerHinting(this._canUseLayerHinting), this._domNode.setContain("strict");
    const t = e.scrollTop - e.bigNumbersDelta;
    this._domNode.setTop(-t);
    const n = Math.min(e.scrollHeight, 1e6);
    this._domNode.setHeight(n), this._domNode.setWidth(this._contentLeft), this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft), this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth), this._glyphMarginBackgroundDomNode.setHeight(n);
  }
};
AN.CLASS_NAME = "glyph-margin", AN.OUTER_CLASS_NAME = "margin";
let uU = AN;
class Sdt extends C3e {
  constructor(e) {
    super(), this._context = e, this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  _getDecorations(e) {
    const t = e.getDecorationsInViewport(), n = [];
    let r = 0;
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = a.options.marginClassName, c = a.options.zIndex;
      l && (n[r++] = new nre(a.range.startLineNumber, a.range.endLineNumber, l, null, c));
    }
    return n;
  }
  prepareRender(e) {
    const t = e.visibleRange.startLineNumber, n = e.visibleRange.endLineNumber, r = this._render(t, n, this._getDecorations(e)), s = [];
    for (let o = t; o <= n; o++) {
      const a = o - t, l = r[a].getDecorations();
      let c = "";
      for (const u of l)
        c += '<div class="cmdr ' + u.className + '" style=""></div>';
      s[a] = c;
    }
    this._renderResult = s;
  }
  render(e, t) {
    return this._renderResult ? this._renderResult[t - e] : "";
  }
}
const UC = class UC {
  constructor(e, t, n, r) {
    this._rgba8Brand = void 0, this.r = UC._clamp(e), this.g = UC._clamp(t), this.b = UC._clamp(n), this.a = UC._clamp(r);
  }
  equals(e) {
    return this.r === e.r && this.g === e.g && this.b === e.b && this.a === e.a;
  }
  static _clamp(e) {
    return e < 0 ? 0 : e > 255 ? 255 : e | 0;
  }
};
UC.Empty = new UC(0, 0, 0, 0);
let My = UC, Edt = class {
  constructor() {
    this._tokenizationSupports = /* @__PURE__ */ new Map(), this._factories = /* @__PURE__ */ new Map(), this._onDidChange = new he(), this.onDidChange = this._onDidChange.event, this._colorMap = null;
  }
  handleChange(e) {
    this._onDidChange.fire({
      changedLanguages: e,
      changedColorMap: !1
    });
  }
  register(e, t) {
    return this._tokenizationSupports.set(e, t), this.handleChange([e]), Et(() => {
      this._tokenizationSupports.get(e) === t && (this._tokenizationSupports.delete(e), this.handleChange([e]));
    });
  }
  get(e) {
    return this._tokenizationSupports.get(e) || null;
  }
  registerFactory(e, t) {
    var r;
    (r = this._factories.get(e)) == null || r.dispose();
    const n = new xdt(this, e, t);
    return this._factories.set(e, n), Et(() => {
      const s = this._factories.get(e);
      !s || s !== n || (this._factories.delete(e), s.dispose());
    });
  }
  async getOrCreate(e) {
    const t = this.get(e);
    if (t)
      return t;
    const n = this._factories.get(e);
    return !n || n.isResolved ? null : (await n.resolve(), this.get(e));
  }
  isResolved(e) {
    if (this.get(e))
      return !0;
    const n = this._factories.get(e);
    return !!(!n || n.isResolved);
  }
  setColorMap(e) {
    this._colorMap = e, this._onDidChange.fire({
      changedLanguages: Array.from(this._tokenizationSupports.keys()),
      changedColorMap: !0
    });
  }
  getColorMap() {
    return this._colorMap;
  }
  getDefaultBackground() {
    return this._colorMap && this._colorMap.length > 2 ? this._colorMap[
      2
      /* ColorId.DefaultBackground */
    ] : null;
  }
};
class xdt extends ge {
  get isResolved() {
    return this._isResolved;
  }
  constructor(e, t, n) {
    super(), this._registry = e, this._languageId = t, this._factory = n, this._isDisposed = !1, this._resolvePromise = null, this._isResolved = !1;
  }
  dispose() {
    this._isDisposed = !0, super.dispose();
  }
  async resolve() {
    return this._resolvePromise || (this._resolvePromise = this._create()), this._resolvePromise;
  }
  async _create() {
    const e = await this._factory.tokenizationSupport;
    this._isResolved = !0, e && !this._isDisposed && this._register(this._registry.register(this._languageId, e));
  }
}
let E4 = class {
  constructor(e, t, n) {
    this.offset = e, this.type = t, this.language = n, this._tokenBrand = void 0;
  }
  toString() {
    return "(" + this.offset + ", " + this.type + ")";
  }
};
class Pfe {
  constructor(e, t) {
    this.tokens = e, this.endState = t, this._tokenizationResultBrand = void 0;
  }
}
class rK {
  constructor(e, t) {
    this.tokens = e, this.endState = t, this._encodedTokenizationResultBrand = void 0;
  }
}
var kd;
(function(i) {
  i[i.Increase = 0] = "Increase", i[i.Decrease = 1] = "Decrease";
})(kd || (kd = {}));
var iA;
(function(i) {
  const e = /* @__PURE__ */ new Map();
  e.set(0, Pe.symbolMethod), e.set(1, Pe.symbolFunction), e.set(2, Pe.symbolConstructor), e.set(3, Pe.symbolField), e.set(4, Pe.symbolVariable), e.set(5, Pe.symbolClass), e.set(6, Pe.symbolStruct), e.set(7, Pe.symbolInterface), e.set(8, Pe.symbolModule), e.set(9, Pe.symbolProperty), e.set(10, Pe.symbolEvent), e.set(11, Pe.symbolOperator), e.set(12, Pe.symbolUnit), e.set(13, Pe.symbolValue), e.set(15, Pe.symbolEnum), e.set(14, Pe.symbolConstant), e.set(15, Pe.symbolEnum), e.set(16, Pe.symbolEnumMember), e.set(17, Pe.symbolKeyword), e.set(28, Pe.symbolSnippet), e.set(18, Pe.symbolText), e.set(19, Pe.symbolColor), e.set(20, Pe.symbolFile), e.set(21, Pe.symbolReference), e.set(22, Pe.symbolCustomColor), e.set(23, Pe.symbolFolder), e.set(24, Pe.symbolTypeParameter), e.set(25, Pe.account), e.set(26, Pe.issues), e.set(27, Pe.tools);
  function t(o) {
    let a = e.get(o);
    return a || (console.info("No codicon found for CompletionItemKind " + o), a = Pe.symbolProperty), a;
  }
  i.toIcon = t;
  function n(o) {
    switch (o) {
      case 0:
        return S(724, "Method");
      case 1:
        return S(725, "Function");
      case 2:
        return S(726, "Constructor");
      case 3:
        return S(727, "Field");
      case 4:
        return S(728, "Variable");
      case 5:
        return S(729, "Class");
      case 6:
        return S(730, "Struct");
      case 7:
        return S(731, "Interface");
      case 8:
        return S(732, "Module");
      case 9:
        return S(733, "Property");
      case 10:
        return S(734, "Event");
      case 11:
        return S(735, "Operator");
      case 12:
        return S(736, "Unit");
      case 13:
        return S(737, "Value");
      case 14:
        return S(738, "Constant");
      case 15:
        return S(739, "Enum");
      case 16:
        return S(740, "Enum Member");
      case 17:
        return S(741, "Keyword");
      case 18:
        return S(742, "Text");
      case 19:
        return S(743, "Color");
      case 20:
        return S(744, "File");
      case 21:
        return S(745, "Reference");
      case 22:
        return S(746, "Custom Color");
      case 23:
        return S(747, "Folder");
      case 24:
        return S(748, "Type Parameter");
      case 25:
        return S(749, "User");
      case 26:
        return S(750, "Issue");
      case 27:
        return S(751, "Tool");
      case 28:
        return S(752, "Snippet");
      default:
        return "";
    }
  }
  i.toLabel = n;
  const r = /* @__PURE__ */ new Map();
  r.set(
    "method",
    0
    /* CompletionItemKind.Method */
  ), r.set(
    "function",
    1
    /* CompletionItemKind.Function */
  ), r.set(
    "constructor",
    2
    /* CompletionItemKind.Constructor */
  ), r.set(
    "field",
    3
    /* CompletionItemKind.Field */
  ), r.set(
    "variable",
    4
    /* CompletionItemKind.Variable */
  ), r.set(
    "class",
    5
    /* CompletionItemKind.Class */
  ), r.set(
    "struct",
    6
    /* CompletionItemKind.Struct */
  ), r.set(
    "interface",
    7
    /* CompletionItemKind.Interface */
  ), r.set(
    "module",
    8
    /* CompletionItemKind.Module */
  ), r.set(
    "property",
    9
    /* CompletionItemKind.Property */
  ), r.set(
    "event",
    10
    /* CompletionItemKind.Event */
  ), r.set(
    "operator",
    11
    /* CompletionItemKind.Operator */
  ), r.set(
    "unit",
    12
    /* CompletionItemKind.Unit */
  ), r.set(
    "value",
    13
    /* CompletionItemKind.Value */
  ), r.set(
    "constant",
    14
    /* CompletionItemKind.Constant */
  ), r.set(
    "enum",
    15
    /* CompletionItemKind.Enum */
  ), r.set(
    "enum-member",
    16
    /* CompletionItemKind.EnumMember */
  ), r.set(
    "enumMember",
    16
    /* CompletionItemKind.EnumMember */
  ), r.set(
    "keyword",
    17
    /* CompletionItemKind.Keyword */
  ), r.set(
    "snippet",
    28
    /* CompletionItemKind.Snippet */
  ), r.set(
    "text",
    18
    /* CompletionItemKind.Text */
  ), r.set(
    "color",
    19
    /* CompletionItemKind.Color */
  ), r.set(
    "file",
    20
    /* CompletionItemKind.File */
  ), r.set(
    "reference",
    21
    /* CompletionItemKind.Reference */
  ), r.set(
    "customcolor",
    22
    /* CompletionItemKind.Customcolor */
  ), r.set(
    "folder",
    23
    /* CompletionItemKind.Folder */
  ), r.set(
    "type-parameter",
    24
    /* CompletionItemKind.TypeParameter */
  ), r.set(
    "typeParameter",
    24
    /* CompletionItemKind.TypeParameter */
  ), r.set(
    "account",
    25
    /* CompletionItemKind.User */
  ), r.set(
    "issue",
    26
    /* CompletionItemKind.Issue */
  ), r.set(
    "tool",
    27
    /* CompletionItemKind.Tool */
  );
  function s(o, a) {
    let l = r.get(o);
    return typeof l > "u" && !a && (l = 9), l;
  }
  i.fromString = s;
})(iA || (iA = {}));
var Vu;
(function(i) {
  i[i.Automatic = 0] = "Automatic", i[i.Explicit = 1] = "Explicit";
})(Vu || (Vu = {}));
class L3e {
  constructor(e, t, n, r) {
    this.range = e, this.text = t, this.completionKind = n, this.isSnippetText = r;
  }
  equals(e) {
    return z.lift(this.range).equalsRange(e.range) && this.text === e.text && this.completionKind === e.completionKind && this.isSnippetText === e.isSnippetText;
  }
}
var rre;
(function(i) {
  i[i.Code = 1] = "Code", i[i.Label = 2] = "Label";
})(rre || (rre = {}));
class sK {
  static fromExtensionId(e) {
    return new sK(e, void 0, void 0);
  }
  constructor(e, t, n) {
    this.extensionId = e, this.extensionVersion = t, this.providerId = n;
  }
  toString() {
    let e = "";
    return this.extensionId && (e += this.extensionId), this.extensionVersion && (e += `@${this.extensionVersion}`), this.providerId && (e += `:${this.providerId}`), e.length === 0 && (e = "unknown"), e;
  }
}
var oT;
(function(i) {
  i[i.Accepted = 0] = "Accepted", i[i.Rejected = 1] = "Rejected", i[i.Ignored = 2] = "Ignored";
})(oT || (oT = {}));
var x4;
(function(i) {
  i[i.Automatic = 0] = "Automatic", i[i.PasteAs = 1] = "PasteAs";
})(x4 || (x4 = {}));
var rb;
(function(i) {
  i[i.Invoke = 1] = "Invoke", i[i.TriggerCharacter = 2] = "TriggerCharacter", i[i.ContentChange = 3] = "ContentChange";
})(rb || (rb = {}));
var rA;
(function(i) {
  i[i.Text = 0] = "Text", i[i.Read = 1] = "Read", i[i.Write = 2] = "Write";
})(rA || (rA = {}));
function Ldt(i) {
  return i && Ht.isUri(i.uri) && z.isIRange(i.range) && (z.isIRange(i.originSelectionRange) || z.isIRange(i.targetSelectionRange));
}
const Tdt = {
  17: S(753, "array"),
  16: S(754, "boolean"),
  4: S(755, "class"),
  13: S(756, "constant"),
  8: S(757, "constructor"),
  9: S(758, "enumeration"),
  21: S(759, "enumeration member"),
  23: S(760, "event"),
  7: S(761, "field"),
  0: S(762, "file"),
  11: S(763, "function"),
  10: S(764, "interface"),
  19: S(765, "key"),
  5: S(766, "method"),
  1: S(767, "module"),
  2: S(768, "namespace"),
  20: S(769, "null"),
  15: S(770, "number"),
  18: S(771, "object"),
  24: S(772, "operator"),
  3: S(773, "package"),
  6: S(774, "property"),
  14: S(775, "string"),
  22: S(776, "struct"),
  25: S(777, "type parameter"),
  12: S(778, "variable")
};
function kdt(i, e) {
  return S(779, "{0} ({1})", i, Tdt[e]);
}
var dU;
(function(i) {
  const e = /* @__PURE__ */ new Map();
  e.set(0, Pe.symbolFile), e.set(1, Pe.symbolModule), e.set(2, Pe.symbolNamespace), e.set(3, Pe.symbolPackage), e.set(4, Pe.symbolClass), e.set(5, Pe.symbolMethod), e.set(6, Pe.symbolProperty), e.set(7, Pe.symbolField), e.set(8, Pe.symbolConstructor), e.set(9, Pe.symbolEnum), e.set(10, Pe.symbolInterface), e.set(11, Pe.symbolFunction), e.set(12, Pe.symbolVariable), e.set(13, Pe.symbolConstant), e.set(14, Pe.symbolString), e.set(15, Pe.symbolNumber), e.set(16, Pe.symbolBoolean), e.set(17, Pe.symbolArray), e.set(18, Pe.symbolObject), e.set(19, Pe.symbolKey), e.set(20, Pe.symbolNull), e.set(21, Pe.symbolEnumMember), e.set(22, Pe.symbolStruct), e.set(23, Pe.symbolEvent), e.set(24, Pe.symbolOperator), e.set(25, Pe.symbolTypeParameter);
  function t(s) {
    let o = e.get(s);
    return o || (console.info("No codicon found for SymbolKind " + s), o = Pe.symbolProperty), o;
  }
  i.toIcon = t;
  const n = /* @__PURE__ */ new Map();
  n.set(
    0,
    20
    /* CompletionItemKind.File */
  ), n.set(
    1,
    8
    /* CompletionItemKind.Module */
  ), n.set(
    2,
    8
    /* CompletionItemKind.Module */
  ), n.set(
    3,
    8
    /* CompletionItemKind.Module */
  ), n.set(
    4,
    5
    /* CompletionItemKind.Class */
  ), n.set(
    5,
    0
    /* CompletionItemKind.Method */
  ), n.set(
    6,
    9
    /* CompletionItemKind.Property */
  ), n.set(
    7,
    3
    /* CompletionItemKind.Field */
  ), n.set(
    8,
    2
    /* CompletionItemKind.Constructor */
  ), n.set(
    9,
    15
    /* CompletionItemKind.Enum */
  ), n.set(
    10,
    7
    /* CompletionItemKind.Interface */
  ), n.set(
    11,
    1
    /* CompletionItemKind.Function */
  ), n.set(
    12,
    4
    /* CompletionItemKind.Variable */
  ), n.set(
    13,
    14
    /* CompletionItemKind.Constant */
  ), n.set(
    14,
    18
    /* CompletionItemKind.Text */
  ), n.set(
    15,
    13
    /* CompletionItemKind.Value */
  ), n.set(
    16,
    13
    /* CompletionItemKind.Value */
  ), n.set(
    17,
    13
    /* CompletionItemKind.Value */
  ), n.set(
    18,
    13
    /* CompletionItemKind.Value */
  ), n.set(
    19,
    17
    /* CompletionItemKind.Keyword */
  ), n.set(
    20,
    13
    /* CompletionItemKind.Value */
  ), n.set(
    21,
    16
    /* CompletionItemKind.EnumMember */
  ), n.set(
    22,
    6
    /* CompletionItemKind.Struct */
  ), n.set(
    23,
    10
    /* CompletionItemKind.Event */
  ), n.set(
    24,
    11
    /* CompletionItemKind.Operator */
  ), n.set(
    25,
    24
    /* CompletionItemKind.TypeParameter */
  );
  function r(s) {
    let o = n.get(s);
    return o === void 0 && (console.info("No completion kind found for SymbolKind " + s), o = 20), o;
  }
  i.toCompletionKind = r;
})(dU || (dU = {}));
const Dg = class Dg {
  /**
   * Returns a {@link FoldingRangeKind} for the given value.
   *
   * @param value of the kind.
   */
  static fromValue(e) {
    switch (e) {
      case "comment":
        return Dg.Comment;
      case "imports":
        return Dg.Imports;
      case "region":
        return Dg.Region;
    }
    return new Dg(e);
  }
  /**
   * Creates a new {@link FoldingRangeKind}.
   *
   * @param value of the kind.
   */
  constructor(e) {
    this.value = e;
  }
};
Dg.Comment = new Dg("comment"), Dg.Imports = new Dg("imports"), Dg.Region = new Dg("region");
let Qy = Dg;
var sre;
(function(i) {
  i[i.AIGenerated = 1] = "AIGenerated";
})(sre || (sre = {}));
var L4;
(function(i) {
  i[i.Invoke = 0] = "Invoke", i[i.Automatic = 1] = "Automatic";
})(L4 || (L4 = {}));
var ore;
(function(i) {
  function e(t) {
    return !t || typeof t != "object" ? !1 : typeof t.id == "string" && typeof t.title == "string";
  }
  i.is = e;
})(ore || (ore = {}));
var hU;
(function(i) {
  i[i.Type = 1] = "Type", i[i.Parameter = 2] = "Parameter";
})(hU || (hU = {}));
class Ddt {
  constructor(e) {
    this.createSupport = e, this._tokenizationSupport = null;
  }
  dispose() {
    this._tokenizationSupport && this._tokenizationSupport.then((e) => {
      e && e.dispose();
    });
  }
  get tokenizationSupport() {
    return this._tokenizationSupport || (this._tokenizationSupport = this.createSupport()), this._tokenizationSupport;
  }
}
const Ys = new Edt(), zj = class zj extends ge {
  static getInstance() {
    return this._INSTANCE || (this._INSTANCE = new zj()), this._INSTANCE;
  }
  constructor() {
    super(), this._onDidChange = new he(), this.onDidChange = this._onDidChange.event, this._updateColorMap(), this._register(Ys.onDidChange((e) => {
      e.changedColorMap && this._updateColorMap();
    }));
  }
  _updateColorMap() {
    const e = Ys.getColorMap();
    if (!e) {
      this._colors = [My.Empty], this._backgroundIsLight = !0;
      return;
    }
    this._colors = [My.Empty];
    for (let n = 1; n < e.length; n++) {
      const r = e[n].rgba;
      this._colors[n] = new My(r.r, r.g, r.b, Math.round(r.a * 255));
    }
    const t = e[
      2
      /* ColorId.DefaultBackground */
    ].getRelativeLuminance();
    this._backgroundIsLight = t >= 0.5, this._onDidChange.fire(void 0);
  }
  getColor(e) {
    return (e < 1 || e >= this._colors.length) && (e = 2), this._colors[e];
  }
  backgroundIsLight() {
    return this._backgroundIsLight;
  }
};
zj._INSTANCE = null;
let fU = zj;
const Idt = (() => {
  const i = [];
  for (let e = 32; e <= 126; e++)
    i.push(e);
  return i.push(
    65533
    /* Constants.UNKNOWN_CODE */
  ), i;
})(), Ndt = (i, e) => (i -= 32, i < 0 || i > 96 ? e <= 2 ? (i + 96) % 96 : 95 : i);
class T4 {
  constructor(e, t) {
    this.scale = t, this._minimapCharRendererBrand = void 0, this.charDataNormal = T4.soften(e, 12 / 15), this.charDataLight = T4.soften(e, 50 / 60);
  }
  static soften(e, t) {
    const n = new Uint8ClampedArray(e.length);
    for (let r = 0, s = e.length; r < s; r++)
      n[r] = VV(e[r] * t);
    return n;
  }
  renderChar(e, t, n, r, s, o, a, l, c, u, d) {
    const h = 1 * this.scale, g = 2 * this.scale, m = d ? 1 : g;
    if (t + h > e.width || n + m > e.height) {
      console.warn("bad render request outside image data");
      return;
    }
    const _ = u ? this.charDataLight : this.charDataNormal, v = Ndt(r, c), w = e.width * 4, E = a.r, L = a.g, T = a.b, D = s.r - E, N = s.g - L, R = s.b - T, M = Math.max(o, l), B = e.data;
    let H = v * h * g, j = n * w + t * 4;
    for (let K = 0; K < m; K++) {
      let X = j;
      for (let Y = 0; Y < h; Y++) {
        const G = _[H++] / 255 * (o / 255);
        B[X++] = E + D * G, B[X++] = L + N * G, B[X++] = T + R * G, B[X++] = M;
      }
      j += w;
    }
  }
  blockRenderChar(e, t, n, r, s, o, a, l) {
    const c = 1 * this.scale, u = 2 * this.scale, d = l ? 1 : u;
    if (t + c > e.width || n + d > e.height) {
      console.warn("bad render request outside image data");
      return;
    }
    const h = e.width * 4, g = 0.5 * (s / 255), m = o.r, _ = o.g, v = o.b, w = r.r - m, E = r.g - _, L = r.b - v, T = m + w * g, D = _ + E * g, N = v + L * g, R = Math.max(s, a), M = e.data;
    let B = n * h + t * 4;
    for (let H = 0; H < d; H++) {
      let j = B;
      for (let K = 0; K < c; K++)
        M[j++] = T, M[j++] = D, M[j++] = N, M[j++] = R;
      B += h;
    }
  }
}
const HLe = {
  0: 0,
  1: 1,
  2: 2,
  3: 3,
  4: 4,
  5: 5,
  6: 6,
  7: 7,
  8: 8,
  9: 9,
  A: 10,
  B: 11,
  C: 12,
  D: 13,
  E: 14,
  F: 15
}, WLe = (i) => {
  const e = new Uint8ClampedArray(i.length / 2);
  for (let t = 0; t < i.length; t += 2)
    e[t >> 1] = HLe[i[t]] << 4 | HLe[i[t + 1]] & 15;
  return e;
}, VLe = {
  1: JL(() => WLe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),
  2: JL(() => WLe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))
};
class LF {
  /**
   * Creates a new character renderer factory with the given scale.
   */
  static create(e, t) {
    if (this.lastCreated && e === this.lastCreated.scale && t === this.lastFontFamily)
      return this.lastCreated;
    let n;
    return VLe[e] ? n = new T4(VLe[e](), e) : n = LF.createFromSampleData(LF.createSampleData(t).data, e), this.lastFontFamily = t, this.lastCreated = n, n;
  }
  /**
   * Creates the font sample data, writing to a canvas.
   */
  static createSampleData(e) {
    const t = document.createElement("canvas"), n = t.getContext("2d");
    t.style.height = "16px", t.height = 16, t.width = 960, t.style.width = "960px", n.fillStyle = "#ffffff", n.font = `bold 16px ${e}`, n.textBaseline = "middle";
    let r = 0;
    for (const s of Idt)
      n.fillText(String.fromCharCode(s), r, 16 / 2), r += 10;
    return n.getImageData(
      0,
      0,
      960,
      16
      /* Constants.SAMPLED_CHAR_HEIGHT */
    );
  }
  /**
   * Creates a character renderer from the canvas sample data.
   */
  static createFromSampleData(e, t) {
    if (e.length !== 61440)
      throw new Error("Unexpected source in MinimapCharRenderer");
    const r = LF._downsample(e, t);
    return new T4(r, t);
  }
  static _downsampleChar(e, t, n, r, s) {
    const o = 1 * s, a = 2 * s;
    let l = r, c = 0;
    for (let u = 0; u < a; u++) {
      const d = u / a * 16, h = (u + 1) / a * 16;
      for (let g = 0; g < o; g++) {
        const m = g / o * 10, _ = (g + 1) / o * 10;
        let v = 0, w = 0;
        for (let L = d; L < h; L++) {
          const T = t + Math.floor(L) * 3840, D = 1 - (L - Math.floor(L));
          for (let N = m; N < _; N++) {
            const R = 1 - (N - Math.floor(N)), M = T + Math.floor(N) * 4, B = R * D;
            w += B, v += e[M] * e[M + 3] / 255 * B;
          }
        }
        const E = v / w;
        c = Math.max(c, E), n[l++] = VV(E);
      }
    }
    return c;
  }
  static _downsample(e, t) {
    const n = 2 * t * 1 * t, r = n * 96, s = new Uint8ClampedArray(r);
    let o = 0, a = 0, l = 0;
    for (let c = 0; c < 96; c++)
      l = Math.max(l, this._downsampleChar(e, a, s, o, t)), o += n, a += 40;
    if (l > 0) {
      const c = 255 / l;
      for (let u = 0; u < r; u++)
        s[u] *= c;
    }
    return s;
  }
}
const Rdt = Za ? '"Segoe WPC", "Segoe UI", sans-serif' : Kn ? "-apple-system, BlinkMacSystemFont, sans-serif" : 'system-ui, "Ubuntu", "Droid Sans", sans-serif';
class T3e {
  constructor(e, t) {
    this._viewModelDecorationBrand = void 0, this.range = e, this.options = t;
  }
}
function Ffe(i, e) {
  return !(e.options.hideInCommentTokens && Bfe(i, e) || e.options.hideInStringTokens && Hfe(i, e));
}
function Bfe(i, e) {
  return k3e(
    i,
    e.range,
    (t) => t === 1
    /* StandardTokenType.Comment */
  );
}
function Hfe(i, e) {
  return k3e(
    i,
    e.range,
    (t) => t === 2
    /* StandardTokenType.String */
  );
}
function k3e(i, e, t) {
  for (let n = e.startLineNumber; n <= e.endLineNumber; n++) {
    const r = i.tokenization.getLineTokens(n), s = n === e.startLineNumber, o = n === e.endLineNumber;
    let a = s ? r.findTokenIndexAtOffset(e.startColumn - 1) : 0;
    for (; a < r.getCount() && !(o && r.getStartOffset(a) > e.endColumn - 1); ) {
      if (!t(r.getStandardTokenType(a)))
        return !1;
      a++;
    }
  }
  return !0;
}
const Adt = 140, Odt = 2;
class JN {
  constructor(e, t, n) {
    const r = e.options, s = r.get(
      163
      /* EditorOption.pixelRatio */
    ), o = r.get(
      165
      /* EditorOption.layoutInfo */
    ), a = o.minimap, l = r.get(
      59
      /* EditorOption.fontInfo */
    ), c = r.get(
      81
      /* EditorOption.minimap */
    );
    this.renderMinimap = a.renderMinimap, this.size = c.size, this.minimapHeightIsEditorHeight = a.minimapHeightIsEditorHeight, this.scrollBeyondLastLine = r.get(
      119
      /* EditorOption.scrollBeyondLastLine */
    ), this.paddingTop = r.get(
      96
      /* EditorOption.padding */
    ).top, this.paddingBottom = r.get(
      96
      /* EditorOption.padding */
    ).bottom, this.showSlider = c.showSlider, this.autohide = c.autohide, this.pixelRatio = s, this.typicalHalfwidthCharacterWidth = l.typicalHalfwidthCharacterWidth, this.lineHeight = r.get(
      75
      /* EditorOption.lineHeight */
    ), this.minimapLeft = a.minimapLeft, this.minimapWidth = a.minimapWidth, this.minimapHeight = o.height, this.canvasInnerWidth = a.minimapCanvasInnerWidth, this.canvasInnerHeight = a.minimapCanvasInnerHeight, this.canvasOuterWidth = a.minimapCanvasOuterWidth, this.canvasOuterHeight = a.minimapCanvasOuterHeight, this.isSampling = a.minimapIsSampling, this.editorHeight = o.height, this.fontScale = a.minimapScale, this.minimapLineHeight = a.minimapLineHeight, this.minimapCharWidth = 1 * this.fontScale, this.sectionHeaderFontFamily = Rdt, this.sectionHeaderFontSize = c.sectionHeaderFontSize * s, this.sectionHeaderLetterSpacing = c.sectionHeaderLetterSpacing, this.sectionHeaderFontColor = JN._getSectionHeaderColor(t, n.getColor(
      1
      /* ColorId.DefaultForeground */
    )), this.charRenderer = JL(() => LF.create(this.fontScale, l.fontFamily)), this.defaultBackgroundColor = n.getColor(
      2
      /* ColorId.DefaultBackground */
    ), this.backgroundColor = JN._getMinimapBackground(t, this.defaultBackgroundColor), this.foregroundAlpha = JN._getMinimapForegroundOpacity(t);
  }
  static _getMinimapBackground(e, t) {
    const n = e.getColor(ilt);
    return n ? new My(n.rgba.r, n.rgba.g, n.rgba.b, Math.round(255 * n.rgba.a)) : t;
  }
  static _getMinimapForegroundOpacity(e) {
    const t = e.getColor(rlt);
    return t ? My._clamp(Math.round(255 * t.rgba.a)) : 255;
  }
  static _getSectionHeaderColor(e, t) {
    const n = e.getColor(kb);
    return n ? new My(n.rgba.r, n.rgba.g, n.rgba.b, Math.round(255 * n.rgba.a)) : t;
  }
  equals(e) {
    return this.renderMinimap === e.renderMinimap && this.size === e.size && this.minimapHeightIsEditorHeight === e.minimapHeightIsEditorHeight && this.scrollBeyondLastLine === e.scrollBeyondLastLine && this.paddingTop === e.paddingTop && this.paddingBottom === e.paddingBottom && this.showSlider === e.showSlider && this.autohide === e.autohide && this.pixelRatio === e.pixelRatio && this.typicalHalfwidthCharacterWidth === e.typicalHalfwidthCharacterWidth && this.lineHeight === e.lineHeight && this.minimapLeft === e.minimapLeft && this.minimapWidth === e.minimapWidth && this.minimapHeight === e.minimapHeight && this.canvasInnerWidth === e.canvasInnerWidth && this.canvasInnerHeight === e.canvasInnerHeight && this.canvasOuterWidth === e.canvasOuterWidth && this.canvasOuterHeight === e.canvasOuterHeight && this.isSampling === e.isSampling && this.editorHeight === e.editorHeight && this.fontScale === e.fontScale && this.minimapLineHeight === e.minimapLineHeight && this.minimapCharWidth === e.minimapCharWidth && this.sectionHeaderFontSize === e.sectionHeaderFontSize && this.sectionHeaderLetterSpacing === e.sectionHeaderLetterSpacing && this.defaultBackgroundColor && this.defaultBackgroundColor.equals(e.defaultBackgroundColor) && this.backgroundColor && this.backgroundColor.equals(e.backgroundColor) && this.foregroundAlpha === e.foregroundAlpha;
  }
}
class TF {
  constructor(e, t, n, r, s, o, a, l, c) {
    this.scrollTop = e, this.scrollHeight = t, this.sliderNeeded = n, this._computedSliderRatio = r, this.sliderTop = s, this.sliderHeight = o, this.topPaddingLineCount = a, this.startLineNumber = l, this.endLineNumber = c;
  }
  /**
   * Compute a desired `scrollPosition` such that the slider moves by `delta`.
   */
  getDesiredScrollTopFromDelta(e) {
    return Math.round(this.scrollTop + e / this._computedSliderRatio);
  }
  getDesiredScrollTopFromTouchLocation(e) {
    return Math.round((e - this.sliderHeight / 2) / this._computedSliderRatio);
  }
  /**
   * Intersect a line range with `this.startLineNumber` and `this.endLineNumber`.
   */
  intersectWithViewport(e) {
    const t = Math.max(this.startLineNumber, e.startLineNumber), n = Math.min(this.endLineNumber, e.endLineNumber);
    return t > n ? null : [t, n];
  }
  /**
   * Get the inner minimap y coordinate for a line number.
   */
  getYForLineNumber(e, t) {
    return +(e - this.startLineNumber + this.topPaddingLineCount) * t;
  }
  static create(e, t, n, r, s, o, a, l, c, u, d) {
    const h = e.pixelRatio, g = e.minimapLineHeight, m = Math.floor(e.canvasInnerHeight / g), _ = e.lineHeight;
    if (e.minimapHeightIsEditorHeight) {
      let N = l * e.lineHeight + e.paddingTop + e.paddingBottom;
      e.scrollBeyondLastLine && (N += Math.max(0, s - e.lineHeight - e.paddingBottom));
      const R = Math.max(1, Math.floor(s * s / N)), M = Math.max(0, e.minimapHeight - R), B = M / (u - s), H = c * B, j = M > 0, K = Math.floor(e.canvasInnerHeight / e.minimapLineHeight), X = Math.floor(e.paddingTop / e.lineHeight);
      return new TF(c, u, j, B, H, R, X, 1, Math.min(a, K));
    }
    let v;
    if (o && n !== a) {
      const N = n - t + 1;
      v = Math.floor(N * g / h);
    } else {
      const N = s / _;
      v = Math.floor(N * g / h);
    }
    const w = Math.floor(e.paddingTop / _);
    let E = Math.floor(e.paddingBottom / _);
    if (e.scrollBeyondLastLine) {
      const N = s / _;
      E = Math.max(E, N - 1);
    }
    let L;
    if (E > 0) {
      const N = s / _;
      L = (w + a + E - N - 1) * g / h;
    } else
      L = Math.max(0, (w + a) * g / h - v);
    L = Math.min(e.minimapHeight - v, L);
    const T = L / (u - s), D = c * T;
    if (m >= w + a + E) {
      const N = L > 0;
      return new TF(c, u, N, T, D, v, w, 1, a);
    } else {
      let N;
      t > 1 ? N = t + w : N = Math.max(1, c / _);
      let R, M = Math.max(1, Math.floor(N - D * h / g));
      M < w ? (R = w - M + 1, M = 1) : (R = 0, M = Math.max(1, M - w)), d && d.scrollHeight === u && (d.scrollTop > c && (M = Math.min(M, d.startLineNumber), R = Math.max(R, d.topPaddingLineCount)), d.scrollTop < c && (M = Math.max(M, d.startLineNumber), R = Math.min(R, d.topPaddingLineCount)));
      const B = Math.min(a, M - R + m - 1), H = (c - r) / _;
      let j;
      return c >= e.paddingTop ? j = (t - M + R + H) * g / h : j = c / e.paddingTop * (R + H) * g / h, new TF(c, u, !0, T, j, v, R, M, B);
    }
  }
}
const $j = class $j {
  constructor(e) {
    this.dy = e;
  }
  onContentChanged() {
    this.dy = -1;
  }
  onTokensChanged() {
    this.dy = -1;
  }
};
$j.INVALID = new $j(-1);
let gU = $j;
class ULe {
  constructor(e, t, n) {
    this.renderedLayout = e, this._imageData = t, this._renderedLines = new s3e({
      createLine: () => gU.INVALID
    }), this._renderedLines._set(e.startLineNumber, n);
  }
  /**
   * Check if the current RenderData matches accurately the new desired layout and no painting is needed.
   */
  linesEquals(e) {
    if (!this.scrollEquals(e))
      return !1;
    const n = this._renderedLines._get().lines;
    for (let r = 0, s = n.length; r < s; r++)
      if (n[r].dy === -1)
        return !1;
    return !0;
  }
  /**
   * Check if the current RenderData matches the new layout's scroll position
   */
  scrollEquals(e) {
    return this.renderedLayout.startLineNumber === e.startLineNumber && this.renderedLayout.endLineNumber === e.endLineNumber;
  }
  _get() {
    const e = this._renderedLines._get();
    return {
      imageData: this._imageData,
      rendLineNumberStart: e.rendLineNumberStart,
      lines: e.lines
    };
  }
  onLinesChanged(e, t) {
    return this._renderedLines.onLinesChanged(e, t);
  }
  onLinesDeleted(e, t) {
    this._renderedLines.onLinesDeleted(e, t);
  }
  onLinesInserted(e, t) {
    this._renderedLines.onLinesInserted(e, t);
  }
  onTokensChanged(e) {
    return this._renderedLines.onTokensChanged(e);
  }
}
class Wfe {
  constructor(e, t, n, r) {
    this._backgroundFillData = Wfe._createBackgroundFillData(t, n, r), this._buffers = [
      e.createImageData(t, n),
      e.createImageData(t, n)
    ], this._lastUsedBuffer = 0;
  }
  getBuffer() {
    this._lastUsedBuffer = 1 - this._lastUsedBuffer;
    const e = this._buffers[this._lastUsedBuffer];
    return e.data.set(this._backgroundFillData), e;
  }
  static _createBackgroundFillData(e, t, n) {
    const r = n.r, s = n.g, o = n.b, a = n.a, l = new Uint8ClampedArray(e * t * 4);
    let c = 0;
    for (let u = 0; u < t; u++)
      for (let d = 0; d < e; d++)
        l[c] = r, l[c + 1] = s, l[c + 2] = o, l[c + 3] = a, c += 4;
    return l;
  }
}
class k4 {
  static compute(e, t, n) {
    if (e.renderMinimap === 0 || !e.isSampling)
      return [null, []];
    const { minimapLineCount: r } = YN.computeContainedMinimapLineCount({
      viewLineCount: t,
      scrollBeyondLastLine: e.scrollBeyondLastLine,
      paddingTop: e.paddingTop,
      paddingBottom: e.paddingBottom,
      height: e.editorHeight,
      lineHeight: e.lineHeight,
      pixelRatio: e.pixelRatio
    }), s = t / r, o = s / 2;
    if (!n || n.minimapLines.length === 0) {
      const v = [];
      if (v[0] = 1, r > 1) {
        for (let w = 0, E = r - 1; w < E; w++)
          v[w] = Math.round(w * s + o);
        v[r - 1] = t;
      }
      return [new k4(s, v), []];
    }
    const a = n.minimapLines, l = a.length, c = [];
    let u = 0, d = 0, h = 1;
    const g = 10;
    let m = [], _ = null;
    for (let v = 0; v < r; v++) {
      const w = Math.max(h, Math.round(v * s)), E = Math.max(w, Math.round((v + 1) * s));
      for (; u < l && a[u] < w; ) {
        if (m.length < g) {
          const T = u + 1 + d;
          _ && _.type === "deleted" && _._oldIndex === u - 1 ? _.deleteToLineNumber++ : (_ = { type: "deleted", _oldIndex: u, deleteFromLineNumber: T, deleteToLineNumber: T }, m.push(_)), d--;
        }
        u++;
      }
      let L;
      if (u < l && a[u] <= E)
        L = a[u], u++;
      else if (v === 0 ? L = 1 : v + 1 === r ? L = t : L = Math.round(v * s + o), m.length < g) {
        const T = u + 1 + d;
        _ && _.type === "inserted" && _._i === v - 1 ? _.insertToLineNumber++ : (_ = { type: "inserted", _i: v, insertFromLineNumber: T, insertToLineNumber: T }, m.push(_)), d++;
      }
      c[v] = L, h = L;
    }
    if (m.length < g)
      for (; u < l; ) {
        const v = u + 1 + d;
        _ && _.type === "deleted" && _._oldIndex === u - 1 ? _.deleteToLineNumber++ : (_ = { type: "deleted", _oldIndex: u, deleteFromLineNumber: v, deleteToLineNumber: v }, m.push(_)), d--, u++;
      }
    else
      m = [{ type: "flush" }];
    return [new k4(s, c), m];
  }
  constructor(e, t) {
    this.samplingRatio = e, this.minimapLines = t;
  }
  modelLineToMinimapLine(e) {
    return Math.min(this.minimapLines.length, Math.max(1, Math.round(e / this.samplingRatio)));
  }
  /**
   * Will return null if the model line ranges are not intersecting with a sampled model line.
   */
  modelLineRangeToMinimapLineRange(e, t) {
    let n = this.modelLineToMinimapLine(e) - 1;
    for (; n > 0 && this.minimapLines[n - 1] >= e; )
      n--;
    let r = this.modelLineToMinimapLine(t) - 1;
    for (; r + 1 < this.minimapLines.length && this.minimapLines[r + 1] <= t; )
      r++;
    if (n === r) {
      const s = this.minimapLines[n];
      if (s < e || s > t)
        return null;
    }
    return [n + 1, r + 1];
  }
  /**
   * Will always return a range, even if it is not intersecting with a sampled model line.
   */
  decorationLineRangeToMinimapLineRange(e, t) {
    let n = this.modelLineToMinimapLine(e), r = this.modelLineToMinimapLine(t);
    return e !== t && r === n && (r === this.minimapLines.length ? n > 1 && n-- : r++), [n, r];
  }
  onLinesDeleted(e) {
    const t = e.toLineNumber - e.fromLineNumber + 1;
    let n = this.minimapLines.length, r = 0;
    for (let s = this.minimapLines.length - 1; s >= 0 && !(this.minimapLines[s] < e.fromLineNumber); s--)
      this.minimapLines[s] <= e.toLineNumber ? (this.minimapLines[s] = Math.max(1, e.fromLineNumber - 1), n = Math.min(n, s), r = Math.max(r, s)) : this.minimapLines[s] -= t;
    return [n, r];
  }
  onLinesInserted(e) {
    const t = e.toLineNumber - e.fromLineNumber + 1;
    for (let n = this.minimapLines.length - 1; n >= 0 && !(this.minimapLines[n] < e.fromLineNumber); n--)
      this.minimapLines[n] += t;
  }
}
class Mdt extends fu {
  constructor(e) {
    super(e), this._sectionHeaderCache = new Tb(10, 1.5), this.tokensColorTracker = fU.getInstance(), this._selections = [], this._minimapSelections = null, this.options = new JN(this._context.configuration, this._context.theme, this.tokensColorTracker);
    const [t] = k4.compute(this.options, this._context.viewModel.getLineCount(), null);
    this._samplingState = t, this._shouldCheckSampling = !1, this._actual = new lN(e.theme, this);
  }
  dispose() {
    this._actual.dispose(), super.dispose();
  }
  getDomNode() {
    return this._actual.getDomNode();
  }
  _onOptionsMaybeChanged() {
    const e = new JN(this._context.configuration, this._context.theme, this.tokensColorTracker);
    return this.options.equals(e) ? !1 : (this.options = e, this._recreateLineSampling(), this._actual.onDidChangeOptions(), !0);
  }
  // ---- begin view event handlers
  onConfigurationChanged(e) {
    return this._onOptionsMaybeChanged();
  }
  onCursorStateChanged(e) {
    return this._selections = e.selections, this._minimapSelections = null, this._actual.onSelectionChanged();
  }
  onDecorationsChanged(e) {
    return e.affectsMinimap ? this._actual.onDecorationsChanged() : !1;
  }
  onFlushed(e) {
    return this._samplingState && (this._shouldCheckSampling = !0), this._actual.onFlushed();
  }
  onLinesChanged(e) {
    if (this._samplingState) {
      const t = this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber, e.fromLineNumber + e.count - 1);
      return t ? this._actual.onLinesChanged(t[0], t[1] - t[0] + 1) : !1;
    } else
      return this._actual.onLinesChanged(e.fromLineNumber, e.count);
  }
  onLinesDeleted(e) {
    if (this._samplingState) {
      const [t, n] = this._samplingState.onLinesDeleted(e);
      return t <= n && this._actual.onLinesChanged(t + 1, n - t + 1), this._shouldCheckSampling = !0, !0;
    } else
      return this._actual.onLinesDeleted(e.fromLineNumber, e.toLineNumber);
  }
  onLinesInserted(e) {
    return this._samplingState ? (this._samplingState.onLinesInserted(e), this._shouldCheckSampling = !0, !0) : this._actual.onLinesInserted(e.fromLineNumber, e.toLineNumber);
  }
  onScrollChanged(e) {
    return this._actual.onScrollChanged(e);
  }
  onThemeChanged(e) {
    return this._actual.onThemeChanged(), this._onOptionsMaybeChanged(), !0;
  }
  onTokensChanged(e) {
    if (this._samplingState) {
      const t = [];
      for (const n of e.ranges) {
        const r = this._samplingState.modelLineRangeToMinimapLineRange(n.fromLineNumber, n.toLineNumber);
        r && t.push({ fromLineNumber: r[0], toLineNumber: r[1] });
      }
      return t.length ? this._actual.onTokensChanged(t) : !1;
    } else
      return this._actual.onTokensChanged(e.ranges);
  }
  onTokensColorsChanged(e) {
    return this._onOptionsMaybeChanged(), this._actual.onTokensColorsChanged();
  }
  onZonesChanged(e) {
    return this._actual.onZonesChanged();
  }
  // --- end event handlers
  prepareRender(e) {
    this._shouldCheckSampling && (this._shouldCheckSampling = !1, this._recreateLineSampling());
  }
  render(e) {
    let t = e.visibleRange.startLineNumber, n = e.visibleRange.endLineNumber;
    this._samplingState && (t = this._samplingState.modelLineToMinimapLine(t), n = this._samplingState.modelLineToMinimapLine(n));
    const r = {
      viewportContainsWhitespaceGaps: e.viewportData.whitespaceViewportData.length > 0,
      scrollWidth: e.scrollWidth,
      scrollHeight: e.scrollHeight,
      viewportStartLineNumber: t,
      viewportEndLineNumber: n,
      viewportStartLineNumberVerticalOffset: e.getVerticalOffsetForLineNumber(t),
      scrollTop: e.scrollTop,
      scrollLeft: e.scrollLeft,
      viewportWidth: e.viewportWidth,
      viewportHeight: e.viewportHeight
    };
    this._actual.render(r);
  }
  //#region IMinimapModel
  _recreateLineSampling() {
    this._minimapSelections = null;
    const e = !!this._samplingState, [t, n] = k4.compute(this.options, this._context.viewModel.getLineCount(), this._samplingState);
    if (this._samplingState = t, e && this._samplingState)
      for (const r of n)
        switch (r.type) {
          case "deleted":
            this._actual.onLinesDeleted(r.deleteFromLineNumber, r.deleteToLineNumber);
            break;
          case "inserted":
            this._actual.onLinesInserted(r.insertFromLineNumber, r.insertToLineNumber);
            break;
          case "flush":
            this._actual.onFlushed();
            break;
        }
  }
  getLineCount() {
    return this._samplingState ? this._samplingState.minimapLines.length : this._context.viewModel.getLineCount();
  }
  getRealLineCount() {
    return this._context.viewModel.getLineCount();
  }
  getLineContent(e) {
    return this._samplingState ? this._context.viewModel.getLineContent(this._samplingState.minimapLines[e - 1]) : this._context.viewModel.getLineContent(e);
  }
  getLineMaxColumn(e) {
    return this._samplingState ? this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e - 1]) : this._context.viewModel.getLineMaxColumn(e);
  }
  getMinimapLinesRenderingData(e, t, n) {
    if (this._samplingState) {
      const r = [];
      for (let s = 0, o = t - e + 1; s < o; s++)
        n[s] ? r[s] = this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e + s - 1]) : r[s] = null;
      return r;
    }
    return this._context.viewModel.getMinimapLinesRenderingData(e, t, n).data;
  }
  getSelections() {
    if (this._minimapSelections === null)
      if (this._samplingState) {
        this._minimapSelections = [];
        for (const e of this._selections) {
          const [t, n] = this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber, e.endLineNumber);
          this._minimapSelections.push(new bt(t, e.startColumn, n, e.endColumn));
        }
      } else
        this._minimapSelections = this._selections;
    return this._minimapSelections;
  }
  getMinimapDecorationsInViewport(e, t) {
    return this._getMinimapDecorationsInViewport(e, t).filter((n) => {
      var r;
      return !((r = n.options.minimap) != null && r.sectionHeaderStyle);
    });
  }
  getSectionHeaderDecorationsInViewport(e, t) {
    const n = this.options.sectionHeaderFontSize / this.options.minimapLineHeight;
    return e = Math.floor(Math.max(1, e - n)), this._getMinimapDecorationsInViewport(e, t).filter((r) => {
      var s;
      return !!((s = r.options.minimap) != null && s.sectionHeaderStyle);
    });
  }
  _getMinimapDecorationsInViewport(e, t) {
    let n;
    if (this._samplingState) {
      const s = this._samplingState.minimapLines[e - 1], o = this._samplingState.minimapLines[t - 1];
      n = new z(s, 1, o, this._context.viewModel.getLineMaxColumn(o));
    } else
      n = new z(e, 1, t, this._context.viewModel.getLineMaxColumn(t));
    const r = this._context.viewModel.getMinimapDecorationsInRange(n);
    if (this._samplingState) {
      const s = [];
      for (const o of r) {
        if (!o.options.minimap)
          continue;
        const a = o.range, l = this._samplingState.modelLineToMinimapLine(a.startLineNumber), c = this._samplingState.modelLineToMinimapLine(a.endLineNumber);
        s.push(new T3e(new z(l, a.startColumn, c, a.endColumn), o.options));
      }
      return s;
    }
    return r;
  }
  getSectionHeaderText(e, t) {
    var o;
    const n = (o = e.options.minimap) == null ? void 0 : o.sectionHeaderText;
    if (!n)
      return null;
    const r = this._sectionHeaderCache.get(n);
    if (r)
      return r;
    const s = t(n);
    return this._sectionHeaderCache.set(n, s), s;
  }
  getOptions() {
    return this._context.viewModel.model.getOptions();
  }
  revealLineNumber(e) {
    this._samplingState && (e = this._samplingState.minimapLines[e - 1]), this._context.viewModel.revealRange(
      "mouse",
      !1,
      new z(e, 1, e, 1),
      1,
      0
      /* ScrollType.Smooth */
    );
  }
  setScrollTop(e) {
    this._context.viewModel.viewLayout.setScrollPosition(
      {
        scrollTop: e
      },
      1
      /* ScrollType.Immediate */
    );
  }
}
class lN extends ge {
  constructor(e, t) {
    super(), this._renderDecorations = !1, this._gestureInProgress = !1, this._isMouseOverMinimap = !1, this._theme = e, this._model = t, this._lastRenderData = null, this._buffers = null, this._selectionColor = this._theme.getColor(ILe), this._domNode = Gi(document.createElement("div")), gm.write(
      this._domNode,
      9
      /* PartFingerprint.Minimap */
    ), this._domNode.setClassName(this._getMinimapDomNodeClassName()), this._domNode.setPosition("absolute"), this._domNode.setAttribute("role", "presentation"), this._domNode.setAttribute("aria-hidden", "true"), this._shadow = Gi(document.createElement("div")), this._shadow.setClassName("minimap-shadow-hidden"), this._domNode.appendChild(this._shadow), this._canvas = Gi(document.createElement("canvas")), this._canvas.setPosition("absolute"), this._canvas.setLeft(0), this._domNode.appendChild(this._canvas), this._decorationsCanvas = Gi(document.createElement("canvas")), this._decorationsCanvas.setPosition("absolute"), this._decorationsCanvas.setClassName("minimap-decorations-layer"), this._decorationsCanvas.setLeft(0), this._domNode.appendChild(this._decorationsCanvas), this._slider = Gi(document.createElement("div")), this._slider.setPosition("absolute"), this._slider.setClassName("minimap-slider"), this._slider.setLayerHinting(!0), this._slider.setContain("strict"), this._domNode.appendChild(this._slider), this._sliderHorizontal = Gi(document.createElement("div")), this._sliderHorizontal.setPosition("absolute"), this._sliderHorizontal.setClassName("minimap-slider-horizontal"), this._slider.appendChild(this._sliderHorizontal), this._applyLayout(), this._hideDelayedScheduler = this._register(new mr(() => this._hideImmediatelyIfMouseIsOutside(), 500)), this._register(vo(this._domNode.domNode, Xe.MOUSE_OVER, () => {
      this._isMouseOverMinimap = !0;
    })), this._register(vo(this._domNode.domNode, Xe.MOUSE_LEAVE, () => {
      this._isMouseOverMinimap = !1;
    })), this._pointerDownListener = vo(this._domNode.domNode, Xe.POINTER_DOWN, (n) => {
      n.preventDefault();
      const r = n.pointerType === "mouse", s = n.button === 0;
      if (this._model.options.renderMinimap !== 0 && this._lastRenderData) {
        if (this._model.options.size !== "proportional") {
          if (s && this._lastRenderData) {
            const a = ho(this._slider.domNode), l = a.top + a.height / 2;
            this._startSliderDragging(n, l, this._lastRenderData.renderedLayout);
          }
          return;
        }
        if (s || !r) {
          const a = this._model.options.minimapLineHeight, l = this._model.options.canvasInnerHeight / this._model.options.canvasOuterHeight * n.offsetY;
          let u = Math.floor(l / a) + this._lastRenderData.renderedLayout.startLineNumber - this._lastRenderData.renderedLayout.topPaddingLineCount;
          u = Math.min(u, this._model.getLineCount()), this._model.revealLineNumber(u);
        }
      }
    }), this._sliderPointerMoveMonitor = new JA(), this._sliderPointerDownListener = vo(this._slider.domNode, Xe.POINTER_DOWN, (n) => {
      n.preventDefault(), n.stopPropagation(), n.button === 0 && this._lastRenderData && this._startSliderDragging(n, n.pageY, this._lastRenderData.renderedLayout);
    }), this._gestureDisposable = ec.addTarget(this._domNode.domNode), this._sliderTouchStartListener = Ce(this._domNode.domNode, zr.Start, (n) => {
      n.preventDefault(), n.stopPropagation(), this._lastRenderData && (this._slider.toggleClassName("active", !0), this._gestureInProgress = !0, this.scrollDueToTouchEvent(n));
    }, { passive: !1 }), this._sliderTouchMoveListener = Ce(this._domNode.domNode, zr.Change, (n) => {
      n.preventDefault(), n.stopPropagation(), this._lastRenderData && this._gestureInProgress && this.scrollDueToTouchEvent(n);
    }, { passive: !1 }), this._sliderTouchEndListener = vo(this._domNode.domNode, zr.End, (n) => {
      n.preventDefault(), n.stopPropagation(), this._gestureInProgress = !1, this._slider.toggleClassName("active", !1);
    });
  }
  _hideSoon() {
    this._hideDelayedScheduler.cancel(), this._hideDelayedScheduler.schedule();
  }
  _hideImmediatelyIfMouseIsOutside() {
    if (this._isMouseOverMinimap) {
      this._hideSoon();
      return;
    }
    this._domNode.toggleClassName("active", !1);
  }
  _startSliderDragging(e, t, n) {
    if (!e.target || !(e.target instanceof Element))
      return;
    const r = e.pageX;
    this._slider.toggleClassName("active", !0);
    const s = (o, a) => {
      const l = ho(this._domNode.domNode), c = Math.min(Math.abs(a - r), Math.abs(a - l.left), Math.abs(a - l.left - l.width));
      if (Za && c > Adt) {
        this._model.setScrollTop(n.scrollTop);
        return;
      }
      const u = o - t;
      this._model.setScrollTop(n.getDesiredScrollTopFromDelta(u));
    };
    e.pageY !== t && s(e.pageY, r), this._sliderPointerMoveMonitor.startMonitoring(e.target, e.pointerId, e.buttons, (o) => s(o.pageY, o.pageX), () => {
      this._slider.toggleClassName("active", !1);
    });
  }
  scrollDueToTouchEvent(e) {
    const t = this._domNode.domNode.getBoundingClientRect().top, n = this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY - t);
    this._model.setScrollTop(n);
  }
  dispose() {
    this._pointerDownListener.dispose(), this._sliderPointerMoveMonitor.dispose(), this._sliderPointerDownListener.dispose(), this._gestureDisposable.dispose(), this._sliderTouchStartListener.dispose(), this._sliderTouchMoveListener.dispose(), this._sliderTouchEndListener.dispose(), super.dispose();
  }
  _getMinimapDomNodeClassName() {
    const e = ["minimap"];
    return this._model.options.showSlider === "always" ? e.push("slider-always") : e.push("slider-mouseover"), this._model.options.autohide === "mouseover" ? e.push("minimap-autohide-mouseover") : this._model.options.autohide === "scroll" && e.push("minimap-autohide-scroll"), e.join(" ");
  }
  getDomNode() {
    return this._domNode;
  }
  _applyLayout() {
    this._domNode.setLeft(this._model.options.minimapLeft), this._domNode.setWidth(this._model.options.minimapWidth), this._domNode.setHeight(this._model.options.minimapHeight), this._shadow.setHeight(this._model.options.minimapHeight), this._canvas.setWidth(this._model.options.canvasOuterWidth), this._canvas.setHeight(this._model.options.canvasOuterHeight), this._canvas.domNode.width = this._model.options.canvasInnerWidth, this._canvas.domNode.height = this._model.options.canvasInnerHeight, this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth), this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight), this._decorationsCanvas.domNode.width = this._model.options.canvasInnerWidth, this._decorationsCanvas.domNode.height = this._model.options.canvasInnerHeight, this._slider.setWidth(this._model.options.minimapWidth);
  }
  _getBuffer() {
    return this._buffers || this._model.options.canvasInnerWidth > 0 && this._model.options.canvasInnerHeight > 0 && (this._buffers = new Wfe(this._canvas.domNode.getContext("2d"), this._model.options.canvasInnerWidth, this._model.options.canvasInnerHeight, this._model.options.backgroundColor)), this._buffers ? this._buffers.getBuffer() : null;
  }
  // ---- begin view event handlers
  onDidChangeOptions() {
    this._lastRenderData = null, this._buffers = null, this._applyLayout(), this._domNode.setClassName(this._getMinimapDomNodeClassName());
  }
  onSelectionChanged() {
    return this._renderDecorations = !0, !0;
  }
  onDecorationsChanged() {
    return this._renderDecorations = !0, !0;
  }
  onFlushed() {
    return this._lastRenderData = null, !0;
  }
  onLinesChanged(e, t) {
    return this._lastRenderData ? this._lastRenderData.onLinesChanged(e, t) : !1;
  }
  onLinesDeleted(e, t) {
    var n;
    return (n = this._lastRenderData) == null || n.onLinesDeleted(e, t), !0;
  }
  onLinesInserted(e, t) {
    var n;
    return (n = this._lastRenderData) == null || n.onLinesInserted(e, t), !0;
  }
  onScrollChanged(e) {
    return this._model.options.autohide === "scroll" && (e.scrollTopChanged || e.scrollHeightChanged) && (this._domNode.toggleClassName("active", !0), this._hideSoon()), this._renderDecorations = !0, !0;
  }
  onThemeChanged() {
    return this._selectionColor = this._theme.getColor(ILe), this._renderDecorations = !0, !0;
  }
  onTokensChanged(e) {
    return this._lastRenderData ? this._lastRenderData.onTokensChanged(e) : !1;
  }
  onTokensColorsChanged() {
    return this._lastRenderData = null, this._buffers = null, !0;
  }
  onZonesChanged() {
    return this._lastRenderData = null, !0;
  }
  // --- end event handlers
  render(e) {
    if (this._model.options.renderMinimap === 0) {
      this._shadow.setClassName("minimap-shadow-hidden"), this._sliderHorizontal.setWidth(0), this._sliderHorizontal.setHeight(0);
      return;
    }
    e.scrollLeft + e.viewportWidth >= e.scrollWidth ? this._shadow.setClassName("minimap-shadow-hidden") : this._shadow.setClassName("minimap-shadow-visible");
    const n = TF.create(this._model.options, e.viewportStartLineNumber, e.viewportEndLineNumber, e.viewportStartLineNumberVerticalOffset, e.viewportHeight, e.viewportContainsWhitespaceGaps, this._model.getLineCount(), this._model.getRealLineCount(), e.scrollTop, e.scrollHeight, this._lastRenderData ? this._lastRenderData.renderedLayout : null);
    this._slider.setDisplay(n.sliderNeeded ? "block" : "none"), this._slider.setTop(n.sliderTop), this._slider.setHeight(n.sliderHeight), this._sliderHorizontal.setLeft(0), this._sliderHorizontal.setWidth(this._model.options.minimapWidth), this._sliderHorizontal.setTop(0), this._sliderHorizontal.setHeight(n.sliderHeight), this.renderDecorations(n), this._lastRenderData = this.renderLines(n);
  }
  renderDecorations(e) {
    if (this._renderDecorations) {
      this._renderDecorations = !1;
      const t = this._model.getSelections();
      t.sort(z.compareRangesUsingStarts);
      const n = this._model.getMinimapDecorationsInViewport(e.startLineNumber, e.endLineNumber);
      n.sort((h, g) => (h.options.zIndex || 0) - (g.options.zIndex || 0));
      const { canvasInnerWidth: r, canvasInnerHeight: s } = this._model.options, o = this._model.options.minimapLineHeight, a = this._model.options.minimapCharWidth, l = this._model.getOptions().tabSize, c = this._decorationsCanvas.domNode.getContext("2d");
      c.clearRect(0, 0, r, s);
      const u = new zLe(e.startLineNumber, e.endLineNumber, !1);
      this._renderSelectionLineHighlights(c, t, u, e, o), this._renderDecorationsLineHighlights(c, n, u, e, o);
      const d = new zLe(e.startLineNumber, e.endLineNumber, null);
      this._renderSelectionsHighlights(c, t, d, e, o, l, a, r), this._renderDecorationsHighlights(c, n, d, e, o, l, a, r), this._renderSectionHeaders(e);
    }
  }
  _renderSelectionLineHighlights(e, t, n, r, s) {
    if (!this._selectionColor || this._selectionColor.isTransparent())
      return;
    e.fillStyle = this._selectionColor.transparent(0.5).toString();
    let o = 0, a = 0;
    for (const l of t) {
      const c = r.intersectWithViewport(l);
      if (!c)
        continue;
      const [u, d] = c;
      for (let m = u; m <= d; m++)
        n.set(m, !0);
      const h = r.getYForLineNumber(u, s), g = r.getYForLineNumber(d, s);
      a >= h || (a > o && e.fillRect(C_, o, e.canvas.width, a - o), o = h), a = g;
    }
    a > o && e.fillRect(C_, o, e.canvas.width, a - o);
  }
  _renderDecorationsLineHighlights(e, t, n, r, s) {
    const o = /* @__PURE__ */ new Map();
    for (let a = t.length - 1; a >= 0; a--) {
      const l = t[a], c = l.options.minimap;
      if (!c || c.position !== 1)
        continue;
      const u = r.intersectWithViewport(l.range);
      if (!u)
        continue;
      const [d, h] = u, g = c.getColor(this._theme.value);
      if (!g || g.isTransparent())
        continue;
      let m = o.get(g.toString());
      m || (m = g.transparent(0.5).toString(), o.set(g.toString(), m)), e.fillStyle = m;
      for (let _ = d; _ <= h; _++) {
        if (n.has(_))
          continue;
        n.set(_, !0);
        const v = r.getYForLineNumber(d, s);
        e.fillRect(C_, v, e.canvas.width, s);
      }
    }
  }
  _renderSelectionsHighlights(e, t, n, r, s, o, a, l) {
    if (!(!this._selectionColor || this._selectionColor.isTransparent()))
      for (const c of t) {
        const u = r.intersectWithViewport(c);
        if (!u)
          continue;
        const [d, h] = u;
        for (let g = d; g <= h; g++)
          this.renderDecorationOnLine(e, n, c, this._selectionColor, r, g, s, s, o, a, l);
      }
  }
  _renderDecorationsHighlights(e, t, n, r, s, o, a, l) {
    for (const c of t) {
      const u = c.options.minimap;
      if (!u)
        continue;
      const d = r.intersectWithViewport(c.range);
      if (!d)
        continue;
      const [h, g] = d, m = u.getColor(this._theme.value);
      if (!(!m || m.isTransparent()))
        for (let _ = h; _ <= g; _++)
          switch (u.position) {
            case 1:
              this.renderDecorationOnLine(e, n, c.range, m, r, _, s, s, o, a, l);
              continue;
            case 2: {
              const v = r.getYForLineNumber(_, s);
              this.renderDecoration(e, m, 2, v, Odt, s);
              continue;
            }
          }
    }
  }
  renderDecorationOnLine(e, t, n, r, s, o, a, l, c, u, d) {
    const h = s.getYForLineNumber(o, l);
    if (h + a < 0 || h > this._model.options.canvasInnerHeight)
      return;
    const { startLineNumber: g, endLineNumber: m } = n, _ = g === o ? n.startColumn : 1, v = m === o ? n.endColumn : this._model.getLineMaxColumn(o), w = this.getXOffsetForPosition(t, o, _, c, u, d), E = this.getXOffsetForPosition(t, o, v, c, u, d);
    this.renderDecoration(e, r, w, h, E - w, a);
  }
  getXOffsetForPosition(e, t, n, r, s, o) {
    if (n === 1)
      return C_;
    if ((n - 1) * s >= o)
      return o;
    let l = e.get(t);
    if (!l) {
      const c = this._model.getLineContent(t);
      l = [C_];
      let u = C_;
      for (let d = 1; d < c.length + 1; d++) {
        const h = c.charCodeAt(d - 1), g = h === 9 ? r * s : tw(h) ? 2 * s : s, m = u + g;
        if (m >= o) {
          l[d] = o;
          break;
        }
        l[d] = m, u = m;
      }
      e.set(t, l);
    }
    return n - 1 < l.length ? l[n - 1] : o;
  }
  renderDecoration(e, t, n, r, s, o) {
    e.fillStyle = t && t.toString() || "", e.fillRect(n, r, s, o);
  }
  _renderSectionHeaders(e) {
    var _;
    const t = this._model.options.minimapLineHeight, n = this._model.options.sectionHeaderFontSize, r = this._model.options.sectionHeaderLetterSpacing, s = n * 1.5, { canvasInnerWidth: o } = this._model.options, a = this._model.options.backgroundColor, l = `rgb(${a.r} ${a.g} ${a.b} / .7)`, c = this._model.options.sectionHeaderFontColor, u = `rgb(${c.r} ${c.g} ${c.b})`, d = u, h = this._decorationsCanvas.domNode.getContext("2d");
    h.letterSpacing = r + "px", h.font = "500 " + n + "px " + this._model.options.sectionHeaderFontFamily, h.strokeStyle = d, h.lineWidth = 0.4;
    const g = this._model.getSectionHeaderDecorationsInViewport(e.startLineNumber, e.endLineNumber);
    g.sort((v, w) => v.range.startLineNumber - w.range.startLineNumber);
    const m = lN._fitSectionHeader.bind(null, h, o - C_);
    for (const v of g) {
      const w = e.getYForLineNumber(v.range.startLineNumber, t) + n, E = w - n, L = E + 2, T = this._model.getSectionHeaderText(v, m);
      lN._renderSectionLabel(h, T, ((_ = v.options.minimap) == null ? void 0 : _.sectionHeaderStyle) === 2, l, u, o, E, s, w, L);
    }
  }
  static _fitSectionHeader(e, t, n) {
    if (!n)
      return n;
    const r = "…", s = e.measureText(n).width, o = e.measureText(r).width;
    if (s <= t || s <= o)
      return n;
    const a = n.length, l = s / n.length, c = Math.floor((t - o) / l) - 1;
    let u = Math.ceil(c / 2);
    for (; u > 0 && /\s/.test(n[u - 1]); )
      --u;
    return n.substring(0, u) + r + n.substring(a - (c - u));
  }
  static _renderSectionLabel(e, t, n, r, s, o, a, l, c, u) {
    t && (e.fillStyle = r, e.fillRect(0, a, o, l), e.fillStyle = s, e.fillText(t, C_, c)), n && (e.beginPath(), e.moveTo(0, u), e.lineTo(o, u), e.closePath(), e.stroke());
  }
  renderLines(e) {
    const t = e.startLineNumber, n = e.endLineNumber, r = this._model.options.minimapLineHeight;
    if (this._lastRenderData && this._lastRenderData.linesEquals(e)) {
      const G = this._lastRenderData._get();
      return new ULe(e, G.imageData, G.lines);
    }
    const s = this._getBuffer();
    if (!s)
      return null;
    const [o, a, l] = lN._renderUntouchedLines(s, e.topPaddingLineCount, t, n, r, this._lastRenderData), c = this._model.getMinimapLinesRenderingData(t, n, l), u = this._model.getOptions().tabSize, d = this._model.options.defaultBackgroundColor, h = this._model.options.backgroundColor, g = this._model.options.foregroundAlpha, m = this._model.tokensColorTracker, _ = m.backgroundIsLight(), v = this._model.options.renderMinimap, w = this._model.options.charRenderer(), E = this._model.options.fontScale, L = this._model.options.minimapCharWidth, D = (v === 1 ? 2 : 3) * E, N = r > D ? Math.floor((r - D) / 2) : 0, R = h.a / 255, M = new My(Math.round((h.r - d.r) * R + d.r), Math.round((h.g - d.g) * R + d.g), Math.round((h.b - d.b) * R + d.b), 255);
    let B = e.topPaddingLineCount * r;
    const H = [];
    for (let G = 0, Q = n - t + 1; G < Q; G++)
      l[G] && lN._renderLine(s, M, h.a, _, v, L, m, g, w, B, N, u, c[G], E, r), H[G] = new gU(B), B += r;
    const j = o === -1 ? 0 : o, X = (a === -1 ? s.height : a) - j;
    return this._canvas.domNode.getContext("2d").putImageData(s, 0, 0, 0, j, s.width, X), new ULe(e, s, H);
  }
  static _renderUntouchedLines(e, t, n, r, s, o) {
    const a = [];
    if (!o) {
      for (let B = 0, H = r - n + 1; B < H; B++)
        a[B] = !0;
      return [-1, -1, a];
    }
    const l = o._get(), c = l.imageData.data, u = l.rendLineNumberStart, d = l.lines, h = d.length, g = e.width, m = e.data, _ = (r - n + 1) * s * g * 4;
    let v = -1, w = -1, E = -1, L = -1, T = -1, D = -1, N = t * s;
    for (let B = n; B <= r; B++) {
      const H = B - n, j = B - u, K = j >= 0 && j < h ? d[j].dy : -1;
      if (K === -1) {
        a[H] = !0, N += s;
        continue;
      }
      const X = K * g * 4, Y = (K + s) * g * 4, G = N * g * 4, Q = (N + s) * g * 4;
      L === X && D === G ? (L = Y, D = Q) : (E !== -1 && (m.set(c.subarray(E, L), T), v === -1 && E === 0 && E === T && (v = L), w === -1 && L === _ && E === T && (w = E)), E = X, L = Y, T = G, D = Q), a[H] = !1, N += s;
    }
    E !== -1 && (m.set(c.subarray(E, L), T), v === -1 && E === 0 && E === T && (v = L), w === -1 && L === _ && E === T && (w = E));
    const R = v === -1 ? -1 : v / (g * 4), M = w === -1 ? -1 : w / (g * 4);
    return [R, M, a];
  }
  static _renderLine(e, t, n, r, s, o, a, l, c, u, d, h, g, m, _) {
    const v = g.content, w = g.tokens, E = e.width - o, L = _ === 1;
    let T = C_, D = 0, N = 0;
    for (let R = 0, M = w.getCount(); R < M; R++) {
      const B = w.getEndOffset(R), H = w.getForeground(R), j = a.getColor(H);
      for (; D < B; D++) {
        if (T > E)
          return;
        const K = v.charCodeAt(D);
        if (K === 9) {
          const X = h - (D + N) % h;
          N += X - 1, T += X * o;
        } else if (K === 32)
          T += o;
        else {
          const X = tw(K) ? 2 : 1;
          for (let Y = 0; Y < X; Y++)
            if (s === 2 ? c.blockRenderChar(e, T, u + d, j, l, t, n, L) : c.renderChar(e, T, u + d, K, j, l, t, n, m, r, L), T += o, T > E)
              return;
        }
      }
    }
  }
}
class zLe {
  constructor(e, t, n) {
    this._startLineNumber = e, this._endLineNumber = t, this._defaultValue = n, this._values = [];
    for (let r = 0, s = this._endLineNumber - this._startLineNumber + 1; r < s; r++)
      this._values[r] = n;
  }
  has(e) {
    return this.get(e) !== this._defaultValue;
  }
  set(e, t) {
    e < this._startLineNumber || e > this._endLineNumber || (this._values[e - this._startLineNumber] = t);
  }
  get(e) {
    return e < this._startLineNumber || e > this._endLineNumber ? this._defaultValue : this._values[e - this._startLineNumber];
  }
}
class Pdt extends fu {
  constructor(e, t) {
    super(e), this._viewDomNode = t;
    const r = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._widgets = {}, this._verticalScrollbarWidth = r.verticalScrollbarWidth, this._minimapWidth = r.minimap.minimapWidth, this._horizontalScrollbarHeight = r.horizontalScrollbarHeight, this._editorHeight = r.height, this._editorWidth = r.width, this._viewDomNodeRect = { top: 0, left: 0, width: 0, height: 0 }, this._domNode = Gi(document.createElement("div")), gm.write(
      this._domNode,
      4
      /* PartFingerprint.OverlayWidgets */
    ), this._domNode.setClassName("overlayWidgets"), this.overflowingOverlayWidgetsDomNode = Gi(document.createElement("div")), gm.write(
      this.overflowingOverlayWidgetsDomNode,
      5
      /* PartFingerprint.OverflowingOverlayWidgets */
    ), this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets");
  }
  dispose() {
    super.dispose(), this._widgets = {};
  }
  getDomNode() {
    return this._domNode;
  }
  // ---- begin view event handlers
  onConfigurationChanged(e) {
    const n = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
    return this._verticalScrollbarWidth = n.verticalScrollbarWidth, this._minimapWidth = n.minimap.minimapWidth, this._horizontalScrollbarHeight = n.horizontalScrollbarHeight, this._editorHeight = n.height, this._editorWidth = n.width, !0;
  }
  // ---- end view event handlers
  _widgetCanOverflow(e) {
    const n = this._context.configuration.options.get(
      4
      /* EditorOption.allowOverflow */
    );
    return (e.allowEditorOverflow || !1) && n;
  }
  addWidget(e) {
    const t = Gi(e.getDomNode());
    this._widgets[e.getId()] = {
      widget: e,
      preference: null,
      domNode: t
    }, t.setPosition("absolute"), t.setAttribute("widgetId", e.getId()), this._widgetCanOverflow(e) ? this.overflowingOverlayWidgetsDomNode.appendChild(t) : this._domNode.appendChild(t), this.setShouldRender(), this._updateMaxMinWidth();
  }
  setWidgetPosition(e, t) {
    const n = this._widgets[e.getId()], r = t ? t.preference : null, s = t == null ? void 0 : t.stackOridinal;
    return n.preference === r && n.stack === s ? (this._updateMaxMinWidth(), !1) : (n.preference = r, n.stack = s, this.setShouldRender(), this._updateMaxMinWidth(), !0);
  }
  removeWidget(e) {
    const t = e.getId();
    if (this._widgets.hasOwnProperty(t)) {
      const r = this._widgets[t].domNode.domNode;
      delete this._widgets[t], r.remove(), this.setShouldRender(), this._updateMaxMinWidth();
    }
  }
  _updateMaxMinWidth() {
    var n, r;
    let e = 0;
    const t = Object.keys(this._widgets);
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], c = (r = (n = this._widgets[a].widget).getMinContentWidthInPx) == null ? void 0 : r.call(n);
      typeof c < "u" && (e = Math.max(e, c));
    }
    this._context.viewLayout.setOverlayWidgetsMinWidth(e);
  }
  _renderWidget(e, t) {
    const n = e.domNode;
    if (e.preference === null) {
      n.setTop("");
      return;
    }
    const r = 2 * this._verticalScrollbarWidth + this._minimapWidth;
    if (e.preference === 0 || e.preference === 1) {
      if (e.preference === 1) {
        const s = n.domNode.clientHeight;
        n.setTop(this._editorHeight - s - 2 * this._horizontalScrollbarHeight);
      } else
        n.setTop(0);
      e.stack !== void 0 ? (n.setTop(t[e.preference]), t[e.preference] += n.domNode.clientWidth) : n.setRight(r);
    } else if (e.preference === 2)
      n.domNode.style.right = "50%", e.stack !== void 0 ? (n.setTop(t[
        2
        /* OverlayWidgetPositionPreference.TOP_CENTER */
      ]), t[
        2
        /* OverlayWidgetPositionPreference.TOP_CENTER */
      ] += n.domNode.clientHeight) : n.setTop(0);
    else {
      const { top: s, left: o } = e.preference;
      if (this._context.configuration.options.get(
        51
        /* EditorOption.fixedOverflowWidgets */
      ) && this._widgetCanOverflow(e.widget)) {
        const l = this._viewDomNodeRect;
        n.setTop(s + l.top), n.setLeft(o + l.left), n.setPosition("fixed");
      } else
        n.setTop(s), n.setLeft(o), n.setPosition("absolute");
    }
  }
  prepareRender(e) {
    this._viewDomNodeRect = ho(this._viewDomNode.domNode);
  }
  render(e) {
    this._domNode.setWidth(this._editorWidth);
    const t = Object.keys(this._widgets), n = Array.from({ length: 3 }, () => 0);
    t.sort((r, s) => (this._widgets[r].stack || 0) - (this._widgets[s].stack || 0));
    for (let r = 0, s = t.length; r < s; r++) {
      const o = t[r];
      this._renderWidget(this._widgets[o], n);
    }
  }
}
class $Le {
  constructor(e, t, n, r) {
    this._viewportBrand = void 0, this.top = e | 0, this.left = t | 0, this.width = n | 0, this.height = r | 0;
  }
}
class Fdt {
  constructor(e, t) {
    this.tabSize = e, this.data = t;
  }
}
class Vfe {
  constructor(e, t, n, r, s, o, a) {
    this._viewLineDataBrand = void 0, this.content = e, this.continuesWithWrappedLine = t, this.minColumn = n, this.maxColumn = r, this.startVisibleColumn = s, this.tokens = o, this.inlineDecorations = a;
  }
}
class Kh {
  constructor(e, t, n, r, s, o, a, l, c, u, d, h) {
    this.minColumn = e, this.maxColumn = t, this.content = n, this.continuesWithWrappedLine = r, this.isBasicASCII = Kh.isBasicASCII(n, o), this.containsRTL = Kh.containsRTL(n, this.isBasicASCII, s), this.tokens = a, this.inlineDecorations = l, this.tabSize = c, this.startVisibleColumn = u, this.textDirection = d, this.hasVariableFonts = h;
  }
  static isBasicASCII(e, t) {
    return t ? _B(e) : !0;
  }
  static containsRTL(e, t, n) {
    return !t && n ? jR(e) : !1;
  }
}
class D4 {
  constructor(e, t, n) {
    this.color = e, this.zIndex = t, this.data = n;
  }
  static compareByRenderingProps(e, t) {
    return e.zIndex === t.zIndex ? e.color < t.color ? -1 : e.color > t.color ? 1 : 0 : e.zIndex - t.zIndex;
  }
  static equals(e, t) {
    return e.color === t.color && e.zIndex === t.zIndex && ds(e.data, t.data);
  }
  static equalsArr(e, t) {
    return ds(e, t, D4.equals);
  }
}
class Bdt {
  constructor(e, t) {
    const n = e.options;
    this.lineHeight = n.get(
      75
      /* EditorOption.lineHeight */
    ), this.pixelRatio = n.get(
      163
      /* EditorOption.pixelRatio */
    ), this.overviewRulerLanes = n.get(
      95
      /* EditorOption.overviewRulerLanes */
    ), this.renderBorder = n.get(
      94
      /* EditorOption.overviewRulerBorder */
    );
    const r = t.getColor(Put);
    this.borderColor = r ? r.toString() : null, this.hideCursor = n.get(
      68
      /* EditorOption.hideCursorInOverviewRuler */
    );
    const s = t.getColor(nK);
    this.cursorColorSingle = s ? s.transparent(0.7).toString() : null;
    const o = t.getColor(d3e);
    this.cursorColorPrimary = o ? o.transparent(0.7).toString() : null;
    const a = t.getColor(h3e);
    this.cursorColorSecondary = a ? a.transparent(0.7).toString() : null, this.themeType = t.type;
    const l = n.get(
      81
      /* EditorOption.minimap */
    ), c = l.enabled, u = l.side, d = t.getColor(Fut), h = Ys.getDefaultBackground();
    d ? this.backgroundColor = d : c && u === "right" ? this.backgroundColor = h : this.backgroundColor = null;
    const m = n.get(
      165
      /* EditorOption.layoutInfo */
    ).overviewRuler;
    this.top = m.top, this.right = m.right, this.domWidth = m.width, this.domHeight = m.height, this.overviewRulerLanes === 0 ? (this.canvasWidth = 0, this.canvasHeight = 0) : (this.canvasWidth = this.domWidth * this.pixelRatio | 0, this.canvasHeight = this.domHeight * this.pixelRatio | 0);
    const [_, v] = this._initLanes(1, this.canvasWidth, this.overviewRulerLanes);
    this.x = _, this.w = v;
  }
  _initLanes(e, t, n) {
    const r = t - e;
    if (n >= 3) {
      const s = Math.floor(r / 3), o = Math.floor(r / 3), a = r - s - o, l = e, c = l + s, u = l + s + a;
      return [
        [
          0,
          l,
          // Left
          c,
          // Center
          l,
          // Left | Center
          u,
          // Right
          l,
          // Left | Right
          c,
          // Center | Right
          l
          // Left | Center | Right
        ],
        [
          0,
          s,
          // Left
          a,
          // Center
          s + a,
          // Left | Center
          o,
          // Right
          s + a + o,
          // Left | Right
          a + o,
          // Center | Right
          s + a + o
          // Left | Center | Right
        ]
      ];
    } else if (n === 2) {
      const s = Math.floor(r / 2), o = r - s, a = e, l = a + s;
      return [
        [
          0,
          a,
          // Left
          a,
          // Center
          a,
          // Left | Center
          l,
          // Right
          a,
          // Left | Right
          a,
          // Center | Right
          a
          // Left | Center | Right
        ],
        [
          0,
          s,
          // Left
          s,
          // Center
          s,
          // Left | Center
          o,
          // Right
          s + o,
          // Left | Right
          s + o,
          // Center | Right
          s + o
          // Left | Center | Right
        ]
      ];
    } else {
      const s = e, o = r;
      return [
        [
          0,
          s,
          // Left
          s,
          // Center
          s,
          // Left | Center
          s,
          // Right
          s,
          // Left | Right
          s,
          // Center | Right
          s
          // Left | Center | Right
        ],
        [
          0,
          o,
          // Left
          o,
          // Center
          o,
          // Left | Center
          o,
          // Right
          o,
          // Left | Right
          o,
          // Center | Right
          o
          // Left | Center | Right
        ]
      ];
    }
  }
  equals(e) {
    return this.lineHeight === e.lineHeight && this.pixelRatio === e.pixelRatio && this.overviewRulerLanes === e.overviewRulerLanes && this.renderBorder === e.renderBorder && this.borderColor === e.borderColor && this.hideCursor === e.hideCursor && this.cursorColorSingle === e.cursorColorSingle && this.cursorColorPrimary === e.cursorColorPrimary && this.cursorColorSecondary === e.cursorColorSecondary && this.themeType === e.themeType && De.equals(this.backgroundColor, e.backgroundColor) && this.top === e.top && this.right === e.right && this.domWidth === e.domWidth && this.domHeight === e.domHeight && this.canvasWidth === e.canvasWidth && this.canvasHeight === e.canvasHeight;
  }
}
class Hdt extends fu {
  constructor(e) {
    super(e), this._actualShouldRender = 0, this._renderedDecorations = [], this._renderedCursorPositions = [], this._domNode = Gi(document.createElement("canvas")), this._domNode.setClassName("decorationsOverviewRuler"), this._domNode.setPosition("absolute"), this._domNode.setLayerHinting(!0), this._domNode.setContain("strict"), this._domNode.setAttribute("aria-hidden", "true"), this._updateSettings(!1), this._tokensColorTrackerListener = Ys.onDidChange((t) => {
      t.changedColorMap && this._updateSettings(!0);
    }), this._cursorPositions = [{ position: new de(1, 1), color: this._settings.cursorColorSingle }];
  }
  dispose() {
    super.dispose(), this._tokensColorTrackerListener.dispose();
  }
  _updateSettings(e) {
    const t = new Bdt(this._context.configuration, this._context.theme);
    return this._settings && this._settings.equals(t) ? !1 : (this._settings = t, this._domNode.setTop(this._settings.top), this._domNode.setRight(this._settings.right), this._domNode.setWidth(this._settings.domWidth), this._domNode.setHeight(this._settings.domHeight), this._domNode.domNode.width = this._settings.canvasWidth, this._domNode.domNode.height = this._settings.canvasHeight, e && this._render(), !0);
  }
  // ---- begin view event handlers
  _markRenderingIsNeeded() {
    return this._actualShouldRender = 2, !0;
  }
  _markRenderingIsMaybeNeeded() {
    return this._actualShouldRender = 1, !0;
  }
  onConfigurationChanged(e) {
    return this._updateSettings(!1) ? this._markRenderingIsNeeded() : !1;
  }
  onCursorStateChanged(e) {
    this._cursorPositions = [];
    for (let t = 0, n = e.selections.length; t < n; t++) {
      let r = this._settings.cursorColorSingle;
      n > 1 && (r = t === 0 ? this._settings.cursorColorPrimary : this._settings.cursorColorSecondary), this._cursorPositions.push({ position: e.selections[t].getPosition(), color: r });
    }
    return this._cursorPositions.sort((t, n) => de.compare(t.position, n.position)), this._markRenderingIsMaybeNeeded();
  }
  onDecorationsChanged(e) {
    return e.affectsOverviewRuler ? this._markRenderingIsMaybeNeeded() : !1;
  }
  onFlushed(e) {
    return this._markRenderingIsNeeded();
  }
  onScrollChanged(e) {
    return e.scrollHeightChanged ? this._markRenderingIsNeeded() : !1;
  }
  onZonesChanged(e) {
    return this._markRenderingIsNeeded();
  }
  onThemeChanged(e) {
    return this._updateSettings(!1) ? this._markRenderingIsNeeded() : !1;
  }
  // ---- end view event handlers
  getDomNode() {
    return this._domNode.domNode;
  }
  prepareRender(e) {
  }
  render(e) {
    this._render(), this._actualShouldRender = 0;
  }
  _render() {
    const e = this._settings.backgroundColor;
    if (this._settings.overviewRulerLanes === 0) {
      this._domNode.setBackgroundColor(e ? De.Format.CSS.formatHexA(e) : ""), this._domNode.setDisplay("none");
      return;
    }
    const t = this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);
    if (t.sort(D4.compareByRenderingProps), this._actualShouldRender === 1 && !D4.equalsArr(this._renderedDecorations, t) && (this._actualShouldRender = 2), this._actualShouldRender === 1 && !ds(this._renderedCursorPositions, this._cursorPositions, (m, _) => m.position.lineNumber === _.position.lineNumber && m.color === _.color) && (this._actualShouldRender = 2), this._actualShouldRender === 1)
      return;
    this._renderedDecorations = t, this._renderedCursorPositions = this._cursorPositions, this._domNode.setDisplay("block");
    const n = this._settings.canvasWidth, r = this._settings.canvasHeight, s = this._settings.lineHeight, o = this._context.viewLayout, a = this._context.viewLayout.getScrollHeight(), l = r / a, c = 6 * this._settings.pixelRatio | 0, u = c / 2 | 0, d = this._domNode.domNode.getContext("2d");
    e ? e.isOpaque() ? (d.fillStyle = De.Format.CSS.formatHexA(e), d.fillRect(0, 0, n, r)) : (d.clearRect(0, 0, n, r), d.fillStyle = De.Format.CSS.formatHexA(e), d.fillRect(0, 0, n, r)) : d.clearRect(0, 0, n, r);
    const h = this._settings.x, g = this._settings.w;
    for (const m of t) {
      const _ = m.color, v = m.data;
      d.fillStyle = _;
      let w = 0, E = 0, L = 0;
      for (let T = 0, D = v.length / 3; T < D; T++) {
        const N = v[3 * T], R = v[3 * T + 1], M = v[3 * T + 2];
        let B = o.getVerticalOffsetForLineNumber(R) * l | 0, H = (o.getVerticalOffsetForLineNumber(M) + s) * l | 0;
        if (H - B < c) {
          let K = (B + H) / 2 | 0;
          K < u ? K = u : K + u > r && (K = r - u), B = K - u, H = K + u;
        }
        B > L + 1 || N !== w ? (T !== 0 && d.fillRect(h[w], E, g[w], L - E), w = N, E = B, L = H) : H > L && (L = H);
      }
      d.fillRect(h[w], E, g[w], L - E);
    }
    if (!this._settings.hideCursor) {
      const m = 2 * this._settings.pixelRatio | 0, _ = m / 2 | 0, v = this._settings.x[
        7
        /* OverviewRulerLane.Full */
      ], w = this._settings.w[
        7
        /* OverviewRulerLane.Full */
      ];
      let E = -100, L = -100, T = null;
      for (let D = 0, N = this._cursorPositions.length; D < N; D++) {
        const R = this._cursorPositions[D].color;
        if (!R)
          continue;
        const M = this._cursorPositions[D].position;
        let B = o.getVerticalOffsetForLineNumber(M.lineNumber) * l | 0;
        B < _ ? B = _ : B + _ > r && (B = r - _);
        const H = B - _, j = H + m;
        H > L + 1 || R !== T ? (D !== 0 && T && d.fillRect(v, E, w, L - E), E = H, L = j) : j > L && (L = j), T = R, d.fillStyle = R;
      }
      T && d.fillRect(v, E, w, L - E);
    }
    this._settings.renderBorder && this._settings.borderColor && this._settings.overviewRulerLanes > 0 && (d.beginPath(), d.lineWidth = 1, d.strokeStyle = this._settings.borderColor, d.moveTo(0, 0), d.lineTo(0, r), d.moveTo(1, 0), d.lineTo(n, 0), d.stroke());
  }
}
class jLe {
  constructor(e, t, n) {
    this._colorZoneBrand = void 0, this.from = e | 0, this.to = t | 0, this.colorId = n | 0;
  }
  static compare(e, t) {
    return e.colorId === t.colorId ? e.from === t.from ? e.to - t.to : e.from - t.from : e.colorId - t.colorId;
  }
}
class D3e {
  constructor(e, t, n, r) {
    this._overviewRulerZoneBrand = void 0, this.startLineNumber = e, this.endLineNumber = t, this.heightInLines = n, this.color = r, this._colorZone = null;
  }
  static compare(e, t) {
    return e.color === t.color ? e.startLineNumber === t.startLineNumber ? e.heightInLines === t.heightInLines ? e.endLineNumber - t.endLineNumber : e.heightInLines - t.heightInLines : e.startLineNumber - t.startLineNumber : e.color < t.color ? -1 : 1;
  }
  setColorZone(e) {
    this._colorZone = e;
  }
  getColorZones() {
    return this._colorZone;
  }
}
class Wdt {
  constructor(e) {
    this._getVerticalOffsetForLine = e, this._zones = [], this._colorZonesInvalid = !1, this._lineHeight = 0, this._domWidth = 0, this._domHeight = 0, this._outerHeight = 0, this._pixelRatio = 1, this._lastAssignedId = 0, this._color2Id = /* @__PURE__ */ Object.create(null), this._id2Color = [];
  }
  getId2Color() {
    return this._id2Color;
  }
  setZones(e) {
    this._zones = e, this._zones.sort(D3e.compare);
  }
  setLineHeight(e) {
    return this._lineHeight === e ? !1 : (this._lineHeight = e, this._colorZonesInvalid = !0, !0);
  }
  setPixelRatio(e) {
    this._pixelRatio = e, this._colorZonesInvalid = !0;
  }
  getDOMWidth() {
    return this._domWidth;
  }
  getCanvasWidth() {
    return this._domWidth * this._pixelRatio;
  }
  setDOMWidth(e) {
    return this._domWidth === e ? !1 : (this._domWidth = e, this._colorZonesInvalid = !0, !0);
  }
  getDOMHeight() {
    return this._domHeight;
  }
  getCanvasHeight() {
    return this._domHeight * this._pixelRatio;
  }
  setDOMHeight(e) {
    return this._domHeight === e ? !1 : (this._domHeight = e, this._colorZonesInvalid = !0, !0);
  }
  getOuterHeight() {
    return this._outerHeight;
  }
  setOuterHeight(e) {
    return this._outerHeight === e ? !1 : (this._outerHeight = e, this._colorZonesInvalid = !0, !0);
  }
  resolveColorZones() {
    const e = this._colorZonesInvalid, t = Math.floor(this._lineHeight), n = Math.floor(this.getCanvasHeight()), r = Math.floor(this._outerHeight), s = n / r, o = Math.floor(4 * this._pixelRatio / 2), a = [];
    for (let l = 0, c = this._zones.length; l < c; l++) {
      const u = this._zones[l];
      if (!e) {
        const T = u.getColorZones();
        if (T) {
          a.push(T);
          continue;
        }
      }
      const d = this._getVerticalOffsetForLine(u.startLineNumber), h = u.heightInLines === 0 ? this._getVerticalOffsetForLine(u.endLineNumber) + t : d + u.heightInLines * t, g = Math.floor(s * d), m = Math.floor(s * h);
      let _ = Math.floor((g + m) / 2), v = m - _;
      v < o && (v = o), _ - v < 0 && (_ = v), _ + v > n && (_ = n - v);
      const w = u.color;
      let E = this._color2Id[w];
      E || (E = ++this._lastAssignedId, this._color2Id[w] = E, this._id2Color[E] = w);
      const L = new jLe(_ - v, _ + v, E);
      u.setColorZone(L), a.push(L);
    }
    return this._colorZonesInvalid = !1, a.sort(jLe.compare), a;
  }
}
class Vdt extends YT {
  constructor(e, t) {
    super(), this._context = e;
    const n = this._context.configuration.options;
    this._domNode = Gi(document.createElement("canvas")), this._domNode.setClassName(t), this._domNode.setPosition("absolute"), this._domNode.setLayerHinting(!0), this._domNode.setContain("strict"), this._zoneManager = new Wdt((r) => this._context.viewLayout.getVerticalOffsetForLineNumber(r)), this._zoneManager.setDOMWidth(0), this._zoneManager.setDOMHeight(0), this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()), this._zoneManager.setLineHeight(n.get(
      75
      /* EditorOption.lineHeight */
    )), this._zoneManager.setPixelRatio(n.get(
      163
      /* EditorOption.pixelRatio */
    )), this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), super.dispose();
  }
  // ---- begin view event handlers
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    return e.hasChanged(
      75
      /* EditorOption.lineHeight */
    ) && (this._zoneManager.setLineHeight(t.get(
      75
      /* EditorOption.lineHeight */
    )), this._render()), e.hasChanged(
      163
      /* EditorOption.pixelRatio */
    ) && (this._zoneManager.setPixelRatio(t.get(
      163
      /* EditorOption.pixelRatio */
    )), this._domNode.setWidth(this._zoneManager.getDOMWidth()), this._domNode.setHeight(this._zoneManager.getDOMHeight()), this._domNode.domNode.width = this._zoneManager.getCanvasWidth(), this._domNode.domNode.height = this._zoneManager.getCanvasHeight(), this._render()), !0;
  }
  onFlushed(e) {
    return this._render(), !0;
  }
  onScrollChanged(e) {
    return e.scrollHeightChanged && (this._zoneManager.setOuterHeight(e.scrollHeight), this._render()), !0;
  }
  onZonesChanged(e) {
    return this._render(), !0;
  }
  // ---- end view event handlers
  getDomNode() {
    return this._domNode.domNode;
  }
  setLayout(e) {
    this._domNode.setTop(e.top), this._domNode.setRight(e.right);
    let t = !1;
    t = this._zoneManager.setDOMWidth(e.width) || t, t = this._zoneManager.setDOMHeight(e.height) || t, t && (this._domNode.setWidth(this._zoneManager.getDOMWidth()), this._domNode.setHeight(this._zoneManager.getDOMHeight()), this._domNode.domNode.width = this._zoneManager.getCanvasWidth(), this._domNode.domNode.height = this._zoneManager.getCanvasHeight(), this._render());
  }
  setZones(e) {
    this._zoneManager.setZones(e), this._render();
  }
  _render() {
    if (this._zoneManager.getOuterHeight() === 0)
      return !1;
    const e = this._zoneManager.getCanvasWidth(), t = this._zoneManager.getCanvasHeight(), n = this._zoneManager.resolveColorZones(), r = this._zoneManager.getId2Color(), s = this._domNode.domNode.getContext("2d");
    return s.clearRect(0, 0, e, t), n.length > 0 && this._renderOneLane(s, n, r, e), !0;
  }
  _renderOneLane(e, t, n, r) {
    let s = 0, o = 0, a = 0;
    for (const l of t) {
      const c = l.colorId, u = l.from, d = l.to;
      c !== s ? (e.fillRect(0, o, r, a - o), s = c, e.fillStyle = n[s], o = u, a = d) : a >= u ? a = Math.max(a, d) : (e.fillRect(0, o, r, a - o), o = u, a = d);
    }
    e.fillRect(0, o, r, a - o);
  }
}
class Udt extends fu {
  constructor(e) {
    super(e), this.domNode = Gi(document.createElement("div")), this.domNode.setAttribute("role", "presentation"), this.domNode.setAttribute("aria-hidden", "true"), this.domNode.setClassName("view-rulers"), this._renderedRulers = [];
    const t = this._context.configuration.options;
    this._rulers = t.get(
      116
      /* EditorOption.rulers */
    ), this._typicalHalfwidthCharacterWidth = t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth;
  }
  dispose() {
    super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    return this._rulers = t.get(
      116
      /* EditorOption.rulers */
    ), this._typicalHalfwidthCharacterWidth = t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth, !0;
  }
  onScrollChanged(e) {
    return e.scrollHeightChanged;
  }
  // --- end event handlers
  prepareRender(e) {
  }
  _ensureRulersCount() {
    const e = this._renderedRulers.length, t = this._rulers.length;
    if (e === t)
      return;
    if (e < t) {
      const { tabSize: r } = this._context.viewModel.model.getOptions(), s = r;
      let o = t - e;
      for (; o > 0; ) {
        const a = Gi(document.createElement("div"));
        a.setClassName("view-ruler"), a.setWidth(s), this.domNode.appendChild(a), this._renderedRulers.push(a), o--;
      }
      return;
    }
    let n = e - t;
    for (; n > 0; ) {
      const r = this._renderedRulers.pop();
      this.domNode.removeChild(r), n--;
    }
  }
  render(e) {
    this._ensureRulersCount();
    for (let t = 0, n = this._rulers.length; t < n; t++) {
      const r = this._renderedRulers[t], s = this._rulers[t];
      r.setBoxShadow(s.color ? `1px 0 0 0 ${s.color} inset` : ""), r.setHeight(Math.min(e.scrollHeight, 1e6)), r.setLeft(s.column * this._typicalHalfwidthCharacterWidth);
    }
  }
}
class zdt extends fu {
  constructor(e) {
    super(e), this._scrollTop = 0, this._width = 0, this._updateWidth(), this._shouldShow = !1;
    const n = this._context.configuration.options.get(
      117
      /* EditorOption.scrollbar */
    );
    this._useShadows = n.useShadows, this._domNode = Gi(document.createElement("div")), this._domNode.setAttribute("role", "presentation"), this._domNode.setAttribute("aria-hidden", "true");
  }
  dispose() {
    super.dispose();
  }
  _updateShouldShow() {
    const e = this._useShadows && this._scrollTop > 0;
    return this._shouldShow !== e ? (this._shouldShow = e, !0) : !1;
  }
  getDomNode() {
    return this._domNode;
  }
  _updateWidth() {
    const t = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
    t.minimap.renderMinimap === 0 || t.minimap.minimapWidth > 0 && t.minimap.minimapLeft === 0 ? this._width = t.width : this._width = t.width - t.verticalScrollbarWidth;
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const n = this._context.configuration.options.get(
      117
      /* EditorOption.scrollbar */
    );
    return this._useShadows = n.useShadows, this._updateWidth(), this._updateShouldShow(), !0;
  }
  onScrollChanged(e) {
    return this._scrollTop = e.scrollTop, this._updateShouldShow();
  }
  // --- end event handlers
  prepareRender(e) {
  }
  render(e) {
    this._domNode.setWidth(this._width), this._domNode.setClassName(this._shouldShow ? "scroll-decoration" : "");
  }
}
class $dt {
  constructor(e) {
    this.left = e.left, this.width = e.width, this.startStyle = null, this.endStyle = null;
  }
}
class jdt {
  constructor(e, t) {
    this.lineNumber = e, this.ranges = t;
  }
}
function Gdt(i) {
  return new $dt(i);
}
function qdt(i) {
  return new jdt(i.lineNumber, i.ranges.map(Gdt));
}
const _o = class _o extends Ew {
  constructor(e) {
    super(), this._previousFrameVisibleRangesWithStyle = [], this._context = e;
    const t = this._context.configuration.options;
    this._roundedSelection = t.get(
      115
      /* EditorOption.roundedSelection */
    ), this._typicalHalfwidthCharacterWidth = t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth, this._selections = [], this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    return this._roundedSelection = t.get(
      115
      /* EditorOption.roundedSelection */
    ), this._typicalHalfwidthCharacterWidth = t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth, !0;
  }
  onCursorStateChanged(e) {
    return this._selections = e.selections.slice(0), !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  _visibleRangesHaveGaps(e) {
    for (let t = 0, n = e.length; t < n; t++)
      if (e[t].ranges.length > 1)
        return !0;
    return !1;
  }
  _enrichVisibleRangesWithStyle(e, t, n) {
    const r = this._typicalHalfwidthCharacterWidth / 4;
    let s = null, o = null;
    if (n && n.length > 0 && t.length > 0) {
      const a = t[0].lineNumber;
      if (a === e.startLineNumber)
        for (let c = 0; !s && c < n.length; c++)
          n[c].lineNumber === a && (s = n[c].ranges[0]);
      const l = t[t.length - 1].lineNumber;
      if (l === e.endLineNumber)
        for (let c = n.length - 1; !o && c >= 0; c--)
          n[c].lineNumber === l && (o = n[c].ranges[0]);
      s && !s.startStyle && (s = null), o && !o.startStyle && (o = null);
    }
    for (let a = 0, l = t.length; a < l; a++) {
      const c = t[a].ranges[0], u = c.left, d = c.left + c.width, h = {
        top: 0,
        bottom: 0
        /* CornerStyle.EXTERN */
      }, g = {
        top: 0,
        bottom: 0
        /* CornerStyle.EXTERN */
      };
      if (a > 0) {
        const m = t[a - 1].ranges[0].left, _ = t[a - 1].ranges[0].left + t[a - 1].ranges[0].width;
        F7(u - m) < r ? h.top = 2 : u > m && (h.top = 1), F7(d - _) < r ? g.top = 2 : m < d && d < _ && (g.top = 1);
      } else s && (h.top = s.startStyle.top, g.top = s.endStyle.top);
      if (a + 1 < l) {
        const m = t[a + 1].ranges[0].left, _ = t[a + 1].ranges[0].left + t[a + 1].ranges[0].width;
        F7(u - m) < r ? h.bottom = 2 : m < u && u < _ && (h.bottom = 1), F7(d - _) < r ? g.bottom = 2 : d < _ && (g.bottom = 1);
      } else o && (h.bottom = o.startStyle.bottom, g.bottom = o.endStyle.bottom);
      c.startStyle = h, c.endStyle = g;
    }
  }
  _getVisibleRangesWithStyle(e, t, n) {
    const s = (t.linesVisibleRangesForRange(e, !0) || []).map(qdt);
    return !this._visibleRangesHaveGaps(s) && this._roundedSelection && this._enrichVisibleRangesWithStyle(t.visibleRange, s, n), s;
  }
  _createSelectionPiece(e, t, n, r, s) {
    return '<div class="cslr ' + n + '" style="top:' + e.toString() + "px;bottom:" + t.toString() + "px;left:" + r.toString() + "px;width:" + s.toString() + 'px;"></div>';
  }
  _actualRenderOneSelection(e, t, n, r) {
    if (r.length === 0)
      return;
    const s = !!r[0].ranges[0].startStyle, o = r[0].lineNumber, a = r[r.length - 1].lineNumber;
    for (let l = 0, c = r.length; l < c; l++) {
      const u = r[l], d = u.lineNumber, h = d - t, g = n && d === o ? 1 : 0, m = n && d !== o && d === a ? 1 : 0;
      let _ = "", v = "";
      for (let w = 0, E = u.ranges.length; w < E; w++) {
        const L = u.ranges[w];
        if (s) {
          const D = L.startStyle, N = L.endStyle;
          if (D.top === 1 || D.bottom === 1) {
            _ += this._createSelectionPiece(g, m, _o.SELECTION_CLASS_NAME, L.left - _o.ROUNDED_PIECE_WIDTH, _o.ROUNDED_PIECE_WIDTH);
            let R = _o.EDITOR_BACKGROUND_CLASS_NAME;
            D.top === 1 && (R += " " + _o.SELECTION_TOP_RIGHT), D.bottom === 1 && (R += " " + _o.SELECTION_BOTTOM_RIGHT), _ += this._createSelectionPiece(g, m, R, L.left - _o.ROUNDED_PIECE_WIDTH, _o.ROUNDED_PIECE_WIDTH);
          }
          if (N.top === 1 || N.bottom === 1) {
            _ += this._createSelectionPiece(g, m, _o.SELECTION_CLASS_NAME, L.left + L.width, _o.ROUNDED_PIECE_WIDTH);
            let R = _o.EDITOR_BACKGROUND_CLASS_NAME;
            N.top === 1 && (R += " " + _o.SELECTION_TOP_LEFT), N.bottom === 1 && (R += " " + _o.SELECTION_BOTTOM_LEFT), _ += this._createSelectionPiece(g, m, R, L.left + L.width, _o.ROUNDED_PIECE_WIDTH);
          }
        }
        let T = _o.SELECTION_CLASS_NAME;
        if (s) {
          const D = L.startStyle, N = L.endStyle;
          D.top === 0 && (T += " " + _o.SELECTION_TOP_LEFT), D.bottom === 0 && (T += " " + _o.SELECTION_BOTTOM_LEFT), N.top === 0 && (T += " " + _o.SELECTION_TOP_RIGHT), N.bottom === 0 && (T += " " + _o.SELECTION_BOTTOM_RIGHT);
        }
        v += this._createSelectionPiece(g, m, T, L.left, L.width);
      }
      e[h][0] += _, e[h][1] += v;
    }
  }
  prepareRender(e) {
    const t = [], n = e.visibleRange.startLineNumber, r = e.visibleRange.endLineNumber;
    for (let o = n; o <= r; o++) {
      const a = o - n;
      t[a] = ["", ""];
    }
    const s = [];
    for (let o = 0, a = this._selections.length; o < a; o++) {
      const l = this._selections[o];
      if (l.isEmpty()) {
        s[o] = null;
        continue;
      }
      const c = this._getVisibleRangesWithStyle(l, e, this._previousFrameVisibleRangesWithStyle[o]);
      s[o] = c, this._actualRenderOneSelection(t, n, this._selections.length > 1, c);
    }
    this._previousFrameVisibleRangesWithStyle = s, this._renderResult = t.map(([o, a]) => o + a);
  }
  render(e, t) {
    if (!this._renderResult)
      return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
};
_o.SELECTION_CLASS_NAME = "selected-text", _o.SELECTION_TOP_LEFT = "top-left-radius", _o.SELECTION_BOTTOM_LEFT = "bottom-left-radius", _o.SELECTION_TOP_RIGHT = "top-right-radius", _o.SELECTION_BOTTOM_RIGHT = "bottom-right-radius", _o.EDITOR_BACKGROUND_CLASS_NAME = "monaco-editor-background", _o.ROUNDED_PIECE_WIDTH = 10;
let are = _o;
ng((i, e) => {
  const t = i.getColor(Fat);
  t && !t.isTransparent() && e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`);
});
function F7(i) {
  return i < 0 ? -i : i;
}
class GLe {
  constructor(e, t, n, r, s, o, a) {
    this.top = e, this.left = t, this.paddingLeft = n, this.width = r, this.height = s, this.textContent = o, this.textContentClassName = a;
  }
}
var yy;
(function(i) {
  i[i.Single = 0] = "Single", i[i.MultiPrimary = 1] = "MultiPrimary", i[i.MultiSecondary = 2] = "MultiSecondary";
})(yy || (yy = {}));
class qLe {
  constructor(e, t) {
    this._context = e;
    const n = this._context.configuration.options, r = n.get(
      59
      /* EditorOption.fontInfo */
    );
    this._cursorStyle = n.get(
      161
      /* EditorOption.effectiveCursorStyle */
    ), this._typicalHalfwidthCharacterWidth = r.typicalHalfwidthCharacterWidth, this._lineCursorWidth = Math.min(n.get(
      37
      /* EditorOption.cursorWidth */
    ), this._typicalHalfwidthCharacterWidth), this._lineCursorHeight = n.get(
      38
      /* EditorOption.cursorHeight */
    ), this._isVisible = !0, this._domNode = Gi(document.createElement("div")), this._domNode.setClassName(`cursor ${QN}`), this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)), this._domNode.setTop(0), this._domNode.setLeft(0), Ma(this._domNode, r), this._domNode.setDisplay("none"), this._position = new de(1, 1), this._pluralityClass = "", this.setPlurality(t), this._lastRenderedContent = "", this._renderData = null;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return this._position;
  }
  setPlurality(e) {
    switch (e) {
      default:
      case yy.Single:
        this._pluralityClass = "";
        break;
      case yy.MultiPrimary:
        this._pluralityClass = "cursor-primary";
        break;
      case yy.MultiSecondary:
        this._pluralityClass = "cursor-secondary";
        break;
    }
  }
  show() {
    this._isVisible || (this._domNode.setVisibility("inherit"), this._isVisible = !0);
  }
  hide() {
    this._isVisible && (this._domNode.setVisibility("hidden"), this._isVisible = !1);
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options, n = t.get(
      59
      /* EditorOption.fontInfo */
    );
    return this._cursorStyle = t.get(
      161
      /* EditorOption.effectiveCursorStyle */
    ), this._typicalHalfwidthCharacterWidth = n.typicalHalfwidthCharacterWidth, this._lineCursorWidth = Math.min(t.get(
      37
      /* EditorOption.cursorWidth */
    ), this._typicalHalfwidthCharacterWidth), this._lineCursorHeight = t.get(
      38
      /* EditorOption.cursorHeight */
    ), Ma(this._domNode, n), !0;
  }
  onCursorPositionChanged(e, t) {
    return t ? this._domNode.domNode.style.transitionProperty = "none" : this._domNode.domNode.style.transitionProperty = "", this._position = e, !0;
  }
  /**
   * If `this._position` is inside a grapheme, returns the position where the grapheme starts.
   * Also returns the next grapheme.
   */
  _getGraphemeAwarePosition() {
    const { lineNumber: e, column: t } = this._position, n = this._context.viewModel.getLineContent(e), [r, s] = unt(n, t - 1);
    return [new de(e, r + 1), n.substring(r, s)];
  }
  _prepareRender(e) {
    let t = "", n = "";
    const [r, s] = this._getGraphemeAwarePosition(), o = this._context.viewLayout.getLineHeightForLineNumber(r.lineNumber), a = this._lineCursorHeight === 0 ? o : Math.min(o, this._lineCursorHeight), l = (o - a) / 2;
    if (this._cursorStyle === Ia.Line || this._cursorStyle === Ia.LineThin) {
      const _ = e.visibleRangeForPosition(r);
      if (!_ || _.outsideRenderedLine)
        return null;
      const v = At(this._domNode.domNode);
      let w;
      this._cursorStyle === Ia.Line ? (w = Vxe(v, this._lineCursorWidth > 0 ? this._lineCursorWidth : 2), w > 2 && (t = s, n = this._getTokenClassName(r))) : w = Vxe(v, 1);
      let E = _.left, L = 0;
      w >= 2 && E >= 1 && (L = 1, E -= L);
      const T = e.getVerticalOffsetForLineNumber(r.lineNumber) - e.bigNumbersDelta + l;
      return new GLe(T, E, L, w, a, t, n);
    }
    const c = e.linesVisibleRangesForRange(new z(r.lineNumber, r.column, r.lineNumber, r.column + s.length), !1);
    if (!c || c.length === 0)
      return null;
    const u = c[0];
    if (u.outsideRenderedLine || u.ranges.length === 0)
      return null;
    const d = u.ranges[0], h = s === "	" ? this._typicalHalfwidthCharacterWidth : d.width < 1 ? this._typicalHalfwidthCharacterWidth : d.width;
    this._cursorStyle === Ia.Block && (t = s, n = this._getTokenClassName(r));
    let g = e.getVerticalOffsetForLineNumber(r.lineNumber) - e.bigNumbersDelta, m = o;
    return (this._cursorStyle === Ia.Underline || this._cursorStyle === Ia.UnderlineThin) && (g += o - 2, m = 2), new GLe(g, d.left, 0, h, m, t, n);
  }
  _getTokenClassName(e) {
    const t = this._context.viewModel.getViewLineData(e.lineNumber), n = t.tokens.findTokenIndexAtOffset(e.column - 1);
    return t.tokens.getClassName(n);
  }
  prepareRender(e) {
    this._renderData = this._prepareRender(e);
  }
  render(e) {
    return this._renderData ? (this._lastRenderedContent !== this._renderData.textContent && (this._lastRenderedContent = this._renderData.textContent, this._domNode.domNode.textContent = this._lastRenderedContent), this._domNode.setClassName(`cursor ${this._pluralityClass} ${QN} ${this._renderData.textContentClassName}`), this._domNode.setDisplay("block"), this._domNode.setTop(this._renderData.top), this._domNode.setLeft(this._renderData.left), this._domNode.setPaddingLeft(this._renderData.paddingLeft), this._domNode.setWidth(this._renderData.width), this._domNode.setLineHeight(this._renderData.height), this._domNode.setHeight(this._renderData.height), {
      domNode: this._domNode.domNode,
      position: this._position,
      contentLeft: this._renderData.left,
      height: this._renderData.height,
      width: 2
    }) : (this._domNode.setDisplay("none"), null);
  }
}
const R3 = class R3 extends fu {
  constructor(e) {
    super(e);
    const t = this._context.configuration.options;
    this._readOnly = t.get(
      104
      /* EditorOption.readOnly */
    ), this._cursorBlinking = t.get(
      32
      /* EditorOption.cursorBlinking */
    ), this._cursorStyle = t.get(
      161
      /* EditorOption.effectiveCursorStyle */
    ), this._cursorSmoothCaretAnimation = t.get(
      33
      /* EditorOption.cursorSmoothCaretAnimation */
    ), this._editContextEnabled = t.get(
      170
      /* EditorOption.effectiveEditContext */
    ), this._selectionIsEmpty = !0, this._isComposingInput = !1, this._isVisible = !1, this._primaryCursor = new qLe(this._context, yy.Single), this._secondaryCursors = [], this._renderData = [], this._domNode = Gi(document.createElement("div")), this._domNode.setAttribute("role", "presentation"), this._domNode.setAttribute("aria-hidden", "true"), this._updateDomClassName(), this._domNode.appendChild(this._primaryCursor.getDomNode()), this._startCursorBlinkAnimation = new Gh(), this._cursorFlatBlinkInterval = new yq(), this._blinkingEnabled = !1, this._editorHasFocus = !1, this._updateBlinking();
  }
  dispose() {
    super.dispose(), this._startCursorBlinkAnimation.dispose(), this._cursorFlatBlinkInterval.dispose();
  }
  getDomNode() {
    return this._domNode;
  }
  // --- begin event handlers
  onCompositionStart(e) {
    return this._isComposingInput = !0, this._updateBlinking(), !0;
  }
  onCompositionEnd(e) {
    return this._isComposingInput = !1, this._updateBlinking(), !0;
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options;
    this._readOnly = t.get(
      104
      /* EditorOption.readOnly */
    ), this._cursorBlinking = t.get(
      32
      /* EditorOption.cursorBlinking */
    ), this._cursorStyle = t.get(
      161
      /* EditorOption.effectiveCursorStyle */
    ), this._cursorSmoothCaretAnimation = t.get(
      33
      /* EditorOption.cursorSmoothCaretAnimation */
    ), this._editContextEnabled = t.get(
      170
      /* EditorOption.effectiveEditContext */
    ), this._updateBlinking(), this._updateDomClassName(), this._primaryCursor.onConfigurationChanged(e);
    for (let n = 0, r = this._secondaryCursors.length; n < r; n++)
      this._secondaryCursors[n].onConfigurationChanged(e);
    return !0;
  }
  _onCursorPositionChanged(e, t, n) {
    const r = this._secondaryCursors.length !== t.length || this._cursorSmoothCaretAnimation === "explicit" && n !== 3;
    if (this._primaryCursor.setPlurality(t.length ? yy.MultiPrimary : yy.Single), this._primaryCursor.onCursorPositionChanged(e, r), this._updateBlinking(), this._secondaryCursors.length < t.length) {
      const s = t.length - this._secondaryCursors.length;
      for (let o = 0; o < s; o++) {
        const a = new qLe(this._context, yy.MultiSecondary);
        this._domNode.domNode.insertBefore(a.getDomNode().domNode, this._primaryCursor.getDomNode().domNode.nextSibling), this._secondaryCursors.push(a);
      }
    } else if (this._secondaryCursors.length > t.length) {
      const s = this._secondaryCursors.length - t.length;
      for (let o = 0; o < s; o++)
        this._domNode.removeChild(this._secondaryCursors[0].getDomNode()), this._secondaryCursors.splice(0, 1);
    }
    for (let s = 0; s < t.length; s++)
      this._secondaryCursors[s].onCursorPositionChanged(t[s], r);
  }
  onCursorStateChanged(e) {
    const t = [];
    for (let r = 0, s = e.selections.length; r < s; r++)
      t[r] = e.selections[r].getPosition();
    this._onCursorPositionChanged(t[0], t.slice(1), e.reason);
    const n = e.selections[0].isEmpty();
    return this._selectionIsEmpty !== n && (this._selectionIsEmpty = n, this._updateDomClassName()), !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onFocusChanged(e) {
    return this._editorHasFocus = e.isFocused, this._updateBlinking(), !1;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return !0;
  }
  onTokensChanged(e) {
    const t = (n) => {
      for (let r = 0, s = e.ranges.length; r < s; r++)
        if (e.ranges[r].fromLineNumber <= n.lineNumber && n.lineNumber <= e.ranges[r].toLineNumber)
          return !0;
      return !1;
    };
    if (t(this._primaryCursor.getPosition()))
      return !0;
    for (const n of this._secondaryCursors)
      if (t(n.getPosition()))
        return !0;
    return !1;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  // ---- blinking logic
  _getCursorBlinking() {
    return this._isComposingInput && !this._editContextEnabled || !this._editorHasFocus ? 0 : this._readOnly ? 5 : this._cursorBlinking;
  }
  _updateBlinking() {
    this._startCursorBlinkAnimation.cancel(), this._cursorFlatBlinkInterval.cancel();
    const e = this._getCursorBlinking(), t = e === 0, n = e === 5;
    t ? this._hide() : this._show(), this._blinkingEnabled = !1, this._updateDomClassName(), !t && !n && (e === 1 ? this._cursorFlatBlinkInterval.cancelAndSet(() => {
      this._isVisible ? this._hide() : this._show();
    }, R3.BLINK_INTERVAL, At(this._domNode.domNode)) : this._startCursorBlinkAnimation.setIfNotSet(() => {
      this._blinkingEnabled = !0, this._updateDomClassName();
    }, R3.BLINK_INTERVAL));
  }
  // --- end blinking logic
  _updateDomClassName() {
    this._domNode.setClassName(this._getClassName());
  }
  _getClassName() {
    let e = "cursors-layer";
    switch (this._selectionIsEmpty || (e += " has-selection"), this._cursorStyle) {
      case Ia.Line:
        e += " cursor-line-style";
        break;
      case Ia.Block:
        e += " cursor-block-style";
        break;
      case Ia.Underline:
        e += " cursor-underline-style";
        break;
      case Ia.LineThin:
        e += " cursor-line-thin-style";
        break;
      case Ia.BlockOutline:
        e += " cursor-block-outline-style";
        break;
      case Ia.UnderlineThin:
        e += " cursor-underline-thin-style";
        break;
      default:
        e += " cursor-line-style";
    }
    if (this._blinkingEnabled)
      switch (this._getCursorBlinking()) {
        case 1:
          e += " cursor-blink";
          break;
        case 2:
          e += " cursor-smooth";
          break;
        case 3:
          e += " cursor-phase";
          break;
        case 4:
          e += " cursor-expand";
          break;
        case 5:
          e += " cursor-solid";
          break;
        default:
          e += " cursor-solid";
      }
    else
      e += " cursor-solid";
    return (this._cursorSmoothCaretAnimation === "on" || this._cursorSmoothCaretAnimation === "explicit") && (e += " cursor-smooth-caret-animation"), e;
  }
  _show() {
    this._primaryCursor.show();
    for (let e = 0, t = this._secondaryCursors.length; e < t; e++)
      this._secondaryCursors[e].show();
    this._isVisible = !0;
  }
  _hide() {
    this._primaryCursor.hide();
    for (let e = 0, t = this._secondaryCursors.length; e < t; e++)
      this._secondaryCursors[e].hide();
    this._isVisible = !1;
  }
  // ---- IViewPart implementation
  prepareRender(e) {
    this._primaryCursor.prepareRender(e);
    for (let t = 0, n = this._secondaryCursors.length; t < n; t++)
      this._secondaryCursors[t].prepareRender(e);
  }
  render(e) {
    const t = [];
    let n = 0;
    const r = this._primaryCursor.render(e);
    r && (t[n++] = r);
    for (let s = 0, o = this._secondaryCursors.length; s < o; s++) {
      const a = this._secondaryCursors[s].render(e);
      a && (t[n++] = a);
    }
    this._renderData = t;
  }
  getLastRenderData() {
    return this._renderData;
  }
};
R3.BLINK_INTERVAL = 500;
let lre = R3;
ng((i, e) => {
  const t = [
    { class: ".cursor", foreground: nK, background: Afe },
    { class: ".cursor-primary", foreground: d3e, background: but },
    { class: ".cursor-secondary", foreground: h3e, background: vut }
  ];
  for (const n of t) {
    const r = i.getColor(n.foreground);
    if (r) {
      let s = i.getColor(n.background);
      s || (s = r.opposite()), e.addRule(`.monaco-editor .cursors-layer ${n.class} { background-color: ${r}; border-color: ${r}; color: ${s}; }`), am(i.type) && e.addRule(`.monaco-editor .cursors-layer.has-selection ${n.class} { border-left: 1px solid ${s}; border-right: 1px solid ${s}; }`);
    }
  }
});
const ree = () => {
  throw new Error("Invalid change accessor");
};
class Kdt extends fu {
  constructor(e) {
    super(e);
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._lineHeight = t.get(
      75
      /* EditorOption.lineHeight */
    ), this._contentWidth = n.contentWidth, this._contentLeft = n.contentLeft, this.domNode = Gi(document.createElement("div")), this.domNode.setClassName("view-zones"), this.domNode.setPosition("absolute"), this.domNode.setAttribute("role", "presentation"), this.domNode.setAttribute("aria-hidden", "true"), this.marginDomNode = Gi(document.createElement("div")), this.marginDomNode.setClassName("margin-view-zones"), this.marginDomNode.setPosition("absolute"), this.marginDomNode.setAttribute("role", "presentation"), this.marginDomNode.setAttribute("aria-hidden", "true"), this._zones = {};
  }
  dispose() {
    super.dispose(), this._zones = {};
  }
  // ---- begin view event handlers
  _recomputeWhitespacesProps() {
    const e = this._context.viewLayout.getWhitespaces(), t = /* @__PURE__ */ new Map();
    for (const r of e)
      t.set(r.id, r);
    let n = !1;
    return this._context.viewModel.changeWhitespace((r) => {
      const s = Object.keys(this._zones);
      for (let o = 0, a = s.length; o < a; o++) {
        const l = s[o], c = this._zones[l], u = this._computeWhitespaceProps(c.delegate);
        c.isInHiddenArea = u.isInHiddenArea;
        const d = t.get(l);
        d && (d.afterLineNumber !== u.afterViewLineNumber || d.height !== u.heightInPx) && (r.changeOneWhitespace(l, u.afterViewLineNumber, u.heightInPx), this._safeCallOnComputedHeight(c.delegate, u.heightInPx), n = !0);
      }
    }), n;
  }
  onConfigurationChanged(e) {
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    return this._lineHeight = t.get(
      75
      /* EditorOption.lineHeight */
    ), this._contentWidth = n.contentWidth, this._contentLeft = n.contentLeft, e.hasChanged(
      75
      /* EditorOption.lineHeight */
    ) && this._recomputeWhitespacesProps(), !0;
  }
  onLineMappingChanged(e) {
    return this._recomputeWhitespacesProps();
  }
  onLinesDeleted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged || e.scrollWidthChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  // ---- end view event handlers
  _getZoneOrdinal(e) {
    return e.ordinal ?? e.afterColumn ?? 1e4;
  }
  _computeWhitespaceProps(e) {
    if (e.afterLineNumber === 0)
      return {
        isInHiddenArea: !1,
        afterViewLineNumber: 0,
        heightInPx: this._heightInPixels(e),
        minWidthInPx: this._minWidthInPixels(e)
      };
    let t;
    if (typeof e.afterColumn < "u")
      t = this._context.viewModel.model.validatePosition({
        lineNumber: e.afterLineNumber,
        column: e.afterColumn
      });
    else {
      const o = this._context.viewModel.model.validatePosition({
        lineNumber: e.afterLineNumber,
        column: 1
      }).lineNumber;
      t = new de(o, this._context.viewModel.model.getLineMaxColumn(o));
    }
    let n;
    t.column === this._context.viewModel.model.getLineMaxColumn(t.lineNumber) ? n = this._context.viewModel.model.validatePosition({
      lineNumber: t.lineNumber + 1,
      column: 1
    }) : n = this._context.viewModel.model.validatePosition({
      lineNumber: t.lineNumber,
      column: t.column + 1
    });
    const r = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t, e.afterColumnAffinity, !0), s = e.showInHiddenAreas || this._context.viewModel.coordinatesConverter.modelPositionIsVisible(n);
    return {
      isInHiddenArea: !s,
      afterViewLineNumber: r.lineNumber,
      heightInPx: s ? this._heightInPixels(e) : 0,
      minWidthInPx: this._minWidthInPixels(e)
    };
  }
  changeViewZones(e) {
    let t = !1;
    return this._context.viewModel.changeWhitespace((n) => {
      const r = {
        addZone: (s) => (t = !0, this._addZone(n, s)),
        removeZone: (s) => {
          s && (t = this._removeZone(n, s) || t);
        },
        layoutZone: (s) => {
          s && (t = this._layoutZone(n, s) || t);
        }
      };
      Ydt(e, r), r.addZone = ree, r.removeZone = ree, r.layoutZone = ree;
    }), t;
  }
  _addZone(e, t) {
    const n = this._computeWhitespaceProps(t), s = {
      whitespaceId: e.insertWhitespace(n.afterViewLineNumber, this._getZoneOrdinal(t), n.heightInPx, n.minWidthInPx),
      delegate: t,
      isInHiddenArea: n.isInHiddenArea,
      isVisible: !1,
      domNode: Gi(t.domNode),
      marginDomNode: t.marginDomNode ? Gi(t.marginDomNode) : null
    };
    return this._safeCallOnComputedHeight(s.delegate, n.heightInPx), s.domNode.setPosition("absolute"), s.domNode.domNode.style.width = "100%", s.domNode.setDisplay("none"), s.domNode.setAttribute("monaco-view-zone", s.whitespaceId), this.domNode.appendChild(s.domNode), s.marginDomNode && (s.marginDomNode.setPosition("absolute"), s.marginDomNode.domNode.style.width = "100%", s.marginDomNode.setDisplay("none"), s.marginDomNode.setAttribute("monaco-view-zone", s.whitespaceId), this.marginDomNode.appendChild(s.marginDomNode)), this._zones[s.whitespaceId] = s, this.setShouldRender(), s.whitespaceId;
  }
  _removeZone(e, t) {
    if (this._zones.hasOwnProperty(t)) {
      const n = this._zones[t];
      return delete this._zones[t], e.removeWhitespace(n.whitespaceId), n.domNode.removeAttribute("monaco-visible-view-zone"), n.domNode.removeAttribute("monaco-view-zone"), n.domNode.domNode.remove(), n.marginDomNode && (n.marginDomNode.removeAttribute("monaco-visible-view-zone"), n.marginDomNode.removeAttribute("monaco-view-zone"), n.marginDomNode.domNode.remove()), this.setShouldRender(), !0;
    }
    return !1;
  }
  _layoutZone(e, t) {
    if (this._zones.hasOwnProperty(t)) {
      const n = this._zones[t], r = this._computeWhitespaceProps(n.delegate);
      return n.isInHiddenArea = r.isInHiddenArea, e.changeOneWhitespace(n.whitespaceId, r.afterViewLineNumber, r.heightInPx), this._safeCallOnComputedHeight(n.delegate, r.heightInPx), this.setShouldRender(), !0;
    }
    return !1;
  }
  shouldSuppressMouseDownOnViewZone(e) {
    return this._zones.hasOwnProperty(e) ? !!this._zones[e].delegate.suppressMouseDown : !1;
  }
  _heightInPixels(e) {
    return typeof e.heightInPx == "number" ? e.heightInPx : typeof e.heightInLines == "number" ? this._lineHeight * e.heightInLines : this._lineHeight;
  }
  _minWidthInPixels(e) {
    return typeof e.minWidthInPx == "number" ? e.minWidthInPx : 0;
  }
  _safeCallOnComputedHeight(e, t) {
    if (typeof e.onComputedHeight == "function")
      try {
        e.onComputedHeight(t);
      } catch (n) {
        fn(n);
      }
  }
  _safeCallOnDomNodeTop(e, t) {
    if (typeof e.onDomNodeTop == "function")
      try {
        e.onDomNodeTop(t);
      } catch (n) {
        fn(n);
      }
  }
  prepareRender(e) {
  }
  render(e) {
    const t = e.viewportData.whitespaceViewportData, n = {};
    let r = !1;
    for (const o of t)
      this._zones[o.id].isInHiddenArea || (n[o.id] = o, r = !0);
    const s = Object.keys(this._zones);
    for (let o = 0, a = s.length; o < a; o++) {
      const l = s[o], c = this._zones[l];
      let u = 0, d = 0, h = "none";
      n.hasOwnProperty(l) ? (u = n[l].verticalOffset - e.bigNumbersDelta, d = n[l].height, h = "block", c.isVisible || (c.domNode.setAttribute("monaco-visible-view-zone", "true"), c.isVisible = !0), this._safeCallOnDomNodeTop(c.delegate, e.getScrolledTopFromAbsoluteTop(n[l].verticalOffset))) : (c.isVisible && (c.domNode.removeAttribute("monaco-visible-view-zone"), c.isVisible = !1), this._safeCallOnDomNodeTop(c.delegate, e.getScrolledTopFromAbsoluteTop(-1e6))), c.domNode.setTop(u), c.domNode.setHeight(d), c.domNode.setDisplay(h), c.marginDomNode && (c.marginDomNode.setTop(u), c.marginDomNode.setHeight(d), c.marginDomNode.setDisplay(h));
    }
    r && (this.domNode.setWidth(Math.max(e.scrollWidth, this._contentWidth)), this.marginDomNode.setWidth(this._contentLeft));
  }
}
function Ydt(i, e) {
  try {
    return i(e);
  } catch (t) {
    fn(t);
  }
}
class Xdt extends Ew {
  constructor(e) {
    super(), this._context = e, this._options = new KLe(this._context.configuration), this._selection = [], this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = new KLe(this._context.configuration);
    return this._options.equals(t) ? e.hasChanged(
      165
      /* EditorOption.layoutInfo */
    ) : (this._options = t, !0);
  }
  onCursorStateChanged(e) {
    return this._selection = e.selections, this._options.renderWhitespace === "selection";
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  prepareRender(e) {
    if (this._options.renderWhitespace === "none") {
      this._renderResult = null;
      return;
    }
    const t = e.visibleRange.startLineNumber, r = e.visibleRange.endLineNumber - t + 1, s = new Array(r);
    for (let o = 0; o < r; o++)
      s[o] = !0;
    this._renderResult = [];
    for (let o = e.viewportData.startLineNumber; o <= e.viewportData.endLineNumber; o++) {
      const a = o - e.viewportData.startLineNumber, l = this._context.viewModel.getViewLineRenderingData(o);
      let c = null;
      if (this._options.renderWhitespace === "selection") {
        const u = this._selection;
        for (const d of u) {
          if (d.endLineNumber < o || d.startLineNumber > o)
            continue;
          const h = d.startLineNumber === o ? d.startColumn : l.minColumn, g = d.endLineNumber === o ? d.endColumn : l.maxColumn;
          h < g && (c || (c = []), c.push(new Tt(h - 1, g - 1)));
        }
      }
      this._renderResult[a] = this._applyRenderWhitespace(e, o, c, l);
    }
  }
  _applyRenderWhitespace(e, t, n, r) {
    if (r.hasVariableFonts || this._options.renderWhitespace === "selection" && !n || this._options.renderWhitespace === "trailing" && r.continuesWithWrappedLine)
      return "";
    const s = this._context.theme.getColor(Ofe), o = this._options.renderWithSVG, a = r.content, l = this._options.stopRenderingLineAfter === -1 ? a.length : Math.min(this._options.stopRenderingLineAfter, a.length), c = r.continuesWithWrappedLine, u = r.minColumn - 1, d = this._options.renderWhitespace === "boundary", h = this._options.renderWhitespace === "trailing", g = e.getLineHeightForLineNumber(t), m = this._options.middotWidth, _ = this._options.wsmiddotWidth, v = this._options.spaceWidth, w = Math.abs(_ - v), E = Math.abs(m - v), L = w < E ? 11825 : 183, T = this._options.canUseHalfwidthRightwardsArrow;
    let D = "", N = !1, R = Tc(a), M;
    R === -1 ? (N = !0, R = l, M = l) : M = zg(a);
    let B = 0, H = n && n[B], j = 0;
    for (let K = u; K < l; K++) {
      const X = a.charCodeAt(K);
      if (H && H.endExclusive <= K && (B++, H = n && n[B]), X !== 9 && X !== 32 || h && !N && K <= M)
        continue;
      if (d && K >= R && K <= M && X === 32) {
        const G = K - 1 >= 0 ? a.charCodeAt(K - 1) : 0, Q = K + 1 < l ? a.charCodeAt(K + 1) : 0;
        if (G !== 32 && Q !== 32)
          continue;
      }
      if (d && c && K === l - 1) {
        const G = K - 1 >= 0 ? a.charCodeAt(K - 1) : 0;
        if (X === 32 && G !== 32 && G !== 9)
          continue;
      }
      if (n && !(H && H.start <= K && K < H.endExclusive))
        continue;
      const Y = e.visibleRangeForPosition(new de(t, K + 1));
      Y && (o ? (j = Math.max(j, Y.left), X === 9 ? D += this._renderArrow(g, v, Y.left) : D += `<circle cx="${(Y.left + v / 2).toFixed(2)}" cy="${(g / 2).toFixed(2)}" r="${(v / 7).toFixed(2)}" />`) : X === 9 ? D += `<div class="mwh" style="left:${Y.left}px;height:${g}px;">${T ? "￫" : "→"}</div>` : D += `<div class="mwh" style="left:${Y.left}px;height:${g}px;">${String.fromCharCode(L)}</div>`);
    }
    return o ? (j = Math.round(j + v), `<svg style="bottom:0;position:absolute;width:${j}px;height:${g}px" viewBox="0 0 ${j} ${g}" xmlns="http://www.w3.org/2000/svg" fill="${s}">` + D + "</svg>") : D;
  }
  _renderArrow(e, t, n) {
    const r = t / 7, s = t, o = e / 2, a = n, l = { x: 0, y: r / 2 }, c = { x: 100 / 125 * s, y: l.y }, u = { x: c.x - 0.2 * c.x, y: c.y + 0.2 * c.x }, d = { x: u.x + 0.1 * c.x, y: u.y + 0.1 * c.x }, h = { x: d.x + 0.35 * c.x, y: d.y - 0.35 * c.x }, g = { x: h.x, y: -h.y }, m = { x: d.x, y: -d.y }, _ = { x: u.x, y: -u.y }, v = { x: c.x, y: -c.y }, w = { x: l.x, y: -l.y };
    return `<path d="M ${[l, c, u, d, h, g, m, _, v, w].map((T) => `${(a + T.x).toFixed(2)} ${(o + T.y).toFixed(2)}`).join(" L ")}" />`;
  }
  render(e, t) {
    if (!this._renderResult)
      return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
}
class KLe {
  constructor(e) {
    const t = e.options, n = t.get(
      59
      /* EditorOption.fontInfo */
    ), r = t.get(
      47
      /* EditorOption.experimentalWhitespaceRendering */
    );
    r === "off" ? (this.renderWhitespace = "none", this.renderWithSVG = !1) : r === "svg" ? (this.renderWhitespace = t.get(
      113
      /* EditorOption.renderWhitespace */
    ), this.renderWithSVG = !0) : (this.renderWhitespace = t.get(
      113
      /* EditorOption.renderWhitespace */
    ), this.renderWithSVG = !1), this.spaceWidth = n.spaceWidth, this.middotWidth = n.middotWidth, this.wsmiddotWidth = n.wsmiddotWidth, this.canUseHalfwidthRightwardsArrow = n.canUseHalfwidthRightwardsArrow, this.lineHeight = t.get(
      75
      /* EditorOption.lineHeight */
    ), this.stopRenderingLineAfter = t.get(
      133
      /* EditorOption.stopRenderingLineAfter */
    );
  }
  equals(e) {
    return this.renderWhitespace === e.renderWhitespace && this.renderWithSVG === e.renderWithSVG && this.spaceWidth === e.spaceWidth && this.middotWidth === e.middotWidth && this.wsmiddotWidth === e.wsmiddotWidth && this.canUseHalfwidthRightwardsArrow === e.canUseHalfwidthRightwardsArrow && this.lineHeight === e.lineHeight && this.stopRenderingLineAfter === e.stopRenderingLineAfter;
  }
}
class Zdt {
  constructor(e, t, n, r) {
    this.selections = e, this.startLineNumber = t.startLineNumber | 0, this.endLineNumber = t.endLineNumber | 0, this.relativeVerticalOffset = t.relativeVerticalOffset, this.bigNumbersDelta = t.bigNumbersDelta | 0, this.lineHeight = t.lineHeight | 0, this.whitespaceViewportData = n, this._model = r, this.visibleRange = new z(t.startLineNumber, this._model.getLineMinColumn(t.startLineNumber), t.endLineNumber, this._model.getLineMaxColumn(t.endLineNumber));
  }
  getViewLineRenderingData(e) {
    return this._model.getViewportViewLineRenderingData(this.visibleRange, e);
  }
  getDecorationsInViewport() {
    return this._model.getDecorationsInViewport(this.visibleRange);
  }
}
class Qdt {
  get type() {
    return this._theme.type;
  }
  get value() {
    return this._theme;
  }
  constructor(e) {
    this._theme = e;
  }
  update(e) {
    this._theme = e;
  }
  getColor(e) {
    return this._theme.getColor(e);
  }
}
class Jdt {
  constructor(e, t, n) {
    this.configuration = e, this.theme = new Qdt(t), this.viewModel = n, this.viewLayout = n.viewLayout;
  }
  addEventHandler(e) {
    this.viewModel.addViewEventHandler(e);
  }
  removeEventHandler(e) {
    this.viewModel.removeViewEventHandler(e);
  }
}
const Hx = new Float32Array([
  1,
  0,
  1,
  1,
  0,
  1,
  0,
  0,
  0,
  1,
  1,
  0
]);
function aT(i) {
  if (!i)
    throw new Error(`Value "${i}" cannot be null`);
  return i;
}
function I3e(i, e, t) {
  let n = new e.ResizeObserver((r) => {
    const s = r.find((l) => l.target === i);
    if (!s)
      return;
    if (!("devicePixelContentBoxSize" in s)) {
      n == null || n.disconnect(), n = void 0;
      return;
    }
    const o = s.devicePixelContentBoxSize[0].inlineSize, a = s.devicePixelContentBoxSize[0].blockSize;
    o > 0 && a > 0 && t(o, a);
  });
  try {
    n.observe(i, { box: ["device-pixel-content-box"] });
  } catch {
    throw n.disconnect(), n = void 0, new Wt("Could not observe device pixel dimensions");
  }
  return Et(() => n == null ? void 0 : n.disconnect());
}
var eht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
};
let tht = 0;
class I4 extends ge {
  get cacheKey() {
    return `${this.fontFamily}_${this.fontSize}px`;
  }
  constructor(e, t, n, r) {
    super(), this.fontSize = e, this.fontFamily = t, this.devicePixelRatio = n, this._decorationStyleCache = r, this.id = tht++, this._workGlyph = {
      source: null,
      boundingBox: {
        left: 0,
        bottom: 0,
        right: 0,
        top: 0
      },
      originOffset: {
        x: 0,
        y: 0
      },
      fontBoundingBoxAscent: 0,
      fontBoundingBoxDescent: 0
    }, this._workGlyphConfig = { chars: void 0, tokenMetadata: 0, decorationStyleSetId: 0 }, this._antiAliasing = Kn ? "greyscale" : "subpixel";
    const s = Math.ceil(this.fontSize * n);
    this._canvas = new OffscreenCanvas(s * 3, s * 3), this._ctx = aT(this._canvas.getContext("2d", {
      willReadFrequently: !0,
      alpha: this._antiAliasing === "greyscale"
    })), this._ctx.textBaseline = "top", this._ctx.fillStyle = "#FFFFFF", this._ctx.font = `${s}px ${this.fontFamily}`, this._textMetrics = this._ctx.measureText("A");
  }
  /**
   * Rasterizes a glyph. Note that the returned object is reused across different glyphs and
   * therefore is only safe for synchronous access.
   */
  rasterizeGlyph(e, t, n, r) {
    return e === "" ? {
      source: this._canvas,
      boundingBox: { top: 0, left: 0, bottom: -1, right: -1 },
      originOffset: { x: 0, y: 0 },
      fontBoundingBoxAscent: 0,
      fontBoundingBoxDescent: 0
    } : this._workGlyphConfig.chars === e && this._workGlyphConfig.tokenMetadata === t && this._workGlyphConfig.decorationStyleSetId === n ? this._workGlyph : (this._workGlyphConfig.chars = e, this._workGlyphConfig.tokenMetadata = t, this._workGlyphConfig.decorationStyleSetId = n, this._rasterizeGlyph(e, t, n, r));
  }
  _rasterizeGlyph(e, t, n, r) {
    const s = Math.ceil(this.fontSize * this.devicePixelRatio), o = s * 3;
    this._canvas.width !== o && (this._canvas.width = o, this._canvas.height = o), this._ctx.save();
    const a = (t & 15) / 10, l = jl.getBackground(t), c = r[l], u = this._decorationStyleCache.getStyleSet(n);
    this._antiAliasing === "subpixel" ? (this._ctx.fillStyle = c, this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height)) : this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);
    const d = new ww(200), h = jl.getFontStyle(t);
    h & 1 && d.appendString("italic "), (u == null ? void 0 : u.bold) !== void 0 ? u.bold && d.appendString("bold ") : h & 2 && d.appendString("bold "), d.appendString(`${s}px ${this.fontFamily}`), this._ctx.font = d.build();
    const g = s, m = s;
    (u == null ? void 0 : u.color) !== void 0 ? this._ctx.fillStyle = `#${u.color.toString(16).padStart(8, "0")}` : this._ctx.fillStyle = r[jl.getForeground(t)], this._ctx.textBaseline = "top", (u == null ? void 0 : u.opacity) !== void 0 && (this._ctx.globalAlpha = u.opacity), this._ctx.fillText(e, g + a, m), this._ctx.restore();
    const _ = this._ctx.getImageData(0, 0, this._canvas.width, this._canvas.height);
    if (this._antiAliasing === "subpixel") {
      const v = parseInt(c.substring(1, 3), 16), w = parseInt(c.substring(3, 5), 16), E = parseInt(c.substring(5, 7), 16);
      this._clearColor(_, v, w, E), this._ctx.putImageData(_, 0, 0);
    }
    return this._findGlyphBoundingBox(_, this._workGlyph.boundingBox), this._workGlyph.source = this._canvas, this._workGlyph.originOffset.x = this._workGlyph.boundingBox.left - g, this._workGlyph.originOffset.y = this._workGlyph.boundingBox.top - m, this._workGlyph.fontBoundingBoxAscent = this._textMetrics.fontBoundingBoxAscent, this._workGlyph.fontBoundingBoxDescent = this._textMetrics.fontBoundingBoxDescent, this._workGlyph;
  }
  _clearColor(e, t, n, r) {
    for (let s = 0; s < e.data.length; s += 4)
      e.data[s] === t && e.data[s + 1] === n && e.data[s + 2] === r && (e.data[s + 3] = 0);
  }
  // TODO: Does this even need to happen when measure text is used?
  _findGlyphBoundingBox(e, t) {
    const n = this._canvas.height, r = this._canvas.width;
    let s = !1;
    for (let o = 0; o < n; o++) {
      for (let a = 0; a < r; a++) {
        const l = o * r * 4 + a * 4 + 3;
        if (e.data[l] !== 0) {
          t.top = o, s = !0;
          break;
        }
      }
      if (s)
        break;
    }
    t.left = 0, s = !1;
    for (let o = 0; o < r; o++) {
      for (let a = 0; a < n; a++) {
        const l = a * r * 4 + o * 4 + 3;
        if (e.data[l] !== 0) {
          t.left = o, s = !0;
          break;
        }
      }
      if (s)
        break;
    }
    t.right = r, s = !1;
    for (let o = r - 1; o >= t.left; o--) {
      for (let a = 0; a < n; a++) {
        const l = a * r * 4 + o * 4 + 3;
        if (e.data[l] !== 0) {
          t.right = o, s = !0;
          break;
        }
      }
      if (s)
        break;
    }
    t.bottom = t.top, s = !1;
    for (let o = n - 1; o >= 0; o--) {
      for (let a = 0; a < r; a++) {
        const l = o * r * 4 + a * 4 + 3;
        if (e.data[l] !== 0) {
          t.bottom = o, s = !0;
          break;
        }
      }
      if (s)
        break;
    }
  }
  getTextMetrics(e) {
    return this._ctx.measureText(e);
  }
}
eht([
  go
], I4.prototype, "cacheKey", null);
var nht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, iht = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let pU = class extends ge {
  constructor(e) {
    super(), this._logService = e, this._tasks = [], this._i = 0, this._register(Et(() => this.clear()));
  }
  enqueue(e) {
    this._tasks.push(e), this._start();
  }
  clear() {
    this._idleCallback && (this._cancelCallback(this._idleCallback), this._idleCallback = void 0), this._i = 0, this._tasks.length = 0;
  }
  _start() {
    this._idleCallback || (this._idleCallback = this._requestCallback(this._process.bind(this)));
  }
  _process(e) {
    this._idleCallback = void 0;
    let t = 0, n = 0, r = e.timeRemaining(), s = 0;
    for (; this._i < this._tasks.length; ) {
      if (t = Date.now(), this._tasks[this._i]() || this._i++, t = Math.max(1, Date.now() - t), n = Math.max(t, n), s = e.timeRemaining(), n * 1.5 > s) {
        r - t < -20 && this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r - t))}ms`), this._start();
        return;
      }
      r = s;
    }
    this.clear();
  }
};
pU = nht([
  iht(0, $r)
], pU);
class rht extends pU {
  _requestCallback(e) {
    return rr().setTimeout(() => e(this._createDeadline(16)));
  }
  _cancelCallback(e) {
    rr().clearTimeout(e);
  }
  _createDeadline(e) {
    const t = Date.now() + e;
    return {
      timeRemaining: () => Math.max(0, t - Date.now())
    };
  }
}
class sht extends pU {
  _requestCallback(e) {
    return rr().requestIdleCallback(e);
  }
  _cancelCallback(e) {
    rr().cancelIdleCallback(e);
  }
}
const oht = "requestIdleCallback" in rr() ? sht : rht;
class aht {
  constructor(e, t) {
    this._canvas = e, this._textureIndex = t, this._currentRow = {
      x: 0,
      y: 0,
      h: 0
    }, this._allocatedGlyphs = /* @__PURE__ */ new Set(), this._nextIndex = 0, this._ctx = aT(this._canvas.getContext("2d", {
      willReadFrequently: !0
    }));
  }
  allocate(e) {
    const t = e.boundingBox.right - e.boundingBox.left + 1, n = e.boundingBox.bottom - e.boundingBox.top + 1;
    if (t > this._canvas.width || n > this._canvas.height)
      throw new Wt("Glyph is too large for the atlas page");
    if (e.boundingBox.right - e.boundingBox.left + 1 > this._canvas.width - this._currentRow.x && (this._currentRow.x = 0, this._currentRow.y += this._currentRow.h, this._currentRow.h = 1), this._currentRow.y + e.boundingBox.bottom - e.boundingBox.top + 1 > this._canvas.height)
      return;
    this._ctx.drawImage(
      e.source,
      // source
      e.boundingBox.left,
      e.boundingBox.top,
      t,
      n,
      // destination
      this._currentRow.x,
      this._currentRow.y,
      t,
      n
    );
    const r = {
      pageIndex: this._textureIndex,
      glyphIndex: this._nextIndex++,
      x: this._currentRow.x,
      y: this._currentRow.y,
      w: t,
      h: n,
      originOffsetX: e.originOffset.x,
      originOffsetY: e.originOffset.y,
      fontBoundingBoxAscent: e.fontBoundingBoxAscent,
      fontBoundingBoxDescent: e.fontBoundingBoxDescent
    };
    return this._currentRow.x += t, this._currentRow.h = Math.max(this._currentRow.h, n), this._allocatedGlyphs.add(r), r;
  }
  getUsagePreview() {
    const e = this._canvas.width, t = this._canvas.height, n = new OffscreenCanvas(e, t), r = aT(n.getContext("2d"));
    r.fillStyle = "#808080", r.fillRect(0, 0, e, t);
    const s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
    for (const a of this._allocatedGlyphs)
      s.set(a.y, Math.max(s.get(a.y) ?? 0, a.h)), o.set(a.y, Math.max(o.get(a.y) ?? 0, a.x + a.w));
    for (const a of this._allocatedGlyphs)
      r.fillStyle = "#4040FF", r.fillRect(a.x, a.y, a.w, a.h), r.fillStyle = "#FF0000", r.fillRect(a.x, a.y + a.h, a.w, s.get(a.y) - a.h);
    for (const [a, l] of o.entries())
      a !== this._currentRow.y && (r.fillStyle = "#FF0000", r.fillRect(l, a, e - l, s.get(a)));
    return n.convertToBlob();
  }
  getStats() {
    const e = this._canvas.width, t = this._canvas.height;
    let n = 0, r = 0;
    const s = e * t, o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
    for (const l of this._allocatedGlyphs)
      o.set(l.y, Math.max(o.get(l.y) ?? 0, l.h)), a.set(l.y, Math.max(a.get(l.y) ?? 0, l.x + l.w));
    for (const l of this._allocatedGlyphs)
      n += l.w * l.h, r += l.w * (o.get(l.y) - l.h);
    for (const [l, c] of a.entries())
      l !== this._currentRow.y && (r += (e - c) * o.get(l));
    return [
      `page${this._textureIndex}:`,
      `     Total: ${s} (${e}x${t})`,
      `      Used: ${n} (${(n / s * 100).toPrecision(2)}%)`,
      `    Wasted: ${r} (${(r / s * 100).toPrecision(2)}%)`,
      `Efficiency: ${(n / (n + r) * 100).toPrecision(2)}%`
    ].join(`
`);
  }
}
class lht {
  constructor(e, t, n) {
    this._canvas = e, this._textureIndex = t, this._slabs = [], this._activeSlabsByDims = new Rq(), this._unusedRects = [], this._openRegionsByHeight = /* @__PURE__ */ new Map(), this._openRegionsByWidth = /* @__PURE__ */ new Map(), this._allocatedGlyphs = /* @__PURE__ */ new Set(), this._nextIndex = 0, this._ctx = aT(this._canvas.getContext("2d", {
      willReadFrequently: !0
    })), this._slabW = Math.min((n == null ? void 0 : n.slabW) ?? 64 << Math.max(Math.floor(rr().devicePixelRatio) - 1, 0), this._canvas.width), this._slabH = Math.min((n == null ? void 0 : n.slabH) ?? this._slabW, this._canvas.height), this._slabsPerRow = Math.floor(this._canvas.width / this._slabW), this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH);
  }
  allocate(e) {
    const t = e.boundingBox.right - e.boundingBox.left + 1, n = e.boundingBox.bottom - e.boundingBox.top + 1;
    if (t > this._canvas.width || n > this._canvas.height)
      throw new Wt("Glyph is too large for the atlas page");
    if (t > this._slabW || n > this._slabH) {
      if (this._allocatedGlyphs.size > 0)
        return;
      let c = this._canvas.width;
      for (; t < c / 2 && n < c / 2; )
        c /= 2;
      this._slabW = c, this._slabH = c, this._slabsPerRow = Math.floor(this._canvas.width / this._slabW), this._slabsPerColumn = Math.floor(this._canvas.height / this._slabH);
    }
    const r = {
      // Nearest square number
      // TODO: This can probably be optimized
      // w: 1 << Math.ceil(Math.sqrt(glyphWidth)),
      // h: 1 << Math.ceil(Math.sqrt(glyphHeight)),
      // Nearest x px
      // w: Math.ceil(glyphWidth / nearestXPixels) * nearestXPixels,
      // h: Math.ceil(glyphHeight / nearestXPixels) * nearestXPixels,
      // Round odd numbers up
      // w: glyphWidth % 0 === 1 ? glyphWidth + 1 : glyphWidth,
      // h: glyphHeight % 0 === 1 ? glyphHeight + 1 : glyphHeight,
      // Exact number only
      w: t,
      h: n
    };
    let s = this._activeSlabsByDims.get(r.w, r.h);
    if (s) {
      const c = Math.floor(this._slabW / s.entryW) * Math.floor(this._slabH / s.entryH);
      s.count >= c && (s = void 0);
    }
    let o, a;
    if (!s)
      if (t < n) {
        const c = this._openRegionsByWidth.get(t);
        if (c != null && c.length)
          for (let u = c.length - 1; u >= 0; u--) {
            const d = c[u];
            if (d.w >= t && d.h >= n) {
              o = d.x, a = d.y, t < d.w && this._unusedRects.push({
                x: d.x + t,
                y: d.y,
                w: d.w - t,
                h: n
              }), d.y += n, d.h -= n, d.h === 0 && (u === c.length - 1 ? c.pop() : this._unusedRects.splice(u, 1));
              break;
            }
          }
      } else {
        const c = this._openRegionsByHeight.get(n);
        if (c != null && c.length)
          for (let u = c.length - 1; u >= 0; u--) {
            const d = c[u];
            if (d.w >= t && d.h >= n) {
              o = d.x, a = d.y, n < d.h && this._unusedRects.push({
                x: d.x,
                y: d.y + n,
                w: t,
                h: d.h - n
              }), d.x += t, d.w -= t, d.h === 0 && (u === c.length - 1 ? c.pop() : this._unusedRects.splice(u, 1));
              break;
            }
          }
      }
    if (o === void 0 || a === void 0) {
      if (!s) {
        if (this._slabs.length >= this._slabsPerRow * this._slabsPerColumn)
          return;
        s = {
          x: Math.floor(this._slabs.length % this._slabsPerRow) * this._slabW,
          y: Math.floor(this._slabs.length / this._slabsPerRow) * this._slabH,
          entryW: r.w,
          entryH: r.h,
          count: 0
        };
        const u = this._slabW % s.entryW, d = this._slabH % s.entryH;
        u && YLe(this._openRegionsByWidth, u, {
          x: s.x + this._slabW - u,
          w: u,
          y: s.y,
          h: this._slabH - (d ?? 0)
        }), d && YLe(this._openRegionsByHeight, d, {
          x: s.x,
          w: this._slabW,
          y: s.y + this._slabH - d,
          h: d
        }), this._slabs.push(s), this._activeSlabsByDims.set(s, r.w, r.h);
      }
      const c = Math.floor(this._slabW / s.entryW);
      o = s.x + Math.floor(s.count % c) * s.entryW, a = s.y + Math.floor(s.count / c) * s.entryH, s.count++;
    }
    this._ctx.drawImage(
      e.source,
      // source
      e.boundingBox.left,
      e.boundingBox.top,
      t,
      n,
      // destination
      o,
      a,
      t,
      n
    );
    const l = {
      pageIndex: this._textureIndex,
      glyphIndex: this._nextIndex++,
      x: o,
      y: a,
      w: t,
      h: n,
      originOffsetX: e.originOffset.x,
      originOffsetY: e.originOffset.y,
      fontBoundingBoxAscent: e.fontBoundingBoxAscent,
      fontBoundingBoxDescent: e.fontBoundingBoxDescent
    };
    return this._allocatedGlyphs.add(l), l;
  }
  getUsagePreview() {
    const e = this._canvas.width, t = this._canvas.height, n = new OffscreenCanvas(e, t), r = aT(n.getContext("2d"));
    r.fillStyle = "#808080", r.fillRect(0, 0, e, t);
    let s = 0, o = 0, a = 0;
    const l = 64 << Math.floor(rr().devicePixelRatio) - 1, c = l;
    for (const d of this._slabs) {
      let h = 0, g = 0;
      for (let v = 0; v < d.count; v++)
        h + d.entryW > l && (h = 0, g += d.entryH), r.fillStyle = "#FF0000", r.fillRect(d.x + h, d.y + g, d.entryW, d.entryH), s += d.entryW * d.entryH, h += d.entryW;
      const m = Math.floor(l / d.entryW), _ = Math.floor(c / d.entryH);
      d.entryW * m * d.entryH * _;
    }
    for (const d of this._allocatedGlyphs)
      o += d.w * d.h, r.fillStyle = "#4040FF", r.fillRect(d.x, d.y, d.w, d.h);
    const u = Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());
    for (const d of u)
      r.fillStyle = "#FF000088", r.fillRect(d.x, d.y, d.w, d.h), a += d.w * d.h;
    return r.globalAlpha = 0.5, r.drawImage(this._canvas, 0, 0), r.globalAlpha = 1, n.convertToBlob();
  }
  getStats() {
    const e = this._canvas.width, t = this._canvas.height;
    let n = 0, r = 0, s = 0, o = 0, a = 0;
    const l = e * t, c = 64 << Math.floor(rr().devicePixelRatio) - 1, u = c;
    for (const m of this._slabs) {
      let _ = 0, v = 0;
      for (let T = 0; T < m.count; T++)
        _ + m.entryW > c && (_ = 0, v += m.entryH), n += m.entryW * m.entryH, _ += m.entryW;
      const w = Math.floor(c / m.entryW), E = Math.floor(u / m.entryH), L = m.entryW * w * m.entryH * E;
      s += c * u - L;
    }
    for (const m of this._allocatedGlyphs)
      r += m.w * m.h;
    const d = Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat());
    for (const m of d)
      a += m.w * m.h;
    const h = s - a;
    o = n - (r - h);
    const g = r / (r + o + a);
    return [
      `page[${this._textureIndex}]:`,
      `     Total: ${l}px (${e}x${t})`,
      `      Used: ${r}px (${(r / l * 100).toFixed(2)}%)`,
      `    Wasted: ${o}px (${(o / l * 100).toFixed(2)}%)`,
      `Restricted: ${a}px (${(a / l * 100).toFixed(2)}%) (hard to allocate)`,
      `Efficiency: ${g === 1 ? "100" : (g * 100).toFixed(2)}%`,
      `     Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width / c) * Math.floor(this._canvas.height / u)}`
    ].join(`
`);
  }
}
function YLe(i, e, t) {
  let n = i.get(e);
  n || (n = [], i.set(e, n)), n.push(t);
}
var cht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, XLe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, cre, Zx;
let Up = (Zx = class extends ge {
  get version() {
    return this._version;
  }
  get usedArea() {
    return this._usedArea;
  }
  get source() {
    return this._canvas;
  }
  get glyphs() {
    return this._glyphInOrderSet.values();
  }
  constructor(e, t, n, r, s) {
    switch (super(), this._logService = r, this._version = 0, this._usedArea = { left: 0, top: 0, right: 0, bottom: 0 }, this._glyphMap = new Rq(), this._glyphInOrderSet = /* @__PURE__ */ new Set(), this._canvas = new OffscreenCanvas(t, t), this._colorMap = s.getColorTheme().tokenColorMap, n) {
      case "shelf":
        this._allocator = new aht(this._canvas, e);
        break;
      case "slab":
        this._allocator = new lht(this._canvas, e);
        break;
      default:
        this._allocator = n(this._canvas, e);
        break;
    }
    this._register(Et(() => {
      this._canvas.width = 1, this._canvas.height = 1;
    }));
  }
  getGlyph(e, t, n, r) {
    return this._glyphMap.get(t, n, r, e.cacheKey) ?? this._createGlyph(e, t, n, r);
  }
  _createGlyph(e, t, n, r) {
    if (this._glyphInOrderSet.size >= cre.maximumGlyphCount)
      return;
    const s = e.rasterizeGlyph(t, n, r, this._colorMap), o = this._allocator.allocate(s);
    if (o !== void 0)
      return this._glyphMap.set(o, t, n, r, e.cacheKey), this._glyphInOrderSet.add(o), this._version++, this._usedArea.right = Math.max(this._usedArea.right, o.x + o.w - 1), this._usedArea.bottom = Math.max(this._usedArea.bottom, o.y + o.h - 1), this._logService.getLevel() === da.Trace && this._logService.trace("New glyph", {
        chars: t,
        tokenMetadata: n,
        decorationStyleSetId: r,
        rasterizedGlyph: s,
        glyph: o
      }), o;
  }
  getUsagePreview() {
    return this._allocator.getUsagePreview();
  }
  getStats() {
    return this._allocator.getStats();
  }
}, cre = Zx, Zx.maximumGlyphCount = 5e3, Zx);
Up = cre = cht([
  XLe(3, $r),
  XLe(4, to)
], Up);
var uht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ZLe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, IW, Qx;
let c1 = (Qx = class extends ge {
  get pages() {
    return this._pages;
  }
  constructor(e, t, n, r, s) {
    super(), this._maxTextureSize = e, this._decorationStyleCache = n, this._themeService = r, this._instantiationService = s, this._warmUpTask = this._register(new er()), this._warmedUpRasterizers = /* @__PURE__ */ new Set(), this._pages = [], this._glyphPageIndex = new Rq(), this._onDidDeleteGlyphs = this._register(new he()), this.onDidDeleteGlyphs = this._onDidDeleteGlyphs.event, this._allocatorType = (t == null ? void 0 : t.allocatorType) ?? "slab", this._register(Ze.runAndSubscribe(this._themeService.onDidColorThemeChange, () => {
      this._colorMap && this.clear(), this._colorMap = this._themeService.getColorTheme().tokenColorMap;
    }));
    const o = Math.max(1, Math.floor(rr().devicePixelRatio));
    this.pageSize = Math.min(1024 * o, this._maxTextureSize), this._initFirstPage(), this._register(Et(() => or(this._pages)));
  }
  _initFirstPage() {
    const e = this._instantiationService.createInstance(Up, 0, this.pageSize, this._allocatorType);
    this._pages.push(e);
    const t = new I4(1, "", 1, this._decorationStyleCache);
    e.getGlyph(t, "", 0, 0), t.dispose();
  }
  clear() {
    for (const e of this._pages)
      e.dispose();
    this._pages.length = 0, this._glyphPageIndex.clear(), this._warmedUpRasterizers.clear(), this._warmUpTask.clear(), this._initFirstPage(), this._onDidDeleteGlyphs.fire();
  }
  getGlyph(e, t, n, r, s) {
    return n &= -2048, n |= Math.floor(s % 1 * 10), this._warmedUpRasterizers.has(e.id) || (this._warmUpAtlas(e), this._warmedUpRasterizers.add(e.id)), this._tryGetGlyph(this._glyphPageIndex.get(t, n, r, e.cacheKey) ?? 0, e, t, n, r);
  }
  _tryGetGlyph(e, t, n, r, s) {
    return this._glyphPageIndex.set(e, n, r, s, t.cacheKey), this._pages[e].getGlyph(t, n, r, s) ?? (e + 1 < this._pages.length ? this._tryGetGlyph(e + 1, t, n, r, s) : void 0) ?? this._getGlyphFromNewPage(t, n, r, s);
  }
  _getGlyphFromNewPage(e, t, n, r) {
    if (this._pages.length >= IW.maximumPageCount)
      throw new Error(`Attempt to create a texture atlas page past the limit ${IW.maximumPageCount}`);
    return this._pages.push(this._instantiationService.createInstance(Up, this._pages.length, this.pageSize, this._allocatorType)), this._glyphPageIndex.set(this._pages.length - 1, t, n, r, e.cacheKey), this._pages[this._pages.length - 1].getGlyph(e, t, n, r);
  }
  getStats() {
    return this._pages.map((e) => e.getStats());
  }
  /**
   * Warms up the atlas by rasterizing all printable ASCII characters for each token color. This
   * is distrubuted over multiple idle callbacks to avoid blocking the main thread.
   */
  _warmUpAtlas(e) {
    var r;
    const t = this._colorMap;
    if (!t)
      throw new Wt("Cannot warm atlas without color map");
    (r = this._warmUpTask.value) == null || r.clear();
    const n = this._warmUpTask.value = this._instantiationService.createInstance(oht);
    for (let s = 65; s <= 90; s++)
      for (const o of t.keys())
        n.enqueue(() => {
          for (let a = 0; a < 1; a += 0.1)
            this.getGlyph(e, String.fromCharCode(s), o << 15 & 16744448, 0, a);
        });
    for (let s = 97; s <= 122; s++)
      for (const o of t.keys())
        n.enqueue(() => {
          for (let a = 0; a < 1; a += 0.1)
            this.getGlyph(e, String.fromCharCode(s), o << 15 & 16744448, 0, a);
        });
    for (let s = 33; s <= 126; s++)
      for (const o of t.keys())
        n.enqueue(() => {
          for (let a = 0; a < 1; a += 0.1)
            this.getGlyph(e, String.fromCharCode(s), o << 15 & 16744448, 0, a);
        });
  }
}, IW = Qx, Qx.maximumPageCount = 16, Qx);
c1 = IW = uht([
  ZLe(3, to),
  ZLe(4, xt)
], c1);
var N4;
(function(i) {
  i[i.Ignore = 0] = "Ignore", i[i.Info = 1] = "Info", i[i.Warning = 2] = "Warning", i[i.Error = 3] = "Error";
})(N4 || (N4 = {}));
(function(i) {
  const e = "error", t = "warning", n = "warn", r = "info", s = "ignore";
  function o(l) {
    return l ? tN(e, l) ? i.Error : tN(t, l) || tN(n, l) ? i.Warning : tN(r, l) ? i.Info : i.Ignore : i.Ignore;
  }
  i.fromValue = o;
  function a(l) {
    switch (l) {
      case i.Error:
        return e;
      case i.Warning:
        return t;
      case i.Info:
        return r;
      default:
        return s;
    }
  }
  i.toString = a;
})(N4 || (N4 = {}));
const Rs = N4;
var i2 = Rs;
const no = Vn("notificationService");
class dht {
}
var $u;
(function(i) {
  async function e(r) {
    try {
      if (!navigator.gpu)
        throw new Error("This browser does not support WebGPU");
      const s = await navigator.gpu.requestAdapter();
      if (!s)
        throw new Error("This browser supports WebGPU but it appears to be disabled");
      return see(await s.requestDevice());
    } catch (s) {
      throw r && r(s.message), s;
    }
  }
  i.requestDevice = e;
  function t(r, s, o) {
    const a = r.createBuffer(s);
    return o && r.queue.writeBuffer(a, 0, ZL(o) ? o() : o), see(a);
  }
  i.createBuffer = t;
  function n(r, s) {
    return see(r.createTexture(s));
  }
  i.createTexture = n;
})($u || ($u = {}));
function see(i) {
  return {
    object: i,
    dispose: () => i.destroy()
  };
}
class hht {
  get dataOffset() {
    return this._startIndex;
  }
  get dirtySize() {
    if (!(this._startIndex === void 0 || this._endIndex === void 0))
      return this._endIndex - this._startIndex + 1;
  }
  get isDirty() {
    return this._startIndex !== void 0;
  }
  /**
   * Flag the index(es) as modified. Returns the index flagged.
   * @param index An index to flag.
   * @param length An optional length to flag. Defaults to 1.
   */
  flag(e, t = 1) {
    return this._flag(e), t > 1 && this._flag(e + t - 1), e;
  }
  _flag(e) {
    (this._startIndex === void 0 || e < this._startIndex) && (this._startIndex = e), (this._endIndex === void 0 || e > this._endIndex) && (this._endIndex = e);
  }
  clear() {
    this._startIndex = void 0, this._endIndex = void 0;
  }
}
function fht(i, e) {
  return new ght(i, e);
}
class ght extends ge {
  get entryCount() {
    return this._entries.size;
  }
  get dirtyTracker() {
    return this._dirtyTracker;
  }
  constructor(e, t) {
    super(), this.propertySpecs = e, this.capacity = t, this._dirtyTracker = new hht(), this._propertySpecsMap = /* @__PURE__ */ new Map(), this._entries = new xc(), this._onDidChange = this._register(new he()), this._onDidChangeBuffer = this._register(new he()), this.onDidChangeBuffer = this._onDidChangeBuffer.event, this.view = new Float32Array(t * e.length), this.buffer = this.view.buffer, this._entrySize = e.length;
    for (let n = 0; n < e.length; n++) {
      const r = {
        offset: n,
        ...e[n]
      };
      this._propertySpecsMap.set(r.name, r);
    }
    this._register(Et(() => or(this._entries)));
  }
  createEntry(e) {
    this._entries.size === this.capacity && (this._expandBuffer(), this._onDidChangeBuffer.fire());
    const t = new pht(this.view, this._propertySpecsMap, this._dirtyTracker, this._entries.size, e), n = this._entries.push(t), r = [];
    return r.push(Ze.forward(t.onDidChange, this._onDidChange)), r.push(t.onWillDispose(() => {
      const s = t.i;
      n(), this.view.set(this.view.subarray(s * this._entrySize + 2, this._entries.size * this._entrySize + 2), s * this._entrySize);
      for (const o of this._entries)
        o.i > s && o.i--;
      this._dirtyTracker.flag(s, (this._entries.size - s) * this._entrySize), or(r);
    })), t;
  }
  _expandBuffer() {
    this.capacity *= 2;
    const e = new Float32Array(this.capacity * this._entrySize);
    e.set(this.view), this.view = e, this.buffer = this.view.buffer;
  }
}
class pht extends ge {
  constructor(e, t, n, r, s) {
    super(), this._view = e, this._propertySpecsMap = t, this._dirtyTracker = n, this.i = r, this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event, this._onWillDispose = this._register(new he()), this.onWillDispose = this._onWillDispose.event;
    for (const o of this._propertySpecsMap.values())
      this._view[this.i * this._propertySpecsMap.size + o.offset] = s[o.name];
    this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size);
  }
  dispose() {
    this._onWillDispose.fire(), super.dispose();
  }
  setRaw(e) {
    if (e.length !== this._propertySpecsMap.size)
      throw new Error(`Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);
    this._view.set(e, this.i * this._propertySpecsMap.size), this._dirtyTracker.flag(this.i * this._propertySpecsMap.size, this._propertySpecsMap.size);
  }
}
const mht = (
  /*wgsl*/
  `

struct Vertex {
	@location(0) position: vec2f,
};

struct LayoutInfo {
	canvasDims: vec2f,
	viewportOffset: vec2f,
	viewportDims: vec2f,
}

struct ScrollOffset {
	offset: vec2f,
}

struct Shape {
	position: vec2f,
	size: vec2f,
	color: vec4f,
};

struct VSOutput {
	@builtin(position) position: vec4f,
	@location(1)       color:    vec4f,
};

// Uniforms
@group(0) @binding(1) var<uniform>       layoutInfo:      LayoutInfo;

// Storage buffers
@group(0) @binding(0)            var<storage, read> shapes:          array<Shape>;
@group(0) @binding(2)      var<uniform>       scrollOffset:    ScrollOffset;

@vertex fn vs(
	vert: Vertex,
	@builtin(instance_index) instanceIndex: u32,
	@builtin(vertex_index) vertexIndex : u32
) -> VSOutput {
	let shape = shapes[instanceIndex];

	var vsOut: VSOutput;
	vsOut.position = vec4f(
		(
			// Top left corner
			vec2f(-1,  1) +
			// Convert pixel position to clipspace
			vec2f( 2, -2) / layoutInfo.canvasDims *
			// Shape position and size
			(layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size)
		),
		0.0,
		1.0
	);
	vsOut.color = shape.color;
	return vsOut;
}

@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
	return vsOut.color;
}
`
);
class _ht extends YT {
  constructor(e, t, n, r, s, o) {
    super(), this._context = e, this._contentLeft = t, this._devicePixelRatio = n, this._canvas = r, this._ctx = s, this._shapeBindBuffer = this._register(new er()), this._initialized = !1, this._shapeCollection = this._register(fht([
      { name: "x" },
      { name: "y" },
      { name: "width" },
      { name: "height" },
      { name: "red" },
      { name: "green" },
      { name: "blue" },
      { name: "alpha" }
    ], 32)), this._context.addEventHandler(this), this._initWebgpu(o);
  }
  async _initWebgpu(e) {
    if (this._device = await e, this._store.isDisposed)
      return;
    const t = navigator.gpu.getPreferredCanvasFormat();
    this._ctx.configure({
      device: this._device,
      format: t,
      alphaMode: "premultiplied"
    }), this._renderPassColorAttachment = {
      view: null,
      // Will be filled at render time
      loadOp: "load",
      storeOp: "store"
    }, this._renderPassDescriptor = {
      label: "Monaco rectangle renderer render pass",
      colorAttachments: [this._renderPassColorAttachment]
    };
    let n;
    {
      const a = new Float32Array(
        6
        /* Info.FloatsPerEntry */
      ), l = (c = this._canvas.width, u = this._canvas.height) => (a[
        0
        /* Info.Offset_CanvasWidth____ */
      ] = c, a[
        1
        /* Info.Offset_CanvasHeight___ */
      ] = u, a[
        2
        /* Info.Offset_ViewportOffsetX */
      ] = Math.ceil(this._context.configuration.options.get(
        165
        /* EditorOption.layoutInfo */
      ).contentLeft * rr().devicePixelRatio), a[
        3
        /* Info.Offset_ViewportOffsetY */
      ] = 0, a[
        4
        /* Info.Offset_ViewportWidth__ */
      ] = a[
        0
        /* Info.Offset_CanvasWidth____ */
      ] - a[
        2
        /* Info.Offset_ViewportOffsetX */
      ], a[
        5
        /* Info.Offset_ViewportHeight_ */
      ] = a[
        1
        /* Info.Offset_CanvasHeight___ */
      ] - a[
        3
        /* Info.Offset_ViewportOffsetY */
      ], a);
      n = this._register($u.createBuffer(this._device, {
        label: "Monaco rectangle renderer uniform buffer",
        size: 24,
        usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
      }, () => l())).object, this._register(I3e(this._canvas, rr(), (c, u) => {
        this._device.queue.writeBuffer(n, 0, l(c, u));
      }));
    }
    const r = 2;
    this._scrollOffsetBindBuffer = this._register($u.createBuffer(this._device, {
      label: "Monaco rectangle renderer scroll offset buffer",
      size: r * Float32Array.BYTES_PER_ELEMENT,
      usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
    })).object, this._scrollOffsetValueBuffer = new Float32Array(r);
    const s = () => $u.createBuffer(this._device, {
      label: "Monaco rectangle renderer shape buffer",
      size: this._shapeCollection.buffer.byteLength,
      usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
    });
    this._shapeBindBuffer.value = s(), this._register(Ze.runAndSubscribe(this._shapeCollection.onDidChangeBuffer, () => {
      this._shapeBindBuffer.value = s(), this._pipeline && this._updateBindGroup(this._pipeline, n);
    })), this._vertexBuffer = this._register($u.createBuffer(this._device, {
      label: "Monaco rectangle renderer vertex buffer",
      size: Hx.byteLength,
      usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST
    }, Hx)).object;
    const o = this._device.createShaderModule({
      label: "Monaco rectangle renderer shader module",
      code: mht
    });
    this._pipeline = this._device.createRenderPipeline({
      label: "Monaco rectangle renderer render pipeline",
      layout: "auto",
      vertex: {
        module: o,
        buffers: [
          {
            arrayStride: 2 * Float32Array.BYTES_PER_ELEMENT,
            // 2 floats, 4 bytes each
            attributes: [
              { shaderLocation: 0, offset: 0, format: "float32x2" }
              // position
            ]
          }
        ]
      },
      fragment: {
        module: o,
        targets: [
          {
            format: t,
            blend: {
              color: {
                srcFactor: "src-alpha",
                dstFactor: "one-minus-src-alpha"
              },
              alpha: {
                srcFactor: "src-alpha",
                dstFactor: "one-minus-src-alpha"
              }
            }
          }
        ]
      }
    }), this._updateBindGroup(this._pipeline, n), this._initialized = !0;
  }
  _updateBindGroup(e, t) {
    this._bindGroup = this._device.createBindGroup({
      label: "Monaco rectangle renderer bind group",
      layout: e.getBindGroupLayout(0),
      entries: [
        { binding: 0, resource: { buffer: this._shapeBindBuffer.value.object } },
        { binding: 1, resource: { buffer: t } },
        { binding: 2, resource: { buffer: this._scrollOffsetBindBuffer } }
      ]
    });
  }
  register(e, t, n, r, s, o, a, l) {
    return this._shapeCollection.createEntry({ x: e, y: t, width: n, height: r, red: s, green: o, blue: a, alpha: l });
  }
  // #region Event handlers
  onScrollChanged(e) {
    if (this._device) {
      const t = rr().devicePixelRatio;
      this._scrollOffsetValueBuffer[0] = this._context.viewLayout.getCurrentScrollLeft() * t, this._scrollOffsetValueBuffer[1] = this._context.viewLayout.getCurrentScrollTop() * t, this._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer);
    }
    return !0;
  }
  // #endregion
  _update() {
    if (!this._device)
      return;
    const e = this._shapeCollection;
    e.dirtyTracker.isDirty && (this._device.queue.writeBuffer(this._shapeBindBuffer.value.object, 0, e.buffer, e.dirtyTracker.dataOffset, e.dirtyTracker.dirtySize * e.view.BYTES_PER_ELEMENT), e.dirtyTracker.clear());
  }
  draw(e) {
    if (!this._initialized)
      return;
    this._update();
    const t = this._device.createCommandEncoder({ label: "Monaco rectangle renderer command encoder" });
    this._renderPassColorAttachment.view = this._ctx.getCurrentTexture().createView();
    const n = t.beginRenderPass(this._renderPassDescriptor);
    n.setPipeline(this._pipeline), n.setVertexBuffer(0, this._vertexBuffer), n.setBindGroup(0, this._bindGroup);
    const r = Math.ceil(this._contentLeft.get() * this._devicePixelRatio.get());
    n.setScissorRect(r, 0, this._canvas.width - r, this._canvas.height), n.draw(Hx.length / 2, this._shapeCollection.entryCount), n.end();
    const s = t.finish();
    this._device.queue.submit([s]);
  }
}
class bht extends ge {
  constructor() {
    super(), this._ruleCache = /* @__PURE__ */ new Map(), this._container = Ge("div.monaco-decoration-css-rule-extractor"), this._dummyElement = Ge("span"), this._container.appendChild(this._dummyElement), this._register(Et(() => this._container.remove()));
  }
  getStyleRules(e, t) {
    const n = this._ruleCache.get(t);
    if (n)
      return n;
    this._dummyElement.className = t, e.appendChild(this._container);
    const r = this._getStyleRules(t);
    return this._ruleCache.set(t, r), e.removeChild(this._container), r;
  }
  _getStyleRules(e) {
    const t = [], r = [...yB().styleSheets];
    for (let s = 0; s < r.length; s++) {
      const o = r[s];
      for (const a of o.cssRules)
        if (a instanceof CSSImportRule)
          a.styleSheet && r.push(a.styleSheet);
        else if (a instanceof CSSStyleRule) {
          const l = `.${e}`, c = a.selectorText.indexOf(l);
          if (c !== -1) {
            const u = c + l.length;
            (a.selectorText.length === u || a.selectorText.substring(u, u + 1).match(/[ :]/)) && t.push(a);
          }
        }
    }
    return t;
  }
}
class vht {
  constructor() {
    this._nextId = 1, this._cacheById = /* @__PURE__ */ new Map(), this._cacheByStyle = new Rq();
  }
  getOrCreateEntry(e, t, n) {
    if (e === void 0 && t === void 0 && n === void 0)
      return 0;
    const r = this._cacheByStyle.get(e ?? 0, t ? 1 : 0, n === void 0 ? "" : n.toFixed(2));
    if (r)
      return r.id;
    const s = this._nextId++, o = {
      id: s,
      color: e,
      bold: t,
      opacity: n
    };
    return this._cacheById.set(s, o), this._cacheByStyle.set(o, e ?? 0, t ? 1 : 0, n === void 0 ? "" : n.toFixed(2)), s;
  }
  getStyleSet(e) {
    if (e !== 0)
      return this._cacheById.get(e);
  }
}
var yht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, oee = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Yc, M1;
let Cc = (M1 = class extends ge {
  static get decorationCssRuleExtractor() {
    return Yc._decorationCssRuleExtractor;
  }
  static get decorationStyleCache() {
    return Yc._decorationStyleCache;
  }
  /**
   * The shared texture atlas to use across all views.
   *
   * @throws if called before the GPU device is resolved
   */
  static get atlas() {
    if (!Yc._atlas)
      throw new Wt("Cannot call ViewGpuContext.textureAtlas before device is resolved");
    return Yc._atlas;
  }
  /**
   * The shared texture atlas to use across all views. This is a convenience alias for
   * {@link ViewGpuContext.atlas}.
   *
   * @throws if called before the GPU device is resolved
   */
  get atlas() {
    return Yc.atlas;
  }
  constructor(e, t, n, r) {
    super(), this._instantiationService = t, this._notificationService = n, this.configurationService = r, this.maxGpuCols = 2e3, this.canvas = Gi(document.createElement("canvas")), this.canvas.setClassName("editorCanvas"), this._register(Ze.runAndSubscribe(r.onDidChangeConfiguration, (l) => {
      var c;
      if (!l || l.affectsConfiguration("editor.scrollbar.verticalScrollbarSize")) {
        const u = ((c = r.getValue("editor").scrollbar) == null ? void 0 : c.verticalScrollbarSize) ?? 14;
        this.canvas.domNode.style.boxSizing = "border-box", this.canvas.domNode.style.paddingRight = `${u}px`;
      }
    })), this.ctx = aT(this.canvas.domNode.getContext("webgpu")), Yc.device || (Yc.device = $u.requestDevice((l) => {
      const c = [{
        label: S(73, "Use DOM-based rendering"),
        run: () => this.configurationService.updateValue("editor.experimentalGpuAcceleration", "off")
      }];
      this._notificationService.prompt(i2.Warning, l, c);
    }).then((l) => (Yc.deviceSync = l.object, Yc._atlas || (Yc._atlas = this._instantiationService.createInstance(c1, l.object.limits.maxTextureDimension2D, void 0, Yc.decorationStyleCache)), l.object)));
    const s = Qt(this, rr().devicePixelRatio);
    this._register(Ce(rr(), "resize", () => {
      s.set(rr().devicePixelRatio, void 0);
    })), this.devicePixelRatio = s, this._register(rm(this.devicePixelRatio, () => {
      var l;
      return (l = Yc.atlas) == null ? void 0 : l.clear();
    }));
    const o = Qt(this, { width: this.canvas.domNode.width, height: this.canvas.domNode.height });
    this._register(I3e(this.canvas.domNode, rr(), (l, c) => {
      this.canvas.domNode.width = l, this.canvas.domNode.height = c, o.set({ width: l, height: c }, void 0);
    })), this.canvasDevicePixelDimensions = o;
    const a = Qt(this, 0);
    this._register(this.configurationService.onDidChangeConfiguration((l) => {
      a.set(e.configuration.options.get(
        165
        /* EditorOption.layoutInfo */
      ).contentLeft, void 0);
    })), this.contentLeft = a, this.rectangleRenderer = this._instantiationService.createInstance(_ht, e, this.contentLeft, this.devicePixelRatio, this.canvas.domNode, this.ctx, Yc.device);
  }
  /**
   * This method determines which lines can be and are allowed to be rendered using the GPU
   * renderer. Eventually this should trend all lines, except maybe exceptional cases like
   * decorations that use class names.
   */
  canRender(e, t, n) {
    const r = t.getViewLineRenderingData(n);
    if (r.containsRTL || r.maxColumn > this.maxGpuCols)
      return !1;
    if (r.inlineDecorations.length > 0) {
      let s = !0;
      for (const o of r.inlineDecorations) {
        if (o.type !== 0) {
          s = !1;
          break;
        }
        const a = Yc._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode, o.inlineClassName);
        if (s && (s = a.every((l) => {
          if (l.selectorText.includes(":"))
            return !1;
          for (const c of l.style)
            if (!QLe(c, l.style))
              return !1;
          return !0;
        })), !s)
          break;
      }
      return s;
    }
    return !0;
  }
  /**
   * Like {@link canRender} but returns detailed information about why the line cannot be rendered.
   */
  canRenderDetailed(e, t, n) {
    const r = t.getViewLineRenderingData(n), s = [];
    if (r.containsRTL && s.push("containsRTL"), r.maxColumn > this.maxGpuCols && s.push("maxColumn > maxGpuCols"), r.inlineDecorations.length > 0) {
      let o = !0;
      const a = [], l = [], c = [];
      for (const u of r.inlineDecorations) {
        if (u.type !== 0) {
          a.push(u.type), o = !1;
          continue;
        }
        const d = Yc._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode, u.inlineClassName);
        o && (o = d.every((h) => {
          if (h.selectorText.includes(":"))
            return l.push(h.selectorText), !1;
          for (const g of h.style)
            if (!QLe(g, h.style))
              return c.push(`${g}: ${h.style[g]}`), !1;
          return !0;
        }));
      }
      a.length > 0 && s.push(`inlineDecorations with unsupported types (${a.map((u) => `\`${u}\``).join(", ")})`), c.length > 0 && s.push(`inlineDecorations with unsupported CSS rules (${c.map((u) => `\`${u}\``).join(", ")})`), l.length > 0 && s.push(`inlineDecorations with unsupported CSS selectors (${l.map((u) => `\`${u}\``).join(", ")})`);
    }
    return s;
  }
}, Yc = M1, M1._decorationCssRuleExtractor = new bht(), M1._decorationStyleCache = new vht(), M1);
Cc = Yc = yht([
  oee(1, xt),
  oee(2, no),
  oee(3, xn)
], Cc);
const Cht = [
  "color",
  "font-weight",
  "opacity"
];
function QLe(i, e) {
  return !!Cht.includes(i);
}
function mU(i, e) {
  return i.isBasicASCII && e.useMonospaceOptimizations ? new wht(i) : new Sht(i);
}
class wht {
  constructor(e) {
    this._content = e.content;
  }
  getSegmentAtIndex(e) {
    return this._content[e];
  }
}
class Sht {
  constructor(e) {
    this._segments = [];
    const t = e.content, n = qT.Segmenter(void 0, { granularity: "grapheme" }).value, r = Array.from(n.segment(t));
    let s = 0;
    for (let o = 0; o < t.length; o++) {
      const a = r[s];
      if (!a)
        break;
      if (a.index !== o) {
        this._segments.push(void 0);
        continue;
      }
      s++, this._segments.push(a);
    }
  }
  getSegmentAtIndex(e) {
    var t;
    return (t = this._segments[e]) == null ? void 0 : t.segment;
  }
}
class N3e extends YT {
  get glyphRasterizer() {
    return this._glyphRasterizer.value;
  }
  constructor(e, t, n, r) {
    super(), this._context = e, this._viewGpuContext = t, this._device = n, this._glyphRasterizer = r, this._context.addEventHandler(this);
  }
}
const R3e = (
  /*wgsl*/
  `
struct GlyphInfo {
	position: vec2f,
	size: vec2f,
	origin: vec2f,
};

struct Vertex {
	@location(0) position: vec2f,
};

struct Cell {
	position: vec2f,
	unused1: vec2f,
	glyphIndex: f32,
	textureIndex: f32
};

struct LayoutInfo {
	canvasDims: vec2f,
	viewportOffset: vec2f,
	viewportDims: vec2f,
}

struct ScrollOffset {
	offset: vec2f
}

struct VSOutput {
	@builtin(position) position:   vec4f,
	@location(1)       layerIndex: f32,
	@location(0)       texcoord:   vec2f,
};

// Uniforms
@group(0) @binding(4)       var<uniform>       layoutInfo:      LayoutInfo;
@group(0) @binding(5)  var<uniform>       atlasDims:       vec2f;
@group(0) @binding(6)            var<uniform>       scrollOffset:    ScrollOffset;

// Storage buffers
@group(0) @binding(0)               var<storage, read> glyphInfo:       array<array<GlyphInfo, ${Up.maximumGlyphCount}>, ${c1.maximumPageCount}>;
@group(0) @binding(1)                   var<storage, read> cells:           array<Cell>;

@vertex fn vs(
	vert: Vertex,
	@builtin(instance_index) instanceIndex: u32,
	@builtin(vertex_index) vertexIndex : u32
) -> VSOutput {
	let cell = cells[instanceIndex];
	var glyph = glyphInfo[u32(cell.textureIndex)][u32(cell.glyphIndex)];

	var vsOut: VSOutput;
	// Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1
	vsOut.position = vec4f(
		// Make everything relative to top left instead of center
		vec2f(-1, 1) +
		((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims) * glyph.size +
		((cell.position * vec2f(2, -2)) / layoutInfo.canvasDims) +
		((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) +
		(((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims),
		0.0,
		1.0
	);

	vsOut.layerIndex = cell.textureIndex;
	// Textures are flipped from natural direction on the y-axis, so flip it back
	vsOut.texcoord = vert.position;
	vsOut.texcoord = (
		// Glyph offset (0-1)
		(glyph.position / atlasDims) +
		// Glyph coordinate (0-1)
		(vsOut.texcoord * (glyph.size / atlasDims))
	);

	return vsOut;
}

@group(0) @binding(2) var ourSampler: sampler;
@group(0) @binding(3)        var ourTexture: texture_2d_array<f32>;

@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
	return textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex));
}
`
), N_ = class N_ extends N3e {
  get bindGroupEntries() {
    return [
      { binding: 1, resource: { buffer: this._cellBindBuffer } },
      { binding: 6, resource: { buffer: this._scrollOffsetBindBuffer } }
    ];
  }
  constructor(e, t, n, r) {
    super(e, t, n, r), this.type = "viewport", this.wgsl = R3e, this._cellBindBufferLineCapacity = 63, this._activeDoubleBufferIndex = 0, this._visibleObjectCount = 0, this._scrollInitialized = !1, this._onDidChangeBindGroupEntries = this._register(new he()), this.onDidChangeBindGroupEntries = this._onDidChangeBindGroupEntries.event, this._rebuildCellBuffer(this._cellBindBufferLineCapacity);
    const s = 2;
    this._scrollOffsetBindBuffer = this._register($u.createBuffer(this._device, {
      label: "Monaco scroll offset buffer",
      size: s * Float32Array.BYTES_PER_ELEMENT,
      usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
    })).object, this._scrollOffsetValueBuffer = new Float32Array(s);
  }
  _rebuildCellBuffer(e) {
    var r;
    (r = this._cellBindBuffer) == null || r.destroy();
    const t = (Math.floor(
      e / 32
      /* Constants.CellBindBufferCapacityIncrement */
    ) + 1) * 32, n = t * N_.maxSupportedColumns * 6 * Float32Array.BYTES_PER_ELEMENT;
    this._cellBindBuffer = this._register($u.createBuffer(this._device, {
      label: "Monaco full file cell buffer",
      size: n,
      usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
    })).object, this._cellValueBuffers = [
      new ArrayBuffer(n),
      new ArrayBuffer(n)
    ], this._cellBindBufferLineCapacity = t, this._onDidChangeBindGroupEntries.fire();
  }
  // #region Event handlers
  // The primary job of these handlers is to:
  // 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when
  //    it's _within the viewport_.
  // 2. Pass relevant events on to the render function so it can force certain line ranges to be
  //    re-rendered even if they're not in the viewport. For example when a view zone is added,
  //    there are lines that used to be visible but are no longer, so those ranges must be
  //    cleared and uploaded to the GPU.
  onConfigurationChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onTokensChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onScrollChanged(e) {
    const t = rr().devicePixelRatio;
    return this._scrollOffsetValueBuffer[0] = ((e == null ? void 0 : e.scrollLeft) ?? this._context.viewLayout.getCurrentScrollLeft()) * t, this._scrollOffsetValueBuffer[1] = ((e == null ? void 0 : e.scrollTop) ?? this._context.viewLayout.getCurrentScrollTop()) * t, this._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer), !0;
  }
  onThemeChanged(e) {
    return !0;
  }
  onLineMappingChanged(e) {
    return !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  // #endregion
  reset() {
    for (const e of [0, 1]) {
      const t = new Float32Array(this._cellValueBuffers[e]);
      t.fill(0, 0, t.length), this._device.queue.writeBuffer(this._cellBindBuffer, 0, t.buffer, 0, t.byteLength);
    }
  }
  update(e, t) {
    var X;
    let n = "", r, s = 0, o = 0, a = 0, l = 0, c = 0, u = 0, d, h = 0, g = 0, m = 0, _ = 0, v, w, E, L, T, D = 0, N = 0, R;
    const M = rr().devicePixelRatio;
    let B;
    this._scrollInitialized || (this.onScrollChanged(), this._scrollInitialized = !0), this._cellBindBufferLineCapacity < e.endLineNumber - e.startLineNumber + 1 && this._rebuildCellBuffer(e.endLineNumber - e.startLineNumber + 1);
    const H = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);
    H.fill(0);
    const j = N_.maxSupportedColumns * 6;
    for (o = e.startLineNumber; o <= e.endLineNumber; o++)
      if (this._viewGpuContext.canRender(t, e, o)) {
        L = e.getViewLineRenderingData(o), u = 0, B = mU(L, t), s = t.spaceWidth * M, l = 0, R = L.tokens, g = L.minColumn - 1, m = 0;
        for (let Y = 0, G = R.getCount(); Y < G; Y++)
          if (m = R.getEndOffset(Y), !(m <= g)) {
            for (_ = R.getMetadata(Y), a = g; a < m && !(a > N_.maxSupportedColumns); a++) {
              if (r = B.getSegmentAtIndex(a), r === void 0)
                continue;
              n = r, L.isBasicASCII && t.useMonospaceOptimizations || (s = this.glyphRasterizer.getTextMetrics(n).width), w = void 0, v = void 0, E = void 0;
              for (T of L.inlineDecorations) {
                if (o < T.range.startLineNumber || o > T.range.endLineNumber || o === T.range.startLineNumber && a < T.range.startColumn - 1 || o === T.range.endLineNumber && a >= T.range.endColumn - 1)
                  continue;
                const oe = Cc.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, T.inlineClassName);
                for (const Z of oe)
                  for (const pe of Z.style) {
                    const J = ((X = Z.styleMap.get(pe)) == null ? void 0 : X.toString()) ?? "";
                    switch (pe) {
                      case "color": {
                        const ae = De.Format.CSS.parse(J);
                        if (!ae)
                          throw new Wt("Invalid color format " + J);
                        w = ae.toNumber32Bit();
                        break;
                      }
                      case "font-weight": {
                        Eht(J) >= 400 ? v = !0 : v = !1;
                        break;
                      }
                      case "opacity": {
                        E = xht(J);
                        break;
                      }
                      default:
                        throw new Wt("Unexpected inline decoration style");
                    }
                  }
              }
              if (n === " " || n === "	") {
                if (h = ((o - 1) * N_.maxSupportedColumns + a) * 6, H.fill(
                  0,
                  h,
                  h + 6
                  /* CellBufferInfo.FloatsPerEntry */
                ), n === "	") {
                  const oe = a + u;
                  u = As.nextRenderTabStop(a + u, L.tabSize), l += s * (u - oe), u -= a + 1;
                } else
                  l += s;
                continue;
              }
              const Q = Cc.decorationStyleCache.getOrCreateEntry(w, v, E);
              d = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, n, _, Q, l), c = Math.round(
                // Top of layout box (includes line height)
                e.relativeVerticalOffset[o - e.startLineNumber] * M + // Delta from top of layout box (includes line height) to top of the inline box (no line height)
                Math.floor((e.lineHeight * M - (d.fontBoundingBoxAscent + d.fontBoundingBoxDescent)) / 2) + // Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn
                // with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical
                // baseline.
                d.fontBoundingBoxAscent
              ), h = ((o - e.startLineNumber) * N_.maxSupportedColumns + a) * 6, H[
                h + 0
                /* CellBufferInfo.Offset_X */
              ] = Math.floor(l), H[
                h + 1
                /* CellBufferInfo.Offset_Y */
              ] = c, H[
                h + 4
                /* CellBufferInfo.GlyphIndex */
              ] = d.glyphIndex, H[
                h + 5
                /* CellBufferInfo.TextureIndex */
              ] = d.pageIndex, l += s;
            }
            g = m;
          }
        D = ((o - e.startLineNumber) * N_.maxSupportedColumns + m) * 6, N = (o - e.startLineNumber) * N_.maxSupportedColumns * 6, H.fill(0, D, N);
      }
    const K = (e.endLineNumber - e.startLineNumber + 1) * j;
    return this._device.queue.writeBuffer(this._cellBindBuffer, 0, H.buffer, 0, (e.endLineNumber - e.startLineNumber) * j * Float32Array.BYTES_PER_ELEMENT), this._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1, this._visibleObjectCount = K, K;
  }
  draw(e, t) {
    if (this._visibleObjectCount <= 0)
      throw new Wt("Attempt to draw 0 objects");
    e.draw(Hx.length / 2, this._visibleObjectCount);
  }
};
N_.maxSupportedColumns = 2e3;
let ure = N_;
function Eht(i) {
  switch (i) {
    case "lighter":
    case "normal":
      return 400;
    case "bolder":
    case "bold":
      return 700;
  }
  return parseInt(i);
}
function xht(i) {
  return i.endsWith("%") ? parseFloat(i.substring(0, i.length - 1)) / 100 : i.match(/^\d+(?:\.\d*)/) ? parseFloat(i) : 1;
}
const ul = class ul extends N3e {
  get bindGroupEntries() {
    return [
      { binding: 1, resource: { buffer: this._cellBindBuffer } },
      { binding: 6, resource: { buffer: this._scrollOffsetBindBuffer } }
    ];
  }
  constructor(e, t, n, r) {
    super(e, t, n, r), this.type = "fullfile", this.wgsl = R3e, this._activeDoubleBufferIndex = 0, this._upToDateLines = [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()], this._visibleObjectCount = 0, this._finalRenderedLine = 0, this._scrollInitialized = !1, this._queuedBufferUpdates = [[], []];
    const s = ul.maxSupportedLines * ul.maxSupportedColumns * 6 * Float32Array.BYTES_PER_ELEMENT;
    this._cellBindBuffer = this._register($u.createBuffer(this._device, {
      label: "Monaco full file cell buffer",
      size: s,
      usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
    })).object, this._cellValueBuffers = [
      new ArrayBuffer(s),
      new ArrayBuffer(s)
    ];
    const o = 2;
    this._scrollOffsetBindBuffer = this._register($u.createBuffer(this._device, {
      label: "Monaco scroll offset buffer",
      size: o * Float32Array.BYTES_PER_ELEMENT,
      usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
    })).object, this._scrollOffsetValueBuffer = new Float32Array(o);
  }
  // #region Event handlers
  // The primary job of these handlers is to:
  // 1. Invalidate the up to date line cache, which will cause the line to be re-rendered when
  //    it's _within the viewport_.
  // 2. Pass relevant events on to the render function so it can force certain line ranges to be
  //    re-rendered even if they're not in the viewport. For example when a view zone is added,
  //    there are lines that used to be visible but are no longer, so those ranges must be
  //    cleared and uploaded to the GPU.
  onConfigurationChanged(e) {
    return this._invalidateAllLines(), this._queueBufferUpdate(e), !0;
  }
  onDecorationsChanged(e) {
    return this._invalidateAllLines(), !0;
  }
  onTokensChanged(e) {
    for (const t of e.ranges)
      this._invalidateLineRange(t.fromLineNumber, t.toLineNumber);
    return !0;
  }
  onLinesDeleted(e) {
    return this._invalidateLinesFrom(e.fromLineNumber), this._queueBufferUpdate(e), !0;
  }
  onLinesInserted(e) {
    return this._invalidateLinesFrom(e.fromLineNumber), !0;
  }
  onLinesChanged(e) {
    return this._invalidateLineRange(e.fromLineNumber, e.fromLineNumber + e.count), !0;
  }
  onScrollChanged(e) {
    const t = rr().devicePixelRatio;
    return this._scrollOffsetValueBuffer[0] = ((e == null ? void 0 : e.scrollLeft) ?? this._context.viewLayout.getCurrentScrollLeft()) * t, this._scrollOffsetValueBuffer[1] = ((e == null ? void 0 : e.scrollTop) ?? this._context.viewLayout.getCurrentScrollTop()) * t, this._device.queue.writeBuffer(this._scrollOffsetBindBuffer, 0, this._scrollOffsetValueBuffer), !0;
  }
  onThemeChanged(e) {
    return this._invalidateAllLines(), !0;
  }
  onLineMappingChanged(e) {
    return this._invalidateAllLines(), this._queueBufferUpdate(e), !0;
  }
  onZonesChanged(e) {
    return this._invalidateAllLines(), this._queueBufferUpdate(e), !0;
  }
  // #endregion
  _invalidateAllLines() {
    this._upToDateLines[0].clear(), this._upToDateLines[1].clear();
  }
  _invalidateLinesFrom(e) {
    for (const t of [0, 1]) {
      const n = this._upToDateLines[t];
      for (const r of n)
        r >= e && n.delete(r);
    }
  }
  _invalidateLineRange(e, t) {
    for (let n = e; n <= t; n++)
      this._upToDateLines[0].delete(n), this._upToDateLines[1].delete(n);
  }
  reset() {
    this._invalidateAllLines();
    for (const e of [0, 1]) {
      const t = new Float32Array(this._cellValueBuffers[e]);
      t.fill(0, 0, t.length), this._device.queue.writeBuffer(this._cellBindBuffer, 0, t.buffer, 0, t.byteLength);
    }
    this._finalRenderedLine = 0;
  }
  update(e, t) {
    var oe;
    let n = "", r, s = 0, o = 0, a = 0, l = 0, c = 0, u = 0, d, h = 0, g = 0, m = 0, _ = 0, v, w, E, L, T, D = 0, N = 0, R;
    const M = rr().devicePixelRatio;
    let B;
    this._scrollInitialized || (this.onScrollChanged(), this._scrollInitialized = !0);
    const H = new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]), j = ul.maxSupportedColumns * 6, K = this._upToDateLines[this._activeDoubleBufferIndex];
    let X = 3e3, Y = 0;
    const G = this._queuedBufferUpdates[this._activeDoubleBufferIndex];
    for (; G.length; ) {
      const Z = G.shift();
      switch (Z.type) {
        // TODO: Refine these cases so we're not throwing away everything
        case 2:
        case 8:
        case 17: {
          H.fill(0), X = 1, Y = Math.max(Y, this._finalRenderedLine), this._finalRenderedLine = 0;
          break;
        }
        case 10: {
          const pe = (Z.fromLineNumber - 1) * ul.maxSupportedColumns * 6, J = Z.toLineNumber * ul.maxSupportedColumns * 6, ae = (this._finalRenderedLine - (Z.toLineNumber - Z.fromLineNumber + 1)) * ul.maxSupportedColumns * 6;
          H.set(H.subarray(J), pe), H.fill(0, ae), X = Math.min(X, Z.fromLineNumber), Y = Math.max(Y, this._finalRenderedLine), this._finalRenderedLine -= Z.toLineNumber - Z.fromLineNumber + 1;
          break;
        }
      }
    }
    for (o = e.startLineNumber; o <= e.endLineNumber; o++) {
      if (!this._viewGpuContext.canRender(t, e, o)) {
        D = (o - 1) * ul.maxSupportedColumns * 6, N = o * ul.maxSupportedColumns * 6, H.fill(0, D, N), X = Math.min(X, o), Y = Math.max(Y, o);
        continue;
      }
      if (!K.has(o)) {
        X = Math.min(X, o), Y = Math.max(Y, o), L = e.getViewLineRenderingData(o), u = 0, B = mU(L, t), s = t.spaceWidth * M, l = 0, R = L.tokens, g = L.minColumn - 1, m = 0;
        for (let Z = 0, pe = R.getCount(); Z < pe; Z++)
          if (m = R.getEndOffset(Z), !(m <= g)) {
            for (_ = R.getMetadata(Z), a = g; a < m && !(a > ul.maxSupportedColumns); a++) {
              if (r = B.getSegmentAtIndex(a), r === void 0)
                continue;
              n = r, L.isBasicASCII && t.useMonospaceOptimizations || (s = this.glyphRasterizer.getTextMetrics(n).width), w = void 0, v = void 0, E = void 0;
              for (T of L.inlineDecorations) {
                if (o < T.range.startLineNumber || o > T.range.endLineNumber || o === T.range.startLineNumber && a < T.range.startColumn - 1 || o === T.range.endLineNumber && a >= T.range.endColumn - 1)
                  continue;
                const ae = Cc.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode, T.inlineClassName);
                for (const be of ae)
                  for (const re of be.style) {
                    const ze = ((oe = be.styleMap.get(re)) == null ? void 0 : oe.toString()) ?? "";
                    switch (re) {
                      case "color": {
                        const Ve = De.Format.CSS.parse(ze);
                        if (!Ve)
                          throw new Wt("Invalid color format " + ze);
                        w = Ve.toNumber32Bit();
                        break;
                      }
                      case "font-weight": {
                        Lht(ze) >= 400 ? v = !0 : v = !1;
                        break;
                      }
                      case "opacity": {
                        E = Tht(ze);
                        break;
                      }
                      default:
                        throw new Wt("Unexpected inline decoration style");
                    }
                  }
              }
              if (n === " " || n === "	") {
                if (h = ((o - 1) * ul.maxSupportedColumns + a) * 6, H.fill(
                  0,
                  h,
                  h + 6
                  /* CellBufferInfo.FloatsPerEntry */
                ), n === "	") {
                  const ae = a + u;
                  u = As.nextRenderTabStop(a + u, L.tabSize), l += s * (u - ae), u -= a + 1;
                } else
                  l += s;
                continue;
              }
              const J = Cc.decorationStyleCache.getOrCreateEntry(w, v, E);
              d = this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer, n, _, J, l), c = Math.round(
                // Top of layout box (includes line height)
                e.relativeVerticalOffset[o - e.startLineNumber] * M + // Delta from top of layout box (includes line height) to top of the inline box (no line height)
                Math.floor((e.lineHeight * M - (d.fontBoundingBoxAscent + d.fontBoundingBoxDescent)) / 2) + // Delta from top of inline box (no line height) to top of glyph origin. If the glyph was drawn
                // with a top baseline for example, this ends up drawing the glyph correctly using the alphabetical
                // baseline.
                d.fontBoundingBoxAscent
              ), h = ((o - 1) * ul.maxSupportedColumns + a) * 6, H[
                h + 0
                /* CellBufferInfo.Offset_X */
              ] = Math.floor(l), H[
                h + 1
                /* CellBufferInfo.Offset_Y */
              ] = c, H[
                h + 4
                /* CellBufferInfo.GlyphIndex */
              ] = d.glyphIndex, H[
                h + 5
                /* CellBufferInfo.TextureIndex */
              ] = d.pageIndex, l += s;
            }
            g = m;
          }
        D = ((o - 1) * ul.maxSupportedColumns + m) * 6, N = o * ul.maxSupportedColumns * 6, H.fill(0, D, N), K.add(o);
      }
    }
    const Q = (e.endLineNumber - e.startLineNumber + 1) * j;
    return X = Math.min(X, ul.maxSupportedLines), Y = Math.min(Y, ul.maxSupportedLines), X <= Y && this._device.queue.writeBuffer(this._cellBindBuffer, (X - 1) * j * Float32Array.BYTES_PER_ELEMENT, H.buffer, (X - 1) * j * Float32Array.BYTES_PER_ELEMENT, (Y - X + 1) * j * Float32Array.BYTES_PER_ELEMENT), this._finalRenderedLine = Math.max(this._finalRenderedLine, Y), this._activeDoubleBufferIndex = this._activeDoubleBufferIndex ? 0 : 1, this._visibleObjectCount = Q, Q;
  }
  draw(e, t) {
    if (this._visibleObjectCount <= 0)
      throw new Wt("Attempt to draw 0 objects");
    e.draw(Hx.length / 2, this._visibleObjectCount, void 0, (t.startLineNumber - 1) * ul.maxSupportedColumns);
  }
  /**
   * Queue updates that need to happen on the active buffer, not just the cache. This will be
   * deferred to when the actual cell buffer is changed since the active buffer could be locked by
   * the GPU which would block the main thread.
   */
  _queueBufferUpdate(e) {
    this._queuedBufferUpdates[0].push(e), this._queuedBufferUpdates[1].push(e);
  }
};
ul.maxSupportedLines = 3e3, ul.maxSupportedColumns = 200;
let WE = ul;
function Lht(i) {
  switch (i) {
    case "lighter":
    case "normal":
      return 400;
    case "bolder":
    case "bold":
      return 700;
  }
  return parseInt(i);
}
function Tht(i) {
  return i.endsWith("%") ? parseFloat(i.substring(0, i.length - 1)) / 100 : i.match(/^\d+(?:\.\d*)/) ? parseFloat(i) : 1;
}
var kht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, JLe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let dre = class extends fu {
  constructor(e, t, n, r) {
    super(e), this._viewGpuContext = t, this._instantiationService = n, this._logService = r, this._atlasGpuTextureVersions = [], this._initialized = !1, this._glyphRasterizer = this._register(new er()), this._renderStrategy = this._register(new er()), this.canvas = this._viewGpuContext.canvas.domNode, this._register(Xt((s) => {
      this._viewGpuContext.canvasDevicePixelDimensions.read(s);
      const o = this._lastViewportData;
      o && setTimeout(() => {
        o === this._lastViewportData && this.renderText(o);
      });
    })), this.initWebgpu();
  }
  async initWebgpu() {
    if (this._device = Cc.deviceSync || await Cc.device, this._store.isDisposed)
      return;
    const e = Cc.atlas;
    this._register(e.onDidDeleteGlyphs(() => {
      this._atlasGpuTextureVersions.length = 0, this._atlasGpuTextureVersions[0] = 0, this._atlasGpuTextureVersions[1] = 0, this._renderStrategy.value.reset();
    }));
    const t = navigator.gpu.getPreferredCanvasFormat();
    this._viewGpuContext.ctx.configure({
      device: this._device,
      format: t,
      alphaMode: "premultiplied"
    }), this._renderPassColorAttachment = {
      view: null,
      // Will be filled at render time
      loadOp: "load",
      storeOp: "store"
    }, this._renderPassDescriptor = {
      label: "Monaco render pass",
      colorAttachments: [this._renderPassColorAttachment]
    };
    let n;
    {
      const l = new Float32Array(
        6
        /* Info.FloatsPerEntry */
      ), c = (u = this.canvas.width, d = this.canvas.height) => (l[
        0
        /* Info.Offset_CanvasWidth____ */
      ] = u, l[
        1
        /* Info.Offset_CanvasHeight___ */
      ] = d, l[
        2
        /* Info.Offset_ViewportOffsetX */
      ] = Math.ceil(this._context.configuration.options.get(
        165
        /* EditorOption.layoutInfo */
      ).contentLeft * rr().devicePixelRatio), l[
        3
        /* Info.Offset_ViewportOffsetY */
      ] = 0, l[
        4
        /* Info.Offset_ViewportWidth__ */
      ] = l[
        0
        /* Info.Offset_CanvasWidth____ */
      ] - l[
        2
        /* Info.Offset_ViewportOffsetX */
      ], l[
        5
        /* Info.Offset_ViewportHeight_ */
      ] = l[
        1
        /* Info.Offset_CanvasHeight___ */
      ] - l[
        3
        /* Info.Offset_ViewportOffsetY */
      ], l);
      n = this._register($u.createBuffer(this._device, {
        label: "Monaco uniform buffer",
        size: 24,
        usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
      }, () => c())).object, this._register(rm(this._viewGpuContext.canvasDevicePixelDimensions, ({ width: u, height: d }) => {
        this._device.queue.writeBuffer(n, 0, c(u, d));
      })), this._register(rm(this._viewGpuContext.contentLeft, () => {
        this._device.queue.writeBuffer(n, 0, c());
      }));
    }
    let r;
    r = this._register($u.createBuffer(this._device, {
      label: "Monaco atlas info uniform buffer",
      size: 8,
      usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
    }, () => {
      const l = new Float32Array(
        2
        /* Info.FloatsPerEntry */
      );
      return l[
        0
        /* Info.Offset_Width_ */
      ] = e.pageSize, l[
        1
        /* Info.Offset_Height */
      ] = e.pageSize, l;
    })).object;
    const s = this._context.configuration.options.get(
      58
      /* EditorOption.fontFamily */
    ), o = this._context.configuration.options.get(
      61
      /* EditorOption.fontSize */
    );
    this._glyphRasterizer.value = this._register(new I4(o, s, this._viewGpuContext.devicePixelRatio.get(), Cc.decorationStyleCache)), this._register(rm(this._viewGpuContext.devicePixelRatio, () => {
      this._refreshGlyphRasterizer();
    })), this._renderStrategy.value = this._instantiationService.createInstance(WE, this._context, this._viewGpuContext, this._device, this._glyphRasterizer), this._glyphStorageBuffer = this._register($u.createBuffer(this._device, {
      label: "Monaco glyph storage buffer",
      size: c1.maximumPageCount * (Up.maximumGlyphCount * 24),
      usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST
    })).object, this._atlasGpuTextureVersions[0] = 0, this._atlasGpuTextureVersions[1] = 0, this._atlasGpuTexture = this._register($u.createTexture(this._device, {
      label: "Monaco atlas texture",
      format: "rgba8unorm",
      size: { width: e.pageSize, height: e.pageSize, depthOrArrayLayers: c1.maximumPageCount },
      dimension: "2d",
      usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT
    })).object, this._updateAtlasStorageBufferAndTexture(), this._vertexBuffer = this._register($u.createBuffer(this._device, {
      label: "Monaco vertex buffer",
      size: Hx.byteLength,
      usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST
    }, Hx)).object;
    const a = this._device.createShaderModule({
      label: "Monaco shader module",
      code: this._renderStrategy.value.wgsl
    });
    if (this._pipeline = this._device.createRenderPipeline({
      label: "Monaco render pipeline",
      layout: "auto",
      vertex: {
        module: a,
        buffers: [
          {
            arrayStride: 2 * Float32Array.BYTES_PER_ELEMENT,
            // 2 floats, 4 bytes each
            attributes: [
              { shaderLocation: 0, offset: 0, format: "float32x2" }
              // position
            ]
          }
        ]
      },
      fragment: {
        module: a,
        targets: [
          {
            format: t,
            blend: {
              color: {
                srcFactor: "src-alpha",
                dstFactor: "one-minus-src-alpha"
              },
              alpha: {
                srcFactor: "src-alpha",
                dstFactor: "one-minus-src-alpha"
              }
            }
          }
        ]
      }
    }), this._rebuildBindGroup = () => {
      this._bindGroup = this._device.createBindGroup({
        label: "Monaco bind group",
        layout: this._pipeline.getBindGroupLayout(0),
        entries: [
          // TODO: Pass in generically as array?
          { binding: 0, resource: { buffer: this._glyphStorageBuffer } },
          {
            binding: 2,
            resource: this._device.createSampler({
              label: "Monaco atlas sampler",
              magFilter: "nearest",
              minFilter: "nearest"
            })
          },
          { binding: 3, resource: this._atlasGpuTexture.createView() },
          { binding: 4, resource: { buffer: n } },
          { binding: 5, resource: { buffer: r } },
          ...this._renderStrategy.value.bindGroupEntries
        ]
      });
    }, this._rebuildBindGroup(), this._initialized = !0, this._initViewportData) {
      for (const l of this._initViewportData)
        this.renderText(l);
      this._initViewportData = void 0;
    }
  }
  _refreshRenderStrategy(e) {
    var n, r;
    if (((n = this._renderStrategy.value) == null ? void 0 : n.type) === "viewport" || e.endLineNumber < WE.maxSupportedLines && this._viewportMaxColumn(e) < WE.maxSupportedColumns)
      return;
    this._logService.trace(`File is larger than ${WE.maxSupportedLines} lines or ${WE.maxSupportedColumns} columns, switching to viewport render strategy`);
    const t = this._instantiationService.createInstance(ure, this._context, this._viewGpuContext, this._device, this._glyphRasterizer);
    this._renderStrategy.value = t, this._register(t.onDidChangeBindGroupEntries(() => {
      var s;
      return (s = this._rebuildBindGroup) == null ? void 0 : s.call(this);
    })), (r = this._rebuildBindGroup) == null || r.call(this);
  }
  _viewportMaxColumn(e) {
    let t = 0, n;
    for (let r = e.startLineNumber; r <= e.endLineNumber; r++)
      n = e.getViewLineRenderingData(r), t = Math.max(t, n.maxColumn);
    return t;
  }
  _updateAtlasStorageBufferAndTexture() {
    for (const [e, t] of Cc.atlas.pages.entries()) {
      if (e >= c1.maximumPageCount) {
        console.log(`Attempt to upload atlas page [${e}], only ${c1.maximumPageCount} are supported currently`);
        continue;
      }
      if (t.version === this._atlasGpuTextureVersions[e])
        continue;
      this._logService.trace("Updating atlas page[", e, "] from version ", this._atlasGpuTextureVersions[e], " to version ", t.version);
      const n = 6 * Up.maximumGlyphCount, r = new Float32Array(n);
      let s = 0;
      for (const o of t.glyphs)
        r[
          s + 0
          /* GlyphStorageBufferInfo.Offset_TexturePosition */
        ] = o.x, r[s + 0 + 1] = o.y, r[
          s + 2
          /* GlyphStorageBufferInfo.Offset_TextureSize */
        ] = o.w, r[s + 2 + 1] = o.h, r[
          s + 4
          /* GlyphStorageBufferInfo.Offset_OriginPosition */
        ] = o.originOffsetX, r[s + 4 + 1] = o.originOffsetY, s += 6;
      if (s / 6 > Up.maximumGlyphCount)
        throw new Error(`Attempting to write more glyphs (${s / 6}) than the GPUBuffer can hold (${Up.maximumGlyphCount})`);
      this._device.queue.writeBuffer(this._glyphStorageBuffer, e * 6 * Up.maximumGlyphCount * Float32Array.BYTES_PER_ELEMENT, r, 0, 6 * Up.maximumGlyphCount), t.usedArea.right - t.usedArea.left > 0 && t.usedArea.bottom - t.usedArea.top > 0 && this._device.queue.copyExternalImageToTexture({ source: t.source }, {
        texture: this._atlasGpuTexture,
        origin: {
          x: t.usedArea.left,
          y: t.usedArea.top,
          z: e
        }
      }, {
        width: t.usedArea.right - t.usedArea.left + 1,
        height: t.usedArea.bottom - t.usedArea.top + 1
      }), this._atlasGpuTextureVersions[e] = t.version;
    }
  }
  prepareRender(e) {
    throw new Wt("Should not be called");
  }
  render(e) {
    throw new Wt("Should not be called");
  }
  // #region Event handlers
  // Since ViewLinesGpu currently coordinates rendering to the canvas, it must listen to all
  // changed events that any GPU part listens to. This is because any drawing to the canvas will
  // clear it for that frame, so all parts must be rendered every time.
  //
  // Additionally, since this is intrinsically linked to ViewLines, it must also listen to events
  // from that side. Luckily rendering is cheap, it's only when uploaded data changes does it
  // start to cost.
  onConfigurationChanged(e) {
    return this._refreshGlyphRasterizer(), !0;
  }
  onCursorStateChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onLineMappingChanged(e) {
    return !0;
  }
  onRevealRangeRequest(e) {
    return !0;
  }
  onScrollChanged(e) {
    return !0;
  }
  onThemeChanged(e) {
    return !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  // #endregion
  _refreshGlyphRasterizer() {
    const e = this._glyphRasterizer.value;
    if (!e)
      return;
    const t = this._context.configuration.options.get(
      58
      /* EditorOption.fontFamily */
    ), n = this._context.configuration.options.get(
      61
      /* EditorOption.fontSize */
    ), r = this._viewGpuContext.devicePixelRatio.get();
    (e.fontFamily !== t || e.fontSize !== n || e.devicePixelRatio !== r) && (this._glyphRasterizer.value = new I4(n, t, r, Cc.decorationStyleCache));
  }
  renderText(e) {
    if (this._initialized)
      return this._refreshRenderStrategy(e), this._renderText(e);
    this._initViewportData = this._initViewportData ?? [], this._initViewportData.push(e);
  }
  _renderText(e) {
    this._viewGpuContext.rectangleRenderer.draw(e);
    const t = new cU(this._context.configuration, this._context.theme.type);
    this._renderStrategy.value.update(e, t), this._updateAtlasStorageBufferAndTexture();
    const n = this._device.createCommandEncoder({ label: "Monaco command encoder" });
    this._renderPassColorAttachment.view = this._viewGpuContext.ctx.getCurrentTexture().createView({ label: "Monaco canvas texture view" });
    const r = n.beginRenderPass(this._renderPassDescriptor);
    r.setPipeline(this._pipeline), r.setVertexBuffer(0, this._vertexBuffer);
    const s = Math.ceil(this._viewGpuContext.contentLeft.get() * this._viewGpuContext.devicePixelRatio.get());
    r.setScissorRect(s, 0, this.canvas.width - s, this.canvas.height), r.setBindGroup(0, this._bindGroup), this._renderStrategy.value.draw(r, e), r.end();
    const o = n.finish();
    this._device.queue.submit([o]), this._lastViewportData = e, this._lastViewLineOptions = t;
  }
  linesVisibleRangesForRange(e, t) {
    if (!this._lastViewportData)
      return null;
    const n = e.endLineNumber, r = z.intersectRanges(e, this._lastViewportData.visibleRange);
    if (!r)
      return null;
    const s = this._lastViewportData.startLineNumber, o = this._lastViewportData.endLineNumber, a = this._lastViewportData, l = this._lastViewLineOptions;
    if (!a || !l)
      return null;
    const c = [];
    let u = 0;
    t && (u = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new de(r.startLineNumber, 1)).lineNumber);
    for (let d = r.startLineNumber; d <= r.endLineNumber; d++) {
      if (d < s || d > o)
        continue;
      const h = d === r.startLineNumber ? r.startColumn : 1, g = d !== n, m = g ? this._context.viewModel.getLineMaxColumn(d) : r.endColumn, _ = this._visibleRangesForLineRange(d, h, m);
      if (_) {
        if (t && d < n) {
          const v = u;
          u = this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new de(d + 1, 1)).lineNumber, v !== u && (_.ranges[_.ranges.length - 1].width += l.spaceWidth);
        }
        c.push(new GFe(_.outsideRenderedLine, d, xB.from(_.ranges), g));
      }
    }
    return c.length === 0 ? null : c;
  }
  _visibleRangesForLineRange(e, t, n) {
    if (this.shouldRender())
      return null;
    const r = this._lastViewportData, s = this._lastViewLineOptions;
    if (!r || !s || e < r.startLineNumber || e > r.endLineNumber)
      return null;
    const o = r.getViewLineRenderingData(e), a = o.content;
    let l;
    o.isBasicASCII && s.useMonospaceOptimizations || (l = mU(o, s));
    let c = "", u = 0, d = 0;
    for (let _ = 0; _ < t - 1; _++) {
      if (o.isBasicASCII && s.useMonospaceOptimizations)
        c = a.charAt(_);
      else {
        if (c = l.getSegmentAtIndex(_), c === void 0)
          continue;
        d += this._renderStrategy.value.glyphRasterizer.getTextMetrics(c).width / rr().devicePixelRatio - s.spaceWidth;
      }
      c === "	" ? u = As.nextRenderTabStop(u, o.tabSize) : u++;
    }
    let h = u, g = 0;
    for (let _ = t - 1; _ < n - 1; _++) {
      if (o.isBasicASCII && s.useMonospaceOptimizations)
        c = a.charAt(_);
      else {
        if (c = l.getSegmentAtIndex(_), c === void 0)
          continue;
        g += this._renderStrategy.value.glyphRasterizer.getTextMetrics(c).width / rr().devicePixelRatio - s.spaceWidth;
      }
      c === "	" ? h = As.nextRenderTabStop(h, o.tabSize) : h++;
    }
    return new qie(!1, [
      new k1(u * s.spaceWidth + d, (h - u) * s.spaceWidth + g)
    ]);
  }
  visibleRangeForPosition(e) {
    const t = this._visibleRangesForLineRange(e.lineNumber, e.column, e.column);
    return t ? new qFe(t.outsideRenderedLine, t.ranges[0].left) : null;
  }
  getLineWidth(e) {
    if (!this._lastViewportData || !this._lastViewLineOptions || !this._viewGpuContext.canRender(this._lastViewLineOptions, this._lastViewportData, e))
      return;
    const t = this._lastViewportData.getViewLineRenderingData(e), n = this._visibleRangesForLineRange(e, 1, t.maxColumn), r = n == null ? void 0 : n.ranges.at(-1);
    if (r)
      return r.width;
  }
  getPositionAtCoordinate(e, t) {
    if (!this._lastViewportData || !this._lastViewLineOptions || !this._viewGpuContext.canRender(this._lastViewLineOptions, this._lastViewportData, e))
      return;
    const n = this._lastViewportData.getViewLineRenderingData(e), r = n.content, s = rr().devicePixelRatio, o = t * s, a = this._lastViewLineOptions.spaceWidth * s, l = mU(n, this._lastViewLineOptions);
    let c = 0, u = 0, d = 0, h = 0;
    for (let g = 0; g < r.length; g++) {
      const m = l.getSegmentAtIndex(g);
      if (m === void 0) {
        h++;
        continue;
      }
      if (m === "	") {
        const _ = g + d;
        d = As.nextRenderTabStop(g + d, n.tabSize), u = a * (d - _), d -= g + 1;
      } else n.isBasicASCII && this._lastViewLineOptions.useMonospaceOptimizations ? u = a : u = this._renderStrategy.value.glyphRasterizer.getTextMetrics(m).width;
      if (o < c + u / 2)
        break;
      c += u, h++;
    }
    return new de(e, h + 1);
  }
};
dre = kht([
  JLe(2, xt),
  JLe(3, $r)
], dre);
class Dht {
  constructor() {
    this._onDidChange = new he(), this.onDidChange = this._onDidChange.event, this._enabled = !0;
  }
  get enabled() {
    return this._enabled;
  }
  /**
   * Enable IME
   */
  enable() {
    this._enabled = !0, this._onDidChange.fire();
  }
  /**
   * Disable IME
   */
  disable() {
    this._enabled = !1, this._onDidChange.fire();
  }
}
const sb = new Dht(), Fi = Vn("keybindingService");
class A3e extends fu {
}
class O3e {
  _getPageOfLine(e, t) {
    return Math.floor((e - 1) / t);
  }
  _getRangeForPage(e, t) {
    const n = e * t, r = n + 1, s = n + t;
    return new z(r, 1, s + 1, 1);
  }
  fromEditorSelection(e, t, n, r) {
    const o = this._getPageOfLine(t.startLineNumber, n), a = this._getRangeForPage(o, n), l = this._getPageOfLine(t.endLineNumber, n), c = this._getRangeForPage(l, n);
    let u = a.intersectRanges(new z(1, 1, t.startLineNumber, t.startColumn));
    if (r && e.getValueLengthInRange(
      u,
      1
      /* EndOfLinePreference.LF */
    ) > 500) {
      const L = e.modifyPosition(u.getEndPosition(), -500);
      u = z.fromPositions(L, u.getEndPosition());
    }
    const d = e.getValueInRange(
      u,
      1
      /* EndOfLinePreference.LF */
    ), h = e.getLineCount(), g = e.getLineMaxColumn(h);
    let m = c.intersectRanges(new z(t.endLineNumber, t.endColumn, h, g));
    if (r && e.getValueLengthInRange(
      m,
      1
      /* EndOfLinePreference.LF */
    ) > 500) {
      const L = e.modifyPosition(m.getStartPosition(), 500);
      m = z.fromPositions(m.getStartPosition(), L);
    }
    const _ = e.getValueInRange(
      m,
      1
      /* EndOfLinePreference.LF */
    );
    let v;
    if (o === l || o + 1 === l)
      v = e.getValueInRange(
        t,
        1
        /* EndOfLinePreference.LF */
      );
    else {
      const L = a.intersectRanges(t), T = c.intersectRanges(t);
      v = e.getValueInRange(
        L,
        1
        /* EndOfLinePreference.LF */
      ) + "…" + e.getValueInRange(
        T,
        1
        /* EndOfLinePreference.LF */
      );
    }
    r && v.length > 2 * 500 && (v = v.substring(0, 500) + "…" + v.substring(v.length - 500, v.length));
    let w, E;
    return t.getDirection() === 0 ? (w = d.length, E = d.length + v.length) : (E = d.length, w = d.length + v.length), {
      value: d + v + _,
      selection: t,
      selectionStart: w,
      selectionEnd: E,
      startPositionWithinEditor: u.getStartPosition(),
      newlineCountBeforeSelection: u.endLineNumber - u.startLineNumber
    };
  }
}
function hre(i, e) {
  var n, r, s;
  if (i.get(
    2
    /* EditorOption.accessibilitySupport */
  ) === 1) {
    const o = (n = e.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")) == null ? void 0 : n.getAriaLabel(), a = (r = e.lookupKeybinding("workbench.action.showCommands")) == null ? void 0 : r.getAriaLabel(), l = (s = e.lookupKeybinding("workbench.action.openGlobalKeybindings")) == null ? void 0 : s.getAriaLabel(), c = S(56, "The editor is not accessible at this time.");
    return o ? S(57, "{0} To enable screen reader optimized mode, use {1}", c, o) : a ? S(58, "{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.", c, a) : l ? S(59, "{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.", c, l) : c;
  }
  return i.get(
    8
    /* EditorOption.ariaLabel */
  );
}
function eTe(i) {
  let e = 0, t = -1;
  do {
    if (t = i.indexOf(`
`, t + 1), t === -1)
      break;
    e++;
  } while (!0);
  return e;
}
var Iht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, tTe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class Nht {
  constructor(e, t, n, r, s) {
    this._context = e, this.modelLineNumber = t, this.distanceToModelLineStart = n, this.widthOfHiddenLineTextBefore = r, this.distanceToModelLineEnd = s, this._visibleTextAreaBrand = void 0, this.startPosition = null, this.endPosition = null, this.visibleTextareaStart = null, this.visibleTextareaEnd = null, this._previousPresentation = null;
  }
  prepareRender(e) {
    const t = new de(this.modelLineNumber, this.distanceToModelLineStart + 1), n = new de(this.modelLineNumber, this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber) - this.distanceToModelLineEnd);
    this.startPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t), this.endPosition = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n), this.startPosition.lineNumber === this.endPosition.lineNumber ? (this.visibleTextareaStart = e.visibleRangeForPosition(this.startPosition), this.visibleTextareaEnd = e.visibleRangeForPosition(this.endPosition)) : (this.visibleTextareaStart = null, this.visibleTextareaEnd = null);
  }
  definePresentation(e) {
    return this._previousPresentation || (e ? this._previousPresentation = e : this._previousPresentation = {
      foreground: 1,
      italic: !1,
      bold: !1,
      underline: !1,
      strikethrough: !1
    }), this._previousPresentation;
  }
}
const aee = Zu;
let fre = class extends A3e {
  constructor(e, t, n, r, s, o) {
    super(e), this._keybindingService = s, this._instantiationService = o, this._primaryCursorPosition = new de(1, 1), this._primaryCursorVisibleRange = null, this._viewController = n, this._visibleRangeProvider = r, this._scrollLeft = 0, this._scrollTop = 0;
    const a = this._context.configuration.options, l = a.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._setAccessibilityOptions(a), this._contentLeft = l.contentLeft, this._contentWidth = l.contentWidth, this._contentHeight = l.height, this._fontInfo = a.get(
      59
      /* EditorOption.fontInfo */
    ), this._emptySelectionClipboard = a.get(
      45
      /* EditorOption.emptySelectionClipboard */
    ), this._copyWithSyntaxHighlighting = a.get(
      31
      /* EditorOption.copyWithSyntaxHighlighting */
    ), this._visibleTextArea = null, this._selections = [new bt(1, 1, 1, 1)], this._modelSelections = [new bt(1, 1, 1, 1)], this._lastRenderPosition = null, this.textArea = Gi(document.createElement("textarea")), gm.write(
      this.textArea,
      7
      /* PartFingerprint.TextArea */
    ), this.textArea.setClassName(`inputarea ${QN}`), this.textArea.setAttribute("wrap", this._textAreaWrapping && !this._visibleTextArea ? "on" : "off");
    const { tabSize: c } = this._context.viewModel.model.getOptions();
    this.textArea.domNode.style.tabSize = `${c * this._fontInfo.spaceWidth}px`, this.textArea.setAttribute("autocorrect", "off"), this.textArea.setAttribute("autocapitalize", "off"), this.textArea.setAttribute("autocomplete", "off"), this.textArea.setAttribute("spellcheck", "false"), this.textArea.setAttribute("aria-label", hre(a, this._keybindingService)), this.textArea.setAttribute("aria-required", a.get(
      9
      /* EditorOption.ariaRequired */
    ) ? "true" : "false"), this.textArea.setAttribute("tabindex", String(a.get(
      140
      /* EditorOption.tabIndex */
    ))), this.textArea.setAttribute("role", "textbox"), this.textArea.setAttribute("aria-roledescription", S(60, "editor")), this.textArea.setAttribute("aria-multiline", "true"), this.textArea.setAttribute("aria-autocomplete", a.get(
      104
      /* EditorOption.readOnly */
    ) ? "none" : "both"), this._ensureReadOnlyAttribute(), this.textAreaCover = Gi(document.createElement("div")), this.textAreaCover.setPosition("absolute"), t.appendChild(this.textArea), t.appendChild(this.textAreaCover);
    const u = new O3e(), d = {
      getDataToCopy: () => i3e(this._context.viewModel, this._modelSelections, this._emptySelectionClipboard, this._copyWithSyntaxHighlighting),
      getScreenReaderContent: () => {
        if (this._accessibilitySupport === 1) {
          const m = this._selections[0];
          if (Kn && m.isEmpty()) {
            const v = m.getStartPosition();
            let w = this._getWordBeforePosition(v);
            if (w.length === 0 && (w = this._getCharacterBeforePosition(v)), w.length > 0)
              return new vc(w, w.length, w.length, z.fromPositions(v), 0);
          }
          if (Kn && !m.isEmpty() && this._context.viewModel.getValueLengthInRange(
            m,
            0
            /* EndOfLinePreference.TextDefined */
          ) < 500) {
            const v = this._context.viewModel.getValueInRange(
              m,
              0
              /* EndOfLinePreference.TextDefined */
            );
            return new vc(v, 0, v.length, m, 0);
          }
          if (XL && !m.isEmpty()) {
            const v = "vscode-placeholder";
            return new vc(v, 0, v.length, null, void 0);
          }
          return vc.EMPTY;
        }
        if (hxe) {
          const m = this._selections[0];
          if (m.isEmpty()) {
            const _ = m.getStartPosition(), [v, w] = this._getAndroidWordAtPosition(_);
            if (v.length > 0)
              return new vc(v, w, w, z.fromPositions(_), 0);
          }
          return vc.EMPTY;
        }
        const g = u.fromEditorSelection(
          this._context.viewModel,
          this._selections[0],
          this._accessibilityPageSize,
          this._accessibilitySupport === 0
          /* AccessibilitySupport.Unknown */
        );
        return vc.fromScreenReaderContentState(g);
      },
      deduceModelPosition: (g, m, _) => this._context.viewModel.deduceModelPositionRelativeToViewPosition(g, m, _)
    }, h = this._register(new sut(this.textArea.domNode));
    this._textAreaInput = this._register(this._instantiationService.createInstance(Jie, d, h, Ad, {
      isAndroid: hxe,
      isChrome: uB,
      isFirefox: Zu,
      isSafari: XL
    })), this._register(this._textAreaInput.onKeyDown((g) => {
      this._viewController.emitKeyDown(g);
    })), this._register(this._textAreaInput.onKeyUp((g) => {
      this._viewController.emitKeyUp(g);
    })), this._register(this._textAreaInput.onPaste((g) => {
      let m = !1, _ = null, v = null;
      g.metadata && (m = this._emptySelectionClipboard && !!g.metadata.isFromEmptySelection, _ = typeof g.metadata.multicursorText < "u" ? g.metadata.multicursorText : null, v = g.metadata.mode), this._viewController.paste(g.text, m, _, v);
    })), this._register(this._textAreaInput.onCut(() => {
      this._viewController.cut();
    })), this._register(this._textAreaInput.onType((g) => {
      g.replacePrevCharCnt || g.replaceNextCharCnt || g.positionDelta ? this._viewController.compositionType(g.text, g.replacePrevCharCnt, g.replaceNextCharCnt, g.positionDelta) : this._viewController.type(g.text);
    })), this._register(this._textAreaInput.onSelectionChangeRequest((g) => {
      this._viewController.setSelection(g);
    })), this._register(this._textAreaInput.onCompositionStart((g) => {
      const m = this.textArea.domNode, _ = this._modelSelections[0], { distanceToModelLineStart: v, widthOfHiddenTextBefore: w } = (() => {
        const L = m.value.substring(0, Math.min(m.selectionStart, m.selectionEnd)), T = L.lastIndexOf(`
`), D = L.substring(T + 1), N = D.lastIndexOf("	"), R = D.length - N - 1, M = _.getStartPosition(), B = Math.min(M.column - 1, R), H = M.column - 1 - B, j = D.substring(0, D.length - B), { tabSize: K } = this._context.viewModel.model.getOptions(), X = Rht(this.textArea.domNode.ownerDocument, j, this._fontInfo, K);
        return { distanceToModelLineStart: H, widthOfHiddenTextBefore: X };
      })(), { distanceToModelLineEnd: E } = (() => {
        const L = m.value.substring(Math.max(m.selectionStart, m.selectionEnd)), T = L.indexOf(`
`), D = T === -1 ? L : L.substring(0, T), N = D.indexOf("	"), R = N === -1 ? D.length : D.length - N - 1, M = _.getEndPosition(), B = Math.min(this._context.viewModel.model.getLineMaxColumn(M.lineNumber) - M.column, R);
        return { distanceToModelLineEnd: this._context.viewModel.model.getLineMaxColumn(M.lineNumber) - M.column - B };
      })();
      this._context.viewModel.revealRange(
        "keyboard",
        !0,
        z.fromPositions(this._selections[0].getStartPosition()),
        0,
        1
        /* ScrollType.Immediate */
      ), this._visibleTextArea = new Nht(this._context, _.startLineNumber, v, w, E), this.textArea.setAttribute("wrap", this._textAreaWrapping && !this._visibleTextArea ? "on" : "off"), this._visibleTextArea.prepareRender(this._visibleRangeProvider), this._render(), this.textArea.setClassName(`inputarea ${QN} ime-input`), this._viewController.compositionStart(), this._context.viewModel.onCompositionStart();
    })), this._register(this._textAreaInput.onCompositionUpdate((g) => {
      this._visibleTextArea && (this._visibleTextArea.prepareRender(this._visibleRangeProvider), this._render());
    })), this._register(this._textAreaInput.onCompositionEnd(() => {
      this._visibleTextArea = null, this.textArea.setAttribute("wrap", this._textAreaWrapping && !this._visibleTextArea ? "on" : "off"), this._render(), this.textArea.setClassName(`inputarea ${QN}`), this._viewController.compositionEnd(), this._context.viewModel.onCompositionEnd();
    })), this._register(this._textAreaInput.onFocus(() => {
      this._context.viewModel.setHasFocus(!0);
    })), this._register(this._textAreaInput.onBlur(() => {
      this._context.viewModel.setHasFocus(!1);
    })), this._register(sb.onDidChange(() => {
      this._ensureReadOnlyAttribute();
    }));
  }
  get domNode() {
    return this.textArea;
  }
  writeScreenReaderContent(e) {
    this._textAreaInput.writeNativeTextAreaContent(e);
  }
  dispose() {
    super.dispose(), this.textArea.domNode.remove(), this.textAreaCover.domNode.remove();
  }
  _getAndroidWordAtPosition(e) {
    const t = '`~!@#$%^&*()-=+[{]}\\|;:",.<>/?', n = this._context.viewModel.getLineContent(e.lineNumber), r = Yf(t, []);
    let s = !0, o = e.column, a = !0, l = e.column, c = 0;
    for (; c < 50 && (s || a); ) {
      if (s && o <= 1 && (s = !1), s) {
        const u = n.charCodeAt(o - 2);
        r.get(u) !== 0 ? s = !1 : o--;
      }
      if (a && l > n.length && (a = !1), a) {
        const u = n.charCodeAt(l - 1);
        r.get(u) !== 0 ? a = !1 : l++;
      }
      c++;
    }
    return [n.substring(o - 1, l - 1), e.column - o];
  }
  _getWordBeforePosition(e) {
    const t = this._context.viewModel.getLineContent(e.lineNumber), n = Yf(this._context.configuration.options.get(
      148
      /* EditorOption.wordSeparators */
    ), []);
    let r = e.column, s = 0;
    for (; r > 1; ) {
      const o = t.charCodeAt(r - 2);
      if (n.get(o) !== 0 || s > 50)
        return t.substring(r - 1, e.column - 1);
      s++, r--;
    }
    return t.substring(0, e.column - 1);
  }
  _getCharacterBeforePosition(e) {
    if (e.column > 1) {
      const n = this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column - 2);
      if (!Qo(n.charCodeAt(0)))
        return n;
    }
    return "";
  }
  _setAccessibilityOptions(e) {
    this._accessibilitySupport = e.get(
      2
      /* EditorOption.accessibilitySupport */
    );
    const t = e.get(
      3
      /* EditorOption.accessibilityPageSize */
    );
    this._accessibilitySupport === 2 && t === wm.accessibilityPageSize.defaultValue ? this._accessibilityPageSize = 500 : this._accessibilityPageSize = t;
    const r = e.get(
      165
      /* EditorOption.layoutInfo */
    ).wrappingColumn;
    if (r !== -1 && this._accessibilitySupport !== 1) {
      const s = e.get(
        59
        /* EditorOption.fontInfo */
      );
      this._textAreaWrapping = !0, this._textAreaWidth = Math.round(r * s.typicalHalfwidthCharacterWidth);
    } else
      this._textAreaWrapping = !1, this._textAreaWidth = aee ? 0 : 1;
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    const t = this._context.configuration.options, n = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    this._setAccessibilityOptions(t), this._contentLeft = n.contentLeft, this._contentWidth = n.contentWidth, this._contentHeight = n.height, this._fontInfo = t.get(
      59
      /* EditorOption.fontInfo */
    ), this._emptySelectionClipboard = t.get(
      45
      /* EditorOption.emptySelectionClipboard */
    ), this._copyWithSyntaxHighlighting = t.get(
      31
      /* EditorOption.copyWithSyntaxHighlighting */
    ), this.textArea.setAttribute("wrap", this._textAreaWrapping && !this._visibleTextArea ? "on" : "off");
    const { tabSize: r } = this._context.viewModel.model.getOptions();
    return this.textArea.domNode.style.tabSize = `${r * this._fontInfo.spaceWidth}px`, this.textArea.setAttribute("aria-label", hre(t, this._keybindingService)), this.textArea.setAttribute("aria-required", t.get(
      9
      /* EditorOption.ariaRequired */
    ) ? "true" : "false"), this.textArea.setAttribute("tabindex", String(t.get(
      140
      /* EditorOption.tabIndex */
    ))), (e.hasChanged(
      41
      /* EditorOption.domReadOnly */
    ) || e.hasChanged(
      104
      /* EditorOption.readOnly */
    )) && this._ensureReadOnlyAttribute(), e.hasChanged(
      2
      /* EditorOption.accessibilitySupport */
    ) && this._textAreaInput.writeNativeTextAreaContent("strategy changed"), !0;
  }
  onCursorStateChanged(e) {
    return this._selections = e.selections.slice(0), this._modelSelections = e.modelSelections.slice(0), this._textAreaInput.writeNativeTextAreaContent("selection changed"), !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return this._scrollLeft = e.scrollLeft, this._scrollTop = e.scrollTop, !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  // --- end event handlers
  // --- begin view API
  isFocused() {
    return this._textAreaInput.isFocused();
  }
  focus() {
    this._textAreaInput.focusTextArea();
  }
  refreshFocusState() {
    this._textAreaInput.refreshFocusState();
  }
  getLastRenderData() {
    return this._lastRenderPosition;
  }
  setAriaOptions(e) {
    e.activeDescendant ? (this.textArea.setAttribute("aria-haspopup", "true"), this.textArea.setAttribute("aria-autocomplete", "list"), this.textArea.setAttribute("aria-activedescendant", e.activeDescendant)) : (this.textArea.setAttribute("aria-haspopup", "false"), this.textArea.setAttribute("aria-autocomplete", "both"), this.textArea.removeAttribute("aria-activedescendant")), e.role && this.textArea.setAttribute("role", e.role);
  }
  // --- end view API
  _ensureReadOnlyAttribute() {
    const e = this._context.configuration.options;
    !sb.enabled || e.get(
      41
      /* EditorOption.domReadOnly */
    ) && e.get(
      104
      /* EditorOption.readOnly */
    ) ? this.textArea.setAttribute("readonly", "true") : this.textArea.removeAttribute("readonly");
  }
  prepareRender(e) {
    var t;
    this._primaryCursorPosition = new de(this._selections[0].positionLineNumber, this._selections[0].positionColumn), this._primaryCursorVisibleRange = e.visibleRangeForPosition(this._primaryCursorPosition), (t = this._visibleTextArea) == null || t.prepareRender(e);
  }
  render(e) {
    this._textAreaInput.writeNativeTextAreaContent("render"), this._render();
  }
  _render() {
    if (this._visibleTextArea) {
      const n = this._visibleTextArea.visibleTextareaStart, r = this._visibleTextArea.visibleTextareaEnd, s = this._visibleTextArea.startPosition, o = this._visibleTextArea.endPosition;
      if (s && o && n && r && r.left >= this._scrollLeft && n.left <= this._scrollLeft + this._contentWidth) {
        const a = this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber) - this._scrollTop, l = eTe(this.textArea.domNode.value.substr(0, this.textArea.domNode.selectionStart));
        let c = this._visibleTextArea.widthOfHiddenLineTextBefore, u = this._contentLeft + n.left - this._scrollLeft, d = r.left - n.left + 1;
        if (u < this._contentLeft) {
          const L = this._contentLeft - u;
          u += L, c += L, d -= L;
        }
        d > this._contentWidth && (d = this._contentWidth);
        const h = this._context.viewLayout.getLineHeightForLineNumber(s.lineNumber), g = this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition), m = this._context.viewModel.getViewLineData(s.lineNumber), _ = m.tokens.findTokenIndexAtOffset(s.column - 1), v = m.tokens.findTokenIndexAtOffset(o.column - 1), w = _ === v, E = this._visibleTextArea.definePresentation(w ? m.tokens.getPresentation(_) : null);
        this.textArea.domNode.scrollTop = l * h, this.textArea.domNode.scrollLeft = c, this._doRender({
          lastRenderPosition: null,
          top: a,
          left: u,
          width: d,
          height: h,
          useCover: !1,
          color: (Ys.getColorMap() || [])[E.foreground],
          italic: E.italic,
          bold: E.bold,
          underline: E.underline,
          strikethrough: E.strikethrough,
          fontSize: g
        });
      }
      return;
    }
    if (!this._primaryCursorVisibleRange) {
      this._renderAtTopLeft();
      return;
    }
    const e = this._contentLeft + this._primaryCursorVisibleRange.left - this._scrollLeft;
    if (e < this._contentLeft || e > this._contentLeft + this._contentWidth) {
      this._renderAtTopLeft();
      return;
    }
    const t = this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber) - this._scrollTop;
    if (t < 0 || t > this._contentHeight) {
      this._renderAtTopLeft();
      return;
    }
    if (Kn || this._accessibilitySupport === 2) {
      const n = this._primaryCursorPosition.lineNumber, r = this._context.viewLayout.getLineHeightForLineNumber(n);
      this._doRender({
        lastRenderPosition: this._primaryCursorPosition,
        top: t,
        left: this._textAreaWrapping ? this._contentLeft : e,
        width: this._textAreaWidth,
        height: r,
        useCover: !1
      }), this.textArea.domNode.scrollLeft = this._primaryCursorVisibleRange.left;
      const s = this._textAreaInput.textAreaState.newlineCountBeforeSelection ?? eTe(this.textArea.domNode.value.substring(0, this.textArea.domNode.selectionStart));
      this.textArea.domNode.scrollTop = s * r;
      return;
    }
    this._doRender({
      lastRenderPosition: this._primaryCursorPosition,
      top: t,
      left: this._textAreaWrapping ? this._contentLeft : e,
      width: this._textAreaWidth,
      height: aee ? 0 : 1,
      useCover: !1
    });
  }
  _renderAtTopLeft() {
    this._doRender({
      lastRenderPosition: null,
      top: 0,
      left: 0,
      width: this._textAreaWidth,
      height: aee ? 0 : 1,
      useCover: !0
    });
  }
  _doRender(e) {
    this._lastRenderPosition = e.lastRenderPosition;
    const t = this.textArea, n = this.textAreaCover;
    Ma(t, this._fontInfo), t.setTop(e.top), t.setLeft(e.left), t.setWidth(e.width), t.setHeight(e.height), t.setLineHeight(e.height), t.setFontSize(e.fontSize ?? this._fontInfo.fontSize), t.setColor(e.color ? De.Format.CSS.formatHex(e.color) : ""), t.setFontStyle(e.italic ? "italic" : ""), e.bold && t.setFontWeight("bold"), t.setTextDecoration(`${e.underline ? " underline" : ""}${e.strikethrough ? " line-through" : ""}`), n.setTop(e.useCover ? e.top : 0), n.setLeft(e.useCover ? e.left : 0), n.setWidth(e.useCover ? e.width : 0), n.setHeight(e.useCover ? e.height : 0);
    const r = this._context.configuration.options;
    r.get(
      66
      /* EditorOption.glyphMargin */
    ) ? n.setClassName("monaco-editor-background textAreaCover " + uU.OUTER_CLASS_NAME) : r.get(
      76
      /* EditorOption.lineNumbers */
    ).renderType !== 0 ? n.setClassName("monaco-editor-background textAreaCover " + lU.CLASS_NAME) : n.setClassName("monaco-editor-background textAreaCover");
  }
};
fre = Iht([
  tTe(4, Fi),
  tTe(5, xt)
], fre);
function Rht(i, e, t, n) {
  if (e.length === 0)
    return 0;
  const r = i.createElement("div");
  r.style.position = "absolute", r.style.top = "-50000px", r.style.width = "50000px";
  const s = i.createElement("span");
  Ma(s, t), s.style.whiteSpace = "pre", s.style.tabSize = `${n * t.spaceWidth}px`, s.append(e), r.appendChild(s), i.body.appendChild(r);
  const o = s.offsetWidth;
  return r.remove(), o;
}
var Aht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Oht = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let gre = class extends ge {
  constructor(e, t, n) {
    super(), this._domNode = t, this._onFocusChange = n, this._isFocused = !1, this._isPaused = !1, this._register(Ce(this._domNode, "focus", () => {
      e.trace("NativeEditContext.focus"), !this._isPaused && this.refreshFocusState();
    })), this._register(Ce(this._domNode, "blur", () => {
      e.trace("NativeEditContext.blur"), !this._isPaused && this._handleFocusedChanged(!1);
    }));
  }
  pause() {
    this._isPaused = !0;
  }
  resume() {
    this._isPaused = !1, this.refreshFocusState();
  }
  _handleFocusedChanged(e) {
    this._isFocused !== e && (this._isFocused = e, this._onFocusChange(this._isFocused));
  }
  focus() {
    this._domNode.focus(), this.refreshFocusState();
  }
  refreshFocusState() {
    const e = iw(this._domNode), t = e ? e.activeElement : ea(), n = this._domNode === t;
    this._handleFocusedChanged(n);
  }
  get isFocused() {
    return this._isFocused;
  }
};
gre = Aht([
  Oht(0, $r)
], gre);
function $M(i, e, t, n) {
  return i.addEventListener(e, t, n), {
    dispose() {
      i.removeEventListener(e, t);
    }
  };
}
var Mht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Pht = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const lee = Db("richScreenReaderContent", { createHTML: (i) => i }), cee = "data-line-number";
let pre = class extends ge {
  constructor(e, t, n, r) {
    super(), this._domNode = e, this._context = t, this._viewController = n, this._accessibilityService = r, this._selectionChangeListener = this._register(new er()), this._accessibilityPageSize = 1, this._ignoreSelectionChangeTime = 0, this._state = R4.NULL, this._strategy = new Hht(), this._renderedLines = /* @__PURE__ */ new Map(), this._renderedSelection = new bt(1, 1, 1, 1), this.onConfigurationChanged(this._context.configuration.options);
  }
  updateScreenReaderContent(e) {
    const t = rr().document.activeElement;
    if (!t || t !== this._domNode.domNode)
      return;
    if (this._accessibilityService.isScreenReaderOptimized()) {
      const r = this._getScreenReaderContentLineIntervals(e);
      this._state.equals(r) || (this._state = r, this._renderedLines = this._renderScreenReaderContent(r)), this._renderedSelection.equalsSelection(e) || (this._renderedSelection = e, this._setSelectionOnScreenReaderContent(this._context, this._renderedLines, e));
    } else
      this._state = R4.NULL, this._setIgnoreSelectionChangeTime("setValue"), this._domNode.domNode.textContent = "";
  }
  updateScrollTop(e) {
    const t = this._state.intervals;
    if (!t.length)
      return;
    const n = this._context.viewModel.viewLayout, r = t[0].startLine, s = n.getVerticalOffsetForLineNumber(r), o = n.getVerticalOffsetForLineNumber(e.positionLineNumber);
    this._domNode.domNode.scrollTop = o - s;
  }
  onFocusChange(e) {
    e ? this._selectionChangeListener.value = this._setSelectionChangeListener() : this._selectionChangeListener.value = void 0;
  }
  onConfigurationChanged(e) {
    this._accessibilityPageSize = e.get(
      3
      /* EditorOption.accessibilityPageSize */
    );
  }
  onWillCut() {
    this._setIgnoreSelectionChangeTime("onCut");
  }
  onWillPaste() {
    this._setIgnoreSelectionChangeTime("onWillPaste");
  }
  // --- private methods
  _setIgnoreSelectionChangeTime(e) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  _setSelectionChangeListener() {
    let e = 0;
    return Ce(this._domNode.domNode.ownerDocument, "selectionchange", () => {
      if (!(rr().document.activeElement === this._domNode.domNode) || !this._accessibilityService.isScreenReaderOptimized() || !sb.enabled)
        return;
      const s = Date.now(), o = s - e;
      if (e = s, o < 5)
        return;
      const a = s - this._ignoreSelectionChangeTime;
      if (this._ignoreSelectionChangeTime = 0, a < 100)
        return;
      const l = this._getEditorSelectionFromDomRange();
      l && this._viewController.setSelection(l);
    });
  }
  _renderScreenReaderContent(e) {
    const t = [], n = /* @__PURE__ */ new Map();
    for (const r of e.intervals)
      for (let s = r.startLine; s <= r.endLine; s++) {
        const o = this._renderLine(s);
        n.set(s, o), t.push(o.domNode);
      }
    return this._setIgnoreSelectionChangeTime("setValue"), this._domNode.domNode.replaceChildren(...t), n;
  }
  _renderLine(e) {
    const t = this._context.viewModel, n = t.getViewLineRenderingData(e), r = this._context.configuration.options, s = r.get(
      59
      /* EditorOption.fontInfo */
    ), o = r.get(
      133
      /* EditorOption.stopRenderingLineAfter */
    ), a = r.get(
      108
      /* EditorOption.renderControlCharacters */
    ), l = r.get(
      60
      /* EditorOption.fontLigatures */
    ), c = r.get(
      40
      /* EditorOption.disableMonospaceOptimizations */
    ), u = Lc.filter(n.inlineDecorations, e, n.minColumn, n.maxColumn), d = s.isMonospace && !c, h = l !== Yy.OFF;
    let g;
    r.get(
      47
      /* EditorOption.experimentalWhitespaceRendering */
    ) === "off" ? g = r.get(
      113
      /* EditorOption.renderWhitespace */
    ) : g = "none";
    const _ = new d0(d, s.canUseHalfwidthRightwardsArrow, n.content, n.continuesWithWrappedLine, n.isBasicASCII, n.containsRTL, n.minColumn - 1, n.tokens, u, n.tabSize, n.startVisibleColumn, s.spaceWidth, s.middotWidth, s.wsmiddotWidth, o, g, a, h, null, null, 0, !0), v = new ww(1e4), w = t2(_, v), E = v.build(), L = (lee == null ? void 0 : lee.createHTML(E)) ?? E, T = t.viewLayout.getLineHeightForLineNumber(e) + "px", D = document.createElement("div");
    return D.innerHTML = L, D.style.lineHeight = T, D.style.height = T, D.setAttribute(cee, e.toString()), new Fht(D, w.characterMapping);
  }
  _setSelectionOnScreenReaderContent(e, t, n) {
    const s = rr().document.getSelection();
    if (!s)
      return;
    const o = n.startLineNumber, a = n.endLineNumber, l = t.get(o), c = t.get(a);
    if (!l || !c)
      return;
    const u = e.viewModel, d = u.model, h = u.coordinatesConverter, g = new z(o, 1, o, n.selectionStartColumn), m = h.convertViewRangeToModelRange(g), _ = d.getCharacterCountInRange(m), v = new z(a, 1, a, n.positionColumn), w = h.convertViewRangeToModelRange(v), E = d.getCharacterCountInRange(w), L = l.characterMapping.getDomPosition(_), T = c.characterMapping.getDomPosition(E), D = l.domNode.firstChild, N = c.domNode.firstChild, R = D.childNodes, M = N.childNodes, B = R.item(L.partIndex), H = M.item(T.partIndex);
    !B.firstChild || !H.firstChild || (this._setIgnoreSelectionChangeTime("setRange"), s.setBaseAndExtent(B.firstChild, n.startColumn === 1 ? 0 : L.charIndex + 1, H.firstChild, n.endColumn === 1 ? 0 : T.charIndex + 1));
  }
  _getScreenReaderContentLineIntervals(e) {
    return this._strategy.fromEditorSelection(this._context.viewModel, e, this._accessibilityPageSize);
  }
  _getEditorSelectionFromDomRange() {
    var E, L, T, D;
    if (!this._renderedLines)
      return;
    const e = rr().document.getSelection();
    if (!e || e.rangeCount === 0)
      return;
    const n = e.getRangeAt(0), r = n.startContainer, s = n.endContainer, o = r.parentElement, a = s.parentElement;
    if (!o || !eo(o) || !a || !eo(a))
      return;
    const l = (E = o.parentElement) == null ? void 0 : E.parentElement, c = (L = a.parentElement) == null ? void 0 : L.parentElement;
    if (!l || !c)
      return;
    const u = l.getAttribute(cee), d = c.getAttribute(cee);
    if (!u || !d)
      return;
    const h = parseInt(u), g = parseInt(d), m = (T = this._renderedLines.get(h)) == null ? void 0 : T.characterMapping, _ = (D = this._renderedLines.get(g)) == null ? void 0 : D.characterMapping;
    if (!m || !_)
      return;
    const v = y4(m, o, n.startOffset), w = y4(_, a, n.endOffset);
    return e.direction === "forward" ? new bt(h, v, g, w) : new bt(g, w, h, v);
  }
};
pre = Mht([
  Pht(3, Qa)
], pre);
class Fht {
  constructor(e, t) {
    this.domNode = e, this.characterMapping = t;
  }
}
class Bht {
  constructor(e, t) {
    this.startLine = e, this.endLine = t;
  }
}
class R4 {
  constructor(e, t) {
    this.intervals = t;
    let n = "";
    for (const r of t)
      for (let s = r.startLine; s <= r.endLine; s++)
        n += e.getLineContent(s) + `
`;
    this.value = n;
  }
  equals(e) {
    return this.value === e.value;
  }
  static get NULL() {
    const e = {
      getLineContent: () => "",
      getLineCount: () => 1,
      getLineMaxColumn: () => 1,
      getValueInRange: () => "",
      getValueLengthInRange: () => 0,
      modifyPosition: (t, n) => t
    };
    return new R4(e, []);
  }
}
class Hht {
  constructor() {
  }
  _getPageOfLine(e, t) {
    return Math.floor((e - 1) / t);
  }
  _getRangeForPage(e, t, n) {
    const r = t * n, s = r + 1, o = Math.min(r + n, e.getLineCount());
    return new Bht(s, o);
  }
  fromEditorSelection(e, t, n) {
    const r = this._getPageOfLine(t.startLineNumber, n), s = this._getRangeForPage(e, r, n), o = this._getPageOfLine(t.endLineNumber, n), a = this._getRangeForPage(e, o, n), l = [{ startLine: s.startLine, endLine: s.endLine }];
    return r + 1 < o && l.push({ startLine: a.startLine, endLine: a.endLine }), new R4(e, l);
  }
}
class Wht {
  constructor(e) {
    this.replacements = e;
    let t = -1;
    for (const n of e) {
      if (!(n.replaceRange.start >= t))
        throw new Wt(`Edits must be disjoint and sorted. Found ${n} after ${t}`);
      t = n.replaceRange.endExclusive;
    }
  }
  toString() {
    return `[${this.replacements.map((t) => t.toString()).join(", ")}]`;
  }
  /**
   * Normalizes the edit by removing empty replacements and joining touching replacements (if the replacements allow joining).
   * Two edits have an equal normalized edit if and only if they have the same effect on any input.
   *
   * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_normalize.drawio.png)
   *
   * Invariant:
   * ```
   * (forall base: TEdit.apply(base).equals(other.apply(base))) <-> this.normalize().equals(other.normalize())
   * ```
   * and
   * ```
   * forall base: TEdit.apply(base).equals(this.normalize().apply(base))
   * ```
   *
   */
  normalize() {
    const e = [];
    let t;
    for (const n of this.replacements)
      if (!(n.getNewLength() === 0 && n.replaceRange.length === 0)) {
        if (t && t.replaceRange.endExclusive === n.replaceRange.start) {
          const r = t.tryJoinTouching(n);
          if (r) {
            t = r;
            continue;
          }
        }
        t && e.push(t), t = n;
      }
    return t && e.push(t), this._createNew(e);
  }
  /**
   * Combines two edits into one with the same effect.
   *
   * ![](https://raw.githubusercontent.com/microsoft/vscode/refs/heads/main/src/vs/editor/common/core/edits/docs/BaseEdit_compose.drawio.png)
   *
   * Invariant:
   * ```
   * other.apply(this.apply(s0)) = this.compose(other).apply(s0)
   * ```
   */
  compose(e) {
    const t = this.normalize(), n = e.normalize();
    if (t.isEmpty())
      return n;
    if (n.isEmpty())
      return t;
    const r = [...t.replacements], s = [];
    let o = 0;
    for (const a of n.replacements) {
      for (; ; ) {
        const d = r[0];
        if (!d || d.replaceRange.start + o + d.getNewLength() >= a.replaceRange.start)
          break;
        r.shift(), s.push(d), o += d.getNewLength() - d.replaceRange.length;
      }
      const l = o;
      let c, u;
      for (; ; ) {
        const d = r[0];
        if (!d || d.replaceRange.start + o > a.replaceRange.endExclusive)
          break;
        c || (c = d), u = d, r.shift(), o += d.getNewLength() - d.replaceRange.length;
      }
      if (!c)
        s.push(a.delta(-o));
      else {
        const d = Math.min(c.replaceRange.start, a.replaceRange.start - l), h = a.replaceRange.start - (c.replaceRange.start + l);
        if (h > 0) {
          const v = c.slice(Tt.emptyAt(d), new Tt(0, h));
          s.push(v);
        }
        if (!u)
          throw new Wt("Invariant violation: lastIntersecting is undefined");
        const g = u.replaceRange.endExclusive + o - a.replaceRange.endExclusive;
        if (g > 0) {
          const v = u.slice(Tt.ofStartAndLength(u.replaceRange.endExclusive, 0), new Tt(u.getNewLength() - g, u.getNewLength()));
          r.unshift(v), o -= v.getNewLength() - v.replaceRange.length;
        }
        const m = new Tt(d, a.replaceRange.endExclusive - o), _ = a.slice(m, new Tt(0, a.getNewLength()));
        s.push(_);
      }
    }
    for (; ; ) {
      const a = r.shift();
      if (!a)
        break;
      s.push(a);
    }
    return this._createNew(s).normalize();
  }
  /**
   * Returns the range of each replacement in the applied value.
  */
  getNewRanges() {
    const e = [];
    let t = 0;
    for (const n of this.replacements)
      e.push(Tt.ofStartAndLength(n.replaceRange.start + t, n.getNewLength())), t += n.getLengthDelta();
    return e;
  }
  isEmpty() {
    return this.replacements.length === 0;
  }
}
class Vht {
  constructor(e) {
    this.replaceRange = e;
  }
  delta(e) {
    return this.slice(this.replaceRange.delta(e), new Tt(0, this.getNewLength()));
  }
  getLengthDelta() {
    return this.getNewLength() - this.replaceRange.length;
  }
  toString() {
    return `{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`;
  }
  get isEmpty() {
    return this.getNewLength() === 0 && this.replaceRange.length === 0;
  }
  getRangeAfterReplace() {
    return new Tt(this.replaceRange.start, this.replaceRange.start + this.getNewLength());
  }
}
class Uht extends Wht {
  apply(e) {
    const t = [];
    let n = 0;
    for (const r of this.replacements)
      t.push(e.substring(n, r.replaceRange.start)), t.push(r.newText), n = r.replaceRange.endExclusive;
    return t.push(e.substring(n)), t.join("");
  }
}
class zht extends Vht {
  constructor(e, t) {
    super(e), this.newText = t;
  }
  getNewLength() {
    return this.newText.length;
  }
  toString() {
    return `${this.replaceRange} -> ${JSON.stringify(this.newText)}`;
  }
  replace(e) {
    return e.substring(0, this.replaceRange.start) + this.newText + e.substring(this.replaceRange.endExclusive);
  }
  removeCommonSuffixPrefix(e) {
    const t = e.substring(this.replaceRange.start, this.replaceRange.endExclusive), n = jg(t, this.newText), r = Math.min(t.length - n, this.newText.length - n, Gy(t, this.newText)), s = new Tt(this.replaceRange.start + n, this.replaceRange.endExclusive - r), o = this.newText.substring(n, this.newText.length - r);
    return new Ya(s, o);
  }
  removeCommonSuffixAndPrefix(e) {
    return this.removeCommonSuffix(e).removeCommonPrefix(e);
  }
  removeCommonPrefix(e) {
    const t = this.replaceRange.substring(e), n = jg(t, this.newText);
    return n === 0 ? this : this.slice(this.replaceRange.deltaStart(n), new Tt(n, this.newText.length));
  }
  removeCommonSuffix(e) {
    const t = this.replaceRange.substring(e), n = Gy(t, this.newText);
    return n === 0 ? this : this.slice(this.replaceRange.deltaEnd(-n), new Tt(0, this.newText.length - n));
  }
  toJson() {
    return {
      txt: this.newText,
      pos: this.replaceRange.start,
      len: this.replaceRange.length
    };
  }
}
const ON = class ON extends Uht {
  static compose(e) {
    if (e.length === 0)
      return ON.empty;
    let t = e[0];
    for (let n = 1; n < e.length; n++)
      t = t.compose(e[n]);
    return t;
  }
  constructor(e) {
    super(e);
  }
  _createNew(e) {
    return new ON(e);
  }
};
ON.empty = new ON([]);
let Jy = ON;
class Ya extends zht {
  static insert(e, t) {
    return new Ya(Tt.emptyAt(e), t);
  }
  static replace(e, t) {
    return new Ya(e, t);
  }
  equals(e) {
    return this.replaceRange.equals(e.replaceRange) && this.newText === e.newText;
  }
  tryJoinTouching(e) {
    return new Ya(this.replaceRange.joinRightTouching(e.replaceRange), this.newText + e.newText);
  }
  slice(e, t) {
    return new Ya(e, t ? t.substring(this.newText) : this.newText);
  }
}
function M3e(i, e) {
  i = i.slice();
  const t = [];
  let n = 0;
  for (const r of e.replacements) {
    for (; ; ) {
      const o = i[0];
      if (!o || o.endExclusive >= r.replaceRange.start)
        break;
      i.shift(), t.push(o.delta(n));
    }
    const s = [];
    for (; ; ) {
      const o = i[0];
      if (!o || !o.intersectsOrTouches(r.replaceRange))
        break;
      i.shift(), s.push(o);
    }
    for (let o = s.length - 1; o >= 0; o--) {
      let a = s[o];
      const l = a.intersect(r.replaceRange).length;
      a = a.deltaEnd(-l + (o === 0 ? r.newText.length : 0));
      const c = a.start - r.replaceRange.start;
      c > 0 && (a = a.delta(-c)), o !== 0 && (a = a.delta(r.newText.length)), a = a.delta(-(r.newText.length - r.replaceRange.length)), i.unshift(a);
    }
    n += r.newText.length - r.replaceRange.length;
  }
  for (; ; ) {
    const r = i[0];
    if (!r)
      break;
    i.shift(), t.push(r.delta(n));
  }
  return t;
}
const yf = class yf {
  static ofLength(e, t) {
    return new yf(e, e + t);
  }
  static fromRange(e) {
    return new yf(e.startLineNumber, e.endLineNumber);
  }
  static fromRangeInclusive(e) {
    return new yf(e.startLineNumber, e.endLineNumber + 1);
  }
  /**
   * @param lineRanges An array of arrays of of sorted line ranges.
   */
  static joinMany(e) {
    if (e.length === 0)
      return [];
    let t = new Mf(e[0].slice());
    for (let n = 1; n < e.length; n++)
      t = t.getUnion(new Mf(e[n].slice()));
    return t.ranges;
  }
  static join(e) {
    if (e.length === 0)
      throw new Wt("lineRanges cannot be empty");
    let t = e[0].startLineNumber, n = e[0].endLineNumberExclusive;
    for (let r = 1; r < e.length; r++)
      t = Math.min(t, e[r].startLineNumber), n = Math.max(n, e[r].endLineNumberExclusive);
    return new yf(t, n);
  }
  /**
   * @internal
   */
  static deserialize(e) {
    return new yf(e[0], e[1]);
  }
  constructor(e, t) {
    if (e > t)
      throw new Wt(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);
    this.startLineNumber = e, this.endLineNumberExclusive = t;
  }
  /**
   * Indicates if this line range contains the given line number.
   */
  contains(e) {
    return this.startLineNumber <= e && e < this.endLineNumberExclusive;
  }
  /**
   * Indicates if this line range is empty.
   */
  get isEmpty() {
    return this.startLineNumber === this.endLineNumberExclusive;
  }
  /**
   * Moves this line range by the given offset of line numbers.
   */
  delta(e) {
    return new yf(this.startLineNumber + e, this.endLineNumberExclusive + e);
  }
  deltaLength(e) {
    return new yf(this.startLineNumber, this.endLineNumberExclusive + e);
  }
  /**
   * The number of lines this line range spans.
   */
  get length() {
    return this.endLineNumberExclusive - this.startLineNumber;
  }
  /**
   * Creates a line range that combines this and the given line range.
   */
  join(e) {
    return new yf(Math.min(this.startLineNumber, e.startLineNumber), Math.max(this.endLineNumberExclusive, e.endLineNumberExclusive));
  }
  toString() {
    return `[${this.startLineNumber},${this.endLineNumberExclusive})`;
  }
  /**
   * The resulting range is empty if the ranges do not intersect, but touch.
   * If the ranges don't even touch, the result is undefined.
   */
  intersect(e) {
    const t = Math.max(this.startLineNumber, e.startLineNumber), n = Math.min(this.endLineNumberExclusive, e.endLineNumberExclusive);
    if (t <= n)
      return new yf(t, n);
  }
  intersectsStrict(e) {
    return this.startLineNumber < e.endLineNumberExclusive && e.startLineNumber < this.endLineNumberExclusive;
  }
  intersectsOrTouches(e) {
    return this.startLineNumber <= e.endLineNumberExclusive && e.startLineNumber <= this.endLineNumberExclusive;
  }
  equals(e) {
    return this.startLineNumber === e.startLineNumber && this.endLineNumberExclusive === e.endLineNumberExclusive;
  }
  toInclusiveRange() {
    return this.isEmpty ? null : new z(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);
  }
  /**
   * @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position!
  */
  toExclusiveRange() {
    return new z(this.startLineNumber, 1, this.endLineNumberExclusive, 1);
  }
  mapToLineArray(e) {
    const t = [];
    for (let n = this.startLineNumber; n < this.endLineNumberExclusive; n++)
      t.push(e(n));
    return t;
  }
  forEach(e) {
    for (let t = this.startLineNumber; t < this.endLineNumberExclusive; t++)
      e(t);
  }
  /**
   * @internal
   */
  serialize() {
    return [this.startLineNumber, this.endLineNumberExclusive];
  }
  /**
   * Converts this 1-based line range to a 0-based offset range (subtracts 1!).
   * @internal
   */
  toOffsetRange() {
    return new Tt(this.startLineNumber - 1, this.endLineNumberExclusive - 1);
  }
  addMargin(e, t) {
    return new yf(this.startLineNumber - e, this.endLineNumberExclusive + t);
  }
};
yf.compareByStart = yl((e) => e.startLineNumber, Hd);
let Zt = yf;
class Mf {
  constructor(e = []) {
    this._normalizedRanges = e;
  }
  get ranges() {
    return this._normalizedRanges;
  }
  addRange(e) {
    if (e.length === 0)
      return;
    const t = S4(this._normalizedRanges, (r) => r.endLineNumberExclusive >= e.startLineNumber), n = nA(this._normalizedRanges, (r) => r.startLineNumber <= e.endLineNumberExclusive) + 1;
    if (t === n)
      this._normalizedRanges.splice(t, 0, e);
    else if (t === n - 1) {
      const r = this._normalizedRanges[t];
      this._normalizedRanges[t] = r.join(e);
    } else {
      const r = this._normalizedRanges[t].join(this._normalizedRanges[n - 1]).join(e);
      this._normalizedRanges.splice(t, n - t, r);
    }
  }
  contains(e) {
    const t = tA(this._normalizedRanges, (n) => n.startLineNumber <= e);
    return !!t && t.endLineNumberExclusive > e;
  }
  intersects(e) {
    const t = tA(this._normalizedRanges, (n) => n.startLineNumber < e.endLineNumberExclusive);
    return !!t && t.endLineNumberExclusive > e.startLineNumber;
  }
  getUnion(e) {
    if (this._normalizedRanges.length === 0)
      return e;
    if (e._normalizedRanges.length === 0)
      return this;
    const t = [];
    let n = 0, r = 0, s = null;
    for (; n < this._normalizedRanges.length || r < e._normalizedRanges.length; ) {
      let o = null;
      if (n < this._normalizedRanges.length && r < e._normalizedRanges.length) {
        const a = this._normalizedRanges[n], l = e._normalizedRanges[r];
        a.startLineNumber < l.startLineNumber ? (o = a, n++) : (o = l, r++);
      } else n < this._normalizedRanges.length ? (o = this._normalizedRanges[n], n++) : (o = e._normalizedRanges[r], r++);
      s === null ? s = o : s.endLineNumberExclusive >= o.startLineNumber ? s = new Zt(s.startLineNumber, Math.max(s.endLineNumberExclusive, o.endLineNumberExclusive)) : (t.push(s), s = o);
    }
    return s !== null && t.push(s), new Mf(t);
  }
  /**
   * Subtracts all ranges in this set from `range` and returns the result.
   */
  subtractFrom(e) {
    const t = S4(this._normalizedRanges, (o) => o.endLineNumberExclusive >= e.startLineNumber), n = nA(this._normalizedRanges, (o) => o.startLineNumber <= e.endLineNumberExclusive) + 1;
    if (t === n)
      return new Mf([e]);
    const r = [];
    let s = e.startLineNumber;
    for (let o = t; o < n; o++) {
      const a = this._normalizedRanges[o];
      a.startLineNumber > s && r.push(new Zt(s, a.startLineNumber)), s = a.endLineNumberExclusive;
    }
    return s < e.endLineNumberExclusive && r.push(new Zt(s, e.endLineNumberExclusive)), new Mf(r);
  }
  toString() {
    return this._normalizedRanges.map((e) => e.toString()).join(", ");
  }
  getIntersection(e) {
    const t = [];
    let n = 0, r = 0;
    for (; n < this._normalizedRanges.length && r < e._normalizedRanges.length; ) {
      const s = this._normalizedRanges[n], o = e._normalizedRanges[r], a = s.intersect(o);
      a && !a.isEmpty && t.push(a), s.endLineNumberExclusive < o.endLineNumberExclusive ? n++ : r++;
    }
    return new Mf(t);
  }
  getWithDelta(e) {
    return new Mf(this._normalizedRanges.map((t) => t.delta(e)));
  }
}
const Mp = class Mp {
  static betweenPositions(e, t) {
    return e.lineNumber === t.lineNumber ? new Mp(0, t.column - e.column) : new Mp(t.lineNumber - e.lineNumber, t.column - 1);
  }
  static fromPosition(e) {
    return new Mp(e.lineNumber - 1, e.column - 1);
  }
  static ofRange(e) {
    return Mp.betweenPositions(e.getStartPosition(), e.getEndPosition());
  }
  static ofText(e) {
    let t = 0, n = 0;
    for (const r of e)
      r === `
` ? (t++, n = 0) : n++;
    return new Mp(t, n);
  }
  constructor(e, t) {
    this.lineCount = e, this.columnCount = t;
  }
  isGreaterThanOrEqualTo(e) {
    return this.lineCount !== e.lineCount ? this.lineCount > e.lineCount : this.columnCount >= e.columnCount;
  }
  add(e) {
    return e.lineCount === 0 ? new Mp(this.lineCount, this.columnCount + e.columnCount) : new Mp(this.lineCount + e.lineCount, e.columnCount);
  }
  createRange(e) {
    return this.lineCount === 0 ? new z(e.lineNumber, e.column, e.lineNumber, e.column + this.columnCount) : new z(e.lineNumber, e.column, e.lineNumber + this.lineCount, this.columnCount + 1);
  }
  toRange() {
    return new z(1, 1, this.lineCount + 1, this.columnCount + 1);
  }
  toLineRange() {
    return Zt.ofLength(1, this.lineCount + 1);
  }
  addToPosition(e) {
    return this.lineCount === 0 ? new de(e.lineNumber, e.column + this.columnCount) : new de(e.lineNumber + this.lineCount, this.columnCount + 1);
  }
  toString() {
    return `${this.lineCount},${this.columnCount}`;
  }
};
Mp.zero = new Mp(0, 0);
let ta = Mp;
class P3e {
  getOffsetRange(e) {
    return new Tt(this.getOffset(e.getStartPosition()), this.getOffset(e.getEndPosition()));
  }
  getRange(e) {
    return z.fromPositions(this.getPosition(e.start), this.getPosition(e.endExclusive));
  }
  getStringReplacement(e) {
    return new Wx.deps.StringReplacement(this.getOffsetRange(e.range), e.text);
  }
  getTextReplacement(e) {
    return new Wx.deps.TextReplacement(this.getRange(e.replaceRange), e.newText);
  }
  getTextEdit(e) {
    const t = e.replacements.map((n) => this.getTextReplacement(n));
    return new Wx.deps.TextEdit(t);
  }
}
const KCe = class KCe {
  static get deps() {
    if (!this._deps)
      throw new Error("Dependencies not set. Call _setDependencies first.");
    return this._deps;
  }
};
KCe._deps = void 0;
let Wx = KCe;
function $ht(i) {
  Wx._deps = i;
}
class oK extends P3e {
  constructor(e) {
    super(), this.text = e, this.lineStartOffsetByLineIdx = [], this.lineEndOffsetByLineIdx = [], this.lineStartOffsetByLineIdx.push(0);
    for (let t = 0; t < e.length; t++)
      e.charAt(t) === `
` && (this.lineStartOffsetByLineIdx.push(t + 1), t > 0 && e.charAt(t - 1) === "\r" ? this.lineEndOffsetByLineIdx.push(t - 1) : this.lineEndOffsetByLineIdx.push(t));
    this.lineEndOffsetByLineIdx.push(e.length);
  }
  getOffset(e) {
    const t = this._validatePosition(e);
    return this.lineStartOffsetByLineIdx[t.lineNumber - 1] + t.column - 1;
  }
  _validatePosition(e) {
    if (e.lineNumber < 1)
      return new de(1, 1);
    const t = this.textLength.lineCount + 1;
    if (e.lineNumber > t) {
      const r = this.getLineLength(t);
      return new de(t, r + 1);
    }
    if (e.column < 1)
      return new de(e.lineNumber, 1);
    const n = this.getLineLength(e.lineNumber);
    return e.column - 1 > n ? new de(e.lineNumber, n + 1) : e;
  }
  getPosition(e) {
    const t = nA(this.lineStartOffsetByLineIdx, (s) => s <= e), n = t + 1, r = e - this.lineStartOffsetByLineIdx[t] + 1;
    return new de(n, r);
  }
  get textLength() {
    const e = this.lineStartOffsetByLineIdx.length - 1;
    return new Wx.deps.TextLength(e, this.text.length - this.lineStartOffsetByLineIdx[e]);
  }
  getLineLength(e) {
    return this.lineEndOffsetByLineIdx[e - 1] - this.lineStartOffsetByLineIdx[e - 1];
  }
}
class Ufe {
  constructor() {
    this._transformer = void 0;
  }
  get endPositionExclusive() {
    return this.length.addToPosition(new de(1, 1));
  }
  get lineRange() {
    return this.length.toLineRange();
  }
  getValue() {
    return this.getValueOfRange(this.length.toRange());
  }
  getValueOfOffsetRange(e) {
    return this.getValueOfRange(this.getTransformer().getRange(e));
  }
  getLineLength(e) {
    return this.getValueOfRange(new z(e, 1, e, Number.MAX_SAFE_INTEGER)).length;
  }
  getTransformer() {
    return this._transformer || (this._transformer = new oK(this.getValue())), this._transformer;
  }
  getLineAt(e) {
    return this.getValueOfRange(new z(e, 1, e, Number.MAX_SAFE_INTEGER));
  }
}
class jht extends Ufe {
  constructor(e, t) {
    K3(t >= 1), super(), this._getLineContent = e, this._lineCount = t;
  }
  getValueOfRange(e) {
    if (e.startLineNumber === e.endLineNumber)
      return this._getLineContent(e.startLineNumber).substring(e.startColumn - 1, e.endColumn - 1);
    let t = this._getLineContent(e.startLineNumber).substring(e.startColumn - 1);
    for (let n = e.startLineNumber + 1; n < e.endLineNumber; n++)
      t += `
` + this._getLineContent(n);
    return t += `
` + this._getLineContent(e.endLineNumber).substring(0, e.endColumn - 1), t;
  }
  getLineLength(e) {
    return this._getLineContent(e).length;
  }
  get length() {
    const e = this._getLineContent(this._lineCount);
    return new ta(this._lineCount - 1, e.length);
  }
}
class B7 extends jht {
  constructor(e) {
    super((t) => e[t - 1], e.length);
  }
}
class u1 extends Ufe {
  constructor(e) {
    super(), this.value = e, this._t = new oK(this.value);
  }
  getValueOfRange(e) {
    return this._t.getOffsetRange(e).substring(this.value);
  }
  get length() {
    return this._t.textLength;
  }
}
class Md {
  static fromStringEdit(e, t) {
    const n = e.replacements.map((r) => Wo.fromStringReplacement(r, t));
    return new Md(n);
  }
  static fromParallelReplacementsUnsorted(e) {
    const t = e.slice().sort(yl((n) => n.range, z.compareRangesUsingStarts));
    return new Md(t);
  }
  constructor(e) {
    this.replacements = e, J1(() => hB(e, (t, n) => t.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())));
  }
  mapPosition(e) {
    let t = 0, n = 0, r = 0;
    for (const s of this.replacements) {
      const o = s.range.getStartPosition();
      if (e.isBeforeOrEqual(o))
        break;
      const a = s.range.getEndPosition(), l = ta.ofText(s.text);
      if (e.isBefore(a)) {
        const c = new de(o.lineNumber + t, o.column + (o.lineNumber + t === n ? r : 0)), u = l.addToPosition(c);
        return H7(c, u);
      }
      o.lineNumber + t !== n && (r = 0), t += l.lineCount - (s.range.endLineNumber - s.range.startLineNumber), l.lineCount === 0 ? a.lineNumber !== o.lineNumber ? r += l.columnCount - (a.column - 1) : r += l.columnCount - (a.column - o.column) : r = l.columnCount, n = a.lineNumber + t;
    }
    return new de(e.lineNumber + t, e.column + (e.lineNumber + t === n ? r : 0));
  }
  mapRange(e) {
    function t(o) {
      return o instanceof de ? o : o.getStartPosition();
    }
    function n(o) {
      return o instanceof de ? o : o.getEndPosition();
    }
    const r = t(this.mapPosition(e.getStartPosition())), s = n(this.mapPosition(e.getEndPosition()));
    return H7(r, s);
  }
  apply(e) {
    let t = "", n = new de(1, 1);
    for (const s of this.replacements) {
      const o = s.range, a = o.getStartPosition(), l = o.getEndPosition(), c = H7(n, a);
      c.isEmpty() || (t += e.getValueOfRange(c)), t += s.text, n = l;
    }
    const r = H7(n, e.endPositionExclusive);
    return r.isEmpty() || (t += e.getValueOfRange(r)), t;
  }
  applyToString(e) {
    const t = new u1(e);
    return this.apply(t);
  }
  getNewRanges() {
    const e = [];
    let t = 0, n = 0, r = 0;
    for (const s of this.replacements) {
      const o = ta.ofText(s.text), a = de.lift({
        lineNumber: s.range.startLineNumber + n,
        column: s.range.startColumn + (s.range.startLineNumber === t ? r : 0)
      }), l = o.createRange(a);
      e.push(l), n = l.endLineNumber - s.range.endLineNumber, r = l.endColumn - s.range.endColumn, t = s.range.endLineNumber;
    }
    return e;
  }
  toReplacement(e) {
    if (this.replacements.length === 0)
      throw new Wt();
    if (this.replacements.length === 1)
      return this.replacements[0];
    const t = this.replacements[0].range.getStartPosition(), n = this.replacements[this.replacements.length - 1].range.getEndPosition();
    let r = "";
    for (let s = 0; s < this.replacements.length; s++) {
      const o = this.replacements[s];
      if (r += o.text, s < this.replacements.length - 1) {
        const a = this.replacements[s + 1], l = z.fromPositions(o.range.getEndPosition(), a.range.getStartPosition()), c = e.getValueOfRange(l);
        r += c;
      }
    }
    return new Wo(z.fromPositions(t, n), r);
  }
  toString(e) {
    return e === void 0 ? this.replacements.map((t) => t.toString()).join(`
`) : typeof e == "string" ? this.toString(new u1(e)) : this.replacements.length === 0 ? "" : this.replacements.map((t) => {
      const r = e.getValueOfRange(t.range), s = z.fromPositions(new de(Math.max(1, t.range.startLineNumber - 1), 1), t.range.getStartPosition());
      let o = e.getValueOfRange(s);
      o.length > 10 && (o = "..." + o.substring(o.length - 10));
      const a = z.fromPositions(t.range.getEndPosition(), new de(t.range.endLineNumber + 1, 1));
      let l = e.getValueOfRange(a);
      l.length > 10 && (l = l.substring(0, 10) + "...");
      let c = r;
      if (c.length > 10) {
        const d = Math.floor(5);
        c = c.substring(0, d) + "..." + c.substring(c.length - d);
      }
      let u = t.text;
      if (u.length > 10) {
        const d = Math.floor(5);
        u = u.substring(0, d) + "..." + u.substring(u.length - d);
      }
      return c.length === 0 ? `${o}❰${u}❱${l}` : `${o}❰${c}↦${u}❱${l}`;
    }).join(`
`);
  }
}
class Wo {
  static joinReplacements(e, t) {
    if (e.length === 0)
      throw new Wt();
    if (e.length === 1)
      return e[0];
    const n = e[0].range.getStartPosition(), r = e[e.length - 1].range.getEndPosition();
    let s = "";
    for (let o = 0; o < e.length; o++) {
      const a = e[o];
      if (s += a.text, o < e.length - 1) {
        const l = e[o + 1], c = z.fromPositions(a.range.getEndPosition(), l.range.getStartPosition()), u = t.getValueOfRange(c);
        s += u;
      }
    }
    return new Wo(z.fromPositions(n, r), s);
  }
  static fromStringReplacement(e, t) {
    return new Wo(t.getTransformer().getRange(e.replaceRange), e.newText);
  }
  static delete(e) {
    return new Wo(e, "");
  }
  constructor(e, t) {
    this.range = e, this.text = t;
  }
  get isEmpty() {
    return this.range.isEmpty() && this.text.length === 0;
  }
  static equals(e, t) {
    return e.range.equalsRange(t.range) && e.text === t.text;
  }
  equals(e) {
    return Wo.equals(this, e);
  }
  removeCommonPrefixAndSuffix(e) {
    return this.removeCommonPrefix(e).removeCommonSuffix(e);
  }
  removeCommonPrefix(e) {
    const t = e.getValueOfRange(this.range).replaceAll(`\r
`, `
`), n = this.text.replaceAll(`\r
`, `
`), r = jg(t, n), s = ta.ofText(t.substring(0, r)).addToPosition(this.range.getStartPosition()), o = n.substring(r), a = z.fromPositions(s, this.range.getEndPosition());
    return new Wo(a, o);
  }
  removeCommonSuffix(e) {
    const t = e.getValueOfRange(this.range).replaceAll(`\r
`, `
`), n = this.text.replaceAll(`\r
`, `
`), r = Gy(t, n), s = ta.ofText(t.substring(0, t.length - r)).addToPosition(this.range.getStartPosition()), o = n.substring(0, n.length - r), a = z.fromPositions(this.range.getStartPosition(), s);
    return new Wo(a, o);
  }
  toString() {
    const e = this.range.getStartPosition(), t = this.range.getEndPosition();
    return `(${e.lineNumber},${e.column} -> ${t.lineNumber},${t.column}): "${this.text}"`;
  }
}
function H7(i, e) {
  if (i.lineNumber === e.lineNumber && i.column === Number.MAX_SAFE_INTEGER)
    return z.fromPositions(e, e);
  if (!i.isBeforeOrEqual(e))
    throw new Wt("start must be before end");
  return new z(i.lineNumber, i.column, e.lineNumber, e.column);
}
$ht({
  StringEdit: Jy,
  StringReplacement: Ya,
  TextReplacement: Wo,
  TextEdit: Md,
  TextLength: ta
});
var Ght = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, qht = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let mre = class extends ge {
  constructor(e, t, n, r) {
    super(), this._domNode = e, this._context = t, this._viewController = n, this._accessibilityService = r, this._selectionChangeListener = this._register(new er()), this._accessibilityPageSize = 1, this._ignoreSelectionChangeTime = 0, this._strategy = new O3e(), this.onConfigurationChanged(this._context.configuration.options);
  }
  updateScreenReaderContent(e) {
    const t = this._domNode.domNode, n = rr().document.activeElement;
    if (!n || n !== t)
      return;
    if (this._accessibilityService.isScreenReaderOptimized()) {
      this._state = this._getScreenReaderContentState(e), t.textContent !== this._state.value && (this._setIgnoreSelectionChangeTime("setValue"), t.textContent = this._state.value);
      const s = rr().document.getSelection();
      if (!s)
        return;
      const o = this._getScreenReaderRange(this._state.selectionStart, this._state.selectionEnd);
      if (!o)
        return;
      this._setIgnoreSelectionChangeTime("setRange"), s.setBaseAndExtent(o.anchorNode, o.anchorOffset, o.focusNode, o.focusOffset);
    } else
      this._state = void 0, this._setIgnoreSelectionChangeTime("setValue"), this._domNode.domNode.textContent = "";
  }
  updateScrollTop(e) {
    if (!this._state)
      return;
    const t = this._context.viewModel.viewLayout, n = this._state.startPositionWithinEditor.lineNumber, r = t.getVerticalOffsetForLineNumber(n), s = t.getVerticalOffsetForLineNumber(e.positionLineNumber);
    this._domNode.domNode.scrollTop = s - r;
  }
  onFocusChange(e) {
    e ? this._selectionChangeListener.value = this._setSelectionChangeListener() : this._selectionChangeListener.value = void 0;
  }
  onConfigurationChanged(e) {
    this._accessibilityPageSize = e.get(
      3
      /* EditorOption.accessibilityPageSize */
    );
  }
  onWillCut() {
    this._setIgnoreSelectionChangeTime("onCut");
  }
  onWillPaste() {
    this._setIgnoreSelectionChangeTime("onWillPaste");
  }
  // --- private methods
  _setIgnoreSelectionChangeTime(e) {
    this._ignoreSelectionChangeTime = Date.now();
  }
  _setSelectionChangeListener() {
    let e = 0;
    return Ce(this._domNode.domNode.ownerDocument, "selectionchange", () => {
      const t = this._accessibilityService.isScreenReaderOptimized();
      if (!this._state || !t || !sb.enabled || !(rr().document.activeElement === this._domNode.domNode))
        return;
      const s = rr().document.getSelection();
      if (!s || s.rangeCount === 0)
        return;
      const a = s.getRangeAt(0), l = Date.now(), c = l - e;
      if (e = l, c < 5)
        return;
      const u = l - this._ignoreSelectionChangeTime;
      this._ignoreSelectionChangeTime = 0, !(u < 100) && this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context, this._state, s.direction, a));
    });
  }
  _getScreenReaderContentState(e) {
    const t = this._strategy.fromEditorSelection(
      this._context.viewModel,
      e,
      this._accessibilityPageSize,
      this._accessibilityService.getAccessibilitySupport() === 0
      /* AccessibilitySupport.Unknown */
    ), n = this._context.viewModel.model.getPositionAt(1 / 0);
    let r = t.value;
    return n.column === 1 && e.getEndPosition().equals(n) && (r += `
`), t.value = r, t;
  }
  _getScreenReaderRange(e, t) {
    const n = this._domNode.domNode.firstChild;
    if (!n)
      return;
    const r = new globalThis.Range();
    return r.setStart(n, e), r.setEnd(n, t), {
      anchorNode: n,
      anchorOffset: e,
      focusNode: n,
      focusOffset: t
    };
  }
  _getEditorSelectionFromDomRange(e, t, n, r) {
    const s = e.viewModel, o = s.model, l = s.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor), c = o.getOffsetAt(l);
    let u = r.startOffset + c, d = r.endOffset + c;
    if (o.getEndOfLineSequence() === 1) {
      const w = t.value, E = new oK(w), L = E.getPosition(r.startOffset), T = E.getPosition(r.endOffset);
      u += L.lineNumber - 1, d += T.lineNumber - 1;
    }
    const g = o.getPositionAt(u), m = o.getPositionAt(d), _ = n === "forward" ? g : m, v = n === "forward" ? m : g;
    return bt.fromPositions(_, v);
  }
};
mre = Ght([
  qht(3, Qa)
], mre);
var Kht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, nTe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let _re = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._domNode = e, this._context = t, this._viewController = n, this._keybindingService = r, this._accessibilityService = s, this._contentLeft = 1, this._contentWidth = 1, this._contentHeight = 1, this._divWidth = 1, this._primarySelection = new bt(1, 1, 1, 1), this._primaryCursorVisibleRange = null, this._state = this._register(new er()), this._instantiateScreenReaderContent(), this._updateConfigurationSettings(), this._updateDomAttributes();
  }
  onWillPaste() {
    var e;
    (e = this._state.value) == null || e.onWillPaste();
  }
  onWillCut() {
    var e;
    (e = this._state.value) == null || e.onWillCut();
  }
  handleFocusChange(e) {
    var t;
    (t = this._state.value) == null || t.onFocusChange(e), this.writeScreenReaderContent();
  }
  onConfigurationChanged(e) {
    this._instantiateScreenReaderContent(), this._updateConfigurationSettings(), this._updateDomAttributes(), e.hasChanged(
      2
      /* EditorOption.accessibilitySupport */
    ) && this.writeScreenReaderContent();
  }
  _instantiateScreenReaderContent() {
    const e = this._context.configuration.options.get(
      107
      /* EditorOption.renderRichScreenReaderContent */
    );
    this._renderRichContent !== e && (this._renderRichContent = e, this._state.value = this._createScreenReaderContent(e));
  }
  _createScreenReaderContent(e) {
    return e ? new pre(this._domNode, this._context, this._viewController, this._accessibilityService) : new mre(this._domNode, this._context, this._viewController, this._accessibilityService);
  }
  _updateConfigurationSettings() {
    var r;
    const e = this._context.configuration.options, t = e.get(
      165
      /* EditorOption.layoutInfo */
    ), n = t.wrappingColumn;
    this._contentLeft = t.contentLeft, this._contentWidth = t.contentWidth, this._contentHeight = t.height, this._fontInfo = e.get(
      59
      /* EditorOption.fontInfo */
    ), this._divWidth = Math.round(n * this._fontInfo.typicalHalfwidthCharacterWidth), (r = this._state.value) == null || r.onConfigurationChanged(e);
  }
  _updateDomAttributes() {
    const e = this._context.configuration.options;
    this._domNode.domNode.setAttribute("role", "textbox"), this._domNode.domNode.setAttribute("aria-required", e.get(
      9
      /* EditorOption.ariaRequired */
    ) ? "true" : "false"), this._domNode.domNode.setAttribute("aria-multiline", "true"), this._domNode.domNode.setAttribute("aria-autocomplete", e.get(
      104
      /* EditorOption.readOnly */
    ) ? "none" : "both"), this._domNode.domNode.setAttribute("aria-roledescription", S(55, "editor")), this._domNode.domNode.setAttribute("aria-label", hre(e, this._keybindingService));
    const t = this._context.viewModel.model.getOptions().tabSize, n = e.get(
      59
      /* EditorOption.fontInfo */
    ).spaceWidth;
    this._domNode.domNode.style.tabSize = `${t * n}px`;
    const r = e.get(
      154
      /* EditorOption.wordWrapOverride2 */
    ), s = r === "inherit" ? e.get(
      153
      /* EditorOption.wordWrapOverride1 */
    ) : r, o = s === "inherit" ? e.get(
      149
      /* EditorOption.wordWrap */
    ) : s;
    this._domNode.domNode.style.textWrap = o === "off" ? "nowrap" : "wrap";
  }
  onCursorStateChanged(e) {
    this._primarySelection = e.selections[0] ?? new bt(1, 1, 1, 1);
  }
  prepareRender(e) {
    this.writeScreenReaderContent(), this._primaryCursorVisibleRange = e.visibleRangeForPosition(this._primarySelection.getPosition());
  }
  render(e) {
    var l;
    if (!this._primaryCursorVisibleRange) {
      this._renderAtTopLeft();
      return;
    }
    const t = this._context.viewLayout.getCurrentScrollLeft(), n = this._contentLeft + this._primaryCursorVisibleRange.left - t;
    if (n < this._contentLeft || n > this._contentLeft + this._contentWidth) {
      this._renderAtTopLeft();
      return;
    }
    const r = this._context.viewLayout.getCurrentScrollTop(), s = this._primarySelection.positionLineNumber, o = this._context.viewLayout.getVerticalOffsetForLineNumber(s) - r;
    if (o < 0 || o > this._contentHeight) {
      this._renderAtTopLeft();
      return;
    }
    const a = this._context.viewLayout.getLineHeightForLineNumber(s);
    this._doRender(o, this._contentLeft, this._divWidth, a), (l = this._state.value) == null || l.updateScrollTop(this._primarySelection);
  }
  _renderAtTopLeft() {
    this._doRender(0, 0, this._contentWidth, 1);
  }
  _doRender(e, t, n, r) {
    Ma(this._domNode, this._fontInfo), this._domNode.setTop(e), this._domNode.setLeft(t), this._domNode.setWidth(n), this._domNode.setHeight(r), this._domNode.setLineHeight(r);
  }
  setAriaOptions(e) {
    e.activeDescendant ? (this._domNode.setAttribute("aria-haspopup", "true"), this._domNode.setAttribute("aria-autocomplete", "list"), this._domNode.setAttribute("aria-activedescendant", e.activeDescendant)) : (this._domNode.setAttribute("aria-haspopup", "false"), this._domNode.setAttribute("aria-autocomplete", "both"), this._domNode.removeAttribute("aria-activedescendant")), e.role && this._domNode.setAttribute("role", e.role);
  }
  writeScreenReaderContent() {
    var e;
    (e = this._state.value) == null || e.updateScreenReaderContent(this._primarySelection);
  }
};
_re = Kht([
  nTe(3, Fi),
  nTe(4, Qa)
], _re);
var bre;
(function(i) {
  function e(t, n) {
    return new t.EditContext(n);
  }
  i.create = e;
})(bre || (bre = {}));
class Yht {
  constructor() {
    this._nativeEditContextMapping = /* @__PURE__ */ new Map();
  }
  register(e, t) {
    return this._nativeEditContextMapping.set(e, t), {
      dispose: () => {
        this._nativeEditContextMapping.delete(e);
      }
    };
  }
  get(e) {
    return this._nativeEditContextMapping.get(e);
  }
}
const zfe = new Yht();
var Xht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, iTe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, kF;
(function(i) {
  i.NONE = "edit-context-composition-none", i.SECONDARY = "edit-context-composition-secondary", i.PRIMARY = "edit-context-composition-primary";
})(kF || (kF = {}));
let _U = class extends A3e {
  constructor(e, t, n, r, s, o, a) {
    super(t), this._viewController = r, this._visibleRangeProvider = s, this.logService = a, this._previousEditContextSelection = new Tt(0, 0), this._editContextPrimarySelection = new bt(1, 1, 1, 1), this._decorations = [], this._primarySelection = new bt(1, 1, 1, 1), this._targetWindowId = -1, this._scrollTop = 0, this._scrollLeft = 0, this.domNode = new YV(document.createElement("div")), this.domNode.setClassName("native-edit-context"), this._imeTextArea = new YV(document.createElement("textarea")), this._imeTextArea.setClassName("ime-text-area"), this._imeTextArea.setAttribute("readonly", "true"), this._imeTextArea.setAttribute("tabindex", "-1"), this._imeTextArea.setAttribute("aria-hidden", "true"), this.domNode.setAttribute("autocorrect", "off"), this.domNode.setAttribute("autocapitalize", "off"), this.domNode.setAttribute("autocomplete", "off"), this.domNode.setAttribute("spellcheck", "false"), this._updateDomAttributes(), n.appendChild(this.domNode), n.appendChild(this._imeTextArea), this._parent = n.domNode, this._focusTracker = this._register(new gre(a, this.domNode.domNode, (d) => {
      a.trace("NativeEditContext#handleFocusChange : ", d), this._screenReaderSupport.handleFocusChange(d), this._context.viewModel.setHasFocus(d);
    }));
    const l = At(this.domNode.domNode);
    this._editContext = bre.create(l), this.setEditContextOnDomNode(), this._screenReaderSupport = this._register(o.createInstance(_re, this.domNode, t, this._viewController)), this._register(Ce(this.domNode.domNode, "copy", (d) => {
      this.logService.trace("NativeEditContext#copy"), this._ensureClipboardGetsEditorSelection(d);
    })), this._register(Ce(this.domNode.domNode, "cut", (d) => {
      this.logService.trace("NativeEditContext#cut"), this._screenReaderSupport.onWillCut(), this._ensureClipboardGetsEditorSelection(d), this.logService.trace("NativeEditContext#cut (before viewController.cut)"), this._viewController.cut();
    })), this._register(Ce(this.domNode.domNode, "keyup", (d) => this._onKeyUp(d))), this._register(Ce(this.domNode.domNode, "keydown", async (d) => this._onKeyDown(d))), this._register(Ce(this._imeTextArea.domNode, "keyup", (d) => this._onKeyUp(d))), this._register(Ce(this._imeTextArea.domNode, "keydown", async (d) => this._onKeyDown(d))), this._register(Ce(this.domNode.domNode, "beforeinput", async (d) => {
      (d.inputType === "insertParagraph" || d.inputType === "insertLineBreak") && this._onType(this._viewController, { text: `
`, replacePrevCharCnt: 0, replaceNextCharCnt: 0, positionDelta: 0 });
    })), this._register(Ce(this.domNode.domNode, "paste", (d) => {
      if (this.logService.trace("NativeEditContext#paste"), d.preventDefault(), !d.clipboardData)
        return;
      let [h, g] = Fx.getTextData(d.clipboardData);
      if (this.logService.trace("NativeEditContext#paste with id : ", g == null ? void 0 : g.id, " with text.length: ", h.length), !h)
        return;
      g = g || ib.INSTANCE.get(h);
      let m = !1, _ = null, v = null;
      g && (m = this._context.configuration.options.get(
        45
        /* EditorOption.emptySelectionClipboard */
      ) && !!g.isFromEmptySelection, _ = typeof g.multicursorText < "u" ? g.multicursorText : null, v = g.mode), this.logService.trace("NativeEditContext#paste (before viewController.paste)"), this._viewController.paste(h, m, _, v);
    })), this._register($M(this._editContext, "textformatupdate", (d) => this._handleTextFormatUpdate(d))), this._register($M(this._editContext, "characterboundsupdate", (d) => this._updateCharacterBounds(d)));
    let c;
    this._register($M(this._editContext, "textupdate", (d) => {
      const h = d.text;
      if (h.length === 1) {
        const g = h.charCodeAt(0);
        if (Qo(g)) {
          c = h;
          return;
        }
        if (ew(g) && c) {
          const m = {
            text: c + h,
            selectionEnd: d.selectionEnd,
            selectionStart: d.selectionStart,
            updateRangeStart: d.updateRangeStart - 1,
            updateRangeEnd: d.updateRangeEnd - 1
          };
          c = void 0, this._emitTypeEvent(this._viewController, m);
          return;
        }
      }
      this._emitTypeEvent(this._viewController, d);
    })), this._register($M(this._editContext, "compositionstart", (d) => {
      this._updateEditContext(), this._viewController.compositionStart(), this._context.viewModel.onCompositionStart();
    })), this._register($M(this._editContext, "compositionend", (d) => {
      this._updateEditContext(), this._viewController.compositionEnd(), this._context.viewModel.onCompositionEnd();
    }));
    let u = !1;
    this._register(sb.onDidChange(() => {
      sb.enabled && u && (this._focusTracker.resume(), this.domNode.focus(), u = !1), !sb.enabled && this.isFocused() && (this._focusTracker.pause(), this._imeTextArea.focus(), u = !0);
    })), this._register(zfe.register(e, this));
  }
  // --- Public methods ---
  dispose() {
    this.domNode.domNode.editContext = void 0, this.domNode.domNode.blur(), this.domNode.domNode.remove(), this._imeTextArea.domNode.remove(), super.dispose();
  }
  setAriaOptions(e) {
    this._screenReaderSupport.setAriaOptions(e);
  }
  /* Last rendered data needed for correct hit-testing and determining the mouse position.
   * Without this, the selection will blink as incorrect mouse position is calculated */
  getLastRenderData() {
    return this._primarySelection.getPosition();
  }
  prepareRender(e) {
    this._screenReaderSupport.prepareRender(e), this._updateSelectionAndControlBounds(e);
  }
  render(e) {
    this._screenReaderSupport.render(e);
  }
  onCursorStateChanged(e) {
    return this._primarySelection = e.modelSelections[0] ?? new bt(1, 1, 1, 1), this._screenReaderSupport.onCursorStateChanged(e), this._updateEditContext(), !0;
  }
  onConfigurationChanged(e) {
    return this._screenReaderSupport.onConfigurationChanged(e), this._updateDomAttributes(), !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return this._updateEditContextOnLineChange(e.fromLineNumber, e.fromLineNumber + e.count - 1), !0;
  }
  onLinesDeleted(e) {
    return this._updateEditContextOnLineChange(e.fromLineNumber, e.toLineNumber), !0;
  }
  onLinesInserted(e) {
    return this._updateEditContextOnLineChange(e.fromLineNumber, e.toLineNumber), !0;
  }
  _updateEditContextOnLineChange(e, t) {
    this._editContextPrimarySelection.endLineNumber < e || this._editContextPrimarySelection.startLineNumber > t || this._updateEditContext();
  }
  onScrollChanged(e) {
    return this._scrollLeft = e.scrollLeft, this._scrollTop = e.scrollTop, !0;
  }
  onZonesChanged(e) {
    return !0;
  }
  onWillPaste() {
    this.logService.trace("NativeEditContext#onWillPaste"), this._onWillPaste();
  }
  _onWillPaste() {
    this._screenReaderSupport.onWillPaste();
  }
  onWillCopy() {
    this.logService.trace("NativeEditContext#onWillCopy"), this.logService.trace("NativeEditContext#isFocused : ", this.domNode.domNode === ea());
  }
  writeScreenReaderContent() {
    this._screenReaderSupport.writeScreenReaderContent();
  }
  isFocused() {
    return this._focusTracker.isFocused;
  }
  focus() {
    this._focusTracker.focus(), this.refreshFocusState();
  }
  refreshFocusState() {
    this._focusTracker.refreshFocusState();
  }
  // TODO: added as a workaround fix for https://github.com/microsoft/vscode/issues/229825
  // When this issue will be fixed the following should be removed.
  setEditContextOnDomNode() {
    const e = At(this.domNode.domNode), t = i4(e);
    this._targetWindowId !== t && (this.domNode.domNode.editContext = this._editContext, this._targetWindowId = t);
  }
  // --- Private methods ---
  _onKeyUp(e) {
    this._viewController.emitKeyUp(new wr(e));
  }
  _onKeyDown(e) {
    const t = new wr(e);
    t.keyCode === 114 && t.stopPropagation(), this._viewController.emitKeyDown(t);
  }
  _updateDomAttributes() {
    const e = this._context.configuration.options;
    this.domNode.domNode.setAttribute("tabindex", String(e.get(
      140
      /* EditorOption.tabIndex */
    )));
  }
  _updateEditContext() {
    const e = this._getNewEditContextState();
    e && (this._editContext.updateText(0, Number.MAX_SAFE_INTEGER, e.text ?? " "), this._editContext.updateSelection(e.selectionStartOffset, e.selectionEndOffset), this._editContextPrimarySelection = e.editContextPrimarySelection, this._previousEditContextSelection = new Tt(e.selectionStartOffset, e.selectionEndOffset));
  }
  _emitTypeEvent(e, t) {
    if (!this._editContext)
      return;
    const n = this._previousEditContextSelection.endExclusive, r = this._previousEditContextSelection.start;
    this._previousEditContextSelection = new Tt(t.selectionStart, t.selectionEnd);
    let s = 0, o = 0;
    t.updateRangeEnd > n && (s = t.updateRangeEnd - n), t.updateRangeStart < r && (o = r - t.updateRangeStart);
    let a = "";
    r < t.updateRangeStart && (a += this._editContext.text.substring(r, t.updateRangeStart)), a += t.text, n > t.updateRangeEnd && (a += this._editContext.text.substring(t.updateRangeEnd, n));
    let l = 0;
    t.selectionStart === t.selectionEnd && r === n && (l = t.selectionStart - (t.updateRangeStart + t.text.length));
    const c = {
      text: a,
      replacePrevCharCnt: o,
      replaceNextCharCnt: s,
      positionDelta: l
    };
    this._onType(e, c);
  }
  _onType(e, t) {
    t.replacePrevCharCnt || t.replaceNextCharCnt || t.positionDelta ? e.compositionType(t.text, t.replacePrevCharCnt, t.replaceNextCharCnt, t.positionDelta) : e.type(t.text);
  }
  _getNewEditContextState() {
    const e = this._primarySelection, t = this._context.viewModel.model;
    if (!t.isValidRange(e))
      return;
    const n = e.startLineNumber, r = e.endLineNumber, s = t.getLineMaxColumn(r), o = new z(n, 1, r, s), a = t.getValueInRange(
      o,
      0
      /* EndOfLinePreference.TextDefined */
    ), l = e.startColumn - 1, c = a.length + e.endColumn - s;
    return {
      text: a,
      selectionStartOffset: l,
      selectionEndOffset: c,
      editContextPrimarySelection: e
    };
  }
  _editContextStartPosition() {
    return new de(this._editContextPrimarySelection.startLineNumber, 1);
  }
  _handleTextFormatUpdate(e) {
    if (!this._editContext)
      return;
    const t = e.getTextFormats(), n = this._editContextStartPosition(), r = [];
    t.forEach((s) => {
      const o = this._context.viewModel.model, a = o.getOffsetAt(n), l = o.getPositionAt(a + s.rangeStart), c = o.getPositionAt(a + s.rangeEnd), u = z.fromPositions(l, c), d = s.underlineThickness.toLowerCase();
      let h = kF.NONE;
      switch (d) {
        case "thin":
          h = kF.SECONDARY;
          break;
        case "thick":
          h = kF.PRIMARY;
          break;
      }
      r.push({
        range: u,
        options: {
          description: "textFormatDecoration",
          inlineClassName: h
        }
      });
    }), this._decorations = this._context.viewModel.model.deltaDecorations(this._decorations, r);
  }
  _updateSelectionAndControlBounds(e) {
    if (!this._parent)
      return;
    const n = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ).contentLeft, r = this._parent.getBoundingClientRect(), s = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection), o = this._context.viewLayout.getVerticalOffsetForLineNumber(s.startLineNumber), a = r.top + o - this._scrollTop, c = this._context.viewLayout.getVerticalOffsetAfterLineNumber(s.endLineNumber) - o;
    let u = r.left + n - this._scrollLeft, d;
    if (this._primarySelection.isEmpty()) {
      const g = e.visibleRangeForPosition(s.getStartPosition());
      g && (u += g.left), d = 0;
    } else
      d = r.width - n;
    const h = new DOMRect(u, a, d, c);
    this._editContext.updateSelectionBounds(h), this._editContext.updateControlBounds(h);
  }
  _updateCharacterBounds(e) {
    if (!this._parent)
      return;
    const t = this._context.configuration.options, n = t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth, r = t.get(
      165
      /* EditorOption.layoutInfo */
    ).contentLeft, s = this._parent.getBoundingClientRect(), o = [], a = new oK(this._editContext.text);
    for (let l = e.rangeStart; l < e.rangeEnd; l++) {
      const c = a.getPosition(l), u = this._editContextPrimarySelection.startLineNumber - 1, d = new de(u + c.lineNumber, c.column), h = d.delta(0, 1), g = z.fromPositions(d, h), m = this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(g), _ = this._visibleRangeProvider.linesVisibleRangesForRange(m, !0) ?? [], v = m.startLineNumber, w = this._context.viewLayout.getVerticalOffsetForLineNumber(v), E = s.top + w - this._scrollTop;
      let L = 0, T = n;
      if (_.length > 0)
        for (const N of _[0].ranges) {
          L = N.left, T = N.width;
          break;
        }
      const D = this._context.viewLayout.getLineHeightForLineNumber(v);
      o.push(new DOMRect(s.left + r + L - this._scrollLeft, E, T, D));
    }
    this._editContext.updateCharacterBounds(e.rangeStart, o);
  }
  _ensureClipboardGetsEditorSelection(e) {
    const t = this._context.configuration.options, n = t.get(
      45
      /* EditorOption.emptySelectionClipboard */
    ), r = t.get(
      31
      /* EditorOption.copyWithSyntaxHighlighting */
    ), s = this._context.viewModel.getCursorStates().map((c) => c.modelState.selection), o = i3e(this._context.viewModel, s, n, r);
    let a;
    this.logService.getLevel() === da.Trace && (a = XT());
    const l = {
      version: 1,
      id: a,
      isFromEmptySelection: o.isFromEmptySelection,
      multicursorText: o.multicursorText,
      mode: o.mode
    };
    ib.INSTANCE.set(
      // When writing "LINE\r\n" to the clipboard and then pasting,
      // Firefox pastes "LINE\n", so let's work around this quirk
      Zu ? o.text.replace(/\r\n/g, `
`) : o.text,
      l
    ), e.preventDefault(), e.clipboardData && Fx.setTextData(e.clipboardData, o.text, o.html, l), this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ", a, " with text.length: ", o.text.length);
  }
};
_U = Xht([
  iTe(5, xt),
  iTe(6, $r)
], _U);
class Zht extends fu {
  constructor(e, t) {
    super(e), this._viewGpuContext = t, this._gpuShapes = [], this._register(Xt((n) => this._updateEntries(n)));
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    return this._updateEntries(void 0), !0;
  }
  // --- end event handlers
  prepareRender(e) {
  }
  render(e) {
  }
  _updateEntries(e) {
    const t = this._context.configuration.options, n = t.get(
      116
      /* EditorOption.rulers */
    ), r = t.get(
      59
      /* EditorOption.fontInfo */
    ).typicalHalfwidthCharacterWidth, s = this._viewGpuContext.devicePixelRatio.read(e);
    for (let o = 0, a = n.length; o < a; o++) {
      const l = n[o], c = this._gpuShapes[o], u = l.color ? De.fromHex(l.color) : this._context.theme.getColor(Mut) ?? De.white, d = [
        l.column * r * s,
        0,
        Math.max(1, Math.ceil(s)),
        Number.MAX_SAFE_INTEGER,
        u.rgba.r / 255,
        u.rgba.g / 255,
        u.rgba.b / 255,
        u.rgba.a
      ];
      c ? c.setRaw(d) : this._gpuShapes[o] = this._viewGpuContext.rectangleRenderer.register(...d);
    }
    for (; this._gpuShapes.length > n.length; )
      this._gpuShapes.splice(-1, 1)[0].dispose();
  }
}
const jj = class jj extends Ew {
  constructor(e, t) {
    super(), this._viewGpuContext = t, this._context = e, this._renderResult = null, this._context.addEventHandler(this);
  }
  dispose() {
    this._context.removeEventHandler(this), this._renderResult = null, super.dispose();
  }
  // --- begin event handlers
  onConfigurationChanged(e) {
    return !0;
  }
  onCursorStateChanged(e) {
    return !0;
  }
  onFlushed(e) {
    return !0;
  }
  onLinesChanged(e) {
    return !0;
  }
  onLinesDeleted(e) {
    return !0;
  }
  onLinesInserted(e) {
    return !0;
  }
  onScrollChanged(e) {
    return e.scrollTopChanged;
  }
  onZonesChanged(e) {
    return !0;
  }
  onDecorationsChanged(e) {
    return !0;
  }
  // --- end event handlers
  prepareRender(e) {
    const t = e.visibleRange.startLineNumber, n = e.visibleRange.endLineNumber, r = e.viewportData, s = new cU(this._context.configuration, this._context.theme.type), o = [];
    for (let a = t; a <= n; a++) {
      const l = a - t, c = this._viewGpuContext.canRenderDetailed(s, r, a);
      o[l] = c.length ? `<div class="${jj.CLASS_NAME}" title="Cannot render on GPU: ${c.join(", ")}"></div>` : "";
    }
    this._renderResult = o;
  }
  render(e, t) {
    if (!this._renderResult)
      return "";
    const n = t - e;
    return n < 0 || n >= this._renderResult.length ? "" : this._renderResult[n];
  }
};
jj.CLASS_NAME = "gpu-mark";
let vre = jj;
var Qht = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Jht = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let yre = class extends YT {
  constructor(e, t, n, r, s, o, a, l, c) {
    super(), this._instantiationService = c, this._shouldRecomputeGlyphMarginLanes = !1, this._ownerID = t, this._widgetFocusTracker = this._register(new eft(e, l)), this._register(this._widgetFocusTracker.onChange(() => {
      this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus());
    })), this._selections = [new bt(1, 1, 1, 1)], this._renderAnimationFrame = null, this._overflowGuardContainer = Gi(document.createElement("div")), gm.write(
      this._overflowGuardContainer,
      3
      /* PartFingerprint.OverflowGuard */
    ), this._overflowGuardContainer.setClassName("overflow-guard"), this._viewController = new cut(r, o, a, n), this._context = new Jdt(r, s, o), this._context.addEventHandler(this), this._viewParts = [], this._editContextEnabled = this._context.configuration.options.get(
      170
      /* EditorOption.effectiveEditContext */
    ), this._accessibilitySupport = this._context.configuration.options.get(
      2
      /* EditorOption.accessibilitySupport */
    ), this._editContext = this._instantiateEditContext(), this._viewParts.push(this._editContext), this._linesContent = Gi(document.createElement("div")), this._linesContent.setClassName("lines-content monaco-editor-background"), this._linesContent.setPosition("absolute"), this.domNode = Gi(document.createElement("div")), this.domNode.setClassName(this._getEditorClassName()), this.domNode.setAttribute("role", "code"), this._context.configuration.options.get(
      46
      /* EditorOption.experimentalGpuAcceleration */
    ) === "on" && (this._viewGpuContext = this._instantiationService.createInstance(Cc, this._context)), this._scrollbar = new odt(this._context, this._linesContent, this.domNode, this._overflowGuardContainer), this._viewParts.push(this._scrollbar), this._viewLines = new ire(this._context, this._viewGpuContext, this._linesContent), this._viewGpuContext && (this._viewLinesGpu = this._instantiationService.createInstance(dre, this._context, this._viewGpuContext)), this._viewZones = new Kdt(this._context), this._viewParts.push(this._viewZones);
    const u = new Hdt(this._context);
    this._viewParts.push(u);
    const d = new zdt(this._context);
    this._viewParts.push(d);
    const h = new dut(this._context);
    this._viewParts.push(h), h.addDynamicOverlay(new idt(this._context)), h.addDynamicOverlay(new are(this._context)), h.addDynamicOverlay(new bdt(this._context)), h.addDynamicOverlay(new sdt(this._context)), h.addDynamicOverlay(new Xdt(this._context));
    const g = new hut(this._context);
    this._viewParts.push(g), g.addDynamicOverlay(new rdt(this._context)), g.addDynamicOverlay(new Sdt(this._context)), g.addDynamicOverlay(new wdt(this._context)), g.addDynamicOverlay(new lU(this._context)), this._viewGpuContext && g.addDynamicOverlay(new vre(this._context, this._viewGpuContext)), this._glyphMarginWidgets = new cdt(this._context), this._viewParts.push(this._glyphMarginWidgets);
    const m = new uU(this._context);
    m.getDomNode().appendChild(this._viewZones.marginDomNode), m.getDomNode().appendChild(g.getDomNode()), m.getDomNode().appendChild(this._glyphMarginWidgets.domNode), this._viewParts.push(m), this._contentWidgets = new gut(this._context, this.domNode), this._viewParts.push(this._contentWidgets), this._viewCursors = new lre(this._context), this._viewParts.push(this._viewCursors), this._overlayWidgets = new Pdt(this._context, this.domNode), this._viewParts.push(this._overlayWidgets);
    const _ = this._viewGpuContext ? new Zht(this._context, this._viewGpuContext) : new Udt(this._context);
    this._viewParts.push(_);
    const v = new fut(this._context);
    this._viewParts.push(v);
    const w = new Mdt(this._context);
    if (this._viewParts.push(w), u) {
      const E = this._scrollbar.getOverviewRulerLayoutInfo();
      E.parent.insertBefore(u.getDomNode(), E.insertBefore);
    }
    this._linesContent.appendChild(h.getDomNode()), "domNode" in _ && this._linesContent.appendChild(_.domNode), this._linesContent.appendChild(this._viewZones.domNode), this._linesContent.appendChild(this._viewLines.getDomNode()), this._linesContent.appendChild(this._contentWidgets.domNode), this._linesContent.appendChild(this._viewCursors.getDomNode()), this._overflowGuardContainer.appendChild(m.getDomNode()), this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()), this._viewGpuContext && this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas), this._overflowGuardContainer.appendChild(d.getDomNode()), this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()), this._overflowGuardContainer.appendChild(w.getDomNode()), this._overflowGuardContainer.appendChild(v.domNode), this.domNode.appendChild(this._overflowGuardContainer), l ? (l.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode), l.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)) : (this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode), this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)), this._applyLayout(), this._pointerHandler = this._register(new lut(this._context, this._viewController, this._createPointerHandlerHelper()));
  }
  _instantiateEditContext() {
    return this._context.configuration.options.get(
      170
      /* EditorOption.effectiveEditContext */
    ) ? this._instantiationService.createInstance(_U, this._ownerID, this._context, this._overflowGuardContainer, this._viewController, this._createTextAreaHandlerHelper()) : this._instantiationService.createInstance(fre, this._context, this._overflowGuardContainer, this._viewController, this._createTextAreaHandlerHelper());
  }
  _updateEditContext() {
    const e = this._context.configuration.options.get(
      170
      /* EditorOption.effectiveEditContext */
    ), t = this._context.configuration.options.get(
      2
      /* EditorOption.accessibilitySupport */
    );
    if (this._editContextEnabled === e && this._accessibilitySupport === t)
      return;
    this._editContextEnabled = e, this._accessibilitySupport = t;
    const n = this._editContext.isFocused(), r = this._viewParts.indexOf(this._editContext);
    this._editContext.dispose(), this._editContext = this._instantiateEditContext(), n && this._editContext.focus(), r !== -1 && this._viewParts.splice(r, 1, this._editContext);
  }
  _computeGlyphMarginLanes() {
    const e = this._context.viewModel.model, t = this._context.viewModel.glyphLanes;
    let n = [], r = 0;
    n = n.concat(e.getAllMarginDecorations().map((s) => {
      var a, l;
      const o = ((a = s.options.glyphMargin) == null ? void 0 : a.position) ?? fm.Center;
      return r = Math.max(r, s.range.endLineNumber), { range: s.range, lane: o, persist: (l = s.options.glyphMargin) == null ? void 0 : l.persistLane };
    })), n = n.concat(this._glyphMarginWidgets.getWidgets().map((s) => {
      const o = e.validateRange(s.preference.range);
      return r = Math.max(r, o.endLineNumber), { range: o, lane: s.preference.lane };
    })), n.sort((s, o) => z.compareRangesUsingStarts(s.range, o.range)), t.reset(r);
    for (const s of n)
      t.push(s.lane, s.range, s.persist);
    return t;
  }
  _createPointerHandlerHelper() {
    return {
      viewDomNode: this.domNode.domNode,
      linesContentDomNode: this._linesContent.domNode,
      viewLinesDomNode: this._viewLines.getDomNode().domNode,
      viewLinesGpu: this._viewLinesGpu,
      focusTextArea: () => {
        this.focus();
      },
      dispatchTextAreaEvent: (e) => {
        this._editContext.domNode.domNode.dispatchEvent(e);
      },
      getLastRenderData: () => {
        const e = this._viewCursors.getLastRenderData() || [], t = this._editContext.getLastRenderData();
        return new Mct(e, t);
      },
      renderNow: () => {
        this.render(!0, !1);
      },
      shouldSuppressMouseDownOnViewZone: (e) => this._viewZones.shouldSuppressMouseDownOnViewZone(e),
      shouldSuppressMouseDownOnWidget: (e) => this._contentWidgets.shouldSuppressMouseDownOnWidget(e),
      getPositionFromDOMInfo: (e, t) => (this._flushAccumulatedAndRenderNow(), this._viewLines.getPositionFromDOMInfo(e, t)),
      visibleRangeForPosition: (e, t) => {
        var r;
        this._flushAccumulatedAndRenderNow();
        const n = new de(e, t);
        return this._viewLines.visibleRangeForPosition(n) ?? ((r = this._viewLinesGpu) == null ? void 0 : r.visibleRangeForPosition(n)) ?? null;
      },
      getLineWidth: (e) => {
        if (this._flushAccumulatedAndRenderNow(), this._viewLinesGpu) {
          const t = this._viewLinesGpu.getLineWidth(e);
          if (t !== void 0)
            return t;
        }
        return this._viewLines.getLineWidth(e);
      }
    };
  }
  _createTextAreaHandlerHelper() {
    return {
      visibleRangeForPosition: (e) => (this._flushAccumulatedAndRenderNow(), this._viewLines.visibleRangeForPosition(e)),
      linesVisibleRangesForRange: (e, t) => (this._flushAccumulatedAndRenderNow(), this._viewLines.linesVisibleRangesForRange(e, t))
    };
  }
  _applyLayout() {
    const t = this._context.configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
    this.domNode.setWidth(t.width), this.domNode.setHeight(t.height), this._overflowGuardContainer.setWidth(t.width), this._overflowGuardContainer.setHeight(t.height), this._linesContent.setWidth(16777216), this._linesContent.setHeight(16777216);
  }
  _getEditorClassName() {
    const e = this._editContext.isFocused() ? " focused" : "";
    return this._context.configuration.options.get(
      162
      /* EditorOption.editorClassName */
    ) + " " + tre(this._context.theme.type) + e;
  }
  // --- begin event handlers
  handleEvents(e) {
    super.handleEvents(e), this._scheduleRender();
  }
  onConfigurationChanged(e) {
    return this.domNode.setClassName(this._getEditorClassName()), this._updateEditContext(), this._applyLayout(), !1;
  }
  onCursorStateChanged(e) {
    return this._selections = e.selections, !1;
  }
  onDecorationsChanged(e) {
    return e.affectsGlyphMargin && (this._shouldRecomputeGlyphMarginLanes = !0), !1;
  }
  onFocusChanged(e) {
    return this.domNode.setClassName(this._getEditorClassName()), !1;
  }
  onThemeChanged(e) {
    return this._context.theme.update(e.theme), this.domNode.setClassName(this._getEditorClassName()), !1;
  }
  // --- end event handlers
  dispose() {
    var e, t;
    this._renderAnimationFrame !== null && (this._renderAnimationFrame.dispose(), this._renderAnimationFrame = null), this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(), this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(), this._context.removeEventHandler(this), (e = this._viewGpuContext) == null || e.dispose(), this._viewLines.dispose(), (t = this._viewLinesGpu) == null || t.dispose();
    for (const n of this._viewParts)
      n.dispose();
    super.dispose();
  }
  _scheduleRender() {
    var e;
    if (this._store.isDisposed)
      throw new Wt();
    if (this._renderAnimationFrame === null) {
      this._editContext instanceof _U && this._editContext.setEditContextOnDomNode();
      const t = this._createCoordinatedRendering();
      this._renderAnimationFrame = Cre.INSTANCE.scheduleCoordinatedRendering({
        window: At((e = this.domNode) == null ? void 0 : e.domNode),
        prepareRenderText: () => {
          if (this._store.isDisposed)
            throw new Wt();
          try {
            return t.prepareRenderText();
          } finally {
            this._renderAnimationFrame = null;
          }
        },
        renderText: () => {
          if (this._store.isDisposed)
            throw new Wt();
          return t.renderText();
        },
        prepareRender: (n, r) => {
          if (this._store.isDisposed)
            throw new Wt();
          return t.prepareRender(n, r);
        },
        render: (n, r) => {
          if (this._store.isDisposed)
            throw new Wt();
          return t.render(n, r);
        }
      });
    }
  }
  _flushAccumulatedAndRenderNow() {
    const e = this._createCoordinatedRendering();
    d1(() => e.prepareRenderText());
    const t = d1(() => e.renderText());
    if (t) {
      const [n, r] = t;
      d1(() => e.prepareRender(n, r)), d1(() => e.render(n, r));
    }
  }
  _getViewPartsToRender() {
    const e = [];
    let t = 0;
    for (const n of this._viewParts)
      n.shouldRender() && (e[t++] = n);
    return e;
  }
  _createCoordinatedRendering() {
    return {
      prepareRenderText: () => {
        if (this._shouldRecomputeGlyphMarginLanes) {
          this._shouldRecomputeGlyphMarginLanes = !1;
          const e = this._computeGlyphMarginLanes();
          this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes);
        }
        s1.onRenderStart();
      },
      renderText: () => {
        var r;
        if (!this.domNode.domNode.isConnected)
          return null;
        let e = this._getViewPartsToRender();
        if (!this._viewLines.shouldRender() && e.length === 0)
          return null;
        const t = this._context.viewLayout.getLinesViewportData();
        this._context.viewModel.setViewport(t.startLineNumber, t.endLineNumber, t.centeredLineNumber);
        const n = new Zdt(this._selections, t, this._context.viewLayout.getWhitespaceViewportData(), this._context.viewModel);
        return this._contentWidgets.shouldRender() && this._contentWidgets.onBeforeRender(n), this._viewLines.shouldRender() && (this._viewLines.renderText(n), this._viewLines.onDidRender(), e = this._getViewPartsToRender()), (r = this._viewLinesGpu) != null && r.shouldRender() && (this._viewLinesGpu.renderText(n), this._viewLinesGpu.onDidRender()), [e, new _ct(this._context.viewLayout, n, this._viewLines, this._viewLinesGpu)];
      },
      prepareRender: (e, t) => {
        for (const n of e)
          n.prepareRender(t);
      },
      render: (e, t) => {
        for (const n of e)
          n.render(t), n.onDidRender();
      }
    };
  }
  // --- BEGIN CodeEditor helpers
  delegateVerticalScrollbarPointerDown(e) {
    this._scrollbar.delegateVerticalScrollbarPointerDown(e);
  }
  delegateScrollFromMouseWheelEvent(e) {
    this._scrollbar.delegateScrollFromMouseWheelEvent(e);
  }
  restoreState(e) {
    this._context.viewModel.viewLayout.setScrollPosition(
      {
        scrollTop: e.scrollTop,
        scrollLeft: e.scrollLeft
      },
      1
      /* ScrollType.Immediate */
    ), this._context.viewModel.visibleLinesStabilized();
  }
  getOffsetForColumn(e, t) {
    const n = this._context.viewModel.model.validatePosition({
      lineNumber: e,
      column: t
    }), r = this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);
    this._flushAccumulatedAndRenderNow();
    const s = this._viewLines.visibleRangeForPosition(new de(r.lineNumber, r.column));
    return s ? s.left : -1;
  }
  getTargetAtClientPoint(e, t) {
    const n = this._pointerHandler.getTargetAtClientPoint(e, t);
    return n ? tK.convertViewToModelMouseTarget(n, this._context.viewModel.coordinatesConverter) : null;
  }
  createOverviewRuler(e) {
    return new Vdt(this._context, e);
  }
  change(e) {
    this._viewZones.changeViewZones(e), this._scheduleRender();
  }
  render(e, t) {
    if (t) {
      this._viewLines.forceShouldRender();
      for (const n of this._viewParts)
        n.forceShouldRender();
    }
    e ? this._flushAccumulatedAndRenderNow() : this._scheduleRender();
  }
  writeScreenReaderContent(e) {
    this._editContext.writeScreenReaderContent(e);
  }
  focus() {
    this._editContext.focus();
  }
  isFocused() {
    return this._editContext.isFocused();
  }
  isWidgetFocused() {
    return this._widgetFocusTracker.hasFocus();
  }
  setAriaOptions(e) {
    this._editContext.setAriaOptions(e);
  }
  addContentWidget(e) {
    this._contentWidgets.addWidget(e.widget), this.layoutContentWidget(e), this._scheduleRender();
  }
  layoutContentWidget(e) {
    var t, n, r, s;
    this._contentWidgets.setWidgetPosition(e.widget, ((t = e.position) == null ? void 0 : t.position) ?? null, ((n = e.position) == null ? void 0 : n.secondaryPosition) ?? null, ((r = e.position) == null ? void 0 : r.preference) ?? null, ((s = e.position) == null ? void 0 : s.positionAffinity) ?? null), this._scheduleRender();
  }
  removeContentWidget(e) {
    this._contentWidgets.removeWidget(e.widget), this._scheduleRender();
  }
  addOverlayWidget(e) {
    this._overlayWidgets.addWidget(e.widget), this.layoutOverlayWidget(e), this._scheduleRender();
  }
  layoutOverlayWidget(e) {
    this._overlayWidgets.setWidgetPosition(e.widget, e.position) && this._scheduleRender();
  }
  removeOverlayWidget(e) {
    this._overlayWidgets.removeWidget(e.widget), this._scheduleRender();
  }
  addGlyphMarginWidget(e) {
    this._glyphMarginWidgets.addWidget(e.widget), this._shouldRecomputeGlyphMarginLanes = !0, this._scheduleRender();
  }
  layoutGlyphMarginWidget(e) {
    const t = e.position;
    this._glyphMarginWidgets.setWidgetPosition(e.widget, t) && (this._shouldRecomputeGlyphMarginLanes = !0, this._scheduleRender());
  }
  removeGlyphMarginWidget(e) {
    this._glyphMarginWidgets.removeWidget(e.widget), this._shouldRecomputeGlyphMarginLanes = !0, this._scheduleRender();
  }
};
yre = Qht([
  Jht(8, xt)
], yre);
function d1(i) {
  try {
    return i();
  } catch (e) {
    return fn(e), null;
  }
}
const Gj = class Gj {
  constructor() {
    this._coordinatedRenderings = [], this._animationFrameRunners = /* @__PURE__ */ new Map();
  }
  scheduleCoordinatedRendering(e) {
    return this._coordinatedRenderings.push(e), this._scheduleRender(e.window), {
      dispose: () => {
        const t = this._coordinatedRenderings.indexOf(e);
        if (t !== -1 && (this._coordinatedRenderings.splice(t, 1), this._coordinatedRenderings.length === 0)) {
          for (const [n, r] of this._animationFrameRunners)
            r.dispose();
          this._animationFrameRunners.clear();
        }
      }
    };
  }
  _scheduleRender(e) {
    if (!this._animationFrameRunners.has(e)) {
      const t = () => {
        this._animationFrameRunners.delete(e), this._onRenderScheduled();
      };
      this._animationFrameRunners.set(e, FV(e, t, 100));
    }
  }
  _onRenderScheduled() {
    const e = this._coordinatedRenderings.slice(0);
    this._coordinatedRenderings = [];
    for (const n of e)
      d1(() => n.prepareRenderText());
    const t = [];
    for (let n = 0, r = e.length; n < r; n++) {
      const s = e[n];
      t[n] = d1(() => s.renderText());
    }
    for (let n = 0, r = e.length; n < r; n++) {
      const s = e[n], o = t[n];
      if (!o)
        continue;
      const [a, l] = o;
      d1(() => s.prepareRender(a, l));
    }
    for (let n = 0, r = e.length; n < r; n++) {
      const s = e[n], o = t[n];
      if (!o)
        continue;
      const [a, l] = o;
      d1(() => s.render(a, l));
    }
  }
};
Gj.INSTANCE = new Gj();
let Cre = Gj;
class eft extends ge {
  constructor(e, t) {
    super(), this._onChange = this._register(new he()), this.onChange = this._onChange.event, this._hadFocus = void 0, this._hasDomElementFocus = !1, this._domFocusTracker = this._register(qf(e)), this._overflowWidgetsDomNodeHasFocus = !1, this._register(this._domFocusTracker.onDidFocus(() => {
      this._hasDomElementFocus = !0, this._update();
    })), this._register(this._domFocusTracker.onDidBlur(() => {
      this._hasDomElementFocus = !1, this._update();
    })), t && (this._overflowWidgetsDomNode = this._register(qf(t)), this._register(this._overflowWidgetsDomNode.onDidFocus(() => {
      this._overflowWidgetsDomNodeHasFocus = !0, this._update();
    })), this._register(this._overflowWidgetsDomNode.onDidBlur(() => {
      this._overflowWidgetsDomNodeHasFocus = !1, this._update();
    })));
  }
  _update() {
    const e = this._hasDomElementFocus || this._overflowWidgetsDomNodeHasFocus;
    this._hadFocus !== e && (this._hadFocus = e, this._onChange.fire(void 0));
  }
  hasFocus() {
    return this._hadFocus ?? !1;
  }
}
class DF {
  constructor(e, t, n, r, s) {
    this.injectionOffsets = e, this.injectionOptions = t, this.breakOffsets = n, this.breakOffsetsVisibleColumn = r, this.wrappedTextIndentLength = s;
  }
  getOutputLineCount() {
    return this.breakOffsets.length;
  }
  getMinOutputOffset(e) {
    return e > 0 ? this.wrappedTextIndentLength : 0;
  }
  getLineLength(e) {
    const t = e > 0 ? this.breakOffsets[e - 1] : 0;
    let r = this.breakOffsets[e] - t;
    return e > 0 && (r += this.wrappedTextIndentLength), r;
  }
  getMaxOutputOffset(e) {
    return this.getLineLength(e);
  }
  translateToInputOffset(e, t) {
    e > 0 && (t = Math.max(0, t - this.wrappedTextIndentLength));
    let r = e === 0 ? t : this.breakOffsets[e - 1] + t;
    if (this.injectionOffsets !== null)
      for (let s = 0; s < this.injectionOffsets.length && r > this.injectionOffsets[s]; s++)
        r < this.injectionOffsets[s] + this.injectionOptions[s].content.length ? r = this.injectionOffsets[s] : r -= this.injectionOptions[s].content.length;
    return r;
  }
  translateToOutputPosition(e, t = 2) {
    let n = e;
    if (this.injectionOffsets !== null)
      for (let r = 0; r < this.injectionOffsets.length && !(e < this.injectionOffsets[r] || t !== 1 && e === this.injectionOffsets[r]); r++)
        n += this.injectionOptions[r].content.length;
    return this.offsetInInputWithInjectionsToOutputPosition(n, t);
  }
  offsetInInputWithInjectionsToOutputPosition(e, t = 2) {
    let n = 0, r = this.breakOffsets.length - 1, s = 0, o = 0;
    for (; n <= r; ) {
      s = n + (r - n) / 2 | 0;
      const l = this.breakOffsets[s];
      if (o = s > 0 ? this.breakOffsets[s - 1] : 0, t === 0)
        if (e <= o)
          r = s - 1;
        else if (e > l)
          n = s + 1;
        else
          break;
      else if (e < o)
        r = s - 1;
      else if (e >= l)
        n = s + 1;
      else
        break;
    }
    let a = e - o;
    return s > 0 && (a += this.wrappedTextIndentLength), new W7(s, a);
  }
  normalizeOutputPosition(e, t, n) {
    if (this.injectionOffsets !== null) {
      const r = this.outputPositionToOffsetInInputWithInjections(e, t), s = this.normalizeOffsetInInputWithInjectionsAroundInjections(r, n);
      if (s !== r)
        return this.offsetInInputWithInjectionsToOutputPosition(s, n);
    }
    if (n === 0) {
      if (e > 0 && t === this.getMinOutputOffset(e))
        return new W7(e - 1, this.getMaxOutputOffset(e - 1));
    } else if (n === 1) {
      const r = this.getOutputLineCount() - 1;
      if (e < r && t === this.getMaxOutputOffset(e))
        return new W7(e + 1, this.getMinOutputOffset(e + 1));
    }
    return new W7(e, t);
  }
  outputPositionToOffsetInInputWithInjections(e, t) {
    return e > 0 && (t = Math.max(0, t - this.wrappedTextIndentLength)), (e > 0 ? this.breakOffsets[e - 1] : 0) + t;
  }
  normalizeOffsetInInputWithInjectionsAroundInjections(e, t) {
    const n = this.getInjectedTextAtOffset(e);
    if (!n)
      return e;
    if (t === 2) {
      if (e === n.offsetInInputWithInjections + n.length && rTe(this.injectionOptions[n.injectedTextIndex].cursorStops))
        return n.offsetInInputWithInjections + n.length;
      {
        let r = n.offsetInInputWithInjections;
        if (sTe(this.injectionOptions[n.injectedTextIndex].cursorStops))
          return r;
        let s = n.injectedTextIndex - 1;
        for (; s >= 0 && this.injectionOffsets[s] === this.injectionOffsets[n.injectedTextIndex] && !(rTe(this.injectionOptions[s].cursorStops) || (r -= this.injectionOptions[s].content.length, sTe(this.injectionOptions[s].cursorStops))); )
          s--;
        return r;
      }
    } else if (t === 1 || t === 4) {
      let r = n.offsetInInputWithInjections + n.length, s = n.injectedTextIndex;
      for (; s + 1 < this.injectionOffsets.length && this.injectionOffsets[s + 1] === this.injectionOffsets[s]; )
        r += this.injectionOptions[s + 1].content.length, s++;
      return r;
    } else if (t === 0 || t === 3) {
      let r = n.offsetInInputWithInjections, s = n.injectedTextIndex;
      for (; s - 1 >= 0 && this.injectionOffsets[s - 1] === this.injectionOffsets[s]; )
        r -= this.injectionOptions[s - 1].content.length, s--;
      return r;
    }
    dB();
  }
  getInjectedText(e, t) {
    const n = this.outputPositionToOffsetInInputWithInjections(e, t), r = this.getInjectedTextAtOffset(n);
    return r ? {
      options: this.injectionOptions[r.injectedTextIndex]
    } : null;
  }
  getInjectedTextAtOffset(e) {
    const t = this.injectionOffsets, n = this.injectionOptions;
    if (t !== null) {
      let r = 0;
      for (let s = 0; s < t.length; s++) {
        const o = n[s].content.length, a = t[s] + r, l = t[s] + r + o;
        if (a > e)
          break;
        if (e <= l)
          return {
            injectedTextIndex: s,
            offsetInInputWithInjections: a,
            length: o
          };
        r += o;
      }
    }
  }
}
function rTe(i) {
  return i == null ? !0 : i === Af.Right || i === Af.Both;
}
function sTe(i) {
  return i == null ? !0 : i === Af.Left || i === Af.Both;
}
class W7 {
  constructor(e, t) {
    this.outputLineIndex = e, this.outputOffset = t;
  }
  toString() {
    return `${this.outputLineIndex}:${this.outputOffset}`;
  }
  toPosition(e) {
    return new de(e + this.outputLineIndex, this.outputOffset + 1);
  }
}
class tft {
  constructor() {
    this.changeType = 1;
  }
}
class pm {
  static applyInjectedText(e, t) {
    if (!t || t.length === 0)
      return e;
    let n = "", r = 0;
    for (const s of t)
      n += e.substring(r, s.column - 1), r = s.column - 1, n += s.options.content;
    return n += e.substring(r), n;
  }
  static fromDecorations(e) {
    const t = [];
    for (const n of e)
      n.options.before && n.options.before.content.length > 0 && t.push(new pm(n.ownerId, n.range.startLineNumber, n.range.startColumn, n.options.before, 0)), n.options.after && n.options.after.content.length > 0 && t.push(new pm(n.ownerId, n.range.endLineNumber, n.range.endColumn, n.options.after, 1));
    return t.sort((n, r) => n.lineNumber === r.lineNumber ? n.column === r.column ? n.order - r.order : n.column - r.column : n.lineNumber - r.lineNumber), t;
  }
  constructor(e, t, n, r, s) {
    this.ownerId = e, this.lineNumber = t, this.column = n, this.options = r, this.order = s;
  }
}
class oTe {
  constructor(e, t, n) {
    this.changeType = 2, this.lineNumber = e, this.detail = t, this.injectedText = n;
  }
}
class nft {
  constructor(e, t, n, r) {
    this.ownerId = e, this.decorationId = t, this.lineNumber = n, this.lineHeight = r;
  }
}
class ift {
  constructor(e, t) {
    this.ownerId = e, this.lineNumber = t;
  }
}
class rft {
  constructor(e, t) {
    this.changeType = 3, this.fromLineNumber = e, this.toLineNumber = t;
  }
}
class sft {
  constructor(e, t, n, r) {
    this.changeType = 4, this.injectedTexts = r, this.fromLineNumber = e, this.toLineNumber = t, this.detail = n;
  }
}
class oft {
  constructor() {
    this.changeType = 5;
  }
}
class eR {
  constructor(e, t, n, r) {
    this.changes = e, this.versionId = t, this.isUndoing = n, this.isRedoing = r, this.resultingSelection = null;
  }
  containsEvent(e) {
    for (let t = 0, n = this.changes.length; t < n; t++)
      if (this.changes[t].changeType === e)
        return !0;
    return !1;
  }
  static merge(e, t) {
    const n = [].concat(e.changes).concat(t.changes), r = t.versionId, s = e.isUndoing || t.isUndoing, o = e.isRedoing || t.isRedoing;
    return new eR(n, r, s, o);
  }
}
class F3e {
  constructor(e) {
    this.changes = e;
  }
}
let B3e = class {
  constructor(e) {
    this.changes = e;
  }
}, H3e = class {
  constructor(e) {
    this.changes = e;
  }
};
class Vx {
  constructor(e, t) {
    this.rawContentChangedEvent = e, this.contentChangedEvent = t;
  }
  merge(e) {
    const t = eR.merge(this.rawContentChangedEvent, e.rawContentChangedEvent), n = Vx._mergeChangeEvents(this.contentChangedEvent, e.contentChangedEvent);
    return new Vx(t, n);
  }
  static _mergeChangeEvents(e, t) {
    const n = [].concat(e.changes).concat(t.changes), r = t.eol, s = t.versionId, o = e.isUndoing || t.isUndoing, a = e.isRedoing || t.isRedoing, l = e.isFlush || t.isFlush, c = e.isEolChange && t.isEolChange;
    return {
      changes: n,
      eol: r,
      isEolChange: c,
      versionId: s,
      isUndoing: o,
      isRedoing: a,
      isFlush: l,
      detailedReasons: e.detailedReasons.concat(t.detailedReasons),
      detailedReasonsChangeLengths: e.detailedReasonsChangeLengths.concat(t.detailedReasonsChangeLengths)
    };
  }
}
const uee = Db("domLineBreaksComputer", { createHTML: (i) => i });
class $fe {
  static create(e) {
    return new $fe(new WeakRef(e));
  }
  constructor(e) {
    this.targetWindow = e;
  }
  createLineBreaksComputer(e, t, n, r, s, o) {
    const a = [], l = [];
    return {
      addRequest: (c, u, d) => {
        a.push(c), l.push(u);
      },
      finalize: () => aft(i1(this.targetWindow.deref()), a, e, t, n, r, s, l)
    };
  }
}
function aft(i, e, t, n, r, s, o, a) {
  function l(B) {
    const H = a[B];
    if (H) {
      const j = pm.applyInjectedText(e[B], H), K = H.map((Y) => Y.options), X = H.map((Y) => Y.column - 1);
      return new DF(X, K, [j.length], [], 0);
    } else
      return null;
  }
  if (r === -1) {
    const B = [];
    for (let H = 0, j = e.length; H < j; H++)
      B[H] = l(H);
    return B;
  }
  const c = Math.round(r * t.typicalHalfwidthCharacterWidth), d = Math.round(n * (s === 3 ? 2 : s === 2 ? 1 : 0)), h = Math.ceil(t.spaceWidth * d), g = document.createElement("div");
  Ma(g, t);
  const m = new ww(1e4), _ = [], v = [], w = [], E = [], L = [];
  for (let B = 0; B < e.length; B++) {
    const H = pm.applyInjectedText(e[B], a[B]);
    let j = 0, K = 0, X = c;
    if (s !== 0)
      if (j = Tc(H), j === -1)
        j = 0;
      else {
        for (let oe = 0; oe < j; oe++) {
          const Z = H.charCodeAt(oe) === 9 ? n - K % n : 1;
          K += Z;
        }
        const Q = Math.ceil(t.spaceWidth * K);
        Q + t.typicalFullwidthCharacterWidth > c ? (j = 0, K = 0) : X = c - Q;
      }
    const Y = H.substr(j), G = lft(Y, K, n, X, m, h);
    _[B] = j, v[B] = K, w[B] = Y, E[B] = G[0], L[B] = G[1];
  }
  const T = m.build(), D = (uee == null ? void 0 : uee.createHTML(T)) ?? T;
  g.innerHTML = D, g.style.position = "absolute", g.style.top = "10000", o === "keepAll" ? (g.style.wordBreak = "keep-all", g.style.overflowWrap = "anywhere") : (g.style.wordBreak = "inherit", g.style.overflowWrap = "break-word"), i.document.body.appendChild(g);
  const N = document.createRange(), R = Array.prototype.slice.call(g.children, 0), M = [];
  for (let B = 0; B < e.length; B++) {
    const H = R[B], j = cft(N, H, w[B], E[B]);
    if (j === null) {
      M[B] = l(B);
      continue;
    }
    const K = _[B], X = v[B] + d, Y = L[B], G = [];
    for (let pe = 0, J = j.length; pe < J; pe++)
      G[pe] = Y[j[pe]];
    if (K !== 0)
      for (let pe = 0, J = j.length; pe < J; pe++)
        j[pe] += K;
    let Q, oe;
    const Z = a[B];
    Z ? (Q = Z.map((pe) => pe.options), oe = Z.map((pe) => pe.column - 1)) : (Q = null, oe = null), M[B] = new DF(oe, Q, j, G, X);
  }
  return g.remove(), M;
}
function lft(i, e, t, n, r, s) {
  if (s !== 0) {
    const h = String(s);
    r.appendString('<div style="text-indent: -'), r.appendString(h), r.appendString("px; padding-left: "), r.appendString(h), r.appendString("px; box-sizing: border-box; width:");
  } else
    r.appendString('<div style="width:');
  r.appendString(String(n)), r.appendString('px;">');
  const o = i.length;
  let a = e, l = 0;
  const c = [], u = [];
  let d = 0 < o ? i.charCodeAt(0) : 0;
  r.appendString("<span>");
  for (let h = 0; h < o; h++) {
    h !== 0 && h % 16384 === 0 && r.appendString("</span><span>"), c[h] = l, u[h] = a;
    const g = d;
    d = h + 1 < o ? i.charCodeAt(h + 1) : 0;
    let m = 1, _ = 1;
    switch (g) {
      case 9:
        m = t - a % t, _ = m;
        for (let v = 1; v <= m; v++)
          v < m ? r.appendCharCode(160) : r.appendASCIICharCode(
            32
            /* CharCode.Space */
          );
        break;
      case 32:
        d === 32 ? r.appendCharCode(160) : r.appendASCIICharCode(
          32
          /* CharCode.Space */
        );
        break;
      case 60:
        r.appendString("&lt;");
        break;
      case 62:
        r.appendString("&gt;");
        break;
      case 38:
        r.appendString("&amp;");
        break;
      case 0:
        r.appendString("&#00;");
        break;
      case 65279:
      case 8232:
      case 8233:
      case 133:
        r.appendCharCode(65533);
        break;
      default:
        tw(g) && _++, g < 32 ? r.appendCharCode(9216 + g) : r.appendCharCode(g);
    }
    l += m, a += _;
  }
  return r.appendString("</span>"), c[i.length] = l, u[i.length] = a, r.appendString("</div>"), [c, u];
}
function cft(i, e, t, n) {
  if (t.length <= 1)
    return null;
  const r = Array.prototype.slice.call(e.children, 0), s = [];
  try {
    wre(i, r, n, 0, null, t.length - 1, null, s);
  } catch (o) {
    return console.log(o), null;
  }
  return s.length === 0 ? null : (s.push(t.length), s);
}
function wre(i, e, t, n, r, s, o, a) {
  if (n === s || (r = r || dee(i, e, t[n], t[n + 1]), o = o || dee(i, e, t[s], t[s + 1]), Math.abs(r[0].top - o[0].top) <= 0.1))
    return;
  if (n + 1 === s) {
    a.push(s);
    return;
  }
  const l = n + (s - n) / 2 | 0, c = dee(i, e, t[l], t[l + 1]);
  wre(i, e, t, n, r, l, c, a), wre(i, e, t, l, c, s, o, a);
}
function dee(i, e, t, n) {
  return i.setStart(
    e[t / 16384 | 0].firstChild,
    t % 16384
    /* Constants.SPAN_MODULO_LIMIT */
  ), i.setEnd(
    e[n / 16384 | 0].firstChild,
    n % 16384
    /* Constants.SPAN_MODULO_LIMIT */
  ), i.getClientRects();
}
class uft extends ge {
  constructor() {
    super(), this._editor = null, this._instantiationService = null, this._instances = this._register(new pq()), this._pending = /* @__PURE__ */ new Map(), this._finishedInstantiation = [], this._finishedInstantiation[
      0
      /* EditorContributionInstantiation.Eager */
    ] = !1, this._finishedInstantiation[
      1
      /* EditorContributionInstantiation.AfterFirstRender */
    ] = !1, this._finishedInstantiation[
      2
      /* EditorContributionInstantiation.BeforeFirstInteraction */
    ] = !1, this._finishedInstantiation[
      3
      /* EditorContributionInstantiation.Eventually */
    ] = !1;
  }
  initialize(e, t, n) {
    this._editor = e, this._instantiationService = n;
    for (const r of t) {
      if (this._pending.has(r.id)) {
        fn(new Error(`Cannot have two contributions with the same id ${r.id}`));
        continue;
      }
      this._pending.set(r.id, r);
    }
    this._instantiateSome(
      0
      /* EditorContributionInstantiation.Eager */
    ), this._register(UP(At(this._editor.getDomNode()), () => {
      this._instantiateSome(
        1
        /* EditorContributionInstantiation.AfterFirstRender */
      );
    })), this._register(UP(At(this._editor.getDomNode()), () => {
      this._instantiateSome(
        2
        /* EditorContributionInstantiation.BeforeFirstInteraction */
      );
    })), this._register(UP(At(this._editor.getDomNode()), () => {
      this._instantiateSome(
        3
        /* EditorContributionInstantiation.Eventually */
      );
    }, 5e3));
  }
  saveViewState() {
    const e = {};
    for (const [t, n] of this._instances)
      typeof n.saveViewState == "function" && (e[t] = n.saveViewState());
    return e;
  }
  restoreViewState(e) {
    for (const [t, n] of this._instances)
      typeof n.restoreViewState == "function" && n.restoreViewState(e[t]);
  }
  get(e) {
    return this._instantiateById(e), this._instances.get(e) || null;
  }
  onBeforeInteractionEvent() {
    this._instantiateSome(
      2
      /* EditorContributionInstantiation.BeforeFirstInteraction */
    );
  }
  onAfterModelAttached() {
    var e;
    return UP(At((e = this._editor) == null ? void 0 : e.getDomNode()), () => {
      this._instantiateSome(
        1
        /* EditorContributionInstantiation.AfterFirstRender */
      );
    }, 50);
  }
  _instantiateSome(e) {
    if (this._finishedInstantiation[e])
      return;
    this._finishedInstantiation[e] = !0;
    const t = this._findPendingContributionsByInstantiation(e);
    for (const n of t)
      this._instantiateById(n.id);
  }
  _findPendingContributionsByInstantiation(e) {
    const t = [];
    for (const [, n] of this._pending)
      n.instantiation === e && t.push(n);
    return t;
  }
  _instantiateById(e) {
    const t = this._pending.get(e);
    if (t) {
      if (this._pending.delete(e), !this._instantiationService || !this._editor)
        throw new Error("Cannot instantiate contributions before being initialized!");
      try {
        const n = this._instantiationService.createInstance(t.ctor, this._editor);
        this._instances.set(t.id, n), typeof n.restoreViewState == "function" && t.instantiation !== 0 && console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`);
      } catch (n) {
        fn(n);
      }
    }
  }
}
class W3e {
  constructor(e, t, n, r, s, o, a) {
    this.id = e, this.label = t, this.alias = n, this.metadata = r, this._precondition = s, this._run = o, this._contextKeyService = a;
  }
  isSupported() {
    return this._contextKeyService.contextMatchesRules(this._precondition);
  }
  run(e) {
    return this.isSupported() ? this._run(e) : Promise.resolve(void 0);
  }
}
const DB = {
  ICodeEditor: "vs.editor.ICodeEditor",
  IDiffEditor: "vs.editor.IDiffEditor"
};
function lw(i) {
  let e = 0, t = 0, n = 0, r = 0;
  for (let s = 0, o = i.length; s < o; s++) {
    const a = i.charCodeAt(s);
    a === 13 ? (e === 0 && (t = s), e++, s + 1 < o && i.charCodeAt(s + 1) === 10 ? (r |= 2, s++) : r |= 3, n = s + 1) : a === 10 && (r |= 1, e === 0 && (t = s), e++, n = s + 1);
  }
  return e === 0 && (t = i.length), [e, t, i.length - n, r];
}
class aTe {
  constructor(e, t, n, r) {
    this.range = e, this.nestingLevel = t, this.nestingLevelOfEqualBracketType = n, this.isInvalid = r;
  }
}
class dft {
  constructor(e, t, n, r, s, o) {
    this.range = e, this.openingBracketRange = t, this.closingBracketRange = n, this.nestingLevel = r, this.nestingLevelOfEqualBracketType = s, this.bracketPairNode = o;
  }
  get openingBracketInfo() {
    return this.bracketPairNode.openingBracket.bracketInfo;
  }
}
class hft extends dft {
  constructor(e, t, n, r, s, o, a) {
    super(e, t, n, r, s, o), this.minVisibleColumnIndentation = a;
  }
}
function fft(i, e, t, n) {
  return i !== t ? ko(t - i, n) : ko(0, n - e);
}
const ou = 0;
function bU(i) {
  return i === 0;
}
const Hh = 2 ** 26;
function ko(i, e) {
  return i * Hh + e;
}
function Wf(i) {
  const e = i, t = Math.floor(e / Hh), n = e - t * Hh;
  return new ta(t, n);
}
function gft(i) {
  return Math.floor(i / Hh);
}
function Zs(i, e) {
  let t = i + e;
  return e >= Hh && (t = t - i % Hh), t;
}
function pft(i, e) {
  return i.reduce((t, n) => Zs(t, e(n)), ou);
}
function V3e(i, e) {
  return i === e;
}
function A4(i, e) {
  const t = i, n = e;
  if (n - t <= 0)
    return ou;
  const s = Math.floor(t / Hh), o = Math.floor(n / Hh), a = n - o * Hh;
  if (s === o) {
    const l = t - s * Hh;
    return ko(0, a - l);
  } else
    return ko(o - s, a);
}
function tR(i, e) {
  return i < e;
}
function nR(i, e) {
  return i <= e;
}
function $P(i, e) {
  return i >= e;
}
function cN(i) {
  return ko(i.lineNumber - 1, i.column - 1);
}
function Ux(i, e) {
  const t = i, n = Math.floor(t / Hh), r = t - n * Hh, s = e, o = Math.floor(s / Hh), a = s - o * Hh;
  return new z(n + 1, r + 1, o + 1, a + 1);
}
function mft(i) {
  const e = $d(i);
  return ko(e.length - 1, e[e.length - 1].length);
}
class Cy {
  static fromModelContentChanges(e) {
    return e.map((n) => {
      const r = z.lift(n.range);
      return new Cy(cN(r.getStartPosition()), cN(r.getEndPosition()), mft(n.text));
    }).reverse();
  }
  constructor(e, t, n) {
    this.startOffset = e, this.endOffset = t, this.newLength = n;
  }
  toString() {
    return `[${Wf(this.startOffset)}...${Wf(this.endOffset)}) -> ${Wf(this.newLength)}`;
  }
}
class _ft {
  /**
   * @param edits Must be sorted by offset in ascending order.
  */
  constructor(e) {
    this.nextEditIdx = 0, this.deltaOldToNewLineCount = 0, this.deltaOldToNewColumnCount = 0, this.deltaLineIdxInOld = -1, this.edits = e.map((t) => jfe.from(t));
  }
  /**
   * @param offset Must be equal to or greater than the last offset this method has been called with.
  */
  getOffsetBeforeChange(e) {
    return this.adjustNextEdit(e), this.translateCurToOld(e);
  }
  /**
   * @param offset Must be equal to or greater than the last offset this method has been called with.
   * Returns null if there is no edit anymore.
  */
  getDistanceToNextChange(e) {
    this.adjustNextEdit(e);
    const t = this.edits[this.nextEditIdx], n = t ? this.translateOldToCur(t.offsetObj) : null;
    return n === null ? null : A4(e, n);
  }
  translateOldToCur(e) {
    return e.lineCount === this.deltaLineIdxInOld ? ko(e.lineCount + this.deltaOldToNewLineCount, e.columnCount + this.deltaOldToNewColumnCount) : ko(e.lineCount + this.deltaOldToNewLineCount, e.columnCount);
  }
  translateCurToOld(e) {
    const t = Wf(e);
    return t.lineCount - this.deltaOldToNewLineCount === this.deltaLineIdxInOld ? ko(t.lineCount - this.deltaOldToNewLineCount, t.columnCount - this.deltaOldToNewColumnCount) : ko(t.lineCount - this.deltaOldToNewLineCount, t.columnCount);
  }
  adjustNextEdit(e) {
    for (; this.nextEditIdx < this.edits.length; ) {
      const t = this.edits[this.nextEditIdx], n = this.translateOldToCur(t.endOffsetAfterObj);
      if (nR(n, e)) {
        this.nextEditIdx++;
        const r = Wf(n), s = Wf(this.translateOldToCur(t.endOffsetBeforeObj)), o = r.lineCount - s.lineCount;
        this.deltaOldToNewLineCount += o;
        const a = this.deltaLineIdxInOld === t.endOffsetBeforeObj.lineCount ? this.deltaOldToNewColumnCount : 0, l = r.columnCount - s.columnCount;
        this.deltaOldToNewColumnCount = a + l, this.deltaLineIdxInOld = t.endOffsetBeforeObj.lineCount;
      } else
        break;
    }
  }
}
class jfe {
  static from(e) {
    return new jfe(e.startOffset, e.endOffset, e.newLength);
  }
  constructor(e, t, n) {
    this.endOffsetBeforeObj = Wf(t), this.endOffsetAfterObj = Wf(Zs(e, n)), this.offsetObj = Wf(e);
  }
}
const V7 = [], Cf = class Cf {
  static create(e, t) {
    if (e <= 128 && t.length === 0) {
      let n = Cf.cache[e];
      return n || (n = new Cf(e, t), Cf.cache[e] = n), n;
    }
    return new Cf(e, t);
  }
  static getEmpty() {
    return this.empty;
  }
  constructor(e, t) {
    this.items = e, this.additionalItems = t;
  }
  add(e, t) {
    const n = t.getKey(e);
    let r = n >> 5;
    if (r === 0) {
      const o = 1 << n | this.items;
      return o === this.items ? this : Cf.create(o, this.additionalItems);
    }
    r--;
    const s = this.additionalItems.slice(0);
    for (; s.length < r; )
      s.push(0);
    return s[r] |= 1 << (n & 31), Cf.create(this.items, s);
  }
  merge(e) {
    const t = this.items | e.items;
    if (this.additionalItems === V7 && e.additionalItems === V7)
      return t === this.items ? this : t === e.items ? e : Cf.create(t, V7);
    const n = [];
    for (let r = 0; r < Math.max(this.additionalItems.length, e.additionalItems.length); r++) {
      const s = this.additionalItems[r] || 0, o = e.additionalItems[r] || 0;
      n.push(s | o);
    }
    return Cf.create(t, n);
  }
  intersects(e) {
    if ((this.items & e.items) !== 0)
      return !0;
    for (let t = 0; t < Math.min(this.additionalItems.length, e.additionalItems.length); t++)
      if ((this.additionalItems[t] & e.additionalItems[t]) !== 0)
        return !0;
    return !1;
  }
};
Cf.cache = new Array(129), Cf.empty = Cf.create(0, V7);
let Nd = Cf;
const lTe = {
  getKey(i) {
    return i;
  }
};
class U3e {
  constructor() {
    this.items = /* @__PURE__ */ new Map();
  }
  getKey(e) {
    let t = this.items.get(e);
    return t === void 0 && (t = this.items.size, this.items.set(e, t)), t;
  }
}
class Gfe {
  /**
   * The length of the entire node, which should equal the sum of lengths of all children.
  */
  get length() {
    return this._length;
  }
  constructor(e) {
    this._length = e;
  }
}
class O4 extends Gfe {
  static create(e, t, n) {
    let r = e.length;
    return t && (r = Zs(r, t.length)), n && (r = Zs(r, n.length)), new O4(r, e, t, n, t ? t.missingOpeningBracketIds : Nd.getEmpty());
  }
  get kind() {
    return 2;
  }
  get listHeight() {
    return 0;
  }
  get childrenLength() {
    return 3;
  }
  getChild(e) {
    switch (e) {
      case 0:
        return this.openingBracket;
      case 1:
        return this.child;
      case 2:
        return this.closingBracket;
    }
    throw new Error("Invalid child index");
  }
  /**
   * Avoid using this property, it allocates an array!
  */
  get children() {
    const e = [];
    return e.push(this.openingBracket), this.child && e.push(this.child), this.closingBracket && e.push(this.closingBracket), e;
  }
  constructor(e, t, n, r, s) {
    super(e), this.openingBracket = t, this.child = n, this.closingBracket = r, this.missingOpeningBracketIds = s;
  }
  canBeReused(e) {
    return !(this.closingBracket === null || e.intersects(this.missingOpeningBracketIds));
  }
  deepClone() {
    return new O4(this.length, this.openingBracket.deepClone(), this.child && this.child.deepClone(), this.closingBracket && this.closingBracket.deepClone(), this.missingOpeningBracketIds);
  }
  computeMinIndentation(e, t) {
    return this.child ? this.child.computeMinIndentation(Zs(e, this.openingBracket.length), t) : Number.MAX_SAFE_INTEGER;
  }
}
class pb extends Gfe {
  /**
   * This method uses more memory-efficient list nodes that can only store 2 or 3 children.
  */
  static create23(e, t, n, r = !1) {
    let s = e.length, o = e.missingOpeningBracketIds;
    if (e.listHeight !== t.listHeight)
      throw new Error("Invalid list heights");
    if (s = Zs(s, t.length), o = o.merge(t.missingOpeningBracketIds), n) {
      if (e.listHeight !== n.listHeight)
        throw new Error("Invalid list heights");
      s = Zs(s, n.length), o = o.merge(n.missingOpeningBracketIds);
    }
    return r ? new bft(s, e.listHeight + 1, e, t, n, o) : new M4(s, e.listHeight + 1, e, t, n, o);
  }
  static getEmpty() {
    return new vft(ou, 0, [], Nd.getEmpty());
  }
  get kind() {
    return 4;
  }
  get missingOpeningBracketIds() {
    return this._missingOpeningBracketIds;
  }
  /**
   * Use ListAstNode.create.
  */
  constructor(e, t, n) {
    super(e), this.listHeight = t, this._missingOpeningBracketIds = n, this.cachedMinIndentation = -1;
  }
  throwIfImmutable() {
  }
  makeLastElementMutable() {
    this.throwIfImmutable();
    const e = this.childrenLength;
    if (e === 0)
      return;
    const t = this.getChild(e - 1), n = t.kind === 4 ? t.toMutable() : t;
    return t !== n && this.setChild(e - 1, n), n;
  }
  makeFirstElementMutable() {
    if (this.throwIfImmutable(), this.childrenLength === 0)
      return;
    const t = this.getChild(0), n = t.kind === 4 ? t.toMutable() : t;
    return t !== n && this.setChild(0, n), n;
  }
  canBeReused(e) {
    if (e.intersects(this.missingOpeningBracketIds) || this.childrenLength === 0)
      return !1;
    let t = this;
    for (; t.kind === 4; ) {
      const n = t.childrenLength;
      if (n === 0)
        throw new Wt();
      t = t.getChild(n - 1);
    }
    return t.canBeReused(e);
  }
  handleChildrenChanged() {
    this.throwIfImmutable();
    const e = this.childrenLength;
    let t = this.getChild(0).length, n = this.getChild(0).missingOpeningBracketIds;
    for (let r = 1; r < e; r++) {
      const s = this.getChild(r);
      t = Zs(t, s.length), n = n.merge(s.missingOpeningBracketIds);
    }
    this._length = t, this._missingOpeningBracketIds = n, this.cachedMinIndentation = -1;
  }
  computeMinIndentation(e, t) {
    if (this.cachedMinIndentation !== -1)
      return this.cachedMinIndentation;
    let n = Number.MAX_SAFE_INTEGER, r = e;
    for (let s = 0; s < this.childrenLength; s++) {
      const o = this.getChild(s);
      o && (n = Math.min(n, o.computeMinIndentation(r, t)), r = Zs(r, o.length));
    }
    return this.cachedMinIndentation = n, n;
  }
}
class M4 extends pb {
  get childrenLength() {
    return this._item3 !== null ? 3 : 2;
  }
  getChild(e) {
    switch (e) {
      case 0:
        return this._item1;
      case 1:
        return this._item2;
      case 2:
        return this._item3;
    }
    throw new Error("Invalid child index");
  }
  setChild(e, t) {
    switch (e) {
      case 0:
        this._item1 = t;
        return;
      case 1:
        this._item2 = t;
        return;
      case 2:
        this._item3 = t;
        return;
    }
    throw new Error("Invalid child index");
  }
  get children() {
    return this._item3 ? [this._item1, this._item2, this._item3] : [this._item1, this._item2];
  }
  get item1() {
    return this._item1;
  }
  get item2() {
    return this._item2;
  }
  get item3() {
    return this._item3;
  }
  constructor(e, t, n, r, s, o) {
    super(e, t, o), this._item1 = n, this._item2 = r, this._item3 = s;
  }
  deepClone() {
    return new M4(this.length, this.listHeight, this._item1.deepClone(), this._item2.deepClone(), this._item3 ? this._item3.deepClone() : null, this.missingOpeningBracketIds);
  }
  appendChildOfSameHeight(e) {
    if (this._item3)
      throw new Error("Cannot append to a full (2,3) tree node");
    this.throwIfImmutable(), this._item3 = e, this.handleChildrenChanged();
  }
  unappendChild() {
    if (!this._item3)
      throw new Error("Cannot remove from a non-full (2,3) tree node");
    this.throwIfImmutable();
    const e = this._item3;
    return this._item3 = null, this.handleChildrenChanged(), e;
  }
  prependChildOfSameHeight(e) {
    if (this._item3)
      throw new Error("Cannot prepend to a full (2,3) tree node");
    this.throwIfImmutable(), this._item3 = this._item2, this._item2 = this._item1, this._item1 = e, this.handleChildrenChanged();
  }
  unprependChild() {
    if (!this._item3)
      throw new Error("Cannot remove from a non-full (2,3) tree node");
    this.throwIfImmutable();
    const e = this._item1;
    return this._item1 = this._item2, this._item2 = this._item3, this._item3 = null, this.handleChildrenChanged(), e;
  }
  toMutable() {
    return this;
  }
}
class bft extends M4 {
  toMutable() {
    return new M4(this.length, this.listHeight, this.item1, this.item2, this.item3, this.missingOpeningBracketIds);
  }
  throwIfImmutable() {
    throw new Error("this instance is immutable");
  }
}
class vU extends pb {
  get childrenLength() {
    return this._children.length;
  }
  getChild(e) {
    return this._children[e];
  }
  setChild(e, t) {
    this._children[e] = t;
  }
  get children() {
    return this._children;
  }
  constructor(e, t, n, r) {
    super(e, t, r), this._children = n;
  }
  deepClone() {
    const e = new Array(this._children.length);
    for (let t = 0; t < this._children.length; t++)
      e[t] = this._children[t].deepClone();
    return new vU(this.length, this.listHeight, e, this.missingOpeningBracketIds);
  }
  appendChildOfSameHeight(e) {
    this.throwIfImmutable(), this._children.push(e), this.handleChildrenChanged();
  }
  unappendChild() {
    this.throwIfImmutable();
    const e = this._children.pop();
    return this.handleChildrenChanged(), e;
  }
  prependChildOfSameHeight(e) {
    this.throwIfImmutable(), this._children.unshift(e), this.handleChildrenChanged();
  }
  unprependChild() {
    this.throwIfImmutable();
    const e = this._children.shift();
    return this.handleChildrenChanged(), e;
  }
  toMutable() {
    return this;
  }
}
class vft extends vU {
  toMutable() {
    return new vU(this.length, this.listHeight, [...this.children], this.missingOpeningBracketIds);
  }
  throwIfImmutable() {
    throw new Error("this instance is immutable");
  }
}
const yft = [];
class qfe extends Gfe {
  get listHeight() {
    return 0;
  }
  get childrenLength() {
    return 0;
  }
  getChild(e) {
    return null;
  }
  get children() {
    return yft;
  }
  deepClone() {
    return this;
  }
}
class VE extends qfe {
  get kind() {
    return 0;
  }
  get missingOpeningBracketIds() {
    return Nd.getEmpty();
  }
  canBeReused(e) {
    return !0;
  }
  computeMinIndentation(e, t) {
    const n = Wf(e), r = (n.columnCount === 0 ? n.lineCount : n.lineCount + 1) + 1, s = gft(Zs(e, this.length)) + 1;
    let o = Number.MAX_SAFE_INTEGER;
    for (let a = r; a <= s; a++) {
      const l = t.getLineFirstNonWhitespaceColumn(a), c = t.getLineContent(a);
      if (l === 0)
        continue;
      const u = As.visibleColumnFromColumn(c, l, t.getOptions().tabSize);
      o = Math.min(o, u);
    }
    return o;
  }
}
class yU extends qfe {
  static create(e, t, n) {
    return new yU(e, t, n);
  }
  get kind() {
    return 1;
  }
  get missingOpeningBracketIds() {
    return Nd.getEmpty();
  }
  constructor(e, t, n) {
    super(e), this.bracketInfo = t, this.bracketIds = n;
  }
  get text() {
    return this.bracketInfo.bracketText;
  }
  get languageId() {
    return this.bracketInfo.languageId;
  }
  canBeReused(e) {
    return !1;
  }
  computeMinIndentation(e, t) {
    return Number.MAX_SAFE_INTEGER;
  }
}
class Cft extends qfe {
  get kind() {
    return 3;
  }
  constructor(e, t) {
    super(t), this.missingOpeningBracketIds = e;
  }
  canBeReused(e) {
    return !e.intersects(this.missingOpeningBracketIds);
  }
  computeMinIndentation(e, t) {
    return Number.MAX_SAFE_INTEGER;
  }
}
let ZC = class {
  constructor(e, t, n, r, s) {
    this.length = e, this.kind = t, this.bracketId = n, this.bracketIds = r, this.astNode = s;
  }
};
class z3e {
  constructor(e, t) {
    this.textModel = e, this.bracketTokens = t, this.reader = new wft(this.textModel, this.bracketTokens), this._offset = ou, this.didPeek = !1, this.peeked = null, this.textBufferLineCount = e.getLineCount(), this.textBufferLastLineLength = e.getLineLength(this.textBufferLineCount);
  }
  get offset() {
    return this._offset;
  }
  get length() {
    return ko(this.textBufferLineCount - 1, this.textBufferLastLineLength);
  }
  skip(e) {
    this.didPeek = !1, this._offset = Zs(this._offset, e);
    const t = Wf(this._offset);
    this.reader.setPosition(t.lineCount, t.columnCount);
  }
  read() {
    let e;
    return this.peeked ? (this.didPeek = !1, e = this.peeked) : e = this.reader.read(), e && (this._offset = Zs(this._offset, e.length)), e;
  }
  peek() {
    return this.didPeek || (this.peeked = this.reader.read(), this.didPeek = !0), this.peeked;
  }
}
class wft {
  constructor(e, t) {
    this.textModel = e, this.bracketTokens = t, this.lineIdx = 0, this.line = null, this.lineCharOffset = 0, this.lineTokens = null, this.lineTokenOffset = 0, this.peekedToken = null, this.textBufferLineCount = e.getLineCount(), this.textBufferLastLineLength = e.getLineLength(this.textBufferLineCount);
  }
  setPosition(e, t) {
    e === this.lineIdx ? (this.lineCharOffset = t, this.line !== null && (this.lineTokenOffset = this.lineCharOffset === 0 ? 0 : this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))) : (this.lineIdx = e, this.lineCharOffset = t, this.line = null), this.peekedToken = null;
  }
  read() {
    if (this.peekedToken) {
      const s = this.peekedToken;
      return this.peekedToken = null, this.lineCharOffset += s.length, s;
    }
    if (this.lineIdx > this.textBufferLineCount - 1 || this.lineIdx === this.textBufferLineCount - 1 && this.lineCharOffset >= this.textBufferLastLineLength)
      return null;
    this.line === null && (this.lineTokens = this.textModel.tokenization.getLineTokens(this.lineIdx + 1), this.line = this.lineTokens.getLineContent(), this.lineTokenOffset = this.lineCharOffset === 0 ? 0 : this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));
    const e = this.lineIdx, t = this.lineCharOffset;
    let n = 0;
    for (; ; ) {
      const s = this.lineTokens, o = s.getCount();
      let a = null;
      if (this.lineTokenOffset < o) {
        const l = s.getMetadata(this.lineTokenOffset);
        for (; this.lineTokenOffset + 1 < o && l === s.getMetadata(this.lineTokenOffset + 1); )
          this.lineTokenOffset++;
        const c = jl.getTokenType(l) === 0, u = jl.containsBalancedBrackets(l), d = s.getEndOffset(this.lineTokenOffset);
        if (u && c && this.lineCharOffset < d) {
          const h = s.getLanguageId(this.lineTokenOffset), g = this.line.substring(this.lineCharOffset, d), m = this.bracketTokens.getSingleLanguageBracketTokens(h), _ = m.regExpGlobal;
          if (_) {
            _.lastIndex = 0;
            const v = _.exec(g);
            v && (a = m.getToken(v[0]), a && (this.lineCharOffset += v.index));
          }
        }
        if (n += d - this.lineCharOffset, a)
          if (e !== this.lineIdx || t !== this.lineCharOffset) {
            this.peekedToken = a;
            break;
          } else
            return this.lineCharOffset += a.length, a;
        else
          this.lineTokenOffset++, this.lineCharOffset = d;
      } else if (this.lineIdx === this.textBufferLineCount - 1 || (this.lineIdx++, this.lineTokens = this.textModel.tokenization.getLineTokens(this.lineIdx + 1), this.lineTokenOffset = 0, this.line = this.lineTokens.getLineContent(), this.lineCharOffset = 0, n += 33, n > 1e3))
        break;
      if (n > 1500)
        break;
    }
    const r = fft(e, t, this.lineIdx, this.lineCharOffset);
    return new ZC(r, 0, -1, Nd.getEmpty(), new VE(r));
  }
}
class Sft {
  constructor(e, t) {
    this.text = e, this._offset = ou, this.idx = 0;
    const n = t.getRegExpStr(), r = n ? new RegExp(n + `|
`, "gi") : null, s = [];
    let o, a = 0, l = 0, c = 0, u = 0;
    const d = [];
    for (let m = 0; m < 60; m++)
      d.push(new ZC(ko(0, m), 0, -1, Nd.getEmpty(), new VE(ko(0, m))));
    const h = [];
    for (let m = 0; m < 60; m++)
      h.push(new ZC(ko(1, m), 0, -1, Nd.getEmpty(), new VE(ko(1, m))));
    if (r)
      for (r.lastIndex = 0; (o = r.exec(e)) !== null; ) {
        const m = o.index, _ = o[0];
        if (_ === `
`)
          a++, l = m + 1;
        else {
          if (c !== m) {
            let v;
            if (u === a) {
              const w = m - c;
              if (w < d.length)
                v = d[w];
              else {
                const E = ko(0, w);
                v = new ZC(E, 0, -1, Nd.getEmpty(), new VE(E));
              }
            } else {
              const w = a - u, E = m - l;
              if (w === 1 && E < h.length)
                v = h[E];
              else {
                const L = ko(w, E);
                v = new ZC(L, 0, -1, Nd.getEmpty(), new VE(L));
              }
            }
            s.push(v);
          }
          s.push(t.getToken(_)), c = m + _.length, u = a;
        }
      }
    const g = e.length;
    if (c !== g) {
      const m = u === a ? ko(0, g - c) : ko(a - u, g - l);
      s.push(new ZC(m, 0, -1, Nd.getEmpty(), new VE(m)));
    }
    this.length = ko(a, g - l), this.tokens = s;
  }
  get offset() {
    return this._offset;
  }
  read() {
    return this.tokens[this.idx++] || null;
  }
  peek() {
    return this.tokens[this.idx] || null;
  }
  skip(e) {
    throw new ftt();
  }
}
class Kfe {
  static createFromLanguage(e, t) {
    function n(s) {
      return t.getKey(`${s.languageId}:::${s.bracketText}`);
    }
    const r = /* @__PURE__ */ new Map();
    for (const s of e.bracketsNew.openingBrackets) {
      const o = ko(0, s.bracketText.length), a = n(s), l = Nd.getEmpty().add(a, lTe);
      r.set(s.bracketText, new ZC(o, 1, a, l, yU.create(o, s, l)));
    }
    for (const s of e.bracketsNew.closingBrackets) {
      const o = ko(0, s.bracketText.length);
      let a = Nd.getEmpty();
      const l = s.getOpeningBrackets();
      for (const c of l)
        a = a.add(n(c), lTe);
      r.set(s.bracketText, new ZC(o, 2, n(l[0]), a, yU.create(o, s, a)));
    }
    return new Kfe(r);
  }
  constructor(e) {
    this.map = e, this.hasRegExp = !1, this._regExpGlobal = null;
  }
  getRegExpStr() {
    if (this.isEmpty)
      return null;
    {
      const e = [...this.map.keys()];
      return e.sort(), e.reverse(), e.map((t) => Eft(t)).join("|");
    }
  }
  /**
   * Returns null if there is no such regexp (because there are no brackets).
  */
  get regExpGlobal() {
    if (!this.hasRegExp) {
      const e = this.getRegExpStr();
      this._regExpGlobal = e ? new RegExp(e, "gi") : null, this.hasRegExp = !0;
    }
    return this._regExpGlobal;
  }
  getToken(e) {
    return this.map.get(e.toLowerCase());
  }
  findClosingTokenText(e) {
    for (const [t, n] of this.map)
      if (n.kind === 2 && n.bracketIds.intersects(e))
        return t;
  }
  get isEmpty() {
    return this.map.size === 0;
  }
}
function Eft(i) {
  let e = zd(i);
  return /^[\w ]+/.test(i) && (e = `\\b${e}`), /[\w ]+$/.test(i) && (e = `${e}\\b`), e;
}
class $3e {
  constructor(e, t) {
    this.denseKeyProvider = e, this.getLanguageConfiguration = t, this.languageIdToBracketTokens = /* @__PURE__ */ new Map();
  }
  didLanguageChange(e) {
    return this.languageIdToBracketTokens.has(e);
  }
  getSingleLanguageBracketTokens(e) {
    let t = this.languageIdToBracketTokens.get(e);
    return t || (t = Kfe.createFromLanguage(this.getLanguageConfiguration(e), this.denseKeyProvider), this.languageIdToBracketTokens.set(e, t)), t;
  }
}
function xft(i) {
  if (i.length === 0)
    return null;
  if (i.length === 1)
    return i[0];
  let e = 0;
  function t() {
    if (e >= i.length)
      return null;
    const o = e, a = i[o].listHeight;
    for (e++; e < i.length && i[e].listHeight === a; )
      e++;
    return e - o >= 2 ? j3e(o === 0 && e === i.length ? i : i.slice(o, e), !1) : i[o];
  }
  let n = t(), r = t();
  if (!r)
    return n;
  for (let o = t(); o; o = t())
    cTe(n, r) <= cTe(r, o) ? (n = hee(n, r), r = o) : r = hee(r, o);
  return hee(n, r);
}
function j3e(i, e = !1) {
  if (i.length === 0)
    return null;
  if (i.length === 1)
    return i[0];
  let t = i.length;
  for (; t > 3; ) {
    const n = t >> 1;
    for (let r = 0; r < n; r++) {
      const s = r << 1;
      i[r] = pb.create23(i[s], i[s + 1], s + 3 === t ? i[s + 2] : null, e);
    }
    t = n;
  }
  return pb.create23(i[0], i[1], t >= 3 ? i[2] : null, e);
}
function cTe(i, e) {
  return Math.abs(i.listHeight - e.listHeight);
}
function hee(i, e) {
  return i.listHeight === e.listHeight ? pb.create23(i, e, null, !1) : i.listHeight > e.listHeight ? Lft(i, e) : Tft(e, i);
}
function Lft(i, e) {
  i = i.toMutable();
  let t = i;
  const n = [];
  let r;
  for (; ; ) {
    if (e.listHeight === t.listHeight) {
      r = e;
      break;
    }
    if (t.kind !== 4)
      throw new Error("unexpected");
    n.push(t), t = t.makeLastElementMutable();
  }
  for (let s = n.length - 1; s >= 0; s--) {
    const o = n[s];
    r ? o.childrenLength >= 3 ? r = pb.create23(o.unappendChild(), r, null, !1) : (o.appendChildOfSameHeight(r), r = void 0) : o.handleChildrenChanged();
  }
  return r ? pb.create23(i, r, null, !1) : i;
}
function Tft(i, e) {
  i = i.toMutable();
  let t = i;
  const n = [];
  for (; e.listHeight !== t.listHeight; ) {
    if (t.kind !== 4)
      throw new Error("unexpected");
    n.push(t), t = t.makeFirstElementMutable();
  }
  let r = e;
  for (let s = n.length - 1; s >= 0; s--) {
    const o = n[s];
    r ? o.childrenLength >= 3 ? r = pb.create23(r, o.unprependChild(), null, !1) : (o.prependChildOfSameHeight(r), r = void 0) : o.handleChildrenChanged();
  }
  return r ? pb.create23(r, i, null, !1) : i;
}
class kft {
  constructor(e) {
    this.lastOffset = ou, this.nextNodes = [e], this.offsets = [ou], this.idxs = [];
  }
  /**
   * Returns the longest node at `offset` that satisfies the predicate.
   * @param offset must be greater than or equal to the last offset this method has been called with!
  */
  readLongestNodeAt(e, t) {
    if (tR(e, this.lastOffset))
      throw new Error("Invalid offset");
    for (this.lastOffset = e; ; ) {
      const n = jM(this.nextNodes);
      if (!n)
        return;
      const r = jM(this.offsets);
      if (tR(e, r))
        return;
      if (tR(r, e))
        if (Zs(r, n.length) <= e)
          this.nextNodeAfterCurrent();
        else {
          const s = fee(n);
          s !== -1 ? (this.nextNodes.push(n.getChild(s)), this.offsets.push(r), this.idxs.push(s)) : this.nextNodeAfterCurrent();
        }
      else {
        if (t(n))
          return this.nextNodeAfterCurrent(), n;
        {
          const s = fee(n);
          if (s === -1) {
            this.nextNodeAfterCurrent();
            return;
          } else
            this.nextNodes.push(n.getChild(s)), this.offsets.push(r), this.idxs.push(s);
        }
      }
    }
  }
  // Navigates to the longest node that continues after the current node.
  nextNodeAfterCurrent() {
    for (; ; ) {
      const e = jM(this.offsets), t = jM(this.nextNodes);
      if (this.nextNodes.pop(), this.offsets.pop(), this.idxs.length === 0)
        break;
      const n = jM(this.nextNodes), r = fee(n, this.idxs[this.idxs.length - 1]);
      if (r !== -1) {
        this.nextNodes.push(n.getChild(r)), this.offsets.push(Zs(e, t.length)), this.idxs[this.idxs.length - 1] = r;
        break;
      } else
        this.idxs.pop();
    }
  }
}
function fee(i, e = -1) {
  for (; ; ) {
    if (e++, e >= i.childrenLength)
      return -1;
    if (i.getChild(e))
      return e;
  }
}
function jM(i) {
  return i.length > 0 ? i[i.length - 1] : void 0;
}
function Sre(i, e, t, n) {
  return new Dft(i, e, t, n).parseDocument();
}
let Dft = class {
  constructor(e, t, n, r) {
    if (this.tokenizer = e, this.createImmutableLists = r, this._itemsConstructed = 0, this._itemsFromCache = 0, n && r)
      throw new Error("Not supported");
    this.oldNodeReader = n ? new kft(n) : void 0, this.positionMapper = new _ft(t);
  }
  parseDocument() {
    this._itemsConstructed = 0, this._itemsFromCache = 0;
    let e = this.parseList(Nd.getEmpty(), 0);
    return e || (e = pb.getEmpty()), e;
  }
  parseList(e, t) {
    const n = [];
    for (; ; ) {
      let s = this.tryReadChildFromCache(e);
      if (!s) {
        const o = this.tokenizer.peek();
        if (!o || o.kind === 2 && o.bracketIds.intersects(e))
          break;
        s = this.parseChild(e, t + 1);
      }
      s.kind === 4 && s.childrenLength === 0 || n.push(s);
    }
    return this.oldNodeReader ? xft(n) : j3e(n, this.createImmutableLists);
  }
  tryReadChildFromCache(e) {
    if (this.oldNodeReader) {
      const t = this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);
      if (t === null || !bU(t)) {
        const n = this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset), (r) => t !== null && !tR(r.length, t) ? !1 : r.canBeReused(e));
        if (n)
          return this._itemsFromCache++, this.tokenizer.skip(n.length), n;
      }
    }
  }
  parseChild(e, t) {
    this._itemsConstructed++;
    const n = this.tokenizer.read();
    switch (n.kind) {
      case 2:
        return new Cft(n.bracketIds, n.length);
      case 0:
        return n.astNode;
      case 1: {
        if (t > 300)
          return new VE(n.length);
        const r = e.merge(n.bracketIds), s = this.parseList(r, t + 1), o = this.tokenizer.peek();
        return o && o.kind === 2 && (o.bracketId === n.bracketId || o.bracketIds.intersects(n.bracketIds)) ? (this.tokenizer.read(), O4.create(n.astNode, s, o.astNode)) : O4.create(n.astNode, s, null);
      }
      default:
        throw new Error("unexpected");
    }
  }
};
function CU(i, e) {
  if (i.length === 0)
    return e;
  if (e.length === 0)
    return i;
  const t = new Ky(uTe(i)), n = uTe(e);
  n.push({ modified: !1, lengthBefore: void 0, lengthAfter: void 0 });
  let r = t.dequeue();
  function s(c) {
    if (c === void 0) {
      const d = t.takeWhile((h) => !0) || [];
      return r && d.unshift(r), d;
    }
    const u = [];
    for (; r && !bU(c); ) {
      const [d, h] = r.splitAt(c);
      u.push(d), c = A4(d.lengthAfter, c), r = h ?? t.dequeue();
    }
    return bU(c) || u.push(new h1(!1, c, c)), u;
  }
  const o = [];
  function a(c, u, d) {
    if (o.length > 0 && V3e(o[o.length - 1].endOffset, c)) {
      const h = o[o.length - 1];
      o[o.length - 1] = new Cy(h.startOffset, u, Zs(h.newLength, d));
    } else
      o.push({ startOffset: c, endOffset: u, newLength: d });
  }
  let l = ou;
  for (const c of n) {
    const u = s(c.lengthBefore);
    if (c.modified) {
      const d = pft(u, (g) => g.lengthBefore), h = Zs(l, d);
      a(l, h, c.lengthAfter), l = h;
    } else
      for (const d of u) {
        const h = l;
        l = Zs(l, d.lengthBefore), d.modified && a(h, l, d.lengthAfter);
      }
  }
  return o;
}
class h1 {
  constructor(e, t, n) {
    this.modified = e, this.lengthBefore = t, this.lengthAfter = n;
  }
  splitAt(e) {
    const t = A4(e, this.lengthAfter);
    return V3e(t, ou) ? [this, void 0] : this.modified ? [
      new h1(this.modified, this.lengthBefore, e),
      new h1(this.modified, ou, t)
    ] : [
      new h1(this.modified, e, e),
      new h1(this.modified, t, t)
    ];
  }
  toString() {
    return `${this.modified ? "M" : "U"}:${Wf(this.lengthBefore)} -> ${Wf(this.lengthAfter)}`;
  }
}
function uTe(i) {
  const e = [];
  let t = ou;
  for (const n of i) {
    const r = A4(t, n.startOffset);
    bU(r) || e.push(new h1(!1, r, r));
    const s = A4(n.startOffset, n.endOffset);
    e.push(new h1(!0, s, n.newLength)), t = n.endOffset;
  }
  return e;
}
class Ift extends ge {
  didLanguageChange(e) {
    return this.brackets.didLanguageChange(e);
  }
  constructor(e, t) {
    if (super(), this.textModel = e, this.getLanguageConfiguration = t, this.didChangeEmitter = new he(), this.denseKeyProvider = new U3e(), this.brackets = new $3e(this.denseKeyProvider, this.getLanguageConfiguration), this.onDidChange = this.didChangeEmitter.event, this.queuedTextEditsForInitialAstWithoutTokens = [], this.queuedTextEdits = [], e.tokenization.hasTokens)
      e.tokenization.backgroundTokenizationState === 2 ? (this.initialAstWithoutTokens = void 0, this.astWithTokens = this.parseDocumentFromTextBuffer([], void 0, !1)) : (this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer([], void 0, !0), this.astWithTokens = this.initialAstWithoutTokens);
    else {
      const n = this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()), r = new Sft(this.textModel.getValue(), n);
      this.initialAstWithoutTokens = Sre(r, [], void 0, !0), this.astWithTokens = this.initialAstWithoutTokens;
    }
  }
  //#region TextModel events
  handleDidChangeBackgroundTokenizationState() {
    if (this.textModel.tokenization.backgroundTokenizationState === 2) {
      const e = this.initialAstWithoutTokens === void 0;
      this.initialAstWithoutTokens = void 0, e || this.didChangeEmitter.fire();
    }
  }
  handleDidChangeTokens({ ranges: e }) {
    const t = e.map((n) => new Cy(ko(n.fromLineNumber - 1, 0), ko(n.toLineNumber, 0), ko(n.toLineNumber - n.fromLineNumber + 1, 0)));
    this.handleEdits(t, !0), this.initialAstWithoutTokens || this.didChangeEmitter.fire();
  }
  handleContentChanged(e) {
    const t = Cy.fromModelContentChanges(e.changes);
    this.handleEdits(t, !1);
  }
  handleEdits(e, t) {
    const n = CU(this.queuedTextEdits, e);
    this.queuedTextEdits = n, this.initialAstWithoutTokens && !t && (this.queuedTextEditsForInitialAstWithoutTokens = CU(this.queuedTextEditsForInitialAstWithoutTokens, e));
  }
  //#endregion
  flushQueue() {
    this.queuedTextEdits.length > 0 && (this.astWithTokens = this.parseDocumentFromTextBuffer(this.queuedTextEdits, this.astWithTokens, !1), this.queuedTextEdits = []), this.queuedTextEditsForInitialAstWithoutTokens.length > 0 && (this.initialAstWithoutTokens && (this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens, this.initialAstWithoutTokens, !1)), this.queuedTextEditsForInitialAstWithoutTokens = []);
  }
  /**
   * @pure (only if isPure = true)
  */
  parseDocumentFromTextBuffer(e, t, n) {
    const r = t, s = new z3e(this.textModel, this.brackets);
    return Sre(s, e, r, n);
  }
  getBracketsInRange(e, t) {
    this.flushQueue();
    const n = ko(e.startLineNumber - 1, e.startColumn - 1), r = ko(e.endLineNumber - 1, e.endColumn - 1);
    return new Rx((s) => {
      const o = this.initialAstWithoutTokens || this.astWithTokens;
      Ere(o, ou, o.length, n, r, s, 0, 0, /* @__PURE__ */ new Map(), t);
    });
  }
  getBracketPairsInRange(e, t) {
    this.flushQueue();
    const n = cN(e.getStartPosition()), r = cN(e.getEndPosition());
    return new Rx((s) => {
      const o = this.initialAstWithoutTokens || this.astWithTokens, a = new Nft(s, t, this.textModel);
      xre(o, ou, o.length, n, r, a, 0, /* @__PURE__ */ new Map());
    });
  }
  getFirstBracketAfter(e) {
    this.flushQueue();
    const t = this.initialAstWithoutTokens || this.astWithTokens;
    return q3e(t, ou, t.length, cN(e));
  }
  getFirstBracketBefore(e) {
    this.flushQueue();
    const t = this.initialAstWithoutTokens || this.astWithTokens;
    return G3e(t, ou, t.length, cN(e));
  }
}
function G3e(i, e, t, n) {
  if (i.kind === 4 || i.kind === 2) {
    const r = [];
    for (const s of i.children)
      t = Zs(e, s.length), r.push({ nodeOffsetStart: e, nodeOffsetEnd: t }), e = t;
    for (let s = r.length - 1; s >= 0; s--) {
      const { nodeOffsetStart: o, nodeOffsetEnd: a } = r[s];
      if (tR(o, n)) {
        const l = G3e(i.children[s], o, a, n);
        if (l)
          return l;
      }
    }
    return null;
  } else {
    if (i.kind === 3)
      return null;
    if (i.kind === 1) {
      const r = Ux(e, t);
      return {
        bracketInfo: i.bracketInfo,
        range: r
      };
    }
  }
  return null;
}
function q3e(i, e, t, n) {
  if (i.kind === 4 || i.kind === 2) {
    for (const r of i.children) {
      if (t = Zs(e, r.length), tR(n, t)) {
        const s = q3e(r, e, t, n);
        if (s)
          return s;
      }
      e = t;
    }
    return null;
  } else {
    if (i.kind === 3)
      return null;
    if (i.kind === 1) {
      const r = Ux(e, t);
      return {
        bracketInfo: i.bracketInfo,
        range: r
      };
    }
  }
  return null;
}
function Ere(i, e, t, n, r, s, o, a, l, c, u = !1) {
  if (o > 200)
    return !0;
  e: for (; ; )
    switch (i.kind) {
      case 4: {
        const d = i.childrenLength;
        for (let h = 0; h < d; h++) {
          const g = i.getChild(h);
          if (g) {
            if (t = Zs(e, g.length), nR(e, r) && $P(t, n)) {
              if ($P(t, r)) {
                i = g;
                continue e;
              }
              if (!Ere(g, e, t, n, r, s, o, 0, l, c))
                return !1;
            }
            e = t;
          }
        }
        return !0;
      }
      case 2: {
        const d = !c || !i.closingBracket || i.closingBracket.bracketInfo.closesColorized(i.openingBracket.bracketInfo);
        let h = 0;
        if (l) {
          let m = l.get(i.openingBracket.text);
          m === void 0 && (m = 0), h = m, d && (m++, l.set(i.openingBracket.text, m));
        }
        const g = i.childrenLength;
        for (let m = 0; m < g; m++) {
          const _ = i.getChild(m);
          if (_) {
            if (t = Zs(e, _.length), nR(e, r) && $P(t, n)) {
              if ($P(t, r) && _.kind !== 1) {
                i = _, d ? (o++, a = h + 1) : a = h;
                continue e;
              }
              if ((d || _.kind !== 1 || !i.closingBracket) && !Ere(_, e, t, n, r, s, d ? o + 1 : o, d ? h + 1 : h, l, c, !i.closingBracket))
                return !1;
            }
            e = t;
          }
        }
        return l == null || l.set(i.openingBracket.text, h), !0;
      }
      case 3: {
        const d = Ux(e, t);
        return s(new aTe(d, o - 1, 0, !0));
      }
      case 1: {
        const d = Ux(e, t);
        return s(new aTe(d, o - 1, a - 1, u));
      }
      case 0:
        return !0;
    }
}
class Nft {
  constructor(e, t, n) {
    this.push = e, this.includeMinIndentation = t, this.textModel = n;
  }
}
function xre(i, e, t, n, r, s, o, a) {
  var c;
  if (o > 200)
    return !0;
  let l = !0;
  if (i.kind === 2) {
    let u = 0;
    if (a) {
      let g = a.get(i.openingBracket.text);
      g === void 0 && (g = 0), u = g, g++, a.set(i.openingBracket.text, g);
    }
    const d = Zs(e, i.openingBracket.length);
    let h = -1;
    if (s.includeMinIndentation && (h = i.computeMinIndentation(e, s.textModel)), l = s.push(new hft(Ux(e, t), Ux(e, d), i.closingBracket ? Ux(Zs(d, ((c = i.child) == null ? void 0 : c.length) || ou), t) : void 0, o, u, i, h)), e = d, l && i.child) {
      const g = i.child;
      if (t = Zs(e, g.length), nR(e, r) && $P(t, n) && (l = xre(g, e, t, n, r, s, o + 1, a), !l))
        return !1;
    }
    a == null || a.set(i.openingBracket.text, u);
  } else {
    let u = e;
    for (const d of i.children) {
      const h = u;
      if (u = Zs(u, d.length), nR(h, r) && nR(n, u) && (l = xre(d, h, u, n, r, s, o, a), !l))
        return !1;
    }
  }
  return l;
}
class Rft extends ge {
  get canBuildAST() {
    return this.textModel.getValueLength() <= 5e6;
  }
  constructor(e, t) {
    super(), this.textModel = e, this.languageConfigurationService = t, this.bracketPairsTree = this._register(new er()), this.onDidChangeEmitter = new he(), this.onDidChange = this.onDidChangeEmitter.event, this.bracketsRequested = !1;
  }
  //#region TextModel events
  handleLanguageConfigurationServiceChange(e) {
    var t;
    (!e.languageId || (t = this.bracketPairsTree.value) != null && t.object.didLanguageChange(e.languageId)) && (this.bracketPairsTree.clear(), this.updateBracketPairsTree());
  }
  handleDidChangeOptions(e) {
    this.bracketPairsTree.clear(), this.updateBracketPairsTree();
  }
  handleDidChangeLanguage(e) {
    this.bracketPairsTree.clear(), this.updateBracketPairsTree();
  }
  handleDidChangeContent(e) {
    var t;
    (t = this.bracketPairsTree.value) == null || t.object.handleContentChanged(e);
  }
  handleDidChangeBackgroundTokenizationState() {
    var e;
    (e = this.bracketPairsTree.value) == null || e.object.handleDidChangeBackgroundTokenizationState();
  }
  handleDidChangeTokens(e) {
    var t;
    (t = this.bracketPairsTree.value) == null || t.object.handleDidChangeTokens(e);
  }
  //#endregion
  updateBracketPairsTree() {
    if (this.bracketsRequested && this.canBuildAST) {
      if (!this.bracketPairsTree.value) {
        const e = new ke();
        this.bracketPairsTree.value = Aft(e.add(new Ift(this.textModel, (t) => this.languageConfigurationService.getLanguageConfiguration(t))), e), e.add(this.bracketPairsTree.value.object.onDidChange((t) => this.onDidChangeEmitter.fire(t))), this.onDidChangeEmitter.fire();
      }
    } else
      this.bracketPairsTree.value && (this.bracketPairsTree.clear(), this.onDidChangeEmitter.fire());
  }
  /**
   * Returns all bracket pairs that intersect the given range.
   * The result is sorted by the start position.
  */
  getBracketPairsInRange(e) {
    var t;
    return this.bracketsRequested = !0, this.updateBracketPairsTree(), ((t = this.bracketPairsTree.value) == null ? void 0 : t.object.getBracketPairsInRange(e, !1)) || Rx.empty;
  }
  getBracketPairsInRangeWithMinIndentation(e) {
    var t;
    return this.bracketsRequested = !0, this.updateBracketPairsTree(), ((t = this.bracketPairsTree.value) == null ? void 0 : t.object.getBracketPairsInRange(e, !0)) || Rx.empty;
  }
  getBracketsInRange(e, t = !1) {
    var n;
    return this.bracketsRequested = !0, this.updateBracketPairsTree(), ((n = this.bracketPairsTree.value) == null ? void 0 : n.object.getBracketsInRange(e, t)) || Rx.empty;
  }
  findMatchingBracketUp(e, t, n) {
    const r = this.textModel.validatePosition(t), s = this.textModel.getLanguageIdAtPosition(r.lineNumber, r.column);
    if (this.canBuildAST) {
      const o = this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);
      if (!o)
        return null;
      const a = this.getBracketPairsInRange(z.fromPositions(t, t)).findLast((l) => o.closes(l.openingBracketInfo));
      return a ? a.openingBracketRange : null;
    } else {
      const o = e.toLowerCase(), a = this.languageConfigurationService.getLanguageConfiguration(s).brackets;
      if (!a)
        return null;
      const l = a.textIsBracket[o];
      return l ? U7(this._findMatchingBracketUp(l, r, gee(n))) : null;
    }
  }
  matchBracket(e, t) {
    if (this.canBuildAST) {
      const n = this.getBracketPairsInRange(z.fromPositions(e, e)).filter((r) => r.closingBracketRange !== void 0 && (r.openingBracketRange.containsPosition(e) || r.closingBracketRange.containsPosition(e))).findLastMaxBy(yl((r) => r.openingBracketRange.containsPosition(e) ? r.openingBracketRange : r.closingBracketRange, z.compareRangesUsingStarts));
      return n ? [n.openingBracketRange, n.closingBracketRange] : null;
    } else {
      const n = gee(t);
      return this._matchBracket(this.textModel.validatePosition(e), n);
    }
  }
  _establishBracketSearchOffsets(e, t, n, r) {
    const s = t.getCount(), o = t.getLanguageId(r);
    let a = Math.max(0, e.column - 1 - n.maxBracketLength);
    for (let c = r - 1; c >= 0; c--) {
      const u = t.getEndOffset(c);
      if (u <= a)
        break;
      if (y_(t.getStandardTokenType(c)) || t.getLanguageId(c) !== o) {
        a = u;
        break;
      }
    }
    let l = Math.min(t.getLineContent().length, e.column - 1 + n.maxBracketLength);
    for (let c = r + 1; c < s; c++) {
      const u = t.getStartOffset(c);
      if (u >= l)
        break;
      if (y_(t.getStandardTokenType(c)) || t.getLanguageId(c) !== o) {
        l = u;
        break;
      }
    }
    return { searchStartOffset: a, searchEndOffset: l };
  }
  _matchBracket(e, t) {
    const n = e.lineNumber, r = this.textModel.tokenization.getLineTokens(n), s = this.textModel.getLineContent(n), o = r.findTokenIndexAtOffset(e.column - 1);
    if (o < 0)
      return null;
    const a = this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(o)).brackets;
    if (a && !y_(r.getStandardTokenType(o))) {
      let { searchStartOffset: l, searchEndOffset: c } = this._establishBracketSearchOffsets(e, r, a, o), u = null;
      for (; ; ) {
        const d = Lg.findNextBracketInRange(a.forwardRegex, n, s, l, c);
        if (!d)
          break;
        if (d.startColumn <= e.column && e.column <= d.endColumn) {
          const h = s.substring(d.startColumn - 1, d.endColumn - 1).toLowerCase(), g = this._matchFoundBracket(d, a.textIsBracket[h], a.textIsOpenBracket[h], t);
          if (g) {
            if (g instanceof oy)
              return null;
            u = g;
          }
        }
        l = d.endColumn - 1;
      }
      if (u)
        return u;
    }
    if (o > 0 && r.getStartOffset(o) === e.column - 1) {
      const l = o - 1, c = this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(l)).brackets;
      if (c && !y_(r.getStandardTokenType(l))) {
        const { searchStartOffset: u, searchEndOffset: d } = this._establishBracketSearchOffsets(e, r, c, l), h = Lg.findPrevBracketInRange(c.reversedRegex, n, s, u, d);
        if (h && h.startColumn <= e.column && e.column <= h.endColumn) {
          const g = s.substring(h.startColumn - 1, h.endColumn - 1).toLowerCase(), m = this._matchFoundBracket(h, c.textIsBracket[g], c.textIsOpenBracket[g], t);
          if (m)
            return m instanceof oy ? null : m;
        }
      }
    }
    return null;
  }
  _matchFoundBracket(e, t, n, r) {
    if (!t)
      return null;
    const s = n ? this._findMatchingBracketDown(t, e.getEndPosition(), r) : this._findMatchingBracketUp(t, e.getStartPosition(), r);
    return s ? s instanceof oy ? s : [e, s] : null;
  }
  _findMatchingBracketUp(e, t, n) {
    const r = e.languageId, s = e.reversedRegex;
    let o = -1, a = 0;
    const l = (c, u, d, h) => {
      for (; ; ) {
        if (n && ++a % 100 === 0 && !n())
          return oy.INSTANCE;
        const g = Lg.findPrevBracketInRange(s, c, u, d, h);
        if (!g)
          break;
        const m = u.substring(g.startColumn - 1, g.endColumn - 1).toLowerCase();
        if (e.isOpen(m) ? o++ : e.isClose(m) && o--, o === 0)
          return g;
        h = g.startColumn - 1;
      }
      return null;
    };
    for (let c = t.lineNumber; c >= 1; c--) {
      const u = this.textModel.tokenization.getLineTokens(c), d = u.getCount(), h = this.textModel.getLineContent(c);
      let g = d - 1, m = h.length, _ = h.length;
      c === t.lineNumber && (g = u.findTokenIndexAtOffset(t.column - 1), m = t.column - 1, _ = t.column - 1);
      let v = !0;
      for (; g >= 0; g--) {
        const w = u.getLanguageId(g) === r && !y_(u.getStandardTokenType(g));
        if (w)
          v ? m = u.getStartOffset(g) : (m = u.getStartOffset(g), _ = u.getEndOffset(g));
        else if (v && m !== _) {
          const E = l(c, h, m, _);
          if (E)
            return E;
        }
        v = w;
      }
      if (v && m !== _) {
        const w = l(c, h, m, _);
        if (w)
          return w;
      }
    }
    return null;
  }
  _findMatchingBracketDown(e, t, n) {
    const r = e.languageId, s = e.forwardRegex;
    let o = 1, a = 0;
    const l = (u, d, h, g) => {
      for (; ; ) {
        if (n && ++a % 100 === 0 && !n())
          return oy.INSTANCE;
        const m = Lg.findNextBracketInRange(s, u, d, h, g);
        if (!m)
          break;
        const _ = d.substring(m.startColumn - 1, m.endColumn - 1).toLowerCase();
        if (e.isOpen(_) ? o++ : e.isClose(_) && o--, o === 0)
          return m;
        h = m.endColumn - 1;
      }
      return null;
    }, c = this.textModel.getLineCount();
    for (let u = t.lineNumber; u <= c; u++) {
      const d = this.textModel.tokenization.getLineTokens(u), h = d.getCount(), g = this.textModel.getLineContent(u);
      let m = 0, _ = 0, v = 0;
      u === t.lineNumber && (m = d.findTokenIndexAtOffset(t.column - 1), _ = t.column - 1, v = t.column - 1);
      let w = !0;
      for (; m < h; m++) {
        const E = d.getLanguageId(m) === r && !y_(d.getStandardTokenType(m));
        if (E)
          w || (_ = d.getStartOffset(m)), v = d.getEndOffset(m);
        else if (w && _ !== v) {
          const L = l(u, g, _, v);
          if (L)
            return L;
        }
        w = E;
      }
      if (w && _ !== v) {
        const E = l(u, g, _, v);
        if (E)
          return E;
      }
    }
    return null;
  }
  findPrevBracket(e) {
    var o;
    const t = this.textModel.validatePosition(e);
    if (this.canBuildAST)
      return this.bracketsRequested = !0, this.updateBracketPairsTree(), ((o = this.bracketPairsTree.value) == null ? void 0 : o.object.getFirstBracketBefore(t)) || null;
    let n = null, r = null, s = null;
    for (let a = t.lineNumber; a >= 1; a--) {
      const l = this.textModel.tokenization.getLineTokens(a), c = l.getCount(), u = this.textModel.getLineContent(a);
      let d = c - 1, h = u.length, g = u.length;
      if (a === t.lineNumber) {
        d = l.findTokenIndexAtOffset(t.column - 1), h = t.column - 1, g = t.column - 1;
        const _ = l.getLanguageId(d);
        n !== _ && (n = _, r = this.languageConfigurationService.getLanguageConfiguration(n).brackets, s = this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew);
      }
      let m = !0;
      for (; d >= 0; d--) {
        const _ = l.getLanguageId(d);
        if (n !== _) {
          if (r && s && m && h !== g) {
            const w = Lg.findPrevBracketInRange(r.reversedRegex, a, u, h, g);
            if (w)
              return this._toFoundBracket(s, w);
            m = !1;
          }
          n = _, r = this.languageConfigurationService.getLanguageConfiguration(n).brackets, s = this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew;
        }
        const v = !!r && !y_(l.getStandardTokenType(d));
        if (v)
          m ? h = l.getStartOffset(d) : (h = l.getStartOffset(d), g = l.getEndOffset(d));
        else if (s && r && m && h !== g) {
          const w = Lg.findPrevBracketInRange(r.reversedRegex, a, u, h, g);
          if (w)
            return this._toFoundBracket(s, w);
        }
        m = v;
      }
      if (s && r && m && h !== g) {
        const _ = Lg.findPrevBracketInRange(r.reversedRegex, a, u, h, g);
        if (_)
          return this._toFoundBracket(s, _);
      }
    }
    return null;
  }
  findNextBracket(e) {
    var a;
    const t = this.textModel.validatePosition(e);
    if (this.canBuildAST)
      return this.bracketsRequested = !0, this.updateBracketPairsTree(), ((a = this.bracketPairsTree.value) == null ? void 0 : a.object.getFirstBracketAfter(t)) || null;
    const n = this.textModel.getLineCount();
    let r = null, s = null, o = null;
    for (let l = t.lineNumber; l <= n; l++) {
      const c = this.textModel.tokenization.getLineTokens(l), u = c.getCount(), d = this.textModel.getLineContent(l);
      let h = 0, g = 0, m = 0;
      if (l === t.lineNumber) {
        h = c.findTokenIndexAtOffset(t.column - 1), g = t.column - 1, m = t.column - 1;
        const v = c.getLanguageId(h);
        r !== v && (r = v, s = this.languageConfigurationService.getLanguageConfiguration(r).brackets, o = this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew);
      }
      let _ = !0;
      for (; h < u; h++) {
        const v = c.getLanguageId(h);
        if (r !== v) {
          if (o && s && _ && g !== m) {
            const E = Lg.findNextBracketInRange(s.forwardRegex, l, d, g, m);
            if (E)
              return this._toFoundBracket(o, E);
            _ = !1;
          }
          r = v, s = this.languageConfigurationService.getLanguageConfiguration(r).brackets, o = this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew;
        }
        const w = !!s && !y_(c.getStandardTokenType(h));
        if (w)
          _ || (g = c.getStartOffset(h)), m = c.getEndOffset(h);
        else if (o && s && _ && g !== m) {
          const E = Lg.findNextBracketInRange(s.forwardRegex, l, d, g, m);
          if (E)
            return this._toFoundBracket(o, E);
        }
        _ = w;
      }
      if (o && s && _ && g !== m) {
        const v = Lg.findNextBracketInRange(s.forwardRegex, l, d, g, m);
        if (v)
          return this._toFoundBracket(o, v);
      }
    }
    return null;
  }
  findEnclosingBrackets(e, t) {
    const n = this.textModel.validatePosition(e);
    if (this.canBuildAST) {
      const g = z.fromPositions(n), m = this.getBracketPairsInRange(z.fromPositions(n, n)).findLast((_) => _.closingBracketRange !== void 0 && _.range.strictContainsRange(g));
      return m ? [m.openingBracketRange, m.closingBracketRange] : null;
    }
    const r = gee(t), s = this.textModel.getLineCount(), o = /* @__PURE__ */ new Map();
    let a = [];
    const l = (g, m) => {
      if (!o.has(g)) {
        const _ = [];
        for (let v = 0, w = m ? m.brackets.length : 0; v < w; v++)
          _[v] = 0;
        o.set(g, _);
      }
      a = o.get(g);
    };
    let c = 0;
    const u = (g, m, _, v, w) => {
      for (; ; ) {
        if (r && ++c % 100 === 0 && !r())
          return oy.INSTANCE;
        const E = Lg.findNextBracketInRange(g.forwardRegex, m, _, v, w);
        if (!E)
          break;
        const L = _.substring(E.startColumn - 1, E.endColumn - 1).toLowerCase(), T = g.textIsBracket[L];
        if (T && (T.isOpen(L) ? a[T.index]++ : T.isClose(L) && a[T.index]--, a[T.index] === -1))
          return this._matchFoundBracket(E, T, !1, r);
        v = E.endColumn - 1;
      }
      return null;
    };
    let d = null, h = null;
    for (let g = n.lineNumber; g <= s; g++) {
      const m = this.textModel.tokenization.getLineTokens(g), _ = m.getCount(), v = this.textModel.getLineContent(g);
      let w = 0, E = 0, L = 0;
      if (g === n.lineNumber) {
        w = m.findTokenIndexAtOffset(n.column - 1), E = n.column - 1, L = n.column - 1;
        const D = m.getLanguageId(w);
        d !== D && (d = D, h = this.languageConfigurationService.getLanguageConfiguration(d).brackets, l(d, h));
      }
      let T = !0;
      for (; w < _; w++) {
        const D = m.getLanguageId(w);
        if (d !== D) {
          if (h && T && E !== L) {
            const R = u(h, g, v, E, L);
            if (R)
              return U7(R);
            T = !1;
          }
          d = D, h = this.languageConfigurationService.getLanguageConfiguration(d).brackets, l(d, h);
        }
        const N = !!h && !y_(m.getStandardTokenType(w));
        if (N)
          T || (E = m.getStartOffset(w)), L = m.getEndOffset(w);
        else if (h && T && E !== L) {
          const R = u(h, g, v, E, L);
          if (R)
            return U7(R);
        }
        T = N;
      }
      if (h && T && E !== L) {
        const D = u(h, g, v, E, L);
        if (D)
          return U7(D);
      }
    }
    return null;
  }
  _toFoundBracket(e, t) {
    if (!t)
      return null;
    let n = this.textModel.getValueInRange(t);
    n = n.toLowerCase();
    const r = e.getBracketInfo(n);
    return r ? {
      range: t,
      bracketInfo: r
    } : null;
  }
}
function Aft(i, e) {
  return {
    object: i,
    dispose: () => e == null ? void 0 : e.dispose()
  };
}
function gee(i) {
  if (typeof i > "u")
    return () => !0;
  {
    const e = Date.now();
    return () => Date.now() - e <= i;
  }
}
const qj = class qj {
  constructor() {
    this._searchCanceledBrand = void 0;
  }
};
qj.INSTANCE = new qj();
let oy = qj;
function U7(i) {
  return i instanceof oy ? null : i;
}
class Oft extends ge {
  constructor(e) {
    super(), this.textModel = e, this.colorProvider = new K3e(), this.onDidChangeEmitter = new he(), this.onDidChange = this.onDidChangeEmitter.event, this.colorizationOptions = e.getOptions().bracketPairColorizationOptions, this._register(e.bracketPairs.onDidChange((t) => {
      this.onDidChangeEmitter.fire();
    }));
  }
  //#region TextModel events
  handleDidChangeOptions(e) {
    this.colorizationOptions = this.textModel.getOptions().bracketPairColorizationOptions;
  }
  //#endregion
  getDecorationsInRange(e, t, n, r) {
    return r ? [] : t === void 0 ? [] : this.colorizationOptions.enabled ? this.textModel.bracketPairs.getBracketsInRange(e, !0).map((o) => ({
      id: `bracket${o.range.toString()}-${o.nestingLevel}`,
      options: {
        description: "BracketPairColorization",
        inlineClassName: this.colorProvider.getInlineClassName(o, this.colorizationOptions.independentColorPoolPerBracketType)
      },
      ownerId: 0,
      range: o.range
    })).toArray() : [];
  }
  getAllDecorations(e, t) {
    return e === void 0 ? [] : this.colorizationOptions.enabled ? this.getDecorationsInRange(new z(1, 1, this.textModel.getLineCount(), 1), e, t) : [];
  }
}
class K3e {
  constructor() {
    this.unexpectedClosingBracketClassName = "unexpected-closing-bracket";
  }
  getInlineClassName(e, t) {
    return e.isInvalid ? this.unexpectedClosingBracketClassName : this.getInlineClassNameOfLevel(t ? e.nestingLevelOfEqualBracketType : e.nestingLevel);
  }
  getInlineClassNameOfLevel(e) {
    return `bracket-highlighting-${e % 30}`;
  }
}
ng((i, e) => {
  const t = [
    g3e,
    p3e,
    m3e,
    _3e,
    b3e,
    v3e
  ], n = new K3e();
  e.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${i.getColor($ut)}; }`);
  const r = t.map((s) => i.getColor(s)).filter((s) => !!s).filter((s) => !s.isTransparent());
  for (let s = 0; s < 30; s++) {
    const o = r[s % r.length];
    e.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(s)} { color: ${o}; }`);
  }
});
function z7(i) {
  return i.replace(/\n/g, "\\n").replace(/\r/g, "\\r");
}
class gl {
  get oldLength() {
    return this.oldText.length;
  }
  get oldEnd() {
    return this.oldPosition + this.oldText.length;
  }
  get newLength() {
    return this.newText.length;
  }
  get newEnd() {
    return this.newPosition + this.newText.length;
  }
  constructor(e, t, n, r) {
    this.oldPosition = e, this.oldText = t, this.newPosition = n, this.newText = r;
  }
  toString() {
    return this.oldText.length === 0 ? `(insert@${this.oldPosition} "${z7(this.newText)}")` : this.newText.length === 0 ? `(delete@${this.oldPosition} "${z7(this.oldText)}")` : `(replace@${this.oldPosition} "${z7(this.oldText)}" with "${z7(this.newText)}")`;
  }
  static _writeStringSize(e) {
    return 4 + 2 * e.length;
  }
  static _writeString(e, t, n) {
    const r = t.length;
    Fp(e, r, n), n += 4;
    for (let s = 0; s < r; s++)
      znt(e, t.charCodeAt(s), n), n += 2;
    return n;
  }
  static _readString(e, t) {
    const n = Pp(e, t);
    return t += 4, ast(e, t, n);
  }
  writeSize() {
    return 8 + gl._writeStringSize(this.oldText) + gl._writeStringSize(this.newText);
  }
  write(e, t) {
    return Fp(e, this.oldPosition, t), t += 4, Fp(e, this.newPosition, t), t += 4, t = gl._writeString(e, this.oldText, t), t = gl._writeString(e, this.newText, t), t;
  }
  static read(e, t, n) {
    const r = Pp(e, t);
    t += 4;
    const s = Pp(e, t);
    t += 4;
    const o = gl._readString(e, t);
    t += gl._writeStringSize(o);
    const a = gl._readString(e, t);
    return t += gl._writeStringSize(a), n.push(new gl(r, o, s, a)), t;
  }
}
function Mft(i, e) {
  return i === null || i.length === 0 ? e : new T_(i, e).compress();
}
class T_ {
  constructor(e, t) {
    this._prevEdits = e, this._currEdits = t, this._result = [], this._resultLen = 0, this._prevLen = this._prevEdits.length, this._prevDeltaOffset = 0, this._currLen = this._currEdits.length, this._currDeltaOffset = 0;
  }
  compress() {
    let e = 0, t = 0, n = this._getPrev(e), r = this._getCurr(t);
    for (; e < this._prevLen || t < this._currLen; ) {
      if (n === null) {
        this._acceptCurr(r), r = this._getCurr(++t);
        continue;
      }
      if (r === null) {
        this._acceptPrev(n), n = this._getPrev(++e);
        continue;
      }
      if (r.oldEnd <= n.newPosition) {
        this._acceptCurr(r), r = this._getCurr(++t);
        continue;
      }
      if (n.newEnd <= r.oldPosition) {
        this._acceptPrev(n), n = this._getPrev(++e);
        continue;
      }
      if (r.oldPosition < n.newPosition) {
        const [c, u] = T_._splitCurr(r, n.newPosition - r.oldPosition);
        this._acceptCurr(c), r = u;
        continue;
      }
      if (n.newPosition < r.oldPosition) {
        const [c, u] = T_._splitPrev(n, r.oldPosition - n.newPosition);
        this._acceptPrev(c), n = u;
        continue;
      }
      let a, l;
      if (r.oldEnd === n.newEnd)
        a = n, l = r, n = this._getPrev(++e), r = this._getCurr(++t);
      else if (r.oldEnd < n.newEnd) {
        const [c, u] = T_._splitPrev(n, r.oldLength);
        a = c, l = r, n = u, r = this._getCurr(++t);
      } else {
        const [c, u] = T_._splitCurr(r, n.newLength);
        a = n, l = c, n = this._getPrev(++e), r = u;
      }
      this._result[this._resultLen++] = new gl(a.oldPosition, a.oldText, l.newPosition, l.newText), this._prevDeltaOffset += a.newLength - a.oldLength, this._currDeltaOffset += l.newLength - l.oldLength;
    }
    const s = T_._merge(this._result);
    return T_._removeNoOps(s);
  }
  _acceptCurr(e) {
    this._result[this._resultLen++] = T_._rebaseCurr(this._prevDeltaOffset, e), this._currDeltaOffset += e.newLength - e.oldLength;
  }
  _getCurr(e) {
    return e < this._currLen ? this._currEdits[e] : null;
  }
  _acceptPrev(e) {
    this._result[this._resultLen++] = T_._rebasePrev(this._currDeltaOffset, e), this._prevDeltaOffset += e.newLength - e.oldLength;
  }
  _getPrev(e) {
    return e < this._prevLen ? this._prevEdits[e] : null;
  }
  static _rebaseCurr(e, t) {
    return new gl(t.oldPosition - e, t.oldText, t.newPosition, t.newText);
  }
  static _rebasePrev(e, t) {
    return new gl(t.oldPosition, t.oldText, t.newPosition + e, t.newText);
  }
  static _splitPrev(e, t) {
    const n = e.newText.substr(0, t), r = e.newText.substr(t);
    return [
      new gl(e.oldPosition, e.oldText, e.newPosition, n),
      new gl(e.oldEnd, "", e.newPosition + t, r)
    ];
  }
  static _splitCurr(e, t) {
    const n = e.oldText.substr(0, t), r = e.oldText.substr(t);
    return [
      new gl(e.oldPosition, n, e.newPosition, e.newText),
      new gl(e.oldPosition + t, r, e.newEnd, "")
    ];
  }
  static _merge(e) {
    if (e.length === 0)
      return e;
    const t = [];
    let n = 0, r = e[0];
    for (let s = 1; s < e.length; s++) {
      const o = e[s];
      r.oldEnd === o.oldPosition ? r = new gl(r.oldPosition, r.oldText + o.oldText, r.newPosition, r.newText + o.newText) : (t[n++] = r, r = o);
    }
    return t[n++] = r, t;
  }
  static _removeNoOps(e) {
    if (e.length === 0)
      return e;
    const t = [];
    let n = 0;
    for (let r = 0; r < e.length; r++) {
      const s = e[r];
      s.oldText !== s.newText && (t[n++] = s);
    }
    return t;
  }
}
const Pft = Symbol("TextModelEditSource");
class Y3e {
  constructor(e, t) {
    this.metadata = e;
  }
  toString() {
    return `${this.metadata.source}`;
  }
  getType() {
    const e = this.metadata;
    switch (e.source) {
      case "cursor":
        return e.kind;
      case "inlineCompletionAccept":
        return e.source + (e.$nes ? ":nes" : "");
      case "unknown":
        return e.name || "unknown";
      default:
        return e.source;
    }
  }
  /**
   * Converts the metadata to a key string.
   * Only includes properties/values that have `level` many `$` prefixes or less.
  */
  toKey(e, t = {}) {
    const n = this.metadata;
    return Object.entries(n).filter(([s, o]) => {
      const a = t[s];
      return a !== void 0 ? a : (s.match(/\$/g) || []).length <= e && o !== void 0 && o !== null && o !== "";
    }).map(([s, o]) => `${s}:${o}`).join("-");
  }
}
function Pu(i) {
  return new Y3e(i, Pft);
}
const $l = {
  unknown(i) {
    return Pu({
      source: "unknown",
      name: i.name
    });
  },
  rename: () => Pu({ source: "rename" }),
  chatApplyEdits(i) {
    var e, t;
    return Pu({
      source: "Chat.applyEdits",
      $modelId: dTe(i.modelId),
      $extensionId: (e = i.extensionId) == null ? void 0 : e.extensionId,
      $extensionVersion: (t = i.extensionId) == null ? void 0 : t.version,
      $$languageId: i.languageId,
      $$sessionId: i.sessionId,
      $$requestId: i.requestId,
      $$mode: i.mode,
      $$codeBlockSuggestionId: i.codeBlockSuggestionId
    });
  },
  chatUndoEdits: () => Pu({ source: "Chat.undoEdits" }),
  chatReset: () => Pu({ source: "Chat.reset" }),
  inlineCompletionAccept(i) {
    return Pu({
      source: "inlineCompletionAccept",
      $nes: i.nes,
      ...$7(i.providerId),
      $$requestUuid: i.requestUuid,
      $$languageId: i.languageId
    });
  },
  inlineCompletionPartialAccept(i) {
    return Pu({
      source: "inlineCompletionPartialAccept",
      type: i.type,
      $nes: i.nes,
      ...$7(i.providerId),
      $$requestUuid: i.requestUuid,
      $$languageId: i.languageId
    });
  },
  inlineChatApplyEdit(i) {
    var e, t;
    return Pu({
      source: "inlineChat.applyEdits",
      $modelId: dTe(i.modelId),
      $extensionId: (e = i.extensionId) == null ? void 0 : e.extensionId,
      $extensionVersion: (t = i.extensionId) == null ? void 0 : t.version,
      $$requestId: i.requestId,
      $$languageId: i.languageId
    });
  },
  reloadFromDisk: () => Pu({ source: "reloadFromDisk" }),
  cursor(i) {
    return Pu({
      source: "cursor",
      kind: i.kind,
      detailedSource: i.detailedSource
    });
  },
  setValue: () => Pu({ source: "setValue" }),
  eolChange: () => Pu({ source: "eolChange" }),
  applyEdits: () => Pu({ source: "applyEdits" }),
  snippet: () => Pu({ source: "snippet" }),
  suggest: (i) => Pu({ source: "suggest", ...$7(i.providerId) }),
  codeAction: (i) => Pu({ source: "codeAction", $kind: i.kind, ...$7(i.providerId) })
};
function $7(i) {
  return i ? {
    $extensionId: i.extensionId,
    $extensionVersion: i.extensionVersion,
    $providerId: i.providerId
  } : {};
}
function dTe(i) {
  if (i !== void 0)
    return i.replaceAll("/", "|");
}
class P4 {
  static fromText(e) {
    const t = ta.ofText(e).lineCount, n = e.length;
    return new P4(t, 0, n, 0);
  }
  static tryCreate(e, t, n, r) {
    if (!(e === void 0 || t === void 0 || n === void 0 || r === void 0))
      return new P4(e, t, n, r);
  }
  constructor(e, t, n, r) {
    this.linesAdded = e, this.linesRemoved = t, this.charsAdded = n, this.charsRemoved = r;
  }
}
var hTe;
(function(i) {
  function e() {
    const t = r3e("sgt");
    return t;
  }
  i.newId = e;
})(hTe || (hTe = {}));
function pI(i) {
  return i.toString();
}
class ka {
  static create(e, t) {
    const n = e.getAlternativeVersionId(), r = Lre(e);
    return new ka(n, n, r, r, t, t, []);
  }
  constructor(e, t, n, r, s, o, a) {
    this.beforeVersionId = e, this.afterVersionId = t, this.beforeEOL = n, this.afterEOL = r, this.beforeCursorState = s, this.afterCursorState = o, this.changes = a;
  }
  append(e, t, n, r, s) {
    t.length > 0 && (this.changes = Mft(this.changes, t)), this.afterEOL = n, this.afterVersionId = r, this.afterCursorState = s;
  }
  static _writeSelectionsSize(e) {
    return 4 + 16 * (e ? e.length : 0);
  }
  static _writeSelections(e, t, n) {
    if (Fp(e, t ? t.length : 0, n), n += 4, t)
      for (const r of t)
        Fp(e, r.selectionStartLineNumber, n), n += 4, Fp(e, r.selectionStartColumn, n), n += 4, Fp(e, r.positionLineNumber, n), n += 4, Fp(e, r.positionColumn, n), n += 4;
    return n;
  }
  static _readSelections(e, t, n) {
    const r = Pp(e, t);
    t += 4;
    for (let s = 0; s < r; s++) {
      const o = Pp(e, t);
      t += 4;
      const a = Pp(e, t);
      t += 4;
      const l = Pp(e, t);
      t += 4;
      const c = Pp(e, t);
      t += 4, n.push(new bt(o, a, l, c));
    }
    return t;
  }
  serialize() {
    let e = 10 + ka._writeSelectionsSize(this.beforeCursorState) + ka._writeSelectionsSize(this.afterCursorState) + 4;
    for (const r of this.changes)
      e += r.writeSize();
    const t = new Uint8Array(e);
    let n = 0;
    Fp(t, this.beforeVersionId, n), n += 4, Fp(t, this.afterVersionId, n), n += 4, Exe(t, this.beforeEOL, n), n += 1, Exe(t, this.afterEOL, n), n += 1, n = ka._writeSelections(t, this.beforeCursorState, n), n = ka._writeSelections(t, this.afterCursorState, n), Fp(t, this.changes.length, n), n += 4;
    for (const r of this.changes)
      n = r.write(t, n);
    return t.buffer;
  }
  static deserialize(e) {
    const t = new Uint8Array(e);
    let n = 0;
    const r = Pp(t, n);
    n += 4;
    const s = Pp(t, n);
    n += 4;
    const o = Sxe(t, n);
    n += 1;
    const a = Sxe(t, n);
    n += 1;
    const l = [];
    n = ka._readSelections(t, n, l);
    const c = [];
    n = ka._readSelections(t, n, c);
    const u = Pp(t, n);
    n += 4;
    const d = [];
    for (let h = 0; h < u; h++)
      n = gl.read(t, n, d);
    return new ka(r, s, o, a, l, c, d);
  }
}
class X3e {
  get type() {
    return 0;
  }
  get resource() {
    return Ht.isUri(this.model) ? this.model : this.model.uri;
  }
  constructor(e, t, n, r) {
    this.label = e, this.code = t, this.model = n, this._data = ka.create(n, r);
  }
  toString() {
    return (this._data instanceof ka ? this._data : ka.deserialize(this._data)).changes.map((t) => t.toString()).join(", ");
  }
  matchesResource(e) {
    return (Ht.isUri(this.model) ? this.model : this.model.uri).toString() === e.toString();
  }
  setModel(e) {
    this.model = e;
  }
  canAppend(e) {
    return this.model === e && this._data instanceof ka;
  }
  append(e, t, n, r, s) {
    this._data instanceof ka && this._data.append(e, t, n, r, s);
  }
  close() {
    this._data instanceof ka && (this._data = this._data.serialize());
  }
  open() {
    this._data instanceof ka || (this._data = ka.deserialize(this._data));
  }
  undo() {
    if (Ht.isUri(this.model))
      throw new Error("Invalid SingleModelEditStackElement");
    this._data instanceof ka && (this._data = this._data.serialize());
    const e = ka.deserialize(this._data);
    this.model._applyUndo(e.changes, e.beforeEOL, e.beforeVersionId, e.beforeCursorState);
  }
  redo() {
    if (Ht.isUri(this.model))
      throw new Error("Invalid SingleModelEditStackElement");
    this._data instanceof ka && (this._data = this._data.serialize());
    const e = ka.deserialize(this._data);
    this.model._applyRedo(e.changes, e.afterEOL, e.afterVersionId, e.afterCursorState);
  }
  heapSize() {
    return this._data instanceof ka && (this._data = this._data.serialize()), this._data.byteLength + 168;
  }
}
class Fft {
  get resources() {
    return this._editStackElementsArr.map((e) => e.resource);
  }
  constructor(e, t, n) {
    this.label = e, this.code = t, this.type = 1, this._isOpen = !0, this._editStackElementsArr = n.slice(0), this._editStackElementsMap = /* @__PURE__ */ new Map();
    for (const r of this._editStackElementsArr) {
      const s = pI(r.resource);
      this._editStackElementsMap.set(s, r);
    }
    this._delegate = null;
  }
  prepareUndoRedo() {
    if (this._delegate)
      return this._delegate.prepareUndoRedo(this);
  }
  matchesResource(e) {
    const t = pI(e);
    return this._editStackElementsMap.has(t);
  }
  setModel(e) {
    const t = pI(Ht.isUri(e) ? e : e.uri);
    this._editStackElementsMap.has(t) && this._editStackElementsMap.get(t).setModel(e);
  }
  canAppend(e) {
    if (!this._isOpen)
      return !1;
    const t = pI(e.uri);
    return this._editStackElementsMap.has(t) ? this._editStackElementsMap.get(t).canAppend(e) : !1;
  }
  append(e, t, n, r, s) {
    const o = pI(e.uri);
    this._editStackElementsMap.get(o).append(e, t, n, r, s);
  }
  close() {
    this._isOpen = !1;
  }
  open() {
  }
  undo() {
    this._isOpen = !1;
    for (const e of this._editStackElementsArr)
      e.undo();
  }
  redo() {
    for (const e of this._editStackElementsArr)
      e.redo();
  }
  heapSize(e) {
    const t = pI(e);
    return this._editStackElementsMap.has(t) ? this._editStackElementsMap.get(t).heapSize() : 0;
  }
  split() {
    return this._editStackElementsArr;
  }
  toString() {
    const e = [];
    for (const t of this._editStackElementsArr)
      e.push(`${Kf(t.resource)}: ${t}`);
    return `{${e.join(", ")}}`;
  }
}
function Lre(i) {
  return i.getEOL() === `
` ? 0 : 1;
}
function ay(i) {
  return i ? i instanceof X3e || i instanceof Fft : !1;
}
class Yfe {
  constructor(e, t) {
    this._model = e, this._undoRedoService = t;
  }
  pushStackElement() {
    const e = this._undoRedoService.getLastElement(this._model.uri);
    ay(e) && e.close();
  }
  popStackElement() {
    const e = this._undoRedoService.getLastElement(this._model.uri);
    ay(e) && e.open();
  }
  clear() {
    this._undoRedoService.removeElements(this._model.uri);
  }
  _getOrCreateEditStackElement(e, t) {
    const n = this._undoRedoService.getLastElement(this._model.uri);
    if (ay(n) && n.canAppend(this._model))
      return n;
    const r = new X3e(S(781, "Typing"), "undoredo.textBufferEdit", this._model, e);
    return this._undoRedoService.pushElement(r, t), r;
  }
  pushEOL(e) {
    const t = this._getOrCreateEditStackElement(null, void 0);
    this._model.setEOL(e), t.append(this._model, [], Lre(this._model), this._model.getAlternativeVersionId(), null);
  }
  pushEditOperation(e, t, n, r, s = $l.unknown({ name: "pushEditOperation" })) {
    const o = this._getOrCreateEditStackElement(e, r), a = this._model.applyEdits(t, !0, s), l = Yfe._computeCursorState(n, a), c = a.map((u, d) => ({ index: d, textChange: u.textChange }));
    return c.sort((u, d) => u.textChange.oldPosition === d.textChange.oldPosition ? u.index - d.index : u.textChange.oldPosition - d.textChange.oldPosition), o.append(this._model, c.map((u) => u.textChange), Lre(this._model), this._model.getAlternativeVersionId(), l), l;
  }
  static _computeCursorState(e, t) {
    try {
      return e ? e(t) : null;
    } catch (n) {
      return fn(n), null;
    }
  }
}
class Bft {
  constructor() {
    this.spacesDiff = 0, this.looksLikeAlignment = !1;
  }
}
function Hft(i, e, t, n, r) {
  r.spacesDiff = 0, r.looksLikeAlignment = !1;
  let s;
  for (s = 0; s < e && s < n; s++) {
    const h = i.charCodeAt(s), g = t.charCodeAt(s);
    if (h !== g)
      break;
  }
  let o = 0, a = 0;
  for (let h = s; h < e; h++)
    i.charCodeAt(h) === 32 ? o++ : a++;
  let l = 0, c = 0;
  for (let h = s; h < n; h++)
    t.charCodeAt(h) === 32 ? l++ : c++;
  if (o > 0 && a > 0 || l > 0 && c > 0)
    return;
  const u = Math.abs(a - c), d = Math.abs(o - l);
  if (u === 0) {
    r.spacesDiff = d, d > 0 && 0 <= l - 1 && l - 1 < i.length && l < t.length && t.charCodeAt(l) !== 32 && i.charCodeAt(l - 1) === 32 && i.charCodeAt(i.length - 1) === 44 && (r.looksLikeAlignment = !0);
    return;
  }
  if (d % u === 0) {
    r.spacesDiff = d / u;
    return;
  }
}
function fTe(i, e, t) {
  const n = Math.min(i.getLineCount(), 1e4);
  let r = 0, s = 0, o = "", a = 0;
  const l = [2, 4, 6, 8, 3, 5, 7], c = 8, u = [0, 0, 0, 0, 0, 0, 0, 0, 0], d = new Bft();
  for (let m = 1; m <= n; m++) {
    const _ = i.getLineLength(m), v = i.getLineContent(m), w = _ <= 65536;
    let E = !1, L = 0, T = 0, D = 0;
    for (let R = 0, M = _; R < M; R++) {
      const B = w ? v.charCodeAt(R) : i.getLineCharCode(m, R);
      if (B === 9)
        D++;
      else if (B === 32)
        T++;
      else {
        E = !0, L = R;
        break;
      }
    }
    if (!E || (D > 0 ? r++ : T > 1 && s++, Hft(o, a, v, L, d), d.looksLikeAlignment && !(t && e === d.spacesDiff)))
      continue;
    const N = d.spacesDiff;
    N <= c && u[N]++, o = v, a = L;
  }
  let h = t;
  r !== s && (h = r < s);
  let g = e;
  if (h) {
    let m = h ? 0 : 0.1 * n;
    l.forEach((_) => {
      const v = u[_];
      v > m && (m = v, g = _);
    }), g === 4 && u[4] > 0 && u[2] > 0 && u[2] >= u[4] / 2 && (g = 2);
  }
  return {
    insertSpaces: h,
    tabSize: g
  };
}
function Fu(i) {
  return (i.metadata & 1) >>> 0;
}
function os(i, e) {
  i.metadata = i.metadata & 254 | e << 0;
}
function Cl(i) {
  return (i.metadata & 2) >>> 1 === 1;
}
function Qr(i, e) {
  i.metadata = i.metadata & 253 | (e ? 1 : 0) << 1;
}
function Z3e(i) {
  return (i.metadata & 4) >>> 2 === 1;
}
function gTe(i, e) {
  i.metadata = i.metadata & 251 | (e ? 1 : 0) << 2;
}
function Q3e(i) {
  return (i.metadata & 64) >>> 6 === 1;
}
function pTe(i, e) {
  i.metadata = i.metadata & 191 | (e ? 1 : 0) << 6;
}
function J3e(i) {
  return (i.metadata & 128) >>> 7 === 1;
}
function mTe(i, e) {
  i.metadata = i.metadata & 127 | (e ? 1 : 0) << 7;
}
function Wft(i) {
  return (i.metadata & 24) >>> 3;
}
function _Te(i, e) {
  i.metadata = i.metadata & 231 | e << 3;
}
function Vft(i) {
  return (i.metadata & 32) >>> 5 === 1;
}
function bTe(i, e) {
  i.metadata = i.metadata & 223 | (e ? 1 : 0) << 5;
}
class e4e {
  constructor(e, t, n) {
    this.metadata = 0, this.parent = this, this.left = this, this.right = this, os(
      this,
      1
      /* NodeColor.Red */
    ), this.start = t, this.end = n, this.delta = 0, this.maxEnd = n, this.id = e, this.ownerId = 0, this.options = null, gTe(this, !1), pTe(this, !1), _Te(
      this,
      1
      /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
    ), bTe(this, !1), mTe(this, !1), this.cachedVersionId = 0, this.cachedAbsoluteStart = t, this.cachedAbsoluteEnd = n, this.range = null, Qr(this, !1);
  }
  reset(e, t, n, r) {
    this.start = t, this.end = n, this.maxEnd = n, this.cachedVersionId = e, this.cachedAbsoluteStart = t, this.cachedAbsoluteEnd = n, this.range = r;
  }
  setOptions(e) {
    this.options = e;
    const t = this.options.className;
    gTe(this, t === "squiggly-error" || t === "squiggly-warning" || t === "squiggly-info"), pTe(this, this.options.glyphMarginClassName !== null), _Te(this, this.options.stickiness), bTe(this, this.options.collapseOnReplaceEdit), mTe(this, this.options.affectsFont ?? !1);
  }
  setCachedOffsets(e, t, n) {
    this.cachedVersionId !== n && (this.range = null), this.cachedVersionId = n, this.cachedAbsoluteStart = e, this.cachedAbsoluteEnd = t;
  }
  detach() {
    this.parent = null, this.left = null, this.right = null;
  }
}
const si = new e4e(null, 0, 0);
si.parent = si;
si.left = si;
si.right = si;
os(
  si,
  0
  /* NodeColor.Black */
);
class pee {
  constructor() {
    this.root = si, this.requestNormalizeDelta = !1;
  }
  intervalSearch(e, t, n, r, s, o, a) {
    return this.root === si ? [] : Yft(this, e, t, n, r, s, o, a);
  }
  search(e, t, n, r, s) {
    return this.root === si ? [] : Kft(this, e, t, n, r, s);
  }
  /**
   * Will not set `cachedAbsoluteStart` nor `cachedAbsoluteEnd` on the returned nodes!
   */
  collectNodesFromOwner(e) {
    return Gft(this, e);
  }
  /**
   * Will not set `cachedAbsoluteStart` nor `cachedAbsoluteEnd` on the returned nodes!
   */
  collectNodesPostOrder() {
    return qft(this);
  }
  insert(e) {
    vTe(this, e), this._normalizeDeltaIfNecessary();
  }
  delete(e) {
    yTe(this, e), this._normalizeDeltaIfNecessary();
  }
  resolveNode(e, t) {
    const n = e;
    let r = 0;
    for (; e !== this.root; )
      e === e.parent.right && (r += e.parent.delta), e = e.parent;
    const s = n.start + r, o = n.end + r;
    n.setCachedOffsets(s, o, t);
  }
  acceptReplace(e, t, n, r) {
    const s = $ft(this, e, e + t);
    for (let o = 0, a = s.length; o < a; o++) {
      const l = s[o];
      yTe(this, l);
    }
    this._normalizeDeltaIfNecessary(), jft(this, e, e + t, n), this._normalizeDeltaIfNecessary();
    for (let o = 0, a = s.length; o < a; o++) {
      const l = s[o];
      l.start = l.cachedAbsoluteStart, l.end = l.cachedAbsoluteEnd, zft(l, e, e + t, n, r), l.maxEnd = l.end, vTe(this, l);
    }
    this._normalizeDeltaIfNecessary();
  }
  _normalizeDeltaIfNecessary() {
    this.requestNormalizeDelta && (this.requestNormalizeDelta = !1, Uft(this));
  }
}
function Uft(i) {
  let e = i.root, t = 0;
  for (; e !== si; ) {
    if (e.left !== si && !Cl(e.left)) {
      e = e.left;
      continue;
    }
    if (e.right !== si && !Cl(e.right)) {
      t += e.delta, e = e.right;
      continue;
    }
    e.start = t + e.start, e.end = t + e.end, e.delta = 0, cw(e), Qr(e, !0), Qr(e.left, !1), Qr(e.right, !1), e === e.parent.right && (t -= e.parent.delta), e = e.parent;
  }
  Qr(i.root, !1);
}
function mI(i, e, t, n) {
  return i < t ? !0 : i > t || n === 1 ? !1 : n === 2 ? !0 : e;
}
function zft(i, e, t, n, r) {
  const s = Wft(i), o = s === 0 || s === 2, a = s === 1 || s === 2, l = t - e, c = n, u = Math.min(l, c), d = i.start;
  let h = !1;
  const g = i.end;
  let m = !1;
  e <= d && g <= t && Vft(i) && (i.start = e, h = !0, i.end = e, m = !0);
  {
    const v = r ? 1 : l > 0 ? 2 : 0;
    !h && mI(d, o, e, v) && (h = !0), !m && mI(g, a, e, v) && (m = !0);
  }
  if (u > 0 && !r) {
    const v = l > c ? 2 : 0;
    !h && mI(d, o, e + u, v) && (h = !0), !m && mI(g, a, e + u, v) && (m = !0);
  }
  {
    const v = r ? 1 : 0;
    !h && mI(d, o, t, v) && (i.start = e + c, h = !0), !m && mI(g, a, t, v) && (i.end = e + c, m = !0);
  }
  const _ = c - l;
  h || (i.start = Math.max(0, d + _)), m || (i.end = Math.max(0, g + _)), i.start > i.end && (i.end = i.start);
}
function $ft(i, e, t) {
  let n = i.root, r = 0, s = 0, o = 0, a = 0;
  const l = [];
  let c = 0;
  for (; n !== si; ) {
    if (Cl(n)) {
      Qr(n.left, !1), Qr(n.right, !1), n === n.parent.right && (r -= n.parent.delta), n = n.parent;
      continue;
    }
    if (!Cl(n.left)) {
      if (s = r + n.maxEnd, s < e) {
        Qr(n, !0);
        continue;
      }
      if (n.left !== si) {
        n = n.left;
        continue;
      }
    }
    if (o = r + n.start, o > t) {
      Qr(n, !0);
      continue;
    }
    if (a = r + n.end, a >= e && (n.setCachedOffsets(o, a, 0), l[c++] = n), Qr(n, !0), n.right !== si && !Cl(n.right)) {
      r += n.delta, n = n.right;
      continue;
    }
  }
  return Qr(i.root, !1), l;
}
function jft(i, e, t, n) {
  let r = i.root, s = 0, o = 0, a = 0;
  const l = n - (t - e);
  for (; r !== si; ) {
    if (Cl(r)) {
      Qr(r.left, !1), Qr(r.right, !1), r === r.parent.right && (s -= r.parent.delta), cw(r), r = r.parent;
      continue;
    }
    if (!Cl(r.left)) {
      if (o = s + r.maxEnd, o < e) {
        Qr(r, !0);
        continue;
      }
      if (r.left !== si) {
        r = r.left;
        continue;
      }
    }
    if (a = s + r.start, a > t) {
      r.start += l, r.end += l, r.delta += l, (r.delta < -1073741824 || r.delta > 1073741824) && (i.requestNormalizeDelta = !0), Qr(r, !0);
      continue;
    }
    if (Qr(r, !0), r.right !== si && !Cl(r.right)) {
      s += r.delta, r = r.right;
      continue;
    }
  }
  Qr(i.root, !1);
}
function Gft(i, e) {
  let t = i.root;
  const n = [];
  let r = 0;
  for (; t !== si; ) {
    if (Cl(t)) {
      Qr(t.left, !1), Qr(t.right, !1), t = t.parent;
      continue;
    }
    if (t.left !== si && !Cl(t.left)) {
      t = t.left;
      continue;
    }
    if (t.ownerId === e && (n[r++] = t), Qr(t, !0), t.right !== si && !Cl(t.right)) {
      t = t.right;
      continue;
    }
  }
  return Qr(i.root, !1), n;
}
function qft(i) {
  let e = i.root;
  const t = [];
  let n = 0;
  for (; e !== si; ) {
    if (Cl(e)) {
      Qr(e.left, !1), Qr(e.right, !1), e = e.parent;
      continue;
    }
    if (e.left !== si && !Cl(e.left)) {
      e = e.left;
      continue;
    }
    if (e.right !== si && !Cl(e.right)) {
      e = e.right;
      continue;
    }
    t[n++] = e, Qr(e, !0);
  }
  return Qr(i.root, !1), t;
}
function Kft(i, e, t, n, r, s) {
  let o = i.root, a = 0, l = 0, c = 0;
  const u = [];
  let d = 0;
  for (; o !== si; ) {
    if (Cl(o)) {
      Qr(o.left, !1), Qr(o.right, !1), o === o.parent.right && (a -= o.parent.delta), o = o.parent;
      continue;
    }
    if (o.left !== si && !Cl(o.left)) {
      o = o.left;
      continue;
    }
    l = a + o.start, c = a + o.end, o.setCachedOffsets(l, c, r);
    let h = !0;
    if (e && o.ownerId && o.ownerId !== e && (h = !1), t && Z3e(o) && (h = !1), n && J3e(o) && (h = !1), s && !Q3e(o) && (h = !1), h && (u[d++] = o), Qr(o, !0), o.right !== si && !Cl(o.right)) {
      a += o.delta, o = o.right;
      continue;
    }
  }
  return Qr(i.root, !1), u;
}
function Yft(i, e, t, n, r, s, o, a) {
  let l = i.root, c = 0, u = 0, d = 0, h = 0;
  const g = [];
  let m = 0;
  for (; l !== si; ) {
    if (Cl(l)) {
      Qr(l.left, !1), Qr(l.right, !1), l === l.parent.right && (c -= l.parent.delta), l = l.parent;
      continue;
    }
    if (!Cl(l.left)) {
      if (u = c + l.maxEnd, u < e) {
        Qr(l, !0);
        continue;
      }
      if (l.left !== si) {
        l = l.left;
        continue;
      }
    }
    if (d = c + l.start, d > t) {
      Qr(l, !0);
      continue;
    }
    if (h = c + l.end, h >= e) {
      l.setCachedOffsets(d, h, o);
      let _ = !0;
      n && l.ownerId && l.ownerId !== n && (_ = !1), r && Z3e(l) && (_ = !1), s && J3e(l) && (_ = !1), a && !Q3e(l) && (_ = !1), _ && (g[m++] = l);
    }
    if (Qr(l, !0), l.right !== si && !Cl(l.right)) {
      c += l.delta, l = l.right;
      continue;
    }
  }
  return Qr(i.root, !1), g;
}
function vTe(i, e) {
  if (i.root === si)
    return e.parent = si, e.left = si, e.right = si, os(
      e,
      0
      /* NodeColor.Black */
    ), i.root = e, i.root;
  Xft(i, e), NC(e.parent);
  let t = e;
  for (; t !== i.root && Fu(t.parent) === 1; )
    if (t.parent === t.parent.parent.left) {
      const n = t.parent.parent.right;
      Fu(n) === 1 ? (os(
        t.parent,
        0
        /* NodeColor.Black */
      ), os(
        n,
        0
        /* NodeColor.Black */
      ), os(
        t.parent.parent,
        1
        /* NodeColor.Red */
      ), t = t.parent.parent) : (t === t.parent.right && (t = t.parent, IF(i, t)), os(
        t.parent,
        0
        /* NodeColor.Black */
      ), os(
        t.parent.parent,
        1
        /* NodeColor.Red */
      ), NF(i, t.parent.parent));
    } else {
      const n = t.parent.parent.left;
      Fu(n) === 1 ? (os(
        t.parent,
        0
        /* NodeColor.Black */
      ), os(
        n,
        0
        /* NodeColor.Black */
      ), os(
        t.parent.parent,
        1
        /* NodeColor.Red */
      ), t = t.parent.parent) : (t === t.parent.left && (t = t.parent, NF(i, t)), os(
        t.parent,
        0
        /* NodeColor.Black */
      ), os(
        t.parent.parent,
        1
        /* NodeColor.Red */
      ), IF(i, t.parent.parent));
    }
  return os(
    i.root,
    0
    /* NodeColor.Black */
  ), e;
}
function Xft(i, e) {
  let t = 0, n = i.root;
  const r = e.start, s = e.end;
  for (; ; )
    if (Qft(r, s, n.start + t, n.end + t) < 0)
      if (n.left === si) {
        e.start -= t, e.end -= t, e.maxEnd -= t, n.left = e;
        break;
      } else
        n = n.left;
    else if (n.right === si) {
      e.start -= t + n.delta, e.end -= t + n.delta, e.maxEnd -= t + n.delta, n.right = e;
      break;
    } else
      t += n.delta, n = n.right;
  e.parent = n, e.left = si, e.right = si, os(
    e,
    1
    /* NodeColor.Red */
  );
}
function yTe(i, e) {
  let t, n;
  if (e.left === si ? (t = e.right, n = e, t.delta += e.delta, (t.delta < -1073741824 || t.delta > 1073741824) && (i.requestNormalizeDelta = !0), t.start += e.delta, t.end += e.delta) : e.right === si ? (t = e.left, n = e) : (n = Zft(e.right), t = n.right, t.start += n.delta, t.end += n.delta, t.delta += n.delta, (t.delta < -1073741824 || t.delta > 1073741824) && (i.requestNormalizeDelta = !0), n.start += e.delta, n.end += e.delta, n.delta = e.delta, (n.delta < -1073741824 || n.delta > 1073741824) && (i.requestNormalizeDelta = !0)), n === i.root) {
    i.root = t, os(
      t,
      0
      /* NodeColor.Black */
    ), e.detach(), mee(), cw(t), i.root.parent = si;
    return;
  }
  const r = Fu(n) === 1;
  if (n === n.parent.left ? n.parent.left = t : n.parent.right = t, n === e ? t.parent = n.parent : (n.parent === e ? t.parent = n : t.parent = n.parent, n.left = e.left, n.right = e.right, n.parent = e.parent, os(n, Fu(e)), e === i.root ? i.root = n : e === e.parent.left ? e.parent.left = n : e.parent.right = n, n.left !== si && (n.left.parent = n), n.right !== si && (n.right.parent = n)), e.detach(), r) {
    NC(t.parent), n !== e && (NC(n), NC(n.parent)), mee();
    return;
  }
  NC(t), NC(t.parent), n !== e && (NC(n), NC(n.parent));
  let s;
  for (; t !== i.root && Fu(t) === 0; )
    t === t.parent.left ? (s = t.parent.right, Fu(s) === 1 && (os(
      s,
      0
      /* NodeColor.Black */
    ), os(
      t.parent,
      1
      /* NodeColor.Red */
    ), IF(i, t.parent), s = t.parent.right), Fu(s.left) === 0 && Fu(s.right) === 0 ? (os(
      s,
      1
      /* NodeColor.Red */
    ), t = t.parent) : (Fu(s.right) === 0 && (os(
      s.left,
      0
      /* NodeColor.Black */
    ), os(
      s,
      1
      /* NodeColor.Red */
    ), NF(i, s), s = t.parent.right), os(s, Fu(t.parent)), os(
      t.parent,
      0
      /* NodeColor.Black */
    ), os(
      s.right,
      0
      /* NodeColor.Black */
    ), IF(i, t.parent), t = i.root)) : (s = t.parent.left, Fu(s) === 1 && (os(
      s,
      0
      /* NodeColor.Black */
    ), os(
      t.parent,
      1
      /* NodeColor.Red */
    ), NF(i, t.parent), s = t.parent.left), Fu(s.left) === 0 && Fu(s.right) === 0 ? (os(
      s,
      1
      /* NodeColor.Red */
    ), t = t.parent) : (Fu(s.left) === 0 && (os(
      s.right,
      0
      /* NodeColor.Black */
    ), os(
      s,
      1
      /* NodeColor.Red */
    ), IF(i, s), s = t.parent.left), os(s, Fu(t.parent)), os(
      t.parent,
      0
      /* NodeColor.Black */
    ), os(
      s.left,
      0
      /* NodeColor.Black */
    ), NF(i, t.parent), t = i.root));
  os(
    t,
    0
    /* NodeColor.Black */
  ), mee();
}
function Zft(i) {
  for (; i.left !== si; )
    i = i.left;
  return i;
}
function mee() {
  si.parent = si, si.delta = 0, si.start = 0, si.end = 0;
}
function IF(i, e) {
  const t = e.right;
  t.delta += e.delta, (t.delta < -1073741824 || t.delta > 1073741824) && (i.requestNormalizeDelta = !0), t.start += e.delta, t.end += e.delta, e.right = t.left, t.left !== si && (t.left.parent = e), t.parent = e.parent, e.parent === si ? i.root = t : e === e.parent.left ? e.parent.left = t : e.parent.right = t, t.left = e, e.parent = t, cw(e), cw(t);
}
function NF(i, e) {
  const t = e.left;
  e.delta -= t.delta, (e.delta < -1073741824 || e.delta > 1073741824) && (i.requestNormalizeDelta = !0), e.start -= t.delta, e.end -= t.delta, e.left = t.right, t.right !== si && (t.right.parent = e), t.parent = e.parent, e.parent === si ? i.root = t : e === e.parent.right ? e.parent.right = t : e.parent.left = t, t.right = e, e.parent = t, cw(e), cw(t);
}
function t4e(i) {
  let e = i.end;
  if (i.left !== si) {
    const t = i.left.maxEnd;
    t > e && (e = t);
  }
  if (i.right !== si) {
    const t = i.right.maxEnd + i.delta;
    t > e && (e = t);
  }
  return e;
}
function cw(i) {
  i.maxEnd = t4e(i);
}
function NC(i) {
  for (; i !== si; ) {
    const e = t4e(i);
    if (i.maxEnd === e)
      return;
    i.maxEnd = e, i = i.parent;
  }
}
function Qft(i, e, t, n) {
  return i === t ? e - n : i - t;
}
class Tre {
  constructor(e, t) {
    this.piece = e, this.color = t, this.size_left = 0, this.lf_left = 0, this.parent = this, this.left = this, this.right = this;
  }
  next() {
    if (this.right !== Nn)
      return Xfe(this.right);
    let e = this;
    for (; e.parent !== Nn && e.parent.left !== e; )
      e = e.parent;
    return e.parent === Nn ? Nn : e.parent;
  }
  prev() {
    if (this.left !== Nn)
      return n4e(this.left);
    let e = this;
    for (; e.parent !== Nn && e.parent.right !== e; )
      e = e.parent;
    return e.parent === Nn ? Nn : e.parent;
  }
  detach() {
    this.parent = null, this.left = null, this.right = null;
  }
}
const Nn = new Tre(
  null,
  0
  /* NodeColor.Black */
);
Nn.parent = Nn;
Nn.left = Nn;
Nn.right = Nn;
Nn.color = 0;
function Xfe(i) {
  for (; i.left !== Nn; )
    i = i.left;
  return i;
}
function n4e(i) {
  for (; i.right !== Nn; )
    i = i.right;
  return i;
}
function Zfe(i) {
  return i === Nn ? 0 : i.size_left + i.piece.length + Zfe(i.right);
}
function Qfe(i) {
  return i === Nn ? 0 : i.lf_left + i.piece.lineFeedCnt + Qfe(i.right);
}
function _ee() {
  Nn.parent = Nn;
}
function RF(i, e) {
  const t = e.right;
  t.size_left += e.size_left + (e.piece ? e.piece.length : 0), t.lf_left += e.lf_left + (e.piece ? e.piece.lineFeedCnt : 0), e.right = t.left, t.left !== Nn && (t.left.parent = e), t.parent = e.parent, e.parent === Nn ? i.root = t : e.parent.left === e ? e.parent.left = t : e.parent.right = t, t.left = e, e.parent = t;
}
function AF(i, e) {
  const t = e.left;
  e.left = t.right, t.right !== Nn && (t.right.parent = e), t.parent = e.parent, e.size_left -= t.size_left + (t.piece ? t.piece.length : 0), e.lf_left -= t.lf_left + (t.piece ? t.piece.lineFeedCnt : 0), e.parent === Nn ? i.root = t : e === e.parent.right ? e.parent.right = t : e.parent.left = t, t.right = e, e.parent = t;
}
function j7(i, e) {
  let t, n;
  if (e.left === Nn ? (n = e, t = n.right) : e.right === Nn ? (n = e, t = n.left) : (n = Xfe(e.right), t = n.right), n === i.root) {
    i.root = t, t.color = 0, e.detach(), _ee(), i.root.parent = Nn;
    return;
  }
  const r = n.color === 1;
  if (n === n.parent.left ? n.parent.left = t : n.parent.right = t, n === e ? (t.parent = n.parent, jP(i, t)) : (n.parent === e ? t.parent = n : t.parent = n.parent, jP(i, t), n.left = e.left, n.right = e.right, n.parent = e.parent, n.color = e.color, e === i.root ? i.root = n : e === e.parent.left ? e.parent.left = n : e.parent.right = n, n.left !== Nn && (n.left.parent = n), n.right !== Nn && (n.right.parent = n), n.size_left = e.size_left, n.lf_left = e.lf_left, jP(i, n)), e.detach(), t.parent.left === t) {
    const o = Zfe(t), a = Qfe(t);
    if (o !== t.parent.size_left || a !== t.parent.lf_left) {
      const l = o - t.parent.size_left, c = a - t.parent.lf_left;
      t.parent.size_left = o, t.parent.lf_left = a, zv(i, t.parent, l, c);
    }
  }
  if (jP(i, t.parent), r) {
    _ee();
    return;
  }
  let s;
  for (; t !== i.root && t.color === 0; )
    t === t.parent.left ? (s = t.parent.right, s.color === 1 && (s.color = 0, t.parent.color = 1, RF(i, t.parent), s = t.parent.right), s.left.color === 0 && s.right.color === 0 ? (s.color = 1, t = t.parent) : (s.right.color === 0 && (s.left.color = 0, s.color = 1, AF(i, s), s = t.parent.right), s.color = t.parent.color, t.parent.color = 0, s.right.color = 0, RF(i, t.parent), t = i.root)) : (s = t.parent.left, s.color === 1 && (s.color = 0, t.parent.color = 1, AF(i, t.parent), s = t.parent.left), s.left.color === 0 && s.right.color === 0 ? (s.color = 1, t = t.parent) : (s.left.color === 0 && (s.right.color = 0, s.color = 1, RF(i, s), s = t.parent.left), s.color = t.parent.color, t.parent.color = 0, s.left.color = 0, AF(i, t.parent), t = i.root));
  t.color = 0, _ee();
}
function CTe(i, e) {
  for (jP(i, e); e !== i.root && e.parent.color === 1; )
    if (e.parent === e.parent.parent.left) {
      const t = e.parent.parent.right;
      t.color === 1 ? (e.parent.color = 0, t.color = 0, e.parent.parent.color = 1, e = e.parent.parent) : (e === e.parent.right && (e = e.parent, RF(i, e)), e.parent.color = 0, e.parent.parent.color = 1, AF(i, e.parent.parent));
    } else {
      const t = e.parent.parent.left;
      t.color === 1 ? (e.parent.color = 0, t.color = 0, e.parent.parent.color = 1, e = e.parent.parent) : (e === e.parent.left && (e = e.parent, AF(i, e)), e.parent.color = 0, e.parent.parent.color = 1, RF(i, e.parent.parent));
    }
  i.root.color = 0;
}
function zv(i, e, t, n) {
  for (; e !== i.root && e !== Nn; )
    e.parent.left === e && (e.parent.size_left += t, e.parent.lf_left += n), e = e.parent;
}
function jP(i, e) {
  let t = 0, n = 0;
  if (e !== i.root) {
    for (; e !== i.root && e === e.parent.right; )
      e = e.parent;
    if (e !== i.root)
      for (e = e.parent, t = Zfe(e.left) - e.size_left, n = Qfe(e.left) - e.lf_left, e.size_left += t, e.lf_left += n; e !== i.root && (t !== 0 || n !== 0); )
        e.parent.left === e && (e.parent.size_left += t, e.parent.lf_left += n), e = e.parent;
  }
}
const Jft = 999;
class SE {
  constructor(e, t, n, r) {
    this.searchString = e, this.isRegex = t, this.matchCase = n, this.wordSeparators = r;
  }
  parseSearchRequest() {
    if (this.searchString === "")
      return null;
    let e;
    this.isRegex ? e = i4e(this.searchString) : e = this.searchString.indexOf(`
`) >= 0;
    let t = null;
    try {
      t = YMe(this.searchString, this.isRegex, {
        matchCase: this.matchCase,
        wholeWord: !1,
        multiline: e,
        global: !0,
        unicode: !0
      });
    } catch {
      return null;
    }
    if (!t)
      return null;
    let n = !this.isRegex && !e;
    return n && this.searchString.toLowerCase() !== this.searchString.toUpperCase() && (n = this.matchCase), new tst(t, this.wordSeparators ? Yf(this.wordSeparators, []) : null, n ? this.searchString : null);
  }
}
function i4e(i) {
  if (!i || i.length === 0)
    return !1;
  for (let e = 0, t = i.length; e < t; e++) {
    const n = i.charCodeAt(e);
    if (n === 10)
      return !0;
    if (n === 92) {
      if (e++, e >= t)
        break;
      const r = i.charCodeAt(e);
      if (r === 110 || r === 114 || r === 87)
        return !0;
    }
  }
  return !1;
}
function UE(i, e, t) {
  if (!t)
    return new l4(i, null);
  const n = [];
  for (let r = 0, s = e.length; r < s; r++)
    n[r] = e[r];
  return new l4(i, n);
}
class wTe {
  constructor(e) {
    const t = [];
    let n = 0;
    for (let r = 0, s = e.length; r < s; r++)
      e.charCodeAt(r) === 10 && (t[n++] = r);
    this._lineFeedsOffsets = t;
  }
  findLineFeedCountBeforeOffset(e) {
    const t = this._lineFeedsOffsets;
    let n = 0, r = t.length - 1;
    if (r === -1 || e <= t[0])
      return 0;
    for (; n < r; ) {
      const s = n + ((r - n) / 2 >> 0);
      t[s] >= e ? r = s - 1 : t[s + 1] >= e ? (n = s, r = s) : n = s + 1;
    }
    return n + 1;
  }
}
class G7 {
  static findMatches(e, t, n, r, s) {
    const o = t.parseSearchRequest();
    return o ? o.regex.multiline ? this._doFindMatchesMultiline(e, n, new uN(o.wordSeparators, o.regex), r, s) : this._doFindMatchesLineByLine(e, n, o, r, s) : [];
  }
  /**
   * Multiline search always executes on the lines concatenated with \n.
   * We must therefore compensate for the count of \n in case the model is CRLF
   */
  static _getMultilineMatchRange(e, t, n, r, s, o) {
    let a, l = 0;
    r ? (l = r.findLineFeedCountBeforeOffset(s), a = t + s + l) : a = t + s;
    let c;
    if (r) {
      const g = r.findLineFeedCountBeforeOffset(s + o.length) - l;
      c = a + o.length + g;
    } else
      c = a + o.length;
    const u = e.getPositionAt(a), d = e.getPositionAt(c);
    return new z(u.lineNumber, u.column, d.lineNumber, d.column);
  }
  static _doFindMatchesMultiline(e, t, n, r, s) {
    const o = e.getOffsetAt(t.getStartPosition()), a = e.getValueInRange(
      t,
      1
      /* EndOfLinePreference.LF */
    ), l = e.getEOL() === `\r
` ? new wTe(a) : null, c = [];
    let u = 0, d;
    for (n.reset(0); d = n.next(a); )
      if (c[u++] = UE(this._getMultilineMatchRange(e, o, a, l, d.index, d[0]), d, r), u >= s)
        return c;
    return c;
  }
  static _doFindMatchesLineByLine(e, t, n, r, s) {
    const o = [];
    let a = 0;
    if (t.startLineNumber === t.endLineNumber) {
      const c = e.getLineContent(t.startLineNumber).substring(t.startColumn - 1, t.endColumn - 1);
      return a = this._findMatchesInLine(n, c, t.startLineNumber, t.startColumn - 1, a, o, r, s), o;
    }
    const l = e.getLineContent(t.startLineNumber).substring(t.startColumn - 1);
    a = this._findMatchesInLine(n, l, t.startLineNumber, t.startColumn - 1, a, o, r, s);
    for (let c = t.startLineNumber + 1; c < t.endLineNumber && a < s; c++)
      a = this._findMatchesInLine(n, e.getLineContent(c), c, 0, a, o, r, s);
    if (a < s) {
      const c = e.getLineContent(t.endLineNumber).substring(0, t.endColumn - 1);
      a = this._findMatchesInLine(n, c, t.endLineNumber, 0, a, o, r, s);
    }
    return o;
  }
  static _findMatchesInLine(e, t, n, r, s, o, a, l) {
    const c = e.wordSeparators;
    if (!a && e.simpleSearch) {
      const h = e.simpleSearch, g = h.length, m = t.length;
      let _ = -g;
      for (; (_ = t.indexOf(h, _ + g)) !== -1; )
        if ((!c || Jfe(c, t, m, _, g)) && (o[s++] = new l4(new z(n, _ + 1 + r, n, _ + 1 + g + r), null), s >= l))
          return s;
      return s;
    }
    const u = new uN(e.wordSeparators, e.regex);
    let d;
    u.reset(0);
    do
      if (d = u.next(t), d && (o[s++] = UE(new z(n, d.index + 1 + r, n, d.index + 1 + d[0].length + r), d, a), s >= l))
        return s;
    while (d);
    return s;
  }
  static findNextMatch(e, t, n, r) {
    const s = t.parseSearchRequest();
    if (!s)
      return null;
    const o = new uN(s.wordSeparators, s.regex);
    return s.regex.multiline ? this._doFindNextMatchMultiline(e, n, o, r) : this._doFindNextMatchLineByLine(e, n, o, r);
  }
  static _doFindNextMatchMultiline(e, t, n, r) {
    const s = new de(t.lineNumber, 1), o = e.getOffsetAt(s), a = e.getLineCount(), l = e.getValueInRange(
      new z(s.lineNumber, s.column, a, e.getLineMaxColumn(a)),
      1
      /* EndOfLinePreference.LF */
    ), c = e.getEOL() === `\r
` ? new wTe(l) : null;
    n.reset(t.column - 1);
    const u = n.next(l);
    return u ? UE(this._getMultilineMatchRange(e, o, l, c, u.index, u[0]), u, r) : t.lineNumber !== 1 || t.column !== 1 ? this._doFindNextMatchMultiline(e, new de(1, 1), n, r) : null;
  }
  static _doFindNextMatchLineByLine(e, t, n, r) {
    const s = e.getLineCount(), o = t.lineNumber, a = e.getLineContent(o), l = this._findFirstMatchInLine(n, a, o, t.column, r);
    if (l)
      return l;
    for (let c = 1; c <= s; c++) {
      const u = (o + c - 1) % s, d = e.getLineContent(u + 1), h = this._findFirstMatchInLine(n, d, u + 1, 1, r);
      if (h)
        return h;
    }
    return null;
  }
  static _findFirstMatchInLine(e, t, n, r, s) {
    e.reset(r - 1);
    const o = e.next(t);
    return o ? UE(new z(n, o.index + 1, n, o.index + 1 + o[0].length), o, s) : null;
  }
  static findPreviousMatch(e, t, n, r) {
    const s = t.parseSearchRequest();
    if (!s)
      return null;
    const o = new uN(s.wordSeparators, s.regex);
    return s.regex.multiline ? this._doFindPreviousMatchMultiline(e, n, o, r) : this._doFindPreviousMatchLineByLine(e, n, o, r);
  }
  static _doFindPreviousMatchMultiline(e, t, n, r) {
    const s = this._doFindMatchesMultiline(e, new z(1, 1, t.lineNumber, t.column), n, r, 10 * Jft);
    if (s.length > 0)
      return s[s.length - 1];
    const o = e.getLineCount();
    return t.lineNumber !== o || t.column !== e.getLineMaxColumn(o) ? this._doFindPreviousMatchMultiline(e, new de(o, e.getLineMaxColumn(o)), n, r) : null;
  }
  static _doFindPreviousMatchLineByLine(e, t, n, r) {
    const s = e.getLineCount(), o = t.lineNumber, a = e.getLineContent(o).substring(0, t.column - 1), l = this._findLastMatchInLine(n, a, o, r);
    if (l)
      return l;
    for (let c = 1; c <= s; c++) {
      const u = (s + o - c - 1) % s, d = e.getLineContent(u + 1), h = this._findLastMatchInLine(n, d, u + 1, r);
      if (h)
        return h;
    }
    return null;
  }
  static _findLastMatchInLine(e, t, n, r) {
    let s = null, o;
    for (e.reset(0); o = e.next(t); )
      s = UE(new z(n, o.index + 1, n, o.index + 1 + o[0].length), o, r);
    return s;
  }
}
function egt(i, e, t, n, r) {
  if (n === 0)
    return !0;
  const s = e.charCodeAt(n - 1);
  if (i.get(s) !== 0 || s === 13 || s === 10)
    return !0;
  if (r > 0) {
    const o = e.charCodeAt(n);
    if (i.get(o) !== 0)
      return !0;
  }
  return !1;
}
function tgt(i, e, t, n, r) {
  if (n + r === t)
    return !0;
  const s = e.charCodeAt(n + r);
  if (i.get(s) !== 0 || s === 13 || s === 10)
    return !0;
  if (r > 0) {
    const o = e.charCodeAt(n + r - 1);
    if (i.get(o) !== 0)
      return !0;
  }
  return !1;
}
function Jfe(i, e, t, n, r) {
  return egt(i, e, t, n, r) && tgt(i, e, t, n, r);
}
class uN {
  constructor(e, t) {
    this._wordSeparators = e, this._searchRegex = t, this._prevMatchStartIndex = -1, this._prevMatchLength = 0;
  }
  reset(e) {
    this._searchRegex.lastIndex = e, this._prevMatchStartIndex = -1, this._prevMatchLength = 0;
  }
  next(e) {
    const t = e.length;
    let n;
    do {
      if (this._prevMatchStartIndex + this._prevMatchLength === t || (n = this._searchRegex.exec(e), !n))
        return null;
      const r = n.index, s = n[0].length;
      if (r === this._prevMatchStartIndex && s === this._prevMatchLength) {
        if (s === 0) {
          TV(e, t, this._searchRegex.lastIndex) > 65535 ? this._searchRegex.lastIndex += 2 : this._searchRegex.lastIndex += 1;
          continue;
        }
        return null;
      }
      if (this._prevMatchStartIndex = r, this._prevMatchLength = s, !this._wordSeparators || Jfe(this._wordSeparators, e, t, r, s))
        return n;
    } while (n);
    return null;
  }
}
const Rv = 65535;
function r4e(i) {
  let e;
  return i[i.length - 1] < 65536 ? e = new Uint16Array(i.length) : e = new Uint32Array(i.length), e.set(i, 0), e;
}
class ngt {
  constructor(e, t, n, r, s) {
    this.lineStarts = e, this.cr = t, this.lf = n, this.crlf = r, this.isBasicASCII = s;
  }
}
function Kv(i, e = !0) {
  const t = [0];
  let n = 1;
  for (let r = 0, s = i.length; r < s; r++) {
    const o = i.charCodeAt(r);
    o === 13 ? r + 1 < s && i.charCodeAt(r + 1) === 10 ? (t[n++] = r + 2, r++) : t[n++] = r + 1 : o === 10 && (t[n++] = r + 1);
  }
  return e ? r4e(t) : t;
}
function igt(i, e) {
  i.length = 0, i[0] = 0;
  let t = 1, n = 0, r = 0, s = 0, o = !0;
  for (let l = 0, c = e.length; l < c; l++) {
    const u = e.charCodeAt(l);
    u === 13 ? l + 1 < c && e.charCodeAt(l + 1) === 10 ? (s++, i[t++] = l + 2, l++) : (n++, i[t++] = l + 1) : u === 10 ? (r++, i[t++] = l + 1) : o && u !== 9 && (u < 32 || u > 126) && (o = !1);
  }
  const a = new ngt(r4e(i), n, r, s, o);
  return i.length = 0, a;
}
class wd {
  constructor(e, t, n, r, s) {
    this.bufferIndex = e, this.start = t, this.end = n, this.lineFeedCnt = r, this.length = s;
  }
}
class zE {
  constructor(e, t) {
    this.buffer = e, this.lineStarts = t;
  }
}
class rgt {
  constructor(e, t) {
    this._pieces = [], this._tree = e, this._BOM = t, this._index = 0, e.root !== Nn && e.iterate(e.root, (n) => (n !== Nn && this._pieces.push(n.piece), !0));
  }
  read() {
    return this._pieces.length === 0 ? this._index === 0 ? (this._index++, this._BOM) : null : this._index > this._pieces.length - 1 ? null : this._index === 0 ? this._BOM + this._tree.getPieceContent(this._pieces[this._index++]) : this._tree.getPieceContent(this._pieces[this._index++]);
  }
}
class sgt {
  constructor(e) {
    this._limit = e, this._cache = [];
  }
  get(e) {
    for (let t = this._cache.length - 1; t >= 0; t--) {
      const n = this._cache[t];
      if (n.nodeStartOffset <= e && n.nodeStartOffset + n.node.piece.length >= e)
        return n;
    }
    return null;
  }
  get2(e) {
    for (let t = this._cache.length - 1; t >= 0; t--) {
      const n = this._cache[t];
      if (n.nodeStartLineNumber && n.nodeStartLineNumber < e && n.nodeStartLineNumber + n.node.piece.lineFeedCnt >= e)
        return n;
    }
    return null;
  }
  set(e) {
    this._cache.length >= this._limit && this._cache.shift(), this._cache.push(e);
  }
  validate(e) {
    let t = !1;
    const n = this._cache;
    for (let r = 0; r < n.length; r++) {
      const s = n[r];
      if (s.node.parent === null || s.nodeStartOffset >= e) {
        n[r] = null, t = !0;
        continue;
      }
    }
    if (t) {
      const r = [];
      for (const s of n)
        s !== null && r.push(s);
      this._cache = r;
    }
  }
}
class ogt {
  constructor(e, t, n) {
    this.create(e, t, n);
  }
  create(e, t, n) {
    this._buffers = [
      new zE("", [0])
    ], this._lastChangeBufferPos = { line: 0, column: 0 }, this.root = Nn, this._lineCnt = 1, this._length = 0, this._EOL = t, this._EOLLength = t.length, this._EOLNormalized = n;
    let r = null;
    for (let s = 0, o = e.length; s < o; s++)
      if (e[s].buffer.length > 0) {
        e[s].lineStarts || (e[s].lineStarts = Kv(e[s].buffer));
        const a = new wd(s + 1, { line: 0, column: 0 }, { line: e[s].lineStarts.length - 1, column: e[s].buffer.length - e[s].lineStarts[e[s].lineStarts.length - 1] }, e[s].lineStarts.length - 1, e[s].buffer.length);
        this._buffers.push(e[s]), r = this.rbInsertRight(r, a);
      }
    this._searchCache = new sgt(1), this._lastVisitedLine = { lineNumber: 0, value: "" }, this.computeBufferMetadata();
  }
  normalizeEOL(e) {
    const t = Rv, n = t - Math.floor(t / 3), r = n * 2;
    let s = "", o = 0;
    const a = [];
    if (this.iterate(this.root, (l) => {
      const c = this.getNodeContent(l), u = c.length;
      if (o <= n || o + u < r)
        return s += c, o += u, !0;
      const d = s.replace(/\r\n|\r|\n/g, e);
      return a.push(new zE(d, Kv(d))), s = c, o = u, !0;
    }), o > 0) {
      const l = s.replace(/\r\n|\r|\n/g, e);
      a.push(new zE(l, Kv(l)));
    }
    this.create(a, e, !0);
  }
  // #region Buffer API
  getEOL() {
    return this._EOL;
  }
  setEOL(e) {
    this._EOL = e, this._EOLLength = this._EOL.length, this.normalizeEOL(e);
  }
  createSnapshot(e) {
    return new rgt(this, e);
  }
  getOffsetAt(e, t) {
    let n = 0, r = this.root;
    for (; r !== Nn; )
      if (r.left !== Nn && r.lf_left + 1 >= e)
        r = r.left;
      else if (r.lf_left + r.piece.lineFeedCnt + 1 >= e) {
        n += r.size_left;
        const s = this.getAccumulatedValue(r, e - r.lf_left - 2);
        return n += s + t - 1;
      } else
        e -= r.lf_left + r.piece.lineFeedCnt, n += r.size_left + r.piece.length, r = r.right;
    return n;
  }
  getPositionAt(e) {
    e = Math.floor(e), e = Math.max(0, e);
    let t = this.root, n = 0;
    const r = e;
    for (; t !== Nn; )
      if (t.size_left !== 0 && t.size_left >= e)
        t = t.left;
      else if (t.size_left + t.piece.length >= e) {
        const s = this.getIndexOf(t, e - t.size_left);
        if (n += t.lf_left + s.index, s.index === 0) {
          const o = this.getOffsetAt(n + 1, 1), a = r - o;
          return new de(n + 1, a + 1);
        }
        return new de(n + 1, s.remainder + 1);
      } else if (e -= t.size_left + t.piece.length, n += t.lf_left + t.piece.lineFeedCnt, t.right === Nn) {
        const s = this.getOffsetAt(n + 1, 1), o = r - e - s;
        return new de(n + 1, o + 1);
      } else
        t = t.right;
    return new de(1, 1);
  }
  getValueInRange(e, t) {
    if (e.startLineNumber === e.endLineNumber && e.startColumn === e.endColumn)
      return "";
    const n = this.nodeAt2(e.startLineNumber, e.startColumn), r = this.nodeAt2(e.endLineNumber, e.endColumn), s = this.getValueInRange2(n, r);
    return t ? t !== this._EOL || !this._EOLNormalized ? s.replace(/\r\n|\r|\n/g, t) : t === this.getEOL() && this._EOLNormalized ? s : s.replace(/\r\n|\r|\n/g, t) : s;
  }
  getValueInRange2(e, t) {
    if (e.node === t.node) {
      const a = e.node, l = this._buffers[a.piece.bufferIndex].buffer, c = this.offsetInBuffer(a.piece.bufferIndex, a.piece.start);
      return l.substring(c + e.remainder, c + t.remainder);
    }
    let n = e.node;
    const r = this._buffers[n.piece.bufferIndex].buffer, s = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
    let o = r.substring(s + e.remainder, s + n.piece.length);
    for (n = n.next(); n !== Nn; ) {
      const a = this._buffers[n.piece.bufferIndex].buffer, l = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
      if (n === t.node) {
        o += a.substring(l, l + t.remainder);
        break;
      } else
        o += a.substr(l, n.piece.length);
      n = n.next();
    }
    return o;
  }
  getLinesContent() {
    const e = [];
    let t = 0, n = "", r = !1;
    return this.iterate(this.root, (s) => {
      if (s === Nn)
        return !0;
      const o = s.piece;
      let a = o.length;
      if (a === 0)
        return !0;
      const l = this._buffers[o.bufferIndex].buffer, c = this._buffers[o.bufferIndex].lineStarts, u = o.start.line, d = o.end.line;
      let h = c[u] + o.start.column;
      if (r && (l.charCodeAt(h) === 10 && (h++, a--), e[t++] = n, n = "", r = !1, a === 0))
        return !0;
      if (u === d)
        return !this._EOLNormalized && l.charCodeAt(h + a - 1) === 13 ? (r = !0, n += l.substr(h, a - 1)) : n += l.substr(h, a), !0;
      n += this._EOLNormalized ? l.substring(h, Math.max(h, c[u + 1] - this._EOLLength)) : l.substring(h, c[u + 1]).replace(/(\r\n|\r|\n)$/, ""), e[t++] = n;
      for (let g = u + 1; g < d; g++)
        n = this._EOLNormalized ? l.substring(c[g], c[g + 1] - this._EOLLength) : l.substring(c[g], c[g + 1]).replace(/(\r\n|\r|\n)$/, ""), e[t++] = n;
      return !this._EOLNormalized && l.charCodeAt(c[d] + o.end.column - 1) === 13 ? (r = !0, o.end.column === 0 ? t-- : n = l.substr(c[d], o.end.column - 1)) : n = l.substr(c[d], o.end.column), !0;
    }), r && (e[t++] = n, n = ""), e[t++] = n, e;
  }
  getLength() {
    return this._length;
  }
  getLineCount() {
    return this._lineCnt;
  }
  getLineContent(e) {
    return this._lastVisitedLine.lineNumber === e ? this._lastVisitedLine.value : (this._lastVisitedLine.lineNumber = e, e === this._lineCnt ? this._lastVisitedLine.value = this.getLineRawContent(e) : this._EOLNormalized ? this._lastVisitedLine.value = this.getLineRawContent(e, this._EOLLength) : this._lastVisitedLine.value = this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/, ""), this._lastVisitedLine.value);
  }
  _getCharCode(e) {
    if (e.remainder === e.node.piece.length) {
      const t = e.node.next();
      if (!t)
        return 0;
      const n = this._buffers[t.piece.bufferIndex], r = this.offsetInBuffer(t.piece.bufferIndex, t.piece.start);
      return n.buffer.charCodeAt(r);
    } else {
      const t = this._buffers[e.node.piece.bufferIndex], r = this.offsetInBuffer(e.node.piece.bufferIndex, e.node.piece.start) + e.remainder;
      return t.buffer.charCodeAt(r);
    }
  }
  getLineCharCode(e, t) {
    const n = this.nodeAt2(e, t + 1);
    return this._getCharCode(n);
  }
  getLineLength(e) {
    if (e === this.getLineCount()) {
      const t = this.getOffsetAt(e, 1);
      return this.getLength() - t;
    }
    return this.getOffsetAt(e + 1, 1) - this.getOffsetAt(e, 1) - this._EOLLength;
  }
  getNearestChunk(e) {
    const t = this.nodeAt(e);
    if (t.remainder === t.node.piece.length) {
      const n = t.node.next();
      if (!n || n === Nn)
        return "";
      const r = this._buffers[n.piece.bufferIndex], s = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
      return r.buffer.substring(s, s + n.piece.length);
    } else {
      const n = this._buffers[t.node.piece.bufferIndex], r = this.offsetInBuffer(t.node.piece.bufferIndex, t.node.piece.start), s = r + t.remainder, o = r + t.node.piece.length;
      return n.buffer.substring(s, o);
    }
  }
  findMatchesInNode(e, t, n, r, s, o, a, l, c, u, d) {
    const h = this._buffers[e.piece.bufferIndex], g = this.offsetInBuffer(e.piece.bufferIndex, e.piece.start), m = this.offsetInBuffer(e.piece.bufferIndex, s), _ = this.offsetInBuffer(e.piece.bufferIndex, o);
    let v;
    const w = { line: 0, column: 0 };
    let E, L;
    t._wordSeparators ? (E = h.buffer.substring(m, _), L = (T) => T + m, t.reset(0)) : (E = h.buffer, L = (T) => T, t.reset(m));
    do
      if (v = t.next(E), v) {
        if (L(v.index) >= _)
          return u;
        this.positionInBuffer(e, L(v.index) - g, w);
        const T = this.getLineFeedCnt(e.piece.bufferIndex, s, w), D = w.line === s.line ? w.column - s.column + r : w.column + 1, N = D + v[0].length;
        if (d[u++] = UE(new z(n + T, D, n + T, N), v, l), L(v.index) + v[0].length >= _ || u >= c)
          return u;
      }
    while (v);
    return u;
  }
  findMatchesLineByLine(e, t, n, r) {
    const s = [];
    let o = 0;
    const a = new uN(t.wordSeparators, t.regex);
    let l = this.nodeAt2(e.startLineNumber, e.startColumn);
    if (l === null)
      return [];
    const c = this.nodeAt2(e.endLineNumber, e.endColumn);
    if (c === null)
      return [];
    let u = this.positionInBuffer(l.node, l.remainder);
    const d = this.positionInBuffer(c.node, c.remainder);
    if (l.node === c.node)
      return this.findMatchesInNode(l.node, a, e.startLineNumber, e.startColumn, u, d, t, n, r, o, s), s;
    let h = e.startLineNumber, g = l.node;
    for (; g !== c.node; ) {
      const _ = this.getLineFeedCnt(g.piece.bufferIndex, u, g.piece.end);
      if (_ >= 1) {
        const w = this._buffers[g.piece.bufferIndex].lineStarts, E = this.offsetInBuffer(g.piece.bufferIndex, g.piece.start), L = w[u.line + _], T = h === e.startLineNumber ? e.startColumn : 1;
        if (o = this.findMatchesInNode(g, a, h, T, u, this.positionInBuffer(g, L - E), t, n, r, o, s), o >= r)
          return s;
        h += _;
      }
      const v = h === e.startLineNumber ? e.startColumn - 1 : 0;
      if (h === e.endLineNumber) {
        const w = this.getLineContent(h).substring(v, e.endColumn - 1);
        return o = this._findMatchesInLine(t, a, w, e.endLineNumber, v, o, s, n, r), s;
      }
      if (o = this._findMatchesInLine(t, a, this.getLineContent(h).substr(v), h, v, o, s, n, r), o >= r)
        return s;
      h++, l = this.nodeAt2(h, 1), g = l.node, u = this.positionInBuffer(l.node, l.remainder);
    }
    if (h === e.endLineNumber) {
      const _ = h === e.startLineNumber ? e.startColumn - 1 : 0, v = this.getLineContent(h).substring(_, e.endColumn - 1);
      return o = this._findMatchesInLine(t, a, v, e.endLineNumber, _, o, s, n, r), s;
    }
    const m = h === e.startLineNumber ? e.startColumn : 1;
    return o = this.findMatchesInNode(c.node, a, h, m, u, d, t, n, r, o, s), s;
  }
  _findMatchesInLine(e, t, n, r, s, o, a, l, c) {
    const u = e.wordSeparators;
    if (!l && e.simpleSearch) {
      const h = e.simpleSearch, g = h.length, m = n.length;
      let _ = -g;
      for (; (_ = n.indexOf(h, _ + g)) !== -1; )
        if ((!u || Jfe(u, n, m, _, g)) && (a[o++] = new l4(new z(r, _ + 1 + s, r, _ + 1 + g + s), null), o >= c))
          return o;
      return o;
    }
    let d;
    t.reset(0);
    do
      if (d = t.next(n), d && (a[o++] = UE(new z(r, d.index + 1 + s, r, d.index + 1 + d[0].length + s), d, l), o >= c))
        return o;
    while (d);
    return o;
  }
  // #endregion
  // #region Piece Table
  insert(e, t, n = !1) {
    if (this._EOLNormalized = this._EOLNormalized && n, this._lastVisitedLine.lineNumber = 0, this._lastVisitedLine.value = "", this.root !== Nn) {
      const { node: r, remainder: s, nodeStartOffset: o } = this.nodeAt(e), a = r.piece, l = a.bufferIndex, c = this.positionInBuffer(r, s);
      if (r.piece.bufferIndex === 0 && a.end.line === this._lastChangeBufferPos.line && a.end.column === this._lastChangeBufferPos.column && o + a.length === e && t.length < Rv) {
        this.appendToNode(r, t), this.computeBufferMetadata();
        return;
      }
      if (o === e)
        this.insertContentToNodeLeft(t, r), this._searchCache.validate(e);
      else if (o + r.piece.length > e) {
        const u = [];
        let d = new wd(a.bufferIndex, c, a.end, this.getLineFeedCnt(a.bufferIndex, c, a.end), this.offsetInBuffer(l, a.end) - this.offsetInBuffer(l, c));
        if (this.shouldCheckCRLF() && this.endWithCR(t) && this.nodeCharCodeAt(r, s) === 10) {
          const _ = { line: d.start.line + 1, column: 0 };
          d = new wd(d.bufferIndex, _, d.end, this.getLineFeedCnt(d.bufferIndex, _, d.end), d.length - 1), t += `
`;
        }
        if (this.shouldCheckCRLF() && this.startWithLF(t))
          if (this.nodeCharCodeAt(r, s - 1) === 13) {
            const _ = this.positionInBuffer(r, s - 1);
            this.deleteNodeTail(r, _), t = "\r" + t, r.piece.length === 0 && u.push(r);
          } else
            this.deleteNodeTail(r, c);
        else
          this.deleteNodeTail(r, c);
        const h = this.createNewPieces(t);
        d.length > 0 && this.rbInsertRight(r, d);
        let g = r;
        for (let m = 0; m < h.length; m++)
          g = this.rbInsertRight(g, h[m]);
        this.deleteNodes(u);
      } else
        this.insertContentToNodeRight(t, r);
    } else {
      const r = this.createNewPieces(t);
      let s = this.rbInsertLeft(null, r[0]);
      for (let o = 1; o < r.length; o++)
        s = this.rbInsertRight(s, r[o]);
    }
    this.computeBufferMetadata();
  }
  delete(e, t) {
    if (this._lastVisitedLine.lineNumber = 0, this._lastVisitedLine.value = "", t <= 0 || this.root === Nn)
      return;
    const n = this.nodeAt(e), r = this.nodeAt(e + t), s = n.node, o = r.node;
    if (s === o) {
      const h = this.positionInBuffer(s, n.remainder), g = this.positionInBuffer(s, r.remainder);
      if (n.nodeStartOffset === e) {
        if (t === s.piece.length) {
          const m = s.next();
          j7(this, s), this.validateCRLFWithPrevNode(m), this.computeBufferMetadata();
          return;
        }
        this.deleteNodeHead(s, g), this._searchCache.validate(e), this.validateCRLFWithPrevNode(s), this.computeBufferMetadata();
        return;
      }
      if (n.nodeStartOffset + s.piece.length === e + t) {
        this.deleteNodeTail(s, h), this.validateCRLFWithNextNode(s), this.computeBufferMetadata();
        return;
      }
      this.shrinkNode(s, h, g), this.computeBufferMetadata();
      return;
    }
    const a = [], l = this.positionInBuffer(s, n.remainder);
    this.deleteNodeTail(s, l), this._searchCache.validate(e), s.piece.length === 0 && a.push(s);
    const c = this.positionInBuffer(o, r.remainder);
    this.deleteNodeHead(o, c), o.piece.length === 0 && a.push(o);
    const u = s.next();
    for (let h = u; h !== Nn && h !== o; h = h.next())
      a.push(h);
    const d = s.piece.length === 0 ? s.prev() : s;
    this.deleteNodes(a), this.validateCRLFWithNextNode(d), this.computeBufferMetadata();
  }
  insertContentToNodeLeft(e, t) {
    const n = [];
    if (this.shouldCheckCRLF() && this.endWithCR(e) && this.startWithLF(t)) {
      const o = t.piece, a = { line: o.start.line + 1, column: 0 }, l = new wd(o.bufferIndex, a, o.end, this.getLineFeedCnt(o.bufferIndex, a, o.end), o.length - 1);
      t.piece = l, e += `
`, zv(this, t, -1, -1), t.piece.length === 0 && n.push(t);
    }
    const r = this.createNewPieces(e);
    let s = this.rbInsertLeft(t, r[r.length - 1]);
    for (let o = r.length - 2; o >= 0; o--)
      s = this.rbInsertLeft(s, r[o]);
    this.validateCRLFWithPrevNode(s), this.deleteNodes(n);
  }
  insertContentToNodeRight(e, t) {
    this.adjustCarriageReturnFromNext(e, t) && (e += `
`);
    const n = this.createNewPieces(e), r = this.rbInsertRight(t, n[0]);
    let s = r;
    for (let o = 1; o < n.length; o++)
      s = this.rbInsertRight(s, n[o]);
    this.validateCRLFWithPrevNode(r);
  }
  positionInBuffer(e, t, n) {
    const r = e.piece, s = e.piece.bufferIndex, o = this._buffers[s].lineStarts, l = o[r.start.line] + r.start.column + t;
    let c = r.start.line, u = r.end.line, d = 0, h = 0, g = 0;
    for (; c <= u && (d = c + (u - c) / 2 | 0, g = o[d], d !== u); )
      if (h = o[d + 1], l < g)
        u = d - 1;
      else if (l >= h)
        c = d + 1;
      else
        break;
    return n ? (n.line = d, n.column = l - g, null) : {
      line: d,
      column: l - g
    };
  }
  getLineFeedCnt(e, t, n) {
    if (n.column === 0)
      return n.line - t.line;
    const r = this._buffers[e].lineStarts;
    if (n.line === r.length - 1)
      return n.line - t.line;
    const s = r[n.line + 1], o = r[n.line] + n.column;
    if (s > o + 1)
      return n.line - t.line;
    const a = o - 1;
    return this._buffers[e].buffer.charCodeAt(a) === 13 ? n.line - t.line + 1 : n.line - t.line;
  }
  offsetInBuffer(e, t) {
    return this._buffers[e].lineStarts[t.line] + t.column;
  }
  deleteNodes(e) {
    for (let t = 0; t < e.length; t++)
      j7(this, e[t]);
  }
  createNewPieces(e) {
    if (e.length > Rv) {
      const u = [];
      for (; e.length > Rv; ) {
        const h = e.charCodeAt(Rv - 1);
        let g;
        h === 13 || h >= 55296 && h <= 56319 ? (g = e.substring(0, Rv - 1), e = e.substring(Rv - 1)) : (g = e.substring(0, Rv), e = e.substring(Rv));
        const m = Kv(g);
        u.push(new wd(
          this._buffers.length,
          /* buffer index */
          { line: 0, column: 0 },
          { line: m.length - 1, column: g.length - m[m.length - 1] },
          m.length - 1,
          g.length
        )), this._buffers.push(new zE(g, m));
      }
      const d = Kv(e);
      return u.push(new wd(
        this._buffers.length,
        /* buffer index */
        { line: 0, column: 0 },
        { line: d.length - 1, column: e.length - d[d.length - 1] },
        d.length - 1,
        e.length
      )), this._buffers.push(new zE(e, d)), u;
    }
    let t = this._buffers[0].buffer.length;
    const n = Kv(e, !1);
    let r = this._lastChangeBufferPos;
    if (this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 1] === t && t !== 0 && this.startWithLF(e) && this.endWithCR(this._buffers[0].buffer)) {
      this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line, column: this._lastChangeBufferPos.column + 1 }, r = this._lastChangeBufferPos;
      for (let u = 0; u < n.length; u++)
        n[u] += t + 1;
      this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(n.slice(1)), this._buffers[0].buffer += "_" + e, t += 1;
    } else {
      if (t !== 0)
        for (let u = 0; u < n.length; u++)
          n[u] += t;
      this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(n.slice(1)), this._buffers[0].buffer += e;
    }
    const s = this._buffers[0].buffer.length, o = this._buffers[0].lineStarts.length - 1, a = s - this._buffers[0].lineStarts[o], l = { line: o, column: a }, c = new wd(
      0,
      /** todo@peng */
      r,
      l,
      this.getLineFeedCnt(0, r, l),
      s - t
    );
    return this._lastChangeBufferPos = l, [c];
  }
  getLineRawContent(e, t = 0) {
    let n = this.root, r = "";
    const s = this._searchCache.get2(e);
    if (s) {
      n = s.node;
      const o = this.getAccumulatedValue(n, e - s.nodeStartLineNumber - 1), a = this._buffers[n.piece.bufferIndex].buffer, l = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
      if (s.nodeStartLineNumber + n.piece.lineFeedCnt === e)
        r = a.substring(l + o, l + n.piece.length);
      else {
        const c = this.getAccumulatedValue(n, e - s.nodeStartLineNumber);
        return a.substring(l + o, l + c - t);
      }
    } else {
      let o = 0;
      const a = e;
      for (; n !== Nn; )
        if (n.left !== Nn && n.lf_left >= e - 1)
          n = n.left;
        else if (n.lf_left + n.piece.lineFeedCnt > e - 1) {
          const l = this.getAccumulatedValue(n, e - n.lf_left - 2), c = this.getAccumulatedValue(n, e - n.lf_left - 1), u = this._buffers[n.piece.bufferIndex].buffer, d = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
          return o += n.size_left, this._searchCache.set({
            node: n,
            nodeStartOffset: o,
            nodeStartLineNumber: a - (e - 1 - n.lf_left)
          }), u.substring(d + l, d + c - t);
        } else if (n.lf_left + n.piece.lineFeedCnt === e - 1) {
          const l = this.getAccumulatedValue(n, e - n.lf_left - 2), c = this._buffers[n.piece.bufferIndex].buffer, u = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
          r = c.substring(u + l, u + n.piece.length);
          break;
        } else
          e -= n.lf_left + n.piece.lineFeedCnt, o += n.size_left + n.piece.length, n = n.right;
    }
    for (n = n.next(); n !== Nn; ) {
      const o = this._buffers[n.piece.bufferIndex].buffer;
      if (n.piece.lineFeedCnt > 0) {
        const a = this.getAccumulatedValue(n, 0), l = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
        return r += o.substring(l, l + a - t), r;
      } else {
        const a = this.offsetInBuffer(n.piece.bufferIndex, n.piece.start);
        r += o.substr(a, n.piece.length);
      }
      n = n.next();
    }
    return r;
  }
  computeBufferMetadata() {
    let e = this.root, t = 1, n = 0;
    for (; e !== Nn; )
      t += e.lf_left + e.piece.lineFeedCnt, n += e.size_left + e.piece.length, e = e.right;
    this._lineCnt = t, this._length = n, this._searchCache.validate(this._length);
  }
  // #region node operations
  getIndexOf(e, t) {
    const n = e.piece, r = this.positionInBuffer(e, t), s = r.line - n.start.line;
    if (this.offsetInBuffer(n.bufferIndex, n.end) - this.offsetInBuffer(n.bufferIndex, n.start) === t) {
      const o = this.getLineFeedCnt(e.piece.bufferIndex, n.start, r);
      if (o !== s)
        return { index: o, remainder: 0 };
    }
    return { index: s, remainder: r.column };
  }
  getAccumulatedValue(e, t) {
    if (t < 0)
      return 0;
    const n = e.piece, r = this._buffers[n.bufferIndex].lineStarts, s = n.start.line + t + 1;
    return s > n.end.line ? r[n.end.line] + n.end.column - r[n.start.line] - n.start.column : r[s] - r[n.start.line] - n.start.column;
  }
  deleteNodeTail(e, t) {
    const n = e.piece, r = n.lineFeedCnt, s = this.offsetInBuffer(n.bufferIndex, n.end), o = t, a = this.offsetInBuffer(n.bufferIndex, o), l = this.getLineFeedCnt(n.bufferIndex, n.start, o), c = l - r, u = a - s, d = n.length + u;
    e.piece = new wd(n.bufferIndex, n.start, o, l, d), zv(this, e, u, c);
  }
  deleteNodeHead(e, t) {
    const n = e.piece, r = n.lineFeedCnt, s = this.offsetInBuffer(n.bufferIndex, n.start), o = t, a = this.getLineFeedCnt(n.bufferIndex, o, n.end), l = this.offsetInBuffer(n.bufferIndex, o), c = a - r, u = s - l, d = n.length + u;
    e.piece = new wd(n.bufferIndex, o, n.end, a, d), zv(this, e, u, c);
  }
  shrinkNode(e, t, n) {
    const r = e.piece, s = r.start, o = r.end, a = r.length, l = r.lineFeedCnt, c = t, u = this.getLineFeedCnt(r.bufferIndex, r.start, c), d = this.offsetInBuffer(r.bufferIndex, t) - this.offsetInBuffer(r.bufferIndex, s);
    e.piece = new wd(r.bufferIndex, r.start, c, u, d), zv(this, e, d - a, u - l);
    const h = new wd(r.bufferIndex, n, o, this.getLineFeedCnt(r.bufferIndex, n, o), this.offsetInBuffer(r.bufferIndex, o) - this.offsetInBuffer(r.bufferIndex, n)), g = this.rbInsertRight(e, h);
    this.validateCRLFWithPrevNode(g);
  }
  appendToNode(e, t) {
    this.adjustCarriageReturnFromNext(t, e) && (t += `
`);
    const n = this.shouldCheckCRLF() && this.startWithLF(t) && this.endWithCR(e), r = this._buffers[0].buffer.length;
    this._buffers[0].buffer += t;
    const s = Kv(t, !1);
    for (let g = 0; g < s.length; g++)
      s[g] += r;
    if (n) {
      const g = this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 2];
      this._buffers[0].lineStarts.pop(), this._lastChangeBufferPos = { line: this._lastChangeBufferPos.line - 1, column: r - g };
    }
    this._buffers[0].lineStarts = this._buffers[0].lineStarts.concat(s.slice(1));
    const o = this._buffers[0].lineStarts.length - 1, a = this._buffers[0].buffer.length - this._buffers[0].lineStarts[o], l = { line: o, column: a }, c = e.piece.length + t.length, u = e.piece.lineFeedCnt, d = this.getLineFeedCnt(0, e.piece.start, l), h = d - u;
    e.piece = new wd(e.piece.bufferIndex, e.piece.start, l, d, c), this._lastChangeBufferPos = l, zv(this, e, t.length, h);
  }
  nodeAt(e) {
    let t = this.root;
    const n = this._searchCache.get(e);
    if (n)
      return {
        node: n.node,
        nodeStartOffset: n.nodeStartOffset,
        remainder: e - n.nodeStartOffset
      };
    let r = 0;
    for (; t !== Nn; )
      if (t.size_left > e)
        t = t.left;
      else if (t.size_left + t.piece.length >= e) {
        r += t.size_left;
        const s = {
          node: t,
          remainder: e - t.size_left,
          nodeStartOffset: r
        };
        return this._searchCache.set(s), s;
      } else
        e -= t.size_left + t.piece.length, r += t.size_left + t.piece.length, t = t.right;
    return null;
  }
  nodeAt2(e, t) {
    let n = this.root, r = 0;
    for (; n !== Nn; )
      if (n.left !== Nn && n.lf_left >= e - 1)
        n = n.left;
      else if (n.lf_left + n.piece.lineFeedCnt > e - 1) {
        const s = this.getAccumulatedValue(n, e - n.lf_left - 2), o = this.getAccumulatedValue(n, e - n.lf_left - 1);
        return r += n.size_left, {
          node: n,
          remainder: Math.min(s + t - 1, o),
          nodeStartOffset: r
        };
      } else if (n.lf_left + n.piece.lineFeedCnt === e - 1) {
        const s = this.getAccumulatedValue(n, e - n.lf_left - 2);
        if (s + t - 1 <= n.piece.length)
          return {
            node: n,
            remainder: s + t - 1,
            nodeStartOffset: r
          };
        t -= n.piece.length - s;
        break;
      } else
        e -= n.lf_left + n.piece.lineFeedCnt, r += n.size_left + n.piece.length, n = n.right;
    for (n = n.next(); n !== Nn; ) {
      if (n.piece.lineFeedCnt > 0) {
        const s = this.getAccumulatedValue(n, 0), o = this.offsetOfNode(n);
        return {
          node: n,
          remainder: Math.min(t - 1, s),
          nodeStartOffset: o
        };
      } else if (n.piece.length >= t - 1) {
        const s = this.offsetOfNode(n);
        return {
          node: n,
          remainder: t - 1,
          nodeStartOffset: s
        };
      } else
        t -= n.piece.length;
      n = n.next();
    }
    return null;
  }
  nodeCharCodeAt(e, t) {
    if (e.piece.lineFeedCnt < 1)
      return -1;
    const n = this._buffers[e.piece.bufferIndex], r = this.offsetInBuffer(e.piece.bufferIndex, e.piece.start) + t;
    return n.buffer.charCodeAt(r);
  }
  offsetOfNode(e) {
    if (!e)
      return 0;
    let t = e.size_left;
    for (; e !== this.root; )
      e.parent.right === e && (t += e.parent.size_left + e.parent.piece.length), e = e.parent;
    return t;
  }
  // #endregion
  // #region CRLF
  shouldCheckCRLF() {
    return !(this._EOLNormalized && this._EOL === `
`);
  }
  startWithLF(e) {
    if (typeof e == "string")
      return e.charCodeAt(0) === 10;
    if (e === Nn || e.piece.lineFeedCnt === 0)
      return !1;
    const t = e.piece, n = this._buffers[t.bufferIndex].lineStarts, r = t.start.line, s = n[r] + t.start.column;
    return r === n.length - 1 || n[r + 1] > s + 1 ? !1 : this._buffers[t.bufferIndex].buffer.charCodeAt(s) === 10;
  }
  endWithCR(e) {
    return typeof e == "string" ? e.charCodeAt(e.length - 1) === 13 : e === Nn || e.piece.lineFeedCnt === 0 ? !1 : this.nodeCharCodeAt(e, e.piece.length - 1) === 13;
  }
  validateCRLFWithPrevNode(e) {
    if (this.shouldCheckCRLF() && this.startWithLF(e)) {
      const t = e.prev();
      this.endWithCR(t) && this.fixCRLF(t, e);
    }
  }
  validateCRLFWithNextNode(e) {
    if (this.shouldCheckCRLF() && this.endWithCR(e)) {
      const t = e.next();
      this.startWithLF(t) && this.fixCRLF(e, t);
    }
  }
  fixCRLF(e, t) {
    const n = [], r = this._buffers[e.piece.bufferIndex].lineStarts;
    let s;
    e.piece.end.column === 0 ? s = { line: e.piece.end.line - 1, column: r[e.piece.end.line] - r[e.piece.end.line - 1] - 1 } : s = { line: e.piece.end.line, column: e.piece.end.column - 1 };
    const o = e.piece.length - 1, a = e.piece.lineFeedCnt - 1;
    e.piece = new wd(e.piece.bufferIndex, e.piece.start, s, a, o), zv(this, e, -1, -1), e.piece.length === 0 && n.push(e);
    const l = { line: t.piece.start.line + 1, column: 0 }, c = t.piece.length - 1, u = this.getLineFeedCnt(t.piece.bufferIndex, l, t.piece.end);
    t.piece = new wd(t.piece.bufferIndex, l, t.piece.end, u, c), zv(this, t, -1, -1), t.piece.length === 0 && n.push(t);
    const d = this.createNewPieces(`\r
`);
    this.rbInsertRight(e, d[0]);
    for (let h = 0; h < n.length; h++)
      j7(this, n[h]);
  }
  adjustCarriageReturnFromNext(e, t) {
    if (this.shouldCheckCRLF() && this.endWithCR(e)) {
      const n = t.next();
      if (this.startWithLF(n)) {
        if (e += `
`, n.piece.length === 1)
          j7(this, n);
        else {
          const r = n.piece, s = { line: r.start.line + 1, column: 0 }, o = r.length - 1, a = this.getLineFeedCnt(r.bufferIndex, s, r.end);
          n.piece = new wd(r.bufferIndex, s, r.end, a, o), zv(this, n, -1, -1);
        }
        return !0;
      }
    }
    return !1;
  }
  // #endregion
  // #endregion
  // #region Tree operations
  iterate(e, t) {
    if (e === Nn)
      return t(Nn);
    const n = this.iterate(e.left, t);
    return n && t(e) && this.iterate(e.right, t);
  }
  getNodeContent(e) {
    if (e === Nn)
      return "";
    const t = this._buffers[e.piece.bufferIndex], n = e.piece, r = this.offsetInBuffer(n.bufferIndex, n.start), s = this.offsetInBuffer(n.bufferIndex, n.end);
    return t.buffer.substring(r, s);
  }
  getPieceContent(e) {
    const t = this._buffers[e.bufferIndex], n = this.offsetInBuffer(e.bufferIndex, e.start), r = this.offsetInBuffer(e.bufferIndex, e.end);
    return t.buffer.substring(n, r);
  }
  /**
   *      node              node
   *     /  \              /  \
   *    a   b    <----   a    b
   *                         /
   *                        z
   */
  rbInsertRight(e, t) {
    const n = new Tre(
      t,
      1
      /* NodeColor.Red */
    );
    if (n.left = Nn, n.right = Nn, n.parent = Nn, n.size_left = 0, n.lf_left = 0, this.root === Nn)
      this.root = n, n.color = 0;
    else if (e.right === Nn)
      e.right = n, n.parent = e;
    else {
      const s = Xfe(e.right);
      s.left = n, n.parent = s;
    }
    return CTe(this, n), n;
  }
  /**
   *      node              node
   *     /  \              /  \
   *    a   b     ---->   a    b
   *                       \
   *                        z
   */
  rbInsertLeft(e, t) {
    const n = new Tre(
      t,
      1
      /* NodeColor.Red */
    );
    if (n.left = Nn, n.right = Nn, n.parent = Nn, n.size_left = 0, n.lf_left = 0, this.root === Nn)
      this.root = n, n.color = 0;
    else if (e.left === Nn)
      e.left = n, n.parent = e;
    else {
      const r = n4e(e.left);
      r.right = n, n.parent = r;
    }
    return CTe(this, n), n;
  }
}
class iR extends ge {
  constructor(e, t, n, r, s, o, a) {
    super(), this._onDidChangeContent = this._register(new he()), this._BOM = t, this._mightContainNonBasicASCII = !o, this._mightContainRTL = r, this._mightContainUnusualLineTerminators = s, this._pieceTree = new ogt(e, n, a);
  }
  mightContainRTL() {
    return this._mightContainRTL;
  }
  mightContainUnusualLineTerminators() {
    return this._mightContainUnusualLineTerminators;
  }
  resetMightContainUnusualLineTerminators() {
    this._mightContainUnusualLineTerminators = !1;
  }
  mightContainNonBasicASCII() {
    return this._mightContainNonBasicASCII;
  }
  getBOM() {
    return this._BOM;
  }
  getEOL() {
    return this._pieceTree.getEOL();
  }
  createSnapshot(e) {
    return this._pieceTree.createSnapshot(e ? this._BOM : "");
  }
  getOffsetAt(e, t) {
    return this._pieceTree.getOffsetAt(e, t);
  }
  getPositionAt(e) {
    return this._pieceTree.getPositionAt(e);
  }
  getRangeAt(e, t) {
    const n = e + t, r = this.getPositionAt(e), s = this.getPositionAt(n);
    return new z(r.lineNumber, r.column, s.lineNumber, s.column);
  }
  getValueInRange(e, t = 0) {
    if (e.isEmpty())
      return "";
    const n = this._getEndOfLine(t);
    return this._pieceTree.getValueInRange(e, n);
  }
  getValueLengthInRange(e, t = 0) {
    if (e.isEmpty())
      return 0;
    if (e.startLineNumber === e.endLineNumber)
      return e.endColumn - e.startColumn;
    const n = this.getOffsetAt(e.startLineNumber, e.startColumn), r = this.getOffsetAt(e.endLineNumber, e.endColumn);
    let s = 0;
    const o = this._getEndOfLine(t), a = this.getEOL();
    if (o.length !== a.length) {
      const l = o.length - a.length, c = e.endLineNumber - e.startLineNumber;
      s = l * c;
    }
    return r - n + s;
  }
  getCharacterCountInRange(e, t = 0) {
    if (this._mightContainNonBasicASCII) {
      let n = 0;
      const r = e.startLineNumber, s = e.endLineNumber;
      for (let o = r; o <= s; o++) {
        const a = this.getLineContent(o), l = o === r ? e.startColumn - 1 : 0, c = o === s ? e.endColumn - 1 : a.length;
        for (let u = l; u < c; u++)
          Qo(a.charCodeAt(u)) ? (n = n + 1, u = u + 1) : n = n + 1;
      }
      return n += this._getEndOfLine(t).length * (s - r), n;
    }
    return this.getValueLengthInRange(e, t);
  }
  getNearestChunk(e) {
    return this._pieceTree.getNearestChunk(e);
  }
  getLength() {
    return this._pieceTree.getLength();
  }
  getLineCount() {
    return this._pieceTree.getLineCount();
  }
  getLinesContent() {
    return this._pieceTree.getLinesContent();
  }
  getLineContent(e) {
    return this._pieceTree.getLineContent(e);
  }
  getLineCharCode(e, t) {
    return this._pieceTree.getLineCharCode(e, t);
  }
  getLineLength(e) {
    return this._pieceTree.getLineLength(e);
  }
  getLineFirstNonWhitespaceColumn(e) {
    const t = Tc(this.getLineContent(e));
    return t === -1 ? 0 : t + 1;
  }
  getLineLastNonWhitespaceColumn(e) {
    const t = zg(this.getLineContent(e));
    return t === -1 ? 0 : t + 2;
  }
  _getEndOfLine(e) {
    switch (e) {
      case 1:
        return `
`;
      case 2:
        return `\r
`;
      case 0:
        return this.getEOL();
      default:
        throw new Error("Unknown EOL preference");
    }
  }
  setEOL(e) {
    this._pieceTree.setEOL(e);
  }
  applyEdits(e, t, n) {
    let r = this._mightContainRTL, s = this._mightContainUnusualLineTerminators, o = this._mightContainNonBasicASCII, a = !0, l = [];
    for (let _ = 0; _ < e.length; _++) {
      const v = e[_];
      a && v._isTracked && (a = !1);
      const w = v.range;
      if (v.text) {
        let N = !0;
        o || (N = !_B(v.text), o = N), !r && N && (r = jR(v.text)), !s && N && (s = JMe(v.text));
      }
      let E = "", L = 0, T = 0, D = 0;
      if (v.text) {
        let N;
        [L, T, D, N] = lw(v.text);
        const R = this.getEOL();
        N === 0 || N === (R === `\r
` ? 2 : 1) ? E = v.text : E = v.text.replace(/\r\n|\r|\n/g, R);
      }
      l[_] = {
        sortIndex: _,
        identifier: v.identifier || null,
        range: w,
        rangeOffset: this.getOffsetAt(w.startLineNumber, w.startColumn),
        rangeLength: this.getValueLengthInRange(w),
        text: E,
        eolCount: L,
        firstLineLength: T,
        lastLineLength: D,
        forceMoveMarkers: !!v.forceMoveMarkers,
        isAutoWhitespaceEdit: v.isAutoWhitespaceEdit || !1
      };
    }
    l.sort(iR._sortOpsAscending);
    let c = !1;
    for (let _ = 0, v = l.length - 1; _ < v; _++) {
      const w = l[_].range.getEndPosition(), E = l[_ + 1].range.getStartPosition();
      if (E.isBeforeOrEqual(w)) {
        if (E.isBefore(w))
          throw new Error("Overlapping ranges are not allowed!");
        c = !0;
      }
    }
    a && (l = this._reduceOperations(l));
    const u = n || t ? iR._getInverseEditRanges(l) : [], d = [];
    if (t)
      for (let _ = 0; _ < l.length; _++) {
        const v = l[_], w = u[_];
        if (v.isAutoWhitespaceEdit && v.range.isEmpty())
          for (let E = w.startLineNumber; E <= w.endLineNumber; E++) {
            let L = "";
            E === w.startLineNumber && (L = this.getLineContent(v.range.startLineNumber), Tc(L) !== -1) || d.push({ lineNumber: E, oldContent: L });
          }
      }
    let h = null;
    if (n) {
      let _ = 0;
      h = [];
      for (let v = 0; v < l.length; v++) {
        const w = l[v], E = u[v], L = this.getValueInRange(w.range), T = w.rangeOffset + _;
        _ += w.text.length - L.length, h[v] = {
          sortIndex: w.sortIndex,
          identifier: w.identifier,
          range: E,
          text: L,
          textChange: new gl(w.rangeOffset, L, T, w.text)
        };
      }
      c || h.sort((v, w) => v.sortIndex - w.sortIndex);
    }
    this._mightContainRTL = r, this._mightContainUnusualLineTerminators = s, this._mightContainNonBasicASCII = o;
    const g = this._doApplyEdits(l);
    let m = null;
    if (t && d.length > 0) {
      d.sort((_, v) => v.lineNumber - _.lineNumber), m = [];
      for (let _ = 0, v = d.length; _ < v; _++) {
        const w = d[_].lineNumber;
        if (_ > 0 && d[_ - 1].lineNumber === w)
          continue;
        const E = d[_].oldContent, L = this.getLineContent(w);
        L.length === 0 || L === E || Tc(L) !== -1 || m.push(w);
      }
    }
    return this._onDidChangeContent.fire(), new nst(h, g, m);
  }
  /**
   * Transform operations such that they represent the same logic edit,
   * but that they also do not cause OOM crashes.
   */
  _reduceOperations(e) {
    return e.length < 1e3 ? e : [this._toSingleEditOperation(e)];
  }
  _toSingleEditOperation(e) {
    let t = !1;
    const n = e[0].range, r = e[e.length - 1].range, s = new z(n.startLineNumber, n.startColumn, r.endLineNumber, r.endColumn);
    let o = n.startLineNumber, a = n.startColumn;
    const l = [];
    for (let g = 0, m = e.length; g < m; g++) {
      const _ = e[g], v = _.range;
      t = t || _.forceMoveMarkers, l.push(this.getValueInRange(new z(o, a, v.startLineNumber, v.startColumn))), _.text.length > 0 && l.push(_.text), o = v.endLineNumber, a = v.endColumn;
    }
    const c = l.join(""), [u, d, h] = lw(c);
    return {
      sortIndex: 0,
      identifier: e[0].identifier,
      range: s,
      rangeOffset: this.getOffsetAt(s.startLineNumber, s.startColumn),
      rangeLength: this.getValueLengthInRange(
        s,
        0
        /* EndOfLinePreference.TextDefined */
      ),
      text: c,
      eolCount: u,
      firstLineLength: d,
      lastLineLength: h,
      forceMoveMarkers: t,
      isAutoWhitespaceEdit: !1
    };
  }
  _doApplyEdits(e) {
    e.sort(iR._sortOpsDescending);
    const t = [];
    for (let n = 0; n < e.length; n++) {
      const r = e[n], s = r.range.startLineNumber, o = r.range.startColumn, a = r.range.endLineNumber, l = r.range.endColumn;
      if (s === a && o === l && r.text.length === 0)
        continue;
      r.text ? (this._pieceTree.delete(r.rangeOffset, r.rangeLength), this._pieceTree.insert(r.rangeOffset, r.text, !0)) : this._pieceTree.delete(r.rangeOffset, r.rangeLength);
      const c = new z(s, o, a, l);
      t.push({
        range: c,
        rangeLength: r.rangeLength,
        text: r.text,
        rangeOffset: r.rangeOffset,
        forceMoveMarkers: r.forceMoveMarkers
      });
    }
    return t;
  }
  findMatchesLineByLine(e, t, n, r) {
    return this._pieceTree.findMatchesLineByLine(e, t, n, r);
  }
  /**
   * Assumes `operations` are validated and sorted ascending
   */
  static _getInverseEditRanges(e) {
    const t = [];
    let n = 0, r = 0, s = null;
    for (let o = 0, a = e.length; o < a; o++) {
      const l = e[o];
      let c, u;
      s ? s.range.endLineNumber === l.range.startLineNumber ? (c = n, u = r + (l.range.startColumn - s.range.endColumn)) : (c = n + (l.range.startLineNumber - s.range.endLineNumber), u = l.range.startColumn) : (c = l.range.startLineNumber, u = l.range.startColumn);
      let d;
      if (l.text.length > 0) {
        const h = l.eolCount + 1;
        h === 1 ? d = new z(c, u, c, u + l.firstLineLength) : d = new z(c, u, c + h - 1, l.lastLineLength + 1);
      } else
        d = new z(c, u, c, u);
      n = d.endLineNumber, r = d.endColumn, t.push(d), s = l;
    }
    return t;
  }
  static _sortOpsAscending(e, t) {
    const n = z.compareRangesUsingEnds(e.range, t.range);
    return n === 0 ? e.sortIndex - t.sortIndex : n;
  }
  static _sortOpsDescending(e, t) {
    const n = z.compareRangesUsingEnds(e.range, t.range);
    return n === 0 ? t.sortIndex - e.sortIndex : -n;
  }
}
class agt {
  constructor(e, t, n, r, s, o, a, l, c) {
    this._chunks = e, this._bom = t, this._cr = n, this._lf = r, this._crlf = s, this._containsRTL = o, this._containsUnusualLineTerminators = a, this._isBasicASCII = l, this._normalizeEOL = c;
  }
  _getEOL(e) {
    const t = this._cr + this._lf + this._crlf, n = this._cr + this._crlf;
    return t === 0 ? e === 1 ? `
` : `\r
` : n > t / 2 ? `\r
` : `
`;
  }
  create(e) {
    const t = this._getEOL(e), n = this._chunks;
    if (this._normalizeEOL && (t === `\r
` && (this._cr > 0 || this._lf > 0) || t === `
` && (this._cr > 0 || this._crlf > 0)))
      for (let s = 0, o = n.length; s < o; s++) {
        const a = n[s].buffer.replace(/\r\n|\r|\n/g, t), l = Kv(a);
        n[s] = new zE(a, l);
      }
    const r = new iR(n, this._bom, t, this._containsRTL, this._containsUnusualLineTerminators, this._isBasicASCII, this._normalizeEOL);
    return { textBuffer: r, disposable: r };
  }
}
class s4e {
  constructor() {
    this.chunks = [], this.BOM = "", this._hasPreviousChar = !1, this._previousChar = 0, this._tmpLineStarts = [], this.cr = 0, this.lf = 0, this.crlf = 0, this.containsRTL = !1, this.containsUnusualLineTerminators = !1, this.isBasicASCII = !0;
  }
  acceptChunk(e) {
    if (e.length === 0)
      return;
    this.chunks.length === 0 && Vhe(e) && (this.BOM = fnt, e = e.substr(1));
    const t = e.charCodeAt(e.length - 1);
    t === 13 || t >= 55296 && t <= 56319 ? (this._acceptChunk1(e.substr(0, e.length - 1), !1), this._hasPreviousChar = !0, this._previousChar = t) : (this._acceptChunk1(e, !1), this._hasPreviousChar = !1, this._previousChar = t);
  }
  _acceptChunk1(e, t) {
    !t && e.length === 0 || (this._hasPreviousChar ? this._acceptChunk2(String.fromCharCode(this._previousChar) + e) : this._acceptChunk2(e));
  }
  _acceptChunk2(e) {
    const t = igt(this._tmpLineStarts, e);
    this.chunks.push(new zE(e, t.lineStarts)), this.cr += t.cr, this.lf += t.lf, this.crlf += t.crlf, t.isBasicASCII || (this.isBasicASCII = !1, this.containsRTL || (this.containsRTL = jR(e)), this.containsUnusualLineTerminators || (this.containsUnusualLineTerminators = JMe(e)));
  }
  finish(e = !0) {
    return this._finish(), new agt(this.chunks, this.BOM, this.cr, this.lf, this.crlf, this.containsRTL, this.containsUnusualLineTerminators, this.isBasicASCII, e);
  }
  _finish() {
    if (this.chunks.length === 0 && this._acceptChunk1("", !0), this._hasPreviousChar) {
      this._hasPreviousChar = !1;
      const e = this.chunks[this.chunks.length - 1];
      e.buffer += String.fromCharCode(this._previousChar);
      const t = Kv(e.buffer);
      e.lineStarts = t, this._previousChar === 13 && this.cr++;
    }
  }
}
class lgt {
  constructor() {
    this._onDidChangeVisibleRanges = new he(), this.onDidChangeVisibleRanges = this._onDidChangeVisibleRanges.event, this._views = /* @__PURE__ */ new Set(), this._viewsChanged = Nf(this), this.visibleLineRanges = pl({
      owner: this,
      equalsFn: e4(qhe())
    }, (e) => (this._viewsChanged.read(e), Zt.joinMany([...this._views].map((n) => {
      var r;
      return ((r = n.state.read(e)) == null ? void 0 : r.visibleLineRanges) ?? [];
    }))));
  }
  attachView() {
    const e = new ugt((t) => {
      this._onDidChangeVisibleRanges.fire({ view: e, state: t });
    });
    return this._views.add(e), this._viewsChanged.trigger(void 0), e;
  }
  detachView(e) {
    this._views.delete(e), this._onDidChangeVisibleRanges.fire({ view: e, state: void 0 }), this._viewsChanged.trigger(void 0);
  }
}
class cgt {
  constructor(e, t) {
    this.visibleLineRanges = e, this.stabilized = t;
  }
  equals(e) {
    return this === e ? !0 : !(!ds(this.visibleLineRanges, e.visibleLineRanges, (t, n) => t.equals(n)) || this.stabilized !== e.stabilized);
  }
}
class ugt {
  get state() {
    return this._state;
  }
  constructor(e) {
    this.handleStateChange = e, this._state = CF({ owner: this, equalsFn: cx((t, n) => t.equals(n)) }, void 0);
  }
  setVisibleLines(e, t) {
    const n = e.map((s) => new Zt(s.startLineNumber, s.endLineNumber + 1)), r = new cgt(n, t);
    this._state.set(r, void 0, void 0), this.handleStateChange(r);
  }
}
class dgt extends ge {
  get lineRanges() {
    return this._lineRanges;
  }
  constructor(e) {
    super(), this._refreshTokens = e, this.runner = this._register(new mr(() => this.update(), 50)), this._computedLineRanges = [], this._lineRanges = [];
  }
  update() {
    ds(this._computedLineRanges, this._lineRanges, (e, t) => e.equals(t)) || (this._computedLineRanges = this._lineRanges, this._refreshTokens());
  }
  handleStateChange(e) {
    this._lineRanges = e.visibleLineRanges, e.stabilized ? (this.runner.cancel(), this.update()) : this.runner.schedule();
  }
}
class o4e extends ge {
  get backgroundTokenizationState() {
    return this._backgroundTokenizationState;
  }
  constructor(e, t) {
    super(), this._languageIdCodec = e, this._textModel = t, this._onDidChangeTokens = this._register(new he()), this.onDidChangeTokens = this._onDidChangeTokens.event;
  }
  tokenizeIfCheap(e) {
    this.isCheapToTokenize(e) && this.forceTokenization(e);
  }
}
function hgt(i, e) {
  const t = i.gotoNextSibling(), n = e.gotoNextSibling();
  if (t !== n)
    throw new Error("Trees are out of sync");
  return t && n;
}
function a4e(i, e) {
  const t = i.gotoParent(), n = e.gotoParent();
  if (t !== n)
    throw new Error("Trees are out of sync");
  return t && n;
}
function fgt(i, e, t) {
  const n = i.gotoFirstChild(), r = e.gotoFirstChild();
  if (n !== r)
    throw new Error("Trees are out of sync");
  if (t === 0)
    return n && r;
  for (let s = 1; s <= t; s++) {
    const o = i.gotoNextSibling(), a = e.gotoNextSibling();
    if (o !== a)
      throw new Error("Trees are out of sync");
    if (!o || !a)
      return !1;
  }
  return n && r;
}
function STe(i, e) {
  do {
    if (i.currentNode.nextSibling)
      return hgt(i, e);
    i.currentNode.parent && a4e(i, e);
  } while (i.currentNode.nextSibling || i.currentNode.parent);
  return !1;
}
function ggt(i, e) {
  const t = e.walk();
  t.resetTo(i);
  const n = i.currentNode;
  do
    if (t.currentNode.previousSibling && t.currentNode.endIndex - t.currentNode.startIndex !== 0)
      t.gotoPreviousSibling();
    else {
      for (; !t.currentNode.previousSibling && t.currentNode.parent; )
        t.gotoParent();
      t.gotoPreviousSibling();
    }
  while (t.currentNode.endIndex > n.startIndex && (t.currentNode.parent || t.currentNode.previousSibling) && t.currentNode.id !== n.id);
  if (t.currentNode.id !== n.id && t.currentNode.endIndex <= n.startIndex)
    return t.currentNode;
}
var pgt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ETe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let kre = class extends ge {
  constructor(e, t, n, r, s, o, a) {
    super(), this.languageId = e, this._ranges = t, this._parser = n, this._parserClass = r, this.textModel = s, this._logService = o, this._telemetryService = a, this._tree = Qt(this, void 0), this.tree = this._tree, this._treeLastParsedVersion = Qt(this, -1), this.treeLastParsedVersion = this._treeLastParsedVersion, this._onDidChangeContentQueue = new Jtt(), this._tree = Qt(this, void 0), this.tree = this._tree, this._register(Et(() => {
      var l, c, u;
      (l = this._tree.get()) == null || l.delete(), (c = this._lastFullyParsed) == null || c.delete(), (u = this._lastFullyParsedWithEdits) == null || u.delete(), this._parser.delete();
    })), this.handleContentChange(void 0, this._ranges);
  }
  handleContentChange(e, t) {
    const n = this.textModel.getVersionId();
    let r = [];
    t && (r = this._setRanges(t)), e && this._applyEdits(e.changes), this._onDidChangeContentQueue.clearPending(), this._onDidChangeContentQueue.schedule(async () => {
      if (this._store.isDisposed)
        return;
      const s = this._lastFullyParsed;
      let o;
      this._lastFullyParsedWithEdits && this._lastFullyParsed && (o = this._findChangedNodes(this._lastFullyParsedWithEdits, this._lastFullyParsed));
      const a = await this._parseAndUpdateTree(n);
      if (a) {
        let l;
        o ? s && o && (l = this._findTreeChanges(a, o, r)) : this._ranges && (l = this._ranges.map((u) => ({ newRange: new z(u.startPosition.row + 1, u.startPosition.column + 1, u.endPosition.row + 1, u.endPosition.column + 1), oldRangeLength: u.endIndex - u.startIndex, newRangeStartOffset: u.startIndex, newRangeEndOffset: u.endIndex }))), l || (l = [{ newRange: this.textModel.getFullModelRange(), newRangeStartOffset: 0, newRangeEndOffset: this.textModel.getValueLength() }]);
        const c = this._tree.get();
        Fr((u) => {
          this._tree.set(a, u, { ranges: l, versionId: n }), this._treeLastParsedVersion.set(n, u);
        }), c == null || c.delete();
      }
    });
  }
  _applyEdits(e) {
    var t, n;
    for (const r of e) {
      const s = ta.ofRange(z.lift(r.range)), o = ta.ofText(r.text), a = r.text.length === 0 ? o : s.add(o), l = {
        startIndex: r.rangeOffset,
        oldEndIndex: r.rangeOffset + r.rangeLength,
        newEndIndex: r.rangeOffset + r.text.length,
        startPosition: { row: r.range.startLineNumber - 1, column: r.range.startColumn - 1 },
        oldEndPosition: { row: r.range.endLineNumber - 1, column: r.range.endColumn - 1 },
        newEndPosition: { row: r.range.startLineNumber + a.lineCount - 1, column: a.lineCount ? a.columnCount : r.range.endColumn + a.columnCount }
      };
      (t = this._tree.get()) == null || t.edit(l), (n = this._lastFullyParsedWithEdits) == null || n.edit(l);
    }
  }
  _findChangedNodes(e, t) {
    if (this._ranges && this._ranges.every((a) => a.startPosition.row !== e.rootNode.startPosition.row) || e.rootNode.startPosition.row !== 0)
      return [];
    const n = e.walk(), r = t.walk(), s = [];
    let o = !0;
    do
      if (n.currentNode.hasChanges) {
        const a = n.currentNode.children, l = [], c = a.filter((u, d) => u != null && u.hasChanges || r.currentNode.children.length <= d ? (l.push(d), !0) : !1);
        if (c.length === 0 || n.currentNode.hasError !== r.currentNode.hasError) {
          for (; n.currentNode.parent && o && !n.currentNode.isNamed; )
            o = a4e(n, r);
          const u = n.currentNode, d = ggt(n, e) ?? u;
          s.push({
            startIndex: d.startIndex,
            endIndex: u.endIndex,
            startPosition: d.startPosition,
            endPosition: u.endPosition
          }), o = STe(n, r);
        } else c.length >= 1 && (o = fgt(n, r, l[0]));
      } else
        o = STe(n, r);
    while (o);
    return n.delete(), r.delete(), s;
  }
  _findTreeChanges(e, t, n) {
    let r = 0;
    const s = [];
    for (let o = 0; o < t.length; o++) {
      const a = t[o];
      if (s.length > 0 && a.startIndex >= s[s.length - 1].newRangeStartOffset && a.endIndex <= s[s.length - 1].newRangeEndOffset)
        continue;
      const l = e.walk(), c = () => l.startIndex < a.startIndex && l.endIndex > a.endIndex;
      for (; c(); ) {
        let _ = l.gotoFirstChild(), v = !1;
        for (; _; )
          if (c() && l.currentNode.isNamed) {
            v = !0;
            break;
          } else
            _ = l.gotoNextSibling();
        if (!v) {
          l.gotoParent();
          break;
        }
        if (l.currentNode.childCount === 0)
          break;
      }
      const u = l.currentNode.startPosition, d = l.currentNode.endPosition, h = l.currentNode.startIndex, g = l.currentNode.endIndex, m = { newRange: new z(u.row + 1, u.column + 1, d.row + 1, d.column + 1), newRangeStartOffset: h, newRangeEndOffset: g };
      r < n.length && xTe(n[r], { startIndex: h, endIndex: g }) ? (n[r].startIndex < m.newRangeStartOffset && (m.newRange = m.newRange.setStartPosition(n[r].startPosition.row + 1, n[r].startPosition.column + 1), m.newRangeStartOffset = n[r].startIndex), n[r].endIndex > m.newRangeEndOffset && (m.newRange = m.newRange.setEndPosition(n[r].endPosition.row + 1, n[r].endPosition.column + 1), m.newRangeEndOffset = n[r].endIndex), r++) : r < n.length && n[r].endIndex < m.newRangeStartOffset && s.push({
        newRange: new z(n[r].startPosition.row + 1, n[r].startPosition.column + 1, n[r].endPosition.row + 1, n[r].endPosition.column + 1),
        newRangeStartOffset: n[r].startIndex,
        newRangeEndOffset: n[r].endIndex
      }), s.length > 0 && s[s.length - 1].newRangeEndOffset >= m.newRangeStartOffset ? (s[s.length - 1].newRange = z.fromPositions(s[s.length - 1].newRange.getStartPosition(), m.newRange.getEndPosition()), s[s.length - 1].newRangeEndOffset = m.newRangeEndOffset) : s.push(m);
    }
    return this._constrainRanges(s);
  }
  _constrainRanges(e) {
    if (!this._ranges)
      return e;
    const t = [];
    let n = 0, r = 0;
    for (; n < e.length && r < this._ranges.length; ) {
      const s = e[n], o = this._ranges[r];
      if (s.newRangeEndOffset < o.startIndex)
        n++;
      else if (s.newRangeStartOffset > o.endIndex)
        r++;
      else {
        const a = Math.max(s.newRangeStartOffset, o.startIndex), l = Math.min(s.newRangeEndOffset, o.endIndex), c = s.newRange.intersectRanges(new z(o.startPosition.row + 1, o.startPosition.column + 1, o.endPosition.row + 1, o.endPosition.column + 1));
        t.push({
          newRange: c,
          newRangeEndOffset: l,
          newRangeStartOffset: a
        }), l < s.newRangeEndOffset ? (s.newRange = z.fromPositions(c.getEndPosition(), s.newRange.getEndPosition()), s.newRangeStartOffset = l + 1) : n++;
      }
    }
    return t;
  }
  async _parseAndUpdateTree(e) {
    var n, r;
    const t = await this._parse();
    if (t)
      return (n = this._lastFullyParsed) == null || n.delete(), this._lastFullyParsed = t.copy(), (r = this._lastFullyParsedWithEdits) == null || r.delete(), this._lastFullyParsedWithEdits = t.copy(), t;
    this._tree.get() || this._parser.reset();
  }
  _parse() {
    let e = "fullParse";
    return this._tree.get() && (e = "incrementalParse"), this._parseAndYield(e);
  }
  async _parseAndYield(e) {
    let t = 0, n = 0;
    const r = this.textModel.getVersionId();
    let s;
    const o = mgt();
    do {
      const a = performance.now();
      s = this._parser.parse((l, c) => this._parseCallback(l), this._tree.get(), { progressCallback: o, includedRanges: this._ranges }), t += performance.now() - a, n++, await new Promise((l) => gq(l));
    } while (!this._store.isDisposed && !s && r === this.textModel.getVersionId());
    return this._sendParseTimeTelemetry(e, t, n), s && r === this.textModel.getVersionId() ? s : void 0;
  }
  _parseCallback(e) {
    try {
      return this.textModel.getTextBuffer().getNearestChunk(e);
    } catch (t) {
      this._logService.debug("Error getting chunk for tree-sitter parsing", t);
    }
  }
  _setRanges(e) {
    const t = [];
    if (this._ranges)
      for (const n of e) {
        let r = !1;
        for (let s = 0; s < this._ranges.length; s++) {
          const o = this._ranges[s];
          if (_gt(o, n) || xTe(o, n)) {
            r = !0;
            break;
          }
        }
        r || t.push(n);
      }
    else
      t.push(...e);
    return this._ranges = e, t;
  }
  _sendParseTimeTelemetry(e, t, n) {
    this._logService.debug(`Tree parsing (${e}) took ${t} ms and ${n} passes.`), e === "fullParse" ? this._telemetryService.publicLog2("treeSitter.fullParse", { languageId: this.languageId, time: t, passes: n }) : this._telemetryService.publicLog2("treeSitter.incrementalParse", { languageId: this.languageId, time: t, passes: n });
  }
  createParsedTreeSync(e) {
    const t = new this._parserClass();
    t.setLanguage(this._parser.language);
    const n = t.parse(e);
    return t.delete(), n ?? void 0;
  }
};
kre = pgt([
  ETe(5, $r),
  ETe(6, rc)
], kre);
function mgt() {
  let i = performance.now();
  return function(t) {
    const n = performance.now();
    return n - i > 50 ? (i = n, !0) : !1;
  };
}
function _gt(i, e) {
  return i.startPosition.row === e.startPosition.row && i.startPosition.column === e.startPosition.column && i.endPosition.row === e.endPosition.row && i.endPosition.column === e.endPosition.column && i.startIndex === e.startIndex && i.endIndex === e.endIndex;
}
function xTe(i, e) {
  return i.startIndex <= e.startIndex && i.endIndex >= e.startIndex || e.startIndex <= i.startIndex && e.endIndex >= i.startIndex;
}
const sA = new class {
  clone() {
    return this;
  }
  equals(i) {
    return this === i;
  }
}();
function ege(i, e) {
  return new Pfe([new E4(0, "", i)], e);
}
function aK(i, e) {
  const t = new Uint32Array(2);
  return t[0] = 0, t[1] = (i << 0 | 0 | 0 | 32768 | 2 << 24) >>> 0, new rK(t, e === null ? sA : e);
}
class bgt {
  constructor(e) {
    this._default = e, this._store = [];
  }
  get(e) {
    return e < this._store.length ? this._store[e] : this._default;
  }
  set(e, t) {
    for (; e >= this._store.length; )
      this._store[this._store.length] = this._default;
    this._store[e] = t;
  }
  replace(e, t, n) {
    if (e >= this._store.length)
      return;
    if (t === 0) {
      this.insert(e, n);
      return;
    } else if (n === 0) {
      this.delete(e, t);
      return;
    }
    const r = this._store.slice(0, e), s = this._store.slice(e + t), o = vgt(n, this._default);
    this._store = r.concat(o, s);
  }
  delete(e, t) {
    t === 0 || e >= this._store.length || this._store.splice(e, t);
  }
  insert(e, t) {
    if (t === 0 || e >= this._store.length)
      return;
    const n = [];
    for (let r = 0; r < t; r++)
      n[r] = this._default;
    this._store = bq(this._store, e, n);
  }
}
function vgt(i, e) {
  const t = [];
  for (let n = 0; n < i; n++)
    t[n] = e;
  return t;
}
class ygt {
  /**
   * (Inclusive) start line number for these tokens.
   */
  get startLineNumber() {
    return this._startLineNumber;
  }
  /**
   * (Inclusive) end line number for these tokens.
   */
  get endLineNumber() {
    return this._startLineNumber + this._tokens.length - 1;
  }
  constructor(e, t) {
    this._startLineNumber = e, this._tokens = t;
  }
  /**
   * @see {@link _tokens}
   */
  getLineTokens(e) {
    return this._tokens[e - this._startLineNumber];
  }
  appendLineTokens(e) {
    this._tokens.push(e);
  }
}
class Dre {
  constructor() {
    this._tokens = [];
  }
  add(e, t) {
    if (this._tokens.length > 0) {
      const n = this._tokens[this._tokens.length - 1];
      if (n.endLineNumber + 1 === e) {
        n.appendLineTokens(t);
        return;
      }
    }
    this._tokens.push(new ygt(e, [t]));
  }
  finalize() {
    return this._tokens;
  }
}
class Cgt {
  constructor(e, t) {
    this.tokenizationSupport = t, this.initialState = this.tokenizationSupport.getInitialState(), this.store = new Ire(e);
  }
  getStartState(e) {
    return this.store.getStartState(e, this.initialState);
  }
  getFirstInvalidLine() {
    return this.store.getFirstInvalidLine(this.initialState);
  }
}
class wgt extends Cgt {
  constructor(e, t, n, r) {
    super(e, t), this._textModel = n, this._languageIdCodec = r;
  }
  updateTokensUntilLine(e, t) {
    const n = this._textModel.getLanguageId();
    for (; ; ) {
      const r = this.getFirstInvalidLine();
      if (!r || r.lineNumber > t)
        break;
      const s = this._textModel.getLineContent(r.lineNumber), o = GM(this._languageIdCodec, n, this.tokenizationSupport, s, !0, r.startState);
      e.add(r.lineNumber, o.tokens), this.store.setEndState(r.lineNumber, o.endState);
    }
  }
  /** assumes state is up to date */
  getTokenTypeIfInsertingCharacter(e, t) {
    const n = this.getStartState(e.lineNumber);
    if (!n)
      return 0;
    const r = this._textModel.getLanguageId(), s = this._textModel.getLineContent(e.lineNumber), o = s.substring(0, e.column - 1) + t + s.substring(e.column - 1), a = GM(this._languageIdCodec, r, this.tokenizationSupport, o, !0, n), l = new fo(a.tokens, o, this._languageIdCodec);
    if (l.getCount() === 0)
      return 0;
    const c = l.findTokenIndexAtOffset(e.column - 1);
    return l.getStandardTokenType(c);
  }
  /** assumes state is up to date */
  tokenizeLinesAt(e, t) {
    const n = this.getStartState(e);
    if (!n)
      return null;
    const r = this._textModel.getLanguageId(), s = [];
    let o = n;
    for (const a of t) {
      const l = GM(this._languageIdCodec, r, this.tokenizationSupport, a, !0, o);
      s.push(new fo(l.tokens, a, this._languageIdCodec)), o = l.endState;
    }
    return s;
  }
  hasAccurateTokensForLine(e) {
    const t = this.store.getFirstInvalidEndStateLineNumberOrMax();
    return e < t;
  }
  isCheapToTokenize(e) {
    const t = this.store.getFirstInvalidEndStateLineNumberOrMax();
    return e < t || e === t && this._textModel.getLineLength(e) < 2048;
  }
  /**
   * The result is not cached.
   */
  tokenizeHeuristically(e, t, n) {
    if (n <= this.store.getFirstInvalidEndStateLineNumberOrMax())
      return { heuristicTokens: !1 };
    if (t <= this.store.getFirstInvalidEndStateLineNumberOrMax())
      return this.updateTokensUntilLine(e, n), { heuristicTokens: !1 };
    let r = this.guessStartState(t);
    const s = this._textModel.getLanguageId();
    for (let o = t; o <= n; o++) {
      const a = this._textModel.getLineContent(o), l = GM(this._languageIdCodec, s, this.tokenizationSupport, a, !0, r);
      e.add(o, l.tokens), r = l.endState;
    }
    return { heuristicTokens: !0 };
  }
  guessStartState(e) {
    let { likelyRelevantLines: t, initialState: n } = l4e(this._textModel, e, this);
    n || (n = this.tokenizationSupport.getInitialState());
    const r = this._textModel.getLanguageId();
    let s = n;
    for (const o of t)
      s = GM(this._languageIdCodec, r, this.tokenizationSupport, o, !1, s).endState;
    return s;
  }
}
function l4e(i, e, t) {
  let n = i.getLineFirstNonWhitespaceColumn(e);
  const r = [];
  let s = null;
  for (let o = e - 1; n > 1 && o >= 1; o--) {
    const a = i.getLineFirstNonWhitespaceColumn(o);
    if (a !== 0 && a < n && (r.push(i.getLineContent(o)), n = a, s = t == null ? void 0 : t.getStartState(o), s))
      break;
  }
  return r.reverse(), { likelyRelevantLines: r, initialState: s ?? void 0 };
}
class Ire {
  constructor(e) {
    this.lineCount = e, this._tokenizationStateStore = new Sgt(), this._invalidEndStatesLineNumbers = new Egt(), this._invalidEndStatesLineNumbers.addRange(new Tt(1, e + 1));
  }
  getEndState(e) {
    return this._tokenizationStateStore.getEndState(e);
  }
  /**
   * @returns if the end state has changed.
   */
  setEndState(e, t) {
    if (!t)
      throw new Wt("Cannot set null/undefined state");
    this._invalidEndStatesLineNumbers.delete(e);
    const n = this._tokenizationStateStore.setEndState(e, t);
    return n && e < this.lineCount && this._invalidEndStatesLineNumbers.addRange(new Tt(e + 1, e + 2)), n;
  }
  acceptChange(e, t) {
    this.lineCount += t - e.length, this._tokenizationStateStore.acceptChange(e, t), this._invalidEndStatesLineNumbers.addRangeAndResize(new Tt(e.startLineNumber, e.endLineNumberExclusive), t);
  }
  acceptChanges(e) {
    for (const t of e) {
      const [n] = lw(t.text);
      this.acceptChange(new Zt(t.range.startLineNumber, t.range.endLineNumber + 1), n + 1);
    }
  }
  invalidateEndStateRange(e) {
    this._invalidEndStatesLineNumbers.addRange(new Tt(e.startLineNumber, e.endLineNumberExclusive));
  }
  getFirstInvalidEndStateLineNumber() {
    return this._invalidEndStatesLineNumbers.min;
  }
  getFirstInvalidEndStateLineNumberOrMax() {
    return this.getFirstInvalidEndStateLineNumber() || Number.MAX_SAFE_INTEGER;
  }
  allStatesValid() {
    return this._invalidEndStatesLineNumbers.min === null;
  }
  getStartState(e, t) {
    return e === 1 ? t : this.getEndState(e - 1);
  }
  getFirstInvalidLine(e) {
    const t = this.getFirstInvalidEndStateLineNumber();
    if (t === null)
      return null;
    const n = this.getStartState(t, e);
    if (!n)
      throw new Wt("Start state must be defined");
    return { lineNumber: t, startState: n };
  }
}
class Sgt {
  constructor() {
    this._lineEndStates = new bgt(null);
  }
  getEndState(e) {
    return this._lineEndStates.get(e);
  }
  setEndState(e, t) {
    const n = this._lineEndStates.get(e);
    return n && n.equals(t) ? !1 : (this._lineEndStates.set(e, t), !0);
  }
  acceptChange(e, t) {
    let n = e.length;
    t > 0 && n > 0 && (n--, t--), this._lineEndStates.replace(e.startLineNumber, n, t);
  }
}
class Egt {
  constructor() {
    this._ranges = [];
  }
  get min() {
    return this._ranges.length === 0 ? null : this._ranges[0].start;
  }
  delete(e) {
    const t = this._ranges.findIndex((n) => n.contains(e));
    if (t !== -1) {
      const n = this._ranges[t];
      n.start === e ? n.endExclusive === e + 1 ? this._ranges.splice(t, 1) : this._ranges[t] = new Tt(e + 1, n.endExclusive) : n.endExclusive === e + 1 ? this._ranges[t] = new Tt(n.start, e) : this._ranges.splice(t, 1, new Tt(n.start, e), new Tt(e + 1, n.endExclusive));
    }
  }
  addRange(e) {
    Tt.addRange(e, this._ranges);
  }
  addRangeAndResize(e, t) {
    let n = 0;
    for (; !(n >= this._ranges.length || e.start <= this._ranges[n].endExclusive); )
      n++;
    let r = n;
    for (; !(r >= this._ranges.length || e.endExclusive < this._ranges[r].start); )
      r++;
    const s = t - e.length;
    for (let o = r; o < this._ranges.length; o++)
      this._ranges[o] = this._ranges[o].delta(s);
    if (n === r) {
      const o = new Tt(e.start, e.start + t);
      o.isEmpty || this._ranges.splice(n, 0, o);
    } else {
      const o = Math.min(e.start, this._ranges[n].start), a = Math.max(e.endExclusive, this._ranges[r - 1].endExclusive), l = new Tt(o, a + s);
      l.isEmpty ? this._ranges.splice(n, r - n) : this._ranges.splice(n, r - n, l);
    }
  }
  toString() {
    return this._ranges.map((e) => e.toString()).join(" + ");
  }
}
function GM(i, e, t, n, r, s) {
  let o = null;
  if (t)
    try {
      o = t.tokenizeEncoded(n, r, s.clone());
    } catch (a) {
      fn(a);
    }
  return o || (o = aK(i.encodeLanguageId(e), s)), fo.convertToEndOffset(o.tokens, n.length), o;
}
class xgt {
  constructor(e, t) {
    this._tokenizerWithStateStore = e, this._backgroundTokenStore = t, this._isDisposed = !1, this._isScheduled = !1;
  }
  dispose() {
    this._isDisposed = !0;
  }
  handleChanges() {
    this._beginBackgroundTokenization();
  }
  _beginBackgroundTokenization() {
    this._isScheduled || !this._tokenizerWithStateStore._textModel.isAttachedToEditor() || !this._hasLinesToTokenize() || (this._isScheduled = !0, Ohe((e) => {
      this._isScheduled = !1, this._backgroundTokenizeWithDeadline(e);
    }));
  }
  /**
   * Tokenize until the deadline occurs, but try to yield every 1-2ms.
   */
  _backgroundTokenizeWithDeadline(e) {
    const t = Date.now() + e.timeRemaining(), n = () => {
      this._isDisposed || !this._tokenizerWithStateStore._textModel.isAttachedToEditor() || !this._hasLinesToTokenize() || (this._backgroundTokenizeForAtLeast1ms(), Date.now() < t ? gq(n) : this._beginBackgroundTokenization());
    };
    n();
  }
  /**
   * Tokenize for at least 1ms.
   */
  _backgroundTokenizeForAtLeast1ms() {
    const e = this._tokenizerWithStateStore._textModel.getLineCount(), t = new Dre(), n = _a.create(!1);
    do
      if (n.elapsed() > 1 || this._tokenizeOneInvalidLine(t) >= e)
        break;
    while (this._hasLinesToTokenize());
    this._backgroundTokenStore.setTokens(t.finalize()), this.checkFinished();
  }
  _hasLinesToTokenize() {
    return this._tokenizerWithStateStore ? !this._tokenizerWithStateStore.store.allStatesValid() : !1;
  }
  _tokenizeOneInvalidLine(e) {
    var n;
    const t = (n = this._tokenizerWithStateStore) == null ? void 0 : n.getFirstInvalidLine();
    return t ? (this._tokenizerWithStateStore.updateTokensUntilLine(e, t.lineNumber), t.lineNumber) : this._tokenizerWithStateStore._textModel.getLineCount() + 1;
  }
  checkFinished() {
    this._isDisposed || this._tokenizerWithStateStore.store.allStatesValid() && this._backgroundTokenStore.backgroundTokenizationFinished();
  }
  requestTokens(e, t) {
    this._tokenizerWithStateStore.store.invalidateEndStateRange(new Zt(e, t));
  }
}
class lT {
  get children() {
    return this._children;
  }
  get length() {
    return this._length;
  }
  constructor(e) {
    this.height = e, this._children = [], this._length = 0;
  }
  static create(e, t) {
    const n = new lT(e.height + 1);
    return n.appendChild(e), n.appendChild(t), n;
  }
  canAppendChild() {
    return this._children.length < 3;
  }
  appendChild(e) {
    if (!this.canAppendChild())
      throw new Error("Cannot insert more than 3 children in a ListNode");
    this._children.push(e), this._length += e.length, this._updateParentLength(e.length), Zc(e) || (e.parent = this);
  }
  _updateParentLength(e) {
    let t = this.parent;
    for (; t; )
      t._length += e, t = t.parent;
  }
  unappendChild() {
    const e = this._children.pop();
    return this._length -= e.length, this._updateParentLength(-e.length), e;
  }
  prependChild(e) {
    if (this._children.length >= 3)
      throw new Error("Cannot prepend more than 3 children in a ListNode");
    this._children.unshift(e), this._length += e.length, this._updateParentLength(e.length), Zc(e) || (e.parent = this);
  }
  unprependChild() {
    const e = this._children.shift();
    return this._length -= e.length, this._updateParentLength(-e.length), e;
  }
  lastChild() {
    return this._children[this._children.length - 1];
  }
  dispose() {
    this._children.splice(0, this._children.length);
  }
}
var Ih;
(function(i) {
  i[i.None = 0] = "None", i[i.ViewportGuess = 1] = "ViewportGuess", i[i.EditGuess = 2] = "EditGuess", i[i.Accurate = 3] = "Accurate";
})(Ih || (Ih = {}));
function Zc(i) {
  return i.token !== void 0;
}
function c4e(i, e) {
  let t = i;
  const n = [];
  let r;
  for (; ; ) {
    if (e.height === t.height) {
      r = e;
      break;
    }
    if (Zc(t))
      throw new Error("unexpected");
    n.push(t), t = t.lastChild();
  }
  for (let s = n.length - 1; s >= 0; s--) {
    const o = n[s];
    r && (o.children.length >= 3 ? r = lT.create(o.unappendChild(), r) : (o.appendChild(r), r = void 0));
  }
  if (r) {
    const s = new lT(r.height + 1);
    return s.appendChild(i), s.appendChild(r), s;
  } else
    return i;
}
function Lgt(i, e) {
  let t = i;
  const n = [];
  for (; e.height !== t.height; ) {
    if (Zc(t))
      throw new Error("unexpected");
    n.push(t), t = t.children[0];
  }
  let r = e;
  for (let s = n.length - 1; s >= 0; s--) {
    const o = n[s];
    r && (o.children.length >= 3 ? r = lT.create(r, o.unprependChild()) : (o.prependChild(r), r = void 0));
  }
  return r ? lT.create(r, i) : i;
}
function Tgt(i, e) {
  return i.height === e.height ? lT.create(i, e) : i.height > e.height ? c4e(i, e) : Lgt(e, i);
}
class kgt {
  constructor(e) {
    this._textModel = e, this._root = this.createEmptyRoot();
  }
  createEmptyRoot() {
    return {
      length: this._textModel.getValueLength(),
      token: 0,
      height: 0,
      tokenQuality: Ih.None
    };
  }
  /**
   *
   * @param update all the tokens for the document in sequence
   */
  buildStore(e, t) {
    this._root = this.createFromUpdates(e, t);
  }
  createFromUpdates(e, t) {
    if (e.length === 0)
      return this.createEmptyRoot();
    let n = {
      length: e[0].length,
      token: e[0].token,
      height: 0,
      tokenQuality: t
    };
    for (let r = 1; r < e.length; r++)
      n = c4e(n, { length: e[r].length, token: e[r].token, height: 0, tokenQuality: t });
    return n;
  }
  /**
   *
   * @param tokens tokens are in sequence in the document.
   */
  update(e, t, n) {
    t.length !== 0 && this.replace(e, t[0].startOffsetInclusive, t, n);
  }
  delete(e, t) {
    this.replace(e, t, [], Ih.EditGuess);
  }
  /**
   *
   * @param tokens tokens are in sequence in the document.
   */
  replace(e, t, n, r) {
    const s = t + e, o = [], a = [], l = [{ node: this._root, offset: 0 }];
    for (; l.length > 0; ) {
      const d = l.pop(), h = d.offset;
      if (h < t && h + d.node.length <= t) {
        Zc(d.node) || (d.node.parent = void 0), o.push(d.node);
        continue;
      } else Zc(d.node) && h < t && o.push({ length: t - h, token: d.node.token, height: 0, tokenQuality: d.node.tokenQuality });
      if (!(t <= h && h + d.node.length <= s)) {
        if (h >= s) {
          Zc(d.node) || (d.node.parent = void 0), a.push(d.node);
          continue;
        } else if (Zc(d.node) && h + d.node.length > s) {
          a.push({ length: h + d.node.length - s, token: d.node.token, height: 0, tokenQuality: d.node.tokenQuality });
          continue;
        }
        if (!Zc(d.node)) {
          let g = h + d.node.length;
          for (let m = d.node.children.length - 1; m >= 0; m--)
            g -= d.node.children[m].length, l.push({ node: d.node.children[m], offset: g });
        }
      }
    }
    let c;
    n.length > 0 ? c = o.concat(this.createFromUpdates(n, r), a) : c = o.concat(a);
    let u = c[0];
    for (let d = 1; d < c.length; d++)
      u = Tgt(u, c[d]);
    this._root = u ?? this.createEmptyRoot();
  }
  /**
   *
   * @param startOffsetInclusive
   * @param endOffsetExclusive
   * @param visitor Return true from visitor to exit early
   * @returns
   */
  traverseInOrderInRange(e, t, n) {
    const r = [{ node: this._root, offset: 0 }];
    for (; r.length > 0; ) {
      const { node: s, offset: o } = r.pop();
      if (!(o + s.length <= e || o >= t)) {
        if (n(s, o))
          return;
        if (!Zc(s)) {
          let l = o + s.length;
          for (let c = s.children.length - 1; c >= 0; c--)
            l -= s.children[c].length, r.push({ node: s.children[c], offset: l });
        }
      }
    }
  }
  getTokenAt(e) {
    let t;
    return this.traverseInOrderInRange(e, this._root.length, (n, r) => Zc(n) ? (t = { token: n.token, startOffsetInclusive: r, length: n.length }, !0) : !1), t;
  }
  getTokensInRange(e, t) {
    const n = [];
    return this.traverseInOrderInRange(e, t, (r, s) => {
      if (Zc(r)) {
        let o = r.length, a = s;
        s < e && s + r.length > t ? (a = e, o = t - e) : s < e ? (o -= e - s, a = e) : s + r.length > t && (o -= s + r.length - t), n.push({ token: r.token, startOffsetInclusive: a, length: o });
      }
      return !1;
    }), n;
  }
  markForRefresh(e, t) {
    this.traverseInOrderInRange(e, t, (n) => (Zc(n) && (n.tokenQuality = Ih.None), !1));
  }
  rangeHasTokens(e, t, n) {
    let r = !0;
    return this.traverseInOrderInRange(e, t, (s) => (Zc(s) && s.tokenQuality < n && (r = !1), !1)), r;
  }
  rangeNeedsRefresh(e, t) {
    let n = !1;
    return this.traverseInOrderInRange(e, t, (r) => (Zc(r) && r.tokenQuality !== Ih.Accurate && (n = !0), !1)), n;
  }
  getNeedsRefresh() {
    const e = [];
    return this.traverseInOrderInRange(0, this._textModel.getValueLength(), (t, n) => (Zc(t) && t.tokenQuality !== Ih.Accurate && (e.length > 0 && e[e.length - 1].endOffset === n ? e[e.length - 1].endOffset += t.length : e.push({ startOffset: n, endOffset: n + t.length })), !1)), e;
  }
  dispose() {
    const e = [[this._root, !1]];
    for (; e.length > 0; ) {
      const [t, n] = e.pop();
      if (!Zc(t)) if (n)
        t.dispose(), t.parent = void 0;
      else {
        e.push([t, !0]);
        for (let r = t.children.length - 1; r >= 0; r--)
          e.push([t.children[r], !1]);
      }
    }
    this._root = void 0;
  }
}
const Dgt = Vn("treeSitterThemeService");
var Igt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Ngt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Nre = class extends ge {
  get _textModel() {
    return this._tree.textModel;
  }
  constructor(e, t, n, r, s) {
    super(), this._tree = e, this._highlightingQueries = t, this._languageIdCodec = n, this._visibleLineRanges = r, this._treeSitterThemeService = s, this._onDidChangeTokens = this._register(new he()), this.onDidChangeTokens = this._onDidChangeTokens.event, this._onDidCompleteBackgroundTokenization = this._register(new he()), this.onDidChangeBackgroundTokenization = this._onDidCompleteBackgroundTokenization.event, this._encodedLanguageId = this._languageIdCodec.encodeLanguageId(this._tree.languageId), this._register(rm(this._treeSitterThemeService.onChange, () => {
      this._updateTheme();
    })), this._tokenStore = this._register(new kgt(this._textModel)), this._accurateVersion = this._textModel.getVersionId(), this._guessVersion = this._textModel.getVersionId(), this._tokenStore.buildStore(this._createEmptyTokens(), Ih.None), this._register(Xt((o) => {
      const a = this._visibleLineRanges.read(o);
      this._parseAndTokenizeViewPort(a);
    })), this._register(GA({
      owner: this,
      changeTracker: _it({ tree: this._tree.tree })
    }, (o, a) => {
      var c;
      const l = (c = a.changes.at(0)) == null ? void 0 : c.change;
      if (a.changes.length > 1)
        throw new Wt("The tree changed twice in one transaction. This is currently not supported and should not happen.");
      if (!l)
        a.tree && this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(o));
      else {
        if (this.hasTokens())
          for (const u of l.ranges)
            this._markForRefresh(u.newRange);
        this.hasTokens() ? this._handleTreeUpdate(l.ranges, l.versionId) : this._firstTreeUpdate(l.versionId);
      }
    }));
  }
  handleContentChanged(e) {
    this._guessVersion = e.versionId;
    for (const t of e.changes)
      if (t.text.length > t.rangeLength) {
        const n = t.rangeOffset > 0 ? t.rangeOffset - 1 : t.rangeOffset, r = this._tokenStore.getTokenAt(n);
        let s;
        r ? (s = { startOffsetInclusive: r.startOffsetInclusive, length: r.length + t.text.length - t.rangeLength, token: r.token }, this._tokenStore.markForRefresh(n, t.rangeOffset + (t.text.length > t.rangeLength ? t.text.length : t.rangeLength))) : s = { startOffsetInclusive: n, length: t.text.length, token: 0 }, this._tokenStore.update((r == null ? void 0 : r.length) ?? 0, [s], Ih.EditGuess);
      } else if (t.text.length < t.rangeLength) {
        const n = t.rangeLength - t.text.length;
        this._tokenStore.delete(n, t.rangeOffset);
      }
  }
  getLineTokens(e) {
    const t = this._textModel.getLineContent(e), n = this.getTokens(e);
    return new fo(n, t, this._languageIdCodec);
  }
  _createEmptyTokens() {
    const e = this._emptyToken(), t = this._textModel.getValueLength();
    return [this._emptyTokensForOffsetAndLength(0, t, e)];
  }
  _emptyToken() {
    return this._treeSitterThemeService.findMetadata([], this._encodedLanguageId, !1, void 0);
  }
  _emptyTokensForOffsetAndLength(e, t, n) {
    return { token: n, length: e + t, startOffsetInclusive: 0 };
  }
  hasAccurateTokensForLine(e) {
    return this.hasTokens(new z(e, 1, e, this._textModel.getLineMaxColumn(e)));
  }
  tokenizeLinesAt(e, t) {
    const n = this._guessTokensForLinesContent(e, t), r = [];
    if (!n)
      return null;
    for (let s = 0; s < n.length; s++)
      r.push(new fo(n[s], t[s], this._languageIdCodec));
    return r;
  }
  _rangeHasTokens(e, t) {
    return this._tokenStore.rangeHasTokens(this._textModel.getOffsetAt(e.getStartPosition()), this._textModel.getOffsetAt(e.getEndPosition()), t);
  }
  hasTokens(e) {
    return !e || this._guessVersion === this._accurateVersion ? !0 : !this._tokenStore.rangeNeedsRefresh(this._textModel.getOffsetAt(e.getStartPosition()), this._textModel.getOffsetAt(e.getEndPosition()));
  }
  getTokens(e) {
    const t = this._textModel.getOffsetAt({ lineNumber: e, column: 1 }), n = this._textModel.getOffsetAt({ lineNumber: e, column: this._textModel.getLineLength(e) + 1 }), r = this._tokenStore.getTokensInRange(t, n), s = new Uint32Array(r.length * 2);
    for (let o = 0; o < r.length; o++)
      s[o * 2] = r[o].startOffsetInclusive - t + r[o].length, s[o * 2 + 1] = r[o].token;
    return s;
  }
  getTokensInRange(e, t, n, r) {
    const s = r ? this._tokenizeCapturesWithMetadata(r, t, n) : this._tokenize(e, t, n);
    if (s != null && s.endOffsetsAndMetadata)
      return this._rangeTokensAsUpdates(t, s.endOffsetsAndMetadata);
  }
  _updateTokensInStore(e, t, n) {
    this._accurateVersion = e;
    for (const r of t) {
      const s = r.newTokens.length > 0 ? r.newTokens[r.newTokens.length - 1] : void 0;
      let o;
      s && this._guessVersion >= e ? o = s.startOffsetInclusive + s.length - r.newTokens[0].startOffsetInclusive : r.oldRangeLength ? o = r.oldRangeLength : o = 0, this._tokenStore.update(o, r.newTokens, n);
    }
  }
  _markForRefresh(e) {
    this._tokenStore.markForRefresh(this._textModel.getOffsetAt(e.getStartPosition()), this._textModel.getOffsetAt(e.getEndPosition()));
  }
  _getNeedsRefresh() {
    const e = this._tokenStore.getNeedsRefresh();
    return e ? e.map((t) => ({
      range: z.fromPositions(this._textModel.getPositionAt(t.startOffset), this._textModel.getPositionAt(t.endOffset)),
      startOffset: t.startOffset,
      endOffset: t.endOffset
    })) : [];
  }
  _parseAndTokenizeViewPort(e) {
    const t = e.map((n) => n.toInclusiveRange()).filter(Aa);
    for (const n of t) {
      const r = this._textModel.getOffsetAt(n.getStartPosition()), s = this._textModel.getOffsetAt(n.getEndPosition()), o = this._textModel.getVersionId();
      if (this._rangeHasTokens(n, Ih.ViewportGuess))
        continue;
      const a = this._textModel.getValueInRange(n), l = this._forceParseAndTokenizeContent(n, r, s, a, !0);
      if (!l || this._rangeHasTokens(n, Ih.ViewportGuess) || l.length === 0)
        continue;
      const c = l[l.length - 1], u = c.startOffsetInclusive + c.length - l[0].startOffsetInclusive;
      this._updateTokensInStore(o, [{ newTokens: l, oldRangeLength: u }], Ih.ViewportGuess), this._onDidChangeTokens.fire({ changes: { semanticTokensApplied: !1, ranges: [{ fromLineNumber: n.startLineNumber, toLineNumber: n.endLineNumber }] } });
    }
  }
  _guessTokensForLinesContent(e, t) {
    if (t.length === 0)
      return;
    const n = t.join(this._textModel.getEOL()), r = new z(1, 1, e + t.length, t[t.length - 1].length + 1), s = this._textModel.getOffsetAt({ lineNumber: e, column: 1 }), o = this._forceParseAndTokenizeContent(r, s, s + n.length, n, !1);
    if (!o)
      return;
    const a = new Array(t.length);
    let l = 0, c = 0, u = 0;
    for (let d = 0; d < t.length; d++) {
      const h = [];
      let g = !1;
      for (let m = l; !g && m < o.length; m++) {
        const _ = o[m], v = _.endOffset - u, w = c - u;
        if (v <= t[d].length)
          h.push({ endOffset: v, metadata: _.metadata }), l++;
        else if (w < t[d].length) {
          const E = { endOffset: t[d].length, metadata: _.metadata };
          h.push(E), g = !0;
        } else
          g = !0;
        c = _.endOffset;
      }
      a[d] = this._endOffsetTokensToUint32Array(h), u += t[d].length + this._textModel.getEOL().length;
    }
    return a;
  }
  _forceParseAndTokenizeContent(e, t, n, r, s) {
    const o = l4e(this._textModel, e.startLineNumber).likelyRelevantLines, a = o.join(this._textModel.getEOL()), l = this._tree.createParsedTreeSync(`${a}${r}`);
    if (!l)
      return;
    const c = new z(1, 1, e.endLineNumber - e.startLineNumber + 1 + o.length, e.endColumn), u = this.captureAtRange(c), d = this._tokenizeCapturesWithMetadata(u, a.length, n - t + a.length);
    if (l.delete(), !!d)
      return s ? this._rangeTokensAsUpdates(t, d.endOffsetsAndMetadata, a.length) : d.endOffsetsAndMetadata;
  }
  _firstTreeUpdate(e) {
    return this._setViewPortTokens(e);
  }
  _setViewPortTokens(e) {
    const t = this._visibleLineRanges.get().map((n) => {
      const r = n.toInclusiveRange();
      if (!r)
        return;
      const s = this._textModel.getOffsetAt(r.getStartPosition()), o = this._textModel.getOffsetAt(r.getEndPosition());
      return {
        newRange: r,
        newRangeEndOffset: o,
        newRangeStartOffset: s
      };
    }).filter(Aa);
    return this._handleTreeUpdate(t, e);
  }
  /**
   * Do not await in this method, it will cause a race
   */
  _handleTreeUpdate(e, t) {
    const n = [];
    for (let o = 0; o < e.length; o++)
      if (e[o].newRange.endLineNumber - e[o].newRange.startLineNumber > 1e3) {
        const l = e[o].newRange.endLineNumber;
        let c = e[o].newRange.startLineNumber, u = e[o].newRange.startColumn, d = c + 1e3;
        do {
          const h = new de(c, u), g = d === e[o].newRange.endLineNumber ? e[o].newRange.endColumn : this._textModel.getLineMaxColumn(d), m = new de(d, g), _ = z.fromPositions(h, m);
          n.push({
            range: _,
            startOffset: this._textModel.getOffsetAt(_.getStartPosition()),
            endOffset: this._textModel.getOffsetAt(_.getEndPosition())
          }), c = d + 1, u = 1, d < l && d + 1e3 > l ? d = l : d = d + 1e3;
        } while (d <= l);
      } else if (o === 0 || n[o - 1].endOffset < e[o].newRangeStartOffset)
        n.push({
          range: e[o].newRange,
          startOffset: e[o].newRangeStartOffset,
          endOffset: e[o].newRangeEndOffset
        });
      else if (n[o - 1].endOffset < e[o].newRangeEndOffset) {
        const l = this._textModel.getPositionAt(n[o - 1].endOffset + 1), c = new z(l.lineNumber, l.column, e[o].newRange.endLineNumber, e[o].newRange.endColumn);
        n.push({
          range: c,
          startOffset: n[o - 1].endOffset + 1,
          endOffset: e[o].newRangeEndOffset
        });
      }
    const s = n.map((o) => this._getCaptures(o.range));
    return this._updateTreeForRanges(n, t, s).then(() => {
      !this._textModel.isDisposed() && this._tree.treeLastParsedVersion.get() === this._textModel.getVersionId() && this._refreshNeedsRefresh(t);
    });
  }
  async _updateTreeForRanges(e, t, n) {
    let r;
    for (let s = 0; s < e.length && !(!this._textModel.isDisposed() && t !== this._textModel.getVersionId()); s++) {
      const o = n[s], a = e[s], l = this.getTokensInRange(a.range, a.startOffset, a.endOffset, o);
      l ? r = { newTokens: l } : r = { newTokens: [] }, this._updateTokensInStore(t, [r], Ih.Accurate), this._onDidChangeTokens.fire({
        changes: {
          semanticTokensApplied: !1,
          ranges: [{ fromLineNumber: a.range.getStartPosition().lineNumber, toLineNumber: a.range.getEndPosition().lineNumber }]
        }
      }), await new Promise((c) => gq(c));
    }
    this._onDidCompleteBackgroundTokenization.fire();
  }
  _refreshNeedsRefresh(e) {
    const t = this._getNeedsRefresh();
    if (t.length === 0)
      return;
    const n = new Array(t.length);
    for (let r = 0; r < t.length; r++) {
      const s = t[r];
      n[r] = {
        newRange: s.range,
        newRangeStartOffset: s.startOffset,
        newRangeEndOffset: s.endOffset
      };
    }
    this._handleTreeUpdate(n, e);
  }
  _rangeTokensAsUpdates(e, t, n) {
    const r = [];
    let s = 0;
    for (const o of t) {
      if (o.endOffset <= s || n && o.endOffset < n)
        continue;
      let a;
      n && s < n ? a = { startOffsetInclusive: e + n, length: o.endOffset - n, token: o.metadata } : a = { startOffsetInclusive: e + s, length: o.endOffset - s, token: o.metadata }, r.push(a), s = o.endOffset;
    }
    return r;
  }
  _updateTheme() {
    const e = this._textModel.getFullModelRange();
    this._markForRefresh(e), this._parseAndTokenizeViewPort(this._visibleLineRanges.get());
  }
  captureAtRange(e) {
    const t = this._tree.tree.get();
    return t ? this._highlightingQueries.captures(t.rootNode, { startPosition: { row: e.startLineNumber - 1, column: e.startColumn - 1 }, endPosition: { row: e.endLineNumber - 1, column: e.endColumn - 1 } }).map((n) => ({
      name: n.name,
      text: n.node.text,
      node: {
        startIndex: n.node.startIndex,
        endIndex: n.node.endIndex,
        startPosition: {
          lineNumber: n.node.startPosition.row + 1,
          column: n.node.startPosition.column + 1
        },
        endPosition: {
          lineNumber: n.node.endPosition.row + 1,
          column: n.node.endPosition.column + 1
        }
      },
      encodedLanguageId: this._encodedLanguageId
    })) : [];
  }
  captureAtRangeWithInjections(e) {
    const t = this.captureAtRange(e);
    for (let n = 0; n < t.length; n++) {
      const r = t[n], s = r.node.startPosition.lineNumber, o = r.node.endPosition.lineNumber, a = r.node.startPosition.column, l = r.node.endPosition.column, c = s > e.startLineNumber && s < e.endLineNumber ? s : e.startLineNumber, u = o > e.startLineNumber && o < e.endLineNumber ? o : e.endLineNumber, d = s === e.startLineNumber ? a < e.startColumn ? e.startColumn : a : s < e.startLineNumber ? e.startColumn : a, h = o === e.endLineNumber ? l > e.endColumn ? e.endColumn : l : o > e.endLineNumber ? e.endColumn : l, g = new z(c, d, u, h), m = this._getInjectionCaptures(r, g);
      m && m.length > 0 && (t.splice(n + 1, 0, ...m), n += m.length);
    }
    return t;
  }
  /**
   * Gets the tokens for a given line.
   * Each token takes 2 elements in the array. The first element is the offset of the end of the token *in the line, not in the document*, and the second element is the metadata.
   *
   * @param lineNumber
   * @returns
   */
  tokenizeEncoded(e) {
    const t = this._tokenizeEncoded(e);
    if (!t)
      return;
    const n = this._rangeTokensAsUpdates(this._textModel.getOffsetAt({ lineNumber: e, column: 1 }), t.result);
    t.versionId === this._textModel.getVersionId() && this._updateTokensInStore(t.versionId, [{ newTokens: n, oldRangeLength: this._textModel.getLineLength(e) }], Ih.Accurate);
  }
  _getCaptures(e) {
    return this.captureAtRangeWithInjections(e);
  }
  _tokenize(e, t, n) {
    const r = this._getCaptures(e), s = this._tokenizeCapturesWithMetadata(r, t, n);
    if (s)
      return { ...s, versionId: this._tree.treeLastParsedVersion.get() };
  }
  _createTokensFromCaptures(e, t, n) {
    const r = this._tree.tree.get(), s = _a.create(), o = n - t, a = this._languageIdCodec.encodeLanguageId(this._tree.languageId), l = Rgt[this._tree.languageId] || "source";
    if (e.length === 0)
      return r ? (s.stop(), { endOffsets: [{ endOffset: o, scopes: [], encodedLanguageId: a }], captureTime: s.elapsed() }) : void 0;
    const c = Array(e.length);
    c.fill({ endOffset: 0, scopes: [l], encodedLanguageId: a });
    let u = 0;
    const d = () => {
      c.push({ endOffset: 0, scopes: [l], encodedLanguageId: a });
    }, h = (_, v) => _.name.includes("punctuation") && _.text ? Array.from(_.text.matchAll(Agt)).map((w) => v + w.index) : void 0, g = (_, v, w, E) => {
      if (E !== void 0) {
        const L = c[E].scopes;
        let T = c[E].bracket;
        if ((E > 0 ? c[E - 1].endOffset : 0) !== v) {
          let N;
          if (T && T.length > 0) {
            N = [];
            const R = [];
            for (let M = 0; M < T.length; M++) {
              const B = T[M];
              B < v ? N.push(B) : B > w && R.push(B);
            }
            N.length === 0 && (N = void 0), R.length === 0 ? T = void 0 : T = R;
          }
          c.splice(E, 0, { endOffset: v, scopes: [...L], bracket: N, encodedLanguageId: _.encodedLanguageId }), E++, d(), u++;
        }
        c.splice(E, 0, { endOffset: w, scopes: [...L, _.name], bracket: h(_, v), encodedLanguageId: _.encodedLanguageId }), c[u].bracket = T;
      } else
        c[u] = { endOffset: w, scopes: [l, _.name], bracket: h(_, v), encodedLanguageId: _.encodedLanguageId };
      u++;
    };
    for (let _ = 0; _ < e.length; _++) {
      const v = e[_], w = v.node.endIndex < n ? v.node.endIndex < t ? t : v.node.endIndex : n, E = v.node.startIndex < t ? t : v.node.startIndex, L = w - t;
      let T;
      const D = w - E;
      _ > 0 ? T = c[u - 1].endOffset : T = E - t - 1;
      const N = L - D;
      if (T >= 0 && T < N && (c[u] = { endOffset: N, scopes: [l], encodedLanguageId: this._encodedLanguageId }, u++, d()), !(D < 0))
        if (T >= L) {
          let R = u - 1, M = c[R].endOffset, B = R >= 2 ? c[R - 1].endOffset : 0;
          do {
            if (B + D === M) {
              if (B === N) {
                c[R].scopes.push(v.name);
                const H = c[R].bracket;
                c[R].bracket = H && H.length > 0 ? H : h(v, N);
              }
            } else if (B <= N) {
              g(v, N, L, R);
              break;
            }
            R--, B = R >= 1 ? c[R - 1].endOffset : 0, M = R >= 0 ? c[R].endOffset : 0;
          } while (M > N);
        } else
          g(v, N, L);
    }
    c[u - 1].endOffset < o && o - c[u - 1].endOffset > 0 && (d(), c[u] = { endOffset: o, scopes: c[u].scopes, encodedLanguageId: this._encodedLanguageId }, u++);
    for (let _ = 0; _ < c.length; _++)
      if (c[_].endOffset === 0 && _ !== 0) {
        c.splice(_, c.length - _);
        break;
      }
    const m = s.elapsed();
    return { endOffsets: c, captureTime: m };
  }
  _getInjectionCaptures(e, t) {
    return [];
  }
  _tokenizeCapturesWithMetadata(e, t, n) {
    const r = _a.create(), s = this._createTokensFromCaptures(e, t, n);
    if (!s)
      return;
    const o = s.endOffsets;
    for (let l = 0; l < o.length; l++) {
      const c = o[l];
      c.metadata = this._treeSitterThemeService.findMetadata(c.scopes, c.encodedLanguageId, !!c.bracket && c.bracket.length > 0, void 0);
    }
    const a = r.elapsed();
    return { endOffsetsAndMetadata: o, captureTime: s.captureTime, metadataTime: a };
  }
  _tokenizeEncoded(e) {
    const t = this._textModel.getOffsetAt({ lineNumber: e, column: 1 }), n = this._textModel.getLineCount(), r = e + 1 <= n ? this._textModel.getOffsetAt({ lineNumber: e + 1, column: 1 }) : this._textModel.getValueLength(), s = r - t, o = this._tokenize(new z(e, 1, e, s + 1), t, r);
    if (o)
      return { result: o.endOffsetsAndMetadata, captureTime: o.captureTime, metadataTime: o.metadataTime, versionId: o.versionId };
  }
  _endOffsetTokensToUint32Array(e) {
    const t = new Uint32Array(e.length * 2);
    for (let n = 0; n < e.length; n++)
      t[n * 2] = e[n].endOffset, t[n * 2 + 1] = e[n].metadata;
    return t;
  }
};
Nre = Igt([
  Ngt(4, Dgt)
], Nre);
const Rgt = {
  css: "source.css",
  typescript: "source.ts",
  ini: "source.ini",
  regex: "source.regex"
}, Agt = /[\{\}\[\]\<\>\(\)]/g, tge = Vn("treeSitterLibraryService");
var Ogt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, LTe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Rre = class extends o4e {
  constructor(e, t, n, r, s, o) {
    super(t, n), this._languageIdObs = e, this._treeSitterLibraryService = s, this._instantiationService = o, this._backgroundTokenizationState = 1, this._onDidChangeBackgroundTokenizationState = this._register(new he()), this.onDidChangeBackgroundTokenizationState = this._onDidChangeBackgroundTokenizationState.event;
    const a = new pit(this._treeSitterLibraryService.getParserClass()), l = Ie(this, (c) => {
      var d, h;
      return (h = (d = a.promiseResult) == null ? void 0 : d.read(c)) == null ? void 0 : h.getDataOrThrow();
    });
    this._tree = Ie(this, (c) => {
      const u = l.read(c);
      if (!u)
        return;
      const d = this._languageIdObs.read(c), h = this._treeSitterLibraryService.getLanguage(d, c);
      if (!h)
        return;
      const g = new u();
      if (c.store.add(Et(() => {
        g.delete();
      })), g.setLanguage(h), this._treeSitterLibraryService.getInjectionQueries(d, c) !== void 0)
        return c.store.add(this._instantiationService.createInstance(
          kre,
          d,
          void 0,
          g,
          u,
          /*queries, */
          this._textModel
        ));
    }), this._tokenizationImpl = Ie(this, (c) => {
      const u = this._tree.read(c);
      if (!u)
        return;
      const d = this._treeSitterLibraryService.getHighlightingQueries(u.languageId, c);
      if (d)
        return c.store.add(this._instantiationService.createInstance(Nre, u, d, this._languageIdCodec, r));
    }), this._register(Xt((c) => {
      const u = this._tokenizationImpl.read(c);
      u && (c.store.add(u.onDidChangeTokens((d) => {
        this._onDidChangeTokens.fire(d.changes);
      })), c.store.add(u.onDidChangeBackgroundTokenization((d) => {
        this._backgroundTokenizationState = 2, this._onDidChangeBackgroundTokenizationState.fire();
      })));
    }));
  }
  getLineTokens(e) {
    const t = this._tokenizationImpl.get();
    if (!t) {
      const n = this._textModel.getLineContent(e);
      return fo.createEmpty(n, this._languageIdCodec);
    }
    return t.getLineTokens(e);
  }
  todo_resetTokenization(e = !0) {
    e && this._onDidChangeTokens.fire({
      semanticTokensApplied: !1,
      ranges: [
        {
          fromLineNumber: 1,
          toLineNumber: this._textModel.getLineCount()
        }
      ]
    });
  }
  handleDidChangeAttached() {
  }
  handleDidChangeContent(e) {
    if (e.isFlush)
      this.todo_resetTokenization(!1);
    else {
      const n = this._tokenizationImpl.get();
      n == null || n.handleContentChanged(e);
    }
    const t = this._tree.get();
    t == null || t.handleContentChange(e);
  }
  forceTokenization(e) {
    const t = this._tokenizationImpl.get();
    t && (t.hasAccurateTokensForLine(e) || t.tokenizeEncoded(e));
  }
  hasAccurateTokensForLine(e) {
    const t = this._tokenizationImpl.get();
    return t ? t.hasAccurateTokensForLine(e) : !1;
  }
  isCheapToTokenize(e) {
    return !0;
  }
  getTokenTypeIfInsertingCharacter(e, t, n) {
    return 0;
  }
  tokenizeLinesAt(e, t) {
    const n = this._tokenizationImpl.get();
    return n ? n.tokenizeLinesAt(e, t) : null;
  }
  get hasTokens() {
    const e = this._tokenizationImpl.get();
    return e ? e.hasTokens() : !1;
  }
};
Rre = Ogt([
  LTe(4, tge),
  LTe(5, xt)
], Rre);
class nge {
  constructor(e) {
    this._pieces = [], this._isComplete = !1, this._languageIdCodec = e;
  }
  flush() {
    this._pieces = [], this._isComplete = !1;
  }
  isEmpty() {
    return this._pieces.length === 0;
  }
  set(e, t, n = void 0) {
    if (this._pieces = e || [], this._isComplete = t, n)
      for (const r of this._pieces)
        r.reportIfInvalid(n);
  }
  setPartial(e, t) {
    let n = e;
    if (t.length > 0) {
      const s = t[0].getRange(), o = t[t.length - 1].getRange();
      if (!s || !o)
        return e;
      n = e.plusRange(s).plusRange(o);
    }
    let r = null;
    for (let s = 0, o = this._pieces.length; s < o; s++) {
      const a = this._pieces[s];
      if (a.endLineNumber < n.startLineNumber)
        continue;
      if (a.startLineNumber > n.endLineNumber) {
        r = r || { index: s };
        break;
      }
      if (a.removeTokens(n), a.isEmpty()) {
        this._pieces.splice(s, 1), s--, o--;
        continue;
      }
      if (a.endLineNumber < n.startLineNumber)
        continue;
      if (a.startLineNumber > n.endLineNumber) {
        r = r || { index: s };
        continue;
      }
      const [l, c] = a.split(n);
      if (l.isEmpty()) {
        r = r || { index: s };
        continue;
      }
      c.isEmpty() || (this._pieces.splice(s, 1, l, c), s++, o++, r = r || { index: s });
    }
    return r = r || { index: this._pieces.length }, t.length > 0 && (this._pieces = bq(this._pieces, r.index, t)), n;
  }
  isComplete() {
    return this._isComplete;
  }
  addSparseTokens(e, t) {
    if (t.getTextLength() === 0)
      return t;
    const n = this._pieces;
    if (n.length === 0)
      return t;
    const r = nge._findFirstPieceWithLine(n, e), s = n[r].getLineTokens(e);
    if (!s)
      return t;
    const o = t.getCount(), a = s.getCount();
    let l = 0;
    const c = [];
    let u = 0, d = 0;
    const h = (g, m) => {
      g !== d && (d = g, c[u++] = g, c[u++] = m);
    };
    for (let g = 0; g < a; g++) {
      const m = Math.min(s.getStartCharacter(g), t.getTextLength()), _ = Math.min(s.getEndCharacter(g), t.getTextLength()), v = s.getMetadata(g), w = ((v & 1 ? 2048 : 0) | (v & 2 ? 4096 : 0) | (v & 4 ? 8192 : 0) | (v & 8 ? 16384 : 0) | (v & 16 ? 16744448 : 0) | (v & 32 ? 4278190080 : 0)) >>> 0, E = ~w >>> 0;
      for (; l < o && t.getEndOffset(l) <= m; )
        h(t.getEndOffset(l), t.getMetadata(l)), l++;
      for (l < o && t.getStartOffset(l) < m && h(m, t.getMetadata(l)); l < o && t.getEndOffset(l) < _; )
        h(t.getEndOffset(l), t.getMetadata(l) & E | v & w), l++;
      if (l < o)
        h(_, t.getMetadata(l) & E | v & w), t.getEndOffset(l) === _ && l++;
      else {
        const L = Math.min(Math.max(0, l - 1), o - 1);
        h(_, t.getMetadata(L) & E | v & w);
      }
    }
    for (; l < o; )
      h(t.getEndOffset(l), t.getMetadata(l)), l++;
    return new fo(new Uint32Array(c), t.getLineContent(), this._languageIdCodec);
  }
  static _findFirstPieceWithLine(e, t) {
    let n = 0, r = e.length - 1;
    for (; n < r; ) {
      let s = n + Math.floor((r - n) / 2);
      if (e[s].endLineNumber < t)
        n = s + 1;
      else if (e[s].startLineNumber > t)
        r = s - 1;
      else {
        for (; s > n && e[s - 1].startLineNumber <= t && t <= e[s - 1].endLineNumber; )
          s--;
        return s;
      }
    }
    return n;
  }
  acceptEdit(e, t, n, r, s) {
    for (const o of this._pieces)
      o.acceptEdit(e, t, n, r, s);
  }
}
const Yv = new Uint32Array(0).buffer;
class P_ {
  static deleteBeginning(e, t) {
    return e === null || e === Yv ? e : P_.delete(e, 0, t);
  }
  static deleteEnding(e, t) {
    if (e === null || e === Yv)
      return e;
    const n = hy(e), r = n[n.length - 2];
    return P_.delete(e, t, r);
  }
  static delete(e, t, n) {
    if (e === null || e === Yv || t === n)
      return e;
    const r = hy(e), s = r.length >>> 1;
    if (t === 0 && r[r.length - 2] === n)
      return Yv;
    const o = fo.findIndexInTokensArray(r, t), a = o > 0 ? r[o - 1 << 1] : 0, l = r[o << 1];
    if (n < l) {
      const g = n - t;
      for (let m = o; m < s; m++)
        r[m << 1] -= g;
      return e;
    }
    let c, u;
    a !== t ? (r[o << 1] = t, c = o + 1 << 1, u = t) : (c = o << 1, u = a);
    const d = n - t;
    for (let g = o + 1; g < s; g++) {
      const m = r[g << 1] - d;
      m > u && (r[c++] = m, r[c++] = r[(g << 1) + 1], u = m);
    }
    if (c === r.length)
      return e;
    const h = new Uint32Array(c);
    return h.set(r.subarray(0, c), 0), h.buffer;
  }
  static append(e, t) {
    if (t === Yv)
      return e;
    if (e === Yv)
      return t;
    if (e === null)
      return e;
    if (t === null)
      return null;
    const n = hy(e), r = hy(t), s = r.length >>> 1, o = new Uint32Array(n.length + r.length);
    o.set(n, 0);
    let a = n.length;
    const l = n[n.length - 2];
    for (let c = 0; c < s; c++)
      o[a++] = r[c << 1] + l, o[a++] = r[(c << 1) + 1];
    return o.buffer;
  }
  static insert(e, t, n) {
    if (e === null || e === Yv)
      return e;
    const r = hy(e), s = r.length >>> 1;
    let o = fo.findIndexInTokensArray(r, t);
    o > 0 && r[o - 1 << 1] === t && o--;
    for (let a = o; a < s; a++)
      r[a << 1] += n;
    return e;
  }
}
function hy(i) {
  return i instanceof Uint32Array ? i : new Uint32Array(i);
}
class F4 {
  constructor(e) {
    this._lineTokens = [], this._len = 0, this._languageIdCodec = e;
  }
  flush() {
    this._lineTokens = [], this._len = 0;
  }
  get hasTokens() {
    return this._lineTokens.length > 0;
  }
  getTokens(e, t, n) {
    let r = null;
    if (t < this._len && (r = this._lineTokens[t]), r !== null && r !== Yv)
      return new fo(hy(r), n, this._languageIdCodec);
    const s = new Uint32Array(2);
    return s[0] = n.length, s[1] = TTe(this._languageIdCodec.encodeLanguageId(e)), new fo(s, n, this._languageIdCodec);
  }
  static _massageTokens(e, t, n) {
    const r = n ? hy(n) : null;
    if (t === 0) {
      let s = !1;
      if (r && r.length > 1 && (s = jl.getLanguageId(r[1]) !== e), !s)
        return Yv;
    }
    if (!r || r.length === 0) {
      const s = new Uint32Array(2);
      return s[0] = t, s[1] = TTe(e), s.buffer;
    }
    return r[r.length - 2] = t, r.byteOffset === 0 && r.byteLength === r.buffer.byteLength ? r.buffer : r;
  }
  _ensureLine(e) {
    for (; e >= this._len; )
      this._lineTokens[this._len] = null, this._len++;
  }
  _deleteLines(e, t) {
    t !== 0 && (e + t > this._len && (t = this._len - e), this._lineTokens.splice(e, t), this._len -= t);
  }
  _insertLines(e, t) {
    if (t === 0)
      return;
    const n = [];
    for (let r = 0; r < t; r++)
      n[r] = null;
    this._lineTokens = bq(this._lineTokens, e, n), this._len += t;
  }
  setTokens(e, t, n, r, s) {
    const o = F4._massageTokens(this._languageIdCodec.encodeLanguageId(e), n, r);
    this._ensureLine(t);
    const a = this._lineTokens[t];
    return this._lineTokens[t] = o, s ? !F4._equals(a, o) : !1;
  }
  static _equals(e, t) {
    if (!e || !t)
      return !e && !t;
    const n = hy(e), r = hy(t);
    if (n.length !== r.length)
      return !1;
    for (let s = 0, o = n.length; s < o; s++)
      if (n[s] !== r[s])
        return !1;
    return !0;
  }
  //#region Editing
  acceptEdit(e, t, n) {
    this._acceptDeleteRange(e), this._acceptInsertText(new de(e.startLineNumber, e.startColumn), t, n);
  }
  _acceptDeleteRange(e) {
    const t = e.startLineNumber - 1;
    if (t >= this._len)
      return;
    if (e.startLineNumber === e.endLineNumber) {
      if (e.startColumn === e.endColumn)
        return;
      this._lineTokens[t] = P_.delete(this._lineTokens[t], e.startColumn - 1, e.endColumn - 1);
      return;
    }
    this._lineTokens[t] = P_.deleteEnding(this._lineTokens[t], e.startColumn - 1);
    const n = e.endLineNumber - 1;
    let r = null;
    n < this._len && (r = P_.deleteBeginning(this._lineTokens[n], e.endColumn - 1)), this._lineTokens[t] = P_.append(this._lineTokens[t], r), this._deleteLines(e.startLineNumber, e.endLineNumber - e.startLineNumber);
  }
  _acceptInsertText(e, t, n) {
    if (t === 0 && n === 0)
      return;
    const r = e.lineNumber - 1;
    if (!(r >= this._len)) {
      if (t === 0) {
        this._lineTokens[r] = P_.insert(this._lineTokens[r], e.column - 1, n);
        return;
      }
      this._lineTokens[r] = P_.deleteEnding(this._lineTokens[r], e.column - 1), this._lineTokens[r] = P_.insert(this._lineTokens[r], e.column - 1, n), this._insertLines(e.lineNumber, t);
    }
  }
  //#endregion
  setMultilineTokens(e, t) {
    if (e.length === 0)
      return { changes: [] };
    const n = [];
    for (let r = 0, s = e.length; r < s; r++) {
      const o = e[r];
      let a = 0, l = 0, c = !1;
      for (let u = o.startLineNumber; u <= o.endLineNumber; u++)
        c ? (this.setTokens(t.getLanguageId(), u - 1, t.getLineLength(u), o.getLineTokens(u), !1), l = u) : this.setTokens(t.getLanguageId(), u - 1, t.getLineLength(u), o.getLineTokens(u), !0) && (c = !0, a = u, l = u);
      c && n.push({ fromLineNumber: a, toLineNumber: l });
    }
    return { changes: n };
  }
}
function TTe(i) {
  return (i << 0 | 0 | 0 | 32768 | 2 << 24 | 1024) >>> 0;
}
class Mgt extends o4e {
  constructor(e, t, n, r) {
    super(e, t), this.getLanguageId = n, this._tokenizer = null, this._backgroundTokenizationState = 1, this._onDidChangeBackgroundTokenizationState = this._register(new he()), this.onDidChangeBackgroundTokenizationState = this._onDidChangeBackgroundTokenizationState.event, this._defaultBackgroundTokenizer = null, this._backgroundTokenizer = this._register(new er()), this._tokens = new F4(this._languageIdCodec), this._debugBackgroundTokenizer = this._register(new er()), this._attachedViewStates = this._register(new pq()), this._register(Ys.onDidChange((s) => {
      const o = this.getLanguageId();
      s.changedLanguages.indexOf(o) !== -1 && this.todo_resetTokenization();
    })), this.todo_resetTokenization(), this._register(r.onDidChangeVisibleRanges(({ view: s, state: o }) => {
      if (o) {
        let a = this._attachedViewStates.get(s);
        a || (a = new dgt(() => this.refreshRanges(a.lineRanges)), this._attachedViewStates.set(s, a)), a.handleStateChange(o);
      } else
        this._attachedViewStates.deleteAndDispose(s);
    }));
  }
  todo_resetTokenization(e = !0) {
    var s;
    this._tokens.flush(), (s = this._debugBackgroundTokens) == null || s.flush(), this._debugBackgroundStates && (this._debugBackgroundStates = new Ire(this._textModel.getLineCount())), e && this._onDidChangeTokens.fire({
      semanticTokensApplied: !1,
      ranges: [
        {
          fromLineNumber: 1,
          toLineNumber: this._textModel.getLineCount()
        }
      ]
    });
    const t = () => {
      if (this._textModel.isTooLargeForTokenization())
        return [null, null];
      const o = Ys.get(this.getLanguageId());
      if (!o)
        return [null, null];
      let a;
      try {
        a = o.getInitialState();
      } catch (l) {
        return fn(l), [null, null];
      }
      return [o, a];
    }, [n, r] = t();
    if (n && r ? this._tokenizer = new wgt(this._textModel.getLineCount(), n, this._textModel, this._languageIdCodec) : this._tokenizer = null, this._backgroundTokenizer.clear(), this._defaultBackgroundTokenizer = null, this._tokenizer) {
      const o = {
        setTokens: (a) => {
          this.setTokens(a);
        },
        backgroundTokenizationFinished: () => {
          if (this._backgroundTokenizationState === 2)
            return;
          const a = 2;
          this._backgroundTokenizationState = a, this._onDidChangeBackgroundTokenizationState.fire();
        },
        setEndState: (a, l) => {
          var u;
          if (!this._tokenizer)
            return;
          const c = this._tokenizer.store.getFirstInvalidEndStateLineNumber();
          c !== null && a >= c && ((u = this._tokenizer) == null || u.store.setEndState(a, l));
        }
      };
      n && n.createBackgroundTokenizer && !n.backgroundTokenizerShouldOnlyVerifyTokens && (this._backgroundTokenizer.value = n.createBackgroundTokenizer(this._textModel, o)), !this._backgroundTokenizer.value && !this._textModel.isTooLargeForTokenization() && (this._backgroundTokenizer.value = this._defaultBackgroundTokenizer = new xgt(this._tokenizer, o), this._defaultBackgroundTokenizer.handleChanges()), n != null && n.backgroundTokenizerShouldOnlyVerifyTokens && n.createBackgroundTokenizer ? (this._debugBackgroundTokens = new F4(this._languageIdCodec), this._debugBackgroundStates = new Ire(this._textModel.getLineCount()), this._debugBackgroundTokenizer.clear(), this._debugBackgroundTokenizer.value = n.createBackgroundTokenizer(this._textModel, {
        setTokens: (a) => {
          var l;
          (l = this._debugBackgroundTokens) == null || l.setMultilineTokens(a, this._textModel);
        },
        backgroundTokenizationFinished() {
        },
        setEndState: (a, l) => {
          var c;
          (c = this._debugBackgroundStates) == null || c.setEndState(a, l);
        }
      })) : (this._debugBackgroundTokens = void 0, this._debugBackgroundStates = void 0, this._debugBackgroundTokenizer.value = void 0);
    }
    this.refreshAllVisibleLineTokens();
  }
  handleDidChangeAttached() {
    var e;
    (e = this._defaultBackgroundTokenizer) == null || e.handleChanges();
  }
  handleDidChangeContent(e) {
    var t, n, r;
    if (e.isFlush)
      this.todo_resetTokenization(!1);
    else if (!e.isEolChange) {
      for (const s of e.changes) {
        const [o, a] = lw(s.text);
        this._tokens.acceptEdit(s.range, o, a), (t = this._debugBackgroundTokens) == null || t.acceptEdit(s.range, o, a);
      }
      (n = this._debugBackgroundStates) == null || n.acceptChanges(e.changes), this._tokenizer && this._tokenizer.store.acceptChanges(e.changes), (r = this._defaultBackgroundTokenizer) == null || r.handleChanges();
    }
  }
  setTokens(e) {
    const { changes: t } = this._tokens.setMultilineTokens(e, this._textModel);
    return t.length > 0 && this._onDidChangeTokens.fire({ semanticTokensApplied: !1, ranges: t }), { changes: t };
  }
  refreshAllVisibleLineTokens() {
    const e = Zt.joinMany([...this._attachedViewStates].map(([t, n]) => n.lineRanges));
    this.refreshRanges(e);
  }
  refreshRanges(e) {
    for (const t of e)
      this.refreshRange(t.startLineNumber, t.endLineNumberExclusive - 1);
  }
  refreshRange(e, t) {
    var o, a;
    if (!this._tokenizer)
      return;
    e = Math.max(1, Math.min(this._textModel.getLineCount(), e)), t = Math.min(this._textModel.getLineCount(), t);
    const n = new Dre(), { heuristicTokens: r } = this._tokenizer.tokenizeHeuristically(n, e, t), s = this.setTokens(n.finalize());
    if (r)
      for (const l of s.changes)
        (o = this._backgroundTokenizer.value) == null || o.requestTokens(l.fromLineNumber, l.toLineNumber + 1);
    (a = this._defaultBackgroundTokenizer) == null || a.checkFinished();
  }
  forceTokenization(e) {
    var n, r;
    const t = new Dre();
    (n = this._tokenizer) == null || n.updateTokensUntilLine(t, e), this.setTokens(t.finalize()), (r = this._defaultBackgroundTokenizer) == null || r.checkFinished();
  }
  hasAccurateTokensForLine(e) {
    return this._tokenizer ? this._tokenizer.hasAccurateTokensForLine(e) : !0;
  }
  isCheapToTokenize(e) {
    return this._tokenizer ? this._tokenizer.isCheapToTokenize(e) : !0;
  }
  getLineTokens(e) {
    var r;
    const t = this._textModel.getLineContent(e), n = this._tokens.getTokens(this._textModel.getLanguageId(), e - 1, t);
    if (this._debugBackgroundTokens && this._debugBackgroundStates && this._tokenizer && this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax() > e && this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax() > e) {
      const s = this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(), e - 1, t);
      !n.equals(s) && ((r = this._debugBackgroundTokenizer.value) != null && r.reportMismatchingTokens) && this._debugBackgroundTokenizer.value.reportMismatchingTokens(e);
    }
    return n;
  }
  getTokenTypeIfInsertingCharacter(e, t, n) {
    if (!this._tokenizer)
      return 0;
    const r = this._textModel.validatePosition(new de(e, t));
    return this.forceTokenization(r.lineNumber), this._tokenizer.getTokenTypeIfInsertingCharacter(r, n);
  }
  tokenizeLinesAt(e, t) {
    return this._tokenizer ? (this.forceTokenization(e), this._tokenizer.tokenizeLinesAt(e, t)) : null;
  }
  get hasTokens() {
    return this._tokens.hasTokens;
  }
}
var Pgt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, q7 = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, NW;
let Are = NW = class extends E3e {
  constructor(e, t, n, r, s, o, a, l) {
    super(), this._textModel = e, this._bracketPairsTextModelPart = t, this._languageId = n, this._attachedViews = r, this._languageService = s, this._languageConfigurationService = o, this._instantiationService = a, this._treeSitterLibraryService = l, this._languageIdObs = Qt(this, this._languageId), this._useTreeSitter = Ie(this, (u) => {
      const d = this._languageIdObs.read(u);
      return this._treeSitterLibraryService.supportsLanguage(d, u);
    }), this.tokens = Ie(this, (u) => {
      let d;
      return this._useTreeSitter.read(u) ? d = u.store.add(this._instantiationService.createInstance(Rre, this._languageIdObs, this._languageService.languageIdCodec, this._textModel, this._attachedViews.visibleLineRanges)) : d = u.store.add(new Mgt(this._languageService.languageIdCodec, this._textModel, () => this._languageId, this._attachedViews)), u.store.add(d.onDidChangeTokens((h) => {
        this._emitModelTokensChangedEvent(h);
      })), u.store.add(d.onDidChangeBackgroundTokenizationState((h) => {
        this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState();
      })), d;
    });
    let c = !1;
    this.tokens.recomputeInitiallyAndOnChange(this._store, (u) => {
      c && u.todo_resetTokenization(), c = !0;
    }), this._semanticTokens = new nge(this._languageService.languageIdCodec), this._onDidChangeLanguage = this._register(new he()), this.onDidChangeLanguage = this._onDidChangeLanguage.event, this._onDidChangeLanguageConfiguration = this._register(new he()), this.onDidChangeLanguageConfiguration = this._onDidChangeLanguageConfiguration.event, this._onDidChangeTokens = this._register(new he()), this.onDidChangeTokens = this._onDidChangeTokens.event;
  }
  handleLanguageConfigurationServiceChange(e) {
    e.affects(this._languageId) && this._onDidChangeLanguageConfiguration.fire({});
  }
  handleDidChangeContent(e) {
    if (e.isFlush)
      this._semanticTokens.flush();
    else if (!e.isEolChange)
      for (const t of e.changes) {
        const [n, r, s] = lw(t.text);
        this._semanticTokens.acceptEdit(
          t.range,
          n,
          r,
          s,
          t.text.length > 0 ? t.text.charCodeAt(0) : 0
          /* CharCode.Null */
        );
      }
    this.tokens.get().handleDidChangeContent(e);
  }
  handleDidChangeAttached() {
    this.tokens.get().handleDidChangeAttached();
  }
  /**
   * Includes grammar and semantic tokens.
   */
  getLineTokens(e) {
    this.validateLineNumber(e);
    const t = this.tokens.get().getLineTokens(e);
    return this._semanticTokens.addSparseTokens(e, t);
  }
  _emitModelTokensChangedEvent(e) {
    this._textModel._isDisposing() || (this._bracketPairsTextModelPart.handleDidChangeTokens(e), this._onDidChangeTokens.fire(e));
  }
  // #region Grammar Tokens
  validateLineNumber(e) {
    if (e < 1 || e > this._textModel.getLineCount())
      throw new Wt("Illegal value for lineNumber");
  }
  get hasTokens() {
    return this.tokens.get().hasTokens;
  }
  resetTokenization() {
    this.tokens.get().todo_resetTokenization();
  }
  get backgroundTokenizationState() {
    return this.tokens.get().backgroundTokenizationState;
  }
  forceTokenization(e) {
    this.validateLineNumber(e), this.tokens.get().forceTokenization(e);
  }
  hasAccurateTokensForLine(e) {
    return this.validateLineNumber(e), this.tokens.get().hasAccurateTokensForLine(e);
  }
  isCheapToTokenize(e) {
    return this.validateLineNumber(e), this.tokens.get().isCheapToTokenize(e);
  }
  tokenizeIfCheap(e) {
    this.validateLineNumber(e), this.tokens.get().tokenizeIfCheap(e);
  }
  getTokenTypeIfInsertingCharacter(e, t, n) {
    return this.tokens.get().getTokenTypeIfInsertingCharacter(e, t, n);
  }
  tokenizeLinesAt(e, t) {
    return this.tokens.get().tokenizeLinesAt(e, t);
  }
  // #endregion
  // #region Semantic Tokens
  setSemanticTokens(e, t) {
    this._semanticTokens.set(e, t, this._textModel), this._emitModelTokensChangedEvent({
      semanticTokensApplied: e !== null,
      ranges: [{ fromLineNumber: 1, toLineNumber: this._textModel.getLineCount() }]
    });
  }
  hasCompleteSemanticTokens() {
    return this._semanticTokens.isComplete();
  }
  hasSomeSemanticTokens() {
    return !this._semanticTokens.isEmpty();
  }
  setPartialSemanticTokens(e, t) {
    if (this.hasCompleteSemanticTokens())
      return;
    const n = this._textModel.validateRange(this._semanticTokens.setPartial(e, t));
    this._emitModelTokensChangedEvent({
      semanticTokensApplied: !0,
      ranges: [
        {
          fromLineNumber: n.startLineNumber,
          toLineNumber: n.endLineNumber
        }
      ]
    });
  }
  // #endregion
  // #region Utility Methods
  getWordAtPosition(e) {
    this.assertNotDisposed();
    const t = this._textModel.validatePosition(e), n = this._textModel.getLineContent(t.lineNumber), r = this.getLineTokens(t.lineNumber), s = r.findTokenIndexAtOffset(t.column - 1), [o, a] = NW._findLanguageBoundaries(r, s), l = c4(t.column, this.getLanguageConfiguration(r.getLanguageId(s)).getWordDefinition(), n.substring(o, a), o);
    if (l && l.startColumn <= e.column && e.column <= l.endColumn)
      return l;
    if (s > 0 && o === t.column - 1) {
      const [c, u] = NW._findLanguageBoundaries(r, s - 1), d = c4(t.column, this.getLanguageConfiguration(r.getLanguageId(s - 1)).getWordDefinition(), n.substring(c, u), c);
      if (d && d.startColumn <= e.column && e.column <= d.endColumn)
        return d;
    }
    return null;
  }
  getLanguageConfiguration(e) {
    return this._languageConfigurationService.getLanguageConfiguration(e);
  }
  static _findLanguageBoundaries(e, t) {
    const n = e.getLanguageId(t);
    let r = 0;
    for (let o = t; o >= 0 && e.getLanguageId(o) === n; o--)
      r = e.getStartOffset(o);
    let s = e.getLineContent().length;
    for (let o = t, a = e.getCount(); o < a && e.getLanguageId(o) === n; o++)
      s = e.getEndOffset(o);
    return [r, s];
  }
  getWordUntilPosition(e) {
    const t = this.getWordAtPosition(e);
    return t ? {
      word: t.word.substr(0, e.column - t.startColumn),
      startColumn: t.startColumn,
      endColumn: e.column
    } : { word: "", startColumn: e.column, endColumn: e.column };
  }
  // #endregion
  // #region Language Id handling
  getLanguageId() {
    return this._languageId;
  }
  getLanguageIdAtPosition(e, t) {
    const n = this._textModel.validatePosition(new de(e, t)), r = this.getLineTokens(n.lineNumber);
    return r.getLanguageId(r.findTokenIndexAtOffset(n.column - 1));
  }
  setLanguageId(e, t = "api") {
    if (this._languageId === e)
      return;
    const n = {
      oldLanguage: this._languageId,
      newLanguage: e,
      source: t
    };
    this._languageId = e, this._languageIdObs.set(e, void 0), this._bracketPairsTextModelPart.handleDidChangeLanguage(n), this._onDidChangeLanguage.fire(n), this._onDidChangeLanguageConfiguration.fire({});
  }
};
Are = NW = Pgt([
  q7(4, Gr),
  q7(5, Ls),
  q7(6, xt),
  q7(7, tge)
], Are);
const ige = Vn("undoRedoService");
class u4e {
  constructor(e, t) {
    this.resource = e, this.elements = t;
  }
}
const MN = class MN {
  constructor() {
    this.id = MN._ID++, this.order = 1;
  }
  nextOrder() {
    return this.id === 0 ? 0 : this.order++;
  }
};
MN._ID = 0, MN.None = new MN();
let Ore = MN;
const PN = class PN {
  constructor() {
    this.id = PN._ID++, this.order = 1;
  }
  nextOrder() {
    return this.id === 0 ? 0 : this.order++;
  }
};
PN._ID = 0, PN.None = new PN();
let $E = PN;
var kTe;
function Fgt(i, e) {
  const t = /* @__PURE__ */ new Map();
  for (const n of i) {
    const r = e(n);
    let s = t.get(r);
    s || (s = [], t.set(r, s)), s.push(n);
  }
  return t;
}
function Bgt(i, e) {
  const t = [], n = [];
  for (const r of i)
    e.has(r) || t.push(r);
  for (const r of e)
    i.has(r) || n.push(r);
  return { removed: t, added: n };
}
function d4e(i, e) {
  const t = /* @__PURE__ */ new Set();
  for (const n of e)
    i.has(n) && t.add(n);
  return t;
}
class DTe {
  constructor(e, t) {
    this.toKey = t, this._map = /* @__PURE__ */ new Map(), this[kTe] = "SetWithKey";
    for (const n of e)
      this.add(n);
  }
  get size() {
    return this._map.size;
  }
  add(e) {
    const t = this.toKey(e);
    return this._map.set(t, e), this;
  }
  delete(e) {
    return this._map.delete(this.toKey(e));
  }
  has(e) {
    return this._map.has(this.toKey(e));
  }
  *entries() {
    for (const e of this._map.values())
      yield [e, e];
  }
  keys() {
    return this.values();
  }
  *values() {
    for (const e of this._map.values())
      yield e;
  }
  clear() {
    this._map.clear();
  }
  forEach(e, t) {
    this._map.forEach((n) => e.call(t, n, n, this));
  }
  [Symbol.iterator]() {
    return this.values();
  }
}
kTe = Symbol.toStringTag;
var Hgt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, K7 = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, EE;
function Wgt(i) {
  const e = new s4e();
  return e.acceptChunk(i), e.finish();
}
function Vgt(i) {
  const e = new s4e();
  let t;
  for (; typeof (t = i.read()) == "string"; )
    e.acceptChunk(t);
  return e.finish();
}
function ITe(i, e) {
  let t;
  return typeof i == "string" ? t = Wgt(i) : est(i) ? t = Vgt(i) : t = i, t.create(e);
}
let Y7 = 0;
const Ugt = 999, zgt = 1e4, $gt = 300;
class jgt {
  constructor(e) {
    this._source = e, this._eos = !1;
  }
  read() {
    if (this._eos)
      return null;
    const e = [];
    let t = 0, n = 0;
    do {
      const r = this._source.read();
      if (r === null)
        return this._eos = !0, t === 0 ? null : e.join("");
      if (r.length > 0 && (e[t++] = r, n += r.length), n >= 64 * 1024)
        return e.join("");
    } while (!0);
  }
}
const qM = () => {
  throw new Error("Invalid change accessor");
};
var Gp;
let cT = (Gp = class extends ge {
  static resolveOptions(e, t) {
    if (t.detectIndentation) {
      const n = fTe(e, t.tabSize, t.insertSpaces);
      return new xW({
        tabSize: n.tabSize,
        indentSize: "tabSize",
        // TODO@Alex: guess indentSize independent of tabSize
        insertSpaces: n.insertSpaces,
        trimAutoWhitespace: t.trimAutoWhitespace,
        defaultEOL: t.defaultEOL,
        bracketPairColorizationOptions: t.bracketPairColorizationOptions
      });
    }
    return new xW(t);
  }
  get onDidChangeLanguage() {
    return this._tokenizationTextModelPart.onDidChangeLanguage;
  }
  get onDidChangeLanguageConfiguration() {
    return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration;
  }
  get onDidChangeTokens() {
    return this._tokenizationTextModelPart.onDidChangeTokens;
  }
  get onDidChangeOptions() {
    return this._onDidChangeOptions.event;
  }
  get onDidChangeAttached() {
    return this._onDidChangeAttached.event;
  }
  get onDidChangeLineHeight() {
    return this._onDidChangeLineHeight.event;
  }
  get onDidChangeFont() {
    return this._onDidChangeFont.event;
  }
  onDidChangeContent(e) {
    return this._eventEmitter.slowEvent((t) => e(t.contentChangedEvent));
  }
  onDidChangeContentOrInjectedText(e) {
    return Vg(this._eventEmitter.fastEvent((t) => e(t)), this._onDidChangeInjectedText.event((t) => e(t)));
  }
  _isDisposing() {
    return this.__isDisposing;
  }
  get tokenization() {
    return this._tokenizationTextModelPart;
  }
  get bracketPairs() {
    return this._bracketPairs;
  }
  get guides() {
    return this._guidesTextModelPart;
  }
  constructor(e, t, n, r = null, s, o, a, l) {
    super(), this._undoRedoService = s, this._languageService = o, this._languageConfigurationService = a, this.instantiationService = l, this._onWillDispose = this._register(new he()), this.onWillDispose = this._onWillDispose.event, this._onDidChangeDecorations = this._register(new Xgt((m, _, v) => this.handleBeforeFireDecorationsChangedEvent(m, _, v))), this.onDidChangeDecorations = this._onDidChangeDecorations.event, this._onDidChangeOptions = this._register(new he()), this._onDidChangeAttached = this._register(new he()), this._onDidChangeInjectedText = this._register(new he()), this._onDidChangeLineHeight = this._register(new he()), this._onDidChangeFont = this._register(new he()), this._eventEmitter = this._register(new Zgt()), this._languageSelectionListener = this._register(new er()), this._deltaDecorationCallCnt = 0, this._attachedViews = new lgt(), Y7++, this.id = "$model" + Y7, this.isForSimpleWidget = n.isForSimpleWidget, typeof r > "u" || r === null ? this._associatedResource = Ht.parse("inmemory://model/" + Y7) : this._associatedResource = r, this._attachedEditorCount = 0;
    const { textBuffer: c, disposable: u } = ITe(e, n.defaultEOL);
    this._buffer = c, this._bufferDisposable = u;
    const d = this._buffer.getLineCount(), h = this._buffer.getValueLengthInRange(
      new z(1, 1, d, this._buffer.getLineLength(d) + 1),
      0
      /* model.EndOfLinePreference.TextDefined */
    );
    n.largeFileOptimizations ? (this._isTooLargeForTokenization = h > EE.LARGE_FILE_SIZE_THRESHOLD || d > EE.LARGE_FILE_LINE_COUNT_THRESHOLD, this._isTooLargeForHeapOperation = h > EE.LARGE_FILE_HEAP_OPERATION_THRESHOLD) : (this._isTooLargeForTokenization = !1, this._isTooLargeForHeapOperation = !1), this._options = EE.resolveOptions(this._buffer, n);
    const g = typeof t == "string" ? t : t.languageId;
    typeof t != "string" && (this._languageSelectionListener.value = t.onDidChange(() => this._setLanguage(t.languageId))), this._bracketPairs = this._register(new Rft(this, this._languageConfigurationService)), this._guidesTextModelPart = this._register(new _dt(this, this._languageConfigurationService)), this._decorationProvider = this._register(new Oft(this)), this._tokenizationTextModelPart = this.instantiationService.createInstance(Are, this, this._bracketPairs, g, this._attachedViews), this._isTooLargeForSyncing = h > EE._MODEL_SYNC_LIMIT, this._versionId = 1, this._alternativeVersionId = 1, this._initialUndoRedoSnapshot = null, this._isDisposed = !1, this.__isDisposing = !1, this._instanceId = ePe(Y7), this._lastDecorationId = 0, this._decorations = /* @__PURE__ */ Object.create(null), this._decorationsTree = new NTe(), this._commandManager = new Yfe(this, this._undoRedoService), this._isUndoing = !1, this._isRedoing = !1, this._trimAutoWhitespaceLines = null, this._register(this._decorationProvider.onDidChange(() => {
      this._onDidChangeDecorations.beginDeferredEmit(), this._onDidChangeDecorations.fire(), this._onDidChangeDecorations.endDeferredEmit();
    })), this._languageService.requestRichLanguageFeatures(g), this._register(this._languageConfigurationService.onDidChange((m) => {
      this._bracketPairs.handleLanguageConfigurationServiceChange(m), this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(m);
    }));
  }
  dispose() {
    this.__isDisposing = !0, this._onWillDispose.fire(), this._tokenizationTextModelPart.dispose(), this._isDisposed = !0, super.dispose(), this._bufferDisposable.dispose(), this.__isDisposing = !1;
    const e = new iR([], "", `
`, !1, !1, !0, !0);
    e.dispose(), this._buffer = e, this._bufferDisposable = ge.None;
  }
  _assertNotDisposed() {
    if (this._isDisposed)
      throw new Wt("Model is disposed!");
  }
  getTextBuffer() {
    return this._assertNotDisposed(), this._buffer;
  }
  _emitContentChangedEvent(e, t) {
    this.__isDisposing || (this._tokenizationTextModelPart.handleDidChangeContent(t), this._bracketPairs.handleDidChangeContent(t), this._eventEmitter.fire(new Vx(e, t)));
  }
  setValue(e, t = $l.setValue()) {
    if (this._assertNotDisposed(), e == null)
      throw Bf();
    const { textBuffer: n, disposable: r } = ITe(e, this._options.defaultEOL);
    this._setValueFromTextBuffer(n, r, t);
  }
  _createContentChanged2(e, t, n, r, s, o, a, l, c, u) {
    return {
      changes: [{
        range: e,
        rangeOffset: t,
        rangeLength: n,
        text: s
      }],
      eol: this._buffer.getEOL(),
      isEolChange: c,
      versionId: this.getVersionId(),
      isUndoing: o,
      isRedoing: a,
      isFlush: l,
      detailedReasons: [u],
      detailedReasonsChangeLengths: [1]
    };
  }
  _setValueFromTextBuffer(e, t, n) {
    this._assertNotDisposed();
    const r = this.getFullModelRange(), s = this.getValueLengthInRange(r), o = this.getLineCount(), a = this.getLineMaxColumn(o);
    this._buffer = e, this._bufferDisposable.dispose(), this._bufferDisposable = t, this._increaseVersionId(), this._decorations = /* @__PURE__ */ Object.create(null), this._decorationsTree = new NTe(), this._commandManager.clear(), this._trimAutoWhitespaceLines = null, this._emitContentChangedEvent(new eR([
      new tft()
    ], this._versionId, !1, !1), this._createContentChanged2(new z(1, 1, o, a), 0, s, new de(o, a), this.getValue(), !1, !1, !0, !1, n));
  }
  setEOL(e) {
    this._assertNotDisposed();
    const t = e === 1 ? `\r
` : `
`;
    if (this._buffer.getEOL() === t)
      return;
    const n = this.getFullModelRange(), r = this.getValueLengthInRange(n), s = this.getLineCount(), o = this.getLineMaxColumn(s);
    this._onBeforeEOLChange(), this._buffer.setEOL(t), this._increaseVersionId(), this._onAfterEOLChange(), this._emitContentChangedEvent(new eR([
      new oft()
    ], this._versionId, !1, !1), this._createContentChanged2(new z(1, 1, s, o), 0, r, new de(s, o), this.getValue(), !1, !1, !1, !0, $l.eolChange()));
  }
  _onBeforeEOLChange() {
    this._decorationsTree.ensureAllNodesHaveRanges(this);
  }
  _onAfterEOLChange() {
    const e = this.getVersionId(), t = this._decorationsTree.collectNodesPostOrder();
    for (let n = 0, r = t.length; n < r; n++) {
      const s = t[n], o = s.range, a = s.cachedAbsoluteStart - s.start, l = this._buffer.getOffsetAt(o.startLineNumber, o.startColumn), c = this._buffer.getOffsetAt(o.endLineNumber, o.endColumn);
      s.cachedAbsoluteStart = l, s.cachedAbsoluteEnd = c, s.cachedVersionId = e, s.start = l - a, s.end = c - a, cw(s);
    }
  }
  onBeforeAttached() {
    return this._attachedEditorCount++, this._attachedEditorCount === 1 && (this._tokenizationTextModelPart.handleDidChangeAttached(), this._onDidChangeAttached.fire(void 0)), this._attachedViews.attachView();
  }
  onBeforeDetached(e) {
    this._attachedEditorCount--, this._attachedEditorCount === 0 && (this._tokenizationTextModelPart.handleDidChangeAttached(), this._onDidChangeAttached.fire(void 0)), this._attachedViews.detachView(e);
  }
  isAttachedToEditor() {
    return this._attachedEditorCount > 0;
  }
  getAttachedEditorCount() {
    return this._attachedEditorCount;
  }
  isTooLargeForSyncing() {
    return this._isTooLargeForSyncing;
  }
  isTooLargeForTokenization() {
    return this._isTooLargeForTokenization;
  }
  isTooLargeForHeapOperation() {
    return this._isTooLargeForHeapOperation;
  }
  isDisposed() {
    return this._isDisposed;
  }
  isDominatedByLongLines() {
    if (this._assertNotDisposed(), this.isTooLargeForTokenization())
      return !1;
    let e = 0, t = 0;
    const n = this._buffer.getLineCount();
    for (let r = 1; r <= n; r++) {
      const s = this._buffer.getLineLength(r);
      s >= zgt ? t += s : e += s;
    }
    return t > e;
  }
  get uri() {
    return this._associatedResource;
  }
  //#region Options
  getOptions() {
    return this._assertNotDisposed(), this._options;
  }
  getFormattingOptions() {
    return {
      tabSize: this._options.indentSize,
      insertSpaces: this._options.insertSpaces
    };
  }
  updateOptions(e) {
    this._assertNotDisposed();
    const t = typeof e.tabSize < "u" ? e.tabSize : this._options.tabSize, n = typeof e.indentSize < "u" ? e.indentSize : this._options.originalIndentSize, r = typeof e.insertSpaces < "u" ? e.insertSpaces : this._options.insertSpaces, s = typeof e.trimAutoWhitespace < "u" ? e.trimAutoWhitespace : this._options.trimAutoWhitespace, o = typeof e.bracketColorizationOptions < "u" ? e.bracketColorizationOptions : this._options.bracketPairColorizationOptions, a = new xW({
      tabSize: t,
      indentSize: n,
      insertSpaces: r,
      defaultEOL: this._options.defaultEOL,
      trimAutoWhitespace: s,
      bracketPairColorizationOptions: o
    });
    if (this._options.equals(a))
      return;
    const l = this._options.createChangeEvent(a);
    this._options = a, this._bracketPairs.handleDidChangeOptions(l), this._decorationProvider.handleDidChangeOptions(l), this._onDidChangeOptions.fire(l);
  }
  detectIndentation(e, t) {
    this._assertNotDisposed();
    const n = fTe(this._buffer, t, e);
    this.updateOptions({
      insertSpaces: n.insertSpaces,
      tabSize: n.tabSize,
      indentSize: n.tabSize
      // TODO@Alex: guess indentSize independent of tabSize
    });
  }
  normalizeIndentation(e) {
    return this._assertNotDisposed(), ife(e, this._options.indentSize, this._options.insertSpaces);
  }
  //#endregion
  //#region Reading
  getVersionId() {
    return this._assertNotDisposed(), this._versionId;
  }
  mightContainRTL() {
    return this._buffer.mightContainRTL();
  }
  mightContainUnusualLineTerminators() {
    return this._buffer.mightContainUnusualLineTerminators();
  }
  removeUnusualLineTerminators(e = null) {
    const t = this.findMatches(
      QMe.source,
      !1,
      !0,
      !1,
      null,
      !1,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    );
    this._buffer.resetMightContainUnusualLineTerminators(), this.pushEditOperations(e, t.map((n) => ({ range: n.range, text: null })), () => null);
  }
  mightContainNonBasicASCII() {
    return this._buffer.mightContainNonBasicASCII();
  }
  getAlternativeVersionId() {
    return this._assertNotDisposed(), this._alternativeVersionId;
  }
  getInitialUndoRedoSnapshot() {
    return this._assertNotDisposed(), this._initialUndoRedoSnapshot;
  }
  getOffsetAt(e) {
    this._assertNotDisposed();
    const t = this._validatePosition(
      e.lineNumber,
      e.column,
      0
      /* StringOffsetValidationType.Relaxed */
    );
    return this._buffer.getOffsetAt(t.lineNumber, t.column);
  }
  getPositionAt(e) {
    this._assertNotDisposed();
    const t = Math.min(this._buffer.getLength(), Math.max(0, e));
    return this._buffer.getPositionAt(t);
  }
  _increaseVersionId() {
    this._versionId = this._versionId + 1, this._alternativeVersionId = this._versionId;
  }
  _overwriteVersionId(e) {
    this._versionId = e;
  }
  _overwriteAlternativeVersionId(e) {
    this._alternativeVersionId = e;
  }
  _overwriteInitialUndoRedoSnapshot(e) {
    this._initialUndoRedoSnapshot = e;
  }
  getValue(e, t = !1) {
    if (this._assertNotDisposed(), this.isTooLargeForHeapOperation())
      throw new Wt("Operation would exceed heap memory limits");
    const n = this.getFullModelRange(), r = this.getValueInRange(n, e);
    return t ? this._buffer.getBOM() + r : r;
  }
  createSnapshot(e = !1) {
    return new jgt(this._buffer.createSnapshot(e));
  }
  getValueLength(e, t = !1) {
    this._assertNotDisposed();
    const n = this.getFullModelRange(), r = this.getValueLengthInRange(n, e);
    return t ? this._buffer.getBOM().length + r : r;
  }
  getValueInRange(e, t = 0) {
    return this._assertNotDisposed(), this._buffer.getValueInRange(this.validateRange(e), t);
  }
  getValueLengthInRange(e, t = 0) {
    return this._assertNotDisposed(), this._buffer.getValueLengthInRange(this.validateRange(e), t);
  }
  getCharacterCountInRange(e, t = 0) {
    return this._assertNotDisposed(), this._buffer.getCharacterCountInRange(this.validateRange(e), t);
  }
  getLineCount() {
    return this._assertNotDisposed(), this._buffer.getLineCount();
  }
  getLineContent(e) {
    if (this._assertNotDisposed(), e < 1 || e > this.getLineCount())
      throw new Wt("Illegal value for lineNumber");
    return this._buffer.getLineContent(e);
  }
  getLineLength(e) {
    if (this._assertNotDisposed(), e < 1 || e > this.getLineCount())
      throw new Wt("Illegal value for lineNumber");
    return this._buffer.getLineLength(e);
  }
  getLinesContent() {
    if (this._assertNotDisposed(), this.isTooLargeForHeapOperation())
      throw new Wt("Operation would exceed heap memory limits");
    return this._buffer.getLinesContent();
  }
  getEOL() {
    return this._assertNotDisposed(), this._buffer.getEOL();
  }
  getEndOfLineSequence() {
    return this._assertNotDisposed(), this._buffer.getEOL() === `
` ? 0 : 1;
  }
  getLineMinColumn(e) {
    return this._assertNotDisposed(), 1;
  }
  getLineMaxColumn(e) {
    if (this._assertNotDisposed(), e < 1 || e > this.getLineCount())
      throw new Wt("Illegal value for lineNumber");
    return this._buffer.getLineLength(e) + 1;
  }
  getLineFirstNonWhitespaceColumn(e) {
    if (this._assertNotDisposed(), e < 1 || e > this.getLineCount())
      throw new Wt("Illegal value for lineNumber");
    return this._buffer.getLineFirstNonWhitespaceColumn(e);
  }
  getLineLastNonWhitespaceColumn(e) {
    if (this._assertNotDisposed(), e < 1 || e > this.getLineCount())
      throw new Wt("Illegal value for lineNumber");
    return this._buffer.getLineLastNonWhitespaceColumn(e);
  }
  /**
   * Validates `range` is within buffer bounds, but allows it to sit in between surrogate pairs, etc.
   * Will try to not allocate if possible.
   */
  _validateRangeRelaxedNoAllocations(e) {
    const t = this._buffer.getLineCount(), n = e.startLineNumber, r = e.startColumn;
    let s = Math.floor(typeof n == "number" && !isNaN(n) ? n : 1), o = Math.floor(typeof r == "number" && !isNaN(r) ? r : 1);
    if (s < 1)
      s = 1, o = 1;
    else if (s > t)
      s = t, o = this.getLineMaxColumn(s);
    else if (o <= 1)
      o = 1;
    else {
      const d = this.getLineMaxColumn(s);
      o >= d && (o = d);
    }
    const a = e.endLineNumber, l = e.endColumn;
    let c = Math.floor(typeof a == "number" && !isNaN(a) ? a : 1), u = Math.floor(typeof l == "number" && !isNaN(l) ? l : 1);
    if (c < 1)
      c = 1, u = 1;
    else if (c > t)
      c = t, u = this.getLineMaxColumn(c);
    else if (u <= 1)
      u = 1;
    else {
      const d = this.getLineMaxColumn(c);
      u >= d && (u = d);
    }
    return n === s && r === o && a === c && l === u && e instanceof z && !(e instanceof bt) ? e : new z(s, o, c, u);
  }
  _isValidPosition(e, t, n) {
    if (typeof e != "number" || typeof t != "number" || isNaN(e) || isNaN(t) || e < 1 || t < 1 || (e | 0) !== e || (t | 0) !== t)
      return !1;
    const r = this._buffer.getLineCount();
    if (e > r)
      return !1;
    if (t === 1)
      return !0;
    const s = this.getLineMaxColumn(e);
    if (t > s)
      return !1;
    if (n === 1) {
      const o = this._buffer.getLineCharCode(e, t - 2);
      if (Qo(o))
        return !1;
    }
    return !0;
  }
  _validatePosition(e, t, n) {
    const r = Math.floor(typeof e == "number" && !isNaN(e) ? e : 1), s = Math.floor(typeof t == "number" && !isNaN(t) ? t : 1), o = this._buffer.getLineCount();
    if (r < 1)
      return new de(1, 1);
    if (r > o)
      return new de(o, this.getLineMaxColumn(o));
    if (s <= 1)
      return new de(r, 1);
    const a = this.getLineMaxColumn(r);
    if (s >= a)
      return new de(r, a);
    if (n === 1) {
      const l = this._buffer.getLineCharCode(r, s - 2);
      if (Qo(l))
        return new de(r, s - 1);
    }
    return new de(r, s);
  }
  validatePosition(e) {
    return this._assertNotDisposed(), e instanceof de && this._isValidPosition(e.lineNumber, e.column, 1) ? e : this._validatePosition(e.lineNumber, e.column, 1);
  }
  isValidRange(e) {
    return this._isValidRange(
      e,
      1
      /* StringOffsetValidationType.SurrogatePairs */
    );
  }
  _isValidRange(e, t) {
    const n = e.startLineNumber, r = e.startColumn, s = e.endLineNumber, o = e.endColumn;
    if (!this._isValidPosition(
      n,
      r,
      0
      /* StringOffsetValidationType.Relaxed */
    ) || !this._isValidPosition(
      s,
      o,
      0
      /* StringOffsetValidationType.Relaxed */
    ))
      return !1;
    if (t === 1) {
      const a = r > 1 ? this._buffer.getLineCharCode(n, r - 2) : 0, l = o > 1 && o <= this._buffer.getLineLength(s) ? this._buffer.getLineCharCode(s, o - 2) : 0, c = Qo(a), u = Qo(l);
      return !c && !u;
    }
    return !0;
  }
  validateRange(e) {
    if (this._assertNotDisposed(), e instanceof z && !(e instanceof bt) && this._isValidRange(e, 1))
      return e;
    const n = this._validatePosition(
      e.startLineNumber,
      e.startColumn,
      0
      /* StringOffsetValidationType.Relaxed */
    ), r = this._validatePosition(
      e.endLineNumber,
      e.endColumn,
      0
      /* StringOffsetValidationType.Relaxed */
    ), s = n.lineNumber, o = n.column, a = r.lineNumber, l = r.column;
    {
      const c = o > 1 ? this._buffer.getLineCharCode(s, o - 2) : 0, u = l > 1 && l <= this._buffer.getLineLength(a) ? this._buffer.getLineCharCode(a, l - 2) : 0, d = Qo(c), h = Qo(u);
      return !d && !h ? new z(s, o, a, l) : s === a && o === l ? new z(s, o - 1, a, l - 1) : d && h ? new z(s, o - 1, a, l + 1) : d ? new z(s, o - 1, a, l) : new z(s, o, a, l + 1);
    }
  }
  modifyPosition(e, t) {
    this._assertNotDisposed();
    const n = this.getOffsetAt(e) + t;
    return this.getPositionAt(Math.min(this._buffer.getLength(), Math.max(0, n)));
  }
  getFullModelRange() {
    this._assertNotDisposed();
    const e = this.getLineCount();
    return new z(1, 1, e, this.getLineMaxColumn(e));
  }
  findMatchesLineByLine(e, t, n, r) {
    return this._buffer.findMatchesLineByLine(e, t, n, r);
  }
  findMatches(e, t, n, r, s, o, a = Ugt) {
    this._assertNotDisposed();
    let l = null;
    t !== null && (Array.isArray(t) || (t = [t]), t.every((d) => z.isIRange(d)) && (l = t.map((d) => this.validateRange(d)))), l === null && (l = [this.getFullModelRange()]), l = l.sort((d, h) => d.startLineNumber - h.startLineNumber || d.startColumn - h.startColumn);
    const c = [];
    c.push(l.reduce((d, h) => z.areIntersecting(d, h) ? d.plusRange(h) : (c.push(d), h)));
    let u;
    if (!n && e.indexOf(`
`) < 0) {
      const h = new SE(e, n, r, s).parseSearchRequest();
      if (!h)
        return [];
      u = (g) => this.findMatchesLineByLine(g, h, o, a);
    } else
      u = (d) => G7.findMatches(this, new SE(e, n, r, s), d, o, a);
    return c.map(u).reduce((d, h) => d.concat(h), []);
  }
  findNextMatch(e, t, n, r, s, o) {
    this._assertNotDisposed();
    const a = this.validatePosition(t);
    if (!n && e.indexOf(`
`) < 0) {
      const c = new SE(e, n, r, s).parseSearchRequest();
      if (!c)
        return null;
      const u = this.getLineCount();
      let d = new z(a.lineNumber, a.column, u, this.getLineMaxColumn(u)), h = this.findMatchesLineByLine(d, c, o, 1);
      return G7.findNextMatch(this, new SE(e, n, r, s), a, o), h.length > 0 || (d = new z(1, 1, a.lineNumber, this.getLineMaxColumn(a.lineNumber)), h = this.findMatchesLineByLine(d, c, o, 1), h.length > 0) ? h[0] : null;
    }
    return G7.findNextMatch(this, new SE(e, n, r, s), a, o);
  }
  findPreviousMatch(e, t, n, r, s, o) {
    this._assertNotDisposed();
    const a = this.validatePosition(t);
    return G7.findPreviousMatch(this, new SE(e, n, r, s), a, o);
  }
  //#endregion
  //#region Editing
  pushStackElement() {
    this._commandManager.pushStackElement();
  }
  popStackElement() {
    this._commandManager.popStackElement();
  }
  pushEOL(e) {
    if ((this.getEOL() === `
` ? 0 : 1) !== e)
      try {
        this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit(), this._initialUndoRedoSnapshot === null && (this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri)), this._commandManager.pushEOL(e);
      } finally {
        this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit();
      }
  }
  _validateEditOperation(e) {
    return e instanceof $J ? e : new $J(e.identifier || null, this.validateRange(e.range), e.text, e.forceMoveMarkers || !1, e.isAutoWhitespaceEdit || !1, e._isTracked || !1);
  }
  _validateEditOperations(e) {
    const t = [];
    for (let n = 0, r = e.length; n < r; n++)
      t[n] = this._validateEditOperation(e[n]);
    return t;
  }
  pushEditOperations(e, t, n, r, s) {
    try {
      return this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit(), this._pushEditOperations(e, this._validateEditOperations(t), n, r, s);
    } finally {
      this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  _pushEditOperations(e, t, n, r, s) {
    if (this._options.trimAutoWhitespace && this._trimAutoWhitespaceLines) {
      const o = t.map((l) => ({
        range: this.validateRange(l.range),
        text: l.text
      }));
      let a = !0;
      if (e)
        for (let l = 0, c = e.length; l < c; l++) {
          const u = e[l];
          let d = !1;
          for (let h = 0, g = o.length; h < g; h++) {
            const m = o[h].range, _ = m.startLineNumber > u.endLineNumber, v = u.startLineNumber > m.endLineNumber;
            if (!_ && !v) {
              d = !0;
              break;
            }
          }
          if (!d) {
            a = !1;
            break;
          }
        }
      if (a)
        for (let l = 0, c = this._trimAutoWhitespaceLines.length; l < c; l++) {
          const u = this._trimAutoWhitespaceLines[l], d = this.getLineMaxColumn(u);
          let h = !0;
          for (let g = 0, m = o.length; g < m; g++) {
            const _ = o[g].range, v = o[g].text;
            if (!(u < _.startLineNumber || u > _.endLineNumber) && !(u === _.startLineNumber && _.startColumn === d && _.isEmpty() && v && v.length > 0 && v.charAt(0) === `
`) && !(u === _.startLineNumber && _.startColumn === 1 && _.isEmpty() && v && v.length > 0 && v.charAt(v.length - 1) === `
`)) {
              h = !1;
              break;
            }
          }
          if (h) {
            const g = new z(u, 1, u, d);
            t.push(new $J(null, g, null, !1, !1, !1));
          }
        }
      this._trimAutoWhitespaceLines = null;
    }
    return this._initialUndoRedoSnapshot === null && (this._initialUndoRedoSnapshot = this._undoRedoService.createSnapshot(this.uri)), this._commandManager.pushEditOperation(e, t, n, r, s);
  }
  _applyUndo(e, t, n, r) {
    const s = e.map((o) => {
      const a = this.getPositionAt(o.newPosition), l = this.getPositionAt(o.newEnd);
      return {
        range: new z(a.lineNumber, a.column, l.lineNumber, l.column),
        text: o.oldText
      };
    });
    this._applyUndoRedoEdits(s, t, !0, !1, n, r);
  }
  _applyRedo(e, t, n, r) {
    const s = e.map((o) => {
      const a = this.getPositionAt(o.oldPosition), l = this.getPositionAt(o.oldEnd);
      return {
        range: new z(a.lineNumber, a.column, l.lineNumber, l.column),
        text: o.newText
      };
    });
    this._applyUndoRedoEdits(s, t, !1, !0, n, r);
  }
  _applyUndoRedoEdits(e, t, n, r, s, o) {
    try {
      this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit(), this._isUndoing = n, this._isRedoing = r, this.applyEdits(e, !1), this.setEOL(t), this._overwriteAlternativeVersionId(s);
    } finally {
      this._isUndoing = !1, this._isRedoing = !1, this._eventEmitter.endDeferredEmit(o), this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  applyEdits(e, t, n) {
    try {
      this._onDidChangeDecorations.beginDeferredEmit(), this._eventEmitter.beginDeferredEmit();
      const r = this._validateEditOperations(e);
      return this._doApplyEdits(r, t ?? !1, n ?? $l.applyEdits());
    } finally {
      this._eventEmitter.endDeferredEmit(), this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  _doApplyEdits(e, t, n) {
    const r = this._buffer.getLineCount(), s = this._buffer.applyEdits(e, this._options.trimAutoWhitespace, t), o = this._buffer.getLineCount(), a = s.changes;
    if (this._trimAutoWhitespaceLines = s.trimAutoWhitespaceLineNumbers, a.length !== 0) {
      for (let u = 0, d = a.length; u < d; u++) {
        const h = a[u];
        this._decorationsTree.acceptReplace(h.rangeOffset, h.rangeLength, h.text.length, h.forceMoveMarkers);
      }
      const l = [];
      this._increaseVersionId();
      let c = r;
      for (let u = 0, d = a.length; u < d; u++) {
        const h = a[u], [g] = lw(h.text);
        this._onDidChangeDecorations.fire();
        const m = h.range.startLineNumber, _ = h.range.endLineNumber, v = _ - m, w = g, E = Math.min(v, w), L = w - v, T = o - c - L + m, D = T, N = T + w, R = this._decorationsTree.getInjectedTextInInterval(this, this.getOffsetAt(new de(D, 1)), this.getOffsetAt(new de(N, this.getLineMaxColumn(N))), 0), M = pm.fromDecorations(R), B = new Ky(M);
        for (let H = E; H >= 0; H--) {
          const j = m + H, K = T + H;
          B.takeFromEndWhile((Y) => Y.lineNumber > K);
          const X = B.takeFromEndWhile((Y) => Y.lineNumber === K);
          l.push(new oTe(j, this.getLineContent(K), X));
        }
        if (E < v) {
          const H = m + E;
          l.push(new rft(H + 1, _));
        }
        if (E < w) {
          const H = new Ky(M), j = m + E, K = w - E, X = o - c - K + j + 1, Y = [], G = [];
          for (let Q = 0; Q < K; Q++) {
            const oe = X + Q;
            G[Q] = this.getLineContent(oe), H.takeWhile((Z) => Z.lineNumber < oe), Y[Q] = H.takeWhile((Z) => Z.lineNumber === oe);
          }
          l.push(new sft(j + 1, m + w, G, Y));
        }
        c += L;
      }
      this._emitContentChangedEvent(new eR(l, this.getVersionId(), this._isUndoing, this._isRedoing), {
        changes: a,
        eol: this._buffer.getEOL(),
        isEolChange: !1,
        versionId: this.getVersionId(),
        isUndoing: this._isUndoing,
        isRedoing: this._isRedoing,
        isFlush: !1,
        detailedReasons: [n],
        detailedReasonsChangeLengths: [a.length]
      });
    }
    return s.reverseEdits === null ? void 0 : s.reverseEdits;
  }
  undo() {
    return this._undoRedoService.undo(this.uri);
  }
  canUndo() {
    return this._undoRedoService.canUndo(this.uri);
  }
  redo() {
    return this._undoRedoService.redo(this.uri);
  }
  canRedo() {
    return this._undoRedoService.canRedo(this.uri);
  }
  //#endregion
  //#region Decorations
  handleBeforeFireDecorationsChangedEvent(e, t, n) {
    if (e && e.size > 0) {
      const s = Array.from(e).map((o) => new oTe(o, this.getLineContent(o), this._getInjectedTextInLine(o)));
      this._onDidChangeInjectedText.fire(new F3e(s));
    }
    if (t && t.size > 0) {
      const s = Array.from(t).map((o) => new nft(o.ownerId, o.decorationId, o.lineNumber, o.lineHeight));
      this._onDidChangeLineHeight.fire(new B3e(s));
    }
    if (n && n.size > 0) {
      const s = Array.from(n).map((o) => new ift(o.ownerId, o.lineNumber));
      this._onDidChangeFont.fire(new H3e(s));
    }
  }
  changeDecorations(e, t = 0) {
    this._assertNotDisposed();
    try {
      return this._onDidChangeDecorations.beginDeferredEmit(), this._changeDecorations(t, e);
    } finally {
      this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  _changeDecorations(e, t) {
    const n = {
      addDecoration: (s, o) => this._deltaDecorationsImpl(e, [], [{ range: s, options: o }])[0],
      changeDecoration: (s, o) => {
        this._changeDecorationImpl(e, s, o);
      },
      changeDecorationOptions: (s, o) => {
        this._changeDecorationOptionsImpl(e, s, ATe(o));
      },
      removeDecoration: (s) => {
        this._deltaDecorationsImpl(e, [s], []);
      },
      deltaDecorations: (s, o) => s.length === 0 && o.length === 0 ? [] : this._deltaDecorationsImpl(e, s, o)
    };
    let r = null;
    try {
      r = t(n);
    } catch (s) {
      fn(s);
    }
    return n.addDecoration = qM, n.changeDecoration = qM, n.changeDecorationOptions = qM, n.removeDecoration = qM, n.deltaDecorations = qM, r;
  }
  deltaDecorations(e, t, n = 0) {
    if (this._assertNotDisposed(), e || (e = []), e.length === 0 && t.length === 0)
      return [];
    try {
      return this._deltaDecorationCallCnt++, this._deltaDecorationCallCnt > 1 && (console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."), fn(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))), this._onDidChangeDecorations.beginDeferredEmit(), this._deltaDecorationsImpl(n, e, t);
    } finally {
      this._onDidChangeDecorations.endDeferredEmit(), this._deltaDecorationCallCnt--;
    }
  }
  _getTrackedRange(e) {
    return this.getDecorationRange(e);
  }
  _setTrackedRange(e, t, n) {
    const r = e ? this._decorations[e] : null;
    if (!r)
      return t ? this._deltaDecorationsImpl(0, [], [{ range: t, options: RTe[n] }], !0)[0] : null;
    if (!t)
      return this._decorationsTree.delete(r), delete this._decorations[r.id], null;
    const s = this._validateRangeRelaxedNoAllocations(t), o = this._buffer.getOffsetAt(s.startLineNumber, s.startColumn), a = this._buffer.getOffsetAt(s.endLineNumber, s.endColumn);
    return this._decorationsTree.delete(r), r.reset(this.getVersionId(), o, a, s), r.setOptions(RTe[n]), this._decorationsTree.insert(r), r.id;
  }
  removeAllDecorationsWithOwnerId(e) {
    if (this._isDisposed)
      return;
    const t = this._decorationsTree.collectNodesFromOwner(e);
    for (let n = 0, r = t.length; n < r; n++) {
      const s = t[n];
      this._decorationsTree.delete(s), delete this._decorations[s.id];
    }
  }
  getDecorationOptions(e) {
    const t = this._decorations[e];
    return t ? t.options : null;
  }
  getDecorationRange(e) {
    const t = this._decorations[e];
    return t ? this._decorationsTree.getNodeRange(this, t) : null;
  }
  getLineDecorations(e, t = 0, n = !1, r = !1) {
    return e < 1 || e > this.getLineCount() ? [] : this.getLinesDecorations(e, e, t, n, r);
  }
  getLinesDecorations(e, t, n = 0, r = !1, s = !1, o = !1) {
    const a = this.getLineCount(), l = Math.min(a, Math.max(1, e)), c = Math.min(a, Math.max(1, t)), u = this.getLineMaxColumn(c), d = new z(l, 1, c, u), h = this._getDecorationsInRange(d, n, r, s, o);
    return fie(h, this._decorationProvider.getDecorationsInRange(d, n, r)), h;
  }
  getDecorationsInRange(e, t = 0, n = !1, r = !1, s = !1, o = !1) {
    const a = this.validateRange(e), l = this._getDecorationsInRange(a, t, n, r, o);
    return fie(l, this._decorationProvider.getDecorationsInRange(a, t, n, s)), l;
  }
  getOverviewRulerDecorations(e = 0, t = !1, n = !1) {
    return this._decorationsTree.getAll(this, e, t, n, !0, !1);
  }
  getInjectedTextDecorations(e = 0) {
    return this._decorationsTree.getAllInjectedText(this, e);
  }
  getCustomLineHeightsDecorations(e = 0) {
    return this._decorationsTree.getAllCustomLineHeights(this, e);
  }
  _getInjectedTextInLine(e) {
    const t = this._buffer.getOffsetAt(e, 1), n = t + this._buffer.getLineLength(e), r = this._decorationsTree.getInjectedTextInInterval(this, t, n, 0);
    return pm.fromDecorations(r).filter((s) => s.lineNumber === e);
  }
  getFontDecorationsInRange(e, t = 0) {
    const n = this._buffer.getOffsetAt(e.startLineNumber, e.startColumn), r = this._buffer.getOffsetAt(e.endLineNumber, e.endColumn);
    return this._decorationsTree.getFontDecorationsInInterval(this, n, r, t);
  }
  getAllDecorations(e = 0, t = !1, n = !1) {
    let r = this._decorationsTree.getAll(this, e, t, n, !1, !1);
    return r = r.concat(this._decorationProvider.getAllDecorations(e, t)), r;
  }
  getAllMarginDecorations(e = 0) {
    return this._decorationsTree.getAll(this, e, !1, !1, !1, !0);
  }
  _getDecorationsInRange(e, t, n, r, s) {
    const o = this._buffer.getOffsetAt(e.startLineNumber, e.startColumn), a = this._buffer.getOffsetAt(e.endLineNumber, e.endColumn);
    return this._decorationsTree.getAllInInterval(this, o, a, t, n, r, s);
  }
  getRangeAt(e, t) {
    return this._buffer.getRangeAt(e, t - e);
  }
  _changeDecorationImpl(e, t, n) {
    const r = this._decorations[t];
    if (!r)
      return;
    if (r.options.after) {
      const l = this.getDecorationRange(t);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.endLineNumber);
    }
    if (r.options.before) {
      const l = this.getDecorationRange(t);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(l.startLineNumber);
    }
    if (r.options.lineHeight !== null) {
      const l = this.getDecorationRange(t);
      this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e, t, l.startLineNumber, null);
    }
    if (r.options.affectsFont) {
      const l = this.getDecorationRange(t);
      this._onDidChangeDecorations.recordLineAffectedByFontChange(e, r.id, l.startLineNumber);
    }
    const s = this._validateRangeRelaxedNoAllocations(n), o = this._buffer.getOffsetAt(s.startLineNumber, s.startColumn), a = this._buffer.getOffsetAt(s.endLineNumber, s.endColumn);
    this._decorationsTree.delete(r), r.reset(this.getVersionId(), o, a, s), this._decorationsTree.insert(r), this._onDidChangeDecorations.checkAffectedAndFire(r.options), r.options.after && this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber), r.options.before && this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber), r.options.lineHeight !== null && this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e, t, s.startLineNumber, r.options.lineHeight), r.options.affectsFont && this._onDidChangeDecorations.recordLineAffectedByFontChange(e, r.id, s.startLineNumber);
  }
  _changeDecorationOptionsImpl(e, t, n) {
    const r = this._decorations[t];
    if (!r)
      return;
    const s = !!(r.options.overviewRuler && r.options.overviewRuler.color), o = !!(n.overviewRuler && n.overviewRuler.color);
    if (this._onDidChangeDecorations.checkAffectedAndFire(r.options), this._onDidChangeDecorations.checkAffectedAndFire(n), r.options.after || n.after) {
      const c = this._decorationsTree.getNodeRange(this, r);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.endLineNumber);
    }
    if (r.options.before || n.before) {
      const c = this._decorationsTree.getNodeRange(this, r);
      this._onDidChangeDecorations.recordLineAffectedByInjectedText(c.startLineNumber);
    }
    if (r.options.lineHeight !== null || n.lineHeight !== null) {
      const c = this._decorationsTree.getNodeRange(this, r);
      this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e, t, c.startLineNumber, n.lineHeight);
    }
    if (r.options.affectsFont || n.affectsFont) {
      const c = this._decorationsTree.getNodeRange(this, r);
      this._onDidChangeDecorations.recordLineAffectedByFontChange(e, t, c.startLineNumber);
    }
    const a = s !== o, l = Ggt(n) !== RW(r);
    a || l ? (this._decorationsTree.delete(r), r.setOptions(n), this._decorationsTree.insert(r)) : r.setOptions(n);
  }
  _deltaDecorationsImpl(e, t, n, r = !1) {
    const s = this.getVersionId(), o = t.length;
    let a = 0;
    const l = n.length;
    let c = 0;
    this._onDidChangeDecorations.beginDeferredEmit();
    try {
      const u = new Array(l);
      for (; a < o || c < l; ) {
        let d = null;
        if (a < o) {
          let h;
          do
            h = t[a++], d = this._decorations[h];
          while (!d && a < o);
          if (d) {
            if (d.options.after) {
              const g = this._decorationsTree.getNodeRange(this, d);
              this._onDidChangeDecorations.recordLineAffectedByInjectedText(g.endLineNumber);
            }
            if (d.options.before) {
              const g = this._decorationsTree.getNodeRange(this, d);
              this._onDidChangeDecorations.recordLineAffectedByInjectedText(g.startLineNumber);
            }
            if (d.options.lineHeight !== null) {
              const g = this._decorationsTree.getNodeRange(this, d);
              this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e, h, g.startLineNumber, null);
            }
            if (d.options.affectsFont) {
              const g = this._decorationsTree.getNodeRange(this, d);
              this._onDidChangeDecorations.recordLineAffectedByFontChange(e, h, g.startLineNumber);
            }
            this._decorationsTree.delete(d), r || this._onDidChangeDecorations.checkAffectedAndFire(d.options);
          }
        }
        if (c < l) {
          if (!d) {
            const w = ++this._lastDecorationId, E = `${this._instanceId};${w}`;
            d = new e4e(E, 0, 0), this._decorations[E] = d;
          }
          const h = n[c], g = this._validateRangeRelaxedNoAllocations(h.range), m = ATe(h.options), _ = this._buffer.getOffsetAt(g.startLineNumber, g.startColumn), v = this._buffer.getOffsetAt(g.endLineNumber, g.endColumn);
          d.ownerId = e, d.reset(s, _, v, g), d.setOptions(m), d.options.after && this._onDidChangeDecorations.recordLineAffectedByInjectedText(g.endLineNumber), d.options.before && this._onDidChangeDecorations.recordLineAffectedByInjectedText(g.startLineNumber), d.options.lineHeight !== null && this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e, d.id, g.startLineNumber, d.options.lineHeight), d.options.affectsFont && this._onDidChangeDecorations.recordLineAffectedByFontChange(e, d.id, g.startLineNumber), r || this._onDidChangeDecorations.checkAffectedAndFire(m), this._decorationsTree.insert(d), u[c] = d.id, c++;
        } else
          d && delete this._decorations[d.id];
      }
      return u;
    } finally {
      this._onDidChangeDecorations.endDeferredEmit();
    }
  }
  //#endregion
  //#region Tokenization
  // TODO move them to the tokenization part.
  getLanguageId() {
    return this.tokenization.getLanguageId();
  }
  setLanguage(e, t) {
    typeof e == "string" ? (this._languageSelectionListener.clear(), this._setLanguage(e, t)) : (this._languageSelectionListener.value = e.onDidChange(() => this._setLanguage(e.languageId, t)), this._setLanguage(e.languageId, t));
  }
  _setLanguage(e, t) {
    this.tokenization.setLanguageId(e, t), this._languageService.requestRichLanguageFeatures(e);
  }
  getLanguageIdAtPosition(e, t) {
    return this.tokenization.getLanguageIdAtPosition(e, t);
  }
  getWordAtPosition(e) {
    return this._tokenizationTextModelPart.getWordAtPosition(e);
  }
  getWordUntilPosition(e) {
    return this._tokenizationTextModelPart.getWordUntilPosition(e);
  }
  //#endregion
  normalizePosition(e, t) {
    return e;
  }
  /**
   * Gets the column at which indentation stops at a given line.
   * @internal
  */
  getLineIndentColumn(e) {
    return Mre(this.getLineContent(e)) + 1;
  }
  toString() {
    return `TextModel(${this.uri.toString()})`;
  }
}, EE = Gp, Gp._MODEL_SYNC_LIMIT = 50 * 1024 * 1024, Gp.LARGE_FILE_SIZE_THRESHOLD = 20 * 1024 * 1024, Gp.LARGE_FILE_LINE_COUNT_THRESHOLD = 300 * 1e3, Gp.LARGE_FILE_HEAP_OPERATION_THRESHOLD = 256 * 1024 * 1024, Gp.DEFAULT_CREATION_OPTIONS = {
  isForSimpleWidget: !1,
  tabSize: Gl.tabSize,
  indentSize: Gl.indentSize,
  insertSpaces: Gl.insertSpaces,
  detectIndentation: !1,
  defaultEOL: 1,
  trimAutoWhitespace: Gl.trimAutoWhitespace,
  largeFileOptimizations: Gl.largeFileOptimizations,
  bracketPairColorizationOptions: Gl.bracketPairColorizationOptions
}, Gp);
cT = EE = Hgt([
  K7(4, ige),
  K7(5, Gr),
  K7(6, Ls),
  K7(7, xt)
], cT);
function Mre(i) {
  let e = 0;
  for (const t of i)
    if (t === " " || t === "	")
      e++;
    else
      break;
  return e;
}
function bee(i) {
  return !!(i.options.overviewRuler && i.options.overviewRuler.color);
}
function Ggt(i) {
  return !!i.after || !!i.before;
}
function RW(i) {
  return !!i.options.after || !!i.options.before;
}
class NTe {
  constructor() {
    this._decorationsTree0 = new pee(), this._decorationsTree1 = new pee(), this._injectedTextDecorationsTree = new pee();
  }
  ensureAllNodesHaveRanges(e) {
    this.getAll(e, 0, !1, !1, !1, !1);
  }
  _ensureNodesHaveRanges(e, t) {
    for (const n of t)
      n.range === null && (n.range = e.getRangeAt(n.cachedAbsoluteStart, n.cachedAbsoluteEnd));
    return t;
  }
  getAllInInterval(e, t, n, r, s, o, a) {
    const l = e.getVersionId(), c = this._intervalSearch(t, n, r, s, o, l, a);
    return this._ensureNodesHaveRanges(e, c);
  }
  _intervalSearch(e, t, n, r, s, o, a) {
    const l = this._decorationsTree0.intervalSearch(e, t, n, r, s, o, a), c = this._decorationsTree1.intervalSearch(e, t, n, r, s, o, a), u = this._injectedTextDecorationsTree.intervalSearch(e, t, n, r, s, o, a);
    return l.concat(c).concat(u);
  }
  getInjectedTextInInterval(e, t, n, r) {
    const s = e.getVersionId(), o = this._injectedTextDecorationsTree.intervalSearch(t, n, r, !1, !1, s, !1);
    return this._ensureNodesHaveRanges(e, o).filter((a) => a.options.showIfCollapsed || !a.range.isEmpty());
  }
  getFontDecorationsInInterval(e, t, n, r) {
    const s = e.getVersionId(), o = this._decorationsTree0.intervalSearch(t, n, r, !1, !1, s, !1);
    return this._ensureNodesHaveRanges(e, o).filter((a) => a.options.affectsFont);
  }
  getAllInjectedText(e, t) {
    const n = e.getVersionId(), r = this._injectedTextDecorationsTree.search(t, !1, !1, n, !1);
    return this._ensureNodesHaveRanges(e, r).filter((s) => s.options.showIfCollapsed || !s.range.isEmpty());
  }
  getAllCustomLineHeights(e, t) {
    const n = e.getVersionId(), r = this._search(t, !1, !1, !1, n, !1);
    return this._ensureNodesHaveRanges(e, r).filter((s) => typeof s.options.lineHeight == "number");
  }
  getAll(e, t, n, r, s, o) {
    const a = e.getVersionId(), l = this._search(t, n, r, s, a, o);
    return this._ensureNodesHaveRanges(e, l);
  }
  _search(e, t, n, r, s, o) {
    if (r)
      return this._decorationsTree1.search(e, t, n, s, o);
    {
      const a = this._decorationsTree0.search(e, t, n, s, o), l = this._decorationsTree1.search(e, t, n, s, o), c = this._injectedTextDecorationsTree.search(e, t, n, s, o);
      return a.concat(l).concat(c);
    }
  }
  collectNodesFromOwner(e) {
    const t = this._decorationsTree0.collectNodesFromOwner(e), n = this._decorationsTree1.collectNodesFromOwner(e), r = this._injectedTextDecorationsTree.collectNodesFromOwner(e);
    return t.concat(n).concat(r);
  }
  collectNodesPostOrder() {
    const e = this._decorationsTree0.collectNodesPostOrder(), t = this._decorationsTree1.collectNodesPostOrder(), n = this._injectedTextDecorationsTree.collectNodesPostOrder();
    return e.concat(t).concat(n);
  }
  insert(e) {
    RW(e) ? this._injectedTextDecorationsTree.insert(e) : bee(e) ? this._decorationsTree1.insert(e) : this._decorationsTree0.insert(e);
  }
  delete(e) {
    RW(e) ? this._injectedTextDecorationsTree.delete(e) : bee(e) ? this._decorationsTree1.delete(e) : this._decorationsTree0.delete(e);
  }
  getNodeRange(e, t) {
    const n = e.getVersionId();
    return t.cachedVersionId !== n && this._resolveNode(t, n), t.range === null && (t.range = e.getRangeAt(t.cachedAbsoluteStart, t.cachedAbsoluteEnd)), t.range;
  }
  _resolveNode(e, t) {
    RW(e) ? this._injectedTextDecorationsTree.resolveNode(e, t) : bee(e) ? this._decorationsTree1.resolveNode(e, t) : this._decorationsTree0.resolveNode(e, t);
  }
  acceptReplace(e, t, n, r) {
    this._decorationsTree0.acceptReplace(e, t, n, r), this._decorationsTree1.acceptReplace(e, t, n, r), this._injectedTextDecorationsTree.acceptReplace(e, t, n, r);
  }
}
function u_(i) {
  return i.replace(/[^a-z0-9\-_]/gi, " ");
}
class h4e {
  constructor(e) {
    this.color = e.color || "", this.darkColor = e.darkColor || "";
  }
}
class qgt extends h4e {
  constructor(e) {
    super(e), this._resolvedColor = null, this.position = typeof e.position == "number" ? e.position : zh.Center;
  }
  getColor(e) {
    return this._resolvedColor || (e.type !== "light" && this.darkColor ? this._resolvedColor = this._resolveColor(this.darkColor, e) : this._resolvedColor = this._resolveColor(this.color, e)), this._resolvedColor;
  }
  invalidateCachedColor() {
    this._resolvedColor = null;
  }
  _resolveColor(e, t) {
    if (typeof e == "string")
      return e;
    const n = e ? t.getColor(e.id) : null;
    return n ? n.toString() : "";
  }
}
class Kgt {
  constructor(e) {
    this.position = (e == null ? void 0 : e.position) ?? fm.Center, this.persistLane = e == null ? void 0 : e.persistLane;
  }
}
class Ygt extends h4e {
  constructor(e) {
    super(e), this.position = e.position, this.sectionHeaderStyle = e.sectionHeaderStyle ?? null, this.sectionHeaderText = e.sectionHeaderText ?? null;
  }
  getColor(e) {
    return this._resolvedColor || (e.type !== "light" && this.darkColor ? this._resolvedColor = this._resolveColor(this.darkColor, e) : this._resolvedColor = this._resolveColor(this.color, e)), this._resolvedColor;
  }
  invalidateCachedColor() {
    this._resolvedColor = void 0;
  }
  _resolveColor(e, t) {
    return typeof e == "string" ? De.fromHex(e) : t.getColor(e.id);
  }
}
class uw {
  static from(e) {
    return e instanceof uw ? e : new uw(e);
  }
  constructor(e) {
    this.content = e.content || "", this.tokens = e.tokens ?? null, this.inlineClassName = e.inlineClassName || null, this.inlineClassNameAffectsLetterSpacing = e.inlineClassNameAffectsLetterSpacing || !1, this.attachedData = e.attachedData || null, this.cursorStops = e.cursorStops || null;
  }
}
class dn {
  static register(e) {
    return new dn(e);
  }
  static createDynamic(e) {
    return new dn(e);
  }
  constructor(e) {
    this.description = e.description, this.blockClassName = e.blockClassName ? u_(e.blockClassName) : null, this.blockDoesNotCollapse = e.blockDoesNotCollapse ?? null, this.blockIsAfterEnd = e.blockIsAfterEnd ?? null, this.blockPadding = e.blockPadding ?? null, this.stickiness = e.stickiness || 0, this.zIndex = e.zIndex || 0, this.className = e.className ? u_(e.className) : null, this.shouldFillLineOnLineBreak = e.shouldFillLineOnLineBreak ?? null, this.hoverMessage = e.hoverMessage || null, this.glyphMarginHoverMessage = e.glyphMarginHoverMessage || null, this.lineNumberHoverMessage = e.lineNumberHoverMessage || null, this.isWholeLine = e.isWholeLine || !1, this.lineHeight = e.lineHeight ? Math.min(e.lineHeight, $gt) : null, this.fontSize = e.fontSize || null, this.affectsFont = !!e.fontSize || !!e.fontFamily || !!e.fontWeight || !!e.fontStyle, this.showIfCollapsed = e.showIfCollapsed || !1, this.collapseOnReplaceEdit = e.collapseOnReplaceEdit || !1, this.overviewRuler = e.overviewRuler ? new qgt(e.overviewRuler) : null, this.minimap = e.minimap ? new Ygt(e.minimap) : null, this.glyphMargin = e.glyphMarginClassName ? new Kgt(e.glyphMargin) : null, this.glyphMarginClassName = e.glyphMarginClassName ? u_(e.glyphMarginClassName) : null, this.linesDecorationsClassName = e.linesDecorationsClassName ? u_(e.linesDecorationsClassName) : null, this.lineNumberClassName = e.lineNumberClassName ? u_(e.lineNumberClassName) : null, this.linesDecorationsTooltip = e.linesDecorationsTooltip ? ont(e.linesDecorationsTooltip) : null, this.firstLineDecorationClassName = e.firstLineDecorationClassName ? u_(e.firstLineDecorationClassName) : null, this.marginClassName = e.marginClassName ? u_(e.marginClassName) : null, this.inlineClassName = e.inlineClassName ? u_(e.inlineClassName) : null, this.inlineClassNameAffectsLetterSpacing = e.inlineClassNameAffectsLetterSpacing || !1, this.beforeContentClassName = e.beforeContentClassName ? u_(e.beforeContentClassName) : null, this.afterContentClassName = e.afterContentClassName ? u_(e.afterContentClassName) : null, this.after = e.after ? uw.from(e.after) : null, this.before = e.before ? uw.from(e.before) : null, this.hideInCommentTokens = e.hideInCommentTokens ?? !1, this.hideInStringTokens = e.hideInStringTokens ?? !1, this.textDirection = e.textDirection ?? null;
  }
}
dn.EMPTY = dn.register({ description: "empty" });
const RTe = [
  dn.register({
    description: "tracked-range-always-grows-when-typing-at-edges",
    stickiness: 0
    /* model.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */
  }),
  dn.register({
    description: "tracked-range-never-grows-when-typing-at-edges",
    stickiness: 1
    /* model.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
  }),
  dn.register({
    description: "tracked-range-grows-only-when-typing-before",
    stickiness: 2
    /* model.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore */
  }),
  dn.register({
    description: "tracked-range-grows-only-when-typing-after",
    stickiness: 3
    /* model.TrackedRangeStickiness.GrowsOnlyWhenTypingAfter */
  })
];
function ATe(i) {
  return i instanceof dn ? i : dn.createDynamic(i);
}
class OTe {
  static toKey(e) {
    return `${e.ownerId};${e.decorationId};${e.lineNumber}`;
  }
  constructor(e, t, n, r) {
    this.ownerId = e, this.decorationId = t, this.lineNumber = n, this.lineHeight = r;
  }
}
class MTe {
  static toKey(e) {
    return `${e.ownerId};${e.decorationId};${e.lineNumber}`;
  }
  constructor(e, t, n) {
    this.ownerId = e, this.decorationId = t, this.lineNumber = n;
  }
}
class Xgt extends ge {
  constructor(e) {
    super(), this.handleBeforeFire = e, this._actual = this._register(new he()), this.event = this._actual.event, this._affectedInjectedTextLines = null, this._affectedLineHeights = null, this._affectedFontLines = null, this._deferredCnt = 0, this._shouldFireDeferred = !1, this._affectsMinimap = !1, this._affectsOverviewRuler = !1, this._affectsGlyphMargin = !1, this._affectsLineNumber = !1;
  }
  beginDeferredEmit() {
    this._deferredCnt++;
  }
  endDeferredEmit() {
    var e, t, n;
    this._deferredCnt--, this._deferredCnt === 0 && (this._shouldFireDeferred && this.doFire(), (e = this._affectedInjectedTextLines) == null || e.clear(), this._affectedInjectedTextLines = null, (t = this._affectedLineHeights) == null || t.clear(), this._affectedLineHeights = null, (n = this._affectedFontLines) == null || n.clear(), this._affectedFontLines = null);
  }
  recordLineAffectedByInjectedText(e) {
    this._affectedInjectedTextLines || (this._affectedInjectedTextLines = /* @__PURE__ */ new Set()), this._affectedInjectedTextLines.add(e);
  }
  recordLineAffectedByLineHeightChange(e, t, n, r) {
    this._affectedLineHeights || (this._affectedLineHeights = new DTe([], OTe.toKey)), this._affectedLineHeights.add(new OTe(e, t, n, r));
  }
  recordLineAffectedByFontChange(e, t, n) {
    this._affectedFontLines || (this._affectedFontLines = new DTe([], MTe.toKey)), this._affectedFontLines.add(new MTe(e, t, n));
  }
  checkAffectedAndFire(e) {
    var t, n;
    this._affectsMinimap || (this._affectsMinimap = !!((t = e.minimap) != null && t.position)), this._affectsOverviewRuler || (this._affectsOverviewRuler = !!((n = e.overviewRuler) != null && n.color)), this._affectsGlyphMargin || (this._affectsGlyphMargin = !!e.glyphMarginClassName), this._affectsLineNumber || (this._affectsLineNumber = !!e.lineNumberClassName), this.tryFire();
  }
  fire() {
    this._affectsMinimap = !0, this._affectsOverviewRuler = !0, this._affectsGlyphMargin = !0, this.tryFire();
  }
  tryFire() {
    this._deferredCnt === 0 ? this.doFire() : this._shouldFireDeferred = !0;
  }
  doFire() {
    this.handleBeforeFire(this._affectedInjectedTextLines, this._affectedLineHeights, this._affectedFontLines);
    const e = {
      affectsMinimap: this._affectsMinimap,
      affectsOverviewRuler: this._affectsOverviewRuler,
      affectsGlyphMargin: this._affectsGlyphMargin,
      affectsLineNumber: this._affectsLineNumber
    };
    this._shouldFireDeferred = !1, this._affectsMinimap = !1, this._affectsOverviewRuler = !1, this._affectsGlyphMargin = !1, this._actual.fire(e);
  }
}
class Zgt extends ge {
  constructor() {
    super(), this._fastEmitter = this._register(new he()), this.fastEvent = this._fastEmitter.event, this._slowEmitter = this._register(new he()), this.slowEvent = this._slowEmitter.event, this._deferredCnt = 0, this._deferredEvent = null;
  }
  beginDeferredEmit() {
    this._deferredCnt++;
  }
  endDeferredEmit(e = null) {
    if (this._deferredCnt--, this._deferredCnt === 0 && this._deferredEvent !== null) {
      this._deferredEvent.rawContentChangedEvent.resultingSelection = e;
      const t = this._deferredEvent;
      this._deferredEvent = null, this._fastEmitter.fire(t), this._slowEmitter.fire(t);
    }
  }
  fire(e) {
    if (this._deferredCnt > 0) {
      this._deferredEvent ? this._deferredEvent = this._deferredEvent.merge(e) : this._deferredEvent = e;
      return;
    }
    this._fastEmitter.fire(e), this._slowEmitter.fire(e);
  }
}
const St = Vn("ILanguageFeaturesService");
class rge {
  static create(e) {
    return new rge(e.get(
      151
      /* EditorOption.wordWrapBreakBeforeCharacters */
    ), e.get(
      150
      /* EditorOption.wordWrapBreakAfterCharacters */
    ));
  }
  constructor(e, t) {
    this.classifier = new Qgt(e, t);
  }
  createLineBreaksComputer(e, t, n, r, s, o) {
    const a = [], l = [], c = [];
    return {
      addRequest: (u, d, h) => {
        a.push(u), l.push(d), c.push(h);
      },
      finalize: () => {
        const u = e.typicalFullwidthCharacterWidth / e.typicalHalfwidthCharacterWidth, d = [];
        for (let h = 0, g = a.length; h < g; h++) {
          const m = l[h], _ = c[h];
          _ && !_.injectionOptions && !m && !o ? d[h] = Jgt(this.classifier, _, a[h], t, n, u, r, s) : d[h] = ept(this.classifier, a[h], m, t, n, u, r, s, o);
        }
        return Pre.length = 0, Fre.length = 0, d;
      }
    };
  }
}
class Qgt extends YA {
  constructor(e, t) {
    super(
      0
      /* CharacterClass.NONE */
    );
    for (let n = 0; n < e.length; n++)
      this.set(
        e.charCodeAt(n),
        1
        /* CharacterClass.BREAK_BEFORE */
      );
    for (let n = 0; n < t.length; n++)
      this.set(
        t.charCodeAt(n),
        2
        /* CharacterClass.BREAK_AFTER */
      );
  }
  get(e) {
    return e >= 0 && e < 256 ? this._asciiMap[e] : e >= 12352 && e <= 12543 || e >= 13312 && e <= 19903 || e >= 19968 && e <= 40959 ? 3 : this._map.get(e) || this._defaultValue;
  }
}
let Pre = [], Fre = [];
function Jgt(i, e, t, n, r, s, o, a) {
  if (r === -1)
    return null;
  const l = t.length;
  if (l <= 1)
    return null;
  const c = a === "keepAll", u = e.breakOffsets, d = e.breakOffsetsVisibleColumn, h = f4e(t, n, r, s, o), g = r - h, m = Pre, _ = Fre;
  let v = 0, w = 0, E = 0, L = r;
  const T = u.length;
  let D = 0;
  if (D >= 0) {
    let N = Math.abs(d[D] - L);
    for (; D + 1 < T; ) {
      const R = Math.abs(d[D + 1] - L);
      if (R >= N)
        break;
      N = R, D++;
    }
  }
  for (; D < T; ) {
    let N = D < 0 ? 0 : u[D], R = D < 0 ? 0 : d[D];
    w > N && (N = w, R = E);
    let M = 0, B = 0, H = 0, j = 0;
    if (R <= L) {
      let X = R, Y = N === 0 ? 0 : t.charCodeAt(N - 1), G = N === 0 ? 0 : i.get(Y), Q = !0;
      for (let oe = N; oe < l; oe++) {
        const Z = oe, pe = t.charCodeAt(oe);
        let J, ae;
        if (Qo(pe) ? (oe++, J = 0, ae = 2) : (J = i.get(pe), ae = OF(pe, X, n, s)), Z > w && Bre(Y, G, pe, J, c) && (M = Z, B = X), X += ae, X > L) {
          Z > w ? (H = Z, j = X - ae) : (H = oe + 1, j = X), X - B > g && (M = 0), Q = !1;
          break;
        }
        Y = pe, G = J;
      }
      if (Q) {
        v > 0 && (m[v] = u[u.length - 1], _[v] = d[u.length - 1], v++);
        break;
      }
    }
    if (M === 0) {
      let X = R, Y = t.charCodeAt(N), G = i.get(Y), Q = !1;
      for (let oe = N - 1; oe >= w; oe--) {
        const Z = oe + 1, pe = t.charCodeAt(oe);
        if (pe === 9) {
          Q = !0;
          break;
        }
        let J, ae;
        if (ew(pe) ? (oe--, J = 0, ae = 2) : (J = i.get(pe), ae = tw(pe) ? s : 1), X <= L) {
          if (H === 0 && (H = Z, j = X), X <= L - g)
            break;
          if (Bre(pe, J, Y, G, c)) {
            M = Z, B = X;
            break;
          }
        }
        X -= ae, Y = pe, G = J;
      }
      if (M !== 0) {
        const oe = g - (j - B);
        if (oe <= n) {
          const Z = t.charCodeAt(H);
          let pe;
          Qo(Z) ? pe = 2 : pe = OF(Z, j, n, s), oe - pe < 0 && (M = 0);
        }
      }
      if (Q) {
        D--;
        continue;
      }
    }
    if (M === 0 && (M = H, B = j), M <= w) {
      const X = t.charCodeAt(w);
      Qo(X) ? (M = w + 2, B = E + 2) : (M = w + 1, B = E + OF(X, E, n, s));
    }
    for (w = M, m[v] = M, E = B, _[v] = B, v++, L = B + g; D < 0 || D < T && d[D] < B; )
      D++;
    let K = Math.abs(d[D] - L);
    for (; D + 1 < T; ) {
      const X = Math.abs(d[D + 1] - L);
      if (X >= K)
        break;
      K = X, D++;
    }
  }
  return v === 0 ? null : (m.length = v, _.length = v, Pre = e.breakOffsets, Fre = e.breakOffsetsVisibleColumn, e.breakOffsets = m, e.breakOffsetsVisibleColumn = _, e.wrappedTextIndentLength = h, e);
}
function ept(i, e, t, n, r, s, o, a, l) {
  const c = pm.applyInjectedText(e, t);
  let u, d;
  if (t && t.length > 0 ? (u = t.map((H) => H.options), d = t.map((H) => H.column - 1)) : (u = null, d = null), r === -1)
    return u ? new DF(d, u, [c.length], [], 0) : null;
  const h = c.length;
  if (h <= 1)
    return u ? new DF(d, u, [c.length], [], 0) : null;
  const g = a === "keepAll", m = f4e(c, n, r, s, o), _ = r - m, v = [], w = [];
  let E = 0, L = 0, T = 0, D = r, N = c.charCodeAt(0), R = i.get(N), M = OF(N, 0, n, s), B = 1;
  Qo(N) && (M += 1, N = c.charCodeAt(1), R = i.get(N), B++);
  for (let H = B; H < h; H++) {
    const j = H, K = c.charCodeAt(H);
    let X, Y;
    Qo(K) ? (H++, X = 0, Y = 2) : (X = i.get(K), Y = OF(K, M, n, s)), Bre(N, R, K, X, g) && (L = j, T = M), M += Y, l && tpt(c, H) && (M += D), M > D && ((L === 0 || M - T > _) && (L = j, T = M - Y), v[E] = L, w[E] = T, E++, D = T + _, L = 0), N = K, R = X;
  }
  return E === 0 && (!t || t.length === 0) ? null : (v[E] = h, w[E] = M, new DF(d, u, v, w, m));
}
function OF(i, e, t, n) {
  return i === 9 ? t - e % t : tw(i) || i < 32 ? n : 1;
}
function PTe(i, e) {
  return e - i % e;
}
function tpt(i, e) {
  return e >= 2 && (e < 3 || i.charAt(e - 3) !== "\\") && i.charAt(e - 2) === "\\" && i.charAt(e - 1) === "n" && i.includes('"');
}
function Bre(i, e, t, n, r) {
  return t !== 32 && (e === 2 && n !== 2 || e !== 1 && n === 1 || !r && e === 3 && n !== 2 || !r && n === 3 && e !== 1);
}
function f4e(i, e, t, n, r) {
  let s = 0;
  if (r !== 0) {
    const o = Tc(i);
    if (o !== -1) {
      for (let l = 0; l < o; l++) {
        const c = i.charCodeAt(l) === 9 ? PTe(s, e) : 1;
        s += c;
      }
      const a = r === 3 ? 2 : r === 2 ? 1 : 0;
      for (let l = 0; l < a; l++) {
        const c = PTe(s, e);
        s += c;
      }
      s + n > t && (s = 0);
    }
  }
  return s;
}
class wU {
  constructor(e) {
    this._selTrackedRange = null, this._trackSelection = !0, this._setState(e, new ja(new z(1, 1, 1, 1), 0, 0, new de(1, 1), 0), new ja(new z(1, 1, 1, 1), 0, 0, new de(1, 1), 0));
  }
  dispose(e) {
    this._removeTrackedRange(e);
  }
  startTrackingSelection(e) {
    this._trackSelection = !0, this._updateTrackedRange(e);
  }
  stopTrackingSelection(e) {
    this._trackSelection = !1, this._removeTrackedRange(e);
  }
  _updateTrackedRange(e) {
    this._trackSelection && (this._selTrackedRange = e.model._setTrackedRange(
      this._selTrackedRange,
      this.modelState.selection,
      0
      /* TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */
    ));
  }
  _removeTrackedRange(e) {
    this._selTrackedRange = e.model._setTrackedRange(
      this._selTrackedRange,
      null,
      0
      /* TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */
    );
  }
  asCursorState() {
    return new Di(this.modelState, this.viewState);
  }
  readSelectionFromMarkers(e) {
    const t = e.model._getTrackedRange(this._selTrackedRange);
    return this.modelState.selection.isEmpty() && !t.isEmpty() ? bt.fromRange(t.collapseToEnd(), this.modelState.selection.getDirection()) : bt.fromRange(t, this.modelState.selection.getDirection());
  }
  ensureValidState(e) {
    this._setState(e, this.modelState, this.viewState);
  }
  setState(e, t, n) {
    this._setState(e, t, n);
  }
  static _validatePositionWithCache(e, t, n, r) {
    return t.equals(n) ? r : e.normalizePosition(
      t,
      2
      /* PositionAffinity.None */
    );
  }
  static _validateViewState(e, t) {
    const n = t.position, r = t.selectionStart.getStartPosition(), s = t.selectionStart.getEndPosition(), o = e.normalizePosition(
      n,
      2
      /* PositionAffinity.None */
    ), a = this._validatePositionWithCache(e, r, n, o), l = this._validatePositionWithCache(e, s, r, a);
    return n.equals(o) && r.equals(a) && s.equals(l) ? t : new ja(z.fromPositions(a, l), t.selectionStartKind, t.selectionStartLeftoverVisibleColumns + r.column - a.column, o, t.leftoverVisibleColumns + n.column - o.column);
  }
  _setState(e, t, n) {
    if (n && (n = wU._validateViewState(e.viewModel, n)), t) {
      const r = e.model.validateRange(t.selectionStart), s = t.selectionStart.equalsRange(r) ? t.selectionStartLeftoverVisibleColumns : 0, o = e.model.validatePosition(t.position), a = t.position.equals(o) ? t.leftoverVisibleColumns : 0;
      t = new ja(r, t.selectionStartKind, s, o, a);
    } else {
      if (!n)
        return;
      const r = e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(n.selectionStart)), s = e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(n.position));
      t = new ja(r, n.selectionStartKind, n.selectionStartLeftoverVisibleColumns, s, n.leftoverVisibleColumns);
    }
    if (n) {
      const r = e.coordinatesConverter.validateViewRange(n.selectionStart, t.selectionStart), s = e.coordinatesConverter.validateViewPosition(n.position, t.position);
      n = new ja(r, t.selectionStartKind, t.selectionStartLeftoverVisibleColumns, s, t.leftoverVisibleColumns);
    } else {
      const r = e.coordinatesConverter.convertModelPositionToViewPosition(new de(t.selectionStart.startLineNumber, t.selectionStart.startColumn)), s = e.coordinatesConverter.convertModelPositionToViewPosition(new de(t.selectionStart.endLineNumber, t.selectionStart.endColumn)), o = new z(r.lineNumber, r.column, s.lineNumber, s.column), a = e.coordinatesConverter.convertModelPositionToViewPosition(t.position);
      n = new ja(o, t.selectionStartKind, t.selectionStartLeftoverVisibleColumns, a, t.leftoverVisibleColumns);
    }
    this.modelState = t, this.viewState = n, this._updateTrackedRange(e);
  }
}
class FTe {
  constructor(e) {
    this.context = e, this.cursors = [new wU(e)], this.lastAddedCursorIndex = 0;
  }
  dispose() {
    for (const e of this.cursors)
      e.dispose(this.context);
  }
  startTrackingSelections() {
    for (const e of this.cursors)
      e.startTrackingSelection(this.context);
  }
  stopTrackingSelections() {
    for (const e of this.cursors)
      e.stopTrackingSelection(this.context);
  }
  updateContext(e) {
    this.context = e;
  }
  ensureValidState() {
    for (const e of this.cursors)
      e.ensureValidState(this.context);
  }
  readSelectionFromMarkers() {
    return this.cursors.map((e) => e.readSelectionFromMarkers(this.context));
  }
  getAll() {
    return this.cursors.map((e) => e.asCursorState());
  }
  getViewPositions() {
    return this.cursors.map((e) => e.viewState.position);
  }
  getTopMostViewPosition() {
    return S3e(this.cursors, yl((e) => e.viewState.position, de.compare)).viewState.position;
  }
  getBottomMostViewPosition() {
    return w3e(this.cursors, yl((e) => e.viewState.position, de.compare)).viewState.position;
  }
  getSelections() {
    return this.cursors.map((e) => e.modelState.selection);
  }
  getViewSelections() {
    return this.cursors.map((e) => e.viewState.selection);
  }
  setSelections(e) {
    this.setStates(Di.fromModelSelections(e));
  }
  getPrimaryCursor() {
    return this.cursors[0].asCursorState();
  }
  setStates(e) {
    e !== null && (this.cursors[0].setState(this.context, e[0].modelState, e[0].viewState), this._setSecondaryStates(e.slice(1)));
  }
  /**
   * Creates or disposes secondary cursors as necessary to match the number of `secondarySelections`.
   */
  _setSecondaryStates(e) {
    const t = this.cursors.length - 1, n = e.length;
    if (t < n) {
      const r = n - t;
      for (let s = 0; s < r; s++)
        this._addSecondaryCursor();
    } else if (t > n) {
      const r = t - n;
      for (let s = 0; s < r; s++)
        this._removeSecondaryCursor(this.cursors.length - 2);
    }
    for (let r = 0; r < n; r++)
      this.cursors[r + 1].setState(this.context, e[r].modelState, e[r].viewState);
  }
  killSecondaryCursors() {
    this._setSecondaryStates([]);
  }
  _addSecondaryCursor() {
    this.cursors.push(new wU(this.context)), this.lastAddedCursorIndex = this.cursors.length - 1;
  }
  getLastAddedCursorIndex() {
    return this.cursors.length === 1 || this.lastAddedCursorIndex === 0 ? 0 : this.lastAddedCursorIndex;
  }
  _removeSecondaryCursor(e) {
    this.lastAddedCursorIndex >= e + 1 && this.lastAddedCursorIndex--, this.cursors[e + 1].dispose(this.context), this.cursors.splice(e + 1, 1);
  }
  normalize() {
    if (this.cursors.length === 1)
      return;
    const e = this.cursors.slice(0), t = [];
    for (let n = 0, r = e.length; n < r; n++)
      t.push({
        index: n,
        selection: e[n].modelState.selection
      });
    t.sort(yl((n) => n.selection, z.compareRangesUsingStarts));
    for (let n = 0; n < t.length - 1; n++) {
      const r = t[n], s = t[n + 1], o = r.selection, a = s.selection;
      if (!this.context.cursorConfig.multiCursorMergeOverlapping)
        continue;
      let l;
      if (a.isEmpty() || o.isEmpty() ? l = a.getStartPosition().isBeforeOrEqual(o.getEndPosition()) : l = a.getStartPosition().isBefore(o.getEndPosition()), l) {
        const c = r.index < s.index ? n : n + 1, u = r.index < s.index ? n + 1 : n, d = t[u].index, h = t[c].index, g = t[u].selection, m = t[c].selection;
        if (!g.equalsSelection(m)) {
          const _ = g.plusRange(m), v = g.selectionStartLineNumber === g.startLineNumber && g.selectionStartColumn === g.startColumn, w = m.selectionStartLineNumber === m.startLineNumber && m.selectionStartColumn === m.startColumn;
          let E;
          d === this.lastAddedCursorIndex ? (E = v, this.lastAddedCursorIndex = h) : E = w;
          let L;
          E ? L = new bt(_.startLineNumber, _.startColumn, _.endLineNumber, _.endColumn) : L = new bt(_.endLineNumber, _.endColumn, _.startLineNumber, _.startColumn), t[c].selection = L;
          const T = Di.fromModelSelection(L);
          e[h].setState(this.context, T.modelState, T.viewState);
        }
        for (const _ of t)
          _.index > d && _.index--;
        e.splice(d, 1), t.splice(u, 1), this._removeSecondaryCursor(d - 1), n--;
      }
    }
  }
}
class BTe {
  constructor(e, t, n, r) {
    this._cursorContextBrand = void 0, this.model = e, this.viewModel = t, this.coordinatesConverter = n, this.cursorConfig = r;
  }
}
class npt {
  constructor() {
    this.type = 0;
  }
}
class ipt {
  constructor() {
    this.type = 1;
  }
}
class rpt {
  constructor(e) {
    this.type = 2, this._source = e;
  }
  hasChanged(e) {
    return this._source.hasChanged(e);
  }
}
class spt {
  constructor(e, t, n) {
    this.selections = e, this.modelSelections = t, this.reason = n, this.type = 3;
  }
}
class sE {
  constructor(e) {
    this.type = 4, e ? (this.affectsMinimap = e.affectsMinimap, this.affectsOverviewRuler = e.affectsOverviewRuler, this.affectsGlyphMargin = e.affectsGlyphMargin, this.affectsLineNumber = e.affectsLineNumber) : (this.affectsMinimap = !0, this.affectsOverviewRuler = !0, this.affectsGlyphMargin = !0, this.affectsLineNumber = !0);
  }
}
class X7 {
  constructor() {
    this.type = 5;
  }
}
class opt {
  constructor(e) {
    this.type = 6, this.isFocused = e;
  }
}
class apt {
  constructor() {
    this.type = 7;
  }
}
class Z7 {
  constructor() {
    this.type = 8;
  }
}
class g4e {
  constructor(e, t) {
    this.fromLineNumber = e, this.count = t, this.type = 9;
  }
}
class Hre {
  constructor(e, t) {
    this.type = 10, this.fromLineNumber = e, this.toLineNumber = t;
  }
}
class Wre {
  constructor(e, t) {
    this.type = 11, this.fromLineNumber = e, this.toLineNumber = t;
  }
}
class MF {
  constructor(e, t, n, r, s, o, a) {
    this.source = e, this.minimalReveal = t, this.range = n, this.selections = r, this.verticalType = s, this.revealHorizontal = o, this.scrollType = a, this.type = 12;
  }
}
class lpt {
  constructor(e) {
    this.type = 13, this.scrollWidth = e.scrollWidth, this.scrollLeft = e.scrollLeft, this.scrollHeight = e.scrollHeight, this.scrollTop = e.scrollTop, this.scrollWidthChanged = e.scrollWidthChanged, this.scrollLeftChanged = e.scrollLeftChanged, this.scrollHeightChanged = e.scrollHeightChanged, this.scrollTopChanged = e.scrollTopChanged;
  }
}
class cpt {
  constructor(e) {
    this.theme = e, this.type = 14;
  }
}
class upt {
  constructor(e) {
    this.type = 15, this.ranges = e;
  }
}
class dpt {
  constructor() {
    this.type = 16;
  }
}
let hpt = class {
  constructor() {
    this.type = 17;
  }
};
class fpt extends ge {
  constructor() {
    super(), this._onEvent = this._register(new he()), this.onEvent = this._onEvent.event, this._eventHandlers = [], this._viewEventQueue = null, this._isConsumingViewEventQueue = !1, this._collector = null, this._collectorCnt = 0, this._outgoingEvents = [];
  }
  emitOutgoingEvent(e) {
    this._addOutgoingEvent(e), this._emitOutgoingEvents();
  }
  _addOutgoingEvent(e) {
    for (let t = 0, n = this._outgoingEvents.length; t < n; t++) {
      const r = this._outgoingEvents[t].kind === e.kind ? this._outgoingEvents[t].attemptToMerge(e) : null;
      if (r) {
        this._outgoingEvents[t] = r;
        return;
      }
    }
    this._outgoingEvents.push(e);
  }
  _emitOutgoingEvents() {
    for (; this._outgoingEvents.length > 0; ) {
      if (this._collector || this._isConsumingViewEventQueue)
        return;
      const e = this._outgoingEvents.shift();
      e.isNoOp() || this._onEvent.fire(e);
    }
  }
  addViewEventHandler(e) {
    for (let t = 0, n = this._eventHandlers.length; t < n; t++)
      this._eventHandlers[t] === e && console.warn("Detected duplicate listener in ViewEventDispatcher", e);
    this._eventHandlers.push(e);
  }
  removeViewEventHandler(e) {
    for (let t = 0; t < this._eventHandlers.length; t++)
      if (this._eventHandlers[t] === e) {
        this._eventHandlers.splice(t, 1);
        break;
      }
  }
  beginEmitViewEvents() {
    return this._collectorCnt++, this._collectorCnt === 1 && (this._collector = new gpt()), this._collector;
  }
  endEmitViewEvents() {
    if (this._collectorCnt--, this._collectorCnt === 0) {
      const e = this._collector.outgoingEvents, t = this._collector.viewEvents;
      this._collector = null;
      for (const n of e)
        this._addOutgoingEvent(n);
      t.length > 0 && this._emitMany(t);
    }
    this._emitOutgoingEvents();
  }
  emitSingleViewEvent(e) {
    try {
      this.beginEmitViewEvents().emitViewEvent(e);
    } finally {
      this.endEmitViewEvents();
    }
  }
  _emitMany(e) {
    this._viewEventQueue ? this._viewEventQueue = this._viewEventQueue.concat(e) : this._viewEventQueue = e, this._isConsumingViewEventQueue || this._consumeViewEventQueue();
  }
  _consumeViewEventQueue() {
    try {
      this._isConsumingViewEventQueue = !0, this._doConsumeQueue();
    } finally {
      this._isConsumingViewEventQueue = !1;
    }
  }
  _doConsumeQueue() {
    for (; this._viewEventQueue; ) {
      const e = this._viewEventQueue;
      this._viewEventQueue = null;
      const t = this._eventHandlers.slice(0);
      for (const n of t)
        n.handleEvents(e);
    }
  }
}
class gpt {
  constructor() {
    this.viewEvents = [], this.outgoingEvents = [];
  }
  emitViewEvent(e) {
    this.viewEvents.push(e);
  }
  emitOutgoingEvent(e) {
    this.outgoingEvents.push(e);
  }
}
class sge {
  constructor(e, t, n, r) {
    this.kind = 0, this._oldContentWidth = e, this._oldContentHeight = t, this.contentWidth = n, this.contentHeight = r, this.contentWidthChanged = this._oldContentWidth !== this.contentWidth, this.contentHeightChanged = this._oldContentHeight !== this.contentHeight;
  }
  isNoOp() {
    return !this.contentWidthChanged && !this.contentHeightChanged;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : new sge(this._oldContentWidth, this._oldContentHeight, e.contentWidth, e.contentHeight);
  }
}
class lK {
  constructor(e, t) {
    this.kind = 1, this.oldHasFocus = e, this.hasFocus = t;
  }
  isNoOp() {
    return this.oldHasFocus === this.hasFocus;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : new lK(this.oldHasFocus, e.hasFocus);
  }
}
class ppt {
  constructor(e, t) {
    this.kind = 2, this.oldHasFocus = e, this.hasFocus = t;
  }
  isNoOp() {
    return this.oldHasFocus === this.hasFocus;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : new lK(this.oldHasFocus, e.hasFocus);
  }
}
class oge {
  constructor(e, t, n, r, s, o, a, l) {
    this.kind = 3, this._oldScrollWidth = e, this._oldScrollLeft = t, this._oldScrollHeight = n, this._oldScrollTop = r, this.scrollWidth = s, this.scrollLeft = o, this.scrollHeight = a, this.scrollTop = l, this.scrollWidthChanged = this._oldScrollWidth !== this.scrollWidth, this.scrollLeftChanged = this._oldScrollLeft !== this.scrollLeft, this.scrollHeightChanged = this._oldScrollHeight !== this.scrollHeight, this.scrollTopChanged = this._oldScrollTop !== this.scrollTop;
  }
  isNoOp() {
    return !this.scrollWidthChanged && !this.scrollLeftChanged && !this.scrollHeightChanged && !this.scrollTopChanged;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : new oge(this._oldScrollWidth, this._oldScrollLeft, this._oldScrollHeight, this._oldScrollTop, e.scrollWidth, e.scrollLeft, e.scrollHeight, e.scrollTop);
  }
}
class mpt {
  constructor() {
    this.kind = 4;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : this;
  }
}
class _pt {
  constructor() {
    this.kind = 5;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : this;
  }
}
class SU {
  constructor(e, t, n, r, s, o, a) {
    this.kind = 7, this.oldSelections = e, this.selections = t, this.oldModelVersionId = n, this.modelVersionId = r, this.source = s, this.reason = o, this.reachedMaxCursorCount = a;
  }
  static _selectionsAreEqual(e, t) {
    if (!e && !t)
      return !0;
    if (!e || !t)
      return !1;
    const n = e.length, r = t.length;
    if (n !== r)
      return !1;
    for (let s = 0; s < n; s++)
      if (!e[s].equalsSelection(t[s]))
        return !1;
    return !0;
  }
  isNoOp() {
    return SU._selectionsAreEqual(this.oldSelections, this.selections) && this.oldModelVersionId === this.modelVersionId;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : new SU(this.oldSelections, e.selections, this.oldModelVersionId, e.modelVersionId, e.source, e.reason, this.reachedMaxCursorCount || e.reachedMaxCursorCount);
  }
}
class bpt {
  constructor() {
    this.kind = 6;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return e.kind !== this.kind ? null : this;
  }
}
class vpt {
  constructor(e) {
    this.event = e, this.kind = 8;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class ypt {
  constructor(e) {
    this.event = e, this.kind = 9;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class Cpt {
  constructor(e) {
    this.event = e, this.kind = 10;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class wpt {
  constructor(e) {
    this.event = e, this.kind = 11;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class Spt {
  constructor(e) {
    this.event = e, this.kind = 12;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class Ept {
  constructor(e) {
    this.event = e, this.kind = 13;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class xpt {
  constructor(e) {
    this.event = e, this.kind = 14;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class Lpt {
  constructor(e) {
    this.event = e, this.kind = 15;
  }
  isNoOp() {
    return !1;
  }
  attemptToMerge(e) {
    return null;
  }
}
class Tpt extends ge {
  constructor(e, t, n, r) {
    super(), this._model = e, this._knownModelVersionId = this._model.getVersionId(), this._viewModel = t, this._coordinatesConverter = n, this.context = new BTe(this._model, this._viewModel, this._coordinatesConverter, r), this._cursors = new FTe(this.context), this._hasFocus = !1, this._isHandling = !1, this._compositionState = null, this._columnSelectData = null, this._autoClosedActions = [], this._prevEditOperationType = 0;
  }
  dispose() {
    this._cursors.dispose(), this._autoClosedActions = or(this._autoClosedActions), super.dispose();
  }
  updateConfiguration(e) {
    this.context = new BTe(this._model, this._viewModel, this._coordinatesConverter, e), this._cursors.updateContext(this.context);
  }
  onLineMappingChanged(e) {
    this._knownModelVersionId === this._model.getVersionId() && this.setStates(e, "viewModel", 0, this.getCursorStates());
  }
  setHasFocus(e) {
    this._hasFocus = e;
  }
  _validateAutoClosedActions() {
    if (this._autoClosedActions.length > 0) {
      const e = this._cursors.getSelections();
      for (let t = 0; t < this._autoClosedActions.length; t++) {
        const n = this._autoClosedActions[t];
        n.isValid(e) || (n.dispose(), this._autoClosedActions.splice(t, 1), t--);
      }
    }
  }
  // ------ some getters/setters
  getPrimaryCursorState() {
    return this._cursors.getPrimaryCursor();
  }
  getLastAddedCursorIndex() {
    return this._cursors.getLastAddedCursorIndex();
  }
  getCursorStates() {
    return this._cursors.getAll();
  }
  setStates(e, t, n, r) {
    let s = !1;
    const o = this.context.cursorConfig.multiCursorLimit;
    r !== null && r.length > o && (r = r.slice(0, o), s = !0);
    const a = PF.from(this._model, this);
    return this._cursors.setStates(r), this._cursors.normalize(), this._columnSelectData = null, this._validateAutoClosedActions(), this._emitStateChangedIfNecessary(e, t, n, a, s);
  }
  setCursorColumnSelectData(e) {
    this._columnSelectData = e;
  }
  revealAll(e, t, n, r, s, o) {
    const a = this._cursors.getViewPositions();
    let l = null, c = null;
    a.length > 1 ? c = this._cursors.getViewSelections() : l = z.fromPositions(a[0], a[0]), e.emitViewEvent(new MF(t, n, l, c, r, s, o));
  }
  revealPrimary(e, t, n, r, s, o) {
    const l = [this._cursors.getPrimaryCursor().viewState.selection];
    e.emitViewEvent(new MF(t, n, null, l, r, s, o));
  }
  saveState() {
    const e = [], t = this._cursors.getSelections();
    for (let n = 0, r = t.length; n < r; n++) {
      const s = t[n];
      e.push({
        inSelectionMode: !s.isEmpty(),
        selectionStart: {
          lineNumber: s.selectionStartLineNumber,
          column: s.selectionStartColumn
        },
        position: {
          lineNumber: s.positionLineNumber,
          column: s.positionColumn
        }
      });
    }
    return e;
  }
  restoreState(e, t) {
    const n = [];
    for (let r = 0, s = t.length; r < s; r++) {
      const o = t[r];
      let a = 1, l = 1;
      o.position && o.position.lineNumber && (a = o.position.lineNumber), o.position && o.position.column && (l = o.position.column);
      let c = a, u = l;
      o.selectionStart && o.selectionStart.lineNumber && (c = o.selectionStart.lineNumber), o.selectionStart && o.selectionStart.column && (u = o.selectionStart.column), n.push({
        selectionStartLineNumber: c,
        selectionStartColumn: u,
        positionLineNumber: a,
        positionColumn: l
      });
    }
    this.setStates(e, "restoreState", 0, Di.fromModelSelections(n)), this.revealAll(
      e,
      "restoreState",
      !1,
      0,
      !0,
      1
      /* editorCommon.ScrollType.Immediate */
    );
  }
  onModelContentChanged(e, t) {
    if (t instanceof F3e) {
      if (this._isHandling)
        return;
      this._isHandling = !0;
      try {
        this.setStates(e, "modelChange", 0, this.getCursorStates());
      } finally {
        this._isHandling = !1;
      }
    } else {
      const n = t.rawContentChangedEvent;
      if (this._knownModelVersionId = n.versionId, this._isHandling)
        return;
      const r = n.containsEvent(
        1
        /* RawContentChangedType.Flush */
      );
      if (this._prevEditOperationType = 0, r)
        this._cursors.dispose(), this._cursors = new FTe(this.context), this._validateAutoClosedActions(), this._emitStateChangedIfNecessary(e, "model", 1, null, !1);
      else if (this._hasFocus && n.resultingSelection && n.resultingSelection.length > 0) {
        const s = Di.fromModelSelections(n.resultingSelection);
        this.setStates(e, "modelChange", n.isUndoing ? 5 : n.isRedoing ? 6 : 2, s) && this.revealAll(
          e,
          "modelChange",
          !1,
          0,
          !0,
          0
          /* editorCommon.ScrollType.Smooth */
        );
      } else {
        const s = this._cursors.readSelectionFromMarkers();
        this.setStates(e, "modelChange", 2, Di.fromModelSelections(s));
      }
    }
  }
  getSelection() {
    return this._cursors.getPrimaryCursor().modelState.selection;
  }
  getTopMostViewPosition() {
    return this._cursors.getTopMostViewPosition();
  }
  getBottomMostViewPosition() {
    return this._cursors.getBottomMostViewPosition();
  }
  getCursorColumnSelectData() {
    if (this._columnSelectData)
      return this._columnSelectData;
    const e = this._cursors.getPrimaryCursor(), t = e.viewState.selectionStart.getStartPosition(), n = e.viewState.position;
    return {
      isReal: !1,
      fromViewLineNumber: t.lineNumber,
      fromViewVisualColumn: this.context.cursorConfig.visibleColumnFromColumn(this._viewModel, t),
      toViewLineNumber: n.lineNumber,
      toViewVisualColumn: this.context.cursorConfig.visibleColumnFromColumn(this._viewModel, n)
    };
  }
  getSelections() {
    return this._cursors.getSelections();
  }
  setSelections(e, t, n, r) {
    this.setStates(e, t, r, Di.fromModelSelections(n));
  }
  getPrevEditOperationType() {
    return this._prevEditOperationType;
  }
  setPrevEditOperationType(e) {
    this._prevEditOperationType = e;
  }
  // ------ auxiliary handling logic
  _pushAutoClosedAction(e, t) {
    const n = [], r = [];
    for (let a = 0, l = e.length; a < l; a++)
      n.push({
        range: e[a],
        options: {
          description: "auto-closed-character",
          inlineClassName: "auto-closed-character",
          stickiness: 1
          /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
        }
      }), r.push({
        range: t[a],
        options: {
          description: "auto-closed-enclosing",
          stickiness: 1
          /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
        }
      });
    const s = this._model.deltaDecorations([], n), o = this._model.deltaDecorations([], r);
    this._autoClosedActions.push(new HTe(this._model, s, o));
  }
  _executeEditOperation(e, t) {
    if (!e)
      return;
    e.shouldPushStackElementBefore && this._model.pushStackElement();
    const n = kpt.executeCommands(this._model, this._cursors.getSelections(), e.commands, t);
    if (n) {
      this._interpretCommandResult(n);
      const r = [], s = [];
      for (let o = 0; o < e.commands.length; o++) {
        const a = e.commands[o];
        a instanceof ffe && a.enclosingRange && a.closeCharacterRange && (r.push(a.closeCharacterRange), s.push(a.enclosingRange));
      }
      r.length > 0 && this._pushAutoClosedAction(r, s), this._prevEditOperationType = e.type;
    }
    e.shouldPushStackElementAfter && this._model.pushStackElement();
  }
  _interpretCommandResult(e) {
    (!e || e.length === 0) && (e = this._cursors.readSelectionFromMarkers()), this._columnSelectData = null, this._cursors.setSelections(e), this._cursors.normalize();
  }
  // -----------------------------------------------------------------------------------------------------------
  // ----- emitting events
  _emitStateChangedIfNecessary(e, t, n, r, s) {
    const o = PF.from(this._model, this);
    if (o.equals(r))
      return !1;
    const a = this._cursors.getSelections(), l = this._cursors.getViewSelections();
    if (e.emitViewEvent(new spt(l, a, n)), !r || r.cursorState.length !== o.cursorState.length || o.cursorState.some((c, u) => !c.modelState.equals(r.cursorState[u].modelState))) {
      const c = r ? r.cursorState.map((d) => d.modelState.selection) : null, u = r ? r.modelVersionId : 0;
      e.emitOutgoingEvent(new SU(c, a, u, o.modelVersionId, t || "keyboard", n, s));
    }
    return !0;
  }
  // -----------------------------------------------------------------------------------------------------------
  // ----- handlers beyond this point
  _findAutoClosingPairs(e) {
    if (!e.length)
      return null;
    const t = [];
    for (let n = 0, r = e.length; n < r; n++) {
      const s = e[n];
      if (!s.text || s.text.indexOf(`
`) >= 0)
        return null;
      const o = s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);
      if (!o)
        return null;
      const a = o[1], l = this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);
      if (!l || l.length !== 1)
        return null;
      const c = l[0].open, u = s.text.length - o[2].length - 1, d = s.text.lastIndexOf(c, u - 1);
      if (d === -1)
        return null;
      t.push([d, u]);
    }
    return t;
  }
  executeEdits(e, t, n, r, s) {
    let o = null;
    t === "snippet" && (o = this._findAutoClosingPairs(n)), o && (n[0]._isTracked = !0);
    const a = [], l = [], c = this._model.pushEditOperations(this.getSelections(), n, (u) => {
      if (o)
        for (let h = 0, g = o.length; h < g; h++) {
          const [m, _] = o[h], v = u[h], w = v.range.startLineNumber, E = v.range.startColumn - 1 + m, L = v.range.startColumn - 1 + _;
          a.push(new z(w, L + 1, w, L + 2)), l.push(new z(w, E + 1, w, L + 2));
        }
      const d = r(u);
      return d && (this._isHandling = !0), d;
    }, void 0, s);
    c && (this._isHandling = !1, this.setSelections(
      e,
      t,
      c,
      0
      /* CursorChangeReason.NotSet */
    )), a.length > 0 && this._pushAutoClosedAction(a, l);
  }
  _executeEdit(e, t, n, r = 0) {
    if (this.context.cursorConfig.readOnly)
      return;
    const s = PF.from(this._model, this);
    this._cursors.stopTrackingSelections(), this._isHandling = !0;
    try {
      this._cursors.ensureValidState(), e();
    } catch (o) {
      fn(o);
    }
    this._isHandling = !1, this._cursors.startTrackingSelections(), this._validateAutoClosedActions(), this._emitStateChangedIfNecessary(t, n, r, s, !1) && this.revealAll(
      t,
      n,
      !1,
      0,
      !0,
      0
      /* editorCommon.ScrollType.Smooth */
    );
  }
  getAutoClosedCharacters() {
    return HTe.getAllAutoClosedCharacters(this._autoClosedActions);
  }
  startComposition(e) {
    this._compositionState = new FF(this._model, this.getSelections());
  }
  endComposition(e, t) {
    const n = $l.cursor({ kind: "compositionEnd", detailedSource: t }), r = this._compositionState ? this._compositionState.deduceOutcome(this._model, this.getSelections()) : null;
    this._compositionState = null, this._executeEdit(() => {
      t === "keyboard" && this._executeEditOperation(YC.compositionEndWithInterceptors(this._prevEditOperationType, this.context.cursorConfig, this._model, r, this.getSelections(), this.getAutoClosedCharacters()), n);
    }, e, t);
  }
  type(e, t, n) {
    const r = $l.cursor({ kind: "type", detailedSource: n });
    this._executeEdit(() => {
      if (n === "keyboard") {
        const s = t.length;
        let o = 0;
        for (; o < s; ) {
          const a = Hhe(t, o), l = t.substr(o, a);
          this._executeEditOperation(YC.typeWithInterceptors(!!this._compositionState, this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), this.getAutoClosedCharacters(), l), r), o += a;
        }
      } else
        this._executeEditOperation(YC.typeWithoutInterceptors(this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), t), r);
    }, e, n);
  }
  compositionType(e, t, n, r, s, o) {
    const a = $l.cursor({ kind: "compositionType", detailedSource: o });
    if (t.length === 0 && n === 0 && r === 0) {
      if (s !== 0) {
        const l = this.getSelections().map((c) => {
          const u = c.getPosition();
          return new bt(u.lineNumber, u.column + s, u.lineNumber, u.column + s);
        });
        this.setSelections(
          e,
          o,
          l,
          0
          /* CursorChangeReason.NotSet */
        );
      }
      return;
    }
    this._executeEdit(() => {
      this._executeEditOperation(YC.compositionType(this._prevEditOperationType, this.context.cursorConfig, this._model, this.getSelections(), t, n, r, s), a);
    }, e, o);
  }
  paste(e, t, n, r, s) {
    const o = $l.cursor({ kind: "paste", detailedSource: s });
    this._executeEdit(
      () => {
        this._executeEditOperation(YC.paste(this.context.cursorConfig, this._model, this.getSelections(), t, n, r || []), o);
      },
      e,
      s,
      4
      /* CursorChangeReason.Paste */
    );
  }
  cut(e, t) {
    const n = $l.cursor({ kind: "cut", detailedSource: t });
    this._executeEdit(() => {
      this._executeEditOperation(iT.cut(this.context.cursorConfig, this._model, this.getSelections()), n);
    }, e, t);
  }
  executeCommand(e, t, n) {
    const r = $l.cursor({ kind: "executeCommand", detailedSource: n });
    this._executeEdit(() => {
      this._cursors.killSecondaryCursors(), this._executeEditOperation(new uu(0, [t], {
        shouldPushStackElementBefore: !1,
        shouldPushStackElementAfter: !1
      }), r);
    }, e, n);
  }
  executeCommands(e, t, n) {
    const r = $l.cursor({ kind: "executeCommands", detailedSource: n });
    this._executeEdit(() => {
      this._executeEditOperation(new uu(0, t, {
        shouldPushStackElementBefore: !1,
        shouldPushStackElementAfter: !1
      }), r);
    }, e, n);
  }
}
class PF {
  static from(e, t) {
    return new PF(e.getVersionId(), t.getCursorStates());
  }
  constructor(e, t) {
    this.modelVersionId = e, this.cursorState = t;
  }
  equals(e) {
    if (!e || this.modelVersionId !== e.modelVersionId || this.cursorState.length !== e.cursorState.length)
      return !1;
    for (let t = 0, n = this.cursorState.length; t < n; t++)
      if (!this.cursorState[t].equals(e.cursorState[t]))
        return !1;
    return !0;
  }
}
class HTe {
  static getAllAutoClosedCharacters(e) {
    let t = [];
    for (const n of e)
      t = t.concat(n.getAutoClosedCharactersRanges());
    return t;
  }
  constructor(e, t, n) {
    this._model = e, this._autoClosedCharactersDecorations = t, this._autoClosedEnclosingDecorations = n;
  }
  dispose() {
    this._autoClosedCharactersDecorations = this._model.deltaDecorations(this._autoClosedCharactersDecorations, []), this._autoClosedEnclosingDecorations = this._model.deltaDecorations(this._autoClosedEnclosingDecorations, []);
  }
  getAutoClosedCharactersRanges() {
    const e = [];
    for (let t = 0; t < this._autoClosedCharactersDecorations.length; t++) {
      const n = this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);
      n && e.push(n);
    }
    return e;
  }
  isValid(e) {
    const t = [];
    for (let n = 0; n < this._autoClosedEnclosingDecorations.length; n++) {
      const r = this._model.getDecorationRange(this._autoClosedEnclosingDecorations[n]);
      if (r && (t.push(r), r.startLineNumber !== r.endLineNumber))
        return !1;
    }
    t.sort(z.compareRangesUsingStarts), e.sort(z.compareRangesUsingStarts);
    for (let n = 0; n < e.length; n++)
      if (n >= t.length || !t[n].strictContainsRange(e[n]))
        return !1;
    return !0;
  }
}
class kpt {
  static executeCommands(e, t, n, r = $l.unknown({ name: "executeCommands" })) {
    const s = {
      model: e,
      selectionsBefore: t,
      trackedRanges: [],
      trackedRangesDirection: []
    }, o = this._innerExecuteCommands(s, n, r);
    for (let a = 0, l = s.trackedRanges.length; a < l; a++)
      s.model._setTrackedRange(
        s.trackedRanges[a],
        null,
        0
        /* TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */
      );
    return o;
  }
  static _innerExecuteCommands(e, t, n) {
    if (this._arrayIsEmpty(t))
      return null;
    const r = this._getEditOperations(e, t);
    if (r.operations.length === 0)
      return null;
    const s = r.operations, o = this._getLoserCursorMap(s);
    if (o.hasOwnProperty("0"))
      return console.warn("Ignoring commands"), null;
    const a = [];
    for (let u = 0, d = s.length; u < d; u++)
      o.hasOwnProperty(s[u].identifier.major.toString()) || a.push(s[u]);
    r.hadTrackedEditOperation && a.length > 0 && (a[0]._isTracked = !0);
    let l = e.model.pushEditOperations(e.selectionsBefore, a, (u) => {
      const d = [];
      for (let m = 0; m < e.selectionsBefore.length; m++)
        d[m] = [];
      for (const m of u)
        m.identifier && d[m.identifier.major].push(m);
      const h = (m, _) => m.identifier.minor - _.identifier.minor, g = [];
      for (let m = 0; m < e.selectionsBefore.length; m++)
        d[m].length > 0 ? (d[m].sort(h), g[m] = t[m].computeCursorState(e.model, {
          getInverseEditOperations: () => d[m],
          getTrackedSelection: (_) => {
            const v = parseInt(_, 10), w = e.model._getTrackedRange(e.trackedRanges[v]);
            return e.trackedRangesDirection[v] === 0 ? new bt(w.startLineNumber, w.startColumn, w.endLineNumber, w.endColumn) : new bt(w.endLineNumber, w.endColumn, w.startLineNumber, w.startColumn);
          }
        })) : g[m] = e.selectionsBefore[m];
      return g;
    }, void 0, n);
    l || (l = e.selectionsBefore);
    const c = [];
    for (const u in o)
      o.hasOwnProperty(u) && c.push(parseInt(u, 10));
    c.sort((u, d) => d - u);
    for (const u of c)
      l.splice(u, 1);
    return l;
  }
  static _arrayIsEmpty(e) {
    for (let t = 0, n = e.length; t < n; t++)
      if (e[t])
        return !1;
    return !0;
  }
  static _getEditOperations(e, t) {
    let n = [], r = !1;
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s];
      if (a) {
        const l = this._getEditOperationsFromCommand(e, s, a);
        n = n.concat(l.operations), r = r || l.hadTrackedEditOperation;
      }
    }
    return {
      operations: n,
      hadTrackedEditOperation: r
    };
  }
  static _getEditOperationsFromCommand(e, t, n) {
    const r = [];
    let s = 0;
    const o = (d, h, g = !1) => {
      z.isEmpty(d) && h === "" || r.push({
        identifier: {
          major: t,
          minor: s++
        },
        range: d,
        text: h,
        forceMoveMarkers: g,
        isAutoWhitespaceEdit: n.insertsAutoWhitespace
      });
    };
    let a = !1;
    const u = {
      addEditOperation: o,
      addTrackedEditOperation: (d, h, g) => {
        a = !0, o(d, h, g);
      },
      trackSelection: (d, h) => {
        const g = bt.liftSelection(d);
        let m;
        if (g.isEmpty())
          if (typeof h == "boolean")
            h ? m = 2 : m = 3;
          else {
            const w = e.model.getLineMaxColumn(g.startLineNumber);
            g.startColumn === w ? m = 2 : m = 3;
          }
        else
          m = 1;
        const _ = e.trackedRanges.length, v = e.model._setTrackedRange(null, g, m);
        return e.trackedRanges[_] = v, e.trackedRangesDirection[_] = g.getDirection(), _.toString();
      }
    };
    try {
      n.getEditOperations(e.model, u);
    } catch (d) {
      return fn(d), {
        operations: [],
        hadTrackedEditOperation: !1
      };
    }
    return {
      operations: r,
      hadTrackedEditOperation: a
    };
  }
  static _getLoserCursorMap(e) {
    e = e.slice(0), e.sort((n, r) => -z.compareRangesUsingEnds(n.range, r.range));
    const t = {};
    for (let n = 1; n < e.length; n++) {
      const r = e[n - 1], s = e[n];
      if (z.getStartPosition(r.range).isBefore(z.getEndPosition(s.range))) {
        let o;
        r.identifier.major > s.identifier.major ? o = r.identifier.major : o = s.identifier.major, t[o.toString()] = !0;
        for (let a = 0; a < e.length; a++)
          e[a].identifier.major === o && (e.splice(a, 1), a < n && n--, a--);
        n > 0 && n--;
      }
    }
    return t;
  }
}
class Dpt {
  constructor(e, t, n, r) {
    this.text = e, this.lineNumber = t, this.startSelectionOffset = n, this.endSelectionOffset = r;
  }
}
class FF {
  static _capture(e, t) {
    const n = [];
    for (const r of t) {
      if (r.startLineNumber !== r.endLineNumber)
        return null;
      const s = r.startLineNumber;
      n.push(new Dpt(e.getLineContent(s), s, r.startColumn - 1, r.endColumn - 1));
    }
    return n;
  }
  constructor(e, t) {
    this._original = FF._capture(e, t);
  }
  /**
   * Returns the inserted text during this composition.
   * If the composition resulted in existing text being changed (i.e. not a pure insertion) it returns null.
   */
  deduceOutcome(e, t) {
    if (!this._original)
      return null;
    const n = FF._capture(e, t);
    if (!n || this._original.length !== n.length)
      return null;
    const r = [];
    for (let s = 0, o = this._original.length; s < o; s++)
      r.push(FF._deduceOutcome(this._original[s], n[s]));
    return r;
  }
  static _deduceOutcome(e, t) {
    const n = Math.min(e.startSelectionOffset, t.startSelectionOffset, jg(e.text, t.text)), r = Math.min(e.text.length - e.endSelectionOffset, t.text.length - t.endSelectionOffset, Gy(e.text, t.text)), s = e.text.substring(n, e.text.length - r), o = n, a = t.text.length - r, l = t.text.substring(o, a), c = new z(t.lineNumber, o + 1, t.lineNumber, a + 1);
    return new oot(s, e.startSelectionOffset - n, e.endSelectionOffset - n, l, t.startSelectionOffset - n, t.endSelectionOffset - n, c);
  }
}
const WTe = {
  getInitialState: () => sA,
  tokenizeEncoded: (i, e, t) => aK(0, t)
};
async function Ipt(i, e, t) {
  if (!t)
    return VTe(e, i.languageIdCodec, WTe);
  const n = await Ys.getOrCreate(t);
  return VTe(e, i.languageIdCodec, n || WTe);
}
function Npt(i, e, t, n, r, s, o) {
  let a = "<div>", l = n, c = 0, u = !0;
  for (let d = 0, h = e.getCount(); d < h; d++) {
    const g = e.getEndOffset(d);
    if (g <= n)
      continue;
    let m = "";
    for (; l < g && l < r; l++) {
      const _ = i.charCodeAt(l);
      switch (_) {
        case 9: {
          let v = s - (l + c) % s;
          for (c += v - 1; v > 0; )
            o && u ? (m += "&#160;", u = !1) : (m += " ", u = !0), v--;
          break;
        }
        case 60:
          m += "&lt;", u = !1;
          break;
        case 62:
          m += "&gt;", u = !1;
          break;
        case 38:
          m += "&amp;", u = !1;
          break;
        case 0:
          m += "&#00;", u = !1;
          break;
        case 65279:
        case 8232:
        case 8233:
        case 133:
          m += "�", u = !1;
          break;
        case 13:
          m += "&#8203", u = !1;
          break;
        case 32:
          o && u ? (m += "&#160;", u = !1) : (m += " ", u = !0);
          break;
        default:
          m += String.fromCharCode(_), u = !1;
      }
    }
    if (a += `<span style="${e.getInlineStyle(d, t)}">${m}</span>`, g > r || l >= r)
      break;
  }
  return a += "</div>", a;
}
function VTe(i, e, t) {
  let n = '<div class="monaco-tokenized-source">';
  const r = $d(i);
  let s = t.getInitialState();
  for (let o = 0, a = r.length; o < a; o++) {
    const l = r[o];
    o > 0 && (n += "<br/>");
    const c = t.tokenizeEncoded(l, !0, s);
    fo.convertToEndOffset(c.tokens, l.length);
    const d = new fo(c.tokens, l, e).inflate();
    let h = 0;
    for (let g = 0, m = d.getCount(); g < m; g++) {
      const _ = d.getClassName(g), v = d.getEndOffset(g);
      n += `<span class="${_}">${Ug(l.substring(h, v))}</span>`, h = v;
    }
    s = c.endState;
  }
  return n += "</div>", n;
}
class Rpt {
  constructor(e, t, n, r, s) {
    this.decorationId = e, this.index = t, this.lineNumber = n, this.specialHeight = r, this.prefixSum = s, this.maximumSpecialHeight = r, this.deleted = !1;
  }
}
class UTe {
  constructor(e, t) {
    if (this._decorationIDToCustomLine = new vee(), this._orderedCustomLines = [], this._pendingSpecialLinesToInsert = [], this._invalidIndex = 0, this._hasPending = !1, this._defaultLineHeight = e, t.length > 0) {
      for (const n of t)
        this.insertOrChangeCustomLineHeight(n.decorationId, n.startLineNumber, n.endLineNumber, n.lineHeight);
      this.commit();
    }
  }
  set defaultLineHeight(e) {
    this._defaultLineHeight = e;
  }
  get defaultLineHeight() {
    return this._defaultLineHeight;
  }
  removeCustomLineHeight(e) {
    const t = this._decorationIDToCustomLine.get(e);
    if (t) {
      this._decorationIDToCustomLine.delete(e);
      for (const n of t)
        n.deleted = !0, this._invalidIndex = Math.min(this._invalidIndex, n.index);
      this._hasPending = !0;
    }
  }
  insertOrChangeCustomLineHeight(e, t, n, r) {
    this.removeCustomLineHeight(e);
    for (let s = t; s <= n; s++) {
      const o = new Rpt(e, -1, s, r, 0);
      this._pendingSpecialLinesToInsert.push(o);
    }
    this._hasPending = !0;
  }
  heightForLineNumber(e) {
    const t = this._binarySearchOverOrderedCustomLinesArray(e);
    return t >= 0 ? this._orderedCustomLines[t].maximumSpecialHeight : this._defaultLineHeight;
  }
  getAccumulatedLineHeightsIncludingLineNumber(e) {
    const t = this._binarySearchOverOrderedCustomLinesArray(e);
    if (t >= 0)
      return this._orderedCustomLines[t].prefixSum + this._orderedCustomLines[t].maximumSpecialHeight;
    if (t === -1)
      return this._defaultLineHeight * e;
    const n = -(t + 1), r = this._orderedCustomLines[n - 1];
    return r.prefixSum + r.maximumSpecialHeight + this._defaultLineHeight * (e - r.lineNumber);
  }
  onLinesDeleted(e, t) {
    const n = t - e + 1, r = this._orderedCustomLines.length, s = this._binarySearchOverOrderedCustomLinesArray(e);
    let o;
    if (s >= 0) {
      o = s;
      for (let d = s - 1; d >= 0 && this._orderedCustomLines[d].lineNumber === e; d--)
        o--;
    } else
      o = s === -(r + 1) && s !== -1 ? r - 1 : -(s + 1);
    const a = this._binarySearchOverOrderedCustomLinesArray(t);
    let l;
    if (a >= 0) {
      l = a;
      for (let d = a + 1; d < r && this._orderedCustomLines[d].lineNumber === t; d++)
        l++;
    } else
      l = a === -(r + 1) && a !== -1 ? r - 1 : -(a + 1);
    const c = l > o, u = l === o && this._orderedCustomLines[o] && this._orderedCustomLines[o].lineNumber >= e && this._orderedCustomLines[o].lineNumber <= t;
    if (c || u) {
      let d = 0;
      for (let N = o; N <= l; N++)
        d = Math.max(d, this._orderedCustomLines[N].maximumSpecialHeight);
      let h = 0;
      if (o > 0) {
        const N = this._orderedCustomLines[o - 1];
        h = N.prefixSum + N.maximumSpecialHeight + this._defaultLineHeight * (e - N.lineNumber - 1);
      } else
        h = e > 0 ? (e - 1) * this._defaultLineHeight : 0;
      const g = this._orderedCustomLines[o], m = this._orderedCustomLines[l], _ = this._orderedCustomLines[l + 1], v = _ && _.lineNumber === t + 1 ? _.maximumSpecialHeight : this._defaultLineHeight, w = m.prefixSum + m.maximumSpecialHeight - g.prefixSum + this._defaultLineHeight * (t - m.lineNumber) + this._defaultLineHeight * (g.lineNumber - e) + v - d, E = /* @__PURE__ */ new Set(), L = [], T = new vee();
      let D = 0;
      for (let N = 0; N < this._orderedCustomLines.length; N++) {
        const R = this._orderedCustomLines[N];
        if (N < o)
          L.push(R), T.add(R.decorationId, R);
        else if (N >= o && N <= l) {
          const M = R.decorationId;
          E.has(M) ? D++ : (R.index -= D, R.lineNumber = e, R.prefixSum = h, R.maximumSpecialHeight = d, L.push(R), T.add(R.decorationId, R));
        } else N > l && (R.index -= D, R.lineNumber -= n, R.prefixSum -= w, L.push(R), T.add(R.decorationId, R));
        E.add(R.decorationId);
      }
      this._orderedCustomLines = L, this._decorationIDToCustomLine = T;
    } else {
      const d = n * this._defaultLineHeight;
      for (let h = l; h < this._orderedCustomLines.length; h++) {
        const g = this._orderedCustomLines[h];
        g.lineNumber > t && (g.lineNumber -= n, g.prefixSum -= d);
      }
    }
  }
  onLinesInserted(e, t) {
    const n = t - e + 1, r = this._binarySearchOverOrderedCustomLinesArray(e);
    let s;
    if (r >= 0) {
      s = r;
      for (let u = r - 1; u >= 0 && this._orderedCustomLines[u].lineNumber === e; u--)
        s--;
    } else
      s = -(r + 1);
    const o = [], a = /* @__PURE__ */ new Set();
    for (let u = s; u < this._orderedCustomLines.length; u++)
      this._orderedCustomLines[u].lineNumber === e && a.add(this._orderedCustomLines[u].decorationId);
    const l = /* @__PURE__ */ new Set();
    for (let u = s - 1; u >= 0; u--)
      this._orderedCustomLines[u].lineNumber === e - 1 && l.add(this._orderedCustomLines[u].decorationId);
    const c = d4e(l, a);
    for (let u = s; u < this._orderedCustomLines.length; u++)
      this._orderedCustomLines[u].lineNumber += n, this._orderedCustomLines[u].prefixSum += this._defaultLineHeight * n;
    if (c.size > 0) {
      for (const u of c) {
        const d = this._decorationIDToCustomLine.get(u);
        if (d) {
          const h = d.reduce((_, v) => Math.min(_, v.lineNumber), e), g = d.reduce((_, v) => Math.max(_, v.lineNumber), e), m = d.reduce((_, v) => Math.max(_, v.specialHeight), 0);
          o.push({
            decorationId: u,
            startLineNumber: h,
            endLineNumber: g,
            lineHeight: m
          });
        }
      }
      for (const u of o)
        this.insertOrChangeCustomLineHeight(u.decorationId, u.startLineNumber, u.endLineNumber, u.lineHeight);
      this.commit();
    }
  }
  commit() {
    if (!this._hasPending)
      return;
    for (const s of this._pendingSpecialLinesToInsert) {
      const o = this._binarySearchOverOrderedCustomLinesArray(s.lineNumber), a = o >= 0 ? o : -(o + 1);
      this._orderedCustomLines.splice(a, 0, s), this._invalidIndex = Math.min(this._invalidIndex, a);
    }
    this._pendingSpecialLinesToInsert = [];
    const e = new vee(), t = [];
    for (let s = 0; s < this._invalidIndex; s++) {
      const o = this._orderedCustomLines[s];
      t.push(o), e.add(o.decorationId, o);
    }
    let n = 0, r = this._invalidIndex > 0 ? t[this._invalidIndex - 1] : void 0;
    for (let s = this._invalidIndex; s < this._orderedCustomLines.length; s++) {
      const o = this._orderedCustomLines[s];
      if (o.deleted) {
        n++;
        continue;
      }
      if (o.index = s - n, r && r.lineNumber === o.lineNumber)
        o.maximumSpecialHeight = r.maximumSpecialHeight, o.prefixSum = r.prefixSum;
      else {
        let a = o.specialHeight;
        for (let c = s; c < this._orderedCustomLines.length; c++) {
          const u = this._orderedCustomLines[c];
          if (!u.deleted) {
            if (u.lineNumber !== o.lineNumber)
              break;
            a = Math.max(a, u.specialHeight);
          }
        }
        o.maximumSpecialHeight = a;
        let l;
        r ? l = r.prefixSum + r.maximumSpecialHeight + this._defaultLineHeight * (o.lineNumber - r.lineNumber - 1) : l = this._defaultLineHeight * (o.lineNumber - 1), o.prefixSum = l;
      }
      r = o, t.push(o), e.add(o.decorationId, o);
    }
    this._orderedCustomLines = t, this._decorationIDToCustomLine = e, this._invalidIndex = 1 / 0, this._hasPending = !1;
  }
  _binarySearchOverOrderedCustomLinesArray(e) {
    return $he(this._orderedCustomLines.length, (t) => {
      const n = this._orderedCustomLines[t];
      return n.lineNumber === e ? 0 : n.lineNumber < e ? -1 : 1;
    });
  }
}
class vee {
  constructor() {
    this._map = /* @__PURE__ */ new Map();
  }
  add(e, t) {
    const n = this._map.get(e);
    n ? n.push(t) : this._map.set(e, [t]);
  }
  get(e) {
    return this._map.get(e);
  }
  delete(e) {
    this._map.delete(e);
  }
}
class Apt {
  constructor() {
    this._hasPending = !1, this._inserts = [], this._changes = [], this._removes = [];
  }
  insert(e) {
    this._hasPending = !0, this._inserts.push(e);
  }
  change(e) {
    this._hasPending = !0, this._changes.push(e);
  }
  remove(e) {
    this._hasPending = !0, this._removes.push(e);
  }
  commit(e) {
    if (!this._hasPending)
      return;
    const t = this._inserts, n = this._changes, r = this._removes;
    this._hasPending = !1, this._inserts = [], this._changes = [], this._removes = [], e._commitPendingChanges(t, n, r);
  }
}
class Opt {
  constructor(e, t, n, r, s) {
    this.id = e, this.afterLineNumber = t, this.ordinal = n, this.height = r, this.minWidth = s, this.prefixSum = 0;
  }
}
var P1;
let Mpt = (P1 = class {
  constructor(e, t, n, r, s) {
    this._instanceId = ePe(++P1.INSTANCE_COUNT), this._pendingChanges = new Apt(), this._lastWhitespaceId = 0, this._arr = [], this._prefixSumValidIndex = -1, this._minWidth = -1, this._lineCount = e, this._paddingTop = n, this._paddingBottom = r, this._lineHeightsManager = new UTe(t, s);
  }
  /**
   * Find the insertion index for a new value inside a sorted array of values.
   * If the value is already present in the sorted array, the insertion index will be after the already existing value.
   */
  static findInsertionIndex(e, t, n) {
    let r = 0, s = e.length;
    for (; r < s; ) {
      const o = r + s >>> 1;
      t === e[o].afterLineNumber ? n < e[o].ordinal ? s = o : r = o + 1 : t < e[o].afterLineNumber ? s = o : r = o + 1;
    }
    return r;
  }
  /**
   * Change the height of a line in pixels.
   */
  setDefaultLineHeight(e) {
    this._lineHeightsManager.defaultLineHeight = e;
  }
  /**
   * Changes the padding used to calculate vertical offsets.
   */
  setPadding(e, t) {
    this._paddingTop = e, this._paddingBottom = t;
  }
  /**
   * Set the number of lines.
   *
   * @param lineCount New number of lines.
   */
  onFlushed(e, t) {
    this._lineCount = e, this._lineHeightsManager = new UTe(this._lineHeightsManager.defaultLineHeight, t);
  }
  changeLineHeights(e) {
    let t = !1;
    try {
      e({
        insertOrChangeCustomLineHeight: (r, s, o, a) => {
          t = !0, this._lineHeightsManager.insertOrChangeCustomLineHeight(r, s, o, a);
        },
        removeCustomLineHeight: (r) => {
          t = !0, this._lineHeightsManager.removeCustomLineHeight(r);
        }
      });
    } finally {
      this._lineHeightsManager.commit();
    }
    return t;
  }
  changeWhitespace(e) {
    let t = !1;
    try {
      e({
        insertWhitespace: (r, s, o, a) => {
          t = !0, r = r | 0, s = s | 0, o = o | 0, a = a | 0;
          const l = this._instanceId + ++this._lastWhitespaceId;
          return this._pendingChanges.insert(new Opt(l, r, s, o, a)), l;
        },
        changeOneWhitespace: (r, s, o) => {
          t = !0, s = s | 0, o = o | 0, this._pendingChanges.change({ id: r, newAfterLineNumber: s, newHeight: o });
        },
        removeWhitespace: (r) => {
          t = !0, this._pendingChanges.remove({ id: r });
        }
      });
    } finally {
      this._pendingChanges.commit(this);
    }
    return t;
  }
  _commitPendingChanges(e, t, n) {
    if ((e.length > 0 || n.length > 0) && (this._minWidth = -1), e.length + t.length + n.length <= 1) {
      for (const l of e)
        this._insertWhitespace(l);
      for (const l of t)
        this._changeOneWhitespace(l.id, l.newAfterLineNumber, l.newHeight);
      for (const l of n) {
        const c = this._findWhitespaceIndex(l.id);
        c !== -1 && this._removeWhitespace(c);
      }
      return;
    }
    const r = /* @__PURE__ */ new Set();
    for (const l of n)
      r.add(l.id);
    const s = /* @__PURE__ */ new Map();
    for (const l of t)
      s.set(l.id, l);
    const o = (l) => {
      const c = [];
      for (const u of l)
        if (!r.has(u.id)) {
          if (s.has(u.id)) {
            const d = s.get(u.id);
            u.afterLineNumber = d.newAfterLineNumber, u.height = d.newHeight;
          }
          c.push(u);
        }
      return c;
    }, a = o(this._arr).concat(o(e));
    a.sort((l, c) => l.afterLineNumber === c.afterLineNumber ? l.ordinal - c.ordinal : l.afterLineNumber - c.afterLineNumber), this._arr = a, this._prefixSumValidIndex = -1;
  }
  _insertWhitespace(e) {
    const t = P1.findInsertionIndex(this._arr, e.afterLineNumber, e.ordinal);
    this._arr.splice(t, 0, e), this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, t - 1);
  }
  _findWhitespaceIndex(e) {
    const t = this._arr;
    for (let n = 0, r = t.length; n < r; n++)
      if (t[n].id === e)
        return n;
    return -1;
  }
  _changeOneWhitespace(e, t, n) {
    const r = this._findWhitespaceIndex(e);
    if (r !== -1 && (this._arr[r].height !== n && (this._arr[r].height = n, this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, r - 1)), this._arr[r].afterLineNumber !== t)) {
      const s = this._arr[r];
      this._removeWhitespace(r), s.afterLineNumber = t, this._insertWhitespace(s);
    }
  }
  _removeWhitespace(e) {
    this._arr.splice(e, 1), this._prefixSumValidIndex = Math.min(this._prefixSumValidIndex, e - 1);
  }
  /**
   * Notify the layouter that lines have been deleted (a continuous zone of lines).
   *
   * @param fromLineNumber The line number at which the deletion started, inclusive
   * @param toLineNumber The line number at which the deletion ended, inclusive
   */
  onLinesDeleted(e, t) {
    e = e | 0, t = t | 0, this._lineCount -= t - e + 1;
    for (let n = 0, r = this._arr.length; n < r; n++) {
      const s = this._arr[n].afterLineNumber;
      e <= s && s <= t ? this._arr[n].afterLineNumber = e - 1 : s > t && (this._arr[n].afterLineNumber -= t - e + 1);
    }
    this._lineHeightsManager.onLinesDeleted(e, t);
  }
  /**
   * Notify the layouter that lines have been inserted (a continuous zone of lines).
   *
   * @param fromLineNumber The line number at which the insertion started, inclusive
   * @param toLineNumber The line number at which the insertion ended, inclusive.
   */
  onLinesInserted(e, t) {
    e = e | 0, t = t | 0, this._lineCount += t - e + 1;
    for (let n = 0, r = this._arr.length; n < r; n++) {
      const s = this._arr[n].afterLineNumber;
      e <= s && (this._arr[n].afterLineNumber += t - e + 1);
    }
    this._lineHeightsManager.onLinesInserted(e, t);
  }
  /**
   * Get the sum of all the whitespaces.
   */
  getWhitespacesTotalHeight() {
    return this._arr.length === 0 ? 0 : this.getWhitespacesAccumulatedHeight(this._arr.length - 1);
  }
  /**
   * Return the sum of the heights of the whitespaces at [0..index].
   * This includes the whitespace at `index`.
   *
   * @param index The index of the whitespace.
   * @return The sum of the heights of all whitespaces before the one at `index`, including the one at `index`.
   */
  getWhitespacesAccumulatedHeight(e) {
    e = e | 0;
    let t = Math.max(0, this._prefixSumValidIndex + 1);
    t === 0 && (this._arr[0].prefixSum = this._arr[0].height, t++);
    for (let n = t; n <= e; n++)
      this._arr[n].prefixSum = this._arr[n - 1].prefixSum + this._arr[n].height;
    return this._prefixSumValidIndex = Math.max(this._prefixSumValidIndex, e), this._arr[e].prefixSum;
  }
  /**
   * Get the sum of heights for all objects.
   *
   * @return The sum of heights for all objects.
   */
  getLinesTotalHeight() {
    const e = this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(this._lineCount), t = this.getWhitespacesTotalHeight();
    return e + t + this._paddingTop + this._paddingBottom;
  }
  /**
   * Returns the accumulated height of whitespaces before the given line number.
   *
   * @param lineNumber The line number
   */
  getWhitespaceAccumulatedHeightBeforeLineNumber(e) {
    e = e | 0;
    const t = this._findLastWhitespaceBeforeLineNumber(e);
    return t === -1 ? 0 : this.getWhitespacesAccumulatedHeight(t);
  }
  _findLastWhitespaceBeforeLineNumber(e) {
    e = e | 0;
    const t = this._arr;
    let n = 0, r = t.length - 1;
    for (; n <= r; ) {
      const o = (r - n | 0) / 2 | 0, a = n + o | 0;
      if (t[a].afterLineNumber < e) {
        if (a + 1 >= t.length || t[a + 1].afterLineNumber >= e)
          return a;
        n = a + 1 | 0;
      } else
        r = a - 1 | 0;
    }
    return -1;
  }
  _findFirstWhitespaceAfterLineNumber(e) {
    e = e | 0;
    const n = this._findLastWhitespaceBeforeLineNumber(e) + 1;
    return n < this._arr.length ? n : -1;
  }
  /**
   * Find the index of the first whitespace which has `afterLineNumber` >= `lineNumber`.
   * @return The index of the first whitespace with `afterLineNumber` >= `lineNumber` or -1 if no whitespace is found.
   */
  getFirstWhitespaceIndexAfterLineNumber(e) {
    return e = e | 0, this._findFirstWhitespaceAfterLineNumber(e);
  }
  /**
   * Get the vertical offset (the sum of heights for all objects above) a certain line number.
   *
   * @param lineNumber The line number
   * @return The sum of heights for all objects above `lineNumber`.
   */
  getVerticalOffsetForLineNumber(e, t = !1) {
    e = e | 0;
    let n;
    e > 1 ? n = this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e - 1) : n = 0;
    const r = this.getWhitespaceAccumulatedHeightBeforeLineNumber(e - (t ? 1 : 0));
    return n + r + this._paddingTop;
  }
  getLineHeightForLineNumber(e) {
    return this._lineHeightsManager.heightForLineNumber(e);
  }
  /**
   * Get the vertical offset (the sum of heights for all objects above) a certain line number and also the line height of the line.
   *
   * @param lineNumber The line number
   * @return The sum of heights for all objects above `lineNumber`.
   */
  getVerticalOffsetAfterLineNumber(e, t = !1) {
    e = e | 0;
    const n = this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e), r = this.getWhitespaceAccumulatedHeightBeforeLineNumber(e + (t ? 1 : 0));
    return n + r + this._paddingTop;
  }
  /**
   * The maximum min width for all whitespaces.
   */
  getWhitespaceMinWidth() {
    if (this._minWidth === -1) {
      let e = 0;
      for (let t = 0, n = this._arr.length; t < n; t++)
        e = Math.max(e, this._arr[t].minWidth);
      this._minWidth = e;
    }
    return this._minWidth;
  }
  /**
   * Check if `verticalOffset` is below all lines.
   */
  isAfterLines(e) {
    const t = this.getLinesTotalHeight();
    return e > t;
  }
  isInTopPadding(e) {
    return this._paddingTop === 0 ? !1 : e < this._paddingTop;
  }
  isInBottomPadding(e) {
    if (this._paddingBottom === 0)
      return !1;
    const t = this.getLinesTotalHeight();
    return e >= t - this._paddingBottom;
  }
  /**
   * Find the first line number that is at or after vertical offset `verticalOffset`.
   * i.e. if getVerticalOffsetForLine(line) is x and getVerticalOffsetForLine(line + 1) is y, then
   * getLineNumberAtOrAfterVerticalOffset(i) = line, x <= i < y.
   *
   * @param verticalOffset The vertical offset to search at.
   * @return The line number at or after vertical offset `verticalOffset`.
   */
  getLineNumberAtOrAfterVerticalOffset(e) {
    if (e = e | 0, e < 0)
      return 1;
    const t = this._lineCount | 0;
    let n = 1, r = t;
    for (; n < r; ) {
      const s = (n + r) / 2 | 0, o = this.getLineHeightForLineNumber(s), a = this.getVerticalOffsetForLineNumber(s) | 0;
      if (e >= a + o)
        n = s + 1;
      else {
        if (e >= a)
          return s;
        r = s;
      }
    }
    return n > t ? t : n;
  }
  /**
   * Get all the lines and their relative vertical offsets that are positioned between `verticalOffset1` and `verticalOffset2`.
   *
   * @param verticalOffset1 The beginning of the viewport.
   * @param verticalOffset2 The end of the viewport.
   * @return A structure describing the lines positioned between `verticalOffset1` and `verticalOffset2`.
   */
  getLinesViewportData(e, t) {
    e = e | 0, t = t | 0;
    const n = this.getLineNumberAtOrAfterVerticalOffset(e) | 0, r = this.getVerticalOffsetForLineNumber(n) | 0;
    let s = this._lineCount | 0, o = this.getFirstWhitespaceIndexAfterLineNumber(n) | 0;
    const a = this.getWhitespacesCount() | 0;
    let l, c;
    o === -1 ? (o = a, c = s + 1, l = 0) : (c = this.getAfterLineNumberForWhitespaceIndex(o) | 0, l = this.getHeightForWhitespaceIndex(o) | 0);
    let u = r, d = u;
    const h = 5e5;
    let g = 0;
    r >= h && (g = Math.floor(r / h) * h, g = Math.floor(g / this._lineHeightsManager.defaultLineHeight) * this._lineHeightsManager.defaultLineHeight, d -= g);
    const m = [], _ = e + (t - e) / 2;
    let v = -1;
    for (let T = n; T <= s; T++) {
      const D = this.getLineHeightForLineNumber(T);
      if (v === -1) {
        const N = u, R = u + D;
        (N <= _ && _ < R || N > _) && (v = T);
      }
      for (u += D, m[T - n] = d, d += D; c === T; )
        d += l, u += l, o++, o >= a ? c = s + 1 : (c = this.getAfterLineNumberForWhitespaceIndex(o) | 0, l = this.getHeightForWhitespaceIndex(o) | 0);
      if (u >= t) {
        s = T;
        break;
      }
    }
    v === -1 && (v = s);
    const w = this.getVerticalOffsetForLineNumber(s) | 0;
    let E = n, L = s;
    if (E < L && r < e && E++, E < L) {
      const T = this.getLineHeightForLineNumber(s);
      w + T > t && L--;
    }
    return {
      bigNumbersDelta: g,
      startLineNumber: n,
      endLineNumber: s,
      relativeVerticalOffset: m,
      centeredLineNumber: v,
      completelyVisibleStartLineNumber: E,
      completelyVisibleEndLineNumber: L,
      lineHeight: this._lineHeightsManager.defaultLineHeight
    };
  }
  getVerticalOffsetForWhitespaceIndex(e) {
    e = e | 0;
    const t = this.getAfterLineNumberForWhitespaceIndex(e);
    let n;
    t >= 1 ? n = this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t) : n = 0;
    let r;
    return e > 0 ? r = this.getWhitespacesAccumulatedHeight(e - 1) : r = 0, n + r + this._paddingTop;
  }
  getWhitespaceIndexAtOrAfterVerticallOffset(e) {
    e = e | 0;
    let t = 0, n = this.getWhitespacesCount() - 1;
    if (n < 0)
      return -1;
    const r = this.getVerticalOffsetForWhitespaceIndex(n), s = this.getHeightForWhitespaceIndex(n);
    if (e >= r + s)
      return -1;
    for (; t < n; ) {
      const o = Math.floor((t + n) / 2), a = this.getVerticalOffsetForWhitespaceIndex(o), l = this.getHeightForWhitespaceIndex(o);
      if (e >= a + l)
        t = o + 1;
      else {
        if (e >= a)
          return o;
        n = o;
      }
    }
    return t;
  }
  /**
   * Get exactly the whitespace that is layouted at `verticalOffset`.
   *
   * @param verticalOffset The vertical offset.
   * @return Precisely the whitespace that is layouted at `verticaloffset` or null.
   */
  getWhitespaceAtVerticalOffset(e) {
    e = e | 0;
    const t = this.getWhitespaceIndexAtOrAfterVerticallOffset(e);
    if (t < 0 || t >= this.getWhitespacesCount())
      return null;
    const n = this.getVerticalOffsetForWhitespaceIndex(t);
    if (n > e)
      return null;
    const r = this.getHeightForWhitespaceIndex(t), s = this.getIdForWhitespaceIndex(t), o = this.getAfterLineNumberForWhitespaceIndex(t);
    return {
      id: s,
      afterLineNumber: o,
      verticalOffset: n,
      height: r
    };
  }
  /**
   * Get a list of whitespaces that are positioned between `verticalOffset1` and `verticalOffset2`.
   *
   * @param verticalOffset1 The beginning of the viewport.
   * @param verticalOffset2 The end of the viewport.
   * @return An array with all the whitespaces in the viewport. If no whitespace is in viewport, the array is empty.
   */
  getWhitespaceViewportData(e, t) {
    e = e | 0, t = t | 0;
    const n = this.getWhitespaceIndexAtOrAfterVerticallOffset(e), r = this.getWhitespacesCount() - 1;
    if (n < 0)
      return [];
    const s = [];
    for (let o = n; o <= r; o++) {
      const a = this.getVerticalOffsetForWhitespaceIndex(o), l = this.getHeightForWhitespaceIndex(o);
      if (a >= t)
        break;
      s.push({
        id: this.getIdForWhitespaceIndex(o),
        afterLineNumber: this.getAfterLineNumberForWhitespaceIndex(o),
        verticalOffset: a,
        height: l
      });
    }
    return s;
  }
  /**
   * Get all whitespaces.
   */
  getWhitespaces() {
    return this._arr.slice(0);
  }
  /**
   * The number of whitespaces.
   */
  getWhitespacesCount() {
    return this._arr.length;
  }
  /**
   * Get the `id` for whitespace at index `index`.
   *
   * @param index The index of the whitespace.
   * @return `id` of whitespace at `index`.
   */
  getIdForWhitespaceIndex(e) {
    return e = e | 0, this._arr[e].id;
  }
  /**
   * Get the `afterLineNumber` for whitespace at index `index`.
   *
   * @param index The index of the whitespace.
   * @return `afterLineNumber` of whitespace at `index`.
   */
  getAfterLineNumberForWhitespaceIndex(e) {
    return e = e | 0, this._arr[e].afterLineNumber;
  }
  /**
   * Get the `height` for whitespace at index `index`.
   *
   * @param index The index of the whitespace.
   * @return `height` of whitespace at `index`.
   */
  getHeightForWhitespaceIndex(e) {
    return e = e | 0, this._arr[e].height;
  }
}, P1.INSTANCE_COUNT = 0, P1);
const Ppt = 125;
class GP {
  constructor(e, t, n, r) {
    e = e | 0, t = t | 0, n = n | 0, r = r | 0, e < 0 && (e = 0), t < 0 && (t = 0), n < 0 && (n = 0), r < 0 && (r = 0), this.width = e, this.contentWidth = t, this.scrollWidth = Math.max(e, t), this.height = n, this.contentHeight = r, this.scrollHeight = Math.max(n, r);
  }
  equals(e) {
    return this.width === e.width && this.contentWidth === e.contentWidth && this.height === e.height && this.contentHeight === e.contentHeight;
  }
}
class Fpt extends ge {
  constructor(e, t) {
    super(), this._onDidContentSizeChange = this._register(new he()), this.onDidContentSizeChange = this._onDidContentSizeChange.event, this._dimensions = new GP(0, 0, 0, 0), this._scrollable = this._register(new n2({
      forceIntegerValues: !0,
      smoothScrollDuration: e,
      scheduleAtNextAnimationFrame: t
    })), this.onDidScroll = this._scrollable.onScroll;
  }
  getScrollable() {
    return this._scrollable;
  }
  setSmoothScrollDuration(e) {
    this._scrollable.setSmoothScrollDuration(e);
  }
  validateScrollPosition(e) {
    return this._scrollable.validateScrollPosition(e);
  }
  getScrollDimensions() {
    return this._dimensions;
  }
  setScrollDimensions(e) {
    if (this._dimensions.equals(e))
      return;
    const t = this._dimensions;
    this._dimensions = e, this._scrollable.setScrollDimensions({
      width: e.width,
      scrollWidth: e.scrollWidth,
      height: e.height,
      scrollHeight: e.scrollHeight
    }, !0);
    const n = t.contentWidth !== e.contentWidth, r = t.contentHeight !== e.contentHeight;
    (n || r) && this._onDidContentSizeChange.fire(new sge(t.contentWidth, t.contentHeight, e.contentWidth, e.contentHeight));
  }
  getFutureScrollPosition() {
    return this._scrollable.getFutureScrollPosition();
  }
  getCurrentScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
  setScrollPositionNow(e) {
    this._scrollable.setScrollPositionNow(e);
  }
  setScrollPositionSmooth(e) {
    this._scrollable.setScrollPositionSmooth(e);
  }
  hasPendingScrollAnimation() {
    return this._scrollable.hasPendingScrollAnimation();
  }
}
class Bpt extends ge {
  constructor(e, t, n, r) {
    super(), this._configuration = e;
    const s = this._configuration.options, o = s.get(
      165
      /* EditorOption.layoutInfo */
    ), a = s.get(
      96
      /* EditorOption.padding */
    );
    this._linesLayout = new Mpt(t, s.get(
      75
      /* EditorOption.lineHeight */
    ), a.top, a.bottom, n), this._maxLineWidth = 0, this._overlayWidgetsMinWidth = 0, this._scrollable = this._register(new Fpt(0, r)), this._configureSmoothScrollDuration(), this._scrollable.setScrollDimensions(new GP(o.contentWidth, 0, o.height, 0)), this.onDidScroll = this._scrollable.onDidScroll, this.onDidContentSizeChange = this._scrollable.onDidContentSizeChange, this._updateHeight();
  }
  dispose() {
    super.dispose();
  }
  getScrollable() {
    return this._scrollable.getScrollable();
  }
  onHeightMaybeChanged() {
    this._updateHeight();
  }
  _configureSmoothScrollDuration() {
    this._scrollable.setSmoothScrollDuration(this._configuration.options.get(
      130
      /* EditorOption.smoothScrolling */
    ) ? Ppt : 0);
  }
  // ---- begin view event handlers
  onConfigurationChanged(e) {
    const t = this._configuration.options;
    if (e.hasChanged(
      75
      /* EditorOption.lineHeight */
    ) && this._linesLayout.setDefaultLineHeight(t.get(
      75
      /* EditorOption.lineHeight */
    )), e.hasChanged(
      96
      /* EditorOption.padding */
    )) {
      const n = t.get(
        96
        /* EditorOption.padding */
      );
      this._linesLayout.setPadding(n.top, n.bottom);
    }
    if (e.hasChanged(
      165
      /* EditorOption.layoutInfo */
    )) {
      const n = t.get(
        165
        /* EditorOption.layoutInfo */
      ), r = n.contentWidth, s = n.height, o = this._scrollable.getScrollDimensions(), a = o.contentWidth;
      this._scrollable.setScrollDimensions(new GP(r, o.contentWidth, s, this._getContentHeight(r, s, a)));
    } else
      this._updateHeight();
    e.hasChanged(
      130
      /* EditorOption.smoothScrolling */
    ) && this._configureSmoothScrollDuration();
  }
  onFlushed(e, t) {
    this._linesLayout.onFlushed(e, t);
  }
  onLinesDeleted(e, t) {
    this._linesLayout.onLinesDeleted(e, t);
  }
  onLinesInserted(e, t) {
    this._linesLayout.onLinesInserted(e, t);
  }
  // ---- end view event handlers
  _getHorizontalScrollbarHeight(e, t) {
    const r = this._configuration.options.get(
      117
      /* EditorOption.scrollbar */
    );
    return r.horizontal === 2 || e >= t ? 0 : r.horizontalScrollbarSize;
  }
  _getContentHeight(e, t, n) {
    const r = this._configuration.options;
    let s = this._linesLayout.getLinesTotalHeight();
    return r.get(
      119
      /* EditorOption.scrollBeyondLastLine */
    ) ? s += Math.max(0, t - r.get(
      75
      /* EditorOption.lineHeight */
    ) - r.get(
      96
      /* EditorOption.padding */
    ).bottom) : r.get(
      117
      /* EditorOption.scrollbar */
    ).ignoreHorizontalScrollbarInContentHeight || (s += this._getHorizontalScrollbarHeight(e, n)), s;
  }
  _updateHeight() {
    const e = this._scrollable.getScrollDimensions(), t = e.width, n = e.height, r = e.contentWidth;
    this._scrollable.setScrollDimensions(new GP(t, e.contentWidth, n, this._getContentHeight(t, n, r)));
  }
  // ---- Layouting logic
  getCurrentViewport() {
    const e = this._scrollable.getScrollDimensions(), t = this._scrollable.getCurrentScrollPosition();
    return new $Le(t.scrollTop, t.scrollLeft, e.width, e.height);
  }
  getFutureViewport() {
    const e = this._scrollable.getScrollDimensions(), t = this._scrollable.getFutureScrollPosition();
    return new $Le(t.scrollTop, t.scrollLeft, e.width, e.height);
  }
  _computeContentWidth() {
    const e = this._configuration.options, t = this._maxLineWidth, n = e.get(
      166
      /* EditorOption.wrappingInfo */
    ), r = e.get(
      59
      /* EditorOption.fontInfo */
    ), s = e.get(
      165
      /* EditorOption.layoutInfo */
    );
    if (n.isViewportWrapping) {
      const o = e.get(
        81
        /* EditorOption.minimap */
      );
      return t > s.contentWidth + r.typicalHalfwidthCharacterWidth && o.enabled && o.side === "right" ? t + s.verticalScrollbarWidth : t;
    } else {
      const o = e.get(
        118
        /* EditorOption.scrollBeyondLastColumn */
      ) * r.typicalHalfwidthCharacterWidth, a = this._linesLayout.getWhitespaceMinWidth();
      return Math.max(t + o + s.verticalScrollbarWidth, a, this._overlayWidgetsMinWidth);
    }
  }
  setMaxLineWidth(e) {
    this._maxLineWidth = e, this._updateContentWidth();
  }
  setOverlayWidgetsMinWidth(e) {
    this._overlayWidgetsMinWidth = e, this._updateContentWidth();
  }
  _updateContentWidth() {
    const e = this._scrollable.getScrollDimensions();
    this._scrollable.setScrollDimensions(new GP(e.width, this._computeContentWidth(), e.height, e.contentHeight)), this._updateHeight();
  }
  // ---- view state
  saveState() {
    const e = this._scrollable.getFutureScrollPosition(), t = e.scrollTop, n = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t), r = this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(n);
    return {
      scrollTop: t,
      scrollTopWithoutViewZones: t - r,
      scrollLeft: e.scrollLeft
    };
  }
  // ----
  changeWhitespace(e) {
    const t = this._linesLayout.changeWhitespace(e);
    return t && this.onHeightMaybeChanged(), t;
  }
  changeSpecialLineHeights(e) {
    const t = this._linesLayout.changeLineHeights(e);
    return t && this.onHeightMaybeChanged(), t;
  }
  getVerticalOffsetForLineNumber(e, t = !1) {
    return this._linesLayout.getVerticalOffsetForLineNumber(e, t);
  }
  getVerticalOffsetAfterLineNumber(e, t = !1) {
    return this._linesLayout.getVerticalOffsetAfterLineNumber(e, t);
  }
  getLineHeightForLineNumber(e) {
    return this._linesLayout.getLineHeightForLineNumber(e);
  }
  isAfterLines(e) {
    return this._linesLayout.isAfterLines(e);
  }
  isInTopPadding(e) {
    return this._linesLayout.isInTopPadding(e);
  }
  isInBottomPadding(e) {
    return this._linesLayout.isInBottomPadding(e);
  }
  getLineNumberAtVerticalOffset(e) {
    return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e);
  }
  getWhitespaceAtVerticalOffset(e) {
    return this._linesLayout.getWhitespaceAtVerticalOffset(e);
  }
  getLinesViewportData() {
    const e = this.getCurrentViewport();
    return this._linesLayout.getLinesViewportData(e.top, e.top + e.height);
  }
  getLinesViewportDataAtScrollTop(e) {
    const t = this._scrollable.getScrollDimensions();
    return e + t.height > t.scrollHeight && (e = t.scrollHeight - t.height), e < 0 && (e = 0), this._linesLayout.getLinesViewportData(e, e + t.height);
  }
  getWhitespaceViewportData() {
    const e = this.getCurrentViewport();
    return this._linesLayout.getWhitespaceViewportData(e.top, e.top + e.height);
  }
  getWhitespaces() {
    return this._linesLayout.getWhitespaces();
  }
  // ----
  getContentWidth() {
    return this._scrollable.getScrollDimensions().contentWidth;
  }
  getScrollWidth() {
    return this._scrollable.getScrollDimensions().scrollWidth;
  }
  getContentHeight() {
    return this._scrollable.getScrollDimensions().contentHeight;
  }
  getScrollHeight() {
    return this._scrollable.getScrollDimensions().scrollHeight;
  }
  getCurrentScrollLeft() {
    return this._scrollable.getCurrentScrollPosition().scrollLeft;
  }
  getCurrentScrollTop() {
    return this._scrollable.getCurrentScrollPosition().scrollTop;
  }
  validateScrollPosition(e) {
    return this._scrollable.validateScrollPosition(e);
  }
  setScrollPosition(e, t) {
    t === 1 ? this._scrollable.setScrollPositionNow(e) : this._scrollable.setScrollPositionSmooth(e);
  }
  hasPendingScrollAnimation() {
    return this._scrollable.hasPendingScrollAnimation();
  }
  deltaScrollNow(e, t) {
    const n = this._scrollable.getCurrentScrollPosition();
    this._scrollable.setScrollPositionNow({
      scrollLeft: n.scrollLeft + e,
      scrollTop: n.scrollTop + t
    });
  }
}
class zx {
  constructor(e, t, n) {
    this.range = e, this.inlineClassName = t, this.type = n;
  }
}
class Hpt {
  constructor(e, t, n, r) {
    this.startOffset = e, this.endOffset = t, this.inlineClassName = n, this.inlineClassNameAffectsLetterSpacing = r;
  }
  toInlineDecoration(e) {
    return new zx(
      new z(e, this.startOffset + 1, e, this.endOffset + 1),
      this.inlineClassName,
      this.inlineClassNameAffectsLetterSpacing ? 3 : 0
      /* InlineDecorationType.Regular */
    );
  }
}
class Wpt {
  constructor(e, t, n, r, s) {
    this.editorId = e, this.model = t, this.configuration = n, this._linesCollection = r, this._coordinatesConverter = s, this._decorationsCache = /* @__PURE__ */ Object.create(null), this._cachedModelDecorationsResolver = null, this._cachedModelDecorationsResolverViewRange = null;
  }
  _clearCachedModelDecorationsResolver() {
    this._cachedModelDecorationsResolver = null, this._cachedModelDecorationsResolverViewRange = null;
  }
  dispose() {
    this._decorationsCache = /* @__PURE__ */ Object.create(null), this._clearCachedModelDecorationsResolver();
  }
  reset() {
    this._decorationsCache = /* @__PURE__ */ Object.create(null), this._clearCachedModelDecorationsResolver();
  }
  onModelDecorationsChanged() {
    this._decorationsCache = /* @__PURE__ */ Object.create(null), this._clearCachedModelDecorationsResolver();
  }
  onLineMappingChanged() {
    this._decorationsCache = /* @__PURE__ */ Object.create(null), this._clearCachedModelDecorationsResolver();
  }
  _getOrCreateViewModelDecoration(e) {
    const t = e.id;
    let n = this._decorationsCache[t];
    if (!n) {
      const r = e.range, s = e.options;
      let o;
      if (s.isWholeLine) {
        const a = this._coordinatesConverter.convertModelPositionToViewPosition(new de(r.startLineNumber, 1), 0, !1, !0), l = this._coordinatesConverter.convertModelPositionToViewPosition(
          new de(r.endLineNumber, this.model.getLineMaxColumn(r.endLineNumber)),
          1
          /* PositionAffinity.Right */
        );
        o = new z(a.lineNumber, a.column, l.lineNumber, l.column);
      } else
        o = this._coordinatesConverter.convertModelRangeToViewRange(
          r,
          1
          /* PositionAffinity.Right */
        );
      n = new T3e(o, s), this._decorationsCache[t] = n;
    }
    return n;
  }
  getMinimapDecorationsInRange(e) {
    return this._getDecorationsInRange(e, !0, !1).decorations;
  }
  getDecorationsViewportData(e) {
    let t = this._cachedModelDecorationsResolver !== null;
    return t = t && e.equalsRange(this._cachedModelDecorationsResolverViewRange), t || (this._cachedModelDecorationsResolver = this._getDecorationsInRange(e, !1, !1), this._cachedModelDecorationsResolverViewRange = e), this._cachedModelDecorationsResolver;
  }
  getDecorationsOnLine(e, t = !1, n = !1) {
    const r = new z(e, this._linesCollection.getViewLineMinColumn(e), e, this._linesCollection.getViewLineMaxColumn(e));
    return this._getDecorationsInRange(r, t, n);
  }
  _getDecorationsInRange(e, t, n) {
    const r = this._linesCollection.getDecorationsInRange(e, this.editorId, XV(this.configuration.options), ZV(this.configuration.options), t, n), s = e.startLineNumber, o = e.endLineNumber, a = [];
    let l = 0;
    const c = [];
    for (let d = s; d <= o; d++)
      c[d - s] = [];
    let u = !1;
    for (let d = 0, h = r.length; d < h; d++) {
      const g = r[d], m = g.options;
      if (!Ffe(this.model, g))
        continue;
      const _ = this._getOrCreateViewModelDecoration(g), v = _.range;
      if (a[l++] = _, m.inlineClassName) {
        const w = new zx(
          v,
          m.inlineClassName,
          m.inlineClassNameAffectsLetterSpacing ? 3 : 0
          /* InlineDecorationType.Regular */
        ), E = Math.max(s, v.startLineNumber), L = Math.min(o, v.endLineNumber);
        for (let T = E; T <= L; T++)
          c[T - s].push(w);
      }
      if (m.beforeContentClassName && s <= v.startLineNumber && v.startLineNumber <= o) {
        const w = new zx(
          new z(v.startLineNumber, v.startColumn, v.startLineNumber, v.startColumn),
          m.beforeContentClassName,
          1
          /* InlineDecorationType.Before */
        );
        c[v.startLineNumber - s].push(w);
      }
      if (m.afterContentClassName && s <= v.endLineNumber && v.endLineNumber <= o) {
        const w = new zx(
          new z(v.endLineNumber, v.endColumn, v.endLineNumber, v.endColumn),
          m.afterContentClassName,
          2
          /* InlineDecorationType.After */
        );
        c[v.endLineNumber - s].push(w);
      }
      m.affectsFont && (u = !0);
    }
    return {
      decorations: a,
      inlineDecorations: c,
      hasVariableFonts: u
    };
  }
}
function yee(i, e) {
  return i === null ? e ? EU.INSTANCE : xU.INSTANCE : new Vpt(i, e);
}
class Vpt {
  constructor(e, t) {
    this._projectionData = e, this._isVisible = t;
  }
  isVisible() {
    return this._isVisible;
  }
  setVisible(e) {
    return this._isVisible = e, this;
  }
  getProjectionData() {
    return this._projectionData;
  }
  getViewLineCount() {
    return this._isVisible ? this._projectionData.getOutputLineCount() : 0;
  }
  getViewLineContent(e, t, n) {
    this._assertVisible();
    const r = n > 0 ? this._projectionData.breakOffsets[n - 1] : 0, s = this._projectionData.breakOffsets[n];
    let o;
    if (this._projectionData.injectionOffsets !== null) {
      const a = this._projectionData.injectionOffsets.map((c, u) => new pm(0, 0, c + 1, this._projectionData.injectionOptions[u], 0));
      o = pm.applyInjectedText(e.getLineContent(t), a).substring(r, s);
    } else
      o = e.getValueInRange({
        startLineNumber: t,
        startColumn: r + 1,
        endLineNumber: t,
        endColumn: s + 1
      });
    return n > 0 && (o = zTe(this._projectionData.wrappedTextIndentLength) + o), o;
  }
  getViewLineLength(e, t, n) {
    return this._assertVisible(), this._projectionData.getLineLength(n);
  }
  getViewLineMinColumn(e, t, n) {
    return this._assertVisible(), this._projectionData.getMinOutputOffset(n) + 1;
  }
  getViewLineMaxColumn(e, t, n) {
    return this._assertVisible(), this._projectionData.getMaxOutputOffset(n) + 1;
  }
  /**
   * Try using {@link getViewLinesData} instead.
  */
  getViewLineData(e, t, n) {
    const r = new Array();
    return this.getViewLinesData(e, t, n, 1, 0, [!0], r), r[0];
  }
  getViewLinesData(e, t, n, r, s, o, a) {
    this._assertVisible();
    const l = this._projectionData, c = l.injectionOffsets, u = l.injectionOptions;
    let d = null;
    if (c) {
      d = [];
      let g = 0, m = 0;
      for (let _ = 0; _ < l.getOutputLineCount(); _++) {
        const v = new Array();
        d[_] = v;
        const w = _ > 0 ? l.breakOffsets[_ - 1] : 0, E = l.breakOffsets[_];
        for (; m < c.length; ) {
          const L = u[m].content.length, T = c[m] + g, D = T + L;
          if (T > E)
            break;
          if (w < D) {
            const N = u[m];
            if (N.inlineClassName) {
              const R = _ > 0 ? l.wrappedTextIndentLength : 0, M = R + Math.max(T - w, 0), B = R + Math.min(D - w, E - w);
              M !== B && v.push(new Hpt(M, B, N.inlineClassName, N.inlineClassNameAffectsLetterSpacing));
            }
          }
          if (D <= E)
            g += L, m++;
          else
            break;
        }
      }
    }
    let h;
    if (c) {
      const g = [];
      for (let m = 0; m < c.length; m++) {
        const _ = c[m], v = u[m].tokens;
        v ? v.forEach((w, E) => {
          g.push({
            offset: _,
            text: w.substring(u[m].content),
            tokenMetadata: E.metadata
          });
        }) : g.push({
          offset: _,
          text: u[m].content,
          tokenMetadata: fo.defaultTokenMetadata
        });
      }
      h = e.tokenization.getLineTokens(t).withInserted(g);
    } else
      h = e.tokenization.getLineTokens(t);
    for (let g = n; g < n + r; g++) {
      const m = s + g - n;
      if (!o[m]) {
        a[m] = null;
        continue;
      }
      a[m] = this._getViewLineData(h, d ? d[g] : null, g);
    }
  }
  _getViewLineData(e, t, n) {
    this._assertVisible();
    const r = this._projectionData, s = n > 0 ? r.wrappedTextIndentLength : 0, o = n > 0 ? r.breakOffsets[n - 1] : 0, a = r.breakOffsets[n], l = e.sliceAndInflate(o, a, s);
    let c = l.getLineContent();
    n > 0 && (c = zTe(r.wrappedTextIndentLength) + c);
    const u = this._projectionData.getMinOutputOffset(n) + 1, d = c.length + 1, h = n + 1 < this.getViewLineCount(), g = n === 0 ? 0 : r.breakOffsetsVisibleColumn[n - 1];
    return new Vfe(c, h, u, d, g, l, t);
  }
  getModelColumnOfViewPosition(e, t) {
    return this._assertVisible(), this._projectionData.translateToInputOffset(e, t - 1) + 1;
  }
  getViewPositionOfModelPosition(e, t, n = 2) {
    return this._assertVisible(), this._projectionData.translateToOutputPosition(t - 1, n).toPosition(e);
  }
  getViewLineNumberOfModelPosition(e, t) {
    this._assertVisible();
    const n = this._projectionData.translateToOutputPosition(t - 1);
    return e + n.outputLineIndex;
  }
  normalizePosition(e, t, n) {
    const r = t.lineNumber - e;
    return this._projectionData.normalizeOutputPosition(e, t.column - 1, n).toPosition(r);
  }
  getInjectedTextAt(e, t) {
    return this._projectionData.getInjectedText(e, t - 1);
  }
  _assertVisible() {
    if (!this._isVisible)
      throw new Error("Not supported");
  }
}
const Kj = class Kj {
  constructor() {
  }
  isVisible() {
    return !0;
  }
  setVisible(e) {
    return e ? this : xU.INSTANCE;
  }
  getProjectionData() {
    return null;
  }
  getViewLineCount() {
    return 1;
  }
  getViewLineContent(e, t, n) {
    return e.getLineContent(t);
  }
  getViewLineLength(e, t, n) {
    return e.getLineLength(t);
  }
  getViewLineMinColumn(e, t, n) {
    return e.getLineMinColumn(t);
  }
  getViewLineMaxColumn(e, t, n) {
    return e.getLineMaxColumn(t);
  }
  getViewLineData(e, t, n) {
    const r = e.tokenization.getLineTokens(t), s = r.getLineContent();
    return new Vfe(s, !1, 1, s.length + 1, 0, r.inflate(), null);
  }
  getViewLinesData(e, t, n, r, s, o, a) {
    if (!o[s]) {
      a[s] = null;
      return;
    }
    a[s] = this.getViewLineData(e, t, 0);
  }
  getModelColumnOfViewPosition(e, t) {
    return t;
  }
  getViewPositionOfModelPosition(e, t) {
    return new de(e, t);
  }
  getViewLineNumberOfModelPosition(e, t) {
    return e;
  }
  normalizePosition(e, t, n) {
    return t;
  }
  getInjectedTextAt(e, t) {
    return null;
  }
};
Kj.INSTANCE = new Kj();
let EU = Kj;
const Yj = class Yj {
  constructor() {
  }
  isVisible() {
    return !1;
  }
  setVisible(e) {
    return e ? EU.INSTANCE : this;
  }
  getProjectionData() {
    return null;
  }
  getViewLineCount() {
    return 0;
  }
  getViewLineContent(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLineLength(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLineMinColumn(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLineMaxColumn(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLineData(e, t, n) {
    throw new Error("Not supported");
  }
  getViewLinesData(e, t, n, r, s, o, a) {
    throw new Error("Not supported");
  }
  getModelColumnOfViewPosition(e, t) {
    throw new Error("Not supported");
  }
  getViewPositionOfModelPosition(e, t) {
    throw new Error("Not supported");
  }
  getViewLineNumberOfModelPosition(e, t) {
    throw new Error("Not supported");
  }
  normalizePosition(e, t, n) {
    throw new Error("Not supported");
  }
  getInjectedTextAt(e, t) {
    throw new Error("Not supported");
  }
};
Yj.INSTANCE = new Yj();
let xU = Yj;
const Cee = [""];
function zTe(i) {
  if (i >= Cee.length)
    for (let e = 1; e <= i; e++)
      Cee[e] = Upt(e);
  return Cee[i];
}
function Upt(i) {
  return new Array(i + 1).join(" ");
}
class zpt {
  constructor(e) {
    this.values = e, this.prefixSum = new Uint32Array(e.length), this.prefixSumValidIndex = new Int32Array(1), this.prefixSumValidIndex[0] = -1;
  }
  insertValues(e, t) {
    e = fI(e);
    const n = this.values, r = this.prefixSum, s = t.length;
    return s === 0 ? !1 : (this.values = new Uint32Array(n.length + s), this.values.set(n.subarray(0, e), 0), this.values.set(n.subarray(e), e + s), this.values.set(t, e), e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1), this.prefixSum = new Uint32Array(this.values.length), this.prefixSumValidIndex[0] >= 0 && this.prefixSum.set(r.subarray(0, this.prefixSumValidIndex[0] + 1)), !0);
  }
  setValue(e, t) {
    return e = fI(e), t = fI(t), this.values[e] === t ? !1 : (this.values[e] = t, e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1), !0);
  }
  removeValues(e, t) {
    e = fI(e), t = fI(t);
    const n = this.values, r = this.prefixSum;
    if (e >= n.length)
      return !1;
    const s = n.length - e;
    return t >= s && (t = s), t === 0 ? !1 : (this.values = new Uint32Array(n.length - t), this.values.set(n.subarray(0, e), 0), this.values.set(n.subarray(e + t), e), this.prefixSum = new Uint32Array(this.values.length), e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1), this.prefixSumValidIndex[0] >= 0 && this.prefixSum.set(r.subarray(0, this.prefixSumValidIndex[0] + 1)), !0);
  }
  getTotalSum() {
    return this.values.length === 0 ? 0 : this._getPrefixSum(this.values.length - 1);
  }
  /**
   * Returns the sum of the first `index + 1` many items.
   * @returns `SUM(0 <= j <= index, values[j])`.
   */
  getPrefixSum(e) {
    return e < 0 ? 0 : (e = fI(e), this._getPrefixSum(e));
  }
  _getPrefixSum(e) {
    if (e <= this.prefixSumValidIndex[0])
      return this.prefixSum[e];
    let t = this.prefixSumValidIndex[0] + 1;
    t === 0 && (this.prefixSum[0] = this.values[0], t++), e >= this.values.length && (e = this.values.length - 1);
    for (let n = t; n <= e; n++)
      this.prefixSum[n] = this.prefixSum[n - 1] + this.values[n];
    return this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], e), this.prefixSum[e];
  }
  getIndexOf(e) {
    e = Math.floor(e), this.getTotalSum();
    let t = 0, n = this.values.length - 1, r = 0, s = 0, o = 0;
    for (; t <= n; )
      if (r = t + (n - t) / 2 | 0, s = this.prefixSum[r], o = s - this.values[r], e < o)
        n = r - 1;
      else if (e >= s)
        t = r + 1;
      else
        break;
    return new p4e(r, e - o);
  }
}
class $pt {
  constructor(e) {
    this._values = e, this._isValid = !1, this._validEndIndex = -1, this._prefixSum = [], this._indexBySum = [];
  }
  /**
   * @returns SUM(0 <= j < values.length, values[j])
   */
  getTotalSum() {
    return this._ensureValid(), this._indexBySum.length;
  }
  /**
   * Returns the sum of the first `count` many items.
   * @returns `SUM(0 <= j < count, values[j])`.
   */
  getPrefixSum(e) {
    return this._ensureValid(), e === 0 ? 0 : this._prefixSum[e - 1];
  }
  /**
   * @returns `result`, such that `getPrefixSum(result.index) + result.remainder = sum`
   */
  getIndexOf(e) {
    this._ensureValid();
    const t = this._indexBySum[e], n = t > 0 ? this._prefixSum[t - 1] : 0;
    return new p4e(t, e - n);
  }
  removeValues(e, t) {
    this._values.splice(e, t), this._invalidate(e);
  }
  insertValues(e, t) {
    this._values = bq(this._values, e, t), this._invalidate(e);
  }
  _invalidate(e) {
    this._isValid = !1, this._validEndIndex = Math.min(this._validEndIndex, e - 1);
  }
  _ensureValid() {
    if (!this._isValid) {
      for (let e = this._validEndIndex + 1, t = this._values.length; e < t; e++) {
        const n = this._values[e], r = e > 0 ? this._prefixSum[e - 1] : 0;
        this._prefixSum[e] = r + n;
        for (let s = 0; s < n; s++)
          this._indexBySum[r + s] = e;
      }
      this._prefixSum.length = this._values.length, this._indexBySum.length = this._prefixSum[this._prefixSum.length - 1], this._isValid = !0, this._validEndIndex = this._values.length - 1;
    }
  }
  setValue(e, t) {
    this._values[e] !== t && (this._values[e] = t, this._invalidate(e));
  }
}
class p4e {
  constructor(e, t) {
    this.index = e, this.remainder = t, this._prefixSumIndexOfResultBrand = void 0, this.index = e, this.remainder = t;
  }
}
class jpt {
  constructor(e) {
    this._model = e;
  }
  _validPosition(e) {
    return this._model.validatePosition(e);
  }
  _validRange(e) {
    return this._model.validateRange(e);
  }
  // View -> Model conversion and related methods
  convertViewPositionToModelPosition(e) {
    return this._validPosition(e);
  }
  convertViewRangeToModelRange(e) {
    return this._validRange(e);
  }
  validateViewPosition(e, t) {
    return this._validPosition(t);
  }
  validateViewRange(e, t) {
    return this._validRange(t);
  }
  // Model -> View conversion and related methods
  convertModelPositionToViewPosition(e) {
    return this._validPosition(e);
  }
  convertModelRangeToViewRange(e) {
    return this._validRange(e);
  }
  modelPositionIsVisible(e) {
    const t = this._model.getLineCount();
    return !(e.lineNumber < 1 || e.lineNumber > t);
  }
  getModelLineViewLineCount(e) {
    return 1;
  }
  getViewLineNumberOfModelPosition(e, t) {
    return e;
  }
}
class Gpt {
  constructor(e, t, n, r, s, o, a, l, c, u, d) {
    this._editorId = e, this.model = t, this._validModelVersionId = -1, this._domLineBreaksComputerFactory = n, this._monospaceLineBreaksComputerFactory = r, this.fontInfo = s, this.tabSize = o, this.wrappingStrategy = a, this.wrappingColumn = l, this.wrappingIndent = c, this.wordBreak = u, this.wrapOnEscapedLineFeeds = d, this._constructLines(
      /*resetHiddenAreas*/
      !0,
      null
    );
  }
  dispose() {
    this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, []);
  }
  createCoordinatesConverter() {
    return new Kpt(this);
  }
  _constructLines(e, t) {
    this.modelLineProjections = [], e && (this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, []));
    const n = this.model.getLinesContent(), r = this.model.getInjectedTextDecorations(this._editorId), s = n.length, o = this.createLineBreaksComputer(), a = new Ky(pm.fromDecorations(r));
    for (let _ = 0; _ < s; _++) {
      const v = a.takeWhile((w) => w.lineNumber === _ + 1);
      o.addRequest(n[_], v, t ? t[_] : null);
    }
    const l = o.finalize(), c = [], u = this.hiddenAreasDecorationIds.map((_) => this.model.getDecorationRange(_)).sort(z.compareRangesUsingStarts);
    let d = 1, h = 0, g = -1, m = g + 1 < u.length ? h + 1 : s + 2;
    for (let _ = 0; _ < s; _++) {
      const v = _ + 1;
      v === m && (g++, d = u[g].startLineNumber, h = u[g].endLineNumber, m = g + 1 < u.length ? h + 1 : s + 2);
      const w = v >= d && v <= h, E = yee(l[_], !w);
      c[_] = E.getViewLineCount(), this.modelLineProjections[_] = E;
    }
    this._validModelVersionId = this.model.getVersionId(), this.projectedModelLineLineCounts = new $pt(c);
  }
  getHiddenAreas() {
    return this.hiddenAreasDecorationIds.map((e) => this.model.getDecorationRange(e));
  }
  setHiddenAreas(e) {
    const t = e.map((h) => this.model.validateRange(h)), n = qpt(t), r = this.hiddenAreasDecorationIds.map((h) => this.model.getDecorationRange(h)).sort(z.compareRangesUsingStarts);
    if (n.length === r.length) {
      let h = !1;
      for (let g = 0; g < n.length; g++)
        if (!n[g].equalsRange(r[g])) {
          h = !0;
          break;
        }
      if (!h)
        return !1;
    }
    const s = n.map((h) => ({
      range: h,
      options: dn.EMPTY
    }));
    this.hiddenAreasDecorationIds = this.model.deltaDecorations(this.hiddenAreasDecorationIds, s);
    const o = n;
    let a = 1, l = 0, c = -1, u = c + 1 < o.length ? l + 1 : this.modelLineProjections.length + 2, d = !1;
    for (let h = 0; h < this.modelLineProjections.length; h++) {
      const g = h + 1;
      g === u && (c++, a = o[c].startLineNumber, l = o[c].endLineNumber, u = c + 1 < o.length ? l + 1 : this.modelLineProjections.length + 2);
      let m = !1;
      if (g >= a && g <= l ? this.modelLineProjections[h].isVisible() && (this.modelLineProjections[h] = this.modelLineProjections[h].setVisible(!1), m = !0) : (d = !0, this.modelLineProjections[h].isVisible() || (this.modelLineProjections[h] = this.modelLineProjections[h].setVisible(!0), m = !0)), m) {
        const _ = this.modelLineProjections[h].getViewLineCount();
        this.projectedModelLineLineCounts.setValue(h, _);
      }
    }
    return d || this.setHiddenAreas([]), !0;
  }
  modelPositionIsVisible(e, t) {
    return e < 1 || e > this.modelLineProjections.length ? !1 : this.modelLineProjections[e - 1].isVisible();
  }
  getModelLineViewLineCount(e) {
    return e < 1 || e > this.modelLineProjections.length ? 1 : this.modelLineProjections[e - 1].getViewLineCount();
  }
  setTabSize(e) {
    return this.tabSize === e ? !1 : (this.tabSize = e, this._constructLines(
      /*resetHiddenAreas*/
      !1,
      null
    ), !0);
  }
  setWrappingSettings(e, t, n, r, s) {
    const o = this.fontInfo.equals(e), a = this.wrappingStrategy === t, l = this.wrappingColumn === n, c = this.wrappingIndent === r, u = this.wordBreak === s;
    if (o && a && l && c && u)
      return !1;
    const d = o && a && !l && c && u;
    this.fontInfo = e, this.wrappingStrategy = t, this.wrappingColumn = n, this.wrappingIndent = r, this.wordBreak = s;
    let h = null;
    if (d) {
      h = [];
      for (let g = 0, m = this.modelLineProjections.length; g < m; g++)
        h[g] = this.modelLineProjections[g].getProjectionData();
    }
    return this._constructLines(
      /*resetHiddenAreas*/
      !1,
      h
    ), !0;
  }
  createLineBreaksComputer() {
    return (this.wrappingStrategy === "advanced" ? this._domLineBreaksComputerFactory : this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo, this.tabSize, this.wrappingColumn, this.wrappingIndent, this.wordBreak, this.wrapOnEscapedLineFeeds);
  }
  onModelFlushed() {
    this._constructLines(
      /*resetHiddenAreas*/
      !0,
      null
    );
  }
  onModelLinesDeleted(e, t, n) {
    if (!e || e <= this._validModelVersionId)
      return null;
    const r = t === 1 ? 1 : this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1, s = this.projectedModelLineLineCounts.getPrefixSum(n);
    return this.modelLineProjections.splice(t - 1, n - t + 1), this.projectedModelLineLineCounts.removeValues(t - 1, n - t + 1), new Hre(r, s);
  }
  onModelLinesInserted(e, t, n, r) {
    if (!e || e <= this._validModelVersionId)
      return null;
    const s = t > 2 && !this.modelLineProjections[t - 2].isVisible(), o = t === 1 ? 1 : this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1;
    let a = 0;
    const l = [], c = [];
    for (let u = 0, d = r.length; u < d; u++) {
      const h = yee(r[u], !s);
      l.push(h);
      const g = h.getViewLineCount();
      a += g, c[u] = g;
    }
    return this.modelLineProjections = this.modelLineProjections.slice(0, t - 1).concat(l).concat(this.modelLineProjections.slice(t - 1)), this.projectedModelLineLineCounts.insertValues(t - 1, c), new Wre(o, o + a - 1);
  }
  onModelLineChanged(e, t, n) {
    if (e !== null && e <= this._validModelVersionId)
      return [!1, null, null, null];
    const r = t - 1, s = this.modelLineProjections[r].getViewLineCount(), o = this.modelLineProjections[r].isVisible(), a = yee(n, o);
    this.modelLineProjections[r] = a;
    const l = this.modelLineProjections[r].getViewLineCount();
    let c = !1, u = 0, d = -1, h = 0, g = -1, m = 0, _ = -1;
    s > l ? (u = this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1, d = u + l - 1, m = d + 1, _ = m + (s - l) - 1, c = !0) : s < l ? (u = this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1, d = u + s - 1, h = d + 1, g = h + (l - s) - 1, c = !0) : (u = this.projectedModelLineLineCounts.getPrefixSum(t - 1) + 1, d = u + l - 1), this.projectedModelLineLineCounts.setValue(r, l);
    const v = u <= d ? new g4e(u, d - u + 1) : null, w = h <= g ? new Wre(h, g) : null, E = m <= _ ? new Hre(m, _) : null;
    return [c, v, w, E];
  }
  acceptVersionId(e) {
    this._validModelVersionId = e, this.modelLineProjections.length === 1 && !this.modelLineProjections[0].isVisible() && this.setHiddenAreas([]);
  }
  getViewLineCount() {
    return this.projectedModelLineLineCounts.getTotalSum();
  }
  _toValidViewLineNumber(e) {
    if (e < 1)
      return 1;
    const t = this.getViewLineCount();
    return e > t ? t : e | 0;
  }
  getActiveIndentGuide(e, t, n) {
    e = this._toValidViewLineNumber(e), t = this._toValidViewLineNumber(t), n = this._toValidViewLineNumber(n);
    const r = this.convertViewPositionToModelPosition(e, this.getViewLineMinColumn(e)), s = this.convertViewPositionToModelPosition(t, this.getViewLineMinColumn(t)), o = this.convertViewPositionToModelPosition(n, this.getViewLineMinColumn(n)), a = this.model.guides.getActiveIndentGuide(r.lineNumber, s.lineNumber, o.lineNumber), l = this.convertModelPositionToViewPosition(a.startLineNumber, 1), c = this.convertModelPositionToViewPosition(a.endLineNumber, this.model.getLineMaxColumn(a.endLineNumber));
    return {
      startLineNumber: l.lineNumber,
      endLineNumber: c.lineNumber,
      indent: a.indent
    };
  }
  // #region ViewLineInfo
  getViewLineInfo(e) {
    e = this._toValidViewLineNumber(e);
    const t = this.projectedModelLineLineCounts.getIndexOf(e - 1), n = t.index, r = t.remainder;
    return new $Te(n + 1, r);
  }
  getMinColumnOfViewLine(e) {
    return this.modelLineProjections[e.modelLineNumber - 1].getViewLineMinColumn(this.model, e.modelLineNumber, e.modelLineWrappedLineIdx);
  }
  getMaxColumnOfViewLine(e) {
    return this.modelLineProjections[e.modelLineNumber - 1].getViewLineMaxColumn(this.model, e.modelLineNumber, e.modelLineWrappedLineIdx);
  }
  getModelStartPositionOfViewLine(e) {
    const t = this.modelLineProjections[e.modelLineNumber - 1], n = t.getViewLineMinColumn(this.model, e.modelLineNumber, e.modelLineWrappedLineIdx), r = t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx, n);
    return new de(e.modelLineNumber, r);
  }
  getModelEndPositionOfViewLine(e) {
    const t = this.modelLineProjections[e.modelLineNumber - 1], n = t.getViewLineMaxColumn(this.model, e.modelLineNumber, e.modelLineWrappedLineIdx), r = t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx, n);
    return new de(e.modelLineNumber, r);
  }
  getViewLineInfosGroupedByModelRanges(e, t) {
    const n = this.getViewLineInfo(e), r = this.getViewLineInfo(t), s = new Array();
    let o = this.getModelStartPositionOfViewLine(n), a = new Array();
    for (let l = n.modelLineNumber; l <= r.modelLineNumber; l++) {
      const c = this.modelLineProjections[l - 1];
      if (c.isVisible()) {
        const u = l === n.modelLineNumber ? n.modelLineWrappedLineIdx : 0, d = l === r.modelLineNumber ? r.modelLineWrappedLineIdx + 1 : c.getViewLineCount();
        for (let h = u; h < d; h++)
          a.push(new $Te(l, h));
      }
      if (!c.isVisible() && o) {
        const u = new de(l - 1, this.model.getLineMaxColumn(l - 1) + 1), d = z.fromPositions(o, u);
        s.push(new jTe(d, a)), a = [], o = null;
      } else c.isVisible() && !o && (o = new de(l, 1));
    }
    if (o) {
      const l = z.fromPositions(o, this.getModelEndPositionOfViewLine(r));
      s.push(new jTe(l, a));
    }
    return s;
  }
  // #endregion
  getViewLinesBracketGuides(e, t, n, r) {
    const s = n ? this.convertViewPositionToModelPosition(n.lineNumber, n.column) : null, o = [];
    for (const a of this.getViewLineInfosGroupedByModelRanges(e, t)) {
      const l = a.modelRange.startLineNumber, c = this.model.guides.getLinesBracketGuides(l, a.modelRange.endLineNumber, s, r);
      for (const u of a.viewLines) {
        const h = c[u.modelLineNumber - l].map((g) => {
          if (g.forWrappedLinesAfterColumn !== -1 && this.modelLineProjections[u.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesAfterColumn).lineNumber >= u.modelLineWrappedLineIdx || g.forWrappedLinesBeforeOrAtColumn !== -1 && this.modelLineProjections[u.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.forWrappedLinesBeforeOrAtColumn).lineNumber < u.modelLineWrappedLineIdx)
            return;
          if (!g.horizontalLine)
            return g;
          let m = -1;
          if (g.column !== -1) {
            const w = this.modelLineProjections[u.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.column);
            if (w.lineNumber === u.modelLineWrappedLineIdx)
              m = w.column;
            else if (w.lineNumber < u.modelLineWrappedLineIdx)
              m = this.getMinColumnOfViewLine(u);
            else if (w.lineNumber > u.modelLineWrappedLineIdx)
              return;
          }
          const _ = this.convertModelPositionToViewPosition(u.modelLineNumber, g.horizontalLine.endColumn), v = this.modelLineProjections[u.modelLineNumber - 1].getViewPositionOfModelPosition(0, g.horizontalLine.endColumn);
          return v.lineNumber === u.modelLineWrappedLineIdx ? new px(g.visibleColumn, m, g.className, new xF(g.horizontalLine.top, _.column), -1, -1) : v.lineNumber < u.modelLineWrappedLineIdx || g.visibleColumn !== -1 ? void 0 : new px(g.visibleColumn, m, g.className, new xF(g.horizontalLine.top, this.getMaxColumnOfViewLine(u)), -1, -1);
        });
        o.push(h.filter((g) => !!g));
      }
    }
    return o;
  }
  getViewLinesIndentGuides(e, t) {
    e = this._toValidViewLineNumber(e), t = this._toValidViewLineNumber(t);
    const n = this.convertViewPositionToModelPosition(e, this.getViewLineMinColumn(e)), r = this.convertViewPositionToModelPosition(t, this.getViewLineMaxColumn(t));
    let s = [];
    const o = [], a = [], l = n.lineNumber - 1, c = r.lineNumber - 1;
    let u = null;
    for (let m = l; m <= c; m++) {
      const _ = this.modelLineProjections[m];
      if (_.isVisible()) {
        const v = _.getViewLineNumberOfModelPosition(0, m === l ? n.column : 1), w = _.getViewLineNumberOfModelPosition(0, this.model.getLineMaxColumn(m + 1)), E = w - v + 1;
        let L = 0;
        E > 1 && _.getViewLineMinColumn(this.model, m + 1, w) === 1 && (L = v === 0 ? 1 : 2), o.push(E), a.push(L), u === null && (u = new de(m + 1, 0));
      } else
        u !== null && (s = s.concat(this.model.guides.getLinesIndentGuides(u.lineNumber, m)), u = null);
    }
    u !== null && (s = s.concat(this.model.guides.getLinesIndentGuides(u.lineNumber, r.lineNumber)), u = null);
    const d = t - e + 1, h = new Array(d);
    let g = 0;
    for (let m = 0, _ = s.length; m < _; m++) {
      let v = s[m];
      const w = Math.min(d - g, o[m]), E = a[m];
      let L;
      E === 2 ? L = 0 : E === 1 ? L = 1 : L = w;
      for (let T = 0; T < w; T++)
        T === L && (v = 0), h[g++] = v;
    }
    return h;
  }
  getViewLineContent(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineContent(this.model, t.modelLineNumber, t.modelLineWrappedLineIdx);
  }
  getViewLineLength(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineLength(this.model, t.modelLineNumber, t.modelLineWrappedLineIdx);
  }
  getViewLineMinColumn(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineMinColumn(this.model, t.modelLineNumber, t.modelLineWrappedLineIdx);
  }
  getViewLineMaxColumn(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineMaxColumn(this.model, t.modelLineNumber, t.modelLineWrappedLineIdx);
  }
  getViewLineData(e) {
    const t = this.getViewLineInfo(e);
    return this.modelLineProjections[t.modelLineNumber - 1].getViewLineData(this.model, t.modelLineNumber, t.modelLineWrappedLineIdx);
  }
  getViewLinesData(e, t, n) {
    e = this._toValidViewLineNumber(e), t = this._toValidViewLineNumber(t);
    const r = this.projectedModelLineLineCounts.getIndexOf(e - 1);
    let s = e;
    const o = r.index, a = r.remainder, l = [];
    for (let c = o, u = this.model.getLineCount(); c < u; c++) {
      const d = this.modelLineProjections[c];
      if (!d.isVisible())
        continue;
      const h = c === o ? a : 0;
      let g = d.getViewLineCount() - h, m = !1;
      if (s + g > t && (m = !0, g = t - s + 1), d.getViewLinesData(this.model, c + 1, h, g, s - e, n, l), s += g, m)
        break;
    }
    return l;
  }
  validateViewPosition(e, t, n) {
    e = this._toValidViewLineNumber(e);
    const r = this.projectedModelLineLineCounts.getIndexOf(e - 1), s = r.index, o = r.remainder, a = this.modelLineProjections[s], l = a.getViewLineMinColumn(this.model, s + 1, o), c = a.getViewLineMaxColumn(this.model, s + 1, o);
    t < l && (t = l), t > c && (t = c);
    const u = a.getModelColumnOfViewPosition(o, t);
    return this.model.validatePosition(new de(s + 1, u)).equals(n) ? new de(e, t) : this.convertModelPositionToViewPosition(n.lineNumber, n.column);
  }
  validateViewRange(e, t) {
    const n = this.validateViewPosition(e.startLineNumber, e.startColumn, t.getStartPosition()), r = this.validateViewPosition(e.endLineNumber, e.endColumn, t.getEndPosition());
    return new z(n.lineNumber, n.column, r.lineNumber, r.column);
  }
  convertViewPositionToModelPosition(e, t) {
    const n = this.getViewLineInfo(e), r = this.modelLineProjections[n.modelLineNumber - 1].getModelColumnOfViewPosition(n.modelLineWrappedLineIdx, t);
    return this.model.validatePosition(new de(n.modelLineNumber, r));
  }
  convertViewRangeToModelRange(e) {
    const t = this.convertViewPositionToModelPosition(e.startLineNumber, e.startColumn), n = this.convertViewPositionToModelPosition(e.endLineNumber, e.endColumn);
    return new z(t.lineNumber, t.column, n.lineNumber, n.column);
  }
  convertModelPositionToViewPosition(e, t, n = 2, r = !1, s = !1) {
    const o = this.model.validatePosition(new de(e, t)), a = o.lineNumber, l = o.column;
    let c = a - 1, u = !1;
    if (s)
      for (; c < this.modelLineProjections.length && !this.modelLineProjections[c].isVisible(); )
        c++, u = !0;
    else
      for (; c > 0 && !this.modelLineProjections[c].isVisible(); )
        c--, u = !0;
    if (c === 0 && !this.modelLineProjections[c].isVisible())
      return new de(r ? 0 : 1, 1);
    const d = 1 + this.projectedModelLineLineCounts.getPrefixSum(c);
    let h;
    return u ? s ? h = this.modelLineProjections[c].getViewPositionOfModelPosition(d, 1, n) : h = this.modelLineProjections[c].getViewPositionOfModelPosition(d, this.model.getLineMaxColumn(c + 1), n) : h = this.modelLineProjections[a - 1].getViewPositionOfModelPosition(d, l, n), h;
  }
  /**
   * @param affinity The affinity in case of an empty range. Has no effect for non-empty ranges.
  */
  convertModelRangeToViewRange(e, t = 0) {
    if (e.isEmpty()) {
      const n = this.convertModelPositionToViewPosition(e.startLineNumber, e.startColumn, t);
      return z.fromPositions(n);
    } else {
      const n = this.convertModelPositionToViewPosition(
        e.startLineNumber,
        e.startColumn,
        1
        /* PositionAffinity.Right */
      ), r = this.convertModelPositionToViewPosition(
        e.endLineNumber,
        e.endColumn,
        0
        /* PositionAffinity.Left */
      );
      return new z(n.lineNumber, n.column, r.lineNumber, r.column);
    }
  }
  getViewLineNumberOfModelPosition(e, t) {
    let n = e - 1;
    if (this.modelLineProjections[n].isVisible()) {
      const s = 1 + this.projectedModelLineLineCounts.getPrefixSum(n);
      return this.modelLineProjections[n].getViewLineNumberOfModelPosition(s, t);
    }
    for (; n > 0 && !this.modelLineProjections[n].isVisible(); )
      n--;
    if (n === 0 && !this.modelLineProjections[n].isVisible())
      return 1;
    const r = 1 + this.projectedModelLineLineCounts.getPrefixSum(n);
    return this.modelLineProjections[n].getViewLineNumberOfModelPosition(r, this.model.getLineMaxColumn(n + 1));
  }
  getDecorationsInRange(e, t, n, r, s, o) {
    const a = this.convertViewPositionToModelPosition(e.startLineNumber, e.startColumn), l = this.convertViewPositionToModelPosition(e.endLineNumber, e.endColumn);
    if (l.lineNumber - a.lineNumber <= e.endLineNumber - e.startLineNumber)
      return this.model.getDecorationsInRange(new z(a.lineNumber, 1, l.lineNumber, l.column), t, n, r, s, o);
    let c = [];
    const u = a.lineNumber - 1, d = l.lineNumber - 1;
    let h = null;
    for (let v = u; v <= d; v++)
      if (this.modelLineProjections[v].isVisible())
        h === null && (h = new de(v + 1, v === u ? a.column : 1));
      else if (h !== null) {
        const E = this.model.getLineMaxColumn(v);
        c = c.concat(this.model.getDecorationsInRange(new z(h.lineNumber, h.column, v, E), t, n, r, s)), h = null;
      }
    h !== null && (c = c.concat(this.model.getDecorationsInRange(new z(h.lineNumber, h.column, l.lineNumber, l.column), t, n, r, s)), h = null), c.sort((v, w) => {
      const E = z.compareRangesUsingStarts(v.range, w.range);
      return E === 0 ? v.id < w.id ? -1 : v.id > w.id ? 1 : 0 : E;
    });
    const g = [];
    let m = 0, _ = null;
    for (const v of c) {
      const w = v.id;
      _ !== w && (_ = w, g[m++] = v);
    }
    return g;
  }
  getInjectedTextAt(e) {
    const t = this.getViewLineInfo(e.lineNumber);
    return this.modelLineProjections[t.modelLineNumber - 1].getInjectedTextAt(t.modelLineWrappedLineIdx, e.column);
  }
  normalizePosition(e, t) {
    const n = this.getViewLineInfo(e.lineNumber);
    return this.modelLineProjections[n.modelLineNumber - 1].normalizePosition(n.modelLineWrappedLineIdx, e, t);
  }
  getLineIndentColumn(e) {
    const t = this.getViewLineInfo(e);
    return t.modelLineWrappedLineIdx === 0 ? this.model.getLineIndentColumn(t.modelLineNumber) : 0;
  }
}
function qpt(i) {
  if (i.length === 0)
    return [];
  const e = i.slice();
  e.sort(z.compareRangesUsingStarts);
  const t = [];
  let n = e[0].startLineNumber, r = e[0].endLineNumber;
  for (let s = 1, o = e.length; s < o; s++) {
    const a = e[s];
    a.startLineNumber > r + 1 ? (t.push(new z(n, 1, r, 1)), n = a.startLineNumber, r = a.endLineNumber) : a.endLineNumber > r && (r = a.endLineNumber);
  }
  return t.push(new z(n, 1, r, 1)), t;
}
class $Te {
  constructor(e, t) {
    this.modelLineNumber = e, this.modelLineWrappedLineIdx = t;
  }
}
class jTe {
  constructor(e, t) {
    this.modelRange = e, this.viewLines = t;
  }
}
class Kpt {
  constructor(e) {
    this._lines = e;
  }
  // View -> Model conversion and related methods
  convertViewPositionToModelPosition(e) {
    return this._lines.convertViewPositionToModelPosition(e.lineNumber, e.column);
  }
  convertViewRangeToModelRange(e) {
    return this._lines.convertViewRangeToModelRange(e);
  }
  validateViewPosition(e, t) {
    return this._lines.validateViewPosition(e.lineNumber, e.column, t);
  }
  validateViewRange(e, t) {
    return this._lines.validateViewRange(e, t);
  }
  // Model -> View conversion and related methods
  convertModelPositionToViewPosition(e, t, n, r) {
    return this._lines.convertModelPositionToViewPosition(e.lineNumber, e.column, t, n, r);
  }
  convertModelRangeToViewRange(e, t) {
    return this._lines.convertModelRangeToViewRange(e, t);
  }
  modelPositionIsVisible(e) {
    return this._lines.modelPositionIsVisible(e.lineNumber, e.column);
  }
  getModelLineViewLineCount(e) {
    return this._lines.getModelLineViewLineCount(e);
  }
  getViewLineNumberOfModelPosition(e, t) {
    return this._lines.getViewLineNumberOfModelPosition(e, t);
  }
}
class Ypt {
  constructor(e) {
    this.model = e;
  }
  dispose() {
  }
  createCoordinatesConverter() {
    return new jpt(this.model);
  }
  getHiddenAreas() {
    return [];
  }
  setHiddenAreas(e) {
    return !1;
  }
  setTabSize(e) {
    return !1;
  }
  setWrappingSettings(e, t, n, r) {
    return !1;
  }
  createLineBreaksComputer() {
    const e = [];
    return {
      addRequest: (t, n, r) => {
        e.push(null);
      },
      finalize: () => e
    };
  }
  onModelFlushed() {
  }
  onModelLinesDeleted(e, t, n) {
    return new Hre(t, n);
  }
  onModelLinesInserted(e, t, n, r) {
    return new Wre(t, n);
  }
  onModelLineChanged(e, t, n) {
    return [!1, new g4e(t, 1), null, null];
  }
  acceptVersionId(e) {
  }
  getViewLineCount() {
    return this.model.getLineCount();
  }
  getActiveIndentGuide(e, t, n) {
    return {
      startLineNumber: e,
      endLineNumber: e,
      indent: 0
    };
  }
  getViewLinesBracketGuides(e, t, n) {
    return new Array(t - e + 1).fill([]);
  }
  getViewLinesIndentGuides(e, t) {
    const n = t - e + 1, r = new Array(n);
    for (let s = 0; s < n; s++)
      r[s] = 0;
    return r;
  }
  getViewLineContent(e) {
    return this.model.getLineContent(e);
  }
  getViewLineLength(e) {
    return this.model.getLineLength(e);
  }
  getViewLineMinColumn(e) {
    return this.model.getLineMinColumn(e);
  }
  getViewLineMaxColumn(e) {
    return this.model.getLineMaxColumn(e);
  }
  getViewLineData(e) {
    const t = this.model.tokenization.getLineTokens(e), n = t.getLineContent();
    return new Vfe(n, !1, 1, n.length + 1, 0, t.inflate(), null);
  }
  getViewLinesData(e, t, n) {
    const r = this.model.getLineCount();
    e = Math.min(Math.max(1, e), r), t = Math.min(Math.max(1, t), r);
    const s = [];
    for (let o = e; o <= t; o++) {
      const a = o - e;
      s[a] = n[a] ? this.getViewLineData(o) : null;
    }
    return s;
  }
  getDecorationsInRange(e, t, n, r, s, o) {
    return this.model.getDecorationsInRange(e, t, n, r, s, o);
  }
  normalizePosition(e, t) {
    return this.model.normalizePosition(e, t);
  }
  getLineIndentColumn(e) {
    return this.model.getLineIndentColumn(e);
  }
  getInjectedTextAt(e) {
    return null;
  }
}
const oE = fm.Right;
class Xpt {
  constructor(e) {
    this.persist = 0, this._requiredLanes = 1, this.lanes = new Uint8Array(Math.ceil((e + 1) * oE / 8));
  }
  reset(e) {
    const t = Math.ceil((e + 1) * oE / 8);
    this.lanes.length < t ? this.lanes = new Uint8Array(t) : this.lanes.fill(0), this._requiredLanes = 1;
  }
  get requiredLanes() {
    return this._requiredLanes;
  }
  push(e, t, n) {
    n && (this.persist |= 1 << e - 1);
    for (let r = t.startLineNumber; r <= t.endLineNumber; r++) {
      const s = oE * r + (e - 1);
      this.lanes[s >>> 3] |= 1 << s % 8, this._requiredLanes = Math.max(this._requiredLanes, this.countAtLine(r));
    }
  }
  getLanesAtLine(e) {
    const t = [];
    let n = oE * e;
    for (let r = 0; r < oE; r++)
      (this.persist & 1 << r || this.lanes[n >>> 3] & 1 << n % 8) && t.push(r + 1), n++;
    return t.length ? t : [fm.Center];
  }
  countAtLine(e) {
    let t = oE * e, n = 0;
    for (let r = 0; r < oE; r++)
      (this.persist & 1 << r || this.lanes[t >>> 3] & 1 << t % 8) && n++, t++;
    return n;
  }
}
let Zpt = class extends ge {
  constructor(e, t, n, r, s, o, a, l, c, u) {
    if (super(), this.languageConfigurationService = a, this._themeService = l, this._attachedView = c, this._transactionalTarget = u, this.hiddenAreasModel = new Jpt(), this.previousHiddenAreas = [], this._editorId = e, this._configuration = t, this.model = n, this._eventDispatcher = new fpt(), this.onEvent = this._eventDispatcher.onEvent, this.cursorConfig = new hI(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._updateConfigurationViewLineCount = this._register(new mr(() => this._updateConfigurationViewLineCountNow(), 0)), this._hasFocus = !1, this._viewportStart = age.create(this.model), this.glyphLanes = new Xpt(0), this.model.isTooLargeForTokenization())
      this._lines = new Ypt(this.model);
    else {
      const d = this._configuration.options, h = d.get(
        59
        /* EditorOption.fontInfo */
      ), g = d.get(
        156
        /* EditorOption.wrappingStrategy */
      ), m = d.get(
        166
        /* EditorOption.wrappingInfo */
      ), _ = d.get(
        155
        /* EditorOption.wrappingIndent */
      ), v = d.get(
        146
        /* EditorOption.wordBreak */
      ), w = d.get(
        160
        /* EditorOption.wrapOnEscapedLineFeeds */
      );
      this._lines = new Gpt(this._editorId, this.model, r, s, h, this.model.getOptions().tabSize, g, m.wrappingColumn, _, v, w);
    }
    this.coordinatesConverter = this._lines.createCoordinatesConverter(), this._cursor = this._register(new Tpt(n, this, this.coordinatesConverter, this.cursorConfig)), this.viewLayout = this._register(new Bpt(this._configuration, this.getLineCount(), this._getCustomLineHeights(), o)), this._register(this.viewLayout.onDidScroll((d) => {
      d.scrollTopChanged && this._handleVisibleLinesChanged(), d.scrollTopChanged && this._viewportStart.invalidate(), this._eventDispatcher.emitSingleViewEvent(new lpt(d)), this._eventDispatcher.emitOutgoingEvent(new oge(d.oldScrollWidth, d.oldScrollLeft, d.oldScrollHeight, d.oldScrollTop, d.scrollWidth, d.scrollLeft, d.scrollHeight, d.scrollTop));
    })), this._register(this.viewLayout.onDidContentSizeChange((d) => {
      this._eventDispatcher.emitOutgoingEvent(d);
    })), this._decorations = new Wpt(this._editorId, this.model, this._configuration, this._lines, this.coordinatesConverter), this._registerModelEvents(), this._register(this._configuration.onDidChangeFast((d) => {
      try {
        const h = this._eventDispatcher.beginEmitViewEvents();
        this._onConfigurationChanged(h, d);
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
    })), this._register(fU.getInstance().onDidChange(() => {
      this._eventDispatcher.emitSingleViewEvent(new dpt());
    })), this._register(this._themeService.onDidColorThemeChange((d) => {
      this._invalidateDecorationsColorCache(), this._eventDispatcher.emitSingleViewEvent(new cpt(d));
    })), this._updateConfigurationViewLineCountNow();
  }
  dispose() {
    super.dispose(), this._decorations.dispose(), this._lines.dispose(), this._viewportStart.dispose(), this._eventDispatcher.dispose();
  }
  createLineBreaksComputer() {
    return this._lines.createLineBreaksComputer();
  }
  addViewEventHandler(e) {
    this._eventDispatcher.addViewEventHandler(e);
  }
  removeViewEventHandler(e) {
    this._eventDispatcher.removeViewEventHandler(e);
  }
  _getCustomLineHeights() {
    return this._configuration.options.get(
      5
      /* EditorOption.allowVariableLineHeights */
    ) ? this.model.getCustomLineHeightsDecorations(this._editorId).map((n) => {
      const r = n.range.startLineNumber, s = this.coordinatesConverter.convertModelRangeToViewRange(new z(r, 1, r, this.model.getLineMaxColumn(r)));
      return {
        decorationId: n.id,
        startLineNumber: s.startLineNumber,
        endLineNumber: s.endLineNumber,
        lineHeight: n.options.lineHeight || 0
      };
    }) : [];
  }
  _updateConfigurationViewLineCountNow() {
    this._configuration.setViewLineCount(this._lines.getViewLineCount());
  }
  getModelVisibleRanges() {
    const e = this.viewLayout.getLinesViewportData(), t = new z(e.startLineNumber, this.getLineMinColumn(e.startLineNumber), e.endLineNumber, this.getLineMaxColumn(e.endLineNumber));
    return this._toModelVisibleRanges(t);
  }
  visibleLinesStabilized() {
    const e = this.getModelVisibleRanges();
    this._attachedView.setVisibleLines(e, !0);
  }
  _handleVisibleLinesChanged() {
    const e = this.getModelVisibleRanges();
    this._attachedView.setVisibleLines(e, !1);
  }
  setHasFocus(e) {
    this._hasFocus = e, this._cursor.setHasFocus(e), this._eventDispatcher.emitSingleViewEvent(new opt(e)), this._eventDispatcher.emitOutgoingEvent(new lK(!e, e));
  }
  setHasWidgetFocus(e) {
    this._eventDispatcher.emitOutgoingEvent(new ppt(!e, e));
  }
  onCompositionStart() {
    this._eventDispatcher.emitSingleViewEvent(new npt());
  }
  onCompositionEnd() {
    this._eventDispatcher.emitSingleViewEvent(new ipt());
  }
  _captureStableViewport() {
    if (this._viewportStart.isValid && this.viewLayout.getCurrentScrollTop() > 0) {
      const e = new de(this._viewportStart.viewLineNumber, this.getLineMinColumn(this._viewportStart.viewLineNumber)), t = this.coordinatesConverter.convertViewPositionToModelPosition(e);
      return new qTe(t, this._viewportStart.startLineDelta);
    }
    return new qTe(null, 0);
  }
  _onConfigurationChanged(e, t) {
    const n = this._captureStableViewport(), r = this._configuration.options, s = r.get(
      59
      /* EditorOption.fontInfo */
    ), o = r.get(
      156
      /* EditorOption.wrappingStrategy */
    ), a = r.get(
      166
      /* EditorOption.wrappingInfo */
    ), l = r.get(
      155
      /* EditorOption.wrappingIndent */
    ), c = r.get(
      146
      /* EditorOption.wordBreak */
    );
    this._lines.setWrappingSettings(s, o, a.wrappingColumn, l, c) && (e.emitViewEvent(new X7()), e.emitViewEvent(new Z7()), e.emitViewEvent(new sE(null)), this._cursor.onLineMappingChanged(e), this._decorations.onLineMappingChanged(), this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()), this._updateConfigurationViewLineCount.schedule()), t.hasChanged(
      104
      /* EditorOption.readOnly */
    ) && (this._decorations.reset(), e.emitViewEvent(new sE(null))), t.hasChanged(
      112
      /* EditorOption.renderValidationDecorations */
    ) && (this._decorations.reset(), e.emitViewEvent(new sE(null))), e.emitViewEvent(new rpt(t)), this.viewLayout.onConfigurationChanged(t), n.recoverViewportStart(this.coordinatesConverter, this.viewLayout), hI.shouldRecreate(t) && (this.cursorConfig = new hI(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._cursor.updateConfiguration(this.cursorConfig));
  }
  _registerModelEvents() {
    this._register(this.model.onDidChangeContentOrInjectedText((n) => {
      try {
        const s = this._eventDispatcher.beginEmitViewEvents();
        let o = !1, a = !1;
        const l = n instanceof Vx ? n.rawContentChangedEvent.changes : n.changes, c = n instanceof Vx ? n.rawContentChangedEvent.versionId : null, u = this._lines.createLineBreaksComputer();
        for (const g of l)
          switch (g.changeType) {
            case 4: {
              for (let m = 0; m < g.detail.length; m++) {
                const _ = g.detail[m];
                let v = g.injectedTexts[m];
                v && (v = v.filter((w) => !w.ownerId || w.ownerId === this._editorId)), u.addRequest(_, v, null);
              }
              break;
            }
            case 2: {
              let m = null;
              g.injectedText && (m = g.injectedText.filter((_) => !_.ownerId || _.ownerId === this._editorId)), u.addRequest(g.detail, m, null);
              break;
            }
          }
        const d = u.finalize(), h = new Ky(d);
        for (const g of l)
          switch (g.changeType) {
            case 1: {
              this._lines.onModelFlushed(), s.emitViewEvent(new X7()), this._decorations.reset(), this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()), o = !0;
              break;
            }
            case 3: {
              const m = this._lines.onModelLinesDeleted(c, g.fromLineNumber, g.toLineNumber);
              m !== null && (s.emitViewEvent(m), this.viewLayout.onLinesDeleted(m.fromLineNumber, m.toLineNumber)), o = !0;
              break;
            }
            case 4: {
              const m = h.takeCount(g.detail.length), _ = this._lines.onModelLinesInserted(c, g.fromLineNumber, g.toLineNumber, m);
              _ !== null && (s.emitViewEvent(_), this.viewLayout.onLinesInserted(_.fromLineNumber, _.toLineNumber)), o = !0;
              break;
            }
            case 2: {
              const m = h.dequeue(), [_, v, w, E] = this._lines.onModelLineChanged(c, g.lineNumber, m);
              a = _, v && s.emitViewEvent(v), w && (s.emitViewEvent(w), this.viewLayout.onLinesInserted(w.fromLineNumber, w.toLineNumber)), E && (s.emitViewEvent(E), this.viewLayout.onLinesDeleted(E.fromLineNumber, E.toLineNumber));
              break;
            }
            case 5:
              break;
          }
        c !== null && this._lines.acceptVersionId(c), this.viewLayout.onHeightMaybeChanged(), !o && a && (s.emitViewEvent(new Z7()), s.emitViewEvent(new sE(null)), this._cursor.onLineMappingChanged(s), this._decorations.onLineMappingChanged());
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
      const r = this._viewportStart.isValid;
      if (this._viewportStart.invalidate(), this._configuration.setModelLineCount(this.model.getLineCount()), this._updateConfigurationViewLineCountNow(), !this._hasFocus && this.model.getAttachedEditorCount() >= 2 && r) {
        const s = this.model._getTrackedRange(this._viewportStart.modelTrackedRange);
        if (s) {
          const o = this.coordinatesConverter.convertModelPositionToViewPosition(s.getStartPosition()), a = this.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber);
          this.viewLayout.setScrollPosition(
            { scrollTop: a + this._viewportStart.startLineDelta },
            1
            /* ScrollType.Immediate */
          );
        }
      }
      try {
        const s = this._eventDispatcher.beginEmitViewEvents();
        n instanceof Vx && s.emitOutgoingEvent(new wpt(n.contentChangedEvent)), this._cursor.onModelContentChanged(s, n);
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
      this._handleVisibleLinesChanged();
    })), this._configuration.options.get(
      5
      /* EditorOption.allowVariableLineHeights */
    ) && this._register(this.model.onDidChangeLineHeight((n) => {
      const r = n.changes.filter((s) => s.ownerId === this._editorId || s.ownerId === 0);
      if (this.viewLayout.changeSpecialLineHeights((s) => {
        for (const o of r) {
          const { decorationId: a, lineNumber: l, lineHeight: c } = o, u = this.coordinatesConverter.convertModelRangeToViewRange(new z(l, 1, l, this.model.getLineMaxColumn(l)));
          c !== null ? s.insertOrChangeCustomLineHeight(a, u.startLineNumber, u.endLineNumber, c) : s.removeCustomLineHeight(a);
        }
      }), r.length > 0) {
        const s = new B3e(r);
        this._eventDispatcher.emitOutgoingEvent(new xpt(s));
      }
    })), this._configuration.options.get(
      172
      /* EditorOption.effectiveAllowVariableFonts */
    ) && this._register(this.model.onDidChangeFont((n) => {
      const r = n.changes.filter((s) => s.ownerId === this._editorId || s.ownerId === 0);
      if (r.length > 0) {
        const s = new H3e(r);
        this._eventDispatcher.emitOutgoingEvent(new Lpt(s));
      }
    })), this._register(this.model.onDidChangeTokens((n) => {
      const r = [];
      for (let s = 0, o = n.ranges.length; s < o; s++) {
        const a = n.ranges[s], l = this.coordinatesConverter.convertModelPositionToViewPosition(new de(a.fromLineNumber, 1)).lineNumber, c = this.coordinatesConverter.convertModelPositionToViewPosition(new de(a.toLineNumber, this.model.getLineMaxColumn(a.toLineNumber))).lineNumber;
        r[s] = {
          fromLineNumber: l,
          toLineNumber: c
        };
      }
      this._eventDispatcher.emitSingleViewEvent(new upt(r)), this._eventDispatcher.emitOutgoingEvent(new Ept(n));
    })), this._register(this.model.onDidChangeLanguageConfiguration((n) => {
      this._eventDispatcher.emitSingleViewEvent(new apt()), this.cursorConfig = new hI(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._cursor.updateConfiguration(this.cursorConfig), this._eventDispatcher.emitOutgoingEvent(new Cpt(n));
    })), this._register(this.model.onDidChangeLanguage((n) => {
      this.cursorConfig = new hI(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._cursor.updateConfiguration(this.cursorConfig), this._eventDispatcher.emitOutgoingEvent(new ypt(n));
    })), this._register(this.model.onDidChangeOptions((n) => {
      if (this._lines.setTabSize(this.model.getOptions().tabSize)) {
        try {
          const r = this._eventDispatcher.beginEmitViewEvents();
          r.emitViewEvent(new X7()), r.emitViewEvent(new Z7()), r.emitViewEvent(new sE(null)), this._cursor.onLineMappingChanged(r), this._decorations.onLineMappingChanged(), this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights());
        } finally {
          this._eventDispatcher.endEmitViewEvents();
        }
        this._updateConfigurationViewLineCount.schedule();
      }
      this.cursorConfig = new hI(this.model.getLanguageId(), this.model.getOptions(), this._configuration, this.languageConfigurationService), this._cursor.updateConfiguration(this.cursorConfig), this._eventDispatcher.emitOutgoingEvent(new Spt(n));
    })), this._register(this.model.onDidChangeDecorations((n) => {
      this._decorations.onModelDecorationsChanged(), this._eventDispatcher.emitSingleViewEvent(new sE(n)), this._eventDispatcher.emitOutgoingEvent(new vpt(n));
    }));
  }
  getFontSizeAtPosition(e) {
    if (!this._configuration.options.get(
      172
      /* EditorOption.effectiveAllowVariableFonts */
    ))
      return null;
    const n = this.model.getFontDecorationsInRange(z.fromPositions(e), this._editorId);
    let r = this._configuration.options.get(
      59
      /* EditorOption.fontInfo */
    ).fontSize + "px";
    for (const s of n)
      if (s.options.fontSize) {
        r = s.options.fontSize;
        break;
      }
    return r;
  }
  /**
   * @param forceUpdate If true, the hidden areas will be updated even if the new ranges are the same as the previous ranges.
   * This is because the model might have changed, which resets the hidden areas, but not the last cached value.
   * This needs a better fix in the future.
  */
  setHiddenAreas(e, t, n) {
    var a;
    this.hiddenAreasModel.setHiddenAreas(t, e);
    const r = this.hiddenAreasModel.getMergedRanges();
    if (r === this.previousHiddenAreas && !n)
      return;
    this.previousHiddenAreas = r;
    const s = this._captureStableViewport();
    let o = !1;
    try {
      const l = this._eventDispatcher.beginEmitViewEvents();
      o = this._lines.setHiddenAreas(r), o && (l.emitViewEvent(new X7()), l.emitViewEvent(new Z7()), l.emitViewEvent(new sE(null)), this._cursor.onLineMappingChanged(l), this._decorations.onLineMappingChanged(), this.viewLayout.onFlushed(this.getLineCount(), this._getCustomLineHeights()), this.viewLayout.onHeightMaybeChanged());
      const c = (a = s.viewportStartModelPosition) == null ? void 0 : a.lineNumber;
      c && r.some((d) => d.startLineNumber <= c && c <= d.endLineNumber) || s.recoverViewportStart(this.coordinatesConverter, this.viewLayout);
    } finally {
      this._eventDispatcher.endEmitViewEvents();
    }
    this._updateConfigurationViewLineCount.schedule(), o && this._eventDispatcher.emitOutgoingEvent(new _pt());
  }
  getVisibleRangesPlusViewportAboveBelow() {
    const e = this._configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ), t = this._configuration.options.get(
      75
      /* EditorOption.lineHeight */
    ), n = Math.max(20, Math.round(e.height / t)), r = this.viewLayout.getLinesViewportData(), s = Math.max(1, r.completelyVisibleStartLineNumber - n), o = Math.min(this.getLineCount(), r.completelyVisibleEndLineNumber + n);
    return this._toModelVisibleRanges(new z(s, this.getLineMinColumn(s), o, this.getLineMaxColumn(o)));
  }
  getVisibleRanges() {
    const e = this.getCompletelyVisibleViewRange();
    return this._toModelVisibleRanges(e);
  }
  getHiddenAreas() {
    return this._lines.getHiddenAreas();
  }
  _toModelVisibleRanges(e) {
    const t = this.coordinatesConverter.convertViewRangeToModelRange(e), n = this._lines.getHiddenAreas();
    if (n.length === 0)
      return [t];
    const r = [];
    let s = 0, o = t.startLineNumber, a = t.startColumn;
    const l = t.endLineNumber, c = t.endColumn;
    for (let u = 0, d = n.length; u < d; u++) {
      const h = n[u].startLineNumber, g = n[u].endLineNumber;
      g < o || h > l || (o < h && (r[s++] = new z(o, a, h - 1, this.model.getLineMaxColumn(h - 1))), o = g + 1, a = 1);
    }
    return (o < l || o === l && a < c) && (r[s++] = new z(o, a, l, c)), r;
  }
  getCompletelyVisibleViewRange() {
    const e = this.viewLayout.getLinesViewportData(), t = e.completelyVisibleStartLineNumber, n = e.completelyVisibleEndLineNumber;
    return new z(t, this.getLineMinColumn(t), n, this.getLineMaxColumn(n));
  }
  getCompletelyVisibleViewRangeAtScrollTop(e) {
    const t = this.viewLayout.getLinesViewportDataAtScrollTop(e), n = t.completelyVisibleStartLineNumber, r = t.completelyVisibleEndLineNumber;
    return new z(n, this.getLineMinColumn(n), r, this.getLineMaxColumn(r));
  }
  saveState() {
    const e = this.viewLayout.saveState(), t = e.scrollTop, n = this.viewLayout.getLineNumberAtVerticalOffset(t), r = this.coordinatesConverter.convertViewPositionToModelPosition(new de(n, this.getLineMinColumn(n))), s = this.viewLayout.getVerticalOffsetForLineNumber(n) - t;
    return {
      scrollLeft: e.scrollLeft,
      firstPosition: r,
      firstPositionDeltaTop: s
    };
  }
  reduceRestoreState(e) {
    if (typeof e.firstPosition > "u")
      return this._reduceRestoreStateCompatibility(e);
    const t = this.model.validatePosition(e.firstPosition), n = this.coordinatesConverter.convertModelPositionToViewPosition(t), r = this.viewLayout.getVerticalOffsetForLineNumber(n.lineNumber) - e.firstPositionDeltaTop;
    return {
      scrollLeft: e.scrollLeft,
      scrollTop: r
    };
  }
  _reduceRestoreStateCompatibility(e) {
    return {
      scrollLeft: e.scrollLeft,
      scrollTop: e.scrollTopWithoutViewZones
    };
  }
  getTabSize() {
    return this.model.getOptions().tabSize;
  }
  getLineCount() {
    return this._lines.getViewLineCount();
  }
  /**
   * Gives a hint that a lot of requests are about to come in for these line numbers.
   */
  setViewport(e, t, n) {
    this._viewportStart.update(this, e);
  }
  getActiveIndentGuide(e, t, n) {
    return this._lines.getActiveIndentGuide(e, t, n);
  }
  getLinesIndentGuides(e, t) {
    return this._lines.getViewLinesIndentGuides(e, t);
  }
  getBracketGuidesInRangeByLine(e, t, n, r) {
    return this._lines.getViewLinesBracketGuides(e, t, n, r);
  }
  getLineContent(e) {
    return this._lines.getViewLineContent(e);
  }
  getLineLength(e) {
    return this._lines.getViewLineLength(e);
  }
  getLineMinColumn(e) {
    return this._lines.getViewLineMinColumn(e);
  }
  getLineMaxColumn(e) {
    return this._lines.getViewLineMaxColumn(e);
  }
  getLineFirstNonWhitespaceColumn(e) {
    const t = Tc(this.getLineContent(e));
    return t === -1 ? 0 : t + 1;
  }
  getLineLastNonWhitespaceColumn(e) {
    const t = zg(this.getLineContent(e));
    return t === -1 ? 0 : t + 2;
  }
  getMinimapDecorationsInRange(e) {
    return this._decorations.getMinimapDecorationsInRange(e);
  }
  getDecorationsInViewport(e) {
    return this._decorations.getDecorationsViewportData(e).decorations;
  }
  getInjectedTextAt(e) {
    return this._lines.getInjectedTextAt(e);
  }
  _getTextDirection(e, t) {
    let n = 0;
    for (const r of t) {
      const s = r.range;
      if (s.startLineNumber > e || s.endLineNumber < e)
        continue;
      const o = r.options.textDirection;
      o === Ph.RTL ? n++ : o === Ph.LTR && n--;
    }
    return n > 0 ? Ph.RTL : Ph.LTR;
  }
  getTextDirection(e) {
    const t = this._decorations.getDecorationsOnLine(e);
    return this._getTextDirection(e, t.decorations);
  }
  getViewportViewLineRenderingData(e, t) {
    const n = this._decorations.getDecorationsViewportData(e), r = n.inlineDecorations[t - e.startLineNumber];
    return this._getViewLineRenderingData(t, r, n.hasVariableFonts, n.decorations);
  }
  getViewLineRenderingData(e) {
    const t = this._decorations.getDecorationsOnLine(e);
    return this._getViewLineRenderingData(e, t.inlineDecorations[0], t.hasVariableFonts, t.decorations);
  }
  _getViewLineRenderingData(e, t, n, r) {
    const s = this.model.mightContainRTL(), o = this.model.mightContainNonBasicASCII(), a = this.getTabSize(), l = this._lines.getViewLineData(e);
    return l.inlineDecorations && (t = [
      ...t,
      ...l.inlineDecorations.map((c) => c.toInlineDecoration(e))
    ]), new Kh(l.minColumn, l.maxColumn, l.content, l.continuesWithWrappedLine, s, o, l.tokens, t, a, l.startVisibleColumn, this._getTextDirection(e, r), n);
  }
  getViewLineData(e) {
    return this._lines.getViewLineData(e);
  }
  getMinimapLinesRenderingData(e, t, n) {
    const r = this._lines.getViewLinesData(e, t, n);
    return new Fdt(this.getTabSize(), r);
  }
  getAllOverviewRulerDecorations(e) {
    const t = this.model.getOverviewRulerDecorations(this._editorId, XV(this._configuration.options), ZV(this._configuration.options)), n = new Qpt();
    for (const r of t) {
      const s = r.options, o = s.overviewRuler;
      if (!o)
        continue;
      const a = o.position;
      if (a === 0)
        continue;
      const l = o.getColor(e.value), c = this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.startLineNumber, r.range.startColumn), u = this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.endLineNumber, r.range.endColumn);
      n.accept(l, s.zIndex, c, u, a);
    }
    return n.asArray;
  }
  _invalidateDecorationsColorCache() {
    const e = this.model.getOverviewRulerDecorations();
    for (const t of e) {
      const n = t.options.overviewRuler;
      n == null || n.invalidateCachedColor();
      const r = t.options.minimap;
      r == null || r.invalidateCachedColor();
    }
  }
  getValueInRange(e, t) {
    const n = this.coordinatesConverter.convertViewRangeToModelRange(e);
    return this.model.getValueInRange(n, t);
  }
  getValueLengthInRange(e, t) {
    const n = this.coordinatesConverter.convertViewRangeToModelRange(e);
    return this.model.getValueLengthInRange(n, t);
  }
  modifyPosition(e, t) {
    const n = this.coordinatesConverter.convertViewPositionToModelPosition(e), r = this.model.modifyPosition(n, t);
    return this.coordinatesConverter.convertModelPositionToViewPosition(r);
  }
  deduceModelPositionRelativeToViewPosition(e, t, n) {
    const r = this.coordinatesConverter.convertViewPositionToModelPosition(e);
    this.model.getEOL().length === 2 && (t < 0 ? t -= n : t += n);
    const o = this.model.getOffsetAt(r) + t;
    return this.model.getPositionAt(o);
  }
  getPlainTextToCopy(e, t, n) {
    const r = n ? `\r
` : this.model.getEOL();
    e = e.slice(0), e.sort(z.compareRangesUsingStarts);
    let s = !1, o = !1;
    for (const l of e)
      l.isEmpty() ? s = !0 : o = !0;
    if (!o) {
      if (!t)
        return "";
      const l = e.map((u) => u.startLineNumber);
      let c = "";
      for (let u = 0; u < l.length; u++)
        u > 0 && l[u - 1] === l[u] || (c += this.model.getLineContent(l[u]) + r);
      return c;
    }
    if (s && t) {
      const l = [];
      let c = 0;
      for (const u of e) {
        const d = u.startLineNumber;
        u.isEmpty() ? d !== c && l.push(this.model.getLineContent(d)) : l.push(this.model.getValueInRange(
          u,
          n ? 2 : 0
          /* EndOfLinePreference.TextDefined */
        )), c = d;
      }
      return l.length === 1 ? l[0] : l;
    }
    const a = [];
    for (const l of e)
      l.isEmpty() || a.push(this.model.getValueInRange(
        l,
        n ? 2 : 0
        /* EndOfLinePreference.TextDefined */
      ));
    return a.length === 1 ? a[0] : a;
  }
  getRichTextToCopy(e, t) {
    const n = this.model.getLanguageId();
    if (n === $h || e.length !== 1)
      return null;
    let r = e[0];
    if (r.isEmpty()) {
      if (!t)
        return null;
      const u = r.startLineNumber;
      r = new z(u, this.model.getLineMinColumn(u), u, this.model.getLineMaxColumn(u));
    }
    const s = this._configuration.options.get(
      59
      /* EditorOption.fontInfo */
    ), o = this._getColorMap(), l = /[:;\\\/<>]/.test(s.fontFamily) || s.fontFamily === au.fontFamily;
    let c;
    return l ? c = au.fontFamily : (c = s.fontFamily, c = c.replace(/"/g, "'"), /[,']/.test(c) || /[+ ]/.test(c) && (c = `'${c}'`), c = `${c}, ${au.fontFamily}`), {
      mode: n,
      html: `<div style="color: ${o[
        1
        /* ColorId.DefaultForeground */
      ]};background-color: ${o[
        2
        /* ColorId.DefaultBackground */
      ]};font-family: ${c};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">` + this._getHTMLToCopy(r, o) + "</div>"
    };
  }
  _getHTMLToCopy(e, t) {
    const n = e.startLineNumber, r = e.startColumn, s = e.endLineNumber, o = e.endColumn, a = this.getTabSize();
    let l = "";
    for (let c = n; c <= s; c++) {
      const u = this.model.tokenization.getLineTokens(c), d = u.getLineContent(), h = c === n ? r - 1 : 0, g = c === s ? o - 1 : d.length;
      d === "" ? l += "<br>" : l += Npt(d, u.inflate(), t, h, g, a, Za);
    }
    return l;
  }
  _getColorMap() {
    const e = Ys.getColorMap(), t = ["#000000"];
    if (e)
      for (let n = 1, r = e.length; n < r; n++)
        t[n] = De.Format.CSS.formatHex(e[n]);
    return t;
  }
  //#region cursor operations
  getPrimaryCursorState() {
    return this._cursor.getPrimaryCursorState();
  }
  getLastAddedCursorIndex() {
    return this._cursor.getLastAddedCursorIndex();
  }
  getCursorStates() {
    return this._cursor.getCursorStates();
  }
  setCursorStates(e, t, n) {
    return this._withViewEventsCollector((r) => this._cursor.setStates(r, e, t, n));
  }
  getCursorColumnSelectData() {
    return this._cursor.getCursorColumnSelectData();
  }
  getCursorAutoClosedCharacters() {
    return this._cursor.getAutoClosedCharacters();
  }
  setCursorColumnSelectData(e) {
    this._cursor.setCursorColumnSelectData(e);
  }
  getPrevEditOperationType() {
    return this._cursor.getPrevEditOperationType();
  }
  setPrevEditOperationType(e) {
    this._cursor.setPrevEditOperationType(e);
  }
  getSelection() {
    return this._cursor.getSelection();
  }
  getSelections() {
    return this._cursor.getSelections();
  }
  getPosition() {
    return this._cursor.getPrimaryCursorState().modelState.position;
  }
  setSelections(e, t, n = 0) {
    this._withViewEventsCollector((r) => this._cursor.setSelections(r, e, t, n));
  }
  saveCursorState() {
    return this._cursor.saveState();
  }
  restoreCursorState(e) {
    this._withViewEventsCollector((t) => this._cursor.restoreState(t, e));
  }
  _executeCursorEdit(e) {
    if (this._cursor.context.cursorConfig.readOnly) {
      this._eventDispatcher.emitOutgoingEvent(new bpt());
      return;
    }
    this._withViewEventsCollector(e);
  }
  executeEdits(e, t, n, r) {
    this._executeCursorEdit((s) => this._cursor.executeEdits(s, e, t, n, r));
  }
  startComposition() {
    this._executeCursorEdit((e) => this._cursor.startComposition(e));
  }
  endComposition(e) {
    this._executeCursorEdit((t) => this._cursor.endComposition(t, e));
  }
  type(e, t) {
    this._executeCursorEdit((n) => this._cursor.type(n, e, t));
  }
  compositionType(e, t, n, r, s) {
    this._executeCursorEdit((o) => this._cursor.compositionType(o, e, t, n, r, s));
  }
  paste(e, t, n, r) {
    this._executeCursorEdit((s) => this._cursor.paste(s, e, t, n, r));
  }
  cut(e) {
    this._executeCursorEdit((t) => this._cursor.cut(t, e));
  }
  executeCommand(e, t) {
    this._executeCursorEdit((n) => this._cursor.executeCommand(n, e, t));
  }
  executeCommands(e, t) {
    this._executeCursorEdit((n) => this._cursor.executeCommands(n, e, t));
  }
  revealAllCursors(e, t, n = !1) {
    this._withViewEventsCollector((r) => this._cursor.revealAll(
      r,
      e,
      n,
      0,
      t,
      0
      /* ScrollType.Smooth */
    ));
  }
  revealPrimaryCursor(e, t, n = !1) {
    this._withViewEventsCollector((r) => this._cursor.revealPrimary(
      r,
      e,
      n,
      0,
      t,
      0
      /* ScrollType.Smooth */
    ));
  }
  revealTopMostCursor(e) {
    const t = this._cursor.getTopMostViewPosition(), n = new z(t.lineNumber, t.column, t.lineNumber, t.column);
    this._withViewEventsCollector((r) => r.emitViewEvent(new MF(
      e,
      !1,
      n,
      null,
      0,
      !0,
      0
      /* ScrollType.Smooth */
    )));
  }
  revealBottomMostCursor(e) {
    const t = this._cursor.getBottomMostViewPosition(), n = new z(t.lineNumber, t.column, t.lineNumber, t.column);
    this._withViewEventsCollector((r) => r.emitViewEvent(new MF(
      e,
      !1,
      n,
      null,
      0,
      !0,
      0
      /* ScrollType.Smooth */
    )));
  }
  revealRange(e, t, n, r, s) {
    this._withViewEventsCollector((o) => o.emitViewEvent(new MF(e, !1, n, null, r, t, s)));
  }
  //#endregion
  //#region viewLayout
  changeWhitespace(e) {
    this.viewLayout.changeWhitespace(e) && (this._eventDispatcher.emitSingleViewEvent(new hpt()), this._eventDispatcher.emitOutgoingEvent(new mpt()));
  }
  //#endregion
  _withViewEventsCollector(e) {
    return this._transactionalTarget.batchChanges(() => {
      try {
        const t = this._eventDispatcher.beginEmitViewEvents();
        return e(t);
      } finally {
        this._eventDispatcher.endEmitViewEvents();
      }
    });
  }
  batchEvents(e) {
    this._withViewEventsCollector(() => {
      e();
    });
  }
  normalizePosition(e, t) {
    return this._lines.normalizePosition(e, t);
  }
  /**
   * Gets the column at which indentation stops at a given line.
   * @internal
  */
  getLineIndentColumn(e) {
    return this._lines.getLineIndentColumn(e);
  }
};
class age {
  static create(e) {
    const t = e._setTrackedRange(
      null,
      new z(1, 1, 1, 1),
      1
      /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
    );
    return new age(e, 1, !1, t, 0);
  }
  get viewLineNumber() {
    return this._viewLineNumber;
  }
  get isValid() {
    return this._isValid;
  }
  get modelTrackedRange() {
    return this._modelTrackedRange;
  }
  get startLineDelta() {
    return this._startLineDelta;
  }
  constructor(e, t, n, r, s) {
    this._model = e, this._viewLineNumber = t, this._isValid = n, this._modelTrackedRange = r, this._startLineDelta = s;
  }
  dispose() {
    this._model._setTrackedRange(
      this._modelTrackedRange,
      null,
      1
      /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
    );
  }
  update(e, t) {
    const n = e.coordinatesConverter.convertViewPositionToModelPosition(new de(t, e.getLineMinColumn(t))), r = e.model._setTrackedRange(
      this._modelTrackedRange,
      new z(n.lineNumber, n.column, n.lineNumber, n.column),
      1
      /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
    ), s = e.viewLayout.getVerticalOffsetForLineNumber(t), o = e.viewLayout.getCurrentScrollTop();
    this._viewLineNumber = t, this._isValid = !0, this._modelTrackedRange = r, this._startLineDelta = o - s;
  }
  invalidate() {
    this._isValid = !1;
  }
}
class Qpt {
  constructor() {
    this._asMap = /* @__PURE__ */ Object.create(null), this.asArray = [];
  }
  accept(e, t, n, r, s) {
    const o = this._asMap[e];
    if (o) {
      const a = o.data, l = a[a.length - 3], c = a[a.length - 1];
      if (l === s && c + 1 >= n) {
        r > c && (a[a.length - 1] = r);
        return;
      }
      a.push(s, n, r);
    } else {
      const a = new D4(e, t, [s, n, r]);
      this._asMap[e] = a, this.asArray.push(a);
    }
  }
}
class Jpt {
  constructor() {
    this.hiddenAreas = /* @__PURE__ */ new Map(), this.shouldRecompute = !1, this.ranges = [];
  }
  setHiddenAreas(e, t) {
    const n = this.hiddenAreas.get(e);
    n && GTe(n, t) || (this.hiddenAreas.set(e, t), this.shouldRecompute = !0);
  }
  /**
   * The returned array is immutable.
  */
  getMergedRanges() {
    if (!this.shouldRecompute)
      return this.ranges;
    this.shouldRecompute = !1;
    const e = Array.from(this.hiddenAreas.values()).reduce((t, n) => emt(t, n), []);
    return GTe(this.ranges, e) ? this.ranges : (this.ranges = e, this.ranges);
  }
}
function emt(i, e) {
  const t = [];
  let n = 0, r = 0;
  for (; n < i.length && r < e.length; ) {
    const s = i[n], o = e[r];
    if (s.endLineNumber < o.startLineNumber - 1)
      t.push(i[n++]);
    else if (o.endLineNumber < s.startLineNumber - 1)
      t.push(e[r++]);
    else {
      const a = Math.min(s.startLineNumber, o.startLineNumber), l = Math.max(s.endLineNumber, o.endLineNumber);
      t.push(new z(a, 1, l, 1)), n++, r++;
    }
  }
  for (; n < i.length; )
    t.push(i[n++]);
  for (; r < e.length; )
    t.push(e[r++]);
  return t;
}
function GTe(i, e) {
  if (i.length !== e.length)
    return !1;
  for (let t = 0; t < i.length; t++)
    if (!i[t].equalsRange(e[t]))
      return !1;
  return !0;
}
class qTe {
  constructor(e, t) {
    this.viewportStartModelPosition = e, this.startLineDelta = t;
  }
  recoverViewportStart(e, t) {
    if (!this.viewportStartModelPosition)
      return;
    const n = e.convertModelPositionToViewPosition(this.viewportStartModelPosition), r = t.getVerticalOffsetForLineNumber(n.lineNumber);
    t.setScrollPosition(
      { scrollTop: r + this.startLineDelta },
      1
      /* ScrollType.Immediate */
    );
  }
}
class r2 {
  constructor(...e) {
    this._entries = /* @__PURE__ */ new Map();
    for (const [t, n] of e)
      this.set(t, n);
  }
  set(e, t) {
    const n = this._entries.get(e);
    return this._entries.set(e, t), n;
  }
  get(e) {
    return this._entries.get(e);
  }
}
var tmt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Av = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, xE, Jx;
let uT = (Jx = class extends ge {
  //#endregion
  get isSimpleWidget() {
    return this._configuration.isSimpleWidget;
  }
  get contextMenuId() {
    return this._configuration.contextMenuId;
  }
  get contextKeyService() {
    return this._contextKeyService;
  }
  constructor(e, t, n, r, s, o, a, l, c, u, d, h) {
    super(), this.languageConfigurationService = d, this._deliveryQueue = Gtt(), this._contributions = this._register(new uft()), this._onDidDispose = this._register(new he()), this.onDidDispose = this._onDidDispose.event, this._onDidChangeModelContent = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelContent = this._onDidChangeModelContent.event, this._onDidChangeModelLanguage = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelLanguage = this._onDidChangeModelLanguage.event, this._onDidChangeModelLanguageConfiguration = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelLanguageConfiguration = this._onDidChangeModelLanguageConfiguration.event, this._onDidChangeModelOptions = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelOptions = this._onDidChangeModelOptions.event, this._onDidChangeModelDecorations = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelDecorations = this._onDidChangeModelDecorations.event, this._onDidChangeLineHeight = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeLineHeight = this._onDidChangeLineHeight.event, this._onDidChangeFont = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeFont = this._onDidChangeFont.event, this._onDidChangeModelTokens = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModelTokens = this._onDidChangeModelTokens.event, this._onDidChangeConfiguration = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeConfiguration = this._onDidChangeConfiguration.event, this._onWillChangeModel = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onWillChangeModel = this._onWillChangeModel.event, this._onDidChangeModel = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeModel = this._onDidChangeModel.event, this._onDidChangeCursorPosition = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeCursorPosition = this._onDidChangeCursorPosition.event, this._onDidChangeCursorSelection = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeCursorSelection = this._onDidChangeCursorSelection.event, this._onDidAttemptReadOnlyEdit = this._register(new hc(this._contributions, this._deliveryQueue)), this.onDidAttemptReadOnlyEdit = this._onDidAttemptReadOnlyEdit.event, this._onDidLayoutChange = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidLayoutChange = this._onDidLayoutChange.event, this._editorTextFocus = this._register(new KTe({ deliveryQueue: this._deliveryQueue })), this.onDidFocusEditorText = this._editorTextFocus.onDidChangeToTrue, this.onDidBlurEditorText = this._editorTextFocus.onDidChangeToFalse, this._editorWidgetFocus = this._register(new KTe({ deliveryQueue: this._deliveryQueue })), this.onDidFocusEditorWidget = this._editorWidgetFocus.onDidChangeToTrue, this.onDidBlurEditorWidget = this._editorWidgetFocus.onDidChangeToFalse, this._onWillType = this._register(new hc(this._contributions, this._deliveryQueue)), this.onWillType = this._onWillType.event, this._onDidType = this._register(new hc(this._contributions, this._deliveryQueue)), this.onDidType = this._onDidType.event, this._onDidCompositionStart = this._register(new hc(this._contributions, this._deliveryQueue)), this.onDidCompositionStart = this._onDidCompositionStart.event, this._onDidCompositionEnd = this._register(new hc(this._contributions, this._deliveryQueue)), this.onDidCompositionEnd = this._onDidCompositionEnd.event, this._onDidPaste = this._register(new hc(this._contributions, this._deliveryQueue)), this.onDidPaste = this._onDidPaste.event, this._onMouseUp = this._register(new hc(this._contributions, this._deliveryQueue)), this.onMouseUp = this._onMouseUp.event, this._onMouseDown = this._register(new hc(this._contributions, this._deliveryQueue)), this.onMouseDown = this._onMouseDown.event, this._onMouseDrag = this._register(new hc(this._contributions, this._deliveryQueue)), this.onMouseDrag = this._onMouseDrag.event, this._onMouseDrop = this._register(new hc(this._contributions, this._deliveryQueue)), this.onMouseDrop = this._onMouseDrop.event, this._onMouseDropCanceled = this._register(new hc(this._contributions, this._deliveryQueue)), this.onMouseDropCanceled = this._onMouseDropCanceled.event, this._onDropIntoEditor = this._register(new hc(this._contributions, this._deliveryQueue)), this.onDropIntoEditor = this._onDropIntoEditor.event, this._onContextMenu = this._register(new hc(this._contributions, this._deliveryQueue)), this.onContextMenu = this._onContextMenu.event, this._onMouseMove = this._register(new hc(this._contributions, this._deliveryQueue)), this.onMouseMove = this._onMouseMove.event, this._onMouseLeave = this._register(new hc(this._contributions, this._deliveryQueue)), this.onMouseLeave = this._onMouseLeave.event, this._onMouseWheel = this._register(new hc(this._contributions, this._deliveryQueue)), this.onMouseWheel = this._onMouseWheel.event, this._onKeyUp = this._register(new hc(this._contributions, this._deliveryQueue)), this.onKeyUp = this._onKeyUp.event, this._onKeyDown = this._register(new hc(this._contributions, this._deliveryQueue)), this.onKeyDown = this._onKeyDown.event, this._onDidContentSizeChange = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidContentSizeChange = this._onDidContentSizeChange.event, this._onDidScrollChange = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidScrollChange = this._onDidScrollChange.event, this._onDidChangeViewZones = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeViewZones = this._onDidChangeViewZones.event, this._onDidChangeHiddenAreas = this._register(new he({ deliveryQueue: this._deliveryQueue })), this.onDidChangeHiddenAreas = this._onDidChangeHiddenAreas.event, this._updateCounter = 0, this._onWillTriggerEditorOperationEvent = this._register(new he()), this._onBeginUpdate = this._register(new he()), this.onBeginUpdate = this._onBeginUpdate.event, this._onEndUpdate = this._register(new he()), this.onEndUpdate = this._onEndUpdate.event, this._onBeforeExecuteEdit = this._register(new he()), this.onBeforeExecuteEdit = this._onBeforeExecuteEdit.event, this._actions = /* @__PURE__ */ new Map(), this._bannerDomNode = null, this._dropIntoEditorDecorations = this.createDecorationsCollection(), this.inComposition = !1, s.willCreateCodeEditor();
    const g = { ...t };
    if (this._domElement = e, this._overflowWidgetsDomNode = g.overflowWidgetsDomNode, delete g.overflowWidgetsDomNode, this._id = ++nmt, this._decorationTypeKeysToIds = {}, this._decorationTypeSubtypes = {}, this._telemetryData = n.telemetryData, this._configuration = this._register(this._createConfiguration(n.isSimpleWidget || !1, n.contextMenuId ?? (n.isSimpleWidget ? wt.SimpleEditorContext : wt.EditorContext), g, u)), this._register(this._configuration.onDidChange((v) => {
      this._onDidChangeConfiguration.fire(v);
      const w = this._configuration.options;
      if (v.hasChanged(
        165
        /* EditorOption.layoutInfo */
      )) {
        const E = w.get(
          165
          /* EditorOption.layoutInfo */
        );
        this._onDidLayoutChange.fire(E);
      }
    })), this._contextKeyService = this._register(a.createScoped(this._domElement)), n.contextKeyValues)
      for (const [v, w] of Object.entries(n.contextKeyValues))
        this._contextKeyService.createKey(v, w);
    this._notificationService = c, this._codeEditorService = s, this._commandService = o, this._themeService = l, this._register(new rmt(this, this._contextKeyService)), this._register(new smt(this, this._contextKeyService, h)), this._instantiationService = this._register(r.createChild(new r2([Jt, this._contextKeyService]))), this._modelData = null, this._contentWidgets = {}, this._overlayWidgets = {}, this._glyphMarginWidgets = {};
    let m;
    Array.isArray(n.contributions) ? m = n.contributions : m = jN.getEditorContributions(), this._contributions.initialize(this, m, this._instantiationService);
    for (const v of jN.getEditorActions()) {
      if (this._actions.has(v.id)) {
        fn(new Error(`Cannot have two actions with the same id ${v.id}`));
        continue;
      }
      const w = new W3e(v.id, v.label, v.alias, v.metadata, v.precondition ?? void 0, (E) => this._instantiationService.invokeFunction((L) => Promise.resolve(v.runEditorCommand(L, this, E))), this._contextKeyService);
      this._actions.set(w.id, w);
    }
    const _ = () => !this._configuration.options.get(
      104
      /* EditorOption.readOnly */
    ) && this._configuration.options.get(
      43
      /* EditorOption.dropIntoEditor */
    ).enabled;
    this._register(new Kit(this._domElement, {
      onDragOver: (v) => {
        if (!_())
          return;
        const w = this.getTargetAtClientPoint(v.clientX, v.clientY);
        w != null && w.position && this.showDropIndicatorAt(w.position);
      },
      onDrop: async (v) => {
        if (!_() || (this.removeDropIndicator(), !v.dataTransfer))
          return;
        const w = this.getTargetAtClientPoint(v.clientX, v.clientY);
        w != null && w.position && this._onDropIntoEditor.fire({ position: w.position, event: v });
      },
      onDragLeave: () => {
        this.removeDropIndicator();
      },
      onDragEnd: () => {
        this.removeDropIndicator();
      }
    })), this._codeEditorService.addCodeEditor(this);
  }
  writeScreenReaderContent(e) {
    var t;
    (t = this._modelData) == null || t.view.writeScreenReaderContent(e);
  }
  _createConfiguration(e, t, n, r) {
    return new Bie(e, t, n, this._domElement, r);
  }
  getId() {
    return this.getEditorType() + ":" + this._id;
  }
  getEditorType() {
    return DB.ICodeEditor;
  }
  dispose() {
    this._codeEditorService.removeCodeEditor(this), this._actions.clear(), this._contentWidgets = {}, this._overlayWidgets = {}, this._removeDecorationTypes(), this._postDetachModelCleanup(this._detachModel()), this._onDidDispose.fire(), super.dispose();
  }
  invokeWithinContext(e) {
    return this._instantiationService.invokeFunction(e);
  }
  updateOptions(e) {
    this._configuration.updateOptions(e || {});
  }
  getOptions() {
    return this._configuration.options;
  }
  getOption(e) {
    return this._configuration.options.get(e);
  }
  getRawOptions() {
    return this._configuration.getRawOptions();
  }
  getOverflowWidgetsDomNode() {
    return this._overflowWidgetsDomNode;
  }
  getConfiguredWordAtPosition(e) {
    return this._modelData ? Qi.getWordAtPosition(this._modelData.model, this._configuration.options.get(
      148
      /* EditorOption.wordSeparators */
    ), this._configuration.options.get(
      147
      /* EditorOption.wordSegmenterLocales */
    ), e) : null;
  }
  getValue(e = null) {
    if (!this._modelData)
      return "";
    const t = !!(e && e.preserveBOM);
    let n = 0;
    return e && e.lineEnding && e.lineEnding === `
` ? n = 1 : e && e.lineEnding && e.lineEnding === `\r
` && (n = 2), this._modelData.model.getValue(n, t);
  }
  setValue(e) {
    try {
      if (this._beginUpdate(), !this._modelData)
        return;
      this._modelData.model.setValue(e);
    } finally {
      this._endUpdate();
    }
  }
  getModel() {
    return this._modelData ? this._modelData.model : null;
  }
  setModel(e = null) {
    var t;
    try {
      this._beginUpdate();
      const n = e;
      if (this._modelData === null && n === null || this._modelData && this._modelData.model === n)
        return;
      const r = {
        oldModelUrl: ((t = this._modelData) == null ? void 0 : t.model.uri) || null,
        newModelUrl: (n == null ? void 0 : n.uri) || null
      };
      this._onWillChangeModel.fire(r);
      const s = this.hasTextFocus(), o = this._detachModel();
      this._attachModel(n), this.hasModel() ? s && this.focus() : (this._editorTextFocus.setValue(!1), this._editorWidgetFocus.setValue(!1)), this._removeDecorationTypes(), this._onDidChangeModel.fire(r), this._postDetachModelCleanup(o), this._contributionsDisposable = this._contributions.onAfterModelAttached();
    } finally {
      this._endUpdate();
    }
  }
  _removeDecorationTypes() {
    if (this._decorationTypeKeysToIds = {}, this._decorationTypeSubtypes) {
      for (const e in this._decorationTypeSubtypes) {
        const t = this._decorationTypeSubtypes[e];
        for (const n in t)
          this._removeDecorationType(e + "-" + n);
      }
      this._decorationTypeSubtypes = {};
    }
  }
  getVisibleRanges() {
    return this._modelData ? this._modelData.viewModel.getVisibleRanges() : [];
  }
  getVisibleRangesPlusViewportAboveBelow() {
    return this._modelData ? this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow() : [];
  }
  getWhitespaces() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getWhitespaces() : [];
  }
  static _getVerticalOffsetAfterPosition(e, t, n, r) {
    const s = e.model.validatePosition({
      lineNumber: t,
      column: n
    }), o = e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);
    return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber, r);
  }
  getTopForLineNumber(e, t = !1) {
    return this._modelData ? xE._getVerticalOffsetForPosition(this._modelData, e, 1, t) : -1;
  }
  getTopForPosition(e, t) {
    return this._modelData ? xE._getVerticalOffsetForPosition(this._modelData, e, t, !1) : -1;
  }
  static _getVerticalOffsetForPosition(e, t, n, r = !1) {
    const s = e.model.validatePosition({
      lineNumber: t,
      column: n
    }), o = e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);
    return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber, r);
  }
  getBottomForLineNumber(e, t = !1) {
    if (!this._modelData)
      return -1;
    const n = this._modelData.model.getLineMaxColumn(e);
    return xE._getVerticalOffsetAfterPosition(this._modelData, e, n, t);
  }
  getLineHeightForPosition(e) {
    if (!this._modelData)
      return -1;
    const t = this._modelData.viewModel, n = t.coordinatesConverter, r = de.lift(e);
    if (n.modelPositionIsVisible(r)) {
      const s = n.convertModelPositionToViewPosition(r);
      return t.viewLayout.getLineHeightForLineNumber(s.lineNumber);
    }
    return 0;
  }
  setHiddenAreas(e, t, n) {
    var r;
    (r = this._modelData) == null || r.viewModel.setHiddenAreas(e.map((s) => z.lift(s)), t, n);
  }
  getVisibleColumnFromPosition(e) {
    if (!this._modelData)
      return e.column;
    const t = this._modelData.model.validatePosition(e), n = this._modelData.model.getOptions().tabSize;
    return As.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber), t.column, n) + 1;
  }
  getPosition() {
    return this._modelData ? this._modelData.viewModel.getPosition() : null;
  }
  setPosition(e, t = "api") {
    if (this._modelData) {
      if (!de.isIPosition(e))
        throw new Error("Invalid arguments");
      this._modelData.viewModel.setSelections(t, [{
        selectionStartLineNumber: e.lineNumber,
        selectionStartColumn: e.column,
        positionLineNumber: e.lineNumber,
        positionColumn: e.column
      }]);
    }
  }
  _sendRevealRange(e, t, n, r) {
    if (!this._modelData)
      return;
    if (!z.isIRange(e))
      throw new Error("Invalid arguments");
    const s = this._modelData.model.validateRange(e), o = this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);
    this._modelData.viewModel.revealRange("api", n, o, t, r);
  }
  revealLine(e, t = 0) {
    this._revealLine(e, 0, t);
  }
  revealLineInCenter(e, t = 0) {
    this._revealLine(e, 1, t);
  }
  revealLineInCenterIfOutsideViewport(e, t = 0) {
    this._revealLine(e, 2, t);
  }
  revealLineNearTop(e, t = 0) {
    this._revealLine(e, 5, t);
  }
  _revealLine(e, t, n) {
    if (typeof e != "number")
      throw new Error("Invalid arguments");
    this._sendRevealRange(new z(e, 1, e, 1), t, !1, n);
  }
  revealPosition(e, t = 0) {
    this._revealPosition(e, 0, !0, t);
  }
  revealPositionInCenter(e, t = 0) {
    this._revealPosition(e, 1, !0, t);
  }
  revealPositionInCenterIfOutsideViewport(e, t = 0) {
    this._revealPosition(e, 2, !0, t);
  }
  revealPositionNearTop(e, t = 0) {
    this._revealPosition(e, 5, !0, t);
  }
  _revealPosition(e, t, n, r) {
    if (!de.isIPosition(e))
      throw new Error("Invalid arguments");
    this._sendRevealRange(new z(e.lineNumber, e.column, e.lineNumber, e.column), t, n, r);
  }
  getSelection() {
    return this._modelData ? this._modelData.viewModel.getSelection() : null;
  }
  getSelections() {
    return this._modelData ? this._modelData.viewModel.getSelections() : null;
  }
  setSelection(e, t = "api") {
    const n = bt.isISelection(e), r = z.isIRange(e);
    if (!n && !r)
      throw new Error("Invalid arguments");
    if (n)
      this._setSelectionImpl(e, t);
    else if (r) {
      const s = {
        selectionStartLineNumber: e.startLineNumber,
        selectionStartColumn: e.startColumn,
        positionLineNumber: e.endLineNumber,
        positionColumn: e.endColumn
      };
      this._setSelectionImpl(s, t);
    }
  }
  _setSelectionImpl(e, t) {
    if (!this._modelData)
      return;
    const n = new bt(e.selectionStartLineNumber, e.selectionStartColumn, e.positionLineNumber, e.positionColumn);
    this._modelData.viewModel.setSelections(t, [n]);
  }
  revealLines(e, t, n = 0) {
    this._revealLines(e, t, 0, n);
  }
  revealLinesInCenter(e, t, n = 0) {
    this._revealLines(e, t, 1, n);
  }
  revealLinesInCenterIfOutsideViewport(e, t, n = 0) {
    this._revealLines(e, t, 2, n);
  }
  revealLinesNearTop(e, t, n = 0) {
    this._revealLines(e, t, 5, n);
  }
  _revealLines(e, t, n, r) {
    if (typeof e != "number" || typeof t != "number")
      throw new Error("Invalid arguments");
    this._sendRevealRange(new z(e, 1, t, 1), n, !1, r);
  }
  revealRange(e, t = 0, n = !1, r = !0) {
    this._revealRange(e, n ? 1 : 0, r, t);
  }
  revealRangeInCenter(e, t = 0) {
    this._revealRange(e, 1, !0, t);
  }
  revealRangeInCenterIfOutsideViewport(e, t = 0) {
    this._revealRange(e, 2, !0, t);
  }
  revealRangeNearTop(e, t = 0) {
    this._revealRange(e, 5, !0, t);
  }
  revealRangeNearTopIfOutsideViewport(e, t = 0) {
    this._revealRange(e, 6, !0, t);
  }
  revealRangeAtTop(e, t = 0) {
    this._revealRange(e, 3, !0, t);
  }
  _revealRange(e, t, n, r) {
    if (!z.isIRange(e))
      throw new Error("Invalid arguments");
    this._sendRevealRange(z.lift(e), t, n, r);
  }
  setSelections(e, t = "api", n = 0) {
    if (this._modelData) {
      if (!e || e.length === 0)
        throw new Error("Invalid arguments");
      for (let r = 0, s = e.length; r < s; r++)
        if (!bt.isISelection(e[r]))
          throw new Error("Invalid arguments");
      this._modelData.viewModel.setSelections(t, e, n);
    }
  }
  getContentWidth() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getContentWidth() : -1;
  }
  getScrollWidth() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getScrollWidth() : -1;
  }
  getScrollLeft() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getCurrentScrollLeft() : -1;
  }
  getContentHeight() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getContentHeight() : -1;
  }
  getScrollHeight() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getScrollHeight() : -1;
  }
  getScrollTop() {
    return this._modelData ? this._modelData.viewModel.viewLayout.getCurrentScrollTop() : -1;
  }
  setScrollLeft(e, t = 1) {
    if (this._modelData) {
      if (typeof e != "number")
        throw new Error("Invalid arguments");
      this._modelData.viewModel.viewLayout.setScrollPosition({
        scrollLeft: e
      }, t);
    }
  }
  setScrollTop(e, t = 1) {
    if (this._modelData) {
      if (typeof e != "number")
        throw new Error("Invalid arguments");
      this._modelData.viewModel.viewLayout.setScrollPosition({
        scrollTop: e
      }, t);
    }
  }
  setScrollPosition(e, t = 1) {
    this._modelData && this._modelData.viewModel.viewLayout.setScrollPosition(e, t);
  }
  hasPendingScrollAnimation() {
    return this._modelData ? this._modelData.viewModel.viewLayout.hasPendingScrollAnimation() : !1;
  }
  saveViewState() {
    if (!this._modelData)
      return null;
    const e = this._contributions.saveViewState(), t = this._modelData.viewModel.saveCursorState(), n = this._modelData.viewModel.saveState();
    return {
      cursorState: t,
      viewState: n,
      contributionsState: e
    };
  }
  restoreViewState(e) {
    if (!this._modelData || !this._modelData.hasRealView)
      return;
    const t = e;
    if (t && t.cursorState && t.viewState) {
      const n = t.cursorState;
      Array.isArray(n) ? n.length > 0 && this._modelData.viewModel.restoreCursorState(n) : this._modelData.viewModel.restoreCursorState([n]), this._contributions.restoreViewState(t.contributionsState || {});
      const r = this._modelData.viewModel.reduceRestoreState(t.viewState);
      this._modelData.view.restoreState(r);
    }
  }
  handleInitialized() {
    var e;
    (e = this._getViewModel()) == null || e.visibleLinesStabilized();
  }
  getContribution(e) {
    return this._contributions.get(e);
  }
  getActions() {
    return Array.from(this._actions.values());
  }
  getSupportedActions() {
    let e = this.getActions();
    return e = e.filter((t) => t.isSupported()), e;
  }
  getAction(e) {
    return this._actions.get(e) || null;
  }
  trigger(e, t, n) {
    n = n || {};
    try {
      switch (this._onWillTriggerEditorOperationEvent.fire({ source: e, handlerId: t, payload: n }), this._beginUpdate(), t) {
        case "compositionStart":
          this._startComposition();
          return;
        case "compositionEnd":
          this._endComposition(e);
          return;
        case "type": {
          const s = n;
          this._type(e, s.text || "");
          return;
        }
        case "replacePreviousChar": {
          const s = n;
          this._compositionType(e, s.text || "", s.replaceCharCnt || 0, 0, 0);
          return;
        }
        case "compositionType": {
          const s = n;
          this._compositionType(e, s.text || "", s.replacePrevCharCnt || 0, s.replaceNextCharCnt || 0, s.positionDelta || 0);
          return;
        }
        case "paste": {
          const s = n;
          this._paste(e, s.text || "", s.pasteOnNewLine || !1, s.multicursorText || null, s.mode || null, s.clipboardEvent);
          return;
        }
        case "cut":
          this._cut(e);
          return;
      }
      const r = this.getAction(t);
      if (r) {
        Promise.resolve(r.run(n)).then(void 0, fn);
        return;
      }
      if (!this._modelData || this._triggerEditorCommand(e, t, n))
        return;
      this._triggerCommand(t, n);
    } finally {
      this._endUpdate();
    }
  }
  _triggerCommand(e, t) {
    this._commandService.executeCommand(e, t);
  }
  _startComposition() {
    this._modelData && (this.inComposition = !0, this._modelData.viewModel.startComposition(), this._onDidCompositionStart.fire());
  }
  _endComposition(e) {
    this._modelData && (this.inComposition = !1, this._modelData.viewModel.endComposition(e), this._onDidCompositionEnd.fire());
  }
  _type(e, t) {
    !this._modelData || t.length === 0 || (e === "keyboard" && this._onWillType.fire(t), this._modelData.viewModel.type(t, e), e === "keyboard" && this._onDidType.fire(t));
  }
  _compositionType(e, t, n, r, s) {
    this._modelData && this._modelData.viewModel.compositionType(t, n, r, s, e);
  }
  _paste(e, t, n, r, s, o) {
    if (!this._modelData)
      return;
    const a = this._modelData.viewModel, l = a.getSelection().getStartPosition();
    a.paste(t, n, r, e);
    const c = a.getSelection().getStartPosition();
    e === "keyboard" && this._onDidPaste.fire({
      clipboardEvent: o,
      range: new z(l.lineNumber, l.column, c.lineNumber, c.column),
      languageId: s
    });
  }
  _cut(e) {
    this._modelData && this._modelData.viewModel.cut(e);
  }
  _triggerEditorCommand(e, t, n) {
    const r = jN.getEditorCommand(t);
    return r ? (n = n || {}, n.source = e, this._instantiationService.invokeFunction((s) => {
      Promise.resolve(r.runEditorCommand(s, this, n)).then(void 0, fn);
    }), !0) : !1;
  }
  _getViewModel() {
    return this._modelData ? this._modelData.viewModel : null;
  }
  pushUndoStop() {
    return !this._modelData || this._configuration.options.get(
      104
      /* EditorOption.readOnly */
    ) ? !1 : (this._modelData.model.pushStackElement(), !0);
  }
  popUndoStop() {
    return !this._modelData || this._configuration.options.get(
      104
      /* EditorOption.readOnly */
    ) ? !1 : (this._modelData.model.popStackElement(), !0);
  }
  edit(e, t) {
    return this.executeEdits(t, e.replacements.map((n) => ({ range: n.range, text: n.text })), void 0);
  }
  executeEdits(e, t, n) {
    if (!this._modelData || this._configuration.options.get(
      104
      /* EditorOption.readOnly */
    ))
      return !1;
    let r;
    n ? Array.isArray(n) ? r = () => n : r = n : r = () => null;
    let s, o;
    return e instanceof Y3e ? (o = e, s = e.metadata.source) : (o = $l.unknown({ name: s }), s = e), this._onBeforeExecuteEdit.fire({ source: s ?? void 0 }), this._modelData.viewModel.executeEdits(s, t, r, o), !0;
  }
  executeCommand(e, t) {
    this._modelData && this._modelData.viewModel.executeCommand(t, e);
  }
  executeCommands(e, t) {
    this._modelData && this._modelData.viewModel.executeCommands(t, e);
  }
  createDecorationsCollection(e) {
    return new omt(this, e);
  }
  changeDecorations(e) {
    return this._modelData ? this._modelData.model.changeDecorations(e, this._id) : null;
  }
  getLineDecorations(e) {
    if (!this._modelData)
      return null;
    const t = this._configuration.options;
    return this._modelData.model.getLineDecorations(e, this._id, XV(t), ZV(t));
  }
  getDecorationsInRange(e) {
    if (!this._modelData)
      return null;
    const t = this._configuration.options;
    return this._modelData.model.getDecorationsInRange(e, this._id, XV(t), ZV(t));
  }
  getFontSizeAtPosition(e) {
    return this._modelData ? this._modelData.viewModel.getFontSizeAtPosition(e) : null;
  }
  /**
   * @deprecated
   */
  deltaDecorations(e, t) {
    return this._modelData ? e.length === 0 && t.length === 0 ? e : this._modelData.model.deltaDecorations(e, t, this._id) : [];
  }
  removeDecorations(e) {
    !this._modelData || e.length === 0 || this._modelData.model.changeDecorations((t) => {
      t.deltaDecorations(e, []);
    });
  }
  removeDecorationsByType(e) {
    const t = this._decorationTypeKeysToIds[e];
    t && this.changeDecorations((n) => n.deltaDecorations(t, [])), this._decorationTypeKeysToIds.hasOwnProperty(e) && delete this._decorationTypeKeysToIds[e], this._decorationTypeSubtypes.hasOwnProperty(e) && delete this._decorationTypeSubtypes[e];
  }
  getLayoutInfo() {
    return this._configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    );
  }
  createOverviewRuler(e) {
    return !this._modelData || !this._modelData.hasRealView ? null : this._modelData.view.createOverviewRuler(e);
  }
  getContainerDomNode() {
    return this._domElement;
  }
  getDomNode() {
    return !this._modelData || !this._modelData.hasRealView ? null : this._modelData.view.domNode.domNode;
  }
  delegateVerticalScrollbarPointerDown(e) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.delegateVerticalScrollbarPointerDown(e);
  }
  delegateScrollFromMouseWheelEvent(e) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.delegateScrollFromMouseWheelEvent(e);
  }
  layout(e, t = !1) {
    this._configuration.observeContainer(e), t || this.render();
  }
  focus() {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.focus();
  }
  hasTextFocus() {
    return !this._modelData || !this._modelData.hasRealView ? !1 : this._modelData.view.isFocused();
  }
  hasWidgetFocus() {
    return !this._modelData || !this._modelData.hasRealView ? !1 : this._modelData.view.isWidgetFocused();
  }
  addContentWidget(e) {
    const t = {
      widget: e,
      position: e.getPosition()
    };
    this._contentWidgets.hasOwnProperty(e.getId()) && console.warn("Overwriting a content widget with the same id:" + e.getId()), this._contentWidgets[e.getId()] = t, this._modelData && this._modelData.hasRealView && this._modelData.view.addContentWidget(t);
  }
  layoutContentWidget(e) {
    const t = e.getId();
    if (this._contentWidgets.hasOwnProperty(t)) {
      const n = this._contentWidgets[t];
      n.position = e.getPosition(), this._modelData && this._modelData.hasRealView && this._modelData.view.layoutContentWidget(n);
    }
  }
  removeContentWidget(e) {
    const t = e.getId();
    if (this._contentWidgets.hasOwnProperty(t)) {
      const n = this._contentWidgets[t];
      delete this._contentWidgets[t], this._modelData && this._modelData.hasRealView && this._modelData.view.removeContentWidget(n);
    }
  }
  addOverlayWidget(e) {
    const t = {
      widget: e,
      position: e.getPosition()
    };
    this._overlayWidgets.hasOwnProperty(e.getId()) && console.warn("Overwriting an overlay widget with the same id."), this._overlayWidgets[e.getId()] = t, this._modelData && this._modelData.hasRealView && this._modelData.view.addOverlayWidget(t);
  }
  layoutOverlayWidget(e) {
    const t = e.getId();
    if (this._overlayWidgets.hasOwnProperty(t)) {
      const n = this._overlayWidgets[t];
      n.position = e.getPosition(), this._modelData && this._modelData.hasRealView && this._modelData.view.layoutOverlayWidget(n);
    }
  }
  removeOverlayWidget(e) {
    const t = e.getId();
    if (this._overlayWidgets.hasOwnProperty(t)) {
      const n = this._overlayWidgets[t];
      delete this._overlayWidgets[t], this._modelData && this._modelData.hasRealView && this._modelData.view.removeOverlayWidget(n);
    }
  }
  addGlyphMarginWidget(e) {
    const t = {
      widget: e,
      position: e.getPosition()
    };
    this._glyphMarginWidgets.hasOwnProperty(e.getId()) && console.warn("Overwriting a glyph margin widget with the same id."), this._glyphMarginWidgets[e.getId()] = t, this._modelData && this._modelData.hasRealView && this._modelData.view.addGlyphMarginWidget(t);
  }
  layoutGlyphMarginWidget(e) {
    const t = e.getId();
    if (this._glyphMarginWidgets.hasOwnProperty(t)) {
      const n = this._glyphMarginWidgets[t];
      n.position = e.getPosition(), this._modelData && this._modelData.hasRealView && this._modelData.view.layoutGlyphMarginWidget(n);
    }
  }
  removeGlyphMarginWidget(e) {
    const t = e.getId();
    if (this._glyphMarginWidgets.hasOwnProperty(t)) {
      const n = this._glyphMarginWidgets[t];
      delete this._glyphMarginWidgets[t], this._modelData && this._modelData.hasRealView && this._modelData.view.removeGlyphMarginWidget(n);
    }
  }
  changeViewZones(e) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.change(e);
  }
  getTargetAtClientPoint(e, t) {
    return !this._modelData || !this._modelData.hasRealView ? null : this._modelData.view.getTargetAtClientPoint(e, t);
  }
  getScrolledVisiblePosition(e) {
    if (!this._modelData || !this._modelData.hasRealView)
      return null;
    const t = this._modelData.model.validatePosition(e), r = this._configuration.options.get(
      165
      /* EditorOption.layoutInfo */
    ), s = xE._getVerticalOffsetForPosition(this._modelData, t.lineNumber, t.column) - this.getScrollTop(), o = this._modelData.view.getOffsetForColumn(t.lineNumber, t.column) + r.glyphMarginWidth + r.lineNumbersWidth + r.decorationsWidth - this.getScrollLeft(), a = this.getLineHeightForPosition(t);
    return {
      top: s,
      left: o,
      height: a
    };
  }
  getOffsetForColumn(e, t) {
    return !this._modelData || !this._modelData.hasRealView ? -1 : this._modelData.view.getOffsetForColumn(e, t);
  }
  render(e = !1) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.viewModel.batchEvents(() => {
      this._modelData.view.render(!0, e);
    });
  }
  setAriaOptions(e) {
    !this._modelData || !this._modelData.hasRealView || this._modelData.view.setAriaOptions(e);
  }
  applyFontInfo(e) {
    Ma(e, this._configuration.options.get(
      59
      /* EditorOption.fontInfo */
    ));
  }
  setBanner(e, t) {
    this._bannerDomNode && this._domElement.contains(this._bannerDomNode) && this._bannerDomNode.remove(), this._bannerDomNode = e, this._configuration.setReservedHeight(e ? t : 0), this._bannerDomNode && this._domElement.prepend(this._bannerDomNode);
  }
  _attachModel(e) {
    if (!e) {
      this._modelData = null;
      return;
    }
    const t = [];
    this._domElement.setAttribute("data-mode-id", e.getLanguageId()), this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()), this._configuration.setModelLineCount(e.getLineCount());
    const n = e.onBeforeAttached(), r = new Zpt(this._id, this._configuration, e, $fe.create(At(this._domElement)), rge.create(this._configuration.options), (a) => Ju(At(this._domElement), a), this.languageConfigurationService, this._themeService, n, {
      batchChanges: (a) => {
        try {
          return this._beginUpdate(), a();
        } finally {
          this._endUpdate();
        }
      }
    });
    t.push(e.onWillDispose(() => this.setModel(null))), t.push(r.onEvent((a) => {
      switch (a.kind) {
        case 0:
          this._onDidContentSizeChange.fire(a);
          break;
        case 1:
          this._editorTextFocus.setValue(a.hasFocus);
          break;
        case 2:
          this._editorWidgetFocus.setValue(a.hasFocus);
          break;
        case 3:
          this._onDidScrollChange.fire(a);
          break;
        case 4:
          this._onDidChangeViewZones.fire();
          break;
        case 5:
          this._onDidChangeHiddenAreas.fire();
          break;
        case 6:
          this._onDidAttemptReadOnlyEdit.fire();
          break;
        case 7: {
          if (a.reachedMaxCursorCount) {
            const d = this.getOption(
              89
              /* EditorOption.multiCursorLimit */
            ), h = S(80, "The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.", d);
            this._notificationService.prompt(i2.Warning, h, [
              {
                label: "Find and Replace",
                run: () => {
                  this._commandService.executeCommand("editor.action.startFindReplaceAction");
                }
              },
              {
                label: S(81, "Increase Multi Cursor Limit"),
                run: () => {
                  this._commandService.executeCommand("workbench.action.openSettings2", {
                    query: "editor.multiCursorLimit"
                  });
                }
              }
            ]);
          }
          const l = [];
          for (let d = 0, h = a.selections.length; d < h; d++)
            l[d] = a.selections[d].getPosition();
          const c = {
            position: l[0],
            secondaryPositions: l.slice(1),
            reason: a.reason,
            source: a.source
          };
          this._onDidChangeCursorPosition.fire(c);
          const u = {
            selection: a.selections[0],
            secondarySelections: a.selections.slice(1),
            modelVersionId: a.modelVersionId,
            oldSelections: a.oldSelections,
            oldModelVersionId: a.oldModelVersionId,
            source: a.source,
            reason: a.reason
          };
          this._onDidChangeCursorSelection.fire(u);
          break;
        }
        case 8:
          this._onDidChangeModelDecorations.fire(a.event);
          break;
        case 9:
          this._domElement.setAttribute("data-mode-id", e.getLanguageId()), this._onDidChangeModelLanguage.fire(a.event);
          break;
        case 10:
          this._onDidChangeModelLanguageConfiguration.fire(a.event);
          break;
        case 11:
          this._onDidChangeModelContent.fire(a.event);
          break;
        case 12:
          this._onDidChangeModelOptions.fire(a.event);
          break;
        case 13:
          this._onDidChangeModelTokens.fire(a.event);
          break;
        case 14:
          this._onDidChangeLineHeight.fire(a.event);
          break;
        case 15:
          this._onDidChangeFont.fire(a.event);
          break;
      }
    }));
    const [s, o] = this._createView(r);
    if (o) {
      this._domElement.appendChild(s.domNode.domNode);
      let a = Object.keys(this._contentWidgets);
      for (let l = 0, c = a.length; l < c; l++) {
        const u = a[l];
        s.addContentWidget(this._contentWidgets[u]);
      }
      a = Object.keys(this._overlayWidgets);
      for (let l = 0, c = a.length; l < c; l++) {
        const u = a[l];
        s.addOverlayWidget(this._overlayWidgets[u]);
      }
      a = Object.keys(this._glyphMarginWidgets);
      for (let l = 0, c = a.length; l < c; l++) {
        const u = a[l];
        s.addGlyphMarginWidget(this._glyphMarginWidgets[u]);
      }
      s.render(!1, !0), s.domNode.domNode.setAttribute("data-uri", e.uri.toString());
    }
    this._modelData = new imt(e, r, s, o, t, n);
  }
  _createView(e) {
    let t;
    this.isSimpleWidget ? t = {
      paste: (s, o, a, l) => {
        this._paste("keyboard", s, o, a, l);
      },
      type: (s) => {
        this._type("keyboard", s);
      },
      compositionType: (s, o, a, l) => {
        this._compositionType("keyboard", s, o, a, l);
      },
      startComposition: () => {
        this._startComposition();
      },
      endComposition: () => {
        this._endComposition("keyboard");
      },
      cut: () => {
        this._cut("keyboard");
      }
    } : t = {
      paste: (s, o, a, l) => {
        const c = { text: s, pasteOnNewLine: o, multicursorText: a, mode: l };
        this._commandService.executeCommand("paste", c);
      },
      type: (s) => {
        const o = { text: s };
        this._commandService.executeCommand("type", o);
      },
      compositionType: (s, o, a, l) => {
        if (a || l) {
          const c = { text: s, replacePrevCharCnt: o, replaceNextCharCnt: a, positionDelta: l };
          this._commandService.executeCommand("compositionType", c);
        } else {
          const c = { text: s, replaceCharCnt: o };
          this._commandService.executeCommand("replacePreviousChar", c);
        }
      },
      startComposition: () => {
        this._commandService.executeCommand("compositionStart", {});
      },
      endComposition: () => {
        this._commandService.executeCommand("compositionEnd", {});
      },
      cut: () => {
        this._commandService.executeCommand("cut", {});
      }
    };
    const n = new tK(e.coordinatesConverter);
    return n.onKeyDown = (s) => this._onKeyDown.fire(s), n.onKeyUp = (s) => this._onKeyUp.fire(s), n.onContextMenu = (s) => this._onContextMenu.fire(s), n.onMouseMove = (s) => this._onMouseMove.fire(s), n.onMouseLeave = (s) => this._onMouseLeave.fire(s), n.onMouseDown = (s) => this._onMouseDown.fire(s), n.onMouseUp = (s) => this._onMouseUp.fire(s), n.onMouseDrag = (s) => this._onMouseDrag.fire(s), n.onMouseDrop = (s) => this._onMouseDrop.fire(s), n.onMouseDropCanceled = (s) => this._onMouseDropCanceled.fire(s), n.onMouseWheel = (s) => this._onMouseWheel.fire(s), [new yre(this._domElement, this.getId(), t, this._configuration, this._themeService.getColorTheme(), e, n, this._overflowWidgetsDomNode, this._instantiationService), !0];
  }
  _postDetachModelCleanup(e) {
    e == null || e.removeAllDecorationsWithOwnerId(this._id);
  }
  _detachModel() {
    var n;
    if ((n = this._contributionsDisposable) == null || n.dispose(), this._contributionsDisposable = void 0, !this._modelData)
      return null;
    const e = this._modelData.model, t = this._modelData.hasRealView ? this._modelData.view.domNode.domNode : null;
    return this._modelData.dispose(), this._modelData = null, this._domElement.removeAttribute("data-mode-id"), t && this._domElement.contains(t) && t.remove(), this._bannerDomNode && this._domElement.contains(this._bannerDomNode) && this._bannerDomNode.remove(), e;
  }
  _removeDecorationType(e) {
    this._codeEditorService.removeDecorationType(e);
  }
  hasModel() {
    return this._modelData !== null;
  }
  showDropIndicatorAt(e) {
    const t = [{
      range: new z(e.lineNumber, e.column, e.lineNumber, e.column),
      options: xE.dropIntoEditorDecorationOptions
    }];
    this._dropIntoEditorDecorations.set(t), this.revealPosition(
      e,
      1
      /* editorCommon.ScrollType.Immediate */
    );
  }
  removeDropIndicator() {
    this._dropIntoEditorDecorations.clear();
  }
  _beginUpdate() {
    this._updateCounter++, this._updateCounter === 1 && this._onBeginUpdate.fire();
  }
  _endUpdate() {
    this._updateCounter--, this._updateCounter === 0 && this._onEndUpdate.fire();
  }
}, xE = Jx, Jx.dropIntoEditorDecorationOptions = dn.register({
  description: "workbench-dnd-target",
  className: "dnd-target"
}), Jx);
uT = xE = tmt([
  Av(3, xt),
  Av(4, Ti),
  Av(5, jr),
  Av(6, Jt),
  Av(7, to),
  Av(8, no),
  Av(9, Qa),
  Av(10, Ls),
  Av(11, St)
], uT);
let nmt = 0, imt = class {
  constructor(e, t, n, r, s, o) {
    this.model = e, this.viewModel = t, this.view = n, this.hasRealView = r, this.listenersToRemove = s, this.attachedView = o;
  }
  dispose() {
    or(this.listenersToRemove), this.model.onBeforeDetached(this.attachedView), this.hasRealView && this.view.dispose(), this.viewModel.dispose();
  }
};
class KTe extends ge {
  constructor(e) {
    super(), this._emitterOptions = e, this._onDidChangeToTrue = this._register(new he(this._emitterOptions)), this.onDidChangeToTrue = this._onDidChangeToTrue.event, this._onDidChangeToFalse = this._register(new he(this._emitterOptions)), this.onDidChangeToFalse = this._onDidChangeToFalse.event, this._value = 0;
  }
  setValue(e) {
    const t = e ? 2 : 1;
    this._value !== t && (this._value = t, this._value === 2 ? this._onDidChangeToTrue.fire() : this._value === 1 && this._onDidChangeToFalse.fire());
  }
}
class hc extends he {
  constructor(e, t) {
    super({ deliveryQueue: t }), this._contributions = e;
  }
  fire(e) {
    this._contributions.onBeforeInteractionEvent(), super.fire(e);
  }
}
class rmt extends ge {
  constructor(e, t) {
    super(), this._editor = e, t.createKey("editorId", e.getId()), this._editorSimpleInput = se.editorSimpleInput.bindTo(t), this._editorFocus = se.focus.bindTo(t), this._textInputFocus = se.textInputFocus.bindTo(t), this._editorTextFocus = se.editorTextFocus.bindTo(t), this._tabMovesFocus = se.tabMovesFocus.bindTo(t), this._editorReadonly = se.readOnly.bindTo(t), this._inDiffEditor = se.inDiffEditor.bindTo(t), this._editorColumnSelection = se.columnSelection.bindTo(t), this._hasMultipleSelections = se.hasMultipleSelections.bindTo(t), this._hasNonEmptySelection = se.hasNonEmptySelection.bindTo(t), this._canUndo = se.canUndo.bindTo(t), this._canRedo = se.canRedo.bindTo(t), this._register(this._editor.onDidChangeConfiguration(() => this._updateFromConfig())), this._register(this._editor.onDidChangeCursorSelection(() => this._updateFromSelection())), this._register(this._editor.onDidFocusEditorWidget(() => this._updateFromFocus())), this._register(this._editor.onDidBlurEditorWidget(() => this._updateFromFocus())), this._register(this._editor.onDidFocusEditorText(() => this._updateFromFocus())), this._register(this._editor.onDidBlurEditorText(() => this._updateFromFocus())), this._register(this._editor.onDidChangeModel(() => this._updateFromModel())), this._register(this._editor.onDidChangeConfiguration(() => this._updateFromModel())), this._register(YR.onDidChangeTabFocus((n) => this._tabMovesFocus.set(n))), this._updateFromConfig(), this._updateFromSelection(), this._updateFromFocus(), this._updateFromModel(), this._editorSimpleInput.set(this._editor.isSimpleWidget);
  }
  _updateFromConfig() {
    const e = this._editor.getOptions();
    this._tabMovesFocus.set(e.get(
      164
      /* EditorOption.tabFocusMode */
    ) || YR.getTabFocusMode()), this._editorReadonly.set(e.get(
      104
      /* EditorOption.readOnly */
    )), this._inDiffEditor.set(e.get(
      70
      /* EditorOption.inDiffEditor */
    )), this._editorColumnSelection.set(e.get(
      28
      /* EditorOption.columnSelection */
    ));
  }
  _updateFromSelection() {
    const e = this._editor.getSelections();
    e ? (this._hasMultipleSelections.set(e.length > 1), this._hasNonEmptySelection.set(e.some((t) => !t.isEmpty()))) : (this._hasMultipleSelections.reset(), this._hasNonEmptySelection.reset());
  }
  _updateFromFocus() {
    this._editorFocus.set(this._editor.hasWidgetFocus() && !this._editor.isSimpleWidget), this._editorTextFocus.set(this._editor.hasTextFocus() && !this._editor.isSimpleWidget), this._textInputFocus.set(this._editor.hasTextFocus());
  }
  _updateFromModel() {
    const e = this._editor.getModel();
    this._canUndo.set(!!(e && e.canUndo())), this._canRedo.set(!!(e && e.canRedo()));
  }
}
class smt extends ge {
  constructor(e, t, n) {
    super(), this._editor = e, this._contextKeyService = t, this._languageFeaturesService = n, this._langId = se.languageId.bindTo(t), this._hasCompletionItemProvider = se.hasCompletionItemProvider.bindTo(t), this._hasCodeActionsProvider = se.hasCodeActionsProvider.bindTo(t), this._hasCodeLensProvider = se.hasCodeLensProvider.bindTo(t), this._hasDefinitionProvider = se.hasDefinitionProvider.bindTo(t), this._hasDeclarationProvider = se.hasDeclarationProvider.bindTo(t), this._hasImplementationProvider = se.hasImplementationProvider.bindTo(t), this._hasTypeDefinitionProvider = se.hasTypeDefinitionProvider.bindTo(t), this._hasHoverProvider = se.hasHoverProvider.bindTo(t), this._hasDocumentHighlightProvider = se.hasDocumentHighlightProvider.bindTo(t), this._hasDocumentSymbolProvider = se.hasDocumentSymbolProvider.bindTo(t), this._hasReferenceProvider = se.hasReferenceProvider.bindTo(t), this._hasRenameProvider = se.hasRenameProvider.bindTo(t), this._hasSignatureHelpProvider = se.hasSignatureHelpProvider.bindTo(t), this._hasInlayHintsProvider = se.hasInlayHintsProvider.bindTo(t), this._hasDocumentFormattingProvider = se.hasDocumentFormattingProvider.bindTo(t), this._hasDocumentSelectionFormattingProvider = se.hasDocumentSelectionFormattingProvider.bindTo(t), this._hasMultipleDocumentFormattingProvider = se.hasMultipleDocumentFormattingProvider.bindTo(t), this._hasMultipleDocumentSelectionFormattingProvider = se.hasMultipleDocumentSelectionFormattingProvider.bindTo(t), this._isInEmbeddedEditor = se.isInEmbeddedEditor.bindTo(t);
    const r = () => this._update();
    this._register(e.onDidChangeModel(r)), this._register(e.onDidChangeModelLanguage(r)), this._register(n.completionProvider.onDidChange(r)), this._register(n.codeActionProvider.onDidChange(r)), this._register(n.codeLensProvider.onDidChange(r)), this._register(n.definitionProvider.onDidChange(r)), this._register(n.declarationProvider.onDidChange(r)), this._register(n.implementationProvider.onDidChange(r)), this._register(n.typeDefinitionProvider.onDidChange(r)), this._register(n.hoverProvider.onDidChange(r)), this._register(n.documentHighlightProvider.onDidChange(r)), this._register(n.documentSymbolProvider.onDidChange(r)), this._register(n.referenceProvider.onDidChange(r)), this._register(n.renameProvider.onDidChange(r)), this._register(n.documentFormattingEditProvider.onDidChange(r)), this._register(n.documentRangeFormattingEditProvider.onDidChange(r)), this._register(n.signatureHelpProvider.onDidChange(r)), this._register(n.inlayHintsProvider.onDidChange(r)), r();
  }
  dispose() {
    super.dispose();
  }
  reset() {
    this._contextKeyService.bufferChangeEvents(() => {
      this._langId.reset(), this._hasCompletionItemProvider.reset(), this._hasCodeActionsProvider.reset(), this._hasCodeLensProvider.reset(), this._hasDefinitionProvider.reset(), this._hasDeclarationProvider.reset(), this._hasImplementationProvider.reset(), this._hasTypeDefinitionProvider.reset(), this._hasHoverProvider.reset(), this._hasDocumentHighlightProvider.reset(), this._hasDocumentSymbolProvider.reset(), this._hasReferenceProvider.reset(), this._hasRenameProvider.reset(), this._hasDocumentFormattingProvider.reset(), this._hasDocumentSelectionFormattingProvider.reset(), this._hasSignatureHelpProvider.reset(), this._isInEmbeddedEditor.reset();
    });
  }
  _update() {
    const e = this._editor.getModel();
    if (!e) {
      this.reset();
      return;
    }
    this._contextKeyService.bufferChangeEvents(() => {
      this._langId.set(e.getLanguageId()), this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)), this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)), this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)), this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)), this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)), this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)), this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)), this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)), this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)), this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)), this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)), this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)), this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)), this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)), this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e) || this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)), this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)), this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length + this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length > 1), this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length > 1), this._isInEmbeddedEditor.set(e.uri.scheme === Yt.walkThroughSnippet || e.uri.scheme === Yt.vscodeChatCodeBlock);
    });
  }
}
class omt {
  get length() {
    return this._decorationIds.length;
  }
  constructor(e, t) {
    this._editor = e, this._decorationIds = [], this._isChangingDecorations = !1, Array.isArray(t) && t.length > 0 && this.set(t);
  }
  onDidChange(e, t, n) {
    return this._editor.onDidChangeModelDecorations((r) => {
      this._isChangingDecorations || e.call(t, r);
    }, n);
  }
  getRange(e) {
    return !this._editor.hasModel() || e >= this._decorationIds.length ? null : this._editor.getModel().getDecorationRange(this._decorationIds[e]);
  }
  getRanges() {
    if (!this._editor.hasModel())
      return [];
    const e = this._editor.getModel(), t = [];
    for (const n of this._decorationIds) {
      const r = e.getDecorationRange(n);
      r && t.push(r);
    }
    return t;
  }
  has(e) {
    return this._decorationIds.includes(e.id);
  }
  clear() {
    this._decorationIds.length !== 0 && this.set([]);
  }
  set(e) {
    try {
      this._isChangingDecorations = !0, this._editor.changeDecorations((t) => {
        this._decorationIds = t.deltaDecorations(this._decorationIds, e);
      });
    } finally {
      this._isChangingDecorations = !1;
    }
    return this._decorationIds;
  }
  append(e) {
    let t = [];
    try {
      this._isChangingDecorations = !0, this._editor.changeDecorations((n) => {
        t = n.deltaDecorations([], e), this._decorationIds = this._decorationIds.concat(t);
      });
    } finally {
      this._isChangingDecorations = !1;
    }
    return t;
  }
}
const amt = encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"), lmt = encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");
function _I(i) {
  return amt + encodeURIComponent(i.toString()) + lmt;
}
const cmt = encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'), umt = encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');
function YTe(i) {
  return cmt + encodeURIComponent(i.toString()) + umt;
}
ng((i, e) => {
  const t = i.getColor(jq);
  t && (e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${_I(t)}") repeat-x bottom left; }`), e.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${_I(t)}"); }`));
  const n = i.getColor(Xy);
  n && (e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${_I(n)}") repeat-x bottom left; }`), e.addRule(`:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${_I(n)}"); }`));
  const r = i.getColor(gb);
  r && (e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${_I(r)}") repeat-x bottom left; }`), e.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${_I(r)}"); }`));
  const s = i.getColor(Mat);
  s && (e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${YTe(s)}") no-repeat bottom left; }`), e.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${YTe(s)}"); }`));
  const o = i.getColor(But);
  o && (e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${o.rgba.a}; }`), e.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${o.rgba.a}; }`));
});
function $v(i, e) {
  return i;
}
function cK(i) {
  return Br(i);
}
const h0 = Vn("accessibilitySignalService"), On = class On {
  static register(e) {
    return new On(e.fileName);
  }
  constructor(e) {
    this.fileName = e;
  }
};
On.error = On.register({ fileName: "error.mp3" }), On.warning = On.register({ fileName: "warning.mp3" }), On.success = On.register({ fileName: "success.mp3" }), On.foldedArea = On.register({ fileName: "foldedAreas.mp3" }), On.break = On.register({ fileName: "break.mp3" }), On.quickFixes = On.register({ fileName: "quickFixes.mp3" }), On.taskCompleted = On.register({ fileName: "taskCompleted.mp3" }), On.taskFailed = On.register({ fileName: "taskFailed.mp3" }), On.terminalBell = On.register({ fileName: "terminalBell.mp3" }), On.diffLineInserted = On.register({ fileName: "diffLineInserted.mp3" }), On.diffLineDeleted = On.register({ fileName: "diffLineDeleted.mp3" }), On.diffLineModified = On.register({ fileName: "diffLineModified.mp3" }), On.requestSent = On.register({ fileName: "requestSent.mp3" }), On.responseReceived1 = On.register({ fileName: "responseReceived1.mp3" }), On.responseReceived2 = On.register({ fileName: "responseReceived2.mp3" }), On.responseReceived3 = On.register({ fileName: "responseReceived3.mp3" }), On.responseReceived4 = On.register({ fileName: "responseReceived4.mp3" }), On.clear = On.register({ fileName: "clear.mp3" }), On.save = On.register({ fileName: "save.mp3" }), On.format = On.register({ fileName: "format.mp3" }), On.voiceRecordingStarted = On.register({ fileName: "voiceRecordingStarted.mp3" }), On.voiceRecordingStopped = On.register({ fileName: "voiceRecordingStopped.mp3" }), On.progress = On.register({ fileName: "progress.mp3" }), On.chatEditModifiedFile = On.register({ fileName: "chatEditModifiedFile.mp3" }), On.editsKept = On.register({ fileName: "editsKept.mp3" }), On.editsUndone = On.register({ fileName: "editsUndone.mp3" }), On.nextEditSuggestion = On.register({ fileName: "nextEditSuggestion.mp3" }), On.terminalCommandSucceeded = On.register({ fileName: "terminalCommandSucceeded.mp3" }), On.chatUserActionRequired = On.register({ fileName: "chatUserActionRequired.mp3" }), On.codeActionTriggered = On.register({ fileName: "codeActionTriggered.mp3" }), On.codeActionApplied = On.register({ fileName: "codeActionApplied.mp3" });
let vr = On;
class dmt {
  constructor(e) {
    this.randomOneOf = e;
  }
}
const pn = class pn {
  constructor(e, t, n, r, s, o, a = !1) {
    this.sound = e, this.name = t, this.legacySoundSettingsKey = n, this.settingsKey = r, this.legacyAnnouncementSettingsKey = s, this.announcementMessage = o, this.managesOwnEnablement = a;
  }
  static register(e) {
    const t = new dmt("randomOneOf" in e.sound ? e.sound.randomOneOf : [e.sound]), n = new pn(t, e.name, e.legacySoundSettingsKey, e.settingsKey, e.legacyAnnouncementSettingsKey, e.announcementMessage, e.managesOwnEnablement);
    return pn._signals.add(n), n;
  }
};
pn._signals = /* @__PURE__ */ new Set(), pn.errorAtPosition = pn.register({
  name: S(1561, "Error at Position"),
  sound: vr.error,
  announcementMessage: S(1562, "Error"),
  settingsKey: "accessibility.signals.positionHasError",
  delaySettingsKey: "accessibility.signalOptions.delays.errorAtPosition"
}), pn.warningAtPosition = pn.register({
  name: S(1563, "Warning at Position"),
  sound: vr.warning,
  announcementMessage: S(1564, "Warning"),
  settingsKey: "accessibility.signals.positionHasWarning",
  delaySettingsKey: "accessibility.signalOptions.delays.warningAtPosition"
}), pn.errorOnLine = pn.register({
  name: S(1565, "Error on Line"),
  sound: vr.error,
  legacySoundSettingsKey: "audioCues.lineHasError",
  legacyAnnouncementSettingsKey: "accessibility.alert.error",
  announcementMessage: S(1566, "Error on Line"),
  settingsKey: "accessibility.signals.lineHasError"
}), pn.warningOnLine = pn.register({
  name: S(1567, "Warning on Line"),
  sound: vr.warning,
  legacySoundSettingsKey: "audioCues.lineHasWarning",
  legacyAnnouncementSettingsKey: "accessibility.alert.warning",
  announcementMessage: S(1568, "Warning on Line"),
  settingsKey: "accessibility.signals.lineHasWarning"
}), pn.foldedArea = pn.register({
  name: S(1569, "Folded Area on Line"),
  sound: vr.foldedArea,
  legacySoundSettingsKey: "audioCues.lineHasFoldedArea",
  legacyAnnouncementSettingsKey: "accessibility.alert.foldedArea",
  announcementMessage: S(1570, "Folded"),
  settingsKey: "accessibility.signals.lineHasFoldedArea"
}), pn.break = pn.register({
  name: S(1571, "Breakpoint on Line"),
  sound: vr.break,
  legacySoundSettingsKey: "audioCues.lineHasBreakpoint",
  legacyAnnouncementSettingsKey: "accessibility.alert.breakpoint",
  announcementMessage: S(1572, "Breakpoint"),
  settingsKey: "accessibility.signals.lineHasBreakpoint"
}), pn.inlineSuggestion = pn.register({
  name: S(1573, "Inline Suggestion on Line"),
  sound: vr.quickFixes,
  legacySoundSettingsKey: "audioCues.lineHasInlineSuggestion",
  settingsKey: "accessibility.signals.lineHasInlineSuggestion"
}), pn.nextEditSuggestion = pn.register({
  name: S(1574, "Next Edit Suggestion on Line"),
  sound: vr.nextEditSuggestion,
  legacySoundSettingsKey: "audioCues.nextEditSuggestion",
  settingsKey: "accessibility.signals.nextEditSuggestion",
  announcementMessage: S(1575, "Next Edit Suggestion")
}), pn.terminalQuickFix = pn.register({
  name: S(1576, "Terminal Quick Fix"),
  sound: vr.quickFixes,
  legacySoundSettingsKey: "audioCues.terminalQuickFix",
  legacyAnnouncementSettingsKey: "accessibility.alert.terminalQuickFix",
  announcementMessage: S(1577, "Quick Fix"),
  settingsKey: "accessibility.signals.terminalQuickFix"
}), pn.onDebugBreak = pn.register({
  name: S(1578, "Debugger Stopped on Breakpoint"),
  sound: vr.break,
  legacySoundSettingsKey: "audioCues.onDebugBreak",
  legacyAnnouncementSettingsKey: "accessibility.alert.onDebugBreak",
  announcementMessage: S(1579, "Breakpoint"),
  settingsKey: "accessibility.signals.onDebugBreak"
}), pn.noInlayHints = pn.register({
  name: S(1580, "No Inlay Hints on Line"),
  sound: vr.error,
  legacySoundSettingsKey: "audioCues.noInlayHints",
  legacyAnnouncementSettingsKey: "accessibility.alert.noInlayHints",
  announcementMessage: S(1581, "No Inlay Hints"),
  settingsKey: "accessibility.signals.noInlayHints"
}), pn.taskCompleted = pn.register({
  name: S(1582, "Task Completed"),
  sound: vr.taskCompleted,
  legacySoundSettingsKey: "audioCues.taskCompleted",
  legacyAnnouncementSettingsKey: "accessibility.alert.taskCompleted",
  announcementMessage: S(1583, "Task Completed"),
  settingsKey: "accessibility.signals.taskCompleted"
}), pn.taskFailed = pn.register({
  name: S(1584, "Task Failed"),
  sound: vr.taskFailed,
  legacySoundSettingsKey: "audioCues.taskFailed",
  legacyAnnouncementSettingsKey: "accessibility.alert.taskFailed",
  announcementMessage: S(1585, "Task Failed"),
  settingsKey: "accessibility.signals.taskFailed"
}), pn.terminalCommandFailed = pn.register({
  name: S(1586, "Terminal Command Failed"),
  sound: vr.error,
  legacySoundSettingsKey: "audioCues.terminalCommandFailed",
  legacyAnnouncementSettingsKey: "accessibility.alert.terminalCommandFailed",
  announcementMessage: S(1587, "Command Failed"),
  settingsKey: "accessibility.signals.terminalCommandFailed"
}), pn.terminalCommandSucceeded = pn.register({
  name: S(1588, "Terminal Command Succeeded"),
  sound: vr.terminalCommandSucceeded,
  announcementMessage: S(1589, "Command Succeeded"),
  settingsKey: "accessibility.signals.terminalCommandSucceeded"
}), pn.terminalBell = pn.register({
  name: S(1590, "Terminal Bell"),
  sound: vr.terminalBell,
  legacySoundSettingsKey: "audioCues.terminalBell",
  legacyAnnouncementSettingsKey: "accessibility.alert.terminalBell",
  announcementMessage: S(1591, "Terminal Bell"),
  settingsKey: "accessibility.signals.terminalBell"
}), pn.notebookCellCompleted = pn.register({
  name: S(1592, "Notebook Cell Completed"),
  sound: vr.taskCompleted,
  legacySoundSettingsKey: "audioCues.notebookCellCompleted",
  legacyAnnouncementSettingsKey: "accessibility.alert.notebookCellCompleted",
  announcementMessage: S(1593, "Notebook Cell Completed"),
  settingsKey: "accessibility.signals.notebookCellCompleted"
}), pn.notebookCellFailed = pn.register({
  name: S(1594, "Notebook Cell Failed"),
  sound: vr.taskFailed,
  legacySoundSettingsKey: "audioCues.notebookCellFailed",
  legacyAnnouncementSettingsKey: "accessibility.alert.notebookCellFailed",
  announcementMessage: S(1595, "Notebook Cell Failed"),
  settingsKey: "accessibility.signals.notebookCellFailed"
}), pn.diffLineInserted = pn.register({
  name: S(1596, "Diff Line Inserted"),
  sound: vr.diffLineInserted,
  legacySoundSettingsKey: "audioCues.diffLineInserted",
  settingsKey: "accessibility.signals.diffLineInserted"
}), pn.diffLineDeleted = pn.register({
  name: S(1597, "Diff Line Deleted"),
  sound: vr.diffLineDeleted,
  legacySoundSettingsKey: "audioCues.diffLineDeleted",
  settingsKey: "accessibility.signals.diffLineDeleted"
}), pn.diffLineModified = pn.register({
  name: S(1598, "Diff Line Modified"),
  sound: vr.diffLineModified,
  legacySoundSettingsKey: "audioCues.diffLineModified",
  settingsKey: "accessibility.signals.diffLineModified"
}), pn.chatEditModifiedFile = pn.register({
  name: S(1599, "Chat Edit Modified File"),
  sound: vr.chatEditModifiedFile,
  announcementMessage: S(1600, "File Modified from Chat Edits"),
  settingsKey: "accessibility.signals.chatEditModifiedFile"
}), pn.chatRequestSent = pn.register({
  name: S(1601, "Chat Request Sent"),
  sound: vr.requestSent,
  legacySoundSettingsKey: "audioCues.chatRequestSent",
  legacyAnnouncementSettingsKey: "accessibility.alert.chatRequestSent",
  announcementMessage: S(1602, "Chat Request Sent"),
  settingsKey: "accessibility.signals.chatRequestSent"
}), pn.chatResponseReceived = pn.register({
  name: S(1603, "Chat Response Received"),
  legacySoundSettingsKey: "audioCues.chatResponseReceived",
  sound: {
    randomOneOf: [
      vr.responseReceived1,
      vr.responseReceived2,
      vr.responseReceived3,
      vr.responseReceived4
    ]
  },
  settingsKey: "accessibility.signals.chatResponseReceived"
}), pn.codeActionTriggered = pn.register({
  name: S(1604, "Code Action Request Triggered"),
  sound: vr.codeActionTriggered,
  legacySoundSettingsKey: "audioCues.codeActionRequestTriggered",
  legacyAnnouncementSettingsKey: "accessibility.alert.codeActionRequestTriggered",
  announcementMessage: S(1605, "Code Action Request Triggered"),
  settingsKey: "accessibility.signals.codeActionTriggered"
}), pn.codeActionApplied = pn.register({
  name: S(1606, "Code Action Applied"),
  legacySoundSettingsKey: "audioCues.codeActionApplied",
  sound: vr.codeActionApplied,
  settingsKey: "accessibility.signals.codeActionApplied"
}), pn.progress = pn.register({
  name: S(1607, "Progress"),
  sound: vr.progress,
  legacySoundSettingsKey: "audioCues.chatResponsePending",
  legacyAnnouncementSettingsKey: "accessibility.alert.progress",
  announcementMessage: S(1608, "Progress"),
  settingsKey: "accessibility.signals.progress"
}), pn.clear = pn.register({
  name: S(1609, "Clear"),
  sound: vr.clear,
  legacySoundSettingsKey: "audioCues.clear",
  legacyAnnouncementSettingsKey: "accessibility.alert.clear",
  announcementMessage: S(1610, "Clear"),
  settingsKey: "accessibility.signals.clear"
}), pn.save = pn.register({
  name: S(1611, "Save"),
  sound: vr.save,
  legacySoundSettingsKey: "audioCues.save",
  legacyAnnouncementSettingsKey: "accessibility.alert.save",
  announcementMessage: S(1612, "Save"),
  settingsKey: "accessibility.signals.save"
}), pn.format = pn.register({
  name: S(1613, "Format"),
  sound: vr.format,
  legacySoundSettingsKey: "audioCues.format",
  legacyAnnouncementSettingsKey: "accessibility.alert.format",
  announcementMessage: S(1614, "Format"),
  settingsKey: "accessibility.signals.format"
}), pn.voiceRecordingStarted = pn.register({
  name: S(1615, "Voice Recording Started"),
  sound: vr.voiceRecordingStarted,
  legacySoundSettingsKey: "audioCues.voiceRecordingStarted",
  settingsKey: "accessibility.signals.voiceRecordingStarted"
}), pn.voiceRecordingStopped = pn.register({
  name: S(1616, "Voice Recording Stopped"),
  sound: vr.voiceRecordingStopped,
  legacySoundSettingsKey: "audioCues.voiceRecordingStopped",
  settingsKey: "accessibility.signals.voiceRecordingStopped"
}), pn.editsKept = pn.register({
  name: S(1617, "Edits Kept"),
  sound: vr.editsKept,
  announcementMessage: S(1618, "Edits Kept"),
  settingsKey: "accessibility.signals.editsKept"
}), pn.editsUndone = pn.register({
  name: S(1619, "Undo Edits"),
  sound: vr.editsUndone,
  announcementMessage: S(1620, "Edits Undone"),
  settingsKey: "accessibility.signals.editsUndone"
}), pn.chatUserActionRequired = pn.register({
  name: S(1621, "Chat User Action Required"),
  sound: vr.chatUserActionRequired,
  announcementMessage: S(1622, "Chat User Action Required"),
  settingsKey: "accessibility.signals.chatUserActionRequired",
  managesOwnEnablement: !0
});
let tu = pn;
function XTe(i, e, t, n = ba.ofCaller()) {
  return CPe({ debugName: () => `Configuration Key "${i}"` }, (r) => t.onDidChangeConfiguration((s) => {
    s.affectsConfiguration(i) && r(s);
  }), () => t.getValue(i) ?? e, n);
}
function w_(i, e, t, n = ba.ofCaller()) {
  const r = i.bindTo(e), s = new ke();
  return pl({ debugName: () => `Set Context Key "${i.key}"` }, (o) => {
    const a = t(o);
    return r.set(a), a;
  }, n).recomputeInitiallyAndOnChange(s), s;
}
const m4e = Vn("progressService"), YCe = class YCe {
  constructor(e) {
    this.callback = e;
  }
  report(e) {
    this._value = e, this.callback(this._value);
  }
};
YCe.None = Object.freeze({ report() {
} });
let tm = YCe;
const e0 = Vn("editorProgressService");
class mm {
  static capture(e) {
    if (e.getScrollTop() === 0 || e.hasPendingScrollAnimation())
      return new mm(e.getScrollTop(), e.getContentHeight(), null, 0, null);
    let t = null, n = 0;
    const r = e.getVisibleRanges();
    if (r.length > 0) {
      t = r[0].getStartPosition();
      const s = e.getTopForPosition(t.lineNumber, t.column);
      n = e.getScrollTop() - s;
    }
    return new mm(e.getScrollTop(), e.getContentHeight(), t, n, e.getPosition());
  }
  constructor(e, t, n, r, s) {
    this._initialScrollTop = e, this._initialContentHeight = t, this._visiblePosition = n, this._visiblePositionScrollDelta = r, this._cursorPosition = s;
  }
  restore(e) {
    if (!(this._initialContentHeight === e.getContentHeight() && this._initialScrollTop === e.getScrollTop()) && this._visiblePosition) {
      const t = e.getTopForPosition(this._visiblePosition.lineNumber, this._visiblePosition.column);
      e.setScrollTop(t + this._visiblePositionScrollDelta);
    }
  }
  restoreRelativeVerticalPositionOfCursor(e) {
    if (this._initialContentHeight === e.getContentHeight() && this._initialScrollTop === e.getScrollTop())
      return;
    const t = e.getPosition();
    if (!this._cursorPosition || !t)
      return;
    const n = e.getTopForLineNumber(t.lineNumber) - e.getTopForLineNumber(this._cursorPosition.lineNumber);
    e.setScrollTop(
      e.getScrollTop() + n,
      1
      /* ScrollType.Immediate */
    );
  }
}
const dT = {
  /**
   * Application specific resource transfer type
   */
  RESOURCES: "ResourceURLs",
  /**
   * Typically transfer type for copy/paste transfers.
   */
  TEXT: co.text,
  /**
   * Internal type used to pass around text/uri-list data.
   *
   * This is needed to work around https://bugs.chromium.org/p/chromium/issues/detail?id=239745.
   */
  INTERNAL_URI_LIST: "application/vnd.code.uri-list"
}, hmt = () => ({
  get delay() {
    return -1;
  },
  dispose: () => {
  },
  showHover: () => {
  }
});
let uK = hmt;
const fmt = new _l(() => uK("mouse", !1)), gmt = new _l(() => uK("element", !1));
function pmt(i) {
  uK = i;
}
function rd(i) {
  return i === "element" ? gmt.value : fmt.value;
}
function oA() {
  return uK("element", !0);
}
function Py(i, e) {
  if (i !== void 0) {
    const t = i.match(/^\s*var\((.+)\)$/);
    if (t) {
      const n = t[1].split(",", 2);
      return n.length === 2 && (e = Py(n[1].trim(), e)), `var(${n[0]}, ${e})`;
    }
    return i;
  }
  return e;
}
function ZTe(i) {
  const e = i.replaceAll(/[^_\-a-z0-9]/gi, "");
  return e !== i && console.warn(`CSS ident value ${i} modified to ${e} to be safe for CSS`), e;
}
function xC(i) {
  return `'${i.replaceAll(/'/g, "\\000027")}'`;
}
function mb(i) {
  return i ? xd`url('${CSS.escape(uPe.uriToBrowserUri(i).toString(!0))}')` : "url('')";
}
function Q7(i, e = !1) {
  const t = CSS.escape(i);
  return !e && t !== i && console.warn(`CSS class name ${i} modified to ${t} to be safe for CSS`), t;
}
function xd(i, ...e) {
  return i.reduce((t, n, r) => {
    const s = e[r] || "";
    return t + n + s;
  }, "");
}
class wee {
  constructor() {
    this._parts = [];
  }
  push(...e) {
    this._parts.push(...e);
  }
  join(e = `
`) {
    return this._parts.join(e);
  }
}
function mmt(i) {
  const e = _mt(i);
  if (e && e.length > 0)
    return new Uint32Array(e);
}
let Lh = 0;
const QC = new Uint32Array(10);
function _mt(i) {
  if (Lh = 0, d_(
    i,
    See,
    4352
    /* HangulRangeStartCode.InitialConsonant */
  ), Lh > 0 || (d_(
    i,
    Eee,
    4449
    /* HangulRangeStartCode.Vowel */
  ), Lh > 0) || (d_(
    i,
    xee,
    4520
    /* HangulRangeStartCode.FinalConsonant */
  ), Lh > 0) || (d_(
    i,
    aE,
    12593
    /* HangulRangeStartCode.CompatibilityJamo */
  ), Lh))
    return QC.subarray(0, Lh);
  if (i >= 44032 && i <= 55203) {
    const e = i - 44032, t = e % 588, n = Math.floor(e / 588), r = Math.floor(t / 28), s = t % 28 - 1;
    if (n < See.length ? d_(n, See, 0) : 4352 + n - 12593 < aE.length && d_(
      4352 + n,
      aE,
      12593
      /* HangulRangeStartCode.CompatibilityJamo */
    ), r < Eee.length ? d_(r, Eee, 0) : 4449 + r - 12593 < aE.length && d_(
      4449 + r - 12593,
      aE,
      12593
      /* HangulRangeStartCode.CompatibilityJamo */
    ), s >= 0 && (s < xee.length ? d_(s, xee, 0) : 4520 + s - 12593 < aE.length && d_(
      4520 + s - 12593,
      aE,
      12593
      /* HangulRangeStartCode.CompatibilityJamo */
    )), Lh > 0)
      return QC.subarray(0, Lh);
  }
}
function d_(i, e, t) {
  i >= t && i < t + e.length && bmt(e[i - t]);
}
function bmt(i) {
  i !== 0 && (QC[Lh++] = i & 255, i >> 8 && (QC[Lh++] = i >> 8 & 255), i >> 16 && (QC[Lh++] = i >> 16 & 255));
}
const See = new Uint8Array([
  114,
  // ㄱ
  82,
  // ㄲ
  115,
  // ㄴ
  101,
  // ㄷ
  69,
  // ㄸ
  102,
  // ㄹ
  97,
  // ㅁ
  113,
  // ㅂ
  81,
  // ㅃ
  116,
  // ㅅ
  84,
  // ㅆ
  100,
  // ㅇ
  119,
  // ㅈ
  87,
  // ㅉ
  99,
  // ㅊ
  122,
  // ㅋ
  120,
  // ㅌ
  118,
  // ㅍ
  103
  // ㅎ
]), Eee = new Uint16Array([
  107,
  //  -> ㅏ
  111,
  //  -> ㅐ
  105,
  //  -> ㅑ
  79,
  //  -> ㅒ
  106,
  //  -> ㅓ
  112,
  //  -> ㅔ
  117,
  //  -> ㅕ
  80,
  //  -> ㅖ
  104,
  //  -> ㅗ
  27496,
  //  -> ㅘ
  28520,
  //  -> ㅙ
  27752,
  //  -> ㅚ
  121,
  //  -> ㅛ
  110,
  //  -> ㅜ
  27246,
  //  -> ㅝ
  28782,
  //  -> ㅞ
  27758,
  //  -> ㅟ
  98,
  //  -> ㅠ
  109,
  //  -> ㅡ
  27757,
  //  -> ㅢ
  108
  //  -> ㅣ
]), xee = new Uint16Array([
  114,
  // ㄱ
  82,
  // ㄲ
  29810,
  // ㄳ
  115,
  // ㄴ
  30579,
  // ㄵ
  26483,
  // ㄶ
  101,
  // ㄷ
  102,
  // ㄹ
  29286,
  // ㄺ
  24934,
  // ㄻ
  29030,
  // ㄼ
  29798,
  // ㄽ
  30822,
  // ㄾ
  30310,
  // ㄿ
  26470,
  // ㅀ
  97,
  // ㅁ
  113,
  // ㅂ
  29809,
  // ㅄ
  116,
  // ㅅ
  84,
  // ㅆ
  100,
  // ㅇ
  119,
  // ㅈ
  99,
  // ㅊ
  122,
  // ㅋ
  120,
  // ㅌ
  118,
  // ㅍ
  103
  // ㅎ
]), aE = new Uint16Array([
  114,
  // ㄱ
  82,
  // ㄲ
  29810,
  // ㄳ
  115,
  // ㄴ
  30579,
  // ㄵ
  26483,
  // ㄶ
  101,
  // ㄷ
  69,
  // ㄸ
  102,
  // ㄹ
  29286,
  // ㄺ
  24934,
  // ㄻ
  29030,
  // ㄼ
  29798,
  // ㄽ
  30822,
  // ㄾ
  30310,
  // ㄿ
  26470,
  // ㅀ
  97,
  // ㅁ
  113,
  // ㅂ
  81,
  // ㅃ
  29809,
  // ㅄ
  116,
  // ㅅ
  84,
  // ㅆ
  100,
  // ㅇ
  119,
  // ㅈ
  87,
  // ㅉ
  99,
  // ㅊ
  122,
  // ㅋ
  120,
  // ㅌ
  118,
  // ㅍ
  103,
  // ㅎ
  107,
  // ㅏ
  111,
  // ㅐ
  105,
  // ㅑ
  79,
  // ㅒ
  106,
  // ㅓ
  112,
  // ㅔ
  117,
  // ㅕ
  80,
  // ㅖ
  104,
  // ㅗ
  27496,
  // ㅘ
  28520,
  // ㅙ
  27752,
  // ㅚ
  121,
  // ㅛ
  110,
  // ㅜ
  27246,
  // ㅝ
  28782,
  // ㅞ
  27758,
  // ㅟ
  98,
  // ㅠ
  109,
  // ㅡ
  27757,
  // ㅢ
  108
  // ㅣ
  // HF: Hangul Filler (everything after this is archaic)
  // ㅥ
  // ㅦ
  // ㅧ
  // ㅨ
  // ㅩ
  // ㅪ
  // ㅫ
  // ㅬ
  // ㅮ
  // ㅯ
  // ㅰ
  // ㅱ
  // ㅲ
  // ㅳ
  // ㅴ
  // ㅵ
  // ㅶ
  // ㅷ
  // ㅸ
  // ㅹ
  // ㅺ
  // ㅻ
  // ㅼ
  // ㅽ
  // ㅾ
  // ㅿ
  // ㆀ
  // ㆁ
  // ㆂ
  // ㆃ
  // ㆄ
  // ㆅ
  // ㆆ
  // ㆇ
  // ㆈ
  // ㆉ
  // ㆊ
  // ㆋ
  // ㆌ
  // ㆍ
  // ㆎ
]);
function lge(...i) {
  return function(e, t) {
    for (let n = 0, r = i.length; n < r; n++) {
      const s = i[n](e, t);
      if (s)
        return s;
    }
    return null;
  };
}
_4e.bind(void 0, !1);
const B4 = _4e.bind(void 0, !0);
function _4e(i, e, t) {
  if (!t || t.length < e.length)
    return null;
  let n;
  return i ? n = Phe(t, e) : n = t.indexOf(e) === 0, n ? e.length > 0 ? [{ start: 0, end: e.length }] : [] : null;
}
function b4e(i, e) {
  const t = e.toLowerCase().indexOf(i.toLowerCase());
  return t === -1 ? null : [{ start: t, end: t + i.length }];
}
function v4e(i, e) {
  return Vre(i.toLowerCase(), e.toLowerCase(), 0, 0);
}
function Vre(i, e, t, n) {
  if (t === i.length)
    return [];
  if (n === e.length)
    return null;
  if (i[t] === e[n]) {
    let r = null;
    return (r = Vre(i, e, t + 1, n + 1)) ? dge({ start: n, end: n + 1 }, r) : null;
  }
  return Vre(i, e, t, n + 1);
}
function cge(i) {
  return 97 <= i && i <= 122;
}
function dK(i) {
  return 65 <= i && i <= 90;
}
function uge(i) {
  return 48 <= i && i <= 57;
}
function y4e(i) {
  return i === 32 || i === 9 || i === 10 || i === 13;
}
const C4e = /* @__PURE__ */ new Set();
"()[]{}<>`'\"-/;:,.?!".split("").forEach((i) => C4e.add(i.charCodeAt(0)));
function LU(i) {
  return y4e(i) || C4e.has(i);
}
function QTe(i, e) {
  return i === e || LU(i) && LU(e);
}
const Lee = /* @__PURE__ */ new Map();
function JTe(i) {
  if (Lee.has(i))
    return Lee.get(i);
  let e;
  const t = mmt(i);
  return t && (e = t), Lee.set(i, e), e;
}
function w4e(i) {
  return cge(i) || dK(i) || uge(i);
}
function dge(i, e) {
  return e.length === 0 ? e = [i] : i.end === e[0].start ? e[0].start = i.start : e.unshift(i), e;
}
function S4e(i, e) {
  for (let t = e; t < i.length; t++) {
    const n = i.charCodeAt(t);
    if (dK(n) || uge(n) || t > 0 && !w4e(i.charCodeAt(t - 1)))
      return t;
  }
  return i.length;
}
function Ure(i, e, t, n) {
  if (t === i.length)
    return [];
  if (n === e.length)
    return null;
  if (i[t] !== e[n].toLowerCase())
    return null;
  {
    let r = null, s = n + 1;
    for (r = Ure(i, e, t + 1, n + 1); !r && (s = S4e(e, s)) < e.length; )
      r = Ure(i, e, t + 1, s), s++;
    return r === null ? null : dge({ start: n, end: n + 1 }, r);
  }
}
function vmt(i) {
  let e = 0, t = 0, n = 0, r = 0, s = 0;
  for (let u = 0; u < i.length; u++)
    s = i.charCodeAt(u), dK(s) && e++, cge(s) && t++, w4e(s) && n++, uge(s) && r++;
  const o = e / i.length, a = t / i.length, l = n / i.length, c = r / i.length;
  return { upperPercent: o, lowerPercent: a, alphaPercent: l, numericPercent: c };
}
function ymt(i) {
  const { upperPercent: e, lowerPercent: t } = i;
  return t === 0 && e > 0.6;
}
function Cmt(i) {
  const { upperPercent: e, lowerPercent: t, alphaPercent: n, numericPercent: r } = i;
  return t > 0.2 && e < 0.8 && n > 0.6 && r < 0.2;
}
function wmt(i) {
  let e = 0, t = 0, n = 0, r = 0;
  for (let s = 0; s < i.length; s++)
    n = i.charCodeAt(s), dK(n) && e++, cge(n) && t++, y4e(n) && r++;
  return (e === 0 || t === 0) && r === 0 ? i.length <= 30 : e <= 5;
}
function E4e(i, e) {
  if (!e || (e = e.trim(), e.length === 0) || !wmt(i))
    return null;
  e.length > 60 && (e = e.substring(0, 60));
  const t = vmt(e);
  if (!Cmt(t)) {
    if (!ymt(t))
      return null;
    e = e.toLowerCase();
  }
  let n = null, r = 0;
  for (i = i.toLowerCase(); r < e.length && (n = Ure(i, e, 0, r)) === null; )
    r = S4e(e, r + 1);
  return n;
}
function Smt(i, e, t = !1) {
  if (!e || e.length === 0)
    return null;
  let n = null, r = 0;
  for (i = i.toLowerCase(), e = e.toLowerCase(); r < e.length && (n = zre(i, e, 0, r, t), n === null); )
    r = x4e(e, r + 1);
  return n;
}
function zre(i, e, t, n, r) {
  let s = 0;
  if (t === i.length)
    return [];
  if (n === e.length)
    return null;
  if (!QTe(i.charCodeAt(t), e.charCodeAt(n))) {
    const l = JTe(i.charCodeAt(t));
    if (!l)
      return null;
    for (let c = 0; c < l.length; c++)
      if (!QTe(l[c], e.charCodeAt(n + c)))
        return null;
    s += l.length - 1;
  }
  let o = null, a = n + s + 1;
  if (o = zre(i, e, t + 1, a, r), !r)
    for (; !o && (a = x4e(e, a)) < e.length; )
      o = zre(i, e, t + 1, a, r), a++;
  if (!o)
    return null;
  if (i.charCodeAt(t) !== e.charCodeAt(n)) {
    const l = JTe(i.charCodeAt(t));
    if (!l)
      return o;
    for (let c = 0; c < l.length; c++)
      if (l[c] !== e.charCodeAt(n + c))
        return o;
  }
  return dge({ start: n, end: n + s + 1 }, o);
}
function x4e(i, e) {
  for (let t = e; t < i.length; t++)
    if (LU(i.charCodeAt(t)) || t > 0 && LU(i.charCodeAt(t - 1)))
      return t;
  return i.length;
}
const Emt = lge(B4, E4e, b4e), xmt = lge(B4, E4e, v4e), eke = new Tb(1e4);
function tke(i, e, t = !1) {
  if (typeof i != "string" || typeof e != "string")
    return null;
  let n = eke.get(i);
  n || (n = new RegExp(lnt(i), "i"), eke.set(i, n));
  const r = n.exec(e);
  return r ? [{ start: r.index, end: r.index + r[0].length }] : t ? xmt(i, e) : Emt(i, e);
}
function Lmt(i, e) {
  const t = hT(i, i.toLowerCase(), 0, e, e.toLowerCase(), 0, { firstMatchCanBeWeak: !0, boostFullMatch: !0 });
  return t ? IB(t) : null;
}
function Tmt(i, e, t, n, r, s) {
  const o = Math.min(13, i.length);
  for (; t < o; t++) {
    const a = hT(i, e, t, n, r, s, { firstMatchCanBeWeak: !0, boostFullMatch: !0 });
    if (a)
      return a;
  }
  return [0, s];
}
function IB(i) {
  if (typeof i > "u")
    return [];
  const e = [], t = i[1];
  for (let n = i.length - 1; n > 1; n--) {
    const r = i[n] + t, s = e[e.length - 1];
    s && s.end === r ? s.end = r + 1 : e.push({ start: r, end: r + 1 });
  }
  return e;
}
const f1 = 128;
function hge() {
  const i = [], e = [];
  for (let t = 0; t <= f1; t++)
    e[t] = 0;
  for (let t = 0; t <= f1; t++)
    i.push(e.slice(0));
  return i;
}
function L4e(i) {
  const e = [];
  for (let t = 0; t <= i; t++)
    e[t] = 0;
  return e;
}
const T4e = L4e(2 * f1), $re = L4e(2 * f1), Ov = hge(), lE = hge(), J7 = hge();
function eH(i, e) {
  if (e < 0 || e >= i.length)
    return !1;
  const t = i.codePointAt(e);
  switch (t) {
    case 95:
    case 45:
    case 46:
    case 32:
    case 47:
    case 92:
    case 39:
    case 34:
    case 58:
    case 36:
    case 60:
    case 62:
    case 40:
    case 41:
    case 91:
    case 93:
    case 123:
    case 125:
      return !0;
    case void 0:
      return !1;
    default:
      return !!Whe(t);
  }
}
function nke(i, e) {
  if (e < 0 || e >= i.length)
    return !1;
  switch (i.charCodeAt(e)) {
    case 32:
    case 9:
      return !0;
    default:
      return !1;
  }
}
function AW(i, e, t) {
  return e[i] !== t[i];
}
function kmt(i, e, t, n, r, s, o = !1) {
  for (; e < t && r < s; )
    i[e] === n[r] && (o && (T4e[e] = r), e += 1), r += 1;
  return e === t;
}
var $g;
(function(i) {
  i.Default = [-100, 0];
  function e(t) {
    return !t || t.length === 2 && t[0] === -100 && t[1] === 0;
  }
  i.isDefault = e;
})($g || ($g = {}));
const XCe = class XCe {
  constructor(e, t) {
    this.firstMatchCanBeWeak = e, this.boostFullMatch = t;
  }
};
XCe.default = { boostFullMatch: !0, firstMatchCanBeWeak: !1 };
let H4 = XCe;
function hT(i, e, t, n, r, s, o = H4.default) {
  const a = i.length > f1 ? f1 : i.length, l = n.length > f1 ? f1 : n.length;
  if (t >= a || s >= l || a - t > l - s || !kmt(e, t, a, r, s, l, !0))
    return;
  Dmt(a, l, t, s, e, r);
  let c = 1, u = 1, d = t, h = s;
  const g = [!1];
  for (c = 1, d = t; d < a; c++, d++) {
    const E = T4e[d], L = $re[d], T = d + 1 < a ? $re[d + 1] : l;
    for (u = E - s + 1, h = E; h < T; u++, h++) {
      let D = Number.MIN_SAFE_INTEGER, N = !1;
      h <= L && (D = Imt(i, e, d, t, n, r, h, l, s, Ov[c - 1][u - 1] === 0, g));
      let R = 0;
      D !== Number.MIN_SAFE_INTEGER && (N = !0, R = D + lE[c - 1][u - 1]);
      const M = h > E, B = M ? lE[c][u - 1] + (Ov[c][u - 1] > 0 ? -5 : 0) : 0, H = h > E + 1 && Ov[c][u - 1] > 0, j = H ? lE[c][u - 2] + (Ov[c][u - 2] > 0 ? -5 : 0) : 0;
      if (H && (!M || j >= B) && (!N || j >= R))
        lE[c][u] = j, J7[c][u] = 3, Ov[c][u] = 0;
      else if (M && (!N || B >= R))
        lE[c][u] = B, J7[c][u] = 2, Ov[c][u] = 0;
      else if (N)
        lE[c][u] = R, J7[c][u] = 1, Ov[c][u] = Ov[c - 1][u - 1] + 1;
      else
        throw new Error("not possible");
    }
  }
  if (!g[0] && !o.firstMatchCanBeWeak)
    return;
  c--, u--;
  const m = [lE[c][u], s];
  let _ = 0, v = 0;
  for (; c >= 1; ) {
    let E = u;
    do {
      const L = J7[c][E];
      if (L === 3)
        E = E - 2;
      else if (L === 2)
        E = E - 1;
      else
        break;
    } while (E >= 1);
    _ > 1 && e[t + c - 1] === r[s + u - 1] && !AW(E + s - 1, n, r) && _ + 1 > Ov[c][E] && (E = u), E === u ? _++ : _ = 1, v || (v = E), c--, u = E - 1, m.push(u);
  }
  l - s === a && o.boostFullMatch && (m[0] += 2);
  const w = v - a;
  return m[0] -= w, m;
}
function Dmt(i, e, t, n, r, s) {
  let o = i - 1, a = e - 1;
  for (; o >= t && a >= n; )
    r[o] === s[a] && ($re[o] = a, o--), a--;
}
function Imt(i, e, t, n, r, s, o, a, l, c, u) {
  if (e[t] !== s[o])
    return Number.MIN_SAFE_INTEGER;
  let d = 1, h = !1;
  return o === t - n ? d = i[t] === r[o] ? 7 : 5 : AW(o, r, s) && (o === 0 || !AW(o - 1, r, s)) ? (d = i[t] === r[o] ? 7 : 5, h = !0) : eH(s, o) && (o === 0 || !eH(s, o - 1)) ? d = 5 : (eH(s, o - 1) || nke(s, o - 1)) && (d = 5, h = !0), d > 1 && t === n && (u[0] = !0), h || (h = AW(o, r, s) || eH(s, o - 1) || nke(s, o - 1)), t === n ? o > l && (d -= h ? 3 : 5) : c ? d += h ? 2 : 0 : d += h ? 0 : 1, o + 1 === a && (d -= h ? 3 : 5), d;
}
function Nmt(i, e, t, n, r, s, o) {
  return Rmt(i, e, t, n, r, s, !0, o);
}
function Rmt(i, e, t, n, r, s, o, a) {
  let l = hT(i, e, t, n, r, s, a);
  if (i.length >= 3) {
    const c = Math.min(7, i.length - 1);
    for (let u = t + 1; u < c; u++) {
      const d = Amt(i, u);
      if (d) {
        const h = hT(d, d.toLowerCase(), t, n, r, s, a);
        h && (h[0] -= 3, (!l || h[0] > l[0]) && (l = h));
      }
    }
  }
  return l;
}
function Amt(i, e) {
  if (e + 1 >= i.length)
    return;
  const t = i[e], n = i[e + 1];
  if (t !== n)
    return i.slice(0, e) + n + t + i.slice(e + 2);
}
const Omt = "$(", fge = new RegExp(`\\$\\(${qt.iconNameExpression}(?:${qt.iconModifierExpression})?\\)`, "g"), Mmt = new RegExp(`(\\\\)?${fge.source}`, "g");
function Pmt(i) {
  return i.replace(Mmt, (e, t) => t ? e : `\\${e}`);
}
const Fmt = new RegExp(`\\\\${fge.source}`, "g");
function Bmt(i) {
  return i.replace(Fmt, (e) => `\\${e}`);
}
const Hmt = new RegExp(`(\\s)?(\\\\)?${fge.source}(\\s)?`, "g");
function gge(i) {
  return i.indexOf(Omt) === -1 ? i : i.replace(Hmt, (e, t, n, r) => n ? e : t || r || "");
}
function k4e(i) {
  return i ? i.replace(/\$\((.*?)\)/g, (e, t) => ` ${t} `).trim() : "";
}
const Tee = new RegExp(`\\$\\(${qt.iconNameCharacter}+\\)`, "g");
function mx(i) {
  Tee.lastIndex = 0;
  let e = "";
  const t = [];
  let n = 0;
  for (; ; ) {
    const r = Tee.lastIndex, s = Tee.exec(i), o = i.substring(r, s == null ? void 0 : s.index);
    if (o.length > 0) {
      e += o;
      for (let a = 0; a < o.length; a++)
        t.push(n);
    }
    if (!s)
      break;
    n += s[0].length;
  }
  return { text: e, iconOffsets: t };
}
function BF(i, e, t = !1) {
  const { text: n, iconOffsets: r } = e;
  if (!r || r.length === 0)
    return tke(i, n, t);
  const s = pB(n, " "), o = n.length - s.length, a = tke(i, s, t);
  if (a)
    for (const l of a) {
      const c = r[l.start + o] + o;
      l.start += c, l.end += c;
    }
  return a;
}
class ql {
  constructor(e = "", t = !1) {
    if (this.value = e, typeof this.value != "string")
      throw Bf("value");
    typeof t == "boolean" ? (this.isTrusted = t, this.supportThemeIcons = !1, this.supportHtml = !1) : (this.isTrusted = t.isTrusted ?? void 0, this.supportThemeIcons = t.supportThemeIcons ?? !1, this.supportHtml = t.supportHtml ?? !1);
  }
  appendText(e, t = 0) {
    return this.value += Vmt(this.supportThemeIcons ? Pmt(e) : e).replace(/([ \t]+)/g, (n, r) => "&nbsp;".repeat(r.length)).replace(/\>/gm, "\\>").replace(/\n/g, t === 1 ? `\\
` : `

`), this;
  }
  appendMarkdown(e) {
    return this.value += e, this;
  }
  appendCodeblock(e, t) {
    return this.value += `
${Umt(t, e)}
`, this;
  }
  appendLink(e, t, n) {
    return this.value += "[", this.value += this._escape(t, "]"), this.value += "](", this.value += this._escape(String(e), ")"), n && (this.value += ` "${this._escape(this._escape(n, '"'), ")")}"`), this.value += ")", this;
  }
  _escape(e, t) {
    const n = new RegExp(zd(t), "g");
    return e.replace(n, (r, s) => e.charAt(s - 1) !== "\\" ? `\\${r}` : r);
  }
}
function aA(i) {
  return ob(i) ? !i.value : Array.isArray(i) ? i.every(aA) : !0;
}
function ob(i) {
  return i instanceof ql ? !0 : i && typeof i == "object" ? typeof i.value == "string" && (typeof i.isTrusted == "boolean" || typeof i.isTrusted == "object" || i.isTrusted === void 0) && (typeof i.supportThemeIcons == "boolean" || i.supportThemeIcons === void 0) : !1;
}
function Wmt(i, e) {
  return i === e ? !0 : !i || !e ? !1 : i.value === e.value && i.isTrusted === e.isTrusted && i.supportThemeIcons === e.supportThemeIcons && i.supportHtml === e.supportHtml && (i.baseUri === e.baseUri || !!i.baseUri && !!e.baseUri && rw(Ht.from(i.baseUri), Ht.from(e.baseUri)));
}
function Vmt(i) {
  return i.replace(/[\\`*_{}[\]()#+\-!~]/g, "\\$&");
}
function Umt(i, e) {
  var r;
  const t = ((r = i.match(/^`+/gm)) == null ? void 0 : r.reduce((s, o) => s.length > o.length ? s : o).length) ?? 0, n = t >= 3 ? t + 1 : 3;
  return [
    `${"`".repeat(n)}${e}`,
    i,
    `${"`".repeat(n)}`
  ].join(`
`);
}
function tH(i) {
  return i.replace(/"/g, "&quot;");
}
function kee(i) {
  return i && i.replace(/\\([\\`*_{}[\]()#+\-.!~])/g, "$1");
}
function zmt(i) {
  const e = [], t = i.split("|").map((r) => r.trim());
  i = t[0];
  const n = t[1];
  if (n) {
    const r = /height=(\d+)/.exec(n), s = /width=(\d+)/.exec(n), o = r ? r[1] : "", a = s ? s[1] : "", l = isFinite(parseInt(a)), c = isFinite(parseInt(o));
    l && e.push(`width="${a}"`), c && e.push(`height="${o}"`);
  }
  return { href: i, dimensions: e };
}
function D4e(i, ...e) {
  return Ht.from({
    scheme: Yt.command,
    path: i,
    query: e.length ? encodeURIComponent(JSON.stringify(e)) : void 0
  });
}
class pge {
  constructor(e) {
    this._prefix = e, this._lastId = 0;
  }
  nextId() {
    return this._prefix + ++this._lastId;
  }
}
const jre = new pge("id#");
function mge() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null
  };
}
let ZT = mge();
function I4e(i) {
  ZT = i;
}
const N4e = /[&<>"']/, $mt = new RegExp(N4e.source, "g"), R4e = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, jmt = new RegExp(R4e.source, "g"), Gmt = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, ike = (i) => Gmt[i];
function kf(i, e) {
  if (e) {
    if (N4e.test(i))
      return i.replace($mt, ike);
  } else if (R4e.test(i))
    return i.replace(jmt, ike);
  return i;
}
const qmt = /(^|[^\[])\^/g;
function wo(i, e) {
  let t = typeof i == "string" ? i : i.source;
  e = e || "";
  const n = {
    replace: (r, s) => {
      let o = typeof s == "string" ? s : s.source;
      return o = o.replace(qmt, "$1"), t = t.replace(r, o), n;
    },
    getRegex: () => new RegExp(t, e)
  };
  return n;
}
function rke(i) {
  try {
    i = encodeURI(i).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return i;
}
const HF = { exec: () => null };
function ske(i, e) {
  const t = i.replace(/\|/g, (s, o, a) => {
    let l = !1, c = o;
    for (; --c >= 0 && a[c] === "\\"; )
      l = !l;
    return l ? "|" : " |";
  }), n = t.split(/ \|/);
  let r = 0;
  if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), e)
    if (n.length > e)
      n.splice(e);
    else
      for (; n.length < e; )
        n.push("");
  for (; r < n.length; r++)
    n[r] = n[r].trim().replace(/\\\|/g, "|");
  return n;
}
function KM(i, e, t) {
  const n = i.length;
  if (n === 0)
    return "";
  let r = 0;
  for (; r < n && i.charAt(n - r - 1) === e; )
    r++;
  return i.slice(0, n - r);
}
function Kmt(i, e) {
  if (i.indexOf(e[1]) === -1)
    return -1;
  let t = 0;
  for (let n = 0; n < i.length; n++)
    if (i[n] === "\\")
      n++;
    else if (i[n] === e[0])
      t++;
    else if (i[n] === e[1] && (t--, t < 0))
      return n;
  return -1;
}
function oke(i, e, t, n) {
  const r = e.href, s = e.title ? kf(e.title) : null, o = i[1].replace(/\\([\[\]])/g, "$1");
  if (i[0].charAt(0) !== "!") {
    n.state.inLink = !0;
    const a = {
      type: "link",
      raw: t,
      href: r,
      title: s,
      text: o,
      tokens: n.inlineTokens(o)
    };
    return n.state.inLink = !1, a;
  }
  return {
    type: "image",
    raw: t,
    href: r,
    title: s,
    text: kf(o)
  };
}
function Ymt(i, e) {
  const t = i.match(/^(\s+)(?:```)/);
  if (t === null)
    return e;
  const n = t[1];
  return e.split(`
`).map((r) => {
    const s = r.match(/^\s+/);
    if (s === null)
      return r;
    const [o] = s;
    return o.length >= n.length ? r.slice(n.length) : r;
  }).join(`
`);
}
class TU {
  // set by the lexer
  constructor(e) {
    mi(this, "options");
    mi(this, "rules");
    // set by the lexer
    mi(this, "lexer");
    this.options = e || ZT;
  }
  space(e) {
    const t = this.rules.block.newline.exec(e);
    if (t && t[0].length > 0)
      return {
        type: "space",
        raw: t[0]
      };
  }
  code(e) {
    const t = this.rules.block.code.exec(e);
    if (t) {
      const n = t[0].replace(/^ {1,4}/gm, "");
      return {
        type: "code",
        raw: t[0],
        codeBlockStyle: "indented",
        text: this.options.pedantic ? n : KM(n, `
`)
      };
    }
  }
  fences(e) {
    const t = this.rules.block.fences.exec(e);
    if (t) {
      const n = t[0], r = Ymt(n, t[3] || "");
      return {
        type: "code",
        raw: n,
        lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
        text: r
      };
    }
  }
  heading(e) {
    const t = this.rules.block.heading.exec(e);
    if (t) {
      let n = t[2].trim();
      if (/#$/.test(n)) {
        const r = KM(n, "#");
        (this.options.pedantic || !r || / $/.test(r)) && (n = r.trim());
      }
      return {
        type: "heading",
        raw: t[0],
        depth: t[1].length,
        text: n,
        tokens: this.lexer.inline(n)
      };
    }
  }
  hr(e) {
    const t = this.rules.block.hr.exec(e);
    if (t)
      return {
        type: "hr",
        raw: KM(t[0], `
`)
      };
  }
  blockquote(e) {
    const t = this.rules.block.blockquote.exec(e);
    if (t) {
      let n = KM(t[0], `
`).split(`
`), r = "", s = "";
      const o = [];
      for (; n.length > 0; ) {
        let a = !1;
        const l = [];
        let c;
        for (c = 0; c < n.length; c++)
          if (/^ {0,3}>/.test(n[c]))
            l.push(n[c]), a = !0;
          else if (!a)
            l.push(n[c]);
          else
            break;
        n = n.slice(c);
        const u = l.join(`
`), d = u.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
    $1`).replace(/^ {0,3}>[ \t]?/gm, "");
        r = r ? `${r}
${u}` : u, s = s ? `${s}
${d}` : d;
        const h = this.lexer.state.top;
        if (this.lexer.state.top = !0, this.lexer.blockTokens(d, o, !0), this.lexer.state.top = h, n.length === 0)
          break;
        const g = o[o.length - 1];
        if ((g == null ? void 0 : g.type) === "code")
          break;
        if ((g == null ? void 0 : g.type) === "blockquote") {
          const m = g, _ = m.raw + `
` + n.join(`
`), v = this.blockquote(_);
          o[o.length - 1] = v, r = r.substring(0, r.length - m.raw.length) + v.raw, s = s.substring(0, s.length - m.text.length) + v.text;
          break;
        } else if ((g == null ? void 0 : g.type) === "list") {
          const m = g, _ = m.raw + `
` + n.join(`
`), v = this.list(_);
          o[o.length - 1] = v, r = r.substring(0, r.length - g.raw.length) + v.raw, s = s.substring(0, s.length - m.raw.length) + v.raw, n = _.substring(o[o.length - 1].raw.length).split(`
`);
          continue;
        }
      }
      return {
        type: "blockquote",
        raw: r,
        tokens: o,
        text: s
      };
    }
  }
  list(e) {
    let t = this.rules.block.list.exec(e);
    if (t) {
      let n = t[1].trim();
      const r = n.length > 1, s = {
        type: "list",
        raw: "",
        ordered: r,
        start: r ? +n.slice(0, -1) : "",
        loose: !1,
        items: []
      };
      n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
      const o = new RegExp(`^( {0,3}${n})((?:[	 ][^\\n]*)?(?:\\n|$))`);
      let a = !1;
      for (; e; ) {
        let l = !1, c = "", u = "";
        if (!(t = o.exec(e)) || this.rules.block.hr.test(e))
          break;
        c = t[0], e = e.substring(c.length);
        let d = t[2].split(`
`, 1)[0].replace(/^\t+/, (w) => " ".repeat(3 * w.length)), h = e.split(`
`, 1)[0], g = !d.trim(), m = 0;
        if (this.options.pedantic ? (m = 2, u = d.trimStart()) : g ? m = t[1].length + 1 : (m = t[2].search(/[^ ]/), m = m > 4 ? 1 : m, u = d.slice(m), m += t[1].length), g && /^ *$/.test(h) && (c += h + `
`, e = e.substring(h.length + 1), l = !0), !l) {
          const w = new RegExp(`^ {0,${Math.min(3, m - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), E = new RegExp(`^ {0,${Math.min(3, m - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), L = new RegExp(`^ {0,${Math.min(3, m - 1)}}(?:\`\`\`|~~~)`), T = new RegExp(`^ {0,${Math.min(3, m - 1)}}#`);
          for (; e; ) {
            const D = e.split(`
`, 1)[0];
            if (h = D, this.options.pedantic && (h = h.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")), L.test(h) || T.test(h) || w.test(h) || E.test(e))
              break;
            if (h.search(/[^ ]/) >= m || !h.trim())
              u += `
` + h.slice(m);
            else {
              if (g || d.search(/[^ ]/) >= 4 || L.test(d) || T.test(d) || E.test(d))
                break;
              u += `
` + h;
            }
            !g && !h.trim() && (g = !0), c += D + `
`, e = e.substring(D.length + 1), d = h.slice(m);
          }
        }
        s.loose || (a ? s.loose = !0 : /\n *\n *$/.test(c) && (a = !0));
        let _ = null, v;
        this.options.gfm && (_ = /^\[[ xX]\] /.exec(u), _ && (v = _[0] !== "[ ] ", u = u.replace(/^\[[ xX]\] +/, ""))), s.items.push({
          type: "list_item",
          raw: c,
          task: !!_,
          checked: v,
          loose: !1,
          text: u,
          tokens: []
        }), s.raw += c;
      }
      s.items[s.items.length - 1].raw = s.items[s.items.length - 1].raw.trimEnd(), s.items[s.items.length - 1].text = s.items[s.items.length - 1].text.trimEnd(), s.raw = s.raw.trimEnd();
      for (let l = 0; l < s.items.length; l++)
        if (this.lexer.state.top = !1, s.items[l].tokens = this.lexer.blockTokens(s.items[l].text, []), !s.loose) {
          const c = s.items[l].tokens.filter((d) => d.type === "space"), u = c.length > 0 && c.some((d) => /\n.*\n/.test(d.raw));
          s.loose = u;
        }
      if (s.loose)
        for (let l = 0; l < s.items.length; l++)
          s.items[l].loose = !0;
      return s;
    }
  }
  html(e) {
    const t = this.rules.block.html.exec(e);
    if (t)
      return {
        type: "html",
        block: !0,
        raw: t[0],
        pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
        text: t[0]
      };
  }
  def(e) {
    const t = this.rules.block.def.exec(e);
    if (t) {
      const n = t[1].toLowerCase().replace(/\s+/g, " "), r = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
      return {
        type: "def",
        tag: n,
        raw: t[0],
        href: r,
        title: s
      };
    }
  }
  table(e) {
    const t = this.rules.block.table.exec(e);
    if (!t || !/[:|]/.test(t[2]))
      return;
    const n = ske(t[1]), r = t[2].replace(/^\||\| *$/g, "").split("|"), s = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
`) : [], o = {
      type: "table",
      raw: t[0],
      header: [],
      align: [],
      rows: []
    };
    if (n.length === r.length) {
      for (const a of r)
        /^ *-+: *$/.test(a) ? o.align.push("right") : /^ *:-+: *$/.test(a) ? o.align.push("center") : /^ *:-+ *$/.test(a) ? o.align.push("left") : o.align.push(null);
      for (let a = 0; a < n.length; a++)
        o.header.push({
          text: n[a],
          tokens: this.lexer.inline(n[a]),
          header: !0,
          align: o.align[a]
        });
      for (const a of s)
        o.rows.push(ske(a, o.header.length).map((l, c) => ({
          text: l,
          tokens: this.lexer.inline(l),
          header: !1,
          align: o.align[c]
        })));
      return o;
    }
  }
  lheading(e) {
    const t = this.rules.block.lheading.exec(e);
    if (t)
      return {
        type: "heading",
        raw: t[0],
        depth: t[2].charAt(0) === "=" ? 1 : 2,
        text: t[1],
        tokens: this.lexer.inline(t[1])
      };
  }
  paragraph(e) {
    const t = this.rules.block.paragraph.exec(e);
    if (t) {
      const n = t[1].charAt(t[1].length - 1) === `
` ? t[1].slice(0, -1) : t[1];
      return {
        type: "paragraph",
        raw: t[0],
        text: n,
        tokens: this.lexer.inline(n)
      };
    }
  }
  text(e) {
    const t = this.rules.block.text.exec(e);
    if (t)
      return {
        type: "text",
        raw: t[0],
        text: t[0],
        tokens: this.lexer.inline(t[0])
      };
  }
  escape(e) {
    const t = this.rules.inline.escape.exec(e);
    if (t)
      return {
        type: "escape",
        raw: t[0],
        text: kf(t[1])
      };
  }
  tag(e) {
    const t = this.rules.inline.tag.exec(e);
    if (t)
      return !this.lexer.state.inLink && /^<a /i.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
        type: "html",
        raw: t[0],
        inLink: this.lexer.state.inLink,
        inRawBlock: this.lexer.state.inRawBlock,
        block: !1,
        text: t[0]
      };
  }
  link(e) {
    const t = this.rules.inline.link.exec(e);
    if (t) {
      const n = t[2].trim();
      if (!this.options.pedantic && /^</.test(n)) {
        if (!/>$/.test(n))
          return;
        const o = KM(n.slice(0, -1), "\\");
        if ((n.length - o.length) % 2 === 0)
          return;
      } else {
        const o = Kmt(t[2], "()");
        if (o > -1) {
          const l = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + o;
          t[2] = t[2].substring(0, o), t[0] = t[0].substring(0, l).trim(), t[3] = "";
        }
      }
      let r = t[2], s = "";
      if (this.options.pedantic) {
        const o = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);
        o && (r = o[1], s = o[3]);
      } else
        s = t[3] ? t[3].slice(1, -1) : "";
      return r = r.trim(), /^</.test(r) && (this.options.pedantic && !/>$/.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), oke(t, {
        href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
        title: s && s.replace(this.rules.inline.anyPunctuation, "$1")
      }, t[0], this.lexer);
    }
  }
  reflink(e, t) {
    let n;
    if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
      const r = (n[2] || n[1]).replace(/\s+/g, " "), s = t[r.toLowerCase()];
      if (!s) {
        const o = n[0].charAt(0);
        return {
          type: "text",
          raw: o,
          text: o
        };
      }
      return oke(n, s, n[0], this.lexer);
    }
  }
  emStrong(e, t, n = "") {
    let r = this.rules.inline.emStrongLDelim.exec(e);
    if (!r || r[3] && n.match(/[\p{L}\p{N}]/u))
      return;
    if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
      const o = [...r[0]].length - 1;
      let a, l, c = o, u = 0;
      const d = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (d.lastIndex = 0, t = t.slice(-1 * e.length + o); (r = d.exec(t)) != null; ) {
        if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a)
          continue;
        if (l = [...a].length, r[3] || r[4]) {
          c += l;
          continue;
        } else if ((r[5] || r[6]) && o % 3 && !((o + l) % 3)) {
          u += l;
          continue;
        }
        if (c -= l, c > 0)
          continue;
        l = Math.min(l, l + c + u);
        const h = [...r[0]][0].length, g = e.slice(0, o + r.index + h + l);
        if (Math.min(o, l) % 2) {
          const _ = g.slice(1, -1);
          return {
            type: "em",
            raw: g,
            text: _,
            tokens: this.lexer.inlineTokens(_)
          };
        }
        const m = g.slice(2, -2);
        return {
          type: "strong",
          raw: g,
          text: m,
          tokens: this.lexer.inlineTokens(m)
        };
      }
    }
  }
  codespan(e) {
    const t = this.rules.inline.code.exec(e);
    if (t) {
      let n = t[2].replace(/\n/g, " ");
      const r = /[^ ]/.test(n), s = /^ /.test(n) && / $/.test(n);
      return r && s && (n = n.substring(1, n.length - 1)), n = kf(n, !0), {
        type: "codespan",
        raw: t[0],
        text: n
      };
    }
  }
  br(e) {
    const t = this.rules.inline.br.exec(e);
    if (t)
      return {
        type: "br",
        raw: t[0]
      };
  }
  del(e) {
    const t = this.rules.inline.del.exec(e);
    if (t)
      return {
        type: "del",
        raw: t[0],
        text: t[2],
        tokens: this.lexer.inlineTokens(t[2])
      };
  }
  autolink(e) {
    const t = this.rules.inline.autolink.exec(e);
    if (t) {
      let n, r;
      return t[2] === "@" ? (n = kf(t[1]), r = "mailto:" + n) : (n = kf(t[1]), r = n), {
        type: "link",
        raw: t[0],
        text: n,
        href: r,
        tokens: [
          {
            type: "text",
            raw: n,
            text: n
          }
        ]
      };
    }
  }
  url(e) {
    var n;
    let t;
    if (t = this.rules.inline.url.exec(e)) {
      let r, s;
      if (t[2] === "@")
        r = kf(t[0]), s = "mailto:" + r;
      else {
        let o;
        do
          o = t[0], t[0] = ((n = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : n[0]) ?? "";
        while (o !== t[0]);
        r = kf(t[0]), t[1] === "www." ? s = "http://" + t[0] : s = t[0];
      }
      return {
        type: "link",
        raw: t[0],
        text: r,
        href: s,
        tokens: [
          {
            type: "text",
            raw: r,
            text: r
          }
        ]
      };
    }
  }
  inlineText(e) {
    const t = this.rules.inline.text.exec(e);
    if (t) {
      let n;
      return this.lexer.state.inRawBlock ? n = t[0] : n = kf(t[0]), {
        type: "text",
        raw: t[0],
        text: n
      };
    }
  }
}
const Xmt = /^(?: *(?:\n|$))+/, Zmt = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Qmt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, NB = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Jmt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, A4e = /(?:[*+-]|\d{1,9}[.)])/, O4e = wo(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, A4e).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), _ge = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, e_t = /^[^\n]+/, bge = /(?!\s*\])(?:\\.|[^\[\]\\])+/, t_t = wo(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", bge).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), n_t = wo(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, A4e).getRegex(), hK = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", vge = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, i_t = wo("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", vge).replace("tag", hK).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), M4e = wo(_ge).replace("hr", NB).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", hK).getRegex(), r_t = wo(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", M4e).getRegex(), yge = {
  blockquote: r_t,
  code: Zmt,
  def: t_t,
  fences: Qmt,
  heading: Jmt,
  hr: NB,
  html: i_t,
  lheading: O4e,
  list: n_t,
  newline: Xmt,
  paragraph: M4e,
  table: HF,
  text: e_t
}, ake = wo("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", NB).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", hK).getRegex(), s_t = {
  ...yge,
  table: ake,
  paragraph: wo(_ge).replace("hr", NB).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ake).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", hK).getRegex()
}, o_t = {
  ...yge,
  html: wo(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", vge).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
  fences: HF,
  // fences not supported
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  paragraph: wo(_ge).replace("hr", NB).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", O4e).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, P4e = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, a_t = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, F4e = /^( {2,}|\\)\n(?!\s*$)/, l_t = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, RB = "\\p{P}\\p{S}", c_t = wo(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, RB).getRegex(), u_t = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, d_t = wo(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, RB).getRegex(), h_t = wo("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, RB).getRegex(), f_t = wo("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, RB).getRegex(), g_t = wo(/\\([punct])/, "gu").replace(/punct/g, RB).getRegex(), p_t = wo(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), m_t = wo(vge).replace("(?:-->|$)", "-->").getRegex(), __t = wo("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", m_t).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), kU = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, b_t = wo(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", kU).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), B4e = wo(/^!?\[(label)\]\[(ref)\]/).replace("label", kU).replace("ref", bge).getRegex(), H4e = wo(/^!?\[(ref)\](?:\[\])?/).replace("ref", bge).getRegex(), v_t = wo("reflink|nolink(?!\\()", "g").replace("reflink", B4e).replace("nolink", H4e).getRegex(), Cge = {
  _backpedal: HF,
  // only used for GFM url
  anyPunctuation: g_t,
  autolink: p_t,
  blockSkip: u_t,
  br: F4e,
  code: a_t,
  del: HF,
  emStrongLDelim: d_t,
  emStrongRDelimAst: h_t,
  emStrongRDelimUnd: f_t,
  escape: P4e,
  link: b_t,
  nolink: H4e,
  punctuation: c_t,
  reflink: B4e,
  reflinkSearch: v_t,
  tag: __t,
  text: l_t,
  url: HF
}, y_t = {
  ...Cge,
  link: wo(/^!?\[(label)\]\((.*?)\)/).replace("label", kU).getRegex(),
  reflink: wo(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", kU).getRegex()
}, Gre = {
  ...Cge,
  escape: wo(P4e).replace("])", "~|])").getRegex(),
  url: wo(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
}, C_t = {
  ...Gre,
  br: wo(F4e).replace("{2,}", "*").getRegex(),
  text: wo(Gre.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, nH = {
  normal: yge,
  gfm: s_t,
  pedantic: o_t
}, YM = {
  normal: Cge,
  gfm: Gre,
  breaks: C_t,
  pedantic: y_t
};
class J_ {
  constructor(e) {
    mi(this, "tokens");
    mi(this, "options");
    mi(this, "state");
    mi(this, "tokenizer");
    mi(this, "inlineQueue");
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || ZT, this.options.tokenizer = this.options.tokenizer || new TU(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
      inLink: !1,
      inRawBlock: !1,
      top: !0
    };
    const t = {
      block: nH.normal,
      inline: YM.normal
    };
    this.options.pedantic ? (t.block = nH.pedantic, t.inline = YM.pedantic) : this.options.gfm && (t.block = nH.gfm, this.options.breaks ? t.inline = YM.breaks : t.inline = YM.gfm), this.tokenizer.rules = t;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block: nH,
      inline: YM
    };
  }
  /**
   * Static Lex Method
   */
  static lex(e, t) {
    return new J_(t).lex(e);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(e, t) {
    return new J_(t).inlineTokens(e);
  }
  /**
   * Preprocessing
   */
  lex(e) {
    e = e.replace(/\r\n|\r/g, `
`), this.blockTokens(e, this.tokens);
    for (let t = 0; t < this.inlineQueue.length; t++) {
      const n = this.inlineQueue[t];
      this.inlineTokens(n.src, n.tokens);
    }
    return this.inlineQueue = [], this.tokens;
  }
  blockTokens(e, t = [], n = !1) {
    this.options.pedantic ? e = e.replace(/\t/g, "    ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (a, l, c) => l + "    ".repeat(c.length));
    let r, s, o;
    for (; e; )
      if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((a) => (r = a.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1))) {
        if (r = this.tokenizer.space(e)) {
          e = e.substring(r.raw.length), r.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
` : t.push(r);
          continue;
        }
        if (r = this.tokenizer.code(e)) {
          e = e.substring(r.raw.length), s = t[t.length - 1], s && (s.type === "paragraph" || s.type === "text") ? (s.raw += `
` + r.raw, s.text += `
` + r.text, this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(r);
          continue;
        }
        if (r = this.tokenizer.fences(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.heading(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.hr(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.blockquote(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.list(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.html(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.def(e)) {
          e = e.substring(r.raw.length), s = t[t.length - 1], s && (s.type === "paragraph" || s.type === "text") ? (s.raw += `
` + r.raw, s.text += `
` + r.raw, this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
            href: r.href,
            title: r.title
          });
          continue;
        }
        if (r = this.tokenizer.table(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (r = this.tokenizer.lheading(e)) {
          e = e.substring(r.raw.length), t.push(r);
          continue;
        }
        if (o = e, this.options.extensions && this.options.extensions.startBlock) {
          let a = 1 / 0;
          const l = e.slice(1);
          let c;
          this.options.extensions.startBlock.forEach((u) => {
            c = u.call({ lexer: this }, l), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
          }), a < 1 / 0 && a >= 0 && (o = e.substring(0, a + 1));
        }
        if (this.state.top && (r = this.tokenizer.paragraph(o))) {
          s = t[t.length - 1], n && (s == null ? void 0 : s.type) === "paragraph" ? (s.raw += `
` + r.raw, s.text += `
` + r.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
          continue;
        }
        if (r = this.tokenizer.text(e)) {
          e = e.substring(r.raw.length), s = t[t.length - 1], s && s.type === "text" ? (s.raw += `
` + r.raw, s.text += `
` + r.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : t.push(r);
          continue;
        }
        if (e) {
          const a = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(a);
            break;
          } else
            throw new Error(a);
        }
      }
    return this.state.top = !0, t;
  }
  inline(e, t = []) {
    return this.inlineQueue.push({ src: e, tokens: t }), t;
  }
  /**
   * Lexing/Compiling
   */
  inlineTokens(e, t = []) {
    let n, r, s, o = e, a, l, c;
    if (this.tokens.links) {
      const u = Object.keys(this.tokens.links);
      if (u.length > 0)
        for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(o)) != null; )
          u.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (o = o.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (a = this.tokenizer.rules.inline.blockSkip.exec(o)) != null; )
      o = o.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (a = this.tokenizer.rules.inline.anyPunctuation.exec(o)) != null; )
      o = o.slice(0, a.index) + "++" + o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e; )
      if (l || (c = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((u) => (n = u.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
        if (n = this.tokenizer.escape(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.tag(e)) {
          e = e.substring(n.raw.length), r = t[t.length - 1], r && n.type === "text" && r.type === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.link(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.reflink(e, this.tokens.links)) {
          e = e.substring(n.raw.length), r = t[t.length - 1], r && n.type === "text" && r.type === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.emStrong(e, o, c)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.codespan(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.br(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.del(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.autolink(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (!this.state.inLink && (n = this.tokenizer.url(e))) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (s = e, this.options.extensions && this.options.extensions.startInline) {
          let u = 1 / 0;
          const d = e.slice(1);
          let h;
          this.options.extensions.startInline.forEach((g) => {
            h = g.call({ lexer: this }, d), typeof h == "number" && h >= 0 && (u = Math.min(u, h));
          }), u < 1 / 0 && u >= 0 && (s = e.substring(0, u + 1));
        }
        if (n = this.tokenizer.inlineText(s)) {
          e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (c = n.raw.slice(-1)), l = !0, r = t[t.length - 1], r && r.type === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
          continue;
        }
        if (e) {
          const u = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(u);
            break;
          } else
            throw new Error(u);
        }
      }
    return t;
  }
}
class W4 {
  // set by the parser
  constructor(e) {
    mi(this, "options");
    mi(this, "parser");
    this.options = e || ZT;
  }
  space(e) {
    return "";
  }
  code({ text: e, lang: t, escaped: n }) {
    var o;
    const r = (o = (t || "").match(/^\S*/)) == null ? void 0 : o[0], s = e.replace(/\n$/, "") + `
`;
    return r ? '<pre><code class="language-' + kf(r) + '">' + (n ? s : kf(s, !0)) + `</code></pre>
` : "<pre><code>" + (n ? s : kf(s, !0)) + `</code></pre>
`;
  }
  blockquote({ tokens: e }) {
    return `<blockquote>
${this.parser.parse(e)}</blockquote>
`;
  }
  html({ text: e }) {
    return e;
  }
  heading({ tokens: e, depth: t }) {
    return `<h${t}>${this.parser.parseInline(e)}</h${t}>
`;
  }
  hr(e) {
    return `<hr>
`;
  }
  list(e) {
    const t = e.ordered, n = e.start;
    let r = "";
    for (let a = 0; a < e.items.length; a++) {
      const l = e.items[a];
      r += this.listitem(l);
    }
    const s = t ? "ol" : "ul", o = t && n !== 1 ? ' start="' + n + '"' : "";
    return "<" + s + o + `>
` + r + "</" + s + `>
`;
  }
  listitem(e) {
    let t = "";
    if (e.task) {
      const n = this.checkbox({ checked: !!e.checked });
      e.loose ? e.tokens.length > 0 && e.tokens[0].type === "paragraph" ? (e.tokens[0].text = n + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = n + " " + e.tokens[0].tokens[0].text)) : e.tokens.unshift({
        type: "text",
        raw: n + " ",
        text: n + " "
      }) : t += n + " ";
    }
    return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
`;
  }
  checkbox({ checked: e }) {
    return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
  }
  paragraph({ tokens: e }) {
    return `<p>${this.parser.parseInline(e)}</p>
`;
  }
  table(e) {
    let t = "", n = "";
    for (let s = 0; s < e.header.length; s++)
      n += this.tablecell(e.header[s]);
    t += this.tablerow({ text: n });
    let r = "";
    for (let s = 0; s < e.rows.length; s++) {
      const o = e.rows[s];
      n = "";
      for (let a = 0; a < o.length; a++)
        n += this.tablecell(o[a]);
      r += this.tablerow({ text: n });
    }
    return r && (r = `<tbody>${r}</tbody>`), `<table>
<thead>
` + t + `</thead>
` + r + `</table>
`;
  }
  tablerow({ text: e }) {
    return `<tr>
${e}</tr>
`;
  }
  tablecell(e) {
    const t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
    return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
`;
  }
  /**
   * span level renderer
   */
  strong({ tokens: e }) {
    return `<strong>${this.parser.parseInline(e)}</strong>`;
  }
  em({ tokens: e }) {
    return `<em>${this.parser.parseInline(e)}</em>`;
  }
  codespan({ text: e }) {
    return `<code>${e}</code>`;
  }
  br(e) {
    return "<br>";
  }
  del({ tokens: e }) {
    return `<del>${this.parser.parseInline(e)}</del>`;
  }
  link({ href: e, title: t, tokens: n }) {
    const r = this.parser.parseInline(n), s = rke(e);
    if (s === null)
      return r;
    e = s;
    let o = '<a href="' + e + '"';
    return t && (o += ' title="' + t + '"'), o += ">" + r + "</a>", o;
  }
  image({ href: e, title: t, text: n }) {
    const r = rke(e);
    if (r === null)
      return n;
    e = r;
    let s = `<img src="${e}" alt="${n}"`;
    return t && (s += ` title="${t}"`), s += ">", s;
  }
  text(e) {
    return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : e.text;
  }
}
class wge {
  // no need for block level renderers
  strong({ text: e }) {
    return e;
  }
  em({ text: e }) {
    return e;
  }
  codespan({ text: e }) {
    return e;
  }
  del({ text: e }) {
    return e;
  }
  html({ text: e }) {
    return e;
  }
  text({ text: e }) {
    return e;
  }
  link({ text: e }) {
    return "" + e;
  }
  image({ text: e }) {
    return "" + e;
  }
  br() {
    return "";
  }
}
class eb {
  constructor(e) {
    mi(this, "options");
    mi(this, "renderer");
    mi(this, "textRenderer");
    this.options = e || ZT, this.options.renderer = this.options.renderer || new W4(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new wge();
  }
  /**
   * Static Parse Method
   */
  static parse(e, t) {
    return new eb(t).parse(e);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(e, t) {
    return new eb(t).parseInline(e);
  }
  /**
   * Parse Loop
   */
  parse(e, t = !0) {
    let n = "";
    for (let r = 0; r < e.length; r++) {
      const s = e[r];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type]) {
        const a = s, l = this.options.extensions.renderers[a.type].call({ parser: this }, a);
        if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(a.type)) {
          n += l || "";
          continue;
        }
      }
      const o = s;
      switch (o.type) {
        case "space": {
          n += this.renderer.space(o);
          continue;
        }
        case "hr": {
          n += this.renderer.hr(o);
          continue;
        }
        case "heading": {
          n += this.renderer.heading(o);
          continue;
        }
        case "code": {
          n += this.renderer.code(o);
          continue;
        }
        case "table": {
          n += this.renderer.table(o);
          continue;
        }
        case "blockquote": {
          n += this.renderer.blockquote(o);
          continue;
        }
        case "list": {
          n += this.renderer.list(o);
          continue;
        }
        case "html": {
          n += this.renderer.html(o);
          continue;
        }
        case "paragraph": {
          n += this.renderer.paragraph(o);
          continue;
        }
        case "text": {
          let a = o, l = this.renderer.text(a);
          for (; r + 1 < e.length && e[r + 1].type === "text"; )
            a = e[++r], l += `
` + this.renderer.text(a);
          t ? n += this.renderer.paragraph({
            type: "paragraph",
            raw: l,
            text: l,
            tokens: [{ type: "text", raw: l, text: l }]
          }) : n += l;
          continue;
        }
        default: {
          const a = 'Token with "' + o.type + '" type was not found.';
          if (this.options.silent)
            return console.error(a), "";
          throw new Error(a);
        }
      }
    }
    return n;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(e, t) {
    t = t || this.renderer;
    let n = "";
    for (let r = 0; r < e.length; r++) {
      const s = e[r];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type]) {
        const a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
        if (a !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
          n += a || "";
          continue;
        }
      }
      const o = s;
      switch (o.type) {
        case "escape": {
          n += t.text(o);
          break;
        }
        case "html": {
          n += t.html(o);
          break;
        }
        case "link": {
          n += t.link(o);
          break;
        }
        case "image": {
          n += t.image(o);
          break;
        }
        case "strong": {
          n += t.strong(o);
          break;
        }
        case "em": {
          n += t.em(o);
          break;
        }
        case "codespan": {
          n += t.codespan(o);
          break;
        }
        case "br": {
          n += t.br(o);
          break;
        }
        case "del": {
          n += t.del(o);
          break;
        }
        case "text": {
          n += t.text(o);
          break;
        }
        default: {
          const a = 'Token with "' + o.type + '" type was not found.';
          if (this.options.silent)
            return console.error(a), "";
          throw new Error(a);
        }
      }
    }
    return n;
  }
}
class WF {
  constructor(e) {
    mi(this, "options");
    this.options = e || ZT;
  }
  /**
   * Process markdown before marked
   */
  preprocess(e) {
    return e;
  }
  /**
   * Process HTML after marked is finished
   */
  postprocess(e) {
    return e;
  }
  /**
   * Process all tokens before walk tokens
   */
  processAllTokens(e) {
    return e;
  }
}
mi(WF, "passThroughHooks", /* @__PURE__ */ new Set([
  "preprocess",
  "postprocess",
  "processAllTokens"
]));
class W4e {
  constructor(...e) {
    mi(this, "defaults", mge());
    mi(this, "options", this.setOptions);
    mi(this, "parse", this.parseMarkdown(J_.lex, eb.parse));
    mi(this, "parseInline", this.parseMarkdown(J_.lexInline, eb.parseInline));
    mi(this, "Parser", eb);
    mi(this, "Renderer", W4);
    mi(this, "TextRenderer", wge);
    mi(this, "Lexer", J_);
    mi(this, "Tokenizer", TU);
    mi(this, "Hooks", WF);
    this.use(...e);
  }
  /**
   * Run callback for every token
   */
  walkTokens(e, t) {
    var r, s;
    let n = [];
    for (const o of e)
      switch (n = n.concat(t.call(this, o)), o.type) {
        case "table": {
          const a = o;
          for (const l of a.header)
            n = n.concat(this.walkTokens(l.tokens, t));
          for (const l of a.rows)
            for (const c of l)
              n = n.concat(this.walkTokens(c.tokens, t));
          break;
        }
        case "list": {
          const a = o;
          n = n.concat(this.walkTokens(a.items, t));
          break;
        }
        default: {
          const a = o;
          (s = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && s[a.type] ? this.defaults.extensions.childTokens[a.type].forEach((l) => {
            const c = a[l].flat(1 / 0);
            n = n.concat(this.walkTokens(c, t));
          }) : a.tokens && (n = n.concat(this.walkTokens(a.tokens, t)));
        }
      }
    return n;
  }
  use(...e) {
    const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return e.forEach((n) => {
      const r = { ...n };
      if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
        if (!s.name)
          throw new Error("extension name required");
        if ("renderer" in s) {
          const o = t.renderers[s.name];
          o ? t.renderers[s.name] = function(...a) {
            let l = s.renderer.apply(this, a);
            return l === !1 && (l = o.apply(this, a)), l;
          } : t.renderers[s.name] = s.renderer;
        }
        if ("tokenizer" in s) {
          if (!s.level || s.level !== "block" && s.level !== "inline")
            throw new Error("extension level must be 'block' or 'inline'");
          const o = t[s.level];
          o ? o.unshift(s.tokenizer) : t[s.level] = [s.tokenizer], s.start && (s.level === "block" ? t.startBlock ? t.startBlock.push(s.start) : t.startBlock = [s.start] : s.level === "inline" && (t.startInline ? t.startInline.push(s.start) : t.startInline = [s.start]));
        }
        "childTokens" in s && s.childTokens && (t.childTokens[s.name] = s.childTokens);
      }), r.extensions = t), n.renderer) {
        const s = this.defaults.renderer || new W4(this.defaults);
        for (const o in n.renderer) {
          if (!(o in s))
            throw new Error(`renderer '${o}' does not exist`);
          if (["options", "parser"].includes(o))
            continue;
          const a = o, l = n.renderer[a], c = s[a];
          s[a] = (...u) => {
            let d = l.apply(s, u);
            return d === !1 && (d = c.apply(s, u)), d || "";
          };
        }
        r.renderer = s;
      }
      if (n.tokenizer) {
        const s = this.defaults.tokenizer || new TU(this.defaults);
        for (const o in n.tokenizer) {
          if (!(o in s))
            throw new Error(`tokenizer '${o}' does not exist`);
          if (["options", "rules", "lexer"].includes(o))
            continue;
          const a = o, l = n.tokenizer[a], c = s[a];
          s[a] = (...u) => {
            let d = l.apply(s, u);
            return d === !1 && (d = c.apply(s, u)), d;
          };
        }
        r.tokenizer = s;
      }
      if (n.hooks) {
        const s = this.defaults.hooks || new WF();
        for (const o in n.hooks) {
          if (!(o in s))
            throw new Error(`hook '${o}' does not exist`);
          if (o === "options")
            continue;
          const a = o, l = n.hooks[a], c = s[a];
          WF.passThroughHooks.has(o) ? s[a] = (u) => {
            if (this.defaults.async)
              return Promise.resolve(l.call(s, u)).then((h) => c.call(s, h));
            const d = l.call(s, u);
            return c.call(s, d);
          } : s[a] = (...u) => {
            let d = l.apply(s, u);
            return d === !1 && (d = c.apply(s, u)), d;
          };
        }
        r.hooks = s;
      }
      if (n.walkTokens) {
        const s = this.defaults.walkTokens, o = n.walkTokens;
        r.walkTokens = function(a) {
          let l = [];
          return l.push(o.call(this, a)), s && (l = l.concat(s.call(this, a))), l;
        };
      }
      this.defaults = { ...this.defaults, ...r };
    }), this;
  }
  setOptions(e) {
    return this.defaults = { ...this.defaults, ...e }, this;
  }
  lexer(e, t) {
    return J_.lex(e, t ?? this.defaults);
  }
  parser(e, t) {
    return eb.parse(e, t ?? this.defaults);
  }
  parseMarkdown(e, t) {
    return (r, s) => {
      const o = { ...s }, a = { ...this.defaults, ...o }, l = this.onError(!!a.silent, !!a.async);
      if (this.defaults.async === !0 && o.async === !1)
        return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
      if (typeof r > "u" || r === null)
        return l(new Error("marked(): input parameter is undefined or null"));
      if (typeof r != "string")
        return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected"));
      if (a.hooks && (a.hooks.options = a), a.async)
        return Promise.resolve(a.hooks ? a.hooks.preprocess(r) : r).then((c) => e(c, a)).then((c) => a.hooks ? a.hooks.processAllTokens(c) : c).then((c) => a.walkTokens ? Promise.all(this.walkTokens(c, a.walkTokens)).then(() => c) : c).then((c) => t(c, a)).then((c) => a.hooks ? a.hooks.postprocess(c) : c).catch(l);
      try {
        a.hooks && (r = a.hooks.preprocess(r));
        let c = e(r, a);
        a.hooks && (c = a.hooks.processAllTokens(c)), a.walkTokens && this.walkTokens(c, a.walkTokens);
        let u = t(c, a);
        return a.hooks && (u = a.hooks.postprocess(u)), u;
      } catch (c) {
        return l(c);
      }
    };
  }
  onError(e, t) {
    return (n) => {
      if (n.message += `
Please report this to https://github.com/markedjs/marked.`, e) {
        const r = "<p>An error occurred:</p><pre>" + kf(n.message + "", !0) + "</pre>";
        return t ? Promise.resolve(r) : r;
      }
      if (t)
        return Promise.reject(n);
      throw n;
    };
  }
}
const fT = new W4e();
function uo(i, e) {
  return fT.parse(i, e);
}
uo.options = uo.setOptions = function(i) {
  return fT.setOptions(i), uo.defaults = fT.defaults, I4e(uo.defaults), uo;
};
uo.getDefaults = mge;
uo.defaults = ZT;
uo.use = function(...i) {
  return fT.use(...i), uo.defaults = fT.defaults, I4e(uo.defaults), uo;
};
uo.walkTokens = function(i, e) {
  return fT.walkTokens(i, e);
};
uo.parseInline = fT.parseInline;
uo.Parser = eb;
uo.parser = eb.parse;
uo.Renderer = W4;
uo.TextRenderer = wge;
uo.Lexer = J_;
uo.lexer = J_.lex;
uo.Tokenizer = TU;
uo.Hooks = WF;
uo.parse = uo;
uo.options;
uo.setOptions;
uo.use;
uo.walkTokens;
uo.parseInline;
const w_t = uo;
eb.parse;
const V4 = J_.lex;
function S_t(i) {
  return JSON.stringify(i, E_t);
}
function qre(i) {
  let e = JSON.parse(i);
  return e = Kre(e), e;
}
function E_t(i, e) {
  return e instanceof RegExp ? {
    $mid: 2,
    source: e.source,
    flags: e.flags
  } : e;
}
function Kre(i, e = 0) {
  if (!i || e > 200)
    return i;
  if (typeof i == "object") {
    switch (i.$mid) {
      case 1:
        return Ht.revive(i);
      case 2:
        return new RegExp(i.source, i.flags);
      case 17:
        return new Date(i.source);
    }
    if (i instanceof x1 || i instanceof Uint8Array)
      return i;
    if (Array.isArray(i))
      for (let t = 0; t < i.length; ++t)
        i[t] = Kre(i[t], e + 1);
    else
      for (const t in i)
        Object.hasOwnProperty.call(i, t) && (i[t] = Kre(i[t], e + 1));
  }
  return i;
}
/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */
const {
  entries: V4e,
  setPrototypeOf: lke,
  isFrozen: x_t,
  getPrototypeOf: L_t,
  getOwnPropertyDescriptor: T_t
} = Object;
let {
  freeze: jd,
  seal: Gg,
  create: U4e
} = Object, {
  apply: Yre,
  construct: Xre
} = typeof Reflect < "u" && Reflect;
jd || (jd = function(e) {
  return e;
});
Gg || (Gg = function(e) {
  return e;
});
Yre || (Yre = function(e, t, n) {
  return e.apply(t, n);
});
Xre || (Xre = function(e, t) {
  return new e(...t);
});
const iH = Qf(Array.prototype.forEach), cke = Qf(Array.prototype.pop), XM = Qf(Array.prototype.push), OW = Qf(String.prototype.toLowerCase), Dee = Qf(String.prototype.toString), uke = Qf(String.prototype.match), ZM = Qf(String.prototype.replace), k_t = Qf(String.prototype.indexOf), D_t = Qf(String.prototype.trim), Np = Qf(Object.prototype.hasOwnProperty), Sd = Qf(RegExp.prototype.test), QM = I_t(TypeError);
function Qf(i) {
  return function(e) {
    for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
      n[r - 1] = arguments[r];
    return Yre(i, e, n);
  };
}
function I_t(i) {
  return function() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
      t[n] = arguments[n];
    return Xre(i, t);
  };
}
function Mr(i, e) {
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : OW;
  lke && lke(i, null);
  let n = e.length;
  for (; n--; ) {
    let r = e[n];
    if (typeof r == "string") {
      const s = t(r);
      s !== r && (x_t(e) || (e[n] = s), r = s);
    }
    i[r] = !0;
  }
  return i;
}
function N_t(i) {
  for (let e = 0; e < i.length; e++)
    Np(i, e) || (i[e] = null);
  return i;
}
function LE(i) {
  const e = U4e(null);
  for (const [t, n] of V4e(i))
    Np(i, t) && (Array.isArray(n) ? e[t] = N_t(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = LE(n) : e[t] = n);
  return e;
}
function JM(i, e) {
  for (; i !== null; ) {
    const n = T_t(i, e);
    if (n) {
      if (n.get)
        return Qf(n.get);
      if (typeof n.value == "function")
        return Qf(n.value);
    }
    i = L_t(i);
  }
  function t() {
    return null;
  }
  return t;
}
const dke = jd(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Iee = jd(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Nee = jd(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), R_t = jd(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Ree = jd(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), A_t = jd(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), hke = jd(["#text"]), fke = jd(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Aee = jd(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), gke = jd(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), rH = jd(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), O_t = Gg(/\{\{[\w\W]*|[\w\W]*\}\}/gm), M_t = Gg(/<%[\w\W]*|[\w\W]*%>/gm), P_t = Gg(/\${[\w\W]*}/gm), F_t = Gg(/^data-[\-\w.\u00B7-\uFFFF]/), B_t = Gg(/^aria-[\-\w]+$/), z4e = Gg(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), H_t = Gg(/^(?:\w+script|data):/i), W_t = Gg(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), $4e = Gg(/^html$/i), V_t = Gg(/^[a-z][.\w]*(-[.\w]+)+$/i);
var pke = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  MUSTACHE_EXPR: O_t,
  ERB_EXPR: M_t,
  TMPLIT_EXPR: P_t,
  DATA_ATTR: F_t,
  ARIA_ATTR: B_t,
  IS_ALLOWED_URI: z4e,
  IS_SCRIPT_OR_DATA: H_t,
  ATTR_WHITESPACE: W_t,
  DOCTYPE_NAME: $4e,
  CUSTOM_ELEMENT: V_t
});
const eP = {
  element: 1,
  text: 3,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9
}, U_t = function() {
  return typeof window > "u" ? null : window;
}, z_t = function(e, t) {
  if (typeof e != "object" || typeof e.createPolicy != "function")
    return null;
  let n = null;
  const r = "data-tt-policy-suffix";
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
  const s = "dompurify" + (n ? "#" + n : "");
  try {
    return e.createPolicy(s, {
      createHTML(o) {
        return o;
      },
      createScriptURL(o) {
        return o;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + s + " could not be created."), null;
  }
};
function j4e() {
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : U_t();
  const e = (Nt) => j4e(Nt);
  if (e.version = "3.1.7", e.removed = [], !i || !i.document || i.document.nodeType !== eP.document)
    return e.isSupported = !1, e;
  let {
    document: t
  } = i;
  const n = t, r = n.currentScript, {
    DocumentFragment: s,
    HTMLTemplateElement: o,
    Node: a,
    Element: l,
    NodeFilter: c,
    NamedNodeMap: u = i.NamedNodeMap || i.MozNamedAttrMap,
    HTMLFormElement: d,
    DOMParser: h,
    trustedTypes: g
  } = i, m = l.prototype, _ = JM(m, "cloneNode"), v = JM(m, "remove"), w = JM(m, "nextSibling"), E = JM(m, "childNodes"), L = JM(m, "parentNode");
  if (typeof o == "function") {
    const Nt = t.createElement("template");
    Nt.content && Nt.content.ownerDocument && (t = Nt.content.ownerDocument);
  }
  let T, D = "";
  const {
    implementation: N,
    createNodeIterator: R,
    createDocumentFragment: M,
    getElementsByTagName: B
  } = t, {
    importNode: H
  } = n;
  let j = {};
  e.isSupported = typeof V4e == "function" && typeof L == "function" && N && N.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: K,
    ERB_EXPR: X,
    TMPLIT_EXPR: Y,
    DATA_ATTR: G,
    ARIA_ATTR: Q,
    IS_SCRIPT_OR_DATA: oe,
    ATTR_WHITESPACE: Z,
    CUSTOM_ELEMENT: pe
  } = pke;
  let {
    IS_ALLOWED_URI: J
  } = pke, ae = null;
  const be = Mr({}, [...dke, ...Iee, ...Nee, ...Ree, ...hke]);
  let re = null;
  const ze = Mr({}, [...fke, ...Aee, ...gke, ...rH]);
  let Ve = Object.seal(U4e(null, {
    tagNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    attributeNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    allowCustomizedBuiltInElements: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: !1
    }
  })), st = null, ot = null, et = !0, at = !0, en = !1, sn = !0, Vt = !1, Bi = !0, pi = !1, tn = !1, Vr = !1, tr = !1, qr = !1, Bs = !1, Ts = !0, ts = !1;
  const io = "user-content-";
  let nr = !0, _s = !1, Hs = {}, He = null;
  const yt = Mr({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
  let Ln = null;
  const oi = Mr({}, ["audio", "video", "img", "source", "image", "track"]);
  let vi = null;
  const Dt = Mr({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), cn = "http://www.w3.org/1998/Math/MathML", En = "http://www.w3.org/2000/svg", ii = "http://www.w3.org/1999/xhtml";
  let li = ii, lt = !1, Bt = null;
  const Mn = Mr({}, [cn, En, ii], Dee);
  let gn = null;
  const yi = ["application/xhtml+xml", "text/html"], Ni = "text/html";
  let qi = null, Ur = null;
  const Ws = t.createElement("form"), El = function(ve) {
    return ve instanceof RegExp || ve instanceof Function;
  }, Ri = function() {
    let ve = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(Ur && Ur === ve)) {
      if ((!ve || typeof ve != "object") && (ve = {}), ve = LE(ve), gn = // eslint-disable-next-line unicorn/prefer-includes
      yi.indexOf(ve.PARSER_MEDIA_TYPE) === -1 ? Ni : ve.PARSER_MEDIA_TYPE, qi = gn === "application/xhtml+xml" ? Dee : OW, ae = Np(ve, "ALLOWED_TAGS") ? Mr({}, ve.ALLOWED_TAGS, qi) : be, re = Np(ve, "ALLOWED_ATTR") ? Mr({}, ve.ALLOWED_ATTR, qi) : ze, Bt = Np(ve, "ALLOWED_NAMESPACES") ? Mr({}, ve.ALLOWED_NAMESPACES, Dee) : Mn, vi = Np(ve, "ADD_URI_SAFE_ATTR") ? Mr(
        LE(Dt),
        // eslint-disable-line indent
        ve.ADD_URI_SAFE_ATTR,
        // eslint-disable-line indent
        qi
        // eslint-disable-line indent
      ) : Dt, Ln = Np(ve, "ADD_DATA_URI_TAGS") ? Mr(
        LE(oi),
        // eslint-disable-line indent
        ve.ADD_DATA_URI_TAGS,
        // eslint-disable-line indent
        qi
        // eslint-disable-line indent
      ) : oi, He = Np(ve, "FORBID_CONTENTS") ? Mr({}, ve.FORBID_CONTENTS, qi) : yt, st = Np(ve, "FORBID_TAGS") ? Mr({}, ve.FORBID_TAGS, qi) : {}, ot = Np(ve, "FORBID_ATTR") ? Mr({}, ve.FORBID_ATTR, qi) : {}, Hs = Np(ve, "USE_PROFILES") ? ve.USE_PROFILES : !1, et = ve.ALLOW_ARIA_ATTR !== !1, at = ve.ALLOW_DATA_ATTR !== !1, en = ve.ALLOW_UNKNOWN_PROTOCOLS || !1, sn = ve.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Vt = ve.SAFE_FOR_TEMPLATES || !1, Bi = ve.SAFE_FOR_XML !== !1, pi = ve.WHOLE_DOCUMENT || !1, tr = ve.RETURN_DOM || !1, qr = ve.RETURN_DOM_FRAGMENT || !1, Bs = ve.RETURN_TRUSTED_TYPE || !1, Vr = ve.FORCE_BODY || !1, Ts = ve.SANITIZE_DOM !== !1, ts = ve.SANITIZE_NAMED_PROPS || !1, nr = ve.KEEP_CONTENT !== !1, _s = ve.IN_PLACE || !1, J = ve.ALLOWED_URI_REGEXP || z4e, li = ve.NAMESPACE || ii, Ve = ve.CUSTOM_ELEMENT_HANDLING || {}, ve.CUSTOM_ELEMENT_HANDLING && El(ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Ve.tagNameCheck = ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck), ve.CUSTOM_ELEMENT_HANDLING && El(ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Ve.attributeNameCheck = ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), ve.CUSTOM_ELEMENT_HANDLING && typeof ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (Ve.allowCustomizedBuiltInElements = ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Vt && (at = !1), qr && (tr = !0), Hs && (ae = Mr({}, hke), re = [], Hs.html === !0 && (Mr(ae, dke), Mr(re, fke)), Hs.svg === !0 && (Mr(ae, Iee), Mr(re, Aee), Mr(re, rH)), Hs.svgFilters === !0 && (Mr(ae, Nee), Mr(re, Aee), Mr(re, rH)), Hs.mathMl === !0 && (Mr(ae, Ree), Mr(re, gke), Mr(re, rH))), ve.ADD_TAGS && (ae === be && (ae = LE(ae)), Mr(ae, ve.ADD_TAGS, qi)), ve.ADD_ATTR && (re === ze && (re = LE(re)), Mr(re, ve.ADD_ATTR, qi)), ve.ADD_URI_SAFE_ATTR && Mr(vi, ve.ADD_URI_SAFE_ATTR, qi), ve.FORBID_CONTENTS && (He === yt && (He = LE(He)), Mr(He, ve.FORBID_CONTENTS, qi)), nr && (ae["#text"] = !0), pi && Mr(ae, ["html", "head", "body"]), ae.table && (Mr(ae, ["tbody"]), delete st.tbody), ve.TRUSTED_TYPES_POLICY) {
        if (typeof ve.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw QM('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof ve.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw QM('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        T = ve.TRUSTED_TYPES_POLICY, D = T.createHTML("");
      } else
        T === void 0 && (T = z_t(g, r)), T !== null && typeof D == "string" && (D = T.createHTML(""));
      jd && jd(ve), Ur = ve;
    }
  }, So = Mr({}, ["mi", "mo", "mn", "ms", "mtext"]), va = Mr({}, ["annotation-xml"]), xl = Mr({}, ["title", "style", "font", "a", "script"]), ya = Mr({}, [...Iee, ...Nee, ...R_t]), ro = Mr({}, [...Ree, ...A_t]), Eo = function(ve) {
    let fe = L(ve);
    (!fe || !fe.tagName) && (fe = {
      namespaceURI: li,
      tagName: "template"
    });
    const Be = OW(ve.tagName), Lt = OW(fe.tagName);
    return Bt[ve.namespaceURI] ? ve.namespaceURI === En ? fe.namespaceURI === ii ? Be === "svg" : fe.namespaceURI === cn ? Be === "svg" && (Lt === "annotation-xml" || So[Lt]) : !!ya[Be] : ve.namespaceURI === cn ? fe.namespaceURI === ii ? Be === "math" : fe.namespaceURI === En ? Be === "math" && va[Lt] : !!ro[Be] : ve.namespaceURI === ii ? fe.namespaceURI === En && !va[Lt] || fe.namespaceURI === cn && !So[Lt] ? !1 : !ro[Be] && (xl[Be] || !ya[Be]) : !!(gn === "application/xhtml+xml" && Bt[ve.namespaceURI]) : !1;
  }, po = function(ve) {
    XM(e.removed, {
      element: ve
    });
    try {
      L(ve).removeChild(ve);
    } catch {
      v(ve);
    }
  }, bs = function(ve, fe) {
    try {
      XM(e.removed, {
        attribute: fe.getAttributeNode(ve),
        from: fe
      });
    } catch {
      XM(e.removed, {
        attribute: null,
        from: fe
      });
    }
    if (fe.removeAttribute(ve), ve === "is" && !re[ve])
      if (tr || qr)
        try {
          po(fe);
        } catch {
        }
      else
        try {
          fe.setAttribute(ve, "");
        } catch {
        }
  }, na = function(ve) {
    let fe = null, Be = null;
    if (Vr)
      ve = "<remove></remove>" + ve;
    else {
      const kn = uke(ve, /^[\r\n\t ]+/);
      Be = kn && kn[0];
    }
    gn === "application/xhtml+xml" && li === ii && (ve = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + ve + "</body></html>");
    const Lt = T ? T.createHTML(ve) : ve;
    if (li === ii)
      try {
        fe = new h().parseFromString(Lt, gn);
      } catch {
      }
    if (!fe || !fe.documentElement) {
      fe = N.createDocument(li, "template", null);
      try {
        fe.documentElement.innerHTML = lt ? D : Lt;
      } catch {
      }
    }
    const ci = fe.body || fe.documentElement;
    return ve && Be && ci.insertBefore(t.createTextNode(Be), ci.childNodes[0] || null), li === ii ? B.call(fe, pi ? "html" : "body")[0] : pi ? fe.documentElement : ci;
  }, sc = function(ve) {
    return R.call(
      ve.ownerDocument || ve,
      ve,
      // eslint-disable-next-line no-bitwise
      c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
      null
    );
  }, Rc = function(ve) {
    return ve instanceof d && (typeof ve.nodeName != "string" || typeof ve.textContent != "string" || typeof ve.removeChild != "function" || !(ve.attributes instanceof u) || typeof ve.removeAttribute != "function" || typeof ve.setAttribute != "function" || typeof ve.namespaceURI != "string" || typeof ve.insertBefore != "function" || typeof ve.hasChildNodes != "function");
  }, xe = function(ve) {
    return typeof a == "function" && ve instanceof a;
  }, mt = function(ve, fe, Be) {
    j[ve] && iH(j[ve], (Lt) => {
      Lt.call(e, fe, Be, Ur);
    });
  }, jt = function(ve) {
    let fe = null;
    if (mt("beforeSanitizeElements", ve, null), Rc(ve))
      return po(ve), !0;
    const Be = qi(ve.nodeName);
    if (mt("uponSanitizeElement", ve, {
      tagName: Be,
      allowedTags: ae
    }), ve.hasChildNodes() && !xe(ve.firstElementChild) && Sd(/<[/\w]/g, ve.innerHTML) && Sd(/<[/\w]/g, ve.textContent) || ve.nodeType === eP.progressingInstruction || Bi && ve.nodeType === eP.comment && Sd(/<[/\w]/g, ve.data))
      return po(ve), !0;
    if (!ae[Be] || st[Be]) {
      if (!st[Be] && Wi(Be) && (Ve.tagNameCheck instanceof RegExp && Sd(Ve.tagNameCheck, Be) || Ve.tagNameCheck instanceof Function && Ve.tagNameCheck(Be)))
        return !1;
      if (nr && !He[Be]) {
        const Lt = L(ve) || ve.parentNode, ci = E(ve) || ve.childNodes;
        if (ci && Lt) {
          const kn = ci.length;
          for (let qn = kn - 1; qn >= 0; --qn) {
            const bn = _(ci[qn], !0);
            bn.__removalCount = (ve.__removalCount || 0) + 1, Lt.insertBefore(bn, w(ve));
          }
        }
      }
      return po(ve), !0;
    }
    return ve instanceof l && !Eo(ve) || (Be === "noscript" || Be === "noembed" || Be === "noframes") && Sd(/<\/no(script|embed|frames)/i, ve.innerHTML) ? (po(ve), !0) : (Vt && ve.nodeType === eP.text && (fe = ve.textContent, iH([K, X, Y], (Lt) => {
      fe = ZM(fe, Lt, " ");
    }), ve.textContent !== fe && (XM(e.removed, {
      element: ve.cloneNode()
    }), ve.textContent = fe)), mt("afterSanitizeElements", ve, null), !1);
  }, nn = function(ve, fe, Be) {
    if (Ts && (fe === "id" || fe === "name") && (Be in t || Be in Ws))
      return !1;
    if (!(at && !ot[fe] && Sd(G, fe))) {
      if (!(et && Sd(Q, fe))) {
        if (!re[fe] || ot[fe]) {
          if (
            // First condition does a very basic check if a) it's basically a valid custom element tagname AND
            // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
            !(Wi(ve) && (Ve.tagNameCheck instanceof RegExp && Sd(Ve.tagNameCheck, ve) || Ve.tagNameCheck instanceof Function && Ve.tagNameCheck(ve)) && (Ve.attributeNameCheck instanceof RegExp && Sd(Ve.attributeNameCheck, fe) || Ve.attributeNameCheck instanceof Function && Ve.attributeNameCheck(fe)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            fe === "is" && Ve.allowCustomizedBuiltInElements && (Ve.tagNameCheck instanceof RegExp && Sd(Ve.tagNameCheck, Be) || Ve.tagNameCheck instanceof Function && Ve.tagNameCheck(Be)))
          ) return !1;
        } else if (!vi[fe]) {
          if (!Sd(J, ZM(Be, Z, ""))) {
            if (!((fe === "src" || fe === "xlink:href" || fe === "href") && ve !== "script" && k_t(Be, "data:") === 0 && Ln[ve])) {
              if (!(en && !Sd(oe, ZM(Be, Z, "")))) {
                if (Be)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, Wi = function(ve) {
    return ve !== "annotation-xml" && uke(ve, pe);
  }, fi = function(ve) {
    mt("beforeSanitizeAttributes", ve, null);
    const {
      attributes: fe
    } = ve;
    if (!fe)
      return;
    const Be = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: re
    };
    let Lt = fe.length;
    for (; Lt--; ) {
      const ci = fe[Lt], {
        name: kn,
        namespaceURI: qn,
        value: bn
      } = ci, mo = qi(kn);
      let ns = kn === "value" ? bn : D_t(bn);
      if (Be.attrName = mo, Be.attrValue = ns, Be.keepAttr = !0, Be.forceKeepAttr = void 0, mt("uponSanitizeAttribute", ve, Be), ns = Be.attrValue, Be.forceKeepAttr || (bs(kn, ve), !Be.keepAttr))
        continue;
      if (!sn && Sd(/\/>/i, ns)) {
        bs(kn, ve);
        continue;
      }
      Vt && iH([K, X, Y], (vs) => {
        ns = ZM(ns, vs, " ");
      });
      const tf = qi(ve.nodeName);
      if (nn(tf, mo, ns)) {
        if (ts && (mo === "id" || mo === "name") && (bs(kn, ve), ns = io + ns), Bi && Sd(/((--!?|])>)|<\/(style|title)/i, ns)) {
          bs(kn, ve);
          continue;
        }
        if (T && typeof g == "object" && typeof g.getAttributeType == "function" && !qn)
          switch (g.getAttributeType(tf, mo)) {
            case "TrustedHTML": {
              ns = T.createHTML(ns);
              break;
            }
            case "TrustedScriptURL": {
              ns = T.createScriptURL(ns);
              break;
            }
          }
        try {
          qn ? ve.setAttributeNS(qn, kn, ns) : ve.setAttribute(kn, ns), Rc(ve) ? po(ve) : cke(e.removed);
        } catch {
        }
      }
    }
    mt("afterSanitizeAttributes", ve, null);
  }, Ki = function Nt(ve) {
    let fe = null;
    const Be = sc(ve);
    for (mt("beforeSanitizeShadowDOM", ve, null); fe = Be.nextNode(); )
      mt("uponSanitizeShadowNode", fe, null), !jt(fe) && (fe.content instanceof s && Nt(fe.content), fi(fe));
    mt("afterSanitizeShadowDOM", ve, null);
  };
  return e.sanitize = function(Nt) {
    let ve = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, fe = null, Be = null, Lt = null, ci = null;
    if (lt = !Nt, lt && (Nt = "<!-->"), typeof Nt != "string" && !xe(Nt))
      if (typeof Nt.toString == "function") {
        if (Nt = Nt.toString(), typeof Nt != "string")
          throw QM("dirty is not a string, aborting");
      } else
        throw QM("toString is not a function");
    if (!e.isSupported)
      return Nt;
    if (tn || Ri(ve), e.removed = [], typeof Nt == "string" && (_s = !1), _s) {
      if (Nt.nodeName) {
        const bn = qi(Nt.nodeName);
        if (!ae[bn] || st[bn])
          throw QM("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (Nt instanceof a)
      fe = na("<!---->"), Be = fe.ownerDocument.importNode(Nt, !0), Be.nodeType === eP.element && Be.nodeName === "BODY" || Be.nodeName === "HTML" ? fe = Be : fe.appendChild(Be);
    else {
      if (!tr && !Vt && !pi && // eslint-disable-next-line unicorn/prefer-includes
      Nt.indexOf("<") === -1)
        return T && Bs ? T.createHTML(Nt) : Nt;
      if (fe = na(Nt), !fe)
        return tr ? null : Bs ? D : "";
    }
    fe && Vr && po(fe.firstChild);
    const kn = sc(_s ? Nt : fe);
    for (; Lt = kn.nextNode(); )
      jt(Lt) || (Lt.content instanceof s && Ki(Lt.content), fi(Lt));
    if (_s)
      return Nt;
    if (tr) {
      if (qr)
        for (ci = M.call(fe.ownerDocument); fe.firstChild; )
          ci.appendChild(fe.firstChild);
      else
        ci = fe;
      return (re.shadowroot || re.shadowrootmode) && (ci = H.call(n, ci, !0)), ci;
    }
    let qn = pi ? fe.outerHTML : fe.innerHTML;
    return pi && ae["!doctype"] && fe.ownerDocument && fe.ownerDocument.doctype && fe.ownerDocument.doctype.name && Sd($4e, fe.ownerDocument.doctype.name) && (qn = "<!DOCTYPE " + fe.ownerDocument.doctype.name + `>
` + qn), Vt && iH([K, X, Y], (bn) => {
      qn = ZM(qn, bn, " ");
    }), T && Bs ? T.createHTML(qn) : qn;
  }, e.setConfig = function() {
    let Nt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    Ri(Nt), tn = !0;
  }, e.clearConfig = function() {
    Ur = null, tn = !1;
  }, e.isValidAttribute = function(Nt, ve, fe) {
    Ur || Ri({});
    const Be = qi(Nt), Lt = qi(ve);
    return nn(Be, Lt, fe);
  }, e.addHook = function(Nt, ve) {
    typeof ve == "function" && (j[Nt] = j[Nt] || [], XM(j[Nt], ve));
  }, e.removeHook = function(Nt) {
    if (j[Nt])
      return cke(j[Nt]);
  }, e.removeHooks = function(Nt) {
    j[Nt] && (j[Nt] = []);
  }, e.removeAllHooks = function() {
    j = {};
  }, e;
}
var UI = j4e();
const G4e = Object.freeze([
  "a",
  "abbr",
  "b",
  "bdo",
  "blockquote",
  "br",
  "caption",
  "cite",
  "code",
  "col",
  "colgroup",
  "dd",
  "del",
  "details",
  "dfn",
  "div",
  "dl",
  "dt",
  "em",
  "figcaption",
  "figure",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "hr",
  "i",
  "img",
  "ins",
  "kbd",
  "label",
  "li",
  "mark",
  "ol",
  "p",
  "pre",
  "q",
  "rp",
  "rt",
  "ruby",
  "s",
  "samp",
  "small",
  "small",
  "source",
  "span",
  "strike",
  "strong",
  "sub",
  "summary",
  "sup",
  "table",
  "tbody",
  "td",
  "tfoot",
  "th",
  "thead",
  "time",
  "tr",
  "tt",
  "u",
  "ul",
  "var",
  "video",
  "wbr"
]), q4e = Object.freeze([
  "href",
  "target",
  "src",
  "alt",
  "title",
  "for",
  "name",
  "role",
  "tabindex",
  "x-dispatch",
  "required",
  "checked",
  "placeholder",
  "type",
  "start",
  "width",
  "height",
  "align"
]), Oee = "vscode-relative-path";
function mke(i, e) {
  if (e.override === "*")
    return !0;
  try {
    const t = new URL(i, Oee + "://");
    return !!(e.override.includes(t.protocol.replace(/:$/, "")) || e.allowRelativePaths && t.protocol === Oee + ":" && !i.trim().toLowerCase().startsWith(Oee));
  } catch {
    return !1;
  }
}
function $_t(i, e) {
  UI.addHook("afterSanitizeAttributes", (t) => {
    for (const n of ["href", "src"])
      if (t.hasAttribute(n)) {
        const r = t.getAttribute(n);
        n === "href" ? !r.startsWith("#") && !mke(r, i) && t.removeAttribute(n) : mke(r, e) || t.removeAttribute(n);
      }
  });
}
const j_t = Object.freeze({
  ALLOWED_TAGS: [...G4e],
  ALLOWED_ATTR: [...q4e],
  // We sanitize the src/href attributes later if needed
  ALLOW_UNKNOWN_PROTOCOLS: !0
});
function G_t(i, e) {
  return K4e(i, e, "trusted");
}
function K4e(i, e, t) {
  var n, r;
  try {
    const s = { ...j_t };
    e != null && e.allowedTags && (e.allowedTags.override && (s.ALLOWED_TAGS = [...e.allowedTags.override]), e.allowedTags.augment && (s.ALLOWED_TAGS = [...s.ALLOWED_TAGS ?? [], ...e.allowedTags.augment]));
    let o = [...q4e];
    e != null && e.allowedAttributes && (e.allowedAttributes.override && (o = [...e.allowedAttributes.override]), e.allowedAttributes.augment && (o = [...o, ...e.allowedAttributes.augment])), o = o.map((c) => typeof c == "string" ? c.toLowerCase() : {
      attributeName: c.attributeName.toLowerCase(),
      shouldKeep: c.shouldKeep
    });
    const a = new Set(o.map((c) => typeof c == "string" ? c : c.attributeName)), l = /* @__PURE__ */ new Map();
    for (const c of o)
      typeof c == "string" ? l.delete(c) : l.set(c.attributeName, c);
    return s.ALLOWED_ATTR = Array.from(a), $_t({
      override: ((n = e == null ? void 0 : e.allowedLinkProtocols) == null ? void 0 : n.override) ?? [Yt.http, Yt.https],
      allowRelativePaths: (e == null ? void 0 : e.allowRelativeLinkPaths) ?? !1
    }, {
      override: ((r = e == null ? void 0 : e.allowedMediaProtocols) == null ? void 0 : r.override) ?? [Yt.http, Yt.https],
      allowRelativePaths: (e == null ? void 0 : e.allowRelativeMediaPaths) ?? !1
    }), e != null && e.replaceWithPlaintext && UI.addHook("uponSanitizeElement", K_t), l.size && UI.addHook("uponSanitizeAttribute", (c, u) => {
      const d = l.get(u.attrName);
      if (d) {
        const h = d.shouldKeep(c, u);
        typeof h == "string" ? (u.keepAttr = !0, u.attrValue = h) : u.keepAttr = h;
      } else
        u.keepAttr = a.has(u.attrName);
    }), t === "dom" ? UI.sanitize(i, {
      ...s,
      RETURN_DOM_FRAGMENT: !0
    }) : UI.sanitize(i, {
      ...s,
      RETURN_TRUSTED_TYPE: !0
    });
  } finally {
    UI.removeAllHooks();
  }
}
const q_t = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
function K_t(i, e, t) {
  var n, r;
  if (!e.allowedTags[e.tagName] && e.tagName !== "body") {
    const s = Y4e(i);
    i.nodeType === Node.COMMENT_NODE ? (n = i.parentElement) == null || n.insertBefore(s, i) : (r = i.parentElement) == null || r.replaceChild(s, i);
  }
}
function Y4e(i) {
  let e, t;
  if (i.nodeType === Node.COMMENT_NODE)
    e = `<!--${i.textContent}-->`;
  else {
    const o = i.tagName.toLowerCase(), a = q_t.includes(o), l = i.attributes.length ? " " + Array.from(i.attributes).map((c) => `${c.name}="${c.value}"`).join(" ") : "";
    e = `<${o}${l}>`, a || (t = `</${o}>`);
  }
  const n = document.createDocumentFragment(), r = i.ownerDocument.createTextNode(e);
  for (n.appendChild(r); i.firstChild; )
    n.appendChild(i.firstChild);
  const s = t ? i.ownerDocument.createTextNode(t) : void 0;
  return s && n.appendChild(s), n;
}
function X4e(i, e, t) {
  const n = K4e(e, t, "dom");
  ma(i, n);
}
const Y_t = new RegExp(`(\\\\)?\\$\\((${qt.iconNameExpression}(?:${qt.iconModifierExpression})?)\\)`, "g");
function D1(i) {
  const e = new Array();
  let t, n = 0, r = 0;
  for (; (t = Y_t.exec(i)) !== null; ) {
    r = t.index || 0, n < r && e.push(i.substring(n, r)), n = (t.index || 0) + t[0].length;
    const [, s, o] = t;
    e.push(s ? `$(${o})` : _b({ id: o }));
  }
  return n < i.length && e.push(i.substring(n)), e;
}
function _b(i) {
  const e = Ge("span");
  return e.classList.add(...qt.asClassNameArray(i)), e;
}
const Mee = Object.freeze({
  image: ({ href: i, title: e, text: t }) => {
    let n = [], r = [];
    return i && ({ href: i, dimensions: n } = zmt(i), r.push(`src="${tH(i)}"`)), t && r.push(`alt="${tH(t)}"`), e && r.push(`title="${tH(e)}"`), n.length && (r = r.concat(n)), "<img " + r.join(" ") + ">";
  },
  paragraph({ tokens: i }) {
    return `<p>${this.parser.parseInline(i)}</p>`;
  },
  link({ href: i, title: e, tokens: t }) {
    let n = this.parser.parseInline(t);
    return typeof i != "string" ? "" : (i === n && (n = kee(n)), e = typeof e == "string" ? tH(kee(e)) : "", i = kee(i), i = i.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), `<a href="${i}" title="${e || i}" draggable="false">${n}</a>`);
  }
});
function AB(i, e = {}, t) {
  var m, _, v;
  const n = new ke();
  let r = !1;
  const s = new W4e(...e.markedExtensions ?? []), { renderer: o, codeBlocks: a, syncCodeBlocks: l } = Z_t(s, e, i), c = Q_t(i);
  let u;
  if (e.fillInIncompleteTokens) {
    const w = {
      ...s.defaults,
      ...e.markedOptions,
      renderer: o
    }, E = s.lexer(c, w), L = dbt(E);
    u = s.parser(L, w);
  } else
    u = s.parse(c, { ...e == null ? void 0 : e.markedOptions, renderer: o, async: !1 });
  i.supportThemeIcons && (u = D1(u).map((E) => typeof E == "string" ? E : E.outerHTML).join(""));
  const d = document.createElement("div"), h = Z4e(i, e.sanitizerConfig ?? {});
  X4e(d, u, h), X_t(i, e, d);
  let g;
  if (t ? (g = t, ma(t, ...d.children)) : g = d, a.length > 0)
    Promise.all(a).then((w) => {
      var T;
      if (r)
        return;
      const E = new Map(w), L = g.querySelectorAll("div[data-code]");
      for (const D of L) {
        const N = E.get(D.dataset.code ?? "");
        N && ma(D, N);
      }
      (T = e.asyncRenderCallback) == null || T.call(e);
    });
  else if (l.length > 0) {
    const w = new Map(l), E = g.querySelectorAll("div[data-code]");
    for (const L of E) {
      const T = w.get(L.dataset.code ?? "");
      T && ma(L, T);
    }
  }
  if (e.asyncRenderCallback)
    for (const w of g.getElementsByTagName("img")) {
      const E = n.add(Ce(w, "load", () => {
        E.dispose(), e.asyncRenderCallback();
      }));
    }
  if (e.actionHandler) {
    const w = (E) => {
      const L = new vl(At(g), E);
      !L.leftButton && !L.middleButton || _ke(i, e, L);
    };
    n.add(Ce(g, "click", w)), n.add(Ce(g, "auxclick", w)), n.add(Ce(g, "keydown", (E) => {
      const L = new wr(E);
      !L.equals(
        10
        /* KeyCode.Space */
      ) && !L.equals(
        3
        /* KeyCode.Enter */
      ) || _ke(i, e, L);
    }));
  }
  for (const w of [...g.getElementsByTagName("input")])
    if (((m = w.attributes.getNamedItem("type")) == null ? void 0 : m.value) === "checkbox")
      w.setAttribute("disabled", "");
    else if ((_ = e.sanitizerConfig) != null && _.replaceWithPlaintext) {
      const E = Y4e(w);
      (v = w.parentElement) == null || v.replaceChild(E, w);
    } else
      w.remove();
  return {
    element: g,
    dispose: () => {
      r = !0, n.dispose();
    }
  };
}
function X_t(i, e, t) {
  var n;
  for (const r of t.querySelectorAll("img, audio, video, source")) {
    const s = r.getAttribute("src");
    if (s) {
      let o = s;
      try {
        i.baseUri && (o = Zre(Ht.from(i.baseUri), o));
      } catch {
      }
      if (r.setAttribute("src", bke(i, o, !0)), (n = e.sanitizerConfig) != null && n.remoteImageIsAllowed) {
        const a = Ht.parse(o);
        a.scheme !== Yt.file && a.scheme !== Yt.data && !e.sanitizerConfig.remoteImageIsAllowed(a) && r.replaceWith(Ge("", void 0, r.outerHTML));
      }
    }
  }
  for (const r of t.querySelectorAll("a")) {
    const s = r.getAttribute("href");
    if (r.setAttribute("href", ""), !s || /^data:|javascript:/i.test(s) || /^command:/i.test(s) && !i.isTrusted || /^command:(\/\/\/)?_workbench\.downloadResource/i.test(s))
      r.replaceWith(...r.childNodes);
    else {
      let o = bke(i, s, !1);
      i.baseUri && (o = Zre(Ht.from(i.baseUri), s)), r.dataset.href = o;
    }
  }
}
function Z_t(i, e, t) {
  const n = new i.Renderer(e.markedOptions);
  n.image = Mee.image, n.link = Mee.link, n.paragraph = Mee.paragraph;
  const r = [], s = [];
  return e.codeBlockRendererSync ? n.code = ({ text: o, lang: a, raw: l }) => {
    const c = jre.nextId(), u = e.codeBlockRendererSync(vke(a), o, l);
    return s.push([c, u]), `<div class="code" data-code="${c}">${Ug(o)}</div>`;
  } : e.codeBlockRenderer && (n.code = ({ text: o, lang: a }) => {
    const l = jre.nextId(), c = e.codeBlockRenderer(vke(a), o);
    return r.push(c.then((u) => [l, u])), `<div class="code" data-code="${l}">${Ug(o)}</div>`;
  }), t.supportHtml || (n.html = ({ text: o }) => {
    var l;
    return (l = e.sanitizerConfig) != null && l.replaceWithPlaintext ? Ug(o) : (t.isTrusted ? o.match(/^(<span[^>]+>)|(<\/\s*span>)$/) : void 0) ? o : "";
  }), { renderer: n, codeBlocks: r, syncCodeBlocks: s };
}
function Q_t(i) {
  let e = i.value;
  return e.length > 1e5 && (e = `${e.substr(0, 1e5)}…`), i.supportThemeIcons && (e = Bmt(e)), e;
}
function _ke(i, e, t) {
  var r;
  const n = t.target.closest("a[data-href]");
  if (eo(n))
    try {
      let s = n.dataset.href;
      s && (i.baseUri && (s = Zre(Ht.from(i.baseUri), s)), (r = e.actionHandler) == null || r.call(e, s, i));
    } catch (s) {
      fn(s);
    } finally {
      t.preventDefault();
    }
}
function J_t(i, e) {
  let t;
  try {
    t = qre(decodeURIComponent(e));
  } catch {
  }
  return t ? (t = iFe(t, (n) => {
    if (i.uris && i.uris[n])
      return Ht.revive(i.uris[n]);
  }), encodeURIComponent(JSON.stringify(t))) : e;
}
function bke(i, e, t) {
  const n = i.uris && i.uris[e];
  let r = Ht.revive(n);
  return t ? e.startsWith(Yt.data + ":") ? e : (r || (r = Ht.parse(e)), uPe.uriToBrowserUri(r).toString(!0)) : !r || Ht.parse(e).toString() === r.toString() ? e : (r.query && (r = r.with({ query: J_t(i, r.query) })), r.toString());
}
function vke(i) {
  if (!i)
    return "";
  const e = i.split(/[\s+|:|,|\{|\?]/, 1);
  return e.length ? e[0] : i;
}
function Zre(i, e) {
  return /^\w[\w\d+.-]*:/.test(e) ? e : i.path.endsWith("/") ? tLe(i, e).toString() : tLe(Aq(i), e).toString();
}
function ebt(i, e, t = {}) {
  const n = Z4e(e, t);
  return G_t(i, n);
}
const tbt = Object.freeze([
  ...G4e,
  "input"
  // Allow inputs for rendering checkboxes. Other types of inputs are removed and the inputs are always disabled
]), nbt = Object.freeze([
  "align",
  "autoplay",
  "alt",
  "colspan",
  "controls",
  "draggable",
  "height",
  "href",
  "loop",
  "muted",
  "playsinline",
  "poster",
  "rowspan",
  "src",
  "target",
  "title",
  "type",
  "width",
  "start",
  // Input (For disabled inputs)
  "checked",
  "disabled",
  "value",
  // Custom markdown attributes
  "data-code",
  "data-href",
  // Only allow very specific styles
  {
    attributeName: "style",
    shouldKeep: (i, e) => i.tagName === "SPAN" && e.attrName === "style" ? /^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(e.attrValue) : !1
  },
  // Only allow codicons for classes
  {
    attributeName: "class",
    shouldKeep: (i, e) => i.tagName === "SPAN" && e.attrName === "class" ? /^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(e.attrValue) : !1
  }
]);
function Z4e(i, e) {
  var r, s, o;
  const t = i.isTrusted ?? !1, n = [
    Yt.http,
    Yt.https,
    Yt.mailto,
    Yt.file,
    Yt.vscodeFileResource,
    Yt.vscodeRemote,
    Yt.vscodeRemoteResource,
    Yt.vscodeNotebookCell
  ];
  return t && n.push(Yt.command), (r = e.allowedLinkSchemes) != null && r.augment && n.push(...e.allowedLinkSchemes.augment), {
    // allowedTags should included everything that markdown renders to.
    // Since we have our own sanitize function for marked, it's possible we missed some tag so let dompurify make sure.
    // HTML tags that can result from markdown are from reading https://spec.commonmark.org/0.29/
    // HTML table tags that can result from markdown are from https://github.github.com/gfm/#tables-extension-
    allowedTags: {
      override: ((s = e.allowedTags) == null ? void 0 : s.override) ?? tbt
    },
    allowedAttributes: {
      override: ((o = e.allowedAttributes) == null ? void 0 : o.override) ?? nbt
    },
    allowedLinkProtocols: {
      override: n
    },
    allowRelativeLinkPaths: !!i.baseUri,
    allowedMediaProtocols: {
      override: [
        Yt.http,
        Yt.https,
        Yt.data,
        Yt.file,
        Yt.vscodeFileResource,
        Yt.vscodeRemote,
        Yt.vscodeRemoteResource
      ]
    },
    replaceWithPlaintext: e.replaceWithPlaintext
  };
}
function ibt(i, e) {
  if (typeof i == "string")
    return i;
  let t = i.value ?? "";
  t.length > 1e5 && (t = `${t.substr(0, 1e5)}…`);
  const n = w_t(t, { async: !1, renderer: sbt.value });
  return ebt(n, { isTrusted: !1 }, {}).toString().replace(/&(#\d+|[a-zA-Z]+);/g, (r) => rbt.get(r) ?? r).trim();
}
const rbt = /* @__PURE__ */ new Map([
  ["&quot;", '"'],
  ["&nbsp;", " "],
  ["&amp;", "&"],
  ["&#39;", "'"],
  ["&lt;", "<"],
  ["&gt;", ">"]
]);
function Q4e() {
  const i = new W4();
  return i.code = ({ text: e }) => Ug(e), i.blockquote = ({ text: e }) => e + `
`, i.html = (e) => "", i.heading = function({ tokens: e }) {
    return this.parser.parseInline(e) + `
`;
  }, i.hr = () => "", i.list = function({ items: e }) {
    return e.map((t) => this.listitem(t)).join(`
`) + `
`;
  }, i.listitem = ({ text: e }) => e + `
`, i.paragraph = function({ tokens: e }) {
    return this.parser.parseInline(e) + `
`;
  }, i.table = function({ header: e, rows: t }) {
    return e.map((n) => this.tablecell(n)).join(" ") + `
` + t.map((n) => n.map((r) => this.tablecell(r)).join(" ")).join(`
`) + `
`;
  }, i.tablerow = ({ text: e }) => e, i.tablecell = function({ tokens: e }) {
    return this.parser.parseInline(e);
  }, i.strong = ({ text: e }) => e, i.em = ({ text: e }) => e, i.codespan = ({ text: e }) => Ug(e), i.br = (e) => `
`, i.del = ({ text: e }) => e, i.image = (e) => "", i.text = ({ text: e }) => e, i.link = ({ text: e }) => e, i;
}
const sbt = new _l(Q4e);
new _l(() => {
  const i = Q4e();
  return i.code = ({ text: e }) => `
\`\`\`
${Ug(e)}
\`\`\`
`, i;
});
function U4(i) {
  let e = "";
  return i.forEach((t) => {
    e += t.raw;
  }), e;
}
function J4e(i) {
  var e, t;
  if (i.tokens)
    for (let n = i.tokens.length - 1; n >= 0; n--) {
      const r = i.tokens[n];
      if (r.type === "text") {
        const s = r.raw.split(`
`), o = s[s.length - 1];
        if (o.includes("`"))
          return fbt(i);
        if (o.includes("**"))
          return vbt(i);
        if (o.match(/\*\w/))
          return gbt(i);
        if (o.match(/(^|\s)__\w/))
          return ybt(i);
        if (o.match(/(^|\s)_\w/))
          return pbt(i);
        if (
          // Text with start of link target
          obt(o) || // This token doesn't have the link text, eg if it contains other markdown constructs that are in other subtokens.
          // But some preceding token does have an unbalanced [ at least
          abt(o) && i.tokens.slice(0, n).some((a) => a.type === "text" && a.raw.match(/\[[^\]]*$/))
        ) {
          const a = i.tokens.slice(n + 1);
          return (
            // If the link was parsed as a link, then look for a link token and a text token with a quote
            ((e = a[0]) == null ? void 0 : e.type) === "link" && ((t = a[1]) == null ? void 0 : t.type) === "text" && a[1].raw.match(/^ *"[^"]*$/) || // And if the link was not parsed as a link (eg command link), just look for a single quote in this token
            o.match(/^[^"]* +"[^"]*$/) ? _bt(i) : mbt(i)
          );
        } else if (o.match(/(^|\s)\[\w*[^\]]*$/))
          return bbt(i);
      }
    }
}
function obt(i) {
  return !!i.match(/(^|\s)\[.*\]\(\w*/);
}
function abt(i) {
  return !!i.match(/^[^\[]*\]\([^\)]*$/);
}
function lbt(i) {
  var c;
  const e = i.items[i.items.length - 1], t = e.tokens ? e.tokens[e.tokens.length - 1] : void 0, n = (u) => {
    const d = u.items.at(-1), h = d == null ? void 0 : d.tokens.at(-1);
    return (h == null ? void 0 : h.type) === "heading" || (h == null ? void 0 : h.type) === "list" && n(h);
  };
  let r;
  if ((t == null ? void 0 : t.type) === "text" && !("inRawBlock" in e))
    r = J4e(t);
  else if (n(i)) {
    const u = V4(i.raw.trim() + " &nbsp;")[0];
    return u.type !== "list" ? void 0 : u;
  }
  if (!r || r.type !== "paragraph")
    return;
  const s = U4(i.items.slice(0, -1)), o = (c = e.raw.match(/^(\s*(-|\d+\.|\*) +)/)) == null ? void 0 : c[0];
  if (!o)
    return;
  const a = o + U4(e.tokens.slice(0, -1)) + r.raw, l = V4(s + a)[0];
  if (l.type === "list")
    return l;
}
function cbt(i, e) {
  if (i.raw.match(/-\s*$/))
    return V4(e + " &nbsp;");
}
const ubt = 3;
function dbt(i) {
  for (let e = 0; e < ubt; e++) {
    const t = hbt(i);
    if (t)
      i = t;
    else
      break;
  }
  return i;
}
function hbt(i) {
  let e, t;
  for (e = 0; e < i.length; e++) {
    const r = i[e];
    if (r.type === "paragraph" && r.raw.match(/(\n|^)\|/)) {
      t = Cbt(i.slice(e));
      break;
    }
  }
  const n = i.at(-1);
  if (!t && (n == null ? void 0 : n.type) === "list") {
    const r = lbt(n);
    r && (t = [r], e = i.length - 1);
  }
  if (!t && (n == null ? void 0 : n.type) === "paragraph") {
    const r = J4e(n);
    r && (t = [r], e = i.length - 1);
  }
  if (t) {
    const r = [
      ...i.slice(0, e),
      ...t
    ];
    return r.links = i.links, r;
  }
  if ((n == null ? void 0 : n.type) === "heading") {
    const r = cbt(n, U4(i));
    if (r)
      return r;
  }
  return null;
}
function fbt(i) {
  return xw(i, "`");
}
function gbt(i) {
  return xw(i, "*");
}
function pbt(i) {
  return xw(i, "_");
}
function mbt(i) {
  return xw(i, ")", !1);
}
function _bt(i) {
  return xw(i, '")', !1);
}
function bbt(i) {
  return xw(i, "](https://microsoft.com)", !1);
}
function vbt(i) {
  return xw(i, "**");
}
function ybt(i) {
  return xw(i, "__");
}
function xw(i, e, t = !0) {
  const n = U4(Array.isArray(i) ? i : [i]), r = t ? n.trimEnd() : n;
  return V4(r + e)[0];
}
function Cbt(i) {
  const e = U4(i), t = e.split(`
`);
  let n, r = !1;
  for (let s = 0; s < t.length; s++) {
    const o = t[s].trim();
    if (typeof n > "u" && o.match(/^\s*\|/)) {
      const a = o.match(/(\|[^\|]+)(?=\||$)/g);
      a && (n = a.length);
    } else if (typeof n == "number")
      if (o.match(/^\s*\|/)) {
        if (s !== t.length - 1)
          return;
        r = !0;
      } else
        return;
  }
  if (typeof n == "number" && n > 0) {
    const s = r ? t.slice(0, -1).join(`
`) : e, o = !!s.match(/\|\s*$/), a = s + (o ? "" : "|") + `
|${" --- |".repeat(n)}`;
    return V4(a);
  }
}
let e5e = {
  showInstantHover: () => {
  },
  showDelayedHover: () => {
  },
  setupDelayedHover: () => ge.None,
  setupDelayedHoverAtMouse: () => ge.None,
  hideHover: () => {
  },
  showAndFocusLastHover: () => {
  },
  setupManagedHover: () => ({
    dispose: () => {
    },
    show: () => {
    },
    hide: () => {
    },
    update: () => {
    }
  }),
  showManagedHover: () => {
  }
};
function wbt(i) {
  e5e = i;
}
function Jg() {
  return e5e;
}
class Sbt {
  constructor(e) {
    this.spliceables = e;
  }
  splice(e, t, n) {
    this.spliceables.forEach((r) => r.splice(e, t, n));
  }
}
function Jc(i, e, t) {
  return Math.min(Math.max(i, e), t);
}
class t5e {
  constructor() {
    this._n = 1, this._val = 0;
  }
  update(e) {
    return this._val = this._val + (e - this._val) / this._n, this._n += 1, this._val;
  }
  get value() {
    return this._val;
  }
}
class Ebt {
  constructor(e) {
    this._n = 0, this._val = 0, this._values = [], this._index = 0, this._sum = 0, this._values = new Array(e), this._values.fill(0, 0, e);
  }
  update(e) {
    const t = this._values[this._index];
    return this._values[this._index] = e, this._index = (this._index + 1) % this._values.length, this._sum -= t, this._sum += e, this._n < this._values.length && (this._n += 1), this._val = this._sum / this._n, this._val;
  }
  get value() {
    return this._val;
  }
}
class cE extends Error {
  constructor(e, t) {
    super(`ListError [${e}] ${t}`);
  }
}
var Ul;
(function(i) {
  function e(s, o) {
    if (s.start >= o.end || o.start >= s.end)
      return { start: 0, end: 0 };
    const a = Math.max(s.start, o.start), l = Math.min(s.end, o.end);
    return l - a <= 0 ? { start: 0, end: 0 } : { start: a, end: l };
  }
  i.intersect = e;
  function t(s) {
    return s.end - s.start <= 0;
  }
  i.isEmpty = t;
  function n(s, o) {
    return !t(e(s, o));
  }
  i.intersects = n;
  function r(s, o) {
    const a = [], l = { start: s.start, end: Math.min(o.start, s.end) }, c = { start: Math.max(o.end, s.start), end: s.end };
    return t(l) || a.push(l), t(c) || a.push(c), a;
  }
  i.relativeComplement = r;
})(Ul || (Ul = {}));
function yke(i, e) {
  const t = [];
  for (const n of e) {
    if (i.start >= n.range.end)
      continue;
    if (i.end < n.range.start)
      break;
    const r = Ul.intersect(i, n.range);
    Ul.isEmpty(r) || t.push({
      range: r,
      size: n.size
    });
  }
  return t;
}
function Qre({ start: i, end: e }, t) {
  return { start: i + t, end: e + t };
}
function xbt(i) {
  const e = [];
  let t = null;
  for (const n of i) {
    const r = n.range.start, s = n.range.end, o = n.size;
    if (t && o === t.size) {
      t.range.end = s;
      continue;
    }
    t = { range: { start: r, end: s }, size: o }, e.push(t);
  }
  return e;
}
function Lbt(...i) {
  return xbt(i.reduce((e, t) => e.concat(t), []));
}
class Tbt {
  get paddingTop() {
    return this._paddingTop;
  }
  set paddingTop(e) {
    this._size = this._size + e - this._paddingTop, this._paddingTop = e;
  }
  constructor(e) {
    this.groups = [], this._size = 0, this._paddingTop = 0, this._paddingTop = e ?? 0, this._size = this._paddingTop;
  }
  splice(e, t, n = []) {
    const r = n.length - t, s = yke({ start: 0, end: e }, this.groups), o = yke({ start: e + t, end: Number.POSITIVE_INFINITY }, this.groups).map((l) => ({ range: Qre(l.range, r), size: l.size })), a = n.map((l, c) => ({
      range: { start: e + c, end: e + c + 1 },
      size: l.size
    }));
    this.groups = Lbt(s, a, o), this._size = this._paddingTop + this.groups.reduce((l, c) => l + c.size * (c.range.end - c.range.start), 0);
  }
  /**
   * Returns the number of items in the range map.
   */
  get count() {
    const e = this.groups.length;
    return e ? this.groups[e - 1].range.end : 0;
  }
  /**
   * Returns the sum of the sizes of all items in the range map.
   */
  get size() {
    return this._size;
  }
  /**
   * Returns the index of the item at the given position.
   */
  indexAt(e) {
    if (e < 0)
      return -1;
    if (e < this._paddingTop)
      return 0;
    let t = 0, n = this._paddingTop;
    for (const r of this.groups) {
      const s = r.range.end - r.range.start, o = n + s * r.size;
      if (e < o)
        return t + Math.floor((e - n) / r.size);
      t += s, n = o;
    }
    return t;
  }
  /**
   * Returns the index of the item right after the item at the
   * index of the given position.
   */
  indexAfter(e) {
    return Math.min(this.indexAt(e) + 1, this.count);
  }
  /**
   * Returns the start position of the item at the given index.
   */
  positionAt(e) {
    if (e < 0)
      return -1;
    let t = 0, n = 0;
    for (const r of this.groups) {
      const s = r.range.end - r.range.start, o = n + s;
      if (e < o)
        return this._paddingTop + t + (e - n) * r.size;
      t += s * r.size, n = o;
    }
    return -1;
  }
}
class kbt {
  constructor(e) {
    this.renderers = e, this.cache = /* @__PURE__ */ new Map(), this.transactionNodesPendingRemoval = /* @__PURE__ */ new Set(), this.inTransaction = !1;
  }
  /**
   * Returns a row either by creating a new one or reusing
   * a previously released row which shares the same templateId.
   *
   * @returns A row and `isReusingConnectedDomNode` if the row's node is already in the dom in a stale position.
   */
  alloc(e) {
    let t = this.getTemplateCache(e).pop(), n = !1;
    if (t)
      n = this.transactionNodesPendingRemoval.has(t.domNode), n && this.transactionNodesPendingRemoval.delete(t.domNode);
    else {
      const r = Ge(".monaco-list-row"), o = this.getRenderer(e).renderTemplate(r);
      t = { domNode: r, templateId: e, templateData: o };
    }
    return { row: t, isReusingConnectedDomNode: n };
  }
  /**
   * Releases the row for eventual reuse.
   */
  release(e) {
    e && this.releaseRow(e);
  }
  /**
   * Begin a set of changes that use the cache. This lets us skip work when a row is removed and then inserted again.
   */
  transact(e) {
    if (this.inTransaction)
      throw new Error("Already in transaction");
    this.inTransaction = !0;
    try {
      e();
    } finally {
      for (const t of this.transactionNodesPendingRemoval)
        this.doRemoveNode(t);
      this.transactionNodesPendingRemoval.clear(), this.inTransaction = !1;
    }
  }
  releaseRow(e) {
    const { domNode: t, templateId: n } = e;
    t && (this.inTransaction ? this.transactionNodesPendingRemoval.add(t) : this.doRemoveNode(t)), this.getTemplateCache(n).push(e);
  }
  doRemoveNode(e) {
    e.classList.remove("scrolling"), e.remove();
  }
  getTemplateCache(e) {
    let t = this.cache.get(e);
    return t || (t = [], this.cache.set(e, t)), t;
  }
  dispose() {
    this.cache.forEach((e, t) => {
      for (const n of e)
        this.getRenderer(t).disposeTemplate(n.templateData), n.templateData = null;
    }), this.cache.clear(), this.transactionNodesPendingRemoval.clear();
  }
  getRenderer(e) {
    const t = this.renderers.get(e);
    if (!t)
      throw new Error(`No renderer found for ${e}`);
    return t;
  }
}
function Dbt(i, e, t, n = []) {
  if (!i.dataTransfer)
    return;
  const r = Ge(".monaco-drag-image");
  r.textContent = t, r.classList.add(...n), ((a) => {
    for (; a && !a.classList.contains("monaco-workbench"); )
      a = a.parentElement;
    return a || e.ownerDocument.body;
  })(e).appendChild(r), i.dataTransfer.setDragImage(r, -10, -10), setTimeout(() => r.remove(), 0);
}
var f0 = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
};
const uE = {
  CurrentDragAndDropData: void 0
}, h_ = {
  useShadows: !0,
  verticalScrollMode: 1,
  setRowLineHeight: !0,
  setRowHeight: !0,
  supportDynamicHeights: !1,
  dnd: {
    getDragElements(i) {
      return [i];
    },
    getDragURI() {
      return null;
    },
    onDragStart() {
    },
    onDragOver() {
      return !1;
    },
    drop() {
    },
    dispose() {
    }
  },
  horizontalScrolling: !1,
  transformOptimization: !0,
  alwaysConsumeMouseWheel: !0
};
class OB {
  constructor(e) {
    this.elements = e;
  }
  update() {
  }
  getData() {
    return this.elements;
  }
}
class Ibt {
  constructor(e) {
    this.elements = e;
  }
  update() {
  }
  getData() {
    return this.elements;
  }
}
class Nbt {
  constructor() {
    this.types = [], this.files = [];
  }
  update(e) {
    if (e.types && this.types.splice(0, this.types.length, ...e.types), e.files) {
      this.files.splice(0, this.files.length);
      for (let t = 0; t < e.files.length; t++) {
        const n = e.files.item(t);
        n && (n.size || n.type) && this.files.push(n);
      }
    }
  }
  getData() {
    return {
      types: this.types,
      files: this.files
    };
  }
}
function Rbt(i, e) {
  return Array.isArray(i) && Array.isArray(e) ? ds(i, e) : i === e;
}
class Abt {
  constructor(e) {
    e != null && e.getSetSize ? this.getSetSize = e.getSetSize.bind(e) : this.getSetSize = (t, n, r) => r, e != null && e.getPosInSet ? this.getPosInSet = e.getPosInSet.bind(e) : this.getPosInSet = (t, n) => n + 1, e != null && e.getRole ? this.getRole = e.getRole.bind(e) : this.getRole = (t) => "listitem", e != null && e.isChecked ? this.isChecked = e.isChecked.bind(e) : this.isChecked = (t) => {
    };
  }
}
const Xj = class Xj {
  get contentHeight() {
    return this.rangeMap.size;
  }
  get onDidScroll() {
    return this.scrollableElement.onScroll;
  }
  get scrollableElementDomNode() {
    return this.scrollableElement.getDomNode();
  }
  get horizontalScrolling() {
    return this._horizontalScrolling;
  }
  set horizontalScrolling(e) {
    if (e !== this._horizontalScrolling) {
      if (e && this.supportDynamicHeights)
        throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");
      if (this._horizontalScrolling = e, this.domNode.classList.toggle("horizontal-scrolling", this._horizontalScrolling), this._horizontalScrolling) {
        for (const t of this.items)
          this.measureItemWidth(t);
        this.updateScrollWidth(), this.scrollableElement.setScrollDimensions({ width: WJ(this.domNode) }), this.rowsContainer.style.width = `${Math.max(this.scrollWidth || 0, this.renderWidth)}px`;
      } else
        this.scrollableElementWidthDelayer.cancel(), this.scrollableElement.setScrollDimensions({ width: this.renderWidth, scrollWidth: this.renderWidth }), this.rowsContainer.style.width = "";
    }
  }
  constructor(e, t, n, r = h_) {
    var o, a;
    if (this.virtualDelegate = t, this.domId = `list_id_${++Xj.InstanceCount}`, this.renderers = /* @__PURE__ */ new Map(), this.renderWidth = 0, this._scrollHeight = 0, this.scrollableElementUpdateDisposable = null, this.scrollableElementWidthDelayer = new Gf(50), this.splicing = !1, this.dragOverAnimationStopDisposable = ge.None, this.dragOverMouseY = 0, this.canDrop = !1, this.currentDragFeedbackDisposable = ge.None, this.onDragLeaveTimeout = ge.None, this.currentSelectionDisposable = ge.None, this.disposables = new ke(), this._onDidChangeContentHeight = new he(), this._onDidChangeContentWidth = new he(), this.onDidChangeContentHeight = Ze.latch(this._onDidChangeContentHeight.event, void 0, this.disposables), this._horizontalScrolling = !1, r.horizontalScrolling && r.supportDynamicHeights)
      throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");
    this.items = [], this.itemId = 0, this.rangeMap = this.createRangeMap(r.paddingTop ?? 0);
    for (const l of n)
      this.renderers.set(l.templateId, l);
    if (this.cache = this.disposables.add(new kbt(this.renderers)), this.lastRenderTop = 0, this.lastRenderHeight = 0, this.domNode = document.createElement("div"), this.domNode.className = "monaco-list", this.domNode.classList.add(this.domId), this.domNode.tabIndex = 0, this.domNode.classList.toggle("mouse-support", typeof r.mouseSupport == "boolean" ? r.mouseSupport : !0), this._horizontalScrolling = r.horizontalScrolling ?? h_.horizontalScrolling, this.domNode.classList.toggle("horizontal-scrolling", this._horizontalScrolling), this.paddingBottom = typeof r.paddingBottom > "u" ? 0 : r.paddingBottom, this.accessibilityProvider = new Abt(r.accessibilityProvider), this.rowsContainer = document.createElement("div"), this.rowsContainer.className = "monaco-list-rows", (r.transformOptimization ?? h_.transformOptimization) && (this.rowsContainer.style.transform = "translate3d(0px, 0px, 0px)", this.rowsContainer.style.overflow = "hidden", this.rowsContainer.style.contain = "strict"), this.disposables.add(ec.addTarget(this.rowsContainer)), this.scrollable = this.disposables.add(new n2({
      forceIntegerValues: !0,
      smoothScrollDuration: r.smoothScrolling ?? !1 ? 125 : 0,
      scheduleAtNextAnimationFrame: (l) => Ju(At(this.domNode), l)
    })), this.scrollableElement = this.disposables.add(new eK(this.rowsContainer, {
      alwaysConsumeMouseWheel: r.alwaysConsumeMouseWheel ?? h_.alwaysConsumeMouseWheel,
      horizontal: 1,
      vertical: r.verticalScrollMode ?? h_.verticalScrollMode,
      useShadows: r.useShadows ?? h_.useShadows,
      mouseWheelScrollSensitivity: r.mouseWheelScrollSensitivity,
      fastScrollSensitivity: r.fastScrollSensitivity,
      scrollByPage: r.scrollByPage
    }, this.scrollable)), this.domNode.appendChild(this.scrollableElement.getDomNode()), e.appendChild(this.domNode), this.scrollableElement.onScroll(this.onScroll, this, this.disposables), this.disposables.add(Ce(this.rowsContainer, zr.Change, (l) => this.onTouchChange(l))), this.disposables.add(Ce(this.scrollableElement.getDomNode(), "scroll", (l) => {
      const c = l.target, u = c.scrollTop;
      c.scrollTop = 0, r.scrollToActiveElement && this.setScrollTop(this.scrollTop + u);
    })), this.disposables.add(Ce(this.domNode, "dragover", (l) => this.onDragOver(this.toDragEvent(l)))), this.disposables.add(Ce(this.domNode, "drop", (l) => this.onDrop(this.toDragEvent(l)))), this.disposables.add(Ce(this.domNode, "dragleave", (l) => this.onDragLeave(this.toDragEvent(l)))), this.disposables.add(Ce(this.domNode, "dragend", (l) => this.onDragEnd(l))), r.userSelection) {
      if (r.dnd)
        throw new Error("DND and user selection cannot be used simultaneously");
      this.disposables.add(Ce(this.domNode, "mousedown", (l) => this.onPotentialSelectionStart(l)));
    }
    this.setRowLineHeight = r.setRowLineHeight ?? h_.setRowLineHeight, this.setRowHeight = r.setRowHeight ?? h_.setRowHeight, this.supportDynamicHeights = r.supportDynamicHeights ?? h_.supportDynamicHeights, this.dnd = r.dnd ?? this.disposables.add(h_.dnd), this.layout((o = r.initialSize) == null ? void 0 : o.height, (a = r.initialSize) == null ? void 0 : a.width), r.scrollToActiveElement && this._setupFocusObserver(e);
  }
  _setupFocusObserver(e) {
    this.disposables.add(Ce(e, "focus", () => {
      const t = ea();
      this.activeElement !== t && t !== null && (this.activeElement = t, this._scrollToActiveElement(this.activeElement, e));
    }, !0));
  }
  _scrollToActiveElement(e, t) {
    const n = t.getBoundingClientRect(), s = e.getBoundingClientRect().top - n.top;
    s < 0 && this.setScrollTop(this.scrollTop + s);
  }
  updateOptions(e) {
    e.paddingBottom !== void 0 && (this.paddingBottom = e.paddingBottom, this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight })), e.smoothScrolling !== void 0 && this.scrollable.setSmoothScrollDuration(e.smoothScrolling ? 125 : 0), e.horizontalScrolling !== void 0 && (this.horizontalScrolling = e.horizontalScrolling);
    let t;
    if (e.scrollByPage !== void 0 && (t = { ...t ?? {}, scrollByPage: e.scrollByPage }), e.mouseWheelScrollSensitivity !== void 0 && (t = { ...t ?? {}, mouseWheelScrollSensitivity: e.mouseWheelScrollSensitivity }), e.fastScrollSensitivity !== void 0 && (t = { ...t ?? {}, fastScrollSensitivity: e.fastScrollSensitivity }), t && this.scrollableElement.updateOptions(t), e.paddingTop !== void 0 && e.paddingTop !== this.rangeMap.paddingTop) {
      const n = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight), r = e.paddingTop - this.rangeMap.paddingTop;
      this.rangeMap.paddingTop = e.paddingTop, this.render(n, Math.max(0, this.lastRenderTop + r), this.lastRenderHeight, void 0, void 0, !0), this.setScrollTop(this.lastRenderTop), this.eventuallyUpdateScrollDimensions(), this.supportDynamicHeights && this._rerender(this.lastRenderTop, this.lastRenderHeight);
    }
  }
  createRangeMap(e) {
    return new Tbt(e);
  }
  splice(e, t, n = []) {
    if (this.splicing)
      throw new Error("Can't run recursive splices.");
    this.splicing = !0;
    try {
      return this._splice(e, t, n);
    } finally {
      this.splicing = !1, this._onDidChangeContentHeight.fire(this.contentHeight);
    }
  }
  _splice(e, t, n = []) {
    const r = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight), s = { start: e, end: e + t }, o = Ul.intersect(r, s), a = /* @__PURE__ */ new Map();
    for (let D = o.end - 1; D >= o.start; D--) {
      const N = this.items[D];
      if (N.dragStartDisposable.dispose(), N.checkedDisposable.dispose(), N.row) {
        let R = a.get(N.templateId);
        R || (R = [], a.set(N.templateId, R));
        const M = this.renderers.get(N.templateId);
        M && M.disposeElement && M.disposeElement(N.element, D, N.row.templateData, { height: N.size }), R.unshift(N.row);
      }
      N.row = null, N.stale = !0;
    }
    const l = { start: e + t, end: this.items.length }, c = Ul.intersect(l, r), u = Ul.relativeComplement(l, r), d = n.map((D) => ({
      id: String(this.itemId++),
      element: D,
      templateId: this.virtualDelegate.getTemplateId(D),
      size: this.virtualDelegate.getHeight(D),
      width: void 0,
      hasDynamicHeight: !!this.virtualDelegate.hasDynamicHeight && this.virtualDelegate.hasDynamicHeight(D),
      lastDynamicHeightWidth: void 0,
      row: null,
      uri: void 0,
      dropTarget: !1,
      dragStartDisposable: ge.None,
      checkedDisposable: ge.None,
      stale: !1
    }));
    let h;
    e === 0 && t >= this.items.length ? (this.rangeMap = this.createRangeMap(this.rangeMap.paddingTop), this.rangeMap.splice(0, 0, d), h = this.items, this.items = d) : (this.rangeMap.splice(e, t, d), h = OV(this.items, e, t, d));
    const g = n.length - t, m = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight), _ = Qre(c, g), v = Ul.intersect(m, _);
    for (let D = v.start; D < v.end; D++)
      this.updateItemInDOM(this.items[D], D);
    const w = Ul.relativeComplement(_, m);
    for (const D of w)
      for (let N = D.start; N < D.end; N++)
        this.removeItemFromDOM(N);
    const E = u.map((D) => Qre(D, g)), T = [{ start: e, end: e + n.length }, ...E].map((D) => Ul.intersect(m, D)).reverse();
    for (const D of T)
      for (let N = D.end - 1; N >= D.start; N--) {
        const R = this.items[N], M = a.get(R.templateId), B = M == null ? void 0 : M.pop();
        this.insertItemInDOM(N, B);
      }
    for (const D of a.values())
      for (const N of D)
        this.cache.release(N);
    return this.eventuallyUpdateScrollDimensions(), this.supportDynamicHeights && this._rerender(this.scrollTop, this.renderHeight), h.map((D) => D.element);
  }
  eventuallyUpdateScrollDimensions() {
    this._scrollHeight = this.contentHeight, this.rowsContainer.style.height = `${this._scrollHeight}px`, this.scrollableElementUpdateDisposable || (this.scrollableElementUpdateDisposable = Ju(At(this.domNode), () => {
      this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }), this.updateScrollWidth(), this.scrollableElementUpdateDisposable = null;
    }));
  }
  eventuallyUpdateScrollWidth() {
    if (!this.horizontalScrolling) {
      this.scrollableElementWidthDelayer.cancel();
      return;
    }
    this.scrollableElementWidthDelayer.trigger(() => this.updateScrollWidth());
  }
  updateScrollWidth() {
    if (!this.horizontalScrolling)
      return;
    let e = 0;
    for (const t of this.items)
      typeof t.width < "u" && (e = Math.max(e, t.width));
    this.scrollWidth = e, this.scrollableElement.setScrollDimensions({ scrollWidth: e === 0 ? 0 : e + 10 }), this._onDidChangeContentWidth.fire(this.scrollWidth);
  }
  rerender() {
    if (this.supportDynamicHeights) {
      for (const e of this.items)
        e.lastDynamicHeightWidth = void 0;
      this._rerender(this.lastRenderTop, this.lastRenderHeight);
    }
  }
  get length() {
    return this.items.length;
  }
  get renderHeight() {
    return this.scrollableElement.getScrollDimensions().height;
  }
  get firstVisibleIndex() {
    return this.getVisibleRange(this.lastRenderTop, this.lastRenderHeight).start;
  }
  element(e) {
    return this.items[e].element;
  }
  indexOf(e) {
    return this.items.findIndex((t) => t.element === e);
  }
  domElement(e) {
    const t = this.items[e].row;
    return t && t.domNode;
  }
  elementHeight(e) {
    return this.items[e].size;
  }
  elementTop(e) {
    return this.rangeMap.positionAt(e);
  }
  indexAt(e) {
    return this.rangeMap.indexAt(e);
  }
  indexAfter(e) {
    return this.rangeMap.indexAfter(e);
  }
  layout(e, t) {
    const n = {
      height: typeof e == "number" ? e : Fit(this.domNode)
    };
    this.scrollableElementUpdateDisposable && (this.scrollableElementUpdateDisposable.dispose(), this.scrollableElementUpdateDisposable = null, n.scrollHeight = this.scrollHeight), this.scrollableElement.setScrollDimensions(n), typeof t < "u" && (this.renderWidth = t, this.supportDynamicHeights && this._rerender(this.scrollTop, this.renderHeight)), this.horizontalScrolling && this.scrollableElement.setScrollDimensions({
      width: typeof t == "number" ? t : WJ(this.domNode)
    });
  }
  // Render
  render(e, t, n, r, s, o = !1, a = !1) {
    const l = this.getRenderRange(t, n), c = Ul.relativeComplement(l, e).reverse(), u = Ul.relativeComplement(e, l);
    if (o) {
      const d = Ul.intersect(e, l);
      for (let h = d.start; h < d.end; h++)
        this.updateItemInDOM(this.items[h], h);
    }
    this.cache.transact(() => {
      for (const d of u)
        for (let h = d.start; h < d.end; h++)
          this.removeItemFromDOM(h, a);
      for (const d of c)
        for (let h = d.end - 1; h >= d.start; h--)
          this.insertItemInDOM(h);
    }), r !== void 0 && (this.rowsContainer.style.left = `-${r}px`), this.rowsContainer.style.top = `-${t}px`, this.horizontalScrolling && s !== void 0 && (this.rowsContainer.style.width = `${Math.max(s, this.renderWidth)}px`), this.lastRenderTop = t, this.lastRenderHeight = n;
  }
  // DOM operations
  insertItemInDOM(e, t) {
    var l, c;
    const n = this.items[e];
    if (!n.row)
      if (t)
        n.row = t, n.stale = !0;
      else {
        const u = this.cache.alloc(n.templateId);
        n.row = u.row, n.stale || (n.stale = u.isReusingConnectedDomNode);
      }
    const r = this.accessibilityProvider.getRole(n.element) || "listitem";
    n.row.domNode.setAttribute("role", r);
    const s = this.accessibilityProvider.isChecked(n.element);
    if (typeof s == "boolean")
      n.row.domNode.setAttribute("aria-checked", String(!!s));
    else if (s) {
      const u = (d) => n.row.domNode.setAttribute("aria-checked", String(!!d));
      u(s.value), n.checkedDisposable = s.onDidChange(() => u(s.value));
    }
    if (n.stale || !n.row.domNode.parentElement) {
      const u = ((c = (l = this.items.at(e + 1)) == null ? void 0 : l.row) == null ? void 0 : c.domNode) ?? null;
      (n.row.domNode.parentElement !== this.rowsContainer || n.row.domNode.nextElementSibling !== u) && this.rowsContainer.insertBefore(n.row.domNode, u), n.stale = !1;
    }
    this.updateItemInDOM(n, e);
    const o = this.renderers.get(n.templateId);
    if (!o)
      throw new Error(`No renderer found for template id ${n.templateId}`);
    o == null || o.renderElement(n.element, e, n.row.templateData, { height: n.size });
    const a = this.dnd.getDragURI(n.element);
    n.dragStartDisposable.dispose(), n.row.domNode.draggable = !!a, a && (n.dragStartDisposable = Ce(n.row.domNode, "dragstart", (u) => this.onDragStart(n.element, a, u))), this.horizontalScrolling && (this.measureItemWidth(n), this.eventuallyUpdateScrollWidth());
  }
  measureItemWidth(e) {
    if (!e.row || !e.row.domNode)
      return;
    e.row.domNode.style.width = "fit-content", e.width = WJ(e.row.domNode);
    const t = At(e.row.domNode).getComputedStyle(e.row.domNode);
    t.paddingLeft && (e.width += parseFloat(t.paddingLeft)), t.paddingRight && (e.width += parseFloat(t.paddingRight)), e.row.domNode.style.width = "";
  }
  updateItemInDOM(e, t) {
    e.row.domNode.style.top = `${this.elementTop(t)}px`, this.setRowHeight && (e.row.domNode.style.height = `${e.size}px`), this.setRowLineHeight && (e.row.domNode.style.lineHeight = `${e.size}px`), e.row.domNode.setAttribute("data-index", `${t}`), e.row.domNode.setAttribute("data-last-element", t === this.length - 1 ? "true" : "false"), e.row.domNode.setAttribute("data-parity", t % 2 === 0 ? "even" : "odd"), e.row.domNode.setAttribute("aria-setsize", String(this.accessibilityProvider.getSetSize(e.element, t, this.length))), e.row.domNode.setAttribute("aria-posinset", String(this.accessibilityProvider.getPosInSet(e.element, t))), e.row.domNode.setAttribute("id", this.getElementDomId(t)), e.row.domNode.classList.toggle("drop-target", e.dropTarget);
  }
  removeItemFromDOM(e, t) {
    const n = this.items[e];
    if (n.dragStartDisposable.dispose(), n.checkedDisposable.dispose(), n.row) {
      const r = this.renderers.get(n.templateId);
      r && r.disposeElement && r.disposeElement(n.element, e, n.row.templateData, { height: n.size, onScroll: t }), this.cache.release(n.row), n.row = null;
    }
    this.horizontalScrolling && this.eventuallyUpdateScrollWidth();
  }
  getScrollTop() {
    return this.scrollableElement.getScrollPosition().scrollTop;
  }
  setScrollTop(e, t) {
    this.scrollableElementUpdateDisposable && (this.scrollableElementUpdateDisposable.dispose(), this.scrollableElementUpdateDisposable = null, this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight })), this.scrollableElement.setScrollPosition({ scrollTop: e, reuseAnimation: t });
  }
  get scrollTop() {
    return this.getScrollTop();
  }
  set scrollTop(e) {
    this.setScrollTop(e);
  }
  get scrollHeight() {
    return this._scrollHeight + (this.horizontalScrolling ? 10 : 0) + this.paddingBottom;
  }
  // Events
  get onMouseClick() {
    return Ze.map(this.disposables.add(new ir(this.domNode, "click")).event, (e) => this.toMouseEvent(e), this.disposables);
  }
  get onMouseDblClick() {
    return Ze.map(this.disposables.add(new ir(this.domNode, "dblclick")).event, (e) => this.toMouseEvent(e), this.disposables);
  }
  get onMouseMiddleClick() {
    return Ze.filter(Ze.map(this.disposables.add(new ir(this.domNode, "auxclick")).event, (e) => this.toMouseEvent(e), this.disposables), (e) => e.browserEvent.button === 1, this.disposables);
  }
  get onMouseDown() {
    return Ze.map(this.disposables.add(new ir(this.domNode, "mousedown")).event, (e) => this.toMouseEvent(e), this.disposables);
  }
  get onMouseOver() {
    return Ze.map(this.disposables.add(new ir(this.domNode, "mouseover")).event, (e) => this.toMouseEvent(e), this.disposables);
  }
  get onMouseOut() {
    return Ze.map(this.disposables.add(new ir(this.domNode, "mouseout")).event, (e) => this.toMouseEvent(e), this.disposables);
  }
  get onContextMenu() {
    return Ze.any(Ze.map(this.disposables.add(new ir(this.domNode, "contextmenu")).event, (e) => this.toMouseEvent(e), this.disposables), Ze.map(this.disposables.add(new ir(this.domNode, zr.Contextmenu)).event, (e) => this.toGestureEvent(e), this.disposables));
  }
  get onTouchStart() {
    return Ze.map(this.disposables.add(new ir(this.domNode, "touchstart")).event, (e) => this.toTouchEvent(e), this.disposables);
  }
  get onTap() {
    return Ze.map(this.disposables.add(new ir(this.rowsContainer, zr.Tap)).event, (e) => this.toGestureEvent(e), this.disposables);
  }
  toMouseEvent(e) {
    const t = this.getItemIndexFromEventTarget(e.target || null), n = typeof t > "u" ? void 0 : this.items[t], r = n && n.element;
    return { browserEvent: e, index: t, element: r };
  }
  toTouchEvent(e) {
    const t = this.getItemIndexFromEventTarget(e.target || null), n = typeof t > "u" ? void 0 : this.items[t], r = n && n.element;
    return { browserEvent: e, index: t, element: r };
  }
  toGestureEvent(e) {
    const t = this.getItemIndexFromEventTarget(e.initialTarget || null), n = typeof t > "u" ? void 0 : this.items[t], r = n && n.element;
    return { browserEvent: e, index: t, element: r };
  }
  toDragEvent(e) {
    const t = this.getItemIndexFromEventTarget(e.target || null), n = typeof t > "u" ? void 0 : this.items[t], r = n && n.element, s = this.getTargetSector(e, t);
    return { browserEvent: e, index: t, element: r, sector: s };
  }
  onScroll(e) {
    try {
      const t = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
      this.render(t, e.scrollTop, e.height, e.scrollLeft, e.scrollWidth, void 0, !0), this.supportDynamicHeights && this._rerender(e.scrollTop, e.height, e.inSmoothScrolling);
    } catch (t) {
      throw console.error("Got bad scroll event:", e), t;
    }
  }
  onTouchChange(e) {
    e.preventDefault(), e.stopPropagation(), this.scrollTop -= e.translationY;
  }
  // DND
  onDragStart(e, t, n) {
    var o, a;
    if (!n.dataTransfer)
      return;
    const r = this.dnd.getDragElements(e);
    n.dataTransfer.effectAllowed = "copyMove", n.dataTransfer.setData(dT.TEXT, t);
    let s;
    this.dnd.getDragLabel && (s = this.dnd.getDragLabel(r, n)), typeof s > "u" && (s = String(r.length)), Dbt(n, this.domNode, s, [
      this.domId
      /* add domId to get list specific styling */
    ]), this.domNode.classList.add("dragging"), this.currentDragData = new OB(r), uE.CurrentDragAndDropData = new Ibt(r), (a = (o = this.dnd).onDragStart) == null || a.call(o, this.currentDragData, n);
  }
  onPotentialSelectionStart(e) {
    this.currentSelectionDisposable.dispose();
    const t = kit(this.domNode), n = this.currentSelectionDisposable = new ke(), r = n.add(new ke());
    r.add(Ce(this.domNode, "selectstart", () => {
      r.add(Ce(t, "mousemove", (s) => {
        var o;
        ((o = t.getSelection()) == null ? void 0 : o.isCollapsed) === !1 && this.setupDragAndDropScrollTopAnimation(s);
      })), n.add(Et(() => {
        const s = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
        this.currentSelectionBounds = void 0, this.render(s, this.lastRenderTop, this.lastRenderHeight, void 0, void 0);
      })), n.add(Ce(t, "selectionchange", () => {
        const s = t.getSelection();
        if (!s || s.isCollapsed) {
          r.isDisposed && n.dispose();
          return;
        }
        let o = this.getIndexOfListElement(s.anchorNode), a = this.getIndexOfListElement(s.focusNode);
        o !== void 0 && a !== void 0 && (a < o && ([o, a] = [a, o]), this.currentSelectionBounds = { start: o, end: a });
      }));
    })), r.add(Ce(t, "mouseup", () => {
      var s;
      r.dispose(), this.teardownDragAndDropScrollTopAnimation(), ((s = t.getSelection()) == null ? void 0 : s.isCollapsed) !== !1 && n.dispose();
    }));
  }
  getIndexOfListElement(e) {
    var t;
    if (!(!e || !this.domNode.contains(e)))
      for (; e && e !== this.domNode; ) {
        if ((t = e.dataset) != null && t.index)
          return Number(e.dataset.index);
        e = e.parentElement;
      }
  }
  onDragOver(e) {
    var s, o;
    if (e.browserEvent.preventDefault(), this.onDragLeaveTimeout.dispose(), uE.CurrentDragAndDropData && uE.CurrentDragAndDropData.getData() === "vscode-ui" || (this.setupDragAndDropScrollTopAnimation(e.browserEvent), !e.browserEvent.dataTransfer))
      return !1;
    if (!this.currentDragData)
      if (uE.CurrentDragAndDropData)
        this.currentDragData = uE.CurrentDragAndDropData;
      else {
        if (!e.browserEvent.dataTransfer.types)
          return !1;
        this.currentDragData = new Nbt();
      }
    const t = this.dnd.onDragOver(this.currentDragData, e.element, e.index, e.sector, e.browserEvent);
    if (this.canDrop = typeof t == "boolean" ? t : t.accept, !this.canDrop)
      return this.currentDragFeedback = void 0, this.currentDragFeedbackDisposable.dispose(), !1;
    e.browserEvent.dataTransfer.dropEffect = typeof t != "boolean" && ((s = t.effect) == null ? void 0 : s.type) === 0 ? "copy" : "move";
    let n;
    typeof t != "boolean" && t.feedback ? n = t.feedback : typeof e.index > "u" ? n = [-1] : n = [e.index], n = qy(n).filter((a) => a >= -1 && a < this.length).sort((a, l) => a - l), n = n[0] === -1 ? [-1] : n;
    let r = typeof t != "boolean" && t.effect && t.effect.position ? t.effect.position : "drop-target";
    if (Rbt(this.currentDragFeedback, n) && this.currentDragFeedbackPosition === r)
      return !0;
    if (this.currentDragFeedback = n, this.currentDragFeedbackPosition = r, this.currentDragFeedbackDisposable.dispose(), n[0] === -1)
      this.domNode.classList.add(r), this.rowsContainer.classList.add(r), this.currentDragFeedbackDisposable = Et(() => {
        this.domNode.classList.remove(r), this.rowsContainer.classList.remove(r);
      });
    else {
      if (n.length > 1 && r !== "drop-target")
        throw new Error("Can't use multiple feedbacks with position different than 'over'");
      r === "drop-target-after" && n[0] < this.length - 1 && (n[0] += 1, r = "drop-target-before");
      for (const a of n) {
        const l = this.items[a];
        l.dropTarget = !0, (o = l.row) == null || o.domNode.classList.add(r);
      }
      this.currentDragFeedbackDisposable = Et(() => {
        var a;
        for (const l of n) {
          const c = this.items[l];
          c.dropTarget = !1, (a = c.row) == null || a.domNode.classList.remove(r);
        }
      });
    }
    return !0;
  }
  onDragLeave(e) {
    var t, n;
    this.onDragLeaveTimeout.dispose(), this.onDragLeaveTimeout = jy(() => this.clearDragOverFeedback(), 100, this.disposables), this.currentDragData && ((n = (t = this.dnd).onDragLeave) == null || n.call(t, this.currentDragData, e.element, e.index, e.browserEvent));
  }
  onDrop(e) {
    if (!this.canDrop)
      return;
    const t = this.currentDragData;
    this.teardownDragAndDropScrollTopAnimation(), this.clearDragOverFeedback(), this.domNode.classList.remove("dragging"), this.currentDragData = void 0, uE.CurrentDragAndDropData = void 0, !(!t || !e.browserEvent.dataTransfer) && (e.browserEvent.preventDefault(), t.update(e.browserEvent.dataTransfer), this.dnd.drop(t, e.element, e.index, e.sector, e.browserEvent));
  }
  onDragEnd(e) {
    var t, n;
    this.canDrop = !1, this.teardownDragAndDropScrollTopAnimation(), this.clearDragOverFeedback(), this.domNode.classList.remove("dragging"), this.currentDragData = void 0, uE.CurrentDragAndDropData = void 0, (n = (t = this.dnd).onDragEnd) == null || n.call(t, e);
  }
  clearDragOverFeedback() {
    this.currentDragFeedback = void 0, this.currentDragFeedbackPosition = void 0, this.currentDragFeedbackDisposable.dispose(), this.currentDragFeedbackDisposable = ge.None;
  }
  // DND scroll top animation
  setupDragAndDropScrollTopAnimation(e) {
    if (!this.dragOverAnimationDisposable) {
      const t = kPe(this.domNode).top;
      this.dragOverAnimationDisposable = qit(At(this.domNode), this.animateDragAndDropScrollTop.bind(this, t));
    }
    this.dragOverAnimationStopDisposable.dispose(), this.dragOverAnimationStopDisposable = jy(() => {
      this.dragOverAnimationDisposable && (this.dragOverAnimationDisposable.dispose(), this.dragOverAnimationDisposable = void 0);
    }, 1e3, this.disposables), this.dragOverMouseY = e.pageY;
  }
  animateDragAndDropScrollTop(e) {
    if (this.dragOverMouseY === void 0)
      return;
    const t = this.dragOverMouseY - e, n = this.renderHeight - 35;
    t < 35 ? this.scrollTop += Math.max(-14, Math.floor(0.3 * (t - 35))) : t > n && (this.scrollTop += Math.min(14, Math.floor(0.3 * (t - n))));
  }
  teardownDragAndDropScrollTopAnimation() {
    this.dragOverAnimationStopDisposable.dispose(), this.dragOverAnimationDisposable && (this.dragOverAnimationDisposable.dispose(), this.dragOverAnimationDisposable = void 0);
  }
  // Util
  getTargetSector(e, t) {
    if (t === void 0)
      return;
    const n = e.offsetY / this.items[t].size, r = Math.floor(n / 0.25);
    return Jc(r, 0, 3);
  }
  getItemIndexFromEventTarget(e) {
    const t = this.scrollableElement.getDomNode();
    let n = e;
    for (; (eo(n) || RPe(n)) && n !== this.rowsContainer && t.contains(n); ) {
      const r = n.getAttribute("data-index");
      if (r) {
        const s = Number(r);
        if (!isNaN(s))
          return s;
      }
      n = n.parentElement;
    }
  }
  getVisibleRange(e, t) {
    return {
      start: this.rangeMap.indexAt(e),
      end: this.rangeMap.indexAfter(e + t - 1)
    };
  }
  getRenderRange(e, t) {
    const n = this.getVisibleRange(e, t);
    if (this.currentSelectionBounds) {
      const r = this.rangeMap.count;
      n.start = Math.min(n.start, this.currentSelectionBounds.start, r), n.end = Math.min(Math.max(n.end, this.currentSelectionBounds.end + 1), r);
    }
    return n;
  }
  /**
   * Given a stable rendered state, checks every rendered element whether it needs
   * to be probed for dynamic height. Adjusts scroll height and top if necessary.
   */
  _rerender(e, t, n) {
    const r = this.getRenderRange(e, t);
    let s, o;
    e === this.elementTop(r.start) ? (s = r.start, o = 0) : r.end - r.start > 1 && (s = r.start + 1, o = this.elementTop(s) - e);
    let a = 0;
    for (; ; ) {
      const l = this.getRenderRange(e, t);
      let c = !1;
      for (let u = l.start; u < l.end; u++) {
        const d = this.probeDynamicHeight(u);
        d !== 0 && this.rangeMap.splice(u, 1, [this.items[u]]), a += d, c = c || d !== 0;
      }
      if (!c) {
        a !== 0 && this.eventuallyUpdateScrollDimensions();
        const u = Ul.relativeComplement(r, l);
        for (const h of u)
          for (let g = h.start; g < h.end; g++)
            this.items[g].row && this.removeItemFromDOM(g);
        const d = Ul.relativeComplement(l, r).reverse();
        for (const h of d)
          for (let g = h.end - 1; g >= h.start; g--)
            this.insertItemInDOM(g);
        for (let h = l.start; h < l.end; h++)
          this.items[h].row && this.updateItemInDOM(this.items[h], h);
        if (typeof s == "number") {
          const h = this.scrollable.getFutureScrollPosition().scrollTop - e, g = this.elementTop(s) - o + h;
          this.setScrollTop(g, n);
        }
        this._onDidChangeContentHeight.fire(this.contentHeight);
        return;
      }
    }
  }
  probeDynamicHeight(e) {
    var o, a, l;
    const t = this.items[e];
    if (this.virtualDelegate.getDynamicHeight) {
      const c = this.virtualDelegate.getDynamicHeight(t.element);
      if (c !== null) {
        const u = t.size;
        return t.size = c, t.lastDynamicHeightWidth = this.renderWidth, c - u;
      }
    }
    if (!t.hasDynamicHeight || t.lastDynamicHeightWidth === this.renderWidth || this.virtualDelegate.hasDynamicHeight && !this.virtualDelegate.hasDynamicHeight(t.element))
      return 0;
    const n = t.size;
    if (t.row)
      return t.row.domNode.style.height = "", t.size = t.row.domNode.offsetHeight, t.size === 0 && !pa(t.row.domNode, At(t.row.domNode).document.body) && console.warn("Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!", new Error().stack), t.lastDynamicHeightWidth = this.renderWidth, t.size - n;
    const { row: r } = this.cache.alloc(t.templateId);
    r.domNode.style.height = "", this.rowsContainer.appendChild(r.domNode);
    const s = this.renderers.get(t.templateId);
    if (!s)
      throw new Wt("Missing renderer for templateId: " + t.templateId);
    return s.renderElement(t.element, e, r.templateData), t.size = r.domNode.offsetHeight, (o = s.disposeElement) == null || o.call(s, t.element, e, r.templateData), (l = (a = this.virtualDelegate).setDynamicHeight) == null || l.call(a, t.element, t.size), t.lastDynamicHeightWidth = this.renderWidth, r.domNode.remove(), this.cache.release(r), t.size - n;
  }
  getElementDomId(e) {
    return `${this.domId}_${e}`;
  }
  // Dispose
  dispose() {
    var e, t, n;
    for (const r of this.items)
      if (r.dragStartDisposable.dispose(), r.checkedDisposable.dispose(), r.row) {
        const s = this.renderers.get(r.row.templateId);
        s && ((e = s.disposeElement) == null || e.call(s, r.element, -1, r.row.templateData, void 0), s.disposeTemplate(r.row.templateData));
      }
    this.items = [], (t = this.domNode) == null || t.remove(), (n = this.dragOverAnimationDisposable) == null || n.dispose(), this.disposables.dispose();
  }
};
Xj.InstanceCount = 0;
let qg = Xj;
f0([
  go
], qg.prototype, "onMouseClick", null);
f0([
  go
], qg.prototype, "onMouseDblClick", null);
f0([
  go
], qg.prototype, "onMouseMiddleClick", null);
f0([
  go
], qg.prototype, "onMouseDown", null);
f0([
  go
], qg.prototype, "onMouseOver", null);
f0([
  go
], qg.prototype, "onMouseOut", null);
f0([
  go
], qg.prototype, "onContextMenu", null);
f0([
  go
], qg.prototype, "onTouchStart", null);
f0([
  go
], qg.prototype, "onTap", null);
var Lw = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
};
class Obt {
  constructor(e) {
    this.trait = e, this.renderedElements = [];
  }
  get templateId() {
    return `template:${this.trait.name}`;
  }
  renderTemplate(e) {
    return e;
  }
  renderElement(e, t, n) {
    const r = this.renderedElements.findIndex((s) => s.templateData === n);
    if (r >= 0) {
      const s = this.renderedElements[r];
      this.trait.unrender(n), s.index = t;
    } else {
      const s = { index: t, templateData: n };
      this.renderedElements.push(s);
    }
    this.trait.renderIndex(t, n);
  }
  splice(e, t, n) {
    const r = [];
    for (const s of this.renderedElements)
      s.index < e ? r.push(s) : s.index >= e + t && r.push({
        index: s.index + n - t,
        templateData: s.templateData
      });
    this.renderedElements = r;
  }
  renderIndexes(e) {
    for (const { index: t, templateData: n } of this.renderedElements)
      e.indexOf(t) > -1 && this.trait.renderIndex(t, n);
  }
  disposeTemplate(e) {
    const t = this.renderedElements.findIndex((n) => n.templateData === e);
    t < 0 || this.renderedElements.splice(t, 1);
  }
}
let DU = class {
  get onChange() {
    return this._onChange.event;
  }
  get name() {
    return this._trait;
  }
  get renderer() {
    return new Obt(this);
  }
  constructor(e) {
    this._trait = e, this.indexes = [], this.sortedIndexes = [], this._onChange = new he();
  }
  splice(e, t, n) {
    const r = n.length - t, s = e + t, o = [];
    let a = 0;
    for (; a < this.sortedIndexes.length && this.sortedIndexes[a] < e; )
      o.push(this.sortedIndexes[a++]);
    for (let l = 0; l < n.length; l++)
      n[l] && o.push(l + e);
    for (; a < this.sortedIndexes.length && this.sortedIndexes[a] >= s; )
      o.push(this.sortedIndexes[a++] + r);
    this.renderer.splice(e, t, n.length), this._set(o, o);
  }
  renderIndex(e, t) {
    t.classList.toggle(this._trait, this.contains(e));
  }
  unrender(e) {
    e.classList.remove(this._trait);
  }
  /**
   * Sets the indexes which should have this trait.
   *
   * @param indexes Indexes which should have this trait.
   * @return The old indexes which had this trait.
   */
  set(e, t) {
    return this._set(e, [...e].sort(wke), t);
  }
  _set(e, t, n) {
    const r = this.indexes, s = this.sortedIndexes;
    this.indexes = e, this.sortedIndexes = t;
    const o = Jre(s, e);
    return this.renderer.renderIndexes(o), this._onChange.fire({ indexes: e, browserEvent: n }), r;
  }
  get() {
    return this.indexes;
  }
  contains(e) {
    return AV(this.sortedIndexes, e, wke) >= 0;
  }
  dispose() {
    or(this._onChange);
  }
};
Lw([
  go
], DU.prototype, "renderer", null);
class Mbt extends DU {
  constructor(e) {
    super("selected"), this.setAriaSelected = e;
  }
  renderIndex(e, t) {
    super.renderIndex(e, t), this.setAriaSelected && (this.contains(e) ? t.setAttribute("aria-selected", "true") : t.setAttribute("aria-selected", "false"));
  }
}
class Pee {
  constructor(e, t, n) {
    this.trait = e, this.view = t, this.identityProvider = n;
  }
  splice(e, t, n) {
    if (!this.identityProvider)
      return this.trait.splice(e, t, new Array(n.length).fill(!1));
    const r = this.trait.get().map((a) => this.identityProvider.getId(this.view.element(a)).toString());
    if (r.length === 0)
      return this.trait.splice(e, t, new Array(n.length).fill(!1));
    const s = new Set(r), o = n.map((a) => s.has(this.identityProvider.getId(a).toString()));
    this.trait.splice(e, t, o);
  }
}
function MB(i, e) {
  return i.classList.contains(e) ? !0 : i.classList.contains("monaco-list") || !i.parentElement ? !1 : MB(i.parentElement, e);
}
function qP(i) {
  return MB(i, "monaco-editor");
}
function Pbt(i) {
  return MB(i, "monaco-custom-toggle");
}
function Fbt(i) {
  return MB(i, "action-item");
}
function VF(i) {
  return MB(i, "monaco-tree-sticky-row");
}
function z4(i) {
  return i.classList.contains("monaco-tree-sticky-container");
}
function n5e(i) {
  return i.tagName === "A" && i.classList.contains("monaco-button") || i.tagName === "DIV" && i.classList.contains("monaco-button-dropdown") ? !0 : i.classList.contains("monaco-list") || !i.parentElement ? !1 : n5e(i.parentElement);
}
class i5e {
  get onKeyDown() {
    return Ze.chain(this.disposables.add(new ir(this.view.domNode, "keydown")).event, (e) => e.filter((t) => !sm(t.target)).map((t) => new wr(t)));
  }
  constructor(e, t, n) {
    this.list = e, this.view = t, this.disposables = new ke(), this.multipleSelectionDisposables = new ke(), this.multipleSelectionSupport = n.multipleSelectionSupport, this.disposables.add(this.onKeyDown((r) => {
      switch (r.keyCode) {
        case 3:
          return this.onEnter(r);
        case 16:
          return this.onUpArrow(r);
        case 18:
          return this.onDownArrow(r);
        case 11:
          return this.onPageUpArrow(r);
        case 12:
          return this.onPageDownArrow(r);
        case 9:
          return this.onEscape(r);
        case 31:
          this.multipleSelectionSupport && (Kn ? r.metaKey : r.ctrlKey) && this.onCtrlA(r);
      }
    }));
  }
  updateOptions(e) {
    e.multipleSelectionSupport !== void 0 && (this.multipleSelectionSupport = e.multipleSelectionSupport);
  }
  onEnter(e) {
    e.preventDefault(), e.stopPropagation(), this.list.setSelection(this.list.getFocus(), e.browserEvent);
  }
  onUpArrow(e) {
    e.preventDefault(), e.stopPropagation(), this.list.focusPrevious(1, !1, e.browserEvent);
    const t = this.list.getFocus()[0];
    this.list.setAnchor(t), this.list.reveal(t), this.view.domNode.focus();
  }
  onDownArrow(e) {
    e.preventDefault(), e.stopPropagation(), this.list.focusNext(1, !1, e.browserEvent);
    const t = this.list.getFocus()[0];
    this.list.setAnchor(t), this.list.reveal(t), this.view.domNode.focus();
  }
  onPageUpArrow(e) {
    e.preventDefault(), e.stopPropagation(), this.list.focusPreviousPage(e.browserEvent);
    const t = this.list.getFocus()[0];
    this.list.setAnchor(t), this.list.reveal(t), this.view.domNode.focus();
  }
  onPageDownArrow(e) {
    e.preventDefault(), e.stopPropagation(), this.list.focusNextPage(e.browserEvent);
    const t = this.list.getFocus()[0];
    this.list.setAnchor(t), this.list.reveal(t), this.view.domNode.focus();
  }
  onCtrlA(e) {
    e.preventDefault(), e.stopPropagation(), this.list.setSelection(Hu(this.list.length), e.browserEvent), this.list.setAnchor(void 0), this.view.domNode.focus();
  }
  onEscape(e) {
    this.list.getSelection().length && (e.preventDefault(), e.stopPropagation(), this.list.setSelection([], e.browserEvent), this.list.setAnchor(void 0), this.view.domNode.focus());
  }
  dispose() {
    this.disposables.dispose(), this.multipleSelectionDisposables.dispose();
  }
}
Lw([
  go
], i5e.prototype, "onKeyDown", null);
var G_;
(function(i) {
  i[i.Automatic = 0] = "Automatic", i[i.Trigger = 1] = "Trigger";
})(G_ || (G_ = {}));
var dN;
(function(i) {
  i[i.Idle = 0] = "Idle", i[i.Typing = 1] = "Typing";
})(dN || (dN = {}));
const Bbt = new class {
  mightProducePrintableCharacter(i) {
    return i.ctrlKey || i.metaKey || i.altKey ? !1 : i.keyCode >= 31 && i.keyCode <= 56 || i.keyCode >= 21 && i.keyCode <= 30 || i.keyCode >= 98 && i.keyCode <= 107 || i.keyCode >= 85 && i.keyCode <= 95;
  }
}();
class Hbt {
  constructor(e, t, n, r, s) {
    this.list = e, this.view = t, this.keyboardNavigationLabelProvider = n, this.keyboardNavigationEventFilter = r, this.delegate = s, this.enabled = !1, this.state = dN.Idle, this.mode = G_.Automatic, this.triggered = !1, this.previouslyFocused = -1, this.enabledDisposables = new ke(), this.disposables = new ke(), this.updateOptions(e.options);
  }
  updateOptions(e) {
    e.typeNavigationEnabled ?? !0 ? this.enable() : this.disable(), this.mode = e.typeNavigationMode ?? G_.Automatic;
  }
  enable() {
    if (this.enabled)
      return;
    let e = !1;
    const t = Ze.chain(this.enabledDisposables.add(new ir(this.view.domNode, "keydown")).event, (s) => s.filter((o) => !sm(o.target)).filter(() => this.mode === G_.Automatic || this.triggered).map((o) => new wr(o)).filter((o) => e || this.keyboardNavigationEventFilter(o)).filter((o) => this.delegate.mightProducePrintableCharacter(o)).forEach((o) => Mi.stop(o, !0)).map((o) => o.browserEvent.key)), n = Ze.debounce(t, () => null, 800, void 0, void 0, void 0, this.enabledDisposables);
    Ze.reduce(Ze.any(t, n), (s, o) => o === null ? null : (s || "") + o, void 0, this.enabledDisposables)(this.onInput, this, this.enabledDisposables), n(this.onClear, this, this.enabledDisposables), t(() => e = !0, void 0, this.enabledDisposables), n(() => e = !1, void 0, this.enabledDisposables), this.enabled = !0, this.triggered = !1;
  }
  disable() {
    this.enabled && (this.enabledDisposables.clear(), this.enabled = !1, this.triggered = !1);
  }
  onClear() {
    var t;
    const e = this.list.getFocus();
    if (e.length > 0 && e[0] === this.previouslyFocused) {
      const n = (t = this.list.options.accessibilityProvider) == null ? void 0 : t.getAriaLabel(this.list.element(e[0]));
      typeof n == "string" ? lu(n) : n && lu(n.get());
    }
    this.previouslyFocused = -1;
  }
  onInput(e) {
    if (!e) {
      this.state = dN.Idle, this.triggered = !1;
      return;
    }
    const t = this.list.getFocus(), n = t.length > 0 ? t[0] : 0, r = this.state === dN.Idle ? 1 : 0;
    this.state = dN.Typing;
    for (let s = 0; s < this.list.length; s++) {
      const o = (n + s + r) % this.list.length, a = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(o)), l = a && a.toString();
      if (this.list.options.typeNavigationEnabled) {
        if (typeof l < "u") {
          if (B4(e, l)) {
            this.previouslyFocused = n, this.list.setFocus([o]), this.list.reveal(o);
            return;
          }
          const c = Lmt(e, l);
          if (c && c[0].end - c[0].start > 1 && c.length === 1) {
            this.previouslyFocused = n, this.list.setFocus([o]), this.list.reveal(o);
            return;
          }
        }
      } else if (typeof l > "u" || B4(e, l)) {
        this.previouslyFocused = n, this.list.setFocus([o]), this.list.reveal(o);
        return;
      }
    }
  }
  dispose() {
    this.disable(), this.enabledDisposables.dispose(), this.disposables.dispose();
  }
}
class Wbt {
  constructor(e, t) {
    this.list = e, this.view = t, this.disposables = new ke();
    const n = Ze.chain(this.disposables.add(new ir(t.domNode, "keydown")).event, (s) => s.filter((o) => !sm(o.target)).map((o) => new wr(o)));
    Ze.chain(n, (s) => s.filter((o) => o.keyCode === 2 && !o.ctrlKey && !o.metaKey && !o.shiftKey && !o.altKey))(this.onTab, this, this.disposables);
  }
  onTab(e) {
    if (e.target !== this.view.domNode)
      return;
    const t = this.list.getFocus();
    if (t.length === 0)
      return;
    const n = this.view.domElement(t[0]);
    if (!n)
      return;
    const r = n.querySelector("[tabIndex]");
    if (!r || !eo(r) || r.tabIndex === -1)
      return;
    const s = At(r).getComputedStyle(r);
    s.visibility === "hidden" || s.display === "none" || (e.preventDefault(), e.stopPropagation(), r.focus());
  }
  dispose() {
    this.disposables.dispose();
  }
}
function r5e(i) {
  return Kn ? i.browserEvent.metaKey : i.browserEvent.ctrlKey;
}
function s5e(i) {
  return i.browserEvent.shiftKey;
}
function Vbt(i) {
  return Jhe(i) && i.button === 2;
}
const Cke = {
  isSelectionSingleChangeEvent: r5e,
  isSelectionRangeChangeEvent: s5e
};
class o5e {
  get onPointer() {
    return this._onPointer.event;
  }
  constructor(e) {
    this.list = e, this.disposables = new ke(), this._onPointer = this.disposables.add(new he()), e.options.multipleSelectionSupport !== !1 && (this.multipleSelectionController = this.list.options.multipleSelectionController || Cke), this.mouseSupport = typeof e.options.mouseSupport > "u" || !!e.options.mouseSupport, this.mouseSupport && (e.onMouseDown(this.onMouseDown, this, this.disposables), e.onContextMenu(this.onContextMenu, this, this.disposables), e.onMouseDblClick(this.onDoubleClick, this, this.disposables), e.onTouchStart(this.onMouseDown, this, this.disposables), this.disposables.add(ec.addTarget(e.getHTMLElement()))), Ze.any(e.onMouseClick, e.onMouseMiddleClick, e.onTap)(this.onViewPointer, this, this.disposables);
  }
  updateOptions(e) {
    e.multipleSelectionSupport !== void 0 && (this.multipleSelectionController = void 0, e.multipleSelectionSupport && (this.multipleSelectionController = this.list.options.multipleSelectionController || Cke));
  }
  isSelectionSingleChangeEvent(e) {
    return this.multipleSelectionController ? this.multipleSelectionController.isSelectionSingleChangeEvent(e) : !1;
  }
  isSelectionRangeChangeEvent(e) {
    return this.multipleSelectionController ? this.multipleSelectionController.isSelectionRangeChangeEvent(e) : !1;
  }
  isSelectionChangeEvent(e) {
    return this.isSelectionSingleChangeEvent(e) || this.isSelectionRangeChangeEvent(e);
  }
  onMouseDown(e) {
    qP(e.browserEvent.target) || ea() !== e.browserEvent.target && this.list.domFocus();
  }
  onContextMenu(e) {
    if (sm(e.browserEvent.target) || qP(e.browserEvent.target))
      return;
    const t = typeof e.index > "u" ? [] : [e.index];
    this.list.setFocus(t, e.browserEvent);
  }
  onViewPointer(e) {
    if (!this.mouseSupport || sm(e.browserEvent.target) || qP(e.browserEvent.target) || e.browserEvent.isHandledByList)
      return;
    e.browserEvent.isHandledByList = !0;
    const t = e.index;
    if (typeof t > "u") {
      this.list.setFocus([], e.browserEvent), this.list.setSelection([], e.browserEvent), this.list.setAnchor(void 0);
      return;
    }
    if (this.isSelectionChangeEvent(e))
      return this.changeSelection(e);
    this.list.setFocus([t], e.browserEvent), this.list.setAnchor(t), Vbt(e.browserEvent) || this.list.setSelection([t], e.browserEvent), this._onPointer.fire(e);
  }
  onDoubleClick(e) {
    if (sm(e.browserEvent.target) || qP(e.browserEvent.target) || this.isSelectionChangeEvent(e) || e.browserEvent.isHandledByList)
      return;
    e.browserEvent.isHandledByList = !0;
    const t = this.list.getFocus();
    this.list.setSelection(t, e.browserEvent);
  }
  changeSelection(e) {
    const t = e.index;
    let n = this.list.getAnchor();
    if (this.isSelectionRangeChangeEvent(e)) {
      typeof n > "u" && (n = this.list.getFocus()[0] ?? t, this.list.setAnchor(n));
      const r = Math.min(n, t), s = Math.max(n, t), o = Hu(r, s + 1), a = this.list.getSelection(), l = jbt(Jre(a, [n]), n);
      if (l.length === 0)
        return;
      const c = Jre(o, Gbt(a, l));
      this.list.setSelection(c, e.browserEvent), this.list.setFocus([t], e.browserEvent);
    } else if (this.isSelectionSingleChangeEvent(e)) {
      const r = this.list.getSelection(), s = r.filter((o) => o !== t);
      this.list.setFocus([t]), this.list.setAnchor(t), r.length === s.length ? this.list.setSelection([...s, t], e.browserEvent) : this.list.setSelection(s, e.browserEvent);
    }
  }
  dispose() {
    this.disposables.dispose();
  }
}
class Ubt {
  constructor(e, t) {
    this.styleElement = e, this.selectorSuffix = t;
  }
  style(e) {
    const t = this.selectorSuffix && `.${this.selectorSuffix}`, n = [];
    e.listBackground && n.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`), e.listFocusBackground && (n.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`), n.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)), e.listFocusForeground && n.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`), e.listActiveSelectionBackground && (n.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`), n.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)), e.listActiveSelectionForeground && n.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`), e.listActiveSelectionIconForeground && n.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`), e.listFocusAndSelectionBackground && n.push(`
				.monaco-drag-image${t},
				.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
			`), e.listFocusAndSelectionForeground && n.push(`
				.monaco-drag-image${t},
				.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
			`), e.listInactiveFocusForeground && (n.push(`.monaco-list${t} .monaco-list-row.focused { color:  ${e.listInactiveFocusForeground}; }`), n.push(`.monaco-list${t} .monaco-list-row.focused:hover { color:  ${e.listInactiveFocusForeground}; }`)), e.listInactiveSelectionIconForeground && n.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color:  ${e.listInactiveSelectionIconForeground}; }`), e.listInactiveFocusBackground && (n.push(`.monaco-list${t} .monaco-list-row.focused { background-color:  ${e.listInactiveFocusBackground}; }`), n.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color:  ${e.listInactiveFocusBackground}; }`)), e.listInactiveSelectionBackground && (n.push(`.monaco-list${t} .monaco-list-row.selected { background-color:  ${e.listInactiveSelectionBackground}; }`), n.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color:  ${e.listInactiveSelectionBackground}; }`)), e.listInactiveSelectionForeground && n.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`), e.listHoverBackground && n.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`), e.listHoverForeground && n.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color:  ${e.listHoverForeground}; }`);
    const r = Py(e.listFocusAndSelectionOutline, Py(e.listSelectionOutline, e.listFocusOutline ?? ""));
    r && n.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`), e.listFocusOutline && n.push(`
				.monaco-drag-image${t},
				.monaco-list${t}:focus .monaco-list-row.focused,
				.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
			`);
    const s = Py(e.listSelectionOutline, e.listInactiveFocusOutline ?? "");
    s && n.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`), e.listSelectionOutline && n.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`), e.listInactiveFocusOutline && n.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`), e.listHoverOutline && n.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`), e.listDropOverBackground && n.push(`
				.monaco-list${t}.drop-target,
				.monaco-list${t} .monaco-list-rows.drop-target,
				.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }
			`), e.listDropBetweenBackground && (n.push(`
			.monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,
			.monaco-list${t} .monaco-list-row.drop-target-before::before {
				content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;
				background-color: ${e.listDropBetweenBackground};
			}`), n.push(`
			.monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,
			.monaco-list${t} .monaco-list-row.drop-target-after::after {
				content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;
				background-color: ${e.listDropBetweenBackground};
			}`)), e.tableColumnsBorder && n.push(`
				.monaco-table > .monaco-split-view2,
				.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
				.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,
				.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
					border-color: ${e.tableColumnsBorder};
				}

				.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,
				.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
					border-color: transparent;
				}
			`), e.tableOddRowsBackgroundColor && n.push(`
				.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
				.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
				.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
					background-color: ${e.tableOddRowsBackgroundColor};
				}
			`), this.styleElement.textContent = n.join(`
`);
  }
}
const zbt = {
  listFocusBackground: "#7FB0D0",
  listActiveSelectionBackground: "#0E639C",
  listActiveSelectionForeground: "#FFFFFF",
  listActiveSelectionIconForeground: "#FFFFFF",
  listFocusAndSelectionOutline: "#90C2F9",
  listFocusAndSelectionBackground: "#094771",
  listFocusAndSelectionForeground: "#FFFFFF",
  listInactiveSelectionBackground: "#3F3F46",
  listInactiveSelectionIconForeground: "#FFFFFF",
  listHoverBackground: "#2A2D2E",
  listDropOverBackground: "#383B3D",
  listDropBetweenBackground: "#EEEEEE",
  treeIndentGuidesStroke: "#a9a9a9",
  treeInactiveIndentGuidesStroke: De.fromHex("#a9a9a9").transparent(0.4).toString(),
  tableColumnsBorder: De.fromHex("#cccccc").transparent(0.2).toString(),
  tableOddRowsBackgroundColor: De.fromHex("#cccccc").transparent(0.04).toString(),
  listBackground: void 0,
  listFocusForeground: void 0,
  listInactiveSelectionForeground: void 0,
  listInactiveFocusForeground: void 0,
  listInactiveFocusBackground: void 0,
  listHoverForeground: void 0,
  listFocusOutline: void 0,
  listInactiveFocusOutline: void 0,
  listSelectionOutline: void 0,
  listHoverOutline: void 0,
  treeStickyScrollBackground: void 0,
  treeStickyScrollBorder: void 0,
  treeStickyScrollShadow: void 0
}, $bt = {
  keyboardSupport: !0,
  mouseSupport: !0,
  multipleSelectionSupport: !0,
  dnd: {
    getDragURI() {
      return null;
    },
    onDragStart() {
    },
    onDragOver() {
      return !1;
    },
    drop() {
    },
    dispose() {
    }
  }
};
function jbt(i, e) {
  const t = i.indexOf(e);
  if (t === -1)
    return [];
  const n = [];
  let r = t - 1;
  for (; r >= 0 && i[r] === e - (t - r); )
    n.push(i[r--]);
  for (n.reverse(), r = t; r < i.length && i[r] === e + (r - t); )
    n.push(i[r++]);
  return n;
}
function Jre(i, e) {
  const t = [];
  let n = 0, r = 0;
  for (; n < i.length || r < e.length; )
    if (n >= i.length)
      t.push(e[r++]);
    else if (r >= e.length)
      t.push(i[n++]);
    else if (i[n] === e[r]) {
      t.push(i[n]), n++, r++;
      continue;
    } else i[n] < e[r] ? t.push(i[n++]) : t.push(e[r++]);
  return t;
}
function Gbt(i, e) {
  const t = [];
  let n = 0, r = 0;
  for (; n < i.length || r < e.length; )
    if (n >= i.length)
      t.push(e[r++]);
    else if (r >= e.length)
      t.push(i[n++]);
    else if (i[n] === e[r]) {
      n++, r++;
      continue;
    } else i[n] < e[r] ? t.push(i[n++]) : r++;
  return t;
}
const wke = (i, e) => i - e;
class qbt {
  constructor(e, t) {
    this._templateId = e, this.renderers = t;
  }
  get templateId() {
    return this._templateId;
  }
  renderTemplate(e) {
    return this.renderers.map((t) => t.renderTemplate(e));
  }
  renderElement(e, t, n, r) {
    let s = 0;
    for (const o of this.renderers)
      o.renderElement(e, t, n[s++], r);
  }
  disposeElement(e, t, n, r) {
    var o;
    let s = 0;
    for (const a of this.renderers)
      (o = a.disposeElement) == null || o.call(a, e, t, n[s], r), s += 1;
  }
  disposeTemplate(e) {
    let t = 0;
    for (const n of this.renderers)
      n.disposeTemplate(e[t++]);
  }
}
class Kbt {
  constructor(e) {
    this.accessibilityProvider = e, this.templateId = "a18n";
  }
  renderTemplate(e) {
    return { container: e, disposables: new ke() };
  }
  renderElement(e, t, n) {
    const r = this.accessibilityProvider.getAriaLabel(e), s = r && typeof r != "string" ? r : Br(r);
    n.disposables.add(Xt((a) => {
      this.setAriaLabel(a.readObservable(s), n.container);
    }));
    const o = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(e);
    typeof o == "number" ? n.container.setAttribute("aria-level", `${o}`) : n.container.removeAttribute("aria-level");
  }
  setAriaLabel(e, t) {
    e ? t.setAttribute("aria-label", e) : t.removeAttribute("aria-label");
  }
  disposeElement(e, t, n) {
    n.disposables.clear();
  }
  disposeTemplate(e) {
    e.disposables.dispose();
  }
}
class Ybt {
  constructor(e, t) {
    this.list = e, this.dnd = t;
  }
  getDragElements(e) {
    const t = this.list.getSelectedElements();
    return t.indexOf(e) > -1 ? t : [e];
  }
  getDragURI(e) {
    return this.dnd.getDragURI(e);
  }
  getDragLabel(e, t) {
    if (this.dnd.getDragLabel)
      return this.dnd.getDragLabel(e, t);
  }
  onDragStart(e, t) {
    var n, r;
    (r = (n = this.dnd).onDragStart) == null || r.call(n, e, t);
  }
  onDragOver(e, t, n, r, s) {
    return this.dnd.onDragOver(e, t, n, r, s);
  }
  onDragLeave(e, t, n, r) {
    var s, o;
    (o = (s = this.dnd).onDragLeave) == null || o.call(s, e, t, n, r);
  }
  onDragEnd(e) {
    var t, n;
    (n = (t = this.dnd).onDragEnd) == null || n.call(t, e);
  }
  drop(e, t, n, r, s) {
    this.dnd.drop(e, t, n, r, s);
  }
  dispose() {
    this.dnd.dispose();
  }
}
class Zh {
  get onDidChangeFocus() {
    return Ze.map(this.eventBufferer.wrapEvent(this.focus.onChange), (e) => this.toListEvent(e), this.disposables);
  }
  get onDidChangeSelection() {
    return Ze.map(this.eventBufferer.wrapEvent(this.selection.onChange), (e) => this.toListEvent(e), this.disposables);
  }
  get domId() {
    return this.view.domId;
  }
  get onDidScroll() {
    return this.view.onDidScroll;
  }
  get onMouseClick() {
    return this.view.onMouseClick;
  }
  get onMouseDblClick() {
    return this.view.onMouseDblClick;
  }
  get onMouseMiddleClick() {
    return this.view.onMouseMiddleClick;
  }
  get onPointer() {
    return this.mouseController.onPointer;
  }
  get onMouseDown() {
    return this.view.onMouseDown;
  }
  get onMouseOver() {
    return this.view.onMouseOver;
  }
  get onMouseOut() {
    return this.view.onMouseOut;
  }
  get onTouchStart() {
    return this.view.onTouchStart;
  }
  get onTap() {
    return this.view.onTap;
  }
  /**
   * Possible context menu trigger events:
   * - ContextMenu key
   * - Shift F10
   * - Ctrl Option Shift M (macOS with VoiceOver)
   * - Mouse right click
   */
  get onContextMenu() {
    let e = !1;
    const t = Ze.chain(this.disposables.add(new ir(this.view.domNode, "keydown")).event, (s) => s.map((o) => new wr(o)).filter((o) => e = o.keyCode === 58 || o.shiftKey && o.keyCode === 68).map((o) => Mi.stop(o, !0)).filter(() => !1)), n = Ze.chain(this.disposables.add(new ir(this.view.domNode, "keyup")).event, (s) => s.forEach(() => e = !1).map((o) => new wr(o)).filter((o) => o.keyCode === 58 || o.shiftKey && o.keyCode === 68).map((o) => Mi.stop(o, !0)).map(({ browserEvent: o }) => {
      const a = this.getFocus(), l = a.length ? a[0] : void 0, c = typeof l < "u" ? this.view.element(l) : void 0, u = typeof l < "u" ? this.view.domElement(l) : this.view.domNode;
      return { index: l, element: c, anchor: u, browserEvent: o };
    })), r = Ze.chain(this.view.onContextMenu, (s) => s.filter((o) => !e).map(({ element: o, index: a, browserEvent: l }) => ({ element: o, index: a, anchor: new vl(At(this.view.domNode), l), browserEvent: l })));
    return Ze.any(t, n, r);
  }
  get onKeyDown() {
    return this.disposables.add(new ir(this.view.domNode, "keydown")).event;
  }
  get onDidFocus() {
    return Ze.signal(this.disposables.add(new ir(this.view.domNode, "focus", !0)).event);
  }
  get onDidBlur() {
    return Ze.signal(this.disposables.add(new ir(this.view.domNode, "blur", !0)).event);
  }
  constructor(e, t, n, r, s = $bt) {
    var c, u, d;
    this.user = e, this._options = s, this.focus = new DU("focused"), this.anchor = new DU("anchor"), this.eventBufferer = new gB(), this._ariaLabel = "", this.disposables = new ke(), this._onDidDispose = new he(), this.onDidDispose = this._onDidDispose.event;
    const o = this._options.accessibilityProvider && this._options.accessibilityProvider.getWidgetRole ? (c = this._options.accessibilityProvider) == null ? void 0 : c.getWidgetRole() : "list";
    this.selection = new Mbt(o !== "listbox");
    const a = [this.focus.renderer, this.selection.renderer];
    this.accessibilityProvider = s.accessibilityProvider, this.accessibilityProvider && (a.push(new Kbt(this.accessibilityProvider)), (d = (u = this.accessibilityProvider).onDidChangeActiveDescendant) == null || d.call(u, this.onDidChangeActiveDescendant, this, this.disposables)), r = r.map((h) => new qbt(h.templateId, [...a, h]));
    const l = {
      ...s,
      dnd: s.dnd && new Ybt(this, s.dnd)
    };
    if (this.view = this.createListView(t, n, r, l), this.view.domNode.setAttribute("role", o), s.styleController)
      this.styleController = s.styleController(this.view.domId);
    else {
      const h = Zf(this.view.domNode);
      this.styleController = new Ubt(h, this.view.domId);
    }
    if (this.spliceable = new Sbt([
      new Pee(this.focus, this.view, s.identityProvider),
      new Pee(this.selection, this.view, s.identityProvider),
      new Pee(this.anchor, this.view, s.identityProvider),
      this.view
    ]), this.disposables.add(this.focus), this.disposables.add(this.selection), this.disposables.add(this.anchor), this.disposables.add(this.view), this.disposables.add(this._onDidDispose), this.disposables.add(new Wbt(this, this.view)), (typeof s.keyboardSupport != "boolean" || s.keyboardSupport) && (this.keyboardController = new i5e(this, this.view, s), this.disposables.add(this.keyboardController)), s.keyboardNavigationLabelProvider) {
      const h = s.keyboardNavigationDelegate || Bbt;
      this.typeNavigationController = new Hbt(this, this.view, s.keyboardNavigationLabelProvider, s.keyboardNavigationEventFilter ?? (() => !0), h), this.disposables.add(this.typeNavigationController);
    }
    if (this.mouseController = this.createMouseController(s), this.disposables.add(this.mouseController), this.onDidChangeFocus(this._onFocusChange, this, this.disposables), this.onDidChangeSelection(this._onSelectionChange, this, this.disposables), this.accessibilityProvider) {
      const h = this.accessibilityProvider.getWidgetAriaLabel(), g = h && typeof h != "string" ? h : Br(h);
      this.disposables.add(Xt((m) => {
        this.ariaLabel = m.readObservable(g);
      }));
    }
    this._options.multipleSelectionSupport !== !1 && this.view.domNode.setAttribute("aria-multiselectable", "true");
  }
  createListView(e, t, n, r) {
    return new qg(e, t, n, r);
  }
  createMouseController(e) {
    return new o5e(this);
  }
  updateOptions(e = {}) {
    var t, n;
    this._options = { ...this._options, ...e }, (t = this.typeNavigationController) == null || t.updateOptions(this._options), this._options.multipleSelectionController !== void 0 && (this._options.multipleSelectionSupport ? this.view.domNode.setAttribute("aria-multiselectable", "true") : this.view.domNode.removeAttribute("aria-multiselectable")), this.mouseController.updateOptions(e), (n = this.keyboardController) == null || n.updateOptions(e), this.view.updateOptions(e);
  }
  get options() {
    return this._options;
  }
  splice(e, t, n = []) {
    if (e < 0 || e > this.view.length)
      throw new cE(this.user, `Invalid start index: ${e}`);
    if (t < 0)
      throw new cE(this.user, `Invalid delete count: ${t}`);
    t === 0 && n.length === 0 || this.eventBufferer.bufferEvents(() => this.spliceable.splice(e, t, n));
  }
  rerender() {
    this.view.rerender();
  }
  element(e) {
    return this.view.element(e);
  }
  indexOf(e) {
    return this.view.indexOf(e);
  }
  indexAt(e) {
    return this.view.indexAt(e);
  }
  get length() {
    return this.view.length;
  }
  get contentHeight() {
    return this.view.contentHeight;
  }
  get onDidChangeContentHeight() {
    return this.view.onDidChangeContentHeight;
  }
  get scrollTop() {
    return this.view.getScrollTop();
  }
  set scrollTop(e) {
    this.view.setScrollTop(e);
  }
  get scrollHeight() {
    return this.view.scrollHeight;
  }
  get renderHeight() {
    return this.view.renderHeight;
  }
  get firstVisibleIndex() {
    return this.view.firstVisibleIndex;
  }
  get ariaLabel() {
    return this._ariaLabel;
  }
  set ariaLabel(e) {
    this._ariaLabel = e, this.view.domNode.setAttribute("aria-label", e);
  }
  domFocus() {
    this.view.domNode.focus({ preventScroll: !0 });
  }
  layout(e, t) {
    this.view.layout(e, t);
  }
  setSelection(e, t) {
    for (const n of e)
      if (n < 0 || n >= this.length)
        throw new cE(this.user, `Invalid index ${n}`);
    this.selection.set(e, t);
  }
  getSelection() {
    return this.selection.get();
  }
  getSelectedElements() {
    return this.getSelection().map((e) => this.view.element(e));
  }
  setAnchor(e) {
    if (typeof e > "u") {
      this.anchor.set([]);
      return;
    }
    if (e < 0 || e >= this.length)
      throw new cE(this.user, `Invalid index ${e}`);
    this.anchor.set([e]);
  }
  getAnchor() {
    return this.anchor.get().at(0);
  }
  getAnchorElement() {
    const e = this.getAnchor();
    return typeof e > "u" ? void 0 : this.element(e);
  }
  setFocus(e, t) {
    for (const n of e)
      if (n < 0 || n >= this.length)
        throw new cE(this.user, `Invalid index ${n}`);
    this.focus.set(e, t);
  }
  focusNext(e = 1, t = !1, n, r) {
    if (this.length === 0)
      return;
    const s = this.focus.get(), o = this.findNextIndex(s.length > 0 ? s[0] + e : 0, t, r);
    o > -1 && this.setFocus([o], n);
  }
  focusPrevious(e = 1, t = !1, n, r) {
    if (this.length === 0)
      return;
    const s = this.focus.get(), o = this.findPreviousIndex(s.length > 0 ? s[0] - e : 0, t, r);
    o > -1 && this.setFocus([o], n);
  }
  async focusNextPage(e, t) {
    let n = this.view.indexAt(this.view.getScrollTop() + this.view.renderHeight);
    n = n === 0 ? 0 : n - 1;
    const r = this.getFocus()[0];
    if (r !== n && (r === void 0 || n > r)) {
      const s = this.findPreviousIndex(n, !1, t);
      s > -1 && r !== s ? this.setFocus([s], e) : this.setFocus([n], e);
    } else {
      const s = this.view.getScrollTop();
      let o = s + this.view.renderHeight;
      n > r && (o -= this.view.elementHeight(n)), this.view.setScrollTop(o), this.view.getScrollTop() !== s && (this.setFocus([]), await db(0), await this.focusNextPage(e, t));
    }
  }
  async focusPreviousPage(e, t, n = () => 0) {
    let r;
    const s = n(), o = this.view.getScrollTop() + s;
    o === 0 ? r = this.view.indexAt(o) : r = this.view.indexAfter(o - 1);
    const a = this.getFocus()[0];
    if (a !== r && (a === void 0 || a >= r)) {
      const l = this.findNextIndex(r, !1, t);
      l > -1 && a !== l ? this.setFocus([l], e) : this.setFocus([r], e);
    } else {
      const l = o;
      this.view.setScrollTop(o - this.view.renderHeight - s), this.view.getScrollTop() + n() !== l && (this.setFocus([]), await db(0), await this.focusPreviousPage(e, t, n));
    }
  }
  focusLast(e, t) {
    if (this.length === 0)
      return;
    const n = this.findPreviousIndex(this.length - 1, !1, t);
    n > -1 && this.setFocus([n], e);
  }
  focusFirst(e, t) {
    this.focusNth(0, e, t);
  }
  focusNth(e, t, n) {
    if (this.length === 0)
      return;
    const r = this.findNextIndex(e, !1, n);
    r > -1 && this.setFocus([r], t);
  }
  findNextIndex(e, t = !1, n) {
    for (let r = 0; r < this.length; r++) {
      if (e >= this.length && !t)
        return -1;
      if (e = e % this.length, !n || n(this.element(e)))
        return e;
      e++;
    }
    return -1;
  }
  findPreviousIndex(e, t = !1, n) {
    for (let r = 0; r < this.length; r++) {
      if (e < 0 && !t)
        return -1;
      if (e = (this.length + e % this.length) % this.length, !n || n(this.element(e)))
        return e;
      e--;
    }
    return -1;
  }
  getFocus() {
    return this.focus.get();
  }
  getFocusedElements() {
    return this.getFocus().map((e) => this.view.element(e));
  }
  reveal(e, t, n = 0) {
    if (e < 0 || e >= this.length)
      throw new cE(this.user, `Invalid index ${e}`);
    const r = this.view.getScrollTop(), s = this.view.elementTop(e), o = this.view.elementHeight(e);
    if (zy(t)) {
      const a = o - this.view.renderHeight + n;
      this.view.setScrollTop(a * Jc(t, 0, 1) + s - n);
    } else {
      const a = s + o, l = r + this.view.renderHeight;
      s < r + n && a >= l || (s < r + n || a >= l && o >= this.view.renderHeight ? this.view.setScrollTop(s - n) : a >= l && this.view.setScrollTop(a - this.view.renderHeight));
    }
  }
  /**
   * Returns the relative position of an element rendered in the list.
   * Returns `null` if the element isn't *entirely* in the visible viewport.
   */
  getRelativeTop(e, t = 0) {
    if (e < 0 || e >= this.length)
      throw new cE(this.user, `Invalid index ${e}`);
    const n = this.view.getScrollTop(), r = this.view.elementTop(e), s = this.view.elementHeight(e);
    if (r < n + t || r + s > n + this.view.renderHeight)
      return null;
    const o = s - this.view.renderHeight + t;
    return Math.abs((n + t - r) / o);
  }
  getHTMLElement() {
    return this.view.domNode;
  }
  getScrollableElement() {
    return this.view.scrollableElementDomNode;
  }
  getElementID(e) {
    return this.view.getElementDomId(e);
  }
  getElementTop(e) {
    return this.view.elementTop(e);
  }
  style(e) {
    this.styleController.style(e);
  }
  toListEvent({ indexes: e, browserEvent: t }) {
    return { indexes: e, elements: e.map((n) => this.view.element(n)), browserEvent: t };
  }
  _onFocusChange() {
    const e = this.focus.get();
    this.view.domNode.classList.toggle("element-focused", e.length > 0), this.onDidChangeActiveDescendant();
  }
  onDidChangeActiveDescendant() {
    var t;
    const e = this.focus.get();
    if (e.length > 0) {
      let n;
      (t = this.accessibilityProvider) != null && t.getActiveDescendantId && (n = this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))), this.view.domNode.setAttribute("aria-activedescendant", n || this.view.getElementDomId(e[0]));
    } else
      this.view.domNode.removeAttribute("aria-activedescendant");
  }
  _onSelectionChange() {
    const e = this.selection.get();
    this.view.domNode.classList.toggle("selection-none", e.length === 0), this.view.domNode.classList.toggle("selection-single", e.length === 1), this.view.domNode.classList.toggle("selection-multiple", e.length > 1);
  }
  dispose() {
    this._onDidDispose.fire(), this.disposables.dispose(), this._onDidDispose.dispose();
  }
}
Lw([
  go
], Zh.prototype, "onDidChangeFocus", null);
Lw([
  go
], Zh.prototype, "onDidChangeSelection", null);
Lw([
  go
], Zh.prototype, "onContextMenu", null);
Lw([
  go
], Zh.prototype, "onKeyDown", null);
Lw([
  go
], Zh.prototype, "onDidFocus", null);
Lw([
  go
], Zh.prototype, "onDidBlur", null);
const _x = Ge, a5e = "selectOption.entry.template";
class Xbt {
  get templateId() {
    return a5e;
  }
  renderTemplate(e) {
    const t = /* @__PURE__ */ Object.create(null);
    return t.root = e, t.text = Fe(e, _x(".option-text")), t.detail = Fe(e, _x(".option-detail")), t.decoratorRight = Fe(e, _x(".option-decorator-right")), t;
  }
  renderElement(e, t, n) {
    const r = n, s = e.text, o = e.detail, a = e.decoratorRight, l = e.isDisabled;
    r.text.textContent = s, r.detail.textContent = o || "", r.decoratorRight.textContent = a || "", l ? r.root.classList.add("option-disabled") : r.root.classList.remove("option-disabled");
  }
  disposeTemplate(e) {
  }
}
const R_ = class R_ extends ge {
  constructor(e, t, n, r, s) {
    super(), this.options = [], this._currentSelection = 0, this._hasDetails = !1, this._skipLayout = !1, this._sticky = !1, this._isVisible = !1, this.styles = r, this.selectBoxOptions = s || /* @__PURE__ */ Object.create(null), typeof this.selectBoxOptions.minBottomMargin != "number" ? this.selectBoxOptions.minBottomMargin = R_.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN : this.selectBoxOptions.minBottomMargin < 0 && (this.selectBoxOptions.minBottomMargin = 0), this.selectElement = document.createElement("select"), this.selectElement.className = "monaco-select-box monaco-select-box-dropdown-padding", typeof this.selectBoxOptions.ariaLabel == "string" && this.selectElement.setAttribute("aria-label", this.selectBoxOptions.ariaLabel), typeof this.selectBoxOptions.ariaDescription == "string" && this.selectElement.setAttribute("aria-description", this.selectBoxOptions.ariaDescription), this._onDidSelect = new he(), this._register(this._onDidSelect), this.registerListeners(), this.constructSelectDropDown(n), this.selected = t || 0, e && this.setOptions(e, t), this.initStyleSheet();
  }
  setTitle(e) {
    !this._hover && e ? this._hover = this._register(Jg().setupManagedHover(rd("mouse"), this.selectElement, e)) : this._hover && this._hover.update(e);
  }
  // IDelegate - List renderer
  getHeight() {
    return 22;
  }
  getTemplateId() {
    return a5e;
  }
  constructSelectDropDown(e) {
    this.contextViewProvider = e, this.selectDropDownContainer = Ge(".monaco-select-box-dropdown-container"), this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"), this.selectionDetailsPane = Fe(this.selectDropDownContainer, _x(".select-box-details-pane"));
    const t = Fe(this.selectDropDownContainer, _x(".select-box-dropdown-container-width-control")), n = Fe(t, _x(".width-control-div"));
    this.widthControlElement = document.createElement("span"), this.widthControlElement.className = "option-text-width-control", Fe(n, this.widthControlElement), this._dropDownPosition = 0, this.styleElement = Zf(this.selectDropDownContainer), this.selectDropDownContainer.setAttribute("draggable", "true"), this._register(Ce(this.selectDropDownContainer, Xe.DRAG_START, (r) => {
      Mi.stop(r, !0);
    }));
  }
  registerListeners() {
    this._register(vo(this.selectElement, "change", (t) => {
      this.selected = t.target.selectedIndex, this._onDidSelect.fire({
        index: t.target.selectedIndex,
        selected: t.target.value
      }), this.options[this.selected] && this.options[this.selected].text && this.setTitle(this.options[this.selected].text);
    })), this._register(Ce(this.selectElement, Xe.CLICK, (t) => {
      Mi.stop(t), this._isVisible ? this.hideSelectDropDown(!0) : this.showSelectDropDown();
    })), this._register(Ce(this.selectElement, Xe.MOUSE_DOWN, (t) => {
      Mi.stop(t);
    }));
    let e;
    this._register(Ce(this.selectElement, "touchstart", (t) => {
      e = this._isVisible;
    })), this._register(Ce(this.selectElement, "touchend", (t) => {
      Mi.stop(t), e ? this.hideSelectDropDown(!0) : this.showSelectDropDown();
    })), this._register(Ce(this.selectElement, Xe.KEY_DOWN, (t) => {
      const n = new wr(t);
      let r = !1;
      Kn ? (n.keyCode === 18 || n.keyCode === 16 || n.keyCode === 10 || n.keyCode === 3) && (r = !0) : (n.keyCode === 18 && n.altKey || n.keyCode === 16 && n.altKey || n.keyCode === 10 || n.keyCode === 3) && (r = !0), r && (this.showSelectDropDown(), Mi.stop(t, !0));
    }));
  }
  get onDidSelect() {
    return this._onDidSelect.event;
  }
  setOptions(e, t) {
    ds(this.options, e) || (this.options = e, this.selectElement.options.length = 0, this._hasDetails = !1, this._cachedMaxDetailsHeight = void 0, this.options.forEach((n, r) => {
      this.selectElement.add(this.createOption(n.text, r, n.isDisabled)), typeof n.description == "string" && (this._hasDetails = !0);
    })), t !== void 0 && (this.select(t), this._currentSelection = this.selected);
  }
  setOptionsList() {
    var e;
    (e = this.selectList) == null || e.splice(0, this.selectList.length, this.options);
  }
  select(e) {
    e >= 0 && e < this.options.length ? this.selected = e : e > this.options.length - 1 ? this.select(this.options.length - 1) : this.selected < 0 && (this.selected = 0), this.selectElement.selectedIndex = this.selected, this.options[this.selected] && this.options[this.selected].text && this.setTitle(this.options[this.selected].text);
  }
  focus() {
    this.selectElement && (this.selectElement.tabIndex = 0, this.selectElement.focus());
  }
  blur() {
    this.selectElement && (this.selectElement.tabIndex = -1, this.selectElement.blur());
  }
  setFocusable(e) {
    this.selectElement.tabIndex = e ? 0 : -1;
  }
  render(e) {
    this.container = e, e.classList.add("select-container"), e.appendChild(this.selectElement), this.styleSelectElement();
  }
  initStyleSheet() {
    const e = [];
    this.styles.listFocusBackground && e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`), this.styles.listFocusForeground && e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`), this.styles.decoratorRightForeground && e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`), this.styles.selectBackground && this.styles.selectBorder && this.styles.selectBorder !== this.styles.selectBackground ? (e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `), e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `), e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)) : this.styles.selectListBorder && (e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `), e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)), this.styles.listHoverForeground && e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`), this.styles.listHoverBackground && e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`), this.styles.listFocusOutline && e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`), this.styles.listHoverOutline && e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`), e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"), e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"), this.styleElement.textContent = e.join(`
`);
  }
  styleSelectElement() {
    const e = this.styles.selectBackground ?? "", t = this.styles.selectForeground ?? "", n = this.styles.selectBorder ?? "";
    this.selectElement.style.backgroundColor = e, this.selectElement.style.color = t, this.selectElement.style.borderColor = n;
  }
  styleList() {
    const e = this.styles.selectBackground ?? "", t = Py(this.styles.selectListBackground, e);
    this.selectDropDownListContainer.style.backgroundColor = t, this.selectionDetailsPane.style.backgroundColor = t;
    const n = this.styles.focusBorder ?? "";
    this.selectDropDownContainer.style.outlineColor = n, this.selectDropDownContainer.style.outlineOffset = "-1px", this.selectList.style(this.styles);
  }
  createOption(e, t, n) {
    const r = document.createElement("option");
    return r.value = e, r.text = e, r.disabled = !!n, r;
  }
  // ContextView dropdown methods
  showSelectDropDown() {
    this.selectionDetailsPane.textContent = "", !(!this.contextViewProvider || this._isVisible) && (this.createSelectList(this.selectDropDownContainer), this.setOptionsList(), this.contextViewProvider.showContextView({
      getAnchor: () => this.selectElement,
      render: (e) => this.renderSelectDropDown(e, !0),
      layout: () => {
        this.layoutSelectDropDown();
      },
      onHide: () => {
        this.selectDropDownContainer.classList.remove("visible"), this.selectElement.classList.remove("synthetic-focus");
      },
      anchorPosition: this._dropDownPosition
    }, this.selectBoxOptions.optionsAsChildren ? this.container : void 0), this._isVisible = !0, this.hideSelectDropDown(!1), this.contextViewProvider.showContextView({
      getAnchor: () => this.selectElement,
      render: (e) => this.renderSelectDropDown(e),
      layout: () => this.layoutSelectDropDown(),
      onHide: () => {
        this.selectDropDownContainer.classList.remove("visible"), this.selectElement.classList.remove("synthetic-focus");
      },
      anchorPosition: this._dropDownPosition
    }, this.selectBoxOptions.optionsAsChildren ? this.container : void 0), this._currentSelection = this.selected, this._isVisible = !0, this.selectElement.setAttribute("aria-expanded", "true"));
  }
  hideSelectDropDown(e) {
    !this.contextViewProvider || !this._isVisible || (this._isVisible = !1, this.selectElement.setAttribute("aria-expanded", "false"), e && this.selectElement.focus(), this.contextViewProvider.hideContextView());
  }
  renderSelectDropDown(e, t) {
    return e.appendChild(this.selectDropDownContainer), this.layoutSelectDropDown(t), {
      dispose: () => {
        this.selectDropDownContainer.remove();
      }
    };
  }
  // Iterate over detailed descriptions, find max height
  measureMaxDetailsHeight() {
    let e = 0;
    return this.options.forEach((t, n) => {
      this.updateDetail(n), this.selectionDetailsPane.offsetHeight > e && (e = this.selectionDetailsPane.offsetHeight);
    }), e;
  }
  layoutSelectDropDown(e) {
    if (this._skipLayout)
      return !1;
    if (this.selectList) {
      this.selectDropDownContainer.classList.add("visible");
      const t = At(this.selectElement), n = ho(this.selectElement), r = At(this.selectElement).getComputedStyle(this.selectElement), s = parseFloat(r.getPropertyValue("--dropdown-padding-top")) + parseFloat(r.getPropertyValue("--dropdown-padding-bottom")), o = t.innerHeight - n.top - n.height - (this.selectBoxOptions.minBottomMargin || 0), a = n.top - R_.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN, l = this.selectElement.offsetWidth, c = this.setWidthControlElement(this.widthControlElement), u = Math.max(c, Math.round(l)).toString() + "px";
      this.selectDropDownContainer.style.width = u, this.selectList.getHTMLElement().style.height = "", this.selectList.layout();
      let d = this.selectList.contentHeight;
      this._hasDetails && this._cachedMaxDetailsHeight === void 0 && (this._cachedMaxDetailsHeight = this.measureMaxDetailsHeight());
      const h = this._hasDetails ? this._cachedMaxDetailsHeight : 0, g = d + s + h, m = Math.floor((o - s - h) / this.getHeight()), _ = Math.floor((a - s - h) / this.getHeight());
      if (e)
        return n.top + n.height > t.innerHeight - 22 || n.top < R_.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN || m < 1 && _ < 1 ? !1 : (m < R_.DEFAULT_MINIMUM_VISIBLE_OPTIONS && _ > m && this.options.length > m ? (this._dropDownPosition = 1, this.selectDropDownListContainer.remove(), this.selectionDetailsPane.remove(), this.selectDropDownContainer.appendChild(this.selectionDetailsPane), this.selectDropDownContainer.appendChild(this.selectDropDownListContainer), this.selectionDetailsPane.classList.remove("border-top"), this.selectionDetailsPane.classList.add("border-bottom")) : (this._dropDownPosition = 0, this.selectDropDownListContainer.remove(), this.selectionDetailsPane.remove(), this.selectDropDownContainer.appendChild(this.selectDropDownListContainer), this.selectDropDownContainer.appendChild(this.selectionDetailsPane), this.selectionDetailsPane.classList.remove("border-bottom"), this.selectionDetailsPane.classList.add("border-top")), !0);
      if (n.top + n.height > t.innerHeight - 22 || n.top < R_.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN || this._dropDownPosition === 0 && m < 1 || this._dropDownPosition === 1 && _ < 1)
        return this.hideSelectDropDown(!0), !1;
      if (this._dropDownPosition === 0) {
        if (this._isVisible && m + _ < 1)
          return this.hideSelectDropDown(!0), !1;
        g > o && (d = m * this.getHeight());
      } else
        g > a && (d = _ * this.getHeight());
      return this.selectList.layout(d), this.selectList.domFocus(), this.selectList.length > 0 && (this.selectList.setFocus([this.selected || 0]), this.selectList.reveal(this.selectList.getFocus()[0] || 0)), this._hasDetails ? (this.selectList.getHTMLElement().style.height = d + s + "px", this.selectDropDownContainer.style.height = "") : this.selectDropDownContainer.style.height = d + s + "px", this.updateDetail(this.selected), this.selectDropDownContainer.style.width = u, this.selectDropDownListContainer.setAttribute("tabindex", "0"), this.selectElement.classList.add("synthetic-focus"), this.selectDropDownContainer.classList.add("synthetic-focus"), !0;
    } else
      return !1;
  }
  setWidthControlElement(e) {
    let t = 0;
    if (e) {
      let n = 0, r = 0;
      this.options.forEach((s, o) => {
        const a = s.detail ? s.detail.length : 0, l = s.decoratorRight ? s.decoratorRight.length : 0, c = s.text.length + a + l;
        c > r && (n = o, r = c);
      }), e.textContent = this.options[n].text + (this.options[n].decoratorRight ? this.options[n].decoratorRight + " " : ""), t = Td(e);
    }
    return t;
  }
  createSelectList(e) {
    if (this.selectList)
      return;
    this.selectDropDownListContainer = Fe(e, _x(".select-box-dropdown-list-container")), this.listRenderer = new Xbt(), this.selectList = this._register(new Zh("SelectBoxCustom", this.selectDropDownListContainer, this, [this.listRenderer], {
      useShadows: !1,
      verticalScrollMode: 3,
      keyboardSupport: !1,
      mouseSupport: !1,
      accessibilityProvider: {
        getAriaLabel: (r) => {
          let s = r.text;
          return r.detail && (s += `. ${r.detail}`), r.decoratorRight && (s += `. ${r.decoratorRight}`), r.description && (s += `. ${r.description}`), s;
        },
        getWidgetAriaLabel: () => S(16, "Select Box"),
        getRole: () => Kn ? "" : "option",
        getWidgetRole: () => "listbox"
      }
    })), this.selectBoxOptions.ariaLabel && (this.selectList.ariaLabel = this.selectBoxOptions.ariaLabel);
    const t = this._register(new ir(this.selectDropDownListContainer, "keydown")), n = Ze.chain(t.event, (r) => r.filter(() => this.selectList.length > 0).map((s) => new wr(s)));
    this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 3
      /* KeyCode.Enter */
    ))(this.onEnter, this)), this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 2
      /* KeyCode.Tab */
    ))(this.onEnter, this)), this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 9
      /* KeyCode.Escape */
    ))(this.onEscape, this)), this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 16
      /* KeyCode.UpArrow */
    ))(this.onUpArrow, this)), this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 18
      /* KeyCode.DownArrow */
    ))(this.onDownArrow, this)), this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 12
      /* KeyCode.PageDown */
    ))(this.onPageDown, this)), this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 11
      /* KeyCode.PageUp */
    ))(this.onPageUp, this)), this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 14
      /* KeyCode.Home */
    ))(this.onHome, this)), this._register(Ze.chain(n, (r) => r.filter(
      (s) => s.keyCode === 13
      /* KeyCode.End */
    ))(this.onEnd, this)), this._register(Ze.chain(n, (r) => r.filter((s) => s.keyCode >= 21 && s.keyCode <= 56 || s.keyCode >= 85 && s.keyCode <= 113))(this.onCharacter, this)), this._register(Ce(this.selectList.getHTMLElement(), Xe.POINTER_UP, (r) => this.onPointerUp(r))), this._register(this.selectList.onMouseOver((r) => typeof r.index < "u" && this.selectList.setFocus([r.index]))), this._register(this.selectList.onDidChangeFocus((r) => this.onListFocus(r))), this._register(Ce(this.selectDropDownContainer, Xe.FOCUS_OUT, (r) => {
      !this._isVisible || pa(r.relatedTarget, this.selectDropDownContainer) || this.onListBlur();
    })), this.selectList.getHTMLElement().setAttribute("aria-label", this.selectBoxOptions.ariaLabel || ""), this.selectList.getHTMLElement().setAttribute("aria-expanded", "true"), this.styleList();
  }
  // List methods
  // List mouse controller - active exit, select option, fire onDidSelect if change, return focus to parent select
  // Also takes in touchend events
  onPointerUp(e) {
    if (!this.selectList.length)
      return;
    Mi.stop(e);
    const t = e.target;
    if (!t || t.classList.contains("slider"))
      return;
    const n = t.closest(".monaco-list-row");
    if (!n)
      return;
    const r = Number(n.getAttribute("data-index")), s = n.classList.contains("option-disabled");
    r >= 0 && r < this.options.length && !s && (this.selected = r, this.select(this.selected), this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selectList.getFocus()[0]), this.selected !== this._currentSelection && (this._currentSelection = this.selected, this._onDidSelect.fire({
      index: this.selectElement.selectedIndex,
      selected: this.options[this.selected].text
    }), this.options[this.selected] && this.options[this.selected].text && this.setTitle(this.options[this.selected].text)), this.hideSelectDropDown(!0));
  }
  // List Exit - passive - implicit no selection change, hide drop-down
  onListBlur() {
    this._sticky || (this.selected !== this._currentSelection && this.select(this._currentSelection), this.hideSelectDropDown(!1));
  }
  renderDescriptionMarkdown(e, t) {
    const n = (s) => {
      for (let o = 0; o < s.childNodes.length; o++) {
        const a = s.childNodes.item(o);
        (a.tagName && a.tagName.toLowerCase()) === "img" ? a.remove() : n(a);
      }
    }, r = AB({ value: e, supportThemeIcons: !0 }, { actionHandler: t });
    return r.element.classList.add("select-box-description-markdown"), n(r.element), r.element;
  }
  // List Focus Change - passive - update details pane with newly focused element's data
  onListFocus(e) {
    !this._isVisible || !this._hasDetails || this.updateDetail(e.indexes[0]);
  }
  updateDetail(e) {
    this.selectionDetailsPane.textContent = "";
    const t = this.options[e], n = (t == null ? void 0 : t.description) ?? "", r = (t == null ? void 0 : t.descriptionIsMarkdown) ?? !1;
    if (n) {
      if (r) {
        const s = t.descriptionMarkdownActionHandler;
        this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(n, s));
      } else
        this.selectionDetailsPane.textContent = n;
      this.selectionDetailsPane.style.display = "block";
    } else
      this.selectionDetailsPane.style.display = "none";
    this._skipLayout = !0, this.contextViewProvider.layout(), this._skipLayout = !1;
  }
  // List keyboard controller
  // List exit - active - hide ContextView dropdown, reset selection, return focus to parent select
  onEscape(e) {
    Mi.stop(e), this.select(this._currentSelection), this.hideSelectDropDown(!0);
  }
  // List exit - active - hide ContextView dropdown, return focus to parent select, fire onDidSelect if change
  onEnter(e) {
    Mi.stop(e), this.selected !== this._currentSelection && (this._currentSelection = this.selected, this._onDidSelect.fire({
      index: this.selectElement.selectedIndex,
      selected: this.options[this.selected].text
    }), this.options[this.selected] && this.options[this.selected].text && this.setTitle(this.options[this.selected].text)), this.hideSelectDropDown(!0);
  }
  // List navigation - have to handle a disabled option (jump over)
  onDownArrow(e) {
    if (this.selected < this.options.length - 1) {
      Mi.stop(e, !0);
      const t = this.options[this.selected + 1].isDisabled;
      if (t && this.options.length > this.selected + 2)
        this.selected += 2;
      else {
        if (t)
          return;
        this.selected++;
      }
      this.select(this.selected), this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selectList.getFocus()[0]);
    }
  }
  onUpArrow(e) {
    this.selected > 0 && (Mi.stop(e, !0), this.options[this.selected - 1].isDisabled && this.selected > 1 ? this.selected -= 2 : this.selected--, this.select(this.selected), this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selectList.getFocus()[0]));
  }
  onPageUp(e) {
    Mi.stop(e), this.selectList.focusPreviousPage(), setTimeout(() => {
      this.selected = this.selectList.getFocus()[0], this.options[this.selected].isDisabled && this.selected < this.options.length - 1 && (this.selected++, this.selectList.setFocus([this.selected])), this.selectList.reveal(this.selected), this.select(this.selected);
    }, 1);
  }
  onPageDown(e) {
    Mi.stop(e), this.selectList.focusNextPage(), setTimeout(() => {
      this.selected = this.selectList.getFocus()[0], this.options[this.selected].isDisabled && this.selected > 0 && (this.selected--, this.selectList.setFocus([this.selected])), this.selectList.reveal(this.selected), this.select(this.selected);
    }, 1);
  }
  onHome(e) {
    Mi.stop(e), !(this.options.length < 2) && (this.selected = 0, this.options[this.selected].isDisabled && this.selected > 1 && this.selected++, this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selected), this.select(this.selected));
  }
  onEnd(e) {
    Mi.stop(e), !(this.options.length < 2) && (this.selected = this.options.length - 1, this.options[this.selected].isDisabled && this.selected > 1 && this.selected--, this.selectList.setFocus([this.selected]), this.selectList.reveal(this.selected), this.select(this.selected));
  }
  // Mimic option first character navigation of native select
  onCharacter(e) {
    const t = cy.toString(e.keyCode);
    let n = -1;
    for (let r = 0; r < this.options.length - 1; r++)
      if (n = (r + this.selected + 1) % this.options.length, this.options[n].text.charAt(0).toUpperCase() === t && !this.options[n].isDisabled) {
        this.select(n), this.selectList.setFocus([n]), this.selectList.reveal(this.selectList.getFocus()[0]), Mi.stop(e);
        break;
      }
  }
  dispose() {
    this.hideSelectDropDown(!1), super.dispose();
  }
};
R_.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN = 32, R_.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN = 2, R_.DEFAULT_MINIMUM_VISIBLE_OPTIONS = 3;
let ese = R_;
class Zbt extends ge {
  constructor(e, t, n, r) {
    super(), this.selected = 0, this.selectBoxOptions = r || /* @__PURE__ */ Object.create(null), this.options = [], this.selectElement = document.createElement("select"), this.selectElement.className = "monaco-select-box", typeof this.selectBoxOptions.ariaLabel == "string" && this.selectElement.setAttribute("aria-label", this.selectBoxOptions.ariaLabel), typeof this.selectBoxOptions.ariaDescription == "string" && this.selectElement.setAttribute("aria-description", this.selectBoxOptions.ariaDescription), this._onDidSelect = this._register(new he()), this.styles = n, this.registerListeners(), this.setOptions(e, t);
  }
  registerListeners() {
    this._register(ec.addTarget(this.selectElement)), [zr.Tap].forEach((e) => {
      this._register(Ce(this.selectElement, e, (t) => {
        this.selectElement.focus();
      }));
    }), this._register(vo(this.selectElement, "click", (e) => {
      Mi.stop(e, !0);
    })), this._register(vo(this.selectElement, "change", (e) => {
      this.selectElement.title = e.target.value, this._onDidSelect.fire({
        index: e.target.selectedIndex,
        selected: e.target.value
      });
    })), this._register(vo(this.selectElement, "keydown", (e) => {
      let t = !1;
      Kn ? (e.keyCode === 18 || e.keyCode === 16 || e.keyCode === 10) && (t = !0) : (e.keyCode === 18 && e.altKey || e.keyCode === 10 || e.keyCode === 3) && (t = !0), t && e.stopPropagation();
    }));
  }
  get onDidSelect() {
    return this._onDidSelect.event;
  }
  setOptions(e, t) {
    (!this.options || !ds(this.options, e)) && (this.options = e, this.selectElement.options.length = 0, this.options.forEach((n, r) => {
      this.selectElement.add(this.createOption(n.text, r, n.isDisabled));
    })), t !== void 0 && this.select(t);
  }
  select(e) {
    this.options.length === 0 ? this.selected = 0 : e >= 0 && e < this.options.length ? this.selected = e : e > this.options.length - 1 ? this.select(this.options.length - 1) : this.selected < 0 && (this.selected = 0), this.selectElement.selectedIndex = this.selected, this.selected < this.options.length && typeof this.options[this.selected].text == "string" ? this.selectElement.title = this.options[this.selected].text : this.selectElement.title = "";
  }
  focus() {
    this.selectElement && (this.selectElement.tabIndex = 0, this.selectElement.focus());
  }
  blur() {
    this.selectElement && (this.selectElement.tabIndex = -1, this.selectElement.blur());
  }
  setFocusable(e) {
    this.selectElement.tabIndex = e ? 0 : -1;
  }
  render(e) {
    e.classList.add("select-container"), e.appendChild(this.selectElement), this.setOptions(this.options, this.selected), this.applyStyles();
  }
  applyStyles() {
    this.selectElement && (this.selectElement.style.backgroundColor = this.styles.selectBackground ?? "", this.selectElement.style.color = this.styles.selectForeground ?? "", this.selectElement.style.borderColor = this.styles.selectBorder ?? "");
  }
  createOption(e, t, n) {
    const r = document.createElement("option");
    return r.value = e, r.text = e, r.disabled = !!n, r;
  }
}
class Qbt extends Xd {
  constructor(e, t, n, r, s) {
    super(), Kn && !(s != null && s.useCustomDrawn) ? this.selectBoxDelegate = new Zbt(e, t, r, s) : this.selectBoxDelegate = new ese(e, t, n, r, s), this._register(this.selectBoxDelegate);
  }
  // Public SelectBox Methods - routed through delegate interface
  get onDidSelect() {
    return this.selectBoxDelegate.onDidSelect;
  }
  setOptions(e, t) {
    this.selectBoxDelegate.setOptions(e, t);
  }
  select(e) {
    this.selectBoxDelegate.select(e);
  }
  focus() {
    this.selectBoxDelegate.focus();
  }
  blur() {
    this.selectBoxDelegate.blur();
  }
  setFocusable(e) {
    this.selectBoxDelegate.setFocusable(e);
  }
  render(e) {
    this.selectBoxDelegate.render(e);
  }
}
class zp extends ge {
  get action() {
    return this._action;
  }
  constructor(e, t, n = {}) {
    super(), this.options = n, this._context = e || this, this._action = t, t instanceof Vh && this._register(t.onDidChange((r) => {
      this.element && this.handleActionChangeEvent(r);
    }));
  }
  handleActionChangeEvent(e) {
    e.enabled !== void 0 && this.updateEnabled(), e.checked !== void 0 && this.updateChecked(), e.class !== void 0 && this.updateClass(), e.label !== void 0 && (this.updateLabel(), this.updateTooltip()), e.tooltip !== void 0 && this.updateTooltip();
  }
  get actionRunner() {
    return this._actionRunner || (this._actionRunner = this._register(new nT())), this._actionRunner;
  }
  set actionRunner(e) {
    this._actionRunner = e;
  }
  isEnabled() {
    return this._action.enabled;
  }
  setActionContext(e) {
    this._context = e;
  }
  render(e) {
    const t = this.element = e;
    this._register(ec.addTarget(e));
    const n = this.options && this.options.draggable;
    n && (e.draggable = !0, Zu && this._register(Ce(e, Xe.DRAG_START, (r) => {
      var s;
      return (s = r.dataTransfer) == null ? void 0 : s.setData(dT.TEXT, this._action.label);
    }))), this._register(Ce(t, zr.Tap, (r) => this.onClick(r, !0))), this._register(Ce(t, Xe.MOUSE_DOWN, (r) => {
      n || Mi.stop(r, !0), this._action.enabled && r.button === 0 && t.classList.add("active");
    })), Kn && this._register(Ce(t, Xe.CONTEXT_MENU, (r) => {
      r.button === 0 && r.ctrlKey === !0 && this.onClick(r);
    })), this._register(Ce(t, Xe.CLICK, (r) => {
      Mi.stop(r, !0), this.options && this.options.isMenu || this.onClick(r);
    })), this._register(Ce(t, Xe.DBLCLICK, (r) => {
      Mi.stop(r, !0);
    })), [Xe.MOUSE_UP, Xe.MOUSE_OUT].forEach((r) => {
      this._register(Ce(t, r, (s) => {
        Mi.stop(s), t.classList.remove("active");
      }));
    });
  }
  onClick(e, t = !1) {
    var r;
    Mi.stop(e, !0);
    const n = If(this._context) ? (r = this.options) != null && r.useEventAsContext ? e : { preserveFocus: t } : this._context;
    this.actionRunner.run(this._action, n);
  }
  // Only set the tabIndex on the element once it is about to get focused
  // That way this element wont be a tab stop when it is not needed #106441
  focus() {
    this.element && (this.element.tabIndex = 0, this.element.focus(), this.element.classList.add("focused"));
  }
  blur() {
    this.element && (this.element.blur(), this.element.tabIndex = -1, this.element.classList.remove("focused"));
  }
  setFocusable(e) {
    this.element && (this.element.tabIndex = e ? 0 : -1);
  }
  get trapsArrowNavigation() {
    return !1;
  }
  updateEnabled() {
  }
  updateLabel() {
  }
  getClass() {
    return this.action.class;
  }
  getTooltip() {
    return this.action.tooltip;
  }
  getHoverContents() {
    return this.getTooltip();
  }
  updateTooltip() {
    if (!this.element)
      return;
    const e = this.getHoverContents() ?? "";
    if (this.updateAriaLabel(), !this.customHover && e !== "") {
      const t = this.options.hoverDelegate ?? rd("element");
      this.customHover = this._store.add(Jg().setupManagedHover(t, this.element, e));
    } else this.customHover && this.customHover.update(e);
  }
  updateAriaLabel() {
    if (this.element) {
      const e = this.getTooltip() ?? "";
      this.element.setAttribute("aria-label", e);
    }
  }
  updateClass() {
  }
  updateChecked() {
  }
  dispose() {
    this.element && (this.element.remove(), this.element = void 0), this._context = void 0, super.dispose();
  }
}
class lA extends zp {
  constructor(e, t, n) {
    n = {
      ...n,
      icon: n.icon !== void 0 ? n.icon : !1,
      label: n.label !== void 0 ? n.label : !0
    }, super(e, t, n), this.options = n, this.cssClass = "";
  }
  render(e) {
    super.render(e), Ii(this.element);
    const t = document.createElement("a");
    if (t.classList.add("action-label"), t.setAttribute("role", this.getDefaultAriaRole()), this.label = t, this.element.appendChild(t), this.options.label && this.options.keybinding && !this.options.keybindingNotRenderedWithLabel) {
      const n = document.createElement("span");
      n.classList.add("keybinding"), n.textContent = this.options.keybinding, this.element.appendChild(n);
    }
    this.updateClass(), this.updateLabel(), this.updateTooltip(), this.updateEnabled(), this.updateChecked();
  }
  getDefaultAriaRole() {
    return this._action.id === fa.ID ? "presentation" : this.options.isMenu ? "menuitem" : this.options.isTabList ? "tab" : "button";
  }
  // Only set the tabIndex on the element once it is about to get focused
  // That way this element wont be a tab stop when it is not needed #106441
  focus() {
    this.label && (this.label.tabIndex = 0, this.label.focus());
  }
  blur() {
    this.label && (this.label.tabIndex = -1);
  }
  setFocusable(e) {
    this.label && (this.label.tabIndex = e ? 0 : -1);
  }
  updateLabel() {
    this.options.label && this.label && (this.label.textContent = this.action.label);
  }
  getTooltip() {
    let e = null;
    return this.action.tooltip ? e = this.action.tooltip : this.action.label && (e = this.action.label, this.options.keybinding && (e = S(0, "{0} ({1})", e, this.options.keybinding))), e ?? void 0;
  }
  updateClass() {
    var e;
    this.cssClass && this.label && this.label.classList.remove(...this.cssClass.split(" ")), this.options.icon ? (this.cssClass = this.getClass(), this.label && (this.label.classList.add("codicon"), this.cssClass && this.label.classList.add(...this.cssClass.split(" "))), this.updateEnabled()) : (e = this.label) == null || e.classList.remove("codicon");
  }
  updateEnabled() {
    var e, t;
    this.action.enabled ? (this.label && (this.label.removeAttribute("aria-disabled"), this.label.classList.remove("disabled")), (e = this.element) == null || e.classList.remove("disabled")) : (this.label && (this.label.setAttribute("aria-disabled", "true"), this.label.classList.add("disabled")), (t = this.element) == null || t.classList.add("disabled"));
  }
  updateAriaLabel() {
    if (this.label) {
      const e = this.getTooltip() ?? "";
      this.label.setAttribute("aria-label", e);
    }
  }
  updateChecked() {
    this.label && (this.action.checked !== void 0 ? (this.label.classList.toggle("checked", this.action.checked), this.options.isTabList ? this.label.setAttribute("aria-selected", this.action.checked ? "true" : "false") : (this.label.setAttribute("aria-checked", this.action.checked ? "true" : "false"), this.label.setAttribute("role", "checkbox"))) : (this.label.classList.remove("checked"), this.label.removeAttribute(this.options.isTabList ? "aria-selected" : "aria-checked"), this.label.setAttribute("role", this.getDefaultAriaRole())));
  }
}
class Jbt extends zp {
  constructor(e, t, n, r, s, o, a) {
    super(e, t), this.selectBox = new Qbt(n, r, s, o, a), this.selectBox.setFocusable(!1), this._register(this.selectBox), this.registerListeners();
  }
  select(e) {
    this.selectBox.select(e);
  }
  registerListeners() {
    this._register(this.selectBox.onDidSelect((e) => this.runAction(e.selected, e.index)));
  }
  runAction(e, t) {
    this.actionRunner.run(this._action, this.getActionContext(e, t));
  }
  getActionContext(e, t) {
    return e;
  }
  setFocusable(e) {
    this.selectBox.setFocusable(e);
  }
  focus() {
    var e;
    (e = this.selectBox) == null || e.focus();
  }
  blur() {
    var e;
    (e = this.selectBox) == null || e.blur();
  }
  render(e) {
    this.selectBox.render(e);
  }
}
class qu extends ge {
  get onDidBlur() {
    return this._onDidBlur.event;
  }
  get onDidCancel() {
    return this._onDidCancel.event;
  }
  get onDidRun() {
    return this._onDidRun.event;
  }
  get onWillRun() {
    return this._onWillRun.event;
  }
  constructor(e, t = {}) {
    var s, o;
    super(), this._actionRunnerDisposables = this._register(new ke()), this.viewItemDisposables = this._register(new pq()), this.triggerKeyDown = !1, this.focusable = !0, this._onDidBlur = this._register(new he()), this._onDidCancel = this._register(new he({ onWillAddFirstListener: () => this.cancelHasListener = !0 })), this.cancelHasListener = !1, this._onDidRun = this._register(new he()), this._onWillRun = this._register(new he()), this.options = t, this._context = t.context ?? null, this._orientation = this.options.orientation ?? 0, this._triggerKeys = {
      keyDown: ((s = this.options.triggerKeys) == null ? void 0 : s.keyDown) ?? !1,
      keys: ((o = this.options.triggerKeys) == null ? void 0 : o.keys) ?? [
        3,
        10
        /* KeyCode.Space */
      ]
    }, this._hoverDelegate = t.hoverDelegate ?? this._register(oA()), this.options.actionRunner ? this._actionRunner = this.options.actionRunner : (this._actionRunner = new nT(), this._actionRunnerDisposables.add(this._actionRunner)), this._actionRunnerDisposables.add(this._actionRunner.onDidRun((a) => this._onDidRun.fire(a))), this._actionRunnerDisposables.add(this._actionRunner.onWillRun((a) => this._onWillRun.fire(a))), this.viewItems = [], this.focusedItem = void 0, this.domNode = document.createElement("div"), this.domNode.className = "monaco-action-bar";
    let n, r;
    switch (this._orientation) {
      case 0:
        n = [
          15
          /* KeyCode.LeftArrow */
        ], r = [
          17
          /* KeyCode.RightArrow */
        ];
        break;
      case 1:
        n = [
          16
          /* KeyCode.UpArrow */
        ], r = [
          18
          /* KeyCode.DownArrow */
        ], this.domNode.className += " vertical";
        break;
    }
    this._register(Ce(this.domNode, Xe.KEY_DOWN, (a) => {
      const l = new wr(a);
      let c = !0;
      const u = typeof this.focusedItem == "number" ? this.viewItems[this.focusedItem] : void 0;
      n && (l.equals(n[0]) || l.equals(n[1])) ? c = this.focusPrevious() : r && (l.equals(r[0]) || l.equals(r[1])) ? c = this.focusNext() : l.equals(
        9
        /* KeyCode.Escape */
      ) && this.cancelHasListener ? this._onDidCancel.fire() : l.equals(
        14
        /* KeyCode.Home */
      ) ? c = this.focusFirst() : l.equals(
        13
        /* KeyCode.End */
      ) ? c = this.focusLast() : l.equals(
        2
        /* KeyCode.Tab */
      ) && u instanceof zp && u.trapsArrowNavigation ? c = this.focusNext(void 0, !0) : this.isTriggerKeyEvent(l) ? this._triggerKeys.keyDown ? this.doTrigger(l) : this.triggerKeyDown = !0 : c = !1, c && (l.preventDefault(), l.stopPropagation());
    })), this._register(Ce(this.domNode, Xe.KEY_UP, (a) => {
      const l = new wr(a);
      this.isTriggerKeyEvent(l) ? (!this._triggerKeys.keyDown && this.triggerKeyDown && (this.triggerKeyDown = !1, this.doTrigger(l)), l.preventDefault(), l.stopPropagation()) : (l.equals(
        2
        /* KeyCode.Tab */
      ) || l.equals(
        1026
        /* KeyCode.Tab */
      ) || l.equals(
        16
        /* KeyCode.UpArrow */
      ) || l.equals(
        18
        /* KeyCode.DownArrow */
      ) || l.equals(
        15
        /* KeyCode.LeftArrow */
      ) || l.equals(
        17
        /* KeyCode.RightArrow */
      )) && this.updateFocusedItem();
    })), this.focusTracker = this._register(qf(this.domNode)), this._register(this.focusTracker.onDidBlur(() => {
      (ea() === this.domNode || !pa(ea(), this.domNode)) && (this._onDidBlur.fire(), this.previouslyFocusedItem = this.focusedItem, this.focusedItem = void 0, this.triggerKeyDown = !1);
    })), this._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem())), this.actionsList = document.createElement("ul"), this.actionsList.className = "actions-container", this.options.highlightToggledItems && this.actionsList.classList.add("highlight-toggled"), this.actionsList.setAttribute("role", this.options.ariaRole || "toolbar"), this.options.ariaLabel && this.actionsList.setAttribute("aria-label", this.options.ariaLabel), this.domNode.appendChild(this.actionsList), e.appendChild(this.domNode);
  }
  refreshRole() {
    this.length() >= 1 ? this.actionsList.setAttribute("role", this.options.ariaRole || "toolbar") : this.actionsList.setAttribute("role", "presentation");
  }
  // Some action bars should not be focusable at times
  // When an action bar is not focusable make sure to make all the elements inside it not focusable
  // When an action bar is focusable again, make sure the first item can be focused
  setFocusable(e) {
    if (this.focusable = e, this.focusable) {
      const t = this.viewItems.find((n) => n instanceof zp && n.isEnabled());
      t instanceof zp && t.setFocusable(!0);
    } else
      this.viewItems.forEach((t) => {
        t instanceof zp && t.setFocusable(!1);
      });
  }
  isTriggerKeyEvent(e) {
    let t = !1;
    return this._triggerKeys.keys.forEach((n) => {
      t = t || e.equals(n);
    }), t;
  }
  updateFocusedItem() {
    var e, t;
    for (let n = 0; n < this.actionsList.children.length; n++) {
      const r = this.actionsList.children[n];
      if (pa(ea(), r)) {
        this.focusedItem = n, (t = (e = this.viewItems[this.focusedItem]) == null ? void 0 : e.showHover) == null || t.call(e);
        break;
      }
    }
  }
  get context() {
    return this._context;
  }
  set context(e) {
    this._context = e, this.viewItems.forEach((t) => t.setActionContext(e));
  }
  get actionRunner() {
    return this._actionRunner;
  }
  set actionRunner(e) {
    this._actionRunner = e, this._actionRunnerDisposables.clear(), this._actionRunnerDisposables.add(this._actionRunner.onDidRun((t) => this._onDidRun.fire(t))), this._actionRunnerDisposables.add(this._actionRunner.onWillRun((t) => this._onWillRun.fire(t))), this.viewItems.forEach((t) => t.actionRunner = e);
  }
  getContainer() {
    return this.domNode;
  }
  getAction(e) {
    var t;
    if (typeof e == "number")
      return (t = this.viewItems[e]) == null ? void 0 : t.action;
    if (eo(e)) {
      for (; e.parentElement !== this.actionsList; ) {
        if (!e.parentElement)
          return;
        e = e.parentElement;
      }
      for (let n = 0; n < this.actionsList.childNodes.length; n++)
        if (this.actionsList.childNodes[n] === e)
          return this.viewItems[n].action;
    }
  }
  push(e, t = {}) {
    const n = Array.isArray(e) ? e : [e];
    let r = zy(t.index) ? t.index : null;
    if (n.forEach((s) => {
      const o = document.createElement("li");
      o.className = "action-item", o.setAttribute("role", "presentation");
      let a;
      const l = { hoverDelegate: this._hoverDelegate, ...t, isTabList: this.options.ariaRole === "tablist" };
      this.options.actionViewItemProvider && (a = this.options.actionViewItemProvider(s, l)), a || (a = new lA(this.context, s, l)), this.options.allowContextMenu || this.viewItemDisposables.set(a, Ce(o, Xe.CONTEXT_MENU, (c) => {
        Mi.stop(c, !0);
      })), a.actionRunner = this._actionRunner, a.setActionContext(this.context), a.render(o), r === null || r < 0 || r >= this.actionsList.children.length ? (this.actionsList.appendChild(o), this.viewItems.push(a)) : (this.actionsList.insertBefore(o, this.actionsList.children[r]), this.viewItems.splice(r, 0, a), r++);
    }), this.focusable) {
      let s = !1;
      for (const o of this.viewItems) {
        if (!(o instanceof zp))
          continue;
        let a;
        s || o.action.id === fa.ID || !o.isEnabled() && this.options.focusOnlyEnabledItems ? a = !1 : a = !0, a ? (o.setFocusable(!0), s = !0) : o.setFocusable(!1);
      }
    }
    typeof this.focusedItem == "number" && this.focus(this.focusedItem), this.refreshRole();
  }
  clear() {
    this.isEmpty() || (this.viewItems = or(this.viewItems), this.viewItemDisposables.clearAndDisposeAll(), Xa(this.actionsList), this.refreshRole());
  }
  length() {
    return this.viewItems.length;
  }
  isEmpty() {
    return this.viewItems.length === 0;
  }
  focus(e) {
    let t = !1, n;
    if (e === void 0 ? t = !0 : typeof e == "number" ? n = e : typeof e == "boolean" && (t = e), t && typeof this.focusedItem > "u") {
      const r = this.viewItems.findIndex((s) => s.isEnabled());
      this.focusedItem = r === -1 ? void 0 : r, this.updateFocus(void 0, void 0, !0);
    } else
      n !== void 0 && (this.focusedItem = n), this.updateFocus(void 0, void 0, !0);
  }
  focusFirst() {
    return this.focusedItem = this.length() - 1, this.focusNext(!0);
  }
  focusLast() {
    return this.focusedItem = 0, this.focusPrevious(!0);
  }
  focusNext(e, t) {
    if (typeof this.focusedItem > "u")
      this.focusedItem = this.viewItems.length - 1;
    else if (this.viewItems.length <= 1)
      return !1;
    const n = this.focusedItem;
    let r;
    do {
      if (!e && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length)
        return this.focusedItem = n, !1;
      this.focusedItem = (this.focusedItem + 1) % this.viewItems.length, r = this.viewItems[this.focusedItem];
    } while (this.focusedItem !== n && (this.options.focusOnlyEnabledItems && !r.isEnabled() || r.action.id === fa.ID));
    return this.updateFocus(void 0, void 0, t), !0;
  }
  focusPrevious(e) {
    if (typeof this.focusedItem > "u")
      this.focusedItem = 0;
    else if (this.viewItems.length <= 1)
      return !1;
    const t = this.focusedItem;
    let n;
    do {
      if (this.focusedItem = this.focusedItem - 1, this.focusedItem < 0) {
        if (!e && this.options.preventLoopNavigation)
          return this.focusedItem = t, !1;
        this.focusedItem = this.viewItems.length - 1;
      }
      n = this.viewItems[this.focusedItem];
    } while (this.focusedItem !== t && (this.options.focusOnlyEnabledItems && !n.isEnabled() || n.action.id === fa.ID));
    return this.updateFocus(!0), !0;
  }
  updateFocus(e, t, n = !1) {
    var s, o;
    typeof this.focusedItem > "u" && this.actionsList.focus({ preventScroll: t }), this.previouslyFocusedItem !== void 0 && this.previouslyFocusedItem !== this.focusedItem && ((s = this.viewItems[this.previouslyFocusedItem]) == null || s.blur());
    const r = this.focusedItem !== void 0 ? this.viewItems[this.focusedItem] : void 0;
    if (r) {
      let a = !0;
      ZL(r.focus) || (a = !1), this.options.focusOnlyEnabledItems && ZL(r.isEnabled) && !r.isEnabled() && (a = !1), r.action.id === fa.ID && (a = !1), a ? (n || this.previouslyFocusedItem !== this.focusedItem) && (r.focus(e), this.previouslyFocusedItem = this.focusedItem) : (this.actionsList.focus({ preventScroll: t }), this.previouslyFocusedItem = void 0), a && ((o = r.showHover) == null || o.call(r));
    }
  }
  doTrigger(e) {
    if (typeof this.focusedItem > "u")
      return;
    const t = this.viewItems[this.focusedItem];
    if (t instanceof zp) {
      const n = t._context === null || t._context === void 0 ? e : t._context;
      this.run(t._action, n);
    }
  }
  async run(e, t) {
    await this._actionRunner.run(e, t);
  }
  dispose() {
    this._context = void 0, this.viewItems = or(this.viewItems), this.getContainer().remove(), super.dispose();
  }
}
function evt(i, e, t, n) {
  if (i.length === 0)
    return e;
  if (e.length === 0)
    return i;
  const r = [];
  let s = 0, o = 0;
  for (; s < i.length && o < e.length; ) {
    const a = i[s], l = e[o], c = t(a), u = t(l);
    c < u ? (r.push(a), s++) : c > u ? (r.push(l), o++) : (r.push(n(a, l)), s++, o++);
  }
  for (; s < i.length; )
    r.push(i[s]), s++;
  for (; o < e.length; )
    r.push(e[o]), o++;
  return r;
}
function IU(i, e) {
  const t = new ke(), n = i.createDecorationsCollection();
  return t.add(vq({ debugName: () => `Apply decorations from ${e.debugName}` }, (r) => {
    const s = e.read(r);
    n.set(s);
  })), t.add({
    dispose: () => {
      n.clear();
    }
  }), t;
}
function hN(i, e) {
  return i.appendChild(e), Et(() => {
    e.remove();
  });
}
function tvt(i, e) {
  return i.prepend(e), Et(() => {
    e.remove();
  });
}
class l5e extends ge {
  get width() {
    return this._width;
  }
  get height() {
    return this._height;
  }
  get automaticLayout() {
    return this._automaticLayout;
  }
  constructor(e, t) {
    super(), this._automaticLayout = !1, this.elementSizeObserver = this._register(new CFe(e, t)), this._width = Qt(this, this.elementSizeObserver.getWidth()), this._height = Qt(this, this.elementSizeObserver.getHeight()), this._register(this.elementSizeObserver.onDidChange((n) => Fr((r) => {
      this._width.set(this.elementSizeObserver.getWidth(), r), this._height.set(this.elementSizeObserver.getHeight(), r);
    })));
  }
  observe(e) {
    this.elementSizeObserver.observe(e);
  }
  setAutomaticLayout(e) {
    this._automaticLayout = e, e ? this.elementSizeObserver.startObserving() : this.elementSizeObserver.stopObserving();
  }
}
function Ske(i, e, t) {
  let n = e.get(), r = n, s = n;
  const o = Qt("animatedValue", n);
  let a = -1;
  const l = 300;
  let c;
  t.add(GA({
    changeTracker: {
      createChangeSummary: () => ({ animate: !1 }),
      handleChange: (d, h) => (d.didChange(e) && (h.animate = h.animate || d.change), !0)
    }
  }, (d, h) => {
    c !== void 0 && (i.cancelAnimationFrame(c), c = void 0), r = s, n = e.read(d), a = Date.now() - (h.animate ? 0 : l), u();
  }));
  function u() {
    const d = Date.now() - a;
    s = Math.floor(nvt(d, r, n - r, l)), d < l ? c = i.requestAnimationFrame(u) : s = n, o.set(s, void 0);
  }
  return o;
}
function nvt(i, e, t, n) {
  return i === n ? e + t : t * (-Math.pow(2, -10 * i / n) + 1) + e;
}
class Sge extends ge {
  constructor(e, t, n) {
    super(), this._register(new tse(e, n)), this._register(dw(n, {
      height: t.actualHeight,
      top: t.actualTop
    }));
  }
}
class fN {
  get afterLineNumber() {
    return this._afterLineNumber.get();
  }
  constructor(e, t) {
    this._afterLineNumber = e, this.heightInPx = t, this.domNode = document.createElement("div"), this._actualTop = Qt(this, void 0), this._actualHeight = Qt(this, void 0), this.actualTop = this._actualTop, this.actualHeight = this._actualHeight, this.showInHiddenAreas = !0, this.onChange = this._afterLineNumber, this.onDomNodeTop = (n) => {
      this._actualTop.set(n, void 0);
    }, this.onComputedHeight = (n) => {
      this._actualHeight.set(n, void 0);
    };
  }
}
const Zj = class Zj {
  constructor(e, t) {
    this._editor = e, this._domElement = t, this._overlayWidgetId = `managedOverlayWidget-${Zj._counter++}`, this._overlayWidget = {
      getId: () => this._overlayWidgetId,
      getDomNode: () => this._domElement,
      getPosition: () => null
    }, this._editor.addOverlayWidget(this._overlayWidget);
  }
  dispose() {
    this._editor.removeOverlayWidget(this._overlayWidget);
  }
};
Zj._counter = 0;
let tse = Zj;
function dw(i, e) {
  return Xt((t) => {
    for (let [n, r] of Object.entries(e))
      r && typeof r == "object" && "read" in r && (r = r.read(t)), typeof r == "number" && (r = `${r}px`), n = n.replace(/[A-Z]/g, (s) => "-" + s.toLowerCase()), i.style[n] = r;
  });
}
function NU(i, e, t, n) {
  const r = new ke(), s = [];
  return r.add(Ql((o, a) => {
    const l = e.read(o), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
    t && t(!0), i.changeViewZones((d) => {
      for (const h of s)
        d.removeZone(h), n == null || n.delete(h);
      s.length = 0;
      for (const h of l) {
        const g = d.addZone(h);
        h.setZoneId && h.setZoneId(g), s.push(g), n == null || n.add(g), c.set(h, g);
      }
    }), t && t(!1), a.add(GA({
      changeTracker: {
        createChangeSummary() {
          return { zoneIds: [] };
        },
        handleChange(d, h) {
          const g = u.get(d.changedObservable);
          return g !== void 0 && h.zoneIds.push(g), !0;
        }
      }
    }, (d, h) => {
      for (const g of l)
        g.onChange && (u.set(g.onChange, c.get(g)), g.onChange.read(d));
      t && t(!0), i.changeViewZones((g) => {
        for (const m of h.zoneIds)
          g.layoutZone(m);
      }), t && t(!1);
    }));
  })), r.add({
    dispose() {
      t && t(!0), i.changeViewZones((o) => {
        for (const a of s)
          o.removeZone(a);
      }), n == null || n.clear(), t && t(!1);
    }
  }), r;
}
class ivt extends Ss {
  dispose() {
    super.dispose(!0);
  }
}
function Eke(i, e) {
  const t = w4(e, (r) => r.original.startLineNumber <= i.lineNumber);
  if (!t)
    return z.fromPositions(i);
  if (t.original.endLineNumberExclusive <= i.lineNumber) {
    const r = i.lineNumber - t.original.endLineNumberExclusive + t.modified.endLineNumberExclusive;
    return z.fromPositions(new de(r, i.column));
  }
  if (!t.innerChanges)
    return z.fromPositions(new de(t.modified.startLineNumber, 1));
  const n = w4(t.innerChanges, (r) => r.originalRange.getStartPosition().isBeforeOrEqual(i));
  if (!n) {
    const r = i.lineNumber - t.original.startLineNumber + t.modified.startLineNumber;
    return z.fromPositions(new de(r, i.column));
  }
  if (n.originalRange.containsPosition(i))
    return n.modifiedRange;
  {
    const r = rvt(n.originalRange.getEndPosition(), i);
    return z.fromPositions(r.addToPosition(n.modifiedRange.getEndPosition()));
  }
}
function rvt(i, e) {
  return i.lineNumber === e.lineNumber ? new ta(0, e.column - i.column) : new ta(e.lineNumber - i.lineNumber, e.column - 1);
}
function svt(i, e) {
  let t;
  return i.filter((n) => {
    const r = e(n, t);
    return t = n, r;
  });
}
class RU {
  static create(e, t = void 0) {
    return new xke(e, e, t);
  }
  static createWithDisposable(e, t, n = void 0) {
    const r = new ke();
    return r.add(t), r.add(e), new xke(e, r, n);
  }
}
class xke extends RU {
  constructor(e, t, n) {
    super(), this.object = e, this._disposable = t, this._debugOwner = n, this._refCount = 1, this._isDisposed = !1, this._owners = [], n && this._addOwner(n);
  }
  _addOwner(e) {
    e && this._owners.push(e);
  }
  createNewRef(e) {
    return this._refCount++, e && this._addOwner(e), new ovt(this, e);
  }
  dispose() {
    this._isDisposed || (this._isDisposed = !0, this._decreaseRefCount(this._debugOwner));
  }
  _decreaseRefCount(e) {
    if (this._refCount--, this._refCount === 0 && this._disposable.dispose(), e) {
      const t = this._owners.indexOf(e);
      t !== -1 && this._owners.splice(t, 1);
    }
  }
}
class ovt extends RU {
  constructor(e, t) {
    super(), this._base = e, this._debugOwner = t, this._isDisposed = !1;
  }
  get object() {
    return this._base.object;
  }
  createNewRef(e) {
    return this._base.createNewRef(e);
  }
  dispose() {
    this._isDisposed || (this._isDisposed = !0, this._base._decreaseRefCount(this._debugOwner));
  }
}
class wc {
  static inverse(e, t, n) {
    const r = [];
    let s = 1, o = 1;
    for (const l of e) {
      const c = new wc(new Zt(s, l.original.startLineNumber), new Zt(o, l.modified.startLineNumber));
      c.modified.isEmpty || r.push(c), s = l.original.endLineNumberExclusive, o = l.modified.endLineNumberExclusive;
    }
    const a = new wc(new Zt(s, t + 1), new Zt(o, n + 1));
    return a.modified.isEmpty || r.push(a), r;
  }
  static clip(e, t, n) {
    const r = [];
    for (const s of e) {
      const o = s.original.intersect(t), a = s.modified.intersect(n);
      o && !o.isEmpty && a && !a.isEmpty && r.push(new wc(o, a));
    }
    return r;
  }
  constructor(e, t) {
    this.original = e, this.modified = t;
  }
  toString() {
    return `{${this.original.toString()}->${this.modified.toString()}}`;
  }
  flip() {
    return new wc(this.modified, this.original);
  }
  join(e) {
    return new wc(this.original.join(e.original), this.modified.join(e.modified));
  }
  /**
   * This method assumes that the LineRangeMapping describes a valid diff!
   * I.e. if one range is empty, the other range cannot be the entire document.
   * It avoids various problems when the line range points to non-existing line-numbers.
  */
  toRangeMapping() {
    const e = this.original.toInclusiveRange(), t = this.modified.toInclusiveRange();
    if (e && t)
      return new nu(e, t);
    if (this.original.startLineNumber === 1 || this.modified.startLineNumber === 1) {
      if (!(this.modified.startLineNumber === 1 && this.original.startLineNumber === 1))
        throw new Wt("not a valid diff");
      return new nu(new z(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new z(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
    } else
      return new nu(new z(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), new z(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER));
  }
  /**
   * This method assumes that the LineRangeMapping describes a valid diff!
   * I.e. if one range is empty, the other range cannot be the entire document.
   * It avoids various problems when the line range points to non-existing line-numbers.
  */
  toRangeMapping2(e, t) {
    if (Lke(this.original.endLineNumberExclusive, e) && Lke(this.modified.endLineNumberExclusive, t))
      return new nu(new z(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new z(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
    if (!this.original.isEmpty && !this.modified.isEmpty)
      return new nu(z.fromPositions(new de(this.original.startLineNumber, 1), bI(new de(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), e)), z.fromPositions(new de(this.modified.startLineNumber, 1), bI(new de(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), t)));
    if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1)
      return new nu(z.fromPositions(bI(new de(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER), e), bI(new de(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), e)), z.fromPositions(bI(new de(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER), t), bI(new de(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), t)));
    throw new Wt();
  }
}
function bI(i, e) {
  if (i.lineNumber < 1)
    return new de(1, 1);
  if (i.lineNumber > e.length)
    return new de(e.length, e[e.length - 1].length + 1);
  const t = e[i.lineNumber - 1];
  return i.column > t.length + 1 ? new de(i.lineNumber, t.length + 1) : i;
}
function Lke(i, e) {
  return i >= 1 && i <= e.length;
}
class jh extends wc {
  static fromRangeMappings(e) {
    const t = Zt.join(e.map((r) => Zt.fromRangeInclusive(r.originalRange))), n = Zt.join(e.map((r) => Zt.fromRangeInclusive(r.modifiedRange)));
    return new jh(t, n, e);
  }
  constructor(e, t, n) {
    super(e, t), this.innerChanges = n;
  }
  flip() {
    var e;
    return new jh(this.modified, this.original, (e = this.innerChanges) == null ? void 0 : e.map((t) => t.flip()));
  }
  withInnerChangesFromLineRanges() {
    return new jh(this.original, this.modified, [this.toRangeMapping()]);
  }
}
class nu {
  static fromEdit(e) {
    const t = e.getNewRanges();
    return e.replacements.map((r, s) => new nu(r.range, t[s]));
  }
  static assertSorted(e) {
    for (let t = 1; t < e.length; t++) {
      const n = e[t - 1], r = e[t];
      if (!(n.originalRange.getEndPosition().isBeforeOrEqual(r.originalRange.getStartPosition()) && n.modifiedRange.getEndPosition().isBeforeOrEqual(r.modifiedRange.getStartPosition())))
        throw new Wt("Range mappings must be sorted");
    }
  }
  constructor(e, t) {
    this.originalRange = e, this.modifiedRange = t;
  }
  toString() {
    return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;
  }
  flip() {
    return new nu(this.modifiedRange, this.originalRange);
  }
  /**
   * Creates a single text edit that describes the change from the original to the modified text.
  */
  toTextEdit(e) {
    const t = e.getValueOfRange(this.modifiedRange);
    return new Wo(this.originalRange, t);
  }
}
function AU(i, e, t, n = !1) {
  const r = [];
  for (const s of jhe(i.map((o) => avt(o, e, t)), (o, a) => o.original.intersectsOrTouches(a.original) || o.modified.intersectsOrTouches(a.modified))) {
    const o = s[0], a = s[s.length - 1];
    r.push(new jh(o.original.join(a.original), o.modified.join(a.modified), s.map((l) => l.innerChanges[0])));
  }
  return J1(() => !n && r.length > 0 && (r[0].modified.startLineNumber !== r[0].original.startLineNumber || t.length.lineCount - r[r.length - 1].modified.endLineNumberExclusive !== e.length.lineCount - r[r.length - 1].original.endLineNumberExclusive) ? !1 : hB(r, (s, o) => o.original.startLineNumber - s.original.endLineNumberExclusive === o.modified.startLineNumber - s.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined)
  s.original.endLineNumberExclusive < o.original.startLineNumber && s.modified.endLineNumberExclusive < o.modified.startLineNumber)), r;
}
function avt(i, e, t) {
  let n = 0, r = 0;
  i.modifiedRange.endColumn === 1 && i.originalRange.endColumn === 1 && i.originalRange.startLineNumber + n <= i.originalRange.endLineNumber && i.modifiedRange.startLineNumber + n <= i.modifiedRange.endLineNumber && (r = -1), i.modifiedRange.startColumn - 1 >= t.getLineLength(i.modifiedRange.startLineNumber) && i.originalRange.startColumn - 1 >= e.getLineLength(i.originalRange.startLineNumber) && i.originalRange.startLineNumber <= i.originalRange.endLineNumber + r && i.modifiedRange.startLineNumber <= i.modifiedRange.endLineNumber + r && (n = 1);
  const s = new Zt(i.originalRange.startLineNumber + n, i.originalRange.endLineNumber + 1 + r), o = new Zt(i.modifiedRange.startLineNumber + n, i.modifiedRange.endLineNumber + 1 + r);
  return new jh(s, o, [i]);
}
const lvt = {
  IconContribution: "base.contributions.icons"
};
var Tke;
(function(i) {
  function e(t, n) {
    let r = t.defaults;
    for (; qt.isThemeIcon(r); ) {
      const s = QT.getIcon(r.id);
      if (!s)
        return;
      r = s.defaults;
    }
    return r;
  }
  i.getDefinition = e;
})(Tke || (Tke = {}));
var kke;
(function(i) {
  function e(n) {
    return {
      weight: n.weight,
      style: n.style,
      src: n.src.map((r) => ({ format: r.format, location: r.location.toString() }))
    };
  }
  i.toJSONObject = e;
  function t(n) {
    const r = (s) => ga(s) ? s : void 0;
    if (n && Array.isArray(n.src) && n.src.every((s) => ga(s.format) && ga(s.location)))
      return {
        weight: r(n.weight),
        style: r(n.style),
        src: n.src.map((s) => ({ format: s.format, location: Ht.parse(s.location) }))
      };
  }
  i.fromJSONObject = t;
})(kke || (kke = {}));
const cvt = /^([\w_-]+)$/, uvt = S(2006, "The font ID must only contain letters, numbers, underscores and dashes.");
class dvt extends ge {
  constructor() {
    super(), this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event, this.iconSchema = {
      definitions: {
        icons: {
          type: "object",
          properties: {
            fontId: { type: "string", description: S(2007, "The id of the font to use. If not set, the font that is defined first is used."), pattern: cvt.source, patternErrorMessage: uvt },
            fontCharacter: { type: "string", description: S(2008, "The font character associated with the icon definition.") }
          },
          additionalProperties: !1,
          defaultSnippets: [{ body: { fontCharacter: "\\\\e030" } }]
        }
      },
      type: "object",
      properties: {}
    }, this.iconReferenceSchema = { type: "string", pattern: `^${qt.iconNameExpression}$`, enum: [], enumDescriptions: [] }, this.iconsById = {}, this.iconFontsById = {};
  }
  registerIcon(e, t, n, r) {
    const s = this.iconsById[e];
    if (s) {
      if (n && !s.description) {
        s.description = n, this.iconSchema.properties[e].markdownDescription = `${n} $(${e})`;
        const l = this.iconReferenceSchema.enum.indexOf(e);
        l !== -1 && (this.iconReferenceSchema.enumDescriptions[l] = n), this._onDidChange.fire();
      }
      return s;
    }
    const o = { id: e, description: n, defaults: t, deprecationMessage: r };
    this.iconsById[e] = o;
    const a = { $ref: "#/definitions/icons" };
    return r && (a.deprecationMessage = r), n && (a.markdownDescription = `${n}: $(${e})`), this.iconSchema.properties[e] = a, this.iconReferenceSchema.enum.push(e), this.iconReferenceSchema.enumDescriptions.push(n || ""), this._onDidChange.fire(), { id: e };
  }
  getIcons() {
    return Object.keys(this.iconsById).map((e) => this.iconsById[e]);
  }
  getIcon(e) {
    return this.iconsById[e];
  }
  getIconSchema() {
    return this.iconSchema;
  }
  toString() {
    const e = (s, o) => s.id.localeCompare(o.id), t = (s) => {
      for (; qt.isThemeIcon(s.defaults); )
        s = this.iconsById[s.defaults.id];
      return `codicon codicon-${s ? s.id : ""}`;
    }, n = [];
    n.push("| preview     | identifier                        | default codicon ID                | description"), n.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");
    const r = Object.keys(this.iconsById).map((s) => this.iconsById[s]);
    for (const s of r.filter((o) => !!o.description).sort(e))
      n.push(`|<i class="${t(s)}"></i>|${s.id}|${qt.isThemeIcon(s.defaults) ? s.defaults.id : s.id}|${s.description || ""}|`);
    n.push("| preview     | identifier                        "), n.push("| ----------- | --------------------------------- |");
    for (const s of r.filter((o) => !qt.isThemeIcon(o.defaults)).sort(e))
      n.push(`|<i class="${t(s)}"></i>|${s.id}|`);
    return n.join(`
`);
  }
}
const QT = new dvt();
Fs.add(lvt.IconContribution, QT);
function es(i, e, t, n) {
  return QT.registerIcon(i, e, t, n);
}
function c5e() {
  return QT;
}
function hvt() {
  const i = BPe();
  for (const e in i) {
    const t = "\\" + i[e].toString(16);
    QT.registerIcon(e, { fontCharacter: t });
  }
}
hvt();
const u5e = "vscode://schemas/icons", d5e = Fs.as(Bq.JSONContribution);
d5e.registerSchema(u5e, QT.getIconSchema());
const Dke = new mr(() => d5e.notifySchemaChanged(u5e), 200);
QT.onDidChange(() => {
  Dke.isScheduled() || Dke.schedule();
});
const h5e = es("widget-close", Pe.close, S(2009, "Icon for the close action in widgets."));
es("goto-previous-location", Pe.arrowUp, S(2010, "Icon for goto previous editor location."));
es("goto-next-location", Pe.arrowDown, S(2011, "Icon for goto next editor location."));
qt.modify(Pe.sync, "spin");
qt.modify(Pe.loading, "spin");
var Ege = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, xge = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const fvt = es("diff-review-insert", Pe.add, S(94, "Icon for 'Insert' in accessible diff viewer.")), gvt = es("diff-review-remove", Pe.remove, S(95, "Icon for 'Remove' in accessible diff viewer.")), pvt = es("diff-review-close", Pe.close, S(96, "Icon for 'Close' in accessible diff viewer."));
var wR;
let bx = (wR = class extends ge {
  constructor(e, t, n, r, s, o, a, l, c) {
    super(), this._parentNode = e, this._visible = t, this._setVisible = n, this._canClose = r, this._width = s, this._height = o, this._diffs = a, this._models = l, this._instantiationService = c, this._state = Ie(this, (u) => {
      const d = this._visible.read(u);
      if (this._parentNode.style.visibility = d ? "visible" : "hidden", !d)
        return null;
      const h = u.store.add(this._instantiationService.createInstance(nse, this._diffs, this._models, this._setVisible, this._canClose)), g = u.store.add(this._instantiationService.createInstance(ise, this._parentNode, h, this._width, this._height, this._models));
      return { model: h, view: g };
    }).recomputeInitiallyAndOnChange(this._store);
  }
  next() {
    Fr((e) => {
      const t = this._visible.get();
      this._setVisible(!0, e), t && this._state.get().model.nextGroup(e);
    });
  }
  prev() {
    Fr((e) => {
      this._setVisible(!0, e), this._state.get().model.previousGroup(e);
    });
  }
  close() {
    Fr((e) => {
      this._setVisible(!1, e);
    });
  }
}, wR._ttPolicy = Db("diffReview", { createHTML: (e) => e }), wR);
bx = Ege([
  xge(8, xt)
], bx);
let nse = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._diffs = e, this._models = t, this._setVisible = n, this.canClose = r, this._accessibilitySignalService = s, this._groups = Qt(this, []), this._currentGroupIdx = Qt(this, 0), this._currentElementIdx = Qt(this, 0), this.groups = this._groups, this.currentGroup = this._currentGroupIdx.map((o, a) => this._groups.read(a)[o]), this.currentGroupIndex = this._currentGroupIdx, this.currentElement = this._currentElementIdx.map((o, a) => {
      var l;
      return (l = this.currentGroup.read(a)) == null ? void 0 : l.lines[o];
    }), this._register(Xt((o) => {
      const a = this._diffs.read(o);
      if (!a) {
        this._groups.set([], void 0);
        return;
      }
      const l = mvt(a, this._models.getOriginalModel().getLineCount(), this._models.getModifiedModel().getLineCount());
      Fr((c) => {
        const u = this._models.getModifiedPosition();
        if (u) {
          const d = l.findIndex((h) => (u == null ? void 0 : u.lineNumber) < h.range.modified.endLineNumberExclusive);
          d !== -1 && this._currentGroupIdx.set(d, c);
        }
        this._groups.set(l, c);
      });
    })), this._register(Xt((o) => {
      const a = this.currentElement.read(o);
      (a == null ? void 0 : a.type) === iu.Deleted ? this._accessibilitySignalService.playSignal(tu.diffLineDeleted, { source: "accessibleDiffViewer.currentElementChanged" }) : (a == null ? void 0 : a.type) === iu.Added && this._accessibilitySignalService.playSignal(tu.diffLineInserted, { source: "accessibleDiffViewer.currentElementChanged" });
    })), this._register(Xt((o) => {
      const a = this.currentElement.read(o);
      if (a && a.type !== iu.Header) {
        const l = a.modifiedLineNumber ?? a.diff.modified.startLineNumber;
        this._models.modifiedSetSelection(z.fromPositions(new de(l, 1)));
      }
    }));
  }
  _goToGroupDelta(e, t) {
    const n = this.groups.get();
    !n || n.length <= 1 || Ax(t, (r) => {
      this._currentGroupIdx.set(Tt.ofLength(n.length).clipCyclic(this._currentGroupIdx.get() + e), r), this._currentElementIdx.set(0, r);
    });
  }
  nextGroup(e) {
    this._goToGroupDelta(1, e);
  }
  previousGroup(e) {
    this._goToGroupDelta(-1, e);
  }
  _goToLineDelta(e) {
    const t = this.currentGroup.get();
    !t || t.lines.length <= 1 || Fr((n) => {
      this._currentElementIdx.set(Tt.ofLength(t.lines.length).clip(this._currentElementIdx.get() + e), n);
    });
  }
  goToNextLine() {
    this._goToLineDelta(1);
  }
  goToPreviousLine() {
    this._goToLineDelta(-1);
  }
  goToLine(e) {
    const t = this.currentGroup.get();
    if (!t)
      return;
    const n = t.lines.indexOf(e);
    n !== -1 && Fr((r) => {
      this._currentElementIdx.set(n, r);
    });
  }
  revealCurrentElementInEditor() {
    if (!this.canClose.get())
      return;
    this._setVisible(!1, void 0);
    const e = this.currentElement.get();
    e && (e.type === iu.Deleted ? this._models.originalReveal(z.fromPositions(new de(e.originalLineNumber, 1))) : this._models.modifiedReveal(e.type !== iu.Header ? z.fromPositions(new de(e.modifiedLineNumber, 1)) : void 0));
  }
  close() {
    this.canClose.get() && (this._setVisible(!1, void 0), this._models.modifiedFocus());
  }
};
nse = Ege([
  xge(4, h0)
], nse);
const tP = 3;
function mvt(i, e, t) {
  const n = [];
  for (const r of jhe(i, (s, o) => o.modified.startLineNumber - s.modified.endLineNumberExclusive < 2 * tP)) {
    const s = [];
    s.push(new bvt());
    const o = new Zt(Math.max(1, r[0].original.startLineNumber - tP), Math.min(r[r.length - 1].original.endLineNumberExclusive + tP, e + 1)), a = new Zt(Math.max(1, r[0].modified.startLineNumber - tP), Math.min(r[r.length - 1].modified.endLineNumberExclusive + tP, t + 1));
    hPe(r, (u, d) => {
      const h = new Zt(u ? u.original.endLineNumberExclusive : o.startLineNumber, d ? d.original.startLineNumber : o.endLineNumberExclusive), g = new Zt(u ? u.modified.endLineNumberExclusive : a.startLineNumber, d ? d.modified.startLineNumber : a.endLineNumberExclusive);
      h.forEach((m) => {
        s.push(new Cvt(m, g.startLineNumber + (m - h.startLineNumber)));
      }), d && (d.original.forEach((m) => {
        s.push(new vvt(d, m));
      }), d.modified.forEach((m) => {
        s.push(new yvt(d, m));
      }));
    });
    const l = r[0].modified.join(r[r.length - 1].modified), c = r[0].original.join(r[r.length - 1].original);
    n.push(new _vt(new wc(l, c), s));
  }
  return n;
}
var iu;
(function(i) {
  i[i.Header = 0] = "Header", i[i.Unchanged = 1] = "Unchanged", i[i.Deleted = 2] = "Deleted", i[i.Added = 3] = "Added";
})(iu || (iu = {}));
class _vt {
  constructor(e, t) {
    this.range = e, this.lines = t;
  }
}
class bvt {
  constructor() {
    this.type = iu.Header;
  }
}
class vvt {
  constructor(e, t) {
    this.diff = e, this.originalLineNumber = t, this.type = iu.Deleted, this.modifiedLineNumber = void 0;
  }
}
class yvt {
  constructor(e, t) {
    this.diff = e, this.modifiedLineNumber = t, this.type = iu.Added, this.originalLineNumber = void 0;
  }
}
class Cvt {
  constructor(e, t) {
    this.originalLineNumber = e, this.modifiedLineNumber = t, this.type = iu.Unchanged;
  }
}
let ise = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._element = e, this._model = t, this._width = n, this._height = r, this._models = s, this._languageService = o, this.domNode = this._element, this.domNode.className = "monaco-component diff-review monaco-editor-background";
    const a = document.createElement("div");
    a.className = "diff-review-actions", this._actionBar = this._register(new qu(a)), this._register(Xt((l) => {
      this._actionBar.clear(), this._model.canClose.read(l) && this._actionBar.push(Ox({
        id: "diffreview.close",
        label: S(97, "Close"),
        class: "close-diff-review " + qt.asClassName(pvt),
        enabled: !0,
        run: async () => t.close()
      }), { label: !1, icon: !0 });
    })), this._content = document.createElement("div"), this._content.className = "diff-review-content", this._content.setAttribute("role", "code"), this._scrollbar = this._register(new LB(this._content, {})), ma(this.domNode, this._scrollbar.getDomNode(), a), this._register(Xt((l) => {
      this._height.read(l), this._width.read(l), this._scrollbar.scanDomNode();
    })), this._register(Et(() => {
      ma(this.domNode);
    })), this._register(dw(this.domNode, { width: this._width, height: this._height })), this._register(dw(this._content, { width: this._width, height: this._height })), this._register(Ql((l, c) => {
      this._model.currentGroup.read(l), this._render(c);
    })), this._register(vo(this.domNode, "keydown", (l) => {
      (l.equals(
        18
        /* KeyCode.DownArrow */
      ) || l.equals(
        2066
        /* KeyCode.DownArrow */
      ) || l.equals(
        530
        /* KeyCode.DownArrow */
      )) && (l.preventDefault(), this._model.goToNextLine()), (l.equals(
        16
        /* KeyCode.UpArrow */
      ) || l.equals(
        2064
        /* KeyCode.UpArrow */
      ) || l.equals(
        528
        /* KeyCode.UpArrow */
      )) && (l.preventDefault(), this._model.goToPreviousLine()), (l.equals(
        9
        /* KeyCode.Escape */
      ) || l.equals(
        2057
        /* KeyCode.Escape */
      ) || l.equals(
        521
        /* KeyCode.Escape */
      ) || l.equals(
        1033
        /* KeyCode.Escape */
      )) && (l.preventDefault(), this._model.close()), (l.equals(
        10
        /* KeyCode.Space */
      ) || l.equals(
        3
        /* KeyCode.Enter */
      )) && (l.preventDefault(), this._model.revealCurrentElementInEditor());
    }));
  }
  _render(e) {
    const t = this._models.getOriginalOptions(), n = this._models.getModifiedOptions(), r = document.createElement("div");
    r.className = "diff-review-table", r.setAttribute("role", "list"), r.setAttribute("aria-label", S(98, "Accessible Diff Viewer. Use arrow up and down to navigate.")), Ma(r, n.get(
      59
      /* EditorOption.fontInfo */
    )), ma(this._content, r);
    const s = this._models.getOriginalModel(), o = this._models.getModifiedModel();
    if (!s || !o)
      return;
    const a = s.getOptions(), l = o.getOptions(), c = n.get(
      75
      /* EditorOption.lineHeight */
    ), u = this._model.currentGroup.get();
    for (const d of (u == null ? void 0 : u.lines) || []) {
      if (!u)
        break;
      let h;
      if (d.type === iu.Header) {
        const m = document.createElement("div");
        m.className = "diff-review-row", m.setAttribute("role", "listitem");
        const _ = u.range, v = this._model.currentGroupIndex.get(), w = this._model.groups.get().length, E = (N) => N === 0 ? S(99, "no lines changed") : N === 1 ? S(100, "1 line changed") : S(101, "{0} lines changed", N), L = E(_.original.length), T = E(_.modified.length);
        m.setAttribute("aria-label", S(102, "Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}", v + 1, w, _.original.startLineNumber, L, _.modified.startLineNumber, T));
        const D = document.createElement("div");
        D.className = "diff-review-cell diff-review-summary", D.appendChild(document.createTextNode(`${v + 1}/${w}: @@ -${_.original.startLineNumber},${_.original.length} +${_.modified.startLineNumber},${_.modified.length} @@`)), m.appendChild(D), h = m;
      } else
        h = this._createRow(d, c, this._width.get(), t, s, a, n, o, l);
      r.appendChild(h);
      const g = Ie((m) => (
        /** @description isSelected */
        this._model.currentElement.read(m) === d
      ));
      e.add(Xt((m) => {
        const _ = g.read(m);
        h.tabIndex = _ ? 0 : -1, _ && h.focus();
      })), e.add(Ce(h, "focus", () => {
        this._model.goToLine(d);
      }));
    }
    this._scrollbar.scanDomNode();
  }
  _createRow(e, t, n, r, s, o, a, l, c) {
    const u = r.get(
      165
      /* EditorOption.layoutInfo */
    ), d = u.glyphMarginWidth + u.lineNumbersWidth, h = a.get(
      165
      /* EditorOption.layoutInfo */
    ), g = 10 + h.glyphMarginWidth + h.lineNumbersWidth;
    let m = "diff-review-row", _ = "";
    const v = "diff-review-spacer";
    let w = null;
    switch (e.type) {
      case iu.Added:
        m = "diff-review-row line-insert", _ = " char-insert", w = fvt;
        break;
      case iu.Deleted:
        m = "diff-review-row line-delete", _ = " char-delete", w = gvt;
        break;
    }
    const E = document.createElement("div");
    E.style.minWidth = n + "px", E.className = m, E.setAttribute("role", "listitem"), E.ariaLevel = "";
    const L = document.createElement("div");
    L.className = "diff-review-cell", L.style.height = `${t}px`, E.appendChild(L);
    const T = document.createElement("span");
    T.style.width = d + "px", T.style.minWidth = d + "px", T.className = "diff-review-line-number" + _, e.originalLineNumber !== void 0 ? T.appendChild(document.createTextNode(String(e.originalLineNumber))) : T.innerText = " ", L.appendChild(T);
    const D = document.createElement("span");
    D.style.width = g + "px", D.style.minWidth = g + "px", D.style.paddingRight = "10px", D.className = "diff-review-line-number" + _, e.modifiedLineNumber !== void 0 ? D.appendChild(document.createTextNode(String(e.modifiedLineNumber))) : D.innerText = " ", L.appendChild(D);
    const N = document.createElement("span");
    if (N.className = v, w) {
      const B = document.createElement("span");
      B.className = qt.asClassName(w), B.innerText = "  ", N.appendChild(B);
    } else
      N.innerText = "  ";
    L.appendChild(N);
    let R;
    if (e.modifiedLineNumber !== void 0) {
      let B = this._getLineHtml(l, a, c.tabSize, e.modifiedLineNumber, this._languageService.languageIdCodec);
      bx._ttPolicy && (B = bx._ttPolicy.createHTML(B)), L.insertAdjacentHTML("beforeend", B), R = l.getLineContent(e.modifiedLineNumber);
    } else {
      let B = this._getLineHtml(s, r, o.tabSize, e.originalLineNumber, this._languageService.languageIdCodec);
      bx._ttPolicy && (B = bx._ttPolicy.createHTML(B)), L.insertAdjacentHTML("beforeend", B), R = s.getLineContent(e.originalLineNumber);
    }
    R.length === 0 && (R = S(103, "blank"));
    let M = "";
    switch (e.type) {
      case iu.Unchanged:
        e.originalLineNumber === e.modifiedLineNumber ? M = S(104, "{0} unchanged line {1}", R, e.originalLineNumber) : M = S(105, "{0} original line {1} modified line {2}", R, e.originalLineNumber, e.modifiedLineNumber);
        break;
      case iu.Added:
        M = S(106, "+ {0} modified line {1}", R, e.modifiedLineNumber);
        break;
      case iu.Deleted:
        M = S(107, "- {0} original line {1}", R, e.originalLineNumber);
        break;
    }
    return E.setAttribute("aria-label", M), E;
  }
  _getLineHtml(e, t, n, r, s) {
    const o = e.getLineContent(r), a = t.get(
      59
      /* EditorOption.fontInfo */
    ), l = t.get(
      117
      /* EditorOption.scrollbar */
    ).verticalScrollbarSize, c = fo.createEmpty(o, s), u = Kh.isBasicASCII(o, e.mightContainNonBasicASCII()), d = Kh.containsRTL(o, u, e.mightContainRTL());
    return Jq(new d0(a.isMonospace && !t.get(
      40
      /* EditorOption.disableMonospaceOptimizations */
    ), a.canUseHalfwidthRightwardsArrow, o, !1, u, d, 0, c, [], n, 0, a.spaceWidth, a.middotWidth, a.wsmiddotWidth, t.get(
      133
      /* EditorOption.stopRenderingLineAfter */
    ), t.get(
      113
      /* EditorOption.renderWhitespace */
    ), t.get(
      108
      /* EditorOption.renderControlCharacters */
    ), t.get(
      60
      /* EditorOption.fontLigatures */
    ) !== Yy.OFF, null, null, l)).html;
  }
};
ise = Ege([
  xge(5, Gr)
], ise);
class wvt {
  constructor(e) {
    this.editors = e;
  }
  getOriginalModel() {
    return this.editors.original.getModel();
  }
  getOriginalOptions() {
    return this.editors.original.getOptions();
  }
  originalReveal(e) {
    this.editors.original.revealRange(e), this.editors.original.setSelection(e), this.editors.original.focus();
  }
  getModifiedModel() {
    return this.editors.modified.getModel();
  }
  getModifiedOptions() {
    return this.editors.modified.getOptions();
  }
  modifiedReveal(e) {
    e && (this.editors.modified.revealRange(e), this.editors.modified.setSelection(e)), this.editors.modified.focus();
  }
  modifiedSetSelection(e) {
    this.editors.modified.setSelection(e);
  }
  modifiedFocus() {
    this.editors.modified.focus();
  }
  getModifiedPosition() {
    return this.editors.modified.getPosition() ?? void 0;
  }
}
ie("diffEditor.move.border", "#8b8b8b9c", S(134, "The border color for text that got moved in the diff editor."));
ie("diffEditor.moveActive.border", "#FFA500", S(135, "The active border color for text that got moved in the diff editor."));
ie("diffEditor.unchangedRegionShadow", { dark: "#000000", light: "#737373BF", hcDark: "#000000", hcLight: "#737373BF" }, S(136, "The color of the shadow around unchanged region widgets."));
const Svt = es("diff-insert", Pe.add, S(137, "Line decoration for inserts in the diff editor.")), f5e = es("diff-remove", Pe.remove, S(138, "Line decoration for removals in the diff editor.")), Ike = dn.register({
  className: "line-insert",
  description: "line-insert",
  isWholeLine: !0,
  linesDecorationsClassName: "insert-sign " + qt.asClassName(Svt),
  marginClassName: "gutter-insert"
}), Nke = dn.register({
  className: "line-delete",
  description: "line-delete",
  isWholeLine: !0,
  linesDecorationsClassName: "delete-sign " + qt.asClassName(f5e),
  marginClassName: "gutter-delete"
}), Rke = dn.register({
  className: "line-insert",
  description: "line-insert",
  isWholeLine: !0,
  marginClassName: "gutter-insert"
}), Ake = dn.register({
  className: "line-delete",
  description: "line-delete",
  isWholeLine: !0,
  marginClassName: "gutter-delete"
}), Oke = dn.register({
  className: "char-insert",
  description: "char-insert",
  shouldFillLineOnLineBreak: !0
}), Evt = dn.register({
  className: "char-insert",
  description: "char-insert",
  isWholeLine: !0
}), xvt = dn.register({
  className: "char-insert diff-range-empty",
  description: "char-insert diff-range-empty"
}), rse = dn.register({
  className: "char-delete",
  description: "char-delete",
  shouldFillLineOnLineBreak: !0
}), Lvt = dn.register({
  className: "char-delete",
  description: "char-delete",
  isWholeLine: !0
}), Tvt = dn.register({
  className: "char-delete diff-range-empty",
  description: "char-delete diff-range-empty"
}), sd = Vn("editorWorkerService");
var g5e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, sse = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, TE;
const p5e = Vn("diffProviderFactoryService");
let ose = class {
  constructor(e) {
    this.instantiationService = e;
  }
  createDiffProvider(e) {
    return this.instantiationService.createInstance(ase, e);
  }
};
ose = g5e([
  sse(0, xt)
], ose);
ni(
  p5e,
  ose,
  1
  /* InstantiationType.Delayed */
);
var eL;
let ase = (eL = class {
  constructor(e, t, n) {
    this.editorWorkerService = t, this.telemetryService = n, this.onDidChangeEventEmitter = new he(), this.onDidChange = this.onDidChangeEventEmitter.event, this.diffAlgorithm = "advanced", this.diffAlgorithmOnDidChangeSubscription = void 0, this.setOptions(e);
  }
  dispose() {
    var e;
    (e = this.diffAlgorithmOnDidChangeSubscription) == null || e.dispose();
  }
  async computeDiff(e, t, n, r) {
    if (typeof this.diffAlgorithm != "string")
      return this.diffAlgorithm.computeDiff(e, t, n, r);
    if (e.isDisposed() || t.isDisposed())
      return {
        changes: [],
        identical: !0,
        quitEarly: !1,
        moves: []
      };
    if (e.getLineCount() === 1 && e.getLineMaxColumn(1) === 1)
      return t.getLineCount() === 1 && t.getLineMaxColumn(1) === 1 ? {
        changes: [],
        identical: !0,
        quitEarly: !1,
        moves: []
      } : {
        changes: [
          new jh(new Zt(1, 2), new Zt(1, t.getLineCount() + 1), [
            new nu(e.getFullModelRange(), t.getFullModelRange())
          ])
        ],
        identical: !1,
        quitEarly: !1,
        moves: []
      };
    const s = JSON.stringify([e.uri.toString(), t.uri.toString()]), o = JSON.stringify([e.id, t.id, e.getAlternativeVersionId(), t.getAlternativeVersionId(), JSON.stringify(n)]), a = TE.diffCache.get(s);
    if (a && a.context === o)
      return a.result;
    const l = _a.create(), c = await this.editorWorkerService.computeDiff(e.uri, t.uri, n, this.diffAlgorithm), u = l.elapsed();
    if (this.telemetryService.publicLog2("diffEditor.computeDiff", {
      timeMs: u,
      timedOut: (c == null ? void 0 : c.quitEarly) ?? !0,
      detectedMoves: n.computeMoves ? (c == null ? void 0 : c.moves.length) ?? 0 : -1
    }), r.isCancellationRequested)
      return {
        changes: [],
        identical: !1,
        quitEarly: !0,
        moves: []
      };
    if (!c)
      throw new Error("no diff result available");
    return TE.diffCache.size > 10 && TE.diffCache.delete(TE.diffCache.keys().next().value), TE.diffCache.set(s, { result: c, context: o }), c;
  }
  setOptions(e) {
    var n;
    let t = !1;
    e.diffAlgorithm && this.diffAlgorithm !== e.diffAlgorithm && ((n = this.diffAlgorithmOnDidChangeSubscription) == null || n.dispose(), this.diffAlgorithmOnDidChangeSubscription = void 0, this.diffAlgorithm = e.diffAlgorithm, typeof e.diffAlgorithm != "string" && (this.diffAlgorithmOnDidChangeSubscription = e.diffAlgorithm.onDidChange(() => this.onDidChangeEventEmitter.fire())), t = !0), t && this.onDidChangeEventEmitter.fire();
  }
}, TE = eL, eL.diffCache = /* @__PURE__ */ new Map(), eL);
ase = TE = g5e([
  sse(1, sd),
  sse(2, rc)
], ase);
class MW {
  constructor(e, t, n) {
    this.changes = e, this.moves = t, this.hitTimeout = n;
  }
}
class m5e {
  constructor(e, t) {
    this.lineRangeMapping = e, this.changes = t;
  }
}
class Fy {
  static trivial(e, t) {
    return new Fy([new ua(Tt.ofLength(e.length), Tt.ofLength(t.length))], !1);
  }
  static trivialTimedOut(e, t) {
    return new Fy([new ua(Tt.ofLength(e.length), Tt.ofLength(t.length))], !0);
  }
  constructor(e, t) {
    this.diffs = e, this.hitTimeout = t;
  }
}
class ua {
  static invert(e, t) {
    const n = [];
    return hPe(e, (r, s) => {
      n.push(ua.fromOffsetPairs(r ? r.getEndExclusives() : wy.zero, s ? s.getStarts() : new wy(t, (r ? r.seq2Range.endExclusive - r.seq1Range.endExclusive : 0) + t)));
    }), n;
  }
  static fromOffsetPairs(e, t) {
    return new ua(new Tt(e.offset1, t.offset1), new Tt(e.offset2, t.offset2));
  }
  static assertSorted(e) {
    let t;
    for (const n of e) {
      if (t && !(t.seq1Range.endExclusive <= n.seq1Range.start && t.seq2Range.endExclusive <= n.seq2Range.start))
        throw new Wt("Sequence diffs must be sorted");
      t = n;
    }
  }
  constructor(e, t) {
    this.seq1Range = e, this.seq2Range = t;
  }
  swap() {
    return new ua(this.seq2Range, this.seq1Range);
  }
  toString() {
    return `${this.seq1Range} <-> ${this.seq2Range}`;
  }
  join(e) {
    return new ua(this.seq1Range.join(e.seq1Range), this.seq2Range.join(e.seq2Range));
  }
  delta(e) {
    return e === 0 ? this : new ua(this.seq1Range.delta(e), this.seq2Range.delta(e));
  }
  deltaStart(e) {
    return e === 0 ? this : new ua(this.seq1Range.deltaStart(e), this.seq2Range.deltaStart(e));
  }
  deltaEnd(e) {
    return e === 0 ? this : new ua(this.seq1Range.deltaEnd(e), this.seq2Range.deltaEnd(e));
  }
  intersect(e) {
    const t = this.seq1Range.intersect(e.seq1Range), n = this.seq2Range.intersect(e.seq2Range);
    if (!(!t || !n))
      return new ua(t, n);
  }
  getStarts() {
    return new wy(this.seq1Range.start, this.seq2Range.start);
  }
  getEndExclusives() {
    return new wy(this.seq1Range.endExclusive, this.seq2Range.endExclusive);
  }
}
const rx = class rx {
  constructor(e, t) {
    this.offset1 = e, this.offset2 = t;
  }
  toString() {
    return `${this.offset1} <-> ${this.offset2}`;
  }
  delta(e) {
    return e === 0 ? this : new rx(this.offset1 + e, this.offset2 + e);
  }
  equals(e) {
    return this.offset1 === e.offset1 && this.offset2 === e.offset2;
  }
};
rx.zero = new rx(0, 0), rx.max = new rx(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
let wy = rx;
const Qj = class Qj {
  isValid() {
    return !0;
  }
};
Qj.instance = new Qj();
let $4 = Qj;
class kvt {
  constructor(e) {
    if (this.timeout = e, this.startTime = Date.now(), this.valid = !0, e <= 0)
      throw new Wt("timeout must be positive");
  }
  // Recommendation: Set a log-point `{this.disable()}` in the body
  isValid() {
    return !(Date.now() - this.startTime < this.timeout) && this.valid && (this.valid = !1), this.valid;
  }
}
class Fee {
  constructor(e, t) {
    this.width = e, this.height = t, this.array = [], this.array = new Array(e * t);
  }
  get(e, t) {
    return this.array[e + t * this.width];
  }
  set(e, t, n) {
    this.array[e + t * this.width] = n;
  }
}
function lse(i) {
  return i === 32 || i === 9;
}
const A3 = class A3 {
  static getKey(e) {
    let t = this.chrKeys.get(e);
    return t === void 0 && (t = this.chrKeys.size, this.chrKeys.set(e, t)), t;
  }
  constructor(e, t, n) {
    this.range = e, this.lines = t, this.source = n, this.histogram = [];
    let r = 0;
    for (let s = e.startLineNumber - 1; s < e.endLineNumberExclusive - 1; s++) {
      const o = t[s];
      for (let l = 0; l < o.length; l++) {
        r++;
        const c = o[l], u = A3.getKey(c);
        this.histogram[u] = (this.histogram[u] || 0) + 1;
      }
      r++;
      const a = A3.getKey(`
`);
      this.histogram[a] = (this.histogram[a] || 0) + 1;
    }
    this.totalCount = r;
  }
  computeSimilarity(e) {
    let t = 0;
    const n = Math.max(this.histogram.length, e.histogram.length);
    for (let r = 0; r < n; r++)
      t += Math.abs((this.histogram[r] ?? 0) - (e.histogram[r] ?? 0));
    return 1 - t / (this.totalCount + e.totalCount);
  }
};
A3.chrKeys = /* @__PURE__ */ new Map();
let OU = A3;
class Dvt {
  compute(e, t, n = $4.instance, r) {
    if (e.length === 0 || t.length === 0)
      return Fy.trivial(e, t);
    const s = new Fee(e.length, t.length), o = new Fee(e.length, t.length), a = new Fee(e.length, t.length);
    for (let m = 0; m < e.length; m++)
      for (let _ = 0; _ < t.length; _++) {
        if (!n.isValid())
          return Fy.trivialTimedOut(e, t);
        const v = m === 0 ? 0 : s.get(m - 1, _), w = _ === 0 ? 0 : s.get(m, _ - 1);
        let E;
        e.getElement(m) === t.getElement(_) ? (m === 0 || _ === 0 ? E = 0 : E = s.get(m - 1, _ - 1), m > 0 && _ > 0 && o.get(m - 1, _ - 1) === 3 && (E += a.get(m - 1, _ - 1)), E += r ? r(m, _) : 1) : E = -1;
        const L = Math.max(v, w, E);
        if (L === E) {
          const T = m > 0 && _ > 0 ? a.get(m - 1, _ - 1) : 0;
          a.set(m, _, T + 1), o.set(m, _, 3);
        } else L === v ? (a.set(m, _, 0), o.set(m, _, 1)) : L === w && (a.set(m, _, 0), o.set(m, _, 2));
        s.set(m, _, L);
      }
    const l = [];
    let c = e.length, u = t.length;
    function d(m, _) {
      (m + 1 !== c || _ + 1 !== u) && l.push(new ua(new Tt(m + 1, c), new Tt(_ + 1, u))), c = m, u = _;
    }
    let h = e.length - 1, g = t.length - 1;
    for (; h >= 0 && g >= 0; )
      o.get(h, g) === 3 ? (d(h, g), h--, g--) : o.get(h, g) === 1 ? h-- : g--;
    return d(-1, -1), l.reverse(), new Fy(l, !1);
  }
}
class _5e {
  compute(e, t, n = $4.instance) {
    if (e.length === 0 || t.length === 0)
      return Fy.trivial(e, t);
    const r = e, s = t;
    function o(_, v) {
      for (; _ < r.length && v < s.length && r.getElement(_) === s.getElement(v); )
        _++, v++;
      return _;
    }
    let a = 0;
    const l = new Ivt();
    l.set(0, o(0, 0));
    const c = new Nvt();
    c.set(0, l.get(0) === 0 ? null : new Mke(null, 0, 0, l.get(0)));
    let u = 0;
    e: for (; ; ) {
      if (a++, !n.isValid())
        return Fy.trivialTimedOut(r, s);
      const _ = -Math.min(a, s.length + a % 2), v = Math.min(a, r.length + a % 2);
      for (u = _; u <= v; u += 2) {
        const w = u === v ? -1 : l.get(u + 1), E = u === _ ? -1 : l.get(u - 1) + 1, L = Math.min(Math.max(w, E), r.length), T = L - u;
        if (L > r.length || T > s.length)
          continue;
        const D = o(L, T);
        l.set(u, D);
        const N = L === w ? c.get(u + 1) : c.get(u - 1);
        if (c.set(u, D !== L ? new Mke(N, L, T, D - L) : N), l.get(u) === r.length && l.get(u) - u === s.length)
          break e;
      }
    }
    let d = c.get(u);
    const h = [];
    let g = r.length, m = s.length;
    for (; ; ) {
      const _ = d ? d.x + d.length : 0, v = d ? d.y + d.length : 0;
      if ((_ !== g || v !== m) && h.push(new ua(new Tt(_, g), new Tt(v, m))), !d)
        break;
      g = d.x, m = d.y, d = d.prev;
    }
    return h.reverse(), new Fy(h, !1);
  }
}
class Mke {
  constructor(e, t, n, r) {
    this.prev = e, this.x = t, this.y = n, this.length = r;
  }
}
class Ivt {
  constructor() {
    this.positiveArr = new Int32Array(10), this.negativeArr = new Int32Array(10);
  }
  get(e) {
    return e < 0 ? (e = -e - 1, this.negativeArr[e]) : this.positiveArr[e];
  }
  set(e, t) {
    if (e < 0) {
      if (e = -e - 1, e >= this.negativeArr.length) {
        const n = this.negativeArr;
        this.negativeArr = new Int32Array(n.length * 2), this.negativeArr.set(n);
      }
      this.negativeArr[e] = t;
    } else {
      if (e >= this.positiveArr.length) {
        const n = this.positiveArr;
        this.positiveArr = new Int32Array(n.length * 2), this.positiveArr.set(n);
      }
      this.positiveArr[e] = t;
    }
  }
}
class Nvt {
  constructor() {
    this.positiveArr = [], this.negativeArr = [];
  }
  get(e) {
    return e < 0 ? (e = -e - 1, this.negativeArr[e]) : this.positiveArr[e];
  }
  set(e, t) {
    e < 0 ? (e = -e - 1, this.negativeArr[e] = t) : this.positiveArr[e] = t;
  }
}
class MU {
  constructor(e, t, n) {
    this.lines = e, this.range = t, this.considerWhitespaceChanges = n, this.elements = [], this.firstElementOffsetByLineIdx = [], this.lineStartOffsets = [], this.trimmedWsLengthsByLineIdx = [], this.firstElementOffsetByLineIdx.push(0);
    for (let r = this.range.startLineNumber; r <= this.range.endLineNumber; r++) {
      let s = e[r - 1], o = 0;
      r === this.range.startLineNumber && this.range.startColumn > 1 && (o = this.range.startColumn - 1, s = s.substring(o)), this.lineStartOffsets.push(o);
      let a = 0;
      if (!n) {
        const c = s.trimStart();
        a = s.length - c.length, s = c.trimEnd();
      }
      this.trimmedWsLengthsByLineIdx.push(a);
      const l = r === this.range.endLineNumber ? Math.min(this.range.endColumn - 1 - o - a, s.length) : s.length;
      for (let c = 0; c < l; c++)
        this.elements.push(s.charCodeAt(c));
      r < this.range.endLineNumber && (this.elements.push(10), this.firstElementOffsetByLineIdx.push(this.elements.length));
    }
  }
  toString() {
    return `Slice: "${this.text}"`;
  }
  get text() {
    return this.getText(new Tt(0, this.length));
  }
  getText(e) {
    return this.elements.slice(e.start, e.endExclusive).map((t) => String.fromCharCode(t)).join("");
  }
  getElement(e) {
    return this.elements[e];
  }
  get length() {
    return this.elements.length;
  }
  getBoundaryScore(e) {
    const t = Bke(e > 0 ? this.elements[e - 1] : -1), n = Bke(e < this.elements.length ? this.elements[e] : -1);
    if (t === 7 && n === 8)
      return 0;
    if (t === 8)
      return 150;
    let r = 0;
    return t !== n && (r += 10, t === 0 && n === 1 && (r += 1)), r += Fke(t), r += Fke(n), r;
  }
  translateOffset(e, t = "right") {
    const n = nA(this.firstElementOffsetByLineIdx, (s) => s <= e), r = e - this.firstElementOffsetByLineIdx[n];
    return new de(this.range.startLineNumber + n, 1 + this.lineStartOffsets[n] + r + (r === 0 && t === "left" ? 0 : this.trimmedWsLengthsByLineIdx[n]));
  }
  translateRange(e) {
    const t = this.translateOffset(e.start, "right"), n = this.translateOffset(e.endExclusive, "left");
    return n.isBefore(t) ? z.fromPositions(n, n) : z.fromPositions(t, n);
  }
  /**
   * Finds the word that contains the character at the given offset
   */
  findWordContaining(e) {
    if (e < 0 || e >= this.elements.length || !vI(this.elements[e]))
      return;
    let t = e;
    for (; t > 0 && vI(this.elements[t - 1]); )
      t--;
    let n = e;
    for (; n < this.elements.length && vI(this.elements[n]); )
      n++;
    return new Tt(t, n);
  }
  /** fooBar has the two sub-words foo and bar */
  findSubWordContaining(e) {
    if (e < 0 || e >= this.elements.length || !vI(this.elements[e]))
      return;
    let t = e;
    for (; t > 0 && vI(this.elements[t - 1]) && !Pke(this.elements[t]); )
      t--;
    let n = e;
    for (; n < this.elements.length && vI(this.elements[n]) && !Pke(this.elements[n]); )
      n++;
    return new Tt(t, n);
  }
  countLinesIn(e) {
    return this.translateOffset(e.endExclusive).lineNumber - this.translateOffset(e.start).lineNumber;
  }
  isStronglyEqual(e, t) {
    return this.elements[e] === this.elements[t];
  }
  extendToFullLines(e) {
    const t = tA(this.firstElementOffsetByLineIdx, (r) => r <= e.start) ?? 0, n = gdt(this.firstElementOffsetByLineIdx, (r) => e.endExclusive <= r) ?? this.elements.length;
    return new Tt(t, n);
  }
}
function vI(i) {
  return i >= 97 && i <= 122 || i >= 65 && i <= 90 || i >= 48 && i <= 57;
}
function Pke(i) {
  return i >= 65 && i <= 90;
}
const Rvt = {
  0: 0,
  1: 0,
  2: 0,
  3: 10,
  4: 2,
  5: 30,
  6: 3,
  7: 10,
  8: 10
};
function Fke(i) {
  return Rvt[i];
}
function Bke(i) {
  return i === 10 ? 8 : i === 13 ? 7 : lse(i) ? 6 : i >= 97 && i <= 122 ? 0 : i >= 65 && i <= 90 ? 1 : i >= 48 && i <= 57 ? 2 : i === -1 ? 3 : i === 44 || i === 59 ? 5 : 4;
}
function Avt(i, e, t, n, r, s) {
  let { moves: o, excludedChanges: a } = Mvt(i, e, t, s);
  if (!s.isValid())
    return [];
  const l = i.filter((u) => !a.has(u)), c = Pvt(l, n, r, e, t, s);
  return fie(o, c), o = Fvt(o), o = o.filter((u) => {
    const d = u.original.toOffsetRange().slice(e).map((g) => g.trim());
    return d.join(`
`).length >= 15 && Ovt(d, (g) => g.length >= 2) >= 2;
  }), o = Bvt(i, o), o;
}
function Ovt(i, e) {
  let t = 0;
  for (const n of i)
    e(n) && t++;
  return t;
}
function Mvt(i, e, t, n) {
  const r = [], s = i.filter((l) => l.modified.isEmpty && l.original.length >= 3).map((l) => new OU(l.original, e, l)), o = new Set(i.filter((l) => l.original.isEmpty && l.modified.length >= 3).map((l) => new OU(l.modified, t, l))), a = /* @__PURE__ */ new Set();
  for (const l of s) {
    let c = -1, u;
    for (const d of o) {
      const h = l.computeSimilarity(d);
      h > c && (c = h, u = d);
    }
    if (c > 0.9 && u && (o.delete(u), r.push(new wc(l.range, u.range)), a.add(l.source), a.add(u.source)), !n.isValid())
      return { moves: r, excludedChanges: a };
  }
  return { moves: r, excludedChanges: a };
}
function Pvt(i, e, t, n, r, s) {
  const o = [], a = new VPe();
  for (const h of i)
    for (let g = h.original.startLineNumber; g < h.original.endLineNumberExclusive - 2; g++) {
      const m = `${e[g - 1]}:${e[g + 1 - 1]}:${e[g + 2 - 1]}`;
      a.add(m, { range: new Zt(g, g + 3) });
    }
  const l = [];
  i.sort(yl((h) => h.modified.startLineNumber, Hd));
  for (const h of i) {
    let g = [];
    for (let m = h.modified.startLineNumber; m < h.modified.endLineNumberExclusive - 2; m++) {
      const _ = `${t[m - 1]}:${t[m + 1 - 1]}:${t[m + 2 - 1]}`, v = new Zt(m, m + 3), w = [];
      a.forEach(_, ({ range: E }) => {
        for (const T of g)
          if (T.originalLineRange.endLineNumberExclusive + 1 === E.endLineNumberExclusive && T.modifiedLineRange.endLineNumberExclusive + 1 === v.endLineNumberExclusive) {
            T.originalLineRange = new Zt(T.originalLineRange.startLineNumber, E.endLineNumberExclusive), T.modifiedLineRange = new Zt(T.modifiedLineRange.startLineNumber, v.endLineNumberExclusive), w.push(T);
            return;
          }
        const L = {
          modifiedLineRange: v,
          originalLineRange: E
        };
        l.push(L), w.push(L);
      }), g = w;
    }
    if (!s.isValid())
      return [];
  }
  l.sort(mPe(yl((h) => h.modifiedLineRange.length, Hd)));
  const c = new Mf(), u = new Mf();
  for (const h of l) {
    const g = h.modifiedLineRange.startLineNumber - h.originalLineRange.startLineNumber, m = c.subtractFrom(h.modifiedLineRange), _ = u.subtractFrom(h.originalLineRange).getWithDelta(g), v = m.getIntersection(_);
    for (const w of v.ranges) {
      if (w.length < 3)
        continue;
      const E = w, L = w.delta(-g);
      o.push(new wc(L, E)), c.addRange(E), u.addRange(L);
    }
  }
  o.sort(yl((h) => h.original.startLineNumber, Hd));
  const d = new aU(i);
  for (let h = 0; h < o.length; h++) {
    const g = o[h], m = d.findLastMonotonous((N) => N.original.startLineNumber <= g.original.startLineNumber), _ = tA(i, (N) => N.modified.startLineNumber <= g.modified.startLineNumber), v = Math.max(g.original.startLineNumber - m.original.startLineNumber, g.modified.startLineNumber - _.modified.startLineNumber), w = d.findLastMonotonous((N) => N.original.startLineNumber < g.original.endLineNumberExclusive), E = tA(i, (N) => N.modified.startLineNumber < g.modified.endLineNumberExclusive), L = Math.max(w.original.endLineNumberExclusive - g.original.endLineNumberExclusive, E.modified.endLineNumberExclusive - g.modified.endLineNumberExclusive);
    let T;
    for (T = 0; T < v; T++) {
      const N = g.original.startLineNumber - T - 1, R = g.modified.startLineNumber - T - 1;
      if (N > n.length || R > r.length || c.contains(R) || u.contains(N) || !Hke(n[N - 1], r[R - 1], s))
        break;
    }
    T > 0 && (u.addRange(new Zt(g.original.startLineNumber - T, g.original.startLineNumber)), c.addRange(new Zt(g.modified.startLineNumber - T, g.modified.startLineNumber)));
    let D;
    for (D = 0; D < L; D++) {
      const N = g.original.endLineNumberExclusive + D, R = g.modified.endLineNumberExclusive + D;
      if (N > n.length || R > r.length || c.contains(R) || u.contains(N) || !Hke(n[N - 1], r[R - 1], s))
        break;
    }
    D > 0 && (u.addRange(new Zt(g.original.endLineNumberExclusive, g.original.endLineNumberExclusive + D)), c.addRange(new Zt(g.modified.endLineNumberExclusive, g.modified.endLineNumberExclusive + D))), (T > 0 || D > 0) && (o[h] = new wc(new Zt(g.original.startLineNumber - T, g.original.endLineNumberExclusive + D), new Zt(g.modified.startLineNumber - T, g.modified.endLineNumberExclusive + D)));
  }
  return o;
}
function Hke(i, e, t) {
  if (i.trim() === e.trim())
    return !0;
  if (i.length > 300 && e.length > 300)
    return !1;
  const r = new _5e().compute(new MU([i], new z(1, 1, 1, i.length), !1), new MU([e], new z(1, 1, 1, e.length), !1), t);
  let s = 0;
  const o = ua.invert(r.diffs, i.length);
  for (const u of o)
    u.seq1Range.forEach((d) => {
      lse(i.charCodeAt(d)) || s++;
    });
  function a(u) {
    let d = 0;
    for (let h = 0; h < i.length; h++)
      lse(u.charCodeAt(h)) || d++;
    return d;
  }
  const l = a(i.length > e.length ? i : e);
  return s / l > 0.6 && l > 10;
}
function Fvt(i) {
  if (i.length === 0)
    return i;
  i.sort(yl((t) => t.original.startLineNumber, Hd));
  const e = [i[0]];
  for (let t = 1; t < i.length; t++) {
    const n = e[e.length - 1], r = i[t], s = r.original.startLineNumber - n.original.endLineNumberExclusive, o = r.modified.startLineNumber - n.modified.endLineNumberExclusive;
    if (s >= 0 && o >= 0 && s + o <= 2) {
      e[e.length - 1] = n.join(r);
      continue;
    }
    e.push(r);
  }
  return e;
}
function Bvt(i, e) {
  const t = new aU(i);
  return e = e.filter((n) => {
    const r = t.findLastMonotonous((a) => a.original.startLineNumber < n.original.endLineNumberExclusive) || new wc(new Zt(1, 1), new Zt(1, 1)), s = tA(i, (a) => a.modified.startLineNumber < n.modified.endLineNumberExclusive);
    return r !== s;
  }), e;
}
function Wke(i, e, t) {
  let n = t;
  return n = Vke(i, e, n), n = Vke(i, e, n), n = Hvt(i, e, n), n;
}
function Vke(i, e, t) {
  if (t.length === 0)
    return t;
  const n = [];
  n.push(t[0]);
  for (let s = 1; s < t.length; s++) {
    const o = n[n.length - 1];
    let a = t[s];
    if (a.seq1Range.isEmpty || a.seq2Range.isEmpty) {
      const l = a.seq1Range.start - o.seq1Range.endExclusive;
      let c;
      for (c = 1; c <= l && !(i.getElement(a.seq1Range.start - c) !== i.getElement(a.seq1Range.endExclusive - c) || e.getElement(a.seq2Range.start - c) !== e.getElement(a.seq2Range.endExclusive - c)); c++)
        ;
      if (c--, c === l) {
        n[n.length - 1] = new ua(new Tt(o.seq1Range.start, a.seq1Range.endExclusive - l), new Tt(o.seq2Range.start, a.seq2Range.endExclusive - l));
        continue;
      }
      a = a.delta(-c);
    }
    n.push(a);
  }
  const r = [];
  for (let s = 0; s < n.length - 1; s++) {
    const o = n[s + 1];
    let a = n[s];
    if (a.seq1Range.isEmpty || a.seq2Range.isEmpty) {
      const l = o.seq1Range.start - a.seq1Range.endExclusive;
      let c;
      for (c = 0; c < l && !(!i.isStronglyEqual(a.seq1Range.start + c, a.seq1Range.endExclusive + c) || !e.isStronglyEqual(a.seq2Range.start + c, a.seq2Range.endExclusive + c)); c++)
        ;
      if (c === l) {
        n[s + 1] = new ua(new Tt(a.seq1Range.start + l, o.seq1Range.endExclusive), new Tt(a.seq2Range.start + l, o.seq2Range.endExclusive));
        continue;
      }
      c > 0 && (a = a.delta(c));
    }
    r.push(a);
  }
  return n.length > 0 && r.push(n[n.length - 1]), r;
}
function Hvt(i, e, t) {
  if (!i.getBoundaryScore || !e.getBoundaryScore)
    return t;
  for (let n = 0; n < t.length; n++) {
    const r = n > 0 ? t[n - 1] : void 0, s = t[n], o = n + 1 < t.length ? t[n + 1] : void 0, a = new Tt(r ? r.seq1Range.endExclusive + 1 : 0, o ? o.seq1Range.start - 1 : i.length), l = new Tt(r ? r.seq2Range.endExclusive + 1 : 0, o ? o.seq2Range.start - 1 : e.length);
    s.seq1Range.isEmpty ? t[n] = Uke(s, i, e, a, l) : s.seq2Range.isEmpty && (t[n] = Uke(s.swap(), e, i, l, a).swap());
  }
  return t;
}
function Uke(i, e, t, n, r) {
  let o = 1;
  for (; i.seq1Range.start - o >= n.start && i.seq2Range.start - o >= r.start && t.isStronglyEqual(i.seq2Range.start - o, i.seq2Range.endExclusive - o) && o < 100; )
    o++;
  o--;
  let a = 0;
  for (; i.seq1Range.start + a < n.endExclusive && i.seq2Range.endExclusive + a < r.endExclusive && t.isStronglyEqual(i.seq2Range.start + a, i.seq2Range.endExclusive + a) && a < 100; )
    a++;
  if (o === 0 && a === 0)
    return i;
  let l = 0, c = -1;
  for (let u = -o; u <= a; u++) {
    const d = i.seq2Range.start + u, h = i.seq2Range.endExclusive + u, g = i.seq1Range.start + u, m = e.getBoundaryScore(g) + t.getBoundaryScore(d) + t.getBoundaryScore(h);
    m > c && (c = m, l = u);
  }
  return i.delta(l);
}
function Wvt(i, e, t) {
  const n = [];
  for (const r of t) {
    const s = n[n.length - 1];
    if (!s) {
      n.push(r);
      continue;
    }
    r.seq1Range.start - s.seq1Range.endExclusive <= 2 || r.seq2Range.start - s.seq2Range.endExclusive <= 2 ? n[n.length - 1] = new ua(s.seq1Range.join(r.seq1Range), s.seq2Range.join(r.seq2Range)) : n.push(r);
  }
  return n;
}
function zke(i, e, t, n, r = !1) {
  const s = ua.invert(t, i.length), o = [];
  let a = new wy(0, 0);
  function l(u, d) {
    if (u.offset1 < a.offset1 || u.offset2 < a.offset2)
      return;
    const h = n(i, u.offset1), g = n(e, u.offset2);
    if (!h || !g)
      return;
    let m = new ua(h, g);
    const _ = m.intersect(d);
    let v = _.seq1Range.length, w = _.seq2Range.length;
    for (; s.length > 0; ) {
      const E = s[0];
      if (!(E.seq1Range.intersects(m.seq1Range) || E.seq2Range.intersects(m.seq2Range)))
        break;
      const T = n(i, E.seq1Range.start), D = n(e, E.seq2Range.start), N = new ua(T, D), R = N.intersect(E);
      if (v += R.seq1Range.length, w += R.seq2Range.length, m = m.join(N), m.seq1Range.endExclusive >= E.seq1Range.endExclusive)
        s.shift();
      else
        break;
    }
    (r && v + w < m.seq1Range.length + m.seq2Range.length || v + w < (m.seq1Range.length + m.seq2Range.length) * 2 / 3) && o.push(m), a = m.getEndExclusives();
  }
  for (; s.length > 0; ) {
    const u = s.shift();
    u.seq1Range.isEmpty || (l(u.getStarts(), u), l(u.getEndExclusives().delta(-1), u));
  }
  return Vvt(t, o);
}
function Vvt(i, e) {
  const t = [];
  for (; i.length > 0 || e.length > 0; ) {
    const n = i[0], r = e[0];
    let s;
    n && (!r || n.seq1Range.start < r.seq1Range.start) ? s = i.shift() : s = e.shift(), t.length > 0 && t[t.length - 1].seq1Range.endExclusive >= s.seq1Range.start ? t[t.length - 1] = t[t.length - 1].join(s) : t.push(s);
  }
  return t;
}
function Uvt(i, e, t) {
  let n = t;
  if (n.length === 0)
    return n;
  let r = 0, s;
  do {
    s = !1;
    const o = [
      n[0]
    ];
    for (let a = 1; a < n.length; a++) {
      let u = function(h, g) {
        const m = new Tt(c.seq1Range.endExclusive, l.seq1Range.start);
        return i.getText(m).replace(/\s/g, "").length <= 4 && (h.seq1Range.length + h.seq2Range.length > 5 || g.seq1Range.length + g.seq2Range.length > 5);
      };
      const l = n[a], c = o[o.length - 1];
      u(c, l) ? (s = !0, o[o.length - 1] = o[o.length - 1].join(l)) : o.push(l);
    }
    n = o;
  } while (r++ < 10 && s);
  return n;
}
function zvt(i, e, t) {
  let n = t;
  if (n.length === 0)
    return n;
  let r = 0, s;
  do {
    s = !1;
    const a = [
      n[0]
    ];
    for (let l = 1; l < n.length; l++) {
      let d = function(g, m) {
        const _ = new Tt(u.seq1Range.endExclusive, c.seq1Range.start);
        if (i.countLinesIn(_) > 5 || _.length > 500)
          return !1;
        const w = i.getText(_).trim();
        if (w.length > 20 || w.split(/\r\n|\r|\n/).length > 1)
          return !1;
        const E = i.countLinesIn(g.seq1Range), L = g.seq1Range.length, T = e.countLinesIn(g.seq2Range), D = g.seq2Range.length, N = i.countLinesIn(m.seq1Range), R = m.seq1Range.length, M = e.countLinesIn(m.seq2Range), B = m.seq2Range.length, H = 130;
        function j(K) {
          return Math.min(K, H);
        }
        return Math.pow(Math.pow(j(E * 40 + L), 1.5) + Math.pow(j(T * 40 + D), 1.5), 1.5) + Math.pow(Math.pow(j(N * 40 + R), 1.5) + Math.pow(j(M * 40 + B), 1.5), 1.5) > (H ** 1.5) ** 1.5 * 1.3;
      };
      const c = n[l], u = a[a.length - 1];
      d(u, c) ? (s = !0, a[a.length - 1] = a[a.length - 1].join(c)) : a.push(c);
    }
    n = a;
  } while (r++ < 10 && s);
  const o = [];
  return eit(n, (a, l, c) => {
    let u = l;
    function d(w) {
      return w.length > 0 && w.trim().length <= 3 && l.seq1Range.length + l.seq2Range.length > 100;
    }
    const h = i.extendToFullLines(l.seq1Range), g = i.getText(new Tt(h.start, l.seq1Range.start));
    d(g) && (u = u.deltaStart(-g.length));
    const m = i.getText(new Tt(l.seq1Range.endExclusive, h.endExclusive));
    d(m) && (u = u.deltaEnd(m.length));
    const _ = ua.fromOffsetPairs(a ? a.getEndExclusives() : wy.zero, c ? c.getStarts() : wy.max), v = u.intersect(_);
    o.length > 0 && v.getStarts().equals(o[o.length - 1].getEndExclusives()) ? o[o.length - 1] = o[o.length - 1].join(v) : o.push(v);
  }), o;
}
let $ke = class {
  constructor(e, t) {
    this.trimmedHash = e, this.lines = t;
  }
  getElement(e) {
    return this.trimmedHash[e];
  }
  get length() {
    return this.trimmedHash.length;
  }
  getBoundaryScore(e) {
    const t = e === 0 ? 0 : jke(this.lines[e - 1]), n = e === this.lines.length ? 0 : jke(this.lines[e]);
    return 1e3 - (t + n);
  }
  getText(e) {
    return this.lines.slice(e.start, e.endExclusive).join(`
`);
  }
  isStronglyEqual(e, t) {
    return this.lines[e] === this.lines[t];
  }
};
function jke(i) {
  let e = 0;
  for (; e < i.length && (i.charCodeAt(e) === 32 || i.charCodeAt(e) === 9); )
    e++;
  return e;
}
class $vt {
  constructor() {
    this.dynamicProgrammingDiffing = new Dvt(), this.myersDiffingAlgorithm = new _5e();
  }
  computeDiff(e, t, n) {
    if (e.length <= 1 && ds(e, t, (R, M) => R === M))
      return new MW([], [], !1);
    if (e.length === 1 && e[0].length === 0 || t.length === 1 && t[0].length === 0)
      return new MW([
        new jh(new Zt(1, e.length + 1), new Zt(1, t.length + 1), [
          new nu(new z(1, 1, e.length, e[e.length - 1].length + 1), new z(1, 1, t.length, t[t.length - 1].length + 1))
        ])
      ], [], !1);
    const r = n.maxComputationTimeMs === 0 ? $4.instance : new kvt(n.maxComputationTimeMs), s = !n.ignoreTrimWhitespace, o = /* @__PURE__ */ new Map();
    function a(R) {
      let M = o.get(R);
      return M === void 0 && (M = o.size, o.set(R, M)), M;
    }
    const l = e.map((R) => a(R.trim())), c = t.map((R) => a(R.trim())), u = new $ke(l, e), d = new $ke(c, t), h = u.length + d.length < 1700 ? this.dynamicProgrammingDiffing.compute(u, d, r, (R, M) => e[R] === t[M] ? t[M].length === 0 ? 0.1 : 1 + Math.log(1 + t[M].length) : 0.99) : this.myersDiffingAlgorithm.compute(u, d, r);
    let g = h.diffs, m = h.hitTimeout;
    g = Wke(u, d, g), g = Uvt(u, d, g);
    const _ = [], v = (R) => {
      if (s)
        for (let M = 0; M < R; M++) {
          const B = w + M, H = E + M;
          if (e[B] !== t[H]) {
            const j = this.refineDiff(e, t, new ua(new Tt(B, B + 1), new Tt(H, H + 1)), r, s, n);
            for (const K of j.mappings)
              _.push(K);
            j.hitTimeout && (m = !0);
          }
        }
    };
    let w = 0, E = 0;
    for (const R of g) {
      J1(() => R.seq1Range.start - w === R.seq2Range.start - E);
      const M = R.seq1Range.start - w;
      v(M), w = R.seq1Range.endExclusive, E = R.seq2Range.endExclusive;
      const B = this.refineDiff(e, t, R, r, s, n);
      B.hitTimeout && (m = !0);
      for (const H of B.mappings)
        _.push(H);
    }
    v(e.length - w);
    const L = new B7(e), T = new B7(t), D = AU(_, L, T);
    let N = [];
    return n.computeMoves && (N = this.computeMoves(D, e, t, l, c, r, s, n)), J1(() => {
      function R(B, H) {
        if (B.lineNumber < 1 || B.lineNumber > H.length)
          return !1;
        const j = H[B.lineNumber - 1];
        return !(B.column < 1 || B.column > j.length + 1);
      }
      function M(B, H) {
        return !(B.startLineNumber < 1 || B.startLineNumber > H.length + 1 || B.endLineNumberExclusive < 1 || B.endLineNumberExclusive > H.length + 1);
      }
      for (const B of D) {
        if (!B.innerChanges)
          return !1;
        for (const H of B.innerChanges)
          if (!(R(H.modifiedRange.getStartPosition(), t) && R(H.modifiedRange.getEndPosition(), t) && R(H.originalRange.getStartPosition(), e) && R(H.originalRange.getEndPosition(), e)))
            return !1;
        if (!M(B.modified, t) || !M(B.original, e))
          return !1;
      }
      return !0;
    }), new MW(D, N, m);
  }
  computeMoves(e, t, n, r, s, o, a, l) {
    return Avt(e, t, n, r, s, o).map((d) => {
      const h = this.refineDiff(t, n, new ua(d.original.toOffsetRange(), d.modified.toOffsetRange()), o, a, l), g = AU(h.mappings, new B7(t), new B7(n), !0);
      return new m5e(d, g);
    });
  }
  refineDiff(e, t, n, r, s, o) {
    const l = jvt(n).toRangeMapping2(e, t), c = new MU(e, l.originalRange, s), u = new MU(t, l.modifiedRange, s), d = c.length + u.length < 500 ? this.dynamicProgrammingDiffing.compute(c, u, r) : this.myersDiffingAlgorithm.compute(c, u, r);
    let h = d.diffs;
    return h = Wke(c, u, h), h = zke(c, u, h, (m, _) => m.findWordContaining(_)), o.extendToSubwords && (h = zke(c, u, h, (m, _) => m.findSubWordContaining(_), !0)), h = Wvt(c, u, h), h = zvt(c, u, h), {
      mappings: h.map((m) => new nu(c.translateRange(m.seq1Range), u.translateRange(m.seq2Range))),
      hitTimeout: d.hitTimeout
    };
  }
}
function jvt(i) {
  return new wc(new Zt(i.seq1Range.start + 1, i.seq1Range.endExclusive + 1), new Zt(i.seq2Range.start + 1, i.seq2Range.endExclusive + 1));
}
var Gvt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, qvt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let cse = class extends ge {
  setActiveMovedText(e) {
    this._activeMovedText.set(e, void 0);
  }
  constructor(e, t, n) {
    super(), this.model = e, this._options = t, this._diffProviderFactoryService = n, this._isDiffUpToDate = Qt(this, !1), this.isDiffUpToDate = this._isDiffUpToDate, this._diff = Qt(this, void 0), this.diff = this._diff, this._unchangedRegions = Qt(this, void 0), this.unchangedRegions = Ie(this, (a) => {
      var l;
      return this._options.hideUnchangedRegions.read(a) ? ((l = this._unchangedRegions.read(a)) == null ? void 0 : l.regions) ?? [] : (Fr((c) => {
        var u;
        for (const d of ((u = this._unchangedRegions.read(void 0)) == null ? void 0 : u.regions) || [])
          d.collapseAll(c);
      }), []);
    }), this.movedTextToCompare = Qt(this, void 0), this._activeMovedText = Qt(this, void 0), this._hoveredMovedText = Qt(this, void 0), this.activeMovedText = Ie(this, (a) => this.movedTextToCompare.read(a) ?? this._hoveredMovedText.read(a) ?? this._activeMovedText.read(a)), this._cancellationTokenSource = new Ss(), this._diffProvider = Ie(this, (a) => {
      const l = this._diffProviderFactoryService.createDiffProvider({
        diffAlgorithm: this._options.diffAlgorithm.read(a)
      }), c = Dd("onDidChange", l.onDidChange);
      return {
        diffProvider: l,
        onChangeSignal: c
      };
    }), this._register(Et(() => this._cancellationTokenSource.cancel()));
    const r = Nf("contentChangedSignal"), s = this._register(new mr(() => r.trigger(void 0), 200));
    this._register(Xt((a) => {
      const l = this._unchangedRegions.read(a);
      if (!l || l.regions.some((m) => m.isDragged.read(a)))
        return;
      const c = l.originalDecorationIds.map((m) => e.original.getDecorationRange(m)).map((m) => m ? Zt.fromRangeInclusive(m) : void 0), u = l.modifiedDecorationIds.map((m) => e.modified.getDecorationRange(m)).map((m) => m ? Zt.fromRangeInclusive(m) : void 0), d = l.regions.map((m, _) => !c[_] || !u[_] ? void 0 : new g1(c[_].startLineNumber, u[_].startLineNumber, c[_].length, m.visibleLineCountTop.read(a), m.visibleLineCountBottom.read(a))).filter(Aa), h = [];
      let g = !1;
      for (const m of jhe(d, (_, v) => _.getHiddenModifiedRange(a).endLineNumberExclusive === v.getHiddenModifiedRange(a).startLineNumber))
        if (m.length > 1) {
          g = !0;
          const _ = m.reduce((w, E) => w + E.lineCount, 0), v = new g1(m[0].originalLineNumber, m[0].modifiedLineNumber, _, m[0].visibleLineCountTop.read(void 0), m[m.length - 1].visibleLineCountBottom.read(void 0));
          h.push(v);
        } else
          h.push(m[0]);
      if (g) {
        const m = e.original.deltaDecorations(l.originalDecorationIds, h.map((v) => ({ range: v.originalUnchangedRange.toInclusiveRange(), options: { description: "unchanged" } }))), _ = e.modified.deltaDecorations(l.modifiedDecorationIds, h.map((v) => ({ range: v.modifiedUnchangedRange.toInclusiveRange(), options: { description: "unchanged" } })));
        Fr((v) => {
          this._unchangedRegions.set({
            regions: h,
            originalDecorationIds: m,
            modifiedDecorationIds: _
          }, v);
        });
      }
    }));
    const o = (a, l, c) => {
      const u = g1.fromDiffs(a.changes, e.original.getLineCount(), e.modified.getLineCount(), this._options.hideUnchangedRegionsMinimumLineCount.read(c), this._options.hideUnchangedRegionsContextLineCount.read(c));
      let d;
      const h = this._unchangedRegions.get();
      if (h) {
        const v = h.originalDecorationIds.map((T) => e.original.getDecorationRange(T)).map((T) => T ? Zt.fromRangeInclusive(T) : void 0), w = h.modifiedDecorationIds.map((T) => e.modified.getDecorationRange(T)).map((T) => T ? Zt.fromRangeInclusive(T) : void 0);
        let L = svt(h.regions.map((T, D) => {
          if (!v[D] || !w[D])
            return;
          const N = v[D].length;
          return new g1(
            v[D].startLineNumber,
            w[D].startLineNumber,
            N,
            // The visible area can shrink by edits -> we have to account for this
            Math.min(T.visibleLineCountTop.get(), N),
            Math.min(T.visibleLineCountBottom.get(), N - T.visibleLineCountTop.get())
          );
        }).filter(Aa), (T, D) => !D || T.modifiedLineNumber >= D.modifiedLineNumber + D.lineCount && T.originalLineNumber >= D.originalLineNumber + D.lineCount).map((T) => new wc(T.getHiddenOriginalRange(c), T.getHiddenModifiedRange(c)));
        L = wc.clip(L, Zt.ofLength(1, e.original.getLineCount()), Zt.ofLength(1, e.modified.getLineCount())), d = wc.inverse(L, e.original.getLineCount(), e.modified.getLineCount());
      }
      const g = [];
      if (d)
        for (const v of u) {
          const w = d.filter((E) => E.original.intersectsStrict(v.originalUnchangedRange) && E.modified.intersectsStrict(v.modifiedUnchangedRange));
          g.push(...v.setVisibleRanges(w, l));
        }
      else
        g.push(...u);
      const m = e.original.deltaDecorations((h == null ? void 0 : h.originalDecorationIds) || [], g.map((v) => ({ range: v.originalUnchangedRange.toInclusiveRange(), options: { description: "unchanged" } }))), _ = e.modified.deltaDecorations((h == null ? void 0 : h.modifiedDecorationIds) || [], g.map((v) => ({ range: v.modifiedUnchangedRange.toInclusiveRange(), options: { description: "unchanged" } })));
      this._unchangedRegions.set({
        regions: g,
        originalDecorationIds: m,
        modifiedDecorationIds: _
      }, l);
    };
    this._register(e.modified.onDidChangeContent((a) => {
      if (this._diff.get()) {
        const c = Cy.fromModelContentChanges(a.changes);
        this._lastDiff, e.original, e.modified;
      }
      this._isDiffUpToDate.set(!1, void 0), s.schedule();
    })), this._register(e.original.onDidChangeContent((a) => {
      if (this._diff.get()) {
        const c = Cy.fromModelContentChanges(a.changes);
        this._lastDiff, e.original, e.modified;
      }
      this._isDiffUpToDate.set(!1, void 0), s.schedule();
    })), this._register(Ql(async (a, l) => {
      this._options.hideUnchangedRegionsMinimumLineCount.read(a), this._options.hideUnchangedRegionsContextLineCount.read(a), s.cancel(), r.read(a);
      const c = this._diffProvider.read(a);
      c.onChangeSignal.read(a), this._isDiffUpToDate.set(!1, void 0);
      let u = [];
      l.add(e.original.onDidChangeContent((g) => {
        const m = Cy.fromModelContentChanges(g.changes);
        u = CU(u, m);
      }));
      let d = [];
      l.add(e.modified.onDidChangeContent((g) => {
        const m = Cy.fromModelContentChanges(g.changes);
        d = CU(d, m);
      }));
      let h = await c.diffProvider.computeDiff(e.original, e.modified, {
        ignoreTrimWhitespace: this._options.ignoreTrimWhitespace.read(a),
        maxComputationTimeMs: this._options.maxComputationTimeMs.read(a),
        computeMoves: this._options.showMoves.read(a)
      }, this._cancellationTokenSource.token);
      this._cancellationTokenSource.token.isCancellationRequested || e.original.isDisposed() || e.modified.isDisposed() || (h = Kvt(h, e.original, e.modified), h = (e.original, e.modified, void 0) ?? h, h = (e.original, e.modified, void 0) ?? h, Fr((g) => {
        o(h, g), this._lastDiff = h;
        const m = Lge.fromDiffResult(h);
        this._diff.set(m, g), this._isDiffUpToDate.set(!0, g);
        const _ = this.movedTextToCompare.read(void 0);
        this.movedTextToCompare.set(_ ? this._lastDiff.moves.find((v) => v.lineRangeMapping.modified.intersect(_.lineRangeMapping.modified)) : void 0, g);
      }));
    }));
  }
  ensureModifiedLineIsVisible(e, t, n) {
    var s, o;
    if (((s = this.diff.get()) == null ? void 0 : s.mappings.length) === 0)
      return;
    const r = ((o = this._unchangedRegions.get()) == null ? void 0 : o.regions) || [];
    for (const a of r)
      if (a.getHiddenModifiedRange(void 0).contains(e)) {
        a.showModifiedLine(e, t, n);
        return;
      }
  }
  ensureOriginalLineIsVisible(e, t, n) {
    var s, o;
    if (((s = this.diff.get()) == null ? void 0 : s.mappings.length) === 0)
      return;
    const r = ((o = this._unchangedRegions.get()) == null ? void 0 : o.regions) || [];
    for (const a of r)
      if (a.getHiddenOriginalRange(void 0).contains(e)) {
        a.showOriginalLine(e, t, n);
        return;
      }
  }
  async waitForDiff() {
    await yPe(this.isDiffUpToDate, (e) => e);
  }
  serializeState() {
    const e = this._unchangedRegions.get();
    return {
      collapsedRegions: e == null ? void 0 : e.regions.map((t) => ({ range: t.getHiddenModifiedRange(void 0).serialize() }))
    };
  }
  restoreSerializedState(e) {
    var r;
    const t = (r = e.collapsedRegions) == null ? void 0 : r.map((s) => Zt.deserialize(s.range)), n = this._unchangedRegions.get();
    !n || !t || Fr((s) => {
      for (const o of n.regions)
        for (const a of t)
          if (o.modifiedUnchangedRange.intersect(a)) {
            o.setHiddenModifiedRange(a, s);
            break;
          }
    });
  }
};
cse = Gvt([
  qvt(2, p5e)
], cse);
function Kvt(i, e, t) {
  return {
    changes: i.changes.map((n) => new jh(n.original, n.modified, n.innerChanges ? n.innerChanges.map((r) => Yvt(r, e, t)) : void 0)),
    moves: i.moves,
    identical: i.identical,
    quitEarly: i.quitEarly
  };
}
function Yvt(i, e, t) {
  let n = i.originalRange, r = i.modifiedRange;
  return n.startColumn === 1 && r.startColumn === 1 && (n.endColumn !== 1 || r.endColumn !== 1) && n.endColumn === e.getLineMaxColumn(n.endLineNumber) && r.endColumn === t.getLineMaxColumn(r.endLineNumber) && n.endLineNumber < e.getLineCount() && r.endLineNumber < t.getLineCount() && (n = n.setEndPosition(n.endLineNumber + 1, 1), r = r.setEndPosition(r.endLineNumber + 1, 1)), new nu(n, r);
}
class Lge {
  static fromDiffResult(e) {
    return new Lge(e.changes.map((t) => new b5e(t)), e.moves || [], e.identical, e.quitEarly);
  }
  constructor(e, t, n, r) {
    this.mappings = e, this.movedTexts = t, this.identical = n, this.quitEarly = r;
  }
}
class b5e {
  constructor(e) {
    this.lineRangeMapping = e;
  }
}
class g1 {
  static fromDiffs(e, t, n, r, s) {
    const o = jh.inverse(e, t, n), a = [];
    for (const l of o) {
      let c = l.original.startLineNumber, u = l.modified.startLineNumber, d = l.original.length;
      const h = c === 1 && u === 1, g = c + d === t + 1 && u + d === n + 1;
      (h || g) && d >= s + r ? (h && !g && (d -= s), g && !h && (c += s, u += s, d -= s), a.push(new g1(c, u, d, 0, 0))) : d >= s * 2 + r && (c += s, u += s, d -= s * 2, a.push(new g1(c, u, d, 0, 0)));
    }
    return a;
  }
  get originalUnchangedRange() {
    return Zt.ofLength(this.originalLineNumber, this.lineCount);
  }
  get modifiedUnchangedRange() {
    return Zt.ofLength(this.modifiedLineNumber, this.lineCount);
  }
  constructor(e, t, n, r, s) {
    this.originalLineNumber = e, this.modifiedLineNumber = t, this.lineCount = n, this._visibleLineCountTop = Qt(this, 0), this.visibleLineCountTop = this._visibleLineCountTop, this._visibleLineCountBottom = Qt(this, 0), this.visibleLineCountBottom = this._visibleLineCountBottom, this._shouldHideControls = Ie(this, (l) => (
      /** @description isVisible */
      this.visibleLineCountTop.read(l) + this.visibleLineCountBottom.read(l) === this.lineCount && !this.isDragged.read(l)
    )), this.isDragged = Qt(this, void 0);
    const o = Math.max(Math.min(r, this.lineCount), 0), a = Math.max(Math.min(s, this.lineCount - r), 0);
    fxe(r === o), fxe(s === a), this._visibleLineCountTop.set(o, void 0), this._visibleLineCountBottom.set(a, void 0);
  }
  setVisibleRanges(e, t) {
    const n = [], r = new Mf(e.map((l) => l.modified)).subtractFrom(this.modifiedUnchangedRange);
    let s = this.originalLineNumber, o = this.modifiedLineNumber;
    const a = this.modifiedLineNumber + this.lineCount;
    if (r.ranges.length === 0)
      this.showAll(t), n.push(this);
    else {
      let l = 0;
      for (const c of r.ranges) {
        const u = l === r.ranges.length - 1;
        l++;
        const d = (u ? a : c.endLineNumberExclusive) - o, h = new g1(s, o, d, 0, 0);
        h.setHiddenModifiedRange(c, t), n.push(h), s = h.originalUnchangedRange.endLineNumberExclusive, o = h.modifiedUnchangedRange.endLineNumberExclusive;
      }
    }
    return n;
  }
  shouldHideControls(e) {
    return this._shouldHideControls.read(e);
  }
  getHiddenOriginalRange(e) {
    return Zt.ofLength(this.originalLineNumber + this._visibleLineCountTop.read(e), this.lineCount - this._visibleLineCountTop.read(e) - this._visibleLineCountBottom.read(e));
  }
  getHiddenModifiedRange(e) {
    return Zt.ofLength(this.modifiedLineNumber + this._visibleLineCountTop.read(e), this.lineCount - this._visibleLineCountTop.read(e) - this._visibleLineCountBottom.read(e));
  }
  setHiddenModifiedRange(e, t) {
    const n = e.startLineNumber - this.modifiedLineNumber, r = this.modifiedLineNumber + this.lineCount - e.endLineNumberExclusive;
    this.setState(n, r, t);
  }
  getMaxVisibleLineCountTop() {
    return this.lineCount - this._visibleLineCountBottom.get();
  }
  getMaxVisibleLineCountBottom() {
    return this.lineCount - this._visibleLineCountTop.get();
  }
  showMoreAbove(e = 10, t) {
    const n = this.getMaxVisibleLineCountTop();
    this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get() + e, n), t);
  }
  showMoreBelow(e = 10, t) {
    const n = this.lineCount - this._visibleLineCountTop.get();
    this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get() + e, n), t);
  }
  showAll(e) {
    this._visibleLineCountBottom.set(this.lineCount - this._visibleLineCountTop.get(), e);
  }
  showModifiedLine(e, t, n) {
    const r = e + 1 - (this.modifiedLineNumber + this._visibleLineCountTop.get()), s = this.modifiedLineNumber - this._visibleLineCountBottom.get() + this.lineCount - e;
    t === 0 && r < s || t === 1 ? this._visibleLineCountTop.set(this._visibleLineCountTop.get() + r, n) : this._visibleLineCountBottom.set(this._visibleLineCountBottom.get() + s, n);
  }
  showOriginalLine(e, t, n) {
    const r = e - this.originalLineNumber, s = this.originalLineNumber + this.lineCount - e;
    t === 0 && r < s || t === 1 ? this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get() + s - r, this.getMaxVisibleLineCountTop()), n) : this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get() + r - s, this.getMaxVisibleLineCountBottom()), n);
  }
  collapseAll(e) {
    this._visibleLineCountTop.set(0, e), this._visibleLineCountBottom.set(0, e);
  }
  setState(e, t, n) {
    e = Math.max(Math.min(e, this.lineCount), 0), t = Math.max(Math.min(t, this.lineCount - e), 0), this._visibleLineCountTop.set(e, n), this._visibleLineCountBottom.set(t, n);
  }
}
class Xvt extends ge {
  get visibility() {
    return this._visibility;
  }
  set visibility(e) {
    this._visibility !== e && (this._visibility = e, this._diffActions.style.visibility = e ? "visible" : "hidden");
  }
  constructor(e, t, n, r, s, o, a, l, c) {
    super(), this._getViewZoneId = e, this._marginDomNode = t, this._modifiedEditor = n, this._diff = r, this._editor = s, this._viewLineCounts = o, this._originalTextModel = a, this._contextMenuService = l, this._clipboardService = c, this._visibility = !1, this._marginDomNode.style.zIndex = "10", this._diffActions = document.createElement("div"), this._diffActions.className = qt.asClassName(Pe.lightBulb) + " lightbulb-glyph", this._diffActions.style.position = "absolute";
    const u = this._modifiedEditor.getOption(
      75
      /* EditorOption.lineHeight */
    );
    this._diffActions.style.right = "0px", this._diffActions.style.visibility = "hidden", this._diffActions.style.height = `${u}px`, this._diffActions.style.lineHeight = `${u}px`, this._marginDomNode.appendChild(this._diffActions);
    let d = 0;
    const h = n.getOption(
      144
      /* EditorOption.useShadowDOM */
    ) && !jf, g = (m, _) => {
      this._contextMenuService.showContextMenu({
        domForShadowRoot: h ? n.getDomNode() ?? void 0 : void 0,
        getAnchor: () => ({ x: m, y: _ }),
        getActions: () => {
          const v = [], w = r.modified.isEmpty;
          return v.push(new Vh("diff.clipboard.copyDeletedContent", w ? r.original.length > 1 ? S(109, "Copy deleted lines") : S(110, "Copy deleted line") : r.original.length > 1 ? S(111, "Copy changed lines") : S(112, "Copy changed line"), void 0, !0, async () => {
            const L = this._originalTextModel.getValueInRange(r.original.toExclusiveRange());
            await this._clipboardService.writeText(L);
          })), r.original.length > 1 && v.push(new Vh("diff.clipboard.copyDeletedLineContent", w ? S(113, "Copy deleted line ({0})", r.original.startLineNumber + d) : S(114, "Copy changed line ({0})", r.original.startLineNumber + d), void 0, !0, async () => {
            let L = this._originalTextModel.getLineContent(r.original.startLineNumber + d);
            L === "" && (L = this._originalTextModel.getEndOfLineSequence() === 0 ? `
` : `\r
`), await this._clipboardService.writeText(L);
          })), n.getOption(
            104
            /* EditorOption.readOnly */
          ) || v.push(new Vh("diff.inline.revertChange", S(115, "Revert this change"), void 0, !0, async () => {
            this._editor.revert(this._diff);
          })), v;
        },
        autoSelectFirstItem: !0
      });
    };
    this._register(vo(this._diffActions, "mousedown", (m) => {
      if (!m.leftButton)
        return;
      const { top: _, height: v } = ho(this._diffActions), w = Math.floor(u / 3);
      m.preventDefault(), g(m.posx, _ + v + w);
    })), this._register(n.onMouseMove((m) => {
      (m.target.type === 8 || m.target.type === 5) && m.target.detail.viewZoneId === this._getViewZoneId() ? (d = this._updateLightBulbPosition(this._marginDomNode, m.event.browserEvent.y, u), this.visibility = !0) : this.visibility = !1;
    })), this._register(n.onMouseDown((m) => {
      m.event.leftButton && (m.target.type === 8 || m.target.type === 5) && m.target.detail.viewZoneId === this._getViewZoneId() && (m.event.preventDefault(), d = this._updateLightBulbPosition(this._marginDomNode, m.event.browserEvent.y, u), g(m.event.posx, m.event.posy + u));
    }));
  }
  _updateLightBulbPosition(e, t, n) {
    const { top: r } = ho(e), s = t - r, o = Math.floor(s / n), a = o * n;
    if (this._diffActions.style.top = `${a}px`, this._viewLineCounts) {
      let l = 0;
      for (let c = 0; c < this._viewLineCounts.length; c++)
        if (l += this._viewLineCounts[c], o < l)
          return c;
    }
    return o;
  }
}
const Gke = Db("diffEditorWidget", { createHTML: (i) => i });
function PB(i, e, t, n, r = !1) {
  Ma(n, e.fontInfo);
  const s = t.length > 0, o = new ww(1e4);
  let a = 0, l = 0;
  const c = [];
  for (let g = 0; g < i.lineTokens.length; g++) {
    const m = g + 1, _ = i.lineTokens[g], v = i.lineBreakData[g], w = Lc.filter(t, m, 1, Number.MAX_SAFE_INTEGER);
    if (v) {
      let E = 0;
      for (const L of v.breakOffsets) {
        const T = _.sliceAndInflate(E, L, 0);
        a = Math.max(a, qke(l, T, Lc.extractWrapped(w, E, L), s, i.mightContainNonBasicASCII, i.mightContainRTL, e, o, r)), l++, E = L;
      }
      c.push(v.breakOffsets.length);
    } else
      c.push(1), a = Math.max(a, qke(l, _, w, s, i.mightContainNonBasicASCII, i.mightContainRTL, e, o, r)), l++;
  }
  a += e.scrollBeyondLastColumn;
  const u = o.build(), d = Gke ? Gke.createHTML(u) : u;
  n.innerHTML = d;
  const h = a * e.typicalHalfwidthCharacterWidth;
  return {
    heightInLines: l,
    minWidthInPx: h,
    viewLineCounts: c
  };
}
class FB {
  constructor(e, t = e.map((s) => null), n = !0, r = !0) {
    this.lineTokens = e, this.lineBreakData = t, this.mightContainNonBasicASCII = n, this.mightContainRTL = r;
  }
}
class By {
  static fromEditor(e) {
    var s;
    const t = e.getOptions(), n = t.get(
      59
      /* EditorOption.fontInfo */
    ), r = t.get(
      165
      /* EditorOption.layoutInfo */
    );
    return new By(((s = e.getModel()) == null ? void 0 : s.getOptions().tabSize) || 0, n, t.get(
      40
      /* EditorOption.disableMonospaceOptimizations */
    ), n.typicalHalfwidthCharacterWidth, t.get(
      118
      /* EditorOption.scrollBeyondLastColumn */
    ), t.get(
      75
      /* EditorOption.lineHeight */
    ), r.decorationsWidth, t.get(
      133
      /* EditorOption.stopRenderingLineAfter */
    ), t.get(
      113
      /* EditorOption.renderWhitespace */
    ), t.get(
      108
      /* EditorOption.renderControlCharacters */
    ), t.get(
      60
      /* EditorOption.fontLigatures */
    ), t.get(
      117
      /* EditorOption.scrollbar */
    ).verticalScrollbarSize);
  }
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g = !0) {
    this.tabSize = e, this.fontInfo = t, this.disableMonospaceOptimizations = n, this.typicalHalfwidthCharacterWidth = r, this.scrollBeyondLastColumn = s, this.lineHeight = o, this.lineDecorationsWidth = a, this.stopRenderingLineAfter = l, this.renderWhitespace = c, this.renderControlCharacters = u, this.fontLigatures = d, this.verticalScrollbarSize = h, this.setWidth = g;
  }
  withSetWidth(e) {
    return new By(this.tabSize, this.fontInfo, this.disableMonospaceOptimizations, this.typicalHalfwidthCharacterWidth, this.scrollBeyondLastColumn, this.lineHeight, this.lineDecorationsWidth, this.stopRenderingLineAfter, this.renderWhitespace, this.renderControlCharacters, this.fontLigatures, this.verticalScrollbarSize, e);
  }
  withScrollBeyondLastColumn(e) {
    return new By(this.tabSize, this.fontInfo, this.disableMonospaceOptimizations, this.typicalHalfwidthCharacterWidth, e, this.lineHeight, this.lineDecorationsWidth, this.stopRenderingLineAfter, this.renderWhitespace, this.renderControlCharacters, this.fontLigatures, this.verticalScrollbarSize, this.setWidth);
  }
}
function qke(i, e, t, n, r, s, o, a, l) {
  a.appendString('<div class="view-line'), !l && !n && a.appendString(" char-delete"), a.appendString('" style="top:'), a.appendString(String(i * o.lineHeight)), o.setWidth ? a.appendString('px;width:1000000px;">') : a.appendString('px;">');
  const c = e.getLineContent(), u = Kh.isBasicASCII(c, r), d = Kh.containsRTL(c, u, s), h = t2(new d0(
    o.fontInfo.isMonospace && !o.disableMonospaceOptimizations,
    o.fontInfo.canUseHalfwidthRightwardsArrow,
    c,
    !1,
    u,
    d,
    0,
    e,
    t,
    o.tabSize,
    0,
    o.fontInfo.spaceWidth,
    o.fontInfo.middotWidth,
    o.fontInfo.wsmiddotWidth,
    o.stopRenderingLineAfter,
    o.renderWhitespace,
    o.renderControlCharacters,
    o.fontLigatures !== Yy.OFF,
    null,
    // Send no selections, original line cannot be selected
    null,
    o.verticalScrollbarSize
  ), a);
  return a.appendString("</div>"), h.characterMapping.getHorizontalOffset(h.characterMapping.length);
}
const _m = Vn("clipboardService"), g0 = Vn("contextViewService"), Qh = Vn("contextMenuService");
var Zvt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Kke = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let use = class extends ge {
  constructor(e, t, n, r, s, o, a, l, c, u) {
    super(), this._targetWindow = e, this._editors = t, this._diffModel = n, this._options = r, this._diffEditorWidget = s, this._canIgnoreViewZoneUpdateEvent = o, this._origViewZonesToIgnore = a, this._modViewZonesToIgnore = l, this._clipboardService = c, this._contextMenuService = u, this._originalTopPadding = Qt(this, 0), this._originalScrollOffset = Qt(this, 0), this._originalScrollOffsetAnimated = Ske(this._targetWindow, this._originalScrollOffset, this._store), this._modifiedTopPadding = Qt(this, 0), this._modifiedScrollOffset = Qt(this, 0), this._modifiedScrollOffsetAnimated = Ske(this._targetWindow, this._modifiedScrollOffset, this._store);
    const d = Qt("invalidateAlignmentsState", 0), h = this._register(new mr(() => {
      d.set(d.get() + 1, void 0);
    }, 0));
    this._register(this._editors.original.onDidChangeViewZones((L) => {
      this._canIgnoreViewZoneUpdateEvent() || h.schedule();
    })), this._register(this._editors.modified.onDidChangeViewZones((L) => {
      this._canIgnoreViewZoneUpdateEvent() || h.schedule();
    })), this._register(this._editors.original.onDidChangeConfiguration((L) => {
      (L.hasChanged(
        166
        /* EditorOption.wrappingInfo */
      ) || L.hasChanged(
        75
        /* EditorOption.lineHeight */
      )) && h.schedule();
    })), this._register(this._editors.modified.onDidChangeConfiguration((L) => {
      (L.hasChanged(
        166
        /* EditorOption.wrappingInfo */
      ) || L.hasChanged(
        75
        /* EditorOption.lineHeight */
      )) && h.schedule();
    }));
    const g = this._diffModel.map((L) => L ? ji(
      this,
      L.model.original.onDidChangeTokens,
      () => L.model.original.tokenization.backgroundTokenizationState === 2
      /* BackgroundTokenizationState.Completed */
    ) : void 0).map((L, T) => L == null ? void 0 : L.read(T)), m = Ie((L) => {
      const T = this._diffModel.read(L), D = T == null ? void 0 : T.diff.read(L);
      if (!T || !D)
        return null;
      d.read(L);
      const R = this._options.renderSideBySide.read(L);
      return Yke(this._editors.original, this._editors.modified, D.mappings, this._origViewZonesToIgnore, this._modViewZonesToIgnore, R);
    }), _ = Ie((L) => {
      var N;
      const T = (N = this._diffModel.read(L)) == null ? void 0 : N.movedTextToCompare.read(L);
      if (!T)
        return null;
      d.read(L);
      const D = T.changes.map((R) => new b5e(R));
      return Yke(this._editors.original, this._editors.modified, D, this._origViewZonesToIgnore, this._modViewZonesToIgnore, !0);
    });
    function v() {
      const L = document.createElement("div");
      return L.className = "diagonal-fill", L;
    }
    const w = this._register(new ke());
    this.viewZones = Ie(this, (L) => {
      var Z, pe, J, ae;
      w.clear();
      const T = m.read(L) || [], D = [], N = [], R = this._modifiedTopPadding.read(L);
      R > 0 && N.push({
        afterLineNumber: 0,
        domNode: document.createElement("div"),
        heightInPx: R,
        showInHiddenAreas: !0,
        suppressMouseDown: !0
      });
      const M = this._originalTopPadding.read(L);
      M > 0 && D.push({
        afterLineNumber: 0,
        domNode: document.createElement("div"),
        heightInPx: M,
        showInHiddenAreas: !0,
        suppressMouseDown: !0
      });
      const B = this._options.renderSideBySide.read(L), H = B || (Z = this._editors.modified._getViewModel()) == null ? void 0 : Z.createLineBreaksComputer();
      if (H) {
        const be = this._editors.original.getModel();
        for (const re of T)
          if (re.diff)
            for (let ze = re.originalRange.startLineNumber; ze < re.originalRange.endLineNumberExclusive; ze++) {
              if (ze > be.getLineCount())
                return { orig: D, mod: N };
              H == null || H.addRequest(be.getLineContent(ze), null, null);
            }
      }
      const j = (H == null ? void 0 : H.finalize()) ?? [];
      let K = 0;
      const X = this._editors.modified.getOption(
        75
        /* EditorOption.lineHeight */
      ), Y = (pe = this._diffModel.read(L)) == null ? void 0 : pe.movedTextToCompare.read(L), G = ((J = this._editors.original.getModel()) == null ? void 0 : J.mightContainNonBasicASCII()) ?? !1, Q = ((ae = this._editors.original.getModel()) == null ? void 0 : ae.mightContainRTL()) ?? !1, oe = By.fromEditor(this._editors.modified);
      for (const be of T)
        if (be.diff && !B && (!this._options.useTrueInlineDiffRendering.read(L) || !Tge(be.diff))) {
          if (!be.originalRange.isEmpty) {
            g.read(L);
            const ze = document.createElement("div");
            ze.classList.add("view-lines", "line-delete", "monaco-mouse-cursor-text");
            const Ve = this._editors.original.getModel();
            if (be.originalRange.endLineNumberExclusive - 1 > Ve.getLineCount())
              return { orig: D, mod: N };
            const st = new FB(be.originalRange.mapToLineArray((sn) => Ve.tokenization.getLineTokens(sn)), be.originalRange.mapToLineArray((sn) => j[K++]), G, Q), ot = [];
            for (const sn of be.diff.innerChanges || [])
              ot.push(new zx(
                sn.originalRange.delta(-(be.diff.original.startLineNumber - 1)),
                rse.className,
                0
                /* InlineDecorationType.Regular */
              ));
            const et = PB(st, oe, ot, ze), at = document.createElement("div");
            if (at.className = "inline-deleted-margin-view-zone", Ma(at, oe.fontInfo), this._options.renderIndicators.read(L))
              for (let sn = 0; sn < et.heightInLines; sn++) {
                const Vt = document.createElement("div");
                Vt.className = `delete-sign ${qt.asClassName(f5e)}`, Vt.setAttribute("style", `position:absolute;top:${sn * X}px;width:${oe.lineDecorationsWidth}px;height:${X}px;right:0;`), at.appendChild(Vt);
              }
            let en;
            w.add(new Xvt(() => i1(en), at, this._editors.modified, be.diff, this._diffEditorWidget, et.viewLineCounts, this._editors.original.getModel(), this._contextMenuService, this._clipboardService));
            for (let sn = 0; sn < et.viewLineCounts.length; sn++) {
              const Vt = et.viewLineCounts[sn];
              Vt > 1 && D.push({
                afterLineNumber: be.originalRange.startLineNumber + sn,
                domNode: v(),
                heightInPx: (Vt - 1) * X,
                showInHiddenAreas: !0,
                suppressMouseDown: !0
              });
            }
            N.push({
              afterLineNumber: be.modifiedRange.startLineNumber - 1,
              domNode: ze,
              heightInPx: et.heightInLines * X,
              minWidthInPx: et.minWidthInPx,
              marginDomNode: at,
              setZoneId(sn) {
                en = sn;
              },
              showInHiddenAreas: !0,
              suppressMouseDown: !0
            });
          }
          const re = document.createElement("div");
          re.className = "gutter-delete", D.push({
            afterLineNumber: be.originalRange.endLineNumberExclusive - 1,
            domNode: v(),
            heightInPx: be.modifiedHeightInPx,
            marginDomNode: re,
            showInHiddenAreas: !0,
            suppressMouseDown: !0
          });
        } else {
          const re = be.modifiedHeightInPx - be.originalHeightInPx;
          if (re > 0) {
            if (Y != null && Y.lineRangeMapping.original.delta(-1).deltaLength(2).contains(be.originalRange.endLineNumberExclusive - 1))
              continue;
            D.push({
              afterLineNumber: be.originalRange.endLineNumberExclusive - 1,
              domNode: v(),
              heightInPx: re,
              showInHiddenAreas: !0,
              suppressMouseDown: !0
            });
          } else {
            let ze = function() {
              const st = document.createElement("div");
              return st.className = "arrow-revert-change " + qt.asClassName(Pe.arrowRight), L.store.add(Ce(st, "mousedown", (ot) => ot.stopPropagation())), L.store.add(Ce(st, "click", (ot) => {
                ot.stopPropagation(), s.revert(be.diff);
              })), Ge("div", {}, st);
            };
            if (Y != null && Y.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(be.modifiedRange.endLineNumberExclusive - 1))
              continue;
            let Ve;
            be.diff && be.diff.modified.isEmpty && this._options.shouldRenderOldRevertArrows.read(L) && (Ve = ze()), N.push({
              afterLineNumber: be.modifiedRange.endLineNumberExclusive - 1,
              domNode: v(),
              heightInPx: -re,
              marginDomNode: Ve,
              showInHiddenAreas: !0,
              suppressMouseDown: !0
            });
          }
        }
      for (const be of _.read(L) ?? []) {
        if (!(Y != null && Y.lineRangeMapping.original.intersect(be.originalRange)) || !(Y != null && Y.lineRangeMapping.modified.intersect(be.modifiedRange)))
          continue;
        const re = be.modifiedHeightInPx - be.originalHeightInPx;
        re > 0 ? D.push({
          afterLineNumber: be.originalRange.endLineNumberExclusive - 1,
          domNode: v(),
          heightInPx: re,
          showInHiddenAreas: !0,
          suppressMouseDown: !0
        }) : N.push({
          afterLineNumber: be.modifiedRange.endLineNumberExclusive - 1,
          domNode: v(),
          heightInPx: -re,
          showInHiddenAreas: !0,
          suppressMouseDown: !0
        });
      }
      return { orig: D, mod: N };
    });
    let E = !1;
    this._register(this._editors.original.onDidScrollChange((L) => {
      L.scrollLeftChanged && !E && (E = !0, this._editors.modified.setScrollLeft(L.scrollLeft), E = !1);
    })), this._register(this._editors.modified.onDidScrollChange((L) => {
      L.scrollLeftChanged && !E && (E = !0, this._editors.original.setScrollLeft(L.scrollLeft), E = !1);
    })), this._originalScrollTop = ji(this._editors.original.onDidScrollChange, () => (
      /** @description original.getScrollTop */
      this._editors.original.getScrollTop()
    )), this._modifiedScrollTop = ji(this._editors.modified.onDidScrollChange, () => (
      /** @description modified.getScrollTop */
      this._editors.modified.getScrollTop()
    )), this._register(Xt((L) => {
      const T = this._originalScrollTop.read(L) - (this._originalScrollOffsetAnimated.read(void 0) - this._modifiedScrollOffsetAnimated.read(L)) - (this._originalTopPadding.read(void 0) - this._modifiedTopPadding.read(L));
      T !== this._editors.modified.getScrollTop() && this._editors.modified.setScrollTop(
        T,
        1
        /* ScrollType.Immediate */
      );
    })), this._register(Xt((L) => {
      const T = this._modifiedScrollTop.read(L) - (this._modifiedScrollOffsetAnimated.read(void 0) - this._originalScrollOffsetAnimated.read(L)) - (this._modifiedTopPadding.read(void 0) - this._originalTopPadding.read(L));
      T !== this._editors.original.getScrollTop() && this._editors.original.setScrollTop(
        T,
        1
        /* ScrollType.Immediate */
      );
    })), this._register(Xt((L) => {
      var N;
      const T = (N = this._diffModel.read(L)) == null ? void 0 : N.movedTextToCompare.read(L);
      let D = 0;
      if (T) {
        const R = this._editors.original.getTopForLineNumber(T.lineRangeMapping.original.startLineNumber, !0) - this._originalTopPadding.read(void 0);
        D = this._editors.modified.getTopForLineNumber(T.lineRangeMapping.modified.startLineNumber, !0) - this._modifiedTopPadding.read(void 0) - R;
      }
      D > 0 ? (this._modifiedTopPadding.set(0, void 0), this._originalTopPadding.set(D, void 0)) : D < 0 ? (this._modifiedTopPadding.set(-D, void 0), this._originalTopPadding.set(0, void 0)) : setTimeout(() => {
        this._modifiedTopPadding.set(0, void 0), this._originalTopPadding.set(0, void 0);
      }, 400), this._editors.modified.hasTextFocus() ? this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0) - D, void 0, !0) : this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0) + D, void 0, !0);
    }));
  }
};
use = Zvt([
  Kke(8, _m),
  Kke(9, Qh)
], use);
function Yke(i, e, t, n, r, s) {
  const o = new Ky(Xke(i, n)), a = new Ky(Xke(e, r)), l = i.getOption(
    75
    /* EditorOption.lineHeight */
  ), c = e.getOption(
    75
    /* EditorOption.lineHeight */
  ), u = [];
  let d = 0, h = 0;
  function g(m, _) {
    for (; ; ) {
      let v = o.peek(), w = a.peek();
      if (v && v.lineNumber >= m && (v = void 0), w && w.lineNumber >= _ && (w = void 0), !v && !w)
        break;
      const E = v ? v.lineNumber - d : Number.MAX_VALUE, L = w ? w.lineNumber - h : Number.MAX_VALUE;
      E < L ? (o.dequeue(), w = {
        lineNumber: v.lineNumber - d + h,
        heightInPx: 0
      }) : E > L ? (a.dequeue(), v = {
        lineNumber: w.lineNumber - h + d,
        heightInPx: 0
      }) : (o.dequeue(), a.dequeue()), u.push({
        originalRange: Zt.ofLength(v.lineNumber, 1),
        modifiedRange: Zt.ofLength(w.lineNumber, 1),
        originalHeightInPx: l + v.heightInPx,
        modifiedHeightInPx: c + w.heightInPx,
        diff: void 0
      });
    }
  }
  for (const m of t) {
    let L = function(T, D, N = !1) {
      var j, K;
      if (T < E || D < w)
        return;
      if (v)
        v = !1;
      else if (!N && (T === E || D === w))
        return;
      const R = new Zt(E, T), M = new Zt(w, D);
      if (R.isEmpty && M.isEmpty)
        return;
      const B = ((j = o.takeWhile((X) => X.lineNumber < T)) == null ? void 0 : j.reduce((X, Y) => X + Y.heightInPx, 0)) ?? 0, H = ((K = a.takeWhile((X) => X.lineNumber < D)) == null ? void 0 : K.reduce((X, Y) => X + Y.heightInPx, 0)) ?? 0;
      u.push({
        originalRange: R,
        modifiedRange: M,
        originalHeightInPx: R.length * l + B,
        modifiedHeightInPx: M.length * c + H,
        diff: m.lineRangeMapping
      }), E = T, w = D;
    };
    const _ = m.lineRangeMapping;
    g(_.original.startLineNumber, _.modified.startLineNumber);
    let v = !0, w = _.modified.startLineNumber, E = _.original.startLineNumber;
    if (s)
      for (const T of _.innerChanges || []) {
        T.originalRange.startColumn > 1 && T.modifiedRange.startColumn > 1 && L(T.originalRange.startLineNumber, T.modifiedRange.startLineNumber);
        const D = i.getModel(), N = T.originalRange.endLineNumber <= D.getLineCount() ? D.getLineMaxColumn(T.originalRange.endLineNumber) : Number.MAX_SAFE_INTEGER;
        T.originalRange.endColumn < N && L(T.originalRange.endLineNumber, T.modifiedRange.endLineNumber);
      }
    L(_.original.endLineNumberExclusive, _.modified.endLineNumberExclusive, !0), d = _.original.endLineNumberExclusive, h = _.modified.endLineNumberExclusive;
  }
  return g(Number.MAX_VALUE, Number.MAX_VALUE), u;
}
function Xke(i, e) {
  const t = [], n = [], r = i.getOption(
    166
    /* EditorOption.wrappingInfo */
  ).wrappingColumn !== -1, s = i._getViewModel().coordinatesConverter, o = i.getOption(
    75
    /* EditorOption.lineHeight */
  );
  if (r)
    for (let l = 1; l <= i.getModel().getLineCount(); l++) {
      const c = s.getModelLineViewLineCount(l);
      c > 1 && n.push({ lineNumber: l, heightInPx: o * (c - 1) });
    }
  for (const l of i.getWhitespaces()) {
    if (e.has(l.id))
      continue;
    const c = l.afterLineNumber === 0 ? 0 : s.convertViewPositionToModelPosition(new de(l.afterLineNumber, 1)).lineNumber;
    t.push({ lineNumber: c, heightInPx: l.height });
  }
  return evt(t, n, (l) => l.lineNumber, (l, c) => ({ lineNumber: l.lineNumber, heightInPx: l.heightInPx + c.heightInPx }));
}
function Tge(i) {
  return i.innerChanges ? i.innerChanges.every((e) => PU(e.modifiedRange) && PU(e.originalRange) || e.originalRange.equalsRange(new z(1, 1, 1, 1))) : !1;
}
function PU(i) {
  return i.startLineNumber === i.endLineNumber;
}
const O3 = class O3 extends ge {
  constructor(e, t, n, r, s) {
    super(), this._rootElement = e, this._diffModel = t, this._originalEditorLayoutInfo = n, this._modifiedEditorLayoutInfo = r, this._editors = s, this._originalScrollTop = ji(this, this._editors.original.onDidScrollChange, () => this._editors.original.getScrollTop()), this._modifiedScrollTop = ji(this, this._editors.modified.onDidScrollChange, () => this._editors.modified.getScrollTop()), this._viewZonesChanged = Dd("onDidChangeViewZones", this._editors.modified.onDidChangeViewZones), this.width = Qt(this, 0), this._modifiedViewZonesChangedSignal = Dd("modified.onDidChangeViewZones", this._editors.modified.onDidChangeViewZones), this._originalViewZonesChangedSignal = Dd("original.onDidChangeViewZones", this._editors.original.onDidChangeViewZones), this._state = Ie(this, (u) => {
      var N;
      this._element.replaceChildren();
      const d = this._diffModel.read(u), h = (N = d == null ? void 0 : d.diff.read(u)) == null ? void 0 : N.movedTexts;
      if (!h || h.length === 0) {
        this.width.set(0, void 0);
        return;
      }
      this._viewZonesChanged.read(u);
      const g = this._originalEditorLayoutInfo.read(u), m = this._modifiedEditorLayoutInfo.read(u);
      if (!g || !m) {
        this.width.set(0, void 0);
        return;
      }
      this._modifiedViewZonesChangedSignal.read(u), this._originalViewZonesChangedSignal.read(u);
      const _ = h.map((R) => {
        function M(oe, Z) {
          const pe = Z.getTopForLineNumber(oe.startLineNumber, !0), J = Z.getTopForLineNumber(oe.endLineNumberExclusive, !0);
          return (pe + J) / 2;
        }
        const B = M(R.lineRangeMapping.original, this._editors.original), H = this._originalScrollTop.read(u), j = M(R.lineRangeMapping.modified, this._editors.modified), K = this._modifiedScrollTop.read(u), X = B - H, Y = j - K, G = Math.min(B, j), Q = Math.max(B, j);
        return { range: new Tt(G, Q), from: X, to: Y, fromWithoutScroll: B, toWithoutScroll: j, move: R };
      });
      _.sort(nit(yl((R) => R.fromWithoutScroll > R.toWithoutScroll, pPe), yl((R) => R.fromWithoutScroll > R.toWithoutScroll ? R.fromWithoutScroll : -R.toWithoutScroll, Hd)));
      const v = kge.compute(_.map((R) => R.range)), w = 10, E = g.verticalScrollbarWidth, L = (v.getTrackCount() - 1) * 10 + w * 2, T = E + L + (m.contentLeft - O3.movedCodeBlockPadding);
      let D = 0;
      for (const R of _) {
        const M = v.getTrack(D), B = E + w + M * 10, H = 15, j = 15, K = T, X = m.glyphMarginWidth + m.lineNumbersWidth, Y = 18, G = document.createElementNS("http://www.w3.org/2000/svg", "rect");
        G.classList.add("arrow-rectangle"), G.setAttribute("x", `${K - X}`), G.setAttribute("y", `${R.to - Y / 2}`), G.setAttribute("width", `${X}`), G.setAttribute("height", `${Y}`), this._element.appendChild(G);
        const Q = document.createElementNS("http://www.w3.org/2000/svg", "g"), oe = document.createElementNS("http://www.w3.org/2000/svg", "path");
        oe.setAttribute("d", `M 0 ${R.from} L ${B} ${R.from} L ${B} ${R.to} L ${K - j} ${R.to}`), oe.setAttribute("fill", "none"), Q.appendChild(oe);
        const Z = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
        Z.classList.add("arrow"), u.store.add(Xt((pe) => {
          oe.classList.toggle("currentMove", R.move === d.activeMovedText.read(pe)), Z.classList.toggle("currentMove", R.move === d.activeMovedText.read(pe));
        })), Z.setAttribute("points", `${K - j},${R.to - H / 2} ${K},${R.to} ${K - j},${R.to + H / 2}`), Q.appendChild(Z), this._element.appendChild(Q), D++;
      }
      this.width.set(L, void 0);
    }), this._element = document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._element.setAttribute("class", "moved-blocks-lines"), this._rootElement.appendChild(this._element), this._register(Et(() => this._element.remove())), this._register(Xt((u) => {
      const d = this._originalEditorLayoutInfo.read(u), h = this._modifiedEditorLayoutInfo.read(u);
      !d || !h || (this._element.style.left = `${d.width - d.verticalScrollbarWidth}px`, this._element.style.height = `${d.height}px`, this._element.style.width = `${d.verticalScrollbarWidth + d.contentLeft - O3.movedCodeBlockPadding + this.width.read(u)}px`);
    })), this._register(GR(this._state));
    const o = Ie((u) => {
      const d = this._diffModel.read(u), h = d == null ? void 0 : d.diff.read(u);
      return h ? h.movedTexts.map((g) => ({
        move: g,
        original: new fN(Br(g.lineRangeMapping.original.startLineNumber - 1), 18),
        modified: new fN(Br(g.lineRangeMapping.modified.startLineNumber - 1), 18)
      })) : [];
    });
    this._register(NU(this._editors.original, o.map((u) => (
      /** @description movedBlockViewZones.original */
      u.map((d) => d.original)
    )))), this._register(NU(this._editors.modified, o.map((u) => (
      /** @description movedBlockViewZones.modified */
      u.map((d) => d.modified)
    )))), this._register(Ql((u, d) => {
      const h = o.read(u);
      for (const g of h)
        d.add(new Zke(this._editors.original, g.original, g.move, "original", this._diffModel.get())), d.add(new Zke(this._editors.modified, g.modified, g.move, "modified", this._diffModel.get()));
    }));
    const a = Dd("original.onDidFocusEditorWidget", (u) => this._editors.original.onDidFocusEditorWidget(() => setTimeout(() => u(void 0), 0))), l = Dd("modified.onDidFocusEditorWidget", (u) => this._editors.modified.onDidFocusEditorWidget(() => setTimeout(() => u(void 0), 0)));
    let c = "modified";
    this._register(GA({
      changeTracker: {
        createChangeSummary: () => {
        },
        handleChange: (u, d) => (u.didChange(a) && (c = "original"), u.didChange(l) && (c = "modified"), !0)
      }
    }, (u) => {
      a.read(u), l.read(u);
      const d = this._diffModel.read(u);
      if (!d)
        return;
      const h = d.diff.read(u);
      let g;
      if (h && c === "original") {
        const m = this._editors.originalCursor.read(u);
        m && (g = h.movedTexts.find((_) => _.lineRangeMapping.original.contains(m.lineNumber)));
      }
      if (h && c === "modified") {
        const m = this._editors.modifiedCursor.read(u);
        m && (g = h.movedTexts.find((_) => _.lineRangeMapping.modified.contains(m.lineNumber)));
      }
      g !== d.movedTextToCompare.read(void 0) && d.movedTextToCompare.set(void 0, void 0), d.setActiveMovedText(g);
    }));
  }
};
O3.movedCodeBlockPadding = 4;
let rR = O3;
class kge {
  static compute(e) {
    const t = [], n = [];
    for (const r of e) {
      let s = t.findIndex((o) => !o.intersectsStrict(r));
      s === -1 && (t.length >= 6 ? s = pdt(t, yl((a) => a.intersectWithRangeLength(r), Hd)) : (s = t.length, t.push(new lfe()))), t[s].addRange(r), n.push(s);
    }
    return new kge(t.length, n);
  }
  constructor(e, t) {
    this._trackCount = e, this.trackPerLineIdx = t;
  }
  getTrack(e) {
    return this.trackPerLineIdx[e];
  }
  getTrackCount() {
    return this._trackCount;
  }
}
class Zke extends Sge {
  constructor(e, t, n, r, s) {
    const o = Li("div.diff-hidden-lines-widget");
    super(e, t, o.root), this._editor = e, this._move = n, this._kind = r, this._diffModel = s, this._nodes = Li("div.diff-moved-code-block", { style: { marginRight: "4px" } }, [
      Li("div.text-content@textContent"),
      Li("div.action-bar@actionBar")
    ]), o.root.appendChild(this._nodes.root);
    const a = ji(this._editor.onDidLayoutChange, () => this._editor.getLayoutInfo());
    this._register(dw(this._nodes.root, {
      paddingRight: a.map((h) => h.verticalScrollbarWidth)
    }));
    let l;
    n.changes.length > 0 ? l = this._kind === "original" ? S(128, "Code moved with changes to line {0}-{1}", this._move.lineRangeMapping.modified.startLineNumber, this._move.lineRangeMapping.modified.endLineNumberExclusive - 1) : S(129, "Code moved with changes from line {0}-{1}", this._move.lineRangeMapping.original.startLineNumber, this._move.lineRangeMapping.original.endLineNumberExclusive - 1) : l = this._kind === "original" ? S(130, "Code moved to line {0}-{1}", this._move.lineRangeMapping.modified.startLineNumber, this._move.lineRangeMapping.modified.endLineNumberExclusive - 1) : S(131, "Code moved from line {0}-{1}", this._move.lineRangeMapping.original.startLineNumber, this._move.lineRangeMapping.original.endLineNumberExclusive - 1);
    const c = this._register(new qu(this._nodes.actionBar, {
      highlightToggledItems: !0
    })), u = new Vh("", l, "", !1);
    c.push(u, { icon: !1, label: !0 });
    const d = new Vh("", "Compare", qt.asClassName(Pe.compareChanges), !0, () => {
      this._editor.focus(), this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get() === n ? void 0 : this._move, void 0);
    });
    this._register(Xt((h) => {
      const g = this._diffModel.movedTextToCompare.read(h) === n;
      d.checked = g;
    })), c.push(d, { icon: !1, label: !0 });
  }
}
class Qvt extends ge {
  constructor(e, t, n, r) {
    super(), this._editors = e, this._diffModel = t, this._options = n, this._decorations = Ie(this, (s) => {
      const o = this._diffModel.read(s), a = o == null ? void 0 : o.diff.read(s);
      if (!a)
        return null;
      const l = this._diffModel.read(s).movedTextToCompare.read(s), c = this._options.renderIndicators.read(s), u = this._options.showEmptyDecorations.read(s), d = [], h = [];
      if (!l)
        for (const m of a.mappings)
          if (m.lineRangeMapping.original.isEmpty || d.push({ range: m.lineRangeMapping.original.toInclusiveRange(), options: c ? Nke : Ake }), m.lineRangeMapping.modified.isEmpty || h.push({ range: m.lineRangeMapping.modified.toInclusiveRange(), options: c ? Ike : Rke }), m.lineRangeMapping.modified.isEmpty || m.lineRangeMapping.original.isEmpty)
            m.lineRangeMapping.original.isEmpty || d.push({ range: m.lineRangeMapping.original.toInclusiveRange(), options: Lvt }), m.lineRangeMapping.modified.isEmpty || h.push({ range: m.lineRangeMapping.modified.toInclusiveRange(), options: Evt });
          else {
            const _ = this._options.useTrueInlineDiffRendering.read(s) && Tge(m.lineRangeMapping);
            for (const v of m.lineRangeMapping.innerChanges || [])
              if (m.lineRangeMapping.original.contains(v.originalRange.startLineNumber) && d.push({ range: v.originalRange, options: v.originalRange.isEmpty() && u ? Tvt : rse }), m.lineRangeMapping.modified.contains(v.modifiedRange.startLineNumber) && h.push({ range: v.modifiedRange, options: v.modifiedRange.isEmpty() && u && !_ ? xvt : Oke }), _) {
                const w = o.model.original.getValueInRange(v.originalRange);
                h.push({
                  range: v.modifiedRange,
                  options: {
                    description: "deleted-text",
                    before: {
                      content: w,
                      inlineClassName: "inline-deleted-text"
                    },
                    zIndex: 1e5,
                    showIfCollapsed: !0
                  }
                });
              }
          }
      if (l)
        for (const m of l.changes) {
          const _ = m.original.toInclusiveRange();
          _ && d.push({ range: _, options: c ? Nke : Ake });
          const v = m.modified.toInclusiveRange();
          v && h.push({ range: v, options: c ? Ike : Rke });
          for (const w of m.innerChanges || [])
            d.push({ range: w.originalRange, options: rse }), h.push({ range: w.modifiedRange, options: Oke });
        }
      const g = this._diffModel.read(s).activeMovedText.read(s);
      for (const m of a.movedTexts)
        d.push({
          range: m.lineRangeMapping.original.toInclusiveRange(),
          options: {
            description: "moved",
            blockClassName: "movedOriginal" + (m === g ? " currentMove" : ""),
            blockPadding: [rR.movedCodeBlockPadding, 0, rR.movedCodeBlockPadding, rR.movedCodeBlockPadding]
          }
        }), h.push({
          range: m.lineRangeMapping.modified.toInclusiveRange(),
          options: {
            description: "moved",
            blockClassName: "movedModified" + (m === g ? " currentMove" : ""),
            blockPadding: [4, 0, 4, 4]
          }
        });
      return { originalDecorations: d, modifiedDecorations: h };
    }), this._register(IU(this._editors.original, this._decorations.map((s) => (s == null ? void 0 : s.originalDecorations) || []))), this._register(IU(this._editors.modified, this._decorations.map((s) => (s == null ? void 0 : s.modifiedDecorations) || [])));
  }
}
class ha {
  static equals(e, t) {
    return e.x === t.x && e.y === t.y;
  }
  constructor(e, t) {
    this.x = e, this.y = t;
  }
  add(e) {
    return new ha(this.x + e.x, this.y + e.y);
  }
  deltaX(e) {
    return new ha(this.x + e, this.y);
  }
  deltaY(e) {
    return new ha(this.x, this.y + e);
  }
  toString() {
    return `(${this.x},${this.y})`;
  }
  subtract(e) {
    return new ha(this.x - e.x, this.y - e.y);
  }
  scale(e) {
    return new ha(this.x * e, this.y * e);
  }
  mapComponents(e) {
    return new ha(e(this.x), e(this.y));
  }
  isZero() {
    return this.x === 0 && this.y === 0;
  }
  withThreshold(e) {
    return this.mapComponents((t) => t > e ? t - e : t < -e ? t + e : 0);
  }
}
function Ms(i) {
  return dse.get(i);
}
const zC = class zC extends ge {
  /**
   * Make sure that editor is not disposed yet!
  */
  static get(e) {
    let t = zC._map.get(e);
    if (!t) {
      t = new zC(e), zC._map.set(e, t);
      const n = e.onDidDispose(() => {
        const r = zC._map.get(e);
        r && (zC._map.delete(e), r.dispose(), n.dispose());
      });
    }
    return t;
  }
  _beginUpdate() {
    this._updateCounter++, this._updateCounter === 1 && (this._currentTransaction = new $A(() => {
    }));
  }
  _endUpdate() {
    if (this._updateCounter--, this._updateCounter === 0) {
      const e = this._currentTransaction;
      this._currentTransaction = void 0, e.finish();
    }
  }
  constructor(e) {
    var t;
    super(), this.editor = e, this._updateCounter = 0, this._currentTransaction = void 0, this._model = Qt(this, this.editor.getModel()), this.model = this._model, this.isReadonly = ji(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(
      104
      /* EditorOption.readOnly */
    )), this._versionId = CF({ owner: this, lazy: !0 }, ((t = this.editor.getModel()) == null ? void 0 : t.getVersionId()) ?? null), this.versionId = this._versionId, this._selections = CF({ owner: this, equalsFn: cx(e4(bt.selectionsEqual)), lazy: !0 }, this.editor.getSelections() ?? null), this.selections = this._selections, this.positions = pl({ owner: this, equalsFn: cx(e4(de.equals)) }, (n) => {
      var r;
      return ((r = this.selections.read(n)) == null ? void 0 : r.map((s) => s.getStartPosition())) ?? null;
    }), this.isFocused = ji(this, (n) => {
      const r = this.editor.onDidFocusEditorWidget(n), s = this.editor.onDidBlurEditorWidget(n);
      return {
        dispose() {
          r.dispose(), s.dispose();
        }
      };
    }, () => this.editor.hasWidgetFocus()), this.isTextFocused = ji(this, (n) => {
      const r = this.editor.onDidFocusEditorText(n), s = this.editor.onDidBlurEditorText(n);
      return {
        dispose() {
          r.dispose(), s.dispose();
        }
      };
    }, () => this.editor.hasTextFocus()), this.inComposition = ji(this, (n) => {
      const r = this.editor.onDidCompositionStart(() => {
        n(void 0);
      }), s = this.editor.onDidCompositionEnd(() => {
        n(void 0);
      });
      return {
        dispose() {
          r.dispose(), s.dispose();
        }
      };
    }, () => this.editor.inComposition), this.value = Xhe(this, (n) => {
      var r;
      return this.versionId.read(n), ((r = this.model.read(n)) == null ? void 0 : r.getValue()) ?? "";
    }, (n, r) => {
      const s = this.model.get();
      s !== null && n !== s.getValue() && s.setValue(n);
    }), this.valueIsEmpty = Ie(this, (n) => {
      var r;
      return this.versionId.read(n), ((r = this.editor.getModel()) == null ? void 0 : r.getValueLength()) === 0;
    }), this.cursorSelection = pl({ owner: this, equalsFn: cx(bt.selectionsEqual) }, (n) => {
      var r;
      return ((r = this.selections.read(n)) == null ? void 0 : r[0]) ?? null;
    }), this.cursorPosition = pl({ owner: this, equalsFn: de.equals }, (n) => {
      var r, s;
      return ((s = (r = this.selections.read(n)) == null ? void 0 : r[0]) == null ? void 0 : s.getPosition()) ?? null;
    }), this.cursorLineNumber = Ie(this, (n) => {
      var r;
      return ((r = this.cursorPosition.read(n)) == null ? void 0 : r.lineNumber) ?? null;
    }), this.onDidType = Nf(this), this.onDidPaste = Nf(this), this.scrollTop = ji(this.editor.onDidScrollChange, () => this.editor.getScrollTop()), this.scrollLeft = ji(this.editor.onDidScrollChange, () => this.editor.getScrollLeft()), this.layoutInfo = ji(this.editor.onDidLayoutChange, () => this.editor.getLayoutInfo()), this.layoutInfoContentLeft = this.layoutInfo.map((n) => n.contentLeft), this.layoutInfoDecorationsLeft = this.layoutInfo.map((n) => n.decorationsLeft), this.layoutInfoWidth = this.layoutInfo.map((n) => n.width), this.layoutInfoHeight = this.layoutInfo.map((n) => n.height), this.layoutInfoMinimap = this.layoutInfo.map((n) => n.minimap), this.layoutInfoVerticalScrollbarWidth = this.layoutInfo.map((n) => n.verticalScrollbarWidth), this.contentWidth = ji(this.editor.onDidContentSizeChange, () => this.editor.getContentWidth()), this.contentHeight = ji(this.editor.onDidContentSizeChange, () => this.editor.getContentHeight()), this._widgetCounter = 0, this.openedPeekWidgets = Qt(this, 0), this._register(this.editor.onBeginUpdate(() => this._beginUpdate())), this._register(this.editor.onEndUpdate(() => this._endUpdate())), this._register(this.editor.onDidChangeModel(() => {
      this._beginUpdate();
      try {
        this._model.set(this.editor.getModel(), this._currentTransaction), this._forceUpdate();
      } finally {
        this._endUpdate();
      }
    })), this._register(this.editor.onDidType((n) => {
      this._beginUpdate();
      try {
        this._forceUpdate(), this.onDidType.trigger(this._currentTransaction, n);
      } finally {
        this._endUpdate();
      }
    })), this._register(this.editor.onDidPaste((n) => {
      this._beginUpdate();
      try {
        this._forceUpdate(), this.onDidPaste.trigger(this._currentTransaction, n);
      } finally {
        this._endUpdate();
      }
    })), this._register(this.editor.onDidChangeModelContent((n) => {
      var r;
      this._beginUpdate();
      try {
        this._versionId.set(((r = this.editor.getModel()) == null ? void 0 : r.getVersionId()) ?? null, this._currentTransaction, n), this._forceUpdate();
      } finally {
        this._endUpdate();
      }
    })), this._register(this.editor.onDidChangeCursorSelection((n) => {
      this._beginUpdate();
      try {
        this._selections.set(this.editor.getSelections(), this._currentTransaction, n), this._forceUpdate();
      } finally {
        this._endUpdate();
      }
    })), this.domNode = Ie((n) => (this.model.read(n), this.editor.getDomNode()));
  }
  forceUpdate(e) {
    this._beginUpdate();
    try {
      return this._forceUpdate(), e ? e(this._currentTransaction) : void 0;
    } finally {
      this._endUpdate();
    }
  }
  _forceUpdate() {
    var e;
    this._beginUpdate();
    try {
      this._model.set(this.editor.getModel(), this._currentTransaction), this._versionId.set(((e = this.editor.getModel()) == null ? void 0 : e.getVersionId()) ?? null, this._currentTransaction, void 0), this._selections.set(this.editor.getSelections(), this._currentTransaction, void 0);
    } finally {
      this._endUpdate();
    }
  }
  getOption(e, t = ba.ofCaller()) {
    return ji(this, (n) => this.editor.onDidChangeConfiguration((r) => {
      r.hasChanged(e) && n(void 0);
    }), () => this.editor.getOption(e), t);
  }
  setDecorations(e) {
    const t = new ke(), n = this.editor.createDecorationsCollection();
    return t.add(vq({ owner: this, debugName: () => `Apply decorations from ${e.debugName}` }, (r) => {
      const s = e.read(r);
      n.set(s);
    })), t.add({
      dispose: () => {
        n.clear();
      }
    }), t;
  }
  createOverlayWidget(e) {
    const t = "observableOverlayWidget" + this._widgetCounter++, n = {
      getDomNode: () => e.domNode,
      getPosition: () => e.position.get(),
      getId: () => t,
      allowEditorOverflow: e.allowEditorOverflow,
      getMinContentWidthInPx: () => e.minContentWidthInPx.get()
    };
    this.editor.addOverlayWidget(n);
    const r = Xt((s) => {
      e.position.read(s), e.minContentWidthInPx.read(s), this.editor.layoutOverlayWidget(n);
    });
    return Et(() => {
      r.dispose(), this.editor.removeOverlayWidget(n);
    });
  }
  createContentWidget(e) {
    const t = "observableContentWidget" + this._widgetCounter++, n = {
      getDomNode: () => e.domNode,
      getPosition: () => e.position.get(),
      getId: () => t,
      allowEditorOverflow: e.allowEditorOverflow
    };
    this.editor.addContentWidget(n);
    const r = Xt((s) => {
      e.position.read(s), this.editor.layoutContentWidget(n);
    });
    return Et(() => {
      r.dispose(), this.editor.removeContentWidget(n);
    });
  }
  observeLineOffsetRange(e, t) {
    const n = this.observePosition(e.map((s) => new de(s.startLineNumber, 1)), t), r = this.observePosition(e.map((s) => new de(s.endLineNumberExclusive + 1, 1)), t);
    return Ie((s) => {
      var u;
      n.read(s), r.read(s);
      const o = e.read(s), a = (u = this.model.read(s)) == null ? void 0 : u.getLineCount(), l = (typeof a < "u" && o.startLineNumber > a ? this.editor.getBottomForLineNumber(a) : this.editor.getTopForLineNumber(o.startLineNumber)) - this.scrollTop.read(s), c = o.isEmpty ? l : this.editor.getBottomForLineNumber(o.endLineNumberExclusive - 1) - this.scrollTop.read(s);
      return new Tt(l, c);
    });
  }
  observePosition(e, t) {
    let n = e.get();
    const r = CF({ owner: this, debugName: () => `topLeftOfPosition${n == null ? void 0 : n.toString()}`, equalsFn: cx(ha.equals) }, new ha(0, 0)), s = "observablePositionWidget" + this._widgetCounter++, o = document.createElement("div"), a = {
      getDomNode: () => o,
      getPosition: () => n ? { preference: [
        0
        /* ContentWidgetPositionPreference.EXACT */
      ], position: e.get() } : null,
      getId: () => s,
      allowEditorOverflow: !1,
      afterRender: (l, c) => {
        const u = this._model.get();
        u && n && n.lineNumber > u.getLineCount() ? r.set(new ha(0, this.editor.getBottomForLineNumber(u.getLineCount()) - this.scrollTop.get()), void 0) : r.set(c ? new ha(c.left, c.top) : null, void 0);
      }
    };
    return this.editor.addContentWidget(a), t.add(Xt((l) => {
      n = e.read(l), this.editor.layoutContentWidget(a);
    })), t.add(Et(() => {
      this.editor.removeContentWidget(a);
    })), r;
  }
  isTargetHovered(e, t) {
    const n = Qt("isInjectedTextHovered", !1);
    return t.add(this.editor.onMouseMove((r) => {
      const s = e(r);
      n.set(s, void 0);
    })), t.add(this.editor.onMouseLeave((r) => {
      n.set(!1, void 0);
    })), n;
  }
  observeLineHeightForPosition(e) {
    return Ie((t) => {
      const n = e instanceof de ? e : e.read(t);
      return n === null ? null : (this.getOption(
        75
        /* EditorOption.lineHeight */
      ).read(t), this.editor.getLineHeightForPosition(n));
    });
  }
  observeLineHeightForLine(e) {
    return typeof e == "number" ? this.observeLineHeightForPosition(new de(e, 1)) : Ie((t) => {
      const n = e.read(t);
      return n === null ? null : this.observeLineHeightForPosition(new de(n, 1)).read(t);
    });
  }
  observeLineHeightsForLineRange(e) {
    return Ie((t) => {
      const n = e instanceof Zt ? e : e.read(t), r = [];
      for (let s = n.startLineNumber; s < n.endLineNumberExclusive; s++)
        r.push(this.observeLineHeightForLine(s).read(t));
      return r;
    });
  }
};
zC._map = /* @__PURE__ */ new Map();
let dse = zC;
var Jvt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, eyt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, kp, Ty;
let j4 = (Ty = class extends ge {
  constructor(e, t, n, r, s, o, a) {
    super(), this._editors = e, this._rootElement = t, this._diffModel = n, this._rootWidth = r, this._rootHeight = s, this._modifiedEditorLayoutInfo = o, this._themeService = a, this.width = kp.ENTIRE_DIFF_OVERVIEW_WIDTH;
    const l = ji(this._themeService.onDidColorThemeChange, () => this._themeService.getColorTheme()), c = Ie((h) => {
      const g = l.read(h), m = g.getColor(Gat) || (g.getColor(fx) || Wie).transparent(2), _ = g.getColor(qat) || (g.getColor(l1) || Vie).transparent(2);
      return { insertColor: m, removeColor: _ };
    }), u = Gi(document.createElement("div"));
    u.setClassName("diffViewport"), u.setPosition("absolute");
    const d = Li("div.diffOverview", {
      style: { position: "absolute", top: "0px", width: kp.ENTIRE_DIFF_OVERVIEW_WIDTH + "px" }
    }).root;
    this._register(hN(d, u.domNode)), this._register(vo(d, Xe.POINTER_DOWN, (h) => {
      this._editors.modified.delegateVerticalScrollbarPointerDown(h);
    })), this._register(Ce(d, Xe.MOUSE_WHEEL, (h) => {
      this._editors.modified.delegateScrollFromMouseWheelEvent(h);
    }, { passive: !1 })), this._register(hN(this._rootElement, d)), this._register(Ql((h, g) => {
      const m = this._diffModel.read(h), _ = this._editors.original.createOverviewRuler("original diffOverviewRuler");
      _ && (g.add(_), g.add(hN(d, _.getDomNode())));
      const v = this._editors.modified.createOverviewRuler("modified diffOverviewRuler");
      if (v && (g.add(v), g.add(hN(d, v.getDomNode()))), !_ || !v)
        return;
      const w = Dd("viewZoneChanged", this._editors.original.onDidChangeViewZones), E = Dd("viewZoneChanged", this._editors.modified.onDidChangeViewZones), L = Dd("hiddenRangesChanged", this._editors.original.onDidChangeHiddenAreas), T = Dd("hiddenRangesChanged", this._editors.modified.onDidChangeHiddenAreas);
      g.add(Xt((D) => {
        var j;
        w.read(D), E.read(D), L.read(D), T.read(D);
        const N = c.read(D), R = (j = m == null ? void 0 : m.diff.read(D)) == null ? void 0 : j.mappings;
        function M(K, X, Y) {
          const G = Y._getViewModel();
          return G ? K.filter((Q) => Q.length > 0).map((Q) => {
            const oe = G.coordinatesConverter.convertModelPositionToViewPosition(new de(Q.startLineNumber, 1)), Z = G.coordinatesConverter.convertModelPositionToViewPosition(new de(Q.endLineNumberExclusive, 1)), pe = Z.lineNumber - oe.lineNumber;
            return new D3e(oe.lineNumber, Z.lineNumber, pe, X.toString());
          }) : [];
        }
        const B = M((R || []).map((K) => K.lineRangeMapping.original), N.removeColor, this._editors.original), H = M((R || []).map((K) => K.lineRangeMapping.modified), N.insertColor, this._editors.modified);
        _ == null || _.setZones(B), v == null || v.setZones(H);
      })), g.add(Xt((D) => {
        const N = this._rootHeight.read(D), R = this._rootWidth.read(D), M = this._modifiedEditorLayoutInfo.read(D);
        if (M) {
          const B = kp.ENTIRE_DIFF_OVERVIEW_WIDTH - 2 * kp.ONE_OVERVIEW_WIDTH;
          _.setLayout({
            top: 0,
            height: N,
            right: B + kp.ONE_OVERVIEW_WIDTH,
            width: kp.ONE_OVERVIEW_WIDTH
          }), v.setLayout({
            top: 0,
            height: N,
            right: 0,
            width: kp.ONE_OVERVIEW_WIDTH
          });
          const H = this._editors.modifiedScrollTop.read(D), j = this._editors.modifiedScrollHeight.read(D), K = this._editors.modified.getOption(
            117
            /* EditorOption.scrollbar */
          ), X = new eA(K.verticalHasArrows ? K.arrowSize : 0, K.verticalScrollbarSize, 0, M.height, j, H);
          u.setTop(X.getSliderPosition()), u.setHeight(X.getSliderSize());
        } else
          u.setTop(0), u.setHeight(0);
        d.style.height = N + "px", d.style.left = R - kp.ENTIRE_DIFF_OVERVIEW_WIDTH + "px", u.setWidth(kp.ENTIRE_DIFF_OVERVIEW_WIDTH);
      }));
    }));
  }
}, kp = Ty, Ty.ONE_OVERVIEW_WIDTH = 15, Ty.ENTIRE_DIFF_OVERVIEW_WIDTH = Ty.ONE_OVERVIEW_WIDTH * 2, Ty);
j4 = kp = Jvt([
  eyt(6, to)
], j4);
var tyt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Bee = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let hse = class extends ge {
  get onDidContentSizeChange() {
    return this._onDidContentSizeChange.event;
  }
  constructor(e, t, n, r, s, o, a, l) {
    super(), this.originalEditorElement = e, this.modifiedEditorElement = t, this._options = n, this._argCodeEditorWidgetOptions = r, this._createInnerEditor = s, this._contextKeyService = o, this._instantiationService = a, this._keybindingService = l, this.original = this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(), this._argCodeEditorWidgetOptions.originalEditor || {})), this.modified = this._register(this._createRightHandSideEditor(this._options.editorOptions.get(), this._argCodeEditorWidgetOptions.modifiedEditor || {})), this._onDidContentSizeChange = this._register(new he()), this.modifiedScrollTop = ji(this, this.modified.onDidScrollChange, () => (
      /** @description modified.getScrollTop */
      this.modified.getScrollTop()
    )), this.modifiedScrollHeight = ji(this, this.modified.onDidScrollChange, () => (
      /** @description modified.getScrollHeight */
      this.modified.getScrollHeight()
    )), this.modifiedObs = Ms(this.modified), this.originalObs = Ms(this.original), this.modifiedModel = this.modifiedObs.model, this.modifiedSelections = ji(this, this.modified.onDidChangeCursorSelection, () => this.modified.getSelections() ?? []), this.modifiedCursor = pl({ owner: this, equalsFn: de.equals }, (c) => {
      var u;
      return ((u = this.modifiedSelections.read(c)[0]) == null ? void 0 : u.getPosition()) ?? new de(1, 1);
    }), this.originalCursor = ji(this, this.original.onDidChangeCursorPosition, () => this.original.getPosition() ?? new de(1, 1)), this.isOriginalFocused = Ms(this.original).isFocused, this.isModifiedFocused = Ms(this.modified).isFocused, this.isFocused = Ie(this, (c) => this.isOriginalFocused.read(c) || this.isModifiedFocused.read(c)), this._argCodeEditorWidgetOptions = null, this._register(GA({
      changeTracker: {
        createChangeSummary: () => ({}),
        handleChange: (c, u) => (c.didChange(n.editorOptions) && Object.assign(u, c.change.changedOptions), !0)
      }
    }, (c, u) => {
      n.editorOptions.read(c), this._options.renderSideBySide.read(c), this.modified.updateOptions(this._adjustOptionsForRightHandSide(c, u)), this.original.updateOptions(this._adjustOptionsForLeftHandSide(c, u));
    }));
  }
  _createLeftHandSideEditor(e, t) {
    const n = this._adjustOptionsForLeftHandSide(void 0, e), r = this._constructInnerEditor(this._instantiationService, this.originalEditorElement, n, t), s = this._contextKeyService.createKey("isInDiffLeftEditor", r.hasWidgetFocus());
    return this._register(r.onDidFocusEditorWidget(() => s.set(!0))), this._register(r.onDidBlurEditorWidget(() => s.set(!1))), r;
  }
  _createRightHandSideEditor(e, t) {
    const n = this._adjustOptionsForRightHandSide(void 0, e), r = this._constructInnerEditor(this._instantiationService, this.modifiedEditorElement, n, t), s = this._contextKeyService.createKey("isInDiffRightEditor", r.hasWidgetFocus());
    return this._register(r.onDidFocusEditorWidget(() => s.set(!0))), this._register(r.onDidBlurEditorWidget(() => s.set(!1))), r;
  }
  _constructInnerEditor(e, t, n, r) {
    const s = this._createInnerEditor(e, t, n, r);
    return this._register(s.onDidContentSizeChange((o) => {
      const a = this.original.getContentWidth() + this.modified.getContentWidth() + j4.ENTIRE_DIFF_OVERVIEW_WIDTH, l = Math.max(this.modified.getContentHeight(), this.original.getContentHeight());
      this._onDidContentSizeChange.fire({
        contentHeight: l,
        contentWidth: a,
        contentHeightChanged: o.contentHeightChanged,
        contentWidthChanged: o.contentWidthChanged
      });
    })), s;
  }
  _adjustOptionsForLeftHandSide(e, t) {
    const n = this._adjustOptionsForSubEditor(t);
    return this._options.renderSideBySide.get() ? (n.unicodeHighlight = this._options.editorOptions.get().unicodeHighlight || {}, n.wordWrapOverride1 = this._options.diffWordWrap.get()) : (n.wordWrapOverride1 = "off", n.wordWrapOverride2 = "off", n.stickyScroll = { enabled: !1 }, n.unicodeHighlight = { nonBasicASCII: !1, ambiguousCharacters: !1, invisibleCharacters: !1 }), n.glyphMargin = this._options.renderSideBySide.get(), t.originalAriaLabel && (n.ariaLabel = t.originalAriaLabel), n.ariaLabel = this._updateAriaLabel(n.ariaLabel), n.readOnly = !this._options.originalEditable.get(), n.dropIntoEditor = { enabled: !n.readOnly }, n.extraEditorClassName = "original-in-monaco-diff-editor", n;
  }
  _adjustOptionsForRightHandSide(e, t) {
    const n = this._adjustOptionsForSubEditor(t);
    return t.modifiedAriaLabel && (n.ariaLabel = t.modifiedAriaLabel), n.ariaLabel = this._updateAriaLabel(n.ariaLabel), n.wordWrapOverride1 = this._options.diffWordWrap.get(), n.revealHorizontalRightPadding = wm.revealHorizontalRightPadding.defaultValue + j4.ENTIRE_DIFF_OVERVIEW_WIDTH, n.scrollbar.verticalHasArrows = !1, n.extraEditorClassName = "modified-in-monaco-diff-editor", n;
  }
  _adjustOptionsForSubEditor(e) {
    const t = {
      ...e,
      dimension: {
        height: 0,
        width: 0
      }
    };
    return t.inDiffEditor = !0, t.automaticLayout = !1, t.allowVariableLineHeights = !1, t.allowVariableFonts = !1, t.allowVariableFontsInAccessibilityMode = !1, t.scrollbar = { ...t.scrollbar || {} }, t.folding = !1, t.codeLens = this._options.diffCodeLens.get(), t.fixedOverflowWidgets = !0, t.minimap = { ...t.minimap || {} }, t.minimap.enabled = !1, this._options.hideUnchangedRegions.get() ? t.stickyScroll = { enabled: !1 } : t.stickyScroll = this._options.editorOptions.get().stickyScroll, t;
  }
  _updateAriaLabel(e) {
    var n;
    e || (e = "");
    const t = S(108, " use {0} to open the accessibility help.", (n = this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")) == null ? void 0 : n.getAriaLabel());
    return this._options.accessibilityVerbose.get() ? e + t : e ? e.replaceAll(t, "") : "";
  }
};
hse = tyt([
  Bee(5, Jt),
  Bee(6, xt),
  Bee(7, Fi)
], hse);
var s2 = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
};
const nyt = !1;
var FU;
(function(i) {
  i.North = "north", i.South = "south", i.East = "east", i.West = "west";
})(FU || (FU = {}));
let iyt = 4;
const ryt = new he();
let syt = 300;
const oyt = new he();
class Dge {
  constructor(e) {
    this.el = e, this.disposables = new ke();
  }
  get onPointerMove() {
    return this.disposables.add(new ir(At(this.el), "mousemove")).event;
  }
  get onPointerUp() {
    return this.disposables.add(new ir(At(this.el), "mouseup")).event;
  }
  dispose() {
    this.disposables.dispose();
  }
}
s2([
  go
], Dge.prototype, "onPointerMove", null);
s2([
  go
], Dge.prototype, "onPointerUp", null);
class Ige {
  get onPointerMove() {
    return this.disposables.add(new ir(this.el, zr.Change)).event;
  }
  get onPointerUp() {
    return this.disposables.add(new ir(this.el, zr.End)).event;
  }
  constructor(e) {
    this.el = e, this.disposables = new ke();
  }
  dispose() {
    this.disposables.dispose();
  }
}
s2([
  go
], Ige.prototype, "onPointerMove", null);
s2([
  go
], Ige.prototype, "onPointerUp", null);
class BU {
  get onPointerMove() {
    return this.factory.onPointerMove;
  }
  get onPointerUp() {
    return this.factory.onPointerUp;
  }
  constructor(e) {
    this.factory = e;
  }
  dispose() {
  }
}
s2([
  go
], BU.prototype, "onPointerMove", null);
s2([
  go
], BU.prototype, "onPointerUp", null);
const Qke = "pointer-events-disabled";
class zl extends ge {
  get state() {
    return this._state;
  }
  get orthogonalStartSash() {
    return this._orthogonalStartSash;
  }
  get orthogonalEndSash() {
    return this._orthogonalEndSash;
  }
  /**
   * The state of a sash defines whether it can be interacted with by the user
   * as well as what mouse cursor to use, when hovered.
   */
  set state(e) {
    this._state !== e && (this.el.classList.toggle(
      "disabled",
      e === 0
      /* SashState.Disabled */
    ), this.el.classList.toggle(
      "minimum",
      e === 1
      /* SashState.AtMinimum */
    ), this.el.classList.toggle(
      "maximum",
      e === 2
      /* SashState.AtMaximum */
    ), this._state = e, this.onDidEnablementChange.fire(e));
  }
  /**
   * An event which fires whenever the user starts dragging this sash.
   */
  get onDidStart() {
    return this._onDidStart.event;
  }
  /**
   * An event which fires whenever the user moves the mouse while
   * dragging this sash.
   */
  get onDidChange() {
    return this._onDidChange.event;
  }
  /**
   * An event which fires whenever the user double clicks this sash.
   */
  get onDidReset() {
    return this._onDidReset.event;
  }
  /**
   * An event which fires whenever the user stops dragging this sash.
   */
  get onDidEnd() {
    return this._onDidEnd.event;
  }
  /**
   * A reference to another sash, perpendicular to this one, which
   * aligns at the start of this one. A corner sash will be created
   * automatically at that location.
   *
   * The start of a horizontal sash is its left-most position.
   * The start of a vertical sash is its top-most position.
   */
  set orthogonalStartSash(e) {
    if (this._orthogonalStartSash !== e) {
      if (this.orthogonalStartDragHandleDisposables.clear(), this.orthogonalStartSashDisposables.clear(), e) {
        const t = (n) => {
          this.orthogonalStartDragHandleDisposables.clear(), n !== 0 && (this._orthogonalStartDragHandle = Fe(this.el, Ge(".orthogonal-drag-handle.start")), this.orthogonalStartDragHandleDisposables.add(Et(() => this._orthogonalStartDragHandle.remove())), this.orthogonalStartDragHandleDisposables.add(Ce(this._orthogonalStartDragHandle, "mouseenter", () => zl.onMouseEnter(e))), this.orthogonalStartDragHandleDisposables.add(Ce(this._orthogonalStartDragHandle, "mouseleave", () => zl.onMouseLeave(e))));
        };
        this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t, this)), t(e.state);
      }
      this._orthogonalStartSash = e;
    }
  }
  /**
   * A reference to another sash, perpendicular to this one, which
   * aligns at the end of this one. A corner sash will be created
   * automatically at that location.
   *
   * The end of a horizontal sash is its right-most position.
   * The end of a vertical sash is its bottom-most position.
   */
  set orthogonalEndSash(e) {
    if (this._orthogonalEndSash !== e) {
      if (this.orthogonalEndDragHandleDisposables.clear(), this.orthogonalEndSashDisposables.clear(), e) {
        const t = (n) => {
          this.orthogonalEndDragHandleDisposables.clear(), n !== 0 && (this._orthogonalEndDragHandle = Fe(this.el, Ge(".orthogonal-drag-handle.end")), this.orthogonalEndDragHandleDisposables.add(Et(() => this._orthogonalEndDragHandle.remove())), this.orthogonalEndDragHandleDisposables.add(Ce(this._orthogonalEndDragHandle, "mouseenter", () => zl.onMouseEnter(e))), this.orthogonalEndDragHandleDisposables.add(Ce(this._orthogonalEndDragHandle, "mouseleave", () => zl.onMouseLeave(e))));
        };
        this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t, this)), t(e.state);
      }
      this._orthogonalEndSash = e;
    }
  }
  constructor(e, t, n) {
    super(), this.hoverDelay = syt, this.hoverDelayer = this._register(new Gf(this.hoverDelay)), this._state = 3, this.onDidEnablementChange = this._register(new he()), this._onDidStart = this._register(new he()), this._onDidChange = this._register(new he()), this._onDidReset = this._register(new he()), this._onDidEnd = this._register(new he()), this.orthogonalStartSashDisposables = this._register(new ke()), this.orthogonalStartDragHandleDisposables = this._register(new ke()), this.orthogonalEndSashDisposables = this._register(new ke()), this.orthogonalEndDragHandleDisposables = this._register(new ke()), this.linkedSash = void 0, this.el = Fe(e, Ge(".monaco-sash")), n.orthogonalEdge && this.el.classList.add(`orthogonal-edge-${n.orthogonalEdge}`), Kn && this.el.classList.add("mac"), this._register(Ce(this.el, "mousedown", (s) => this.onPointerStart(s, new Dge(e)))), this._register(Ce(this.el, "dblclick", (s) => this.onPointerDoublePress(s))), this._register(Ce(this.el, "mouseenter", () => zl.onMouseEnter(this))), this._register(Ce(this.el, "mouseleave", () => zl.onMouseLeave(this))), this._register(ec.addTarget(this.el)), this._register(Ce(this.el, zr.Start, (s) => this.onPointerStart(s, new Ige(this.el))));
    let r;
    this._register(Ce(this.el, zr.Tap, (s) => {
      if (r) {
        clearTimeout(r), r = void 0, this.onPointerDoublePress(s);
        return;
      }
      clearTimeout(r), r = setTimeout(() => r = void 0, 250);
    })), typeof n.size == "number" ? (this.size = n.size, n.orientation === 0 ? this.el.style.width = `${this.size}px` : this.el.style.height = `${this.size}px`) : (this.size = iyt, this._register(ryt.event((s) => {
      this.size = s, this.layout();
    }))), this._register(oyt.event((s) => this.hoverDelay = s)), this.layoutProvider = t, this.orthogonalStartSash = n.orthogonalStartSash, this.orthogonalEndSash = n.orthogonalEndSash, this.orientation = n.orientation || 0, this.orientation === 1 ? (this.el.classList.add("horizontal"), this.el.classList.remove("vertical")) : (this.el.classList.remove("horizontal"), this.el.classList.add("vertical")), this.el.classList.toggle("debug", nyt), this.layout();
  }
  onPointerStart(e, t) {
    Mi.stop(e);
    let n = !1;
    if (!e.__orthogonalSashEvent) {
      const m = this.getOrthogonalSash(e);
      m && (n = !0, e.__orthogonalSashEvent = !0, m.onPointerStart(e, new BU(t)));
    }
    if (this.linkedSash && !e.__linkedSashEvent && (e.__linkedSashEvent = !0, this.linkedSash.onPointerStart(e, new BU(t))), !this.state)
      return;
    const r = this.el.ownerDocument.getElementsByTagName("iframe");
    for (const m of r)
      m.classList.add(Qke);
    const s = e.pageX, o = e.pageY, a = e.altKey, l = { startX: s, currentX: s, startY: o, currentY: o, altKey: a };
    this.el.classList.add("active"), this._onDidStart.fire(l);
    const c = Zf(this.el), u = () => {
      let m = "";
      n ? m = "all-scroll" : this.orientation === 1 ? this.state === 1 ? m = "s-resize" : this.state === 2 ? m = "n-resize" : m = Kn ? "row-resize" : "ns-resize" : this.state === 1 ? m = "e-resize" : this.state === 2 ? m = "w-resize" : m = Kn ? "col-resize" : "ew-resize", c.textContent = `* { cursor: ${m} !important; }`;
    }, d = new ke();
    u(), n || this.onDidEnablementChange.event(u, null, d);
    const h = (m) => {
      Mi.stop(m, !1);
      const _ = { startX: s, currentX: m.pageX, startY: o, currentY: m.pageY, altKey: a };
      this._onDidChange.fire(_);
    }, g = (m) => {
      Mi.stop(m, !1), c.remove(), this.el.classList.remove("active"), this._onDidEnd.fire(), d.dispose();
      for (const _ of r)
        _.classList.remove(Qke);
    };
    t.onPointerMove(h, null, d), t.onPointerUp(g, null, d), d.add(t);
  }
  onPointerDoublePress(e) {
    const t = this.getOrthogonalSash(e);
    t && t._onDidReset.fire(), this.linkedSash && this.linkedSash._onDidReset.fire(), this._onDidReset.fire();
  }
  static onMouseEnter(e, t = !1) {
    e.el.classList.contains("active") ? (e.hoverDelayer.cancel(), e.el.classList.add("hover")) : e.hoverDelayer.trigger(() => e.el.classList.add("hover"), e.hoverDelay).then(void 0, () => {
    }), !t && e.linkedSash && zl.onMouseEnter(e.linkedSash, !0);
  }
  static onMouseLeave(e, t = !1) {
    e.hoverDelayer.cancel(), e.el.classList.remove("hover"), !t && e.linkedSash && zl.onMouseLeave(e.linkedSash, !0);
  }
  /**
   * Forcefully stop any user interactions with this sash.
   * Useful when hiding a parent component, while the user is still
   * interacting with the sash.
   */
  clearSashHoverState() {
    zl.onMouseLeave(this);
  }
  /**
   * Layout the sash. The sash will size and position itself
   * based on its provided {@link ISashLayoutProvider layout provider}.
   */
  layout() {
    if (this.orientation === 0) {
      const e = this.layoutProvider;
      this.el.style.left = e.getVerticalSashLeft(this) - this.size / 2 + "px", e.getVerticalSashTop && (this.el.style.top = e.getVerticalSashTop(this) + "px"), e.getVerticalSashHeight && (this.el.style.height = e.getVerticalSashHeight(this) + "px");
    } else {
      const e = this.layoutProvider;
      this.el.style.top = e.getHorizontalSashTop(this) - this.size / 2 + "px", e.getHorizontalSashLeft && (this.el.style.left = e.getHorizontalSashLeft(this) + "px"), e.getHorizontalSashWidth && (this.el.style.width = e.getHorizontalSashWidth(this) + "px");
    }
  }
  getOrthogonalSash(e) {
    const t = e.initialTarget ?? e.target;
    if (!(!t || !eo(t)) && t.classList.contains("orthogonal-drag-handle"))
      return t.classList.contains("start") ? this.orthogonalStartSash : this.orthogonalEndSash;
  }
  dispose() {
    super.dispose(), this.el.remove();
  }
}
class ayt {
  resetSash() {
    this._sashRatio.set(void 0, void 0);
  }
  constructor(e, t) {
    this._options = e, this.dimensions = t, this.sashLeft = Xhe(this, (n) => {
      const r = this._sashRatio.read(n) ?? this._options.splitViewDefaultRatio.read(n);
      return this._computeSashLeft(r, n);
    }, (n, r) => {
      const s = this.dimensions.width.get();
      this._sashRatio.set(n / s, r);
    }), this._sashRatio = Qt(this, void 0);
  }
  /** @pure */
  _computeSashLeft(e, t) {
    const n = this.dimensions.width.read(t), r = Math.floor(this._options.splitViewDefaultRatio.read(t) * n), s = this._options.enableSplitViewResizing.read(t) ? Math.floor(e * n) : r, o = 100;
    return n <= o * 2 ? r : s < o ? o : s > n - o ? n - o : s;
  }
}
class v5e extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._domNode = e, this._dimensions = t, this._enabled = n, this._boundarySashes = r, this.sashLeft = s, this._resetSash = o, this._sash = this._register(new zl(this._domNode, {
      getVerticalSashTop: (a) => 0,
      getVerticalSashLeft: (a) => this.sashLeft.get(),
      getVerticalSashHeight: (a) => this._dimensions.height.get()
    }, {
      orientation: 0
      /* Orientation.VERTICAL */
    })), this._startSashPosition = void 0, this._register(this._sash.onDidStart(() => {
      this._startSashPosition = this.sashLeft.get();
    })), this._register(this._sash.onDidChange((a) => {
      this.sashLeft.set(this._startSashPosition + (a.currentX - a.startX), void 0);
    })), this._register(this._sash.onDidEnd(() => this._sash.layout())), this._register(this._sash.onDidReset(() => this._resetSash())), this._register(Xt((a) => {
      const l = this._boundarySashes.read(a);
      l && (this._sash.orthogonalEndSash = l.bottom);
    })), this._register(Xt((a) => {
      const l = this._enabled.read(a);
      this._sash.state = l ? 3 : 0, this.sashLeft.read(a), this._dimensions.height.read(a), this._sash.layout();
    }));
  }
}
const Jj = class Jj extends ge {
  constructor() {
    super(...arguments), this._id = ++Jj.idCounter, this._onDidDispose = this._register(new he()), this.onDidDispose = this._onDidDispose.event;
  }
  getId() {
    return this.getEditorType() + ":v2:" + this._id;
  }
  // #region editorBrowser.IDiffEditor: Delegating to modified Editor
  getVisibleColumnFromPosition(e) {
    return this._targetEditor.getVisibleColumnFromPosition(e);
  }
  getPosition() {
    return this._targetEditor.getPosition();
  }
  setPosition(e, t = "api") {
    this._targetEditor.setPosition(e, t);
  }
  revealLine(e, t = 0) {
    this._targetEditor.revealLine(e, t);
  }
  revealLineInCenter(e, t = 0) {
    this._targetEditor.revealLineInCenter(e, t);
  }
  revealLineInCenterIfOutsideViewport(e, t = 0) {
    this._targetEditor.revealLineInCenterIfOutsideViewport(e, t);
  }
  revealLineNearTop(e, t = 0) {
    this._targetEditor.revealLineNearTop(e, t);
  }
  revealPosition(e, t = 0) {
    this._targetEditor.revealPosition(e, t);
  }
  revealPositionInCenter(e, t = 0) {
    this._targetEditor.revealPositionInCenter(e, t);
  }
  revealPositionInCenterIfOutsideViewport(e, t = 0) {
    this._targetEditor.revealPositionInCenterIfOutsideViewport(e, t);
  }
  revealPositionNearTop(e, t = 0) {
    this._targetEditor.revealPositionNearTop(e, t);
  }
  getSelection() {
    return this._targetEditor.getSelection();
  }
  getSelections() {
    return this._targetEditor.getSelections();
  }
  setSelection(e, t = "api") {
    this._targetEditor.setSelection(e, t);
  }
  setSelections(e, t = "api") {
    this._targetEditor.setSelections(e, t);
  }
  revealLines(e, t, n = 0) {
    this._targetEditor.revealLines(e, t, n);
  }
  revealLinesInCenter(e, t, n = 0) {
    this._targetEditor.revealLinesInCenter(e, t, n);
  }
  revealLinesInCenterIfOutsideViewport(e, t, n = 0) {
    this._targetEditor.revealLinesInCenterIfOutsideViewport(e, t, n);
  }
  revealLinesNearTop(e, t, n = 0) {
    this._targetEditor.revealLinesNearTop(e, t, n);
  }
  revealRange(e, t = 0, n = !1, r = !0) {
    this._targetEditor.revealRange(e, t, n, r);
  }
  revealRangeInCenter(e, t = 0) {
    this._targetEditor.revealRangeInCenter(e, t);
  }
  revealRangeInCenterIfOutsideViewport(e, t = 0) {
    this._targetEditor.revealRangeInCenterIfOutsideViewport(e, t);
  }
  revealRangeNearTop(e, t = 0) {
    this._targetEditor.revealRangeNearTop(e, t);
  }
  revealRangeNearTopIfOutsideViewport(e, t = 0) {
    this._targetEditor.revealRangeNearTopIfOutsideViewport(e, t);
  }
  revealRangeAtTop(e, t = 0) {
    this._targetEditor.revealRangeAtTop(e, t);
  }
  getSupportedActions() {
    return this._targetEditor.getSupportedActions();
  }
  focus() {
    this._targetEditor.focus();
  }
  trigger(e, t, n) {
    this._targetEditor.trigger(e, t, n);
  }
  createDecorationsCollection(e) {
    return this._targetEditor.createDecorationsCollection(e);
  }
  changeDecorations(e) {
    return this._targetEditor.changeDecorations(e);
  }
};
Jj.idCounter = 0;
let fse = Jj;
const ol = {
  enableSplitViewResizing: !0,
  renderSideBySide: !0,
  renderMarginRevertIcon: !0,
  renderGutterMenu: !0,
  maxComputationTime: 5e3,
  maxFileSize: 50,
  ignoreTrimWhitespace: !0,
  renderIndicators: !0,
  originalEditable: !1,
  diffCodeLens: !1,
  renderOverviewRuler: !0,
  diffWordWrap: "inherit",
  diffAlgorithm: "advanced",
  accessibilityVerbose: !1,
  experimental: {
    showMoves: !1,
    showEmptyDecorations: !0,
    useTrueInlineView: !1
  },
  hideUnchangedRegions: {
    enabled: !1,
    contextLineCount: 3,
    minimumLineCount: 3,
    revealLineCount: 20
  },
  isInEmbeddedEditor: !1,
  onlyShowAccessibleDiffViewer: !1,
  renderSideBySideInlineBreakpoint: 900,
  useInlineViewWhenSpaceIsLimited: !0,
  compactMode: !1
};
var lyt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, cyt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let gse = class {
  get editorOptions() {
    return this._options;
  }
  constructor(e, t) {
    this._accessibilityService = t, this._diffEditorWidth = Qt(this, 0), this._screenReaderMode = ji(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized()), this.couldShowInlineViewBecauseOfSize = Ie(this, (r) => this._options.read(r).renderSideBySide && this._diffEditorWidth.read(r) <= this._options.read(r).renderSideBySideInlineBreakpoint), this.renderOverviewRuler = Ie(this, (r) => this._options.read(r).renderOverviewRuler), this.renderSideBySide = Ie(this, (r) => this.compactMode.read(r) && this.shouldRenderInlineViewInSmartMode.read(r) ? !1 : this._options.read(r).renderSideBySide && !(this._options.read(r).useInlineViewWhenSpaceIsLimited && this.couldShowInlineViewBecauseOfSize.read(r) && !this._screenReaderMode.read(r))), this.readOnly = Ie(this, (r) => this._options.read(r).readOnly), this.shouldRenderOldRevertArrows = Ie(this, (r) => !(!this._options.read(r).renderMarginRevertIcon || !this.renderSideBySide.read(r) || this.readOnly.read(r) || this.shouldRenderGutterMenu.read(r))), this.shouldRenderGutterMenu = Ie(this, (r) => this._options.read(r).renderGutterMenu), this.renderIndicators = Ie(this, (r) => this._options.read(r).renderIndicators), this.enableSplitViewResizing = Ie(this, (r) => this._options.read(r).enableSplitViewResizing), this.splitViewDefaultRatio = Ie(this, (r) => this._options.read(r).splitViewDefaultRatio), this.ignoreTrimWhitespace = Ie(this, (r) => this._options.read(r).ignoreTrimWhitespace), this.maxComputationTimeMs = Ie(this, (r) => this._options.read(r).maxComputationTime), this.showMoves = Ie(this, (r) => this._options.read(r).experimental.showMoves && this.renderSideBySide.read(r)), this.isInEmbeddedEditor = Ie(this, (r) => this._options.read(r).isInEmbeddedEditor), this.diffWordWrap = Ie(this, (r) => this._options.read(r).diffWordWrap), this.originalEditable = Ie(this, (r) => this._options.read(r).originalEditable), this.diffCodeLens = Ie(this, (r) => this._options.read(r).diffCodeLens), this.accessibilityVerbose = Ie(this, (r) => this._options.read(r).accessibilityVerbose), this.diffAlgorithm = Ie(this, (r) => this._options.read(r).diffAlgorithm), this.showEmptyDecorations = Ie(this, (r) => this._options.read(r).experimental.showEmptyDecorations), this.onlyShowAccessibleDiffViewer = Ie(this, (r) => this._options.read(r).onlyShowAccessibleDiffViewer), this.compactMode = Ie(this, (r) => this._options.read(r).compactMode), this.trueInlineDiffRenderingEnabled = Ie(this, (r) => this._options.read(r).experimental.useTrueInlineView), this.useTrueInlineDiffRendering = Ie(this, (r) => !this.renderSideBySide.read(r) && this.trueInlineDiffRenderingEnabled.read(r)), this.hideUnchangedRegions = Ie(this, (r) => this._options.read(r).hideUnchangedRegions.enabled), this.hideUnchangedRegionsRevealLineCount = Ie(this, (r) => this._options.read(r).hideUnchangedRegions.revealLineCount), this.hideUnchangedRegionsContextLineCount = Ie(this, (r) => this._options.read(r).hideUnchangedRegions.contextLineCount), this.hideUnchangedRegionsMinimumLineCount = Ie(this, (r) => this._options.read(r).hideUnchangedRegions.minimumLineCount), this._model = Qt(this, void 0), this.shouldRenderInlineViewInSmartMode = this._model.map(this, (r) => wit(this, (s) => {
      const o = r == null ? void 0 : r.diff.read(s);
      return o ? uyt(o, this.trueInlineDiffRenderingEnabled.read(s)) : void 0;
    })).flatten().map(this, (r) => !!r), this.inlineViewHideOriginalLineNumbers = this.compactMode;
    const n = { ...e, ...Jke(e, ol) };
    this._options = Qt(this, n);
  }
  updateOptions(e) {
    const t = Jke(e, this._options.get()), n = { ...this._options.get(), ...e, ...t };
    this._options.set(n, void 0, { changedOptions: e });
  }
  setWidth(e) {
    this._diffEditorWidth.set(e, void 0);
  }
  setModel(e) {
    this._model.set(e, void 0);
  }
};
gse = lyt([
  cyt(1, Qa)
], gse);
function uyt(i, e) {
  return i.mappings.every((t) => dyt(t.lineRangeMapping) || hyt(t.lineRangeMapping) || e && Tge(t.lineRangeMapping));
}
function dyt(i) {
  return i.original.length === 0;
}
function hyt(i) {
  return i.modified.length === 0;
}
function Jke(i, e) {
  var t, n, r, s, o, a, l, c;
  return {
    enableSplitViewResizing: Ot(i.enableSplitViewResizing, e.enableSplitViewResizing),
    splitViewDefaultRatio: pot(i.splitViewDefaultRatio, 0.5, 0.1, 0.9),
    renderSideBySide: Ot(i.renderSideBySide, e.renderSideBySide),
    renderMarginRevertIcon: Ot(i.renderMarginRevertIcon, e.renderMarginRevertIcon),
    maxComputationTime: wE(
      i.maxComputationTime,
      e.maxComputationTime,
      0,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    ),
    maxFileSize: wE(
      i.maxFileSize,
      e.maxFileSize,
      0,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    ),
    ignoreTrimWhitespace: Ot(i.ignoreTrimWhitespace, e.ignoreTrimWhitespace),
    renderIndicators: Ot(i.renderIndicators, e.renderIndicators),
    originalEditable: Ot(i.originalEditable, e.originalEditable),
    diffCodeLens: Ot(i.diffCodeLens, e.diffCodeLens),
    renderOverviewRuler: Ot(i.renderOverviewRuler, e.renderOverviewRuler),
    diffWordWrap: Zr(i.diffWordWrap, e.diffWordWrap, ["off", "on", "inherit"]),
    diffAlgorithm: Zr(i.diffAlgorithm, e.diffAlgorithm, ["legacy", "advanced"], { smart: "legacy", experimental: "advanced" }),
    accessibilityVerbose: Ot(i.accessibilityVerbose, e.accessibilityVerbose),
    experimental: {
      showMoves: Ot((t = i.experimental) == null ? void 0 : t.showMoves, e.experimental.showMoves),
      showEmptyDecorations: Ot((n = i.experimental) == null ? void 0 : n.showEmptyDecorations, e.experimental.showEmptyDecorations),
      useTrueInlineView: Ot((r = i.experimental) == null ? void 0 : r.useTrueInlineView, e.experimental.useTrueInlineView)
    },
    hideUnchangedRegions: {
      enabled: Ot(((s = i.hideUnchangedRegions) == null ? void 0 : s.enabled) ?? ((o = i.experimental) == null ? void 0 : o.collapseUnchangedRegions), e.hideUnchangedRegions.enabled),
      contextLineCount: wE(
        (a = i.hideUnchangedRegions) == null ? void 0 : a.contextLineCount,
        e.hideUnchangedRegions.contextLineCount,
        0,
        1073741824
        /* Constants.MAX_SAFE_SMALL_INTEGER */
      ),
      minimumLineCount: wE(
        (l = i.hideUnchangedRegions) == null ? void 0 : l.minimumLineCount,
        e.hideUnchangedRegions.minimumLineCount,
        0,
        1073741824
        /* Constants.MAX_SAFE_SMALL_INTEGER */
      ),
      revealLineCount: wE(
        (c = i.hideUnchangedRegions) == null ? void 0 : c.revealLineCount,
        e.hideUnchangedRegions.revealLineCount,
        0,
        1073741824
        /* Constants.MAX_SAFE_SMALL_INTEGER */
      )
    },
    isInEmbeddedEditor: Ot(i.isInEmbeddedEditor, e.isInEmbeddedEditor),
    onlyShowAccessibleDiffViewer: Ot(i.onlyShowAccessibleDiffViewer, e.onlyShowAccessibleDiffViewer),
    renderSideBySideInlineBreakpoint: wE(
      i.renderSideBySideInlineBreakpoint,
      e.renderSideBySideInlineBreakpoint,
      0,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    ),
    useInlineViewWhenSpaceIsLimited: Ot(i.useInlineViewWhenSpaceIsLimited, e.useInlineViewWhenSpaceIsLimited),
    renderGutterMenu: Ot(i.renderGutterMenu, e.renderGutterMenu),
    compactMode: Ot(i.compactMode, e.compactMode)
  };
}
class fyt extends nT {
  constructor(e, t) {
    super(), this._onDidChangeVisibility = this._register(new he()), this.onDidChangeVisibility = this._onDidChangeVisibility.event, this._element = Fe(e, Ge(".monaco-dropdown")), this._label = Fe(this._element, Ge(".dropdown-label"));
    let n = t.labelRenderer;
    n || (n = (s) => (s.textContent = t.label || "", null));
    for (const s of [Xe.CLICK, Xe.MOUSE_DOWN, zr.Tap])
      this._register(Ce(this.element, s, (o) => Mi.stop(o, !0)));
    for (const s of [Xe.MOUSE_DOWN, zr.Tap])
      this._register(Ce(this._label, s, (o) => {
        Jhe(o) && o.button !== 0 || (this.visible ? this.hide() : this.show());
      }));
    this._register(Ce(this._label, Xe.KEY_DOWN, (s) => {
      const o = new wr(s);
      (o.equals(
        3
        /* KeyCode.Enter */
      ) || o.equals(
        10
        /* KeyCode.Space */
      )) && (Mi.stop(s, !0), this.visible ? this.hide() : this.show());
    }));
    const r = n(this._label);
    r && this._register(r), this._register(ec.addTarget(this._label));
  }
  get element() {
    return this._element;
  }
  show() {
    this.visible || (this.visible = !0, this._onDidChangeVisibility.fire(!0));
  }
  hide() {
    this.visible && (this.visible = !1, this._onDidChangeVisibility.fire(!1));
  }
  dispose() {
    super.dispose(), this.hide(), this.boxContainer && (this.boxContainer.remove(), this.boxContainer = void 0), this.contents && (this.contents.remove(), this.contents = void 0), this._label && (this._label.remove(), this._label = void 0);
  }
}
class gyt extends fyt {
  constructor(e, t) {
    super(e, t), this._options = t, this._actions = [], this.actions = t.actions || [];
  }
  set menuOptions(e) {
    this._menuOptions = e;
  }
  get menuOptions() {
    return this._menuOptions;
  }
  get actions() {
    return this._options.actionProvider ? this._options.actionProvider.getActions() : this._actions;
  }
  set actions(e) {
    this._actions = e;
  }
  show() {
    super.show(), this.element.classList.add("active"), this._options.contextMenuProvider.showContextMenu({
      getAnchor: () => this.element,
      getActions: () => this.actions,
      getActionsContext: () => this.menuOptions ? this.menuOptions.context : null,
      getActionViewItem: (e, t) => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(e, t) : void 0,
      getKeyBinding: (e) => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(e) : void 0,
      getMenuClassName: () => this._options.menuClassName || "",
      onHide: () => this.onHide(),
      actionRunner: this.menuOptions ? this.menuOptions.actionRunner : void 0,
      anchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : 0,
      domForShadowRoot: this._options.menuAsChild ? this.element : void 0,
      skipTelemetry: this._options.skipTelemetry
    });
  }
  hide() {
    super.hide();
  }
  onHide() {
    this.hide(), this.element.classList.remove("active");
  }
}
class HU extends zp {
  get onDidChangeVisibility() {
    return this._onDidChangeVisibility.event;
  }
  constructor(e, t, n, r = /* @__PURE__ */ Object.create(null)) {
    super(null, e, r), this.actionItem = null, this._onDidChangeVisibility = this._register(new he()), this.menuActionsOrProvider = t, this.contextMenuProvider = n, this.options = r, this.options.actionRunner && (this.actionRunner = this.options.actionRunner);
  }
  render(e) {
    this.actionItem = e;
    const t = (s) => (this.element = Fe(s, Ge("a.action-label")), this.renderLabel(this.element)), n = Array.isArray(this.menuActionsOrProvider), r = {
      contextMenuProvider: this.contextMenuProvider,
      labelRenderer: t,
      menuAsChild: this.options.menuAsChild,
      actions: n ? this.menuActionsOrProvider : void 0,
      actionProvider: n ? void 0 : this.menuActionsOrProvider,
      skipTelemetry: this.options.skipTelemetry
    };
    if (this.dropdownMenu = this._register(new gyt(e, r)), this._register(this.dropdownMenu.onDidChangeVisibility((s) => {
      var o;
      (o = this.element) == null || o.setAttribute("aria-expanded", `${s}`), this._onDidChangeVisibility.fire(s);
    })), this.dropdownMenu.menuOptions = {
      actionViewItemProvider: this.options.actionViewItemProvider,
      actionRunner: this.actionRunner,
      getKeyBinding: this.options.keybindingProvider,
      context: this._context
    }, this.options.anchorAlignmentProvider) {
      const s = this;
      this.dropdownMenu.menuOptions = {
        ...this.dropdownMenu.menuOptions,
        get anchorAlignment() {
          return s.options.anchorAlignmentProvider();
        }
      };
    }
    this.updateTooltip(), this.updateEnabled();
  }
  renderLabel(e) {
    let t = [];
    return typeof this.options.classNames == "string" ? t = this.options.classNames.split(/\s+/g).filter((n) => !!n) : this.options.classNames && (t = this.options.classNames), t.find((n) => n === "icon") || t.push("codicon"), e.classList.add(...t), this._action.label && this._register(Jg().setupManagedHover(this.options.hoverDelegate ?? rd("mouse"), e, this._action.label)), null;
  }
  getTooltip() {
    let e = null;
    return this.action.tooltip ? e = this.action.tooltip : this.action.label && (e = this.action.label), e ?? void 0;
  }
  setActionContext(e) {
    super.setActionContext(e), this.dropdownMenu && (this.dropdownMenu.menuOptions ? this.dropdownMenu.menuOptions.context = e : this.dropdownMenu.menuOptions = { context: e });
  }
  show() {
    var e;
    (e = this.dropdownMenu) == null || e.show();
  }
  updateEnabled() {
    var t, n;
    const e = !this.action.enabled;
    (t = this.actionItem) == null || t.classList.toggle("disabled", e), (n = this.element) == null || n.classList.toggle("disabled", e);
  }
}
class pyt extends ge {
  get onDidChangeDropdownVisibility() {
    return this._onDidChangeDropdownVisibility.event;
  }
  constructor(e, t, n = {
    orientation: 0
    /* ActionsOrientation.HORIZONTAL */
  }) {
    super(), this.submenuActionViewItems = [], this.hasSecondaryActions = !1, this._onDidChangeDropdownVisibility = this._register(new Ktt()), this.disposables = this._register(new ke()), n.hoverDelegate = n.hoverDelegate ?? this._register(oA()), this.options = n, this.toggleMenuAction = this._register(new G4(() => {
      var r;
      return (r = this.toggleMenuActionViewItem) == null ? void 0 : r.show();
    }, n.toggleMenuTitle)), this.element = document.createElement("div"), this.element.className = "monaco-toolbar", e.appendChild(this.element), this.actionBar = this._register(new qu(this.element, {
      orientation: n.orientation,
      ariaLabel: n.ariaLabel,
      actionRunner: n.actionRunner,
      allowContextMenu: n.allowContextMenu,
      highlightToggledItems: n.highlightToggledItems,
      hoverDelegate: n.hoverDelegate,
      actionViewItemProvider: (r, s) => {
        if (r.id === G4.ID)
          return this.toggleMenuActionViewItem = new HU(r, r.menuActions, t, {
            actionViewItemProvider: this.options.actionViewItemProvider,
            actionRunner: this.actionRunner,
            keybindingProvider: this.options.getKeyBinding,
            classNames: qt.asClassNameArray(n.moreIcon ?? Pe.toolBarMore),
            anchorAlignmentProvider: this.options.anchorAlignmentProvider,
            menuAsChild: !!this.options.renderDropdownAsChildElement,
            skipTelemetry: this.options.skipTelemetry,
            isMenu: !0,
            hoverDelegate: this.options.hoverDelegate
          }), this.toggleMenuActionViewItem.setActionContext(this.actionBar.context), this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)), this.toggleMenuActionViewItem;
        if (n.actionViewItemProvider) {
          const o = n.actionViewItemProvider(r, s);
          if (o)
            return o;
        }
        if (r instanceof qR) {
          const o = new HU(r, r.actions, t, {
            actionViewItemProvider: this.options.actionViewItemProvider,
            actionRunner: this.actionRunner,
            keybindingProvider: this.options.getKeyBinding,
            classNames: r.class,
            anchorAlignmentProvider: this.options.anchorAlignmentProvider,
            menuAsChild: !!this.options.renderDropdownAsChildElement,
            skipTelemetry: this.options.skipTelemetry,
            hoverDelegate: this.options.hoverDelegate
          });
          return o.setActionContext(this.actionBar.context), this.submenuActionViewItems.push(o), this.disposables.add(this._onDidChangeDropdownVisibility.add(o.onDidChangeVisibility)), o;
        }
      }
    }));
  }
  set actionRunner(e) {
    this.actionBar.actionRunner = e;
  }
  get actionRunner() {
    return this.actionBar.actionRunner;
  }
  set context(e) {
    var t;
    this.actionBar.context = e, (t = this.toggleMenuActionViewItem) == null || t.setActionContext(e);
    for (const n of this.submenuActionViewItems)
      n.setActionContext(e);
  }
  getElement() {
    return this.element;
  }
  getItemAction(e) {
    return this.actionBar.getAction(e);
  }
  setActions(e, t) {
    this.clear();
    const n = e ? e.slice(0) : [];
    this.hasSecondaryActions = !!(t && t.length > 0), this.hasSecondaryActions && t && (this.toggleMenuAction.menuActions = t.slice(0), n.push(this.toggleMenuAction)), n.forEach((r) => {
      this.actionBar.push(r, { icon: this.options.icon ?? !0, label: this.options.label ?? !1, keybinding: this.getKeybindingLabel(r) });
    });
  }
  getKeybindingLabel(e) {
    var n, r;
    const t = (r = (n = this.options).getKeyBinding) == null ? void 0 : r.call(n, e);
    return (t == null ? void 0 : t.getLabel()) ?? void 0;
  }
  clear() {
    this.submenuActionViewItems = [], this.disposables.clear(), this.actionBar.clear();
  }
  dispose() {
    this.clear(), this.disposables.dispose(), super.dispose();
  }
}
const eG = class eG extends Vh {
  constructor(e, t) {
    t = t || S(17, "More Actions..."), super(eG.ID, t, void 0, !0), this._menuActions = [], this.toggleDropdownMenu = e;
  }
  async run() {
    this.toggleDropdownMenu();
  }
  get menuActions() {
    return this._menuActions;
  }
  set menuActions(e) {
    this._menuActions = e;
  }
};
eG.ID = "toolbar.toggle.more";
let G4 = eG;
class fK {
  constructor(e, t, n = t) {
    this.modifierLabels = [null], this.modifierLabels[
      2
      /* OperatingSystem.Macintosh */
    ] = e, this.modifierLabels[
      1
      /* OperatingSystem.Windows */
    ] = t, this.modifierLabels[
      3
      /* OperatingSystem.Linux */
    ] = n;
  }
  toLabel(e, t, n) {
    if (t.length === 0)
      return null;
    const r = [];
    for (let s = 0, o = t.length; s < o; s++) {
      const a = t[s], l = n(a);
      if (l === null)
        return null;
      r[s] = vyt(a, l, this.modifierLabels[e]);
    }
    return r.join(" ");
  }
}
const Nge = new fK({
  ctrlKey: "⌃",
  shiftKey: "⇧",
  altKey: "⌥",
  metaKey: "⌘",
  separator: ""
}, {
  ctrlKey: S(35, "Ctrl"),
  shiftKey: S(36, "Shift"),
  altKey: S(37, "Alt"),
  metaKey: S(38, "Windows"),
  separator: "+"
}, {
  ctrlKey: S(39, "Ctrl"),
  shiftKey: S(40, "Shift"),
  altKey: S(41, "Alt"),
  metaKey: S(42, "Super"),
  separator: "+"
}), myt = new fK({
  ctrlKey: S(43, "Control"),
  shiftKey: S(44, "Shift"),
  altKey: S(45, "Option"),
  metaKey: S(46, "Command"),
  separator: "+"
}, {
  ctrlKey: S(47, "Control"),
  shiftKey: S(48, "Shift"),
  altKey: S(49, "Alt"),
  metaKey: S(50, "Windows"),
  separator: "+"
}, {
  ctrlKey: S(51, "Control"),
  shiftKey: S(52, "Shift"),
  altKey: S(53, "Alt"),
  metaKey: S(54, "Super"),
  separator: "+"
}), _yt = new fK({
  ctrlKey: "Ctrl",
  shiftKey: "Shift",
  altKey: "Alt",
  metaKey: "Cmd",
  separator: "+"
}, {
  ctrlKey: "Ctrl",
  shiftKey: "Shift",
  altKey: "Alt",
  metaKey: "Super",
  separator: "+"
}), byt = new fK({
  ctrlKey: "ctrl",
  shiftKey: "shift",
  altKey: "alt",
  metaKey: "cmd",
  separator: "+"
}, {
  ctrlKey: "ctrl",
  shiftKey: "shift",
  altKey: "alt",
  metaKey: "win",
  separator: "+"
}, {
  ctrlKey: "ctrl",
  shiftKey: "shift",
  altKey: "alt",
  metaKey: "meta",
  separator: "+"
});
function vyt(i, e, t) {
  if (e === null)
    return "";
  const n = [];
  return i.ctrlKey && n.push(t.ctrlKey), i.shiftKey && n.push(t.shiftKey), i.altKey && n.push(t.altKey), i.metaKey && n.push(t.metaKey), e !== "" && n.push(e), n.join(t.separator);
}
function yyt(i) {
  return i && typeof i == "object" && typeof i.original == "string" && typeof i.value == "string";
}
function Cyt(i) {
  return i ? i.condition !== void 0 : !1;
}
var sR;
(function(i) {
  i[i.STORAGE_DOES_NOT_EXIST = 0] = "STORAGE_DOES_NOT_EXIST", i[i.STORAGE_IN_MEMORY = 1] = "STORAGE_IN_MEMORY";
})(sR || (sR = {}));
var jE;
(function(i) {
  i[i.None = 0] = "None", i[i.Initialized = 1] = "Initialized", i[i.Closed = 2] = "Closed";
})(jE || (jE = {}));
const tG = class tG extends ge {
  constructor(e, t = /* @__PURE__ */ Object.create(null)) {
    super(), this.database = e, this.options = t, this._onDidChangeStorage = this._register(new eT()), this.onDidChangeStorage = this._onDidChangeStorage.event, this.state = jE.None, this.cache = /* @__PURE__ */ new Map(), this.flushDelayer = this._register(new $Me(tG.DEFAULT_FLUSH_DELAY)), this.pendingDeletes = /* @__PURE__ */ new Set(), this.pendingInserts = /* @__PURE__ */ new Map(), this.pendingClose = void 0, this.whenFlushedCallbacks = [], this.registerListeners();
  }
  registerListeners() {
    this._register(this.database.onDidChangeItemsExternal((e) => this.onDidChangeItemsExternal(e)));
  }
  onDidChangeItemsExternal(e) {
    var t, n;
    this._onDidChangeStorage.pause();
    try {
      (t = e.changed) == null || t.forEach((r, s) => this.acceptExternal(s, r)), (n = e.deleted) == null || n.forEach((r) => this.acceptExternal(r, void 0));
    } finally {
      this._onDidChangeStorage.resume();
    }
  }
  acceptExternal(e, t) {
    if (this.state === jE.Closed)
      return;
    let n = !1;
    If(t) ? n = this.cache.delete(e) : this.cache.get(e) !== t && (this.cache.set(e, t), n = !0), n && this._onDidChangeStorage.fire({ key: e, external: !0 });
  }
  get(e, t) {
    const n = this.cache.get(e);
    return If(n) ? t : n;
  }
  getBoolean(e, t) {
    const n = this.get(e);
    return If(n) ? t : n === "true";
  }
  getNumber(e, t) {
    const n = this.get(e);
    return If(n) ? t : parseInt(n, 10);
  }
  async set(e, t, n = !1) {
    if (this.state === jE.Closed)
      return;
    if (If(t))
      return this.delete(e, n);
    const r = Ra(t) || Array.isArray(t) ? S_t(t) : String(t);
    if (this.cache.get(e) !== r)
      return this.cache.set(e, r), this.pendingInserts.set(e, r), this.pendingDeletes.delete(e), this._onDidChangeStorage.fire({ key: e, external: n }), this.doFlush();
  }
  async delete(e, t = !1) {
    if (!(this.state === jE.Closed || !this.cache.delete(e)))
      return this.pendingDeletes.has(e) || this.pendingDeletes.add(e), this.pendingInserts.delete(e), this._onDidChangeStorage.fire({ key: e, external: t }), this.doFlush();
  }
  get hasPending() {
    return this.pendingInserts.size > 0 || this.pendingDeletes.size > 0;
  }
  async flushPending() {
    if (!this.hasPending)
      return;
    const e = { insert: this.pendingInserts, delete: this.pendingDeletes };
    return this.pendingDeletes = /* @__PURE__ */ new Set(), this.pendingInserts = /* @__PURE__ */ new Map(), this.database.updateItems(e).finally(() => {
      var t;
      if (!this.hasPending)
        for (; this.whenFlushedCallbacks.length; )
          (t = this.whenFlushedCallbacks.pop()) == null || t();
    });
  }
  async flush(e) {
    if (!(this.state === jE.Closed || // Return early if we are already closed
    this.pendingClose))
      return this.doFlush(e);
  }
  async doFlush(e) {
    return this.options.hint === sR.STORAGE_IN_MEMORY ? this.flushPending() : this.flushDelayer.trigger(() => this.flushPending(), e);
  }
  async whenFlushed() {
    if (this.hasPending)
      return new Promise((e) => this.whenFlushedCallbacks.push(e));
  }
};
tG.DEFAULT_FLUSH_DELAY = 100;
let UF = tG;
class Hee {
  constructor() {
    this.onDidChangeItemsExternal = Ze.None, this.items = /* @__PURE__ */ new Map();
  }
  async updateItems(e) {
    var t, n;
    (t = e.insert) == null || t.forEach((r, s) => this.items.set(s, r)), (n = e.delete) == null || n.forEach((r) => this.items.delete(r));
  }
}
const PW = "__$__targetStorageMarker", gu = Vn("storageService");
var I1;
(function(i) {
  i[i.NONE = 0] = "NONE", i[i.SHUTDOWN = 1] = "SHUTDOWN";
})(I1 || (I1 = {}));
function wyt(i) {
  const e = i.get(PW);
  if (e)
    try {
      return JSON.parse(e);
    } catch {
    }
  return /* @__PURE__ */ Object.create(null);
}
const nG = class nG extends ge {
  // every minute
  constructor(e = { flushInterval: nG.DEFAULT_FLUSH_INTERVAL }) {
    super(), this._onDidChangeValue = this._register(new eT()), this._onDidChangeTarget = this._register(new eT()), this._onWillSaveState = this._register(new he()), this.onWillSaveState = this._onWillSaveState.event, this.runFlushWhenIdle = this._register(new er()), this._workspaceKeyTargets = void 0, this._profileKeyTargets = void 0, this._applicationKeyTargets = void 0, this.flushWhenIdleScheduler = this._register(new mr(() => this.doFlushWhenIdle(), e.flushInterval));
  }
  onDidChangeValue(e, t, n) {
    return Ze.filter(this._onDidChangeValue.event, (r) => r.scope === e && (t === void 0 || r.key === t), n);
  }
  doFlushWhenIdle() {
    this.runFlushWhenIdle.value = Ohe(() => {
      this.shouldFlushWhenIdle() && this.flush(), this.flushWhenIdleScheduler.schedule();
    });
  }
  shouldFlushWhenIdle() {
    return !0;
  }
  emitDidChangeValue(e, t) {
    const { key: n, external: r } = t;
    if (n === PW) {
      switch (e) {
        case -1:
          this._applicationKeyTargets = void 0;
          break;
        case 0:
          this._profileKeyTargets = void 0;
          break;
        case 1:
          this._workspaceKeyTargets = void 0;
          break;
      }
      this._onDidChangeTarget.fire({ scope: e });
    } else
      this._onDidChangeValue.fire({ scope: e, key: n, target: this.getKeyTargets(e)[n], external: r });
  }
  get(e, t, n) {
    var r;
    return (r = this.getStorage(t)) == null ? void 0 : r.get(e, n);
  }
  getBoolean(e, t, n) {
    var r;
    return (r = this.getStorage(t)) == null ? void 0 : r.getBoolean(e, n);
  }
  getNumber(e, t, n) {
    var r;
    return (r = this.getStorage(t)) == null ? void 0 : r.getNumber(e, n);
  }
  store(e, t, n, r, s = !1) {
    if (If(t)) {
      this.remove(e, n, s);
      return;
    }
    this.withPausedEmitters(() => {
      var o;
      this.updateKeyTarget(e, n, r), (o = this.getStorage(n)) == null || o.set(e, t, s);
    });
  }
  remove(e, t, n = !1) {
    this.withPausedEmitters(() => {
      var r;
      this.updateKeyTarget(e, t, void 0), (r = this.getStorage(t)) == null || r.delete(e, n);
    });
  }
  withPausedEmitters(e) {
    this._onDidChangeValue.pause(), this._onDidChangeTarget.pause();
    try {
      e();
    } finally {
      this._onDidChangeValue.resume(), this._onDidChangeTarget.resume();
    }
  }
  updateKeyTarget(e, t, n, r = !1) {
    var o, a;
    const s = this.getKeyTargets(t);
    typeof n == "number" ? s[e] !== n && (s[e] = n, (o = this.getStorage(t)) == null || o.set(PW, JSON.stringify(s), r)) : typeof s[e] == "number" && (delete s[e], (a = this.getStorage(t)) == null || a.set(PW, JSON.stringify(s), r));
  }
  get workspaceKeyTargets() {
    return this._workspaceKeyTargets || (this._workspaceKeyTargets = this.loadKeyTargets(
      1
      /* StorageScope.WORKSPACE */
    )), this._workspaceKeyTargets;
  }
  get profileKeyTargets() {
    return this._profileKeyTargets || (this._profileKeyTargets = this.loadKeyTargets(
      0
      /* StorageScope.PROFILE */
    )), this._profileKeyTargets;
  }
  get applicationKeyTargets() {
    return this._applicationKeyTargets || (this._applicationKeyTargets = this.loadKeyTargets(
      -1
      /* StorageScope.APPLICATION */
    )), this._applicationKeyTargets;
  }
  getKeyTargets(e) {
    switch (e) {
      case -1:
        return this.applicationKeyTargets;
      case 0:
        return this.profileKeyTargets;
      default:
        return this.workspaceKeyTargets;
    }
  }
  loadKeyTargets(e) {
    const t = this.getStorage(e);
    return t ? wyt(t) : /* @__PURE__ */ Object.create(null);
  }
  async flush(e = I1.NONE) {
    this._onWillSaveState.fire({ reason: e });
    const t = this.getStorage(
      -1
      /* StorageScope.APPLICATION */
    ), n = this.getStorage(
      0
      /* StorageScope.PROFILE */
    ), r = this.getStorage(
      1
      /* StorageScope.WORKSPACE */
    );
    switch (e) {
      // Unspecific reason: just wait when data is flushed
      case I1.NONE:
        await Z3.settled([
          (t == null ? void 0 : t.whenFlushed()) ?? Promise.resolve(),
          (n == null ? void 0 : n.whenFlushed()) ?? Promise.resolve(),
          (r == null ? void 0 : r.whenFlushed()) ?? Promise.resolve()
        ]);
        break;
      // Shutdown: we want to flush as soon as possible
      // and not hit any delays that might be there
      case I1.SHUTDOWN:
        await Z3.settled([
          (t == null ? void 0 : t.flush(0)) ?? Promise.resolve(),
          (n == null ? void 0 : n.flush(0)) ?? Promise.resolve(),
          (r == null ? void 0 : r.flush(0)) ?? Promise.resolve()
        ]);
        break;
    }
  }
};
nG.DEFAULT_FLUSH_INTERVAL = 60 * 1e3;
let pse = nG;
class Syt extends pse {
  constructor() {
    super(), this.applicationStorage = this._register(new UF(new Hee(), { hint: sR.STORAGE_IN_MEMORY })), this.profileStorage = this._register(new UF(new Hee(), { hint: sR.STORAGE_IN_MEMORY })), this.workspaceStorage = this._register(new UF(new Hee(), { hint: sR.STORAGE_IN_MEMORY })), this._register(this.workspaceStorage.onDidChangeStorage((e) => this.emitDidChangeValue(1, e))), this._register(this.profileStorage.onDidChangeStorage((e) => this.emitDidChangeValue(0, e))), this._register(this.applicationStorage.onDidChangeStorage((e) => this.emitDidChangeValue(-1, e)));
  }
  getStorage(e) {
    switch (e) {
      case -1:
        return this.applicationStorage;
      case 0:
        return this.profileStorage;
      default:
        return this.workspaceStorage;
    }
  }
  shouldFlushWhenIdle() {
    return !1;
  }
}
function Eyt(i, e) {
  const t = { ...e };
  for (const n in i) {
    const r = i[n];
    t[n] = r !== void 0 ? je(r) : void 0;
  }
  return t;
}
const y5e = {
  keybindingLabelBackground: je(Dlt),
  keybindingLabelForeground: je(Ilt),
  keybindingLabelBorder: je(Nlt),
  keybindingLabelBottomBorder: je(Rlt),
  keybindingLabelShadow: je(e2)
}, xyt = {
  buttonForeground: je(Xq),
  buttonSeparator: je(mlt),
  buttonBackground: je(gx),
  buttonHoverBackground: je(_lt),
  buttonSecondaryForeground: je(HFe),
  buttonSecondaryBackground: je(nU),
  buttonSecondaryHoverBackground: je(vlt),
  buttonBorder: je(blt)
}, Lyt = {
  progressBarBackground: je(Rat)
}, WU = {
  inputActiveOptionBorder: je(qq),
  inputActiveOptionForeground: je(Kq),
  inputActiveOptionBackground: je(SB)
};
je(zP), je(ylt), je(Clt), je(wlt), je(Slt), je(Elt), je(xlt);
const Rge = {
  checkboxBackground: je(kfe),
  checkboxBorder: je(Llt),
  checkboxForeground: je(Dfe),
  checkboxDisabledBackground: je(Tlt),
  checkboxDisabledForeground: je(klt)
};
je(Bh), je($q), je(e2), je(Efe), je(Zat), je(Qat), je(Jat), je(Iat);
const VU = {
  inputBackground: je(Gie),
  inputForeground: je(FFe),
  inputBorder: je(BFe),
  inputValidationInfoBorder: je(llt),
  inputValidationInfoBackground: je(olt),
  inputValidationInfoForeground: je(alt),
  inputValidationWarningBorder: je(dlt),
  inputValidationWarningBackground: je(clt),
  inputValidationWarningForeground: je(ult),
  inputValidationErrorBorder: je(glt),
  inputValidationErrorBackground: je(hlt),
  inputValidationErrorForeground: je(flt)
}, Tyt = {
  listFilterWidgetBackground: je(jlt),
  listFilterWidgetOutline: je(Glt),
  listFilterWidgetNoMatchesOutline: je(qlt),
  listFilterWidgetShadow: je(Klt),
  inputBoxStyles: VU,
  toggleStyles: WU
}, C5e = {
  badgeBackground: je(kW),
  badgeForeground: je(Nat),
  badgeBorder: je(hi)
};
je(Yat), je(Kat), je(LLe), je(LLe), je(Xat);
const o2 = {
  listBackground: void 0,
  listInactiveFocusForeground: void 0,
  listFocusBackground: je(Alt),
  listFocusForeground: je(Olt),
  listFocusOutline: je(Mlt),
  listActiveSelectionBackground: je(rT),
  listActiveSelectionForeground: je(_4),
  listActiveSelectionIconForeground: je(WFe),
  listFocusAndSelectionOutline: je(Plt),
  listFocusAndSelectionBackground: je(rT),
  listFocusAndSelectionForeground: je(_4),
  listInactiveSelectionBackground: je(Flt),
  listInactiveSelectionIconForeground: je(Hlt),
  listInactiveSelectionForeground: je(Blt),
  listInactiveFocusBackground: je(Wlt),
  listInactiveFocusOutline: je(Vlt),
  listHoverBackground: je(VFe),
  listHoverForeground: je(UFe),
  listDropOverBackground: je(Ult),
  listDropBetweenBackground: je(zlt),
  listSelectionOutline: je(fs),
  listHoverOutline: je(fs),
  treeIndentGuidesStroke: je(zFe),
  treeInactiveIndentGuidesStroke: je(Ylt),
  treeStickyScrollBackground: void 0,
  treeStickyScrollBorder: void 0,
  treeStickyScrollShadow: je(zq),
  tableColumnsBorder: je(Xlt),
  tableOddRowsBackgroundColor: je(Zlt)
};
function JT(i) {
  return Eyt(i, o2);
}
const kyt = {
  selectBackground: je(Yq),
  selectListBackground: je(plt),
  selectForeground: je(Lfe),
  decoratorRightForeground: je($Fe),
  selectBorder: je(Tfe),
  focusBorder: je(fb),
  listFocusBackground: je(v4),
  listInactiveSelectionIconForeground: je(Ife),
  listFocusForeground: je(b4),
  listFocusOutline: LFe(fs, De.transparent.toString()),
  listHoverBackground: je(VFe),
  listHoverForeground: je(UFe),
  listHoverOutline: je(fs),
  selectListBorder: je(vfe),
  listBackground: void 0,
  listActiveSelectionBackground: void 0,
  listActiveSelectionForeground: void 0,
  listActiveSelectionIconForeground: void 0,
  listFocusAndSelectionBackground: void 0,
  listDropOverBackground: void 0,
  listDropBetweenBackground: void 0,
  listInactiveSelectionBackground: void 0,
  listInactiveSelectionForeground: void 0,
  listInactiveFocusBackground: void 0,
  listInactiveFocusOutline: void 0,
  listSelectionOutline: void 0,
  listFocusAndSelectionForeground: void 0,
  listFocusAndSelectionOutline: void 0,
  listInactiveFocusForeground: void 0,
  tableColumnsBorder: void 0,
  tableOddRowsBackgroundColor: void 0,
  treeIndentGuidesStroke: void 0,
  treeInactiveIndentGuidesStroke: void 0,
  treeStickyScrollBackground: void 0,
  treeStickyScrollBorder: void 0,
  treeStickyScrollShadow: void 0
}, Dyt = {
  shadowColor: je(e2),
  borderColor: je(Jlt),
  foregroundColor: je(ect),
  backgroundColor: je(tct),
  selectionForegroundColor: je(nct),
  selectionBackgroundColor: je(ict),
  selectionBorderColor: je(rct),
  separatorColor: je(sct),
  scrollbarShadow: je(zq),
  scrollbarSliderBackground: je(NFe),
  scrollbarSliderHoverBackground: je(RFe),
  scrollbarSliderActiveBackground: je(AFe)
};
function Iyt(i, e) {
  if (Lb)
    return !1;
  const t = Nyt(i, e), n = i.getValue("window");
  return (n == null ? void 0 : n.menuStyle) === "native" ? !(!Kn && !t) : (n == null ? void 0 : n.menuStyle) === "custom" ? !1 : t;
}
function Nyt(i, e) {
  return e || (e = w5e(i)), e === "native";
}
function w5e(i) {
  if (Lb)
    return "custom";
  const e = i.getValue("window");
  if (e) {
    if (Kn && e.nativeTabs === !0 || Kn && e.nativeFullScreen === !1)
      return "native";
    const r = e.titleBarStyle;
    if (r === "native" || r === "custom")
      return r;
  }
  return "custom";
}
function Ryt(i) {
  if (Lb || Kn || w5e(i) === "native")
    return "native";
  const e = i.getValue("window"), t = e == null ? void 0 : e.controlsStyle;
  return t === "custom" || t === "hidden" ? t : "native";
}
var gK = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ru = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
function Ayt(i, e) {
  const t = [];
  return Oyt(i, t), t;
}
function Oyt(i, e, t) {
  const n = by.getInstance(), r = n.keyStatus.altKey || (Za || Qu) && n.keyStatus.shiftKey;
  x5e(i, e, r, (s) => s === "navigation");
}
function S5e(i, e, t, n) {
  const r = { primary: [], secondary: [] };
  return E5e(i, r, e, t, n), r;
}
function Myt(i, e, t, n) {
  const r = [];
  return E5e(i, r, e, t, n), r;
}
function E5e(i, e, t, n, r) {
  x5e(i, e, !1, typeof t == "string" ? (o) => o === t : t, n, r);
}
function x5e(i, e, t, n = (o) => o === "navigation", r = () => !1, s = !1) {
  let o, a;
  Array.isArray(e) ? (o = e, a = e) : (o = e.primary, a = e.secondary);
  const l = /* @__PURE__ */ new Set();
  for (const [c, u] of i) {
    let d;
    n(c) ? (d = o, d.length > 0 && s && d.push(new fa())) : (d = a, d.length > 0 && d.push(new fa()));
    for (let h of u) {
      t && (h = h instanceof Uh && h.alt ? h.alt : h);
      const g = d.push(h);
      h instanceof qR && l.add({ group: c, action: h, index: g - 1 });
    }
  }
  for (const { group: c, action: u, index: d } of l) {
    const h = n(c) ? o : a, g = u.actions;
    r(u, c, h.length) && h.splice(d, 1, ...g);
  }
}
let hw = class extends lA {
  constructor(e, t, n, r, s, o, a, l) {
    super(void 0, e, { icon: !!(e.class || e.item.icon), label: !e.class && !e.item.icon, draggable: t == null ? void 0 : t.draggable, keybinding: t == null ? void 0 : t.keybinding, hoverDelegate: t == null ? void 0 : t.hoverDelegate, keybindingNotRenderedWithLabel: t == null ? void 0 : t.keybindingNotRenderedWithLabel }), this._options = t, this._keybindingService = n, this._notificationService = r, this._contextKeyService = s, this._themeService = o, this._contextMenuService = a, this._accessibilityService = l, this._wantsAltCommand = !1, this._itemClassDispose = this._register(new er()), this._altKey = by.getInstance();
  }
  get _menuItemAction() {
    return this._action;
  }
  get _commandAction() {
    return this._wantsAltCommand && this._menuItemAction.alt || this._menuItemAction;
  }
  async onClick(e) {
    e.preventDefault(), e.stopPropagation();
    try {
      await this.actionRunner.run(this._commandAction, this._context);
    } catch (t) {
      this._notificationService.error(t);
    }
  }
  render(e) {
    if (super.render(e), e.classList.add("menu-entry"), this.options.icon && this._updateItemClass(this._menuItemAction.item), this._menuItemAction.alt) {
      let t = !1;
      const n = () => {
        var s;
        const r = !!((s = this._menuItemAction.alt) != null && s.enabled) && (!this._accessibilityService.isMotionReduced() || t) && (this._altKey.keyStatus.altKey || this._altKey.keyStatus.shiftKey && t);
        r !== this._wantsAltCommand && (this._wantsAltCommand = r, this.updateLabel(), this.updateTooltip(), this.updateClass());
      };
      this._register(this._altKey.event(n)), this._register(Ce(e, "mouseleave", (r) => {
        t = !1, n();
      })), this._register(Ce(e, "mouseenter", (r) => {
        t = !0, n();
      })), n();
    }
  }
  updateLabel() {
    this.options.label && this.label && (this.label.textContent = this._commandAction.label);
  }
  getTooltip() {
    var s;
    const e = this._keybindingService.lookupKeybinding(this._commandAction.id, this._contextKeyService), t = e && e.getLabel(), n = this._commandAction.tooltip || this._commandAction.label;
    let r = t ? S(1629, "{0} ({1})", n, t) : n;
    if (!this._wantsAltCommand && ((s = this._menuItemAction.alt) != null && s.enabled)) {
      const o = this._menuItemAction.alt.tooltip || this._menuItemAction.alt.label, a = this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id, this._contextKeyService), l = a && a.getLabel(), c = l ? S(1630, "{0} ({1})", o, l) : o;
      r = S(1631, `{0}
[{1}] {2}`, r, Nge.modifierLabels[Ad].altKey, c);
    }
    return r;
  }
  updateClass() {
    this.options.icon && (this._commandAction !== this._menuItemAction ? this._menuItemAction.alt && this._updateItemClass(this._menuItemAction.alt.item) : this._updateItemClass(this._menuItemAction.item));
  }
  _updateItemClass(e) {
    this._itemClassDispose.value = void 0;
    const { element: t, label: n } = this;
    if (!t || !n)
      return;
    const r = this._commandAction.checked && Cyt(e.toggled) && e.toggled.icon ? e.toggled.icon : e.icon;
    if (r)
      if (qt.isThemeIcon(r)) {
        const s = qt.asClassNameArray(r);
        n.classList.add(...s), this._itemClassDispose.value = Et(() => {
          n.classList.remove(...s);
        });
      } else
        n.style.backgroundImage = sT(this._themeService.getColorTheme().type) ? mb(r.dark) : mb(r.light), n.classList.add("icon"), this._itemClassDispose.value = Vg(Et(() => {
          n.style.backgroundImage = "", n.classList.remove("icon");
        }), this._themeService.onDidColorThemeChange(() => {
          this.updateClass();
        }));
  }
};
hw = gK([
  ru(2, Fi),
  ru(3, no),
  ru(4, Jt),
  ru(5, to),
  ru(6, Qh),
  ru(7, Qa)
], hw);
class Age extends hw {
  render(e) {
    var t;
    this.options.label = !0, this.options.icon = !1, super.render(e), e.classList.add("text-only"), e.classList.toggle("use-comma", ((t = this._options) == null ? void 0 : t.useComma) ?? !1);
  }
  updateLabel() {
    var t;
    const e = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService);
    if (!e)
      return super.updateLabel();
    if (this.label) {
      const n = Age._symbolPrintEnter(e);
      (t = this._options) != null && t.conversational ? this.label.textContent = S(1632, "{1} to {0}", this._action.label, n) : this.label.textContent = S(1633, "{0} ({1})", this._action.label, n);
    }
  }
  static _symbolPrintEnter(e) {
    var t;
    return (t = e.getLabel()) == null ? void 0 : t.replace(/\benter\b/gi, "⏎").replace(/\bEscape\b/gi, "Esc");
  }
}
let mse = class extends HU {
  constructor(e, t, n, r, s) {
    const o = {
      ...t,
      menuAsChild: (t == null ? void 0 : t.menuAsChild) ?? !1,
      classNames: (t == null ? void 0 : t.classNames) ?? (qt.isThemeIcon(e.item.icon) ? qt.asClassName(e.item.icon) : void 0),
      keybindingProvider: (t == null ? void 0 : t.keybindingProvider) ?? ((a) => n.lookupKeybinding(a.id))
    };
    super(e, { getActions: () => e.actions }, r, o), this._keybindingService = n, this._contextMenuService = r, this._themeService = s;
  }
  render(e) {
    super.render(e), Ii(this.element), e.classList.add("menu-entry");
    const t = this._action, { icon: n } = t.item;
    if (n && !qt.isThemeIcon(n)) {
      this.element.classList.add("icon");
      const r = () => {
        this.element && (this.element.style.backgroundImage = sT(this._themeService.getColorTheme().type) ? mb(n.dark) : mb(n.light));
      };
      r(), this._register(this._themeService.onDidColorThemeChange(() => {
        r();
      }));
    }
  }
};
mse = gK([
  ru(2, Fi),
  ru(3, Qh),
  ru(4, to)
], mse);
let _se = class extends zp {
  constructor(e, t, n, r, s, o, a, l) {
    super(null, e), this._keybindingService = n, this._notificationService = r, this._contextMenuService = s, this._menuService = o, this._instaService = a, this._storageService = l, this._defaultActionDisposables = this._register(new ke()), this._container = null, this._options = t, this._storageKey = `${e.item.submenu.id}_lastActionId`;
    let c;
    const u = t != null && t.persistLastActionId ? l.get(
      this._storageKey,
      1
      /* StorageScope.WORKSPACE */
    ) : void 0;
    u && (c = e.actions.find((h) => u === h.id)), c || (c = e.actions[0]), this._defaultAction = this._defaultActionDisposables.add(this._instaService.createInstance(hw, c, { keybinding: this._getDefaultActionKeybindingLabel(c) }));
    const d = {
      keybindingProvider: (h) => this._keybindingService.lookupKeybinding(h.id),
      ...t,
      menuAsChild: (t == null ? void 0 : t.menuAsChild) ?? !0,
      classNames: (t == null ? void 0 : t.classNames) ?? ["codicon", "codicon-chevron-down"],
      actionRunner: (t == null ? void 0 : t.actionRunner) ?? this._register(new nT())
    };
    this._dropdown = this._register(new HU(e, e.actions, this._contextMenuService, d)), this._register(this._dropdown.actionRunner.onDidRun((h) => {
      h.action instanceof Uh && this.update(h.action);
    }));
  }
  update(e) {
    var t;
    (t = this._options) != null && t.persistLastActionId && this._storageService.store(
      this._storageKey,
      e.id,
      1,
      1
      /* StorageTarget.MACHINE */
    ), this._defaultActionDisposables.clear(), this._defaultAction = this._defaultActionDisposables.add(this._instaService.createInstance(hw, e, { keybinding: this._getDefaultActionKeybindingLabel(e) })), this._defaultAction.actionRunner = this._defaultActionDisposables.add(new class extends nT {
      async runAction(n, r) {
        await n.run(void 0);
      }
    }()), this._container && this._defaultAction.render(Sq(this._container, Ge(".action-container")));
  }
  _getDefaultActionKeybindingLabel(e) {
    var n;
    let t;
    if ((n = this._options) != null && n.renderKeybindingWithDefaultActionLabel) {
      const r = this._keybindingService.lookupKeybinding(e.id);
      r && (t = `(${r.getLabel()})`);
    }
    return t;
  }
  setActionContext(e) {
    super.setActionContext(e), this._defaultAction.setActionContext(e), this._dropdown.setActionContext(e);
  }
  render(e) {
    this._container = e, super.render(this._container), this._container.classList.add("monaco-dropdown-with-default");
    const t = Ge(".action-container");
    this._defaultAction.render(Fe(this._container, t)), this._register(Ce(t, Xe.KEY_DOWN, (r) => {
      const s = new wr(r);
      s.equals(
        17
        /* KeyCode.RightArrow */
      ) && (this._defaultAction.element.tabIndex = -1, this._dropdown.focus(), s.stopPropagation());
    }));
    const n = Ge(".dropdown-action-container");
    this._dropdown.render(Fe(this._container, n)), this._register(Ce(n, Xe.KEY_DOWN, (r) => {
      var o;
      const s = new wr(r);
      s.equals(
        15
        /* KeyCode.LeftArrow */
      ) && (this._defaultAction.element.tabIndex = 0, this._dropdown.setFocusable(!1), (o = this._defaultAction.element) == null || o.focus(), s.stopPropagation());
    }));
  }
  focus(e) {
    e ? this._dropdown.focus() : (this._defaultAction.element.tabIndex = 0, this._defaultAction.element.focus());
  }
  blur() {
    this._defaultAction.element.tabIndex = -1, this._dropdown.blur(), this._container.blur();
  }
  setFocusable(e) {
    e ? this._defaultAction.element.tabIndex = 0 : (this._defaultAction.element.tabIndex = -1, this._dropdown.setFocusable(!1));
  }
};
_se = gK([
  ru(2, Fi),
  ru(3, no),
  ru(4, Qh),
  ru(5, eg),
  ru(6, xt),
  ru(7, gu)
], _se);
let bse = class extends Jbt {
  constructor(e, t, n) {
    super(null, e, e.actions.map((r) => ({
      text: r.id === fa.ID ? "─────────" : r.label,
      isDisabled: !r.enabled
    })), 0, t, kyt, { ariaLabel: e.tooltip, optionsAsChildren: !0, useCustomDrawn: !Iyt(n) }), this.select(Math.max(0, e.actions.findIndex((r) => r.checked)));
  }
  render(e) {
    super.render(e), e.style.borderColor = je(Tfe);
  }
  runAction(e, t) {
    const n = this.action.actions[t];
    n && this.actionRunner.run(n);
  }
};
bse = gK([
  ru(1, g0),
  ru(2, xn)
], bse);
function Oge(i, e, t) {
  return e instanceof Uh ? i.createInstance(hw, e, t) : e instanceof Mx ? e.item.isSelection ? i.createInstance(bse, e) : e.item.rememberDefaultAction ? i.createInstance(_se, e, { ...t, persistLastActionId: !0 }) : i.createInstance(mse, e, t) : void 0;
}
var pK = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ab = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, zI, KP;
let vse = class {
  constructor(e, t, n) {
    this._commandService = e, this._keybindingService = t, this._hiddenStates = new yse(n);
  }
  createMenu(e, t, n) {
    return new UU(e, this._hiddenStates, { emitEventsForSubmenuChanges: !1, eventDebounceDelay: 50, ...n }, this._commandService, this._keybindingService, t);
  }
  getMenuActions(e, t, n) {
    const r = new UU(e, this._hiddenStates, { emitEventsForSubmenuChanges: !1, eventDebounceDelay: 50, ...n }, this._commandService, this._keybindingService, t), s = r.getActions(n);
    return r.dispose(), s;
  }
  resetHiddenStates(e) {
    this._hiddenStates.reset(e);
  }
};
vse = pK([
  ab(0, jr),
  ab(1, Fi),
  ab(2, gu)
], vse);
var tL;
let yse = (tL = class {
  constructor(e) {
    this._storageService = e, this._disposables = new ke(), this._onDidChange = new he(), this.onDidChange = this._onDidChange.event, this._ignoreChangeEvent = !1, this._hiddenByDefaultCache = /* @__PURE__ */ new Map();
    try {
      const t = e.get(zI._key, 0, "{}");
      this._data = JSON.parse(t);
    } catch {
      this._data = /* @__PURE__ */ Object.create(null);
    }
    this._disposables.add(e.onDidChangeValue(0, zI._key, this._disposables)(() => {
      if (!this._ignoreChangeEvent)
        try {
          const t = e.get(zI._key, 0, "{}");
          this._data = JSON.parse(t);
        } catch (t) {
          console.log("FAILED to read storage after UPDATE", t);
        }
      this._onDidChange.fire();
    }));
  }
  dispose() {
    this._onDidChange.dispose(), this._disposables.dispose();
  }
  _isHiddenByDefault(e, t) {
    return this._hiddenByDefaultCache.get(`${e.id}/${t}`) ?? !1;
  }
  setDefaultState(e, t, n) {
    this._hiddenByDefaultCache.set(`${e.id}/${t}`, n);
  }
  isHidden(e, t) {
    var s;
    const n = this._isHiddenByDefault(e, t), r = ((s = this._data[e.id]) == null ? void 0 : s.includes(t)) ?? !1;
    return n ? !r : r;
  }
  updateHidden(e, t, n) {
    this._isHiddenByDefault(e, t) && (n = !n);
    const s = this._data[e.id];
    if (n)
      s ? s.indexOf(t) < 0 && s.push(t) : this._data[e.id] = [t];
    else if (s) {
      const o = s.indexOf(t);
      o >= 0 && Jnt(s, o), s.length === 0 && delete this._data[e.id];
    }
    this._persist();
  }
  reset(e) {
    if (e === void 0)
      this._data = /* @__PURE__ */ Object.create(null), this._persist();
    else {
      for (const { id: t } of e)
        this._data[t] && delete this._data[t];
      this._persist();
    }
  }
  _persist() {
    try {
      this._ignoreChangeEvent = !0;
      const e = JSON.stringify(this._data);
      this._storageService.store(
        zI._key,
        e,
        0,
        0
        /* StorageTarget.USER */
      );
    } finally {
      this._ignoreChangeEvent = !1;
    }
  }
}, zI = tL, tL._key = "menu.hiddenCommands", tL);
yse = zI = pK([
  ab(0, gu)
], yse);
class zF {
  constructor(e, t) {
    this._id = e, this._collectContextKeysForSubmenus = t, this._menuGroups = [], this._allMenuIds = /* @__PURE__ */ new Set(), this._structureContextKeys = /* @__PURE__ */ new Set(), this._preconditionContextKeys = /* @__PURE__ */ new Set(), this._toggledContextKeys = /* @__PURE__ */ new Set(), this.refresh();
  }
  get allMenuIds() {
    return this._allMenuIds;
  }
  get structureContextKeys() {
    return this._structureContextKeys;
  }
  get preconditionContextKeys() {
    return this._preconditionContextKeys;
  }
  get toggledContextKeys() {
    return this._toggledContextKeys;
  }
  refresh() {
    this._menuGroups.length = 0, this._allMenuIds.clear(), this._structureContextKeys.clear(), this._preconditionContextKeys.clear(), this._toggledContextKeys.clear();
    const e = this._sort(Oa.getMenuItems(this._id));
    let t;
    for (const n of e) {
      const r = n.group || "";
      (!t || t[0] !== r) && (t = [r, []], this._menuGroups.push(t)), t[1].push(n), this._collectContextKeysAndSubmenuIds(n);
    }
    this._allMenuIds.add(this._id);
  }
  _sort(e) {
    return e;
  }
  _collectContextKeysAndSubmenuIds(e) {
    if (zF._fillInKbExprKeys(e.when, this._structureContextKeys), $N(e)) {
      if (e.command.precondition && zF._fillInKbExprKeys(e.command.precondition, this._preconditionContextKeys), e.command.toggled) {
        const t = e.command.toggled.condition || e.command.toggled;
        zF._fillInKbExprKeys(t, this._toggledContextKeys);
      }
    } else this._collectContextKeysForSubmenus && (Oa.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds, this), this._allMenuIds.add(e.submenu));
  }
  static _fillInKbExprKeys(e, t) {
    if (e)
      for (const n of e.keys())
        t.add(n);
  }
}
let Cse = KP = class extends zF {
  constructor(e, t, n, r, s, o) {
    super(e, n), this._hiddenStates = t, this._commandService = r, this._keybindingService = s, this._contextKeyService = o, this.refresh();
  }
  createActionGroups(e) {
    const t = [];
    for (const n of this._menuGroups) {
      const [r, s] = n;
      let o;
      for (const a of s)
        if (this._contextKeyService.contextMatchesRules(a.when)) {
          const l = $N(a);
          l && this._hiddenStates.setDefaultState(this._id, a.command.id, !!a.isHiddenByDefault);
          const c = Pyt(this._id, l ? a.command : a, this._hiddenStates);
          if (l) {
            const u = L5e(this._commandService, this._keybindingService, a.command.id, a.when);
            (o ?? (o = [])).push(new Uh(a.command, a.alt, e, c, u, this._contextKeyService, this._commandService));
          } else {
            const u = new KP(a.submenu, this._hiddenStates, this._collectContextKeysForSubmenus, this._commandService, this._keybindingService, this._contextKeyService).createActionGroups(e), d = fa.join(...u.map((h) => h[1]));
            d.length > 0 && (o ?? (o = [])).push(new Mx(a, c, d));
          }
        }
      o && o.length > 0 && t.push([r, o]);
    }
    return t;
  }
  _sort(e) {
    return e.sort(KP._compareMenuItems);
  }
  static _compareMenuItems(e, t) {
    const n = e.group, r = t.group;
    if (n !== r) {
      if (n) {
        if (!r)
          return -1;
      } else return 1;
      if (n === "navigation")
        return -1;
      if (r === "navigation")
        return 1;
      const a = n.localeCompare(r);
      if (a !== 0)
        return a;
    }
    const s = e.order || 0, o = t.order || 0;
    return s < o ? -1 : s > o ? 1 : KP._compareTitles($N(e) ? e.command.title : e.title, $N(t) ? t.command.title : t.title);
  }
  static _compareTitles(e, t) {
    const n = typeof e == "string" ? e : e.original, r = typeof t == "string" ? t : t.original;
    return n.localeCompare(r);
  }
};
Cse = KP = pK([
  ab(3, jr),
  ab(4, Fi),
  ab(5, Jt)
], Cse);
let UU = class {
  constructor(e, t, n, r, s, o) {
    this._disposables = new ke(), this._menuInfo = new Cse(e, t, n.emitEventsForSubmenuChanges, r, s, o);
    const a = new mr(() => {
      this._menuInfo.refresh(), this._onDidChange.fire({ menu: this, isStructuralChange: !0, isEnablementChange: !0, isToggleChange: !0 });
    }, n.eventDebounceDelay);
    this._disposables.add(a), this._disposables.add(Oa.onDidChangeMenu((d) => {
      for (const h of this._menuInfo.allMenuIds)
        if (d.has(h)) {
          a.schedule();
          break;
        }
    }));
    const l = this._disposables.add(new ke()), c = (d) => {
      let h = !1, g = !1, m = !1;
      for (const _ of d)
        if (h = h || _.isStructuralChange, g = g || _.isEnablementChange, m = m || _.isToggleChange, h && g && m)
          break;
      return { menu: this, isStructuralChange: h, isEnablementChange: g, isToggleChange: m };
    }, u = () => {
      l.add(o.onDidChangeContext((d) => {
        const h = d.affectsSome(this._menuInfo.structureContextKeys), g = d.affectsSome(this._menuInfo.preconditionContextKeys), m = d.affectsSome(this._menuInfo.toggledContextKeys);
        (h || g || m) && this._onDidChange.fire({ menu: this, isStructuralChange: h, isEnablementChange: g, isToggleChange: m });
      })), l.add(t.onDidChange((d) => {
        this._onDidChange.fire({ menu: this, isStructuralChange: !0, isEnablementChange: !1, isToggleChange: !1 });
      }));
    };
    this._onDidChange = new VMe({
      // start/stop context key listener
      onWillAddFirstListener: u,
      onDidRemoveLastListener: l.clear.bind(l),
      delay: n.eventDebounceDelay,
      merge: c
    }), this.onDidChange = this._onDidChange.event;
  }
  getActions(e) {
    return this._menuInfo.createActionGroups(e);
  }
  dispose() {
    this._disposables.dispose(), this._onDidChange.dispose();
  }
};
UU = pK([
  ab(3, jr),
  ab(4, Fi),
  ab(5, Jt)
], UU);
function Pyt(i, e, t) {
  const n = vrt(e) ? e.submenu.id : e.id, r = typeof e.title == "string" ? e.title : e.title.value, s = Ox({
    id: `hide/${i.id}/${n}`,
    label: S(1636, "Hide '{0}'", r),
    run() {
      t.updateHidden(i, n, !0);
    }
  }), o = Ox({
    id: `toggle/${i.id}/${n}`,
    label: r,
    get checked() {
      return !t.isHidden(i, n);
    },
    run() {
      t.updateHidden(i, n, !!this.checked);
    }
  });
  return {
    hide: s,
    toggle: o,
    get isHidden() {
      return !o.checked;
    }
  };
}
function L5e(i, e, t, n = void 0, r = !0) {
  return Ox({
    id: `configureKeybinding/${t}`,
    label: S(1637, "Configure Keybinding"),
    enabled: r,
    run() {
      const o = !!!e.lookupKeybinding(t) && n ? n.serialize() : void 0;
      i.executeCommand("workbench.action.openGlobalKeybindings", `@command:${t}` + (o ? ` +when:${o}` : ""));
    }
  });
}
const T5e = Vn("IActionViewItemService");
class Fyt {
  constructor() {
    this._providers = /* @__PURE__ */ new Map(), this._onDidChange = new he(), this.onDidChange = this._onDidChange.event;
  }
  dispose() {
    this._onDidChange.dispose();
  }
  lookUp(e, t) {
    return this._providers.get(this._makeKey(e, t));
  }
  _makeKey(e, t) {
    return `${e.id}/${t instanceof wt ? t.id : t}`;
  }
}
ni(
  T5e,
  Fyt,
  1
  /* InstantiationType.Delayed */
);
var k5e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Th = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let zU = class extends pyt {
  constructor(e, t, n, r, s, o, a, l) {
    super(e, s, {
      // defaults
      getKeyBinding: (u) => o.lookupKeybinding(u.id) ?? void 0,
      // options (override defaults)
      ...t,
      // mandatory (overide options)
      allowContextMenu: !0,
      skipTelemetry: typeof (t == null ? void 0 : t.telemetrySource) == "string"
    }), this._options = t, this._menuService = n, this._contextKeyService = r, this._contextMenuService = s, this._keybindingService = o, this._commandService = a, this._sessionDisposables = this._store.add(new ke());
    const c = t == null ? void 0 : t.telemetrySource;
    c && this._store.add(this.actionBar.onDidRun((u) => l.publicLog2("workbenchActionExecuted", { id: u.action.id, from: c })));
  }
  setActions(e, t = [], n) {
    var u, d, h;
    this._sessionDisposables.clear();
    const r = e.slice(), s = t.slice(), o = [];
    let a = 0;
    const l = [];
    let c = !1;
    if (((u = this._options) == null ? void 0 : u.hiddenItemStrategy) !== -1)
      for (let g = 0; g < r.length; g++) {
        const m = r[g];
        !(m instanceof Uh) && !(m instanceof Mx) || m.hideActions && (o.push(m.hideActions.toggle), m.hideActions.toggle.checked && a++, m.hideActions.isHidden && (c = !0, r[g] = void 0, ((d = this._options) == null ? void 0 : d.hiddenItemStrategy) !== 0 && (l[g] = m)));
      }
    if (((h = this._options) == null ? void 0 : h.overflowBehavior) !== void 0) {
      const g = d4e(new Set(this._options.overflowBehavior.exempted), gi.map(r, (v) => v == null ? void 0 : v.id)), m = this._options.overflowBehavior.maxItems - g.size;
      let _ = 0;
      for (let v = 0; v < r.length; v++) {
        const w = r[v];
        w && (_++, !g.has(w.id) && _ >= m && (r[v] = void 0, l[v] = w));
      }
    }
    Ixe(r), Ixe(l), super.setActions(r, fa.join(l, s)), (o.length > 0 || r.length > 0) && this._sessionDisposables.add(Ce(this.getElement(), "contextmenu", (g) => {
      var E, L, T, D, N;
      const m = new vl(At(this.getElement()), g), _ = this.getItemAction(m.target);
      if (!_)
        return;
      m.preventDefault(), m.stopPropagation();
      const v = [];
      if (_ instanceof Uh && _.menuKeybinding)
        v.push(_.menuKeybinding);
      else if (!(_ instanceof Mx || _ instanceof G4)) {
        const R = !!this._keybindingService.lookupKeybinding(_.id);
        v.push(L5e(this._commandService, this._keybindingService, _.id, void 0, R));
      }
      if (o.length > 0) {
        let R = !1;
        if (a === 1 && ((E = this._options) == null ? void 0 : E.hiddenItemStrategy) === 0) {
          R = !0;
          for (let M = 0; M < o.length; M++)
            if (o[M].checked) {
              o[M] = Ox({
                id: _.id,
                label: _.label,
                checked: !0,
                enabled: !1,
                run() {
                }
              });
              break;
            }
        }
        if (!R && (_ instanceof Uh || _ instanceof Mx)) {
          if (!_.hideActions)
            return;
          v.push(_.hideActions.hide);
        } else
          v.push(Ox({
            id: "label",
            label: S(1634, "Hide"),
            enabled: !1,
            run() {
            }
          }));
      }
      const w = fa.join(v, o);
      (L = this._options) != null && L.resetMenu && !n && (n = [this._options.resetMenu]), c && n && (w.push(new fa()), w.push(Ox({
        id: "resetThisMenu",
        label: S(1635, "Reset Menu"),
        run: () => this._menuService.resetHiddenStates(n)
      }))), w.length !== 0 && this._contextMenuService.showContextMenu({
        getAnchor: () => m,
        getActions: () => w,
        // add context menu actions (iff appicable)
        menuId: (T = this._options) == null ? void 0 : T.contextMenu,
        menuActionOptions: { renderShortTitle: !0, ...(D = this._options) == null ? void 0 : D.menuOptions },
        skipTelemetry: typeof ((N = this._options) == null ? void 0 : N.telemetrySource) == "string",
        contextKeyService: this._contextKeyService
      });
    }));
  }
};
zU = k5e([
  Th(2, eg),
  Th(3, Jt),
  Th(4, Qh),
  Th(5, Fi),
  Th(6, jr),
  Th(7, rc)
], zU);
let q4 = class extends zU {
  get onDidChangeMenuItems() {
    return this._onDidChangeMenuItems.event;
  }
  constructor(e, t, n, r, s, o, a, l, c, u, d) {
    super(e, {
      resetMenu: t,
      ...n,
      actionViewItemProvider: (m, _) => {
        let v = u.lookUp(t, m instanceof Mx ? m.item.submenu.id : m.id);
        v || (v = n == null ? void 0 : n.actionViewItemProvider);
        const w = v == null ? void 0 : v(m, _, d, At(e).vscodeWindowId);
        return w || Oge(d, m, _);
      }
    }, r, s, o, a, l, c), this._onDidChangeMenuItems = this._store.add(new he());
    const h = this._store.add(r.createMenu(t, s, { emitEventsForSubmenuChanges: !0, eventDebounceDelay: n == null ? void 0 : n.eventDebounceDelay })), g = () => {
      var v, w, E;
      const { primary: m, secondary: _ } = S5e(h.getActions(n == null ? void 0 : n.menuOptions), (v = n == null ? void 0 : n.toolbarOptions) == null ? void 0 : v.primaryGroup, (w = n == null ? void 0 : n.toolbarOptions) == null ? void 0 : w.shouldInlineSubmenu, (E = n == null ? void 0 : n.toolbarOptions) == null ? void 0 : E.useSeparatorsInPrimaryActions);
      e.classList.toggle("has-no-actions", m.length === 0 && _.length === 0), super.setActions(m, _);
    };
    this._store.add(h.onDidChange(() => {
      g(), this._onDidChangeMenuItems.fire(this);
    })), this._store.add(u.onDidChange((m) => {
      m === t && g();
    })), g();
  }
  /**
   * @deprecated The WorkbenchToolBar does not support this method because it works with menus.
   */
  setActions() {
    throw new Wt("This toolbar is populated from a menu.");
  }
};
q4 = k5e([
  Th(3, eg),
  Th(4, Jt),
  Th(5, Qh),
  Th(6, Fi),
  Th(7, jr),
  Th(8, rc),
  Th(9, T5e),
  Th(10, xt)
], q4);
var Byt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, eDe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const od = Vn("hoverService");
let cA = class extends ge {
  get delay() {
    var e;
    return this.isInstantlyHovering() ? 0 : (e = this.hoverOptions) != null && e.dynamicDelay ? (t) => {
      var n, r;
      return ((r = (n = this.hoverOptions) == null ? void 0 : n.dynamicDelay) == null ? void 0 : r.call(n, t)) ?? this._delay;
    } : this._delay;
  }
  constructor(e, t, n = {}, r, s) {
    super(), this.placement = e, this.hoverOptions = t, this.overrideOptions = n, this.configurationService = r, this.hoverService = s, this.lastHoverHideTime = 0, this.timeLimit = 200, this.hoverDisposables = this._register(new ke()), this._delay = this.configurationService.getValue("workbench.hover.delay"), this._register(this.configurationService.onDidChangeConfiguration((o) => {
      o.affectsConfiguration("workbench.hover.delay") && (this._delay = this.configurationService.getValue("workbench.hover.delay"));
    }));
  }
  showHover(e, t) {
    const n = typeof this.overrideOptions == "function" ? this.overrideOptions(e, t) : this.overrideOptions;
    this.hoverDisposables.clear();
    const r = eo(e.target) ? [e.target] : e.target.targetElements;
    for (const o of r)
      this.hoverDisposables.add(vo(o, "keydown", (a) => {
        a.equals(
          9
          /* KeyCode.Escape */
        ) && this.hoverService.hideHover();
      }));
    const s = eo(e.content) ? void 0 : typeof e.content == "string" ? e.content.toString() : e.content.value;
    return this.hoverService.showInstantHover({
      ...e,
      ...n,
      persistence: {
        hideOnKeyDown: !0,
        ...n.persistence
      },
      id: s,
      appearance: {
        ...e.appearance,
        compact: !0,
        skipFadeInAnimation: this.isInstantlyHovering(),
        ...n.appearance
      }
    }, t);
  }
  isInstantlyHovering() {
    var e;
    return !!((e = this.hoverOptions) != null && e.instantHover) && Date.now() - this.lastHoverHideTime < this.timeLimit;
  }
  onDidHideHover() {
    var e;
    this.hoverDisposables.clear(), (e = this.hoverOptions) != null && e.instantHover && (this.lastHoverHideTime = Date.now());
  }
};
cA = Byt([
  eDe(3, xn),
  eDe(4, od)
], cA);
const Hyt = {
  showHover: function() {
    throw new Error("Native hover function not implemented.");
  },
  delay: 0,
  showNativeHover: !0
};
class gT extends Ufe {
  constructor(e) {
    super(), this._textModel = e;
  }
  getValueOfRange(e) {
    return this._textModel.getValueInRange(e);
  }
  getLineLength(e) {
    return this._textModel.getLineLength(e);
  }
  get length() {
    const e = this._textModel.getLineCount(), t = this._textModel.getLineLength(e);
    return new ta(e - 1, t);
  }
}
class D5e extends nT {
  constructor(e) {
    super(), this._getContext = e;
  }
  runAction(e, t) {
    const n = this._getContext();
    return super.runAction(e, n);
  }
}
class Wyt extends ge {
  constructor(e, t, n) {
    super(), this._editor = e, this._domNode = t, this.itemProvider = n, this.scrollTop = ji(this, this._editor.onDidScrollChange, (o) => (
      /** @description editor.onDidScrollChange */
      this._editor.getScrollTop()
    )), this.isScrollTopZero = this.scrollTop.map((o) => (
      /** @description isScrollTopZero */
      o === 0
    )), this.modelAttached = ji(this, this._editor.onDidChangeModel, (o) => (
      /** @description editor.onDidChangeModel */
      this._editor.hasModel()
    )), this.editorOnDidChangeViewZones = Dd("onDidChangeViewZones", this._editor.onDidChangeViewZones), this.editorOnDidContentSizeChange = Dd("onDidContentSizeChange", this._editor.onDidContentSizeChange), this.domNodeSizeChanged = Nf("domNodeSizeChanged"), this.views = /* @__PURE__ */ new Map(), this._domNode.className = "gutter monaco-editor";
    const r = this._domNode.appendChild(Li("div.scroll-decoration", { role: "presentation", ariaHidden: "true", style: { width: "100%" } }).root), s = new ResizeObserver(() => {
      Fr((o) => {
        this.domNodeSizeChanged.trigger(o);
      });
    });
    s.observe(this._domNode), this._register(Et(() => s.disconnect())), this._register(Xt((o) => {
      r.className = this.isScrollTopZero.read(o) ? "" : "scroll-decoration";
    })), this._register(Xt((o) => (
      /** @description EditorGutter.Render */
      this.render(o)
    )));
  }
  dispose() {
    super.dispose(), ma(this._domNode);
  }
  render(e) {
    if (!this.modelAttached.read(e))
      return;
    this.domNodeSizeChanged.read(e), this.editorOnDidChangeViewZones.read(e), this.editorOnDidContentSizeChange.read(e);
    const t = this.scrollTop.read(e), n = this._editor.getVisibleRanges(), r = new Set(this.views.keys()), s = Tt.ofStartAndLength(0, this._domNode.clientHeight);
    if (!s.isEmpty)
      for (const o of n) {
        const a = new Zt(o.startLineNumber, o.endLineNumber + 1), l = this.itemProvider.getIntersectingGutterItems(a, e);
        Fr((c) => {
          for (const u of l) {
            if (!u.range.intersect(a))
              continue;
            r.delete(u.id);
            let d = this.views.get(u.id);
            if (d)
              d.item.set(u, c);
            else {
              const _ = document.createElement("div");
              this._domNode.appendChild(_);
              const v = Qt("item", u), w = this.itemProvider.createView(v, _);
              d = new Vyt(v, w, _), this.views.set(u.id, d);
            }
            const h = u.range.startLineNumber <= this._editor.getModel().getLineCount() ? this._editor.getTopForLineNumber(u.range.startLineNumber, !0) - t : u.range.startLineNumber > 1 ? this._editor.getBottomForLineNumber(u.range.startLineNumber - 1, !1) - t : 0, m = (u.range.endLineNumberExclusive === 1 ? Math.max(h, this._editor.getTopForLineNumber(u.range.startLineNumber, !1) - t) : Math.max(h, this._editor.getBottomForLineNumber(u.range.endLineNumberExclusive - 1, !0) - t)) - h;
            d.domNode.style.top = `${h}px`, d.domNode.style.height = `${m}px`, d.gutterItemView.layout(Tt.ofStartAndLength(h, m), s);
          }
        });
      }
    for (const o of r) {
      const a = this.views.get(o);
      a.gutterItemView.dispose(), a.domNode.remove(), this.views.delete(o);
    }
  }
}
class Vyt {
  constructor(e, t, n) {
    this.item = e, this.gutterItemView = t, this.domNode = n;
  }
}
var I5e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, FW = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const Wee = [], sH = 35;
let wse = class extends ge {
  constructor(e, t, n, r, s, o, a, l, c) {
    super(), this._diffModel = t, this._editors = n, this._options = r, this._sashLayout = s, this._boundarySashes = o, this._instantiationService = a, this._contextKeyService = l, this._menuService = c, this._menu = this._register(this._menuService.createMenu(wt.DiffEditorHunkToolbar, this._contextKeyService)), this._actions = ji(this, this._menu.onDidChange, () => this._menu.getActions()), this._hasActions = this._actions.map((d) => d.length > 0), this._showSash = Ie(this, (d) => this._options.renderSideBySide.read(d) && this._hasActions.read(d)), this.width = Ie(this, (d) => this._hasActions.read(d) ? sH : 0), this.elements = Li("div.gutter@gutter", { style: { position: "absolute", height: "100%", width: sH + "px" } }, []), this._currentDiff = Ie(this, (d) => {
      var _;
      const h = this._diffModel.read(d);
      if (!h)
        return;
      const g = (_ = h.diff.read(d)) == null ? void 0 : _.mappings, m = this._editors.modifiedCursor.read(d);
      if (m)
        return g == null ? void 0 : g.find((v) => v.lineRangeMapping.modified.contains(m.lineNumber));
    }), this._selectedDiffs = Ie(this, (d) => {
      const h = this._diffModel.read(d), g = h == null ? void 0 : h.diff.read(d);
      if (!g)
        return Wee;
      const m = this._editors.modifiedSelections.read(d);
      if (m.every((E) => E.isEmpty()))
        return Wee;
      const _ = new Mf(m.map((E) => Zt.fromRangeInclusive(E))), w = g.mappings.filter((E) => E.lineRangeMapping.innerChanges && _.intersects(E.lineRangeMapping.modified)).map((E) => ({
        mapping: E,
        rangeMappings: E.lineRangeMapping.innerChanges.filter((L) => m.some((T) => z.areIntersecting(L.modifiedRange, T)))
      }));
      return w.length === 0 || w.every((E) => E.rangeMappings.length === 0) ? Wee : w;
    }), this._register(tvt(e, this.elements.root)), this._register(Ce(this.elements.root, "click", () => {
      this._editors.modified.focus();
    })), this._register(dw(this.elements.root, { display: this._hasActions.map((d) => d ? "block" : "none") })), xf(this, (d) => this._showSash.read(d) ? new v5e(e, this._sashLayout.dimensions, this._options.enableSplitViewResizing, this._boundarySashes, Xhe(this, (g) => this._sashLayout.sashLeft.read(g) - sH, (g, m) => this._sashLayout.sashLeft.set(g + sH, m)), () => this._sashLayout.resetSash()) : void 0).recomputeInitiallyAndOnChange(this._store);
    const u = Ie(this, (d) => {
      const h = this._diffModel.read(d);
      if (!h)
        return [];
      const g = h.diff.read(d);
      if (!g)
        return [];
      const m = this._selectedDiffs.read(d);
      if (m.length > 0) {
        const v = jh.fromRangeMappings(m.flatMap((w) => w.rangeMappings));
        return [
          new tDe(v, !0, wt.DiffEditorSelectionToolbar, void 0, h.model.original.uri, h.model.modified.uri)
        ];
      }
      const _ = this._currentDiff.read(d);
      return g.mappings.map((v) => new tDe(v.lineRangeMapping.withInnerChangesFromLineRanges(), v.lineRangeMapping === (_ == null ? void 0 : _.lineRangeMapping), wt.DiffEditorHunkToolbar, void 0, h.model.original.uri, h.model.modified.uri));
    });
    this._register(new Wyt(this._editors.modified, this.elements.root, {
      getIntersectingGutterItems: (d, h) => u.read(h),
      createView: (d, h) => this._instantiationService.createInstance(Sse, d, h, this)
    })), this._register(Ce(this.elements.gutter, Xe.MOUSE_WHEEL, (d) => {
      this._editors.modified.getOption(
        117
        /* EditorOption.scrollbar */
      ).handleMouseWheel && this._editors.modified.delegateScrollFromMouseWheelEvent(d);
    }, { passive: !1 }));
  }
  computeStagedValue(e) {
    const t = e.innerChanges ?? [], n = new gT(this._editors.modifiedModel.get()), r = new gT(this._editors.original.getModel());
    return new Md(t.map((a) => a.toTextEdit(n))).apply(r);
  }
  layout(e) {
    this.elements.gutter.style.left = e + "px";
  }
};
wse = I5e([
  FW(6, xt),
  FW(7, Jt),
  FW(8, eg)
], wse);
class tDe {
  constructor(e, t, n, r, s, o) {
    this.mapping = e, this.showAlways = t, this.menuId = n, this.rangeOverride = r, this.originalUri = s, this.modifiedUri = o;
  }
  get id() {
    return this.mapping.modified.toString();
  }
  get range() {
    return this.rangeOverride ?? this.mapping.modified;
  }
}
let Sse = class extends ge {
  constructor(e, t, n, r) {
    super(), this._item = e, this._elements = Li("div.gutterItem", { style: { height: "20px", width: "34px" } }, [
      Li("div.background@background", {}, []),
      Li("div.buttons@buttons", {}, [])
    ]), this._showAlways = this._item.map(this, (o) => o.showAlways), this._menuId = this._item.map(this, (o) => o.menuId), this._isSmall = Qt(this, !1), this._lastItemRange = void 0, this._lastViewRange = void 0;
    const s = this._register(r.createInstance(cA, "element", { instantHover: !0 }, { position: {
      hoverPosition: 1
      /* HoverPosition.RIGHT */
    } }));
    this._register(hN(t, this._elements.root)), this._register(Xt((o) => {
      const a = this._showAlways.read(o);
      this._elements.root.classList.toggle("noTransition", !0), this._elements.root.classList.toggle("showAlways", a), setTimeout(() => {
        this._elements.root.classList.toggle("noTransition", !1);
      }, 0);
    })), this._register(Ql((o, a) => {
      this._elements.buttons.replaceChildren();
      const l = a.add(r.createInstance(q4, this._elements.buttons, this._menuId.read(o), {
        orientation: 1,
        hoverDelegate: s,
        toolbarOptions: {
          primaryGroup: (c) => c.startsWith("primary")
        },
        overflowBehavior: { maxItems: this._isSmall.read(o) ? 1 : 3 },
        hiddenItemStrategy: 0,
        actionRunner: a.add(new D5e(() => {
          const c = this._item.read(void 0), u = c.mapping;
          return {
            mapping: u,
            originalWithModifiedChanges: n.computeStagedValue(u),
            originalUri: c.originalUri,
            modifiedUri: c.modifiedUri
          };
        })),
        menuOptions: {
          shouldForwardArgs: !0
        }
      }));
      a.add(l.onDidChangeMenuItems(() => {
        this._lastItemRange && this.layout(this._lastItemRange, this._lastViewRange);
      }));
    }));
  }
  layout(e, t) {
    this._lastItemRange = e, this._lastViewRange = t;
    let n = this._elements.buttons.clientHeight;
    this._isSmall.set(this._item.get().mapping.original.startLineNumber === 1 && e.length < 30, void 0), n = this._elements.buttons.clientHeight;
    const r = e.length / 2 - n / 2, s = n;
    let o = e.start + r;
    const a = Tt.tryCreate(s, t.endExclusive - s - n), l = Tt.tryCreate(e.start + s, e.endExclusive - n - s);
    l && a && l.start < l.endExclusive && (o = a.clip(o), o = l.clip(o)), this._elements.buttons.style.top = `${o - e.start}px`;
  }
};
Sse = I5e([
  FW(3, xt)
], Sse);
var Uyt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, zyt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, BW, nL;
let $U = (nL = class extends ge {
  static setBreadcrumbsSourceFactory(e) {
    this._breadcrumbsSourceFactory.set(e, void 0);
  }
  get isUpdatingHiddenAreas() {
    return this._isUpdatingHiddenAreas;
  }
  constructor(e, t, n, r) {
    super(), this._editors = e, this._diffModel = t, this._options = n, this._instantiationService = r, this._modifiedOutlineSource = xf(this, (l) => {
      const c = this._editors.modifiedModel.read(l), u = BW._breadcrumbsSourceFactory.read(l);
      return !c || !u ? void 0 : u(c, this._instantiationService);
    }), this._isUpdatingHiddenAreas = !1, this._register(this._editors.original.onDidChangeCursorPosition((l) => {
      if (l.reason === 1)
        return;
      const c = this._diffModel.get();
      Fr((u) => {
        for (const d of this._editors.original.getSelections() || [])
          c == null || c.ensureOriginalLineIsVisible(d.getStartPosition().lineNumber, 0, u), c == null || c.ensureOriginalLineIsVisible(d.getEndPosition().lineNumber, 0, u);
      });
    })), this._register(this._editors.modified.onDidChangeCursorPosition((l) => {
      if (l.reason === 1)
        return;
      const c = this._diffModel.get();
      Fr((u) => {
        for (const d of this._editors.modified.getSelections() || [])
          c == null || c.ensureModifiedLineIsVisible(d.getStartPosition().lineNumber, 0, u), c == null || c.ensureModifiedLineIsVisible(d.getEndPosition().lineNumber, 0, u);
      });
    }));
    const s = this._diffModel.map((l, c) => {
      var d;
      const u = (l == null ? void 0 : l.unchangedRegions.read(c)) ?? [];
      return u.length === 1 && u[0].modifiedLineNumber === 1 && u[0].lineCount === ((d = this._editors.modifiedModel.read(c)) == null ? void 0 : d.getLineCount()) ? [] : u;
    });
    this.viewZones = Ie(this, (l) => {
      const c = this._modifiedOutlineSource.read(l);
      if (!c)
        return { origViewZones: [], modViewZones: [] };
      const u = [], d = [], h = this._options.renderSideBySide.read(l), g = this._options.compactMode.read(l), m = s.read(l);
      for (let _ = 0; _ < m.length; _++) {
        const v = m[_];
        if (!v.shouldHideControls(l) && !(g && (_ === 0 || _ === m.length - 1)))
          if (g) {
            {
              const w = Ie(this, (L) => (
                /** @description hiddenOriginalRangeStart */
                v.getHiddenOriginalRange(L).startLineNumber - 1
              )), E = new fN(w, 12);
              u.push(E), l.store.add(new nDe(this._editors.original, E, v, !h));
            }
            {
              const w = Ie(this, (L) => (
                /** @description hiddenModifiedRangeStart */
                v.getHiddenModifiedRange(L).startLineNumber - 1
              )), E = new fN(w, 12);
              d.push(E), l.store.add(new nDe(this._editors.modified, E, v));
            }
          } else {
            {
              const w = Ie(this, (L) => (
                /** @description hiddenOriginalRangeStart */
                v.getHiddenOriginalRange(L).startLineNumber - 1
              )), E = new fN(w, 24);
              u.push(E), l.store.add(new iDe(this._editors.original, E, v, v.originalUnchangedRange, !h, c, (L) => this._diffModel.get().ensureModifiedLineIsVisible(L, 2, void 0), this._options));
            }
            {
              const w = Ie(this, (L) => (
                /** @description hiddenModifiedRangeStart */
                v.getHiddenModifiedRange(L).startLineNumber - 1
              )), E = new fN(w, 24);
              d.push(E), l.store.add(new iDe(this._editors.modified, E, v, v.modifiedUnchangedRange, !1, c, (L) => this._diffModel.get().ensureModifiedLineIsVisible(L, 2, void 0), this._options));
            }
          }
      }
      return { origViewZones: u, modViewZones: d };
    });
    const o = {
      description: "unchanged lines",
      className: "diff-unchanged-lines",
      isWholeLine: !0
    }, a = {
      description: "Fold Unchanged",
      glyphMarginHoverMessage: new ql(void 0, { isTrusted: !0, supportThemeIcons: !0 }).appendMarkdown(S(121, "Fold Unchanged Region")),
      glyphMarginClassName: "fold-unchanged " + qt.asClassName(Pe.fold),
      zIndex: 10001
    };
    this._register(IU(this._editors.original, Ie(this, (l) => {
      const c = s.read(l), u = c.map((d) => ({
        range: d.originalUnchangedRange.toInclusiveRange(),
        options: o
      }));
      for (const d of c)
        d.shouldHideControls(l) && u.push({
          range: z.fromPositions(new de(d.originalLineNumber, 1)),
          options: a
        });
      return u;
    }))), this._register(IU(this._editors.modified, Ie(this, (l) => {
      const c = s.read(l), u = c.map((d) => ({
        range: d.modifiedUnchangedRange.toInclusiveRange(),
        options: o
      }));
      for (const d of c)
        d.shouldHideControls(l) && u.push({
          range: Zt.ofLength(d.modifiedLineNumber, 1).toInclusiveRange(),
          options: a
        });
      return u;
    }))), this._register(Xt((l) => {
      const c = s.read(l);
      this._isUpdatingHiddenAreas = !0;
      try {
        this._editors.original.setHiddenAreas(c.map((u) => u.getHiddenOriginalRange(l).toInclusiveRange()).filter(Aa)), this._editors.modified.setHiddenAreas(c.map((u) => u.getHiddenModifiedRange(l).toInclusiveRange()).filter(Aa));
      } finally {
        this._isUpdatingHiddenAreas = !1;
      }
    })), this._register(this._editors.modified.onMouseUp((l) => {
      var c;
      if (!l.event.rightButton && l.target.position && ((c = l.target.element) != null && c.className.includes("fold-unchanged"))) {
        const u = l.target.position.lineNumber, d = this._diffModel.get();
        if (!d)
          return;
        const h = d.unchangedRegions.get().find((g) => g.modifiedUnchangedRange.contains(u));
        if (!h)
          return;
        h.collapseAll(void 0), l.event.stopPropagation(), l.event.preventDefault();
      }
    })), this._register(this._editors.original.onMouseUp((l) => {
      var c;
      if (!l.event.rightButton && l.target.position && ((c = l.target.element) != null && c.className.includes("fold-unchanged"))) {
        const u = l.target.position.lineNumber, d = this._diffModel.get();
        if (!d)
          return;
        const h = d.unchangedRegions.get().find((g) => g.originalUnchangedRange.contains(u));
        if (!h)
          return;
        h.collapseAll(void 0), l.event.stopPropagation(), l.event.preventDefault();
      }
    }));
  }
}, BW = nL, nL._breadcrumbsSourceFactory = Qt(BW, () => ({
  dispose() {
  },
  getBreadcrumbItems(e, t) {
    return [];
  }
})), nL);
$U = BW = Uyt([
  zyt(3, xt)
], $U);
class nDe extends Sge {
  constructor(e, t, n, r = !1) {
    const s = Li("div.diff-hidden-lines-widget");
    super(e, t, s.root), this._unchangedRegion = n, this._hide = r, this._nodes = Li("div.diff-hidden-lines-compact", [
      Li("div.line-left", []),
      Li("div.text@text", []),
      Li("div.line-right", [])
    ]), s.root.appendChild(this._nodes.root), this._hide && this._nodes.root.replaceChildren(), this._register(Xt((o) => {
      if (!this._hide) {
        const a = this._unchangedRegion.getHiddenModifiedRange(o).length, l = S(122, "{0} hidden lines", a);
        this._nodes.text.innerText = l;
      }
    }));
  }
}
class iDe extends Sge {
  constructor(e, t, n, r, s, o, a, l) {
    const c = Li("div.diff-hidden-lines-widget");
    super(e, t, c.root), this._editor = e, this._unchangedRegion = n, this._unchangedRegionRange = r, this._hide = s, this._modifiedOutlineSource = o, this._revealModifiedHiddenLine = a, this._options = l, this._nodes = Li("div.diff-hidden-lines", [
      Li("div.top@top", { title: S(123, "Click or drag to show more above") }),
      Li("div.center@content", { style: { display: "flex" } }, [
        Li("div@first", { style: { display: "flex", justifyContent: "center", alignItems: "center", flexShrink: "0" } }, [Ge("a", { title: S(124, "Show Unchanged Region"), role: "button", onclick: () => {
          this._unchangedRegion.showAll(void 0);
        } }, ...D1("$(unfold)"))]),
        Li("div@others", { style: { display: "flex", justifyContent: "center", alignItems: "center" } })
      ]),
      Li("div.bottom@bottom", { title: S(125, "Click or drag to show more below"), role: "button" })
    ]), c.root.appendChild(this._nodes.root), this._hide ? ma(this._nodes.first) : this._register(dw(this._nodes.first, { width: Ms(this._editor).layoutInfoContentLeft })), this._register(Xt((d) => {
      const h = this._unchangedRegion.visibleLineCountTop.read(d) + this._unchangedRegion.visibleLineCountBottom.read(d) === this._unchangedRegion.lineCount;
      this._nodes.bottom.classList.toggle("canMoveTop", !h), this._nodes.bottom.classList.toggle("canMoveBottom", this._unchangedRegion.visibleLineCountBottom.read(d) > 0), this._nodes.top.classList.toggle("canMoveTop", this._unchangedRegion.visibleLineCountTop.read(d) > 0), this._nodes.top.classList.toggle("canMoveBottom", !h);
      const g = this._unchangedRegion.isDragged.read(d), m = this._editor.getDomNode();
      m && (m.classList.toggle("draggingUnchangedRegion", !!g), g === "top" ? (m.classList.toggle("canMoveTop", this._unchangedRegion.visibleLineCountTop.read(d) > 0), m.classList.toggle("canMoveBottom", !h)) : g === "bottom" ? (m.classList.toggle("canMoveTop", !h), m.classList.toggle("canMoveBottom", this._unchangedRegion.visibleLineCountBottom.read(d) > 0)) : (m.classList.toggle("canMoveTop", !1), m.classList.toggle("canMoveBottom", !1)));
    }));
    const u = this._editor;
    this._register(Ce(this._nodes.top, "mousedown", (d) => {
      if (d.button !== 0)
        return;
      this._nodes.top.classList.toggle("dragging", !0), this._nodes.root.classList.toggle("dragging", !0), d.preventDefault();
      const h = d.clientY;
      let g = !1;
      const m = this._unchangedRegion.visibleLineCountTop.get();
      this._unchangedRegion.isDragged.set("top", void 0);
      const _ = At(this._nodes.top), v = Ce(_, "mousemove", (E) => {
        const T = E.clientY - h;
        g = g || Math.abs(T) > 2;
        const D = Math.round(T / u.getOption(
          75
          /* EditorOption.lineHeight */
        )), N = Math.max(0, Math.min(m + D, this._unchangedRegion.getMaxVisibleLineCountTop()));
        this._unchangedRegion.visibleLineCountTop.set(N, void 0);
      }), w = Ce(_, "mouseup", (E) => {
        g || this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(), void 0), this._nodes.top.classList.toggle("dragging", !1), this._nodes.root.classList.toggle("dragging", !1), this._unchangedRegion.isDragged.set(void 0, void 0), v.dispose(), w.dispose();
      });
    })), this._register(Ce(this._nodes.bottom, "mousedown", (d) => {
      if (d.button !== 0)
        return;
      this._nodes.bottom.classList.toggle("dragging", !0), this._nodes.root.classList.toggle("dragging", !0), d.preventDefault();
      const h = d.clientY;
      let g = !1;
      const m = this._unchangedRegion.visibleLineCountBottom.get();
      this._unchangedRegion.isDragged.set("bottom", void 0);
      const _ = At(this._nodes.bottom), v = Ce(_, "mousemove", (E) => {
        const T = E.clientY - h;
        g = g || Math.abs(T) > 2;
        const D = Math.round(T / u.getOption(
          75
          /* EditorOption.lineHeight */
        )), N = Math.max(0, Math.min(m - D, this._unchangedRegion.getMaxVisibleLineCountBottom())), R = this._unchangedRegionRange.endLineNumberExclusive > u.getModel().getLineCount() ? u.getContentHeight() : u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
        this._unchangedRegion.visibleLineCountBottom.set(N, void 0);
        const M = this._unchangedRegionRange.endLineNumberExclusive > u.getModel().getLineCount() ? u.getContentHeight() : u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
        u.setScrollTop(u.getScrollTop() + (M - R));
      }), w = Ce(_, "mouseup", (E) => {
        if (this._unchangedRegion.isDragged.set(void 0, void 0), !g) {
          const L = u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
          this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(), void 0);
          const T = u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
          u.setScrollTop(u.getScrollTop() + (T - L));
        }
        this._nodes.bottom.classList.toggle("dragging", !1), this._nodes.root.classList.toggle("dragging", !1), v.dispose(), w.dispose();
      });
    })), this._register(Xt((d) => {
      const h = [];
      if (!this._hide) {
        const g = n.getHiddenModifiedRange(d).length, m = S(126, "{0} hidden lines", g), _ = Ge("span", { title: S(127, "Double click to unfold") }, m);
        _.addEventListener("dblclick", (E) => {
          E.button === 0 && (E.preventDefault(), this._unchangedRegion.showAll(void 0));
        }), h.push(_);
        const v = this._unchangedRegion.getHiddenModifiedRange(d), w = this._modifiedOutlineSource.getBreadcrumbItems(v, d);
        if (w.length > 0) {
          h.push(Ge("span", void 0, "  |  "));
          for (let E = 0; E < w.length; E++) {
            const L = w[E], T = dU.toIcon(L.kind), D = Li("div.breadcrumb-item", {
              style: { display: "flex", alignItems: "center" }
            }, [
              _b(T),
              " ",
              L.name,
              ...E === w.length - 1 ? [] : [_b(Pe.chevronRight)]
            ]).root;
            h.push(D), D.onclick = () => {
              this._revealModifiedHiddenLine(L.startLineNumber);
            };
          }
        }
      }
      ma(this._nodes.others, ...h);
    }));
  }
}
const Vee = [];
class $yt extends ge {
  constructor(e, t, n, r) {
    super(), this._editors = e, this._diffModel = t, this._options = n, this._widget = r, this._selectedDiffs = Ie(this, (s) => {
      const o = this._diffModel.read(s), a = o == null ? void 0 : o.diff.read(s);
      if (!a)
        return Vee;
      const l = this._editors.modifiedSelections.read(s);
      if (l.every((h) => h.isEmpty()))
        return Vee;
      const c = new Mf(l.map((h) => Zt.fromRangeInclusive(h))), d = a.mappings.filter((h) => h.lineRangeMapping.innerChanges && c.intersects(h.lineRangeMapping.modified)).map((h) => ({
        mapping: h,
        rangeMappings: h.lineRangeMapping.innerChanges.filter((g) => l.some((m) => z.areIntersecting(g.modifiedRange, m)))
      }));
      return d.length === 0 || d.every((h) => h.rangeMappings.length === 0) ? Vee : d;
    }), this._register(Ql((s, o) => {
      if (!this._options.shouldRenderOldRevertArrows.read(s))
        return;
      const a = this._diffModel.read(s), l = a == null ? void 0 : a.diff.read(s);
      if (!a || !l || a.movedTextToCompare.read(s))
        return;
      const c = [], u = this._selectedDiffs.read(s), d = new Set(u.map((h) => h.mapping));
      if (u.length > 0) {
        const h = this._editors.modifiedSelections.read(s), g = o.add(new jU(h[h.length - 1].positionLineNumber, this._widget, u.flatMap((m) => m.rangeMappings), !0));
        this._editors.modified.addGlyphMarginWidget(g), c.push(g);
      }
      for (const h of l.mappings)
        if (!d.has(h) && !h.lineRangeMapping.modified.isEmpty && h.lineRangeMapping.innerChanges) {
          const g = o.add(new jU(h.lineRangeMapping.modified.startLineNumber, this._widget, h.lineRangeMapping, !1));
          this._editors.modified.addGlyphMarginWidget(g), c.push(g);
        }
      o.add(Et(() => {
        for (const h of c)
          this._editors.modified.removeGlyphMarginWidget(h);
      }));
    }));
  }
}
const iG = class iG extends ge {
  getId() {
    return this._id;
  }
  constructor(e, t, n, r) {
    super(), this._lineNumber = e, this._widget = t, this._diffs = n, this._revertSelection = r, this._id = `revertButton${iG.counter++}`, this._domNode = Li("div.revertButton", {
      title: this._revertSelection ? S(132, "Revert Selected Changes") : S(133, "Revert Change")
    }, [_b(Pe.arrowRight)]).root, this._register(Ce(this._domNode, Xe.MOUSE_DOWN, (s) => {
      s.button !== 2 && (s.stopPropagation(), s.preventDefault());
    })), this._register(Ce(this._domNode, Xe.MOUSE_UP, (s) => {
      s.stopPropagation(), s.preventDefault();
    })), this._register(Ce(this._domNode, Xe.CLICK, (s) => {
      this._diffs instanceof wc ? this._widget.revert(this._diffs) : this._widget.revertRangeMappings(this._diffs), s.stopPropagation(), s.preventDefault();
    }));
  }
  /**
   * Get the dom node of the glyph widget.
   */
  getDomNode() {
    return this._domNode;
  }
  /**
   * Get the placement of the glyph widget.
   */
  getPosition() {
    return {
      lane: fm.Right,
      range: {
        startColumn: 1,
        startLineNumber: this._lineNumber,
        endColumn: 1,
        endLineNumber: this._lineNumber
      },
      zIndex: 10001
    };
  }
};
iG.counter = 0;
let jU = iG;
var jyt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, nP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let bb = class extends fse {
  get onDidContentSizeChange() {
    return this._editors.onDidContentSizeChange;
  }
  constructor(e, t, n, r, s, o, a, l) {
    super(), this._domElement = e, this._parentContextKeyService = r, this._parentInstantiationService = s, this._accessibilitySignalService = a, this._editorProgressService = l, this.elements = Li("div.monaco-diff-editor.side-by-side", { style: { position: "relative", height: "100%" } }, [
      Li("div.editor.original@original", { style: { position: "absolute", height: "100%" } }),
      Li("div.editor.modified@modified", { style: { position: "absolute", height: "100%" } }),
      Li("div.accessibleDiffViewer@accessibleDiffViewer", { style: { position: "absolute", height: "100%" } })
    ]), this._diffModelSrc = this._register(Yhe(this, void 0)), this._diffModel = Ie(this, (T) => {
      var D;
      return (D = this._diffModelSrc.read(T)) == null ? void 0 : D.object;
    }), this.onDidChangeModel = Ze.fromObservableLight(this._diffModel), this._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._domElement)), this._instantiationService = this._register(this._parentInstantiationService.createChild(new r2([Jt, this._contextKeyService]))), this._boundarySashes = Qt(this, void 0), this._accessibleDiffViewerShouldBeVisible = Qt(this, !1), this._accessibleDiffViewerVisible = Ie(this, (T) => this._options.onlyShowAccessibleDiffViewer.read(T) ? !0 : this._accessibleDiffViewerShouldBeVisible.read(T)), this._movedBlocksLinesPart = Qt(this, void 0), this._layoutInfo = Ie(this, (T) => {
      var oe, Z;
      const D = this._rootSizeObserver.width.read(T), N = this._rootSizeObserver.height.read(T);
      this._rootSizeObserver.automaticLayout ? this.elements.root.style.height = "100%" : this.elements.root.style.height = N + "px";
      const R = this._sash.read(T), M = this._gutter.read(T), B = (M == null ? void 0 : M.width.read(T)) ?? 0, H = ((oe = this._overviewRulerPart.read(T)) == null ? void 0 : oe.width) ?? 0;
      let j, K, X, Y, G;
      if (!!R) {
        const pe = R.sashLeft.read(T), J = ((Z = this._movedBlocksLinesPart.read(T)) == null ? void 0 : Z.width.read(T)) ?? 0;
        j = 0, K = pe - B - J, G = pe - B, X = pe, Y = D - X - H;
      } else {
        G = 0;
        const pe = this._options.inlineViewHideOriginalLineNumbers.read(T);
        j = B, pe ? K = 0 : K = Math.max(5, this._editors.originalObs.layoutInfoDecorationsLeft.read(T)), X = B + K, Y = D - X - H;
      }
      return this.elements.original.style.left = j + "px", this.elements.original.style.width = K + "px", this._editors.original.layout({ width: K, height: N }, !0), M == null || M.layout(G), this.elements.modified.style.left = X + "px", this.elements.modified.style.width = Y + "px", this._editors.modified.layout({ width: Y, height: N }, !0), {
        modifiedEditor: this._editors.modified.getLayoutInfo(),
        originalEditor: this._editors.original.getLayoutInfo()
      };
    }), this._diffValue = this._diffModel.map((T, D) => T == null ? void 0 : T.diff.read(D)), this.onDidUpdateDiff = Ze.fromObservableLight(this._diffValue), o.willCreateDiffEditor(), this._contextKeyService.createKey("isInDiffEditor", !0), this._domElement.appendChild(this.elements.root), this._register(Et(() => this.elements.root.remove())), this._rootSizeObserver = this._register(new l5e(this.elements.root, t.dimension)), this._rootSizeObserver.setAutomaticLayout(t.automaticLayout ?? !1), this._options = this._instantiationService.createInstance(gse, t), this._register(Xt((T) => {
      this._options.setWidth(this._rootSizeObserver.width.read(T));
    })), this._contextKeyService.createKey(se.isEmbeddedDiffEditor.key, !1), this._register(w_(se.isEmbeddedDiffEditor, this._contextKeyService, (T) => this._options.isInEmbeddedEditor.read(T))), this._register(w_(se.comparingMovedCode, this._contextKeyService, (T) => {
      var D;
      return !!((D = this._diffModel.read(T)) != null && D.movedTextToCompare.read(T));
    })), this._register(w_(se.diffEditorRenderSideBySideInlineBreakpointReached, this._contextKeyService, (T) => this._options.couldShowInlineViewBecauseOfSize.read(T))), this._register(w_(se.diffEditorInlineMode, this._contextKeyService, (T) => !this._options.renderSideBySide.read(T))), this._register(w_(se.hasChanges, this._contextKeyService, (T) => {
      var D, N;
      return (((N = (D = this._diffModel.read(T)) == null ? void 0 : D.diff.read(T)) == null ? void 0 : N.mappings.length) ?? 0) > 0;
    })), this._editors = this._register(this._instantiationService.createInstance(hse, this.elements.original, this.elements.modified, this._options, n, (T, D, N, R) => this._createInnerEditor(T, D, N, R))), this._register(w_(se.diffEditorOriginalWritable, this._contextKeyService, (T) => this._options.originalEditable.read(T))), this._register(w_(se.diffEditorModifiedWritable, this._contextKeyService, (T) => !this._options.readOnly.read(T))), this._register(w_(se.diffEditorOriginalUri, this._contextKeyService, (T) => {
      var D;
      return ((D = this._diffModel.read(T)) == null ? void 0 : D.model.original.uri.toString()) ?? "";
    })), this._register(w_(se.diffEditorModifiedUri, this._contextKeyService, (T) => {
      var D;
      return ((D = this._diffModel.read(T)) == null ? void 0 : D.model.modified.uri.toString()) ?? "";
    })), this._overviewRulerPart = xf(this, (T) => this._options.renderOverviewRuler.read(T) ? this._instantiationService.createInstance($v(j4), this._editors, this.elements.root, this._diffModel, this._rootSizeObserver.width, this._rootSizeObserver.height, this._layoutInfo.map((D) => D.modifiedEditor)) : void 0).recomputeInitiallyAndOnChange(this._store);
    const c = {
      height: this._rootSizeObserver.height,
      width: this._rootSizeObserver.width.map((T, D) => {
        var N;
        return T - (((N = this._overviewRulerPart.read(D)) == null ? void 0 : N.width) ?? 0);
      })
    };
    this._sashLayout = new ayt(this._options, c), this._sash = xf(this, (T) => {
      const D = this._options.renderSideBySide.read(T);
      return this.elements.root.classList.toggle("side-by-side", D), D ? new v5e(this.elements.root, c, this._options.enableSplitViewResizing, this._boundarySashes, this._sashLayout.sashLeft, () => this._sashLayout.resetSash()) : void 0;
    }).recomputeInitiallyAndOnChange(this._store);
    const u = xf(this, (T) => (
      /** @description UnchangedRangesFeature */
      this._instantiationService.createInstance($v($U), this._editors, this._diffModel, this._options)
    )).recomputeInitiallyAndOnChange(this._store);
    xf(this, (T) => (
      /** @description DiffEditorDecorations */
      this._instantiationService.createInstance($v(Qvt), this._editors, this._diffModel, this._options, this)
    )).recomputeInitiallyAndOnChange(this._store);
    const d = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set();
    let g = !1;
    const m = xf(this, (T) => (
      /** @description ViewZoneManager */
      this._instantiationService.createInstance($v(use), At(this._domElement), this._editors, this._diffModel, this._options, this, () => g || u.read(void 0).isUpdatingHiddenAreas, d, h)
    )).recomputeInitiallyAndOnChange(this._store), _ = Ie(this, (T) => {
      const D = m.read(T).viewZones.read(T).orig, N = u.read(T).viewZones.read(T).origViewZones;
      return D.concat(N);
    }), v = Ie(this, (T) => {
      const D = m.read(T).viewZones.read(T).mod, N = u.read(T).viewZones.read(T).modViewZones;
      return D.concat(N);
    });
    this._register(NU(this._editors.original, _, (T) => {
      g = T;
    }, d));
    let w;
    this._register(NU(this._editors.modified, v, (T) => {
      g = T, g ? w = mm.capture(this._editors.modified) : (w == null || w.restore(this._editors.modified), w = void 0);
    }, h)), this._accessibleDiffViewer = xf(this, (T) => this._instantiationService.createInstance($v(bx), this.elements.accessibleDiffViewer, this._accessibleDiffViewerVisible, (D, N) => this._accessibleDiffViewerShouldBeVisible.set(D, N), this._options.onlyShowAccessibleDiffViewer.map((D) => !D), this._rootSizeObserver.width, this._rootSizeObserver.height, this._diffModel.map((D, N) => {
      var R;
      return (R = D == null ? void 0 : D.diff.read(N)) == null ? void 0 : R.mappings.map((M) => M.lineRangeMapping);
    }), new wvt(this._editors))).recomputeInitiallyAndOnChange(this._store);
    const E = this._accessibleDiffViewerVisible.map((T) => T ? "hidden" : "visible");
    this._register(dw(this.elements.modified, { visibility: E })), this._register(dw(this.elements.original, { visibility: E })), this._createDiffEditorContributions(), o.addDiffEditor(this), this._gutter = xf(this, (T) => this._options.shouldRenderGutterMenu.read(T) ? this._instantiationService.createInstance($v(wse), this.elements.root, this._diffModel, this._editors, this._options, this._sashLayout, this._boundarySashes) : void 0), this._register(GR(this._layoutInfo)), xf(this, (T) => (
      /** @description MovedBlocksLinesPart */
      new ($v(rR))(this.elements.root, this._diffModel, this._layoutInfo.map((D) => D.originalEditor), this._layoutInfo.map((D) => D.modifiedEditor), this._editors)
    )).recomputeInitiallyAndOnChange(this._store, (T) => {
      this._movedBlocksLinesPart.set(T, void 0);
    }), this._register(Ze.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition, (T) => this._handleCursorPositionChange(T, !0))), this._register(Ze.runAndSubscribe(this._editors.original.onDidChangeCursorPosition, (T) => this._handleCursorPositionChange(T, !1)));
    const L = this._diffModel.map(this, (T, D) => {
      if (T)
        return T.diff.read(D) === void 0 && !T.isDiffUpToDate.read(D);
    });
    this._register(Ql((T, D) => {
      if (L.read(T) === !0) {
        const N = this._editorProgressService.show(!0, 1e3);
        D.add(Et(() => N.done()));
      }
    })), this._register(Ql((T, D) => {
      D.add(new ($v($yt))(this._editors, this._diffModel, this._options, this));
    })), this._register(Ql((T, D) => {
      const N = this._diffModel.read(T);
      if (N)
        for (const R of [N.model.original, N.model.modified])
          D.add(R.onWillDispose((M) => {
            fn(new Wt("TextModel got disposed before DiffEditorWidget model got reset")), this.setModel(null);
          }));
    })), this._register(Xt((T) => {
      this._options.setModel(this._diffModel.read(T));
    }));
  }
  _createInnerEditor(e, t, n, r) {
    return e.createInstance(uT, t, n, r);
  }
  _createDiffEditorContributions() {
    const e = jN.getDiffEditorContributions();
    for (const t of e)
      try {
        this._register(this._instantiationService.createInstance(t.ctor, this));
      } catch (n) {
        fn(n);
      }
  }
  get _targetEditor() {
    return this._editors.modified;
  }
  getEditorType() {
    return DB.IDiffEditor;
  }
  layout(e) {
    this._rootSizeObserver.observe(e);
  }
  hasTextFocus() {
    return this._editors.original.hasTextFocus() || this._editors.modified.hasTextFocus();
  }
  saveViewState() {
    var n;
    const e = this._editors.original.saveViewState(), t = this._editors.modified.saveViewState();
    return {
      original: e,
      modified: t,
      modelState: (n = this._diffModel.get()) == null ? void 0 : n.serializeState()
    };
  }
  restoreViewState(e) {
    var t;
    if (e && e.original && e.modified) {
      const n = e;
      this._editors.original.restoreViewState(n.original), this._editors.modified.restoreViewState(n.modified), n.modelState && ((t = this._diffModel.get()) == null || t.restoreSerializedState(n.modelState));
    }
  }
  handleInitialized() {
    this._editors.original.handleInitialized(), this._editors.modified.handleInitialized();
  }
  createViewModel(e) {
    return this._instantiationService.createInstance(cse, e, this._options);
  }
  getModel() {
    var e;
    return ((e = this._diffModel.get()) == null ? void 0 : e.model) ?? null;
  }
  setModel(e) {
    const t = e ? "model" in e ? RU.create(e).createNewRef(this) : RU.create(this.createViewModel(e), this) : null;
    this.setDiffModel(t);
  }
  setDiffModel(e, t) {
    const n = this._diffModel.get();
    !e && n && this._accessibleDiffViewer.get().close(), this._diffModel.get() !== (e == null ? void 0 : e.object) && Ax(t, (r) => {
      var a;
      const s = e == null ? void 0 : e.object;
      ji.batchEventsGlobally(r, () => {
        this._editors.original.setModel(s ? s.model.original : null), this._editors.modified.setModel(s ? s.model.modified : null);
      });
      const o = (a = this._diffModelSrc.get()) == null ? void 0 : a.createNewRef(this);
      this._diffModelSrc.set(e == null ? void 0 : e.createNewRef(this), r), setTimeout(() => {
        o == null || o.dispose();
      }, 0);
    });
  }
  /**
   * @param changedOptions Only has values for top-level options that have actually changed.
   */
  updateOptions(e) {
    this._options.updateOptions(e);
  }
  getContainerDomNode() {
    return this._domElement;
  }
  getOriginalEditor() {
    return this._editors.original;
  }
  getModifiedEditor() {
    return this._editors.modified;
  }
  /**
   * @deprecated Use `this.getDiffComputationResult().changes2` instead.
   */
  getLineChanges() {
    var t;
    const e = (t = this._diffModel.get()) == null ? void 0 : t.diff.get();
    return e ? Gyt(e) : null;
  }
  revert(e) {
    const t = this._diffModel.get();
    !t || !t.isDiffUpToDate.get() || this._editors.modified.executeEdits("diffEditor", [
      {
        range: e.modified.toExclusiveRange(),
        text: t.model.original.getValueInRange(e.original.toExclusiveRange())
      }
    ]);
  }
  revertRangeMappings(e) {
    const t = this._diffModel.get();
    if (!t || !t.isDiffUpToDate.get())
      return;
    const n = e.map((r) => ({
      range: r.modifiedRange,
      text: t.model.original.getValueInRange(r.originalRange)
    }));
    this._editors.modified.executeEdits("diffEditor", n);
  }
  revertFocusedRangeMappings() {
    var l, c;
    const e = this._diffModel.get();
    if (!e || !e.isDiffUpToDate.get())
      return;
    const t = (c = (l = this._diffModel.get()) == null ? void 0 : l.diff.get()) == null ? void 0 : c.mappings;
    if (!t || t.length === 0)
      return;
    const n = this._editors.modified;
    if (!n.hasTextFocus())
      return;
    const r = n.getPosition().lineNumber, s = n.getSelection(), o = Zt.fromRange(s || new z(r, 0, r, 0)), a = t.filter((u) => u.lineRangeMapping.modified.intersect(o));
    n.executeEdits("diffEditor", a.map((u) => ({
      range: u.lineRangeMapping.modified.toExclusiveRange(),
      text: e.model.original.getValueInRange(u.lineRangeMapping.original.toExclusiveRange())
    })));
  }
  _goTo(e) {
    this._editors.modified.setPosition(new de(e.lineRangeMapping.modified.startLineNumber, 1)), this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange());
  }
  goToDiff(e) {
    var s, o;
    const t = (o = (s = this._diffModel.get()) == null ? void 0 : s.diff.get()) == null ? void 0 : o.mappings;
    if (!t || t.length === 0)
      return;
    const n = this._editors.modified.getPosition().lineNumber;
    let r;
    e === "next" ? this._editors.modified.getModel().getLineCount() === n ? r = t[0] : r = t.find((l) => l.lineRangeMapping.modified.startLineNumber > n) ?? t[0] : r = w4(t, (a) => a.lineRangeMapping.modified.startLineNumber < n) ?? t[t.length - 1], this._goTo(r), r.lineRangeMapping.modified.isEmpty ? this._accessibilitySignalService.playSignal(tu.diffLineDeleted, { source: "diffEditor.goToDiff" }) : r.lineRangeMapping.original.isEmpty ? this._accessibilitySignalService.playSignal(tu.diffLineInserted, { source: "diffEditor.goToDiff" }) : r && this._accessibilitySignalService.playSignal(tu.diffLineModified, { source: "diffEditor.goToDiff" });
  }
  revealFirstDiff() {
    const e = this._diffModel.get();
    e && this.waitForDiff().then(() => {
      var n;
      const t = (n = e.diff.get()) == null ? void 0 : n.mappings;
      !t || t.length === 0 || this._goTo(t[0]);
    });
  }
  accessibleDiffViewerNext() {
    this._accessibleDiffViewer.get().next();
  }
  accessibleDiffViewerPrev() {
    this._accessibleDiffViewer.get().prev();
  }
  async waitForDiff() {
    const e = this._diffModel.get();
    e && await e.waitForDiff();
  }
  mapToOtherSide() {
    var o, a;
    const e = this._editors.modified.hasWidgetFocus(), t = e ? this._editors.modified : this._editors.original, n = e ? this._editors.original : this._editors.modified;
    let r;
    const s = t.getSelection();
    if (s) {
      const l = (a = (o = this._diffModel.get()) == null ? void 0 : o.diff.get()) == null ? void 0 : a.mappings.map((c) => e ? c.lineRangeMapping.flip() : c.lineRangeMapping);
      if (l) {
        const c = Eke(s.getStartPosition(), l), u = Eke(s.getEndPosition(), l);
        r = z.plusRange(c, u);
      }
    }
    return { destination: n, destinationSelection: r };
  }
  switchSide() {
    const { destination: e, destinationSelection: t } = this.mapToOtherSide();
    e.focus(), t && e.setSelection(t);
  }
  exitCompareMove() {
    const e = this._diffModel.get();
    e && e.movedTextToCompare.set(void 0, void 0);
  }
  collapseAllUnchangedRegions() {
    var t;
    const e = (t = this._diffModel.get()) == null ? void 0 : t.unchangedRegions.get();
    e && Fr((n) => {
      for (const r of e)
        r.collapseAll(n);
    });
  }
  showAllUnchangedRegions() {
    var t;
    const e = (t = this._diffModel.get()) == null ? void 0 : t.unchangedRegions.get();
    e && Fr((n) => {
      for (const r of e)
        r.showAll(n);
    });
  }
  _handleCursorPositionChange(e, t) {
    var n, r;
    if ((e == null ? void 0 : e.reason) === 3) {
      const s = (r = (n = this._diffModel.get()) == null ? void 0 : n.diff.get()) == null ? void 0 : r.mappings.find((o) => t ? o.lineRangeMapping.modified.contains(e.position.lineNumber) : o.lineRangeMapping.original.contains(e.position.lineNumber));
      s != null && s.lineRangeMapping.modified.isEmpty ? this._accessibilitySignalService.playSignal(tu.diffLineDeleted, { source: "diffEditor.cursorPositionChanged" }) : s != null && s.lineRangeMapping.original.isEmpty ? this._accessibilitySignalService.playSignal(tu.diffLineInserted, { source: "diffEditor.cursorPositionChanged" }) : s && this._accessibilitySignalService.playSignal(tu.diffLineModified, { source: "diffEditor.cursorPositionChanged" });
    }
  }
};
bb = jyt([
  nP(3, Jt),
  nP(4, xt),
  nP(5, Ti),
  nP(6, h0),
  nP(7, e0)
], bb);
function Gyt(i) {
  return i.mappings.map((e) => {
    const t = e.lineRangeMapping;
    let n, r, s, o, a = t.innerChanges;
    return t.original.isEmpty ? (n = t.original.startLineNumber - 1, r = 0, a = void 0) : (n = t.original.startLineNumber, r = t.original.endLineNumberExclusive - 1), t.modified.isEmpty ? (s = t.modified.startLineNumber - 1, o = 0, a = void 0) : (s = t.modified.startLineNumber, o = t.modified.endLineNumberExclusive - 1), {
      originalStartLineNumber: n,
      originalEndLineNumber: r,
      modifiedStartLineNumber: s,
      modifiedEndLineNumber: o,
      charChanges: a == null ? void 0 : a.map((l) => ({
        originalStartLineNumber: l.originalRange.startLineNumber,
        originalStartColumn: l.originalRange.startColumn,
        originalEndLineNumber: l.originalRange.endLineNumber,
        originalEndColumn: l.originalRange.endColumn,
        modifiedStartLineNumber: l.modifiedRange.startLineNumber,
        modifiedStartColumn: l.modifiedRange.startColumn,
        modifiedEndLineNumber: l.modifiedRange.endLineNumber,
        modifiedEndColumn: l.modifiedRange.endColumn
      }))
    };
  });
}
class qyt extends Fa {
  constructor() {
    super({
      id: "diffEditor.toggleCollapseUnchangedRegions",
      title: Ee(82, "Toggle Collapse Unchanged Regions"),
      icon: Pe.map,
      toggled: Re.has("config.diffEditor.hideUnchangedRegions.enabled"),
      precondition: Re.has("isInDiffEditor"),
      menu: {
        when: Re.has("isInDiffEditor"),
        id: wt.EditorTitle,
        order: 22,
        group: "navigation"
      }
    });
  }
  run(e, ...t) {
    const n = e.get(xn), r = !n.getValue("diffEditor.hideUnchangedRegions.enabled");
    n.updateValue("diffEditor.hideUnchangedRegions.enabled", r);
  }
}
class N5e extends Fa {
  constructor() {
    super({
      id: "diffEditor.toggleShowMovedCodeBlocks",
      title: Ee(83, "Toggle Show Moved Code Blocks"),
      precondition: Re.has("isInDiffEditor")
    });
  }
  run(e, ...t) {
    const n = e.get(xn), r = !n.getValue("diffEditor.experimental.showMoves");
    n.updateValue("diffEditor.experimental.showMoves", r);
  }
}
class R5e extends Fa {
  constructor() {
    super({
      id: "diffEditor.toggleUseInlineViewWhenSpaceIsLimited",
      title: Ee(84, "Toggle Use Inline View When Space Is Limited"),
      precondition: Re.has("isInDiffEditor")
    });
  }
  run(e, ...t) {
    const n = e.get(xn), r = !n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");
    n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited", r);
  }
}
const BB = Ee(85, "Diff Editor");
class Kyt extends Qg {
  constructor() {
    super({
      id: "diffEditor.switchSide",
      title: Ee(86, "Switch Side"),
      icon: Pe.arrowSwap,
      precondition: Re.has("isInDiffEditor"),
      f1: !0,
      category: BB
    });
  }
  runEditorCommand(e, t, n) {
    const r = ek(e);
    if (r instanceof bb) {
      if (n && n.dryRun)
        return { destinationSelection: r.mapToOtherSide().destinationSelection };
      r.switchSide();
    }
  }
}
class Yyt extends Qg {
  constructor() {
    super({
      id: "diffEditor.exitCompareMove",
      title: Ee(87, "Exit Compare Move"),
      icon: Pe.close,
      precondition: se.comparingMovedCode,
      f1: !1,
      category: BB,
      keybinding: {
        weight: 1e4,
        primary: 9
      }
    });
  }
  runEditorCommand(e, t, ...n) {
    const r = ek(e);
    r instanceof bb && r.exitCompareMove();
  }
}
class Xyt extends Qg {
  constructor() {
    super({
      id: "diffEditor.collapseAllUnchangedRegions",
      title: Ee(88, "Collapse All Unchanged Regions"),
      icon: Pe.fold,
      precondition: Re.has("isInDiffEditor"),
      f1: !0,
      category: BB
    });
  }
  runEditorCommand(e, t, ...n) {
    const r = ek(e);
    r instanceof bb && r.collapseAllUnchangedRegions();
  }
}
class Zyt extends Qg {
  constructor() {
    super({
      id: "diffEditor.showAllUnchangedRegions",
      title: Ee(89, "Show All Unchanged Regions"),
      icon: Pe.unfold,
      precondition: Re.has("isInDiffEditor"),
      f1: !0,
      category: BB
    });
  }
  runEditorCommand(e, t, ...n) {
    const r = ek(e);
    r instanceof bb && r.showAllUnchangedRegions();
  }
}
class Ese extends Fa {
  constructor() {
    super({
      id: "diffEditor.revert",
      title: Ee(90, "Revert"),
      f1: !0,
      category: BB,
      precondition: Re.has("isInDiffEditor")
    });
  }
  run(e, t) {
    return t ? this.runViaToolbarContext(e, t) : this.runViaCursorOrSelection(e);
  }
  runViaCursorOrSelection(e) {
    const t = ek(e);
    t instanceof bb && t.revertFocusedRangeMappings();
  }
  runViaToolbarContext(e, t) {
    const n = Qyt(e, t.originalUri, t.modifiedUri);
    n instanceof bb && n.revertRangeMappings(t.mapping.innerChanges ?? []);
  }
}
const A5e = Ee(91, "Accessible Diff Viewer"), rG = class rG extends Fa {
  constructor() {
    super({
      id: rG.id,
      title: Ee(92, "Go to Next Difference"),
      category: A5e,
      precondition: Re.has("isInDiffEditor"),
      keybinding: {
        primary: 65,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      f1: !0
    });
  }
  run(e) {
    const t = ek(e);
    t == null || t.accessibleDiffViewerNext();
  }
};
rG.id = "editor.action.accessibleDiffViewer.next";
let K4 = rG;
const sG = class sG extends Fa {
  constructor() {
    super({
      id: sG.id,
      title: Ee(93, "Go to Previous Difference"),
      category: A5e,
      precondition: Re.has("isInDiffEditor"),
      keybinding: {
        primary: 1089,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      f1: !0
    });
  }
  run(e) {
    const t = ek(e);
    t == null || t.accessibleDiffViewerPrev();
  }
};
sG.id = "editor.action.accessibleDiffViewer.prev";
let GU = sG;
function Qyt(i, e, t) {
  return i.get(Ti).listDiffEditors().find((s) => {
    var l, c;
    const o = s.getModifiedEditor(), a = s.getOriginalEditor();
    return o && ((l = o.getModel()) == null ? void 0 : l.uri.toString()) === t.toString() && a && ((c = a.getModel()) == null ? void 0 : c.uri.toString()) === e.toString();
  }) || null;
}
function ek(i) {
  const t = i.get(Ti).listDiffEditors(), n = ea();
  if (n) {
    for (const r of t)
      if (r.getContainerDomNode().contains(n))
        return r;
  }
  return null;
}
ar(qyt);
ar(N5e);
ar(R5e);
Oa.appendMenuItem(wt.EditorTitle, {
  command: {
    id: new R5e().desc.id,
    title: S(116, "Use Inline View When Space Is Limited"),
    toggled: Re.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),
    precondition: Re.has("isInDiffEditor")
  },
  order: 11,
  group: "1_diff",
  when: Re.and(se.diffEditorRenderSideBySideInlineBreakpointReached, Re.has("isInDiffEditor"))
});
Oa.appendMenuItem(wt.EditorTitle, {
  command: {
    id: new N5e().desc.id,
    title: S(117, "Show Moved Code Blocks"),
    icon: Pe.move,
    toggled: qA.create("config.diffEditor.experimental.showMoves", !0),
    precondition: Re.has("isInDiffEditor")
  },
  order: 10,
  group: "1_diff",
  when: Re.has("isInDiffEditor")
});
ar(Ese);
for (const i of [
  { icon: Pe.arrowRight, key: se.diffEditorInlineMode.toNegated() },
  { icon: Pe.discard, key: se.diffEditorInlineMode }
])
  Oa.appendMenuItem(wt.DiffEditorHunkToolbar, {
    command: {
      id: new Ese().desc.id,
      title: S(118, "Revert Block"),
      icon: i.icon
    },
    when: Re.and(se.diffEditorModifiedWritable, i.key),
    order: 5,
    group: "primary"
  }), Oa.appendMenuItem(wt.DiffEditorSelectionToolbar, {
    command: {
      id: new Ese().desc.id,
      title: S(119, "Revert Selection"),
      icon: i.icon
    },
    when: Re.and(se.diffEditorModifiedWritable, i.key),
    order: 5,
    group: "primary"
  });
ar(Kyt);
ar(Yyt);
ar(Xyt);
ar(Zyt);
Oa.appendMenuItem(wt.EditorTitle, {
  command: {
    id: K4.id,
    title: S(120, "Open Accessible Diff Viewer"),
    precondition: Re.has("isInDiffEditor")
  },
  order: 10,
  group: "2_diff",
  when: Re.and(se.accessibleDiffViewerVisible.negate(), Re.has("isInDiffEditor"))
});
_i.registerCommandAlias("editor.action.diffReview.next", K4.id);
ar(K4);
_i.registerCommandAlias("editor.action.diffReview.prev", GU.id);
ar(GU);
var Jyt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, e0t = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, xse;
const mK = new ut("selectionAnchorSet", !1);
var iL;
let fw = (iL = class {
  static get(e) {
    return e.getContribution(xse.ID);
  }
  constructor(e, t) {
    this.editor = e, this.selectionAnchorSetContextKey = mK.bindTo(t), this.modelChangeListener = e.onDidChangeModel(() => this.selectionAnchorSetContextKey.reset());
  }
  setSelectionAnchor() {
    if (this.editor.hasModel()) {
      const e = this.editor.getPosition();
      this.editor.changeDecorations((t) => {
        this.decorationId && t.removeDecoration(this.decorationId), this.decorationId = t.addDecoration(bt.fromPositions(e, e), {
          description: "selection-anchor",
          stickiness: 1,
          hoverMessage: new ql().appendText(S(794, "Selection Anchor")),
          className: "selection-anchor"
        });
      }), this.selectionAnchorSetContextKey.set(!!this.decorationId), lu(S(795, "Anchor set at {0}:{1}", e.lineNumber, e.column));
    }
  }
  goToSelectionAnchor() {
    if (this.editor.hasModel() && this.decorationId) {
      const e = this.editor.getModel().getDecorationRange(this.decorationId);
      e && this.editor.setPosition(e.getStartPosition());
    }
  }
  selectFromAnchorToCursor() {
    if (this.editor.hasModel() && this.decorationId) {
      const e = this.editor.getModel().getDecorationRange(this.decorationId);
      if (e) {
        const t = this.editor.getPosition();
        this.editor.setSelection(bt.fromPositions(e.getStartPosition(), t)), this.cancelSelectionAnchor();
      }
    }
  }
  cancelSelectionAnchor() {
    if (this.decorationId) {
      const e = this.decorationId;
      this.editor.changeDecorations((t) => {
        t.removeDecoration(e), this.decorationId = void 0;
      }), this.selectionAnchorSetContextKey.set(!1);
    }
  }
  dispose() {
    this.cancelSelectionAnchor(), this.modelChangeListener.dispose();
  }
}, xse = iL, iL.ID = "editor.contrib.selectionAnchorController", iL);
fw = xse = Jyt([
  e0t(1, Jt)
], fw);
class t0t extends vt {
  constructor() {
    super({
      id: "editor.action.setSelectionAnchor",
      label: Ee(796, "Set Selection Anchor"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2080
          /* KeyCode.KeyB */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  async run(e, t) {
    var n;
    (n = fw.get(t)) == null || n.setSelectionAnchor();
  }
}
class n0t extends vt {
  constructor() {
    super({
      id: "editor.action.goToSelectionAnchor",
      label: Ee(797, "Go to Selection Anchor"),
      precondition: mK
    });
  }
  async run(e, t) {
    var n;
    (n = fw.get(t)) == null || n.goToSelectionAnchor();
  }
}
class i0t extends vt {
  constructor() {
    super({
      id: "editor.action.selectFromAnchorToCursor",
      label: Ee(798, "Select from Anchor to Cursor"),
      precondition: mK,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2089
          /* KeyCode.KeyK */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  async run(e, t) {
    var n;
    (n = fw.get(t)) == null || n.selectFromAnchorToCursor();
  }
}
class r0t extends vt {
  constructor() {
    super({
      id: "editor.action.cancelSelectionAnchor",
      label: Ee(799, "Cancel Selection Anchor"),
      precondition: mK,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 9,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  async run(e, t) {
    var n;
    (n = fw.get(t)) == null || n.cancelSelectionAnchor();
  }
}
Si(
  fw.ID,
  fw,
  4
  /* EditorContributionInstantiation.Lazy */
);
Je(t0t);
Je(n0t);
Je(i0t);
Je(r0t);
const s0t = ie("editorOverviewRuler.bracketMatchForeground", "#A0A0A0", S(800, "Overview ruler marker color for matching brackets."));
class o0t extends vt {
  constructor() {
    super({
      id: "editor.action.jumpToBracket",
      label: Ee(802, "Go to Bracket"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 3165,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    var n;
    (n = pT.get(t)) == null || n.jumpToBracket();
  }
}
class a0t extends vt {
  constructor() {
    super({
      id: "editor.action.selectToBracket",
      label: Ee(803, "Select to Bracket"),
      precondition: void 0,
      metadata: {
        description: Ee(804, "Select the text inside and including the brackets or curly braces"),
        args: [{
          name: "args",
          schema: {
            type: "object",
            properties: {
              selectBrackets: {
                type: "boolean",
                default: !0
              }
            }
          }
        }]
      }
    });
  }
  run(e, t, n) {
    var s;
    let r = !0;
    n && n.selectBrackets === !1 && (r = !1), (s = pT.get(t)) == null || s.selectToBracket(r);
  }
}
class l0t extends vt {
  constructor() {
    super({
      id: "editor.action.removeBrackets",
      label: Ee(805, "Remove Brackets"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 2561,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    var n;
    (n = pT.get(t)) == null || n.removeBrackets(this.id);
  }
}
class c0t {
  constructor(e, t, n) {
    this.position = e, this.brackets = t, this.options = n;
  }
}
const $C = class $C extends ge {
  static get(e) {
    return e.getContribution($C.ID);
  }
  constructor(e) {
    super(), this._editor = e, this._lastBracketsData = [], this._lastVersionId = 0, this._decorations = this._editor.createDecorationsCollection(), this._updateBracketsSoon = this._register(new mr(() => this._updateBrackets(), 50)), this._matchBrackets = this._editor.getOption(
      80
      /* EditorOption.matchBrackets */
    ), this._updateBracketsSoon.schedule(), this._register(e.onDidChangeCursorPosition((t) => {
      this._matchBrackets !== "never" && this._updateBracketsSoon.schedule();
    })), this._register(e.onDidChangeModelContent((t) => {
      this._updateBracketsSoon.schedule();
    })), this._register(e.onDidChangeModel((t) => {
      this._lastBracketsData = [], this._updateBracketsSoon.schedule();
    })), this._register(e.onDidChangeModelLanguageConfiguration((t) => {
      this._lastBracketsData = [], this._updateBracketsSoon.schedule();
    })), this._register(e.onDidChangeConfiguration((t) => {
      t.hasChanged(
        80
        /* EditorOption.matchBrackets */
      ) && (this._matchBrackets = this._editor.getOption(
        80
        /* EditorOption.matchBrackets */
      ), this._decorations.clear(), this._lastBracketsData = [], this._lastVersionId = 0, this._updateBracketsSoon.schedule());
    })), this._register(e.onDidBlurEditorWidget(() => {
      this._updateBracketsSoon.schedule();
    })), this._register(e.onDidFocusEditorWidget(() => {
      this._updateBracketsSoon.schedule();
    }));
  }
  jumpToBracket() {
    if (!this._editor.hasModel())
      return;
    const e = this._editor.getModel(), t = this._editor.getSelections().map((n) => {
      const r = n.getStartPosition(), s = e.bracketPairs.matchBracket(r);
      let o = null;
      if (s)
        s[0].containsPosition(r) && !s[1].containsPosition(r) ? o = s[1].getStartPosition() : s[1].containsPosition(r) && (o = s[0].getStartPosition());
      else {
        const a = e.bracketPairs.findEnclosingBrackets(r);
        if (a)
          o = a[1].getStartPosition();
        else {
          const l = e.bracketPairs.findNextBracket(r);
          l && l.range && (o = l.range.getStartPosition());
        }
      }
      return o ? new bt(o.lineNumber, o.column, o.lineNumber, o.column) : new bt(r.lineNumber, r.column, r.lineNumber, r.column);
    });
    this._editor.setSelections(t), this._editor.revealRange(t[0]);
  }
  selectToBracket(e) {
    if (!this._editor.hasModel())
      return;
    const t = this._editor.getModel(), n = [];
    this._editor.getSelections().forEach((r) => {
      const s = r.getStartPosition();
      let o = t.bracketPairs.matchBracket(s);
      if (!o && (o = t.bracketPairs.findEnclosingBrackets(s), !o)) {
        const c = t.bracketPairs.findNextBracket(s);
        c && c.range && (o = t.bracketPairs.matchBracket(c.range.getStartPosition()));
      }
      let a = null, l = null;
      if (o) {
        o.sort(z.compareRangesUsingStarts);
        const [c, u] = o;
        if (a = e ? c.getStartPosition() : c.getEndPosition(), l = e ? u.getEndPosition() : u.getStartPosition(), u.containsPosition(s)) {
          const d = a;
          a = l, l = d;
        }
      }
      a && l && n.push(new bt(a.lineNumber, a.column, l.lineNumber, l.column));
    }), n.length > 0 && (this._editor.setSelections(n), this._editor.revealRange(n[0]));
  }
  removeBrackets(e) {
    if (!this._editor.hasModel())
      return;
    const t = this._editor.getModel();
    this._editor.getSelections().forEach((n) => {
      const r = n.getPosition();
      let s = t.bracketPairs.matchBracket(r);
      s || (s = t.bracketPairs.findEnclosingBrackets(r)), s && (this._editor.pushUndoStop(), this._editor.executeEdits(e, [
        { range: s[0], text: "" },
        { range: s[1], text: "" }
      ]), this._editor.pushUndoStop());
    });
  }
  _updateBrackets() {
    if (this._matchBrackets === "never")
      return;
    this._recomputeBrackets();
    const e = [];
    let t = 0;
    for (const n of this._lastBracketsData) {
      const r = n.brackets;
      r && (e[t++] = { range: r[0], options: n.options }, e[t++] = { range: r[1], options: n.options });
    }
    this._decorations.set(e);
  }
  _recomputeBrackets() {
    if (!this._editor.hasModel() || !this._editor.hasWidgetFocus()) {
      this._lastBracketsData = [], this._lastVersionId = 0;
      return;
    }
    const e = this._editor.getSelections();
    if (e.length > 100) {
      this._lastBracketsData = [], this._lastVersionId = 0;
      return;
    }
    const t = this._editor.getModel(), n = t.getVersionId();
    let r = [];
    this._lastVersionId === n && (r = this._lastBracketsData);
    const s = [];
    let o = 0;
    for (let d = 0, h = e.length; d < h; d++) {
      const g = e[d];
      g.isEmpty() && (s[o++] = g.getStartPosition());
    }
    s.length > 1 && s.sort(de.compare);
    const a = [];
    let l = 0, c = 0;
    const u = r.length;
    for (let d = 0, h = s.length; d < h; d++) {
      const g = s[d];
      for (; c < u && r[c].position.isBefore(g); )
        c++;
      if (c < u && r[c].position.equals(g))
        a[l++] = r[c];
      else {
        let m = t.bracketPairs.matchBracket(
          g,
          20
          /* give at most 20ms to compute */
        ), _ = $C._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;
        !m && this._matchBrackets === "always" && (m = t.bracketPairs.findEnclosingBrackets(
          g,
          20
          /* give at most 20ms to compute */
        ), _ = $C._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER), a[l++] = new c0t(g, m, _);
      }
    }
    this._lastBracketsData = a, this._lastVersionId = n;
  }
};
$C.ID = "editor.contrib.bracketMatchingController", $C._DECORATION_OPTIONS_WITH_OVERVIEW_RULER = dn.register({
  description: "bracket-match-overview",
  stickiness: 1,
  className: "bracket-match",
  overviewRuler: {
    color: Ks(s0t),
    position: zh.Center
  }
}), $C._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER = dn.register({
  description: "bracket-match-no-overview",
  stickiness: 1,
  className: "bracket-match"
});
let pT = $C;
Si(
  pT.ID,
  pT,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
Je(a0t);
Je(o0t);
Je(l0t);
Oa.appendMenuItem(wt.MenubarGoMenu, {
  group: "5_infile_nav",
  command: {
    id: "editor.action.jumpToBracket",
    title: S(801, "Go to &&Bracket")
  },
  order: 2
});
class u0t {
  constructor(e, t) {
    this._selection = e, this._isMovingLeft = t;
  }
  getEditOperations(e, t) {
    if (this._selection.startLineNumber !== this._selection.endLineNumber || this._selection.isEmpty())
      return;
    const n = this._selection.startLineNumber, r = this._selection.startColumn, s = this._selection.endColumn;
    if (!(this._isMovingLeft && r === 1) && !(!this._isMovingLeft && s === e.getLineMaxColumn(n)))
      if (this._isMovingLeft) {
        const o = new z(n, r - 1, n, r), a = e.getValueInRange(o);
        t.addEditOperation(o, null), t.addEditOperation(new z(n, s, n, s), a);
      } else {
        const o = new z(n, s, n, s + 1), a = e.getValueInRange(o);
        t.addEditOperation(o, null), t.addEditOperation(new z(n, r, n, r), a);
      }
  }
  computeCursorState(e, t) {
    return this._isMovingLeft ? new bt(this._selection.startLineNumber, this._selection.startColumn - 1, this._selection.endLineNumber, this._selection.endColumn - 1) : new bt(this._selection.startLineNumber, this._selection.startColumn + 1, this._selection.endLineNumber, this._selection.endColumn + 1);
  }
}
class O5e extends vt {
  constructor(e, t) {
    super(t), this.left = e;
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = [], r = t.getSelections();
    for (const s of r)
      n.push(new u0t(s, this.left));
    t.pushUndoStop(), t.executeCommands(this.id, n), t.pushUndoStop();
  }
}
class d0t extends O5e {
  constructor() {
    super(!0, {
      id: "editor.action.moveCarretLeftAction",
      label: Ee(806, "Move Selected Text Left"),
      precondition: se.writable
    });
  }
}
class h0t extends O5e {
  constructor() {
    super(!1, {
      id: "editor.action.moveCarretRightAction",
      label: Ee(807, "Move Selected Text Right"),
      precondition: se.writable
    });
  }
}
Je(d0t);
Je(h0t);
class f0t extends vt {
  constructor() {
    super({
      id: "editor.action.transposeLetters",
      label: Ee(808, "Transpose Letters"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: {
          primary: 306
          /* KeyCode.KeyT */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getModel(), r = [], s = t.getSelections();
    for (const o of s) {
      if (!o.isEmpty())
        continue;
      const a = o.startLineNumber, l = o.startColumn, c = n.getLineMaxColumn(a);
      if (a === 1 && (l === 1 || l === 2 && c === 2))
        continue;
      const u = l === c ? o.getPosition() : Zi.rightPosition(n, o.getPosition().lineNumber, o.getPosition().column), d = Zi.leftPosition(n, u), h = Zi.leftPosition(n, d), g = n.getValueInRange(z.fromPositions(h, d)), m = n.getValueInRange(z.fromPositions(d, u)), _ = z.fromPositions(h, u);
      r.push(new bl(_, m + g));
    }
    r.length > 0 && (t.pushUndoStop(), t.executeCommands(this.id, r), t.pushUndoStop());
  }
}
Je(f0t);
const g0t = Vn("productService");
function Mge(i, e) {
  return {
    id: e,
    asString: async () => i,
    asFile: () => {
    },
    value: typeof i == "string" ? i : void 0
  };
}
function p0t(i, e, t, n) {
  const r = { id: XT(), name: i, uri: e, data: t };
  return {
    id: n,
    asString: async () => "",
    asFile: () => r,
    value: void 0
  };
}
class M5e {
  constructor() {
    this._entries = /* @__PURE__ */ new Map();
  }
  get size() {
    let e = 0;
    for (const t of this._entries)
      e++;
    return e;
  }
  has(e) {
    return this._entries.has(this.toKey(e));
  }
  matches(e) {
    const t = [...this._entries.keys()];
    return gi.some(this, ([n, r]) => r.asFile()) && t.push("files"), P5e(qU(e), t);
  }
  get(e) {
    var t;
    return (t = this._entries.get(this.toKey(e))) == null ? void 0 : t[0];
  }
  /**
   * Add a new entry to this data transfer.
   *
   * This does not replace existing entries for `mimeType`.
   */
  append(e, t) {
    const n = this._entries.get(e);
    n ? n.push(t) : this._entries.set(this.toKey(e), [t]);
  }
  /**
   * Set the entry for a given mime type.
   *
   * This replaces all existing entries for `mimeType`.
   */
  replace(e, t) {
    this._entries.set(this.toKey(e), [t]);
  }
  /**
   * Remove all entries for `mimeType`.
   */
  delete(e) {
    this._entries.delete(this.toKey(e));
  }
  /**
   * Iterate over all `[mime, item]` pairs in this data transfer.
   *
   * There may be multiple entries for each mime type.
   */
  *[Symbol.iterator]() {
    for (const [e, t] of this._entries)
      for (const n of t)
        yield [e, n];
  }
  toKey(e) {
    return qU(e);
  }
}
function qU(i) {
  return i.toLowerCase();
}
function rDe(i, e) {
  return P5e(qU(i), e.map(qU));
}
function P5e(i, e) {
  if (i === "*/*")
    return e.length > 0;
  if (e.includes(i))
    return !0;
  const t = i.match(/^([a-z]+)\/([a-z]+|\*)$/i);
  if (!t)
    return !1;
  const [n, r, s] = t;
  return s === "*" ? e.some((o) => o.startsWith(r + "/")) : !1;
}
const _K = Object.freeze({
  // http://amundsen.com/hypermedia/urilist/
  create: (i) => qy(i.map((e) => e.toString())).join(`\r
`),
  split: (i) => i.split(`\r
`),
  parse: (i) => _K.split(i).filter((e) => !e.startsWith("#"))
}), A_ = class A_ {
  constructor(e) {
    this.value = e;
  }
  equals(e) {
    return this.value === e.value;
  }
  contains(e) {
    return this.equals(e) || this.value === "" || e.value.startsWith(this.value + A_.sep);
  }
  intersects(e) {
    return this.contains(e) || e.contains(this);
  }
  append(...e) {
    return new A_((this.value ? [this.value, ...e] : e).join(A_.sep));
  }
};
A_.sep = ".", A_.None = new A_("@@none@@"), A_.Empty = new A_("");
let Ps = A_;
const m0t = { ctrlCmd: !1, alt: !1 };
var Y4;
(function(i) {
  i[i.Blur = 1] = "Blur", i[i.Gesture = 2] = "Gesture", i[i.Other = 3] = "Other";
})(Y4 || (Y4 = {}));
var Bp;
(function(i) {
  i[i.NONE = 0] = "NONE", i[i.FIRST = 1] = "FIRST", i[i.SECOND = 2] = "SECOND", i[i.LAST = 3] = "LAST";
})(Bp || (Bp = {}));
var Yr;
(function(i) {
  i[i.First = 1] = "First", i[i.Second = 2] = "Second", i[i.Last = 3] = "Last", i[i.Next = 4] = "Next", i[i.Previous = 5] = "Previous", i[i.NextPage = 6] = "NextPage", i[i.PreviousPage = 7] = "PreviousPage", i[i.NextSeparator = 8] = "NextSeparator", i[i.PreviousSeparator = 9] = "PreviousSeparator";
})(Yr || (Yr = {}));
var KU;
(function(i) {
  i[i.Title = 1] = "Title", i[i.Inline = 2] = "Inline";
})(KU || (KU = {}));
const tc = Vn("quickInputService"), sDe = {
  EDITORS: "CodeEditors",
  FILES: "CodeFiles"
};
class _0t {
}
const b0t = {
  DragAndDropContribution: "workbench.contributions.dragAndDrop"
};
Fs.add(b0t.DragAndDropContribution, new _0t());
const M3 = class M3 {
  constructor() {
  }
  static getInstance() {
    return M3.INSTANCE;
  }
  hasData(e) {
    return e && e === this.proto;
  }
  getData(e) {
    if (this.hasData(e))
      return this.data;
  }
};
M3.INSTANCE = new M3();
let Lse = M3;
function F5e(i) {
  var e, t;
  if (hm && typeof ((t = (e = globalThis.vscode) == null ? void 0 : e.webUtils) == null ? void 0 : t.getPathForFile) == "function")
    return globalThis.vscode.webUtils.getPathForFile(i);
}
function B5e(i) {
  const e = new M5e();
  for (const t of i.items) {
    const n = t.type;
    if (t.kind === "string") {
      const r = new Promise((s) => t.getAsString(s));
      e.append(n, Mge(r));
    } else if (t.kind === "file") {
      const r = t.getAsFile();
      r && e.append(n, v0t(r));
    }
  }
  return e;
}
function v0t(i) {
  const e = F5e(i), t = e ? Ht.parse(e) : void 0;
  return p0t(i.name, t, async () => new Uint8Array(await i.arrayBuffer()));
}
const y0t = Object.freeze([
  sDe.EDITORS,
  sDe.FILES,
  dT.RESOURCES,
  dT.INTERNAL_URI_LIST
]);
function H5e(i, e = !1) {
  const t = B5e(i), n = t.get(dT.INTERNAL_URI_LIST);
  if (n)
    t.replace(co.uriList, n);
  else if (e || !t.has(co.uriList)) {
    const r = [];
    for (const s of i.items) {
      const o = s.getAsFile();
      if (o) {
        const a = F5e(o);
        try {
          a ? r.push(Ht.file(a).toString()) : r.push(Ht.parse(o.name, !0).toString());
        } catch {
        }
      }
    }
    r.length && t.replace(co.uriList, Mge(_K.create(r)));
  }
  for (const r of y0t)
    t.delete(r);
  return t;
}
const HB = Vn("IWorkspaceEditService");
class Pge {
  constructor(e) {
    this.metadata = e;
  }
  static convert(e) {
    return e.edits.map((t) => {
      if (N1.is(t))
        return N1.lift(t);
      if (oR.is(t))
        return oR.lift(t);
      throw new Error("Unsupported edit");
    });
  }
}
class N1 extends Pge {
  static is(e) {
    return e instanceof N1 ? !0 : Ra(e) && Ht.isUri(e.resource) && Ra(e.textEdit);
  }
  static lift(e) {
    return e instanceof N1 ? e : new N1(e.resource, e.textEdit, e.versionId, e.metadata);
  }
  constructor(e, t, n = void 0, r) {
    super(r), this.resource = e, this.textEdit = t, this.versionId = n;
  }
}
class oR extends Pge {
  static is(e) {
    return e instanceof oR ? !0 : Ra(e) && (!!e.newResource || !!e.oldResource);
  }
  static lift(e) {
    return e instanceof oR ? e : new oR(e.oldResource, e.newResource, e.options, e.metadata);
  }
  constructor(e, t, n = {}, r) {
    super(r), this.oldResource = e, this.newResource = t, this.options = n;
  }
}
const Fge = Vn("IEditorCancelService"), W5e = new ut("cancellableOperation", !1, S(934, "Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));
ni(
  Fge,
  class {
    constructor() {
      this._tokens = /* @__PURE__ */ new WeakMap();
    }
    add(i, e) {
      let t = this._tokens.get(i);
      t || (t = i.invokeWithinContext((r) => {
        const s = W5e.bindTo(r.get(Jt)), o = new xc();
        return { key: s, tokens: o };
      }), this._tokens.set(i, t));
      let n;
      return t.key.set(!0), n = t.tokens.push(e), () => {
        n && (n(), t.key.set(!t.tokens.isEmpty()), n = void 0);
      };
    }
    cancel(i) {
      const e = this._tokens.get(i);
      if (!e)
        return;
      const t = e.tokens.pop();
      t && (t.cancel(), e.key.set(!e.tokens.isEmpty()));
    }
  },
  1
  /* InstantiationType.Delayed */
);
class C0t extends Ss {
  constructor(e, t) {
    super(t), this.editor = e, this._unregister = e.invokeWithinContext((n) => n.get(Fge).add(e, this));
  }
  dispose() {
    this._unregister(), super.dispose();
  }
}
ct(new class extends jo {
  constructor() {
    super({
      id: "editor.cancelOperation",
      kbOpts: {
        weight: 100,
        primary: 9
        /* KeyCode.Escape */
      },
      precondition: W5e
    });
  }
  runEditorCommand(i, e) {
    i.get(Fge).cancel(e);
  }
}());
let V5e = class Tse {
  constructor(e, t) {
    if (this.flags = t, (this.flags & 1) !== 0) {
      const n = e.getModel();
      this.modelVersionId = n ? tT("{0}#{1}", n.uri.toString(), n.getVersionId()) : null;
    } else
      this.modelVersionId = null;
    (this.flags & 4) !== 0 ? this.position = e.getPosition() : this.position = null, (this.flags & 2) !== 0 ? this.selection = e.getSelection() : this.selection = null, (this.flags & 8) !== 0 ? (this.scrollLeft = e.getScrollLeft(), this.scrollTop = e.getScrollTop()) : (this.scrollLeft = -1, this.scrollTop = -1);
  }
  _equals(e) {
    if (!(e instanceof Tse))
      return !1;
    const t = e;
    return !(this.modelVersionId !== t.modelVersionId || this.scrollLeft !== t.scrollLeft || this.scrollTop !== t.scrollTop || !this.position && t.position || this.position && !t.position || this.position && t.position && !this.position.equals(t.position) || !this.selection && t.selection || this.selection && !t.selection || this.selection && t.selection && !this.selection.equalsRange(t.selection));
  }
  validate(e) {
    return this._equals(new Tse(e, this.flags));
  }
};
class t0 extends C0t {
  constructor(e, t, n, r) {
    super(e, r), this._listener = new ke(), t & 4 && this._listener.add(e.onDidChangeCursorPosition((s) => {
      (!n || !z.containsPosition(n, s.position)) && this.cancel();
    })), t & 2 && this._listener.add(e.onDidChangeCursorSelection((s) => {
      (!n || !z.containsRange(n, s.selection)) && this.cancel();
    })), t & 8 && this._listener.add(e.onDidScrollChange((s) => this.cancel())), t & 1 && (this._listener.add(e.onDidChangeModel((s) => this.cancel())), this._listener.add(e.onDidChangeModelContent((s) => this.cancel())));
  }
  dispose() {
    this._listener.dispose(), super.dispose();
  }
}
class Bge extends Ss {
  constructor(e, t) {
    super(t), this._listener = e.onDidChangeContent(() => this.cancel());
  }
  dispose() {
    this._listener.dispose(), super.dispose();
  }
}
var w0t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, S0t = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const E0t = dn.register({
  description: "inline-progress-widget",
  stickiness: 1,
  showIfCollapsed: !0,
  after: {
    content: tPe,
    inlineClassName: "inline-editor-progress-decoration",
    inlineClassNameAffectsLetterSpacing: !0
  }
}), oG = class oG extends ge {
  constructor(e, t, n, r, s) {
    super(), this.typeId = e, this.editor = t, this.range = n, this.delegate = s, this.allowEditorOverflow = !1, this.suppressMouseDown = !0, this.create(r), this.editor.addContentWidget(this), this.editor.layoutContentWidget(this);
  }
  create(e) {
    this.domNode = Ge(".inline-progress-widget"), this.domNode.role = "button", this.domNode.title = e;
    const t = Ge("span.icon");
    this.domNode.append(t), t.classList.add(...qt.asClassNameArray(Pe.loading), "codicon-modifier-spin");
    const n = () => {
      const r = this.editor.getOption(
        75
        /* EditorOption.lineHeight */
      );
      this.domNode.style.height = `${r}px`, this.domNode.style.width = `${Math.ceil(0.8 * r)}px`;
    };
    n(), this._register(this.editor.onDidChangeConfiguration((r) => {
      (r.hasChanged(
        61
        /* EditorOption.fontSize */
      ) || r.hasChanged(
        75
        /* EditorOption.lineHeight */
      )) && n();
    })), this._register(Ce(this.domNode, Xe.CLICK, (r) => {
      this.delegate.cancel();
    }));
  }
  getId() {
    return oG.baseId + "." + this.typeId;
  }
  getDomNode() {
    return this.domNode;
  }
  getPosition() {
    return {
      position: { lineNumber: this.range.startLineNumber, column: this.range.startColumn },
      preference: [
        0
        /* ContentWidgetPositionPreference.EXACT */
      ]
    };
  }
  dispose() {
    super.dispose(), this.editor.removeContentWidget(this);
  }
};
oG.baseId = "editor.widget.inlineProgressWidget";
let kse = oG, YU = class extends ge {
  constructor(e, t, n) {
    super(), this.id = e, this._editor = t, this._instantiationService = n, this._showDelay = 500, this._showPromise = this._register(new er()), this._currentWidget = this._register(new er()), this._operationIdPool = 0, this._currentDecorations = t.createDecorationsCollection();
  }
  dispose() {
    super.dispose(), this._currentDecorations.clear();
  }
  async showWhile(e, t, n, r, s) {
    const o = this._operationIdPool++;
    this._currentOperation = o, this.clear(), this._showPromise.value = jy(() => {
      const a = z.fromPositions(e);
      this._currentDecorations.set([{
        range: a,
        options: E0t
      }]).length > 0 && (this._currentWidget.value = this._instantiationService.createInstance(kse, this.id, this._editor, a, t, r));
    }, s ?? this._showDelay);
    try {
      return await n;
    } finally {
      this._currentOperation === o && (this.clear(), this._currentOperation = void 0);
    }
  }
  clear() {
    this._showPromise.clear(), this._currentDecorations.clear(), this._currentWidget.clear();
  }
};
YU = w0t([
  S0t(2, xt)
], YU);
const ad = Vn("openerService");
function x0t(i, e) {
  return i.with({ fragment: `${e.startLineNumber},${e.startColumn}${e.endLineNumber ? `-${e.endLineNumber}${e.endColumn ? `,${e.endColumn}` : ""}` : ""}` });
}
function L0t(i) {
  let e;
  const t = /^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(i.fragment);
  return t && (e = {
    startLineNumber: parseInt(t[1]),
    startColumn: t[2] ? parseInt(t[2]) : 1,
    endLineNumber: t[4] ? parseInt(t[4]) : void 0,
    endColumn: t[4] ? t[5] ? parseInt(t[5]) : 1 : void 0
  }, i = i.with({ fragment: "" })), { selection: e, uri: i };
}
var T0t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, oDe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Dse, rL;
let n0 = (rL = class {
  constructor(e, t, n) {
    this._options = e, this._languageService = t, this._openerService = n;
  }
  render(e, t, n) {
    const r = AB(e, {
      codeBlockRenderer: (s, o) => this.renderCodeBlock(s, o),
      actionHandler: (s, o) => this.openMarkdownLink(s, o),
      ...t
    }, n);
    return r.element.classList.add("rendered-markdown"), r;
  }
  async renderCodeBlock(e, t) {
    var o, a;
    let n;
    e ? n = this._languageService.getLanguageIdByLanguageName(e) : this._options.editor && (n = (o = this._options.editor.getModel()) == null ? void 0 : o.getLanguageId()), n || (n = $h);
    const r = await Ipt(this._languageService, t, n), s = document.createElement("span");
    if (s.innerHTML = ((a = Dse._ttpTokenizer) == null ? void 0 : a.createHTML(r)) ?? r, this._options.editor) {
      const l = this._options.editor.getOption(
        59
        /* EditorOption.fontInfo */
      );
      Ma(s, l);
    } else this._options.codeBlockFontFamily && (s.style.fontFamily = this._options.codeBlockFontFamily);
    return this._options.codeBlockFontSize !== void 0 && (s.style.fontSize = this._options.codeBlockFontSize), s;
  }
  async openMarkdownLink(e, t) {
    await Hge(this._openerService, e, t.isTrusted);
  }
}, Dse = rL, rL._ttpTokenizer = Db("tokenizeToString", {
  createHTML(e) {
    return e;
  }
}), rL);
n0 = Dse = T0t([
  oDe(1, Gr),
  oDe(2, ad)
], n0);
async function Hge(i, e, t, n) {
  try {
    return await i.open(e, {
      fromUserGesture: !0,
      allowContributedOpeners: !0,
      allowCommands: k0t(t),
      skipValidation: n
    });
  } catch (r) {
    return fn(r), !1;
  }
}
function k0t(i) {
  return i === !0 ? !0 : i && Array.isArray(i.enabledCommands) ? i.enabledCommands : !1;
}
var D0t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, aDe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, HW, F1;
let Vd = (F1 = class {
  static get(e) {
    return e.getContribution(HW.ID);
  }
  constructor(e, t, n) {
    this._openerService = n, this._messageWidget = new er(), this._messageListeners = new ke(), this._mouseOverMessage = !1, this._editor = e, this._visible = HW.MESSAGE_VISIBLE.bindTo(t);
  }
  dispose() {
    this._messageListeners.dispose(), this._messageWidget.dispose(), this._visible.reset();
  }
  showMessage(e, t) {
    if (lu(ob(e) ? e.value : e), this._visible.set(!0), this._messageWidget.clear(), this._messageListeners.clear(), ob(e)) {
      const r = this._messageListeners.add(AB(e, {
        actionHandler: (s, o) => {
          this.closeMessage(), Hge(this._openerService, s, o.isTrusted);
        }
      }));
      this._messageWidget.value = new Uee(this._editor, t, r.element);
    } else
      this._messageWidget.value = new Uee(this._editor, t, e);
    this._messageListeners.add(Ze.debounce(this._editor.onDidBlurEditorText, (r, s) => s, 0)(() => {
      this._mouseOverMessage || this._messageWidget.value && pa(ea(), this._messageWidget.value.getDomNode()) || this.closeMessage();
    })), this._messageListeners.add(this._editor.onDidChangeCursorPosition(() => this.closeMessage())), this._messageListeners.add(this._editor.onDidDispose(() => this.closeMessage())), this._messageListeners.add(this._editor.onDidChangeModel(() => this.closeMessage())), this._messageListeners.add(Ce(this._messageWidget.value.getDomNode(), Xe.MOUSE_ENTER, () => this._mouseOverMessage = !0, !0)), this._messageListeners.add(Ce(this._messageWidget.value.getDomNode(), Xe.MOUSE_LEAVE, () => this._mouseOverMessage = !1, !0));
    let n;
    this._messageListeners.add(this._editor.onMouseMove((r) => {
      r.target.position && (n ? n.containsPosition(r.target.position) || this.closeMessage() : n = new z(t.lineNumber - 3, 1, r.target.position.lineNumber + 3, 1));
    }));
  }
  closeMessage() {
    this._visible.reset(), this._messageListeners.clear(), this._messageWidget.value && this._messageListeners.add(Uee.fadeOut(this._messageWidget.value));
  }
}, HW = F1, F1.ID = "editor.contrib.messageController", F1.MESSAGE_VISIBLE = new ut("messageVisible", !1, S(1277, "Whether the editor is currently showing an inline message")), F1);
Vd = HW = D0t([
  aDe(1, Jt),
  aDe(2, ad)
], Vd);
const I0t = jo.bindToContribution(Vd.get);
ct(new I0t({
  id: "leaveEditorMessage",
  precondition: Vd.MESSAGE_VISIBLE,
  handler: (i) => i.closeMessage(),
  kbOpts: {
    weight: 130,
    primary: 9
    /* KeyCode.Escape */
  }
}));
let Uee = class {
  static fadeOut(e) {
    const t = () => {
      e.dispose(), clearTimeout(n), e.getDomNode().removeEventListener("animationend", t);
    }, n = setTimeout(t, 110);
    return e.getDomNode().addEventListener("animationend", t), e.getDomNode().classList.add("fadeOut"), { dispose: t };
  }
  constructor(e, { lineNumber: t, column: n }, r) {
    this.allowEditorOverflow = !0, this.suppressMouseDown = !1, this._editor = e, this._editor.revealLinesInCenterIfOutsideViewport(
      t,
      t,
      0
      /* ScrollType.Smooth */
    ), this._position = { lineNumber: t, column: n }, this._domNode = document.createElement("div"), this._domNode.classList.add("monaco-editor-overlaymessage"), this._domNode.style.marginLeft = "-6px";
    const s = document.createElement("div");
    s.classList.add("anchor", "top"), this._domNode.appendChild(s);
    const o = document.createElement("div");
    typeof r == "string" ? (o.classList.add("message"), o.textContent = r) : (r.classList.add("message"), o.appendChild(r)), this._domNode.appendChild(o);
    const a = document.createElement("div");
    a.classList.add("anchor", "below"), this._domNode.appendChild(a), this._editor.addContentWidget(this), this._domNode.classList.add("fadeIn");
  }
  dispose() {
    this._editor.removeContentWidget(this);
  }
  getId() {
    return "messageoverlay";
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return {
      position: this._position,
      preference: [
        1,
        2
      ],
      positionAffinity: 1
    };
  }
  afterRender(e) {
    this._domNode.classList.toggle(
      "below",
      e === 2
      /* ContentWidgetPositionPreference.BELOW */
    );
  }
};
Si(
  Vd.ID,
  Vd,
  4
  /* EditorContributionInstantiation.Lazy */
);
class N0t {
  constructor() {
    this._value = "", this._pos = 0;
  }
  reset(e) {
    return this._value = e, this._pos = 0, this;
  }
  next() {
    return this._pos += 1, this;
  }
  hasNext() {
    return this._pos < this._value.length - 1;
  }
  cmp(e) {
    const t = e.charCodeAt(0), n = this._value.charCodeAt(this._pos);
    return t - n;
  }
  value() {
    return this._value[this._pos];
  }
}
class R0t {
  constructor(e = !0) {
    this._caseSensitive = e;
  }
  reset(e) {
    return this._value = e, this._from = 0, this._to = 0, this.next();
  }
  hasNext() {
    return this._to < this._value.length;
  }
  next() {
    this._from = this._to;
    let e = !0;
    for (; this._to < this._value.length; this._to++)
      if (this._value.charCodeAt(this._to) === 46)
        if (e)
          this._from++;
        else
          break;
      else
        e = !1;
    return this;
  }
  cmp(e) {
    return this._caseSensitive ? Mhe(e, this._value, 0, e.length, this._from, this._to) : mB(e, this._value, 0, e.length, this._from, this._to);
  }
  value() {
    return this._value.substring(this._from, this._to);
  }
}
class A0t {
  constructor(e = !0, t = !0) {
    this._splitOnBackslash = e, this._caseSensitive = t;
  }
  reset(e) {
    this._from = 0, this._to = 0, this._value = e, this._valueLen = e.length;
    for (let t = e.length - 1; t >= 0; t--, this._valueLen--) {
      const n = this._value.charCodeAt(t);
      if (!(n === 47 || this._splitOnBackslash && n === 92))
        break;
    }
    return this.next();
  }
  hasNext() {
    return this._to < this._valueLen;
  }
  next() {
    this._from = this._to;
    let e = !0;
    for (; this._to < this._valueLen; this._to++) {
      const t = this._value.charCodeAt(this._to);
      if (t === 47 || this._splitOnBackslash && t === 92)
        if (e)
          this._from++;
        else
          break;
      else
        e = !1;
    }
    return this;
  }
  cmp(e) {
    return this._caseSensitive ? Mhe(e, this._value, 0, e.length, this._from, this._to) : mB(e, this._value, 0, e.length, this._from, this._to);
  }
  value() {
    return this._value.substring(this._from, this._to);
  }
}
class O0t {
  constructor(e, t) {
    this._ignorePathCasing = e, this._ignoreQueryAndFragment = t, this._states = [], this._stateIdx = 0;
  }
  reset(e) {
    return this._value = e, this._states = [], this._value.scheme && this._states.push(
      1
      /* UriIteratorState.Scheme */
    ), this._value.authority && this._states.push(
      2
      /* UriIteratorState.Authority */
    ), this._value.path && (this._pathIterator = new A0t(!1, !this._ignorePathCasing(e)), this._pathIterator.reset(e.path), this._pathIterator.value() && this._states.push(
      3
      /* UriIteratorState.Path */
    )), this._ignoreQueryAndFragment(e) || (this._value.query && this._states.push(
      4
      /* UriIteratorState.Query */
    ), this._value.fragment && this._states.push(
      5
      /* UriIteratorState.Fragment */
    )), this._stateIdx = 0, this;
  }
  next() {
    return this._states[this._stateIdx] === 3 && this._pathIterator.hasNext() ? this._pathIterator.next() : this._stateIdx += 1, this;
  }
  hasNext() {
    return this._states[this._stateIdx] === 3 && this._pathIterator.hasNext() || this._stateIdx < this._states.length - 1;
  }
  cmp(e) {
    if (this._states[this._stateIdx] === 1)
      return iie(e, this._value.scheme);
    if (this._states[this._stateIdx] === 2)
      return iie(e, this._value.authority);
    if (this._states[this._stateIdx] === 3)
      return this._pathIterator.cmp(e);
    if (this._states[this._stateIdx] === 4)
      return Q3(e, this._value.query);
    if (this._states[this._stateIdx] === 5)
      return Q3(e, this._value.fragment);
    throw new Error();
  }
  value() {
    if (this._states[this._stateIdx] === 1)
      return this._value.scheme;
    if (this._states[this._stateIdx] === 2)
      return this._value.authority;
    if (this._states[this._stateIdx] === 3)
      return this._pathIterator.value();
    if (this._states[this._stateIdx] === 4)
      return this._value.query;
    if (this._states[this._stateIdx] === 5)
      return this._value.fragment;
    throw new Error();
  }
}
const P3 = class P3 {
  static wrap(e) {
    return e === void 0 ? P3.Val : e;
  }
  static unwrap(e) {
    return e === P3.Val ? void 0 : e;
  }
};
P3.Val = Symbol("undefined_placeholder");
let Xv = P3;
class oH {
  constructor() {
    this.height = 1, this.value = void 0, this.key = void 0, this.left = void 0, this.mid = void 0, this.right = void 0;
  }
  rotateLeft() {
    const e = this.right;
    return this.right = e.left, e.left = this, this.updateHeight(), e.updateHeight(), e;
  }
  rotateRight() {
    const e = this.left;
    return this.left = e.right, e.right = this, this.updateHeight(), e.updateHeight(), e;
  }
  updateHeight() {
    this.height = 1 + Math.max(this.heightLeft, this.heightRight);
  }
  balanceFactor() {
    return this.heightRight - this.heightLeft;
  }
  get heightLeft() {
    var e;
    return ((e = this.left) == null ? void 0 : e.height) ?? 0;
  }
  get heightRight() {
    var e;
    return ((e = this.right) == null ? void 0 : e.height) ?? 0;
  }
}
class aR {
  static forUris(e = () => !1, t = () => !1) {
    return new aR(new O0t(e, t));
  }
  static forStrings() {
    return new aR(new N0t());
  }
  static forConfigKeys() {
    return new aR(new R0t());
  }
  constructor(e) {
    this._iter = e;
  }
  clear() {
    this._root = void 0;
  }
  set(e, t) {
    const n = this._iter.reset(e);
    let r;
    this._root || (this._root = new oH(), this._root.segment = n.value());
    const s = [];
    for (r = this._root; ; ) {
      const a = n.cmp(r.segment);
      if (a > 0)
        r.left || (r.left = new oH(), r.left.segment = n.value()), s.push([-1, r]), r = r.left;
      else if (a < 0)
        r.right || (r.right = new oH(), r.right.segment = n.value()), s.push([1, r]), r = r.right;
      else if (n.hasNext())
        n.next(), r.mid || (r.mid = new oH(), r.mid.segment = n.value()), s.push([0, r]), r = r.mid;
      else
        break;
    }
    const o = Xv.unwrap(r.value);
    r.value = Xv.wrap(t), r.key = e;
    for (let a = s.length - 1; a >= 0; a--) {
      const l = s[a][1];
      l.updateHeight();
      const c = l.balanceFactor();
      if (c < -1 || c > 1) {
        const u = s[a][0], d = s[a + 1][0];
        if (u === 1 && d === 1)
          s[a][1] = l.rotateLeft();
        else if (u === -1 && d === -1)
          s[a][1] = l.rotateRight();
        else if (u === 1 && d === -1)
          l.right = s[a + 1][1] = s[a + 1][1].rotateRight(), s[a][1] = l.rotateLeft();
        else if (u === -1 && d === 1)
          l.left = s[a + 1][1] = s[a + 1][1].rotateLeft(), s[a][1] = l.rotateRight();
        else
          throw new Error();
        if (a > 0)
          switch (s[a - 1][0]) {
            case -1:
              s[a - 1][1].left = s[a][1];
              break;
            case 1:
              s[a - 1][1].right = s[a][1];
              break;
            case 0:
              s[a - 1][1].mid = s[a][1];
              break;
          }
        else
          this._root = s[0][1];
      }
    }
    return o;
  }
  get(e) {
    var t;
    return Xv.unwrap((t = this._getNode(e)) == null ? void 0 : t.value);
  }
  _getNode(e) {
    const t = this._iter.reset(e);
    let n = this._root;
    for (; n; ) {
      const r = t.cmp(n.segment);
      if (r > 0)
        n = n.left;
      else if (r < 0)
        n = n.right;
      else if (t.hasNext())
        t.next(), n = n.mid;
      else
        break;
    }
    return n;
  }
  has(e) {
    const t = this._getNode(e);
    return !((t == null ? void 0 : t.value) === void 0 && (t == null ? void 0 : t.mid) === void 0);
  }
  delete(e) {
    return this._delete(e, !1);
  }
  deleteSuperstr(e) {
    return this._delete(e, !0);
  }
  _delete(e, t) {
    const n = this._iter.reset(e), r = [];
    let s = this._root;
    for (; s; ) {
      const o = n.cmp(s.segment);
      if (o > 0)
        r.push([-1, s]), s = s.left;
      else if (o < 0)
        r.push([1, s]), s = s.right;
      else if (n.hasNext())
        n.next(), r.push([0, s]), s = s.mid;
      else
        break;
    }
    if (s) {
      if (t ? (s.left = void 0, s.mid = void 0, s.right = void 0, s.height = 1) : (s.key = void 0, s.value = void 0), !s.mid && !s.value)
        if (s.left && s.right) {
          const o = [[1, s]], a = this._min(s.right, o);
          if (a.key) {
            s.key = a.key, s.value = a.value, s.segment = a.segment;
            const l = a.right;
            if (o.length > 1) {
              const [u, d] = o[o.length - 1];
              switch (u) {
                case -1:
                  d.left = l;
                  break;
                case 0:
                  K3(!1);
                case 1:
                  K3(!1);
              }
            } else
              s.right = l;
            const c = this._balanceByStack(o);
            if (r.length > 0) {
              const [u, d] = r[r.length - 1];
              switch (u) {
                case -1:
                  d.left = c;
                  break;
                case 0:
                  d.mid = c;
                  break;
                case 1:
                  d.right = c;
                  break;
              }
            } else
              this._root = c;
          }
        } else {
          const o = s.left ?? s.right;
          if (r.length > 0) {
            const [a, l] = r[r.length - 1];
            switch (a) {
              case -1:
                l.left = o;
                break;
              case 0:
                l.mid = o;
                break;
              case 1:
                l.right = o;
                break;
            }
          } else
            this._root = o;
        }
      this._root = this._balanceByStack(r) ?? this._root;
    }
  }
  _min(e, t) {
    for (; e.left; )
      t.push([-1, e]), e = e.left;
    return e;
  }
  _balanceByStack(e) {
    for (let t = e.length - 1; t >= 0; t--) {
      const n = e[t][1];
      n.updateHeight();
      const r = n.balanceFactor();
      if (r > 1 ? (n.right.balanceFactor() >= 0 || (n.right = n.right.rotateRight()), e[t][1] = n.rotateLeft()) : r < -1 && (n.left.balanceFactor() <= 0 || (n.left = n.left.rotateLeft()), e[t][1] = n.rotateRight()), t > 0)
        switch (e[t - 1][0]) {
          case -1:
            e[t - 1][1].left = e[t][1];
            break;
          case 1:
            e[t - 1][1].right = e[t][1];
            break;
          case 0:
            e[t - 1][1].mid = e[t][1];
            break;
        }
      else
        return e[0][1];
    }
  }
  findSubstr(e) {
    const t = this._iter.reset(e);
    let n = this._root, r;
    for (; n; ) {
      const s = t.cmp(n.segment);
      if (s > 0)
        n = n.left;
      else if (s < 0)
        n = n.right;
      else if (t.hasNext())
        t.next(), r = Xv.unwrap(n.value) || r, n = n.mid;
      else
        break;
    }
    return n && Xv.unwrap(n.value) || r;
  }
  findSuperstr(e) {
    return this._findSuperstrOrElement(e, !1);
  }
  _findSuperstrOrElement(e, t) {
    const n = this._iter.reset(e);
    let r = this._root;
    for (; r; ) {
      const s = n.cmp(r.segment);
      if (s > 0)
        r = r.left;
      else if (s < 0)
        r = r.right;
      else if (n.hasNext())
        n.next(), r = r.mid;
      else
        return r.mid ? this._entries(r.mid) : t ? Xv.unwrap(r.value) : void 0;
    }
  }
  forEach(e) {
    for (const [t, n] of this)
      e(n, t);
  }
  *[Symbol.iterator]() {
    yield* this._entries(this._root);
  }
  _entries(e) {
    const t = [];
    return this._dfsEntries(e, t), t[Symbol.iterator]();
  }
  _dfsEntries(e, t) {
    e && (e.left && this._dfsEntries(e.left, t), e.value !== void 0 && t.push([e.key, Xv.unwrap(e.value)]), e.mid && this._dfsEntries(e.mid, t), e.right && this._dfsEntries(e.right, t));
  }
}
const i0 = Vn("contextService");
function Ise(i) {
  const e = i;
  return typeof (e == null ? void 0 : e.id) == "string" && Ht.isUri(e.uri);
}
function M0t(i) {
  const e = i;
  return typeof (e == null ? void 0 : e.id) == "string" && !Ise(i) && !B0t(i);
}
const P0t = { id: "empty-window" };
function F0t(i, e) {
  if (typeof i == "string" || typeof i > "u")
    return typeof i == "string" ? {
      id: E1(i)
    } : P0t;
  const t = i;
  return t.configuration ? {
    id: t.id,
    configPath: t.configuration
  } : t.folders.length === 1 ? {
    id: t.id,
    uri: t.folders[0].uri
  } : {
    id: t.id
  };
}
function B0t(i) {
  const e = i;
  return typeof (e == null ? void 0 : e.id) == "string" && Ht.isUri(e.configPath);
}
class H0t {
  constructor(e, t) {
    this.raw = t, this.uri = e.uri, this.index = e.index, this.name = e.name;
  }
  toJSON() {
    return { uri: this.uri, name: this.name, index: this.index };
  }
}
const Nse = "code-workspace";
S(2032, "Code Workspace");
const U5e = "4064f6ec-cb38-4ad0-af64-ee6467e63c82";
function W0t(i) {
  return i.id === U5e;
}
var Wge = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, X4 = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class Vge {
  constructor(e) {
    this.copyMimeTypes = [], this.kind = e, this.providedDropEditKinds = [this.kind], this.providedPasteEditKinds = [this.kind];
  }
  async provideDocumentPasteEdits(e, t, n, r, s) {
    const o = await this.getEdit(n, s);
    if (o)
      return {
        edits: [{ insertText: o.insertText, title: o.title, kind: o.kind, handledMimeType: o.handledMimeType, yieldTo: o.yieldTo }],
        dispose() {
        }
      };
  }
  async provideDocumentDropEdits(e, t, n, r) {
    const s = await this.getEdit(n, r);
    if (s)
      return {
        edits: [{ insertText: s.insertText, title: s.title, kind: s.kind, handledMimeType: s.handledMimeType, yieldTo: s.yieldTo }],
        dispose() {
        }
      };
  }
}
const aG = class aG extends Vge {
  constructor() {
    super(Ps.Empty.append("text", "plain")), this.id = aG.id, this.dropMimeTypes = [co.text], this.pasteMimeTypes = [co.text];
  }
  async getEdit(e, t) {
    const n = e.get(co.text);
    if (!n || e.has(co.uriList))
      return;
    const r = await n.asString();
    return {
      handledMimeType: co.text,
      title: S(921, "Insert Plain Text"),
      insertText: r,
      kind: this.kind
    };
  }
};
aG.id = "text";
let mT = aG;
class z5e extends Vge {
  constructor() {
    super(Ps.Empty.append("uri", "path", "absolute")), this.dropMimeTypes = [co.uriList], this.pasteMimeTypes = [co.uriList];
  }
  async getEdit(e, t) {
    const n = await $5e(e);
    if (!n.length || t.isCancellationRequested)
      return;
    let r = 0;
    const s = n.map(({ uri: a, originalText: l }) => a.scheme === Yt.file ? a.fsPath : (r++, l)).join(" ");
    let o;
    return r > 0 ? o = n.length > 1 ? S(922, "Insert Uris") : S(923, "Insert Uri") : o = n.length > 1 ? S(924, "Insert Paths") : S(925, "Insert Path"), {
      handledMimeType: co.uriList,
      insertText: s,
      title: o,
      kind: this.kind
    };
  }
}
let XU = class extends Vge {
  constructor(e) {
    super(Ps.Empty.append("uri", "path", "relative")), this._workspaceContextService = e, this.dropMimeTypes = [co.uriList], this.pasteMimeTypes = [co.uriList];
  }
  async getEdit(e, t) {
    const n = await $5e(e);
    if (!n.length || t.isCancellationRequested)
      return;
    const r = ym(n.map(({ uri: s }) => {
      const o = this._workspaceContextService.getWorkspaceFolder(s);
      return o ? Rrt(o.uri, s) : void 0;
    }));
    if (r.length)
      return {
        handledMimeType: co.uriList,
        insertText: r.join(" "),
        title: n.length > 1 ? S(926, "Insert Relative Paths") : S(927, "Insert Relative Path"),
        kind: this.kind
      };
  }
};
XU = Wge([
  X4(0, i0)
], XU);
class V0t {
  constructor() {
    this.kind = new Ps("html"), this.providedPasteEditKinds = [this.kind], this.copyMimeTypes = [], this.pasteMimeTypes = ["text/html"], this._yieldTo = [{ mimeType: co.text }];
  }
  async provideDocumentPasteEdits(e, t, n, r, s) {
    var l;
    if (r.triggerKind !== x4.PasteAs && !((l = r.only) != null && l.contains(this.kind)))
      return;
    const o = n.get("text/html"), a = await (o == null ? void 0 : o.asString());
    if (!(!a || s.isCancellationRequested))
      return {
        dispose() {
        },
        edits: [{
          insertText: a,
          yieldTo: this._yieldTo,
          title: S(928, "Insert HTML"),
          kind: this.kind
        }]
      };
  }
}
async function $5e(i) {
  const e = i.get(co.uriList);
  if (!e)
    return [];
  const t = await e.asString(), n = [];
  for (const r of _K.parse(t))
    try {
      n.push({ uri: Ht.parse(r), originalText: r });
    } catch {
    }
  return n;
}
const vx = { scheme: "*", hasAccessToAllModels: !0 };
let Rse = class extends ge {
  constructor(e, t) {
    super(), this._register(e.documentDropEditProvider.register(vx, new mT())), this._register(e.documentDropEditProvider.register(vx, new z5e())), this._register(e.documentDropEditProvider.register(vx, new XU(t)));
  }
};
Rse = Wge([
  X4(0, St),
  X4(1, i0)
], Rse);
let Ase = class extends ge {
  constructor(e, t) {
    super(), this._register(e.documentPasteEditProvider.register(vx, new mT())), this._register(e.documentPasteEditProvider.register(vx, new z5e())), this._register(e.documentPasteEditProvider.register(vx, new XU(t))), this._register(e.documentPasteEditProvider.register(vx, new V0t()));
  }
};
Ase = Wge([
  X4(0, St),
  X4(1, i0)
], Ase);
const Ig = class Ig {
  constructor() {
    this.value = "", this.pos = 0;
  }
  static isDigitCharacter(e) {
    return e >= 48 && e <= 57;
  }
  static isVariableCharacter(e) {
    return e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90;
  }
  text(e) {
    this.value = e, this.pos = 0;
  }
  tokenText(e) {
    return this.value.substr(e.pos, e.len);
  }
  next() {
    if (this.pos >= this.value.length)
      return { type: 14, pos: this.pos, len: 0 };
    const e = this.pos;
    let t = 0, n = this.value.charCodeAt(e), r;
    if (r = Ig._table[n], typeof r == "number")
      return this.pos += 1, { type: r, pos: e, len: 1 };
    if (Ig.isDigitCharacter(n)) {
      r = 8;
      do
        t += 1, n = this.value.charCodeAt(e + t);
      while (Ig.isDigitCharacter(n));
      return this.pos += t, { type: r, pos: e, len: t };
    }
    if (Ig.isVariableCharacter(n)) {
      r = 9;
      do
        n = this.value.charCodeAt(e + ++t);
      while (Ig.isVariableCharacter(n) || Ig.isDigitCharacter(n));
      return this.pos += t, { type: r, pos: e, len: t };
    }
    r = 10;
    do
      t += 1, n = this.value.charCodeAt(e + t);
    while (!isNaN(n) && typeof Ig._table[n] > "u" && !Ig.isDigitCharacter(n) && !Ig.isVariableCharacter(n));
    return this.pos += t, { type: r, pos: e, len: t };
  }
};
Ig._table = {
  36: 0,
  58: 1,
  44: 2,
  123: 3,
  125: 4,
  92: 5,
  47: 6,
  124: 7,
  43: 11,
  45: 12,
  63: 13
};
let Ose = Ig;
class a2 {
  constructor() {
    this._children = [];
  }
  appendChild(e) {
    return e instanceof su && this._children[this._children.length - 1] instanceof su ? this._children[this._children.length - 1].value += e.value : (e.parent = this, this._children.push(e)), this;
  }
  replace(e, t) {
    const { parent: n } = e, r = n.children.indexOf(e), s = n.children.slice(0);
    s.splice(r, 1, ...t), n._children = s, (function o(a, l) {
      for (const c of a)
        c.parent = l, o(c.children, c);
    })(t, n);
  }
  get children() {
    return this._children;
  }
  get rightMostDescendant() {
    return this._children.length > 0 ? this._children[this._children.length - 1].rightMostDescendant : this;
  }
  get snippet() {
    let e = this;
    for (; ; ) {
      if (!e)
        return;
      if (e instanceof WB)
        return e;
      e = e.parent;
    }
  }
  toString() {
    return this.children.reduce((e, t) => e + t.toString(), "");
  }
  len() {
    return 0;
  }
}
class su extends a2 {
  constructor(e) {
    super(), this.value = e;
  }
  toString() {
    return this.value;
  }
  len() {
    return this.value.length;
  }
  clone() {
    return new su(this.value);
  }
}
class j5e extends a2 {
}
class Df extends j5e {
  static compareByIndex(e, t) {
    return e.index === t.index ? 0 : e.isFinalTabstop ? 1 : t.isFinalTabstop || e.index < t.index ? -1 : e.index > t.index ? 1 : 0;
  }
  constructor(e) {
    super(), this.index = e;
  }
  get isFinalTabstop() {
    return this.index === 0;
  }
  get choice() {
    return this._children.length === 1 && this._children[0] instanceof l2 ? this._children[0] : void 0;
  }
  clone() {
    const e = new Df(this.index);
    return this.transform && (e.transform = this.transform.clone()), e._children = this.children.map((t) => t.clone()), e;
  }
}
class l2 extends a2 {
  constructor() {
    super(...arguments), this.options = [];
  }
  appendChild(e) {
    return e instanceof su && (e.parent = this, this.options.push(e)), this;
  }
  toString() {
    return this.options[0].value;
  }
  len() {
    return this.options[0].len();
  }
  clone() {
    const e = new l2();
    return this.options.forEach(e.appendChild, e), e;
  }
}
let U0t = class G5e extends a2 {
  constructor() {
    super(...arguments), this.regexp = new RegExp("");
  }
  resolve(e) {
    const t = this;
    let n = !1, r = e.replace(this.regexp, function() {
      return n = !0, t._replace(Array.prototype.slice.call(arguments, 0, -2));
    });
    return !n && this._children.some((s) => s instanceof Hp && !!s.elseValue) && (r = this._replace([])), r;
  }
  _replace(e) {
    let t = "";
    for (const n of this._children)
      if (n instanceof Hp) {
        let r = e[n.index] || "";
        r = n.resolve(r), t += r;
      } else
        t += n.toString();
    return t;
  }
  toString() {
    return "";
  }
  clone() {
    const e = new G5e();
    return e.regexp = new RegExp(this.regexp.source, (this.regexp.ignoreCase ? "i" : "") + (this.regexp.global ? "g" : "")), e._children = this.children.map((t) => t.clone()), e;
  }
};
class Hp extends a2 {
  constructor(e, t, n, r) {
    super(), this.index = e, this.shorthandName = t, this.ifValue = n, this.elseValue = r;
  }
  resolve(e) {
    return this.shorthandName === "upcase" ? e ? e.toLocaleUpperCase() : "" : this.shorthandName === "downcase" ? e ? e.toLocaleLowerCase() : "" : this.shorthandName === "capitalize" ? e ? e[0].toLocaleUpperCase() + e.substr(1) : "" : this.shorthandName === "pascalcase" ? e ? this._toPascalCase(e) : "" : this.shorthandName === "camelcase" ? e ? this._toCamelCase(e) : "" : e && typeof this.ifValue == "string" ? this.ifValue : !e && typeof this.elseValue == "string" ? this.elseValue : e || "";
  }
  _toPascalCase(e) {
    const t = e.match(/[a-z0-9]+/gi);
    return t ? t.map((n) => n.charAt(0).toUpperCase() + n.substr(1)).join("") : e;
  }
  _toCamelCase(e) {
    const t = e.match(/[a-z0-9]+/gi);
    return t ? t.map((n, r) => r === 0 ? n.charAt(0).toLowerCase() + n.substr(1) : n.charAt(0).toUpperCase() + n.substr(1)).join("") : e;
  }
  clone() {
    return new Hp(this.index, this.shorthandName, this.ifValue, this.elseValue);
  }
}
class Z4 extends j5e {
  constructor(e) {
    super(), this.name = e;
  }
  resolve(e) {
    let t = e.resolve(this);
    return this.transform && (t = this.transform.resolve(t || "")), t !== void 0 ? (this._children = [new su(t)], !0) : !1;
  }
  clone() {
    const e = new Z4(this.name);
    return this.transform && (e.transform = this.transform.clone()), e._children = this.children.map((t) => t.clone()), e;
  }
}
function lDe(i, e) {
  const t = [...i];
  for (; t.length > 0; ) {
    const n = t.shift();
    if (!e(n))
      break;
    t.unshift(...n.children);
  }
}
class WB extends a2 {
  get placeholderInfo() {
    if (!this._placeholders) {
      const e = [];
      let t;
      this.walk(function(n) {
        return n instanceof Df && (e.push(n), t = !t || t.index < n.index ? n : t), !0;
      }), this._placeholders = { all: e, last: t };
    }
    return this._placeholders;
  }
  get placeholders() {
    const { all: e } = this.placeholderInfo;
    return e;
  }
  offset(e) {
    let t = 0, n = !1;
    return this.walk((r) => r === e ? (n = !0, !1) : (t += r.len(), !0)), n ? t : -1;
  }
  fullLen(e) {
    let t = 0;
    return lDe([e], (n) => (t += n.len(), !0)), t;
  }
  enclosingPlaceholders(e) {
    const t = [];
    let { parent: n } = e;
    for (; n; )
      n instanceof Df && t.push(n), n = n.parent;
    return t;
  }
  resolveVariables(e) {
    return this.walk((t) => (t instanceof Z4 && t.resolve(e) && (this._placeholders = void 0), !0)), this;
  }
  appendChild(e) {
    return this._placeholders = void 0, super.appendChild(e);
  }
  replace(e, t) {
    return this._placeholders = void 0, super.replace(e, t);
  }
  clone() {
    const e = new WB();
    return this._children = this.children.map((t) => t.clone()), e;
  }
  walk(e) {
    lDe(this.children, e);
  }
}
class _T {
  constructor() {
    this._scanner = new Ose(), this._token = { type: 14, pos: 0, len: 0 };
  }
  static escape(e) {
    return e.replace(/\$|}|\\/g, "\\$&");
  }
  static guessNeedsClipboard(e) {
    return /\${?CLIPBOARD/.test(e);
  }
  parse(e, t, n) {
    const r = new WB();
    return this.parseFragment(e, r), this.ensureFinalTabstop(r, n ?? !1, t ?? !1), r;
  }
  parseFragment(e, t) {
    const n = t.children.length;
    for (this._scanner.text(e), this._token = this._scanner.next(); this._parse(t); )
      ;
    const r = /* @__PURE__ */ new Map(), s = [];
    t.walk((l) => (l instanceof Df && (l.isFinalTabstop ? r.set(0, void 0) : !r.has(l.index) && l.children.length > 0 ? r.set(l.index, l.children) : s.push(l)), !0));
    const o = (l, c) => {
      const u = r.get(l.index);
      if (!u)
        return;
      const d = new Df(l.index);
      d.transform = l.transform;
      for (const h of u) {
        const g = h.clone();
        d.appendChild(g), g instanceof Df && r.has(g.index) && !c.has(g.index) && (c.add(g.index), o(g, c), c.delete(g.index));
      }
      t.replace(l, [d]);
    }, a = /* @__PURE__ */ new Set();
    for (const l of s)
      o(l, a);
    return t.children.slice(n);
  }
  ensureFinalTabstop(e, t, n) {
    (t || n && e.placeholders.length > 0) && (e.placeholders.find((s) => s.index === 0) || e.appendChild(new Df(0)));
  }
  _accept(e, t) {
    if (e === void 0 || this._token.type === e) {
      const n = t ? this._scanner.tokenText(this._token) : !0;
      return this._token = this._scanner.next(), n;
    }
    return !1;
  }
  _backTo(e) {
    return this._scanner.pos = e.pos + e.len, this._token = e, !1;
  }
  _until(e) {
    const t = this._token;
    for (; this._token.type !== e; ) {
      if (this._token.type === 14)
        return !1;
      if (this._token.type === 5) {
        const r = this._scanner.next();
        if (r.type !== 0 && r.type !== 4 && r.type !== 5)
          return !1;
      }
      this._token = this._scanner.next();
    }
    const n = this._scanner.value.substring(t.pos, this._token.pos).replace(/\\(\$|}|\\)/g, "$1");
    return this._token = this._scanner.next(), n;
  }
  _parse(e) {
    return this._parseEscaped(e) || this._parseTabstopOrVariableName(e) || this._parseComplexPlaceholder(e) || this._parseComplexVariable(e) || this._parseAnything(e);
  }
  // \$, \\, \} -> just text
  _parseEscaped(e) {
    let t;
    return (t = this._accept(5, !0)) ? (t = this._accept(0, !0) || this._accept(4, !0) || this._accept(5, !0) || t, e.appendChild(new su(t)), !0) : !1;
  }
  // $foo -> variable, $1 -> tabstop
  _parseTabstopOrVariableName(e) {
    let t;
    const n = this._token;
    return this._accept(
      0
      /* TokenType.Dollar */
    ) && (t = this._accept(9, !0) || this._accept(8, !0)) ? (e.appendChild(/^\d+$/.test(t) ? new Df(Number(t)) : new Z4(t)), !0) : this._backTo(n);
  }
  // ${1:<children>}, ${1} -> placeholder
  _parseComplexPlaceholder(e) {
    let t;
    const n = this._token;
    if (!(this._accept(
      0
      /* TokenType.Dollar */
    ) && this._accept(
      3
      /* TokenType.CurlyOpen */
    ) && (t = this._accept(8, !0))))
      return this._backTo(n);
    const s = new Df(Number(t));
    if (this._accept(
      1
      /* TokenType.Colon */
    ))
      for (; ; ) {
        if (this._accept(
          4
          /* TokenType.CurlyClose */
        ))
          return e.appendChild(s), !0;
        if (!this._parse(s))
          return e.appendChild(new su("${" + t + ":")), s.children.forEach(e.appendChild, e), !0;
      }
    else if (s.index > 0 && this._accept(
      7
      /* TokenType.Pipe */
    )) {
      const o = new l2();
      for (; ; ) {
        if (this._parseChoiceElement(o)) {
          if (this._accept(
            2
            /* TokenType.Comma */
          ))
            continue;
          if (this._accept(
            7
            /* TokenType.Pipe */
          ) && (s.appendChild(o), this._accept(
            4
            /* TokenType.CurlyClose */
          )))
            return e.appendChild(s), !0;
        }
        return this._backTo(n), !1;
      }
    } else return this._accept(
      6
      /* TokenType.Forwardslash */
    ) ? this._parseTransform(s) ? (e.appendChild(s), !0) : (this._backTo(n), !1) : this._accept(
      4
      /* TokenType.CurlyClose */
    ) ? (e.appendChild(s), !0) : this._backTo(n);
  }
  _parseChoiceElement(e) {
    const t = this._token, n = [];
    for (; !(this._token.type === 2 || this._token.type === 7); ) {
      let r;
      if ((r = this._accept(5, !0)) ? r = this._accept(2, !0) || this._accept(7, !0) || this._accept(5, !0) || r : r = this._accept(void 0, !0), !r)
        return this._backTo(t), !1;
      n.push(r);
    }
    return n.length === 0 ? (this._backTo(t), !1) : (e.appendChild(new su(n.join(""))), !0);
  }
  // ${foo:<children>}, ${foo} -> variable
  _parseComplexVariable(e) {
    let t;
    const n = this._token;
    if (!(this._accept(
      0
      /* TokenType.Dollar */
    ) && this._accept(
      3
      /* TokenType.CurlyOpen */
    ) && (t = this._accept(9, !0))))
      return this._backTo(n);
    const s = new Z4(t);
    if (this._accept(
      1
      /* TokenType.Colon */
    ))
      for (; ; ) {
        if (this._accept(
          4
          /* TokenType.CurlyClose */
        ))
          return e.appendChild(s), !0;
        if (!this._parse(s))
          return e.appendChild(new su("${" + t + ":")), s.children.forEach(e.appendChild, e), !0;
      }
    else return this._accept(
      6
      /* TokenType.Forwardslash */
    ) ? this._parseTransform(s) ? (e.appendChild(s), !0) : (this._backTo(n), !1) : this._accept(
      4
      /* TokenType.CurlyClose */
    ) ? (e.appendChild(s), !0) : this._backTo(n);
  }
  _parseTransform(e) {
    const t = new U0t();
    let n = "", r = "";
    for (; !this._accept(
      6
      /* TokenType.Forwardslash */
    ); ) {
      let s;
      if (s = this._accept(5, !0)) {
        s = this._accept(6, !0) || s, n += s;
        continue;
      }
      if (this._token.type !== 14) {
        n += this._accept(void 0, !0);
        continue;
      }
      return !1;
    }
    for (; !this._accept(
      6
      /* TokenType.Forwardslash */
    ); ) {
      let s;
      if (s = this._accept(5, !0)) {
        s = this._accept(5, !0) || this._accept(6, !0) || s, t.appendChild(new su(s));
        continue;
      }
      if (!(this._parseFormatString(t) || this._parseAnything(t)))
        return !1;
    }
    for (; !this._accept(
      4
      /* TokenType.CurlyClose */
    ); ) {
      if (this._token.type !== 14) {
        r += this._accept(void 0, !0);
        continue;
      }
      return !1;
    }
    try {
      t.regexp = new RegExp(n, r);
    } catch {
      return !1;
    }
    return e.transform = t, !0;
  }
  _parseFormatString(e) {
    const t = this._token;
    if (!this._accept(
      0
      /* TokenType.Dollar */
    ))
      return !1;
    let n = !1;
    this._accept(
      3
      /* TokenType.CurlyOpen */
    ) && (n = !0);
    const r = this._accept(8, !0);
    if (r)
      if (n) {
        if (this._accept(
          4
          /* TokenType.CurlyClose */
        ))
          return e.appendChild(new Hp(Number(r))), !0;
        if (!this._accept(
          1
          /* TokenType.Colon */
        ))
          return this._backTo(t), !1;
      } else return e.appendChild(new Hp(Number(r))), !0;
    else return this._backTo(t), !1;
    if (this._accept(
      6
      /* TokenType.Forwardslash */
    )) {
      const s = this._accept(9, !0);
      return !s || !this._accept(
        4
        /* TokenType.CurlyClose */
      ) ? (this._backTo(t), !1) : (e.appendChild(new Hp(Number(r), s)), !0);
    } else if (this._accept(
      11
      /* TokenType.Plus */
    )) {
      const s = this._until(
        4
        /* TokenType.CurlyClose */
      );
      if (s)
        return e.appendChild(new Hp(Number(r), void 0, s, void 0)), !0;
    } else if (this._accept(
      12
      /* TokenType.Dash */
    )) {
      const s = this._until(
        4
        /* TokenType.CurlyClose */
      );
      if (s)
        return e.appendChild(new Hp(Number(r), void 0, void 0, s)), !0;
    } else if (this._accept(
      13
      /* TokenType.QuestionMark */
    )) {
      const s = this._until(
        1
        /* TokenType.Colon */
      );
      if (s) {
        const o = this._until(
          4
          /* TokenType.CurlyClose */
        );
        if (o)
          return e.appendChild(new Hp(Number(r), void 0, s, o)), !0;
      }
    } else {
      const s = this._until(
        4
        /* TokenType.CurlyClose */
      );
      if (s)
        return e.appendChild(new Hp(Number(r), void 0, void 0, s)), !0;
    }
    return this._backTo(t), !1;
  }
  _parseAnything(e) {
    return this._token.type !== 14 ? (e.appendChild(new su(this._scanner.tokenText(this._token))), this._accept(void 0), !0) : !1;
  }
}
function q5e(i, e, t) {
  var n, r;
  return (typeof t.insertText == "string" ? t.insertText === "" : t.insertText.snippet === "") ? {
    edits: ((n = t.additionalEdit) == null ? void 0 : n.edits) ?? []
  } : {
    edits: [
      ...e.map((s) => new N1(i, { range: s, text: typeof t.insertText == "string" ? _T.escape(t.insertText) + "$0" : t.insertText.snippet, insertAsSnippet: !0 })),
      ...((r = t.additionalEdit) == null ? void 0 : r.edits) ?? []
    ]
  };
}
function K5e(i) {
  function e(o, a) {
    return "mimeType" in o ? o.mimeType === a.handledMimeType : !!a.kind && o.kind.contains(a.kind);
  }
  const t = /* @__PURE__ */ new Map();
  for (const o of i)
    for (const a of o.yieldTo ?? [])
      for (const l of i)
        if (l !== o && e(a, l)) {
          let c = t.get(o);
          c || (c = [], t.set(o, c)), c.push(l);
        }
  if (!t.size)
    return Array.from(i);
  const n = /* @__PURE__ */ new Set(), r = [];
  function s(o) {
    if (!o.length)
      return [];
    const a = o[0];
    if (r.includes(a))
      return console.warn("Yield to cycle detected", a), o;
    if (n.has(a))
      return s(o.slice(1));
    let l = [];
    const c = t.get(a);
    return c && (r.push(a), l = s(c), r.pop()), n.add(a), [...l, a, ...s(o.slice(1))];
  }
  return s(Array.from(i));
}
De.white.toString(), De.white.toString();
const z0t = Object.freeze({
  allowedTags: {
    override: ["b", "i", "u", "code", "span"]
  },
  allowedAttributes: {
    override: ["class"]
  }
});
class ZU extends ge {
  get onDidClick() {
    return this._onDidClick.event;
  }
  constructor(e, t) {
    super(), this._label = "", this._onDidClick = this._register(new he()), this._onDidEscape = this._register(new he()), this.options = t, this._element = document.createElement("a"), this._element.classList.add("monaco-button"), this._element.tabIndex = 0, this._element.setAttribute("role", "button"), this._element.classList.toggle("secondary", !!t.secondary);
    const n = t.secondary ? t.buttonSecondaryBackground : t.buttonBackground, r = t.secondary ? t.buttonSecondaryForeground : t.buttonForeground;
    this._element.style.color = r || "", this._element.style.backgroundColor = n || "", t.supportShortLabel && (this._labelShortElement = document.createElement("div"), this._labelShortElement.classList.add("monaco-button-label-short"), this._element.appendChild(this._labelShortElement), this._labelElement = document.createElement("div"), this._labelElement.classList.add("monaco-button-label"), this._element.appendChild(this._labelElement), this._element.classList.add("monaco-text-button-with-short-label")), typeof t.title == "string" && this.setTitle(t.title), typeof t.ariaLabel == "string" && this._element.setAttribute("aria-label", t.ariaLabel), e.appendChild(this._element), this.enabled = !t.disabled, this._register(ec.addTarget(this._element)), [Xe.CLICK, zr.Tap].forEach((s) => {
      this._register(Ce(this._element, s, (o) => {
        if (!this.enabled) {
          Mi.stop(o);
          return;
        }
        this._onDidClick.fire(o);
      }));
    }), this._register(Ce(this._element, Xe.KEY_DOWN, (s) => {
      const o = new wr(s);
      let a = !1;
      this.enabled && (o.equals(
        3
        /* KeyCode.Enter */
      ) || o.equals(
        10
        /* KeyCode.Space */
      )) ? (this._onDidClick.fire(s), a = !0) : o.equals(
        9
        /* KeyCode.Escape */
      ) && (this._onDidEscape.fire(s), this._element.blur(), a = !0), a && Mi.stop(o, !0);
    })), this._register(Ce(this._element, Xe.MOUSE_OVER, (s) => {
      this._element.classList.contains("disabled") || this.updateBackground(!0);
    })), this._register(Ce(this._element, Xe.MOUSE_OUT, (s) => {
      this.updateBackground(!1);
    })), this.focusTracker = this._register(qf(this._element)), this._register(this.focusTracker.onDidFocus(() => {
      this.enabled && this.updateBackground(!0);
    })), this._register(this.focusTracker.onDidBlur(() => {
      this.enabled && this.updateBackground(!1);
    }));
  }
  dispose() {
    super.dispose(), this._element.remove();
  }
  getContentElements(e) {
    const t = [];
    for (let n of D1(e))
      if (typeof n == "string") {
        if (n = n.trim(), n === "")
          continue;
        const r = document.createElement("span");
        r.textContent = n, t.push(r);
      } else
        t.push(n);
    return t;
  }
  updateBackground(e) {
    let t;
    this.options.secondary ? t = e ? this.options.buttonSecondaryHoverBackground : this.options.buttonSecondaryBackground : t = e ? this.options.buttonHoverBackground : this.options.buttonBackground, t && (this._element.style.backgroundColor = t);
  }
  get element() {
    return this._element;
  }
  set label(e) {
    var r;
    if (this._label === e || ob(this._label) && ob(e) && Wmt(this._label, e))
      return;
    this._element.classList.add("monaco-text-button");
    const t = this.options.supportShortLabel ? this._labelElement : this._element;
    if (ob(e)) {
      const s = AB(e, void 0, document.createElement("span"));
      s.dispose();
      const o = (r = s.element.querySelector("p")) == null ? void 0 : r.innerHTML;
      o ? X4e(t, o, z0t) : ma(t);
    } else
      this.options.supportIcons ? ma(t, ...this.getContentElements(e)) : t.textContent = e;
    let n = "";
    typeof this.options.title == "string" ? n = this.options.title : this.options.title && (n = ibt(e)), this.setTitle(n), this._setAriaLabel(), this._label = e;
  }
  get label() {
    return this._label;
  }
  _setAriaLabel() {
    typeof this.options.ariaLabel == "string" ? this._element.setAttribute("aria-label", this.options.ariaLabel) : typeof this.options.title == "string" && this._element.setAttribute("aria-label", this.options.title);
  }
  set icon(e) {
    this._setAriaLabel();
    const t = Array.from(this._element.classList).filter((n) => n.startsWith("codicon-"));
    this._element.classList.remove(...t), this._element.classList.add(...qt.asClassNameArray(e));
  }
  set enabled(e) {
    e ? (this._element.classList.remove("disabled"), this._element.setAttribute("aria-disabled", String(!1)), this._element.tabIndex = 0) : (this._element.classList.add("disabled"), this._element.setAttribute("aria-disabled", String(!0)));
  }
  get enabled() {
    return !this._element.classList.contains("disabled");
  }
  setTitle(e) {
    !this._hover && e !== "" ? this._hover = this._register(Jg().setupManagedHover(this.options.hoverDelegate ?? rd("element"), this._element, e)) : this._hover && this._hover.update(e);
  }
}
function zee(i, e) {
  return e && (i.stack || i.stacktrace) ? S(29, "{0}: {1}", uDe(i), cDe(i.stack) || cDe(i.stacktrace)) : uDe(i);
}
function cDe(i) {
  return Array.isArray(i) ? i.join(`
`) : i;
}
function uDe(i) {
  return i.code === "ERR_UNC_HOST_NOT_ALLOWED" ? `${i.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.` : typeof i.code == "string" && typeof i.errno == "number" && typeof i.syscall == "string" ? S(30, "A system error occurred ({0})", i.message) : i.message || S(31, "An unknown error occurred. Please consult the log for more details.");
}
function QU(i = null, e = !1) {
  if (!i)
    return S(32, "An unknown error occurred. Please consult the log for more details.");
  if (Array.isArray(i)) {
    const t = ym(i), n = QU(t[0], e);
    return t.length > 1 ? S(33, "{0} ({1} errors in total)", n, t.length) : n;
  }
  if (ga(i))
    return i;
  if (i.detail) {
    const t = i.detail;
    if (t.error)
      return zee(t.error, e);
    if (t.exception)
      return zee(t.exception, e);
  }
  return i.stack ? zee(i, e) : i.message ? i.message : S(34, "An unknown error occurred. Please consult the log for more details.");
}
const aH = Ge, $0t = {
  keybindingLabelBackground: void 0,
  keybindingLabelForeground: void 0,
  keybindingLabelBorder: void 0,
  keybindingLabelBottomBorder: void 0,
  keybindingLabelShadow: void 0
};
class c2 extends ge {
  constructor(e, t, n) {
    super(), this.os = t, this.keyElements = /* @__PURE__ */ new Set(), this.options = n || /* @__PURE__ */ Object.create(null);
    const r = this.options.keybindingLabelForeground;
    this.domNode = Fe(e, aH(".monaco-keybinding")), r && (this.domNode.style.color = r), this.hover = this._register(Jg().setupManagedHover(rd("mouse"), this.domNode, "")), this.didEverRender = !1, e.appendChild(this.domNode);
  }
  set(e, t) {
    this.didEverRender && this.keybinding === e && c2.areSame(this.matches, t) || (this.keybinding = e, this.matches = t, this.render());
  }
  render() {
    if (this.clear(), this.keybinding) {
      const e = this.keybinding.getChords();
      e[0] && this.renderChord(this.domNode, e[0], this.matches ? this.matches.firstPart : null);
      for (let n = 1; n < e.length; n++)
        Fe(this.domNode, aH("span.monaco-keybinding-key-chord-separator", void 0, " ")), this.renderChord(this.domNode, e[n], this.matches ? this.matches.chordPart : null);
      const t = this.options.disableTitle ?? !1 ? void 0 : this.keybinding.getAriaLabel() || void 0;
      this.hover.update(t), this.domNode.setAttribute("aria-label", t || "");
    } else this.options && this.options.renderUnboundKeybindings && this.renderUnbound(this.domNode);
    this.didEverRender = !0;
  }
  clear() {
    Xa(this.domNode), this.keyElements.clear();
  }
  renderChord(e, t, n) {
    const r = Nge.modifierLabels[this.os];
    t.ctrlKey && this.renderKey(e, r.ctrlKey, !!(n != null && n.ctrlKey), r.separator), t.shiftKey && this.renderKey(e, r.shiftKey, !!(n != null && n.shiftKey), r.separator), t.altKey && this.renderKey(e, r.altKey, !!(n != null && n.altKey), r.separator), t.metaKey && this.renderKey(e, r.metaKey, !!(n != null && n.metaKey), r.separator);
    const s = t.keyLabel;
    s && this.renderKey(e, s, !!(n != null && n.keyCode), "");
  }
  renderKey(e, t, n, r) {
    Fe(e, this.createKeyElement(t, n ? ".highlight" : "")), r && Fe(e, aH("span.monaco-keybinding-key-separator", void 0, r));
  }
  renderUnbound(e) {
    Fe(e, this.createKeyElement(S(15, "Unbound")));
  }
  createKeyElement(e, t = "") {
    const n = aH("span.monaco-keybinding-key" + t, void 0, e);
    return this.keyElements.add(n), this.options.keybindingLabelBackground && (n.style.backgroundColor = this.options.keybindingLabelBackground), this.options.keybindingLabelBorder && (n.style.borderColor = this.options.keybindingLabelBorder), this.options.keybindingLabelBottomBorder && (n.style.borderBottomColor = this.options.keybindingLabelBottomBorder), this.options.keybindingLabelShadow && (n.style.boxShadow = `inset 0 -1px 0 ${this.options.keybindingLabelShadow}`), n;
  }
  static areSame(e, t) {
    return e === t || !e && !t ? !0 : !!e && !!t && Wd(e.firstPart, t.firstPart) && Wd(e.chordPart, t.chordPart);
  }
}
const Ib = Vn("layoutService");
var Y5e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, WW = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const X5e = "acceptSelectedCodeAction", Z5e = "previewSelectedCodeAction";
class j0t {
  get templateId() {
    return "header";
  }
  renderTemplate(e) {
    e.classList.add("group-header");
    const t = document.createElement("span");
    return e.append(t), { container: e, text: t };
  }
  renderElement(e, t, n) {
    var r;
    n.text.textContent = ((r = e.group) == null ? void 0 : r.title) ?? e.label ?? "";
  }
  disposeTemplate(e) {
  }
}
class G0t {
  get templateId() {
    return "separator";
  }
  renderTemplate(e) {
    e.classList.add("separator");
    const t = document.createElement("span");
    return e.append(t), { container: e, text: t };
  }
  renderElement(e, t, n) {
    n.text.textContent = e.label ?? "";
  }
  disposeTemplate(e) {
  }
}
let Mse = class {
  get templateId() {
    return "action";
  }
  constructor(e, t) {
    this._supportsPreview = e, this._keybindingService = t;
  }
  renderTemplate(e) {
    e.classList.add(this.templateId);
    const t = document.createElement("div");
    t.className = "icon", e.append(t);
    const n = document.createElement("span");
    n.className = "title", e.append(n);
    const r = document.createElement("span");
    r.className = "description", e.append(r);
    const s = new c2(e, Ad);
    return { container: e, icon: t, text: n, description: r, keybinding: s };
  }
  renderElement(e, t, n) {
    var o, a, l;
    if ((o = e.group) != null && o.icon ? (n.icon.className = qt.asClassName(e.group.icon), e.group.icon.color && (n.icon.style.color = je(e.group.icon.color.id))) : (n.icon.className = qt.asClassName(Pe.lightBulb), n.icon.style.color = "var(--vscode-editorLightBulb-foreground)"), !e.item || !e.label)
      return;
    Git(!e.hideIcon, n.icon), n.text.textContent = JU(e.label), e.keybinding ? (n.description.textContent = e.keybinding.getLabel(), n.description.style.display = "inline", n.description.style.letterSpacing = "0.5px") : e.description ? (n.description.textContent = JU(e.description), n.description.style.display = "inline") : (n.description.textContent = "", n.description.style.display = "none");
    const r = (a = this._keybindingService.lookupKeybinding(X5e)) == null ? void 0 : a.getLabel(), s = (l = this._keybindingService.lookupKeybinding(Z5e)) == null ? void 0 : l.getLabel();
    n.container.classList.toggle("option-disabled", e.disabled), e.tooltip ? n.container.title = e.tooltip : e.disabled ? n.container.title = e.label : r && s ? this._supportsPreview && e.canPreview ? n.container.title = S(1638, "{0} to Apply, {1} to Preview", r, s) : n.container.title = S(1639, "{0} to Apply", r) : n.container.title = "";
  }
  disposeTemplate(e) {
    e.keybinding.dispose();
  }
};
Mse = Y5e([
  WW(1, Fi)
], Mse);
class q0t extends UIEvent {
  constructor() {
    super("acceptSelectedAction");
  }
}
class dDe extends UIEvent {
  constructor() {
    super("previewSelectedAction");
  }
}
function K0t(i) {
  if (i.kind === "action")
    return i.label;
}
let Pse = class extends ge {
  constructor(e, t, n, r, s, o, a, l) {
    super(), this._delegate = r, this._contextViewService = o, this._keybindingService = a, this._layoutService = l, this._actionLineHeight = 28, this._headerLineHeight = 28, this._separatorLineHeight = 8, this.cts = this._register(new Ss()), this.domNode = document.createElement("div"), this.domNode.classList.add("actionList");
    const c = {
      getHeight: (u) => {
        switch (u.kind) {
          case "header":
            return this._headerLineHeight;
          case "separator":
            return this._separatorLineHeight;
          default:
            return this._actionLineHeight;
        }
      },
      getTemplateId: (u) => u.kind
    };
    this._list = this._register(new Zh(e, this.domNode, c, [
      new Mse(t, this._keybindingService),
      new j0t(),
      new G0t()
    ], {
      keyboardSupport: !1,
      typeNavigationEnabled: !0,
      keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: K0t },
      accessibilityProvider: {
        getAriaLabel: (u) => {
          if (u.kind === "action") {
            let d = u.label ? JU(u == null ? void 0 : u.label) : "";
            return u.description && (d = d + ", " + JU(u.description)), u.disabled && (d = S(1640, "{0}, Disabled Reason: {1}", d, u.disabled)), d;
          }
          return null;
        },
        getWidgetAriaLabel: () => S(1641, "Action Widget"),
        getRole: (u) => {
          switch (u.kind) {
            case "action":
              return "option";
            case "separator":
              return "separator";
            default:
              return "separator";
          }
        },
        getWidgetRole: () => "listbox",
        ...s
      }
    })), this._list.style(o2), this._register(this._list.onMouseClick((u) => this.onListClick(u))), this._register(this._list.onMouseOver((u) => this.onListHover(u))), this._register(this._list.onDidChangeFocus(() => this.onFocus())), this._register(this._list.onDidChangeSelection((u) => this.onListSelection(u))), this._allMenuItems = n, this._list.splice(0, this._list.length, this._allMenuItems), this._list.length && this.focusNext();
  }
  focusCondition(e) {
    return !e.disabled && e.kind === "action";
  }
  hide(e) {
    this._delegate.onHide(e), this.cts.cancel(), this._contextViewService.hideContextView();
  }
  layout(e) {
    const t = this._allMenuItems.filter((u) => u.kind === "header").length, n = this._allMenuItems.filter((u) => u.kind === "separator").length, o = this._allMenuItems.length * this._actionLineHeight + t * this._headerLineHeight - t * this._actionLineHeight + n * this._separatorLineHeight - n * this._actionLineHeight;
    this._list.layout(o);
    let a = e;
    if (this._allMenuItems.length >= 50)
      a = 380;
    else {
      const u = this._allMenuItems.map((d, h) => {
        const g = this.domNode.ownerDocument.getElementById(this._list.getElementID(h));
        if (g) {
          g.style.width = "auto";
          const m = g.getBoundingClientRect().width;
          return g.style.width = "", m;
        }
        return 0;
      });
      a = Math.max(...u, e);
    }
    const c = Math.min(o, this._layoutService.getContainer(At(this.domNode)).clientHeight * 0.7);
    return this._list.layout(c, a), this.domNode.style.height = `${c}px`, this._list.domFocus(), a;
  }
  focusPrevious() {
    this._list.focusPrevious(1, !0, void 0, this.focusCondition);
  }
  focusNext() {
    this._list.focusNext(1, !0, void 0, this.focusCondition);
  }
  acceptSelected(e) {
    const t = this._list.getFocus();
    if (t.length === 0)
      return;
    const n = t[0], r = this._list.element(n);
    if (!this.focusCondition(r))
      return;
    const s = e ? new dDe() : new q0t();
    this._list.setSelection([n], s);
  }
  onListSelection(e) {
    if (!e.elements.length)
      return;
    const t = e.elements[0];
    t.item && this.focusCondition(t) ? this._delegate.onSelect(t.item, e.browserEvent instanceof dDe) : this._list.setSelection([]);
  }
  onFocus() {
    var r, s;
    const e = this._list.getFocus();
    if (e.length === 0)
      return;
    const t = e[0], n = this._list.element(t);
    (s = (r = this._delegate).onFocus) == null || s.call(r, n.item);
  }
  async onListHover(e) {
    const t = e.element;
    if (t && t.item && this.focusCondition(t)) {
      if (this._delegate.onHover && !t.disabled && t.kind === "action") {
        const n = await this._delegate.onHover(t.item, this.cts.token);
        t.canPreview = n ? n.canPreview : void 0;
      }
      e.index && this._list.splice(e.index, 1, [t]);
    }
    this._list.setFocus(typeof e.index == "number" ? [e.index] : []);
  }
  onListClick(e) {
    e.element && this.focusCondition(e.element) && this._list.setFocus([]);
  }
};
Pse = Y5e([
  WW(5, g0),
  WW(6, Fi),
  WW(7, Ib)
], Pse);
function JU(i) {
  return i.replace(/\r\n|\r|\n/g, " ");
}
var Y0t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, $ee = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
ie("actionBar.toggledBackground", SB, S(1642, "Background color for toggled action items in action bar."));
const bT = {
  Visible: new ut("codeActionMenuVisible", !1, S(1643, "Whether the action widget list is visible"))
}, Tw = Vn("actionWidgetService");
let vT = class extends ge {
  get isVisible() {
    return bT.Visible.getValue(this._contextKeyService) || !1;
  }
  constructor(e, t, n) {
    super(), this._contextViewService = e, this._contextKeyService = t, this._instantiationService = n, this._list = this._register(new er());
  }
  show(e, t, n, r, s, o, a, l) {
    const c = bT.Visible.bindTo(this._contextKeyService), u = this._instantiationService.createInstance(Pse, e, t, n, r, l);
    this._contextViewService.showContextView({
      getAnchor: () => s,
      render: (d) => (c.set(!0), this._renderWidget(d, u, a ?? [])),
      onHide: (d) => {
        c.reset(), this._onWidgetClosed(d);
      }
    }, o, !1);
  }
  acceptSelected(e) {
    var t;
    (t = this._list.value) == null || t.acceptSelected(e);
  }
  focusPrevious() {
    var e, t;
    (t = (e = this._list) == null ? void 0 : e.value) == null || t.focusPrevious();
  }
  focusNext() {
    var e, t;
    (t = (e = this._list) == null ? void 0 : e.value) == null || t.focusNext();
  }
  hide(e) {
    var t;
    (t = this._list.value) == null || t.hide(e), this._list.clear();
  }
  _renderWidget(e, t, n) {
    var g;
    const r = document.createElement("div");
    if (r.classList.add("action-widget"), e.appendChild(r), this._list.value = t, this._list.value)
      r.appendChild(this._list.value.domNode);
    else
      throw new Error("List has no value");
    const s = new ke(), o = document.createElement("div"), a = e.appendChild(o);
    a.classList.add("context-view-block"), s.add(Ce(a, Xe.MOUSE_DOWN, (m) => m.stopPropagation()));
    const l = document.createElement("div"), c = e.appendChild(l);
    c.classList.add("context-view-pointerBlock"), s.add(Ce(c, Xe.POINTER_MOVE, () => c.remove())), s.add(Ce(c, Xe.MOUSE_DOWN, () => c.remove()));
    let u = 0;
    if (n.length) {
      const m = this._createActionBar(".action-widget-action-bar", n);
      m && (r.appendChild(m.getContainer().parentElement), s.add(m), u = m.getContainer().offsetWidth);
    }
    const d = (g = this._list.value) == null ? void 0 : g.layout(u);
    r.style.width = `${d}px`;
    const h = s.add(qf(e));
    return s.add(h.onDidBlur(() => this.hide(!0))), s;
  }
  _createActionBar(e, t) {
    if (!t.length)
      return;
    const n = Ge(e), r = new qu(n);
    return r.push(t, { icon: !1, label: !0 }), r;
  }
  _onWidgetClosed(e) {
    var t;
    (t = this._list.value) == null || t.hide(e);
  }
};
vT = Y0t([
  $ee(0, g0),
  $ee(1, Jt),
  $ee(2, xt)
], vT);
ni(
  Tw,
  vT,
  1
  /* InstantiationType.Delayed */
);
const VB = 1100;
ar(class extends Fa {
  constructor() {
    super({
      id: "hideCodeActionWidget",
      title: Ee(1644, "Hide action widget"),
      precondition: bT.Visible,
      keybinding: {
        weight: VB,
        primary: 9,
        secondary: [
          1033
          /* KeyCode.Escape */
        ]
      }
    });
  }
  run(i) {
    i.get(Tw).hide(!0);
  }
});
ar(class extends Fa {
  constructor() {
    super({
      id: "selectPrevCodeAction",
      title: Ee(1645, "Select previous action"),
      precondition: bT.Visible,
      keybinding: {
        weight: VB,
        primary: 16,
        secondary: [
          2064
          /* KeyCode.UpArrow */
        ],
        mac: { primary: 16, secondary: [
          2064,
          302
          /* KeyCode.KeyP */
        ] }
      }
    });
  }
  run(i) {
    const e = i.get(Tw);
    e instanceof vT && e.focusPrevious();
  }
});
ar(class extends Fa {
  constructor() {
    super({
      id: "selectNextCodeAction",
      title: Ee(1646, "Select next action"),
      precondition: bT.Visible,
      keybinding: {
        weight: VB,
        primary: 18,
        secondary: [
          2066
          /* KeyCode.DownArrow */
        ],
        mac: { primary: 18, secondary: [
          2066,
          300
          /* KeyCode.KeyN */
        ] }
      }
    });
  }
  run(i) {
    const e = i.get(Tw);
    e instanceof vT && e.focusNext();
  }
});
ar(class extends Fa {
  constructor() {
    super({
      id: X5e,
      title: Ee(1647, "Accept selected action"),
      precondition: bT.Visible,
      keybinding: {
        weight: VB,
        primary: 3,
        secondary: [
          2137
          /* KeyCode.Period */
        ]
      }
    });
  }
  run(i) {
    const e = i.get(Tw);
    e instanceof vT && e.acceptSelected();
  }
});
ar(class extends Fa {
  constructor() {
    super({
      id: Z5e,
      title: Ee(1648, "Preview selected action"),
      precondition: bT.Visible,
      keybinding: {
        weight: VB,
        primary: 2051
      }
    });
  }
  run(i) {
    const e = i.get(Tw);
    e instanceof vT && e.acceptSelected(!0);
  }
});
var Q5e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, lR = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Fse, sL;
let Bse = (sL = class extends ge {
  constructor(e, t, n, r, s, o, a, l, c, u, d) {
    super(), this.typeId = e, this.editor = t, this.showCommand = r, this.range = s, this.edits = o, this.onSelectNewEdit = a, this.additionalActions = l, this._keybindingService = u, this._actionWidgetService = d, this.allowEditorOverflow = !0, this.suppressMouseDown = !0, this.create(), this.visibleContext = n.bindTo(c), this.visibleContext.set(!0), this._register(Et(() => this.visibleContext.reset())), this.editor.addContentWidget(this), this.editor.layoutContentWidget(this), this._register(Et((() => this.editor.removeContentWidget(this)))), this._register(this.editor.onDidChangeCursorPosition((h) => {
      this.dispose();
    })), this._register(Ze.runAndSubscribe(u.onDidUpdateKeybindings, () => {
      this._updateButtonTitle();
    }));
  }
  _updateButtonTitle() {
    var t;
    const e = (t = this._keybindingService.lookupKeybinding(this.showCommand.id)) == null ? void 0 : t.getLabel();
    this.button.element.title = this.showCommand.label + (e ? ` (${e})` : "");
  }
  create() {
    this.domNode = Ge(".post-edit-widget"), this.button = this._register(new ZU(this.domNode, {
      supportIcons: !0
    })), this.button.label = "$(insert)", this._register(Ce(this.domNode, Xe.CLICK, () => this.showSelector()));
  }
  getId() {
    return Fse.baseId + "." + this.typeId;
  }
  getDomNode() {
    return this.domNode;
  }
  getPosition() {
    return {
      position: this.range.getEndPosition(),
      preference: [
        2
        /* ContentWidgetPositionPreference.BELOW */
      ]
    };
  }
  showSelector() {
    const e = ho(this.button.element), t = { x: e.left + e.width, y: e.top + e.height };
    this._actionWidgetService.show("postEditWidget", !1, this.edits.allEdits.map((n, r) => ({
      kind: "action",
      item: n,
      label: n.title,
      disabled: !1,
      canPreview: !1,
      group: { title: "", icon: qt.fromId(r === this.edits.activeEditIndex ? Pe.check.id : Pe.blank.id) }
    })), {
      onHide: () => {
        this.editor.focus();
      },
      onSelect: (n) => {
        this._actionWidgetService.hide(!1);
        const r = this.edits.allEdits.findIndex((s) => s === n);
        if (r !== this.edits.activeEditIndex)
          return this.onSelectNewEdit(r);
      }
    }, t, this.editor.getDomNode() ?? void 0, this.additionalActions);
  }
}, Fse = sL, sL.baseId = "editor.widget.postEditWidget", sL);
Bse = Fse = Q5e([
  lR(8, Jt),
  lR(9, Fi),
  lR(10, Tw)
], Bse);
let ez = class extends ge {
  constructor(e, t, n, r, s, o, a, l) {
    super(), this._id = e, this._editor = t, this._visibleContext = n, this._showCommand = r, this._getAdditionalActions = s, this._instantiationService = o, this._bulkEditService = a, this._notificationService = l, this._currentWidget = this._register(new er()), this._register(Ze.any(t.onDidChangeModel, t.onDidChangeModelContent)(() => this.clear()));
  }
  async applyEditAndShowIfNeeded(e, t, n, r, s) {
    if (!e.length || !this._editor.hasModel())
      return;
    const o = this._editor.getModel(), a = t.allEdits.at(t.activeEditIndex);
    if (!a)
      return;
    const l = async (w) => {
      const E = this._editor.getModel();
      E && (await E.undo(), this.applyEditAndShowIfNeeded(e, { activeEditIndex: w, allEdits: t.allEdits }, n, r, s));
    }, c = (w, E) => {
      Xh(w) || (this._notificationService.error(E), n && this.show(e[0], t, l));
    }, u = new t0(this._editor, 3, void 0, s);
    let d;
    try {
      d = await Ytt(r(a, u.token), u.token);
    } catch (w) {
      return c(w, S(932, `Error resolving edit '{0}':
{1}`, a.title, QU(w)));
    } finally {
      u.dispose();
    }
    if (s.isCancellationRequested)
      return;
    const h = q5e(o.uri, e, d), g = e[0], m = o.deltaDecorations([], [{
      range: g,
      options: {
        description: "paste-line-suffix",
        stickiness: 0
        /* TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */
      }
    }]);
    this._editor.focus();
    let _, v;
    try {
      _ = await this._bulkEditService.apply(h, { editor: this._editor, token: s }), v = o.getDecorationRange(m[0]);
    } catch (w) {
      return c(w, S(933, `Error applying edit '{0}':
{1}`, a.title, QU(w)));
    } finally {
      o.deltaDecorations(m, []);
    }
    s.isCancellationRequested || n && _.isApplied && t.allEdits.length > 1 && this.show(v ?? g, t, l);
  }
  show(e, t, n) {
    this.clear(), this._editor.hasModel() && (this._currentWidget.value = this._instantiationService.createInstance(Bse, this._id, this._editor, this._visibleContext, this._showCommand, e, t, n, this._getAdditionalActions()));
  }
  clear() {
    this._currentWidget.clear();
  }
  tryShowSelector() {
    var e;
    (e = this._currentWidget.value) == null || e.showSelector();
  }
};
ez = Q5e([
  lR(5, xt),
  lR(6, HB),
  lR(7, no)
], ez);
var X0t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Mv = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Tg;
const J5e = "editor.changePasteType", Z0t = "editor.pasteAs.preferences", Uge = new ut("pasteWidgetVisible", !1, S(912, "Whether the paste widget is showing")), jee = "application/vnd.code.copymetadata";
var oL;
let r0 = (oL = class extends ge {
  static get(e) {
    return e.getContribution(Tg.ID);
  }
  constructor(e, t, n, r, s, o, a, l, c, u) {
    super(), this._logService = n, this._bulkEditService = r, this._clipboardService = s, this._commandService = o, this._configService = a, this._languageFeaturesService = l, this._quickInputService = c, this._progressService = u, this._editor = e;
    const d = e.getContainerDomNode();
    this._register(Ce(d, "copy", (h) => this.handleCopy(h))), this._register(Ce(d, "cut", (h) => this.handleCopy(h))), this._register(Ce(d, "paste", (h) => this.handlePaste(h), !0)), this._pasteProgressManager = this._register(new YU("pasteIntoEditor", e, t)), this._postPasteWidgetManager = this._register(t.createInstance(ez, "pasteIntoEditor", e, Uge, { id: J5e, label: S(913, "Show paste options...") }, () => Tg._configureDefaultAction ? [Tg._configureDefaultAction] : []));
  }
  changePasteType() {
    this._postPasteWidgetManager.tryShowSelector();
  }
  async pasteAs(e) {
    this._logService.trace("CopyPasteController.pasteAs"), this._editor.focus();
    try {
      this._logService.trace("Before calling editor.action.clipboardPasteAction"), this._pasteAsActionContext = { preferred: e }, await this._commandService.executeCommand("editor.action.clipboardPasteAction");
    } finally {
      this._pasteAsActionContext = void 0;
    }
  }
  clearWidgets() {
    this._postPasteWidgetManager.clear();
  }
  isPasteAsEnabled() {
    return this._editor.getOption(
      97
      /* EditorOption.pasteAs */
    ).enabled;
  }
  async finishedPaste() {
    await this._currentPasteOperation;
  }
  handleCopy(e) {
    var v, w, E, L;
    let t = null;
    if (e.clipboardData) {
      const [T, D] = Fx.getTextData(e.clipboardData), N = D || ib.INSTANCE.get(T);
      t = (N == null ? void 0 : N.id) || null, this._logService.trace("CopyPasteController#handleCopy for id : ", t, " with text.length : ", T.length);
    } else
      this._logService.trace("CopyPasteController#handleCopy");
    if (!this._editor.hasTextFocus() || ((w = (v = this._clipboardService).clearInternalState) == null || w.call(v), !e.clipboardData || !this.isPasteAsEnabled()))
      return;
    const n = this._editor.getModel(), r = this._editor.getSelections();
    if (!n || !(r != null && r.length))
      return;
    const s = this._editor.getOption(
      45
      /* EditorOption.emptySelectionClipboard */
    );
    let o = r;
    const a = r.length === 1 && r[0].isEmpty();
    if (a) {
      if (!s)
        return;
      o = [new z(o[0].startLineNumber, 1, o[0].startLineNumber, 1 + n.getLineLength(o[0].startLineNumber))];
    }
    const l = (E = this._editor._getViewModel()) == null ? void 0 : E.getPlainTextToCopy(r, s, Za), u = {
      multicursorText: Array.isArray(l) ? l : null,
      pasteOnNewLine: a,
      mode: null
    }, d = this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter((T) => !!T.prepareDocumentPaste);
    if (!d.length) {
      this.setCopyMetadata(e.clipboardData, { defaultPastePayload: u });
      return;
    }
    const h = B5e(e.clipboardData), g = d.flatMap((T) => T.copyMimeTypes ?? []), m = t ?? XT();
    this.setCopyMetadata(e.clipboardData, {
      id: m,
      providerCopyMimeTypes: g,
      defaultPastePayload: u
    });
    const _ = d.map((T) => ({
      providerMimeTypes: T.copyMimeTypes,
      operation: Jo((D) => T.prepareDocumentPaste(n, o, h, D).catch((N) => {
        console.error(N);
      }))
    }));
    (L = Tg._currentCopyOperation) == null || L.operations.forEach((T) => T.operation.cancel()), Tg._currentCopyOperation = { handle: m, operations: _ };
  }
  async handlePaste(e) {
    var c, u, d;
    if (e.clipboardData) {
      const [h, g] = Fx.getTextData(e.clipboardData), m = g || ib.INSTANCE.get(h);
      this._logService.trace("CopyPasteController#handlePaste for id : ", m == null ? void 0 : m.id);
    } else
      this._logService.trace("CopyPasteController#handlePaste");
    if (!e.clipboardData || !this._editor.hasTextFocus())
      return;
    (c = Vd.get(this._editor)) == null || c.closeMessage(), (u = this._currentPasteOperation) == null || u.cancel(), this._currentPasteOperation = void 0;
    const t = this._editor.getModel(), n = this._editor.getSelections();
    if (!(n != null && n.length) || !t || this._editor.getOption(
      104
      /* EditorOption.readOnly */
    ) || !this.isPasteAsEnabled() && !this._pasteAsActionContext)
      return;
    const r = this.fetchCopyMetadata(e);
    this._logService.trace("CopyPasteController#handlePaste with metadata : ", r == null ? void 0 : r.id, " and text.length : ", e.clipboardData.getData("text/plain").length);
    const s = H5e(e.clipboardData);
    s.delete(jee);
    const o = Array.from(e.clipboardData.files).map((h) => h.type), a = [
      ...e.clipboardData.types,
      ...o,
      ...(r == null ? void 0 : r.providerCopyMimeTypes) ?? [],
      // TODO: always adds `uri-list` because this get set if there are resources in the system clipboard.
      // However we can only check the system clipboard async. For this early check, just add it in.
      // We filter providers again once we have the final dataTransfer we will use.
      co.uriList
    ], l = this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter((h) => {
      var m, _;
      const g = (m = this._pasteAsActionContext) == null ? void 0 : m.preferred;
      return g && !this.providerMatchesPreference(h, g) ? !1 : (_ = h.pasteMimeTypes) == null ? void 0 : _.some((v) => rDe(v, a));
    });
    if (!l.length) {
      (d = this._pasteAsActionContext) != null && d.preferred && (this.showPasteAsNoEditMessage(n, this._pasteAsActionContext.preferred), e.preventDefault(), e.stopImmediatePropagation());
      return;
    }
    e.preventDefault(), e.stopImmediatePropagation(), this._pasteAsActionContext ? this.showPasteAsPick(this._pasteAsActionContext.preferred, l, n, s, r) : this.doPasteInline(l, n, s, r, e);
  }
  showPasteAsNoEditMessage(e, t) {
    var r;
    const n = "only" in t ? t.only.value : "preferences" in t ? t.preferences.length ? t.preferences.map((s) => s.value).join(", ") : S(914, "empty") : t.providerId;
    (r = Vd.get(this._editor)) == null || r.showMessage(S(915, "No paste edits for '{0}' found", n), e[0].getStartPosition());
  }
  doPasteInline(e, t, n, r, s) {
    this._logService.trace("CopyPasteController#doPasteInline");
    const o = this._editor;
    if (!o.hasModel())
      return;
    const a = new t0(o, 3, void 0), l = Jo(async (c) => {
      const u = this._editor;
      if (!u.hasModel())
        return;
      const d = u.getModel(), h = new ke(), g = h.add(new Ss(c));
      h.add(a.token.onCancellationRequested(() => g.cancel()));
      const m = g.token;
      try {
        if (await this.mergeInDataFromCopy(e, n, r, m), m.isCancellationRequested)
          return;
        const _ = e.filter((E) => this.isSupportedPasteProvider(E, n));
        if (!_.length || _.length === 1 && _[0] instanceof mT)
          return this.applyDefaultPasteHandler(n, r, m, s);
        const v = {
          triggerKind: x4.Automatic
        }, w = await this.getPasteEdits(_, n, d, t, v, m);
        if (h.add(w), m.isCancellationRequested)
          return;
        if (w.edits.length === 1 && w.edits[0].provider instanceof mT)
          return this.applyDefaultPasteHandler(n, r, m, s);
        if (w.edits.length) {
          const E = u.getOption(
            97
            /* EditorOption.pasteAs */
          ).showPasteSelector === "afterPaste";
          return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t, { activeEditIndex: this.getInitialActiveEditIndex(d, w.edits), allEdits: w.edits }, E, async (L, T) => {
            if (!L.provider.resolveDocumentPasteEdit)
              return L;
            const D = L.provider.resolveDocumentPasteEdit(L, T), N = new zT(), R = await this._pasteProgressManager.showWhile(t[0].getEndPosition(), S(916, "Resolving paste edit for '{0}'. Click to cancel", L.title), $R(Promise.race([N.p, D]), T), {
              cancel: () => N.cancel()
            }, 0);
            return R && (L.insertText = R.insertText, L.additionalEdit = R.additionalEdit), L;
          }, m);
        }
        await this.applyDefaultPasteHandler(n, r, m, s);
      } finally {
        h.dispose(), this._currentPasteOperation === l && (this._currentPasteOperation = void 0);
      }
    });
    this._pasteProgressManager.showWhile(t[0].getEndPosition(), S(917, "Running paste handlers. Click to cancel and do basic paste"), l, {
      cancel: async () => {
        l.cancel(), !a.token.isCancellationRequested && await this.applyDefaultPasteHandler(n, r, a.token, s);
      }
    }).finally(() => {
      a.dispose();
    }), this._currentPasteOperation = l;
  }
  showPasteAsPick(e, t, n, r, s) {
    this._logService.trace("CopyPasteController#showPasteAsPick");
    const o = Jo(async (a) => {
      var h;
      const l = this._editor;
      if (!l.hasModel())
        return;
      const c = l.getModel(), u = new ke(), d = u.add(new t0(l, 3, void 0, a));
      try {
        if (await this.mergeInDataFromCopy(t, r, s, d.token), d.token.isCancellationRequested)
          return;
        let g = t.filter((E) => this.isSupportedPasteProvider(E, r, e));
        e && (g = g.filter((E) => this.providerMatchesPreference(E, e)));
        const m = {
          triggerKind: x4.PasteAs,
          only: e && "only" in e ? e.only : void 0
        };
        let _ = u.add(await this.getPasteEdits(g, r, c, n, m, d.token));
        if (d.token.isCancellationRequested)
          return;
        if (e && (_ = {
          edits: _.edits.filter((E) => "only" in e ? e.only.contains(E.kind) : "preferences" in e ? e.preferences.some((L) => L.contains(E.kind)) : e.providerId === E.provider.id),
          dispose: _.dispose
        }), !_.edits.length) {
          e && this.showPasteAsNoEditMessage(n, e);
          return;
        }
        let v;
        if (e)
          v = _.edits.at(0);
        else {
          const E = {
            id: "editor.pasteAs.default",
            label: S(918, "Configure default paste action"),
            edit: void 0
          }, L = await this._quickInputService.pick([
            ..._.edits.map((T) => {
              var D;
              return {
                label: T.title,
                description: (D = T.kind) == null ? void 0 : D.value,
                edit: T
              };
            }),
            ...Tg._configureDefaultAction ? [
              { type: "separator" },
              {
                label: Tg._configureDefaultAction.label,
                edit: void 0
              }
            ] : []
          ], {
            placeHolder: S(919, "Select Paste Action")
          });
          if (L === E) {
            (h = Tg._configureDefaultAction) == null || h.run();
            return;
          }
          v = L == null ? void 0 : L.edit;
        }
        if (!v)
          return;
        const w = q5e(c.uri, n, v);
        await this._bulkEditService.apply(w, { editor: this._editor });
      } finally {
        u.dispose(), this._currentPasteOperation === o && (this._currentPasteOperation = void 0);
      }
    });
    this._progressService.withProgress({
      location: 10,
      title: S(920, "Running paste handlers")
    }, () => o);
  }
  setCopyMetadata(e, t) {
    this._logService.trace("CopyPasteController#setCopyMetadata new id : ", t.id), e.setData(jee, JSON.stringify(t));
  }
  fetchCopyMetadata(e) {
    if (this._logService.trace("CopyPasteController#fetchCopyMetadata"), !e.clipboardData)
      return;
    const t = e.clipboardData.getData(jee);
    if (t)
      try {
        return JSON.parse(t);
      } catch {
        return;
      }
    const [n, r] = Fx.getTextData(e.clipboardData);
    if (r)
      return {
        defaultPastePayload: {
          mode: r.mode,
          multicursorText: r.multicursorText ?? null,
          pasteOnNewLine: !!r.isFromEmptySelection
        }
      };
  }
  async mergeInDataFromCopy(e, t, n, r) {
    var s;
    if (this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ", n == null ? void 0 : n.id), n != null && n.id && ((s = Tg._currentCopyOperation) == null ? void 0 : s.handle) === n.id) {
      const o = Tg._currentCopyOperation.operations.filter((l) => e.some((c) => c.pasteMimeTypes.some((u) => rDe(u, l.providerMimeTypes)))).map((l) => l.operation), a = await Promise.all(o);
      if (r.isCancellationRequested)
        return;
      for (const l of a.reverse())
        if (l)
          for (const [c, u] of l)
            t.replace(c, u);
    }
    if (!t.has(co.uriList)) {
      const o = await this._clipboardService.readResources();
      if (r.isCancellationRequested)
        return;
      o.length && t.append(co.uriList, Mge(_K.create(o)));
    }
  }
  async getPasteEdits(e, t, n, r, s, o) {
    const a = new ke(), l = await $R(Promise.all(e.map(async (u) => {
      var d, h;
      try {
        const g = await ((d = u.provideDocumentPasteEdits) == null ? void 0 : d.call(u, n, r, t, s, o));
        return g && a.add(g), (h = g == null ? void 0 : g.edits) == null ? void 0 : h.map((m) => ({ ...m, provider: u }));
      } catch (g) {
        Xh(g) || console.error(g);
        return;
      }
    })), o), c = ym(l ?? []).flat().filter((u) => !s.only || s.only.contains(u.kind));
    return {
      edits: K5e(c),
      dispose: () => a.dispose()
    };
  }
  async applyDefaultPasteHandler(e, t, n, r) {
    const s = e.get(co.text) ?? e.get("text"), o = await (s == null ? void 0 : s.asString()) ?? "";
    if (n.isCancellationRequested)
      return;
    const a = {
      clipboardEvent: r,
      text: o,
      pasteOnNewLine: (t == null ? void 0 : t.defaultPastePayload.pasteOnNewLine) ?? !1,
      multicursorText: (t == null ? void 0 : t.defaultPastePayload.multicursorText) ?? null,
      mode: null
    };
    this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ", t == null ? void 0 : t.id), this._editor.trigger("keyboard", "paste", a);
  }
  /**
   * Filter out providers if they:
   * - Don't handle any of the data transfer types we have
   * - Don't match the preferred paste kind
   */
  isSupportedPasteProvider(e, t, n) {
    var r;
    return (r = e.pasteMimeTypes) != null && r.some((s) => t.matches(s)) ? !n || this.providerMatchesPreference(e, n) : !1;
  }
  providerMatchesPreference(e, t) {
    return "only" in t ? e.providedPasteEditKinds.some((n) => t.only.contains(n)) : "preferences" in t ? t.preferences.some((n) => t.preferences.some((r) => r.contains(n))) : e.id === t.providerId;
  }
  getInitialActiveEditIndex(e, t) {
    const n = this._configService.getValue(Z0t, { resource: e.uri });
    for (const r of Array.isArray(n) ? n : []) {
      const s = new Ps(r), o = t.findIndex((a) => s.contains(a.kind));
      if (o >= 0)
        return o;
    }
    return 0;
  }
}, Tg = oL, oL.ID = "editor.contrib.copyPasteActionController", oL);
r0 = Tg = X0t([
  Mv(1, xt),
  Mv(2, $r),
  Mv(3, HB),
  Mv(4, _m),
  Mv(5, jr),
  Mv(6, xn),
  Mv(7, St),
  Mv(8, tc),
  Mv(9, m4e)
], r0);
const yT = "9_cutcopypaste", Q0t = hm || document.queryCommandSupported("cut"), eBe = hm || document.queryCommandSupported("copy"), J0t = typeof navigator.clipboard > "u" || Zu ? document.queryCommandSupported("paste") : !0;
function zge(i) {
  return i.register(), i;
}
const eCt = Q0t ? zge(new KA({
  id: "editor.action.clipboardCutAction",
  precondition: void 0,
  kbOpts: (
    // Do not bind cut keybindings in the browser,
    // since browsers do that for us and it avoids security prompts
    hm ? {
      primary: 2102,
      win: { primary: 2102, secondary: [
        1044
        /* KeyCode.Delete */
      ] },
      weight: 100
      /* KeybindingWeight.EditorContrib */
    } : void 0
  ),
  menuOpts: [{
    menuId: wt.MenubarEditMenu,
    group: "2_ccp",
    title: S(809, "Cu&&t"),
    order: 1
  }, {
    menuId: wt.EditorContext,
    group: yT,
    title: S(810, "Cut"),
    when: se.writable,
    order: 1
  }, {
    menuId: wt.CommandPalette,
    group: "",
    title: S(811, "Cut"),
    order: 1
  }, {
    menuId: wt.SimpleEditorContext,
    group: yT,
    title: S(812, "Cut"),
    when: se.writable,
    order: 1
  }]
})) : void 0, tCt = eBe ? zge(new KA({
  id: "editor.action.clipboardCopyAction",
  precondition: void 0,
  kbOpts: (
    // Do not bind copy keybindings in the browser,
    // since browsers do that for us and it avoids security prompts
    hm ? {
      primary: 2081,
      win: { primary: 2081, secondary: [
        2067
        /* KeyCode.Insert */
      ] },
      weight: 100
      /* KeybindingWeight.EditorContrib */
    } : void 0
  ),
  menuOpts: [{
    menuId: wt.MenubarEditMenu,
    group: "2_ccp",
    title: S(813, "&&Copy"),
    order: 2
  }, {
    menuId: wt.EditorContext,
    group: yT,
    title: S(814, "Copy"),
    order: 2
  }, {
    menuId: wt.CommandPalette,
    group: "",
    title: S(815, "Copy"),
    order: 1
  }, {
    menuId: wt.SimpleEditorContext,
    group: yT,
    title: S(816, "Copy"),
    order: 2
  }]
})) : void 0;
Oa.appendMenuItem(wt.MenubarEditMenu, { submenu: wt.MenubarCopy, title: Ee(821, "Copy As"), group: "2_ccp", order: 3 });
Oa.appendMenuItem(wt.EditorContext, { submenu: wt.EditorContextCopy, title: Ee(822, "Copy As"), group: yT, order: 3 });
Oa.appendMenuItem(wt.EditorContext, { submenu: wt.EditorContextShare, title: Ee(823, "Share"), group: "11_share", order: -1, when: Re.and(Re.notEquals("resourceScheme", "output"), se.editorTextFocus) });
Oa.appendMenuItem(wt.ExplorerContext, { submenu: wt.ExplorerContextShare, title: Ee(824, "Share"), group: "11_share", order: -1 });
const Gee = J0t ? zge(new KA({
  id: "editor.action.clipboardPasteAction",
  precondition: void 0,
  kbOpts: (
    // Do not bind paste keybindings in the browser,
    // since browsers do that for us and it avoids security prompts
    hm ? {
      primary: 2100,
      win: { primary: 2100, secondary: [
        1043
        /* KeyCode.Insert */
      ] },
      linux: { primary: 2100, secondary: [
        1043
        /* KeyCode.Insert */
      ] },
      weight: 100
      /* KeybindingWeight.EditorContrib */
    } : void 0
  ),
  menuOpts: [{
    menuId: wt.MenubarEditMenu,
    group: "2_ccp",
    title: S(817, "&&Paste"),
    order: 4
  }, {
    menuId: wt.EditorContext,
    group: yT,
    title: S(818, "Paste"),
    when: se.writable,
    order: 4
  }, {
    menuId: wt.CommandPalette,
    group: "",
    title: S(819, "Paste"),
    order: 1
  }, {
    menuId: wt.SimpleEditorContext,
    group: yT,
    title: S(820, "Paste"),
    when: se.writable,
    order: 4
  }]
})) : void 0;
class nCt extends vt {
  constructor() {
    super({
      id: "editor.action.clipboardCopyWithSyntaxHighlightingAction",
      label: Ee(825, "Copy with Syntax Highlighting"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    const n = e.get($r);
    n.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"), !(!t.hasModel() || !t.getOption(
      45
      /* EditorOption.emptySelectionClipboard */
    ) && t.getSelection().isEmpty()) && (Qie.forceCopyWithSyntaxHighlighting = !0, t.focus(), n.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"), t.getContainerDomNode().ownerDocument.execCommand("copy"), n.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"), Qie.forceCopyWithSyntaxHighlighting = !1);
  }
}
function tBe(i, e) {
  i && (i.addImplementation(1e4, "code-editor", (t, n) => {
    const r = t.get($r);
    r.trace("registerExecCommandImpl (addImplementation code-editor for : ", e, ")");
    const s = t.get(Ti).getFocusedCodeEditor();
    if (s && s.hasTextFocus()) {
      const o = s.getOption(
        45
        /* EditorOption.emptySelectionClipboard */
      ), a = s.getSelection();
      return a && a.isEmpty() && !o || (s.getOption(
        170
        /* EditorOption.effectiveEditContext */
      ) && e === "cut" ? (hDe(s), r.trace("registerExecCommandImpl (before execCommand copy)"), s.getContainerDomNode().ownerDocument.execCommand("copy"), s.trigger(void 0, "cut", void 0), r.trace("registerExecCommandImpl (after execCommand copy)")) : (hDe(s), r.trace("registerExecCommandImpl (before execCommand " + e + ")"), s.getContainerDomNode().ownerDocument.execCommand(e), r.trace("registerExecCommandImpl (after execCommand " + e + ")"))), !0;
    }
    return !1;
  }), i.addImplementation(0, "generic-dom", (t, n) => {
    const r = t.get($r);
    return r.trace("registerExecCommandImpl (addImplementation generic-dom for : ", e, ")"), r.trace("registerExecCommandImpl (before execCommand " + e + ")"), yB().execCommand(e), r.trace("registerExecCommandImpl (after execCommand " + e + ")"), !0;
  }));
}
function hDe(i) {
  if (i.getOption(
    170
    /* EditorOption.effectiveEditContext */
  )) {
    const t = zfe.get(i.getId());
    t && t.onWillCopy();
  }
}
tBe(eCt, "cut");
tBe(tCt, "copy");
Gee && (Gee.addImplementation(1e4, "code-editor", (i, e) => {
  const t = i.get($r);
  t.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");
  const n = i.get(Ti), r = i.get(_m), s = i.get(rc), o = i.get(g0t), a = n.getFocusedCodeEditor();
  if (a && a.hasModel() && a.hasTextFocus()) {
    if (a.getOption(
      170
      /* EditorOption.effectiveEditContext */
    )) {
      const d = zfe.get(a.getId());
      d && d.onWillPaste();
    }
    const c = _a.create(!0);
    t.trace("registerExecCommandImpl (before triggerPaste)");
    const u = r.triggerPaste(rr().vscodeWindowId);
    return u ? (t.trace("registerExecCommandImpl (triggerPaste defined)"), u.then(async () => {
      var d;
      if (t.trace("registerExecCommandImpl (after triggerPaste)"), o.quality !== "stable") {
        const h = c.elapsed();
        s.publicLog2("editorAsyncPaste", { duration: h });
      }
      return ((d = r0.get(a)) == null ? void 0 : d.finishedPaste()) ?? Promise.resolve();
    })) : (t.trace("registerExecCommandImpl (triggerPaste undefined)"), Lb ? (t.trace("registerExecCommandImpl (Paste handling on web)"), (async () => {
      const d = await r.readText();
      if (d !== "") {
        const h = ib.INSTANCE.get(d);
        let g = !1, m = null, _ = null;
        h && (g = a.getOption(
          45
          /* EditorOption.emptySelectionClipboard */
        ) && !!h.isFromEmptySelection, m = typeof h.multicursorText < "u" ? h.multicursorText : null, _ = h.mode), t.trace("registerExecCommandImpl (clipboardText.length : ", d.length, " id : ", h == null ? void 0 : h.id, ")"), a.trigger("keyboard", "paste", {
          text: d,
          pasteOnNewLine: g,
          multicursorText: m,
          mode: _
        });
      }
    })()) : !0);
  }
  return !1;
}), Gee.addImplementation(0, "generic-dom", (i, e) => (i.get($r).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"), i.get(_m).triggerPaste(rr().vscodeWindowId) ?? !1)));
eBe && Je(nCt);
const bK = Object.freeze({
  id: "editor",
  order: 5,
  type: "object",
  title: S(144, "Editor"),
  scope: 6
}), tz = {
  ...bK,
  properties: {
    "editor.tabSize": {
      type: "number",
      default: Gl.tabSize,
      minimum: 1,
      maximum: 100,
      markdownDescription: S(145, "The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.", "`#editor.detectIndentation#`")
    },
    "editor.indentSize": {
      anyOf: [
        {
          type: "string",
          enum: ["tabSize"]
        },
        {
          type: "number",
          minimum: 1
        }
      ],
      default: "tabSize",
      markdownDescription: S(146, 'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')
    },
    "editor.insertSpaces": {
      type: "boolean",
      default: Gl.insertSpaces,
      markdownDescription: S(147, "Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.", "`#editor.detectIndentation#`")
    },
    "editor.detectIndentation": {
      type: "boolean",
      default: Gl.detectIndentation,
      markdownDescription: S(148, "Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.", "`#editor.tabSize#`", "`#editor.insertSpaces#`")
    },
    "editor.trimAutoWhitespace": {
      type: "boolean",
      default: Gl.trimAutoWhitespace,
      description: S(149, "Remove trailing auto inserted whitespace.")
    },
    "editor.largeFileOptimizations": {
      type: "boolean",
      default: Gl.largeFileOptimizations,
      description: S(150, "Special handling for large files to disable certain memory intensive features.")
    },
    "editor.wordBasedSuggestions": {
      enum: ["off", "currentDocument", "matchingDocuments", "allDocuments"],
      default: "matchingDocuments",
      enumDescriptions: [
        S(151, "Turn off Word Based Suggestions."),
        S(152, "Only suggest words from the active document."),
        S(153, "Suggest words from all open documents of the same language."),
        S(154, "Suggest words from all open documents.")
      ],
      description: S(155, "Controls whether completions should be computed based on words in the document and from which documents they are computed.")
    },
    "editor.semanticHighlighting.enabled": {
      enum: [!0, !1, "configuredByTheme"],
      enumDescriptions: [
        S(156, "Semantic highlighting enabled for all color themes."),
        S(157, "Semantic highlighting disabled for all color themes."),
        S(158, "Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")
      ],
      default: "configuredByTheme",
      description: S(159, "Controls whether the semanticHighlighting is shown for the languages that support it.")
    },
    "editor.stablePeek": {
      type: "boolean",
      default: !1,
      markdownDescription: S(160, "Keep peek editors open even when double-clicking their content or when hitting `Escape`.")
    },
    "editor.maxTokenizationLineLength": {
      type: "integer",
      default: 2e4,
      description: S(161, "Lines above this length will not be tokenized for performance reasons")
    },
    "editor.experimental.asyncTokenization": {
      type: "boolean",
      default: !0,
      description: S(162, "Controls whether the tokenization should happen asynchronously on a web worker."),
      tags: ["experimental"]
    },
    "editor.experimental.asyncTokenizationLogging": {
      type: "boolean",
      default: !1,
      description: S(163, "Controls whether async tokenization should be logged. For debugging only.")
    },
    "editor.experimental.asyncTokenizationVerification": {
      type: "boolean",
      default: !1,
      description: S(164, "Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),
      tags: ["experimental"]
    },
    "editor.experimental.treeSitterTelemetry": {
      type: "boolean",
      default: !1,
      markdownDescription: S(165, "Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),
      tags: ["experimental"],
      experiment: {
        mode: "auto"
      }
    },
    "editor.experimental.preferTreeSitter.css": {
      type: "boolean",
      default: !1,
      markdownDescription: S(166, "Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),
      tags: ["experimental"],
      experiment: {
        mode: "auto"
      }
    },
    "editor.experimental.preferTreeSitter.typescript": {
      type: "boolean",
      default: !1,
      markdownDescription: S(167, "Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),
      tags: ["experimental"],
      experiment: {
        mode: "auto"
      }
    },
    "editor.experimental.preferTreeSitter.ini": {
      type: "boolean",
      default: !1,
      markdownDescription: S(168, "Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),
      tags: ["experimental"],
      experiment: {
        mode: "auto"
      }
    },
    "editor.experimental.preferTreeSitter.regex": {
      type: "boolean",
      default: !1,
      markdownDescription: S(169, "Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),
      tags: ["experimental"],
      experiment: {
        mode: "auto"
      }
    },
    "editor.language.brackets": {
      type: ["array", "null"],
      default: null,
      // We want to distinguish the empty array from not configured.
      description: S(170, "Defines the bracket symbols that increase or decrease the indentation."),
      items: {
        type: "array",
        items: [
          {
            type: "string",
            description: S(171, "The opening bracket character or string sequence.")
          },
          {
            type: "string",
            description: S(172, "The closing bracket character or string sequence.")
          }
        ]
      }
    },
    "editor.language.colorizedBracketPairs": {
      type: ["array", "null"],
      default: null,
      // We want to distinguish the empty array from not configured.
      description: S(173, "Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),
      items: {
        type: "array",
        items: [
          {
            type: "string",
            description: S(174, "The opening bracket character or string sequence.")
          },
          {
            type: "string",
            description: S(175, "The closing bracket character or string sequence.")
          }
        ]
      }
    },
    "diffEditor.maxComputationTime": {
      type: "number",
      default: ol.maxComputationTime,
      description: S(176, "Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")
    },
    "diffEditor.maxFileSize": {
      type: "number",
      default: ol.maxFileSize,
      description: S(177, "Maximum file size in MB for which to compute diffs. Use 0 for no limit.")
    },
    "diffEditor.renderSideBySide": {
      type: "boolean",
      default: ol.renderSideBySide,
      description: S(178, "Controls whether the diff editor shows the diff side by side or inline.")
    },
    "diffEditor.renderSideBySideInlineBreakpoint": {
      type: "number",
      default: ol.renderSideBySideInlineBreakpoint,
      description: S(179, "If the diff editor width is smaller than this value, the inline view is used.")
    },
    "diffEditor.useInlineViewWhenSpaceIsLimited": {
      type: "boolean",
      default: ol.useInlineViewWhenSpaceIsLimited,
      description: S(180, "If enabled and the editor width is too small, the inline view is used.")
    },
    "diffEditor.renderMarginRevertIcon": {
      type: "boolean",
      default: ol.renderMarginRevertIcon,
      description: S(181, "When enabled, the diff editor shows arrows in its glyph margin to revert changes.")
    },
    "diffEditor.renderGutterMenu": {
      type: "boolean",
      default: ol.renderGutterMenu,
      description: S(182, "When enabled, the diff editor shows a special gutter for revert and stage actions.")
    },
    "diffEditor.ignoreTrimWhitespace": {
      type: "boolean",
      default: ol.ignoreTrimWhitespace,
      description: S(183, "When enabled, the diff editor ignores changes in leading or trailing whitespace.")
    },
    "diffEditor.renderIndicators": {
      type: "boolean",
      default: ol.renderIndicators,
      description: S(184, "Controls whether the diff editor shows +/- indicators for added/removed changes.")
    },
    "diffEditor.codeLens": {
      type: "boolean",
      default: ol.diffCodeLens,
      description: S(185, "Controls whether the editor shows CodeLens.")
    },
    "diffEditor.wordWrap": {
      type: "string",
      enum: ["off", "on", "inherit"],
      default: ol.diffWordWrap,
      markdownEnumDescriptions: [
        S(186, "Lines will never wrap."),
        S(187, "Lines will wrap at the viewport width."),
        S(188, "Lines will wrap according to the {0} setting.", "`#editor.wordWrap#`")
      ]
    },
    "diffEditor.diffAlgorithm": {
      type: "string",
      enum: ["legacy", "advanced"],
      default: ol.diffAlgorithm,
      markdownEnumDescriptions: [
        S(189, "Uses the legacy diffing algorithm."),
        S(190, "Uses the advanced diffing algorithm.")
      ]
    },
    "diffEditor.hideUnchangedRegions.enabled": {
      type: "boolean",
      default: ol.hideUnchangedRegions.enabled,
      markdownDescription: S(191, "Controls whether the diff editor shows unchanged regions.")
    },
    "diffEditor.hideUnchangedRegions.revealLineCount": {
      type: "integer",
      default: ol.hideUnchangedRegions.revealLineCount,
      markdownDescription: S(192, "Controls how many lines are used for unchanged regions."),
      minimum: 1
    },
    "diffEditor.hideUnchangedRegions.minimumLineCount": {
      type: "integer",
      default: ol.hideUnchangedRegions.minimumLineCount,
      markdownDescription: S(193, "Controls how many lines are used as a minimum for unchanged regions."),
      minimum: 1
    },
    "diffEditor.hideUnchangedRegions.contextLineCount": {
      type: "integer",
      default: ol.hideUnchangedRegions.contextLineCount,
      markdownDescription: S(194, "Controls how many lines are used as context when comparing unchanged regions."),
      minimum: 1
    },
    "diffEditor.experimental.showMoves": {
      type: "boolean",
      default: ol.experimental.showMoves,
      markdownDescription: S(195, "Controls whether the diff editor should show detected code moves.")
    },
    "diffEditor.experimental.showEmptyDecorations": {
      type: "boolean",
      default: ol.experimental.showEmptyDecorations,
      description: S(196, "Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")
    },
    "diffEditor.experimental.useTrueInlineView": {
      type: "boolean",
      default: ol.experimental.useTrueInlineView,
      description: S(197, "If enabled and the editor uses the inline view, word changes are rendered inline.")
    }
  }
};
function iCt(i) {
  return typeof i.type < "u" || typeof i.anyOf < "u";
}
for (const i of sN) {
  const e = i.schema;
  if (typeof e < "u")
    if (iCt(e))
      tz.properties[`editor.${i.name}`] = e;
    else
      for (const t in e)
        Object.hasOwnProperty.call(e, t) && (tz.properties[t] = e[t]);
}
let lH = null;
function nBe() {
  return lH === null && (lH = /* @__PURE__ */ Object.create(null), Object.keys(tz.properties).forEach((i) => {
    lH[i] = !0;
  })), lH;
}
function rCt(i) {
  return nBe()[`editor.${i}`] || !1;
}
function sCt(i) {
  return nBe()[`diffEditor.${i}`] || !1;
}
const oCt = Fs.as(Cm.Configuration);
oCt.registerConfiguration(tz);
const cs = new class {
  constructor() {
    this.QuickFix = new Ps("quickfix"), this.Refactor = new Ps("refactor"), this.RefactorExtract = this.Refactor.append("extract"), this.RefactorInline = this.Refactor.append("inline"), this.RefactorMove = this.Refactor.append("move"), this.RefactorRewrite = this.Refactor.append("rewrite"), this.Notebook = new Ps("notebook"), this.Source = new Ps("source"), this.SourceOrganizeImports = this.Source.append("organizeImports"), this.SourceFixAll = this.Source.append("fixAll"), this.SurroundWith = this.Refactor.append("surround");
  }
}();
var Gd;
(function(i) {
  i.Refactor = "refactor", i.RefactorPreview = "refactor preview", i.Lightbulb = "lightbulb", i.Default = "other (default)", i.SourceAction = "source action", i.QuickFix = "quick fix action", i.FixAll = "fix all", i.OrganizeImports = "organize imports", i.AutoFix = "auto fix", i.QuickFixHover = "quick fix hover window", i.OnSave = "save participants", i.ProblemsView = "problems view";
})(Gd || (Gd = {}));
function aCt(i, e) {
  return !(i.include && !i.include.intersects(e) || i.excludes && i.excludes.some((t) => iBe(e, t, i.include)) || !i.includeSourceActions && cs.Source.contains(e));
}
function lCt(i, e) {
  const t = e.kind ? new Ps(e.kind) : void 0;
  return !(i.include && (!t || !i.include.contains(t)) || i.excludes && t && i.excludes.some((n) => iBe(t, n, i.include)) || !i.includeSourceActions && t && cs.Source.contains(t) || i.onlyIncludePreferredActions && !e.isPreferred);
}
function iBe(i, e, t) {
  return !(!e.contains(i) || t && e.contains(t));
}
class q_ {
  static fromUser(e, t) {
    return !e || typeof e != "object" ? new q_(t.kind, t.apply, !1) : new q_(q_.getKindFromUser(e, t.kind), q_.getApplyFromUser(e, t.apply), q_.getPreferredUser(e));
  }
  static getApplyFromUser(e, t) {
    switch (typeof e.apply == "string" ? e.apply.toLowerCase() : "") {
      case "first":
        return "first";
      case "never":
        return "never";
      case "ifsingle":
        return "ifSingle";
      default:
        return t;
    }
  }
  static getKindFromUser(e, t) {
    return typeof e.kind == "string" ? new Ps(e.kind) : t;
  }
  static getPreferredUser(e) {
    return typeof e.preferred == "boolean" ? e.preferred : !1;
  }
  constructor(e, t, n) {
    this.kind = e, this.apply = t, this.preferred = n;
  }
}
class cCt {
  constructor(e, t, n) {
    this.action = e, this.provider = t, this.highlightRange = n;
  }
  async resolve(e) {
    var t;
    if ((t = this.provider) != null && t.resolveCodeAction && !this.action.edit) {
      let n;
      try {
        n = await this.provider.resolveCodeAction(this.action, e);
      } catch (r) {
        No(r);
      }
      n && (this.action.edit = n.edit);
    }
    return this;
  }
}
const rBe = "editor.action.codeAction", $ge = "editor.action.quickFix", sBe = "editor.action.autoFix", oBe = "editor.action.refactor", aBe = "editor.action.sourceAction", Hse = "editor.action.organizeImports", Wse = "editor.action.fixAll", uCt = 1e3;
class $F extends ge {
  static codeActionsPreferredComparator(e, t) {
    return e.isPreferred && !t.isPreferred ? -1 : !e.isPreferred && t.isPreferred ? 1 : 0;
  }
  static codeActionsComparator({ action: e }, { action: t }) {
    return e.isAI && !t.isAI ? 1 : !e.isAI && t.isAI ? -1 : kc(e.diagnostics) ? kc(t.diagnostics) ? $F.codeActionsPreferredComparator(e, t) : -1 : kc(t.diagnostics) ? 1 : $F.codeActionsPreferredComparator(e, t);
  }
  constructor(e, t, n) {
    super(), this.documentation = t, this._register(n), this.allActions = [...e].sort($F.codeActionsComparator), this.validActions = this.allActions.filter(({ action: r }) => !r.disabled);
  }
  get hasAutoFix() {
    return this.validActions.some(({ action: e }) => !!e.kind && cs.QuickFix.contains(new Ps(e.kind)) && !!e.isPreferred);
  }
  get hasAIFix() {
    return this.validActions.some(({ action: e }) => !!e.isAI);
  }
  get allAIFixes() {
    return this.validActions.every(({ action: e }) => !!e.isAI);
  }
}
const fDe = { actions: [], documentation: void 0 };
async function gN(i, e, t, n, r, s) {
  var _;
  const o = n.filter || {}, a = {
    ...o,
    excludes: [...o.excludes || [], cs.Notebook]
  }, l = {
    only: (_ = o.include) == null ? void 0 : _.value,
    trigger: n.type
  }, c = new Bge(e, s), u = n.type === 2, d = dCt(i, e, u ? a : o), h = new ke(), g = d.map(async (v) => {
    const w = setTimeout(() => r.report(v), 1250);
    try {
      const E = await v.provideCodeActions(e, t, l, c.token);
      if (c.token.isCancellationRequested)
        return E == null || E.dispose(), fDe;
      E && h.add(E);
      const L = ((E == null ? void 0 : E.actions) || []).filter((D) => D && lCt(o, D)), T = fCt(v, L, o.include);
      return {
        actions: L.map((D) => new cCt(D, v)),
        documentation: T
      };
    } catch (E) {
      if (Xh(E))
        throw E;
      return No(E), fDe;
    } finally {
      clearTimeout(w);
    }
  }), m = i.onDidChange(() => {
    const v = i.all(e);
    ds(v, d) || c.cancel();
  });
  try {
    const v = await Promise.all(g), w = v.map((T) => T.actions).flat(), E = [
      ...ym(v.map((T) => T.documentation)),
      ...hCt(i, e, n, w)
    ], L = new $F(w, E, h);
    return h.add(L), L;
  } catch (v) {
    throw h.dispose(), v;
  } finally {
    m.dispose(), c.dispose();
  }
}
function dCt(i, e, t) {
  return i.all(e).filter((n) => n.providedCodeActionKinds ? n.providedCodeActionKinds.some((r) => aCt(t, new Ps(r))) : !0);
}
function* hCt(i, e, t, n) {
  var r, s, o;
  if (e && n.length)
    for (const a of i.all(e))
      a._getAdditionalMenuItems && (yield* (o = a._getAdditionalMenuItems) == null ? void 0 : o.call(a, { trigger: t.type, only: (s = (r = t.filter) == null ? void 0 : r.include) == null ? void 0 : s.value }, n.map((l) => l.action)));
}
function fCt(i, e, t) {
  if (!i.documentation)
    return;
  const n = i.documentation.map((r) => ({ kind: new Ps(r.kind), command: r.command }));
  if (t) {
    let r;
    for (const s of n)
      s.kind.contains(t) && (r ? r.kind.contains(s.kind) && (r = s) : r = s);
    if (r)
      return r == null ? void 0 : r.command;
  }
  for (const r of e)
    if (r.kind) {
      for (const s of n)
        if (s.kind.contains(new Ps(r.kind)))
          return s.command;
    }
}
var p1;
(function(i) {
  i.OnSave = "onSave", i.FromProblemsView = "fromProblemsView", i.FromCodeActions = "fromCodeActions", i.FromAILightbulb = "fromAILightbulb", i.FromProblemsHover = "fromProblemsHover";
})(p1 || (p1 = {}));
async function gCt(i, e, t, n, r = $n.None) {
  var u, d;
  const s = i.get(HB), o = i.get(jr), a = i.get(rc), l = i.get(no), c = i.get(h0);
  if (a.publicLog2("codeAction.applyCodeAction", {
    codeActionTitle: e.action.title,
    codeActionKind: e.action.kind,
    codeActionIsPreferred: !!e.action.isPreferred,
    reason: t
  }), c.playSignal(tu.codeActionTriggered), await e.resolve(r), !r.isCancellationRequested && !((u = e.action.edit) != null && u.edits.length && !(await s.apply(e.action.edit, {
    editor: n == null ? void 0 : n.editor,
    label: e.action.title,
    quotableLabel: e.action.title,
    code: "undoredo.codeAction",
    respectAutoSaveConfig: t !== p1.OnSave,
    showPreview: n == null ? void 0 : n.preview,
    reason: $l.codeAction({ kind: e.action.kind, providerId: sK.fromExtensionId((d = e.provider) == null ? void 0 : d.extensionId) })
  })).isApplied)) {
    if (e.action.command)
      try {
        await o.executeCommand(e.action.command.id, ...e.action.command.arguments || []);
      } catch (h) {
        const g = pCt(h);
        l.error(typeof g == "string" ? g : S(826, "An unknown error occurred while applying the code action"));
      }
    setTimeout(() => c.playSignal(tu.codeActionApplied), uCt);
  }
}
function pCt(i) {
  return typeof i == "string" ? i : i instanceof Error && typeof i.message == "string" ? i.message : void 0;
}
_i.registerCommand("_executeCodeActionProvider", async function(i, e, t, n, r) {
  if (!(e instanceof Ht))
    throw Bf();
  const { codeActionProvider: s } = i.get(St), o = i.get(xs).getModel(e);
  if (!o)
    throw Bf();
  const a = bt.isISelection(t) ? bt.liftSelection(t) : z.isIRange(t) ? o.validateRange(t) : void 0;
  if (!a)
    throw Bf();
  const l = typeof n == "string" ? new Ps(n) : void 0, c = await gN(s, o, a, { type: 1, triggerAction: Gd.Default, filter: { includeSourceActions: !0, include: l } }, tm.None, $n.None), u = [], d = Math.min(c.validActions.length, typeof r == "number" ? r : 0);
  for (let h = 0; h < d; h++)
    u.push(c.validActions[h].resolve($n.None));
  try {
    return await Promise.all(u), c.validActions.map((h) => h.action);
  } finally {
    setTimeout(() => c.dispose(), 100);
  }
});
var Os;
(function(i) {
  i[i.Hint = 1] = "Hint", i[i.Info = 2] = "Info", i[i.Warning = 4] = "Warning", i[i.Error = 8] = "Error";
})(Os || (Os = {}));
(function(i) {
  function e(l, c) {
    return c - l;
  }
  i.compare = e;
  const t = /* @__PURE__ */ Object.create(null);
  t[i.Error] = S(1715, "Error"), t[i.Warning] = S(1716, "Warning"), t[i.Info] = S(1717, "Info");
  function n(l) {
    return t[l] || "";
  }
  i.toString = n;
  const r = /* @__PURE__ */ Object.create(null);
  r[i.Error] = S(1718, "Errors"), r[i.Warning] = S(1719, "Warnings"), r[i.Info] = S(1720, "Infos");
  function s(l) {
    return r[l] || "";
  }
  i.toStringPlural = s;
  function o(l) {
    switch (l) {
      case Rs.Error:
        return i.Error;
      case Rs.Warning:
        return i.Warning;
      case Rs.Info:
        return i.Info;
      case Rs.Ignore:
        return i.Hint;
    }
  }
  i.fromSeverity = o;
  function a(l) {
    switch (l) {
      case i.Error:
        return Rs.Error;
      case i.Warning:
        return Rs.Warning;
      case i.Info:
        return Rs.Info;
      case i.Hint:
        return Rs.Ignore;
    }
  }
  i.toSeverity = a;
})(Os || (Os = {}));
var nz;
(function(i) {
  function t(r) {
    return n(r, !0);
  }
  i.makeKey = t;
  function n(r, s) {
    const o = [""];
    return r.source ? o.push(r.source.replace("¦", "\\¦")) : o.push(""), r.code ? typeof r.code == "string" ? o.push(r.code.replace("¦", "\\¦")) : o.push(r.code.value.replace("¦", "\\¦")) : o.push(""), r.severity !== void 0 && r.severity !== null ? o.push(Os.toString(r.severity)) : o.push(""), r.message && s ? o.push(r.message.replace("¦", "\\¦")) : o.push(""), r.startLineNumber !== void 0 && r.startLineNumber !== null ? o.push(r.startLineNumber.toString()) : o.push(""), r.startColumn !== void 0 && r.startColumn !== null ? o.push(r.startColumn.toString()) : o.push(""), r.endLineNumber !== void 0 && r.endLineNumber !== null ? o.push(r.endLineNumber.toString()) : o.push(""), r.endColumn !== void 0 && r.endColumn !== null ? o.push(r.endColumn.toString()) : o.push(""), o.push(""), o.join("¦");
  }
  i.makeKeyOptionalMessage = n;
})(nz || (nz = {}));
const Nb = Vn("markerService");
var mCt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, _Ct = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Vse, aL;
let Use = (aL = class {
  constructor(e) {
    this.keybindingService = e;
  }
  getResolver() {
    const e = new _l(() => this.keybindingService.getKeybindings().filter((t) => Vse.codeActionCommands.indexOf(t.command) >= 0).filter((t) => t.resolvedKeybinding).map((t) => {
      let n = t.commandArgs;
      return t.command === Hse ? n = { kind: cs.SourceOrganizeImports.value } : t.command === Wse && (n = { kind: cs.SourceFixAll.value }), {
        resolvedKeybinding: t.resolvedKeybinding,
        ...q_.fromUser(n, {
          kind: Ps.None,
          apply: "never"
          /* CodeActionAutoApply.Never */
        })
      };
    }));
    return (t) => {
      if (t.kind) {
        const n = this.bestKeybindingForCodeAction(t, e.value);
        return n == null ? void 0 : n.resolvedKeybinding;
      }
    };
  }
  bestKeybindingForCodeAction(e, t) {
    if (!e.kind)
      return;
    const n = new Ps(e.kind);
    return t.filter((r) => r.kind.contains(n)).filter((r) => r.preferred ? e.isPreferred : !0).reduceRight((r, s) => r ? r.kind.contains(s.kind) ? s : r : s, void 0);
  }
}, Vse = aL, aL.codeActionCommands = [
  oBe,
  rBe,
  aBe,
  Hse,
  Wse
], aL);
Use = Vse = mCt([
  _Ct(0, Fi)
], Use);
ie("symbolIcon.arrayForeground", Qn, S(1480, "The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.booleanForeground", Qn, S(1481, "The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.classForeground", {
  dark: "#EE9D28",
  light: "#D67E00",
  hcDark: "#EE9D28",
  hcLight: "#D67E00"
}, S(1482, "The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.colorForeground", Qn, S(1483, "The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.constantForeground", Qn, S(1484, "The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.constructorForeground", {
  dark: "#B180D7",
  light: "#652D90",
  hcDark: "#B180D7",
  hcLight: "#652D90"
}, S(1485, "The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.enumeratorForeground", {
  dark: "#EE9D28",
  light: "#D67E00",
  hcDark: "#EE9D28",
  hcLight: "#D67E00"
}, S(1486, "The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.enumeratorMemberForeground", {
  dark: "#75BEFF",
  light: "#007ACC",
  hcDark: "#75BEFF",
  hcLight: "#007ACC"
}, S(1487, "The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.eventForeground", {
  dark: "#EE9D28",
  light: "#D67E00",
  hcDark: "#EE9D28",
  hcLight: "#D67E00"
}, S(1488, "The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.fieldForeground", {
  dark: "#75BEFF",
  light: "#007ACC",
  hcDark: "#75BEFF",
  hcLight: "#007ACC"
}, S(1489, "The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.fileForeground", Qn, S(1490, "The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.folderForeground", Qn, S(1491, "The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.functionForeground", {
  dark: "#B180D7",
  light: "#652D90",
  hcDark: "#B180D7",
  hcLight: "#652D90"
}, S(1492, "The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.interfaceForeground", {
  dark: "#75BEFF",
  light: "#007ACC",
  hcDark: "#75BEFF",
  hcLight: "#007ACC"
}, S(1493, "The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.keyForeground", Qn, S(1494, "The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.keywordForeground", Qn, S(1495, "The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.methodForeground", {
  dark: "#B180D7",
  light: "#652D90",
  hcDark: "#B180D7",
  hcLight: "#652D90"
}, S(1496, "The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.moduleForeground", Qn, S(1497, "The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.namespaceForeground", Qn, S(1498, "The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.nullForeground", Qn, S(1499, "The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.numberForeground", Qn, S(1500, "The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.objectForeground", Qn, S(1501, "The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.operatorForeground", Qn, S(1502, "The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.packageForeground", Qn, S(1503, "The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.propertyForeground", Qn, S(1504, "The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.referenceForeground", Qn, S(1505, "The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.snippetForeground", Qn, S(1506, "The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.stringForeground", Qn, S(1507, "The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.structForeground", Qn, S(1508, "The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.textForeground", Qn, S(1509, "The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.typeParameterForeground", Qn, S(1510, "The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.unitForeground", Qn, S(1511, "The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
ie("symbolIcon.variableForeground", {
  dark: "#75BEFF",
  light: "#007ACC",
  hcDark: "#75BEFF",
  hcLight: "#007ACC"
}, S(1512, "The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));
const lBe = Object.freeze({ kind: Ps.Empty, title: S(862, "More Actions...") }), bCt = Object.freeze([
  { kind: cs.QuickFix, title: S(863, "Quick Fix") },
  { kind: cs.RefactorExtract, title: S(864, "Extract"), icon: Pe.wrench },
  { kind: cs.RefactorInline, title: S(865, "Inline"), icon: Pe.wrench },
  { kind: cs.RefactorRewrite, title: S(866, "Rewrite"), icon: Pe.wrench },
  { kind: cs.RefactorMove, title: S(867, "Move"), icon: Pe.wrench },
  { kind: cs.SurroundWith, title: S(868, "Surround With"), icon: Pe.surroundWith },
  { kind: cs.Source, title: S(869, "Source Action"), icon: Pe.symbolFile },
  lBe
]);
function vCt(i, e, t) {
  if (!e)
    return i.map((s) => {
      var o;
      return {
        kind: "action",
        item: s,
        group: lBe,
        disabled: !!s.action.disabled,
        label: s.action.disabled || s.action.title,
        canPreview: !!((o = s.action.edit) != null && o.edits.length)
      };
    });
  const n = bCt.map((s) => ({ group: s, actions: [] }));
  for (const s of i) {
    const o = s.action.kind ? new Ps(s.action.kind) : Ps.None;
    for (const a of n)
      if (a.group.kind.contains(o)) {
        a.actions.push(s);
        break;
      }
  }
  const r = [];
  for (const s of n)
    if (s.actions.length) {
      r.push({ kind: "header", group: s.group });
      for (const o of s.actions) {
        const a = s.group;
        r.push({
          kind: "action",
          item: o,
          group: o.action.isAI ? { title: a.title, kind: a.kind, icon: Pe.sparkle } : a,
          label: o.action.title,
          disabled: !!o.action.disabled,
          keybinding: t(o.action)
        });
      }
    }
  return r;
}
const cBe = new ut("supportedCodeAction", ""), gDe = "_typescript.applyFixAllCodeAction";
class yCt extends ge {
  constructor(e, t, n, r = 250) {
    super(), this._editor = e, this._markerService = t, this._signalChange = n, this._delay = r, this._autoTriggerTimer = this._register(new Gh()), this._register(this._markerService.onMarkerChanged((s) => this._onMarkerChanges(s))), this._register(this._editor.onDidChangeCursorPosition(() => this._tryAutoTrigger()));
  }
  trigger(e) {
    const t = this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);
    this._signalChange(t ? { trigger: e, selection: t } : void 0);
  }
  _onMarkerChanges(e) {
    const t = this._editor.getModel();
    t && e.some((n) => rw(n, t.uri)) && this._tryAutoTrigger();
  }
  _tryAutoTrigger() {
    this._autoTriggerTimer.cancelAndSet(() => {
      this.trigger({ type: 2, triggerAction: Gd.Default });
    }, this._delay);
  }
  _getRangeOfSelectionUnlessWhitespaceEnclosed(e) {
    if (!this._editor.hasModel())
      return;
    const t = this._editor.getSelection();
    if (e.type === 1)
      return t;
    const n = this._editor.getOption(
      73
      /* EditorOption.lightbulb */
    ).enabled;
    if (n !== Ag.Off) {
      {
        if (n === Ag.On)
          return t;
        if (n === Ag.OnCode) {
          if (!t.isEmpty())
            return t;
          const s = this._editor.getModel(), { lineNumber: o, column: a } = t.getPosition(), l = s.getLineContent(o);
          if (l.length === 0)
            return;
          if (a === 1) {
            if (/\s/.test(l[0]))
              return;
          } else if (a === s.getLineMaxColumn(o)) {
            if (/\s/.test(l[l.length - 1]))
              return;
          } else if (/\s/.test(l[a - 2]) && /\s/.test(l[a - 1]))
            return;
        }
      }
      return t;
    }
  }
}
var GE;
(function(i) {
  i.Empty = {
    type: 0
    /* Type.Empty */
  };
  class e {
    constructor(n, r, s) {
      this.trigger = n, this.position = r, this._cancellablePromise = s, this.type = 1, this.actions = s.catch((o) => {
        if (Xh(o))
          return zse;
        throw o;
      });
    }
    cancel() {
      this._cancellablePromise.cancel();
    }
  }
  i.Triggered = e;
})(GE || (GE = {}));
const zse = Object.freeze({
  allActions: [],
  validActions: [],
  dispose: () => {
  },
  documentation: [],
  hasAutoFix: !1,
  hasAIFix: !1,
  allAIFixes: !1
});
class CCt extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._editor = e, this._registry = t, this._markerService = n, this._progressService = s, this._configurationService = o, this._codeActionOracle = this._register(new er()), this._state = GE.Empty, this._onDidChangeState = this._register(new he()), this.onDidChangeState = this._onDidChangeState.event, this.codeActionsDisposable = this._register(new er()), this._disposed = !1, this._supportedCodeActions = cBe.bindTo(r), this._register(this._editor.onDidChangeModel(() => this._update())), this._register(this._editor.onDidChangeModelLanguage(() => this._update())), this._register(this._registry.onDidChange(() => this._update())), this._register(this._editor.onDidChangeConfiguration((a) => {
      a.hasChanged(
        73
        /* EditorOption.lightbulb */
      ) && this._update();
    })), this._update();
  }
  dispose() {
    this._disposed || (this._disposed = !0, super.dispose(), this.setState(GE.Empty, !0));
  }
  _settingEnabledNearbyQuickfixes() {
    var t;
    const e = (t = this._editor) == null ? void 0 : t.getModel();
    return this._configurationService ? this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes", { resource: e == null ? void 0 : e.uri }) : !1;
  }
  _update() {
    if (this._disposed)
      return;
    this._codeActionOracle.value = void 0, this.setState(GE.Empty);
    const e = this._editor.getModel();
    if (e && this._registry.has(e) && !this._editor.getOption(
      104
      /* EditorOption.readOnly */
    )) {
      const t = this._registry.all(e).flatMap((n) => n.providedCodeActionKinds ?? []);
      this._supportedCodeActions.set(t.join(" ")), this._codeActionOracle.value = new yCt(this._editor, this._markerService, (n) => {
        var l;
        if (!n) {
          this.setState(GE.Empty);
          return;
        }
        const r = n.selection.getStartPosition(), s = Jo(async (c) => {
          var d, h, g, m, _, v, w, E, L, T;
          if (this._settingEnabledNearbyQuickfixes() && n.trigger.type === 1 && (n.trigger.triggerAction === Gd.QuickFix || (h = (d = n.trigger.filter) == null ? void 0 : d.include) != null && h.contains(cs.QuickFix))) {
            const D = await gN(this._registry, e, n.selection, n.trigger, tm.None, c);
            this.codeActionsDisposable.value = D;
            const N = [...D.allActions];
            if (c.isCancellationRequested)
              return D.dispose(), zse;
            const R = (g = D.validActions) == null ? void 0 : g.some((B) => B.action.kind && cs.QuickFix.contains(new Ps(B.action.kind)) && !B.action.isAI), M = this._markerService.read({ resource: e.uri });
            if (R) {
              for (const B of D.validActions)
                (_ = (m = B.action.command) == null ? void 0 : m.arguments) != null && _.some((H) => typeof H == "string" && H.includes(gDe)) && (B.action.diagnostics = [...M.filter((H) => H.relatedInformation)]);
              return { validActions: D.validActions, allActions: N, documentation: D.documentation, hasAutoFix: D.hasAutoFix, hasAIFix: D.hasAIFix, allAIFixes: D.allAIFixes, dispose: () => {
                this.codeActionsDisposable.value = D;
              } };
            } else if (!R && M.length > 0) {
              const B = n.selection.getPosition();
              let H = B, j = Number.MAX_VALUE;
              const K = [...D.validActions];
              for (const Y of M) {
                const G = Y.endColumn, Q = Y.endLineNumber, oe = Y.startLineNumber;
                if (Q === B.lineNumber || oe === B.lineNumber) {
                  H = new de(Q, G);
                  const Z = {
                    type: n.trigger.type,
                    triggerAction: n.trigger.triggerAction,
                    filter: { include: (v = n.trigger.filter) != null && v.include ? (w = n.trigger.filter) == null ? void 0 : w.include : cs.QuickFix },
                    autoApply: n.trigger.autoApply,
                    context: { notAvailableMessage: ((E = n.trigger.context) == null ? void 0 : E.notAvailableMessage) || "", position: H }
                  }, pe = new bt(H.lineNumber, H.column, H.lineNumber, H.column), J = await gN(this._registry, e, pe, Z, tm.None, c);
                  if (c.isCancellationRequested)
                    return J.dispose(), zse;
                  if (J.validActions.length !== 0) {
                    for (const ae of J.validActions)
                      (T = (L = ae.action.command) == null ? void 0 : L.arguments) != null && T.some((be) => typeof be == "string" && be.includes(gDe)) && (ae.action.diagnostics = [...M.filter((be) => be.relatedInformation)]);
                    D.allActions.length === 0 && N.push(...J.allActions), Math.abs(B.column - G) < j ? K.unshift(...J.validActions) : K.push(...J.validActions);
                  }
                  j = Math.abs(B.column - G);
                }
              }
              const X = K.filter((Y, G, Q) => Q.findIndex((oe) => oe.action.title === Y.action.title) === G);
              return X.sort((Y, G) => Y.action.isPreferred && !G.action.isPreferred ? -1 : !Y.action.isPreferred && G.action.isPreferred || Y.action.isAI && !G.action.isAI ? 1 : !Y.action.isAI && G.action.isAI ? -1 : 0), { validActions: X, allActions: N, documentation: D.documentation, hasAutoFix: D.hasAutoFix, hasAIFix: D.hasAIFix, allAIFixes: D.allAIFixes, dispose: () => {
                this.codeActionsDisposable.value = D;
              } };
            }
          }
          if (n.trigger.type === 1) {
            const D = await gN(this._registry, e, n.selection, n.trigger, tm.None, c);
            return this.codeActionsDisposable.value = D, D;
          }
          const u = await gN(this._registry, e, n.selection, n.trigger, tm.None, c);
          return this.codeActionsDisposable.value = u, u;
        });
        n.trigger.type === 1 && ((l = this._progressService) == null || l.showWhile(s, 250));
        const o = new GE.Triggered(n.trigger, r, s);
        let a = !1;
        this._state.type === 1 && (a = this._state.trigger.type === 1 && o.type === 1 && o.trigger.type === 2 && this._state.position !== o.position), a ? setTimeout(() => {
          this.setState(o);
        }, 500) : this.setState(o);
      }, void 0), this._codeActionOracle.value.trigger({ type: 2, triggerAction: Gd.Default });
    } else
      this._supportedCodeActions.reset();
  }
  trigger(e) {
    var t;
    (t = this._codeActionOracle.value) == null || t.trigger(e), this.codeActionsDisposable.dispose();
  }
  setState(e, t) {
    e !== this._state && (this._state.type === 1 && this._state.cancel(), this._state = e, !t && !this._disposed && this._onDidChangeState.fire(e));
  }
}
var wCt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, SCt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, $I;
const pDe = es("gutter-lightbulb", Pe.lightBulb, S(870, "Icon which spawns code actions menu from the gutter when there is no space in the editor.")), mDe = es("gutter-lightbulb-auto-fix", Pe.lightbulbAutofix, S(871, "Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")), _De = es("gutter-lightbulb-sparkle", Pe.lightbulbSparkle, S(872, "Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")), bDe = es("gutter-lightbulb-aifix-auto-fix", Pe.lightbulbSparkleAutofix, S(873, "Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")), vDe = es("gutter-lightbulb-sparkle-filled", Pe.sparkleFilled, S(874, "Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));
var Rp;
(function(i) {
  i.Hidden = {
    type: 0
    /* Type.Hidden */
  };
  class e {
    constructor(n, r, s, o) {
      this.actions = n, this.trigger = r, this.editorPosition = s, this.widgetPosition = o, this.type = 1;
    }
  }
  i.Showing = e;
})(Rp || (Rp = {}));
var ky;
let Q4 = (ky = class extends ge {
  constructor(e, t) {
    super(), this._editor = e, this._keybindingService = t, this._onClick = this._register(new he()), this.onClick = this._onClick.event, this._state = Rp.Hidden, this._gutterState = Rp.Hidden, this._iconClasses = [], this.lightbulbClasses = [
      "codicon-" + pDe.id,
      "codicon-" + bDe.id,
      "codicon-" + mDe.id,
      "codicon-" + _De.id,
      "codicon-" + vDe.id
    ], this.gutterDecoration = $I.GUTTER_DECORATION, this._domNode = Ge("div.lightBulbWidget"), this._domNode.role = "listbox", this._register(ec.ignoreTarget(this._domNode)), this._editor.addContentWidget(this), this._register(this._editor.onDidChangeModelContent((n) => {
      const r = this._editor.getModel();
      (this.state.type !== 1 || !r || this.state.editorPosition.lineNumber >= r.getLineCount()) && this.hide(), (this.gutterState.type !== 1 || !r || this.gutterState.editorPosition.lineNumber >= r.getLineCount()) && this.gutterHide();
    })), this._register(Oit(this._domNode, (n) => {
      if (this.state.type !== 1)
        return;
      this._editor.focus(), n.preventDefault();
      const { top: r, height: s } = ho(this._domNode), o = this._editor.getOption(
        75
        /* EditorOption.lineHeight */
      );
      let a = Math.floor(o / 3);
      this.state.widgetPosition.position !== null && this.state.widgetPosition.position.lineNumber < this.state.editorPosition.lineNumber && (a += o), this._onClick.fire({
        x: n.posx,
        y: r + s + a,
        actions: this.state.actions,
        trigger: this.state.trigger
      });
    })), this._register(Ce(this._domNode, "mouseenter", (n) => {
      (n.buttons & 1) === 1 && this.hide();
    })), this._register(Ze.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings, () => {
      var n, r;
      this._preferredKbLabel = ((n = this._keybindingService.lookupKeybinding(sBe)) == null ? void 0 : n.getLabel()) ?? void 0, this._quickFixKbLabel = ((r = this._keybindingService.lookupKeybinding($ge)) == null ? void 0 : r.getLabel()) ?? void 0, this._updateLightBulbTitleAndIcon();
    })), this._register(this._editor.onMouseDown(async (n) => {
      if (!n.target.element || !this.lightbulbClasses.some((l) => n.target.element && n.target.element.classList.contains(l)) || this.gutterState.type !== 1)
        return;
      this._editor.focus();
      const { top: r, height: s } = ho(n.target.element), o = this._editor.getOption(
        75
        /* EditorOption.lineHeight */
      );
      let a = Math.floor(o / 3);
      this.gutterState.widgetPosition.position !== null && this.gutterState.widgetPosition.position.lineNumber < this.gutterState.editorPosition.lineNumber && (a += o), this._onClick.fire({
        x: n.event.posx,
        y: r + s + a,
        actions: this.gutterState.actions,
        trigger: this.gutterState.trigger
      });
    }));
  }
  dispose() {
    super.dispose(), this._editor.removeContentWidget(this), this._gutterDecorationID && this._removeGutterDecoration(this._gutterDecorationID);
  }
  getId() {
    return "LightBulbWidget";
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return this._state.type === 1 ? this._state.widgetPosition : null;
  }
  update(e, t, n) {
    if (e.validActions.length <= 0)
      return this.gutterHide(), this.hide();
    if (!this._editor.hasTextFocus())
      return this.gutterHide(), this.hide();
    if (!this._editor.getOptions().get(
      73
      /* EditorOption.lightbulb */
    ).enabled)
      return this.gutterHide(), this.hide();
    const o = this._editor.getModel();
    if (!o)
      return this.gutterHide(), this.hide();
    const { lineNumber: a, column: l } = o.validatePosition(n), c = o.getOptions().tabSize, u = this._editor.getOptions().get(
      59
      /* EditorOption.fontInfo */
    ), d = o.getLineContent(a), h = iK(d, c), g = u.spaceWidth * h > 22, m = (D) => D > 2 && this._editor.getTopForLineNumber(D) === this._editor.getTopForLineNumber(D - 1), _ = this._editor.getLineDecorations(a);
    let v = !1;
    if (_)
      for (const D of _) {
        const N = D.options.glyphMarginClassName;
        if (N && !this.lightbulbClasses.some((R) => N.includes(R))) {
          v = !0;
          break;
        }
      }
    let w = a, E = 1;
    if (!g) {
      const D = (N) => {
        const R = o.getLineContent(N);
        return /^\s*$|^\s+/.test(R) || R.length <= E;
      };
      if (a > 1 && !m(a - 1)) {
        const N = o.getLineCount(), R = a === N, M = a > 1 && D(a - 1), B = !R && D(a + 1), H = D(a), j = !B && !M;
        if (!B && !M && !v)
          return this.gutterState = new Rp.Showing(e, t, n, {
            position: { lineNumber: w, column: E },
            preference: $I._posPref
          }), this.renderGutterLightbub(), this.hide();
        M || R || M && !H ? w -= 1 : (B || j && H) && (w += 1);
      } else if (a === 1 && (a === o.getLineCount() || !D(a + 1) && !D(a)))
        if (this.gutterState = new Rp.Showing(e, t, n, {
          position: { lineNumber: w, column: E },
          preference: $I._posPref
        }), v)
          this.gutterHide();
        else
          return this.renderGutterLightbub(), this.hide();
      else if (a < o.getLineCount() && !m(a + 1))
        w += 1;
      else if (l * u.spaceWidth < 22)
        return this.hide();
      E = /^\S\s*$/.test(o.getLineContent(w)) ? 2 : 1;
    }
    this.state = new Rp.Showing(e, t, n, {
      position: { lineNumber: w, column: E },
      preference: $I._posPref
    }), this._gutterDecorationID && (this._removeGutterDecoration(this._gutterDecorationID), this.gutterHide());
    const L = e.validActions, T = e.validActions[0].action.kind;
    if (L.length !== 1 || !T) {
      this._editor.layoutContentWidget(this);
      return;
    }
    this._editor.layoutContentWidget(this);
  }
  hide() {
    this.state !== Rp.Hidden && (this.state = Rp.Hidden, this._editor.layoutContentWidget(this));
  }
  gutterHide() {
    this.gutterState !== Rp.Hidden && (this._gutterDecorationID && this._removeGutterDecoration(this._gutterDecorationID), this.gutterState = Rp.Hidden);
  }
  get state() {
    return this._state;
  }
  set state(e) {
    this._state = e, this._updateLightBulbTitleAndIcon();
  }
  get gutterState() {
    return this._gutterState;
  }
  set gutterState(e) {
    this._gutterState = e, this._updateGutterLightBulbTitleAndIcon();
  }
  _updateLightBulbTitleAndIcon() {
    if (this._domNode.classList.remove(...this._iconClasses), this._iconClasses = [], this.state.type !== 1)
      return;
    let e, t = !1;
    this.state.actions.allAIFixes ? (e = Pe.sparkleFilled, this.state.actions.validActions.length === 1 && (t = !0)) : this.state.actions.hasAutoFix ? this.state.actions.hasAIFix ? e = Pe.lightbulbSparkleAutofix : e = Pe.lightbulbAutofix : this.state.actions.hasAIFix ? e = Pe.lightbulbSparkle : e = Pe.lightBulb, this._updateLightbulbTitle(this.state.actions.hasAutoFix, t), this._iconClasses = qt.asClassNameArray(e), this._domNode.classList.add(...this._iconClasses);
  }
  _updateGutterLightBulbTitleAndIcon() {
    if (this.gutterState.type !== 1)
      return;
    let e, t = !1;
    this.gutterState.actions.allAIFixes ? (e = vDe, this.gutterState.actions.validActions.length === 1 && (t = !0)) : this.gutterState.actions.hasAutoFix ? this.gutterState.actions.hasAIFix ? e = bDe : e = mDe : this.gutterState.actions.hasAIFix ? e = _De : e = pDe, this._updateLightbulbTitle(this.gutterState.actions.hasAutoFix, t);
    const n = dn.register({
      description: "codicon-gutter-lightbulb-decoration",
      glyphMarginClassName: qt.asClassName(e),
      glyphMargin: { position: fm.Left },
      stickiness: 1
    });
    this.gutterDecoration = n;
  }
  /* Gutter Helper Functions */
  renderGutterLightbub() {
    const e = this._editor.getSelection();
    e && (this._gutterDecorationID === void 0 ? this._addGutterDecoration(e.startLineNumber) : this._updateGutterDecoration(this._gutterDecorationID, e.startLineNumber));
  }
  _addGutterDecoration(e) {
    this._editor.changeDecorations((t) => {
      this._gutterDecorationID = t.addDecoration(new z(e, 0, e, 0), this.gutterDecoration);
    });
  }
  _removeGutterDecoration(e) {
    this._editor.changeDecorations((t) => {
      t.removeDecoration(e), this._gutterDecorationID = void 0;
    });
  }
  _updateGutterDecoration(e, t) {
    this._editor.changeDecorations((n) => {
      n.changeDecoration(e, new z(t, 0, t, 0)), n.changeDecorationOptions(e, this.gutterDecoration);
    });
  }
  _updateLightbulbTitle(e, t) {
    this.state.type === 1 && (t ? this.title = S(875, "Run: {0}", this.state.actions.validActions[0].action.title) : e && this._preferredKbLabel ? this.title = S(876, "Show Code Actions. Preferred Quick Fix Available ({0})", this._preferredKbLabel) : !e && this._quickFixKbLabel ? this.title = S(877, "Show Code Actions ({0})", this._quickFixKbLabel) : e || (this.title = S(878, "Show Code Actions")));
  }
  set title(e) {
    this._domNode.title = e;
  }
}, $I = ky, ky.GUTTER_DECORATION = dn.register({
  description: "codicon-gutter-lightbulb-decoration",
  glyphMarginClassName: qt.asClassName(Pe.lightBulb),
  glyphMargin: { position: fm.Left },
  stickiness: 1
}), ky.ID = "editor.contrib.lightbulbWidget", ky._posPref = [
  0
  /* ContentWidgetPositionPreference.EXACT */
], ky);
Q4 = $I = wCt([
  SCt(1, Fi)
], Q4);
var ECt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, f_ = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, jI;
const xCt = "quickfix-edit-highlight";
var B1;
let CT = (B1 = class extends ge {
  static get(e) {
    return e.getContribution(jI.ID);
  }
  constructor(e, t, n, r, s, o, a, l, c, u, d) {
    super(), this._commandService = a, this._configurationService = l, this._actionWidgetService = c, this._instantiationService = u, this._progressService = d, this._activeCodeActions = this._register(new er()), this._showDisabled = !1, this._disposed = !1, this._editor = e, this._model = this._register(new CCt(this._editor, s.codeActionProvider, t, n, o, l)), this._register(this._model.onDidChangeState((h) => this.update(h))), this._lightBulbWidget = new _l(() => {
      const h = this._editor.getContribution(Q4.ID);
      return h && this._register(h.onClick((g) => this.showCodeActionsFromLightbulb(g.actions, g))), h;
    }), this._resolver = r.createInstance(Use), this._register(this._editor.onDidLayoutChange(() => this._actionWidgetService.hide()));
  }
  dispose() {
    this._disposed = !0, super.dispose();
  }
  async showCodeActionsFromLightbulb(e, t) {
    if (e.allAIFixes && e.validActions.length === 1) {
      const n = e.validActions[0], r = n.action.command;
      r && r.id === "inlineChat.start" && r.arguments && r.arguments.length >= 1 && (r.arguments[0] = { ...r.arguments[0], autoSend: !1 }), await this.applyCodeAction(n, !1, !1, p1.FromAILightbulb);
      return;
    }
    await this.showCodeActionList(e, t, { includeDisabledActions: !1, fromLightbulb: !0 });
  }
  showCodeActions(e, t, n) {
    return this.showCodeActionList(t, n, { includeDisabledActions: !1, fromLightbulb: !1 });
  }
  manualTriggerAtCurrentPosition(e, t, n, r) {
    var o;
    if (!this._editor.hasModel())
      return;
    (o = Vd.get(this._editor)) == null || o.closeMessage();
    const s = this._editor.getPosition();
    this._trigger({ type: 1, triggerAction: t, filter: n, autoApply: r, context: { notAvailableMessage: e, position: s } });
  }
  _trigger(e) {
    return this._model.trigger(e);
  }
  async applyCodeAction(e, t, n, r) {
    const s = this._progressService.show(!0, 500);
    try {
      await this._instantiationService.invokeFunction(gCt, e, r, { preview: n, editor: this._editor });
    } finally {
      t && this._trigger({ type: 2, triggerAction: Gd.QuickFix, filter: {} }), s.done();
    }
  }
  hideLightBulbWidget() {
    var e, t;
    (e = this._lightBulbWidget.rawValue) == null || e.hide(), (t = this._lightBulbWidget.rawValue) == null || t.gutterHide();
  }
  async update(e) {
    var r, s, o, a, l;
    if (e.type !== 1) {
      this.hideLightBulbWidget();
      return;
    }
    let t;
    try {
      t = await e.actions;
    } catch (c) {
      fn(c);
      return;
    }
    if (this._disposed)
      return;
    const n = this._editor.getSelection();
    if ((n == null ? void 0 : n.startLineNumber) === e.position.lineNumber)
      if ((r = this._lightBulbWidget.value) == null || r.update(t, e.trigger, e.position), e.trigger.type === 1) {
        if ((s = e.trigger.filter) != null && s.include) {
          const u = this.tryGetValidActionToApply(e.trigger, t);
          if (u) {
            try {
              this.hideLightBulbWidget(), await this.applyCodeAction(u, !1, !1, p1.FromCodeActions);
            } finally {
              t.dispose();
            }
            return;
          }
          if (e.trigger.context) {
            const d = this.getInvalidActionThatWouldHaveBeenApplied(e.trigger, t);
            if (d && d.action.disabled) {
              (o = Vd.get(this._editor)) == null || o.showMessage(d.action.disabled, e.trigger.context.position), t.dispose();
              return;
            }
          }
        }
        const c = !!((a = e.trigger.filter) != null && a.include);
        if (e.trigger.context && (!t.allActions.length || !c && !t.validActions.length)) {
          (l = Vd.get(this._editor)) == null || l.showMessage(e.trigger.context.notAvailableMessage, e.trigger.context.position), this._activeCodeActions.value = t, t.dispose();
          return;
        }
        this._activeCodeActions.value = t, this.showCodeActionList(t, this.toCoords(e.position), { includeDisabledActions: c, fromLightbulb: !1 });
      } else
        this._actionWidgetService.isVisible ? t.dispose() : this._activeCodeActions.value = t;
  }
  getInvalidActionThatWouldHaveBeenApplied(e, t) {
    if (t.allActions.length && (e.autoApply === "first" && t.validActions.length === 0 || e.autoApply === "ifSingle" && t.allActions.length === 1))
      return t.allActions.find(({ action: n }) => n.disabled);
  }
  tryGetValidActionToApply(e, t) {
    if (t.validActions.length && (e.autoApply === "first" && t.validActions.length > 0 || e.autoApply === "ifSingle" && t.validActions.length === 1))
      return t.validActions[0];
  }
  async showCodeActionList(e, t, n) {
    const r = this._editor.createDecorationsCollection(), s = this._editor.getDomNode();
    if (!s)
      return;
    const o = n.includeDisabledActions && (this._showDisabled || e.validActions.length === 0) ? e.allActions : e.validActions;
    if (!o.length)
      return;
    const a = de.isIPosition(t) ? this.toCoords(t) : t, l = {
      onSelect: async (c, u) => {
        this.applyCodeAction(
          c,
          /* retrigger */
          !0,
          !!u,
          n.fromLightbulb ? p1.FromAILightbulb : p1.FromCodeActions
        ), this._actionWidgetService.hide(!1), r.clear();
      },
      onHide: (c) => {
        var u;
        (u = this._editor) == null || u.focus(), r.clear();
      },
      onHover: async (c, u) => {
        var g;
        if (u.isCancellationRequested)
          return;
        let d = !1;
        const h = c.action.kind;
        if (h) {
          const m = new Ps(h);
          d = [
            cs.RefactorExtract,
            cs.RefactorInline,
            cs.RefactorRewrite,
            cs.RefactorMove,
            cs.Source
          ].some((v) => v.contains(m));
        }
        return { canPreview: d || !!((g = c.action.edit) != null && g.edits.length) };
      },
      onFocus: (c) => {
        var u, d;
        if (c && c.action) {
          const h = c.action.ranges, g = c.action.diagnostics;
          if (r.clear(), h && h.length > 0) {
            const m = g && (g == null ? void 0 : g.length) > 1 ? g.map((_) => ({ range: _, options: jI.DECORATION })) : h.map((_) => ({ range: _, options: jI.DECORATION }));
            r.set(m);
          } else if (g && g.length > 0) {
            const m = g.map((v) => ({ range: v, options: jI.DECORATION }));
            r.set(m);
            const _ = g[0];
            if (_.startLineNumber && _.startColumn) {
              const v = (d = (u = this._editor.getModel()) == null ? void 0 : u.getWordAtPosition({ lineNumber: _.startLineNumber, column: _.startColumn })) == null ? void 0 : d.word;
              hb(S(859, "Context: {0} at line {1} and column {2}.", v, _.startLineNumber, _.startColumn));
            }
          }
        } else
          r.clear();
      }
    };
    this._actionWidgetService.show("codeActionWidget", !0, vCt(o, this._shouldShowHeaders(), this._resolver.getResolver()), l, a, s, this._getActionBarActions(e, t, n));
  }
  toCoords(e) {
    if (!this._editor.hasModel())
      return { x: 0, y: 0 };
    this._editor.revealPosition(
      e,
      1
      /* ScrollType.Immediate */
    ), this._editor.render();
    const t = this._editor.getScrolledVisiblePosition(e), n = ho(this._editor.getDomNode()), r = n.left + t.left, s = n.top + t.top + t.height;
    return { x: r, y: s };
  }
  _shouldShowHeaders() {
    var t;
    const e = (t = this._editor) == null ? void 0 : t.getModel();
    return this._configurationService.getValue("editor.codeActionWidget.showHeaders", { resource: e == null ? void 0 : e.uri });
  }
  _getActionBarActions(e, t, n) {
    if (n.fromLightbulb)
      return [];
    const r = e.documentation.map((s) => ({
      id: s.id,
      label: s.title,
      tooltip: s.tooltip ?? "",
      class: void 0,
      enabled: !0,
      run: () => this._commandService.executeCommand(s.id, ...s.arguments ?? [])
    }));
    return n.includeDisabledActions && e.validActions.length > 0 && e.allActions.length !== e.validActions.length && r.push(this._showDisabled ? {
      id: "hideMoreActions",
      label: S(860, "Hide Disabled"),
      enabled: !0,
      tooltip: "",
      class: void 0,
      run: () => (this._showDisabled = !1, this.showCodeActionList(e, t, n))
    } : {
      id: "showMoreActions",
      label: S(861, "Show Disabled"),
      enabled: !0,
      tooltip: "",
      class: void 0,
      run: () => (this._showDisabled = !0, this.showCodeActionList(e, t, n))
    }), r;
  }
}, jI = B1, B1.ID = "editor.contrib.codeActionController", B1.DECORATION = dn.register({
  description: "quickfix-highlight",
  className: xCt
}), B1);
CT = jI = ECt([
  f_(1, Nb),
  f_(2, Jt),
  f_(3, xt),
  f_(4, St),
  f_(5, e0),
  f_(6, jr),
  f_(7, xn),
  f_(8, Tw),
  f_(9, xt),
  f_(10, e0)
], CT);
ng((i, e) => {
  ((r, s) => {
    s && e.addRule(`.monaco-editor ${r} { background-color: ${s}; }`);
  })(".quickfix-edit-highlight", i.getColor(vy));
  const n = i.getColor(a1);
  n && e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${am(i.type) ? "dotted" : "solid"} ${n}; box-sizing: border-box; }`);
});
function UB(i) {
  return Re.regex(cBe.keys()[0], new RegExp("(\\s|^)" + zd(i.value) + "\\b"));
}
const jge = {
  type: "object",
  defaultSnippets: [{ body: { kind: "" } }],
  properties: {
    kind: {
      type: "string",
      description: S(827, "Kind of the code action to run.")
    },
    apply: {
      type: "string",
      description: S(828, "Controls when the returned actions are applied."),
      default: "ifSingle",
      enum: [
        "first",
        "ifSingle",
        "never"
        /* CodeActionAutoApply.Never */
      ],
      enumDescriptions: [
        S(829, "Always apply the first returned code action."),
        S(830, "Apply the first returned code action if it is the only one."),
        S(831, "Do not apply the returned code actions.")
      ]
    },
    preferred: {
      type: "boolean",
      default: !1,
      description: S(832, "Controls if only preferred code actions should be returned.")
    }
  }
};
function tk(i, e, t, n, r = Gd.Default) {
  if (i.hasModel()) {
    const s = CT.get(i);
    s == null || s.manualTriggerAtCurrentPosition(e, r, t, n);
  }
}
class LCt extends vt {
  constructor() {
    super({
      id: $ge,
      label: Ee(849, "Quick Fix..."),
      precondition: Re.and(se.writable, se.hasCodeActionsProvider),
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 2137,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    return tk(t, S(833, "No code actions available"), void 0, void 0, Gd.QuickFix);
  }
}
class TCt extends jo {
  constructor() {
    super({
      id: rBe,
      precondition: Re.and(se.writable, se.hasCodeActionsProvider),
      metadata: {
        description: "Trigger a code action",
        args: [{ name: "args", schema: jge }]
      }
    });
  }
  runEditorCommand(e, t, n) {
    const r = q_.fromUser(n, {
      kind: Ps.Empty,
      apply: "ifSingle"
    });
    return tk(t, typeof (n == null ? void 0 : n.kind) == "string" ? r.preferred ? S(834, "No preferred code actions for '{0}' available", n.kind) : S(835, "No code actions for '{0}' available", n.kind) : r.preferred ? S(836, "No preferred code actions available") : S(837, "No code actions available"), {
      include: r.kind,
      includeSourceActions: !0,
      onlyIncludePreferredActions: r.preferred
    }, r.apply);
  }
}
class kCt extends vt {
  constructor() {
    super({
      id: oBe,
      label: Ee(850, "Refactor..."),
      precondition: Re.and(se.writable, se.hasCodeActionsProvider),
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 3120,
        mac: {
          primary: 1328
          /* KeyCode.KeyR */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      contextMenuOpts: {
        group: "1_modification",
        order: 2,
        when: Re.and(se.writable, UB(cs.Refactor))
      },
      metadata: {
        description: "Refactor...",
        args: [{ name: "args", schema: jge }]
      }
    });
  }
  run(e, t, n) {
    const r = q_.fromUser(n, {
      kind: cs.Refactor,
      apply: "never"
      /* CodeActionAutoApply.Never */
    });
    return tk(t, typeof (n == null ? void 0 : n.kind) == "string" ? r.preferred ? S(838, "No preferred refactorings for '{0}' available", n.kind) : S(839, "No refactorings for '{0}' available", n.kind) : r.preferred ? S(840, "No preferred refactorings available") : S(841, "No refactorings available"), {
      include: cs.Refactor.contains(r.kind) ? r.kind : Ps.None,
      onlyIncludePreferredActions: r.preferred
    }, r.apply, Gd.Refactor);
  }
}
class DCt extends vt {
  constructor() {
    super({
      id: aBe,
      label: Ee(851, "Source Action..."),
      precondition: Re.and(se.writable, se.hasCodeActionsProvider),
      contextMenuOpts: {
        group: "1_modification",
        order: 2.1,
        when: Re.and(se.writable, UB(cs.Source))
      },
      metadata: {
        description: "Source Action...",
        args: [{ name: "args", schema: jge }]
      }
    });
  }
  run(e, t, n) {
    const r = q_.fromUser(n, {
      kind: cs.Source,
      apply: "never"
      /* CodeActionAutoApply.Never */
    });
    return tk(t, typeof (n == null ? void 0 : n.kind) == "string" ? r.preferred ? S(842, "No preferred source actions for '{0}' available", n.kind) : S(843, "No source actions for '{0}' available", n.kind) : r.preferred ? S(844, "No preferred source actions available") : S(845, "No source actions available"), {
      include: cs.Source.contains(r.kind) ? r.kind : Ps.None,
      includeSourceActions: !0,
      onlyIncludePreferredActions: r.preferred
    }, r.apply, Gd.SourceAction);
  }
}
class ICt extends vt {
  constructor() {
    super({
      id: Hse,
      label: Ee(852, "Organize Imports"),
      precondition: Re.and(se.writable, UB(cs.SourceOrganizeImports)),
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 1581,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(853, "Organize imports in the current file. Also called 'Optimize Imports' by some tools")
      }
    });
  }
  run(e, t) {
    return tk(t, S(846, "No organize imports action available"), { include: cs.SourceOrganizeImports, includeSourceActions: !0 }, "ifSingle", Gd.OrganizeImports);
  }
}
class NCt extends vt {
  constructor() {
    super({
      id: Wse,
      label: Ee(854, "Fix All"),
      precondition: Re.and(se.writable, UB(cs.SourceFixAll))
    });
  }
  run(e, t) {
    return tk(t, S(847, "No fix all action available"), { include: cs.SourceFixAll, includeSourceActions: !0 }, "ifSingle", Gd.FixAll);
  }
}
class RCt extends vt {
  constructor() {
    super({
      id: sBe,
      label: Ee(855, "Auto Fix..."),
      precondition: Re.and(se.writable, UB(cs.QuickFix)),
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 1625,
        mac: {
          primary: 2649
          /* KeyCode.Period */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    return tk(t, S(848, "No auto fixes available"), {
      include: cs.QuickFix,
      onlyIncludePreferredActions: !0
    }, "ifSingle", Gd.AutoFix);
  }
}
Si(
  CT.ID,
  CT,
  3
  /* EditorContributionInstantiation.Eventually */
);
Si(
  Q4.ID,
  Q4,
  4
  /* EditorContributionInstantiation.Lazy */
);
Je(LCt);
Je(kCt);
Je(DCt);
Je(ICt);
Je(RCt);
Je(NCt);
ct(new TCt());
Fs.as(Cm.Configuration).registerConfiguration({
  ...bK,
  properties: {
    "editor.codeActionWidget.showHeaders": {
      type: "boolean",
      scope: 6,
      description: S(856, "Enable/disable showing group headers in the Code Action menu."),
      default: !0
    }
  }
});
Fs.as(Cm.Configuration).registerConfiguration({
  ...bK,
  properties: {
    "editor.codeActionWidget.includeNearbyQuickFixes": {
      type: "boolean",
      scope: 6,
      description: S(857, "Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),
      default: !0
    }
  }
});
Fs.as(Cm.Configuration).registerConfiguration({
  ...bK,
  properties: {
    "editor.codeActions.triggerOnFocusChange": {
      type: "boolean",
      scope: 6,
      markdownDescription: S(858, "Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.", "`#editor.codeActionsOnSave#`", "`#files.autoSave#`", "`afterDelay`", "`always`"),
      default: !1
    }
  }
});
const lG = class lG {
  constructor() {
    this.lenses = [];
  }
  dispose() {
    var e;
    (e = this._store) == null || e.dispose();
  }
  get isDisposed() {
    var e;
    return ((e = this._store) == null ? void 0 : e.isDisposed) ?? !1;
  }
  add(e, t) {
    UT(e) && (this._store ?? (this._store = new ke()), this._store.add(e));
    for (const n of e.lenses)
      this.lenses.push({ symbol: n, provider: t });
  }
};
lG.Empty = new lG();
let uA = lG;
async function uBe(i, e, t) {
  const n = i.ordered(e), r = /* @__PURE__ */ new Map(), s = new uA(), o = n.map(async (a, l) => {
    r.set(a, l);
    try {
      const c = await Promise.resolve(a.provideCodeLenses(e, t));
      c && s.add(c, a);
    } catch (c) {
      No(c);
    }
  });
  return await Promise.all(o), t.isCancellationRequested ? (s.dispose(), uA.Empty) : (s.lenses = s.lenses.sort((a, l) => a.symbol.range.startLineNumber < l.symbol.range.startLineNumber ? -1 : a.symbol.range.startLineNumber > l.symbol.range.startLineNumber ? 1 : r.get(a.provider) < r.get(l.provider) ? -1 : r.get(a.provider) > r.get(l.provider) ? 1 : a.symbol.range.startColumn < l.symbol.range.startColumn ? -1 : a.symbol.range.startColumn > l.symbol.range.startColumn ? 1 : 0), s);
}
_i.registerCommand("_executeCodeLensProvider", function(i, ...e) {
  let [t, n] = e;
  Ii(Ht.isUri(t)), Ii(typeof n == "number" || !n);
  const { codeLensProvider: r } = i.get(St), s = i.get(xs).getModel(t);
  if (!s)
    throw Bf();
  const o = [], a = new ke();
  return uBe(r, s, $n.None).then((l) => {
    a.add(l);
    const c = [];
    for (const u of l.lenses)
      n == null || u.symbol.command ? o.push(u.symbol) : n-- > 0 && u.provider.resolveCodeLens && c.push(Promise.resolve(u.provider.resolveCodeLens(s, u.symbol, $n.None)).then((d) => o.push(d || u.symbol)));
    return Promise.all(c);
  }).then(() => o).finally(() => {
    setTimeout(() => a.dispose(), 100);
  });
});
var ACt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, OCt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const dBe = Vn("ICodeLensCache");
class yDe {
  constructor(e, t) {
    this.lineCount = e, this.data = t;
  }
}
let $se = class {
  constructor(e) {
    this._fakeProvider = new class {
      provideCodeLenses() {
        throw new Error("not supported");
      }
    }(), this._cache = new Tb(20, 0.75);
    const t = "codelens/cache";
    UP(fr, () => e.remove(
      t,
      1
      /* StorageScope.WORKSPACE */
    ));
    const n = "codelens/cache2", r = e.get(n, 1, "{}");
    this._deserialize(r);
    const s = Ze.filter(e.onWillSaveState, (o) => o.reason === I1.SHUTDOWN);
    Ze.once(s)((o) => {
      e.store(
        n,
        this._serialize(),
        1,
        1
        /* StorageTarget.MACHINE */
      );
    });
  }
  put(e, t) {
    const n = t.lenses.map((o) => {
      var a;
      return {
        range: o.symbol.range,
        command: o.symbol.command && { id: "", title: (a = o.symbol.command) == null ? void 0 : a.title }
      };
    }), r = new uA();
    r.add({ lenses: n }, this._fakeProvider);
    const s = new yDe(e.getLineCount(), r);
    this._cache.set(e.uri.toString(), s);
  }
  get(e) {
    const t = this._cache.get(e.uri.toString());
    return t && t.lineCount === e.getLineCount() ? t.data : void 0;
  }
  delete(e) {
    this._cache.delete(e.uri.toString());
  }
  // --- persistence
  _serialize() {
    const e = /* @__PURE__ */ Object.create(null);
    for (const [t, n] of this._cache) {
      const r = /* @__PURE__ */ new Set();
      for (const s of n.data.lenses)
        r.add(s.symbol.range.startLineNumber);
      e[t] = {
        lineCount: n.lineCount,
        lines: [...r.values()]
      };
    }
    return JSON.stringify(e);
  }
  _deserialize(e) {
    try {
      const t = JSON.parse(e);
      for (const n in t) {
        const r = t[n], s = [];
        for (const a of r.lines)
          s.push({ range: new z(a, 1, a, 11) });
        const o = new uA();
        o.add({ lenses: s }, this._fakeProvider), this._cache.set(n, new yDe(r.lineCount, o));
      }
    } catch {
    }
  }
};
$se = ACt([
  OCt(0, gu)
], $se);
ni(
  dBe,
  $se,
  1
  /* InstantiationType.Delayed */
);
class MCt {
  constructor(e, t, n) {
    this.afterColumn = 1073741824, this.afterLineNumber = e, this.heightInPx = t, this._onHeight = n, this.suppressMouseDown = !0, this.domNode = document.createElement("div");
  }
  onComputedHeight(e) {
    this._lastHeight === void 0 ? this._lastHeight = e : this._lastHeight !== e && (this._lastHeight = e, this._onHeight());
  }
  isVisible() {
    return this._lastHeight !== 0 && this.domNode.hasAttribute("monaco-visible-view-zone");
  }
}
const F3 = class F3 {
  constructor(e, t) {
    this.allowEditorOverflow = !1, this.suppressMouseDown = !0, this._commands = /* @__PURE__ */ new Map(), this._isEmpty = !0, this._editor = e, this._id = `codelens.widget-${F3._idPool++}`, this.updatePosition(t), this._domNode = document.createElement("span"), this._domNode.className = "codelens-decoration";
  }
  withCommands(e, t) {
    this._commands.clear();
    const n = [];
    let r = !1;
    for (let s = 0; s < e.length; s++) {
      const o = e[s];
      if (o && (r = !0, o.command)) {
        const a = D1(o.command.title.trim());
        if (o.command.id) {
          const l = `c${F3._idPool++}`;
          n.push(Ge("a", { id: l, title: o.command.tooltip, role: "button" }, ...a)), this._commands.set(l, o.command);
        } else
          n.push(Ge("span", { title: o.command.tooltip }, ...a));
        s + 1 < e.length && n.push(Ge("span", void 0, " | "));
      }
    }
    r ? (ma(this._domNode, ...n), this._isEmpty && t && this._domNode.classList.add("fadein"), this._isEmpty = !1) : ma(this._domNode, Ge("span", void 0, "no commands"));
  }
  getCommand(e) {
    return e.parentElement === this._domNode ? this._commands.get(e.id) : void 0;
  }
  getId() {
    return this._id;
  }
  getDomNode() {
    return this._domNode;
  }
  updatePosition(e) {
    const t = this._editor.getModel().getLineFirstNonWhitespaceColumn(e);
    this._widgetPosition = {
      position: { lineNumber: e, column: t },
      preference: [
        1
        /* ContentWidgetPositionPreference.ABOVE */
      ]
    };
  }
  getPosition() {
    return this._widgetPosition || null;
  }
};
F3._idPool = 0;
let jse = F3;
class qee {
  constructor() {
    this._removeDecorations = [], this._addDecorations = [], this._addDecorationsCallbacks = [];
  }
  addDecoration(e, t) {
    this._addDecorations.push(e), this._addDecorationsCallbacks.push(t);
  }
  removeDecoration(e) {
    this._removeDecorations.push(e);
  }
  commit(e) {
    const t = e.deltaDecorations(this._removeDecorations, this._addDecorations);
    for (let n = 0, r = t.length; n < r; n++)
      this._addDecorationsCallbacks[n](t[n]);
  }
}
const CDe = dn.register({
  collapseOnReplaceEdit: !0,
  description: "codelens"
});
class wDe {
  constructor(e, t, n, r, s, o) {
    this._isDisposed = !1, this._editor = t, this._data = e, this._decorationIds = [];
    let a;
    const l = [];
    this._data.forEach((c, u) => {
      c.symbol.command && l.push(c.symbol), n.addDecoration({
        range: c.symbol.range,
        options: CDe
      }, (d) => this._decorationIds[u] = d), a ? a = z.plusRange(a, c.symbol.range) : a = z.lift(c.symbol.range);
    }), this._viewZone = new MCt(a.startLineNumber - 1, s, o), this._viewZoneId = r.addZone(this._viewZone), l.length > 0 && (this._createContentWidgetIfNecessary(), this._contentWidget.withCommands(l, !1));
  }
  _createContentWidgetIfNecessary() {
    this._contentWidget ? this._editor.layoutContentWidget(this._contentWidget) : (this._contentWidget = new jse(this._editor, this._viewZone.afterLineNumber + 1), this._editor.addContentWidget(this._contentWidget));
  }
  dispose(e, t) {
    this._decorationIds.forEach(e.removeDecoration, e), this._decorationIds = [], t == null || t.removeZone(this._viewZoneId), this._contentWidget && (this._editor.removeContentWidget(this._contentWidget), this._contentWidget = void 0), this._isDisposed = !0;
  }
  isDisposed() {
    return this._isDisposed;
  }
  isValid() {
    return this._decorationIds.some((e, t) => {
      const n = this._editor.getModel().getDecorationRange(e), r = this._data[t].symbol;
      return !!(n && z.isEmpty(r.range) === n.isEmpty());
    });
  }
  updateCodeLensSymbols(e, t) {
    this._decorationIds.forEach(t.removeDecoration, t), this._decorationIds = [], this._data = e, this._data.forEach((n, r) => {
      t.addDecoration({
        range: n.symbol.range,
        options: CDe
      }, (s) => this._decorationIds[r] = s);
    });
  }
  updateHeight(e, t) {
    this._viewZone.heightInPx = e, t.layoutZone(this._viewZoneId), this._contentWidget && this._editor.layoutContentWidget(this._contentWidget);
  }
  computeIfNecessary(e) {
    if (!this._viewZone.isVisible())
      return null;
    for (let t = 0; t < this._decorationIds.length; t++) {
      const n = e.getDecorationRange(this._decorationIds[t]);
      n && (this._data[t].symbol.range = n);
    }
    return this._data;
  }
  updateCommands(e) {
    this._createContentWidgetIfNecessary(), this._contentWidget.withCommands(e, !0);
    for (let t = 0; t < this._data.length; t++) {
      const n = e[t];
      if (n) {
        const { symbol: r } = this._data[t];
        r.command = n.command || r.command;
      }
    }
  }
  getCommand(e) {
    var t;
    return (t = this._contentWidget) == null ? void 0 : t.getCommand(e);
  }
  getLineNumber() {
    const e = this._editor.getModel().getDecorationRange(this._decorationIds[0]);
    return e ? e.startLineNumber : -1;
  }
  update(e) {
    if (this.isValid()) {
      const t = this._editor.getModel().getDecorationRange(this._decorationIds[0]);
      t && (this._viewZone.afterLineNumber = t.startLineNumber - 1, e.layoutZone(this._viewZoneId), this._contentWidget && (this._contentWidget.updatePosition(t.startLineNumber), this._editor.layoutContentWidget(this._contentWidget)));
    }
  }
}
const Gge = Vn("environmentService");
var PCt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, SDe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const ig = Vn("ILanguageFeatureDebounceService");
var iz;
(function(i) {
  const e = /* @__PURE__ */ new WeakMap();
  let t = 0;
  function n(r) {
    let s = e.get(r);
    return s === void 0 && (s = ++t, e.set(r, s)), s;
  }
  i.of = n;
})(iz || (iz = {}));
class FCt {
  constructor(e) {
    this._default = e;
  }
  get(e) {
    return this._default;
  }
  update(e, t) {
    return this._default;
  }
  default() {
    return this._default;
  }
}
class BCt {
  constructor(e, t, n, r, s, o) {
    this._logService = e, this._name = t, this._registry = n, this._default = r, this._min = s, this._max = o, this._cache = new Tb(50, 0.7);
  }
  _key(e) {
    return e.id + this._registry.all(e).reduce((t, n) => _q(iz.of(n), t), 0);
  }
  get(e) {
    const t = this._key(e), n = this._cache.get(t);
    return n ? Jc(n.value, this._min, this._max) : this.default();
  }
  update(e, t) {
    const n = this._key(e);
    let r = this._cache.get(n);
    r || (r = new Ebt(6), this._cache.set(n, r));
    const s = Jc(r.update(t), this._min, this._max);
    return mq(e.uri, "output") || this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`), s;
  }
  _overall() {
    const e = new t5e();
    for (const [, t] of this._cache)
      e.update(t.value);
    return e.value;
  }
  default() {
    const e = this._overall() | 0 || this._default;
    return Jc(e, this._min, this._max);
  }
}
let Gse = class {
  constructor(e, t) {
    this._logService = e, this._data = /* @__PURE__ */ new Map(), this._isDev = t.isExtensionDevelopment || !t.isBuilt;
  }
  for(e, t, n) {
    const r = (n == null ? void 0 : n.min) ?? 50, s = (n == null ? void 0 : n.max) ?? r ** 2, o = (n == null ? void 0 : n.key) ?? void 0, a = `${iz.of(e)},${r}${o ? "," + o : ""}`;
    let l = this._data.get(a);
    return l || (this._isDev ? (this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`), l = new FCt(r * 1.5)) : l = new BCt(
      this._logService,
      t,
      e,
      this._overallAverage() | 0 || r * 1.5,
      // default is overall default or derived from min-value
      r,
      s
    ), this._data.set(a, l)), l;
  }
  _overallAverage() {
    const e = new t5e();
    for (const t of this._data.values())
      e.update(t.default());
    return e.value;
  }
};
Gse = PCt([
  SDe(0, $r),
  SDe(1, Gge)
], Gse);
ni(
  ig,
  Gse,
  1
  /* InstantiationType.Delayed */
);
var HCt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, iP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, SR;
let J4 = (SR = class {
  constructor(e, t, n, r, s, o) {
    this._editor = e, this._languageFeaturesService = t, this._commandService = r, this._notificationService = s, this._codeLensCache = o, this._disposables = new ke(), this._localToDispose = new ke(), this._lenses = [], this._oldCodeLensModels = new ke(), this._provideCodeLensDebounce = n.for(t.codeLensProvider, "CodeLensProvide", { min: 250 }), this._resolveCodeLensesDebounce = n.for(t.codeLensProvider, "CodeLensResolve", { min: 250, salt: "resolve" }), this._resolveCodeLensesScheduler = new mr(() => this._resolveCodeLensesInViewport(), this._resolveCodeLensesDebounce.default()), this._disposables.add(this._editor.onDidChangeModel(() => this._onModelChange())), this._disposables.add(this._editor.onDidChangeModelLanguage(() => this._onModelChange())), this._disposables.add(this._editor.onDidChangeConfiguration((a) => {
      (a.hasChanged(
        59
        /* EditorOption.fontInfo */
      ) || a.hasChanged(
        25
        /* EditorOption.codeLensFontSize */
      ) || a.hasChanged(
        24
        /* EditorOption.codeLensFontFamily */
      )) && this._updateLensStyle(), a.hasChanged(
        23
        /* EditorOption.codeLens */
      ) && this._onModelChange();
    })), this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange, this)), this._onModelChange(), this._updateLensStyle();
  }
  dispose() {
    var e;
    this._localDispose(), this._localToDispose.dispose(), this._disposables.dispose(), this._oldCodeLensModels.dispose(), (e = this._currentCodeLensModel) == null || e.dispose();
  }
  _getLayoutInfo() {
    const e = Math.max(1.3, this._editor.getOption(
      75
      /* EditorOption.lineHeight */
    ) / this._editor.getOption(
      61
      /* EditorOption.fontSize */
    ));
    let t = this._editor.getOption(
      25
      /* EditorOption.codeLensFontSize */
    );
    return (!t || t < 5) && (t = this._editor.getOption(
      61
      /* EditorOption.fontSize */
    ) * 0.9 | 0), {
      fontSize: t,
      codeLensHeight: t * e | 0
    };
  }
  _updateLensStyle() {
    const { codeLensHeight: e, fontSize: t } = this._getLayoutInfo(), n = this._editor.getOption(
      24
      /* EditorOption.codeLensFontFamily */
    ), r = this._editor.getOption(
      59
      /* EditorOption.fontInfo */
    ), { style: s } = this._editor.getContainerDomNode();
    s.setProperty("--vscode-editorCodeLens-lineHeight", `${e}px`), s.setProperty("--vscode-editorCodeLens-fontSize", `${t}px`), s.setProperty("--vscode-editorCodeLens-fontFeatureSettings", r.fontFeatureSettings), n && (s.setProperty("--vscode-editorCodeLens-fontFamily", n), s.setProperty("--vscode-editorCodeLens-fontFamilyDefault", au.fontFamily)), this._editor.changeViewZones((o) => {
      for (const a of this._lenses)
        a.updateHeight(e, o);
    });
  }
  _localDispose() {
    var e, t, n;
    (e = this._getCodeLensModelPromise) == null || e.cancel(), this._getCodeLensModelPromise = void 0, (t = this._resolveCodeLensesPromise) == null || t.cancel(), this._resolveCodeLensesPromise = void 0, this._localToDispose.clear(), this._oldCodeLensModels.clear(), (n = this._currentCodeLensModel) == null || n.dispose();
  }
  _onModelChange() {
    this._localDispose();
    const e = this._editor.getModel();
    if (!e || !this._editor.getOption(
      23
      /* EditorOption.codeLens */
    ) || e.isTooLargeForTokenization())
      return;
    const t = this._codeLensCache.get(e);
    if (t && this._renderCodeLensSymbols(t), !this._languageFeaturesService.codeLensProvider.has(e)) {
      t && jy(() => {
        const r = this._codeLensCache.get(e);
        t === r && (this._codeLensCache.delete(e), this._onModelChange());
      }, 30 * 1e3, this._localToDispose);
      return;
    }
    for (const r of this._languageFeaturesService.codeLensProvider.all(e))
      if (typeof r.onDidChange == "function") {
        const s = r.onDidChange(() => n.schedule());
        this._localToDispose.add(s);
      }
    const n = new mr(() => {
      var s;
      const r = Date.now();
      (s = this._getCodeLensModelPromise) == null || s.cancel(), this._getCodeLensModelPromise = Jo((o) => uBe(this._languageFeaturesService.codeLensProvider, e, o)), this._getCodeLensModelPromise.then((o) => {
        this._currentCodeLensModel && this._oldCodeLensModels.add(this._currentCodeLensModel), this._currentCodeLensModel = o, this._codeLensCache.put(e, o);
        const a = this._provideCodeLensDebounce.update(e, Date.now() - r);
        n.delay = a, this._renderCodeLensSymbols(o), this._resolveCodeLensesInViewportSoon();
      }, fn);
    }, this._provideCodeLensDebounce.get(e));
    this._localToDispose.add(n), this._localToDispose.add(Et(() => this._resolveCodeLensesScheduler.cancel())), this._localToDispose.add(this._editor.onDidChangeModelContent(() => {
      var r;
      this._editor.changeDecorations((s) => {
        this._editor.changeViewZones((o) => {
          const a = [];
          let l = -1;
          this._lenses.forEach((u) => {
            !u.isValid() || l === u.getLineNumber() ? a.push(u) : (u.update(o), l = u.getLineNumber());
          });
          const c = new qee();
          a.forEach((u) => {
            u.dispose(c, o), this._lenses.splice(this._lenses.indexOf(u), 1);
          }), c.commit(s);
        });
      }), n.schedule(), this._resolveCodeLensesScheduler.cancel(), (r = this._resolveCodeLensesPromise) == null || r.cancel(), this._resolveCodeLensesPromise = void 0;
    })), this._localToDispose.add(this._editor.onDidFocusEditorText(() => {
      n.schedule();
    })), this._localToDispose.add(this._editor.onDidBlurEditorText(() => {
      n.cancel();
    })), this._localToDispose.add(this._editor.onDidScrollChange((r) => {
      r.scrollTopChanged && this._lenses.length > 0 && this._resolveCodeLensesInViewportSoon();
    })), this._localToDispose.add(this._editor.onDidLayoutChange(() => {
      this._resolveCodeLensesInViewportSoon();
    })), this._localToDispose.add(Et(() => {
      if (this._editor.getModel()) {
        const r = mm.capture(this._editor);
        this._editor.changeDecorations((s) => {
          this._editor.changeViewZones((o) => {
            this._disposeAllLenses(s, o);
          });
        }), r.restore(this._editor);
      } else
        this._disposeAllLenses(void 0, void 0);
    })), this._localToDispose.add(this._editor.onMouseDown((r) => {
      if (r.target.type !== 9)
        return;
      let s = r.target.element;
      if ((s == null ? void 0 : s.tagName) === "SPAN" && (s = s.parentElement), (s == null ? void 0 : s.tagName) === "A")
        for (const o of this._lenses) {
          const a = o.getCommand(s);
          if (a) {
            this._commandService.executeCommand(a.id, ...a.arguments || []).catch((l) => this._notificationService.error(l));
            break;
          }
        }
    })), n.schedule();
  }
  _disposeAllLenses(e, t) {
    const n = new qee();
    for (const r of this._lenses)
      r.dispose(n, t);
    e && n.commit(e), this._lenses.length = 0;
  }
  _renderCodeLensSymbols(e) {
    if (!this._editor.hasModel())
      return;
    const t = this._editor.getModel().getLineCount(), n = [];
    let r;
    for (const a of e.lenses) {
      const l = a.symbol.range.startLineNumber;
      l < 1 || l > t || (r && r[r.length - 1].symbol.range.startLineNumber === l ? r.push(a) : (r = [a], n.push(r)));
    }
    if (!n.length && !this._lenses.length)
      return;
    const s = mm.capture(this._editor), o = this._getLayoutInfo();
    this._editor.changeDecorations((a) => {
      this._editor.changeViewZones((l) => {
        const c = new qee();
        let u = 0, d = 0;
        for (; d < n.length && u < this._lenses.length; ) {
          const h = n[d][0].symbol.range.startLineNumber, g = this._lenses[u].getLineNumber();
          g < h ? (this._lenses[u].dispose(c, l), this._lenses.splice(u, 1)) : g === h ? (this._lenses[u].updateCodeLensSymbols(n[d], c), d++, u++) : (this._lenses.splice(u, 0, new wDe(n[d], this._editor, c, l, o.codeLensHeight, () => this._resolveCodeLensesInViewportSoon())), u++, d++);
        }
        for (; u < this._lenses.length; )
          this._lenses[u].dispose(c, l), this._lenses.splice(u, 1);
        for (; d < n.length; )
          this._lenses.push(new wDe(n[d], this._editor, c, l, o.codeLensHeight, () => this._resolveCodeLensesInViewportSoon())), d++;
        c.commit(a);
      });
    }), s.restore(this._editor);
  }
  _resolveCodeLensesInViewportSoon() {
    this._editor.getModel() && this._resolveCodeLensesScheduler.schedule();
  }
  _resolveCodeLensesInViewport() {
    var o;
    (o = this._resolveCodeLensesPromise) == null || o.cancel(), this._resolveCodeLensesPromise = void 0;
    const e = this._editor.getModel();
    if (!e)
      return;
    const t = [], n = [];
    if (this._lenses.forEach((a) => {
      const l = a.computeIfNecessary(e);
      l && (t.push(l), n.push(a));
    }), t.length === 0) {
      this._oldCodeLensModels.clear();
      return;
    }
    const r = Date.now(), s = Jo((a) => {
      const l = t.map((c, u) => {
        const d = new Array(c.length), h = c.map((g, m) => !g.symbol.command && typeof g.provider.resolveCodeLens == "function" ? Promise.resolve(g.provider.resolveCodeLens(e, g.symbol, a)).then((_) => {
          d[m] = _;
        }, No) : (d[m] = g.symbol, Promise.resolve(void 0)));
        return Promise.all(h).then(() => {
          !a.isCancellationRequested && !n[u].isDisposed() && n[u].updateCommands(d);
        });
      });
      return Promise.all(l);
    });
    this._resolveCodeLensesPromise = s, this._resolveCodeLensesPromise.then(() => {
      const a = this._resolveCodeLensesDebounce.update(e, Date.now() - r);
      this._resolveCodeLensesScheduler.delay = a, this._currentCodeLensModel && this._codeLensCache.put(e, this._currentCodeLensModel), this._oldCodeLensModels.clear(), s === this._resolveCodeLensesPromise && (this._resolveCodeLensesPromise = void 0);
    }, (a) => {
      fn(a), s === this._resolveCodeLensesPromise && (this._resolveCodeLensesPromise = void 0);
    });
  }
  async getModel() {
    var e;
    return await this._getCodeLensModelPromise, await this._resolveCodeLensesPromise, (e = this._currentCodeLensModel) != null && e.isDisposed ? void 0 : this._currentCodeLensModel;
  }
}, SR.ID = "css.editor.codeLens", SR);
J4 = HCt([
  iP(1, St),
  iP(2, ig),
  iP(3, jr),
  iP(4, no),
  iP(5, dBe)
], J4);
Si(
  J4.ID,
  J4,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
Je(class extends vt {
  constructor() {
    super({
      id: "codelens.showLensesInCurrentLine",
      precondition: se.hasCodeLensProvider,
      label: Ee(880, "Show CodeLens Commands for Current Line")
    });
  }
  async run(e, t) {
    if (!t.hasModel())
      return;
    const n = e.get(tc), r = e.get(jr), s = e.get(no), o = t.getSelection().positionLineNumber, a = t.getContribution(J4.ID);
    if (!a)
      return;
    const l = await a.getModel();
    if (!l)
      return;
    const c = [];
    for (const h of l.lenses)
      h.symbol.command && h.symbol.range.startLineNumber === o && c.push({
        label: h.symbol.command.title,
        command: h.symbol.command
      });
    if (c.length === 0)
      return;
    const u = await n.pick(c, {
      canPickMany: !1,
      placeHolder: S(879, "Select a command")
    });
    if (!u)
      return;
    let d = u.command;
    if (l.isDisposed) {
      const h = await a.getModel(), g = h == null ? void 0 : h.lenses.find((m) => {
        var _;
        return m.symbol.range.startLineNumber === o && ((_ = m.symbol.command) == null ? void 0 : _.title) === d.title;
      });
      if (!g || !g.symbol.command)
        return;
      d = g.symbol.command;
    }
    try {
      await r.executeCommand(d.id, ...d.arguments || []);
    } catch (h) {
      s.error(h);
    }
  }
});
const hBe = [];
function u2(i) {
  hBe.push(i);
}
function WCt() {
  return hBe.slice(0);
}
class Kee {
  constructor(e, t, n, r) {
    this.priority = e, this.range = t, this.initialMousePosX = n, this.initialMousePosY = r, this.type = 1;
  }
  equals(e) {
    return e.type === 1 && this.range.equalsRange(e.range);
  }
  canAdoptVisibleHover(e, t) {
    return e.type === 1 && t.lineNumber === this.range.startLineNumber;
  }
}
class YP {
  constructor(e, t, n, r, s, o) {
    this.priority = e, this.owner = t, this.range = n, this.initialMousePosX = r, this.initialMousePosY = s, this.supportsMarkerHover = o, this.type = 2;
  }
  equals(e) {
    return e.type === 2 && this.owner === e.owner;
  }
  canAdoptVisibleHover(e, t) {
    return e.type === 2 && this.owner === e.owner;
  }
}
class wT {
  constructor(e, t) {
    this.renderedHoverParts = e, this.disposables = t;
  }
  dispose() {
    var e;
    for (const t of this.renderedHoverParts)
      t.dispose();
    (e = this.disposables) == null || e.dispose();
  }
}
const nk = new class {
  constructor() {
    this._participants = [];
  }
  register(e) {
    this._participants.push(e);
  }
  getAll() {
    return this._participants;
  }
}();
var fBe = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, qse = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let e5 = class {
  constructor(e) {
    this._editorWorkerService = e;
  }
  async provideDocumentColors(e, t) {
    return this._editorWorkerService.computeDefaultDocumentColors(e.uri);
  }
  provideColorPresentations(e, t, n) {
    const r = t.range, s = t.color, o = s.alpha, a = new De(new Ne(Math.round(255 * s.red), Math.round(255 * s.green), Math.round(255 * s.blue), o)), l = o ? De.Format.CSS.formatRGBA(a) : De.Format.CSS.formatRGB(a), c = o ? De.Format.CSS.formatHSLA(a) : De.Format.CSS.formatHSL(a), u = o ? De.Format.CSS.formatHexA(a) : De.Format.CSS.formatHex(a), d = [];
    return d.push({ label: l, textEdit: { range: r, text: l } }), d.push({ label: c, textEdit: { range: r, text: c } }), d.push({ label: u, textEdit: { range: r, text: u } }), d;
  }
};
e5 = fBe([
  qse(0, sd)
], e5);
let Kse = class extends ge {
  constructor(e, t) {
    super(), this._register(e.colorProvider.register("*", new e5(t)));
  }
};
Kse = fBe([
  qse(0, St),
  qse(1, sd)
], Kse);
async function gBe(i, e, t, n = "auto") {
  return qge(new VCt(), i, e, t, n);
}
function pBe(i, e, t, n) {
  return Promise.resolve(t.provideColorPresentations(i, e, n));
}
class VCt {
  constructor() {
  }
  async compute(e, t, n, r) {
    const s = await e.provideDocumentColors(t, n);
    if (Array.isArray(s))
      for (const o of s)
        r.push({ colorInfo: o, provider: e });
    return Array.isArray(s);
  }
}
class UCt {
  constructor() {
  }
  async compute(e, t, n, r) {
    const s = await e.provideDocumentColors(t, n);
    if (Array.isArray(s))
      for (const o of s)
        r.push({ range: o.range, color: [o.color.red, o.color.green, o.color.blue, o.color.alpha] });
    return Array.isArray(s);
  }
}
class zCt {
  constructor(e) {
    this.colorInfo = e;
  }
  async compute(e, t, n, r) {
    const s = await e.provideColorPresentations(t, this.colorInfo, $n.None);
    return Array.isArray(s) && r.push(...s), Array.isArray(s);
  }
}
async function qge(i, e, t, n, r) {
  let s = !1, o;
  const a = [], l = e.ordered(t);
  for (let c = l.length - 1; c >= 0; c--) {
    const u = l[c];
    if (r !== "always" && u instanceof e5)
      o = u;
    else
      try {
        await i.compute(u, t, n, a) && (s = !0);
      } catch (d) {
        No(d);
      }
  }
  return s ? a : o && r !== "never" ? (await i.compute(o, t, n, a), a) : [];
}
function mBe(i, e) {
  const { colorProvider: t } = i.get(St), n = i.get(xs).getModel(e);
  if (!n)
    throw Bf();
  const r = i.get(xn).getValue("editor.defaultColorDecorators", { resource: e });
  return { model: n, colorProviderRegistry: t, defaultColorDecoratorsEnablement: r };
}
var $Ct = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Yee = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Yse;
const _Be = /* @__PURE__ */ Object.create({});
var H1;
let dA = (H1 = class extends ge {
  // ms
  constructor(e, t, n, r) {
    super(), this._editor = e, this._configurationService = t, this._languageFeaturesService = n, this._localToDispose = this._register(new ke()), this._decorationsIds = [], this._colorDatas = /* @__PURE__ */ new Map(), this._decoratorLimitReporter = this._register(new jCt()), this._colorDecorationClassRefs = this._register(new ke()), this._colorDecoratorIds = this._editor.createDecorationsCollection(), this._ruleFactory = this._register(new iU(this._editor)), this._debounceInformation = r.for(n.colorProvider, "Document Colors", { min: Yse.RECOMPUTE_TIME }), this._register(e.onDidChangeModel(() => {
      this._isColorDecoratorsEnabled = this.isEnabled(), this.updateColors();
    })), this._register(e.onDidChangeModelLanguage(() => this.updateColors())), this._register(n.colorProvider.onDidChange(() => this.updateColors())), this._register(e.onDidChangeConfiguration((s) => {
      const o = this._isColorDecoratorsEnabled;
      this._isColorDecoratorsEnabled = this.isEnabled(), this._defaultColorDecoratorsEnablement = this._editor.getOption(
        167
        /* EditorOption.defaultColorDecorators */
      );
      const a = o !== this._isColorDecoratorsEnabled || s.hasChanged(
        27
        /* EditorOption.colorDecoratorsLimit */
      ), l = s.hasChanged(
        167
        /* EditorOption.defaultColorDecorators */
      );
      (a || l) && (this._isColorDecoratorsEnabled ? this.updateColors() : this.removeAllDecorations());
    })), this._timeoutTimer = null, this._computePromise = null, this._isColorDecoratorsEnabled = this.isEnabled(), this._defaultColorDecoratorsEnablement = this._editor.getOption(
      167
      /* EditorOption.defaultColorDecorators */
    ), this.updateColors();
  }
  isEnabled() {
    const e = this._editor.getModel();
    if (!e)
      return !1;
    const t = e.getLanguageId(), n = this._configurationService.getValue(t);
    if (n && typeof n == "object") {
      const r = n.colorDecorators;
      if (r && r.enable !== void 0 && !r.enable)
        return r.enable;
    }
    return this._editor.getOption(
      26
      /* EditorOption.colorDecorators */
    );
  }
  static get(e) {
    return e.getContribution(this.ID);
  }
  dispose() {
    this.stop(), this.removeAllDecorations(), super.dispose();
  }
  updateColors() {
    if (this.stop(), !this._isColorDecoratorsEnabled)
      return;
    const e = this._editor.getModel();
    !e || !this._languageFeaturesService.colorProvider.has(e) || (this._localToDispose.add(this._editor.onDidChangeModelContent(() => {
      this._timeoutTimer || (this._timeoutTimer = new Gh(), this._timeoutTimer.cancelAndSet(() => {
        this._timeoutTimer = null, this.beginCompute();
      }, this._debounceInformation.get(e)));
    })), this.beginCompute());
  }
  async beginCompute() {
    this._computePromise = Jo(async (e) => {
      const t = this._editor.getModel();
      if (!t)
        return [];
      const n = new _a(!1), r = await gBe(this._languageFeaturesService.colorProvider, t, e, this._defaultColorDecoratorsEnablement);
      return this._debounceInformation.update(t, n.elapsed()), r;
    });
    try {
      const e = await this._computePromise;
      this.updateDecorations(e), this.updateColorDecorators(e), this._computePromise = null;
    } catch (e) {
      fn(e);
    }
  }
  stop() {
    this._timeoutTimer && (this._timeoutTimer.cancel(), this._timeoutTimer = null), this._computePromise && (this._computePromise.cancel(), this._computePromise = null), this._localToDispose.clear();
  }
  updateDecorations(e) {
    const t = e.map((n) => ({
      range: {
        startLineNumber: n.colorInfo.range.startLineNumber,
        startColumn: n.colorInfo.range.startColumn,
        endLineNumber: n.colorInfo.range.endLineNumber,
        endColumn: n.colorInfo.range.endColumn
      },
      options: dn.EMPTY
    }));
    this._editor.changeDecorations((n) => {
      this._decorationsIds = n.deltaDecorations(this._decorationsIds, t), this._colorDatas = /* @__PURE__ */ new Map(), this._decorationsIds.forEach((r, s) => this._colorDatas.set(r, e[s]));
    });
  }
  updateColorDecorators(e) {
    this._colorDecorationClassRefs.clear();
    const t = [], n = this._editor.getOption(
      27
      /* EditorOption.colorDecoratorsLimit */
    );
    for (let s = 0; s < e.length && t.length < n; s++) {
      const { red: o, green: a, blue: l, alpha: c } = e[s].colorInfo.color, u = new Ne(Math.round(o * 255), Math.round(a * 255), Math.round(l * 255), c), d = `rgba(${u.r}, ${u.g}, ${u.b}, ${u.a})`, h = this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({
        backgroundColor: d
      }));
      t.push({
        range: {
          startLineNumber: e[s].colorInfo.range.startLineNumber,
          startColumn: e[s].colorInfo.range.startColumn,
          endLineNumber: e[s].colorInfo.range.endLineNumber,
          endColumn: e[s].colorInfo.range.endColumn
        },
        options: {
          description: "colorDetector",
          before: {
            content: tPe,
            inlineClassName: `${h.className} colorpicker-color-decoration`,
            inlineClassNameAffectsLetterSpacing: !0,
            attachedData: _Be
          }
        }
      });
    }
    const r = n < e.length ? n : !1;
    this._decoratorLimitReporter.update(e.length, r), this._colorDecoratorIds.set(t);
  }
  removeAllDecorations() {
    this._editor.removeDecorations(this._decorationsIds), this._decorationsIds = [], this._colorDecoratorIds.clear(), this._colorDecorationClassRefs.clear();
  }
  getColorData(e) {
    const t = this._editor.getModel();
    if (!t)
      return null;
    const n = t.getDecorationsInRange(z.fromPositions(e, e)).filter((r) => this._colorDatas.has(r.id));
    return n.length === 0 ? null : this._colorDatas.get(n[0].id);
  }
  isColorDecoration(e) {
    return this._colorDecoratorIds.has(e);
  }
}, Yse = H1, H1.ID = "editor.contrib.colorDetector", H1.RECOMPUTE_TIME = 1e3, H1);
dA = Yse = $Ct([
  Yee(1, xn),
  Yee(2, St),
  Yee(3, ig)
], dA);
class jCt extends ge {
  constructor() {
    super(...arguments), this._onDidChange = this._register(new he()), this._computed = 0, this._limited = !1;
  }
  update(e, t) {
    (e !== this._computed || t !== this._limited) && (this._computed = e, this._limited = t, this._onDidChange.fire());
  }
}
const bBe = "editor.action.showHover", GCt = "editor.action.showDefinitionPreviewHover", qCt = "editor.action.hideHover", KCt = "editor.action.scrollUpHover", YCt = "editor.action.scrollDownHover", XCt = "editor.action.scrollLeftHover", ZCt = "editor.action.scrollRightHover", QCt = "editor.action.pageUpHover", JCt = "editor.action.pageDownHover", e1t = "editor.action.goToTopHover", t1t = "editor.action.goToBottomHover", vK = "editor.action.increaseHoverVerbosityLevel", n1t = S(1097, "Increase Hover Verbosity Level"), yK = "editor.action.decreaseHoverVerbosityLevel", i1t = S(1098, "Decrease Hover Verbosity Level"), t5 = "editor.action.inlineSuggest.commit", vBe = "editor.action.inlineSuggest.showPrevious", yBe = "editor.action.inlineSuggest.showNext", r1t = "editor.action.inlineSuggest.jump", CBe = "editor.action.inlineSuggest.hide", Xse = "editor.action.inlineSuggest.toggleShowCollapsed";
var Kge = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Fg = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, XP;
let Zse = class extends ge {
  constructor(e, t, n) {
    super(), this.editor = e, this.model = t, this.instantiationService = n, this.alwaysShowToolbar = ji(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).showToolbar === "always"), this.sessionPosition = void 0, this.position = Ie(this, (r) => {
      var l, c;
      const s = (l = this.model.read(r)) == null ? void 0 : l.primaryGhostText.read(r);
      if (!this.alwaysShowToolbar.read(r) || !s || s.parts.length === 0)
        return this.sessionPosition = void 0, null;
      const o = s.parts[0].column;
      this.sessionPosition && this.sessionPosition.lineNumber !== s.lineNumber && (this.sessionPosition = void 0);
      const a = new de(s.lineNumber, Math.min(o, ((c = this.sessionPosition) == null ? void 0 : c.column) ?? Number.MAX_SAFE_INTEGER));
      return this.sessionPosition = a, a;
    }), this._register(Ql((r, s) => {
      const o = this.model.read(r);
      if (!o || !this.alwaysShowToolbar.read(r))
        return;
      const a = Ie((c) => {
        const u = c.store.add(this.instantiationService.createInstance(hA.hot.read(c), this.editor, !0, this.position, o.selectedInlineCompletionIndex, o.inlineCompletionsCount, o.activeCommands, o.warning, () => {
        }));
        return e.addContentWidget(u), c.store.add(Et(() => e.removeContentWidget(u))), c.store.add(Xt((d) => {
          this.position.read(d) && o.lastTriggerKind.read(d) !== Vu.Explicit && o.triggerExplicitly();
        })), u;
      }), l = u0(this, (c, u) => !!this.position.read(c) || !!u);
      s.add(Xt((c) => {
        l.read(c) && a.read(c);
      }));
    }));
  }
};
Zse = Kge([
  Fg(2, xt)
], Zse);
const s1t = es("inline-suggestion-hints-next", Pe.chevronRight, S(1198, "Icon for show next parameter hint.")), o1t = es("inline-suggestion-hints-previous", Pe.chevronLeft, S(1199, "Icon for show previous parameter hint."));
var Dy;
let hA = (Dy = class extends ge {
  static get dropDownVisible() {
    return this._dropDownVisible;
  }
  createCommandAction(e, t, n) {
    const r = new Vh(e, t, n, !0, () => this._commandService.executeCommand(e)), s = this.keybindingService.lookupKeybinding(e, this._contextKeyService);
    let o = t;
    return s && (o = S(1200, "{0} ({1})", t, s.getLabel())), r.tooltip = o, r;
  }
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g) {
    super(), this.editor = e, this.withBorder = t, this._position = n, this._currentSuggestionIdx = r, this._suggestionCount = s, this._extraCommands = o, this._warning = a, this._relayout = l, this._commandService = c, this.keybindingService = d, this._contextKeyService = h, this._menuService = g, this.id = `InlineSuggestionHintsContentWidget${XP.id++}`, this.allowEditorOverflow = !0, this.suppressMouseDown = !1, this._warningMessageContentNode = Ie((m) => {
      const _ = this._warning.read(m);
      return _ ? typeof _.message == "string" ? _.message : m.store.add(AB(_.message)).element : void 0;
    }), this._warningMessageNode = Tn.div({
      class: "warningMessage",
      style: {
        maxWidth: 400,
        margin: 4,
        marginBottom: 4,
        display: Ie((m) => this._warning.read(m) ? "block" : "none")
      }
    }, [
      this._warningMessageContentNode
    ]).keepUpdated(this._store), this.nodes = Li("div.inlineSuggestionsHints", { className: this.withBorder ? "monaco-hover monaco-hover-content" : "" }, [
      this._warningMessageNode.element,
      Li("div@toolBar")
    ]), this.previousAction = this._register(this.createCommandAction(vBe, S(1201, "Previous"), qt.asClassName(o1t))), this.availableSuggestionCountAction = this._register(new Vh("inlineSuggestionHints.availableSuggestionCount", "", void 0, !1)), this.nextAction = this._register(this.createCommandAction(yBe, S(1202, "Next"), qt.asClassName(s1t))), this.inlineCompletionsActionsMenus = this._register(this._menuService.createMenu(wt.InlineCompletionsActions, this._contextKeyService)), this.clearAvailableSuggestionCountLabelDebounced = this._register(new mr(() => {
      this.availableSuggestionCountAction.label = "";
    }, 100)), this.disableButtonsDebounced = this._register(new mr(() => {
      this.previousAction.enabled = this.nextAction.enabled = !1;
    }, 100)), this._register(Xt((m) => {
      this._warningMessageContentNode.read(m), this._warningMessageNode.readEffect(m), this._relayout();
    })), this.toolBar = this._register(u.createInstance(Qse, this.nodes.toolBar, wt.InlineSuggestionToolbar, {
      menuOptions: { renderShortTitle: !0 },
      toolbarOptions: { primaryGroup: (m) => m.startsWith("primary") },
      actionViewItemProvider: (m, _) => {
        if (m instanceof Uh)
          return u.createInstance(l1t, m, void 0);
        if (m === this.availableSuggestionCountAction) {
          const v = new a1t(void 0, m, { label: !0, icon: !1 });
          return v.setClass("availableSuggestionCount"), v;
        }
      },
      telemetrySource: "InlineSuggestionToolbar"
    })), this.toolBar.setPrependedPrimaryActions([
      this.previousAction,
      this.availableSuggestionCountAction,
      this.nextAction
    ]), this._register(this.toolBar.onDidChangeDropdownVisibility((m) => {
      XP._dropDownVisible = m;
    })), this._register(Xt((m) => {
      this._position.read(m), this.editor.layoutContentWidget(this);
    })), this._register(Xt((m) => {
      const _ = this._suggestionCount.read(m), v = this._currentSuggestionIdx.read(m);
      _ !== void 0 ? (this.clearAvailableSuggestionCountLabelDebounced.cancel(), this.availableSuggestionCountAction.label = `${v + 1}/${_}`) : this.clearAvailableSuggestionCountLabelDebounced.schedule(), _ !== void 0 && _ > 1 ? (this.disableButtonsDebounced.cancel(), this.previousAction.enabled = this.nextAction.enabled = !0) : this.disableButtonsDebounced.schedule();
    })), this._register(Xt((m) => {
      const v = this._extraCommands.read(m).map((w) => ({
        class: void 0,
        id: w.command.id,
        enabled: !0,
        tooltip: w.command.tooltip || "",
        label: w.command.title,
        run: (E) => this._commandService.executeCommand(w.command.id)
      }));
      for (const [w, E] of this.inlineCompletionsActionsMenus.getActions())
        for (const L of E)
          L instanceof Uh && v.push(L);
      v.length > 0 && v.unshift(new fa()), this.toolBar.setAdditionalSecondaryActions(v);
    }));
  }
  getId() {
    return this.id;
  }
  getDomNode() {
    return this.nodes.root;
  }
  getPosition() {
    return {
      position: this._position.get(),
      preference: [
        1,
        2
        /* ContentWidgetPositionPreference.BELOW */
      ],
      positionAffinity: 3
    };
  }
}, XP = Dy, Dy.hot = cK(XP), Dy._dropDownVisible = !1, Dy.id = 0, Dy);
hA = XP = Kge([
  Fg(8, jr),
  Fg(9, xt),
  Fg(10, Fi),
  Fg(11, Jt),
  Fg(12, eg)
], hA);
class a1t extends lA {
  constructor() {
    super(...arguments), this._className = void 0;
  }
  setClass(e) {
    this._className = e;
  }
  render(e) {
    super.render(e), this._className && e.classList.add(this._className);
  }
  updateTooltip() {
  }
}
class l1t extends hw {
  updateLabel() {
    const e = this._keybindingService.lookupKeybinding(this._action.id, this._contextKeyService, !0);
    if (!e)
      return super.updateLabel();
    if (this.label) {
      const t = Li("div.keybinding").root;
      this._register(new c2(t, Ad, { disableTitle: !0, ...$0t })).set(e), this.label.textContent = this._action.label, this.label.appendChild(t), this.label.classList.add("inlineSuggestionStatusBarItemLabel");
    }
  }
  updateTooltip() {
  }
}
let Qse = class extends zU {
  constructor(e, t, n, r, s, o, a, l, c) {
    super(e, { resetMenu: t, ...n }, r, s, o, a, l, c), this.menuId = t, this.options2 = n, this.menuService = r, this.contextKeyService = s, this.menu = this._store.add(this.menuService.createMenu(this.menuId, this.contextKeyService, { emitEventsForSubmenuChanges: !0 })), this.additionalActions = [], this.prependedPrimaryActions = [], this.additionalPrimaryActions = [], this._store.add(this.menu.onDidChange(() => this.updateToolbar())), this.updateToolbar();
  }
  updateToolbar() {
    var n, r, s, o, a, l, c;
    const { primary: e, secondary: t } = S5e(this.menu.getActions((n = this.options2) == null ? void 0 : n.menuOptions), (s = (r = this.options2) == null ? void 0 : r.toolbarOptions) == null ? void 0 : s.primaryGroup, (a = (o = this.options2) == null ? void 0 : o.toolbarOptions) == null ? void 0 : a.shouldInlineSubmenu, (c = (l = this.options2) == null ? void 0 : l.toolbarOptions) == null ? void 0 : c.useSeparatorsInPrimaryActions);
    t.push(...this.additionalActions), e.unshift(...this.prependedPrimaryActions), e.push(...this.additionalPrimaryActions), this.setActions(e, t);
  }
  setPrependedPrimaryActions(e) {
    ds(this.prependedPrimaryActions, e, (t, n) => t === n) || (this.prependedPrimaryActions = e, this.updateToolbar());
  }
  setAdditionalSecondaryActions(e) {
    ds(this.additionalActions, e, (t, n) => t === n) || (this.additionalActions = e, this.updateToolbar());
  }
};
Qse = Kge([
  Fg(3, eg),
  Fg(4, Jt),
  Fg(5, Qh),
  Fg(6, Fi),
  Fg(7, jr),
  Fg(8, rc)
], Qse);
function CK(i, e, t) {
  const n = ho(i);
  return !(e < n.left || e > n.left + n.width || t < n.top || t > n.top + n.height);
}
class c1t {
  constructor(e, t, n, r) {
    this.value = e, this.isComplete = t, this.hasLoadingMessage = n, this.options = r;
  }
}
class wBe extends ge {
  constructor(e, t) {
    super(), this._editor = e, this._computer = t, this._onResult = this._register(new he()), this.onResult = this._onResult.event, this._asyncComputationScheduler = this._register(new Xee((n) => this._triggerAsyncComputation(n), 0)), this._syncComputationScheduler = this._register(new Xee((n) => this._triggerSyncComputation(n), 0)), this._loadingMessageScheduler = this._register(new Xee((n) => this._triggerLoadingMessage(n), 0)), this._state = 0, this._asyncIterable = null, this._asyncIterableDone = !1, this._result = [];
  }
  dispose() {
    this._asyncIterable && (this._asyncIterable.cancel(), this._asyncIterable = null), this._options = void 0, super.dispose();
  }
  get _hoverTime() {
    return this._editor.getOption(
      69
      /* EditorOption.hover */
    ).delay;
  }
  get _firstWaitTime() {
    return this._hoverTime / 2;
  }
  get _secondWaitTime() {
    return this._hoverTime - this._firstWaitTime;
  }
  get _loadingMessageTime() {
    return 3 * this._hoverTime;
  }
  _setState(e, t) {
    this._options = t, this._state = e, this._fireResult(t);
  }
  _triggerAsyncComputation(e) {
    this._setState(2, e), this._syncComputationScheduler.schedule(e, this._secondWaitTime), this._computer.computeAsync ? (this._asyncIterableDone = !1, this._asyncIterable = tnt((t) => this._computer.computeAsync(e, t)), (async () => {
      try {
        for await (const t of this._asyncIterable)
          t && (this._result.push(t), this._fireResult(e));
        this._asyncIterableDone = !0, (this._state === 3 || this._state === 4) && this._setState(0, e);
      } catch (t) {
        fn(t);
      }
    })()) : this._asyncIterableDone = !0;
  }
  _triggerSyncComputation(e) {
    this._computer.computeSync && (this._result = this._result.concat(this._computer.computeSync(e))), this._setState(this._asyncIterableDone ? 0 : 3, e);
  }
  _triggerLoadingMessage(e) {
    this._state === 3 && this._setState(4, e);
  }
  _fireResult(e) {
    if (this._state === 1 || this._state === 2)
      return;
    const t = this._state === 0, n = this._state === 4;
    this._onResult.fire(new c1t(this._result.slice(0), t, n, e));
  }
  start(e, t) {
    if (e === 0)
      this._state === 0 && (this._setState(1, t), this._asyncComputationScheduler.schedule(t, this._firstWaitTime), this._loadingMessageScheduler.schedule(t, this._loadingMessageTime));
    else
      switch (this._state) {
        case 0:
          this._triggerAsyncComputation(t), this._syncComputationScheduler.cancel(), this._triggerSyncComputation(t);
          break;
        case 2:
          this._syncComputationScheduler.cancel(), this._triggerSyncComputation(t);
          break;
      }
  }
  cancel() {
    this._asyncComputationScheduler.cancel(), this._syncComputationScheduler.cancel(), this._loadingMessageScheduler.cancel(), this._asyncIterable && (this._asyncIterable.cancel(), this._asyncIterable = null), this._result = [], this._options = void 0, this._state = 0;
  }
  get options() {
    return this._options;
  }
}
class Xee extends ge {
  constructor(e, t) {
    super(), this._scheduler = this._register(new mr(() => e(this._options), t));
  }
  schedule(e, t) {
    this._options = e, this._scheduler.schedule(t);
  }
  cancel() {
    this._scheduler.cancel();
  }
}
class Yge {
  get onDidWillResize() {
    return this._onDidWillResize.event;
  }
  get onDidResize() {
    return this._onDidResize.event;
  }
  constructor() {
    this._onDidWillResize = new he(), this._onDidResize = new he(), this._sashListener = new ke(), this._size = new Ji(0, 0), this._minSize = new Ji(0, 0), this._maxSize = new Ji(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER), this.domNode = document.createElement("div"), this._eastSash = new zl(this.domNode, { getVerticalSashLeft: () => this._size.width }, {
      orientation: 0
      /* Orientation.VERTICAL */
    }), this._westSash = new zl(this.domNode, { getVerticalSashLeft: () => 0 }, {
      orientation: 0
      /* Orientation.VERTICAL */
    }), this._northSash = new zl(this.domNode, { getHorizontalSashTop: () => 0 }, { orientation: 1, orthogonalEdge: FU.North }), this._southSash = new zl(this.domNode, { getHorizontalSashTop: () => this._size.height }, { orientation: 1, orthogonalEdge: FU.South }), this._northSash.orthogonalStartSash = this._westSash, this._northSash.orthogonalEndSash = this._eastSash, this._southSash.orthogonalStartSash = this._westSash, this._southSash.orthogonalEndSash = this._eastSash;
    let e, t = 0, n = 0;
    this._sashListener.add(Ze.any(this._northSash.onDidStart, this._eastSash.onDidStart, this._southSash.onDidStart, this._westSash.onDidStart)(() => {
      e === void 0 && (this._onDidWillResize.fire(), e = this._size, t = 0, n = 0);
    })), this._sashListener.add(Ze.any(this._northSash.onDidEnd, this._eastSash.onDidEnd, this._southSash.onDidEnd, this._westSash.onDidEnd)(() => {
      e !== void 0 && (e = void 0, t = 0, n = 0, this._onDidResize.fire({ dimension: this._size, done: !0 }));
    })), this._sashListener.add(this._eastSash.onDidChange((r) => {
      e && (n = r.currentX - r.startX, this.layout(e.height + t, e.width + n), this._onDidResize.fire({ dimension: this._size, done: !1, east: !0 }));
    })), this._sashListener.add(this._westSash.onDidChange((r) => {
      e && (n = -(r.currentX - r.startX), this.layout(e.height + t, e.width + n), this._onDidResize.fire({ dimension: this._size, done: !1, west: !0 }));
    })), this._sashListener.add(this._northSash.onDidChange((r) => {
      e && (t = -(r.currentY - r.startY), this.layout(e.height + t, e.width + n), this._onDidResize.fire({ dimension: this._size, done: !1, north: !0 }));
    })), this._sashListener.add(this._southSash.onDidChange((r) => {
      e && (t = r.currentY - r.startY, this.layout(e.height + t, e.width + n), this._onDidResize.fire({ dimension: this._size, done: !1, south: !0 }));
    })), this._sashListener.add(Ze.any(this._eastSash.onDidReset, this._westSash.onDidReset)((r) => {
      this._preferredSize && (this.layout(this._size.height, this._preferredSize.width), this._onDidResize.fire({ dimension: this._size, done: !0 }));
    })), this._sashListener.add(Ze.any(this._northSash.onDidReset, this._southSash.onDidReset)((r) => {
      this._preferredSize && (this.layout(this._preferredSize.height, this._size.width), this._onDidResize.fire({ dimension: this._size, done: !0 }));
    }));
  }
  dispose() {
    this._northSash.dispose(), this._southSash.dispose(), this._eastSash.dispose(), this._westSash.dispose(), this._sashListener.dispose(), this._onDidResize.dispose(), this._onDidWillResize.dispose(), this.domNode.remove();
  }
  enableSashes(e, t, n, r) {
    this._northSash.state = e ? 3 : 0, this._eastSash.state = t ? 3 : 0, this._southSash.state = n ? 3 : 0, this._westSash.state = r ? 3 : 0;
  }
  layout(e = this.size.height, t = this.size.width) {
    const { height: n, width: r } = this._minSize, { height: s, width: o } = this._maxSize;
    e = Math.max(n, Math.min(s, e)), t = Math.max(r, Math.min(o, t));
    const a = new Ji(t, e);
    Ji.equals(a, this._size) || (this.domNode.style.height = e + "px", this.domNode.style.width = t + "px", this._size = a, this._northSash.layout(), this._eastSash.layout(), this._southSash.layout(), this._westSash.layout());
  }
  clearSashHoverState() {
    this._eastSash.clearSashHoverState(), this._westSash.clearSashHoverState(), this._northSash.clearSashHoverState(), this._southSash.clearSashHoverState();
  }
  get size() {
    return this._size;
  }
  set maxSize(e) {
    this._maxSize = e;
  }
  get maxSize() {
    return this._maxSize;
  }
  set minSize(e) {
    this._minSize = e;
  }
  get minSize() {
    return this._minSize;
  }
  set preferredSize(e) {
    this._preferredSize = e;
  }
  get preferredSize() {
    return this._preferredSize;
  }
}
const u1t = 30, d1t = 24;
class h1t extends ge {
  constructor(e, t = new Ji(10, 10)) {
    super(), this._editor = e, this.allowEditorOverflow = !0, this.suppressMouseDown = !1, this._resizableNode = this._register(new Yge()), this._contentPosition = null, this._isResizing = !1, this._resizableNode.domNode.style.position = "absolute", this._resizableNode.minSize = Ji.lift(t), this._resizableNode.layout(t.height, t.width), this._resizableNode.enableSashes(!0, !0, !0, !0), this._register(this._resizableNode.onDidResize((n) => {
      this._resize(new Ji(n.dimension.width, n.dimension.height)), n.done && (this._isResizing = !1);
    })), this._register(this._resizableNode.onDidWillResize(() => {
      this._isResizing = !0;
    }));
  }
  get isResizing() {
    return this._isResizing;
  }
  getDomNode() {
    return this._resizableNode.domNode;
  }
  getPosition() {
    return this._contentPosition;
  }
  get position() {
    var e;
    return (e = this._contentPosition) != null && e.position ? de.lift(this._contentPosition.position) : void 0;
  }
  _availableVerticalSpaceAbove(e) {
    const t = this._editor.getDomNode(), n = this._editor.getScrolledVisiblePosition(e);
    return !t || !n ? void 0 : ho(t).top + n.top - u1t;
  }
  _availableVerticalSpaceBelow(e) {
    const t = this._editor.getDomNode(), n = this._editor.getScrolledVisiblePosition(e);
    if (!t || !n)
      return;
    const r = ho(t), s = nw(t.ownerDocument.body), o = r.top + n.top + n.height;
    return s.height - o - d1t;
  }
  _findPositionPreference(e, t) {
    const n = Math.min(this._availableVerticalSpaceBelow(t) ?? 1 / 0, e), r = Math.min(this._availableVerticalSpaceAbove(t) ?? 1 / 0, e), s = Math.min(Math.max(r, n), e), o = Math.min(e, s);
    let a;
    return this._editor.getOption(
      69
      /* EditorOption.hover */
    ).above ? a = o <= r ? 1 : 2 : a = o <= n ? 2 : 1, a === 1 ? this._resizableNode.enableSashes(!0, !0, !1, !1) : this._resizableNode.enableSashes(!1, !0, !0, !1), a;
  }
  _resize(e) {
    this._resizableNode.layout(e.height, e.width);
  }
}
const cH = Ge;
let Xge = class extends ge {
  constructor(e) {
    super(), this.containerDomNode = document.createElement("div"), this.containerDomNode.className = "monaco-hover", this.containerDomNode.classList.toggle("fade-in", !!e), this.containerDomNode.tabIndex = 0, this.containerDomNode.setAttribute("role", "tooltip"), this.contentsDomNode = document.createElement("div"), this.contentsDomNode.className = "monaco-hover-content", this.scrollbar = this._register(new LB(this.contentsDomNode, {
      consumeMouseWheelIfScrollbarIsNeeded: !0
    })), this.containerDomNode.appendChild(this.scrollbar.getDomNode());
  }
  onContentsChanged() {
    this.scrollbar.scanDomNode();
  }
};
class wK extends ge {
  static render(e, t, n) {
    return new wK(e, t, n);
  }
  constructor(e, t, n) {
    super(), this.actionLabel = t.label, this.actionKeybindingLabel = n, this.actionContainer = Fe(e, cH("div.action-container")), this.actionContainer.setAttribute("tabindex", "0"), this.action = Fe(this.actionContainer, cH("a.action")), this.action.setAttribute("role", "button"), t.iconClass && Fe(this.action, cH("span.icon")).classList.add(...t.iconClass.split(" ")), this.actionRenderedLabel = n ? `${t.label} (${n})` : t.label;
    const r = Fe(this.action, cH("span"));
    r.textContent = this.actionRenderedLabel, this._store.add(new EBe(this.actionContainer, t.run)), this._store.add(new xBe(this.actionContainer, t.run, [
      3,
      10
      /* KeyCode.Space */
    ])), this.setEnabled(!0);
  }
  setEnabled(e) {
    e ? (this.actionContainer.classList.remove("disabled"), this.actionContainer.removeAttribute("aria-disabled")) : (this.actionContainer.classList.add("disabled"), this.actionContainer.setAttribute("aria-disabled", "true"));
  }
}
function SBe(i, e) {
  return i && e ? S(7, "Inspect this in the accessible view with {0}.", e) : i ? S(8, "Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding.") : "";
}
class EBe extends ge {
  constructor(e, t) {
    super(), this._register(Ce(e, Xe.CLICK, (n) => {
      n.stopPropagation(), n.preventDefault(), t(e);
    }));
  }
}
class xBe extends ge {
  constructor(e, t, n) {
    super(), this._register(Ce(e, Xe.KEY_DOWN, (r) => {
      const s = new wr(r);
      n.some((o) => s.equals(o)) && (r.stopPropagation(), r.preventDefault(), t(e));
    }));
  }
}
var f1t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, uH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, kg;
const EDe = 30;
var W1;
let Jse = (W1 = class extends h1t {
  get isVisibleFromKeyboard() {
    var e;
    return ((e = this._renderedHover) == null ? void 0 : e.source) === 2;
  }
  get isVisible() {
    return this._hoverVisibleKey.get() ?? !1;
  }
  get isFocused() {
    return this._hoverFocusedKey.get() ?? !1;
  }
  constructor(e, t, n, r, s) {
    const o = e.getOption(
      75
      /* EditorOption.lineHeight */
    ) + 8, a = 150, l = new Ji(a, o);
    super(e, l), this._configurationService = n, this._accessibilityService = r, this._keybindingService = s, this._hover = this._register(new Xge(!0)), this._onDidResize = this._register(new he()), this.onDidResize = this._onDidResize.event, this._onDidScroll = this._register(new he()), this.onDidScroll = this._onDidScroll.event, this._onContentsChanged = this._register(new he()), this.onContentsChanged = this._onContentsChanged.event, this._minimumSize = l, this._hoverVisibleKey = se.hoverVisible.bindTo(t), this._hoverFocusedKey = se.hoverFocused.bindTo(t), Fe(this._resizableNode.domNode, this._hover.containerDomNode), this._resizableNode.domNode.style.zIndex = "50", this._resizableNode.domNode.className = "monaco-resizable-hover", this._register(this._editor.onDidLayoutChange(() => {
      this.isVisible && this._updateMaxDimensions();
    })), this._register(this._editor.onDidChangeConfiguration((u) => {
      u.hasChanged(
        59
        /* EditorOption.fontInfo */
      ) && this._updateFont();
    }));
    const c = this._register(qf(this._resizableNode.domNode));
    this._register(c.onDidFocus(() => {
      this._hoverFocusedKey.set(!0);
    })), this._register(c.onDidBlur(() => {
      this._hoverFocusedKey.set(!1);
    })), this._register(this._hover.scrollbar.onScroll((u) => {
      this._onDidScroll.fire(u);
    })), this._setRenderedHover(void 0), this._editor.addContentWidget(this);
  }
  dispose() {
    var e;
    super.dispose(), (e = this._renderedHover) == null || e.dispose(), this._editor.removeContentWidget(this);
  }
  getId() {
    return kg.ID;
  }
  static _applyDimensions(e, t, n) {
    const r = typeof t == "number" ? `${t}px` : t, s = typeof n == "number" ? `${n}px` : n;
    e.style.width = r, e.style.height = s;
  }
  _setContentsDomNodeDimensions(e, t) {
    const n = this._hover.contentsDomNode;
    return kg._applyDimensions(n, e, t);
  }
  _setContainerDomNodeDimensions(e, t) {
    const n = this._hover.containerDomNode;
    return kg._applyDimensions(n, e, t);
  }
  _setScrollableElementDimensions(e, t) {
    const n = this._hover.scrollbar.getDomNode();
    return kg._applyDimensions(n, e, t);
  }
  _setHoverWidgetDimensions(e, t) {
    this._setContainerDomNodeDimensions(e, t), this._setScrollableElementDimensions(e, t), this._setContentsDomNodeDimensions(e, t), this._layoutContentWidget();
  }
  static _applyMaxDimensions(e, t, n) {
    const r = typeof t == "number" ? `${t}px` : t, s = typeof n == "number" ? `${n}px` : n;
    e.style.maxWidth = r, e.style.maxHeight = s;
  }
  _setHoverWidgetMaxDimensions(e, t) {
    kg._applyMaxDimensions(this._hover.contentsDomNode, e, t), kg._applyMaxDimensions(this._hover.scrollbar.getDomNode(), e, t), kg._applyMaxDimensions(this._hover.containerDomNode, e, t), this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth", typeof e == "number" ? `${e}px` : e), this._layoutContentWidget();
  }
  _setAdjustedHoverWidgetDimensions(e) {
    this._setHoverWidgetMaxDimensions("none", "none"), this._setHoverWidgetDimensions(e.width, e.height);
  }
  _updateResizableNodeMaxDimensions() {
    const e = this._findMaximumRenderingWidth() ?? 1 / 0, t = this._findMaximumRenderingHeight() ?? 1 / 0;
    this._resizableNode.maxSize = new Ji(e, t), this._setHoverWidgetMaxDimensions(e, t);
  }
  _resize(e) {
    kg._lastDimensions = new Ji(e.width, e.height), this._setAdjustedHoverWidgetDimensions(e), this._resizableNode.layout(e.height, e.width), this._updateResizableNodeMaxDimensions(), this._hover.scrollbar.scanDomNode(), this._editor.layoutContentWidget(this), this._onDidResize.fire();
  }
  _findAvailableSpaceVertically() {
    var t;
    const e = (t = this._renderedHover) == null ? void 0 : t.showAtPosition;
    if (e)
      return this._positionPreference === 1 ? this._availableVerticalSpaceAbove(e) : this._availableVerticalSpaceBelow(e);
  }
  _findMaximumRenderingHeight() {
    const e = this._findAvailableSpaceVertically();
    if (!e)
      return;
    let n = this._hover.contentsDomNode.children.length - 1;
    return Array.from(this._hover.contentsDomNode.children).forEach((r) => {
      n += r.clientHeight;
    }), Math.min(e, n);
  }
  _isHoverTextOverflowing() {
    this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace", "nowrap"), this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace", "nowrap");
    const e = Array.from(this._hover.contentsDomNode.children).some((t) => t.scrollWidth > t.clientWidth);
    return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"), this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"), e;
  }
  _findMaximumRenderingWidth() {
    if (!this._editor || !this._editor.hasModel())
      return;
    const e = this._isHoverTextOverflowing(), t = typeof this._contentWidth > "u" ? 0 : this._contentWidth;
    return e || this._hover.containerDomNode.clientWidth < t ? nw(this._hover.containerDomNode.ownerDocument.body).width - 14 : this._hover.containerDomNode.clientWidth;
  }
  isMouseGettingCloser(e, t) {
    if (!this._renderedHover)
      return !1;
    if (this._renderedHover.initialMousePosX === void 0 || this._renderedHover.initialMousePosY === void 0)
      return this._renderedHover.initialMousePosX = e, this._renderedHover.initialMousePosY = t, !1;
    const n = ho(this.getDomNode());
    this._renderedHover.closestMouseDistance === void 0 && (this._renderedHover.closestMouseDistance = xDe(this._renderedHover.initialMousePosX, this._renderedHover.initialMousePosY, n.left, n.top, n.width, n.height));
    const r = xDe(e, t, n.left, n.top, n.width, n.height);
    return r > this._renderedHover.closestMouseDistance + 4 ? !1 : (this._renderedHover.closestMouseDistance = Math.min(this._renderedHover.closestMouseDistance, r), !0);
  }
  _setRenderedHover(e) {
    var t;
    (t = this._renderedHover) == null || t.dispose(), this._renderedHover = e, this._hoverVisibleKey.set(!!e), this._hover.containerDomNode.classList.toggle("hidden", !e);
  }
  _updateFont() {
    const { fontSize: e, lineHeight: t } = this._editor.getOption(
      59
      /* EditorOption.fontInfo */
    ), n = this._hover.contentsDomNode;
    n.style.fontSize = `${e}px`, n.style.lineHeight = `${t / e}`, Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((s) => this._editor.applyFontInfo(s));
  }
  _updateContent(e) {
    const t = this._hover.contentsDomNode;
    t.style.paddingBottom = "", t.textContent = "", t.appendChild(e);
  }
  _layoutContentWidget() {
    this._editor.layoutContentWidget(this), this._hover.onContentsChanged();
  }
  _updateMaxDimensions() {
    const e = Math.max(this._editor.getLayoutInfo().height / 4, 250, kg._lastDimensions.height), t = Math.max(this._editor.getLayoutInfo().width * 0.66, 750, kg._lastDimensions.width);
    this._resizableNode.maxSize = new Ji(t, e), this._setHoverWidgetMaxDimensions(t, e);
  }
  _render(e) {
    this._setRenderedHover(e), this._updateFont(), this._updateContent(e.domNode), this.handleContentsChanged(), this._editor.render();
  }
  getPosition() {
    return this._renderedHover ? {
      position: this._renderedHover.showAtPosition,
      secondaryPosition: this._renderedHover.showAtSecondaryPosition,
      positionAffinity: this._renderedHover.shouldAppearBeforeContent ? 3 : void 0,
      preference: [
        this._positionPreference ?? 1
        /* ContentWidgetPositionPreference.ABOVE */
      ]
    } : null;
  }
  show(e) {
    var o;
    if (!this._editor || !this._editor.hasModel())
      return;
    this._render(e);
    const t = _y(this._hover.containerDomNode), n = e.showAtPosition;
    this._positionPreference = this._findPositionPreference(t, n) ?? 1, this.handleContentsChanged(), e.shouldFocus && this._hover.containerDomNode.focus(), this._onDidResize.fire();
    const s = this._hover.containerDomNode.ownerDocument.activeElement === this._hover.containerDomNode && SBe(this._configurationService.getValue("accessibility.verbosity.hover") === !0 && this._accessibilityService.isScreenReaderOptimized(), ((o = this._keybindingService.lookupKeybinding("editor.action.accessibleView")) == null ? void 0 : o.getAriaLabel()) ?? "");
    s && (this._hover.contentsDomNode.ariaLabel = this._hover.contentsDomNode.textContent + ", " + s);
  }
  hide() {
    if (!this._renderedHover)
      return;
    const e = this._renderedHover.shouldFocus || this._hoverFocusedKey.get();
    this._setRenderedHover(void 0), this._resizableNode.maxSize = new Ji(1 / 0, 1 / 0), this._resizableNode.clearSashHoverState(), this._hoverFocusedKey.set(!1), this._editor.layoutContentWidget(this), e && this._editor.focus();
  }
  _removeConstraintsRenderNormally() {
    const e = this._editor.getLayoutInfo();
    this._resizableNode.layout(e.height, e.width), this._setHoverWidgetDimensions("auto", "auto"), this._updateMaxDimensions();
  }
  setMinimumDimensions(e) {
    this._minimumSize = new Ji(Math.max(this._minimumSize.width, e.width), Math.max(this._minimumSize.height, e.height)), this._updateMinimumWidth();
  }
  _updateMinimumWidth() {
    const e = typeof this._contentWidth > "u" ? this._minimumSize.width : Math.min(this._contentWidth, this._minimumSize.width);
    this._resizableNode.minSize = new Ji(e, this._minimumSize.height);
  }
  handleContentsChanged() {
    var r;
    this._removeConstraintsRenderNormally();
    const e = this._hover.contentsDomNode;
    let t = _y(e), n = Td(e) + 2;
    if (this._resizableNode.layout(t, n), this._setHoverWidgetDimensions(n, t), t = _y(e), n = Td(e), this._contentWidth = n, this._updateMinimumWidth(), this._resizableNode.layout(t, n), (r = this._renderedHover) != null && r.showAtPosition) {
      const s = _y(this._hover.containerDomNode);
      this._positionPreference = this._findPositionPreference(s, this._renderedHover.showAtPosition);
    }
    this._layoutContentWidget(), this._onContentsChanged.fire();
  }
  focus() {
    this._hover.containerDomNode.focus();
  }
  scrollUp() {
    const e = this._hover.scrollbar.getScrollPosition().scrollTop, t = this._editor.getOption(
      59
      /* EditorOption.fontInfo */
    );
    this._hover.scrollbar.setScrollPosition({ scrollTop: e - t.lineHeight });
  }
  scrollDown() {
    const e = this._hover.scrollbar.getScrollPosition().scrollTop, t = this._editor.getOption(
      59
      /* EditorOption.fontInfo */
    );
    this._hover.scrollbar.setScrollPosition({ scrollTop: e + t.lineHeight });
  }
  scrollLeft() {
    const e = this._hover.scrollbar.getScrollPosition().scrollLeft;
    this._hover.scrollbar.setScrollPosition({ scrollLeft: e - EDe });
  }
  scrollRight() {
    const e = this._hover.scrollbar.getScrollPosition().scrollLeft;
    this._hover.scrollbar.setScrollPosition({ scrollLeft: e + EDe });
  }
  pageUp() {
    const e = this._hover.scrollbar.getScrollPosition().scrollTop, t = this._hover.scrollbar.getScrollDimensions().height;
    this._hover.scrollbar.setScrollPosition({ scrollTop: e - t });
  }
  pageDown() {
    const e = this._hover.scrollbar.getScrollPosition().scrollTop, t = this._hover.scrollbar.getScrollDimensions().height;
    this._hover.scrollbar.setScrollPosition({ scrollTop: e + t });
  }
  goToTop() {
    this._hover.scrollbar.setScrollPosition({ scrollTop: 0 });
  }
  goToBottom() {
    this._hover.scrollbar.setScrollPosition({ scrollTop: this._hover.scrollbar.getScrollDimensions().scrollHeight });
  }
}, kg = W1, W1.ID = "editor.contrib.resizableContentHoverWidget", W1._lastDimensions = new Ji(0, 0), W1);
Jse = kg = f1t([
  uH(1, Jt),
  uH(2, xn),
  uH(3, Qa),
  uH(4, Fi)
], Jse);
function xDe(i, e, t, n, r, s) {
  const o = t + r / 2, a = n + s / 2, l = Math.max(Math.abs(i - o) - r / 2, 0), c = Math.max(Math.abs(e - a) - s / 2, 0);
  return Math.sqrt(l * l + c * c);
}
class rz {
  constructor(e, t) {
    this._editor = e, this._participants = t;
  }
  static _getLineDecorations(e, t) {
    if (t.type !== 1 && !t.supportsMarkerHover)
      return [];
    const n = e.getModel(), r = t.range.startLineNumber;
    if (r > n.getLineCount())
      return [];
    const s = n.getLineMaxColumn(r);
    return e.getLineDecorations(r).filter((o) => {
      if (o.options.isWholeLine)
        return !0;
      const a = o.range.startLineNumber === r ? o.range.startColumn : 1, l = o.range.endLineNumber === r ? o.range.endColumn : s;
      if (o.options.showIfCollapsed) {
        if (a > t.range.startColumn + 1 || t.range.endColumn - 1 > l)
          return !1;
      } else if (a > t.range.startColumn || t.range.endColumn > l)
        return !1;
      return !0;
    });
  }
  computeAsync(e, t) {
    const n = e.anchor;
    if (!this._editor.hasModel() || !n)
      return Hf.EMPTY;
    const r = rz._getLineDecorations(this._editor, n);
    return Hf.merge(this._participants.map((s) => s.computeAsync ? s.computeAsync(n, r, e.source, t) : Hf.EMPTY));
  }
  computeSync(e) {
    if (!this._editor.hasModel())
      return [];
    const t = e.anchor, n = rz._getLineDecorations(this._editor, t);
    let r = [];
    for (const s of this._participants)
      r = r.concat(s.computeSync(t, n, e.source));
    return ym(r);
  }
}
class LBe {
  constructor(e, t, n) {
    this.hoverParts = e, this.isComplete = t, this.options = n;
  }
  filter(e) {
    const t = this.hoverParts.filter((n) => n.isValidForHoverAnchor(e));
    return t.length === this.hoverParts.length ? this : new g1t(this, t, this.isComplete, this.options);
  }
}
class g1t extends LBe {
  constructor(e, t, n, r) {
    super(t, n, r), this.original = e;
  }
  filter(e) {
    return this.original.filter(e);
  }
}
var p1t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, LDe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const TDe = Ge;
let sz = class extends ge {
  get hasContent() {
    return this._hasContent;
  }
  constructor(e, t) {
    super(), this._keybindingService = e, this._hoverService = t, this.actions = [], this._hasContent = !1, this.hoverElement = TDe("div.hover-row.status-bar"), this.hoverElement.tabIndex = 0, this.actionsElement = Fe(this.hoverElement, TDe("div.actions"));
  }
  addAction(e) {
    const t = this._keybindingService.lookupKeybinding(e.commandId), n = t ? t.getLabel() : null;
    this._hasContent = !0;
    const r = this._register(wK.render(this.actionsElement, e, n));
    return this._register(this._hoverService.setupManagedHover(rd("element"), r.actionContainer, r.actionRenderedLabel)), this.actions.push(r), r;
  }
  append(e) {
    const t = Fe(this.actionsElement, e);
    return this._hasContent = !0, t;
  }
};
sz = p1t([
  LDe(0, Fi),
  LDe(1, od)
], sz);
class m1t {
  constructor(e, t, n) {
    this.provider = e, this.hover = t, this.ordinal = n;
  }
}
async function _1t(i, e, t, n, r) {
  const s = await Promise.resolve(i.provideHover(t, n, r)).catch(No);
  if (!(!s || !b1t(s)))
    return new m1t(i, s, e);
}
function Zge(i, e, t, n, r = !1) {
  const o = i.ordered(e, r).map((a, l) => _1t(a, l, e, t, n));
  return Hf.fromPromisesResolveOrder(o).coalesce();
}
async function TBe(i, e, t, n, r = !1) {
  const s = [];
  for await (const o of Zge(i, e, t, n, r))
    s.push(o.hover);
  return s;
}
id("_executeHoverProvider", (i, e, t) => {
  const n = i.get(St);
  return TBe(n.hoverProvider, e, t, $n.None);
});
id("_executeHoverProvider_recursive", (i, e, t) => {
  const n = i.get(St);
  return TBe(n.hoverProvider, e, t, $n.None, !0);
});
function b1t(i) {
  const e = typeof i.range < "u", t = typeof i.contents < "u" && i.contents && i.contents.length > 0;
  return e && t;
}
var v1t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, dE = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const yx = Ge, y1t = es("hover-increase-verbosity", Pe.add, S(1123, "Icon for increaseing hover verbosity.")), C1t = es("hover-decrease-verbosity", Pe.remove, S(1124, "Icon for decreasing hover verbosity."));
class Wg {
  constructor(e, t, n, r, s, o = void 0) {
    this.owner = e, this.range = t, this.contents = n, this.isBeforeContent = r, this.ordinal = s, this.source = o;
  }
  isValidForHoverAnchor(e) {
    return e.type === 1 && this.range.startColumn <= e.range.startColumn && this.range.endColumn >= e.range.endColumn;
  }
}
class kBe {
  constructor(e, t, n) {
    this.hover = e, this.hoverProvider = t, this.hoverPosition = n;
  }
  supportsVerbosityAction(e) {
    switch (e) {
      case kd.Increase:
        return this.hover.canIncreaseVerbosity ?? !1;
      case kd.Decrease:
        return this.hover.canDecreaseVerbosity ?? !1;
    }
  }
}
let n5 = class {
  constructor(e, t, n, r, s, o, a, l) {
    this._editor = e, this._languageService = t, this._openerService = n, this._configurationService = r, this._languageFeaturesService = s, this._keybindingService = o, this._hoverService = a, this._commandService = l, this.hoverOrdinal = 3;
  }
  createLoadingMessage(e) {
    return new Wg(this, e.range, [new ql().appendText(S(1125, "Loading..."))], !1, 2e3);
  }
  computeSync(e, t) {
    if (!this._editor.hasModel() || e.type !== 1)
      return [];
    const n = this._editor.getModel(), r = e.range.startLineNumber, s = n.getLineMaxColumn(r), o = [];
    let a = 1e3;
    const l = n.getLineLength(r), c = n.getLanguageIdAtPosition(e.range.startLineNumber, e.range.startColumn), u = this._editor.getOption(
      133
      /* EditorOption.stopRenderingLineAfter */
    ), d = this._configurationService.getValue("editor.maxTokenizationLineLength", {
      overrideIdentifier: c
    });
    let h = !1;
    u >= 0 && l > u && e.range.startColumn >= u && (h = !0, o.push(new Wg(this, e.range, [{
      value: S(1126, "Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")
    }], !1, a++))), !h && typeof d == "number" && l >= d && o.push(new Wg(this, e.range, [{
      value: S(1127, "Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")
    }], !1, a++));
    let g = !1;
    for (const m of t) {
      const _ = m.range.startLineNumber === r ? m.range.startColumn : 1, v = m.range.endLineNumber === r ? m.range.endColumn : s, w = m.options.hoverMessage;
      if (!w || aA(w))
        continue;
      m.options.beforeContentClassName && (g = !0);
      const E = new z(e.range.startLineNumber, _, e.range.startLineNumber, v);
      o.push(new Wg(this, E, Ghe(w), g, a++));
    }
    return o;
  }
  computeAsync(e, t, n, r) {
    if (!this._editor.hasModel() || e.type !== 1)
      return Hf.EMPTY;
    const s = this._editor.getModel(), o = this._languageFeaturesService.hoverProvider;
    return o.has(s) ? this._getMarkdownHovers(o, s, e, r) : Hf.EMPTY;
  }
  async *_getMarkdownHovers(e, t, n, r) {
    const s = n.range.getStartPosition(), o = Zge(e, t, s, r);
    for await (const a of o)
      if (!aA(a.hover.contents)) {
        const l = a.hover.range ? z.lift(a.hover.range) : n.range, c = new kBe(a.hover, a.provider, s);
        yield new Wg(this, l, a.hover.contents, !1, a.ordinal, c);
      }
  }
  renderHoverParts(e, t) {
    return this._renderedHoverParts = new w1t(t, e.fragment, this, this._editor, this._languageService, this._openerService, this._commandService, this._keybindingService, this._hoverService, this._configurationService, e.onContentsChanged), this._renderedHoverParts;
  }
  handleScroll(e) {
    var t;
    (t = this._renderedHoverParts) == null || t.handleScroll(e);
  }
  updateMarkdownHoverVerbosityLevel(e, t) {
    var n;
    return Promise.resolve((n = this._renderedHoverParts) == null ? void 0 : n.updateMarkdownHoverPartVerbosityLevel(e, t));
  }
};
n5 = v1t([
  dE(1, Gr),
  dE(2, ad),
  dE(3, xn),
  dE(4, St),
  dE(5, Fi),
  dE(6, od),
  dE(7, jr)
], n5);
class dH {
  constructor(e, t, n, r) {
    this.hoverPart = e, this.hoverElement = t, this.disposables = n, this.actionsContainer = r;
  }
  dispose() {
    this.disposables.dispose();
  }
}
class w1t {
  constructor(e, t, n, r, s, o, a, l, c, u, d) {
    this._hoverParticipant = n, this._editor = r, this._languageService = s, this._openerService = o, this._commandService = a, this._keybindingService = l, this._hoverService = c, this._configurationService = u, this._onFinishedRendering = d, this._ongoingHoverOperations = /* @__PURE__ */ new Map(), this._disposables = new ke(), this.renderedHoverParts = this._renderHoverParts(e, t, this._onFinishedRendering), this._disposables.add(Et(() => {
      this.renderedHoverParts.forEach((h) => {
        h.dispose();
      }), this._ongoingHoverOperations.forEach((h) => {
        h.tokenSource.dispose(!0);
      });
    }));
  }
  _renderHoverParts(e, t, n) {
    return e.sort(yl((r) => r.ordinal, Hd)), e.map((r) => {
      const s = this._renderHoverPart(r, n);
      return t.appendChild(s.hoverElement), s;
    });
  }
  _renderHoverPart(e, t) {
    const n = this._renderMarkdownHover(e, t), r = n.hoverElement, s = e.source, o = new ke();
    if (o.add(n), !s)
      return new dH(e, r, o);
    const a = s.supportsVerbosityAction(kd.Increase), l = s.supportsVerbosityAction(kd.Decrease);
    if (!a && !l)
      return new dH(e, r, o);
    const c = yx("div.verbosity-actions");
    r.prepend(c);
    const u = yx("div.verbosity-actions-inner");
    return c.append(u), o.add(this._renderHoverExpansionAction(u, kd.Increase, a)), o.add(this._renderHoverExpansionAction(u, kd.Decrease, l)), new dH(e, r, o, u);
  }
  _renderMarkdownHover(e, t) {
    return DBe(this._editor, e, this._languageService, this._openerService, t);
  }
  _renderHoverExpansionAction(e, t, n) {
    const r = new ke(), s = t === kd.Increase, o = Fe(e, yx(qt.asCSSSelector(s ? y1t : C1t)));
    o.tabIndex = 0;
    const a = new cA("mouse", void 0, { target: e, position: {
      hoverPosition: 0
      /* HoverPosition.LEFT */
    } }, this._configurationService, this._hoverService);
    if (r.add(this._hoverService.setupManagedHover(a, o, E1t(this._keybindingService, t))), !n)
      return o.classList.add("disabled"), r;
    o.classList.add("enabled");
    const l = () => this._commandService.executeCommand(t === kd.Increase ? vK : yK, { focus: !0 });
    return r.add(new EBe(o, l)), r.add(new xBe(o, l, [
      3,
      10
      /* KeyCode.Space */
    ])), r;
  }
  handleScroll(e) {
    this.renderedHoverParts.forEach((t) => {
      const n = t.actionsContainer;
      if (!n)
        return;
      const r = t.hoverElement, o = e.scrollTop + e.height, a = r.offsetTop, l = r.clientHeight, c = a + l, u = 22;
      let d;
      c <= o || a >= o ? d = l - u : d = o - a - u, n.style.top = `${d}px`;
    });
  }
  async updateMarkdownHoverPartVerbosityLevel(e, t) {
    const n = this._editor.getModel();
    if (!n)
      return;
    const r = this._getRenderedHoverPartAtIndex(t), s = r == null ? void 0 : r.hoverPart.source;
    if (!r || !(s != null && s.supportsVerbosityAction(e)))
      return;
    const o = await this._fetchHover(s, n, e);
    if (!o)
      return;
    const a = new kBe(o, s.hoverProvider, s.hoverPosition), l = r.hoverPart, c = new Wg(this._hoverParticipant, l.range, o.contents, l.isBeforeContent, l.ordinal, a), u = this._updateRenderedHoverPart(t, c);
    if (u)
      return {
        hoverPart: c,
        hoverElement: u.hoverElement
      };
  }
  async _fetchHover(e, t, n) {
    let r = n === kd.Increase ? 1 : -1;
    const s = e.hoverProvider, o = this._ongoingHoverOperations.get(s);
    o && (o.tokenSource.cancel(), r += o.verbosityDelta);
    const a = new Ss();
    this._ongoingHoverOperations.set(s, { verbosityDelta: r, tokenSource: a });
    const l = { verbosityRequest: { verbosityDelta: r, previousHover: e.hover } };
    let c;
    try {
      c = await Promise.resolve(s.provideHover(t, e.hoverPosition, a.token, l));
    } catch (u) {
      No(u);
    }
    return a.dispose(), this._ongoingHoverOperations.delete(s), c;
  }
  _updateRenderedHoverPart(e, t) {
    if (e >= this.renderedHoverParts.length || e < 0)
      return;
    const n = this._renderHoverPart(t, this._onFinishedRendering), r = this.renderedHoverParts[e], s = r.hoverElement, o = n.hoverElement, a = Array.from(o.children);
    s.replaceChildren(...a);
    const l = new dH(t, s, n.disposables, n.actionsContainer);
    return r.dispose(), this.renderedHoverParts[e] = l, l;
  }
  _getRenderedHoverPartAtIndex(e) {
    return this.renderedHoverParts[e];
  }
  dispose() {
    this._disposables.dispose();
  }
}
function S1t(i, e, t, n, r) {
  e.sort(yl((o) => o.ordinal, Hd));
  const s = [];
  for (const o of e) {
    const a = DBe(t, o, n, r, i.onContentsChanged);
    i.fragment.appendChild(a.hoverElement), s.push(a);
  }
  return new wT(s);
}
function DBe(i, e, t, n, r) {
  const s = new ke(), o = yx("div.hover-row"), a = yx("div.hover-row-contents");
  o.appendChild(a);
  const l = e.contents;
  for (const u of l) {
    if (aA(u))
      continue;
    const d = yx("div.markdown-hover"), h = Fe(d, yx("div.hover-contents")), g = new n0({ editor: i }, t, n), m = s.add(g.render(u, {
      asyncRenderCallback: () => {
        h.className = "hover-contents code-hover-contents", r();
      }
    }));
    h.appendChild(m.element), a.appendChild(d);
  }
  return {
    hoverPart: e,
    hoverElement: o,
    dispose() {
      s.dispose();
    }
  };
}
function E1t(i, e) {
  switch (e) {
    case kd.Increase: {
      const t = i.lookupKeybinding(vK);
      return t ? S(1128, "Increase Hover Verbosity ({0})", t.getLabel()) : S(1129, "Increase Hover Verbosity");
    }
    case kd.Decrease: {
      const t = i.lookupKeybinding(yK);
      return t ? S(1130, "Decrease Hover Verbosity ({0})", t.getLabel()) : S(1131, "Decrease Hover Verbosity");
    }
  }
}
const kDe = Ge;
class x1t extends ge {
  constructor(e, t, n) {
    super(), this.model = t, this.pixelRatio = n, this._onDidChange = new he(), this.onDidChange = this._onDidChange.event, this._onColorFlushed = new he(), this.onColorFlushed = this._onColorFlushed.event, this._domNode = kDe(".saturation-wrap"), Fe(e, this._domNode), this._canvas = document.createElement("canvas"), this._canvas.className = "saturation-box", Fe(this._domNode, this._canvas), this.selection = kDe(".saturation-selection"), Fe(this._domNode, this.selection), this.layout(), this._register(Ce(this._domNode, Xe.POINTER_DOWN, (r) => this.onPointerDown(r))), this._register(this.model.onDidChangeColor(this.onDidChangeColor, this)), this.monitor = null;
  }
  get domNode() {
    return this._domNode;
  }
  onPointerDown(e) {
    if (!e.target || !(e.target instanceof Element))
      return;
    this.monitor = this._register(new JA());
    const t = ho(this._domNode);
    e.target !== this.selection && this.onDidChangePosition(e.offsetX, e.offsetY), this.monitor.startMonitoring(e.target, e.pointerId, e.buttons, (r) => this.onDidChangePosition(r.pageX - t.left, r.pageY - t.top), () => null);
    const n = Ce(e.target.ownerDocument, Xe.POINTER_UP, () => {
      this._onColorFlushed.fire(), n.dispose(), this.monitor && (this.monitor.stopMonitoring(!0), this.monitor = null);
    }, !0);
  }
  onDidChangePosition(e, t) {
    const n = Math.max(0, Math.min(1, e / this.width)), r = Math.max(0, Math.min(1, 1 - t / this.height));
    this.paintSelection(n, r), this._onDidChange.fire({ s: n, v: r });
  }
  layout() {
    this.width = this._domNode.offsetWidth, this.height = this._domNode.offsetHeight, this._canvas.width = this.width * this.pixelRatio, this._canvas.height = this.height * this.pixelRatio, this.paint();
    const e = this.model.color.hsva;
    this.paintSelection(e.s, e.v);
  }
  paint() {
    const e = this.model.color.hsva, t = new De(new Q_(e.h, 1, 1, 1)), n = this._canvas.getContext("2d"), r = n.createLinearGradient(0, 0, this._canvas.width, 0);
    r.addColorStop(0, "rgba(255, 255, 255, 1)"), r.addColorStop(0.5, "rgba(255, 255, 255, 0.5)"), r.addColorStop(1, "rgba(255, 255, 255, 0)");
    const s = n.createLinearGradient(0, 0, 0, this._canvas.height);
    s.addColorStop(0, "rgba(0, 0, 0, 0)"), s.addColorStop(1, "rgba(0, 0, 0, 1)"), n.rect(0, 0, this._canvas.width, this._canvas.height), n.fillStyle = De.Format.CSS.format(t), n.fill(), n.fillStyle = r, n.fill(), n.fillStyle = s, n.fill();
  }
  paintSelection(e, t) {
    this.selection.style.left = `${e * this.width}px`, this.selection.style.top = `${this.height - t * this.height}px`;
  }
  onDidChangeColor(e) {
    if (this.monitor && this.monitor.isMonitoring())
      return;
    this.paint();
    const t = e.hsva;
    this.paintSelection(t.s, t.v);
  }
}
class L1t extends ge {
  constructor(e) {
    super(), this._onClicked = this._register(new he()), this.onClicked = this._onClicked.event, this._button = Fe(e, document.createElement("button")), this._button.classList.add("insert-button"), this._button.textContent = "Insert", this._register(Ce(this._button, Xe.CLICK, () => {
      this._onClicked.fire();
    }));
  }
  get button() {
    return this._button;
  }
}
const rP = Ge;
class IBe extends ge {
  constructor(e, t, n) {
    super(), this.model = t, this._onDidChange = new he(), this.onDidChange = this._onDidChange.event, this._onColorFlushed = new he(), this.onColorFlushed = this._onColorFlushed.event, n === "standalone" ? (this.domNode = Fe(e, rP(".standalone-strip")), this.overlay = Fe(this.domNode, rP(".standalone-overlay"))) : (this.domNode = Fe(e, rP(".strip")), this.overlay = Fe(this.domNode, rP(".overlay"))), this.slider = Fe(this.domNode, rP(".slider")), this.slider.style.top = "0px", this._register(Ce(this.domNode, Xe.POINTER_DOWN, (r) => this.onPointerDown(r))), this._register(t.onDidChangeColor(this.onDidChangeColor, this)), this.layout();
  }
  layout() {
    this.height = this.domNode.offsetHeight - this.slider.offsetHeight;
    const e = this.getValue(this.model.color);
    this.updateSliderPosition(e);
  }
  onDidChangeColor(e) {
    const t = this.getValue(e);
    this.updateSliderPosition(t);
  }
  onPointerDown(e) {
    if (!e.target || !(e.target instanceof Element))
      return;
    const t = this._register(new JA()), n = ho(this.domNode);
    this.domNode.classList.add("grabbing"), e.target !== this.slider && this.onDidChangeTop(e.offsetY), t.startMonitoring(e.target, e.pointerId, e.buttons, (s) => this.onDidChangeTop(s.pageY - n.top), () => null);
    const r = Ce(e.target.ownerDocument, Xe.POINTER_UP, () => {
      this._onColorFlushed.fire(), r.dispose(), t.stopMonitoring(!0), this.domNode.classList.remove("grabbing");
    }, !0);
  }
  onDidChangeTop(e) {
    const t = Math.max(0, Math.min(1, 1 - e / this.height));
    this.updateSliderPosition(t), this._onDidChange.fire(t);
  }
  updateSliderPosition(e) {
    this.slider.style.top = `${(1 - e) * this.height}px`;
  }
}
class T1t extends IBe {
  constructor(e, t, n) {
    super(e, t, n), this.domNode.classList.add("opacity-strip"), this.onDidChangeColor(this.model.color);
  }
  onDidChangeColor(e) {
    super.onDidChangeColor(e);
    const { r: t, g: n, b: r } = e.rgba, s = new De(new Ne(t, n, r, 1)), o = new De(new Ne(t, n, r, 0));
    this.overlay.style.background = `linear-gradient(to bottom, ${s} 0%, ${o} 100%)`;
  }
  getValue(e) {
    return e.hsva.a;
  }
}
class k1t extends IBe {
  constructor(e, t, n) {
    super(e, t, n), this.domNode.classList.add("hue-strip");
  }
  getValue(e) {
    return 1 - e.hsva.h / 360;
  }
}
const D1t = Ge;
class I1t extends ge {
  constructor(e, t, n, r) {
    super(), this.model = t, this.pixelRatio = n, this._insertButton = null, this._domNode = D1t(".colorpicker-body"), Fe(e, this._domNode), this._saturationBox = new x1t(this._domNode, this.model, this.pixelRatio), this._register(this._saturationBox), this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange, this)), this._register(this._saturationBox.onColorFlushed(this.flushColor, this)), this._opacityStrip = new T1t(this._domNode, this.model, r), this._register(this._opacityStrip), this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange, this)), this._register(this._opacityStrip.onColorFlushed(this.flushColor, this)), this._hueStrip = new k1t(this._domNode, this.model, r), this._register(this._hueStrip), this._register(this._hueStrip.onDidChange(this.onDidHueChange, this)), this._register(this._hueStrip.onColorFlushed(this.flushColor, this)), r === "standalone" && (this._insertButton = this._register(new L1t(this._domNode)), this._domNode.classList.add("standalone-colorpicker"));
  }
  flushColor() {
    this.model.flushColor();
  }
  onDidSaturationValueChange({ s: e, v: t }) {
    const n = this.model.color.hsva;
    this.model.color = new De(new Q_(n.h, e, t, n.a));
  }
  onDidOpacityChange(e) {
    const t = this.model.color.hsva;
    this.model.color = new De(new Q_(t.h, t.s, t.v, e));
  }
  onDidHueChange(e) {
    const t = this.model.color.hsva, n = (1 - e) * 360;
    this.model.color = new De(new Q_(n === 360 ? 0 : n, t.s, t.v, t.a));
  }
  get domNode() {
    return this._domNode;
  }
  get saturationBox() {
    return this._saturationBox;
  }
  get enterButton() {
    return this._insertButton;
  }
  layout() {
    this._saturationBox.layout(), this._opacityStrip.layout(), this._hueStrip.layout();
  }
}
const N1t = Ge;
class R1t extends ge {
  constructor(e) {
    super(), this._onClicked = this._register(new he()), this.onClicked = this._onClicked.event, this._button = document.createElement("div"), this._button.classList.add("close-button"), Fe(e, this._button);
    const t = document.createElement("div");
    t.classList.add("close-button-inner-div"), Fe(this._button, t), Fe(t, N1t(".button" + qt.asCSSSelector(es("color-picker-close", Pe.close, S(881, "Icon to close the color picker"))))).classList.add("close-icon"), this._register(Ce(this._button, Xe.CLICK, () => {
      this._onClicked.fire();
    }));
  }
}
const hH = Ge;
class A1t extends ge {
  constructor(e, t, n, r) {
    super(), this.model = t, this.type = r, this._closeButton = null, this._domNode = hH(".colorpicker-header"), Fe(e, this._domNode), this._pickedColorNode = Fe(this._domNode, hH(".picked-color")), Fe(this._pickedColorNode, hH("span.codicon.codicon-color-mode")), this._pickedColorPresentation = Fe(this._pickedColorNode, document.createElement("span")), this._pickedColorPresentation.classList.add("picked-color-presentation");
    const s = S(882, "Click to toggle color options (rgb/hsl/hex)");
    this._pickedColorNode.setAttribute("title", s), this._originalColorNode = Fe(this._domNode, hH(".original-color")), this._originalColorNode.style.backgroundColor = De.Format.CSS.format(this.model.originalColor) || "", this.backgroundColor = n.getColorTheme().getColor(tU) || De.white, this._register(n.onDidColorThemeChange((o) => {
      this.backgroundColor = o.getColor(tU) || De.white;
    })), this._register(Ce(this._pickedColorNode, Xe.CLICK, () => this.model.selectNextColorPresentation())), this._register(Ce(this._originalColorNode, Xe.CLICK, () => {
      this.model.color = this.model.originalColor, this.model.flushColor();
    })), this._register(t.onDidChangeColor(this.onDidChangeColor, this)), this._register(t.onDidChangePresentation(this.onDidChangePresentation, this)), this._pickedColorNode.style.backgroundColor = De.Format.CSS.format(t.color) || "", this._pickedColorNode.classList.toggle("light", t.color.rgba.a < 0.5 ? this.backgroundColor.isLighter() : t.color.isLighter()), this.onDidChangeColor(this.model.color), this.type === "standalone" && (this._domNode.classList.add("standalone-colorpicker"), this._closeButton = this._register(new R1t(this._domNode)));
  }
  get closeButton() {
    return this._closeButton;
  }
  get pickedColorNode() {
    return this._pickedColorNode;
  }
  get originalColorNode() {
    return this._originalColorNode;
  }
  onDidChangeColor(e) {
    this._pickedColorNode.style.backgroundColor = De.Format.CSS.format(e) || "", this._pickedColorNode.classList.toggle("light", e.rgba.a < 0.5 ? this.backgroundColor.isLighter() : e.isLighter()), this.onDidChangePresentation();
  }
  onDidChangePresentation() {
    this._pickedColorPresentation.textContent = this.model.presentation ? this.model.presentation.label : "";
  }
}
const O1t = Ge;
class NBe extends Xd {
  constructor(e, t, n, r, s) {
    super(), this.model = t, this.pixelRatio = n, this._register(d4.getInstance(At(e)).onDidChange(() => this.layout())), this._domNode = O1t(".colorpicker-widget"), e.appendChild(this._domNode), this.header = this._register(new A1t(this._domNode, this.model, r, s)), this.body = this._register(new I1t(this._domNode, this.model, this.pixelRatio, s));
  }
  layout() {
    this.body.layout();
  }
  get domNode() {
    return this._domNode;
  }
}
class M1t {
  get color() {
    return this._color;
  }
  set color(e) {
    this._color.equals(e) || (this._color = e, this._onDidChangeColor.fire(e));
  }
  get presentation() {
    return this.colorPresentations[this.presentationIndex];
  }
  get colorPresentations() {
    return this._colorPresentations;
  }
  set colorPresentations(e) {
    this._colorPresentations = e, this.presentationIndex > e.length - 1 && (this.presentationIndex = 0), this._onDidChangePresentation.fire(this.presentation);
  }
  constructor(e, t, n) {
    this.presentationIndex = n, this._onColorFlushed = new he(), this.onColorFlushed = this._onColorFlushed.event, this._onDidChangeColor = new he(), this.onDidChangeColor = this._onDidChangeColor.event, this._onDidChangePresentation = new he(), this.onDidChangePresentation = this._onDidChangePresentation.event, this.originalColor = e, this._color = e, this._colorPresentations = t;
  }
  selectNextColorPresentation() {
    this.presentationIndex = (this.presentationIndex + 1) % this.colorPresentations.length, this.flushColor(), this._onDidChangePresentation.fire(this.presentation);
  }
  guessColorPresentation(e, t) {
    let n = -1;
    for (let r = 0; r < this.colorPresentations.length; r++)
      if (t.toLowerCase() === this.colorPresentations[r].label) {
        n = r;
        break;
      }
    if (n === -1) {
      const r = t.split("(")[0].toLowerCase();
      for (let s = 0; s < this.colorPresentations.length; s++)
        if (this.colorPresentations[s].label.toLowerCase().startsWith(r)) {
          n = s;
          break;
        }
    }
    n !== -1 && n !== this.presentationIndex && (this.presentationIndex = n, this._onDidChangePresentation.fire(this.presentation));
  }
  flushColor() {
    this._onColorFlushed.fire(this._color);
  }
}
async function RBe(i, e, t) {
  const n = i.getValueInRange(e.range), { red: r, green: s, blue: o, alpha: a } = e.color, l = new Ne(Math.round(r * 255), Math.round(s * 255), Math.round(o * 255), a), c = new De(l), u = await pBe(i, e, t, $n.None), d = new M1t(c, [], 0);
  return d.colorPresentations = u || [], d.guessColorPresentation(c, n), {
    range: z.lift(e.range),
    model: d,
    provider: t
  };
}
function ABe(i, e, t) {
  const n = [], r = t.presentation.textEdit ?? { range: e, text: t.presentation.label, forceMoveMarkers: !1 };
  n.push(r), t.presentation.additionalTextEdits && n.push(...t.presentation.additionalTextEdits);
  const s = z.lift(r.range), o = i.getModel()._setTrackedRange(
    null,
    s,
    3
    /* TrackedRangeStickiness.GrowsOnlyWhenTypingAfter */
  );
  return i.executeEdits("colorpicker", n), i.pushUndoStop(), i.getModel()._getTrackedRange(o) ?? s;
}
async function i5(i, e, t, n, r) {
  const s = await pBe(i, {
    range: n,
    color: {
      red: t.rgba.r / 255,
      green: t.rgba.g / 255,
      blue: t.rgba.b / 255,
      alpha: t.rgba.a
    }
  }, r.provider, $n.None);
  e.colorPresentations = s || [];
}
var P1t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, F1t = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class oz {
  constructor(e, t, n, r) {
    this.owner = e, this.range = t, this.model = n, this.provider = r, this.forceShowAtRange = !0;
  }
  isValidForHoverAnchor(e) {
    return e.type === 1 && this.range.startColumn <= e.range.startColumn && this.range.endColumn >= e.range.endColumn;
  }
  static fromBaseColor(e, t) {
    return new oz(e, t.range, t.model, t.provider);
  }
}
let az = class {
  constructor(e, t) {
    this._editor = e, this._themeService = t, this.hoverOrdinal = 2;
  }
  computeSync(e, t, n) {
    return [];
  }
  computeAsync(e, t, n, r) {
    return Hf.fromPromise(this._computeAsync(e, t, n));
  }
  async _computeAsync(e, t, n) {
    if (!this._editor.hasModel())
      return [];
    if (!this._isValidRequest(n))
      return [];
    const r = dA.get(this._editor);
    if (!r)
      return [];
    for (const s of t) {
      if (!r.isColorDecoration(s))
        continue;
      const o = r.getColorData(s.range.getStartPosition());
      if (o)
        return [oz.fromBaseColor(this, await RBe(this._editor.getModel(), o.colorInfo, o.provider))];
    }
    return [];
  }
  _isValidRequest(e) {
    const t = this._editor.getOption(
      168
      /* EditorOption.colorDecoratorsActivatedOn */
    );
    switch (e) {
      case 0:
        return t === "hover" || t === "clickAndHover";
      case 1:
        return t === "click" || t === "clickAndHover";
      case 2:
        return !0;
    }
  }
  renderHoverParts(e, t) {
    const n = this._editor;
    if (t.length === 0 || !n.hasModel())
      return new wT([]);
    const r = n.getOption(
      75
      /* EditorOption.lineHeight */
    ) + 8;
    e.setMinimumDimensions(new Ji(302, r));
    const s = new ke(), o = t[0], a = n.getModel(), l = o.model;
    this._colorPicker = s.add(new NBe(
      e.fragment,
      l,
      n.getOption(
        163
        /* EditorOption.pixelRatio */
      ),
      this._themeService,
      "hover"
      /* ColorPickerWidgetType.Hover */
    ));
    let c = !1, u = new z(o.range.startLineNumber, o.range.startColumn, o.range.endLineNumber, o.range.endColumn);
    s.add(l.onColorFlushed(async (h) => {
      await i5(a, l, h, u, o), c = !0, u = ABe(n, u, l);
    })), s.add(l.onDidChangeColor((h) => {
      i5(a, l, h, u, o);
    })), s.add(n.onDidChangeModelContent((h) => {
      c ? c = !1 : (e.hide(), n.focus());
    }));
    const d = {
      hoverPart: oz.fromBaseColor(this, o),
      hoverElement: this._colorPicker.domNode,
      dispose() {
        s.dispose();
      }
    };
    return new wT([d]);
  }
  handleResize() {
    var e;
    (e = this._colorPicker) == null || e.layout();
  }
  handleContentsChanged() {
    var e;
    (e = this._colorPicker) == null || e.layout();
  }
  handleHide() {
    var e;
    (e = this._colorPicker) == null || e.dispose(), this._colorPicker = void 0;
  }
  isColorPickerVisible() {
    return !!this._colorPicker;
  }
};
az = P1t([
  F1t(1, to)
], az);
class Xs {
  static insert(e, t) {
    return {
      range: new z(e.lineNumber, e.column, e.lineNumber, e.column),
      text: t,
      forceMoveMarkers: !0
    };
  }
  static delete(e) {
    return {
      range: e,
      text: null
    };
  }
  static replace(e, t) {
    return {
      range: e,
      text: t
    };
  }
  static replaceMove(e, t) {
    return {
      range: e,
      text: t,
      forceMoveMarkers: !0
    };
  }
}
function eoe(i, e) {
  return !!i[e];
}
class Zee {
  constructor(e, t) {
    this.target = e.target, this.isLeftClick = e.event.leftButton, this.isMiddleClick = e.event.middleButton, this.isRightClick = e.event.rightButton, this.mouseMiddleClickAction = t.mouseMiddleClickAction, this.hasTriggerModifier = eoe(e.event, t.triggerModifier), this.isMiddleClick && t.mouseMiddleClickAction === "ctrlLeftClick" && (this.isMiddleClick = !1, this.isLeftClick = !0, this.hasTriggerModifier = !0), this.hasSideBySideModifier = eoe(e.event, t.triggerSideBySideModifier), this.isNoneOrSingleMouseDown = e.event.detail <= 1;
  }
}
class DDe {
  constructor(e, t) {
    this.keyCodeIsTriggerKey = e.keyCode === t.triggerKey, this.keyCodeIsSideBySideKey = e.keyCode === t.triggerSideBySideKey, this.hasTriggerModifier = eoe(e, t.triggerModifier);
  }
}
class fH {
  constructor(e, t, n, r, s) {
    this.mouseMiddleClickAction = s, this.triggerKey = e, this.triggerModifier = t, this.triggerSideBySideKey = n, this.triggerSideBySideModifier = r;
  }
  equals(e) {
    return this.triggerKey === e.triggerKey && this.triggerModifier === e.triggerModifier && this.triggerSideBySideKey === e.triggerSideBySideKey && this.triggerSideBySideModifier === e.triggerSideBySideModifier && this.mouseMiddleClickAction === e.mouseMiddleClickAction;
  }
}
function IDe(i, e) {
  return i === "altKey" ? Kn ? new fH(57, "metaKey", 6, "altKey", e) : new fH(5, "ctrlKey", 6, "altKey", e) : Kn ? new fH(6, "altKey", 57, "metaKey", e) : new fH(6, "altKey", 5, "ctrlKey", e);
}
class SK extends ge {
  constructor(e, t) {
    super(), this._onMouseMoveOrRelevantKeyDown = this._register(new he()), this.onMouseMoveOrRelevantKeyDown = this._onMouseMoveOrRelevantKeyDown.event, this._onExecute = this._register(new he()), this.onExecute = this._onExecute.event, this._onCancel = this._register(new he()), this.onCancel = this._onCancel.event, this._editor = e, this._extractLineNumberFromMouseEvent = (t == null ? void 0 : t.extractLineNumberFromMouseEvent) ?? ((n) => n.target.position ? n.target.position.lineNumber : 0), this._opts = IDe(this._editor.getOption(
      86
      /* EditorOption.multiCursorModifier */
    ), this._editor.getOption(
      87
      /* EditorOption.mouseMiddleClickAction */
    )), this._lastMouseMoveEvent = null, this._hasTriggerKeyOnMouseDown = !1, this._lineNumberOnMouseDown = 0, this._register(this._editor.onDidChangeConfiguration((n) => {
      if (n.hasChanged(
        86
        /* EditorOption.multiCursorModifier */
      ) || n.hasChanged(
        87
        /* EditorOption.mouseMiddleClickAction */
      )) {
        const r = IDe(this._editor.getOption(
          86
          /* EditorOption.multiCursorModifier */
        ), this._editor.getOption(
          87
          /* EditorOption.mouseMiddleClickAction */
        ));
        if (this._opts.equals(r))
          return;
        this._opts = r, this._lastMouseMoveEvent = null, this._hasTriggerKeyOnMouseDown = !1, this._lineNumberOnMouseDown = 0, this._onCancel.fire();
      }
    })), this._register(this._editor.onMouseMove((n) => this._onEditorMouseMove(new Zee(n, this._opts)))), this._register(this._editor.onMouseDown((n) => this._onEditorMouseDown(new Zee(n, this._opts)))), this._register(this._editor.onMouseUp((n) => this._onEditorMouseUp(new Zee(n, this._opts)))), this._register(this._editor.onKeyDown((n) => this._onEditorKeyDown(new DDe(n, this._opts)))), this._register(this._editor.onKeyUp((n) => this._onEditorKeyUp(new DDe(n, this._opts)))), this._register(this._editor.onMouseDrag(() => this._resetHandler())), this._register(this._editor.onDidChangeCursorSelection((n) => this._onDidChangeCursorSelection(n))), this._register(this._editor.onDidChangeModel((n) => this._resetHandler())), this._register(this._editor.onDidChangeModelContent(() => this._resetHandler())), this._register(this._editor.onDidScrollChange((n) => {
      (n.scrollTopChanged || n.scrollLeftChanged) && this._resetHandler();
    }));
  }
  _onDidChangeCursorSelection(e) {
    e.selection && e.selection.startColumn !== e.selection.endColumn && this._resetHandler();
  }
  _onEditorMouseMove(e) {
    this._lastMouseMoveEvent = e, this._onMouseMoveOrRelevantKeyDown.fire([e, null]);
  }
  _onEditorMouseDown(e) {
    this._hasTriggerKeyOnMouseDown = e.hasTriggerModifier, this._lineNumberOnMouseDown = this._extractLineNumberFromMouseEvent(e);
  }
  _onEditorMouseUp(e) {
    const t = this._extractLineNumberFromMouseEvent(e);
    !!this._lineNumberOnMouseDown && this._lineNumberOnMouseDown === t && (this._hasTriggerKeyOnMouseDown || e.isMiddleClick && e.mouseMiddleClickAction === "openLink") && this._onExecute.fire(e);
  }
  _onEditorKeyDown(e) {
    this._lastMouseMoveEvent && (e.keyCodeIsTriggerKey || e.keyCodeIsSideBySideKey && e.hasTriggerModifier) ? this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent, e]) : e.hasTriggerModifier && this._onCancel.fire();
  }
  _onEditorKeyUp(e) {
    e.keyCodeIsTriggerKey && this._onCancel.fire();
  }
  _resetHandler() {
    this._lastMouseMoveEvent = null, this._hasTriggerKeyOnMouseDown = !1, this._onCancel.fire();
  }
}
class OBe {
  constructor(e, t) {
    this.range = e, this.direction = t;
  }
}
class Qge {
  constructor(e, t, n) {
    this.hint = e, this.anchor = t, this.provider = n, this._isResolved = !1;
  }
  with(e) {
    const t = new Qge(this.hint, e.anchor, this.provider);
    return t._isResolved = this._isResolved, t._currentResolve = this._currentResolve, t;
  }
  async resolve(e) {
    if (typeof this.provider.resolveInlayHint == "function") {
      if (this._currentResolve)
        return await this._currentResolve, e.isCancellationRequested ? void 0 : this.resolve(e);
      this._isResolved || (this._currentResolve = this._doResolve(e).finally(() => this._currentResolve = void 0)), await this._currentResolve;
    }
  }
  async _doResolve(e) {
    try {
      const t = await Promise.resolve(this.provider.resolveInlayHint(this.hint, e));
      this.hint.tooltip = (t == null ? void 0 : t.tooltip) ?? this.hint.tooltip, this.hint.label = (t == null ? void 0 : t.label) ?? this.hint.label, this.hint.textEdits = (t == null ? void 0 : t.textEdits) ?? this.hint.textEdits, this._isResolved = !0;
    } catch (t) {
      No(t), this._isResolved = !1;
    }
  }
}
const FN = class FN {
  static async create(e, t, n, r) {
    const s = [], o = e.ordered(t).reverse().map((a) => n.map(async (l) => {
      try {
        const c = await a.provideInlayHints(t, l, r);
        (c != null && c.hints.length || a.onDidChangeInlayHints) && s.push([c ?? FN._emptyInlayHintList, a]);
      } catch (c) {
        No(c);
      }
    }));
    if (await Promise.all(o.flat()), r.isCancellationRequested || t.isDisposed())
      throw new $f();
    return new FN(n, s, t);
  }
  constructor(e, t, n) {
    this._disposables = new ke(), this.ranges = e, this.provider = /* @__PURE__ */ new Set();
    const r = [];
    for (const [s, o] of t) {
      this._disposables.add(s), this.provider.add(o);
      for (const a of s.hints) {
        const l = n.validatePosition(a.position);
        let c = "before";
        const u = FN._getRangeAtPosition(n, l);
        let d;
        u.getStartPosition().isBefore(l) ? (d = z.fromPositions(u.getStartPosition(), l), c = "after") : (d = z.fromPositions(l, u.getEndPosition()), c = "before"), r.push(new Qge(a, new OBe(d, c), o));
      }
    }
    this.items = r.sort((s, o) => de.compare(s.hint.position, o.hint.position));
  }
  dispose() {
    this._disposables.dispose();
  }
  static _getRangeAtPosition(e, t) {
    const n = t.lineNumber, r = e.getWordAtPosition(t);
    if (r)
      return new z(n, r.startColumn, n, r.endColumn);
    e.tokenization.tokenizeIfCheap(n);
    const s = e.tokenization.getLineTokens(n), o = t.column - 1, a = s.findTokenIndexAtOffset(o);
    let l = s.getStartOffset(a), c = s.getEndOffset(a);
    return c - l === 1 && (l === o && a > 1 ? (l = s.getStartOffset(a - 1), c = s.getEndOffset(a - 1)) : c === o && a < s.getCount() - 1 && (l = s.getStartOffset(a + 1), c = s.getEndOffset(a + 1))), new z(n, l + 1, n, c + 1);
  }
};
FN._emptyInlayHintList = Object.freeze({ dispose() {
}, hints: [] });
let lz = FN;
function B1t(i) {
  return D4e(i.id, ...i.arguments ?? []).toString();
}
function vb(i) {
  return i && typeof i.getEditorType == "function" ? i.getEditorType() === DB.ICodeEditor : !1;
}
function Jge(i) {
  return i && typeof i.getEditorType == "function" ? i.getEditorType() === DB.IDiffEditor : !1;
}
function H1t(i) {
  return !!i && typeof i == "object" && typeof i.onDidChangeActiveEditor == "function";
}
function MBe(i) {
  return vb(i) ? i : Jge(i) ? i.getModifiedEditor() : H1t(i) && vb(i.activeCodeEditor) ? i.activeCodeEditor : null;
}
var W1t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Pv = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let s0 = class extends uT {
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g) {
    super(e, { ...r.getRawOptions(), overflowWidgetsDomNode: r.getOverflowWidgetsDomNode() }, n, s, o, a, l, c, u, d, h, g), this._parentEditor = r, this._overwriteOptions = t, super.updateOptions(this._overwriteOptions), this._register(r.onDidChangeConfiguration((m) => this._onParentConfigurationChanged(m)));
  }
  getParentEditor() {
    return this._parentEditor;
  }
  _onParentConfigurationChanged(e) {
    super.updateOptions(this._parentEditor.getRawOptions()), super.updateOptions(this._overwriteOptions);
  }
  updateOptions(e) {
    Pq(this._overwriteOptions, e, !0), super.updateOptions(this._overwriteOptions);
  }
};
s0 = W1t([
  Pv(4, xt),
  Pv(5, Ti),
  Pv(6, jr),
  Pv(7, Jt),
  Pv(8, to),
  Pv(9, no),
  Pv(10, Qa),
  Pv(11, Ls),
  Pv(12, St)
], s0);
function PBe(i) {
  const e = i.get(Ti).getFocusedCodeEditor();
  return e instanceof s0 ? e.getParentEditor() : e;
}
const NDe = new De(new Ne(0, 122, 204)), V1t = {
  showArrow: !0,
  showFrame: !0,
  className: "",
  frameColor: NDe,
  arrowColor: NDe,
  keepEditorSelection: !1
}, U1t = "vs.editor.contrib.zoneWidget";
class z1t {
  constructor(e, t, n, r, s, o, a, l) {
    this.id = "", this.domNode = e, this.afterLineNumber = t, this.afterColumn = n, this.heightInLines = r, this.showInHiddenAreas = a, this.ordinal = l, this._onDomNodeTop = s, this._onComputedHeight = o;
  }
  onDomNodeTop(e) {
    this._onDomNodeTop(e);
  }
  onComputedHeight(e) {
    this._onComputedHeight(e);
  }
}
class $1t {
  constructor(e, t) {
    this._id = e, this._domNode = t;
  }
  getId() {
    return this._id;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return null;
  }
}
const cG = class cG {
  constructor(e) {
    this._editor = e, this._ruleName = cG._IdGenerator.nextId(), this._color = null, this._height = -1, this._decorations = this._editor.createDecorationsCollection();
  }
  dispose() {
    this.hide(), Hie(this._ruleName);
  }
  set color(e) {
    this._color !== e && (this._color = e, this._updateStyle());
  }
  set height(e) {
    this._height !== e && (this._height = e, this._updateStyle());
  }
  _updateStyle() {
    Hie(this._ruleName), JV(`.monaco-editor ${this._ruleName}`, `border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `);
  }
  show(e) {
    e.column === 1 && (e = { lineNumber: e.lineNumber, column: 2 }), this._decorations.set([{
      range: z.fromPositions(e),
      options: {
        description: "zone-widget-arrow",
        className: this._ruleName,
        stickiness: 1
        /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
      }
    }]);
  }
  hide() {
    this._decorations.clear();
  }
};
cG._IdGenerator = new pge(".arrow-decoration-");
let toe = cG;
class j1t {
  constructor(e, t = {}) {
    this._arrow = null, this._overlayWidget = null, this._resizeSash = null, this._isSashResizeHeight = !1, this._viewZone = null, this._disposables = new ke(), this.container = null, this._isShowing = !1, this.editor = e, this._positionMarkerId = this.editor.createDecorationsCollection(), this.options = W_(t), Pq(this.options, V1t, !1), this.domNode = document.createElement("div"), this.options.isAccessible || (this.domNode.setAttribute("aria-hidden", "true"), this.domNode.setAttribute("role", "presentation")), this._disposables.add(this.editor.onDidLayoutChange((n) => {
      const r = this._getWidth(n);
      this.domNode.style.width = r + "px", this.domNode.style.left = this._getLeft(n) + "px", this._onWidth(r);
    }));
  }
  dispose() {
    this._overlayWidget && (this.editor.removeOverlayWidget(this._overlayWidget), this._overlayWidget = null), this._viewZone && this.editor.changeViewZones((e) => {
      this._viewZone && e.removeZone(this._viewZone.id), this._viewZone = null;
    }), this._positionMarkerId.clear(), this._disposables.dispose();
  }
  create() {
    this.domNode.classList.add("zone-widget"), this.options.className && this.domNode.classList.add(this.options.className), this.container = document.createElement("div"), this.container.classList.add("zone-widget-container"), this.domNode.appendChild(this.container), this.options.showArrow && (this._arrow = new toe(this.editor), this._disposables.add(this._arrow)), this._fillContainer(this.container), this._initSash(), this._applyStyles();
  }
  style(e) {
    e.frameColor && (this.options.frameColor = e.frameColor), e.arrowColor && (this.options.arrowColor = e.arrowColor), this._applyStyles();
  }
  _applyStyles() {
    if (this.container && this.options.frameColor) {
      const e = this.options.frameColor.toString();
      this.container.style.borderTopColor = e, this.container.style.borderBottomColor = e;
    }
    if (this._arrow && this.options.arrowColor) {
      const e = this.options.arrowColor.toString();
      this._arrow.color = e;
    }
  }
  _getWidth(e) {
    return e.width - e.minimap.minimapWidth - e.verticalScrollbarWidth;
  }
  _getLeft(e) {
    return e.minimap.minimapWidth > 0 && e.minimap.minimapLeft === 0 ? e.minimap.minimapWidth : 0;
  }
  _onViewZoneTop(e) {
    this.domNode.style.top = e + "px";
  }
  _onViewZoneHeight(e) {
    var t;
    if (this.domNode.style.height = `${e}px`, this.container) {
      const n = e - this._decoratingElementsHeight();
      this.container.style.height = `${n}px`;
      const r = this.editor.getLayoutInfo();
      this._doLayout(n, this._getWidth(r));
    }
    (t = this._resizeSash) == null || t.layout();
  }
  get position() {
    const e = this._positionMarkerId.getRange(0);
    if (e)
      return e.getStartPosition();
  }
  show(e, t) {
    const n = z.isIRange(e) ? z.lift(e) : z.fromPositions(e);
    this._isShowing = !0, this._showImpl(n, t), this._isShowing = !1, this._positionMarkerId.set([{ range: n, options: dn.EMPTY }]);
  }
  hide() {
    var e;
    this._viewZone && (this.editor.changeViewZones((t) => {
      this._viewZone && t.removeZone(this._viewZone.id);
    }), this._viewZone = null), this._overlayWidget && (this.editor.removeOverlayWidget(this._overlayWidget), this._overlayWidget = null), (e = this._arrow) == null || e.hide(), this._positionMarkerId.clear(), this._isSashResizeHeight = !1;
  }
  _decoratingElementsHeight() {
    const e = this.editor.getOption(
      75
      /* EditorOption.lineHeight */
    );
    let t = 0;
    if (this.options.showArrow) {
      const n = Math.round(e / 3);
      t += 2 * n;
    }
    if (this.options.showFrame) {
      const n = this.options.frameWidth ?? Math.round(e / 9);
      t += 2 * n;
    }
    return t;
  }
  /** Gets the maximum widget height in lines. */
  _getMaximumHeightInLines() {
    return Math.max(12, this.editor.getLayoutInfo().height / this.editor.getOption(
      75
      /* EditorOption.lineHeight */
    ) * 0.8);
  }
  _showImpl(e, t) {
    const n = e.getStartPosition(), r = this.editor.getLayoutInfo(), s = this._getWidth(r);
    this.domNode.style.width = `${s}px`, this.domNode.style.left = this._getLeft(r) + "px";
    const o = document.createElement("div");
    o.style.overflow = "hidden";
    const a = this.editor.getOption(
      75
      /* EditorOption.lineHeight */
    ), l = this._getMaximumHeightInLines();
    l !== void 0 && (t = Math.min(t, l));
    let c = 0, u = 0;
    if (this._arrow && this.options.showArrow && (c = Math.round(a / 3), this._arrow.height = c, this._arrow.show(n)), this.options.showFrame && (u = Math.round(a / 9)), this.editor.changeViewZones((g) => {
      this._viewZone && g.removeZone(this._viewZone.id), this._overlayWidget && (this.editor.removeOverlayWidget(this._overlayWidget), this._overlayWidget = null), this.domNode.style.top = "-1000px", this._viewZone = new z1t(o, n.lineNumber, n.column, t, (m) => this._onViewZoneTop(m), (m) => this._onViewZoneHeight(m), this.options.showInHiddenAreas, this.options.ordinal), this._viewZone.id = g.addZone(this._viewZone), this._overlayWidget = new $1t(U1t + this._viewZone.id, this.domNode), this.editor.addOverlayWidget(this._overlayWidget);
    }), this._updateSashEnablement(), this.container && this.options.showFrame) {
      const g = this.options.frameWidth ? this.options.frameWidth : u;
      this.container.style.borderTopWidth = g + "px", this.container.style.borderBottomWidth = g + "px";
    }
    const d = t * a - this._decoratingElementsHeight();
    this.container && (this.container.style.top = c + "px", this.container.style.height = d + "px", this.container.style.overflow = "hidden"), this._doLayout(d, s), this.options.keepEditorSelection || this.editor.setSelection(e);
    const h = this.editor.getModel();
    if (h) {
      const g = h.validateRange(new z(e.startLineNumber, 1, e.endLineNumber + 1, 1));
      this.revealRange(g, g.startLineNumber === h.getLineCount());
    }
  }
  revealRange(e, t) {
    t ? this.editor.revealLineNearTop(
      e.endLineNumber,
      0
      /* ScrollType.Smooth */
    ) : this.editor.revealRange(
      e,
      0
      /* ScrollType.Smooth */
    );
  }
  setCssClass(e, t) {
    this.container && (t && this.container.classList.remove(t), this.container.classList.add(e));
  }
  _onWidth(e) {
  }
  _doLayout(e, t) {
  }
  _relayout(e, t) {
    const n = this._getMaximumHeightInLines(), r = t && n !== void 0 ? Math.min(n, e) : e;
    this._viewZone && this._viewZone.heightInLines !== r && (this.editor.changeViewZones((s) => {
      this._viewZone && (this._viewZone.heightInLines = r, s.layoutZone(this._viewZone.id));
    }), this._updateSashEnablement());
  }
  // --- sash
  _initSash() {
    if (this._resizeSash)
      return;
    this._resizeSash = this._disposables.add(new zl(this.domNode, this, {
      orientation: 1
      /* Orientation.HORIZONTAL */
    })), this.options.isResizeable || (this._resizeSash.state = 0);
    let e;
    this._disposables.add(this._resizeSash.onDidStart((t) => {
      this._viewZone && (e = {
        startY: t.startY,
        heightInLines: this._viewZone.heightInLines,
        ...this._getResizeBounds()
      });
    })), this._disposables.add(this._resizeSash.onDidEnd(() => {
      e = void 0;
    })), this._disposables.add(this._resizeSash.onDidChange((t) => {
      if (e) {
        const n = (t.currentY - e.startY) / this.editor.getOption(
          75
          /* EditorOption.lineHeight */
        ), r = n < 0 ? Math.ceil(n) : Math.floor(n), s = e.heightInLines + r;
        s > e.minLines && s < e.maxLines && (this._isSashResizeHeight = !0, this._relayout(s));
      }
    }));
  }
  _updateSashEnablement() {
    if (this._resizeSash) {
      const { minLines: e, maxLines: t } = this._getResizeBounds();
      this._resizeSash.state = e === t ? 0 : 3;
    }
  }
  _getResizeBounds() {
    return { minLines: 5, maxLines: 35 };
  }
  getHorizontalSashLeft() {
    return 0;
  }
  getHorizontalSashTop() {
    return (this.domNode.style.height === null ? 0 : parseInt(this.domNode.style.height)) - this._decoratingElementsHeight() / 2;
  }
  getHorizontalSashWidth() {
    const e = this.editor.getLayoutInfo();
    return e.width - e.minimap.minimapWidth;
  }
}
var FBe = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, BBe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const HBe = Vn("IPeekViewService");
ni(
  HBe,
  class {
    constructor() {
      this._widgets = /* @__PURE__ */ new Map();
    }
    addExclusiveWidget(i, e) {
      const t = this._widgets.get(i);
      t && (t.listener.dispose(), t.widget.dispose());
      const n = () => {
        const r = this._widgets.get(i);
        r && r.widget === e && (r.listener.dispose(), this._widgets.delete(i));
      };
      this._widgets.set(i, { widget: e, listener: e.onDidClose(n) });
    }
  },
  1
  /* InstantiationType.Delayed */
);
var td;
(function(i) {
  i.inPeekEditor = new ut("inReferenceSearchEditor", !0, S(1306, "Whether the current code editor is embedded inside peek")), i.notInPeekEditor = i.inPeekEditor.toNegated();
})(td || (td = {}));
var ER;
let cz = (ER = class {
  constructor(e, t) {
    e instanceof s0 && td.inPeekEditor.bindTo(t);
  }
  dispose() {
  }
}, ER.ID = "editor.contrib.referenceController", ER);
cz = FBe([
  BBe(1, Jt)
], cz);
Si(
  cz.ID,
  cz,
  0
  /* EditorContributionInstantiation.Eager */
);
const G1t = {
  headerBackgroundColor: De.white,
  primaryHeadingColor: De.fromHex("#333333"),
  secondaryHeadingColor: De.fromHex("#6c6c6cb3")
};
let uz = class extends j1t {
  constructor(e, t, n) {
    super(e, t), this.instantiationService = n, this._onDidClose = new he(), this.onDidClose = this._onDidClose.event, Pq(this.options, G1t, !1);
    const r = Ms(this.editor);
    r.openedPeekWidgets.set(r.openedPeekWidgets.get() + 1, void 0);
  }
  dispose() {
    if (!this.disposed) {
      this.disposed = !0, super.dispose(), this._onDidClose.fire(this);
      const e = Ms(this.editor);
      e.openedPeekWidgets.set(e.openedPeekWidgets.get() - 1, void 0);
    }
  }
  style(e) {
    const t = this.options;
    e.headerBackgroundColor && (t.headerBackgroundColor = e.headerBackgroundColor), e.primaryHeadingColor && (t.primaryHeadingColor = e.primaryHeadingColor), e.secondaryHeadingColor && (t.secondaryHeadingColor = e.secondaryHeadingColor), super.style(e);
  }
  _applyStyles() {
    super._applyStyles();
    const e = this.options;
    this._headElement && e.headerBackgroundColor && (this._headElement.style.backgroundColor = e.headerBackgroundColor.toString()), this._primaryHeading && e.primaryHeadingColor && (this._primaryHeading.style.color = e.primaryHeadingColor.toString()), this._secondaryHeading && e.secondaryHeadingColor && (this._secondaryHeading.style.color = e.secondaryHeadingColor.toString()), this._bodyElement && e.frameColor && (this._bodyElement.style.borderColor = e.frameColor.toString());
  }
  _fillContainer(e) {
    this.setCssClass("peekview-widget"), this._headElement = Ge(".head"), this._bodyElement = Ge(".body"), this._fillHead(this._headElement), this._fillBody(this._bodyElement), e.appendChild(this._headElement), e.appendChild(this._bodyElement);
  }
  _fillHead(e, t) {
    this._titleElement = Ge(".peekview-title"), this.options.supportOnTitleClick && (this._titleElement.classList.add("clickable"), vo(this._titleElement, "click", (s) => this._onTitleClick(s))), Fe(this._headElement, this._titleElement), this._fillTitleIcon(this._titleElement), this._primaryHeading = Ge("span.filename"), this._secondaryHeading = Ge("span.dirname"), this._metaHeading = Ge("span.meta"), Fe(this._titleElement, this._primaryHeading, this._secondaryHeading, this._metaHeading);
    const n = Ge(".peekview-actions");
    Fe(this._headElement, n);
    const r = this._getActionBarOptions();
    this._actionbarWidget = new qu(n, r), this._disposables.add(this._actionbarWidget), t || this._actionbarWidget.push(this._disposables.add(new Vh("peekview.close", S(1307, "Close"), qt.asClassName(Pe.close), !0, () => (this.dispose(), Promise.resolve()))), { label: !1, icon: !0 });
  }
  _fillTitleIcon(e) {
  }
  _getActionBarOptions() {
    return {
      actionViewItemProvider: Oge.bind(void 0, this.instantiationService),
      orientation: 0
      /* ActionsOrientation.HORIZONTAL */
    };
  }
  _onTitleClick(e) {
  }
  setTitle(e, t) {
    this._primaryHeading && this._secondaryHeading && (this._primaryHeading.innerText = e, this._primaryHeading.setAttribute("title", e), t ? this._secondaryHeading.innerText = t : Xa(this._secondaryHeading));
  }
  setMetaTitle(e) {
    this._metaHeading && (e ? (this._metaHeading.innerText = e, Id(this._metaHeading)) : eu(this._metaHeading));
  }
  _doLayout(e, t) {
    if (!this._isShowing && e < 0) {
      this.dispose();
      return;
    }
    const n = Math.ceil(this.editor.getOption(
      75
      /* EditorOption.lineHeight */
    ) * 1.2), r = Math.round(e - (n + 1));
    this._doLayoutHead(n, t), this._doLayoutBody(r, t);
  }
  _doLayoutHead(e, t) {
    this._headElement && (this._headElement.style.height = `${e}px`, this._headElement.style.lineHeight = this._headElement.style.height);
  }
  _doLayoutBody(e, t) {
    this._bodyElement && (this._bodyElement.style.height = `${e}px`);
  }
};
uz = FBe([
  BBe(2, xt)
], uz);
const q1t = ie("peekViewTitle.background", { dark: "#252526", light: "#F3F3F3", hcDark: De.black, hcLight: De.white }, S(1308, "Background color of the peek view title area.")), WBe = ie("peekViewTitleLabel.foreground", { dark: De.white, light: De.black, hcDark: De.white, hcLight: kb }, S(1309, "Color of the peek view title.")), VBe = ie("peekViewTitleDescription.foreground", { dark: "#ccccccb3", light: "#616161", hcDark: "#FFFFFF99", hcLight: "#292929" }, S(1310, "Color of the peek view title info.")), K1t = ie("peekView.border", { dark: gb, light: gb, hcDark: hi, hcLight: hi }, S(1311, "Color of the peek view borders and arrow.")), Y1t = ie("peekViewResult.background", { dark: "#252526", light: "#F3F3F3", hcDark: De.black, hcLight: De.white }, S(1312, "Background color of the peek view result list."));
ie("peekViewResult.lineForeground", { dark: "#bbbbbb", light: "#646465", hcDark: De.white, hcLight: kb }, S(1313, "Foreground color for line nodes in the peek view result list."));
ie("peekViewResult.fileForeground", { dark: De.white, light: "#1E1E1E", hcDark: De.white, hcLight: kb }, S(1314, "Foreground color for file nodes in the peek view result list."));
ie("peekViewResult.selectionBackground", { dark: "#3399ff33", light: "#3399ff33", hcDark: null, hcLight: null }, S(1315, "Background color of the selected entry in the peek view result list."));
ie("peekViewResult.selectionForeground", { dark: De.white, light: "#6C6C6C", hcDark: De.white, hcLight: kb }, S(1316, "Foreground color of the selected entry in the peek view result list."));
const epe = ie("peekViewEditor.background", { dark: "#001F33", light: "#F2F8FC", hcDark: De.black, hcLight: De.white }, S(1317, "Background color of the peek view editor."));
ie("peekViewEditorGutter.background", epe, S(1318, "Background color of the gutter in the peek view editor."));
ie("peekViewEditorStickyScroll.background", epe, S(1319, "Background color of sticky scroll in the peek view editor."));
ie("peekViewEditorStickyScrollGutter.background", epe, S(1320, "Background color of the gutter part of sticky scroll in the peek view editor."));
ie("peekViewResult.matchHighlightBackground", { dark: "#ea5c004d", light: "#ea5c004d", hcDark: null, hcLight: null }, S(1321, "Match highlight color in the peek view result list."));
ie("peekViewEditor.matchHighlightBackground", { dark: "#ff8f0099", light: "#f5d802de", hcDark: null, hcLight: null }, S(1322, "Match highlight color in the peek view editor."));
ie("peekViewEditor.matchHighlightBorder", { dark: null, light: null, hcDark: fs, hcLight: fs }, S(1323, "Match highlight border in the peek view editor."));
class X1t {
  get templateId() {
    return this.renderer.templateId;
  }
  constructor(e, t) {
    this.renderer = e, this.modelProvider = t;
  }
  renderTemplate(e) {
    return { data: this.renderer.renderTemplate(e), disposable: ge.None };
  }
  renderElement(e, t, n, r) {
    var l;
    if ((l = n.disposable) == null || l.dispose(), !n.data)
      return;
    const s = this.modelProvider();
    if (s.isResolved(e))
      return this.renderer.renderElement(s.get(e), e, n.data, r);
    const o = new Ss(), a = s.resolve(e, o.token);
    n.disposable = { dispose: () => o.cancel() }, this.renderer.renderPlaceholder(e, n.data), a.then((c) => this.renderer.renderElement(c, e, n.data, r));
  }
  disposeTemplate(e) {
    e.disposable && (e.disposable.dispose(), e.disposable = void 0), e.data && (this.renderer.disposeTemplate(e.data), e.data = void 0);
  }
}
class Z1t {
  constructor(e, t) {
    this.modelProvider = e, this.accessibilityProvider = t;
  }
  getWidgetAriaLabel() {
    return this.accessibilityProvider.getWidgetAriaLabel();
  }
  getAriaLabel(e) {
    const t = this.modelProvider();
    return t.isResolved(e) ? this.accessibilityProvider.getAriaLabel(t.get(e)) : null;
  }
}
function Q1t(i, e) {
  return {
    ...e,
    accessibilityProvider: e.accessibilityProvider && new Z1t(i, e.accessibilityProvider)
  };
}
class J1t {
  constructor(e, t, n, r, s = {}) {
    const o = () => this.model, a = r.map((l) => new X1t(l, o));
    this.list = new Zh(e, t, n, a, Q1t(o, s));
  }
  updateOptions(e) {
    this.list.updateOptions(e);
  }
  getHTMLElement() {
    return this.list.getHTMLElement();
  }
  get onDidFocus() {
    return this.list.onDidFocus;
  }
  get widget() {
    return this.list;
  }
  get onDidDispose() {
    return this.list.onDidDispose;
  }
  get onMouseDblClick() {
    return Ze.map(this.list.onMouseDblClick, ({ element: e, index: t, browserEvent: n }) => ({ element: e === void 0 ? void 0 : this._model.get(e), index: t, browserEvent: n }));
  }
  get onPointer() {
    return Ze.map(this.list.onPointer, ({ element: e, index: t, browserEvent: n }) => ({ element: e === void 0 ? void 0 : this._model.get(e), index: t, browserEvent: n }));
  }
  get onDidChangeSelection() {
    return Ze.map(this.list.onDidChangeSelection, ({ elements: e, indexes: t, browserEvent: n }) => ({ elements: e.map((r) => this._model.get(r)), indexes: t, browserEvent: n }));
  }
  get model() {
    return this._model;
  }
  set model(e) {
    this._model = e, this.list.splice(0, this.list.length, Hu(e.length));
  }
  getFocus() {
    return this.list.getFocus();
  }
  getSelection() {
    return this.list.getSelection();
  }
  getSelectedElements() {
    return this.getSelection().map((e) => this.model.get(e));
  }
  style(e) {
    this.list.style(e);
  }
  dispose() {
    this.list.dispose();
  }
}
const ewt = {
  separatorBorder: De.transparent
};
class UBe {
  set size(e) {
    this._size = e;
  }
  get size() {
    return this._size;
  }
  get visible() {
    return typeof this._cachedVisibleSize > "u";
  }
  setVisible(e, t) {
    var n, r;
    if (e !== this.visible) {
      e ? (this.size = Jc(this._cachedVisibleSize, this.viewMinimumSize, this.viewMaximumSize), this._cachedVisibleSize = void 0) : (this._cachedVisibleSize = typeof t == "number" ? t : this.size, this.size = 0), this.container.classList.toggle("visible", e);
      try {
        (r = (n = this.view).setVisible) == null || r.call(n, e);
      } catch (s) {
        console.error("Splitview: Failed to set visible view"), console.error(s);
      }
    }
  }
  get minimumSize() {
    return this.visible ? this.view.minimumSize : 0;
  }
  get viewMinimumSize() {
    return this.view.minimumSize;
  }
  get maximumSize() {
    return this.visible ? this.view.maximumSize : 0;
  }
  get viewMaximumSize() {
    return this.view.maximumSize;
  }
  get priority() {
    return this.view.priority;
  }
  get proportionalLayout() {
    return this.view.proportionalLayout ?? !0;
  }
  get snap() {
    return !!this.view.snap;
  }
  set enabled(e) {
    this.container.style.pointerEvents = e ? "" : "none";
  }
  constructor(e, t, n, r) {
    this.container = e, this.view = t, this.disposable = r, this._cachedVisibleSize = void 0, typeof n == "number" ? (this._size = n, this._cachedVisibleSize = void 0, e.classList.add("visible")) : (this._size = 0, this._cachedVisibleSize = n.cachedVisibleSize);
  }
  layout(e, t) {
    this.layoutContainer(e);
    try {
      this.view.layout(this.size, e, t);
    } catch (n) {
      console.error("Splitview: Failed to layout view"), console.error(n);
    }
  }
  dispose() {
    this.disposable.dispose();
  }
}
class twt extends UBe {
  layoutContainer(e) {
    this.container.style.top = `${e}px`, this.container.style.height = `${this.size}px`;
  }
}
class nwt extends UBe {
  layoutContainer(e) {
    this.container.style.left = `${e}px`, this.container.style.width = `${this.size}px`;
  }
}
var Zv;
(function(i) {
  i[i.Idle = 0] = "Idle", i[i.Busy = 1] = "Busy";
})(Zv || (Zv = {}));
var dz;
(function(i) {
  i.Distribute = { type: "distribute" };
  function e(r) {
    return { type: "split", index: r };
  }
  i.Split = e;
  function t(r) {
    return { type: "auto", index: r };
  }
  i.Auto = t;
  function n(r) {
    return { type: "invisible", cachedVisibleSize: r };
  }
  i.Invisible = n;
})(dz || (dz = {}));
class zBe extends ge {
  get orthogonalStartSash() {
    return this._orthogonalStartSash;
  }
  get orthogonalEndSash() {
    return this._orthogonalEndSash;
  }
  get startSnappingEnabled() {
    return this._startSnappingEnabled;
  }
  get endSnappingEnabled() {
    return this._endSnappingEnabled;
  }
  /**
   * A reference to a sash, perpendicular to all sashes in this {@link SplitView},
   * located at the left- or top-most side of the SplitView.
   * Corner sashes will be created automatically at the intersections.
   */
  set orthogonalStartSash(e) {
    for (const t of this.sashItems)
      t.sash.orthogonalStartSash = e;
    this._orthogonalStartSash = e;
  }
  /**
   * A reference to a sash, perpendicular to all sashes in this {@link SplitView},
   * located at the right- or bottom-most side of the SplitView.
   * Corner sashes will be created automatically at the intersections.
   */
  set orthogonalEndSash(e) {
    for (const t of this.sashItems)
      t.sash.orthogonalEndSash = e;
    this._orthogonalEndSash = e;
  }
  /**
   * Enable/disable snapping at the beginning of this {@link SplitView}.
   */
  set startSnappingEnabled(e) {
    this._startSnappingEnabled !== e && (this._startSnappingEnabled = e, this.updateSashEnablement());
  }
  /**
   * Enable/disable snapping at the end of this {@link SplitView}.
   */
  set endSnappingEnabled(e) {
    this._endSnappingEnabled !== e && (this._endSnappingEnabled = e, this.updateSashEnablement());
  }
  /**
   * Create a new {@link SplitView} instance.
   */
  constructor(e, t = {}) {
    super(), this.size = 0, this._contentSize = 0, this.proportions = void 0, this.viewItems = [], this.sashItems = [], this.state = Zv.Idle, this._onDidSashChange = this._register(new he()), this._onDidSashReset = this._register(new he()), this._startSnappingEnabled = !0, this._endSnappingEnabled = !0, this.onDidSashChange = this._onDidSashChange.event, this.onDidSashReset = this._onDidSashReset.event, this.orientation = t.orientation ?? 0, this.inverseAltBehavior = t.inverseAltBehavior ?? !1, this.proportionalLayout = t.proportionalLayout ?? !0, this.getSashOrthogonalSize = t.getSashOrthogonalSize, this.el = document.createElement("div"), this.el.classList.add("monaco-split-view2"), this.el.classList.add(this.orientation === 0 ? "vertical" : "horizontal"), e.appendChild(this.el), this.sashContainer = Fe(this.el, Ge(".sash-container")), this.viewContainer = Ge(".split-view-container"), this.scrollable = this._register(new n2({
      forceIntegerValues: !0,
      smoothScrollDuration: 125,
      scheduleAtNextAnimationFrame: (r) => Ju(At(this.el), r)
    })), this.scrollableElement = this._register(new eK(this.viewContainer, {
      vertical: this.orientation === 0 ? t.scrollbarVisibility ?? 1 : 2,
      horizontal: this.orientation === 1 ? t.scrollbarVisibility ?? 1 : 2
      /* ScrollbarVisibility.Hidden */
    }, this.scrollable));
    const n = this._register(new ir(this.viewContainer, "scroll")).event;
    this._register(n((r) => {
      const s = this.scrollableElement.getScrollPosition(), o = Math.abs(this.viewContainer.scrollLeft - s.scrollLeft) <= 1 ? void 0 : this.viewContainer.scrollLeft, a = Math.abs(this.viewContainer.scrollTop - s.scrollTop) <= 1 ? void 0 : this.viewContainer.scrollTop;
      (o !== void 0 || a !== void 0) && this.scrollableElement.setScrollPosition({ scrollLeft: o, scrollTop: a });
    })), this.onDidScroll = this.scrollableElement.onScroll, this._register(this.onDidScroll((r) => {
      r.scrollTopChanged && (this.viewContainer.scrollTop = r.scrollTop), r.scrollLeftChanged && (this.viewContainer.scrollLeft = r.scrollLeft);
    })), Fe(this.el, this.scrollableElement.getDomNode()), this.style(t.styles || ewt), t.descriptor && (this.size = t.descriptor.size, t.descriptor.views.forEach((r, s) => {
      const o = Ec(r.visible) || r.visible ? r.size : { type: "invisible", cachedVisibleSize: r.size }, a = r.view;
      this.doAddView(a, o, s, !0);
    }), this._contentSize = this.viewItems.reduce((r, s) => r + s.size, 0), this.saveProportions());
  }
  style(e) {
    e.separatorBorder.isTransparent() ? (this.el.classList.remove("separator-border"), this.el.style.removeProperty("--separator-border")) : (this.el.classList.add("separator-border"), this.el.style.setProperty("--separator-border", e.separatorBorder.toString()));
  }
  /**
   * Add a {@link IView view} to this {@link SplitView}.
   *
   * @param view The view to add.
   * @param size Either a fixed size, or a dynamic {@link Sizing} strategy.
   * @param index The index to insert the view on.
   * @param skipLayout Whether layout should be skipped.
   */
  addView(e, t, n = this.viewItems.length, r) {
    this.doAddView(e, t, n, r);
  }
  /**
   * Layout the {@link SplitView}.
   *
   * @param size The entire size of the {@link SplitView}.
   * @param layoutContext An optional layout context to pass along to {@link IView views}.
   */
  layout(e, t) {
    const n = Math.max(this.size, this._contentSize);
    if (this.size = e, this.layoutContext = t, this.proportions) {
      let r = 0;
      for (let s = 0; s < this.viewItems.length; s++) {
        const o = this.viewItems[s], a = this.proportions[s];
        typeof a == "number" ? r += a : e -= o.size;
      }
      for (let s = 0; s < this.viewItems.length; s++) {
        const o = this.viewItems[s], a = this.proportions[s];
        typeof a == "number" && r > 0 && (o.size = Jc(Math.round(a * e / r), o.minimumSize, o.maximumSize));
      }
    } else {
      const r = Hu(this.viewItems.length), s = r.filter(
        (a) => this.viewItems[a].priority === 1
        /* LayoutPriority.Low */
      ), o = r.filter(
        (a) => this.viewItems[a].priority === 2
        /* LayoutPriority.High */
      );
      this.resize(this.viewItems.length - 1, e - n, void 0, s, o);
    }
    this.distributeEmptySpace(), this.layoutViews();
  }
  saveProportions() {
    this.proportionalLayout && this._contentSize > 0 && (this.proportions = this.viewItems.map((e) => e.proportionalLayout && e.visible ? e.size / this._contentSize : void 0));
  }
  onSashStart({ sash: e, start: t, alt: n }) {
    for (const a of this.viewItems)
      a.enabled = !1;
    const r = this.sashItems.findIndex((a) => a.sash === e), s = Vg(Ce(this.el.ownerDocument.body, "keydown", (a) => o(this.sashDragState.current, a.altKey)), Ce(this.el.ownerDocument.body, "keyup", () => o(this.sashDragState.current, !1))), o = (a, l) => {
      const c = this.viewItems.map((m) => m.size);
      let u = Number.NEGATIVE_INFINITY, d = Number.POSITIVE_INFINITY;
      if (this.inverseAltBehavior && (l = !l), l)
        if (r === this.sashItems.length - 1) {
          const _ = this.viewItems[r];
          u = (_.minimumSize - _.size) / 2, d = (_.maximumSize - _.size) / 2;
        } else {
          const _ = this.viewItems[r + 1];
          u = (_.size - _.maximumSize) / 2, d = (_.size - _.minimumSize) / 2;
        }
      let h, g;
      if (!l) {
        const m = Hu(r, -1), _ = Hu(r + 1, this.viewItems.length), v = m.reduce((M, B) => M + (this.viewItems[B].minimumSize - c[B]), 0), w = m.reduce((M, B) => M + (this.viewItems[B].viewMaximumSize - c[B]), 0), E = _.length === 0 ? Number.POSITIVE_INFINITY : _.reduce((M, B) => M + (c[B] - this.viewItems[B].minimumSize), 0), L = _.length === 0 ? Number.NEGATIVE_INFINITY : _.reduce((M, B) => M + (c[B] - this.viewItems[B].viewMaximumSize), 0), T = Math.max(v, L), D = Math.min(E, w), N = this.findFirstSnapIndex(m), R = this.findFirstSnapIndex(_);
        if (typeof N == "number") {
          const M = this.viewItems[N], B = Math.floor(M.viewMinimumSize / 2);
          h = {
            index: N,
            limitDelta: M.visible ? T - B : T + B,
            size: M.size
          };
        }
        if (typeof R == "number") {
          const M = this.viewItems[R], B = Math.floor(M.viewMinimumSize / 2);
          g = {
            index: R,
            limitDelta: M.visible ? D + B : D - B,
            size: M.size
          };
        }
      }
      this.sashDragState = { start: a, current: a, index: r, sizes: c, minDelta: u, maxDelta: d, alt: l, snapBefore: h, snapAfter: g, disposable: s };
    };
    o(t, n);
  }
  onSashChange({ current: e }) {
    const { index: t, start: n, sizes: r, alt: s, minDelta: o, maxDelta: a, snapBefore: l, snapAfter: c } = this.sashDragState;
    this.sashDragState.current = e;
    const u = e - n, d = this.resize(t, u, r, void 0, void 0, o, a, l, c);
    if (s) {
      const h = t === this.sashItems.length - 1, g = this.viewItems.map((L) => L.size), m = h ? t : t + 1, _ = this.viewItems[m], v = _.size - _.maximumSize, w = _.size - _.minimumSize, E = h ? t - 1 : t + 1;
      this.resize(E, -d, g, void 0, void 0, v, w);
    }
    this.distributeEmptySpace(), this.layoutViews();
  }
  onSashEnd(e) {
    this._onDidSashChange.fire(e), this.sashDragState.disposable.dispose(), this.saveProportions();
    for (const t of this.viewItems)
      t.enabled = !0;
  }
  onViewChange(e, t) {
    const n = this.viewItems.indexOf(e);
    n < 0 || n >= this.viewItems.length || (t = typeof t == "number" ? t : e.size, t = Jc(t, e.minimumSize, e.maximumSize), this.inverseAltBehavior && n > 0 ? (this.resize(n - 1, Math.floor((e.size - t) / 2)), this.distributeEmptySpace(), this.layoutViews()) : (e.size = t, this.relayout([n], void 0)));
  }
  /**
   * Resize a {@link IView view} within the {@link SplitView}.
   *
   * @param index The {@link IView view} index.
   * @param size The {@link IView view} size.
   */
  resizeView(e, t) {
    if (!(e < 0 || e >= this.viewItems.length)) {
      if (this.state !== Zv.Idle)
        throw new Error("Cant modify splitview");
      this.state = Zv.Busy;
      try {
        const n = Hu(this.viewItems.length).filter((a) => a !== e), r = [...n.filter(
          (a) => this.viewItems[a].priority === 1
          /* LayoutPriority.Low */
        ), e], s = n.filter(
          (a) => this.viewItems[a].priority === 2
          /* LayoutPriority.High */
        ), o = this.viewItems[e];
        t = Math.round(t), t = Jc(t, o.minimumSize, Math.min(o.maximumSize, this.size)), o.size = t, this.relayout(r, s);
      } finally {
        this.state = Zv.Idle;
      }
    }
  }
  /**
   * Distribute the entire {@link SplitView} size among all {@link IView views}.
   */
  distributeViewSizes() {
    const e = [];
    let t = 0;
    for (const a of this.viewItems)
      a.maximumSize - a.minimumSize > 0 && (e.push(a), t += a.size);
    const n = Math.floor(t / e.length);
    for (const a of e)
      a.size = Jc(n, a.minimumSize, a.maximumSize);
    const r = Hu(this.viewItems.length), s = r.filter(
      (a) => this.viewItems[a].priority === 1
      /* LayoutPriority.Low */
    ), o = r.filter(
      (a) => this.viewItems[a].priority === 2
      /* LayoutPriority.High */
    );
    this.relayout(s, o);
  }
  /**
   * Returns the size of a {@link IView view}.
   */
  getViewSize(e) {
    return e < 0 || e >= this.viewItems.length ? -1 : this.viewItems[e].size;
  }
  doAddView(e, t, n = this.viewItems.length, r) {
    if (this.state !== Zv.Idle)
      throw new Error("Cant modify splitview");
    this.state = Zv.Busy;
    try {
      const s = Ge(".split-view-view");
      n === this.viewItems.length ? this.viewContainer.appendChild(s) : this.viewContainer.insertBefore(s, this.viewContainer.children.item(n));
      const o = e.onDidChange((h) => this.onViewChange(u, h)), a = Et(() => s.remove()), l = Vg(o, a);
      let c;
      typeof t == "number" ? c = t : (t.type === "auto" && (this.areViewsDistributed() ? t = { type: "distribute" } : t = { type: "split", index: t.index }), t.type === "split" ? c = this.getViewSize(t.index) / 2 : t.type === "invisible" ? c = { cachedVisibleSize: t.cachedVisibleSize } : c = e.minimumSize);
      const u = this.orientation === 0 ? new twt(s, e, c, l) : new nwt(s, e, c, l);
      if (this.viewItems.splice(n, 0, u), this.viewItems.length > 1) {
        const h = { orthogonalStartSash: this.orthogonalStartSash, orthogonalEndSash: this.orthogonalEndSash }, g = this.orientation === 0 ? new zl(this.sashContainer, { getHorizontalSashTop: (M) => this.getSashPosition(M), getHorizontalSashWidth: this.getSashOrthogonalSize }, {
          ...h,
          orientation: 1
          /* Orientation.HORIZONTAL */
        }) : new zl(this.sashContainer, { getVerticalSashLeft: (M) => this.getSashPosition(M), getVerticalSashHeight: this.getSashOrthogonalSize }, {
          ...h,
          orientation: 0
          /* Orientation.VERTICAL */
        }), m = this.orientation === 0 ? (M) => ({ sash: g, start: M.startY, current: M.currentY, alt: M.altKey }) : (M) => ({ sash: g, start: M.startX, current: M.currentX, alt: M.altKey }), v = Ze.map(g.onDidStart, m)(this.onSashStart, this), E = Ze.map(g.onDidChange, m)(this.onSashChange, this), T = Ze.map(g.onDidEnd, () => this.sashItems.findIndex((M) => M.sash === g))(this.onSashEnd, this), D = g.onDidReset(() => {
          const M = this.sashItems.findIndex((X) => X.sash === g), B = Hu(M, -1), H = Hu(M + 1, this.viewItems.length), j = this.findFirstSnapIndex(B), K = this.findFirstSnapIndex(H);
          typeof j == "number" && !this.viewItems[j].visible || typeof K == "number" && !this.viewItems[K].visible || this._onDidSashReset.fire(M);
        }), N = Vg(v, E, T, D, g), R = { sash: g, disposable: N };
        this.sashItems.splice(n - 1, 0, R);
      }
      s.appendChild(e.element);
      let d;
      typeof t != "number" && t.type === "split" && (d = [t.index]), r || this.relayout([n], d), !r && typeof t != "number" && t.type === "distribute" && this.distributeViewSizes();
    } finally {
      this.state = Zv.Idle;
    }
  }
  relayout(e, t) {
    const n = this.viewItems.reduce((r, s) => r + s.size, 0);
    this.resize(this.viewItems.length - 1, this.size - n, void 0, e, t), this.distributeEmptySpace(), this.layoutViews(), this.saveProportions();
  }
  resize(e, t, n = this.viewItems.map((u) => u.size), r, s, o = Number.NEGATIVE_INFINITY, a = Number.POSITIVE_INFINITY, l, c) {
    if (e < 0 || e >= this.viewItems.length)
      return 0;
    const u = Hu(e, -1), d = Hu(e + 1, this.viewItems.length);
    if (s)
      for (const R of s)
        FJ(u, R), FJ(d, R);
    if (r)
      for (const R of r)
        I7(u, R), I7(d, R);
    const h = u.map((R) => this.viewItems[R]), g = u.map((R) => n[R]), m = d.map((R) => this.viewItems[R]), _ = d.map((R) => n[R]), v = u.reduce((R, M) => R + (this.viewItems[M].minimumSize - n[M]), 0), w = u.reduce((R, M) => R + (this.viewItems[M].maximumSize - n[M]), 0), E = d.length === 0 ? Number.POSITIVE_INFINITY : d.reduce((R, M) => R + (n[M] - this.viewItems[M].minimumSize), 0), L = d.length === 0 ? Number.NEGATIVE_INFINITY : d.reduce((R, M) => R + (n[M] - this.viewItems[M].maximumSize), 0), T = Math.max(v, L, o), D = Math.min(E, w, a);
    let N = !1;
    if (l) {
      const R = this.viewItems[l.index], M = t >= l.limitDelta;
      N = M !== R.visible, R.setVisible(M, l.size);
    }
    if (!N && c) {
      const R = this.viewItems[c.index], M = t < c.limitDelta;
      N = M !== R.visible, R.setVisible(M, c.size);
    }
    if (N)
      return this.resize(e, t, n, r, s, o, a);
    t = Jc(t, T, D);
    for (let R = 0, M = t; R < h.length; R++) {
      const B = h[R], H = Jc(g[R] + M, B.minimumSize, B.maximumSize), j = H - g[R];
      M -= j, B.size = H;
    }
    for (let R = 0, M = t; R < m.length; R++) {
      const B = m[R], H = Jc(_[R] - M, B.minimumSize, B.maximumSize), j = H - _[R];
      M += j, B.size = H;
    }
    return t;
  }
  distributeEmptySpace(e) {
    const t = this.viewItems.reduce((a, l) => a + l.size, 0);
    let n = this.size - t;
    const r = Hu(this.viewItems.length - 1, -1), s = r.filter(
      (a) => this.viewItems[a].priority === 1
      /* LayoutPriority.Low */
    ), o = r.filter(
      (a) => this.viewItems[a].priority === 2
      /* LayoutPriority.High */
    );
    for (const a of o)
      FJ(r, a);
    for (const a of s)
      I7(r, a);
    typeof e == "number" && I7(r, e);
    for (let a = 0; n !== 0 && a < r.length; a++) {
      const l = this.viewItems[r[a]], c = Jc(l.size + n, l.minimumSize, l.maximumSize), u = c - l.size;
      n -= u, l.size = c;
    }
  }
  layoutViews() {
    this._contentSize = this.viewItems.reduce((t, n) => t + n.size, 0);
    let e = 0;
    for (const t of this.viewItems)
      t.layout(e, this.layoutContext), e += t.size;
    this.sashItems.forEach((t) => t.sash.layout()), this.updateSashEnablement(), this.updateScrollableElement();
  }
  updateScrollableElement() {
    this.orientation === 0 ? this.scrollableElement.setScrollDimensions({
      height: this.size,
      scrollHeight: this._contentSize
    }) : this.scrollableElement.setScrollDimensions({
      width: this.size,
      scrollWidth: this._contentSize
    });
  }
  updateSashEnablement() {
    let e = !1;
    const t = this.viewItems.map((l) => e = l.size - l.minimumSize > 0 || e);
    e = !1;
    const n = this.viewItems.map((l) => e = l.maximumSize - l.size > 0 || e), r = [...this.viewItems].reverse();
    e = !1;
    const s = r.map((l) => e = l.size - l.minimumSize > 0 || e).reverse();
    e = !1;
    const o = r.map((l) => e = l.maximumSize - l.size > 0 || e).reverse();
    let a = 0;
    for (let l = 0; l < this.sashItems.length; l++) {
      const { sash: c } = this.sashItems[l], u = this.viewItems[l];
      a += u.size;
      const d = !(t[l] && o[l + 1]), h = !(n[l] && s[l + 1]);
      if (d && h) {
        const g = Hu(l, -1), m = Hu(l + 1, this.viewItems.length), _ = this.findFirstSnapIndex(g), v = this.findFirstSnapIndex(m), w = typeof _ == "number" && !this.viewItems[_].visible, E = typeof v == "number" && !this.viewItems[v].visible;
        w && s[l] && (a > 0 || this.startSnappingEnabled) ? c.state = 1 : E && t[l] && (a < this._contentSize || this.endSnappingEnabled) ? c.state = 2 : c.state = 0;
      } else d && !h ? c.state = 1 : !d && h ? c.state = 2 : c.state = 3;
    }
  }
  getSashPosition(e) {
    let t = 0;
    for (let n = 0; n < this.sashItems.length; n++)
      if (t += this.viewItems[n].size, this.sashItems[n].sash === e)
        return t;
    return 0;
  }
  findFirstSnapIndex(e) {
    for (const t of e) {
      const n = this.viewItems[t];
      if (n.visible && n.snap)
        return t;
    }
    for (const t of e) {
      const n = this.viewItems[t];
      if (n.visible && n.maximumSize - n.minimumSize > 0)
        return;
      if (!n.visible && n.snap)
        return t;
    }
  }
  areViewsDistributed() {
    let e, t;
    for (const n of this.viewItems)
      if (e = e === void 0 ? n.size : Math.min(e, n.size), t = t === void 0 ? n.size : Math.max(t, n.size), t - e > 2)
        return !1;
    return !0;
  }
  dispose() {
    var e;
    (e = this.sashDragState) == null || e.disposable.dispose(), or(this.viewItems), this.viewItems = [], this.sashItems.forEach((t) => t.disposable.dispose()), this.sashItems = [], super.dispose();
  }
}
const uG = class uG {
  constructor(e, t, n) {
    this.columns = e, this.getColumnSize = n, this.templateId = uG.TemplateId, this.renderedTemplates = /* @__PURE__ */ new Set();
    const r = new Map(t.map((s) => [s.templateId, s]));
    this.renderers = [];
    for (const s of e) {
      const o = r.get(s.templateId);
      if (!o)
        throw new Error(`Table cell renderer for template id ${s.templateId} not found.`);
      this.renderers.push(o);
    }
  }
  renderTemplate(e) {
    const t = Fe(e, Ge(".monaco-table-tr")), n = [], r = [];
    for (let o = 0; o < this.columns.length; o++) {
      const a = this.renderers[o], l = Fe(t, Ge(".monaco-table-td", { "data-col-index": o }));
      l.style.width = `${this.getColumnSize(o)}px`, n.push(l), r.push(a.renderTemplate(l));
    }
    const s = { container: e, cellContainers: n, cellTemplateData: r };
    return this.renderedTemplates.add(s), s;
  }
  renderElement(e, t, n, r) {
    for (let s = 0; s < this.columns.length; s++) {
      const a = this.columns[s].project(e);
      this.renderers[s].renderElement(a, t, n.cellTemplateData[s], r);
    }
  }
  disposeElement(e, t, n, r) {
    for (let s = 0; s < this.columns.length; s++) {
      const o = this.renderers[s];
      if (o.disposeElement) {
        const l = this.columns[s].project(e);
        o.disposeElement(l, t, n.cellTemplateData[s], r);
      }
    }
  }
  disposeTemplate(e) {
    for (let t = 0; t < this.columns.length; t++)
      this.renderers[t].disposeTemplate(e.cellTemplateData[t]);
    Xa(e.container), this.renderedTemplates.delete(e);
  }
  layoutColumn(e, t) {
    for (const { cellContainers: n } of this.renderedTemplates)
      n[e].style.width = `${t}px`;
  }
};
uG.TemplateId = "row";
let hz = uG;
function iwt(i) {
  return {
    getHeight(e) {
      return i.getHeight(e);
    },
    getTemplateId() {
      return hz.TemplateId;
    }
  };
}
class rwt extends ge {
  get minimumSize() {
    return this.column.minimumWidth ?? 120;
  }
  get maximumSize() {
    return this.column.maximumWidth ?? Number.POSITIVE_INFINITY;
  }
  get onDidChange() {
    return this.column.onDidChangeWidthConstraints ?? Ze.None;
  }
  constructor(e, t) {
    super(), this.column = e, this.index = t, this._onDidLayout = new he(), this.onDidLayout = this._onDidLayout.event, this.element = Ge(".monaco-table-th", { "data-col-index": t }, e.label), e.tooltip && this._register(Jg().setupManagedHover(rd("mouse"), this.element, e.tooltip));
  }
  layout(e) {
    this._onDidLayout.fire([this.index, e]);
  }
}
const dG = class dG {
  get onDidChangeFocus() {
    return this.list.onDidChangeFocus;
  }
  get onDidChangeSelection() {
    return this.list.onDidChangeSelection;
  }
  get onDidScroll() {
    return this.list.onDidScroll;
  }
  get onMouseDblClick() {
    return this.list.onMouseDblClick;
  }
  get onPointer() {
    return this.list.onPointer;
  }
  get onDidFocus() {
    return this.list.onDidFocus;
  }
  get scrollTop() {
    return this.list.scrollTop;
  }
  set scrollTop(e) {
    this.list.scrollTop = e;
  }
  get scrollHeight() {
    return this.list.scrollHeight;
  }
  get renderHeight() {
    return this.list.renderHeight;
  }
  get onDidDispose() {
    return this.list.onDidDispose;
  }
  constructor(e, t, n, r, s, o) {
    this.virtualDelegate = n, this.columns = r, this.domId = `table_id_${++dG.InstanceCount}`, this.disposables = new ke(), this.cachedWidth = 0, this.cachedHeight = 0, this.domNode = Fe(t, Ge(`.monaco-table.${this.domId}`));
    const a = r.map((u, d) => this.disposables.add(new rwt(u, d))), l = {
      size: a.reduce((u, d) => u + d.column.weight, 0),
      views: a.map((u) => ({ size: u.column.weight, view: u }))
    };
    this.splitview = this.disposables.add(new zBe(this.domNode, {
      orientation: 1,
      scrollbarVisibility: 2,
      getSashOrthogonalSize: () => this.cachedHeight,
      descriptor: l
    })), this.splitview.el.style.height = `${n.headerRowHeight}px`, this.splitview.el.style.lineHeight = `${n.headerRowHeight}px`;
    const c = new hz(r, s, (u) => this.splitview.getViewSize(u));
    this.list = this.disposables.add(new Zh(e, this.domNode, iwt(n), [c], o)), Ze.any(...a.map((u) => u.onDidLayout))(([u, d]) => c.layoutColumn(u, d), null, this.disposables), this.splitview.onDidSashReset((u) => {
      const d = r.reduce((g, m) => g + m.weight, 0), h = r[u].weight / d * this.cachedWidth;
      this.splitview.resizeView(u, h);
    }, null, this.disposables), this.styleElement = Zf(this.domNode), this.style(zbt);
  }
  updateOptions(e) {
    this.list.updateOptions(e);
  }
  splice(e, t, n = []) {
    this.list.splice(e, t, n);
  }
  getHTMLElement() {
    return this.domNode;
  }
  style(e) {
    const t = [];
    t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {
			top: ${this.virtualDelegate.headerRowHeight + 1}px;
			height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
		}`), this.styleElement.textContent = t.join(`
`), this.list.style(e);
  }
  getSelectedElements() {
    return this.list.getSelectedElements();
  }
  getSelection() {
    return this.list.getSelection();
  }
  getFocus() {
    return this.list.getFocus();
  }
  dispose() {
    this.disposables.dispose();
  }
};
dG.InstanceCount = 0;
let noe = dG;
const $Be = {
  inputActiveOptionBorder: "#007ACC00",
  inputActiveOptionForeground: "#FFFFFF",
  inputActiveOptionBackground: "#0E639C50"
};
class kw extends Xd {
  get onChange() {
    return this._onChange.event;
  }
  get onKeyDown() {
    return this._onKeyDown.event;
  }
  constructor(e) {
    super(), this._onChange = this._register(new he()), this._onKeyDown = this._register(new he()), this._opts = e, this._checked = this._opts.isChecked;
    const t = ["monaco-custom-toggle"];
    this._opts.icon && (this._icon = this._opts.icon, t.push(...qt.asClassNameArray(this._icon))), this._opts.actionClassName && t.push(...this._opts.actionClassName.split(" ")), this._checked && t.push("checked"), this.domNode = document.createElement("div"), this._hover = this._register(Jg().setupManagedHover(e.hoverDelegate ?? rd("mouse"), this.domNode, this._opts.title)), this.domNode.classList.add(...t), this._opts.notFocusable || (this.domNode.tabIndex = 0), this.domNode.setAttribute("role", "checkbox"), this.domNode.setAttribute("aria-checked", String(this._checked)), this.domNode.setAttribute("aria-label", this._opts.title), this.applyStyles(), this.onclick(this.domNode, (n) => {
      this.enabled && (this.checked = !this._checked, this._onChange.fire(!1), n.preventDefault());
    }), this._register(this.ignoreGesture(this.domNode)), this.onkeydown(this.domNode, (n) => {
      if (this.enabled) {
        if (n.keyCode === 10 || n.keyCode === 3) {
          this.checked = !this._checked, this._onChange.fire(!0), n.preventDefault(), n.stopPropagation();
          return;
        }
        this._onKeyDown.fire(n);
      }
    });
  }
  get enabled() {
    return this.domNode.getAttribute("aria-disabled") !== "true";
  }
  focus() {
    this.domNode.focus();
  }
  get checked() {
    return this._checked;
  }
  set checked(e) {
    this._checked = e, this.domNode.setAttribute("aria-checked", String(this._checked)), this.domNode.classList.toggle("checked", this._checked), this.applyStyles();
  }
  setIcon(e) {
    this._icon && this.domNode.classList.remove(...qt.asClassNameArray(this._icon)), this._icon = e, this._icon && this.domNode.classList.add(...qt.asClassNameArray(this._icon));
  }
  width() {
    return 22;
  }
  applyStyles() {
    this.domNode && (this.domNode.style.borderColor = this._checked && this._opts.inputActiveOptionBorder || "", this.domNode.style.color = this._checked && this._opts.inputActiveOptionForeground || "inherit", this.domNode.style.backgroundColor = this._checked && this._opts.inputActiveOptionBackground || "");
  }
  enable() {
    this.domNode.setAttribute("aria-disabled", String(!1)), this.domNode.classList.remove("disabled");
  }
  disable() {
    this.domNode.setAttribute("aria-disabled", String(!0)), this.domNode.classList.add("disabled");
  }
  setTitle(e) {
    this._hover.update(e), this.domNode.setAttribute("aria-label", e);
  }
}
const ZCe = class ZCe extends Xd {
  constructor(e, t, n) {
    super(), this.checkbox = e, this.domNode = t, this.styles = n, this._onChange = this._register(new he()), this.onChange = this._onChange.event, this.applyStyles();
  }
  get enabled() {
    return this.checkbox.enabled;
  }
  enable() {
    this.checkbox.enable(), this.applyStyles(!0);
  }
  disable() {
    this.checkbox.disable(), this.applyStyles(!1);
  }
  setTitle(e) {
    this.checkbox.setTitle(e);
  }
  applyStyles(e = this.enabled) {
    this.domNode.style.color = (e ? this.styles.checkboxForeground : this.styles.checkboxDisabledForeground) || "", this.domNode.style.backgroundColor = (e ? this.styles.checkboxBackground : this.styles.checkboxDisabledBackground) || "", this.domNode.style.borderColor = (e ? this.styles.checkboxBorder : this.styles.checkboxDisabledBackground) || "";
    const t = this.styles.size || 18;
    this.domNode.style.width = this.domNode.style.height = this.domNode.style.fontSize = `${t}px`, this.domNode.style.fontSize = `${t - 2}px`;
  }
};
ZCe.CLASS_NAME = "monaco-checkbox";
let r5 = ZCe;
class jBe extends r5 {
  constructor(e, t, n) {
    const r = new kw({ title: e, isChecked: t, icon: Pe.check, actionClassName: r5.CLASS_NAME, hoverDelegate: n.hoverDelegate, ...$Be });
    super(r, r.domNode, n), this._register(r), this._register(this.checkbox.onChange((s) => {
      this.applyStyles(), this._onChange.fire(s);
    }));
  }
  get checked() {
    return this.checkbox.checked;
  }
  set checked(e) {
    this.checkbox.checked = e, this.applyStyles();
  }
  applyStyles(e) {
    this.checkbox.checked ? this.checkbox.setIcon(Pe.check) : this.checkbox.setIcon(void 0), super.applyStyles(e);
  }
}
class GBe extends r5 {
  constructor(e, t, n) {
    let r;
    switch (t) {
      case !0:
        r = Pe.check;
        break;
      case "partial":
        r = Pe.dash;
        break;
      case !1:
        r = void 0;
        break;
    }
    const s = new kw({
      title: e,
      isChecked: t === !0,
      icon: r,
      actionClassName: jBe.CLASS_NAME,
      hoverDelegate: n.hoverDelegate,
      ...$Be
    });
    super(s, s.domNode, n), this._state = t, this._register(s), this._register(this.checkbox.onChange((o) => {
      this._state = this.checkbox.checked, this.applyStyles(), this._onChange.fire(o);
    }));
  }
  get checked() {
    return this._state;
  }
  set checked(e) {
    this._state !== e && (this._state = e, this.checkbox.checked = e === !0, this.applyStyles());
  }
  applyStyles(e) {
    switch (this._state) {
      case !0:
        this.checkbox.setIcon(Pe.check);
        break;
      case "partial":
        this.checkbox.setIcon(Pe.dash);
        break;
      case !1:
        this.checkbox.setIcon(void 0);
        break;
    }
    super.applyStyles(e);
  }
}
const swt = S(2, "Match Case"), owt = S(3, "Match Whole Word"), awt = S(4, "Use Regular Expression");
class qBe extends kw {
  constructor(e) {
    super({
      icon: Pe.caseSensitive,
      title: swt + e.appendTitle,
      isChecked: e.isChecked,
      hoverDelegate: e.hoverDelegate ?? rd("element"),
      inputActiveOptionBorder: e.inputActiveOptionBorder,
      inputActiveOptionForeground: e.inputActiveOptionForeground,
      inputActiveOptionBackground: e.inputActiveOptionBackground
    });
  }
}
class KBe extends kw {
  constructor(e) {
    super({
      icon: Pe.wholeWord,
      title: owt + e.appendTitle,
      isChecked: e.isChecked,
      hoverDelegate: e.hoverDelegate ?? rd("element"),
      inputActiveOptionBorder: e.inputActiveOptionBorder,
      inputActiveOptionForeground: e.inputActiveOptionForeground,
      inputActiveOptionBackground: e.inputActiveOptionBackground
    });
  }
}
class YBe extends kw {
  constructor(e) {
    super({
      icon: Pe.regex,
      title: awt + e.appendTitle,
      isChecked: e.isChecked,
      hoverDelegate: e.hoverDelegate ?? rd("element"),
      inputActiveOptionBorder: e.inputActiveOptionBorder,
      inputActiveOptionForeground: e.inputActiveOptionForeground,
      inputActiveOptionBackground: e.inputActiveOptionBackground
    });
  }
}
function lwt(i, e, t) {
  const n = t ?? document.createElement("div");
  return n.textContent = i, n;
}
function cwt(i, e, t) {
  const n = t ?? document.createElement("div");
  return n.textContent = "", XBe(n, dwt(i), e == null ? void 0 : e.actionHandler, e == null ? void 0 : e.renderCodeSegments), n;
}
class uwt {
  constructor(e) {
    this.source = e, this.index = 0;
  }
  eos() {
    return this.index >= this.source.length;
  }
  next() {
    const e = this.peek();
    return this.advance(), e;
  }
  peek() {
    return this.source[this.index];
  }
  advance() {
    this.index++;
  }
}
function XBe(i, e, t, n) {
  let r;
  if (e.type === 2)
    r = document.createTextNode(e.content || "");
  else if (e.type === 3)
    r = document.createElement("b");
  else if (e.type === 4)
    r = document.createElement("i");
  else if (e.type === 7 && n)
    r = document.createElement("code");
  else if (e.type === 5 && t) {
    const s = document.createElement("a");
    t.disposables.add(vo(s, "click", (o) => {
      t.callback(String(e.index), o);
    })), r = s;
  } else e.type === 8 ? r = document.createElement("br") : e.type === 1 && (r = i);
  r && i !== r && i.appendChild(r), r && Array.isArray(e.children) && e.children.forEach((s) => {
    XBe(r, s, t, n);
  });
}
function dwt(i, e) {
  const t = {
    type: 1,
    children: []
  };
  let n = 0, r = t;
  const s = [], o = new uwt(i);
  for (; !o.eos(); ) {
    let a = o.next();
    const l = a === "\\" && ioe(o.peek()) !== 0;
    if (l && (a = o.next()), !l && hwt(a) && a === o.peek()) {
      o.advance(), r.type === 2 && (r = s.pop());
      const c = ioe(a);
      if (r.type === c || r.type === 5 && c === 6)
        r = s.pop();
      else {
        const u = {
          type: c,
          children: []
        };
        c === 5 && (u.index = n, n++), r.children.push(u), s.push(r), r = u;
      }
    } else if (a === `
`)
      r.type === 2 && (r = s.pop()), r.children.push({
        type: 8
        /* FormatType.NewLine */
      });
    else if (r.type !== 2) {
      const c = {
        type: 2,
        content: a
      };
      r.children.push(c), s.push(r), r = c;
    } else
      r.content += a;
  }
  return r.type === 2 && (r = s.pop()), t;
}
function hwt(i, e) {
  return ioe(i) !== 0;
}
function ioe(i, e) {
  switch (i) {
    case "*":
      return 3;
    case "_":
      return 4;
    case "[":
      return 5;
    case "]":
      return 6;
    case "`":
      return 0;
    default:
      return 0;
  }
}
class fwt {
  constructor(e, t = 0, n = e.length, r = t - 1) {
    this.items = e, this.start = t, this.end = n, this.index = r;
  }
  current() {
    return this.index === this.start - 1 || this.index === this.end ? null : this.items[this.index];
  }
  next() {
    return this.index = Math.min(this.index + 1, this.end), this.current();
  }
  previous() {
    return this.index = Math.max(this.index - 1, this.start - 1), this.current();
  }
  first() {
    return this.index = this.start, this.current();
  }
  last() {
    return this.index = this.end - 1, this.current();
  }
}
class gwt {
  constructor(e = /* @__PURE__ */ new Set(), t = 10) {
    this._history = e, this._limit = t, this._onChange(), this._history.onDidChange && (this._disposable = this._history.onDidChange(() => this._onChange()));
  }
  getHistory() {
    return this._elements;
  }
  add(e) {
    this._history.delete(e), this._history.add(e), this._onChange();
  }
  next() {
    return this._navigator.next();
  }
  previous() {
    return this._currentPosition() !== 0 ? this._navigator.previous() : null;
  }
  current() {
    return this._navigator.current();
  }
  first() {
    return this._navigator.first();
  }
  last() {
    return this._navigator.last();
  }
  isLast() {
    return this._currentPosition() >= this._elements.length - 1;
  }
  isNowhere() {
    return this._navigator.current() === null;
  }
  has(e) {
    return this._history.has(e);
  }
  _onChange() {
    this._reduceToLimit();
    const e = this._elements;
    this._navigator = new fwt(e, 0, e.length, e.length);
  }
  _reduceToLimit() {
    const e = this._elements;
    if (e.length > this._limit) {
      const t = e.slice(e.length - this._limit);
      this._history.replace ? this._history.replace(t) : this._history = new Set(t);
    }
  }
  _currentPosition() {
    const e = this._navigator.current();
    return e ? this._elements.indexOf(e) : -1;
  }
  get _elements() {
    const e = [];
    return this._history.forEach((t) => e.push(t)), e;
  }
  dispose() {
    this._disposable && (this._disposable.dispose(), this._disposable = void 0);
  }
}
const yI = Ge;
let pwt = class extends Xd {
  get onDidChange() {
    return this._onDidChange.event;
  }
  get onDidHeightChange() {
    return this._onDidHeightChange.event;
  }
  constructor(e, t, n) {
    super(), this.state = "idle", this.maxHeight = Number.POSITIVE_INFINITY, this.hover = this._register(new er()), this._onDidChange = this._register(new he()), this._onDidHeightChange = this._register(new he()), this.contextViewProvider = t, this.options = n, this.message = null, this.placeholder = this.options.placeholder || "", this.tooltip = this.options.tooltip ?? (this.placeholder || ""), this.ariaLabel = this.options.ariaLabel || "", this.options.validationOptions && (this.validation = this.options.validationOptions.validation), this.element = Fe(e, yI(".monaco-inputbox.idle"));
    const r = this.options.flexibleHeight ? "textarea" : "input", s = Fe(this.element, yI(".ibwrapper"));
    if (this.input = Fe(s, yI(r + ".input.empty")), this.input.setAttribute("autocorrect", "off"), this.input.setAttribute("autocapitalize", "off"), this.input.setAttribute("spellcheck", "false"), this.onfocus(this.input, () => this.element.classList.add("synthetic-focus")), this.onblur(this.input, () => this.element.classList.remove("synthetic-focus")), this.options.flexibleHeight) {
      this.maxHeight = typeof this.options.flexibleMaxHeight == "number" ? this.options.flexibleMaxHeight : Number.POSITIVE_INFINITY, this.mirror = Fe(s, yI("div.mirror")), this.mirror.innerText = " ", this.scrollableElement = new e3e(this.element, {
        vertical: 1
        /* ScrollbarVisibility.Auto */
      }), this.options.flexibleWidth && (this.input.setAttribute("wrap", "off"), this.mirror.style.whiteSpace = "pre", this.mirror.style.wordWrap = "initial"), Fe(e, this.scrollableElement.getDomNode()), this._register(this.scrollableElement), this._register(this.scrollableElement.onScroll((l) => this.input.scrollTop = l.scrollTop));
      const o = this._register(new ir(e.ownerDocument, "selectionchange")), a = Ze.filter(o.event, () => {
        const l = e.ownerDocument.getSelection();
        return (l == null ? void 0 : l.anchorNode) === s;
      });
      this._register(a(this.updateScrollDimensions, this)), this._register(this.onDidHeightChange(this.updateScrollDimensions, this));
    } else
      this.input.type = this.options.type || "text", this.input.setAttribute("wrap", "off");
    this.ariaLabel && this.input.setAttribute("aria-label", this.ariaLabel), this.placeholder && !this.options.showPlaceholderOnFocus && this.setPlaceHolder(this.placeholder), this.tooltip && this.setTooltip(this.tooltip), this.oninput(this.input, () => this.onValueChange()), this.onblur(this.input, () => this.onBlur()), this.onfocus(this.input, () => this.onFocus()), this._register(this.ignoreGesture(this.input)), setTimeout(() => this.updateMirror(), 0), this.options.actions && (this.actionbar = this._register(new qu(this.element)), this.actionbar.push(this.options.actions, { icon: !0, label: !1 })), this.applyStyles();
  }
  onBlur() {
    this._hideMessage(), this.options.showPlaceholderOnFocus && this.input.setAttribute("placeholder", "");
  }
  onFocus() {
    this._showMessage(), this.options.showPlaceholderOnFocus && this.input.setAttribute("placeholder", this.placeholder || "");
  }
  setPlaceHolder(e) {
    this.placeholder = e, this.input.setAttribute("placeholder", e);
  }
  setTooltip(e) {
    this.tooltip = e, this.hover.value || (this.hover.value = this._register(Jg().setupDelayedHoverAtMouse(this.input, () => ({
      content: this.tooltip,
      appearance: {
        compact: !0
      }
    }))));
  }
  get inputElement() {
    return this.input;
  }
  get value() {
    return this.input.value;
  }
  set value(e) {
    this.input.value !== e && (this.input.value = e, this.onValueChange());
  }
  get height() {
    return typeof this.cachedHeight == "number" ? this.cachedHeight : _y(this.element);
  }
  focus() {
    this.input.focus();
  }
  blur() {
    this.input.blur();
  }
  hasFocus() {
    return wq(this.input);
  }
  select(e = null) {
    this.input.select(), e && (this.input.setSelectionRange(e.start, e.end), e.end === this.input.value.length && (this.input.scrollLeft = this.input.scrollWidth));
  }
  isSelectionAtEnd() {
    return this.input.selectionEnd === this.input.value.length && this.input.selectionStart === this.input.selectionEnd;
  }
  getSelection() {
    const e = this.input.selectionStart;
    if (e === null)
      return null;
    const t = this.input.selectionEnd ?? e;
    return {
      start: e,
      end: t
    };
  }
  enable() {
    this.input.removeAttribute("disabled");
  }
  disable() {
    this.blur(), this.input.disabled = !0, this._hideMessage();
  }
  set paddingRight(e) {
    this.input.style.width = `calc(100% - ${e}px)`, this.mirror && (this.mirror.style.paddingRight = e + "px");
  }
  updateScrollDimensions() {
    if (typeof this.cachedContentHeight != "number" || typeof this.cachedHeight != "number" || !this.scrollableElement)
      return;
    const e = this.cachedContentHeight, t = this.cachedHeight, n = this.input.scrollTop;
    this.scrollableElement.setScrollDimensions({ scrollHeight: e, height: t }), this.scrollableElement.setScrollPosition({ scrollTop: n });
  }
  showMessage(e, t) {
    if (this.state === "open" && Wd(this.message, e))
      return;
    this.message = e, this.element.classList.remove("idle"), this.element.classList.remove("info"), this.element.classList.remove("warning"), this.element.classList.remove("error"), this.element.classList.add(this.classForType(e.type));
    const n = this.stylesForType(this.message.type);
    this.element.style.border = `1px solid ${Py(n.border, "transparent")}`, this.message.content && (this.hasFocus() || t) && this._showMessage();
  }
  hideMessage() {
    this.message = null, this.element.classList.remove("info"), this.element.classList.remove("warning"), this.element.classList.remove("error"), this.element.classList.add("idle"), this._hideMessage(), this.applyStyles();
  }
  validate() {
    let e = null;
    return this.validation && (e = this.validation(this.value), e ? (this.inputElement.setAttribute("aria-invalid", "true"), this.showMessage(e)) : this.inputElement.hasAttribute("aria-invalid") && (this.inputElement.removeAttribute("aria-invalid"), this.hideMessage())), e == null ? void 0 : e.type;
  }
  stylesForType(e) {
    const t = this.options.inputBoxStyles;
    switch (e) {
      case 1:
        return { border: t.inputValidationInfoBorder, background: t.inputValidationInfoBackground, foreground: t.inputValidationInfoForeground };
      case 2:
        return { border: t.inputValidationWarningBorder, background: t.inputValidationWarningBackground, foreground: t.inputValidationWarningForeground };
      default:
        return { border: t.inputValidationErrorBorder, background: t.inputValidationErrorBackground, foreground: t.inputValidationErrorForeground };
    }
  }
  classForType(e) {
    switch (e) {
      case 1:
        return "info";
      case 2:
        return "warning";
      default:
        return "error";
    }
  }
  _showMessage() {
    if (!this.contextViewProvider || !this.message)
      return;
    let e;
    const t = () => e.style.width = Td(this.element) + "px";
    this.contextViewProvider.showContextView({
      getAnchor: () => this.element,
      anchorAlignment: 1,
      render: (r) => {
        if (!this.message)
          return null;
        e = Fe(r, yI(".monaco-inputbox-container")), t();
        const s = yI("span.monaco-inputbox-message");
        this.message.formatContent ? cwt(this.message.content, void 0, s) : lwt(this.message.content, void 0, s), s.classList.add(this.classForType(this.message.type));
        const o = this.stylesForType(this.message.type);
        return s.style.backgroundColor = o.background ?? "", s.style.color = o.foreground ?? "", s.style.border = o.border ? `1px solid ${o.border}` : "", Fe(e, s), null;
      },
      onHide: () => {
        this.state = "closed";
      },
      layout: t
    });
    let n;
    this.message.type === 3 ? n = S(9, "Error: {0}", this.message.content) : this.message.type === 2 ? n = S(10, "Warning: {0}", this.message.content) : n = S(11, "Info: {0}", this.message.content), lu(n), this.state = "open";
  }
  _hideMessage() {
    this.contextViewProvider && (this.state === "open" && this.contextViewProvider.hideContextView(), this.state = "idle");
  }
  onValueChange() {
    this._onDidChange.fire(this.value), this.validate(), this.updateMirror(), this.input.classList.toggle("empty", !this.value), this.state === "open" && this.contextViewProvider && this.contextViewProvider.layout();
  }
  updateMirror() {
    if (!this.mirror)
      return;
    const e = this.value, n = e.charCodeAt(e.length - 1) === 10 ? " " : "";
    (e + n).replace(/\u000c/g, "") ? this.mirror.textContent = e + n : this.mirror.innerText = " ", this.layout();
  }
  applyStyles() {
    const e = this.options.inputBoxStyles, t = e.inputBackground ?? "", n = e.inputForeground ?? "", r = e.inputBorder ?? "";
    this.element.style.backgroundColor = t, this.element.style.color = n, this.input.style.backgroundColor = "inherit", this.input.style.color = n, this.element.style.border = `1px solid ${Py(r, "transparent")}`;
  }
  layout() {
    if (!this.mirror)
      return;
    const e = this.cachedContentHeight;
    this.cachedContentHeight = _y(this.mirror), e !== this.cachedContentHeight && (this.cachedHeight = Math.min(this.cachedContentHeight, this.maxHeight), this.input.style.height = this.cachedHeight + "px", this._onDidHeightChange.fire(this.cachedContentHeight));
  }
  insertAtCursor(e) {
    const t = this.inputElement, n = t.selectionStart, r = t.selectionEnd, s = t.value;
    n !== null && r !== null && (this.value = s.substr(0, n) + e + s.substr(r), t.setSelectionRange(n + 1, n + 1), this.layout());
  }
  dispose() {
    var e;
    this._hideMessage(), this.message = null, (e = this.actionbar) == null || e.dispose(), super.dispose();
  }
};
class ZBe extends pwt {
  constructor(e, t, n) {
    const r = S(12, " or {0} for history", "⇅"), s = S(13, " ({0} for history)", "⇅");
    super(e, t, n), this._onDidFocus = this._register(new he()), this.onDidFocus = this._onDidFocus.event, this._onDidBlur = this._register(new he()), this.onDidBlur = this._onDidBlur.event, this.history = this._register(new gwt(n.history, 100));
    const o = () => {
      if (n.showHistoryHint && n.showHistoryHint() && !this.placeholder.endsWith(r) && !this.placeholder.endsWith(s) && this.history.getHistory().length) {
        const a = this.placeholder.endsWith(")") ? r : s, l = this.placeholder + a;
        n.showPlaceholderOnFocus && !wq(this.input) ? this.placeholder = l : this.setPlaceHolder(l);
      }
    };
    this.observer = new MutationObserver((a, l) => {
      a.forEach((c) => {
        c.target.textContent || o();
      });
    }), this.observer.observe(this.input, { attributeFilter: ["class"] }), this.onfocus(this.input, () => o()), this.onblur(this.input, () => {
      const a = (l) => {
        if (this.placeholder.endsWith(l)) {
          const c = this.placeholder.slice(0, this.placeholder.length - l.length);
          return n.showPlaceholderOnFocus ? this.placeholder = c : this.setPlaceHolder(c), !0;
        } else
          return !1;
      };
      a(s) || a(r);
    });
  }
  dispose() {
    super.dispose(), this.observer && (this.observer.disconnect(), this.observer = void 0);
  }
  addToHistory(e) {
    this.value && (e || this.value !== this.getCurrentValue()) && this.history.add(this.value);
  }
  isAtLastInHistory() {
    return this.history.isLast();
  }
  isNowhereInHistory() {
    return this.history.isNowhere();
  }
  showNextValue() {
    this.history.has(this.value) || this.addToHistory();
    let e = this.getNextValue();
    e && (e = e === this.value ? this.getNextValue() : e), this.value = e ?? "", hb(this.value ? this.value : S(14, "Cleared Input"));
  }
  showPreviousValue() {
    this.history.has(this.value) || this.addToHistory();
    let e = this.getPreviousValue();
    e && (e = e === this.value ? this.getPreviousValue() : e), e && (this.value = e, hb(this.value));
  }
  setPlaceHolder(e) {
    super.setPlaceHolder(e), this.setTooltip(e);
  }
  onBlur() {
    super.onBlur(), this._onDidBlur.fire();
  }
  onFocus() {
    super.onFocus(), this._onDidFocus.fire();
  }
  getCurrentValue() {
    let e = this.history.current();
    return e || (e = this.history.last(), this.history.next()), e;
  }
  getPreviousValue() {
    return this.history.previous() || this.history.first();
  }
  getNextValue() {
    return this.history.next();
  }
}
const mwt = S(1, "input");
class QBe extends Xd {
  get onDidOptionChange() {
    return this._onDidOptionChange.event;
  }
  get onKeyDown() {
    return this._onKeyDown.event;
  }
  get onMouseDown() {
    return this._onMouseDown.event;
  }
  get onCaseSensitiveKeyDown() {
    return this._onCaseSensitiveKeyDown.event;
  }
  get onRegexKeyDown() {
    return this._onRegexKeyDown.event;
  }
  constructor(e, t, n) {
    super(), this.fixFocusOnOptionClickEnabled = !0, this.imeSessionInProgress = !1, this.additionalTogglesDisposables = this._register(new er()), this.additionalToggles = [], this._onDidOptionChange = this._register(new he()), this._onKeyDown = this._register(new he()), this._onMouseDown = this._register(new he()), this._onInput = this._register(new he()), this._onKeyUp = this._register(new he()), this._onCaseSensitiveKeyDown = this._register(new he()), this._onRegexKeyDown = this._register(new he()), this._lastHighlightFindOptions = 0, this.placeholder = n.placeholder || "", this.validation = n.validation, this.label = n.label || mwt, this.showCommonFindToggles = !!n.showCommonFindToggles;
    const r = n.appendCaseSensitiveLabel || "", s = n.appendWholeWordsLabel || "", o = n.appendRegexLabel || "", a = !!n.flexibleHeight, l = !!n.flexibleWidth, c = n.flexibleMaxHeight;
    this.domNode = document.createElement("div"), this.domNode.classList.add("monaco-findInput"), this.inputBox = this._register(new ZBe(this.domNode, t, {
      placeholder: this.placeholder || "",
      ariaLabel: this.label || "",
      validationOptions: {
        validation: this.validation
      },
      showHistoryHint: n.showHistoryHint,
      flexibleHeight: a,
      flexibleWidth: l,
      flexibleMaxHeight: c,
      inputBoxStyles: n.inputBoxStyles,
      history: n.history
    }));
    const u = this._register(oA());
    if (this.showCommonFindToggles) {
      this.regex = this._register(new YBe({
        appendTitle: o,
        isChecked: !1,
        hoverDelegate: u,
        ...n.toggleStyles
      })), this._register(this.regex.onChange((h) => {
        this._onDidOptionChange.fire(h), !h && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(), this.validate();
      })), this._register(this.regex.onKeyDown((h) => {
        this._onRegexKeyDown.fire(h);
      })), this.wholeWords = this._register(new KBe({
        appendTitle: s,
        isChecked: !1,
        hoverDelegate: u,
        ...n.toggleStyles
      })), this._register(this.wholeWords.onChange((h) => {
        this._onDidOptionChange.fire(h), !h && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(), this.validate();
      })), this.caseSensitive = this._register(new qBe({
        appendTitle: r,
        isChecked: !1,
        hoverDelegate: u,
        ...n.toggleStyles
      })), this._register(this.caseSensitive.onChange((h) => {
        this._onDidOptionChange.fire(h), !h && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(), this.validate();
      })), this._register(this.caseSensitive.onKeyDown((h) => {
        this._onCaseSensitiveKeyDown.fire(h);
      }));
      const d = [this.caseSensitive.domNode, this.wholeWords.domNode, this.regex.domNode];
      this.onkeydown(this.domNode, (h) => {
        if (h.equals(
          15
          /* KeyCode.LeftArrow */
        ) || h.equals(
          17
          /* KeyCode.RightArrow */
        ) || h.equals(
          9
          /* KeyCode.Escape */
        )) {
          const g = d.indexOf(this.domNode.ownerDocument.activeElement);
          if (g >= 0) {
            let m = -1;
            h.equals(
              17
              /* KeyCode.RightArrow */
            ) ? m = (g + 1) % d.length : h.equals(
              15
              /* KeyCode.LeftArrow */
            ) && (g === 0 ? m = d.length - 1 : m = g - 1), h.equals(
              9
              /* KeyCode.Escape */
            ) ? (d[g].blur(), this.inputBox.focus()) : m >= 0 && d[m].focus(), Mi.stop(h, !0);
          }
        }
      });
    }
    this.controls = document.createElement("div"), this.controls.className = "controls", this.controls.style.display = this.showCommonFindToggles ? "" : "none", this.caseSensitive && this.controls.append(this.caseSensitive.domNode), this.wholeWords && this.controls.appendChild(this.wholeWords.domNode), this.regex && this.controls.appendChild(this.regex.domNode), this.setAdditionalToggles(n == null ? void 0 : n.additionalToggles), this.controls && this.domNode.appendChild(this.controls), e == null || e.appendChild(this.domNode), this._register(Ce(this.inputBox.inputElement, "compositionstart", (d) => {
      this.imeSessionInProgress = !0;
    })), this._register(Ce(this.inputBox.inputElement, "compositionend", (d) => {
      this.imeSessionInProgress = !1, this._onInput.fire();
    })), this.onkeydown(this.inputBox.inputElement, (d) => this._onKeyDown.fire(d)), this.onkeyup(this.inputBox.inputElement, (d) => this._onKeyUp.fire(d)), this.oninput(this.inputBox.inputElement, (d) => this._onInput.fire()), this.onmousedown(this.inputBox.inputElement, (d) => this._onMouseDown.fire(d));
  }
  get onDidChange() {
    return this.inputBox.onDidChange;
  }
  layout(e) {
    this.inputBox.layout(), this.updateInputBoxPadding(e.collapsedFindWidget);
  }
  enable() {
    var e, t, n;
    this.domNode.classList.remove("disabled"), this.inputBox.enable(), (e = this.regex) == null || e.enable(), (t = this.wholeWords) == null || t.enable(), (n = this.caseSensitive) == null || n.enable();
    for (const r of this.additionalToggles)
      r.enable();
  }
  disable() {
    var e, t, n;
    this.domNode.classList.add("disabled"), this.inputBox.disable(), (e = this.regex) == null || e.disable(), (t = this.wholeWords) == null || t.disable(), (n = this.caseSensitive) == null || n.disable();
    for (const r of this.additionalToggles)
      r.disable();
  }
  setFocusInputOnOptionClick(e) {
    this.fixFocusOnOptionClickEnabled = e;
  }
  setEnabled(e) {
    e ? this.enable() : this.disable();
  }
  setAdditionalToggles(e) {
    for (const t of this.additionalToggles)
      t.domNode.remove();
    this.additionalToggles = [], this.additionalTogglesDisposables.value = new ke();
    for (const t of e ?? [])
      this.additionalTogglesDisposables.value.add(t), this.controls.appendChild(t.domNode), this.additionalTogglesDisposables.value.add(t.onChange((n) => {
        this._onDidOptionChange.fire(n), !n && this.fixFocusOnOptionClickEnabled && this.inputBox.focus();
      })), this.additionalToggles.push(t);
    this.additionalToggles.length > 0 && (this.controls.style.display = ""), this.updateInputBoxPadding();
  }
  updateInputBoxPadding(e = !1) {
    var t, n, r;
    e ? this.inputBox.paddingRight = 0 : this.inputBox.paddingRight = (((t = this.caseSensitive) == null ? void 0 : t.width()) ?? 0) + (((n = this.wholeWords) == null ? void 0 : n.width()) ?? 0) + (((r = this.regex) == null ? void 0 : r.width()) ?? 0) + this.additionalToggles.reduce((s, o) => s + o.width(), 0);
  }
  getValue() {
    return this.inputBox.value;
  }
  setValue(e) {
    this.inputBox.value !== e && (this.inputBox.value = e);
  }
  select() {
    this.inputBox.select();
  }
  focus() {
    this.inputBox.focus();
  }
  getCaseSensitive() {
    var e;
    return ((e = this.caseSensitive) == null ? void 0 : e.checked) ?? !1;
  }
  setCaseSensitive(e) {
    this.caseSensitive && (this.caseSensitive.checked = e);
  }
  getWholeWords() {
    var e;
    return ((e = this.wholeWords) == null ? void 0 : e.checked) ?? !1;
  }
  setWholeWords(e) {
    this.wholeWords && (this.wholeWords.checked = e);
  }
  getRegex() {
    var e;
    return ((e = this.regex) == null ? void 0 : e.checked) ?? !1;
  }
  setRegex(e) {
    this.regex && (this.regex.checked = e, this.validate());
  }
  focusOnCaseSensitive() {
    var e;
    (e = this.caseSensitive) == null || e.focus();
  }
  highlightFindOptions() {
    this.domNode.classList.remove("highlight-" + this._lastHighlightFindOptions), this._lastHighlightFindOptions = 1 - this._lastHighlightFindOptions, this.domNode.classList.add("highlight-" + this._lastHighlightFindOptions);
  }
  validate() {
    this.inputBox.validate();
  }
  showMessage(e) {
    this.inputBox.showMessage(e);
  }
  clearMessage() {
    this.inputBox.hideMessage();
  }
}
var kh;
(function(i) {
  i[i.Expanded = 0] = "Expanded", i[i.Collapsed = 1] = "Collapsed", i[i.PreserveOrExpanded = 2] = "PreserveOrExpanded", i[i.PreserveOrCollapsed = 3] = "PreserveOrCollapsed";
})(kh || (kh = {}));
var Cx;
(function(i) {
  i[i.Unknown = 0] = "Unknown", i[i.Twistie = 1] = "Twistie", i[i.Element = 2] = "Element", i[i.Filter = 3] = "Filter";
})(Cx || (Cx = {}));
class Ah extends Error {
  constructor(e, t) {
    super(`TreeError [${e}] ${t}`);
  }
}
class tpe {
  constructor(e) {
    this.fn = e, this._map = /* @__PURE__ */ new WeakMap();
  }
  map(e) {
    let t = this._map.get(e);
    return t || (t = this.fn(e), this._map.set(e, t)), t;
  }
}
class RC {
  /**
   * Constructs a new DiffChange with the given sequence information
   * and content.
   */
  constructor(e, t, n, r) {
    this.originalStart = e, this.originalLength = t, this.modifiedStart = n, this.modifiedLength = r;
  }
  /**
   * The end point (exclusive) of the change in the original sequence.
   */
  getOriginalEnd() {
    return this.originalStart + this.originalLength;
  }
  /**
   * The end point (exclusive) of the change in the modified sequence.
   */
  getModifiedEnd() {
    return this.modifiedStart + this.modifiedLength;
  }
}
class RDe {
  constructor(e) {
    this.source = e;
  }
  getElements() {
    const e = this.source, t = new Int32Array(e.length);
    for (let n = 0, r = e.length; n < r; n++)
      t[n] = e.charCodeAt(n);
    return t;
  }
}
function _wt(i, e, t) {
  return new K_(new RDe(i), new RDe(e)).ComputeDiff(t).changes;
}
class CI {
  static Assert(e, t) {
    if (!e)
      throw new Error(t);
  }
}
class wI {
  /**
   * Copies a range of elements from an Array starting at the specified source index and pastes
   * them to another Array starting at the specified destination index. The length and the indexes
   * are specified as 64-bit integers.
   * sourceArray:
   *		The Array that contains the data to copy.
   * sourceIndex:
   *		A 64-bit integer that represents the index in the sourceArray at which copying begins.
   * destinationArray:
   *		The Array that receives the data.
   * destinationIndex:
   *		A 64-bit integer that represents the index in the destinationArray at which storing begins.
   * length:
   *		A 64-bit integer that represents the number of elements to copy.
   */
  static Copy(e, t, n, r, s) {
    for (let o = 0; o < s; o++)
      n[r + o] = e[t + o];
  }
  static Copy2(e, t, n, r, s) {
    for (let o = 0; o < s; o++)
      n[r + o] = e[t + o];
  }
}
class ADe {
  /**
   * Constructs a new DiffChangeHelper for the given DiffSequences.
   */
  constructor() {
    this.m_changes = [], this.m_originalStart = 1073741824, this.m_modifiedStart = 1073741824, this.m_originalCount = 0, this.m_modifiedCount = 0;
  }
  /**
   * Marks the beginning of the next change in the set of differences.
   */
  MarkNextChange() {
    (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.m_changes.push(new RC(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)), this.m_originalCount = 0, this.m_modifiedCount = 0, this.m_originalStart = 1073741824, this.m_modifiedStart = 1073741824;
  }
  /**
   * Adds the original element at the given position to the elements
   * affected by the current change. The modified index gives context
   * to the change position with respect to the original sequence.
   * @param originalIndex The index of the original element to add.
   * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.
   */
  AddOriginalElement(e, t) {
    this.m_originalStart = Math.min(this.m_originalStart, e), this.m_modifiedStart = Math.min(this.m_modifiedStart, t), this.m_originalCount++;
  }
  /**
   * Adds the modified element at the given position to the elements
   * affected by the current change. The original index gives context
   * to the change position with respect to the modified sequence.
   * @param originalIndex The index of the original element that provides corresponding position in the original sequence.
   * @param modifiedIndex The index of the modified element to add.
   */
  AddModifiedElement(e, t) {
    this.m_originalStart = Math.min(this.m_originalStart, e), this.m_modifiedStart = Math.min(this.m_modifiedStart, t), this.m_modifiedCount++;
  }
  /**
   * Retrieves all of the changes marked by the class.
   */
  getChanges() {
    return (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.MarkNextChange(), this.m_changes;
  }
  /**
   * Retrieves all of the changes marked by the class in the reverse order
   */
  getReverseChanges() {
    return (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.MarkNextChange(), this.m_changes.reverse(), this.m_changes;
  }
}
class K_ {
  /**
   * Constructs the DiffFinder
   */
  constructor(e, t, n = null) {
    this.ContinueProcessingPredicate = n, this._originalSequence = e, this._modifiedSequence = t;
    const [r, s, o] = K_._getElements(e), [a, l, c] = K_._getElements(t);
    this._hasStrings = o && c, this._originalStringElements = r, this._originalElementsOrHash = s, this._modifiedStringElements = a, this._modifiedElementsOrHash = l, this.m_forwardHistory = [], this.m_reverseHistory = [];
  }
  static _isStringArray(e) {
    return e.length > 0 && typeof e[0] == "string";
  }
  static _getElements(e) {
    const t = e.getElements();
    if (K_._isStringArray(t)) {
      const n = new Int32Array(t.length);
      for (let r = 0, s = t.length; r < s; r++)
        n[r] = Uhe(t[r], 0);
      return [t, n, !0];
    }
    return t instanceof Int32Array ? [[], t, !1] : [[], new Int32Array(t), !1];
  }
  ElementsAreEqual(e, t) {
    return this._originalElementsOrHash[e] !== this._modifiedElementsOrHash[t] ? !1 : this._hasStrings ? this._originalStringElements[e] === this._modifiedStringElements[t] : !0;
  }
  ElementsAreStrictEqual(e, t) {
    if (!this.ElementsAreEqual(e, t))
      return !1;
    const n = K_._getStrictElement(this._originalSequence, e), r = K_._getStrictElement(this._modifiedSequence, t);
    return n === r;
  }
  static _getStrictElement(e, t) {
    return typeof e.getStrictElement == "function" ? e.getStrictElement(t) : null;
  }
  OriginalElementsAreEqual(e, t) {
    return this._originalElementsOrHash[e] !== this._originalElementsOrHash[t] ? !1 : this._hasStrings ? this._originalStringElements[e] === this._originalStringElements[t] : !0;
  }
  ModifiedElementsAreEqual(e, t) {
    return this._modifiedElementsOrHash[e] !== this._modifiedElementsOrHash[t] ? !1 : this._hasStrings ? this._modifiedStringElements[e] === this._modifiedStringElements[t] : !0;
  }
  ComputeDiff(e) {
    return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, e);
  }
  /**
   * Computes the differences between the original and modified input
   * sequences on the bounded range.
   * @returns An array of the differences between the two input sequences.
   */
  _ComputeDiff(e, t, n, r, s) {
    const o = [!1];
    let a = this.ComputeDiffRecursive(e, t, n, r, o);
    return s && (a = this.PrettifyChanges(a)), {
      quitEarly: o[0],
      changes: a
    };
  }
  /**
   * Private helper method which computes the differences on the bounded range
   * recursively.
   * @returns An array of the differences between the two input sequences.
   */
  ComputeDiffRecursive(e, t, n, r, s) {
    for (s[0] = !1; e <= t && n <= r && this.ElementsAreEqual(e, n); )
      e++, n++;
    for (; t >= e && r >= n && this.ElementsAreEqual(t, r); )
      t--, r--;
    if (e > t || n > r) {
      let d;
      return n <= r ? (CI.Assert(e === t + 1, "originalStart should only be one more than originalEnd"), d = [
        new RC(e, 0, n, r - n + 1)
      ]) : e <= t ? (CI.Assert(n === r + 1, "modifiedStart should only be one more than modifiedEnd"), d = [
        new RC(e, t - e + 1, n, 0)
      ]) : (CI.Assert(e === t + 1, "originalStart should only be one more than originalEnd"), CI.Assert(n === r + 1, "modifiedStart should only be one more than modifiedEnd"), d = []), d;
    }
    const o = [0], a = [0], l = this.ComputeRecursionPoint(e, t, n, r, o, a, s), c = o[0], u = a[0];
    if (l !== null)
      return l;
    if (!s[0]) {
      const d = this.ComputeDiffRecursive(e, c, n, u, s);
      let h = [];
      return s[0] ? h = [
        new RC(c + 1, t - (c + 1) + 1, u + 1, r - (u + 1) + 1)
      ] : h = this.ComputeDiffRecursive(c + 1, t, u + 1, r, s), this.ConcatenateChanges(d, h);
    }
    return [
      new RC(e, t - e + 1, n, r - n + 1)
    ];
  }
  WALKTRACE(e, t, n, r, s, o, a, l, c, u, d, h, g, m, _, v, w, E) {
    let L = null, T = null, D = new ADe(), N = t, R = n, M = g[0] - v[0] - r, B = -1073741824, H = this.m_forwardHistory.length - 1;
    do {
      const j = M + e;
      j === N || j < R && c[j - 1] < c[j + 1] ? (d = c[j + 1], m = d - M - r, d < B && D.MarkNextChange(), B = d, D.AddModifiedElement(d + 1, m), M = j + 1 - e) : (d = c[j - 1] + 1, m = d - M - r, d < B && D.MarkNextChange(), B = d - 1, D.AddOriginalElement(d, m + 1), M = j - 1 - e), H >= 0 && (c = this.m_forwardHistory[H], e = c[0], N = 1, R = c.length - 1);
    } while (--H >= -1);
    if (L = D.getReverseChanges(), E[0]) {
      let j = g[0] + 1, K = v[0] + 1;
      if (L !== null && L.length > 0) {
        const X = L[L.length - 1];
        j = Math.max(j, X.getOriginalEnd()), K = Math.max(K, X.getModifiedEnd());
      }
      T = [
        new RC(j, h - j + 1, K, _ - K + 1)
      ];
    } else {
      D = new ADe(), N = o, R = a, M = g[0] - v[0] - l, B = 1073741824, H = w ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;
      do {
        const j = M + s;
        j === N || j < R && u[j - 1] >= u[j + 1] ? (d = u[j + 1] - 1, m = d - M - l, d > B && D.MarkNextChange(), B = d + 1, D.AddOriginalElement(d + 1, m + 1), M = j + 1 - s) : (d = u[j - 1], m = d - M - l, d > B && D.MarkNextChange(), B = d, D.AddModifiedElement(d + 1, m + 1), M = j - 1 - s), H >= 0 && (u = this.m_reverseHistory[H], s = u[0], N = 1, R = u.length - 1);
      } while (--H >= -1);
      T = D.getChanges();
    }
    return this.ConcatenateChanges(L, T);
  }
  /**
   * Given the range to compute the diff on, this method finds the point:
   * (midOriginal, midModified)
   * that exists in the middle of the LCS of the two sequences and
   * is the point at which the LCS problem may be broken down recursively.
   * This method will try to keep the LCS trace in memory. If the LCS recursion
   * point is calculated and the full trace is available in memory, then this method
   * will return the change list.
   * @param originalStart The start bound of the original sequence range
   * @param originalEnd The end bound of the original sequence range
   * @param modifiedStart The start bound of the modified sequence range
   * @param modifiedEnd The end bound of the modified sequence range
   * @param midOriginal The middle point of the original sequence range
   * @param midModified The middle point of the modified sequence range
   * @returns The diff changes, if available, otherwise null
   */
  ComputeRecursionPoint(e, t, n, r, s, o, a) {
    let l = 0, c = 0, u = 0, d = 0, h = 0, g = 0;
    e--, n--, s[0] = 0, o[0] = 0, this.m_forwardHistory = [], this.m_reverseHistory = [];
    const m = t - e + (r - n), _ = m + 1, v = new Int32Array(_), w = new Int32Array(_), E = r - n, L = t - e, T = e - n, D = t - r, R = (L - E) % 2 === 0;
    v[E] = e, w[L] = t, a[0] = !1;
    for (let M = 1; M <= m / 2 + 1; M++) {
      let B = 0, H = 0;
      u = this.ClipDiagonalBound(E - M, M, E, _), d = this.ClipDiagonalBound(E + M, M, E, _);
      for (let K = u; K <= d; K += 2) {
        K === u || K < d && v[K - 1] < v[K + 1] ? l = v[K + 1] : l = v[K - 1] + 1, c = l - (K - E) - T;
        const X = l;
        for (; l < t && c < r && this.ElementsAreEqual(l + 1, c + 1); )
          l++, c++;
        if (v[K] = l, l + c > B + H && (B = l, H = c), !R && Math.abs(K - L) <= M - 1 && l >= w[K])
          return s[0] = l, o[0] = c, X <= w[K] && M <= 1448 ? this.WALKTRACE(E, u, d, T, L, h, g, D, v, w, l, t, s, c, r, o, R, a) : null;
      }
      const j = (B - e + (H - n) - M) / 2;
      if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(B, j))
        return a[0] = !0, s[0] = B, o[0] = H, j > 0 && M <= 1448 ? this.WALKTRACE(E, u, d, T, L, h, g, D, v, w, l, t, s, c, r, o, R, a) : (e++, n++, [
          new RC(e, t - e + 1, n, r - n + 1)
        ]);
      h = this.ClipDiagonalBound(L - M, M, L, _), g = this.ClipDiagonalBound(L + M, M, L, _);
      for (let K = h; K <= g; K += 2) {
        K === h || K < g && w[K - 1] >= w[K + 1] ? l = w[K + 1] - 1 : l = w[K - 1], c = l - (K - L) - D;
        const X = l;
        for (; l > e && c > n && this.ElementsAreEqual(l, c); )
          l--, c--;
        if (w[K] = l, R && Math.abs(K - E) <= M && l <= v[K])
          return s[0] = l, o[0] = c, X >= v[K] && M <= 1448 ? this.WALKTRACE(E, u, d, T, L, h, g, D, v, w, l, t, s, c, r, o, R, a) : null;
      }
      if (M <= 1447) {
        let K = new Int32Array(d - u + 2);
        K[0] = E - u + 1, wI.Copy2(v, u, K, 1, d - u + 1), this.m_forwardHistory.push(K), K = new Int32Array(g - h + 2), K[0] = L - h + 1, wI.Copy2(w, h, K, 1, g - h + 1), this.m_reverseHistory.push(K);
      }
    }
    return this.WALKTRACE(E, u, d, T, L, h, g, D, v, w, l, t, s, c, r, o, R, a);
  }
  /**
   * Shifts the given changes to provide a more intuitive diff.
   * While the first element in a diff matches the first element after the diff,
   * we shift the diff down.
   *
   * @param changes The list of changes to shift
   * @returns The shifted changes
   */
  PrettifyChanges(e) {
    for (let t = 0; t < e.length; t++) {
      const n = e[t], r = t < e.length - 1 ? e[t + 1].originalStart : this._originalElementsOrHash.length, s = t < e.length - 1 ? e[t + 1].modifiedStart : this._modifiedElementsOrHash.length, o = n.originalLength > 0, a = n.modifiedLength > 0;
      for (; n.originalStart + n.originalLength < r && n.modifiedStart + n.modifiedLength < s && (!o || this.OriginalElementsAreEqual(n.originalStart, n.originalStart + n.originalLength)) && (!a || this.ModifiedElementsAreEqual(n.modifiedStart, n.modifiedStart + n.modifiedLength)); ) {
        const c = this.ElementsAreStrictEqual(n.originalStart, n.modifiedStart);
        if (this.ElementsAreStrictEqual(n.originalStart + n.originalLength, n.modifiedStart + n.modifiedLength) && !c)
          break;
        n.originalStart++, n.modifiedStart++;
      }
      const l = [null];
      if (t < e.length - 1 && this.ChangesOverlap(e[t], e[t + 1], l)) {
        e[t] = l[0], e.splice(t + 1, 1), t--;
        continue;
      }
    }
    for (let t = e.length - 1; t >= 0; t--) {
      const n = e[t];
      let r = 0, s = 0;
      if (t > 0) {
        const d = e[t - 1];
        r = d.originalStart + d.originalLength, s = d.modifiedStart + d.modifiedLength;
      }
      const o = n.originalLength > 0, a = n.modifiedLength > 0;
      let l = 0, c = this._boundaryScore(n.originalStart, n.originalLength, n.modifiedStart, n.modifiedLength);
      for (let d = 1; ; d++) {
        const h = n.originalStart - d, g = n.modifiedStart - d;
        if (h < r || g < s || o && !this.OriginalElementsAreEqual(h, h + n.originalLength) || a && !this.ModifiedElementsAreEqual(g, g + n.modifiedLength))
          break;
        const _ = (h === r && g === s ? 5 : 0) + this._boundaryScore(h, n.originalLength, g, n.modifiedLength);
        _ > c && (c = _, l = d);
      }
      n.originalStart -= l, n.modifiedStart -= l;
      const u = [null];
      if (t > 0 && this.ChangesOverlap(e[t - 1], e[t], u)) {
        e[t - 1] = u[0], e.splice(t, 1), t++;
        continue;
      }
    }
    if (this._hasStrings)
      for (let t = 1, n = e.length; t < n; t++) {
        const r = e[t - 1], s = e[t], o = s.originalStart - r.originalStart - r.originalLength, a = r.originalStart, l = s.originalStart + s.originalLength, c = l - a, u = r.modifiedStart, d = s.modifiedStart + s.modifiedLength, h = d - u;
        if (o < 5 && c < 20 && h < 20) {
          const g = this._findBetterContiguousSequence(a, c, u, h, o);
          if (g) {
            const [m, _] = g;
            (m !== r.originalStart + r.originalLength || _ !== r.modifiedStart + r.modifiedLength) && (r.originalLength = m - r.originalStart, r.modifiedLength = _ - r.modifiedStart, s.originalStart = m + o, s.modifiedStart = _ + o, s.originalLength = l - s.originalStart, s.modifiedLength = d - s.modifiedStart);
          }
        }
      }
    return e;
  }
  _findBetterContiguousSequence(e, t, n, r, s) {
    if (t < s || r < s)
      return null;
    const o = e + t - s + 1, a = n + r - s + 1;
    let l = 0, c = 0, u = 0;
    for (let d = e; d < o; d++)
      for (let h = n; h < a; h++) {
        const g = this._contiguousSequenceScore(d, h, s);
        g > 0 && g > l && (l = g, c = d, u = h);
      }
    return l > 0 ? [c, u] : null;
  }
  _contiguousSequenceScore(e, t, n) {
    let r = 0;
    for (let s = 0; s < n; s++) {
      if (!this.ElementsAreEqual(e + s, t + s))
        return 0;
      r += this._originalStringElements[e + s].length;
    }
    return r;
  }
  _OriginalIsBoundary(e) {
    return e <= 0 || e >= this._originalElementsOrHash.length - 1 ? !0 : this._hasStrings && /^\s*$/.test(this._originalStringElements[e]);
  }
  _OriginalRegionIsBoundary(e, t) {
    if (this._OriginalIsBoundary(e) || this._OriginalIsBoundary(e - 1))
      return !0;
    if (t > 0) {
      const n = e + t;
      if (this._OriginalIsBoundary(n - 1) || this._OriginalIsBoundary(n))
        return !0;
    }
    return !1;
  }
  _ModifiedIsBoundary(e) {
    return e <= 0 || e >= this._modifiedElementsOrHash.length - 1 ? !0 : this._hasStrings && /^\s*$/.test(this._modifiedStringElements[e]);
  }
  _ModifiedRegionIsBoundary(e, t) {
    if (this._ModifiedIsBoundary(e) || this._ModifiedIsBoundary(e - 1))
      return !0;
    if (t > 0) {
      const n = e + t;
      if (this._ModifiedIsBoundary(n - 1) || this._ModifiedIsBoundary(n))
        return !0;
    }
    return !1;
  }
  _boundaryScore(e, t, n, r) {
    const s = this._OriginalRegionIsBoundary(e, t) ? 1 : 0, o = this._ModifiedRegionIsBoundary(n, r) ? 1 : 0;
    return s + o;
  }
  /**
   * Concatenates the two input DiffChange lists and returns the resulting
   * list.
   * @param The left changes
   * @param The right changes
   * @returns The concatenated list
   */
  ConcatenateChanges(e, t) {
    const n = [];
    if (e.length === 0 || t.length === 0)
      return t.length > 0 ? t : e;
    if (this.ChangesOverlap(e[e.length - 1], t[0], n)) {
      const r = new Array(e.length + t.length - 1);
      return wI.Copy(e, 0, r, 0, e.length - 1), r[e.length - 1] = n[0], wI.Copy(t, 1, r, e.length, t.length - 1), r;
    } else {
      const r = new Array(e.length + t.length);
      return wI.Copy(e, 0, r, 0, e.length), wI.Copy(t, 0, r, e.length, t.length), r;
    }
  }
  /**
   * Returns true if the two changes overlap and can be merged into a single
   * change
   * @param left The left change
   * @param right The right change
   * @param mergedChange The merged change if the two overlap, null otherwise
   * @returns True if the two changes overlap
   */
  ChangesOverlap(e, t, n) {
    if (CI.Assert(e.originalStart <= t.originalStart, "Left change is not less than or equal to right change"), CI.Assert(e.modifiedStart <= t.modifiedStart, "Left change is not less than or equal to right change"), e.originalStart + e.originalLength >= t.originalStart || e.modifiedStart + e.modifiedLength >= t.modifiedStart) {
      const r = e.originalStart;
      let s = e.originalLength;
      const o = e.modifiedStart;
      let a = e.modifiedLength;
      return e.originalStart + e.originalLength >= t.originalStart && (s = t.originalStart + t.originalLength - e.originalStart), e.modifiedStart + e.modifiedLength >= t.modifiedStart && (a = t.modifiedStart + t.modifiedLength - e.modifiedStart), n[0] = new RC(r, s, o, a), !0;
    } else
      return n[0] = null, !1;
  }
  /**
   * Helper method used to clip a diagonal index to the range of valid
   * diagonals. This also decides whether or not the diagonal index,
   * if it exceeds the boundary, should be clipped to the boundary or clipped
   * one inside the boundary depending on the Even/Odd status of the boundary
   * and numDifferences.
   * @param diagonal The index of the diagonal to clip.
   * @param numDifferences The current number of differences being iterated upon.
   * @param diagonalBaseIndex The base reference diagonal.
   * @param numDiagonals The total number of diagonals.
   * @returns The clipped diagonal index.
   */
  ClipDiagonalBound(e, t, n, r) {
    if (e >= 0 && e < r)
      return e;
    const s = n, o = r - n - 1, a = t % 2 === 0;
    if (e < 0) {
      const l = s % 2 === 0;
      return a === l ? 0 : 1;
    } else {
      const l = o % 2 === 0;
      return a === l ? r - 1 : r - 2;
    }
  }
}
function zB(i) {
  return !!i && i.visibility !== void 0;
}
function ST(i) {
  switch (i) {
    case !0:
      return 1;
    case !1:
      return 0;
    default:
      return i;
  }
}
function Qee(i) {
  return typeof i.collapsible == "boolean";
}
class bwt {
  constructor(e, t, n = {}) {
    this.user = e, this.rootRef = [], this.eventBufferer = new gB(), this._onDidSpliceModel = new he(), this.onDidSpliceModel = this._onDidSpliceModel.event, this._onDidSpliceRenderedNodes = new he(), this.onDidSpliceRenderedNodes = this._onDidSpliceRenderedNodes.event, this._onDidChangeCollapseState = new he(), this.onDidChangeCollapseState = this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event), this._onDidChangeRenderNodeCount = new he(), this.onDidChangeRenderNodeCount = this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event), this.refilterDelayer = new Gf(zMe), this.collapseByDefault = typeof n.collapseByDefault > "u" ? !1 : n.collapseByDefault, this.allowNonCollapsibleParents = n.allowNonCollapsibleParents ?? !1, this.filter = n.filter, this.autoExpandSingleChildren = typeof n.autoExpandSingleChildren > "u" ? !1 : n.autoExpandSingleChildren, this.root = {
      parent: void 0,
      element: t,
      children: [],
      depth: 0,
      visibleChildrenCount: 0,
      visibleChildIndex: -1,
      collapsible: !1,
      collapsed: !1,
      renderNodeCount: 0,
      visibility: 1,
      visible: !0,
      filterData: void 0
    };
  }
  splice(e, t, n = gi.empty(), r = {}) {
    if (e.length === 0)
      throw new Ah(this.user, "Invalid tree location");
    r.diffIdentityProvider ? this.spliceSmart(r.diffIdentityProvider, e, t, n, r) : this.spliceSimple(e, t, n, r);
  }
  spliceSmart(e, t, n, r = gi.empty(), s, o = s.diffDepth ?? 0) {
    const { parentNode: a } = this.getParentNodeWithListIndex(t);
    if (!a.lastDiffIds)
      return this.spliceSimple(t, n, r, s);
    const l = [...r], c = t[t.length - 1], u = new K_({ getElements: () => a.lastDiffIds }, {
      getElements: () => [
        ...a.children.slice(0, c),
        ...l,
        ...a.children.slice(c + n)
      ].map((_) => e.getId(_.element).toString())
    }).ComputeDiff(!1);
    if (u.quitEarly)
      return a.lastDiffIds = void 0, this.spliceSimple(t, n, l, s);
    const d = t.slice(0, -1), h = (_, v, w) => {
      if (o > 0)
        for (let E = 0; E < w; E++)
          _--, v--, this.spliceSmart(e, [...d, _, 0], Number.MAX_SAFE_INTEGER, l[v].children, s, o - 1);
    };
    let g = Math.min(a.children.length, c + n), m = l.length;
    for (const _ of u.changes.sort((v, w) => w.originalStart - v.originalStart))
      h(g, m, g - (_.originalStart + _.originalLength)), g = _.originalStart, m = _.modifiedStart - c, this.spliceSimple([...d, g], _.originalLength, gi.slice(l, m, m + _.modifiedLength), s);
    h(g, m, g);
  }
  spliceSimple(e, t, n = gi.empty(), { onDidCreateNode: r, onDidDeleteNode: s, diffIdentityProvider: o }) {
    const { parentNode: a, listIndex: l, revealed: c, visible: u } = this.getParentNodeWithListIndex(e), d = [], h = gi.map(n, (D) => this.createTreeNode(D, a, a.visible ? 1 : 0, c, d, r)), g = e[e.length - 1];
    let m = 0;
    for (let D = g; D >= 0 && D < a.children.length; D--) {
      const N = a.children[D];
      if (N.visible) {
        m = N.visibleChildIndex;
        break;
      }
    }
    const _ = [];
    let v = 0, w = 0;
    for (const D of h)
      _.push(D), w += D.renderNodeCount, D.visible && (D.visibleChildIndex = m + v++);
    const E = OV(a.children, g, t, _);
    o ? a.lastDiffIds ? OV(a.lastDiffIds, g, t, _.map((D) => o.getId(D.element).toString())) : a.lastDiffIds = a.children.map((D) => o.getId(D.element).toString()) : a.lastDiffIds = void 0;
    let L = 0;
    for (const D of E)
      D.visible && L++;
    if (L !== 0)
      for (let D = g + _.length; D < a.children.length; D++) {
        const N = a.children[D];
        N.visible && (N.visibleChildIndex -= L);
      }
    if (a.visibleChildrenCount += v - L, E.length > 0 && s) {
      const D = (N) => {
        s(N), N.children.forEach(D);
      };
      E.forEach(D);
    }
    if (c && u) {
      const D = E.reduce((N, R) => N + (R.visible ? R.renderNodeCount : 0), 0);
      this._updateAncestorsRenderNodeCount(a, w - D), this._onDidSpliceRenderedNodes.fire({ start: l, deleteCount: D, elements: d });
    }
    this._onDidSpliceModel.fire({ insertedNodes: _, deletedNodes: E });
    let T = a;
    for (; T; ) {
      if (T.visibility === 2) {
        this.refilterDelayer.trigger(() => this.refilter());
        break;
      }
      T = T.parent;
    }
  }
  rerender(e) {
    if (e.length === 0)
      throw new Ah(this.user, "Invalid tree location");
    const { node: t, listIndex: n, revealed: r } = this.getTreeNodeWithListIndex(e);
    t.visible && r && this._onDidSpliceRenderedNodes.fire({ start: n, deleteCount: 1, elements: [t] });
  }
  has(e) {
    return this.hasTreeNode(e);
  }
  getListIndex(e) {
    const { listIndex: t, visible: n, revealed: r } = this.getTreeNodeWithListIndex(e);
    return n && r ? t : -1;
  }
  getListRenderCount(e) {
    return this.getTreeNode(e).renderNodeCount;
  }
  isCollapsible(e) {
    return this.getTreeNode(e).collapsible;
  }
  setCollapsible(e, t) {
    const n = this.getTreeNode(e);
    typeof t > "u" && (t = !n.collapsible);
    const r = { collapsible: t };
    return this.eventBufferer.bufferEvents(() => this._setCollapseState(e, r));
  }
  isCollapsed(e) {
    return this.getTreeNode(e).collapsed;
  }
  setCollapsed(e, t, n) {
    const r = this.getTreeNode(e);
    typeof t > "u" && (t = !r.collapsed);
    const s = { collapsed: t, recursive: n || !1 };
    return this.eventBufferer.bufferEvents(() => this._setCollapseState(e, s));
  }
  _setCollapseState(e, t) {
    const { node: n, listIndex: r, revealed: s } = this.getTreeNodeWithListIndex(e), o = this._setListNodeCollapseState(n, r, s, t);
    if (n !== this.root && this.autoExpandSingleChildren && o && !Qee(t) && n.collapsible && !n.collapsed && !t.recursive) {
      let a = -1;
      for (let l = 0; l < n.children.length; l++)
        if (n.children[l].visible)
          if (a > -1) {
            a = -1;
            break;
          } else
            a = l;
      a > -1 && this._setCollapseState([...e, a], t);
    }
    return o;
  }
  _setListNodeCollapseState(e, t, n, r) {
    const s = this._setNodeCollapseState(e, r, !1);
    if (!n || !e.visible || !s)
      return s;
    const o = e.renderNodeCount, a = this.updateNodeAfterCollapseChange(e), l = o - (t === -1 ? 0 : 1);
    return this._onDidSpliceRenderedNodes.fire({ start: t + 1, deleteCount: l, elements: a.slice(1) }), s;
  }
  _setNodeCollapseState(e, t, n) {
    let r;
    if (e === this.root ? r = !1 : (Qee(t) ? (r = e.collapsible !== t.collapsible, e.collapsible = t.collapsible) : e.collapsible ? (r = e.collapsed !== t.collapsed, e.collapsed = t.collapsed) : r = !1, r && this._onDidChangeCollapseState.fire({ node: e, deep: n })), !Qee(t) && t.recursive)
      for (const s of e.children)
        r = this._setNodeCollapseState(s, t, !0) || r;
    return r;
  }
  expandTo(e) {
    this.eventBufferer.bufferEvents(() => {
      let t = this.getTreeNode(e);
      for (; t.parent; )
        t = t.parent, e = e.slice(0, e.length - 1), t.collapsed && this._setCollapseState(e, { collapsed: !1, recursive: !1 });
    });
  }
  refilter() {
    const e = this.root.renderNodeCount, t = this.updateNodeAfterFilterChange(this.root);
    this._onDidSpliceRenderedNodes.fire({ start: 0, deleteCount: e, elements: t }), this.refilterDelayer.cancel();
  }
  createTreeNode(e, t, n, r, s, o) {
    const a = {
      parent: t,
      element: e.element,
      children: [],
      depth: t.depth + 1,
      visibleChildrenCount: 0,
      visibleChildIndex: -1,
      collapsible: typeof e.collapsible == "boolean" ? e.collapsible : typeof e.collapsed < "u",
      collapsed: typeof e.collapsed > "u" ? this.collapseByDefault : e.collapsed,
      renderNodeCount: 1,
      visibility: 1,
      visible: !0,
      filterData: void 0
    }, l = this._filterNode(a, n);
    a.visibility = l, r && s.push(a);
    const c = e.children || gi.empty(), u = r && l !== 0 && !a.collapsed;
    let d = 0, h = 1;
    for (const g of c) {
      const m = this.createTreeNode(g, a, l, u, s, o);
      a.children.push(m), h += m.renderNodeCount, m.visible && (m.visibleChildIndex = d++);
    }
    return this.allowNonCollapsibleParents || (a.collapsible = a.collapsible || a.children.length > 0), a.visibleChildrenCount = d, a.visible = l === 2 ? d > 0 : l === 1, a.visible ? a.collapsed || (a.renderNodeCount = h) : (a.renderNodeCount = 0, r && s.pop()), o == null || o(a), a;
  }
  updateNodeAfterCollapseChange(e) {
    const t = e.renderNodeCount, n = [];
    return this._updateNodeAfterCollapseChange(e, n), this._updateAncestorsRenderNodeCount(e.parent, n.length - t), n;
  }
  _updateNodeAfterCollapseChange(e, t) {
    if (e.visible === !1)
      return 0;
    if (t.push(e), e.renderNodeCount = 1, !e.collapsed)
      for (const n of e.children)
        e.renderNodeCount += this._updateNodeAfterCollapseChange(n, t);
    return this._onDidChangeRenderNodeCount.fire(e), e.renderNodeCount;
  }
  updateNodeAfterFilterChange(e) {
    const t = e.renderNodeCount, n = [];
    return this._updateNodeAfterFilterChange(e, e.visible ? 1 : 0, n), this._updateAncestorsRenderNodeCount(e.parent, n.length - t), n;
  }
  _updateNodeAfterFilterChange(e, t, n, r = !0) {
    let s;
    if (e !== this.root) {
      if (s = this._filterNode(e, t), s === 0)
        return e.visible = !1, e.renderNodeCount = 0, !1;
      r && n.push(e);
    }
    const o = n.length;
    e.renderNodeCount = e === this.root ? 0 : 1;
    let a = !1;
    if (!e.collapsed || s !== 0) {
      let l = 0;
      for (const c of e.children)
        a = this._updateNodeAfterFilterChange(c, s, n, r && !e.collapsed) || a, c.visible && (c.visibleChildIndex = l++);
      e.visibleChildrenCount = l;
    } else
      e.visibleChildrenCount = 0;
    return e !== this.root && (e.visible = s === 2 ? a : s === 1, e.visibility = s), e.visible ? e.collapsed || (e.renderNodeCount += n.length - o) : (e.renderNodeCount = 0, r && n.pop()), this._onDidChangeRenderNodeCount.fire(e), e.visible;
  }
  _updateAncestorsRenderNodeCount(e, t) {
    if (t !== 0)
      for (; e; )
        e.renderNodeCount += t, this._onDidChangeRenderNodeCount.fire(e), e = e.parent;
  }
  _filterNode(e, t) {
    const n = this.filter ? this.filter.filter(e.element, t) : 1;
    return typeof n == "boolean" ? (e.filterData = void 0, n ? 1 : 0) : zB(n) ? (e.filterData = n.data, ST(n.visibility)) : (e.filterData = void 0, ST(n));
  }
  // cheap
  hasTreeNode(e, t = this.root) {
    if (!e || e.length === 0)
      return !0;
    const [n, ...r] = e;
    return n < 0 || n > t.children.length ? !1 : this.hasTreeNode(r, t.children[n]);
  }
  // cheap
  getTreeNode(e, t = this.root) {
    if (!e || e.length === 0)
      return t;
    const [n, ...r] = e;
    if (n < 0 || n > t.children.length)
      throw new Ah(this.user, "Invalid tree location");
    return this.getTreeNode(r, t.children[n]);
  }
  // expensive
  getTreeNodeWithListIndex(e) {
    if (e.length === 0)
      return { node: this.root, listIndex: -1, revealed: !0, visible: !1 };
    const { parentNode: t, listIndex: n, revealed: r, visible: s } = this.getParentNodeWithListIndex(e), o = e[e.length - 1];
    if (o < 0 || o > t.children.length)
      throw new Ah(this.user, "Invalid tree location");
    const a = t.children[o];
    return { node: a, listIndex: n, revealed: r, visible: s && a.visible };
  }
  getParentNodeWithListIndex(e, t = this.root, n = 0, r = !0, s = !0) {
    const [o, ...a] = e;
    if (o < 0 || o > t.children.length)
      throw new Ah(this.user, "Invalid tree location");
    for (let l = 0; l < o; l++)
      n += t.children[l].renderNodeCount;
    return r = r && !t.collapsed, s = s && t.visible, a.length === 0 ? { parentNode: t, listIndex: n, revealed: r, visible: s } : this.getParentNodeWithListIndex(a, t.children[o], n + 1, r, s);
  }
  getNode(e = []) {
    return this.getTreeNode(e);
  }
  // TODO@joao perf!
  getNodeLocation(e) {
    const t = [];
    let n = e;
    for (; n.parent; )
      t.push(n.parent.children.indexOf(n)), n = n.parent;
    return t.reverse();
  }
  getParentNodeLocation(e) {
    if (e.length !== 0)
      return e.length === 1 ? [] : Qnt(e)[0];
  }
  getFirstElementChild(e) {
    const t = this.getTreeNode(e);
    if (t.children.length !== 0)
      return t.children[0].element;
  }
}
class vwt extends OB {
  constructor(e) {
    super(e.elements.map((t) => t.element)), this.data = e;
  }
}
function Jee(i) {
  return i instanceof OB ? new vwt(i) : i;
}
class ywt {
  constructor(e, t) {
    this.modelProvider = e, this.dnd = t, this.autoExpandDisposable = ge.None, this.disposables = new ke();
  }
  getDragURI(e) {
    return this.dnd.getDragURI(e.element);
  }
  getDragLabel(e, t) {
    if (this.dnd.getDragLabel)
      return this.dnd.getDragLabel(e.map((n) => n.element), t);
  }
  onDragStart(e, t) {
    var n, r;
    (r = (n = this.dnd).onDragStart) == null || r.call(n, Jee(e), t);
  }
  onDragOver(e, t, n, r, s, o = !0) {
    const a = this.dnd.onDragOver(Jee(e), t && t.element, n, r, s), l = this.autoExpandNode !== t;
    if (l && (this.autoExpandDisposable.dispose(), this.autoExpandNode = t), typeof t > "u")
      return a;
    if (l && typeof a != "boolean" && a.autoExpand && (this.autoExpandDisposable = jy(() => {
      const g = this.modelProvider(), m = g.getNodeLocation(t);
      g.isCollapsed(m) && g.setCollapsed(m, !1), this.autoExpandNode = void 0;
    }, 500, this.disposables)), typeof a == "boolean" || !a.accept || typeof a.bubble > "u" || a.feedback) {
      if (!o) {
        const g = typeof a == "boolean" ? a : a.accept, m = typeof a == "boolean" ? void 0 : a.effect;
        return { accept: g, effect: m, feedback: [n] };
      }
      return a;
    }
    if (a.bubble === 1) {
      const g = this.modelProvider(), m = g.getNodeLocation(t), _ = g.getParentNodeLocation(m), v = g.getNode(_), w = _ && g.getListIndex(_);
      return this.onDragOver(e, v, w, r, s, !1);
    }
    const c = this.modelProvider(), u = c.getNodeLocation(t), d = c.getListIndex(u), h = c.getListRenderCount(u);
    return { ...a, feedback: Hu(d, d + h) };
  }
  drop(e, t, n, r, s) {
    this.autoExpandDisposable.dispose(), this.autoExpandNode = void 0, this.dnd.drop(Jee(e), t && t.element, n, r, s);
  }
  onDragEnd(e) {
    var t, n;
    (n = (t = this.dnd).onDragEnd) == null || n.call(t, e);
  }
  dispose() {
    this.disposables.dispose(), this.dnd.dispose();
  }
}
function Cwt(i, e, t) {
  return t && {
    ...t,
    identityProvider: t.identityProvider && {
      getId(n) {
        return t.identityProvider.getId(n.element);
      }
    },
    dnd: t.dnd && e.add(new ywt(i, t.dnd)),
    multipleSelectionController: t.multipleSelectionController && {
      isSelectionSingleChangeEvent(n) {
        return t.multipleSelectionController.isSelectionSingleChangeEvent({ ...n, element: n.element });
      },
      isSelectionRangeChangeEvent(n) {
        return t.multipleSelectionController.isSelectionRangeChangeEvent({ ...n, element: n.element });
      }
    },
    accessibilityProvider: t.accessibilityProvider && {
      ...t.accessibilityProvider,
      getSetSize(n) {
        const r = i(), s = r.getNodeLocation(n), o = r.getParentNodeLocation(s);
        return r.getNode(o).visibleChildrenCount;
      },
      getPosInSet(n) {
        return n.visibleChildIndex + 1;
      },
      isChecked: t.accessibilityProvider && t.accessibilityProvider.isChecked ? (n) => t.accessibilityProvider.isChecked(n.element) : void 0,
      getRole: t.accessibilityProvider && t.accessibilityProvider.getRole ? (n) => t.accessibilityProvider.getRole(n.element) : () => "treeitem",
      getAriaLabel(n) {
        return t.accessibilityProvider.getAriaLabel(n.element);
      },
      getWidgetAriaLabel() {
        return t.accessibilityProvider.getWidgetAriaLabel();
      },
      getWidgetRole: t.accessibilityProvider && t.accessibilityProvider.getWidgetRole ? () => t.accessibilityProvider.getWidgetRole() : () => "tree",
      getAriaLevel: t.accessibilityProvider && t.accessibilityProvider.getAriaLevel ? (n) => t.accessibilityProvider.getAriaLevel(n.element) : (n) => n.depth,
      getActiveDescendantId: t.accessibilityProvider.getActiveDescendantId && ((n) => t.accessibilityProvider.getActiveDescendantId(n.element))
    },
    keyboardNavigationLabelProvider: t.keyboardNavigationLabelProvider && {
      ...t.keyboardNavigationLabelProvider,
      getKeyboardNavigationLabel(n) {
        return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(n.element);
      }
    }
  };
}
class npe {
  constructor(e) {
    this.delegate = e;
  }
  getHeight(e) {
    return this.delegate.getHeight(e.element);
  }
  getTemplateId(e) {
    return this.delegate.getTemplateId(e.element);
  }
  hasDynamicHeight(e) {
    return !!this.delegate.hasDynamicHeight && this.delegate.hasDynamicHeight(e.element);
  }
  setDynamicHeight(e, t) {
    var n, r;
    (r = (n = this.delegate).setDynamicHeight) == null || r.call(n, e.element, t);
  }
}
var ET;
(function(i) {
  i.None = "none", i.OnHover = "onHover", i.Always = "always";
})(ET || (ET = {}));
class wwt {
  get elements() {
    return this._elements;
  }
  constructor(e, t = []) {
    this._elements = t, this.disposables = new ke(), this.onDidChange = Ze.forEach(e, (n) => this._elements = n, this.disposables);
  }
  dispose() {
    this.disposables.dispose();
  }
}
const BN = class BN {
  constructor(e, t, n, r, s, o = {}) {
    var a;
    this.renderer = e, this.model = t, this.activeNodes = r, this.renderedIndentGuides = s, this.renderedElements = /* @__PURE__ */ new Map(), this.renderedNodes = /* @__PURE__ */ new Map(), this.indent = BN.DefaultIndent, this.hideTwistiesOfChildlessElements = !1, this.shouldRenderIndentGuides = !1, this.activeIndentNodes = /* @__PURE__ */ new Set(), this.indentGuidesDisposable = ge.None, this.disposables = new ke(), this.templateId = e.templateId, this.updateOptions(o), Ze.map(n, (l) => l.node)(this.onDidChangeNodeTwistieState, this, this.disposables), (a = e.onDidChangeTwistieState) == null || a.call(e, this.onDidChangeTwistieState, this, this.disposables);
  }
  updateOptions(e = {}) {
    if (typeof e.indent < "u") {
      const t = Jc(e.indent, 0, 40);
      if (t !== this.indent) {
        this.indent = t;
        for (const [n, r] of this.renderedNodes)
          r.indentSize = BN.DefaultIndent + (n.depth - 1) * this.indent, this.renderTreeElement(n, r);
      }
    }
    if (typeof e.renderIndentGuides < "u") {
      const t = e.renderIndentGuides !== ET.None;
      if (t !== this.shouldRenderIndentGuides) {
        this.shouldRenderIndentGuides = t;
        for (const [n, r] of this.renderedNodes)
          this._renderIndentGuides(n, r);
        if (this.indentGuidesDisposable.dispose(), t) {
          const n = new ke();
          this.activeNodes.onDidChange(this._onDidChangeActiveNodes, this, n), this.indentGuidesDisposable = n, this._onDidChangeActiveNodes(this.activeNodes.elements);
        }
      }
    }
    typeof e.hideTwistiesOfChildlessElements < "u" && (this.hideTwistiesOfChildlessElements = e.hideTwistiesOfChildlessElements);
  }
  renderTemplate(e) {
    const t = Fe(e, Ge(".monaco-tl-row")), n = Fe(t, Ge(".monaco-tl-indent")), r = Fe(t, Ge(".monaco-tl-twistie")), s = Fe(t, Ge(".monaco-tl-contents")), o = this.renderer.renderTemplate(s);
    return { container: e, indent: n, twistie: r, indentGuidesDisposable: ge.None, indentSize: 0, templateData: o };
  }
  renderElement(e, t, n, r) {
    n.indentSize = BN.DefaultIndent + (e.depth - 1) * this.indent, this.renderedNodes.set(e, n), this.renderedElements.set(e.element, e), this.renderTreeElement(e, n), this.renderer.renderElement(e, t, n.templateData, { ...r, indent: n.indentSize });
  }
  disposeElement(e, t, n, r) {
    var s, o;
    n.indentGuidesDisposable.dispose(), (o = (s = this.renderer).disposeElement) == null || o.call(s, e, t, n.templateData, { ...r, indent: n.indentSize }), typeof (r == null ? void 0 : r.height) == "number" && (this.renderedNodes.delete(e), this.renderedElements.delete(e.element));
  }
  disposeTemplate(e) {
    this.renderer.disposeTemplate(e.templateData);
  }
  onDidChangeTwistieState(e) {
    const t = this.renderedElements.get(e);
    t && this.onDidChangeNodeTwistieState(t);
  }
  onDidChangeNodeTwistieState(e) {
    const t = this.renderedNodes.get(e);
    t && (this._onDidChangeActiveNodes(this.activeNodes.elements), this.renderTreeElement(e, t));
  }
  renderTreeElement(e, t) {
    t.twistie.style.paddingLeft = `${t.indentSize}px`, t.indent.style.width = `${t.indentSize + this.indent - 16}px`, e.collapsible ? t.container.setAttribute("aria-expanded", String(!e.collapsed)) : t.container.removeAttribute("aria-expanded"), t.twistie.classList.remove(...qt.asClassNameArray(Pe.treeItemExpanded));
    let n = !1;
    this.renderer.renderTwistie && (n = this.renderer.renderTwistie(e.element, t.twistie)), e.collapsible && (!this.hideTwistiesOfChildlessElements || e.visibleChildrenCount > 0) ? (n || t.twistie.classList.add(...qt.asClassNameArray(Pe.treeItemExpanded)), t.twistie.classList.add("collapsible"), t.twistie.classList.toggle("collapsed", e.collapsed)) : t.twistie.classList.remove("collapsible", "collapsed"), this._renderIndentGuides(e, t);
  }
  _renderIndentGuides(e, t) {
    if (Xa(t.indent), t.indentGuidesDisposable.dispose(), !this.shouldRenderIndentGuides)
      return;
    const n = new ke();
    for (; ; ) {
      const r = this.model.getNodeLocation(e), s = this.model.getParentNodeLocation(r);
      if (!s)
        break;
      const o = this.model.getNode(s), a = Ge(".indent-guide", { style: `width: ${this.indent}px` });
      this.activeIndentNodes.has(o) && a.classList.add("active"), t.indent.childElementCount === 0 ? t.indent.appendChild(a) : t.indent.insertBefore(a, t.indent.firstElementChild), this.renderedIndentGuides.add(o, a), n.add(Et(() => this.renderedIndentGuides.delete(o, a))), e = o;
    }
    t.indentGuidesDisposable = n;
  }
  _onDidChangeActiveNodes(e) {
    if (!this.shouldRenderIndentGuides)
      return;
    const t = /* @__PURE__ */ new Set();
    e.forEach((n) => {
      const r = this.model.getNodeLocation(n);
      try {
        const s = this.model.getParentNodeLocation(r);
        n.collapsible && n.children.length > 0 && !n.collapsed ? t.add(n) : s && t.add(this.model.getNode(s));
      } catch {
      }
    }), this.activeIndentNodes.forEach((n) => {
      t.has(n) || this.renderedIndentGuides.forEach(n, (r) => r.classList.remove("active"));
    }), t.forEach((n) => {
      this.activeIndentNodes.has(n) || this.renderedIndentGuides.forEach(n, (r) => r.classList.add("active"));
    }), this.activeIndentNodes = t;
  }
  dispose() {
    this.renderedNodes.clear(), this.renderedElements.clear(), this.indentGuidesDisposable.dispose(), or(this.disposables);
  }
};
BN.DefaultIndent = 8;
let roe = BN;
function Swt(i, e) {
  const t = e.toLowerCase().indexOf(i);
  let n;
  if (t > -1) {
    n = [Number.MAX_SAFE_INTEGER, 0];
    for (let r = i.length; r > 0; r--)
      n.push(t + r - 1);
  }
  return n;
}
class JBe {
  get totalCount() {
    return this._totalCount;
  }
  get matchCount() {
    return this._matchCount;
  }
  set findMatchType(e) {
    this._findMatchType = e;
  }
  get findMatchType() {
    return this._findMatchType;
  }
  set findMode(e) {
    this._findMode = e;
  }
  get findMode() {
    return this._findMode;
  }
  constructor(e, t, n) {
    this._keyboardNavigationLabelProvider = e, this._filter = t, this._defaultFindVisibility = n, this._totalCount = 0, this._matchCount = 0, this._findMatchType = Zp.Fuzzy, this._findMode = Oh.Highlight, this._pattern = "", this._lowercasePattern = "", this.disposables = new ke();
  }
  filter(e, t) {
    let n = 1;
    if (this._filter) {
      const o = this._filter.filter(e, t);
      if (typeof o == "boolean" ? n = o ? 1 : 0 : zB(o) ? n = ST(o.visibility) : n = o, n === 0)
        return !1;
    }
    if (this._totalCount++, !this._pattern)
      return this._matchCount++, { data: $g.Default, visibility: n };
    const r = this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e), s = Array.isArray(r) ? r : [r];
    for (const o of s) {
      const a = o && o.toString();
      if (typeof a > "u")
        return { data: $g.Default, visibility: n };
      let l;
      if (this._findMatchType === Zp.Contiguous ? l = Swt(this._lowercasePattern, a.toLowerCase()) : l = hT(this._pattern, this._lowercasePattern, 0, a, a.toLowerCase(), 0, { firstMatchCanBeWeak: !0, boostFullMatch: !0 }), l)
        return this._matchCount++, s.length === 1 ? { data: l, visibility: n } : { data: { label: a, score: l }, visibility: n };
    }
    return this._findMode === Oh.Filter ? typeof this._defaultFindVisibility == "number" ? this._defaultFindVisibility : this._defaultFindVisibility ? this._defaultFindVisibility(e) : 2 : { data: $g.Default, visibility: n };
  }
  reset() {
    this._totalCount = 0, this._matchCount = 0;
  }
  dispose() {
    or(this.disposables);
  }
}
class Ewt {
  constructor(e) {
    this.stateMap = new Map(e.map((t) => [t.id, { ...t }]));
  }
  get(e) {
    const t = this.stateMap.get(e);
    if (t === void 0)
      throw new Error(`No state found for toggle id ${e}`);
    return t.isChecked;
  }
  set(e, t) {
    const n = this.stateMap.get(e);
    if (n === void 0)
      throw new Error(`No state found for toggle id ${e}`);
    return n.isChecked === t ? !1 : (n.isChecked = t, !0);
  }
}
var Oh;
(function(i) {
  i[i.Highlight = 0] = "Highlight", i[i.Filter = 1] = "Filter";
})(Oh || (Oh = {}));
var Zp;
(function(i) {
  i[i.Fuzzy = 0] = "Fuzzy", i[i.Contiguous = 1] = "Contiguous";
})(Zp || (Zp = {}));
var HC;
(function(i) {
  i.Mode = "mode", i.MatchType = "matchType";
})(HC || (HC = {}));
class xwt {
  get pattern() {
    return this._pattern;
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e) {
    var t;
    this._placeholder = e, (t = this.widget) == null || t.setPlaceHolder(e);
  }
  constructor(e, t, n, r = {}) {
    this.tree = e, this.filter = t, this.contextViewProvider = n, this.options = r, this._pattern = "", this._onDidChangePattern = new he(), this._onDidChangeOpenState = new he(), this.onDidChangeOpenState = this._onDidChangeOpenState.event, this.enabledDisposables = new ke(), this.disposables = new ke(), this.toggles = new Ewt(r.toggles ?? []), this._placeholder = r.placeholder ?? S(20, "Type to search");
  }
  isOpened() {
    return !!this.widget;
  }
  updateToggleState(e, t) {
    var n;
    this.toggles.set(e, t), (n = this.widget) == null || n.setToggleState(e, t);
  }
  renderMessage(e, t) {
    var n, r, s;
    e ? this.tree.options.showNotFoundMessage ?? !0 ? (n = this.widget) == null || n.showMessage({ type: 2, content: t ?? S(21, "No results found.") }) : (r = this.widget) == null || r.showMessage({
      type: 2
      /* MessageType.WARNING */
    }) : (s = this.widget) == null || s.clearMessage();
  }
  alertResults(e) {
    lu(e ? S(23, "{0} results", e) : S(22, "No results"));
  }
  dispose() {
    this._history = void 0, this._onDidChangePattern.dispose(), this.enabledDisposables.dispose(), this.disposables.dispose();
  }
}
let e6e = class extends xwt {
  get mode() {
    return this.toggles.get(HC.Mode) ? Oh.Filter : Oh.Highlight;
  }
  set mode(e) {
    if (e === this.mode)
      return;
    const t = e === Oh.Filter;
    this.updateToggleState(HC.Mode, t), this.placeholder = t ? S(24, "Type to filter") : S(25, "Type to search"), this.filter.findMode = e, this.tree.refilter(), this.render(), this._onDidChangeMode.fire(e);
  }
  get matchType() {
    return this.toggles.get(HC.MatchType) ? Zp.Fuzzy : Zp.Contiguous;
  }
  set matchType(e) {
    e !== this.matchType && (this.updateToggleState(HC.MatchType, e === Zp.Fuzzy), this.filter.findMatchType = e, this.tree.refilter(), this.render(), this._onDidChangeMatchType.fire(e));
  }
  constructor(e, t, n, r = {}) {
    const s = r.defaultFindMode ?? Oh.Highlight, o = r.defaultFindMatchType ?? Zp.Fuzzy, a = [{
      id: HC.Mode,
      icon: Pe.listFilter,
      title: S(26, "Filter"),
      isChecked: s === Oh.Filter
    }, {
      id: HC.MatchType,
      icon: Pe.searchFuzzy,
      title: S(27, "Fuzzy Match"),
      isChecked: o === Zp.Fuzzy
    }];
    t.findMatchType = o, t.findMode = s, super(e, t, n, { ...r, toggles: a }), this.filter = t, this._onDidChangeMode = new he(), this.onDidChangeMode = this._onDidChangeMode.event, this._onDidChangeMatchType = new he(), this.onDidChangeMatchType = this._onDidChangeMatchType.event, this.disposables.add(this.tree.onDidChangeModel(() => {
      this.isOpened() && (this.pattern.length !== 0 && this.tree.refilter(), this.render());
    })), this.disposables.add(this.tree.onWillRefilter(() => this.filter.reset()));
  }
  updateOptions(e = {}) {
    e.defaultFindMode !== void 0 && (this.mode = e.defaultFindMode), e.defaultFindMatchType !== void 0 && (this.matchType = e.defaultFindMatchType);
  }
  shouldAllowFocus(e) {
    return !this.isOpened() || !this.pattern || this.filter.totalCount > 0 && this.filter.matchCount <= 1 ? !0 : !$g.isDefault(e.filterData);
  }
  render() {
    const t = this.filter.matchCount === 0 && this.filter.totalCount > 0 && this.pattern.length > 0;
    this.renderMessage(t), this.pattern.length && this.alertResults(this.filter.matchCount);
  }
};
function Lwt(i, e) {
  return i.position === e.position && t6e(i, e);
}
function t6e(i, e) {
  return i.node.element === e.node.element && i.startIndex === e.startIndex && i.height === e.height && i.endIndex === e.endIndex;
}
class Twt {
  constructor(e = []) {
    this.stickyNodes = e;
  }
  get count() {
    return this.stickyNodes.length;
  }
  equal(e) {
    return ds(this.stickyNodes, e.stickyNodes, Lwt);
  }
  contains(e) {
    return this.stickyNodes.some((t) => t.node.element === e.element);
  }
  lastNodePartiallyVisible() {
    if (this.count === 0)
      return !1;
    const e = this.stickyNodes[this.count - 1];
    if (this.count === 1)
      return e.position !== 0;
    const t = this.stickyNodes[this.count - 2];
    return t.position + t.height !== e.position;
  }
  animationStateChanged(e) {
    if (!ds(this.stickyNodes, e.stickyNodes, t6e) || this.count === 0)
      return !1;
    const t = this.stickyNodes[this.count - 1], n = e.stickyNodes[e.count - 1];
    return t.position !== n.position;
  }
}
class kwt {
  constrainStickyScrollNodes(e, t, n) {
    for (let r = 0; r < e.length; r++) {
      const s = e[r];
      if (s.position + s.height > n || r >= t)
        return e.slice(0, r);
    }
    return e;
  }
}
let ODe = class extends ge {
  constructor(e, t, n, r, s, o = {}) {
    super(), this.tree = e, this.model = t, this.view = n, this.treeDelegate = s, this.maxWidgetViewRatio = 0.4;
    const a = this.validateStickySettings(o);
    this.stickyScrollMaxItemCount = a.stickyScrollMaxItemCount, this.stickyScrollDelegate = o.stickyScrollDelegate ?? new kwt(), this.paddingTop = o.paddingTop ?? 0, this._widget = this._register(new Dwt(n.getScrollableElement(), n, e, r, s, o.accessibilityProvider)), this.onDidChangeHasFocus = this._widget.onDidChangeHasFocus, this.onContextMenu = this._widget.onContextMenu, this._register(n.onDidScroll(() => this.update())), this._register(n.onDidChangeContentHeight(() => this.update())), this._register(e.onDidChangeCollapseState(() => this.update())), this._register(t.onDidSpliceRenderedNodes((l) => {
      const c = this._widget.state;
      if (!c)
        return;
      if (l.deleteCount > 0 && c.stickyNodes.some((h) => !this.model.has(this.model.getNodeLocation(h.node)))) {
        this.update();
        return;
      }
      c.stickyNodes.some((h) => {
        const g = this.model.getListIndex(this.model.getNodeLocation(h.node));
        return g >= l.start && g < l.start + l.deleteCount && c.contains(h.node);
      }) && this._widget.rerender();
    })), this.update();
  }
  get height() {
    return this._widget.height;
  }
  getNodeAtHeight(e) {
    let t;
    if (e === 0 ? t = this.view.firstVisibleIndex : t = this.view.indexAt(e + this.view.scrollTop), !(t < 0 || t >= this.view.length))
      return this.view.element(t);
  }
  update() {
    const e = this.getNodeAtHeight(this.paddingTop);
    if (!e || this.tree.scrollTop <= this.paddingTop) {
      this._widget.setState(void 0);
      return;
    }
    const t = this.findStickyState(e);
    this._widget.setState(t);
  }
  findStickyState(e) {
    const t = [];
    let n = e, r = 0, s = this.getNextStickyNode(n, void 0, r);
    for (; s && (t.push(s), r += s.height, !(t.length <= this.stickyScrollMaxItemCount && (n = this.getNextVisibleNode(s), !n))); )
      s = this.getNextStickyNode(n, s.node, r);
    const o = this.constrainStickyNodes(t);
    return o.length ? new Twt(o) : void 0;
  }
  getNextVisibleNode(e) {
    return this.getNodeAtHeight(e.position + e.height);
  }
  getNextStickyNode(e, t, n) {
    const r = this.getAncestorUnderPrevious(e, t);
    if (r && !(r === e && (!this.nodeIsUncollapsedParent(e) || this.nodeTopAlignsWithStickyNodesBottom(e, n))))
      return this.createStickyScrollNode(r, n);
  }
  nodeTopAlignsWithStickyNodesBottom(e, t) {
    const n = this.getNodeIndex(e), r = this.view.getElementTop(n), s = t;
    return this.view.scrollTop === r - s;
  }
  createStickyScrollNode(e, t) {
    const n = this.treeDelegate.getHeight(e), { startIndex: r, endIndex: s } = this.getNodeRange(e), o = this.calculateStickyNodePosition(s, t, n);
    return { node: e, position: o, height: n, startIndex: r, endIndex: s };
  }
  getAncestorUnderPrevious(e, t = void 0) {
    let n = e, r = this.getParentNode(n);
    for (; r; ) {
      if (r === t)
        return n;
      n = r, r = this.getParentNode(n);
    }
    if (t === void 0)
      return n;
  }
  calculateStickyNodePosition(e, t, n) {
    let r = this.view.getRelativeTop(e);
    if (r === null && this.view.firstVisibleIndex === e && e + 1 < this.view.length) {
      const c = this.treeDelegate.getHeight(this.view.element(e)), u = this.view.getRelativeTop(e + 1);
      r = u ? u - c / this.view.renderHeight : null;
    }
    if (r === null)
      return t;
    const s = this.view.element(e), o = this.treeDelegate.getHeight(s), l = r * this.view.renderHeight + o;
    return t + n > l && t <= l ? l - n : t;
  }
  constrainStickyNodes(e) {
    if (e.length === 0)
      return [];
    const t = this.view.renderHeight * this.maxWidgetViewRatio, n = e[e.length - 1];
    if (e.length <= this.stickyScrollMaxItemCount && n.position + n.height <= t)
      return e;
    const r = this.stickyScrollDelegate.constrainStickyScrollNodes(e, this.stickyScrollMaxItemCount, t);
    if (!r.length)
      return [];
    const s = r[r.length - 1];
    if (r.length > this.stickyScrollMaxItemCount || s.position + s.height > t)
      throw new Error("stickyScrollDelegate violates constraints");
    return r;
  }
  getParentNode(e) {
    const t = this.model.getNodeLocation(e), n = this.model.getParentNodeLocation(t);
    return n ? this.model.getNode(n) : void 0;
  }
  nodeIsUncollapsedParent(e) {
    const t = this.model.getNodeLocation(e);
    return this.model.getListRenderCount(t) > 1;
  }
  getNodeIndex(e) {
    const t = this.model.getNodeLocation(e);
    return this.model.getListIndex(t);
  }
  getNodeRange(e) {
    const t = this.model.getNodeLocation(e), n = this.model.getListIndex(t);
    if (n < 0)
      throw new Error("Node not found in tree");
    const r = this.model.getListRenderCount(t), s = n + r - 1;
    return { startIndex: n, endIndex: s };
  }
  nodePositionTopBelowWidget(e) {
    const t = [];
    let n = this.getParentNode(e);
    for (; n; )
      t.push(n), n = this.getParentNode(n);
    let r = 0;
    for (let s = 0; s < t.length && s < this.stickyScrollMaxItemCount; s++)
      r += this.treeDelegate.getHeight(t[s]);
    return r;
  }
  domFocus() {
    this._widget.domFocus();
  }
  // Whether sticky scroll was the last focused part in the tree or not
  focusedLast() {
    return this._widget.focusedLast();
  }
  updateOptions(e = {}) {
    if (e.paddingTop !== void 0 && (this.paddingTop = e.paddingTop), e.stickyScrollMaxItemCount !== void 0) {
      const t = this.validateStickySettings(e);
      this.stickyScrollMaxItemCount !== t.stickyScrollMaxItemCount && (this.stickyScrollMaxItemCount = t.stickyScrollMaxItemCount, this.update());
    }
  }
  validateStickySettings(e) {
    let t = 7;
    return typeof e.stickyScrollMaxItemCount == "number" && (t = Math.max(e.stickyScrollMaxItemCount, 1)), { stickyScrollMaxItemCount: t };
  }
}, Dwt = class {
  get state() {
    return this._previousState;
  }
  constructor(e, t, n, r, s, o) {
    this.view = t, this.tree = n, this.treeRenderers = r, this.treeDelegate = s, this.accessibilityProvider = o, this._previousElements = [], this._previousStateDisposables = new ke(), this._rootDomNode = Ge(".monaco-tree-sticky-container.empty"), e.appendChild(this._rootDomNode);
    const a = Ge(".monaco-tree-sticky-container-shadow");
    this._rootDomNode.appendChild(a), this.stickyScrollFocus = new Iwt(this._rootDomNode, t), this.onDidChangeHasFocus = this.stickyScrollFocus.onDidChangeHasFocus, this.onContextMenu = this.stickyScrollFocus.onContextMenu;
  }
  get height() {
    if (!this._previousState)
      return 0;
    const e = this._previousState.stickyNodes[this._previousState.count - 1];
    return e.position + e.height;
  }
  setState(e) {
    const t = !!this._previousState && this._previousState.count > 0, n = !!e && e.count > 0;
    if (!t && !n || t && n && this._previousState.equal(e))
      return;
    if (t !== n && this.setVisible(n), !n) {
      this._previousState = void 0, this._previousElements = [], this._previousStateDisposables.clear();
      return;
    }
    const r = e.stickyNodes[e.count - 1];
    this._previousState && e.animationStateChanged(this._previousState) ? this._previousElements[this._previousState.count - 1].style.top = `${r.position}px` : this.renderState(e), this._previousState = e, this._rootDomNode.style.height = `${r.position + r.height}px`;
  }
  renderState(e) {
    this._previousStateDisposables.clear();
    const t = Array(e.count);
    for (let n = e.count - 1; n >= 0; n--) {
      const r = e.stickyNodes[n], { element: s, disposable: o } = this.createElement(r, n, e.count);
      t[n] = s, this._rootDomNode.appendChild(s), this._previousStateDisposables.add(o);
    }
    this.stickyScrollFocus.updateElements(t, e), this._previousElements = t;
  }
  rerender() {
    this._previousState && this.renderState(this._previousState);
  }
  createElement(e, t, n) {
    const r = e.startIndex, s = document.createElement("div");
    s.style.top = `${e.position}px`, this.tree.options.setRowHeight !== !1 && (s.style.height = `${e.height}px`), this.tree.options.setRowLineHeight !== !1 && (s.style.lineHeight = `${e.height}px`), s.classList.add("monaco-tree-sticky-row"), s.classList.add("monaco-list-row"), s.setAttribute("data-index", `${r}`), s.setAttribute("data-parity", r % 2 === 0 ? "even" : "odd"), s.setAttribute("id", this.view.getElementID(r));
    const o = this.setAccessibilityAttributes(s, e.node.element, t, n), a = this.treeDelegate.getTemplateId(e.node), l = this.treeRenderers.find((h) => h.templateId === a);
    if (!l)
      throw new Error(`No renderer found for template id ${a}`);
    let c = e.node;
    c === this.tree.getNode(this.tree.getNodeLocation(e.node)) && (c = new Proxy(e.node, {}));
    const u = l.renderTemplate(s);
    l.renderElement(c, e.startIndex, u, { height: e.height });
    const d = Et(() => {
      o.dispose(), l.disposeElement(c, e.startIndex, u, { height: e.height }), l.disposeTemplate(u), s.remove();
    });
    return { element: s, disposable: d };
  }
  setAccessibilityAttributes(e, t, n, r) {
    if (!this.accessibilityProvider)
      return ge.None;
    this.accessibilityProvider.getSetSize && e.setAttribute("aria-setsize", String(this.accessibilityProvider.getSetSize(t, n, r))), this.accessibilityProvider.getPosInSet && e.setAttribute("aria-posinset", String(this.accessibilityProvider.getPosInSet(t, n))), this.accessibilityProvider.getRole && e.setAttribute("role", this.accessibilityProvider.getRole(t) ?? "treeitem");
    const s = this.accessibilityProvider.getAriaLabel(t), o = s && typeof s != "string" ? s : Br(s), a = Xt((c) => {
      const u = c.readObservable(o);
      u ? e.setAttribute("aria-label", u) : e.removeAttribute("aria-label");
    });
    typeof s == "string" || s && e.setAttribute("aria-label", s.get());
    const l = this.accessibilityProvider.getAriaLevel && this.accessibilityProvider.getAriaLevel(t);
    return typeof l == "number" && e.setAttribute("aria-level", `${l}`), e.setAttribute("aria-selected", String(!1)), a;
  }
  setVisible(e) {
    this._rootDomNode.classList.toggle("empty", !e), e || this.stickyScrollFocus.updateElements([], void 0);
  }
  domFocus() {
    this.stickyScrollFocus.domFocus();
  }
  focusedLast() {
    return this.stickyScrollFocus.focusedLast();
  }
  dispose() {
    this.stickyScrollFocus.dispose(), this._previousStateDisposables.dispose(), this._rootDomNode.remove();
  }
};
class Iwt extends ge {
  get domHasFocus() {
    return this._domHasFocus;
  }
  set domHasFocus(e) {
    e !== this._domHasFocus && (this._onDidChangeHasFocus.fire(e), this._domHasFocus = e);
  }
  constructor(e, t) {
    super(), this.container = e, this.view = t, this.focusedIndex = -1, this.elements = [], this._onDidChangeHasFocus = new he(), this.onDidChangeHasFocus = this._onDidChangeHasFocus.event, this._onContextMenu = new he(), this.onContextMenu = this._onContextMenu.event, this._domHasFocus = !1, this._register(Ce(this.container, "focus", () => this.onFocus())), this._register(Ce(this.container, "blur", () => this.onBlur())), this._register(this.view.onDidFocus(() => this.toggleStickyScrollFocused(!1))), this._register(this.view.onKeyDown((n) => this.onKeyDown(n))), this._register(this.view.onMouseDown((n) => this.onMouseDown(n))), this._register(this.view.onContextMenu((n) => this.handleContextMenu(n)));
  }
  handleContextMenu(e) {
    const t = e.browserEvent.target;
    if (!z4(t) && !VF(t)) {
      this.focusedLast() && this.view.domFocus();
      return;
    }
    if (!sy(e.browserEvent)) {
      if (!this.state)
        throw new Error("Context menu should not be triggered when state is undefined");
      const o = this.state.stickyNodes.findIndex((a) => {
        var l;
        return a.node.element === ((l = e.element) == null ? void 0 : l.element);
      });
      if (o === -1)
        throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");
      this.container.focus(), this.setFocus(o);
      return;
    }
    if (!this.state || this.focusedIndex < 0)
      throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");
    const r = this.state.stickyNodes[this.focusedIndex].node.element, s = this.elements[this.focusedIndex];
    this._onContextMenu.fire({ element: r, anchor: s, browserEvent: e.browserEvent, isStickyScroll: !0 });
  }
  onKeyDown(e) {
    if (this.domHasFocus && this.state) {
      if (e.key === "ArrowUp")
        this.setFocusedElement(Math.max(0, this.focusedIndex - 1)), e.preventDefault(), e.stopPropagation();
      else if (e.key === "ArrowDown" || e.key === "ArrowRight") {
        if (this.focusedIndex >= this.state.count - 1) {
          const t = this.state.stickyNodes[this.state.count - 1].startIndex + 1;
          this.view.domFocus(), this.view.setFocus([t]), this.scrollNodeUnderWidget(t, this.state);
        } else
          this.setFocusedElement(this.focusedIndex + 1);
        e.preventDefault(), e.stopPropagation();
      }
    }
  }
  onMouseDown(e) {
    const t = e.browserEvent.target;
    !z4(t) && !VF(t) || (e.browserEvent.preventDefault(), e.browserEvent.stopPropagation());
  }
  updateElements(e, t) {
    if (t && t.count === 0)
      throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");
    if (t && t.count !== e.length)
      throw new Error("Sticky scroll focus received illigel state");
    const n = this.focusedIndex;
    if (this.removeFocus(), this.elements = e, this.state = t, t) {
      const r = Jc(n, 0, t.count - 1);
      this.setFocus(r);
    } else
      this.domHasFocus && this.view.domFocus();
    this.container.tabIndex = t ? 0 : -1;
  }
  setFocusedElement(e) {
    const t = this.state;
    if (!t)
      throw new Error("Cannot set focus when state is undefined");
    if (this.setFocus(e), !(e < t.count - 1) && t.lastNodePartiallyVisible()) {
      const n = t.stickyNodes[e];
      this.scrollNodeUnderWidget(n.endIndex + 1, t);
    }
  }
  scrollNodeUnderWidget(e, t) {
    const n = t.stickyNodes[t.count - 1], r = t.count > 1 ? t.stickyNodes[t.count - 2] : void 0, s = this.view.getElementTop(e), o = r ? r.position + r.height + n.height : n.height;
    this.view.scrollTop = s - o;
  }
  domFocus() {
    if (!this.state)
      throw new Error("Cannot focus when state is undefined");
    this.container.focus();
  }
  focusedLast() {
    return this.state ? this.view.getHTMLElement().classList.contains("sticky-scroll-focused") : !1;
  }
  removeFocus() {
    this.focusedIndex !== -1 && (this.toggleElementFocus(this.elements[this.focusedIndex], !1), this.focusedIndex = -1);
  }
  setFocus(e) {
    if (0 > e)
      throw new Error("addFocus() can not remove focus");
    if (!this.state && e >= 0)
      throw new Error("Cannot set focus index when state is undefined");
    if (this.state && e >= this.state.count)
      throw new Error("Cannot set focus index to an index that does not exist");
    const t = this.focusedIndex;
    t >= 0 && this.toggleElementFocus(this.elements[t], !1), e >= 0 && this.toggleElementFocus(this.elements[e], !0), this.focusedIndex = e;
  }
  toggleElementFocus(e, t) {
    this.toggleElementActiveFocus(e, t && this.domHasFocus), this.toggleElementPassiveFocus(e, t);
  }
  toggleCurrentElementActiveFocus(e) {
    this.focusedIndex !== -1 && this.toggleElementActiveFocus(this.elements[this.focusedIndex], e);
  }
  toggleElementActiveFocus(e, t) {
    e.classList.toggle("focused", t);
  }
  toggleElementPassiveFocus(e, t) {
    e.classList.toggle("passive-focused", t);
  }
  toggleStickyScrollFocused(e) {
    this.view.getHTMLElement().classList.toggle("sticky-scroll-focused", e);
  }
  onFocus() {
    if (!this.state || this.elements.length === 0)
      throw new Error("Cannot focus when state is undefined or elements are empty");
    this.domHasFocus = !0, this.toggleStickyScrollFocused(!0), this.toggleCurrentElementActiveFocus(!0), this.focusedIndex === -1 && this.setFocus(0);
  }
  onBlur() {
    this.domHasFocus = !1, this.toggleCurrentElementActiveFocus(!1);
  }
  dispose() {
    this.toggleStickyScrollFocused(!1), this._onDidChangeHasFocus.fire(!1), super.dispose();
  }
}
function gH(i) {
  let e = Cx.Unknown;
  return VJ(i.browserEvent.target, "monaco-tl-twistie", "monaco-tl-row") ? e = Cx.Twistie : VJ(i.browserEvent.target, "monaco-tl-contents", "monaco-tl-row") ? e = Cx.Element : VJ(i.browserEvent.target, "monaco-tree-type-filter", "monaco-list") && (e = Cx.Filter), {
    browserEvent: i.browserEvent,
    element: i.element ? i.element.element : null,
    target: e
  };
}
function Nwt(i) {
  const e = z4(i.browserEvent.target);
  return {
    element: i.element ? i.element.element : null,
    browserEvent: i.browserEvent,
    anchor: i.anchor,
    isStickyScroll: e
  };
}
function VW(i, e) {
  e(i), i.children.forEach((t) => VW(t, e));
}
class ete {
  get nodeSet() {
    return this._nodeSet || (this._nodeSet = this.createNodeSet()), this._nodeSet;
  }
  constructor(e, t) {
    this.getFirstViewElementWithTrait = e, this.identityProvider = t, this.nodes = [], this._onDidChange = new he(), this.onDidChange = this._onDidChange.event;
  }
  set(e, t) {
    !(t != null && t.__forceEvent) && ds(this.nodes, e) || this._set(e, !1, t);
  }
  _set(e, t, n) {
    if (this.nodes = [...e], this.elements = void 0, this._nodeSet = void 0, !t) {
      const r = this;
      this._onDidChange.fire({ get elements() {
        return r.get();
      }, browserEvent: n });
    }
  }
  get() {
    return this.elements || (this.elements = this.nodes.map((e) => e.element)), [...this.elements];
  }
  getNodes() {
    return this.nodes;
  }
  has(e) {
    return this.nodeSet.has(e);
  }
  onDidModelSplice({ insertedNodes: e, deletedNodes: t }) {
    if (!this.identityProvider) {
      const l = this.createNodeSet(), c = (u) => l.delete(u);
      t.forEach((u) => VW(u, c)), this.set([...l.values()]);
      return;
    }
    const n = /* @__PURE__ */ new Set(), r = (l) => n.add(this.identityProvider.getId(l.element).toString());
    t.forEach((l) => VW(l, r));
    const s = /* @__PURE__ */ new Map(), o = (l) => s.set(this.identityProvider.getId(l.element).toString(), l);
    e.forEach((l) => VW(l, o));
    const a = [];
    for (const l of this.nodes) {
      const c = this.identityProvider.getId(l.element).toString();
      if (!n.has(c))
        a.push(l);
      else {
        const d = s.get(c);
        d && d.visible && a.push(d);
      }
    }
    if (this.nodes.length > 0 && a.length === 0) {
      const l = this.getFirstViewElementWithTrait();
      l && a.push(l);
    }
    this._set(a, !0);
  }
  createNodeSet() {
    const e = /* @__PURE__ */ new Set();
    for (const t of this.nodes)
      e.add(t);
    return e;
  }
}
class Rwt extends o5e {
  constructor(e, t, n) {
    super(e), this.tree = t, this.stickyScrollProvider = n;
  }
  onViewPointer(e) {
    if (n5e(e.browserEvent.target) || sm(e.browserEvent.target) || qP(e.browserEvent.target) || e.browserEvent.isHandledByList)
      return;
    const t = e.element;
    if (!t)
      return super.onViewPointer(e);
    if (this.isSelectionRangeChangeEvent(e) || this.isSelectionSingleChangeEvent(e))
      return super.onViewPointer(e);
    const n = e.browserEvent.target, r = n.classList.contains("monaco-tl-twistie") || n.classList.contains("monaco-icon-label") && n.classList.contains("folder-icon") && e.browserEvent.offsetX < 16, s = VF(e.browserEvent.target);
    let o = !1;
    if (s ? o = !0 : typeof this.tree.expandOnlyOnTwistieClick == "function" ? o = this.tree.expandOnlyOnTwistieClick(t.element) : o = !!this.tree.expandOnlyOnTwistieClick, s)
      this.handleStickyScrollMouseEvent(e, t);
    else {
      if (o && !r && e.browserEvent.detail !== 2)
        return super.onViewPointer(e);
      if (!this.tree.expandOnDoubleClick && e.browserEvent.detail === 2)
        return super.onViewPointer(e);
    }
    if (t.collapsible && (!s || r)) {
      const a = this.tree.getNodeLocation(t), l = e.browserEvent.altKey;
      if (this.tree.setFocus([a]), this.tree.toggleCollapsed(a, l), r) {
        e.browserEvent.isHandledByList = !0;
        return;
      }
    }
    s || super.onViewPointer(e);
  }
  handleStickyScrollMouseEvent(e, t) {
    if (Pbt(e.browserEvent.target) || Fbt(e.browserEvent.target))
      return;
    const n = this.stickyScrollProvider();
    if (!n)
      throw new Error("Sticky scroll controller not found");
    const r = this.list.indexOf(t), s = this.list.getElementTop(r), o = n.nodePositionTopBelowWidget(t);
    this.tree.scrollTop = s - o, this.list.domFocus(), this.list.setFocus([r]), this.list.setSelection([r]);
  }
  onDoubleClick(e) {
    e.browserEvent.target.classList.contains("monaco-tl-twistie") || !this.tree.expandOnDoubleClick || e.browserEvent.isHandledByList || super.onDoubleClick(e);
  }
  // to make sure dom focus is not stolen (for example with context menu)
  onMouseDown(e) {
    const t = e.browserEvent.target;
    if (!z4(t) && !VF(t)) {
      super.onMouseDown(e);
      return;
    }
  }
  onContextMenu(e) {
    const t = e.browserEvent.target;
    if (!z4(t) && !VF(t)) {
      super.onContextMenu(e);
      return;
    }
  }
}
class Awt extends Zh {
  constructor(e, t, n, r, s, o, a, l) {
    super(e, t, n, r, l), this.focusTrait = s, this.selectionTrait = o, this.anchorTrait = a;
  }
  createMouseController(e) {
    return new Rwt(this, e.tree, e.stickyScrollProvider);
  }
  splice(e, t, n = []) {
    if (super.splice(e, t, n), n.length === 0)
      return;
    const r = [], s = [];
    let o;
    n.forEach((a, l) => {
      this.focusTrait.has(a) && r.push(e + l), this.selectionTrait.has(a) && s.push(e + l), this.anchorTrait.has(a) && (o = e + l);
    }), r.length > 0 && super.setFocus(qy([...super.getFocus(), ...r])), s.length > 0 && super.setSelection(qy([...super.getSelection(), ...s])), typeof o == "number" && super.setAnchor(o);
  }
  setFocus(e, t, n = !1) {
    super.setFocus(e, t), n || this.focusTrait.set(e.map((r) => this.element(r)), t);
  }
  setSelection(e, t, n = !1) {
    super.setSelection(e, t), n || this.selectionTrait.set(e.map((r) => this.element(r)), t);
  }
  setAnchor(e, t = !1) {
    super.setAnchor(e), t || (typeof e > "u" ? this.anchorTrait.set([]) : this.anchorTrait.set([this.element(e)]));
  }
}
class n6e {
  get onDidScroll() {
    return this.view.onDidScroll;
  }
  get onDidChangeFocus() {
    return this.eventBufferer.wrapEvent(this.focus.onDidChange);
  }
  get onDidChangeSelection() {
    return this.eventBufferer.wrapEvent(this.selection.onDidChange);
  }
  get onMouseDblClick() {
    return Ze.filter(Ze.map(this.view.onMouseDblClick, gH), (e) => e.target !== Cx.Filter);
  }
  get onMouseOver() {
    return Ze.map(this.view.onMouseOver, gH);
  }
  get onMouseOut() {
    return Ze.map(this.view.onMouseOut, gH);
  }
  get onContextMenu() {
    var e;
    return Ze.any(Ze.filter(Ze.map(this.view.onContextMenu, Nwt), (t) => !t.isStickyScroll), ((e = this.stickyScrollController) == null ? void 0 : e.onContextMenu) ?? Ze.None);
  }
  get onPointer() {
    return Ze.map(this.view.onPointer, gH);
  }
  get onKeyDown() {
    return this.view.onKeyDown;
  }
  get onDidFocus() {
    return this.view.onDidFocus;
  }
  get onDidChangeModel() {
    return Ze.any(this.onDidChangeModelRelay.event, this.onDidSwapModel.event);
  }
  get onDidChangeCollapseState() {
    return this.onDidChangeCollapseStateRelay.event;
  }
  get expandOnDoubleClick() {
    return typeof this._options.expandOnDoubleClick > "u" ? !0 : this._options.expandOnDoubleClick;
  }
  get expandOnlyOnTwistieClick() {
    return typeof this._options.expandOnlyOnTwistieClick > "u" ? !0 : this._options.expandOnlyOnTwistieClick;
  }
  get onDidDispose() {
    return this.view.onDidDispose;
  }
  constructor(e, t, n, r, s = {}) {
    this._user = e, this._options = s, this.eventBufferer = new gB(), this.onDidChangeFindOpenState = Ze.None, this.onDidChangeStickyScrollFocused = Ze.None, this.disposables = new ke(), this.onDidSwapModel = this.disposables.add(new he()), this.onDidChangeModelRelay = this.disposables.add(new FM()), this.onDidSpliceModelRelay = this.disposables.add(new FM()), this.onDidChangeCollapseStateRelay = this.disposables.add(new FM()), this.onDidChangeRenderNodeCountRelay = this.disposables.add(new FM()), this.onDidChangeActiveNodesRelay = this.disposables.add(new FM()), this._onWillRefilter = new he(), this.onWillRefilter = this._onWillRefilter.event, this._onDidUpdateOptions = new he(), this.modelDisposables = new ke(), s.keyboardNavigationLabelProvider && (s.findWidgetEnabled ?? !0) && (this.findFilter = new JBe(s.keyboardNavigationLabelProvider, s.filter, s.defaultFindVisibility), s = { ...s, filter: this.findFilter }, this.disposables.add(this.findFilter)), this.model = this.createModel(e, s), this.treeDelegate = new npe(n);
    const o = this.disposables.add(new wwt(this.onDidChangeActiveNodesRelay.event)), a = new VPe();
    this.renderers = r.map((l) => new roe(l, this.model, this.onDidChangeCollapseStateRelay.event, o, a, s));
    for (const l of this.renderers)
      this.disposables.add(l);
    if (this.focus = new ete(() => this.view.getFocusedElements()[0], s.identityProvider), this.selection = new ete(() => this.view.getSelectedElements()[0], s.identityProvider), this.anchor = new ete(() => this.view.getAnchorElement(), s.identityProvider), this.view = new Awt(e, t, this.treeDelegate, this.renderers, this.focus, this.selection, this.anchor, { ...Cwt(() => this.model, this.disposables, s), tree: this, stickyScrollProvider: () => this.stickyScrollController }), this.setupModel(this.model), s.keyboardSupport !== !1) {
      const l = Ze.chain(this.view.onKeyDown, (c) => c.filter((u) => !sm(u.target)).map((u) => new wr(u)));
      Ze.chain(l, (c) => c.filter(
        (u) => u.keyCode === 15
        /* KeyCode.LeftArrow */
      ))(this.onLeftArrow, this, this.disposables), Ze.chain(l, (c) => c.filter(
        (u) => u.keyCode === 17
        /* KeyCode.RightArrow */
      ))(this.onRightArrow, this, this.disposables), Ze.chain(l, (c) => c.filter(
        (u) => u.keyCode === 10
        /* KeyCode.Space */
      ))(this.onSpace, this, this.disposables);
    }
    if ((s.findWidgetEnabled ?? !0) && s.keyboardNavigationLabelProvider && s.contextViewProvider) {
      const l = {
        styles: s.findWidgetStyles,
        defaultFindMode: s.defaultFindMode,
        defaultFindMatchType: s.defaultFindMatchType,
        showNotFoundMessage: s.showNotFoundMessage
      };
      this.findController = this.disposables.add(new e6e(this, this.findFilter, s.contextViewProvider, l)), this.focusNavigationFilter = (c) => this.findController.shouldAllowFocus(c), this.onDidChangeFindOpenState = this.findController.onDidChangeOpenState, this.onDidChangeFindMode = this.findController.onDidChangeMode, this.onDidChangeFindMatchType = this.findController.onDidChangeMatchType;
    } else
      this.onDidChangeFindMode = Ze.None, this.onDidChangeFindMatchType = Ze.None;
    s.enableStickyScroll && (this.stickyScrollController = new ODe(this, this.model, this.view, this.renderers, this.treeDelegate, s), this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus), this.styleElement = Zf(this.view.getHTMLElement()), this.getHTMLElement().classList.toggle("always", this._options.renderIndentGuides === ET.Always);
  }
  updateOptions(e = {}) {
    var t;
    this._options = { ...this._options, ...e };
    for (const n of this.renderers)
      n.updateOptions(e);
    this.view.updateOptions(this._options), (t = this.findController) == null || t.updateOptions(e), this.updateStickyScroll(e), this._onDidUpdateOptions.fire(this._options), this.getHTMLElement().classList.toggle("always", this._options.renderIndentGuides === ET.Always);
  }
  get options() {
    return this._options;
  }
  updateStickyScroll(e) {
    var t;
    !this.stickyScrollController && this._options.enableStickyScroll ? (this.stickyScrollController = new ODe(this, this.model, this.view, this.renderers, this.treeDelegate, this._options), this.onDidChangeStickyScrollFocused = this.stickyScrollController.onDidChangeHasFocus) : this.stickyScrollController && !this._options.enableStickyScroll && (this.onDidChangeStickyScrollFocused = Ze.None, this.stickyScrollController.dispose(), this.stickyScrollController = void 0), (t = this.stickyScrollController) == null || t.updateOptions(e);
  }
  // Widget
  getHTMLElement() {
    return this.view.getHTMLElement();
  }
  get onDidChangeContentHeight() {
    return this.view.onDidChangeContentHeight;
  }
  get scrollTop() {
    return this.view.scrollTop;
  }
  set scrollTop(e) {
    this.view.scrollTop = e;
  }
  get scrollHeight() {
    return this.view.scrollHeight;
  }
  get renderHeight() {
    return this.view.renderHeight;
  }
  get ariaLabel() {
    return this.view.ariaLabel;
  }
  set ariaLabel(e) {
    this.view.ariaLabel = e;
  }
  domFocus() {
    var e;
    (e = this.stickyScrollController) != null && e.focusedLast() ? this.stickyScrollController.domFocus() : this.view.domFocus();
  }
  layout(e, t) {
    this.view.layout(e, t);
  }
  style(e) {
    const t = `.${this.view.domId}`, n = [];
    e.treeIndentGuidesStroke && (n.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide  { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`), n.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`));
    const r = e.treeStickyScrollBackground ?? e.listBackground;
    r && (n.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${r}; }`), n.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${r}; }`)), e.treeStickyScrollBorder && n.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`), e.treeStickyScrollShadow && n.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`), e.listFocusForeground && (n.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`), n.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));
    const s = Py(e.listFocusAndSelectionOutline, Py(e.listSelectionOutline, e.listFocusOutline ?? ""));
    s && (n.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`), n.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)), e.listFocusOutline && (n.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`), n.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`), n.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`), n.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`), n.push(`.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)), this.styleElement.textContent = n.join(`
`), this.view.style(e);
  }
  // Tree navigation
  getParentElement(e) {
    const t = this.model.getParentNodeLocation(e);
    return this.model.getNode(t).element;
  }
  getFirstElementChild(e) {
    return this.model.getFirstElementChild(e);
  }
  // Tree
  getNode(e) {
    return this.model.getNode(e);
  }
  getNodeLocation(e) {
    return this.model.getNodeLocation(e);
  }
  collapse(e, t = !1) {
    return this.model.setCollapsed(e, !0, t);
  }
  expand(e, t = !1) {
    return this.model.setCollapsed(e, !1, t);
  }
  toggleCollapsed(e, t = !1) {
    return this.model.setCollapsed(e, void 0, t);
  }
  isCollapsible(e) {
    return this.model.isCollapsible(e);
  }
  setCollapsible(e, t) {
    return this.model.setCollapsible(e, t);
  }
  isCollapsed(e) {
    return this.model.isCollapsed(e);
  }
  refilter() {
    this._onWillRefilter.fire(void 0), this.model.refilter();
  }
  setSelection(e, t) {
    this.eventBufferer.bufferEvents(() => {
      const n = e.map((s) => this.model.getNode(s));
      this.selection.set(n, t);
      const r = e.map((s) => this.model.getListIndex(s)).filter((s) => s > -1);
      this.view.setSelection(r, t, !0);
    });
  }
  getSelection() {
    return this.selection.get();
  }
  setFocus(e, t) {
    this.eventBufferer.bufferEvents(() => {
      const n = e.map((s) => this.model.getNode(s));
      this.focus.set(n, t);
      const r = e.map((s) => this.model.getListIndex(s)).filter((s) => s > -1);
      this.view.setFocus(r, t, !0);
    });
  }
  focusNext(e = 1, t = !1, n, r = sy(n) && n.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusNext(e, t, n, r);
  }
  focusPrevious(e = 1, t = !1, n, r = sy(n) && n.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusPrevious(e, t, n, r);
  }
  focusNextPage(e, t = sy(e) && e.altKey ? void 0 : this.focusNavigationFilter) {
    return this.view.focusNextPage(e, t);
  }
  focusPreviousPage(e, t = sy(e) && e.altKey ? void 0 : this.focusNavigationFilter) {
    return this.view.focusPreviousPage(e, t, () => {
      var n;
      return ((n = this.stickyScrollController) == null ? void 0 : n.height) ?? 0;
    });
  }
  focusLast(e, t = sy(e) && e.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusLast(e, t);
  }
  focusFirst(e, t = sy(e) && e.altKey ? void 0 : this.focusNavigationFilter) {
    this.view.focusFirst(e, t);
  }
  getFocus() {
    return this.focus.get();
  }
  reveal(e, t) {
    this.model.expandTo(e);
    const n = this.model.getListIndex(e);
    if (n !== -1)
      if (!this.stickyScrollController)
        this.view.reveal(n, t);
      else {
        const r = this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));
        this.view.reveal(n, t, r);
      }
  }
  // List
  onLeftArrow(e) {
    e.preventDefault(), e.stopPropagation();
    const t = this.view.getFocusedElements();
    if (t.length === 0)
      return;
    const n = t[0], r = this.model.getNodeLocation(n);
    if (!this.model.setCollapsed(r, !0)) {
      const o = this.model.getParentNodeLocation(r);
      if (!o)
        return;
      const a = this.model.getListIndex(o);
      this.view.reveal(a), this.view.setFocus([a]);
    }
  }
  onRightArrow(e) {
    e.preventDefault(), e.stopPropagation();
    const t = this.view.getFocusedElements();
    if (t.length === 0)
      return;
    const n = t[0], r = this.model.getNodeLocation(n);
    if (!this.model.setCollapsed(r, !1)) {
      if (!n.children.some((l) => l.visible))
        return;
      const [o] = this.view.getFocus(), a = o + 1;
      this.view.reveal(a), this.view.setFocus([a]);
    }
  }
  onSpace(e) {
    e.preventDefault(), e.stopPropagation();
    const t = this.view.getFocusedElements();
    if (t.length === 0)
      return;
    const n = t[0], r = this.model.getNodeLocation(n), s = e.browserEvent.altKey;
    this.model.setCollapsed(r, void 0, s);
  }
  setupModel(e) {
    this.modelDisposables.clear(), this.modelDisposables.add(e.onDidSpliceRenderedNodes(({ start: s, deleteCount: o, elements: a }) => this.view.splice(s, o, a)));
    const t = Ze.forEach(e.onDidSpliceModel, (s) => {
      this.eventBufferer.bufferEvents(() => {
        this.focus.onDidModelSplice(s), this.selection.onDidModelSplice(s);
      });
    }, this.modelDisposables);
    t(() => null, null, this.modelDisposables);
    const n = this.modelDisposables.add(new he()), r = this.modelDisposables.add(new Gf(0));
    this.modelDisposables.add(Ze.any(t, this.focus.onDidChange, this.selection.onDidChange)(() => {
      r.trigger(() => {
        const s = /* @__PURE__ */ new Set();
        for (const o of this.focus.getNodes())
          s.add(o);
        for (const o of this.selection.getNodes())
          s.add(o);
        n.fire([...s.values()]);
      });
    })), this.onDidChangeActiveNodesRelay.input = n.event, this.onDidChangeModelRelay.input = Ze.signal(e.onDidSpliceModel), this.onDidChangeCollapseStateRelay.input = e.onDidChangeCollapseState, this.onDidChangeRenderNodeCountRelay.input = e.onDidChangeRenderNodeCount, this.onDidSpliceModelRelay.input = e.onDidSpliceModel;
  }
  dispose() {
    var e;
    or(this.disposables), (e = this.stickyScrollController) == null || e.dispose(), this.view.dispose(), this.modelDisposables.dispose();
  }
}
class ipe {
  constructor(e, t = {}) {
    this.user = e, this.rootRef = null, this.nodes = /* @__PURE__ */ new Map(), this.nodesByIdentity = /* @__PURE__ */ new Map(), this.model = new bwt(e, null, t), this.onDidSpliceModel = this.model.onDidSpliceModel, this.onDidSpliceRenderedNodes = this.model.onDidSpliceRenderedNodes, this.onDidChangeCollapseState = this.model.onDidChangeCollapseState, this.onDidChangeRenderNodeCount = this.model.onDidChangeRenderNodeCount, t.sorter && (this.sorter = {
      compare(n, r) {
        return t.sorter.compare(n.element, r.element);
      }
    }), this.identityProvider = t.identityProvider;
  }
  setChildren(e, t = gi.empty(), n = {}) {
    const r = this.getElementLocation(e);
    this._setChildren(r, this.preserveCollapseState(t), n);
  }
  _setChildren(e, t = gi.empty(), n) {
    const r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), o = (l) => {
      var u;
      if (l.element === null)
        return;
      const c = l;
      if (r.add(c.element), this.nodes.set(c.element, c), this.identityProvider) {
        const d = this.identityProvider.getId(c.element).toString();
        s.add(d), this.nodesByIdentity.set(d, c);
      }
      (u = n.onDidCreateNode) == null || u.call(n, c);
    }, a = (l) => {
      var u;
      if (l.element === null)
        return;
      const c = l;
      if (r.has(c.element) || this.nodes.delete(c.element), this.identityProvider) {
        const d = this.identityProvider.getId(c.element).toString();
        s.has(d) || this.nodesByIdentity.delete(d);
      }
      (u = n.onDidDeleteNode) == null || u.call(n, c);
    };
    this.model.splice([...e, 0], Number.MAX_VALUE, t, { ...n, onDidCreateNode: o, onDidDeleteNode: a });
  }
  preserveCollapseState(e = gi.empty()) {
    return this.sorter && (e = [...e].sort(this.sorter.compare.bind(this.sorter))), gi.map(e, (t) => {
      let n = this.nodes.get(t.element);
      if (!n && this.identityProvider) {
        const o = this.identityProvider.getId(t.element).toString();
        n = this.nodesByIdentity.get(o);
      }
      if (!n) {
        let o;
        return typeof t.collapsed > "u" ? o = void 0 : t.collapsed === kh.Collapsed || t.collapsed === kh.PreserveOrCollapsed ? o = !0 : t.collapsed === kh.Expanded || t.collapsed === kh.PreserveOrExpanded ? o = !1 : o = !!t.collapsed, {
          ...t,
          children: this.preserveCollapseState(t.children),
          collapsed: o
        };
      }
      const r = typeof t.collapsible == "boolean" ? t.collapsible : n.collapsible;
      let s;
      return typeof t.collapsed > "u" || t.collapsed === kh.PreserveOrCollapsed || t.collapsed === kh.PreserveOrExpanded ? s = n.collapsed : t.collapsed === kh.Collapsed ? s = !0 : t.collapsed === kh.Expanded ? s = !1 : s = !!t.collapsed, {
        ...t,
        collapsible: r,
        collapsed: s,
        children: this.preserveCollapseState(t.children)
      };
    });
  }
  rerender(e) {
    const t = this.getElementLocation(e);
    this.model.rerender(t);
  }
  getFirstElementChild(e = null) {
    const t = this.getElementLocation(e);
    return this.model.getFirstElementChild(t);
  }
  has(e) {
    return this.nodes.has(e);
  }
  getListIndex(e) {
    const t = this.getElementLocation(e);
    return this.model.getListIndex(t);
  }
  getListRenderCount(e) {
    const t = this.getElementLocation(e);
    return this.model.getListRenderCount(t);
  }
  isCollapsible(e) {
    const t = this.getElementLocation(e);
    return this.model.isCollapsible(t);
  }
  setCollapsible(e, t) {
    const n = this.getElementLocation(e);
    return this.model.setCollapsible(n, t);
  }
  isCollapsed(e) {
    const t = this.getElementLocation(e);
    return this.model.isCollapsed(t);
  }
  setCollapsed(e, t, n) {
    const r = this.getElementLocation(e);
    return this.model.setCollapsed(r, t, n);
  }
  expandTo(e) {
    const t = this.getElementLocation(e);
    this.model.expandTo(t);
  }
  refilter() {
    this.model.refilter();
  }
  getNode(e = null) {
    if (e === null)
      return this.model.getNode(this.model.rootRef);
    const t = this.nodes.get(e);
    if (!t)
      throw new Ah(this.user, `Tree element not found: ${e}`);
    return t;
  }
  getNodeLocation(e) {
    return e.element;
  }
  getParentNodeLocation(e) {
    if (e === null)
      throw new Ah(this.user, "Invalid getParentNodeLocation call");
    const t = this.nodes.get(e);
    if (!t)
      throw new Ah(this.user, `Tree element not found: ${e}`);
    const n = this.model.getNodeLocation(t), r = this.model.getParentNodeLocation(n);
    return this.model.getNode(r).element;
  }
  getElementLocation(e) {
    if (e === null)
      return [];
    const t = this.nodes.get(e);
    if (!t)
      throw new Ah(this.user, `Tree element not found: ${e}`);
    return this.model.getNodeLocation(t);
  }
}
function UW(i) {
  const e = [i.element], t = i.incompressible || !1;
  return {
    element: { elements: e, incompressible: t },
    children: gi.map(gi.from(i.children), UW),
    collapsible: i.collapsible,
    collapsed: i.collapsed
  };
}
function zW(i) {
  const e = [i.element], t = i.incompressible || !1;
  let n, r;
  for (; [r, n] = gi.consume(gi.from(i.children), 2), !(r.length !== 1 || r[0].incompressible); )
    i = r[0], e.push(i.element);
  return {
    element: { elements: e, incompressible: t },
    children: gi.map(gi.concat(r, n), zW),
    collapsible: i.collapsible,
    collapsed: i.collapsed
  };
}
function soe(i, e = 0) {
  let t;
  return e < i.element.elements.length - 1 ? t = [soe(i, e + 1)] : t = gi.map(gi.from(i.children), (n) => soe(n, 0)), e === 0 && i.element.incompressible ? {
    element: i.element.elements[e],
    children: t,
    incompressible: !0,
    collapsible: i.collapsible,
    collapsed: i.collapsed
  } : {
    element: i.element.elements[e],
    children: t,
    collapsible: i.collapsible,
    collapsed: i.collapsed
  };
}
function MDe(i) {
  return soe(i, 0);
}
function i6e(i, e, t) {
  return i.element === e ? { ...i, children: t } : { ...i, children: gi.map(gi.from(i.children), (n) => i6e(n, e, t)) };
}
const Owt = (i) => ({
  getId(e) {
    return e.elements.map((t) => i.getId(t).toString()).join("\0");
  }
});
class Mwt {
  get onDidSpliceRenderedNodes() {
    return this.model.onDidSpliceRenderedNodes;
  }
  get onDidSpliceModel() {
    return this.model.onDidSpliceModel;
  }
  get onDidChangeCollapseState() {
    return this.model.onDidChangeCollapseState;
  }
  get onDidChangeRenderNodeCount() {
    return this.model.onDidChangeRenderNodeCount;
  }
  constructor(e, t = {}) {
    this.user = e, this.rootRef = null, this.nodes = /* @__PURE__ */ new Map(), this.model = new ipe(e, t), this.enabled = typeof t.compressionEnabled > "u" ? !0 : t.compressionEnabled, this.identityProvider = t.identityProvider;
  }
  setChildren(e, t = gi.empty(), n) {
    const r = n.diffIdentityProvider && Owt(n.diffIdentityProvider);
    if (e === null) {
      const m = gi.map(t, this.enabled ? zW : UW);
      this._setChildren(null, m, { diffIdentityProvider: r, diffDepth: 1 / 0 });
      return;
    }
    const s = this.nodes.get(e);
    if (!s)
      throw new Ah(this.user, "Unknown compressed tree node");
    const o = this.model.getNode(s), a = this.model.getParentNodeLocation(s), l = this.model.getNode(a), c = MDe(o), u = i6e(c, e, t), d = (this.enabled ? zW : UW)(u), h = n.diffIdentityProvider ? ((m, _) => n.diffIdentityProvider.getId(m) === n.diffIdentityProvider.getId(_)) : void 0;
    if (ds(d.element.elements, o.element.elements, h)) {
      this._setChildren(s, d.children || gi.empty(), { diffIdentityProvider: r, diffDepth: 1 });
      return;
    }
    const g = l.children.map((m) => m === o ? d : m);
    this._setChildren(l.element, g, {
      diffIdentityProvider: r,
      diffDepth: o.depth - l.depth
    });
  }
  isCompressionEnabled() {
    return this.enabled;
  }
  setCompressionEnabled(e) {
    if (e === this.enabled)
      return;
    this.enabled = e;
    const n = this.model.getNode().children, r = gi.map(n, MDe), s = gi.map(r, e ? zW : UW);
    this._setChildren(null, s, {
      diffIdentityProvider: this.identityProvider,
      diffDepth: 1 / 0
    });
  }
  _setChildren(e, t, n) {
    const r = /* @__PURE__ */ new Set(), s = (a) => {
      for (const l of a.element.elements)
        r.add(l), this.nodes.set(l, a.element);
    }, o = (a) => {
      for (const l of a.element.elements)
        r.has(l) || this.nodes.delete(l);
    };
    this.model.setChildren(e, t, { ...n, onDidCreateNode: s, onDidDeleteNode: o });
  }
  has(e) {
    return this.nodes.has(e);
  }
  getListIndex(e) {
    const t = this.getCompressedNode(e);
    return this.model.getListIndex(t);
  }
  getListRenderCount(e) {
    const t = this.getCompressedNode(e);
    return this.model.getListRenderCount(t);
  }
  getNode(e) {
    if (typeof e > "u")
      return this.model.getNode();
    const t = this.getCompressedNode(e);
    return this.model.getNode(t);
  }
  // TODO: review this
  getNodeLocation(e) {
    const t = this.model.getNodeLocation(e);
    return t === null ? null : t.elements[t.elements.length - 1];
  }
  // TODO: review this
  getParentNodeLocation(e) {
    const t = this.getCompressedNode(e), n = this.model.getParentNodeLocation(t);
    return n === null ? null : n.elements[n.elements.length - 1];
  }
  getFirstElementChild(e) {
    const t = this.getCompressedNode(e);
    return this.model.getFirstElementChild(t);
  }
  isCollapsible(e) {
    const t = this.getCompressedNode(e);
    return this.model.isCollapsible(t);
  }
  setCollapsible(e, t) {
    const n = this.getCompressedNode(e);
    return this.model.setCollapsible(n, t);
  }
  isCollapsed(e) {
    const t = this.getCompressedNode(e);
    return this.model.isCollapsed(t);
  }
  setCollapsed(e, t, n) {
    const r = this.getCompressedNode(e);
    return this.model.setCollapsed(r, t, n);
  }
  expandTo(e) {
    const t = this.getCompressedNode(e);
    this.model.expandTo(t);
  }
  rerender(e) {
    const t = this.getCompressedNode(e);
    this.model.rerender(t);
  }
  refilter() {
    this.model.refilter();
  }
  getCompressedNode(e) {
    if (e === null)
      return null;
    const t = this.nodes.get(e);
    if (!t)
      throw new Ah(this.user, `Tree element not found: ${e}`);
    return t;
  }
}
const Pwt = (i) => i[i.length - 1];
class rpe {
  get element() {
    return this.node.element === null ? null : this.unwrapper(this.node.element);
  }
  get children() {
    return this.node.children.map((e) => new rpe(this.unwrapper, e));
  }
  get depth() {
    return this.node.depth;
  }
  get visibleChildrenCount() {
    return this.node.visibleChildrenCount;
  }
  get visibleChildIndex() {
    return this.node.visibleChildIndex;
  }
  get collapsible() {
    return this.node.collapsible;
  }
  get collapsed() {
    return this.node.collapsed;
  }
  get visible() {
    return this.node.visible;
  }
  get filterData() {
    return this.node.filterData;
  }
  constructor(e, t) {
    this.unwrapper = e, this.node = t;
  }
}
function Fwt(i, e) {
  return {
    ...e,
    identityProvider: e.identityProvider && {
      getId(t) {
        return e.identityProvider.getId(i(t));
      }
    },
    sorter: e.sorter && {
      compare(t, n) {
        return e.sorter.compare(t.elements[0], n.elements[0]);
      }
    },
    filter: e.filter && {
      filter(t, n) {
        const r = t.elements;
        for (let s = 0; s < r.length - 1; s++) {
          const o = e.filter.filter(r[s], n);
          n = ST(zB(o) ? o.visibility : o);
        }
        return e.filter.filter(r[r.length - 1], n);
      }
    }
  };
}
class Bwt {
  get onDidSpliceModel() {
    return Ze.map(this.model.onDidSpliceModel, ({ insertedNodes: e, deletedNodes: t }) => ({
      insertedNodes: e.map((n) => this.nodeMapper.map(n)),
      deletedNodes: t.map((n) => this.nodeMapper.map(n))
    }));
  }
  get onDidSpliceRenderedNodes() {
    return Ze.map(this.model.onDidSpliceRenderedNodes, ({ start: e, deleteCount: t, elements: n }) => ({
      start: e,
      deleteCount: t,
      elements: n.map((r) => this.nodeMapper.map(r))
    }));
  }
  get onDidChangeCollapseState() {
    return Ze.map(this.model.onDidChangeCollapseState, ({ node: e, deep: t }) => ({
      node: this.nodeMapper.map(e),
      deep: t
    }));
  }
  get onDidChangeRenderNodeCount() {
    return Ze.map(this.model.onDidChangeRenderNodeCount, (e) => this.nodeMapper.map(e));
  }
  constructor(e, t = {}) {
    this.rootRef = null, this.elementMapper = t.elementMapper || Pwt;
    const n = (r) => this.elementMapper(r.elements);
    this.nodeMapper = new tpe((r) => new rpe(n, r)), this.model = new Mwt(e, Fwt(n, t));
  }
  setChildren(e, t = gi.empty(), n = {}) {
    this.model.setChildren(e, t, n);
  }
  isCompressionEnabled() {
    return this.model.isCompressionEnabled();
  }
  setCompressionEnabled(e) {
    this.model.setCompressionEnabled(e);
  }
  has(e) {
    return this.model.has(e);
  }
  getListIndex(e) {
    return this.model.getListIndex(e);
  }
  getListRenderCount(e) {
    return this.model.getListRenderCount(e);
  }
  getNode(e) {
    return this.nodeMapper.map(this.model.getNode(e));
  }
  getNodeLocation(e) {
    return e.element;
  }
  getParentNodeLocation(e) {
    return this.model.getParentNodeLocation(e);
  }
  getFirstElementChild(e) {
    const t = this.model.getFirstElementChild(e);
    return t === null || typeof t > "u" ? t : this.elementMapper(t.elements);
  }
  isCollapsible(e) {
    return this.model.isCollapsible(e);
  }
  setCollapsible(e, t) {
    return this.model.setCollapsible(e, t);
  }
  isCollapsed(e) {
    return this.model.isCollapsed(e);
  }
  setCollapsed(e, t, n) {
    return this.model.setCollapsed(e, t, n);
  }
  expandTo(e) {
    return this.model.expandTo(e);
  }
  rerender(e) {
    return this.model.rerender(e);
  }
  refilter() {
    return this.model.refilter();
  }
  getCompressedTreeNode(e = null) {
    return this.model.getNode(e);
  }
}
var Hwt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
};
class spe extends n6e {
  get onDidChangeCollapseState() {
    return this.model.onDidChangeCollapseState;
  }
  constructor(e, t, n, r, s = {}) {
    super(e, t, n, r, s), this.user = e;
  }
  setChildren(e, t = gi.empty(), n) {
    this.model.setChildren(e, t, n);
  }
  rerender(e) {
    if (e === void 0) {
      this.view.rerender();
      return;
    }
    this.model.rerender(e);
  }
  hasElement(e) {
    return this.model.has(e);
  }
  createModel(e, t) {
    return new ipe(e, t);
  }
}
class r6e {
  get compressedTreeNodeProvider() {
    return this._compressedTreeNodeProvider();
  }
  constructor(e, t, n) {
    this._compressedTreeNodeProvider = e, this.stickyScrollDelegate = t, this.renderer = n, this.templateId = n.templateId, n.onDidChangeTwistieState && (this.onDidChangeTwistieState = n.onDidChangeTwistieState);
  }
  renderTemplate(e) {
    return { compressedTreeNode: void 0, data: this.renderer.renderTemplate(e) };
  }
  renderElement(e, t, n, r) {
    let s = this.stickyScrollDelegate.getCompressedNode(e);
    s || (s = this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)), s.element.elements.length === 1 ? (n.compressedTreeNode = void 0, this.renderer.renderElement(e, t, n.data, r)) : (n.compressedTreeNode = s, this.renderer.renderCompressedElements(s, t, n.data, r));
  }
  disposeElement(e, t, n, r) {
    var s, o, a, l;
    n.compressedTreeNode ? (o = (s = this.renderer).disposeCompressedElements) == null || o.call(s, n.compressedTreeNode, t, n.data, r) : (l = (a = this.renderer).disposeElement) == null || l.call(a, e, t, n.data, r);
  }
  disposeTemplate(e) {
    this.renderer.disposeTemplate(e.data);
  }
  renderTwistie(e, t) {
    var n, r;
    return ((r = (n = this.renderer).renderTwistie) == null ? void 0 : r.call(n, e, t)) ?? !1;
  }
}
Hwt([
  go
], r6e.prototype, "compressedTreeNodeProvider", null);
class Wwt {
  constructor(e) {
    this.modelProvider = e, this.compressedStickyNodes = /* @__PURE__ */ new Map();
  }
  getCompressedNode(e) {
    return this.compressedStickyNodes.get(e);
  }
  constrainStickyScrollNodes(e, t, n) {
    if (this.compressedStickyNodes.clear(), e.length === 0)
      return [];
    for (let r = 0; r < e.length; r++) {
      const s = e[r], o = s.position + s.height;
      if (r + 1 < e.length && o + e[r + 1].height > n || r >= t - 1 && t < e.length) {
        const l = e.slice(0, r), c = e.slice(r), u = this.compressStickyNodes(c);
        return [...l, u];
      }
    }
    return e;
  }
  compressStickyNodes(e) {
    if (e.length === 0)
      throw new Error("Can't compress empty sticky nodes");
    const t = this.modelProvider();
    if (!t.isCompressionEnabled())
      return e[0];
    const n = [];
    for (let c = 0; c < e.length; c++) {
      const u = e[c], d = t.getCompressedTreeNode(u.node.element);
      if (d.element) {
        if (c !== 0 && d.element.incompressible)
          break;
        n.push(...d.element.elements);
      }
    }
    if (n.length < 2)
      return e[0];
    const r = e[e.length - 1], s = { elements: n, incompressible: !1 }, o = { ...r.node, children: [], element: s }, a = new Proxy(e[0].node, {}), l = {
      node: a,
      startIndex: e[0].startIndex,
      endIndex: r.endIndex,
      position: e[0].position,
      height: e[0].height
    };
    return this.compressedStickyNodes.set(a, o), l;
  }
}
function Vwt(i, e) {
  return e && {
    ...e,
    keyboardNavigationLabelProvider: e.keyboardNavigationLabelProvider && {
      getKeyboardNavigationLabel(t) {
        let n;
        try {
          n = i().getCompressedTreeNode(t);
        } catch {
          return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t);
        }
        return n.element.elements.length === 1 ? e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t) : e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements);
      }
    }
  };
}
class s6e extends spe {
  constructor(e, t, n, r, s = {}) {
    const o = () => this, a = new Wwt(() => this.model), l = r.map((c) => new r6e(o, a, c));
    super(e, t, n, l, { ...Vwt(o, s), stickyScrollDelegate: a });
  }
  setChildren(e, t = gi.empty(), n) {
    this.model.setChildren(e, t, n);
  }
  createModel(e, t) {
    return new Bwt(e, t);
  }
  updateOptions(e = {}) {
    super.updateOptions(e), typeof e.compressionEnabled < "u" && this.model.setCompressionEnabled(e.compressionEnabled);
  }
  getCompressedTreeNode(e = null) {
    return this.model.getCompressedTreeNode(e);
  }
}
function tte(i) {
  return {
    ...i,
    children: [],
    refreshPromise: void 0,
    stale: !0,
    slow: !1,
    forceExpanded: !1
  };
}
function ooe(i, e) {
  return e.parent ? e.parent === i ? !0 : ooe(i, e.parent) : !1;
}
function Uwt(i, e) {
  return i === e || ooe(i, e) || ooe(e, i);
}
class ope {
  get element() {
    return this.node.element.element;
  }
  get children() {
    return this.node.children.map((e) => new ope(e));
  }
  get depth() {
    return this.node.depth;
  }
  get visibleChildrenCount() {
    return this.node.visibleChildrenCount;
  }
  get visibleChildIndex() {
    return this.node.visibleChildIndex;
  }
  get collapsible() {
    return this.node.collapsible;
  }
  get collapsed() {
    return this.node.collapsed;
  }
  get visible() {
    return this.node.visible;
  }
  get filterData() {
    return this.node.filterData;
  }
  constructor(e) {
    this.node = e;
  }
}
class zwt {
  constructor(e, t, n) {
    this.renderer = e, this.nodeMapper = t, this.onDidChangeTwistieState = n, this.renderedNodes = /* @__PURE__ */ new Map(), this.templateId = e.templateId;
  }
  renderTemplate(e) {
    return { templateData: this.renderer.renderTemplate(e) };
  }
  renderElement(e, t, n, r) {
    this.renderer.renderElement(this.nodeMapper.map(e), t, n.templateData, r);
  }
  renderTwistie(e, t) {
    return e.slow ? (t.classList.add(...qt.asClassNameArray(Pe.treeItemLoading)), !0) : (t.classList.remove(...qt.asClassNameArray(Pe.treeItemLoading)), !1);
  }
  disposeElement(e, t, n, r) {
    var s, o;
    (o = (s = this.renderer).disposeElement) == null || o.call(s, this.nodeMapper.map(e), t, n.templateData, r);
  }
  disposeTemplate(e) {
    this.renderer.disposeTemplate(e.templateData);
  }
  dispose() {
    this.renderedNodes.clear();
  }
}
function PDe(i) {
  return {
    browserEvent: i.browserEvent,
    elements: i.elements.map((e) => e.element)
  };
}
function FDe(i) {
  return {
    browserEvent: i.browserEvent,
    element: i.element && i.element.element,
    target: i.target
  };
}
class $wt extends OB {
  constructor(e) {
    super(e.elements.map((t) => t.element)), this.data = e;
  }
}
function nte(i) {
  return i instanceof OB ? new $wt(i) : i;
}
class jwt {
  constructor(e) {
    this.dnd = e;
  }
  getDragURI(e) {
    return this.dnd.getDragURI(e.element);
  }
  getDragLabel(e, t) {
    if (this.dnd.getDragLabel)
      return this.dnd.getDragLabel(e.map((n) => n.element), t);
  }
  onDragStart(e, t) {
    var n, r;
    (r = (n = this.dnd).onDragStart) == null || r.call(n, nte(e), t);
  }
  onDragOver(e, t, n, r, s, o = !0) {
    return this.dnd.onDragOver(nte(e), t && t.element, n, r, s);
  }
  drop(e, t, n, r, s) {
    this.dnd.drop(nte(e), t && t.element, n, r, s);
  }
  onDragEnd(e) {
    var t, n;
    (n = (t = this.dnd).onDragEnd) == null || n.call(t, e);
  }
  dispose() {
    this.dnd.dispose();
  }
}
class Gwt extends JBe {
  constructor(e, t, n) {
    super(t, n), this.findProvider = e, this.isFindSessionActive = !1;
  }
  filter(e, t) {
    const n = super.filter(e, t);
    if (!this.isFindSessionActive || this.findMode === Oh.Highlight || !this.findProvider.isVisible)
      return n;
    const r = zB(n) ? n.visibility : n;
    return ST(r) === 0 ? 0 : this.findProvider.isVisible(e) ? n : 0;
  }
}
class qwt extends e6e {
  constructor(e, t, n, r, s) {
    super(e, n, r, s), this.findProvider = t, this.filter = n, this.activeSession = !1, this.asyncWorkInProgress = !1, this.disposables.add(Et(async () => {
      var o, a;
      this.activeSession && await ((a = (o = this.findProvider).endSession) == null ? void 0 : a.call(o));
    }));
  }
  render() {
    if (this.asyncWorkInProgress || !this.activeFindMetadata)
      return;
    const e = this.activeFindMetadata.matchCount === 0 && this.pattern.length > 0;
    this.renderMessage(e), this.pattern.length && this.alertResults(this.activeFindMetadata.matchCount);
  }
  shouldAllowFocus(e) {
    return this.shouldFocusWhenNavigating(e);
  }
  shouldFocusWhenNavigating(e) {
    var n;
    if (!this.activeSession || !this.activeFindMetadata)
      return !0;
    const t = (n = e.element) == null ? void 0 : n.element;
    return t && this.activeFindMetadata.isMatch(t) ? !0 : !$g.isDefault(e.filterData);
  }
}
function o6e(i) {
  return i && {
    ...i,
    collapseByDefault: !0,
    identityProvider: i.identityProvider && {
      getId(e) {
        return i.identityProvider.getId(e.element);
      }
    },
    dnd: i.dnd && new jwt(i.dnd),
    multipleSelectionController: i.multipleSelectionController && {
      isSelectionSingleChangeEvent(e) {
        return i.multipleSelectionController.isSelectionSingleChangeEvent({ ...e, element: e.element });
      },
      isSelectionRangeChangeEvent(e) {
        return i.multipleSelectionController.isSelectionRangeChangeEvent({ ...e, element: e.element });
      }
    },
    accessibilityProvider: i.accessibilityProvider && {
      ...i.accessibilityProvider,
      getPosInSet: void 0,
      getSetSize: void 0,
      getRole: i.accessibilityProvider.getRole ? (e) => i.accessibilityProvider.getRole(e.element) : () => "treeitem",
      isChecked: i.accessibilityProvider.isChecked ? (e) => {
        var t;
        return !!((t = i.accessibilityProvider) != null && t.isChecked(e.element));
      } : void 0,
      getAriaLabel(e) {
        return i.accessibilityProvider.getAriaLabel(e.element);
      },
      getWidgetAriaLabel() {
        return i.accessibilityProvider.getWidgetAriaLabel();
      },
      getWidgetRole: i.accessibilityProvider.getWidgetRole ? () => i.accessibilityProvider.getWidgetRole() : () => "tree",
      getAriaLevel: i.accessibilityProvider.getAriaLevel && ((e) => i.accessibilityProvider.getAriaLevel(e.element)),
      getActiveDescendantId: i.accessibilityProvider.getActiveDescendantId && ((e) => i.accessibilityProvider.getActiveDescendantId(e.element))
    },
    filter: i.filter && {
      filter(e, t) {
        return i.filter.filter(e.element, t);
      }
    },
    keyboardNavigationLabelProvider: i.keyboardNavigationLabelProvider && {
      ...i.keyboardNavigationLabelProvider,
      getKeyboardNavigationLabel(e) {
        return i.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element);
      }
    },
    sorter: void 0,
    expandOnlyOnTwistieClick: typeof i.expandOnlyOnTwistieClick > "u" ? void 0 : typeof i.expandOnlyOnTwistieClick != "function" ? i.expandOnlyOnTwistieClick : ((e) => i.expandOnlyOnTwistieClick(e.element)),
    defaultFindVisibility: (e) => e.hasChildren && e.stale ? 1 : typeof i.defaultFindVisibility == "number" ? i.defaultFindVisibility : typeof i.defaultFindVisibility > "u" ? 2 : i.defaultFindVisibility(e.element)
  };
}
function aoe(i, e) {
  e(i), i.children.forEach((t) => aoe(t, e));
}
class a6e {
  get onDidScroll() {
    return this.tree.onDidScroll;
  }
  get onDidChangeFocus() {
    return Ze.map(this.tree.onDidChangeFocus, PDe);
  }
  get onDidChangeSelection() {
    return Ze.map(this.tree.onDidChangeSelection, PDe);
  }
  get onMouseDblClick() {
    return Ze.map(this.tree.onMouseDblClick, FDe);
  }
  get onPointer() {
    return Ze.map(this.tree.onPointer, FDe);
  }
  get onDidFocus() {
    return this.tree.onDidFocus;
  }
  /**
   * To be used internally only!
   * @deprecated
   */
  get onDidChangeModel() {
    return this.tree.onDidChangeModel;
  }
  get onDidChangeCollapseState() {
    return this.tree.onDidChangeCollapseState;
  }
  get onDidChangeStickyScrollFocused() {
    return this.tree.onDidChangeStickyScrollFocused;
  }
  get onDidDispose() {
    return this.tree.onDidDispose;
  }
  constructor(e, t, n, r, s, o = {}) {
    this.user = e, this.dataSource = s, this.nodes = /* @__PURE__ */ new Map(), this.subTreeRefreshPromises = /* @__PURE__ */ new Map(), this.refreshPromises = /* @__PURE__ */ new Map(), this._onDidRender = new he(), this._onDidChangeNodeSlowState = new he(), this.nodeMapper = new tpe((c) => new ope(c)), this.disposables = new ke(), this.identityProvider = o.identityProvider, this.autoExpandSingleChildren = typeof o.autoExpandSingleChildren > "u" ? !1 : o.autoExpandSingleChildren, this.sorter = o.sorter, this.getDefaultCollapseState = (c) => o.collapseByDefault ? o.collapseByDefault(c) ? kh.PreserveOrCollapsed : kh.PreserveOrExpanded : void 0;
    let a = !1, l;
    if (o.findProvider && (o.findWidgetEnabled ?? !0) && o.keyboardNavigationLabelProvider && o.contextViewProvider && (a = !0, l = new Gwt(o.findProvider, o.keyboardNavigationLabelProvider, o.filter)), this.tree = this.createTree(e, t, n, r, { ...o, findWidgetEnabled: !a, filter: l ?? o.filter }), this.root = tte({
      element: void 0,
      parent: null,
      hasChildren: !0,
      defaultCollapseState: void 0
    }), this.identityProvider && (this.root = {
      ...this.root,
      id: null
    }), this.nodes.set(null, this.root), this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables), a) {
      const c = {
        styles: o.findWidgetStyles,
        showNotFoundMessage: o.showNotFoundMessage,
        defaultFindMatchType: o.defaultFindMatchType,
        defaultFindMode: o.defaultFindMode
      };
      this.findController = this.disposables.add(new qwt(this.tree, o.findProvider, l, this.tree.options.contextViewProvider, c)), this.focusNavigationFilter = (u) => this.findController.shouldFocusWhenNavigating(u), this.onDidChangeFindOpenState = this.findController.onDidChangeOpenState, this.onDidChangeFindMode = this.findController.onDidChangeMode, this.onDidChangeFindMatchType = this.findController.onDidChangeMatchType;
    } else
      this.onDidChangeFindOpenState = this.tree.onDidChangeFindOpenState, this.onDidChangeFindMode = this.tree.onDidChangeFindMode, this.onDidChangeFindMatchType = this.tree.onDidChangeFindMatchType;
  }
  createTree(e, t, n, r, s) {
    const o = new npe(n), a = r.map((c) => new zwt(c, this.nodeMapper, this._onDidChangeNodeSlowState.event)), l = o6e(s) || {};
    return new spe(e, t, o, a, l);
  }
  updateOptions(e = {}) {
    this.findController && (e.defaultFindMode !== void 0 && (this.findController.mode = e.defaultFindMode), e.defaultFindMatchType !== void 0 && (this.findController.matchType = e.defaultFindMatchType)), this.tree.updateOptions(e);
  }
  // Widget
  getHTMLElement() {
    return this.tree.getHTMLElement();
  }
  get scrollTop() {
    return this.tree.scrollTop;
  }
  set scrollTop(e) {
    this.tree.scrollTop = e;
  }
  get scrollHeight() {
    return this.tree.scrollHeight;
  }
  get renderHeight() {
    return this.tree.renderHeight;
  }
  domFocus() {
    this.tree.domFocus();
  }
  layout(e, t) {
    this.tree.layout(e, t);
  }
  style(e) {
    this.tree.style(e);
  }
  // Model
  getInput() {
    return this.root.element;
  }
  async setInput(e, t) {
    this.cancelAllRefreshPromises(), this.root.element = e;
    const n = t && { viewState: t, focus: [], selection: [] };
    await this._updateChildren(e, !0, !1, n), n && (this.tree.setFocus(n.focus), this.tree.setSelection(n.selection)), t && typeof t.scrollTop == "number" && (this.scrollTop = t.scrollTop);
  }
  cancelAllRefreshPromises(e = !1) {
    this.refreshPromises.forEach((t) => t.cancel()), this.refreshPromises.clear(), e && (this.subTreeRefreshPromises.forEach((t) => t.cancel()), this.subTreeRefreshPromises.clear());
  }
  async _updateChildren(e = this.root.element, t = !0, n = !1, r, s) {
    if (typeof this.root.element > "u")
      throw new Ah(this.user, "Tree input not set");
    this.root.refreshPromise && (await this.root.refreshPromise, await Ze.toPromise(this._onDidRender.event));
    const o = this.getDataNode(e);
    if (await this.refreshAndRenderNode(o, t, r, s), n)
      try {
        this.tree.rerender(o);
      } catch {
      }
  }
  // View
  rerender(e) {
    if (e === void 0 || e === this.root.element) {
      this.tree.rerender();
      return;
    }
    const t = this.getDataNode(e);
    this.tree.rerender(t);
  }
  // Tree
  getNode(e = this.root.element) {
    const t = this.getDataNode(e), n = this.tree.getNode(t === this.root ? null : t);
    return this.nodeMapper.map(n);
  }
  collapse(e, t = !1) {
    const n = this.getDataNode(e);
    return this.tree.collapse(n === this.root ? null : n, t);
  }
  async expand(e, t = !1) {
    if (typeof this.root.element > "u")
      throw new Ah(this.user, "Tree input not set");
    this.root.refreshPromise && (await this.root.refreshPromise, await Ze.toPromise(this._onDidRender.event));
    const n = this.getDataNode(e);
    if (this.tree.hasElement(n) && !this.tree.isCollapsible(n) || (n.refreshPromise && (await n.refreshPromise, await Ze.toPromise(this._onDidRender.event)), n !== this.root && !n.refreshPromise && !this.tree.isCollapsed(n)))
      return !1;
    const r = this.tree.expand(n === this.root ? null : n, t);
    return n.refreshPromise && (await n.refreshPromise, await Ze.toPromise(this._onDidRender.event)), r;
  }
  setSelection(e, t) {
    const n = e.map((r) => this.getDataNode(r));
    this.tree.setSelection(n, t);
  }
  getSelection() {
    return this.tree.getSelection().map((t) => t.element);
  }
  setFocus(e, t) {
    const n = e.map((r) => this.getDataNode(r));
    this.tree.setFocus(n, t);
  }
  getFocus() {
    return this.tree.getFocus().map((t) => t.element);
  }
  reveal(e, t) {
    this.tree.reveal(this.getDataNode(e), t);
  }
  // Tree navigation
  getParentElement(e) {
    const t = this.tree.getParentElement(this.getDataNode(e));
    return t && t.element;
  }
  getFirstElementChild(e = this.root.element) {
    const t = this.getDataNode(e), n = this.tree.getFirstElementChild(t === this.root ? null : t);
    return n && n.element;
  }
  // Implementation
  getDataNode(e) {
    var n;
    const t = this.nodes.get(e === this.root.element ? null : e);
    if (!t) {
      const r = (n = this.identityProvider) == null ? void 0 : n.getId(e).toString();
      throw new Ah(this.user, `Data tree node not found${r ? `: ${r}` : ""}`);
    }
    return t;
  }
  async refreshAndRenderNode(e, t, n, r) {
    this.disposables.isDisposed || (await this.refreshNode(e, t, n), !this.disposables.isDisposed && this.render(e, n, r));
  }
  async refreshNode(e, t, n) {
    let r;
    if (this.subTreeRefreshPromises.forEach((s, o) => {
      !r && Uwt(o, e) && (r = s.then(() => this.refreshNode(e, t, n)));
    }), r)
      return r;
    if (e !== this.root && this.tree.getNode(e).collapsed) {
      e.hasChildren = !!this.dataSource.hasChildren(e.element), e.stale = !0, this.setChildren(e, [], t, n);
      return;
    }
    return this.doRefreshSubTree(e, t, n);
  }
  async doRefreshSubTree(e, t, n) {
    const r = Jo(async () => {
      const s = await this.doRefreshNode(e, t, n);
      e.stale = !1, await Z3.settled(s.map((o) => this.doRefreshSubTree(o, t, n)));
    });
    return e.refreshPromise = r, this.subTreeRefreshPromises.set(e, r), r.finally(() => {
      e.refreshPromise = void 0, this.subTreeRefreshPromises.delete(e);
    }), r;
  }
  async doRefreshNode(e, t, n) {
    e.hasChildren = !!this.dataSource.hasChildren(e.element);
    let r;
    if (!e.hasChildren)
      r = Promise.resolve(gi.empty());
    else {
      const s = this.doGetChildren(e);
      if (Kne(s))
        r = Promise.resolve(s);
      else {
        const o = db(800);
        o.then(() => {
          e.slow = !0, this._onDidChangeNodeSlowState.fire(e);
        }, (a) => null), r = s.finally(() => o.cancel());
      }
    }
    try {
      const s = await r;
      return this.setChildren(e, s, t, n);
    } catch (s) {
      if (e !== this.root && this.tree.hasElement(e) && this.tree.collapse(e), Xh(s))
        return [];
      throw s;
    } finally {
      e.slow && (e.slow = !1, this._onDidChangeNodeSlowState.fire(e));
    }
  }
  doGetChildren(e) {
    let t = this.refreshPromises.get(e);
    if (t)
      return t;
    const n = this.dataSource.getChildren(e.element);
    return Kne(n) ? this.processChildren(n) : (t = Jo(async () => this.processChildren(await n)), this.refreshPromises.set(e, t), t.finally(() => {
      this.refreshPromises.delete(e);
    }));
  }
  _onDidChangeCollapseState({ node: e, deep: t }) {
    e.element !== null && !e.collapsed && e.element.stale && (t ? this.collapse(e.element.element) : this.refreshAndRenderNode(e.element, !1).catch(fn));
  }
  setChildren(e, t, n, r) {
    const s = [...t];
    if (e.children.length === 0 && s.length === 0)
      return [];
    const o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
    for (const u of e.children)
      o.set(u.element, u), this.identityProvider && a.set(u.id, { node: u, collapsed: this.tree.hasElement(u) && this.tree.isCollapsed(u) });
    const l = [], c = s.map((u) => {
      const d = !!this.dataSource.hasChildren(u);
      if (!this.identityProvider) {
        const _ = tte({ element: u, parent: e, hasChildren: d, defaultCollapseState: this.getDefaultCollapseState(u) });
        return d && _.defaultCollapseState === kh.PreserveOrExpanded && l.push(_), _;
      }
      const h = this.identityProvider.getId(u).toString(), g = a.get(h);
      if (g) {
        const _ = g.node;
        return o.delete(_.element), this.nodes.delete(_.element), this.nodes.set(u, _), _.element = u, _.hasChildren = d, n ? g.collapsed ? (_.children.forEach((v) => aoe(v, (w) => this.nodes.delete(w.element))), _.children.splice(0, _.children.length), _.stale = !0) : l.push(_) : d && !g.collapsed && l.push(_), _;
      }
      const m = tte({ element: u, parent: e, id: h, hasChildren: d, defaultCollapseState: this.getDefaultCollapseState(u) });
      return r && r.viewState.focus && r.viewState.focus.indexOf(h) > -1 && r.focus.push(m), r && r.viewState.selection && r.viewState.selection.indexOf(h) > -1 && r.selection.push(m), (r && r.viewState.expanded && r.viewState.expanded.indexOf(h) > -1 || d && m.defaultCollapseState === kh.PreserveOrExpanded) && l.push(m), m;
    });
    for (const u of o.values())
      aoe(u, (d) => this.nodes.delete(d.element));
    for (const u of c)
      this.nodes.set(u.element, u);
    return OV(e.children, 0, e.children.length, c), e !== this.root && this.autoExpandSingleChildren && c.length === 1 && l.length === 0 && (c[0].forceExpanded = !0, l.push(c[0])), l;
  }
  render(e, t, n) {
    const r = e.children.map((o) => this.asTreeElement(o, t)), s = n && {
      ...n,
      diffIdentityProvider: n.diffIdentityProvider && {
        getId(o) {
          return n.diffIdentityProvider.getId(o.element);
        }
      }
    };
    this.tree.setChildren(e === this.root ? null : e, r, s), e !== this.root && this.tree.setCollapsible(e, e.hasChildren), this._onDidRender.fire();
  }
  asTreeElement(e, t) {
    if (e.stale)
      return {
        element: e,
        collapsible: e.hasChildren,
        collapsed: !0
      };
    let n;
    return t && t.viewState.expanded && e.id && t.viewState.expanded.indexOf(e.id) > -1 ? n = !1 : e.forceExpanded ? (n = !1, e.forceExpanded = !1) : n = e.defaultCollapseState, {
      element: e,
      children: e.hasChildren ? gi.map(e.children, (r) => this.asTreeElement(r, t)) : [],
      collapsible: e.hasChildren,
      collapsed: n
    };
  }
  processChildren(e) {
    return this.sorter && (e = [...e].sort(this.sorter.compare.bind(this.sorter))), e;
  }
  dispose() {
    this.disposables.dispose(), this.tree.dispose();
  }
}
class ape {
  get element() {
    return {
      elements: this.node.element.elements.map((e) => e.element),
      incompressible: this.node.element.incompressible
    };
  }
  get children() {
    return this.node.children.map((e) => new ape(e));
  }
  get depth() {
    return this.node.depth;
  }
  get visibleChildrenCount() {
    return this.node.visibleChildrenCount;
  }
  get visibleChildIndex() {
    return this.node.visibleChildIndex;
  }
  get collapsible() {
    return this.node.collapsible;
  }
  get collapsed() {
    return this.node.collapsed;
  }
  get visible() {
    return this.node.visible;
  }
  get filterData() {
    return this.node.filterData;
  }
  constructor(e) {
    this.node = e;
  }
}
class Kwt {
  constructor(e, t, n, r) {
    this.renderer = e, this.nodeMapper = t, this.compressibleNodeMapperProvider = n, this.onDidChangeTwistieState = r, this.renderedNodes = /* @__PURE__ */ new Map(), this.disposables = [], this.templateId = e.templateId;
  }
  renderTemplate(e) {
    return { templateData: this.renderer.renderTemplate(e) };
  }
  renderElement(e, t, n, r) {
    this.renderer.renderElement(this.nodeMapper.map(e), t, n.templateData, r);
  }
  renderCompressedElements(e, t, n, r) {
    this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e), t, n.templateData, r);
  }
  renderTwistie(e, t) {
    return e.slow ? (t.classList.add(...qt.asClassNameArray(Pe.treeItemLoading)), !0) : (t.classList.remove(...qt.asClassNameArray(Pe.treeItemLoading)), !1);
  }
  disposeElement(e, t, n, r) {
    var s, o;
    (o = (s = this.renderer).disposeElement) == null || o.call(s, this.nodeMapper.map(e), t, n.templateData, r);
  }
  disposeCompressedElements(e, t, n, r) {
    var s, o;
    (o = (s = this.renderer).disposeCompressedElements) == null || o.call(s, this.compressibleNodeMapperProvider().map(e), t, n.templateData, r);
  }
  disposeTemplate(e) {
    this.renderer.disposeTemplate(e.templateData);
  }
  dispose() {
    this.renderedNodes.clear(), this.disposables = or(this.disposables);
  }
}
function Ywt(i) {
  const e = i && o6e(i);
  return e && {
    ...e,
    keyboardNavigationLabelProvider: e.keyboardNavigationLabelProvider && {
      ...e.keyboardNavigationLabelProvider,
      getCompressedNodeKeyboardNavigationLabel(t) {
        return i.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((n) => n.element));
      }
    }
  };
}
class Xwt extends a6e {
  constructor(e, t, n, r, s, o, a = {}) {
    super(e, t, n, s, o, a), this.compressionDelegate = r, this.compressibleNodeMapper = new tpe((l) => new ape(l)), this.filter = a.filter;
  }
  createTree(e, t, n, r, s) {
    const o = new npe(n), a = r.map((c) => new Kwt(c, this.nodeMapper, () => this.compressibleNodeMapper, this._onDidChangeNodeSlowState.event)), l = Ywt(s) || {};
    return new s6e(e, t, o, a, l);
  }
  asTreeElement(e, t) {
    return {
      incompressible: this.compressionDelegate.isIncompressible(e.element),
      ...super.asTreeElement(e, t)
    };
  }
  render(e, t, n) {
    if (!this.identityProvider)
      return super.render(e, t);
    const r = (g) => this.identityProvider.getId(g).toString(), s = (g) => {
      const m = /* @__PURE__ */ new Set();
      for (const _ of g) {
        const v = this.tree.getCompressedTreeNode(_ === this.root ? null : _);
        if (v.element)
          for (const w of v.element.elements)
            m.add(r(w.element));
      }
      return m;
    }, o = s(this.tree.getSelection()), a = s(this.tree.getFocus());
    super.render(e, t, n);
    const l = this.getSelection();
    let c = !1;
    const u = this.getFocus();
    let d = !1;
    const h = (g) => {
      const m = g.element;
      if (m)
        for (let _ = 0; _ < m.elements.length; _++) {
          const v = r(m.elements[_].element), w = m.elements[m.elements.length - 1].element;
          o.has(v) && l.indexOf(w) === -1 && (l.push(w), c = !0), a.has(v) && u.indexOf(w) === -1 && (u.push(w), d = !0);
        }
      g.children.forEach(h);
    };
    h(this.tree.getCompressedTreeNode(e === this.root ? null : e)), c && this.setSelection(l), d && this.setFocus(u);
  }
  // For compressed async data trees, `TreeVisibility.Recurse` doesn't currently work
  // and we have to filter everything beforehand
  // Related to #85193 and #85835
  processChildren(e) {
    return this.filter && (e = gi.filter(e, (t) => {
      const n = this.filter.filter(
        t,
        1
        /* TreeVisibility.Visible */
      ), r = Zwt(n);
      if (r === 2)
        throw new Error("Recursive tree visibility not supported in async data compressed trees");
      return r === 1;
    })), super.processChildren(e);
  }
}
function Zwt(i) {
  return typeof i == "boolean" ? i ? 1 : 0 : zB(i) ? ST(i.visibility) : ST(i);
}
class Qwt extends n6e {
  constructor(e, t, n, r, s, o = {}) {
    super(e, t, n, r, o), this.user = e, this.dataSource = s, this.identityProvider = o.identityProvider;
  }
  createModel(e, t) {
    return new ipe(e, t);
  }
}
new ut("isMac", Kn, S(1669, "Whether the operating system is macOS"));
new ut("isLinux", Qu, S(1670, "Whether the operating system is Linux"));
const EK = new ut("isWindows", Za, S(1671, "Whether the operating system is Windows")), l6e = new ut("isWeb", Lb, S(1672, "Whether the platform is a web browser"));
new ut("isMacNative", Kn && !Lb, S(1673, "Whether the operating system is macOS on a non-browser platform"));
new ut("isIOS", jf, S(1674, "Whether the operating system is iOS"));
new ut("isMobile", PMe, S(1675, "Whether the platform is a mobile web browser"));
new ut("isDevelopment", !1, !0);
new ut("productQualityType", "", S(1676, "Quality type of VS Code"));
const c6e = "inputFocus", lpe = new ut(c6e, !1, S(1677, "Whether keyboard focus is inside an input box"));
var p0 = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Jr = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const rg = Vn("listService");
class Jwt {
  get lastFocusedList() {
    return this._lastFocusedWidget;
  }
  constructor() {
    this.disposables = new ke(), this.lists = [], this._lastFocusedWidget = void 0;
  }
  setLastFocusedList(e) {
    var t, n;
    e !== this._lastFocusedWidget && ((t = this._lastFocusedWidget) == null || t.getHTMLElement().classList.remove("last-focused"), this._lastFocusedWidget = e, (n = this._lastFocusedWidget) == null || n.getHTMLElement().classList.add("last-focused"));
  }
  register(e, t) {
    if (this.lists.some((r) => r.widget === e))
      throw new Error("Cannot register the same widget multiple times");
    const n = { widget: e, extraContextKeys: t };
    return this.lists.push(n), wq(e.getHTMLElement()) && this.setLastFocusedList(e), Vg(e.onDidFocus(() => this.setLastFocusedList(e)), Et(() => this.lists.splice(this.lists.indexOf(n), 1)), e.onDidDispose(() => {
      this.lists = this.lists.filter((r) => r !== n), this._lastFocusedWidget === e && this.setLastFocusedList(void 0);
    }));
  }
  dispose() {
    this.disposables.dispose();
  }
}
const s5 = new ut("listScrollAtBoundary", "none");
Re.or(s5.isEqualTo("top"), s5.isEqualTo("both"));
Re.or(s5.isEqualTo("bottom"), s5.isEqualTo("both"));
const u6e = new ut("listFocus", !0), d6e = new ut("treestickyScrollFocused", !1), xK = new ut("listSupportsMultiselect", !0), h6e = Re.and(u6e, Re.not(c6e), d6e.negate()), cpe = new ut("listHasSelectionOrFocus", !1), upe = new ut("listDoubleSelection", !1), dpe = new ut("listMultiSelection", !1), LK = new ut("listSelectionNavigation", !1), eSt = new ut("listSupportsFind", !0), hpe = new ut("treeElementCanCollapse", !1), tSt = new ut("treeElementHasParent", !1), fpe = new ut("treeElementCanExpand", !1), nSt = new ut("treeElementHasChild", !1), iSt = new ut("treeFindOpen", !1), f6e = "listTypeNavigationMode", g6e = "listAutomaticKeyboardNavigation";
function TK(i, e) {
  const t = i.createScoped(e.getHTMLElement());
  return u6e.bindTo(t), t;
}
function kK(i, e) {
  const t = s5.bindTo(i), n = () => {
    const r = e.scrollTop === 0, s = e.scrollHeight - e.renderHeight - e.scrollTop < 1;
    r && s ? t.set("both") : r ? t.set("top") : s ? t.set("bottom") : t.set("none");
  };
  return n(), e.onDidScroll(n);
}
const ik = "workbench.list.multiSelectModifier", $W = "workbench.list.openMode", Vf = "workbench.list.horizontalScrolling", gpe = "workbench.list.defaultFindMode", ppe = "workbench.list.typeNavigationMode", fz = "workbench.list.keyboardNavigation", bm = "workbench.list.scrollByPage", mpe = "workbench.list.defaultFindMatchType", o5 = "workbench.tree.indent", gz = "workbench.tree.renderIndentGuides", vm = "workbench.list.smoothScrolling", yb = "workbench.list.mouseWheelScrollSensitivity", Cb = "workbench.list.fastScrollSensitivity", pz = "workbench.tree.expandMode", mz = "workbench.tree.enableStickyScroll", _z = "workbench.tree.stickyScrollMaxItemCount";
function wb(i) {
  return i.getValue(ik) === "alt";
}
class rSt extends ge {
  constructor(e) {
    super(), this.configurationService = e, this.useAltAsMultipleSelectionModifier = wb(e), this.registerListeners();
  }
  registerListeners() {
    this._register(this.configurationService.onDidChangeConfiguration((e) => {
      e.affectsConfiguration(ik) && (this.useAltAsMultipleSelectionModifier = wb(this.configurationService));
    }));
  }
  isSelectionSingleChangeEvent(e) {
    return this.useAltAsMultipleSelectionModifier ? e.browserEvent.altKey : r5e(e);
  }
  isSelectionRangeChangeEvent(e) {
    return s5e(e);
  }
}
function DK(i, e) {
  const t = i.get(xn), n = i.get(Fi), r = new ke();
  return [{
    ...e,
    keyboardNavigationDelegate: { mightProducePrintableCharacter(o) {
      return n.mightProducePrintableCharacter(o);
    } },
    smoothScrolling: !!t.getValue(vm),
    mouseWheelScrollSensitivity: t.getValue(yb),
    fastScrollSensitivity: t.getValue(Cb),
    multipleSelectionController: e.multipleSelectionController ?? r.add(new rSt(t)),
    keyboardNavigationEventFilter: aSt(n),
    scrollByPage: !!t.getValue(bm)
  }, r];
}
let BDe = class extends Zh {
  constructor(e, t, n, r, s, o, a, l, c) {
    const u = typeof s.horizontalScrolling < "u" ? s.horizontalScrolling : !!l.getValue(Vf), [d, h] = c.invokeFunction(DK, s);
    super(e, t, n, r, {
      keyboardSupport: !1,
      ...d,
      horizontalScrolling: u
    }), this.disposables.add(h), this.contextKeyService = TK(o, this), this.disposables.add(kK(this.contextKeyService, this)), this.listSupportsMultiSelect = xK.bindTo(this.contextKeyService), this.listSupportsMultiSelect.set(s.multipleSelectionSupport !== !1), LK.bindTo(this.contextKeyService).set(!!s.selectionNavigation), this.listHasSelectionOrFocus = cpe.bindTo(this.contextKeyService), this.listDoubleSelection = upe.bindTo(this.contextKeyService), this.listMultiSelection = dpe.bindTo(this.contextKeyService), this.horizontalScrolling = s.horizontalScrolling, this._useAltAsMultipleSelectionModifier = wb(l), this.disposables.add(this.contextKeyService), this.disposables.add(a.register(this)), this.updateStyles(s.overrideStyles), this.disposables.add(this.onDidChangeSelection(() => {
      const m = this.getSelection(), _ = this.getFocus();
      this.contextKeyService.bufferChangeEvents(() => {
        this.listHasSelectionOrFocus.set(m.length > 0 || _.length > 0), this.listMultiSelection.set(m.length > 1), this.listDoubleSelection.set(m.length === 2);
      });
    })), this.disposables.add(this.onDidChangeFocus(() => {
      const m = this.getSelection(), _ = this.getFocus();
      this.listHasSelectionOrFocus.set(m.length > 0 || _.length > 0);
    })), this.disposables.add(l.onDidChangeConfiguration((m) => {
      m.affectsConfiguration(ik) && (this._useAltAsMultipleSelectionModifier = wb(l));
      let _ = {};
      if (m.affectsConfiguration(Vf) && this.horizontalScrolling === void 0) {
        const v = !!l.getValue(Vf);
        _ = { ..._, horizontalScrolling: v };
      }
      if (m.affectsConfiguration(bm)) {
        const v = !!l.getValue(bm);
        _ = { ..._, scrollByPage: v };
      }
      if (m.affectsConfiguration(vm)) {
        const v = !!l.getValue(vm);
        _ = { ..._, smoothScrolling: v };
      }
      if (m.affectsConfiguration(yb)) {
        const v = l.getValue(yb);
        _ = { ..._, mouseWheelScrollSensitivity: v };
      }
      if (m.affectsConfiguration(Cb)) {
        const v = l.getValue(Cb);
        _ = { ..._, fastScrollSensitivity: v };
      }
      Object.keys(_).length > 0 && this.updateOptions(_);
    })), this.navigator = new p6e(this, { configurationService: l, ...s }), this.disposables.add(this.navigator);
  }
  updateOptions(e) {
    super.updateOptions(e), e.overrideStyles !== void 0 && this.updateStyles(e.overrideStyles), e.multipleSelectionSupport !== void 0 && this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport);
  }
  updateStyles(e) {
    this.style(e ? JT(e) : o2);
  }
};
BDe = p0([
  Jr(5, Jt),
  Jr(6, rg),
  Jr(7, xn),
  Jr(8, xt)
], BDe);
let HDe = class extends J1t {
  constructor(e, t, n, r, s, o, a, l, c) {
    const u = typeof s.horizontalScrolling < "u" ? s.horizontalScrolling : !!l.getValue(Vf), [d, h] = c.invokeFunction(DK, s);
    super(e, t, n, r, {
      keyboardSupport: !1,
      ...d,
      horizontalScrolling: u
    }), this.disposables = new ke(), this.disposables.add(h), this.contextKeyService = TK(o, this), this.disposables.add(kK(this.contextKeyService, this.widget)), this.horizontalScrolling = s.horizontalScrolling, this.listSupportsMultiSelect = xK.bindTo(this.contextKeyService), this.listSupportsMultiSelect.set(s.multipleSelectionSupport !== !1), LK.bindTo(this.contextKeyService).set(!!s.selectionNavigation), this._useAltAsMultipleSelectionModifier = wb(l), this.disposables.add(this.contextKeyService), this.disposables.add(a.register(this)), this.updateStyles(s.overrideStyles), this.disposables.add(l.onDidChangeConfiguration((m) => {
      m.affectsConfiguration(ik) && (this._useAltAsMultipleSelectionModifier = wb(l));
      let _ = {};
      if (m.affectsConfiguration(Vf) && this.horizontalScrolling === void 0) {
        const v = !!l.getValue(Vf);
        _ = { ..._, horizontalScrolling: v };
      }
      if (m.affectsConfiguration(bm)) {
        const v = !!l.getValue(bm);
        _ = { ..._, scrollByPage: v };
      }
      if (m.affectsConfiguration(vm)) {
        const v = !!l.getValue(vm);
        _ = { ..._, smoothScrolling: v };
      }
      if (m.affectsConfiguration(yb)) {
        const v = l.getValue(yb);
        _ = { ..._, mouseWheelScrollSensitivity: v };
      }
      if (m.affectsConfiguration(Cb)) {
        const v = l.getValue(Cb);
        _ = { ..._, fastScrollSensitivity: v };
      }
      Object.keys(_).length > 0 && this.updateOptions(_);
    })), this.navigator = new p6e(this, { configurationService: l, ...s }), this.disposables.add(this.navigator);
  }
  updateOptions(e) {
    super.updateOptions(e), e.overrideStyles !== void 0 && this.updateStyles(e.overrideStyles), e.multipleSelectionSupport !== void 0 && this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport);
  }
  updateStyles(e) {
    this.style(e ? JT(e) : o2);
  }
  dispose() {
    this.disposables.dispose(), super.dispose();
  }
};
HDe = p0([
  Jr(5, Jt),
  Jr(6, rg),
  Jr(7, xn),
  Jr(8, xt)
], HDe);
let WDe = class extends noe {
  constructor(e, t, n, r, s, o, a, l, c, u) {
    const d = typeof o.horizontalScrolling < "u" ? o.horizontalScrolling : !!c.getValue(Vf), [h, g] = u.invokeFunction(DK, o);
    super(e, t, n, r, s, {
      keyboardSupport: !1,
      ...h,
      horizontalScrolling: d
    }), this.disposables.add(g), this.contextKeyService = TK(a, this), this.disposables.add(kK(this.contextKeyService, this)), this.listSupportsMultiSelect = xK.bindTo(this.contextKeyService), this.listSupportsMultiSelect.set(o.multipleSelectionSupport !== !1), LK.bindTo(this.contextKeyService).set(!!o.selectionNavigation), this.listHasSelectionOrFocus = cpe.bindTo(this.contextKeyService), this.listDoubleSelection = upe.bindTo(this.contextKeyService), this.listMultiSelection = dpe.bindTo(this.contextKeyService), this.horizontalScrolling = o.horizontalScrolling, this._useAltAsMultipleSelectionModifier = wb(c), this.disposables.add(this.contextKeyService), this.disposables.add(l.register(this)), this.updateStyles(o.overrideStyles), this.disposables.add(this.onDidChangeSelection(() => {
      const _ = this.getSelection(), v = this.getFocus();
      this.contextKeyService.bufferChangeEvents(() => {
        this.listHasSelectionOrFocus.set(_.length > 0 || v.length > 0), this.listMultiSelection.set(_.length > 1), this.listDoubleSelection.set(_.length === 2);
      });
    })), this.disposables.add(this.onDidChangeFocus(() => {
      const _ = this.getSelection(), v = this.getFocus();
      this.listHasSelectionOrFocus.set(_.length > 0 || v.length > 0);
    })), this.disposables.add(c.onDidChangeConfiguration((_) => {
      _.affectsConfiguration(ik) && (this._useAltAsMultipleSelectionModifier = wb(c));
      let v = {};
      if (_.affectsConfiguration(Vf) && this.horizontalScrolling === void 0) {
        const w = !!c.getValue(Vf);
        v = { ...v, horizontalScrolling: w };
      }
      if (_.affectsConfiguration(bm)) {
        const w = !!c.getValue(bm);
        v = { ...v, scrollByPage: w };
      }
      if (_.affectsConfiguration(vm)) {
        const w = !!c.getValue(vm);
        v = { ...v, smoothScrolling: w };
      }
      if (_.affectsConfiguration(yb)) {
        const w = c.getValue(yb);
        v = { ...v, mouseWheelScrollSensitivity: w };
      }
      if (_.affectsConfiguration(Cb)) {
        const w = c.getValue(Cb);
        v = { ...v, fastScrollSensitivity: w };
      }
      Object.keys(v).length > 0 && this.updateOptions(v);
    })), this.navigator = new sSt(this, { configurationService: c, ...o }), this.disposables.add(this.navigator);
  }
  updateOptions(e) {
    super.updateOptions(e), e.overrideStyles !== void 0 && this.updateStyles(e.overrideStyles), e.multipleSelectionSupport !== void 0 && this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport);
  }
  updateStyles(e) {
    this.style(e ? JT(e) : o2);
  }
  dispose() {
    this.disposables.dispose(), super.dispose();
  }
};
WDe = p0([
  Jr(6, Jt),
  Jr(7, rg),
  Jr(8, xn),
  Jr(9, xt)
], WDe);
class _pe extends ge {
  constructor(e, t) {
    super(), this.widget = e, this._onDidOpen = this._register(new he()), this.onDidOpen = this._onDidOpen.event, this._register(Ze.filter(this.widget.onDidChangeSelection, (n) => sy(n.browserEvent))((n) => this.onSelectionFromKeyboard(n))), this._register(this.widget.onPointer((n) => this.onPointer(n.element, n.browserEvent))), this._register(this.widget.onMouseDblClick((n) => this.onMouseDblClick(n.element, n.browserEvent))), typeof (t == null ? void 0 : t.openOnSingleClick) != "boolean" && (t != null && t.configurationService) ? (this.openOnSingleClick = (t == null ? void 0 : t.configurationService.getValue($W)) !== "doubleClick", this._register(t == null ? void 0 : t.configurationService.onDidChangeConfiguration((n) => {
      n.affectsConfiguration($W) && (this.openOnSingleClick = (t == null ? void 0 : t.configurationService.getValue($W)) !== "doubleClick");
    }))) : this.openOnSingleClick = (t == null ? void 0 : t.openOnSingleClick) ?? !0;
  }
  onSelectionFromKeyboard(e) {
    if (e.elements.length !== 1)
      return;
    const t = e.browserEvent, n = typeof t.preserveFocus == "boolean" ? t.preserveFocus : !0, r = typeof t.pinned == "boolean" ? t.pinned : !n;
    this._open(this.getSelectedElement(), n, r, !1, e.browserEvent);
  }
  onPointer(e, t) {
    if (!this.openOnSingleClick || t.detail === 2)
      return;
    const r = t.button === 1, s = !0, o = r, a = t.ctrlKey || t.metaKey || t.altKey;
    this._open(e, s, o, a, t);
  }
  onMouseDblClick(e, t) {
    if (!t)
      return;
    const n = t.target;
    if (n.classList.contains("monaco-tl-twistie") || n.classList.contains("monaco-icon-label") && n.classList.contains("folder-icon") && t.offsetX < 16)
      return;
    const s = !1, o = !0, a = t.ctrlKey || t.metaKey || t.altKey;
    this._open(e, s, o, a, t);
  }
  _open(e, t, n, r, s) {
    e && this._onDidOpen.fire({
      editorOptions: {
        preserveFocus: t,
        pinned: n,
        revealIfVisible: !0
      },
      sideBySide: r,
      element: e,
      browserEvent: s
    });
  }
}
class p6e extends _pe {
  constructor(e, t) {
    super(e, t), this.widget = e;
  }
  getSelectedElement() {
    return this.widget.getSelectedElements()[0];
  }
}
class sSt extends _pe {
  constructor(e, t) {
    super(e, t);
  }
  getSelectedElement() {
    return this.widget.getSelectedElements()[0];
  }
}
class oSt extends _pe {
  constructor(e, t) {
    super(e, t);
  }
  getSelectedElement() {
    return this.widget.getSelection()[0] ?? void 0;
  }
}
function aSt(i) {
  let e = !1;
  return (t) => {
    if (t.toKeyCodeChord().isModifierKey())
      return !1;
    if (e)
      return e = !1, !1;
    const n = i.softDispatch(t, t.target);
    return n.kind === 1 ? (e = !0, !1) : (e = !1, n.kind === 0);
  };
}
let bz = class extends spe {
  get onDidOpen() {
    return this.internals.onDidOpen;
  }
  constructor(e, t, n, r, s, o, a, l, c) {
    const { options: u, getTypeNavigationMode: d, disposable: h } = o.invokeFunction($B, s);
    super(e, t, n, r, u), this.disposables.add(h), this.internals = new xT(this, s, d, s.overrideStyles, a, l, c), this.disposables.add(this.internals);
  }
  updateOptions(e) {
    super.updateOptions(e), this.internals.updateOptions(e);
  }
};
bz = p0([
  Jr(5, xt),
  Jr(6, Jt),
  Jr(7, rg),
  Jr(8, xn)
], bz);
let VDe = class extends s6e {
  constructor(e, t, n, r, s, o, a, l, c) {
    const { options: u, getTypeNavigationMode: d, disposable: h } = o.invokeFunction($B, s);
    super(e, t, n, r, u), this.disposables.add(h), this.internals = new xT(this, s, d, s.overrideStyles, a, l, c), this.disposables.add(this.internals);
  }
  updateOptions(e = {}) {
    super.updateOptions(e), e.overrideStyles && this.internals.updateStyleOverrides(e.overrideStyles), this.internals.updateOptions(e);
  }
};
VDe = p0([
  Jr(5, xt),
  Jr(6, Jt),
  Jr(7, rg),
  Jr(8, xn)
], VDe);
let UDe = class extends Qwt {
  constructor(e, t, n, r, s, o, a, l, c, u) {
    const { options: d, getTypeNavigationMode: h, disposable: g } = a.invokeFunction($B, o);
    super(e, t, n, r, s, d), this.disposables.add(g), this.internals = new xT(this, o, h, o.overrideStyles, l, c, u), this.disposables.add(this.internals);
  }
  updateOptions(e = {}) {
    super.updateOptions(e), e.overrideStyles !== void 0 && this.internals.updateStyleOverrides(e.overrideStyles), this.internals.updateOptions(e);
  }
};
UDe = p0([
  Jr(6, xt),
  Jr(7, Jt),
  Jr(8, rg),
  Jr(9, xn)
], UDe);
let loe = class extends a6e {
  get onDidOpen() {
    return this.internals.onDidOpen;
  }
  constructor(e, t, n, r, s, o, a, l, c, u) {
    const { options: d, getTypeNavigationMode: h, disposable: g } = a.invokeFunction($B, o);
    super(e, t, n, r, s, d), this.disposables.add(g), this.internals = new xT(this, o, h, o.overrideStyles, l, c, u), this.disposables.add(this.internals);
  }
  updateOptions(e = {}) {
    super.updateOptions(e), e.overrideStyles && this.internals.updateStyleOverrides(e.overrideStyles), this.internals.updateOptions(e);
  }
};
loe = p0([
  Jr(6, xt),
  Jr(7, Jt),
  Jr(8, rg),
  Jr(9, xn)
], loe);
let zDe = class extends Xwt {
  constructor(e, t, n, r, s, o, a, l, c, u, d) {
    const { options: h, getTypeNavigationMode: g, disposable: m } = l.invokeFunction($B, a);
    super(e, t, n, r, s, o, h), this.disposables.add(m), this.internals = new xT(this, a, g, a.overrideStyles, c, u, d), this.disposables.add(this.internals);
  }
  updateOptions(e) {
    super.updateOptions(e), this.internals.updateOptions(e);
  }
};
zDe = p0([
  Jr(7, xt),
  Jr(8, Jt),
  Jr(9, rg),
  Jr(10, xn)
], zDe);
function m6e(i) {
  const e = i.getValue(gpe);
  if (e === "highlight")
    return Oh.Highlight;
  if (e === "filter")
    return Oh.Filter;
  const t = i.getValue(fz);
  if (t === "simple" || t === "highlight")
    return Oh.Highlight;
  if (t === "filter")
    return Oh.Filter;
}
function _6e(i) {
  const e = i.getValue(mpe);
  if (e === "fuzzy")
    return Zp.Fuzzy;
  if (e === "contiguous")
    return Zp.Contiguous;
}
function $B(i, e) {
  const t = i.get(xn), n = i.get(g0), r = i.get(Jt), s = i.get(xt), o = () => {
    const h = r.getContextKeyValue(f6e);
    if (h === "automatic")
      return G_.Automatic;
    if (h === "trigger" || r.getContextKeyValue(g6e) === !1)
      return G_.Trigger;
    const m = t.getValue(ppe);
    if (m === "automatic")
      return G_.Automatic;
    if (m === "trigger")
      return G_.Trigger;
  }, a = e.horizontalScrolling !== void 0 ? e.horizontalScrolling : !!t.getValue(Vf), [l, c] = s.invokeFunction(DK, e), u = e.paddingBottom, d = e.renderIndentGuides !== void 0 ? e.renderIndentGuides : t.getValue(gz);
  return {
    getTypeNavigationMode: o,
    disposable: c,
    // eslint-disable-next-line local/code-no-dangerous-type-assertions
    options: {
      // ...options, // TODO@Joao why is this not splatted here?
      keyboardSupport: !1,
      ...l,
      indent: typeof t.getValue(o5) == "number" ? t.getValue(o5) : void 0,
      renderIndentGuides: d,
      smoothScrolling: !!t.getValue(vm),
      defaultFindMode: m6e(t),
      defaultFindMatchType: _6e(t),
      horizontalScrolling: a,
      scrollByPage: !!t.getValue(bm),
      paddingBottom: u,
      hideTwistiesOfChildlessElements: e.hideTwistiesOfChildlessElements,
      expandOnlyOnTwistieClick: e.expandOnlyOnTwistieClick ?? t.getValue(pz) === "doubleClick",
      contextViewProvider: n,
      findWidgetStyles: Tyt,
      enableStickyScroll: !!t.getValue(mz),
      stickyScrollMaxItemCount: Number(t.getValue(_z))
    }
  };
}
let xT = class {
  get onDidOpen() {
    return this.navigator.onDidOpen;
  }
  constructor(e, t, n, r, s, o, a) {
    this.tree = e, this.disposables = [], this.contextKeyService = TK(s, e), this.disposables.push(kK(this.contextKeyService, e)), this.listSupportsMultiSelect = xK.bindTo(this.contextKeyService), this.listSupportsMultiSelect.set(t.multipleSelectionSupport !== !1), LK.bindTo(this.contextKeyService).set(!!t.selectionNavigation), this.listSupportFindWidget = eSt.bindTo(this.contextKeyService), this.listSupportFindWidget.set(t.findWidgetEnabled ?? !0), this.hasSelectionOrFocus = cpe.bindTo(this.contextKeyService), this.hasDoubleSelection = upe.bindTo(this.contextKeyService), this.hasMultiSelection = dpe.bindTo(this.contextKeyService), this.treeElementCanCollapse = hpe.bindTo(this.contextKeyService), this.treeElementHasParent = tSt.bindTo(this.contextKeyService), this.treeElementCanExpand = fpe.bindTo(this.contextKeyService), this.treeElementHasChild = nSt.bindTo(this.contextKeyService), this.treeFindOpen = iSt.bindTo(this.contextKeyService), this.treeStickyScrollFocused = d6e.bindTo(this.contextKeyService), this._useAltAsMultipleSelectionModifier = wb(a), this.updateStyleOverrides(r);
    const c = () => {
      const d = e.getFocus()[0];
      if (!d)
        return;
      const h = e.getNode(d);
      this.treeElementCanCollapse.set(h.collapsible && !h.collapsed), this.treeElementHasParent.set(!!e.getParentElement(d)), this.treeElementCanExpand.set(h.collapsible && h.collapsed), this.treeElementHasChild.set(!!e.getFirstElementChild(d));
    }, u = /* @__PURE__ */ new Set();
    u.add(f6e), u.add(g6e), this.disposables.push(this.contextKeyService, o.register(e), e.onDidChangeSelection(() => {
      const d = e.getSelection(), h = e.getFocus();
      this.contextKeyService.bufferChangeEvents(() => {
        this.hasSelectionOrFocus.set(d.length > 0 || h.length > 0), this.hasMultiSelection.set(d.length > 1), this.hasDoubleSelection.set(d.length === 2);
      });
    }), e.onDidChangeFocus(() => {
      const d = e.getSelection(), h = e.getFocus();
      this.hasSelectionOrFocus.set(d.length > 0 || h.length > 0), c();
    }), e.onDidChangeCollapseState(c), e.onDidChangeModel(c), e.onDidChangeFindOpenState((d) => this.treeFindOpen.set(d)), e.onDidChangeStickyScrollFocused((d) => this.treeStickyScrollFocused.set(d)), a.onDidChangeConfiguration((d) => {
      let h = {};
      if (d.affectsConfiguration(ik) && (this._useAltAsMultipleSelectionModifier = wb(a)), d.affectsConfiguration(o5)) {
        const g = a.getValue(o5);
        h = { ...h, indent: g };
      }
      if (d.affectsConfiguration(gz) && t.renderIndentGuides === void 0) {
        const g = a.getValue(gz);
        h = { ...h, renderIndentGuides: g };
      }
      if (d.affectsConfiguration(vm)) {
        const g = !!a.getValue(vm);
        h = { ...h, smoothScrolling: g };
      }
      if (d.affectsConfiguration(gpe) || d.affectsConfiguration(fz)) {
        const g = m6e(a);
        h = { ...h, defaultFindMode: g };
      }
      if (d.affectsConfiguration(ppe) || d.affectsConfiguration(fz)) {
        const g = n();
        h = { ...h, typeNavigationMode: g };
      }
      if (d.affectsConfiguration(mpe)) {
        const g = _6e(a);
        h = { ...h, defaultFindMatchType: g };
      }
      if (d.affectsConfiguration(Vf) && t.horizontalScrolling === void 0) {
        const g = !!a.getValue(Vf);
        h = { ...h, horizontalScrolling: g };
      }
      if (d.affectsConfiguration(bm)) {
        const g = !!a.getValue(bm);
        h = { ...h, scrollByPage: g };
      }
      if (d.affectsConfiguration(pz) && t.expandOnlyOnTwistieClick === void 0 && (h = { ...h, expandOnlyOnTwistieClick: a.getValue(pz) === "doubleClick" }), d.affectsConfiguration(mz)) {
        const g = a.getValue(mz);
        h = { ...h, enableStickyScroll: g };
      }
      if (d.affectsConfiguration(_z)) {
        const g = Math.max(1, a.getValue(_z));
        h = { ...h, stickyScrollMaxItemCount: g };
      }
      if (d.affectsConfiguration(yb)) {
        const g = a.getValue(yb);
        h = { ...h, mouseWheelScrollSensitivity: g };
      }
      if (d.affectsConfiguration(Cb)) {
        const g = a.getValue(Cb);
        h = { ...h, fastScrollSensitivity: g };
      }
      Object.keys(h).length > 0 && e.updateOptions(h);
    }), this.contextKeyService.onDidChangeContext((d) => {
      d.affectsSome(u) && e.updateOptions({ typeNavigationMode: n() });
    })), this.navigator = new oSt(e, { configurationService: a, ...t }), this.disposables.push(this.navigator);
  }
  updateOptions(e) {
    e.multipleSelectionSupport !== void 0 && this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport);
  }
  updateStyleOverrides(e) {
    this.tree.style(e ? JT(e) : o2);
  }
  dispose() {
    this.disposables = or(this.disposables);
  }
};
xT = p0([
  Jr(4, Jt),
  Jr(5, rg),
  Jr(6, xn)
], xT);
const lSt = Fs.as(Cm.Configuration);
lSt.registerConfiguration({
  id: "workbench",
  order: 7,
  title: S(1688, "Workbench"),
  type: "object",
  properties: {
    [ik]: {
      type: "string",
      enum: ["ctrlCmd", "alt"],
      markdownEnumDescriptions: [
        S(1689, "Maps to `Control` on Windows and Linux and to `Command` on macOS."),
        S(1690, "Maps to `Alt` on Windows and Linux and to `Option` on macOS.")
      ],
      default: "ctrlCmd",
      description: S(1691, "The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")
    },
    [$W]: {
      type: "string",
      enum: ["singleClick", "doubleClick"],
      default: "singleClick",
      description: S(1692, "Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")
    },
    [Vf]: {
      type: "boolean",
      default: !1,
      description: S(1693, "Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")
    },
    [bm]: {
      type: "boolean",
      default: !1,
      description: S(1694, "Controls whether clicks in the scrollbar scroll page by page.")
    },
    [o5]: {
      type: "number",
      default: 8,
      minimum: 4,
      maximum: 40,
      description: S(1695, "Controls tree indentation in pixels.")
    },
    [gz]: {
      type: "string",
      enum: ["none", "onHover", "always"],
      default: "onHover",
      description: S(1696, "Controls whether the tree should render indent guides.")
    },
    [vm]: {
      type: "boolean",
      default: !1,
      description: S(1697, "Controls whether lists and trees have smooth scrolling.")
    },
    [yb]: {
      type: "number",
      default: 1,
      markdownDescription: S(1698, "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")
    },
    [Cb]: {
      type: "number",
      default: 5,
      markdownDescription: S(1699, "Scrolling speed multiplier when pressing `Alt`.")
    },
    [gpe]: {
      type: "string",
      enum: ["highlight", "filter"],
      enumDescriptions: [
        S(1700, "Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),
        S(1701, "Filter elements when searching.")
      ],
      default: "highlight",
      description: S(1702, "Controls the default find mode for lists and trees in the workbench.")
    },
    [fz]: {
      type: "string",
      enum: ["simple", "highlight", "filter"],
      enumDescriptions: [
        S(1703, "Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),
        S(1704, "Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),
        S(1705, "Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")
      ],
      default: "highlight",
      description: S(1706, "Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),
      deprecated: !0,
      deprecationMessage: S(1707, "Please use 'workbench.list.defaultFindMode' and	'workbench.list.typeNavigationMode' instead.")
    },
    [mpe]: {
      type: "string",
      enum: ["fuzzy", "contiguous"],
      enumDescriptions: [
        S(1708, "Use fuzzy matching when searching."),
        S(1709, "Use contiguous matching when searching.")
      ],
      default: "fuzzy",
      description: S(1710, "Controls the type of matching used when searching lists and trees in the workbench.")
    },
    [pz]: {
      type: "string",
      enum: ["singleClick", "doubleClick"],
      default: "singleClick",
      description: S(1711, "Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")
    },
    [mz]: {
      type: "boolean",
      default: !0,
      description: S(1712, "Controls whether sticky scrolling is enabled in trees.")
    },
    [_z]: {
      type: "number",
      minimum: 1,
      default: 7,
      markdownDescription: S(1713, "Controls the number of sticky elements displayed in the tree when {0} is enabled.", "`#workbench.tree.enableStickyScroll#`")
    },
    [ppe]: {
      type: "string",
      enum: ["automatic", "trigger"],
      default: "automatic",
      markdownDescription: S(1714, "Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")
    }
  }
});
class o0 {
  constructor(e, t, n, r) {
    this.isProviderFirst = e, this.parent = t, this.link = n, this._rangeCallback = r, this.id = jre.nextId();
  }
  get uri() {
    return this.link.uri;
  }
  get range() {
    return this._range ?? this.link.targetSelectionRange ?? this.link.range;
  }
  set range(e) {
    this._range = e, this._rangeCallback(this);
  }
  get ariaMessage() {
    var t;
    const e = (t = this.parent.getPreview(this)) == null ? void 0 : t.preview(this.range);
    return e ? S(1083, "{0} in {1} on line {2} at column {3}", e.value, Kf(this.uri), this.range.startLineNumber, this.range.startColumn) : S(1082, "in {0} on line {1} at column {2}", Kf(this.uri), this.range.startLineNumber, this.range.startColumn);
  }
}
class cSt {
  constructor(e) {
    this._modelReference = e;
  }
  dispose() {
    this._modelReference.dispose();
  }
  preview(e, t = 8) {
    const n = this._modelReference.object.textEditorModel;
    if (!n)
      return;
    const { startLineNumber: r, startColumn: s, endLineNumber: o, endColumn: a } = e, l = n.getWordUntilPosition({ lineNumber: r, column: s - t }), c = new z(r, l.startColumn, r, s), u = new z(
      o,
      a,
      o,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    ), d = n.getValueInRange(c).replace(/^\s+/, ""), h = n.getValueInRange(e), g = n.getValueInRange(u).replace(/\s+$/, "");
    return {
      value: d + h + g,
      highlight: { start: d.length, end: d.length + h.length }
    };
  }
}
class fA {
  constructor(e, t) {
    this.parent = e, this.uri = t, this.children = [], this._previews = new Co();
  }
  dispose() {
    or(this._previews.values()), this._previews.clear();
  }
  getPreview(e) {
    return this._previews.get(e.uri);
  }
  get ariaMessage() {
    const e = this.children.length;
    return e === 1 ? S(1084, "1 symbol in {0}, full path {1}", Kf(this.uri), this.uri.fsPath) : S(1085, "{0} symbols in {1}, full path {2}", e, Kf(this.uri), this.uri.fsPath);
  }
  async resolve(e) {
    if (this._previews.size !== 0)
      return this;
    for (const t of this.children)
      if (!this._previews.has(t.uri))
        try {
          const n = await e.createModelReference(t.uri);
          this._previews.set(t.uri, new cSt(n));
        } catch (n) {
          fn(n);
        }
    return this;
  }
}
class Ud {
  constructor(e, t) {
    this.groups = [], this.references = [], this._onDidChangeReferenceRange = new he(), this.onDidChangeReferenceRange = this._onDidChangeReferenceRange.event, this._links = e, this._title = t;
    const [n] = e;
    e.sort(Ud._compareReferences);
    let r;
    for (const s of e)
      if ((!r || !hs.isEqual(r.uri, s.uri, !0)) && (r = new fA(this, s.uri), this.groups.push(r)), r.children.length === 0 || Ud._compareReferences(s, r.children[r.children.length - 1]) !== 0) {
        const o = new o0(n === s, r, s, (a) => this._onDidChangeReferenceRange.fire(a));
        this.references.push(o), r.children.push(o);
      }
  }
  dispose() {
    or(this.groups), this._onDidChangeReferenceRange.dispose(), this.groups.length = 0;
  }
  clone() {
    return new Ud(this._links, this._title);
  }
  get title() {
    return this._title;
  }
  get isEmpty() {
    return this.groups.length === 0;
  }
  get ariaMessage() {
    return this.isEmpty ? S(1086, "No results found") : this.references.length === 1 ? S(1087, "Found 1 symbol in {0}", this.references[0].uri.fsPath) : this.groups.length === 1 ? S(1088, "Found {0} symbols in {1}", this.references.length, this.groups[0].uri.fsPath) : S(1089, "Found {0} symbols in {1} files", this.references.length, this.groups.length);
  }
  nextOrPreviousReference(e, t) {
    const { parent: n } = e;
    let r = n.children.indexOf(e);
    const s = n.children.length, o = n.parent.groups.length;
    return o === 1 || t && r + 1 < s || !t && r > 0 ? (t ? r = (r + 1) % s : r = (r + s - 1) % s, n.children[r]) : (r = n.parent.groups.indexOf(n), t ? (r = (r + 1) % o, n.parent.groups[r].children[0]) : (r = (r + o - 1) % o, n.parent.groups[r].children[n.parent.groups[r].children.length - 1]));
  }
  nearestReference(e, t) {
    const n = this.references.map((r, s) => ({
      idx: s,
      prefixLen: jg(r.uri.toString(), e.toString()),
      offsetDist: Math.abs(r.range.startLineNumber - t.lineNumber) * 100 + Math.abs(r.range.startColumn - t.column)
    })).sort((r, s) => r.prefixLen > s.prefixLen ? -1 : r.prefixLen < s.prefixLen ? 1 : r.offsetDist < s.offsetDist ? -1 : r.offsetDist > s.offsetDist ? 1 : 0)[0];
    if (n)
      return this.references[n.idx];
  }
  referenceAt(e, t) {
    for (const n of this.references)
      if (n.uri.toString() === e.toString() && z.containsPosition(n.range, t))
        return n;
  }
  firstReference() {
    for (const e of this.references)
      if (e.isProviderFirst)
        return e;
    return this.references[0];
  }
  static _compareReferences(e, t) {
    return hs.compare(e.uri, t.uri) || z.compareRangesUsingStarts(e.range, t.range);
  }
}
class coe extends ge {
  constructor(e, t, n) {
    super(), this.options = t, this.styles = n, this.count = 0, this.hover = this._register(new er()), this.element = Fe(e, Ge(".monaco-count-badge")), this._register(Et(() => e.removeChild(this.element))), this.countFormat = this.options.countFormat || "{0}", this.titleFormat = this.options.titleFormat || "", this.setCount(this.options.count || 0), this.updateHover();
  }
  setCount(e) {
    this.count = e, this.render();
  }
  setTitleFormat(e) {
    this.titleFormat = e, this.updateHover(), this.render();
  }
  updateHover() {
    this.titleFormat !== "" && !this.hover.value ? this.hover.value = Jg().setupDelayedHoverAtMouse(this.element, () => ({ content: tT(this.titleFormat, this.count), appearance: { compact: !0 } })) : this.titleFormat === "" && this.hover.value && (this.hover.value = void 0);
  }
  render() {
    this.element.textContent = tT(this.countFormat, this.count), this.element.style.backgroundColor = this.styles.badgeBackground ?? "", this.element.style.color = this.styles.badgeForeground ?? "", this.styles.badgeBorder && (this.element.style.border = `1px solid ${this.styles.badgeBorder}`);
  }
}
class R1 extends ge {
  /**
   * Create a new {@link HighlightedLabel}.
   *
   * @param container The parent container to append to.
   */
  constructor(e, t) {
    super(), this.options = t, this.text = "", this.title = "", this.highlights = [], this.didEverRender = !1, this.supportIcons = (t == null ? void 0 : t.supportIcons) ?? !1, this.domNode = Fe(e, Ge("span.monaco-highlighted-label"));
  }
  /**
   * The label's DOM node.
   */
  get element() {
    return this.domNode;
  }
  /**
   * Set the label and highlights.
   *
   * @param text The label to display.
   * @param highlights The ranges to highlight.
   * @param title An optional title for the hover tooltip.
   * @param escapeNewLines Whether to escape new lines.
   * @returns
   */
  set(e, t = [], n = "", r) {
    e || (e = ""), r && (e = R1.escapeNewLines(e, t)), !(this.didEverRender && this.text === e && this.title === n && Wd(this.highlights, t)) && (this.text = e, this.title = n, this.highlights = t, this.render());
  }
  render() {
    var n;
    const e = [];
    let t = 0;
    for (const r of this.highlights) {
      if (r.end === r.start)
        continue;
      if (t < r.start) {
        const a = this.text.substring(t, r.start);
        this.supportIcons ? e.push(...D1(a)) : e.push(a), t = r.start;
      }
      const s = this.text.substring(t, r.end), o = Ge("span.highlight", void 0, ...this.supportIcons ? D1(s) : [s]);
      r.extraClasses && o.classList.add(...r.extraClasses), e.push(o), t = r.end;
    }
    if (t < this.text.length) {
      const r = this.text.substring(t);
      this.supportIcons ? e.push(...D1(r)) : e.push(r);
    }
    if (ma(this.domNode, ...e), !this.customHover && this.title !== "") {
      const r = ((n = this.options) == null ? void 0 : n.hoverDelegate) ?? rd("mouse");
      this.customHover = this._register(Jg().setupManagedHover(r, this.domNode, this.title));
    } else this.customHover && this.customHover.update(this.title);
    this.didEverRender = !0;
  }
  static escapeNewLines(e, t) {
    let n = 0, r = 0;
    return e.replace(/\r\n|\r|\n/g, (s, o) => {
      r = s === `\r
` ? -1 : 0, o += n;
      for (const a of t)
        a.end <= o || (a.start >= o && (a.start += r), a.end >= o && (a.end += r));
      return n += r, "⏎";
    });
  }
}
class sP {
  constructor(e) {
    this._element = e;
  }
  get element() {
    return this._element;
  }
  set textContent(e) {
    this.disposed || e === this._textContent || (this._textContent = e, this._element.textContent = e);
  }
  set classNames(e) {
    this.disposed || Wd(e, this._classNames) || (this._classNames = e, this._element.classList.value = "", this._element.classList.add(...e));
  }
  set empty(e) {
    this.disposed || e === this._empty || (this._empty = e, this._element.style.marginLeft = e ? "0" : "");
  }
  dispose() {
    this.disposed = !0;
  }
}
class a5 extends ge {
  constructor(e, t) {
    super(), this.customHovers = /* @__PURE__ */ new Map(), this.creationOptions = t, this.domNode = this._register(new sP(Fe(e, Ge(".monaco-icon-label")))), this.labelContainer = Fe(this.domNode.element, Ge(".monaco-icon-label-container")), this.nameContainer = Fe(this.labelContainer, Ge("span.monaco-icon-name-container")), t != null && t.supportHighlights || t != null && t.supportIcons ? this.nameNode = this._register(new hSt(this.nameContainer, !!t.supportIcons)) : this.nameNode = new uSt(this.nameContainer), this.hoverDelegate = (t == null ? void 0 : t.hoverDelegate) ?? rd("mouse");
  }
  get element() {
    return this.domNode.element;
  }
  setLabel(e, t, n) {
    const r = ["monaco-icon-label"], s = ["monaco-icon-label-container"];
    let o = "";
    n && (n.extraClasses && r.push(...n.extraClasses), n.italic && r.push("italic"), n.strikethrough && r.push("strikethrough"), n.disabledCommand && s.push("disabled"), n.title && (typeof n.title == "string" ? o += n.title : o += e));
    const a = this.domNode.element.querySelector(".monaco-icon-label-iconpath");
    if (n != null && n.iconPath) {
      let l;
      !a || !eo(a) ? (l = Ge(".monaco-icon-label-iconpath"), this.domNode.element.prepend(l)) : l = a, l.style.backgroundImage = mb(n == null ? void 0 : n.iconPath), l.style.backgroundRepeat = "no-repeat", l.style.backgroundPosition = "center", l.style.backgroundSize = "contain";
    } else a && a.remove();
    if (this.domNode.classNames = r, this.domNode.element.setAttribute("aria-label", o), this.labelContainer.classList.value = "", this.labelContainer.classList.add(...s), this.setupHover(n != null && n.descriptionTitle ? this.labelContainer : this.element, n == null ? void 0 : n.title), this.nameNode.setLabel(e, n), t || this.descriptionNode) {
      const l = this.getOrCreateDescriptionNode();
      l instanceof R1 ? (l.set(t || "", n ? n.descriptionMatches : void 0, void 0, n == null ? void 0 : n.labelEscapeNewLines), this.setupHover(l.element, n == null ? void 0 : n.descriptionTitle)) : (l.textContent = t && (n != null && n.labelEscapeNewLines) ? R1.escapeNewLines(t, []) : t || "", this.setupHover(l.element, (n == null ? void 0 : n.descriptionTitle) || ""), l.empty = !t);
    }
    if (n != null && n.suffix || this.suffixNode) {
      const l = this.getOrCreateSuffixNode();
      l.textContent = (n == null ? void 0 : n.suffix) ?? "";
    }
  }
  setupHover(e, t) {
    var o;
    const n = this.customHovers.get(e);
    if (n && (n.dispose(), this.customHovers.delete(e)), !t) {
      e.removeAttribute("title");
      return;
    }
    let r = e;
    if ((o = this.creationOptions) != null && o.hoverTargetOverride) {
      if (!pa(e, this.creationOptions.hoverTargetOverride))
        throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");
      r = this.creationOptions.hoverTargetOverride;
    }
    const s = Jg().setupManagedHover(this.hoverDelegate, r, t);
    s && this.customHovers.set(e, s);
  }
  dispose() {
    super.dispose();
    for (const e of this.customHovers.values())
      e.dispose();
    this.customHovers.clear();
  }
  getOrCreateSuffixNode() {
    if (!this.suffixNode) {
      const e = this._register(new sP($it(this.nameContainer, Ge("span.monaco-icon-suffix-container"))));
      this.suffixNode = this._register(new sP(Fe(e.element, Ge("span.label-suffix"))));
    }
    return this.suffixNode;
  }
  getOrCreateDescriptionNode() {
    var e;
    if (!this.descriptionNode) {
      const t = this._register(new sP(Fe(this.labelContainer, Ge("span.monaco-icon-description-container"))));
      (e = this.creationOptions) != null && e.supportDescriptionHighlights ? this.descriptionNode = this._register(new R1(Fe(t.element, Ge("span.label-description")), { supportIcons: !!this.creationOptions.supportIcons })) : this.descriptionNode = this._register(new sP(Fe(t.element, Ge("span.label-description"))));
    }
    return this.descriptionNode;
  }
}
class uSt {
  constructor(e) {
    this.container = e, this.label = void 0, this.singleLabel = void 0;
  }
  setLabel(e, t) {
    if (!(this.label === e && Wd(this.options, t)))
      if (this.label = e, this.options = t, typeof e == "string")
        this.singleLabel || (this.container.textContent = "", this.container.classList.remove("multiple"), this.singleLabel = Fe(this.container, Ge("a.label-name", { id: t == null ? void 0 : t.domId }))), this.singleLabel.textContent = e;
      else {
        this.container.textContent = "", this.container.classList.add("multiple"), this.singleLabel = void 0;
        for (let n = 0; n < e.length; n++) {
          const r = e[n], s = (t == null ? void 0 : t.domId) && `${t == null ? void 0 : t.domId}_${n}`;
          Fe(this.container, Ge("a.label-name", { id: s, "data-icon-label-count": e.length, "data-icon-label-index": n, role: "treeitem" }, r)), n < e.length - 1 && Fe(this.container, Ge("span.label-separator", void 0, (t == null ? void 0 : t.separator) || "/"));
        }
      }
  }
}
function dSt(i, e, t) {
  if (!t)
    return;
  let n = 0;
  return i.map((r) => {
    const s = { start: n, end: n + r.length }, o = t.map((a) => Ul.intersect(s, a)).filter((a) => !Ul.isEmpty(a)).map(({ start: a, end: l }) => ({ start: a - n, end: l - n }));
    return n = s.end + e.length, o;
  });
}
class hSt extends ge {
  constructor(e, t) {
    super(), this.container = e, this.supportIcons = t, this.label = void 0, this.singleLabel = void 0;
  }
  setLabel(e, t) {
    if (!(this.label === e && Wd(this.options, t)))
      if (this.label = e, this.options = t, typeof e == "string")
        this.singleLabel || (this.container.textContent = "", this.container.classList.remove("multiple"), this.singleLabel = this._register(new R1(Fe(this.container, Ge("a.label-name", { id: t == null ? void 0 : t.domId })), { supportIcons: this.supportIcons }))), this.singleLabel.set(e, t == null ? void 0 : t.matches, void 0, t == null ? void 0 : t.labelEscapeNewLines);
      else {
        this.container.textContent = "", this.container.classList.add("multiple"), this.singleLabel = void 0;
        const n = (t == null ? void 0 : t.separator) || "/", r = dSt(e, n, t == null ? void 0 : t.matches);
        for (let s = 0; s < e.length; s++) {
          const o = e[s], a = r ? r[s] : void 0, l = (t == null ? void 0 : t.domId) && `${t == null ? void 0 : t.domId}_${s}`, c = Ge("a.label-name", { id: l, "data-icon-label-count": e.length, "data-icon-label-index": s, role: "treeitem" });
          this._register(new R1(Fe(this.container, c), { supportIcons: this.supportIcons })).set(o, a, void 0, t == null ? void 0 : t.labelEscapeNewLines), s < e.length - 1 && Fe(c, Ge("span.label-separator", void 0, n));
        }
      }
  }
}
const LT = Vn("labelService");
var IK = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, NK = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, uoe;
let doe = class {
  constructor(e) {
    this._resolverService = e;
  }
  hasChildren(e) {
    return e instanceof Ud || e instanceof fA;
  }
  getChildren(e) {
    if (e instanceof Ud)
      return e.groups;
    if (e instanceof fA)
      return e.resolve(this._resolverService).then((t) => t.children);
    throw new Error("bad tree");
  }
};
doe = IK([
  NK(0, Ic)
], doe);
class fSt {
  getHeight() {
    return 23;
  }
  getTemplateId(e) {
    return e instanceof fA ? vz.id : yz.id;
  }
}
let hoe = class {
  constructor(e) {
    this._keybindingService = e;
  }
  getKeyboardNavigationLabel(e) {
    var t;
    if (e instanceof o0) {
      const n = (t = e.parent.getPreview(e)) == null ? void 0 : t.preview(e.range);
      if (n)
        return n.value;
    }
    return Kf(e.uri);
  }
};
hoe = IK([
  NK(0, Fi)
], hoe);
class gSt {
  getId(e) {
    return e instanceof o0 ? e.id : e.uri;
  }
}
let foe = class extends ge {
  constructor(e, t) {
    super(), this._labelService = t;
    const n = document.createElement("div");
    n.classList.add("reference-file"), this.file = this._register(new a5(n, { supportHighlights: !0 })), this.badge = this._register(new coe(Fe(n, Ge(".count")), {}, C5e)), e.appendChild(n);
  }
  set(e, t) {
    const n = Aq(e.uri);
    this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri), this._labelService.getUriLabel(n, { relative: !0 }), { title: this._labelService.getUriLabel(e.uri), matches: t });
    const r = e.children.length;
    this.badge.setCount(r), r > 1 ? this.badge.setTitleFormat(S(1076, "{0} references", r)) : this.badge.setTitleFormat(S(1077, "{0} reference", r));
  }
};
foe = IK([
  NK(1, LT)
], foe);
var lL;
let vz = (lL = class {
  constructor(e) {
    this._instantiationService = e, this.templateId = uoe.id;
  }
  renderTemplate(e) {
    return this._instantiationService.createInstance(foe, e);
  }
  renderElement(e, t, n) {
    n.set(e.element, IB(e.filterData));
  }
  disposeTemplate(e) {
    e.dispose();
  }
}, uoe = lL, lL.id = "FileReferencesRenderer", lL);
vz = uoe = IK([
  NK(0, xt)
], vz);
class pSt extends ge {
  constructor(e) {
    super(), this.label = this._register(new R1(e));
  }
  set(e, t) {
    var r;
    const n = (r = e.parent.getPreview(e)) == null ? void 0 : r.preview(e.range);
    if (!n || !n.value)
      this.label.set(`${Kf(e.uri)}:${e.range.startLineNumber + 1}:${e.range.startColumn + 1}`);
    else {
      const { value: s, highlight: o } = n;
      t && !$g.isDefault(t) ? (this.label.element.classList.toggle("referenceMatch", !1), this.label.set(s, IB(t))) : (this.label.element.classList.toggle("referenceMatch", !0), this.label.set(s, [o]));
    }
  }
}
const hG = class hG {
  constructor() {
    this.templateId = hG.id;
  }
  renderTemplate(e) {
    return new pSt(e);
  }
  renderElement(e, t, n) {
    n.set(e.element, e.filterData);
  }
  disposeTemplate(e) {
    e.dispose();
  }
};
hG.id = "OneReferenceRenderer";
let yz = hG;
class mSt {
  getWidgetAriaLabel() {
    return S(1078, "References");
  }
  getAriaLabel(e) {
    return e.ariaMessage;
  }
}
var b6e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, kE = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const fG = class fG {
  constructor(e, t) {
    this._editor = e, this._model = t, this._decorations = /* @__PURE__ */ new Map(), this._decorationIgnoreSet = /* @__PURE__ */ new Set(), this._callOnDispose = new ke(), this._callOnModelChange = new ke(), this._callOnDispose.add(this._editor.onDidChangeModel(() => this._onModelChanged())), this._onModelChanged();
  }
  dispose() {
    this._callOnModelChange.dispose(), this._callOnDispose.dispose(), this.removeDecorations();
  }
  _onModelChanged() {
    this._callOnModelChange.clear();
    const e = this._editor.getModel();
    if (e) {
      for (const t of this._model.references)
        if (t.uri.toString() === e.uri.toString()) {
          this._addDecorations(t.parent);
          return;
        }
    }
  }
  _addDecorations(e) {
    if (!this._editor.hasModel())
      return;
    this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(() => this._onDecorationChanged()));
    const t = [], n = [];
    for (let r = 0, s = e.children.length; r < s; r++) {
      const o = e.children[r];
      this._decorationIgnoreSet.has(o.id) || o.uri.toString() === this._editor.getModel().uri.toString() && (t.push({
        range: o.range,
        options: fG.DecorationOptions
      }), n.push(r));
    }
    this._editor.changeDecorations((r) => {
      const s = r.deltaDecorations([], t);
      for (let o = 0; o < s.length; o++)
        this._decorations.set(s[o], e.children[n[o]]);
    });
  }
  _onDecorationChanged() {
    const e = [], t = this._editor.getModel();
    if (t) {
      for (const [n, r] of this._decorations) {
        const s = t.getDecorationRange(n);
        if (!s)
          continue;
        let o = !1;
        if (!z.equalsRange(s, r.range)) {
          if (z.spansMultipleLines(s))
            o = !0;
          else {
            const a = r.range.endColumn - r.range.startColumn, l = s.endColumn - s.startColumn;
            a !== l && (o = !0);
          }
          o ? (this._decorationIgnoreSet.add(r.id), e.push(n)) : r.range = s;
        }
      }
      for (let n = 0, r = e.length; n < r; n++)
        this._decorations.delete(e[n]);
      this._editor.removeDecorations(e);
    }
  }
  removeDecorations() {
    this._editor.removeDecorations([...this._decorations.keys()]), this._decorations.clear();
  }
};
fG.DecorationOptions = dn.register({
  description: "reference-decoration",
  stickiness: 1,
  className: "reference-decoration"
});
let goe = fG;
class _St {
  constructor() {
    this.ratio = 0.7, this.heightInLines = 18;
  }
  static fromJSON(e) {
    let t, n;
    try {
      const r = JSON.parse(e);
      t = r.ratio, n = r.heightInLines;
    } catch {
    }
    return {
      ratio: t || 0.7,
      heightInLines: n || 18
    };
  }
}
class bSt extends loe {
}
let poe = class {
  constructor(e) {
    this.labelService = e, this.disposables = new ke();
  }
  getDragURI(e) {
    return e instanceof fA ? e.uri.toString() : e instanceof o0 ? x0t(e.uri, e.range).toString() : null;
  }
  getDragLabel(e) {
    return e.length === 0 ? void 0 : e.map((n) => this.labelService.getUriBasenameLabel(n.uri)).join(", ");
  }
  onDragStart(e, t) {
    if (!t.dataTransfer)
      return;
    const r = e.elements.map((s) => this.getDragURI(s)).filter(Boolean);
    r.length && (t.dataTransfer.setData(dT.RESOURCES, JSON.stringify(r)), t.dataTransfer.setData(dT.TEXT, r.join(`
`)));
  }
  onDragOver() {
    return !1;
  }
  drop() {
  }
  dispose() {
    this.disposables.dispose();
  }
};
poe = b6e([
  kE(0, LT)
], poe);
let moe = class extends uz {
  constructor(e, t, n, r, s, o, a, l, c) {
    super(e, { showFrame: !1, showArrow: !0, isResizeable: !0, isAccessible: !0, supportOnTitleClick: !0 }, o), this._defaultTreeKeyboardSupport = t, this.layoutData = n, this._textModelResolverService = s, this._instantiationService = o, this._peekViewService = a, this._uriLabel = l, this._keybindingService = c, this._disposeOnNewModel = new ke(), this._callOnDispose = new ke(), this._onDidSelectReference = new he(), this.onDidSelectReference = this._onDidSelectReference.event, this._dim = new Ji(0, 0), this._isClosing = !1, this._applyTheme(r.getColorTheme()), this._callOnDispose.add(r.onDidColorThemeChange(this._applyTheme.bind(this))), this._peekViewService.addExclusiveWidget(e, this), this.create();
  }
  get isClosing() {
    return this._isClosing;
  }
  dispose() {
    this._isClosing = !0, this.setModel(void 0), this._callOnDispose.dispose(), this._disposeOnNewModel.dispose(), or(this._preview), or(this._previewNotAvailableMessage), or(this._tree), or(this._previewModelReference), this._splitView.dispose(), super.dispose();
  }
  _applyTheme(e) {
    const t = e.getColor(K1t) || De.transparent;
    this.style({
      arrowColor: t,
      frameColor: t,
      headerBackgroundColor: e.getColor(q1t) || De.transparent,
      primaryHeadingColor: e.getColor(WBe),
      secondaryHeadingColor: e.getColor(VBe)
    });
  }
  show(e) {
    super.show(e, this.layoutData.heightInLines || 18);
  }
  focusOnReferenceTree() {
    this._tree.domFocus();
  }
  focusOnPreviewEditor() {
    this._preview.focus();
  }
  isPreviewEditorFocused() {
    return this._preview.hasTextFocus();
  }
  _onTitleClick(e) {
    this._preview && this._preview.getModel() && this._onDidSelectReference.fire({
      element: this._getFocusedReference(),
      kind: e.ctrlKey || e.metaKey || e.altKey ? "side" : "open",
      source: "title"
    });
  }
  _fillBody(e) {
    this.setCssClass("reference-zone-widget"), this._messageContainer = Fe(e, Ge("div.messages")), eu(this._messageContainer), this._splitView = new zBe(e, {
      orientation: 1
      /* Orientation.HORIZONTAL */
    }), this._previewContainer = Fe(e, Ge("div.preview.inline"));
    const t = {
      scrollBeyondLastLine: !1,
      scrollbar: {
        verticalScrollbarSize: 14,
        horizontal: "auto",
        useShadows: !0,
        verticalHasArrows: !1,
        horizontalHasArrows: !1,
        alwaysConsumeMouseWheel: !0
      },
      overviewRulerLanes: 2,
      fixedOverflowWidgets: !0,
      minimap: {
        enabled: !1
      }
    };
    this._preview = this._instantiationService.createInstance(s0, this._previewContainer, t, {}, this.editor), eu(this._previewContainer), this._previewNotAvailableMessage = this._instantiationService.createInstance(cT, S(1079, "no preview available"), $h, cT.DEFAULT_CREATION_OPTIONS, null), this._treeContainer = Fe(e, Ge("div.ref-tree.inline"));
    const n = {
      keyboardSupport: this._defaultTreeKeyboardSupport,
      accessibilityProvider: new mSt(),
      keyboardNavigationLabelProvider: this._instantiationService.createInstance(hoe),
      identityProvider: new gSt(),
      openOnSingleClick: !0,
      selectionNavigation: !0,
      overrideStyles: {
        listBackground: Y1t
      },
      dnd: this._instantiationService.createInstance(poe)
    };
    this._defaultTreeKeyboardSupport && this._callOnDispose.add(vo(this._treeContainer, "keydown", (s) => {
      s.equals(
        9
        /* KeyCode.Escape */
      ) && (this._keybindingService.dispatchEvent(s, s.target), s.stopPropagation());
    }, !0)), this._tree = this._instantiationService.createInstance(bSt, "ReferencesWidget", this._treeContainer, new fSt(), [
      this._instantiationService.createInstance(vz),
      this._instantiationService.createInstance(yz)
    ], this._instantiationService.createInstance(doe), n), this._splitView.addView({
      onDidChange: Ze.None,
      element: this._previewContainer,
      minimumSize: 200,
      maximumSize: Number.MAX_VALUE,
      layout: (s) => {
        this._preview.layout({ height: this._dim.height, width: s });
      }
    }, dz.Distribute), this._splitView.addView({
      onDidChange: Ze.None,
      element: this._treeContainer,
      minimumSize: 100,
      maximumSize: Number.MAX_VALUE,
      layout: (s) => {
        this._treeContainer.style.height = `${this._dim.height}px`, this._treeContainer.style.width = `${s}px`, this._tree.layout(this._dim.height, s);
      }
    }, dz.Distribute), this._disposables.add(this._splitView.onDidSashChange(() => {
      this._dim.width && (this.layoutData.ratio = this._splitView.getViewSize(0) / this._dim.width);
    }, void 0));
    const r = (s, o) => {
      s instanceof o0 && (o === "show" && this._revealReference(s, !1), this._onDidSelectReference.fire({ element: s, kind: o, source: "tree" }));
    };
    this._disposables.add(this._tree.onDidOpen((s) => {
      s.sideBySide ? r(s.element, "side") : s.editorOptions.pinned ? r(s.element, "goto") : r(s.element, "show");
    })), eu(this._treeContainer);
  }
  _onWidth(e) {
    this._dim && this._doLayoutBody(this._dim.height, e);
  }
  _doLayoutBody(e, t) {
    super._doLayoutBody(e, t), this._dim = new Ji(t, e), this.layoutData.heightInLines = this._viewZone ? this._viewZone.heightInLines : this.layoutData.heightInLines, this._splitView.layout(t), this._splitView.resizeView(0, t * this.layoutData.ratio);
  }
  setSelection(e) {
    return this._revealReference(e, !0).then(() => {
      this._model && (this._tree.setSelection([e]), this._tree.setFocus([e]));
    });
  }
  setModel(e) {
    return this._disposeOnNewModel.clear(), this._model = e, this._model ? this._onNewModel() : Promise.resolve();
  }
  _onNewModel() {
    return this._model ? this._model.isEmpty ? (this.setTitle(""), this._messageContainer.innerText = S(1080, "No results"), Id(this._messageContainer), Promise.resolve(void 0)) : (eu(this._messageContainer), this._decorationsManager = new goe(this._preview, this._model), this._disposeOnNewModel.add(this._decorationsManager), this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange((e) => this._tree.rerender(e))), this._disposeOnNewModel.add(this._preview.onMouseDown((e) => {
      const { event: t, target: n } = e;
      if (t.detail !== 2)
        return;
      const r = this._getFocusedReference();
      r && this._onDidSelectReference.fire({
        element: { uri: r.uri, range: n.range },
        kind: t.ctrlKey || t.metaKey || t.altKey ? "side" : "open",
        source: "editor"
      });
    })), this.container.classList.add("results-loaded"), Id(this._treeContainer), Id(this._previewContainer), this._splitView.layout(this._dim.width), this.focusOnReferenceTree(), this._tree.setInput(this._model.groups.length === 1 ? this._model.groups[0] : this._model)) : Promise.resolve(void 0);
  }
  _getFocusedReference() {
    const [e] = this._tree.getFocus();
    if (e instanceof o0)
      return e;
    if (e instanceof fA && e.children.length > 0)
      return e.children[0];
  }
  async revealReference(e) {
    await this._revealReference(e, !1), this._onDidSelectReference.fire({ element: e, kind: "goto", source: "tree" });
  }
  async _revealReference(e, t) {
    if (this._revealedReference === e)
      return;
    this._revealedReference = e, e.uri.scheme !== Yt.inMemory ? this.setTitle(Drt(e.uri), this._uriLabel.getUriLabel(Aq(e.uri))) : this.setTitle(S(1081, "References"));
    const n = this._textModelResolverService.createModelReference(e.uri);
    this._tree.getInput() === e.parent ? this._tree.reveal(e) : (t && this._tree.reveal(e.parent), await this._tree.expand(e.parent), this._tree.reveal(e));
    const r = await n;
    if (!this._model) {
      r.dispose();
      return;
    }
    or(this._previewModelReference);
    const s = r.object;
    if (s) {
      const o = this._preview.getModel() === s.textEditorModel ? 0 : 1, a = z.lift(e.range).collapseToStart();
      this._previewModelReference = r, this._preview.setModel(s.textEditorModel), this._preview.setSelection(a), this._preview.revealRangeInCenter(a, o);
    } else
      this._preview.setModel(this._previewNotAvailableMessage), r.dispose();
  }
};
moe = b6e([
  kE(3, to),
  kE(4, Ic),
  kE(5, xt),
  kE(6, HBe),
  kE(7, LT),
  kE(8, Fi)
], moe);
var vSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, SI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, jW;
const rk = new ut("referenceSearchVisible", !1, S(1073, "Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));
var cL;
let TT = (cL = class {
  static get(e) {
    return e.getContribution(jW.ID);
  }
  constructor(e, t, n, r, s, o, a, l) {
    this._defaultTreeKeyboardSupport = e, this._editor = t, this._editorService = r, this._notificationService = s, this._instantiationService = o, this._storageService = a, this._configurationService = l, this._disposables = new ke(), this._requestIdPool = 0, this._ignoreModelChangeEvent = !1, this._referenceSearchVisible = rk.bindTo(n);
  }
  dispose() {
    var e, t;
    this._referenceSearchVisible.reset(), this._disposables.dispose(), (e = this._widget) == null || e.dispose(), (t = this._model) == null || t.dispose(), this._widget = void 0, this._model = void 0;
  }
  toggleWidget(e, t, n) {
    let r;
    if (this._widget && (r = this._widget.position), this.closeWidget(), r && e.containsPosition(r))
      return;
    this._peekMode = n, this._referenceSearchVisible.set(!0), this._disposables.add(this._editor.onDidChangeModelLanguage(() => {
      this.closeWidget();
    })), this._disposables.add(this._editor.onDidChangeModel(() => {
      this._ignoreModelChangeEvent || this.closeWidget();
    }));
    const s = "peekViewLayout", o = _St.fromJSON(this._storageService.get(s, 0, "{}"));
    this._widget = this._instantiationService.createInstance(moe, this._editor, this._defaultTreeKeyboardSupport, o), this._widget.setTitle(S(1074, "Loading...")), this._widget.show(e), this._disposables.add(this._widget.onDidClose(() => {
      t.cancel(), this._widget ? (this._storageService.store(
        s,
        JSON.stringify(this._widget.layoutData),
        0,
        1
        /* StorageTarget.MACHINE */
      ), this._widget.isClosing || this.closeWidget(), this._widget = void 0) : this.closeWidget();
    })), this._disposables.add(this._widget.onDidSelectReference((l) => {
      const { element: c, kind: u } = l;
      if (c)
        switch (u) {
          case "open":
            (l.source !== "editor" || !this._configurationService.getValue("editor.stablePeek")) && this.openReference(c, !1, !1);
            break;
          case "side":
            this.openReference(c, !0, !1);
            break;
          case "goto":
            n ? this._gotoReference(c, !0) : this.openReference(c, !1, !0);
            break;
        }
    }));
    const a = ++this._requestIdPool;
    t.then((l) => {
      var c;
      if (a !== this._requestIdPool || !this._widget) {
        l.dispose();
        return;
      }
      return (c = this._model) == null || c.dispose(), this._model = l, this._widget.setModel(this._model).then(() => {
        if (this._widget && this._model && this._editor.hasModel()) {
          this._model.isEmpty ? this._widget.setMetaTitle("") : this._widget.setMetaTitle(S(1075, "{0} ({1})", this._model.title, this._model.references.length));
          const u = this._editor.getModel().uri, d = new de(e.startLineNumber, e.startColumn), h = this._model.nearestReference(u, d);
          if (h)
            return this._widget.setSelection(h).then(() => {
              this._widget && this._editor.getOption(
                99
                /* EditorOption.peekWidgetDefaultFocus */
              ) === "editor" && this._widget.focusOnPreviewEditor();
            });
        }
      });
    }, (l) => {
      this._notificationService.error(l);
    });
  }
  changeFocusBetweenPreviewAndReferences() {
    this._widget && (this._widget.isPreviewEditorFocused() ? this._widget.focusOnReferenceTree() : this._widget.focusOnPreviewEditor());
  }
  async goToNextOrPreviousReference(e) {
    if (!this._editor.hasModel() || !this._model || !this._widget)
      return;
    const t = this._widget.position;
    if (!t)
      return;
    const n = this._model.nearestReference(this._editor.getModel().uri, t);
    if (!n)
      return;
    const r = this._model.nextOrPreviousReference(n, e), s = this._editor.hasTextFocus(), o = this._widget.isPreviewEditorFocused();
    await this._widget.setSelection(r), await this._gotoReference(r, !1), s ? this._editor.focus() : this._widget && o && this._widget.focusOnPreviewEditor();
  }
  async revealReference(e) {
    !this._editor.hasModel() || !this._model || !this._widget || await this._widget.revealReference(e);
  }
  closeWidget(e = !0) {
    var t, n;
    (t = this._widget) == null || t.dispose(), (n = this._model) == null || n.dispose(), this._referenceSearchVisible.reset(), this._disposables.clear(), this._widget = void 0, this._model = void 0, e && this._editor.focus(), this._requestIdPool += 1;
  }
  _gotoReference(e, t) {
    var r;
    (r = this._widget) == null || r.hide(), this._ignoreModelChangeEvent = !0;
    const n = z.lift(e.range).collapseToStart();
    return this._editorService.openCodeEditor({
      resource: e.uri,
      options: { selection: n, selectionSource: "code.jump", pinned: t }
    }, this._editor).then((s) => {
      if (this._ignoreModelChangeEvent = !1, !s || !this._widget) {
        this.closeWidget();
        return;
      }
      if (this._editor === s)
        this._widget.show(n), this._widget.focusOnReferenceTree();
      else {
        const o = jW.get(s), a = this._model.clone();
        this.closeWidget(), s.focus(), o == null || o.toggleWidget(n, Jo((l) => Promise.resolve(a)), this._peekMode ?? !1);
      }
    }, (s) => {
      this._ignoreModelChangeEvent = !1, fn(s);
    });
  }
  openReference(e, t, n) {
    t || this.closeWidget();
    const { uri: r, range: s } = e;
    this._editorService.openCodeEditor({
      resource: r,
      options: { selection: s, selectionSource: "code.jump", pinned: n }
    }, this._editor, t);
  }
}, jW = cL, cL.ID = "editor.contrib.referencesController", cL);
TT = jW = vSt([
  SI(2, Jt),
  SI(3, Ti),
  SI(4, no),
  SI(5, xt),
  SI(6, gu),
  SI(7, xn)
], TT);
function sk(i, e) {
  const t = PBe(i);
  if (!t)
    return;
  const n = TT.get(t);
  n && e(n);
}
Pa.registerCommandAndKeybindingRule({
  id: "togglePeekWidgetFocus",
  weight: 100,
  primary: Ro(
    2089,
    60
    /* KeyCode.F2 */
  ),
  when: Re.or(rk, td.inPeekEditor),
  handler(i) {
    sk(i, (e) => {
      e.changeFocusBetweenPreviewAndReferences();
    });
  }
});
Pa.registerCommandAndKeybindingRule({
  id: "goToNextReference",
  weight: 90,
  primary: 62,
  secondary: [
    70
    /* KeyCode.F12 */
  ],
  when: Re.or(rk, td.inPeekEditor),
  handler(i) {
    sk(i, (e) => {
      e.goToNextOrPreviousReference(!0);
    });
  }
});
Pa.registerCommandAndKeybindingRule({
  id: "goToPreviousReference",
  weight: 90,
  primary: 1086,
  secondary: [
    1094
    /* KeyCode.F12 */
  ],
  when: Re.or(rk, td.inPeekEditor),
  handler(i) {
    sk(i, (e) => {
      e.goToNextOrPreviousReference(!1);
    });
  }
});
_i.registerCommandAlias("goToNextReferenceFromEmbeddedEditor", "goToNextReference");
_i.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor", "goToPreviousReference");
_i.registerCommandAlias("closeReferenceSearchEditor", "closeReferenceSearch");
_i.registerCommand("closeReferenceSearch", (i) => sk(i, (e) => e.closeWidget()));
Pa.registerKeybindingRule({
  id: "closeReferenceSearch",
  weight: -1,
  primary: 9,
  secondary: [
    1033
    /* KeyCode.Escape */
  ],
  when: Re.and(td.inPeekEditor, Re.not("config.editor.stablePeek"))
});
Pa.registerKeybindingRule({
  id: "closeReferenceSearch",
  weight: 250,
  primary: 9,
  secondary: [
    1033
    /* KeyCode.Escape */
  ],
  when: Re.and(rk, Re.not("config.editor.stablePeek"), Re.or(se.editorTextFocus, lpe.negate()))
});
Pa.registerCommandAndKeybindingRule({
  id: "revealReference",
  weight: 200,
  primary: 3,
  mac: {
    primary: 3,
    secondary: [
      2066
      /* KeyCode.DownArrow */
    ]
  },
  when: Re.and(rk, h6e, hpe.negate(), fpe.negate()),
  handler(i) {
    var n;
    const t = (n = i.get(rg).lastFocusedList) == null ? void 0 : n.getFocus();
    Array.isArray(t) && t[0] instanceof o0 && sk(i, (r) => r.revealReference(t[0]));
  }
});
Pa.registerCommandAndKeybindingRule({
  id: "openReferenceToSide",
  weight: 100,
  primary: 2051,
  mac: {
    primary: 259
    /* KeyCode.Enter */
  },
  when: Re.and(rk, h6e, hpe.negate(), fpe.negate()),
  handler(i) {
    var n;
    const t = (n = i.get(rg).lastFocusedList) == null ? void 0 : n.getFocus();
    Array.isArray(t) && t[0] instanceof o0 && sk(i, (r) => r.openReference(t[0], !0, !0));
  }
});
_i.registerCommand("openReference", (i) => {
  var n;
  const t = (n = i.get(rg).lastFocusedList) == null ? void 0 : n.getFocus();
  Array.isArray(t) && t[0] instanceof o0 && sk(i, (r) => r.openReference(t[0], !1, !0));
});
var v6e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ZP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const bpe = new ut("hasSymbols", !1, S(1090, "Whether there are symbol locations that can be navigated via keyboard-only.")), RK = Vn("ISymbolNavigationService");
let _oe = class {
  constructor(e, t, n, r) {
    this._editorService = t, this._notificationService = n, this._keybindingService = r, this._currentModel = void 0, this._currentIdx = -1, this._ignoreEditorChange = !1, this._ctxHasSymbols = bpe.bindTo(e);
  }
  reset() {
    var e, t;
    this._ctxHasSymbols.reset(), (e = this._currentState) == null || e.dispose(), (t = this._currentMessage) == null || t.close(), this._currentModel = void 0, this._currentIdx = -1;
  }
  put(e) {
    const t = e.parent.parent;
    if (t.references.length <= 1) {
      this.reset();
      return;
    }
    this._currentModel = t, this._currentIdx = t.references.indexOf(e), this._ctxHasSymbols.set(!0), this._showMessage();
    const n = new boe(this._editorService), r = n.onDidChange((s) => {
      if (this._ignoreEditorChange)
        return;
      const o = this._editorService.getActiveCodeEditor();
      if (!o)
        return;
      const a = o.getModel(), l = o.getPosition();
      if (!a || !l)
        return;
      let c = !1, u = !1;
      for (const d of t.references)
        if (rw(d.uri, a.uri))
          c = !0, u = u || z.containsPosition(d.range, l);
        else if (c)
          break;
      (!c || !u) && this.reset();
    });
    this._currentState = Vg(n, r);
  }
  revealNext(e) {
    if (!this._currentModel)
      return Promise.resolve();
    this._currentIdx += 1, this._currentIdx %= this._currentModel.references.length;
    const t = this._currentModel.references[this._currentIdx];
    return this._showMessage(), this._ignoreEditorChange = !0, this._editorService.openCodeEditor({
      resource: t.uri,
      options: {
        selection: z.collapseToStart(t.range),
        selectionRevealType: 3
        /* TextEditorSelectionRevealType.NearTopIfOutsideViewport */
      }
    }, e).finally(() => {
      this._ignoreEditorChange = !1;
    });
  }
  _showMessage() {
    var n;
    (n = this._currentMessage) == null || n.close();
    const e = this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"), t = e ? S(1091, "Symbol {0} of {1}, {2} for next", this._currentIdx + 1, this._currentModel.references.length, e.getLabel()) : S(1092, "Symbol {0} of {1}", this._currentIdx + 1, this._currentModel.references.length);
    this._currentMessage = this._notificationService.status(t);
  }
};
_oe = v6e([
  ZP(0, Jt),
  ZP(1, Ti),
  ZP(2, no),
  ZP(3, Fi)
], _oe);
ni(
  RK,
  _oe,
  1
  /* InstantiationType.Delayed */
);
ct(new class extends jo {
  constructor() {
    super({
      id: "editor.gotoNextSymbolFromResult",
      precondition: bpe,
      kbOpts: {
        weight: 100,
        primary: 70
        /* KeyCode.F12 */
      }
    });
  }
  runEditorCommand(i, e) {
    return i.get(RK).revealNext(e);
  }
}());
Pa.registerCommandAndKeybindingRule({
  id: "editor.gotoNextSymbolFromResult.cancel",
  weight: 100,
  when: bpe,
  primary: 9,
  handler(i) {
    i.get(RK).reset();
  }
});
let boe = class {
  constructor(e) {
    this._listener = /* @__PURE__ */ new Map(), this._disposables = new ke(), this._onDidChange = new he(), this.onDidChange = this._onDidChange.event, this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor, this)), this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor, this)), e.listCodeEditors().forEach(this._onDidAddEditor, this);
  }
  dispose() {
    this._disposables.dispose(), this._onDidChange.dispose(), or(this._listener.values());
  }
  _onDidAddEditor(e) {
    this._listener.set(e, Vg(e.onDidChangeCursorPosition((t) => this._onDidChange.fire({ editor: e })), e.onDidChangeModelContent((t) => this._onDidChange.fire({ editor: e }))));
  }
  _onDidRemoveEditor(e) {
    var t;
    (t = this._listener.get(e)) == null || t.dispose(), this._listener.delete(e);
  }
};
boe = v6e([
  ZP(0, Ti)
], boe);
function voe(i, e) {
  return e.uri.scheme === i.uri.scheme ? !0 : !aie(e.uri, Yt.walkThroughSnippet, Yt.vscodeChatCodeBlock, Yt.vscodeChatCodeCompareBlock);
}
async function jB(i, e, t, n, r) {
  const o = t.ordered(i, n).map((l) => Promise.resolve(r(l, i, e)).then(void 0, (c) => {
    No(c);
  })), a = await Promise.all(o);
  return ym(a.flat()).filter((l) => voe(i, l));
}
function GB(i, e, t, n, r) {
  return jB(e, t, i, n, (s, o, a) => s.provideDefinition(o, a, r));
}
function vpe(i, e, t, n, r) {
  return jB(e, t, i, n, (s, o, a) => s.provideDeclaration(o, a, r));
}
function ype(i, e, t, n, r) {
  return jB(e, t, i, n, (s, o, a) => s.provideImplementation(o, a, r));
}
function Cpe(i, e, t, n, r) {
  return jB(e, t, i, n, (s, o, a) => s.provideTypeDefinition(o, a, r));
}
function qB(i, e, t, n, r, s) {
  return jB(e, t, i, r, async (o, a, l) => {
    var d, h;
    const c = (d = await o.provideReferences(a, l, { includeDeclaration: !0 }, s)) == null ? void 0 : d.filter((g) => voe(a, g));
    if (!n || !c || c.length !== 2)
      return c;
    const u = (h = await o.provideReferences(a, l, { includeDeclaration: !1 }, s)) == null ? void 0 : h.filter((g) => voe(a, g));
    return u && u.length === 1 ? u : c;
  });
}
async function Rb(i) {
  const e = await i(), t = new Ud(e, ""), n = t.references.map((r) => r.link);
  return t.dispose(), n;
}
id("_executeDefinitionProvider", (i, e, t) => {
  const n = i.get(St), r = GB(n.definitionProvider, e, t, !1, $n.None);
  return Rb(() => r);
});
id("_executeDefinitionProvider_recursive", (i, e, t) => {
  const n = i.get(St), r = GB(n.definitionProvider, e, t, !0, $n.None);
  return Rb(() => r);
});
id("_executeTypeDefinitionProvider", (i, e, t) => {
  const n = i.get(St), r = Cpe(n.typeDefinitionProvider, e, t, !1, $n.None);
  return Rb(() => r);
});
id("_executeTypeDefinitionProvider_recursive", (i, e, t) => {
  const n = i.get(St), r = Cpe(n.typeDefinitionProvider, e, t, !0, $n.None);
  return Rb(() => r);
});
id("_executeDeclarationProvider", (i, e, t) => {
  const n = i.get(St), r = vpe(n.declarationProvider, e, t, !1, $n.None);
  return Rb(() => r);
});
id("_executeDeclarationProvider_recursive", (i, e, t) => {
  const n = i.get(St), r = vpe(n.declarationProvider, e, t, !0, $n.None);
  return Rb(() => r);
});
id("_executeReferenceProvider", (i, e, t) => {
  const n = i.get(St), r = qB(n.referenceProvider, e, t, !1, !1, $n.None);
  return Rb(() => r);
});
id("_executeReferenceProvider_recursive", (i, e, t) => {
  const n = i.get(St), r = qB(n.referenceProvider, e, t, !1, !0, $n.None);
  return Rb(() => r);
});
id("_executeImplementationProvider", (i, e, t) => {
  const n = i.get(St), r = ype(n.implementationProvider, e, t, !1, $n.None);
  return Rb(() => r);
});
id("_executeImplementationProvider_recursive", (i, e, t) => {
  const n = i.get(St), r = ype(n.implementationProvider, e, t, !0, $n.None);
  return Rb(() => r);
});
Oa.appendMenuItem(wt.EditorContext, {
  submenu: wt.EditorContextPeek,
  title: S(1033, "Peek"),
  group: "navigation",
  order: 100
});
class gA {
  static is(e) {
    return !e || typeof e != "object" ? !1 : !!(e instanceof gA || de.isIPosition(e.position) && e.model);
  }
  constructor(e, t) {
    this.model = e, this.position = t;
  }
}
const Ng = class Ng extends Qg {
  static all() {
    return Ng._allSymbolNavigationCommands.values();
  }
  static _patchConfig(e) {
    const t = { ...e, f1: !0 };
    if (t.menu)
      for (const n of gi.wrap(t.menu))
        (n.id === wt.EditorContext || n.id === wt.EditorContextPeek) && (n.when = Re.and(e.precondition, n.when));
    return t;
  }
  constructor(e, t) {
    super(Ng._patchConfig(t)), this.configuration = e, Ng._allSymbolNavigationCommands.set(t.id, this);
  }
  runEditorCommand(e, t, n, r) {
    if (!t.hasModel())
      return Promise.resolve(void 0);
    const s = e.get(no), o = e.get(Ti), a = e.get(e0), l = e.get(RK), c = e.get(St), u = e.get(xt), d = t.getModel(), h = t.getPosition(), g = gA.is(n) ? n : new gA(d, h), m = new t0(
      t,
      5
      /* CodeEditorStateFlag.Position */
    ), _ = $R(this._getLocationModel(c, g.model, g.position, m.token), m.token).then(async (v) => {
      var L;
      if (!v || m.token.isCancellationRequested)
        return;
      lu(v.ariaMessage);
      let w;
      if (v.referenceAt(d.uri, h)) {
        const T = this._getAlternativeCommand(t);
        T !== void 0 && !Ng._activeAlternativeCommands.has(T) && Ng._allSymbolNavigationCommands.has(T) && (w = Ng._allSymbolNavigationCommands.get(T));
      }
      const E = v.references.length;
      if (E === 0) {
        if (!this.configuration.muteMessage) {
          const T = d.getWordAtPosition(h);
          (L = Vd.get(t)) == null || L.showMessage(this._getNoResultFoundMessage(T), h);
        }
      } else if (E === 1 && w)
        Ng._activeAlternativeCommands.add(this.desc.id), u.invokeFunction((T) => w.runEditorCommand(T, t, n, r).finally(() => {
          Ng._activeAlternativeCommands.delete(this.desc.id);
        }));
      else
        return this._onResult(o, l, t, v, r);
    }, (v) => {
      s.error(v);
    }).finally(() => {
      m.dispose();
    });
    return a.showWhile(_, 250), _;
  }
  async _onResult(e, t, n, r, s) {
    const o = this._getGoToPreference(n);
    if (!(n instanceof s0) && (this.configuration.openInPeek || o === "peek" && r.references.length > 1))
      this._openInPeek(n, r, s);
    else {
      const a = r.firstReference(), l = r.references.length > 1 && o === "gotoAndPeek", c = await this._openReference(n, e, a, this.configuration.openToSide, !l);
      l && c ? this._openInPeek(c, r, s) : r.dispose(), o === "goto" && t.put(a);
    }
  }
  async _openReference(e, t, n, r, s) {
    let o;
    if (Ldt(n) && (o = n.targetSelectionRange), o || (o = n.range), !o)
      return;
    const a = await t.openCodeEditor({
      resource: n.uri,
      options: {
        selection: z.collapseToStart(o),
        selectionRevealType: 3,
        selectionSource: "code.jump"
        /* TextEditorSelectionSource.JUMP */
      }
    }, e, r);
    if (a) {
      if (s) {
        const l = a.getModel(), c = a.createDecorationsCollection([{ range: o, options: { description: "symbol-navigate-action-highlight", className: "symbolHighlight" } }]);
        setTimeout(() => {
          a.getModel() === l && c.clear();
        }, 350);
      }
      return a;
    }
  }
  _openInPeek(e, t, n) {
    const r = TT.get(e);
    r && e.hasModel() ? r.toggleWidget(n ?? e.getSelection(), Jo((s) => Promise.resolve(t)), this.configuration.openInPeek) : t.dispose();
  }
};
Ng._allSymbolNavigationCommands = /* @__PURE__ */ new Map(), Ng._activeAlternativeCommands = /* @__PURE__ */ new Set();
let a0 = Ng;
class KB extends a0 {
  async _getLocationModel(e, t, n, r) {
    return new Ud(await GB(e.definitionProvider, t, n, !1, r), S(1034, "Definitions"));
  }
  _getNoResultFoundMessage(e) {
    return e && e.word ? S(1035, "No definition found for '{0}'", e.word) : S(1036, "No definition found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).alternativeDefinitionCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).multipleDefinitions;
  }
}
var V1;
ar((V1 = class extends KB {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !1,
      muteMessage: !1
    }, {
      id: V1.id,
      title: {
        ...Ee(1060, "Go to Definition"),
        mnemonicTitle: S(1037, "Go to &&Definition")
      },
      precondition: se.hasDefinitionProvider,
      keybinding: [{
        when: se.editorTextFocus,
        primary: 70,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }, {
        when: Re.and(se.editorTextFocus, l6e),
        primary: 2118,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }],
      menu: [{
        id: wt.EditorContext,
        group: "navigation",
        order: 1.1
      }, {
        id: wt.MenubarGoMenu,
        precondition: null,
        group: "4_symbol_nav",
        order: 2
      }]
    }), _i.registerCommandAlias("editor.action.goToDeclaration", V1.id);
  }
}, V1.id = "editor.action.revealDefinition", V1));
var U1;
ar((U1 = class extends KB {
  constructor() {
    super({
      openToSide: !0,
      openInPeek: !1,
      muteMessage: !1
    }, {
      id: U1.id,
      title: Ee(1061, "Open Definition to the Side"),
      precondition: Re.and(se.hasDefinitionProvider, se.isInEmbeddedEditor.toNegated()),
      keybinding: [{
        when: se.editorTextFocus,
        primary: Ro(
          2089,
          70
          /* KeyCode.F12 */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }, {
        when: Re.and(se.editorTextFocus, l6e),
        primary: Ro(
          2089,
          2118
          /* KeyCode.F12 */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }]
    }), _i.registerCommandAlias("editor.action.openDeclarationToTheSide", U1.id);
  }
}, U1.id = "editor.action.revealDefinitionAside", U1));
var z1;
ar((z1 = class extends KB {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !0,
      muteMessage: !1
    }, {
      id: z1.id,
      title: Ee(1062, "Peek Definition"),
      precondition: Re.and(se.hasDefinitionProvider, td.notInPeekEditor, se.isInEmbeddedEditor.toNegated()),
      keybinding: {
        when: se.editorTextFocus,
        primary: 582,
        linux: {
          primary: 3140
          /* KeyCode.F10 */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menu: {
        id: wt.EditorContextPeek,
        group: "peek",
        order: 2
      }
    }), _i.registerCommandAlias("editor.action.previewDeclaration", z1.id);
  }
}, z1.id = "editor.action.peekDefinition", z1));
class y6e extends a0 {
  async _getLocationModel(e, t, n, r) {
    return new Ud(await vpe(e.declarationProvider, t, n, !1, r), S(1038, "Declarations"));
  }
  _getNoResultFoundMessage(e) {
    return e && e.word ? S(1039, "No declaration found for '{0}'", e.word) : S(1040, "No declaration found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).alternativeDeclarationCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).multipleDeclarations;
  }
}
var uL;
ar((uL = class extends y6e {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !1,
      muteMessage: !1
    }, {
      id: uL.id,
      title: {
        ...Ee(1063, "Go to Declaration"),
        mnemonicTitle: S(1041, "Go to &&Declaration")
      },
      precondition: Re.and(se.hasDeclarationProvider, se.isInEmbeddedEditor.toNegated()),
      menu: [{
        id: wt.EditorContext,
        group: "navigation",
        order: 1.3
      }, {
        id: wt.MenubarGoMenu,
        precondition: null,
        group: "4_symbol_nav",
        order: 3
      }]
    });
  }
  _getNoResultFoundMessage(e) {
    return e && e.word ? S(1042, "No declaration found for '{0}'", e.word) : S(1043, "No declaration found");
  }
}, uL.id = "editor.action.revealDeclaration", uL));
ar(class extends y6e {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !0,
      muteMessage: !1
    }, {
      id: "editor.action.peekDeclaration",
      title: Ee(1064, "Peek Declaration"),
      precondition: Re.and(se.hasDeclarationProvider, td.notInPeekEditor, se.isInEmbeddedEditor.toNegated()),
      menu: {
        id: wt.EditorContextPeek,
        group: "peek",
        order: 3
      }
    });
  }
});
class C6e extends a0 {
  async _getLocationModel(e, t, n, r) {
    return new Ud(await Cpe(e.typeDefinitionProvider, t, n, !1, r), S(1044, "Type Definitions"));
  }
  _getNoResultFoundMessage(e) {
    return e && e.word ? S(1045, "No type definition found for '{0}'", e.word) : S(1046, "No type definition found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).alternativeTypeDefinitionCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).multipleTypeDefinitions;
  }
}
var dL;
ar((dL = class extends C6e {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !1,
      muteMessage: !1
    }, {
      id: dL.ID,
      title: {
        ...Ee(1065, "Go to Type Definition"),
        mnemonicTitle: S(1047, "Go to &&Type Definition")
      },
      precondition: se.hasTypeDefinitionProvider,
      keybinding: {
        when: se.editorTextFocus,
        primary: 0,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menu: [{
        id: wt.EditorContext,
        group: "navigation",
        order: 1.4
      }, {
        id: wt.MenubarGoMenu,
        precondition: null,
        group: "4_symbol_nav",
        order: 3
      }]
    });
  }
}, dL.ID = "editor.action.goToTypeDefinition", dL));
var hL;
ar((hL = class extends C6e {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !0,
      muteMessage: !1
    }, {
      id: hL.ID,
      title: Ee(1066, "Peek Type Definition"),
      precondition: Re.and(se.hasTypeDefinitionProvider, td.notInPeekEditor, se.isInEmbeddedEditor.toNegated()),
      menu: {
        id: wt.EditorContextPeek,
        group: "peek",
        order: 4
      }
    });
  }
}, hL.ID = "editor.action.peekTypeDefinition", hL));
class w6e extends a0 {
  async _getLocationModel(e, t, n, r) {
    return new Ud(await ype(e.implementationProvider, t, n, !1, r), S(1048, "Implementations"));
  }
  _getNoResultFoundMessage(e) {
    return e && e.word ? S(1049, "No implementation found for '{0}'", e.word) : S(1050, "No implementation found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).alternativeImplementationCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).multipleImplementations;
  }
}
var fL;
ar((fL = class extends w6e {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !1,
      muteMessage: !1
    }, {
      id: fL.ID,
      title: {
        ...Ee(1067, "Go to Implementations"),
        mnemonicTitle: S(1051, "Go to &&Implementations")
      },
      precondition: se.hasImplementationProvider,
      keybinding: {
        when: se.editorTextFocus,
        primary: 2118,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menu: [{
        id: wt.EditorContext,
        group: "navigation",
        order: 1.45
      }, {
        id: wt.MenubarGoMenu,
        precondition: null,
        group: "4_symbol_nav",
        order: 4
      }]
    });
  }
}, fL.ID = "editor.action.goToImplementation", fL));
var gL;
ar((gL = class extends w6e {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !0,
      muteMessage: !1
    }, {
      id: gL.ID,
      title: Ee(1068, "Peek Implementations"),
      precondition: Re.and(se.hasImplementationProvider, td.notInPeekEditor, se.isInEmbeddedEditor.toNegated()),
      keybinding: {
        when: se.editorTextFocus,
        primary: 3142,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menu: {
        id: wt.EditorContextPeek,
        group: "peek",
        order: 5
      }
    });
  }
}, gL.ID = "editor.action.peekImplementation", gL));
class S6e extends a0 {
  _getNoResultFoundMessage(e) {
    return e ? S(1052, "No references found for '{0}'", e.word) : S(1053, "No references found");
  }
  _getAlternativeCommand(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).alternativeReferenceCommand;
  }
  _getGoToPreference(e) {
    return e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).multipleReferences;
  }
}
ar(class extends S6e {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !1,
      muteMessage: !1
    }, {
      id: "editor.action.goToReferences",
      title: {
        ...Ee(1069, "Go to References"),
        mnemonicTitle: S(1054, "Go to &&References")
      },
      precondition: Re.and(se.hasReferenceProvider, td.notInPeekEditor, se.isInEmbeddedEditor.toNegated()),
      keybinding: {
        when: se.editorTextFocus,
        primary: 1094,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menu: [{
        id: wt.EditorContext,
        group: "navigation",
        order: 1.45
      }, {
        id: wt.MenubarGoMenu,
        precondition: null,
        group: "4_symbol_nav",
        order: 5
      }]
    });
  }
  async _getLocationModel(e, t, n, r) {
    return new Ud(await qB(e.referenceProvider, t, n, !0, !1, r), S(1055, "References"));
  }
});
ar(class extends S6e {
  constructor() {
    super({
      openToSide: !1,
      openInPeek: !0,
      muteMessage: !1
    }, {
      id: "editor.action.referenceSearch.trigger",
      title: Ee(1070, "Peek References"),
      precondition: Re.and(se.hasReferenceProvider, td.notInPeekEditor, se.isInEmbeddedEditor.toNegated()),
      menu: {
        id: wt.EditorContextPeek,
        group: "peek",
        order: 6
      }
    });
  }
  async _getLocationModel(e, t, n, r) {
    return new Ud(await qB(e.referenceProvider, t, n, !1, !1, r), S(1056, "References"));
  }
});
class ySt extends a0 {
  constructor(e, t, n) {
    super(e, {
      id: "editor.action.goToLocation",
      title: Ee(1071, "Go to Any Symbol"),
      precondition: Re.and(td.notInPeekEditor, se.isInEmbeddedEditor.toNegated())
    }), this._references = t, this._gotoMultipleBehaviour = n;
  }
  async _getLocationModel(e, t, n, r) {
    return new Ud(this._references, S(1057, "Locations"));
  }
  _getNoResultFoundMessage(e) {
    return e && S(1058, "No results for '{0}'", e.word) || "";
  }
  _getGoToPreference(e) {
    return this._gotoMultipleBehaviour ?? e.getOption(
      67
      /* EditorOption.gotoLocation */
    ).multipleReferences;
  }
  _getAlternativeCommand() {
  }
}
_i.registerCommand({
  id: "editor.action.goToLocations",
  metadata: {
    description: "Go to locations from a position in a file",
    args: [
      { name: "uri", description: "The text document in which to start", constraint: Ht },
      { name: "position", description: "The position at which to start", constraint: de.isIPosition },
      { name: "locations", description: "An array of locations.", constraint: Array },
      { name: "multiple", description: "Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`" },
      { name: "noResultsMessage", description: "Human readable message that shows when locations is empty." }
    ]
  },
  handler: async (i, e, t, n, r, s, o) => {
    Ii(Ht.isUri(e)), Ii(de.isIPosition(t)), Ii(Array.isArray(n)), Ii(typeof r > "u" || typeof r == "string"), Ii(typeof o > "u" || typeof o == "boolean");
    const a = i.get(Ti), l = await a.openCodeEditor({ resource: e }, a.getFocusedCodeEditor());
    if (vb(l))
      return l.setPosition(t), l.revealPositionInCenterIfOutsideViewport(
        t,
        0
        /* ScrollType.Smooth */
      ), l.invokeWithinContext((c) => {
        const u = new class extends ySt {
          _getNoResultFoundMessage(d) {
            return s || super._getNoResultFoundMessage(d);
          }
        }({
          muteMessage: !s,
          openInPeek: !!o,
          openToSide: !1
        }, n, r);
        c.get(xt).invokeFunction(u.run.bind(u), l);
      });
  }
});
_i.registerCommand({
  id: "editor.action.peekLocations",
  metadata: {
    description: "Peek locations from a position in a file",
    args: [
      { name: "uri", description: "The text document in which to start", constraint: Ht },
      { name: "position", description: "The position at which to start", constraint: de.isIPosition },
      { name: "locations", description: "An array of locations.", constraint: Array },
      { name: "multiple", description: "Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`" }
    ]
  },
  handler: async (i, e, t, n, r) => {
    i.get(jr).executeCommand("editor.action.goToLocations", e, t, n, r, void 0, !0);
  }
});
_i.registerCommand({
  id: "editor.action.findReferences",
  handler: (i, e, t) => {
    Ii(Ht.isUri(e)), Ii(de.isIPosition(t));
    const n = i.get(St), r = i.get(Ti);
    return r.openCodeEditor({ resource: e }, r.getFocusedCodeEditor()).then((s) => {
      if (!vb(s) || !s.hasModel())
        return;
      const o = TT.get(s);
      if (!o)
        return;
      const a = Jo((c) => qB(n.referenceProvider, s.getModel(), de.lift(t), !1, !1, c).then((u) => new Ud(u, S(1059, "References")))), l = new z(t.lineNumber, t.column, t.lineNumber, t.column);
      return Promise.resolve(o.toggleWidget(l, a, !1));
    });
  }
});
_i.registerCommandAlias("editor.action.showReferences", "editor.action.peekLocations");
async function CSt(i, e, t, n) {
  const r = i.get(Ic), s = i.get(Qh), o = i.get(jr), a = i.get(xt), l = i.get(no);
  if (await n.item.resolve($n.None), !n.part.location)
    return;
  const c = n.part.location, u = [], d = new Set(Oa.getMenuItems(wt.EditorContext).map((g) => $N(g) ? g.command.id : XT()));
  for (const g of a0.all())
    d.has(g.desc.id) && u.push(new Vh(g.desc.id, Uh.label(g.desc, { renderShortTitle: !0 }), void 0, !0, async () => {
      const m = await r.createModelReference(c.uri);
      try {
        const _ = new gA(m.object.textEditorModel, z.getStartPosition(c.range)), v = n.item.anchor.range;
        await a.invokeFunction(g.runEditorCommand.bind(g), e, _, v);
      } finally {
        m.dispose();
      }
    }));
  if (n.part.command) {
    const { command: g } = n.part;
    u.push(new fa()), u.push(new Vh(g.id, g.title, void 0, !0, async () => {
      try {
        await o.executeCommand(g.id, ...g.arguments ?? []);
      } catch (m) {
        l.notify({
          severity: i2.Error,
          source: n.item.provider.displayName,
          message: m
        });
      }
    }));
  }
  const h = e.getOption(
    144
    /* EditorOption.useShadowDOM */
  );
  s.showContextMenu({
    domForShadowRoot: h ? e.getDomNode() ?? void 0 : void 0,
    getAnchor: () => {
      const g = ho(t);
      return { x: g.left, y: g.top + g.height + 8 };
    },
    getActions: () => u,
    onHide: () => {
      e.focus();
    },
    autoSelectFirstItem: !0
  });
}
async function E6e(i, e, t, n) {
  const s = await i.get(Ic).createModelReference(n.uri);
  await t.invokeWithinContext(async (o) => {
    const a = e.hasSideBySideModifier, l = o.get(Jt), c = td.inPeekEditor.getValue(l), u = !a && t.getOption(
      101
      /* EditorOption.definitionLinkOpensInPeek */
    ) && !c;
    return new KB({ openToSide: a, openInPeek: u, muteMessage: !0 }, { title: { value: "", original: "" }, id: "", precondition: void 0 }).run(o, new gA(s.object.textEditorModel, z.getStartPosition(n.range)), z.lift(n.range));
  }), s.dispose();
}
var wSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, EI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, GI;
class Cz {
  constructor() {
    this._entries = new Tb(50);
  }
  get(e) {
    const t = Cz._key(e);
    return this._entries.get(t);
  }
  set(e, t) {
    const n = Cz._key(e);
    this._entries.set(n, t);
  }
  static _key(e) {
    return `${e.uri.toString()}/${e.getVersionId()}`;
  }
}
const x6e = Vn("IInlayHintsCache");
ni(
  x6e,
  Cz,
  1
  /* InstantiationType.Delayed */
);
class yoe {
  constructor(e, t) {
    this.item = e, this.index = t;
  }
  get part() {
    const e = this.item.hint.label;
    return typeof e == "string" ? { label: e } : e[this.index];
  }
}
class SSt {
  constructor(e, t) {
    this.part = e, this.hasTriggerModifier = t;
  }
}
var Iy;
let l5 = (Iy = class {
  static get(e) {
    return e.getContribution(GI.ID) ?? void 0;
  }
  constructor(e, t, n, r, s, o, a) {
    this._editor = e, this._languageFeaturesService = t, this._inlayHintsCache = r, this._commandService = s, this._notificationService = o, this._instaService = a, this._disposables = new ke(), this._sessionDisposables = new ke(), this._decorationsMetadata = /* @__PURE__ */ new Map(), this._activeRenderMode = 0, this._ruleFactory = this._disposables.add(new iU(this._editor)), this._debounceInfo = n.for(t.inlayHintsProvider, "InlayHint", { min: 25 }), this._disposables.add(t.inlayHintsProvider.onDidChange(() => this._update())), this._disposables.add(e.onDidChangeModel(() => this._update())), this._disposables.add(e.onDidChangeModelLanguage(() => this._update())), this._disposables.add(e.onDidChangeConfiguration((l) => {
      l.hasChanged(
        159
        /* EditorOption.inlayHints */
      ) && this._update();
    })), this._update();
  }
  dispose() {
    this._sessionDisposables.dispose(), this._removeAllDecorations(), this._disposables.dispose();
  }
  _update() {
    this._sessionDisposables.clear(), this._removeAllDecorations();
    const e = this._editor.getOption(
      159
      /* EditorOption.inlayHints */
    );
    if (e.enabled === "off")
      return;
    const t = this._editor.getModel();
    if (!t || !this._languageFeaturesService.inlayHintsProvider.has(t))
      return;
    if (e.enabled === "on")
      this._activeRenderMode = 0;
    else {
      let l, c;
      e.enabled === "onUnlessPressed" ? (l = 0, c = 1) : (l = 1, c = 0), this._activeRenderMode = l, this._sessionDisposables.add(by.getInstance().event((u) => {
        if (!this._editor.hasModel())
          return;
        const d = u.altKey && u.ctrlKey && !(u.shiftKey || u.metaKey) ? c : l;
        if (d !== this._activeRenderMode) {
          this._activeRenderMode = d;
          const h = this._editor.getModel(), g = this._copyInlayHintsWithCurrentAnchor(h);
          this._updateHintsDecorators([h.getFullModelRange()], g), o.schedule(0);
        }
      }));
    }
    const n = this._inlayHintsCache.get(t);
    n && this._updateHintsDecorators([t.getFullModelRange()], n), this._sessionDisposables.add(Et(() => {
      t.isDisposed() || this._cacheHintsForFastRestore(t);
    }));
    let r;
    const s = /* @__PURE__ */ new Set(), o = new mr(async () => {
      const l = Date.now();
      r == null || r.dispose(!0), r = new Ss();
      const c = t.onWillDispose(() => r == null ? void 0 : r.cancel());
      try {
        const u = r.token, d = await lz.create(this._languageFeaturesService.inlayHintsProvider, t, this._getHintsRanges(), u);
        if (o.delay = this._debounceInfo.update(t, Date.now() - l), u.isCancellationRequested) {
          d.dispose();
          return;
        }
        for (const h of d.provider)
          typeof h.onDidChangeInlayHints == "function" && !s.has(h) && (s.add(h), this._sessionDisposables.add(h.onDidChangeInlayHints(() => {
            o.isScheduled() || o.schedule();
          })));
        this._sessionDisposables.add(d), this._updateHintsDecorators(d.ranges, d.items), this._cacheHintsForFastRestore(t);
      } catch (u) {
        fn(u);
      } finally {
        r.dispose(), c.dispose();
      }
    }, this._debounceInfo.get(t));
    this._sessionDisposables.add(o), this._sessionDisposables.add(Et(() => r == null ? void 0 : r.dispose(!0))), o.schedule(0), this._sessionDisposables.add(this._editor.onDidScrollChange((l) => {
      (l.scrollTopChanged || !o.isScheduled()) && o.schedule();
    }));
    const a = this._sessionDisposables.add(new er());
    this._sessionDisposables.add(this._editor.onDidChangeModelContent((l) => {
      r == null || r.cancel();
      const c = Math.max(o.delay, 800);
      this._cursorInfo = { position: this._editor.getPosition(), notEarlierThan: Date.now() + c }, a.value = jy(() => o.schedule(0), c), o.schedule();
    })), this._sessionDisposables.add(this._editor.onDidChangeConfiguration((l) => {
      l.hasChanged(
        159
        /* EditorOption.inlayHints */
      ) && o.schedule();
    })), this._sessionDisposables.add(this._installDblClickGesture(() => o.schedule(0))), this._sessionDisposables.add(this._installLinkGesture()), this._sessionDisposables.add(this._installContextMenu());
  }
  _installLinkGesture() {
    const e = new ke(), t = e.add(new SK(this._editor)), n = new ke();
    return e.add(n), e.add(t.onMouseMoveOrRelevantKeyDown((r) => {
      const [s] = r, o = this._getInlayHintLabelPart(s), a = this._editor.getModel();
      if (!o || !a) {
        n.clear();
        return;
      }
      const l = new Ss();
      n.add(Et(() => l.dispose(!0))), o.item.resolve(l.token), this._activeInlayHintPart = o.part.command || o.part.location ? new SSt(o, s.hasTriggerModifier) : void 0;
      const c = a.validatePosition(o.item.hint.position).lineNumber, u = new z(c, 1, c, a.getLineMaxColumn(c)), d = this._getInlineHintsForRange(u);
      this._updateHintsDecorators([u], d), n.add(Et(() => {
        this._activeInlayHintPart = void 0, this._updateHintsDecorators([u], d);
      }));
    })), e.add(t.onCancel(() => n.clear())), e.add(t.onExecute(async (r) => {
      const s = this._getInlayHintLabelPart(r);
      if (s) {
        const o = s.part;
        o.location ? this._instaService.invokeFunction(E6e, r, this._editor, o.location) : ore.is(o.command) && await this._invokeCommand(o.command, s.item);
      }
    })), e;
  }
  _getInlineHintsForRange(e) {
    const t = /* @__PURE__ */ new Set();
    for (const n of this._decorationsMetadata.values())
      e.containsRange(n.item.anchor.range) && t.add(n.item);
    return Array.from(t);
  }
  _installDblClickGesture(e) {
    return this._editor.onMouseUp(async (t) => {
      if (t.event.detail !== 2)
        return;
      const n = this._getInlayHintLabelPart(t);
      if (n && (t.event.preventDefault(), await n.item.resolve($n.None), kc(n.item.hint.textEdits))) {
        const r = n.item.hint.textEdits.map((s) => Xs.replace(z.lift(s.range), s.text));
        this._editor.executeEdits("inlayHint.default", r), e();
      }
    });
  }
  _installContextMenu() {
    return this._editor.onContextMenu(async (e) => {
      if (!eo(e.event.target))
        return;
      const t = this._getInlayHintLabelPart(e);
      t && await this._instaService.invokeFunction(CSt, this._editor, e.event.target, t);
    });
  }
  _getInlayHintLabelPart(e) {
    var n;
    if (e.target.type !== 6)
      return;
    const t = (n = e.target.detail.injectedText) == null ? void 0 : n.options;
    if (t instanceof uw && (t == null ? void 0 : t.attachedData) instanceof yoe)
      return t.attachedData;
  }
  async _invokeCommand(e, t) {
    try {
      await this._commandService.executeCommand(e.id, ...e.arguments ?? []);
    } catch (n) {
      this._notificationService.notify({
        severity: i2.Error,
        source: t.provider.displayName,
        message: n
      });
    }
  }
  _cacheHintsForFastRestore(e) {
    const t = this._copyInlayHintsWithCurrentAnchor(e);
    this._inlayHintsCache.set(e, t);
  }
  // return inlay hints but with an anchor that reflects "updates"
  // that happened after receiving them, e.g adding new lines before a hint
  _copyInlayHintsWithCurrentAnchor(e) {
    const t = /* @__PURE__ */ new Map();
    for (const [n, r] of this._decorationsMetadata) {
      if (t.has(r.item))
        continue;
      const s = e.getDecorationRange(n);
      if (s) {
        const o = new OBe(s, r.item.anchor.direction), a = r.item.with({ anchor: o });
        t.set(r.item, a);
      }
    }
    return Array.from(t.values());
  }
  _getHintsRanges() {
    const t = this._editor.getModel(), n = this._editor.getVisibleRangesPlusViewportAboveBelow(), r = [];
    for (const s of n.sort(z.compareRangesUsingStarts)) {
      const o = t.validateRange(new z(s.startLineNumber - 30, s.startColumn, s.endLineNumber + 30, s.endColumn));
      r.length === 0 || !z.areIntersectingOrTouching(r[r.length - 1], o) ? r.push(o) : r[r.length - 1] = z.plusRange(r[r.length - 1], o);
    }
    return r;
  }
  _updateHintsDecorators(e, t) {
    var v, w;
    const n = /* @__PURE__ */ new Map();
    if (this._cursorInfo && this._cursorInfo.notEarlierThan > Date.now() && e.some((E) => E.containsPosition(this._cursorInfo.position))) {
      const { position: E } = this._cursorInfo;
      this._cursorInfo = void 0;
      const L = /* @__PURE__ */ new Map();
      for (const R of this._editor.getLineDecorations(E.lineNumber) ?? []) {
        const M = this._decorationsMetadata.get(R.id);
        if (R.range.startColumn > E.column)
          continue;
        const B = M == null ? void 0 : M.decoration.options[M.item.anchor.direction];
        if (B && B.attachedData !== GI._whitespaceData) {
          const H = L.get(M.item) ?? 0;
          L.set(M.item, H + B.content.length);
        }
      }
      const T = t.filter((R) => R.anchor.range.startLineNumber === E.lineNumber && R.anchor.range.endColumn <= E.column), D = Array.from(L.values());
      let N;
      for (; ; ) {
        const R = T.shift(), M = D.shift();
        if (!M && !R)
          break;
        if (R)
          n.set(R, M ?? 0), N = R;
        else if (N && M) {
          let B = n.get(N);
          B += M, B += D.reduce((H, j) => H + j, 0), D.length = 0;
          break;
        }
      }
    }
    const r = [], s = (E, L, T, D, N) => {
      const R = {
        content: T,
        inlineClassNameAffectsLetterSpacing: !0,
        inlineClassName: L.className,
        cursorStops: D,
        attachedData: N
      };
      r.push({
        item: E,
        classNameRef: L,
        decoration: {
          range: E.anchor.range,
          options: {
            // className: "rangeHighlight", // DEBUG highlight to see to what range a hint is attached
            description: "InlayHint",
            showIfCollapsed: E.anchor.range.isEmpty(),
            // "original" range is empty
            collapseOnReplaceEdit: !E.anchor.range.isEmpty(),
            stickiness: 0,
            [E.anchor.direction]: this._activeRenderMode === 0 ? R : void 0
          }
        }
      });
    }, o = (E, L) => {
      const T = this._ruleFactory.createClassNameRef({
        width: `${a / 3 | 0}px`,
        display: "inline-block"
      });
      s(E, T, " ", L ? Af.Right : Af.None, GI._whitespaceData);
    }, { fontSize: a, fontFamily: l, padding: c, isUniform: u } = this._getLayoutInfo(), d = this._editor.getOption(
      159
      /* EditorOption.inlayHints */
    ).maximumLength, h = "--code-editorInlayHintsFontFamily";
    this._editor.getContainerDomNode().style.setProperty(h, l);
    let g = { line: 0, totalLen: 0 };
    for (let E = 0; E < t.length; E++) {
      const L = t[E];
      if (g.line !== L.anchor.range.startLineNumber && (g = { line: L.anchor.range.startLineNumber, totalLen: 0 }), d && g.totalLen > d)
        continue;
      L.hint.paddingLeft && o(L, !1);
      const T = typeof L.hint.label == "string" ? [{ label: L.hint.label }] : L.hint.label, D = n.get(L);
      let N = 0;
      for (let R = 0; R < T.length; R++) {
        const M = T[R], B = R === 0, H = R === T.length - 1, j = {
          fontSize: `${a}px`,
          fontFamily: `var(${h}), ${au.fontFamily}`,
          verticalAlign: u ? "baseline" : "middle",
          unicodeBidi: "isolate"
        };
        kc(L.hint.textEdits) && (j.cursor = "default"), this._fillInColors(j, L.hint), (M.command || M.location) && ((v = this._activeInlayHintPart) == null ? void 0 : v.part.item) === L && this._activeInlayHintPart.part.index === R && (j.textDecoration = "underline", this._activeInlayHintPart.hasTriggerModifier && (j.color = Ks(Pat), j.cursor = "pointer"));
        let K = M.label;
        g.totalLen += K.length;
        let X = !1;
        const Y = d !== 0 ? g.totalLen - d : 0;
        if (Y > 0 && (K = K.slice(0, -Y) + "…", X = !0), N += K.length, D !== void 0) {
          const G = N - D;
          G >= 0 && (N -= G, K = K.slice(0, -(1 + G)) + "…", X = !0);
        }
        if (c && (B && (H || X) ? (j.padding = `1px ${Math.max(1, a / 4) | 0}px`, j.borderRadius = `${a / 4 | 0}px`) : B ? (j.padding = `1px 0 1px ${Math.max(1, a / 4) | 0}px`, j.borderRadius = `${a / 4 | 0}px 0 0 ${a / 4 | 0}px`) : H || X ? (j.padding = `1px ${Math.max(1, a / 4) | 0}px 1px 0`, j.borderRadius = `0 ${a / 4 | 0}px ${a / 4 | 0}px 0`) : j.padding = "1px 0 1px 0"), s(L, this._ruleFactory.createClassNameRef(j), ESt(K), H && !L.hint.paddingRight ? Af.Right : Af.None, new yoe(L, R)), X)
          break;
      }
      if (D !== void 0 && N < D) {
        const R = D - N;
        s(L, this._ruleFactory.createClassNameRef({}), " ".repeat(R), Af.None);
      }
      if (L.hint.paddingRight && o(L, !0), r.length > GI._MAX_DECORATORS)
        break;
    }
    const m = [];
    for (const [E, L] of this._decorationsMetadata) {
      const T = (w = this._editor.getModel()) == null ? void 0 : w.getDecorationRange(E);
      T && e.some((D) => D.containsRange(T)) && (m.push(E), L.classNameRef.dispose(), this._decorationsMetadata.delete(E));
    }
    const _ = mm.capture(this._editor);
    this._editor.changeDecorations((E) => {
      const L = E.deltaDecorations(m, r.map((T) => T.decoration));
      for (let T = 0; T < L.length; T++) {
        const D = r[T];
        this._decorationsMetadata.set(L[T], D);
      }
    }), _.restore(this._editor);
  }
  _fillInColors(e, t) {
    t.kind === hU.Parameter ? (e.backgroundColor = Ks($at), e.color = Ks(zat)) : t.kind === hU.Type ? (e.backgroundColor = Ks(Uat), e.color = Ks(Vat)) : (e.backgroundColor = Ks(Sfe), e.color = Ks(wfe));
  }
  _getLayoutInfo() {
    const e = this._editor.getOption(
      159
      /* EditorOption.inlayHints */
    ), t = e.padding, n = this._editor.getOption(
      61
      /* EditorOption.fontSize */
    ), r = this._editor.getOption(
      58
      /* EditorOption.fontFamily */
    );
    let s = e.fontSize;
    (!s || s < 5 || s > n) && (s = n);
    const o = e.fontFamily || r;
    return { fontSize: s, fontFamily: o, padding: t, isUniform: !t && o === r && s === n };
  }
  _removeAllDecorations() {
    this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));
    for (const e of this._decorationsMetadata.values())
      e.classNameRef.dispose();
    this._decorationsMetadata.clear();
  }
}, GI = Iy, Iy.ID = "editor.contrib.InlayHints", Iy._MAX_DECORATORS = 1500, Iy._whitespaceData = {}, Iy);
l5 = GI = wSt([
  EI(1, St),
  EI(2, ig),
  EI(3, x6e),
  EI(4, jr),
  EI(5, no),
  EI(6, xt)
], l5);
function ESt(i) {
  return i.replace(/[ \t]/g, " ");
}
_i.registerCommand("_executeInlayHintProvider", async (i, ...e) => {
  const [t, n] = e;
  Ii(Ht.isUri(t)), Ii(z.isIRange(n));
  const { inlayHintsProvider: r } = i.get(St), s = await i.get(Ic).createModelReference(t);
  try {
    const o = await lz.create(r, s.object.textEditorModel, [z.lift(n)], $n.None), a = o.items.map((l) => l.hint);
    return setTimeout(() => o.dispose(), 0), a;
  } finally {
    s.dispose();
  }
});
var xSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, LC = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class $De extends YP {
  constructor(e, t, n, r) {
    super(10, t, e.item.anchor.range, n, r, !0), this.part = e;
  }
}
let wz = class extends n5 {
  constructor(e, t, n, r, s, o, a, l, c) {
    super(e, t, n, o, l, r, s, c), this._resolverService = a, this.hoverOrdinal = 6;
  }
  suggestHoverAnchor(e) {
    var r;
    if (!l5.get(this._editor) || e.target.type !== 6)
      return null;
    const n = (r = e.target.detail.injectedText) == null ? void 0 : r.options;
    return n instanceof uw && n.attachedData instanceof yoe ? new $De(n.attachedData, this, e.event.posx, e.event.posy) : null;
  }
  computeSync() {
    return [];
  }
  computeAsync(e, t, n, r) {
    return e instanceof $De ? new Hf(async (s) => {
      const { part: o } = e;
      if (await o.item.resolve(r), r.isCancellationRequested)
        return;
      let a;
      typeof o.item.hint.tooltip == "string" ? a = new ql().appendText(o.item.hint.tooltip) : o.item.hint.tooltip && (a = o.item.hint.tooltip), a && s.emitOne(new Wg(this, e.range, [a], !1, 0)), kc(o.item.hint.textEdits) && s.emitOne(new Wg(this, e.range, [new ql().appendText(S(1157, "Double-click to insert"))], !1, 10001));
      let l;
      if (typeof o.part.tooltip == "string" ? l = new ql().appendText(o.part.tooltip) : o.part.tooltip && (l = o.part.tooltip), l && s.emitOne(new Wg(this, e.range, [l], !1, 1)), o.part.location || o.part.command) {
        let u;
        const h = this._editor.getOption(
          86
          /* EditorOption.multiCursorModifier */
        ) === "altKey" ? Kn ? S(1158, "cmd + click") : S(1159, "ctrl + click") : Kn ? S(1160, "option + click") : S(1161, "alt + click");
        o.part.location && o.part.command ? u = new ql().appendText(S(1162, "Go to Definition ({0}), right click for more", h)) : o.part.location ? u = new ql().appendText(S(1163, "Go to Definition ({0})", h)) : o.part.command && (u = new ql(`[${S(1164, "Execute Command")}](${B1t(o.part.command)} "${o.part.command.title}") (${h})`, { isTrusted: !0 })), u && s.emitOne(new Wg(this, e.range, [u], !1, 1e4));
      }
      const c = this._resolveInlayHintLabelPartHover(o, r);
      for await (const u of c)
        s.emitOne(u);
    }) : Hf.EMPTY;
  }
  async *_resolveInlayHintLabelPartHover(e, t) {
    if (!e.part.location)
      return;
    const { uri: n, range: r } = e.part.location, s = await this._resolverService.createModelReference(n);
    try {
      const o = s.object.textEditorModel;
      if (!this._languageFeaturesService.hoverProvider.has(o))
        return;
      for await (const a of Zge(this._languageFeaturesService.hoverProvider, o, new de(r.startLineNumber, r.startColumn), t))
        aA(a.hover.contents) || (yield new Wg(this, e.item.anchor.range, a.hover.contents, !1, 2 + a.ordinal));
    } finally {
      s.dispose();
    }
  }
};
wz = xSt([
  LC(1, Gr),
  LC(2, ad),
  LC(3, Fi),
  LC(4, od),
  LC(5, xn),
  LC(6, Ic),
  LC(7, St),
  LC(8, jr)
], wz);
var L6e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Sz = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Coe, woe;
let Soe = Coe = class extends ge {
  constructor(e, t, n, r, s, o) {
    super();
    const a = t.hoverParts;
    this._renderedHoverParts = this._register(new Eoe(e, n, a, r, s, o));
    const l = t.options, c = l.anchor, { showAtPosition: u, showAtSecondaryPosition: d } = Coe.computeHoverPositions(e, c.range, a);
    this.shouldAppearBeforeContent = a.some((h) => h.isBeforeContent), this.showAtPosition = u, this.showAtSecondaryPosition = d, this.initialMousePosX = c.initialMousePosX, this.initialMousePosY = c.initialMousePosY, this.shouldFocus = l.shouldFocus, this.source = l.source;
  }
  get domNode() {
    return this._renderedHoverParts.domNode;
  }
  get domNodeHasChildren() {
    return this._renderedHoverParts.domNodeHasChildren;
  }
  get focusedHoverPartIndex() {
    return this._renderedHoverParts.focusedHoverPartIndex;
  }
  get hoverPartsCount() {
    return this._renderedHoverParts.hoverPartsCount;
  }
  focusHoverPartWithIndex(e) {
    this._renderedHoverParts.focusHoverPartWithIndex(e);
  }
  async updateHoverVerbosityLevel(e, t, n) {
    this._renderedHoverParts.updateHoverVerbosityLevel(e, t, n);
  }
  isColorPickerVisible() {
    return this._renderedHoverParts.isColorPickerVisible();
  }
  static computeHoverPositions(e, t, n) {
    let r = 1;
    if (e.hasModel()) {
      const u = e._getViewModel(), d = u.coordinatesConverter, h = d.convertModelRangeToViewRange(t), g = u.getLineMinColumn(h.startLineNumber), m = new de(h.startLineNumber, g);
      r = d.convertViewPositionToModelPosition(m).column;
    }
    const s = t.startLineNumber;
    let o = t.startColumn, a;
    for (const u of n) {
      const d = u.range, h = d.startLineNumber === s, g = d.endLineNumber === s;
      if (h && g) {
        const _ = d.startColumn, v = Math.min(o, _);
        o = Math.max(v, r);
      }
      u.forceShowAtRange && (a = d);
    }
    let l, c;
    if (a) {
      const u = a.getStartPosition();
      l = u, c = u;
    } else
      l = t.getStartPosition(), c = new de(s, o);
    return {
      showAtPosition: l,
      showAtSecondaryPosition: c
    };
  }
};
Soe = Coe = L6e([
  Sz(4, Fi),
  Sz(5, od)
], Soe);
class LSt {
  constructor(e, t) {
    this._statusBar = t, e.appendChild(this._statusBar.hoverElement);
  }
  get hoverElement() {
    return this._statusBar.hoverElement;
  }
  get actions() {
    return this._statusBar.actions;
  }
  dispose() {
    this._statusBar.dispose();
  }
}
var pL;
let Eoe = (pL = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._renderedParts = [], this._focusedHoverPartIndex = -1, this._context = r, this._fragment = document.createDocumentFragment(), this._register(this._renderParts(t, n, r, s, o)), this._register(this._registerListenersOnRenderedParts()), this._register(this._createEditorDecorations(e, n)), this._updateMarkdownAndColorParticipantInfo(t);
  }
  _createEditorDecorations(e, t) {
    if (t.length === 0)
      return ge.None;
    let n = t[0].range;
    for (const s of t) {
      const o = s.range;
      n = z.plusRange(n, o);
    }
    const r = e.createDecorationsCollection();
    return r.set([{
      range: n,
      options: woe._DECORATION_OPTIONS
    }]), Et(() => {
      r.clear();
    });
  }
  _renderParts(e, t, n, r, s) {
    const o = new sz(r, s), a = {
      fragment: this._fragment,
      statusBar: o,
      ...n
    }, l = new ke();
    l.add(o);
    for (const u of e) {
      const d = this._renderHoverPartsForParticipant(t, u, a);
      l.add(d);
      for (const h of d.renderedHoverParts)
        this._renderedParts.push({
          type: "hoverPart",
          participant: u,
          hoverPart: h.hoverPart,
          hoverElement: h.hoverElement
        });
    }
    const c = this._renderStatusBar(this._fragment, o);
    return c && (l.add(c), this._renderedParts.push({
      type: "statusBar",
      hoverElement: c.hoverElement,
      actions: c.actions
    })), l;
  }
  _renderHoverPartsForParticipant(e, t, n) {
    const r = e.filter((o) => o.owner === t);
    return r.length > 0 ? t.renderHoverParts(n, r) : new wT([]);
  }
  _renderStatusBar(e, t) {
    if (t.hasContent)
      return new LSt(e, t);
  }
  _registerListenersOnRenderedParts() {
    const e = new ke();
    return this._renderedParts.forEach((t, n) => {
      const r = t.hoverElement;
      r.tabIndex = 0, e.add(Ce(r, Xe.FOCUS_IN, (s) => {
        s.stopPropagation(), this._focusedHoverPartIndex = n;
      })), e.add(Ce(r, Xe.FOCUS_OUT, (s) => {
        s.stopPropagation(), this._focusedHoverPartIndex = -1;
      }));
    }), e;
  }
  _updateMarkdownAndColorParticipantInfo(e) {
    const t = e.find((n) => n instanceof n5 && !(n instanceof wz));
    t && (this._markdownHoverParticipant = t), this._colorHoverParticipant = e.find((n) => n instanceof az);
  }
  focusHoverPartWithIndex(e) {
    e < 0 || e >= this._renderedParts.length || this._renderedParts[e].hoverElement.focus();
  }
  async updateHoverVerbosityLevel(e, t, n) {
    if (!this._markdownHoverParticipant)
      return;
    let r;
    t >= 0 ? r = { start: t, endExclusive: t + 1 } : r = this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);
    for (let s = r.start; s < r.endExclusive; s++) {
      const o = this._normalizedIndexToMarkdownHoverIndexRange(this._markdownHoverParticipant, s);
      if (o === void 0)
        continue;
      const a = await this._markdownHoverParticipant.updateMarkdownHoverVerbosityLevel(e, o);
      a && (this._renderedParts[s] = {
        type: "hoverPart",
        participant: this._markdownHoverParticipant,
        hoverPart: a.hoverPart,
        hoverElement: a.hoverElement
      });
    }
    n && (t >= 0 ? this.focusHoverPartWithIndex(t) : this._context.focus()), this._context.onContentsChanged();
  }
  isColorPickerVisible() {
    var e;
    return ((e = this._colorHoverParticipant) == null ? void 0 : e.isColorPickerVisible()) ?? !1;
  }
  _normalizedIndexToMarkdownHoverIndexRange(e, t) {
    const n = this._renderedParts[t];
    if (!n || n.type !== "hoverPart" || !(n.participant === e))
      return;
    const s = this._renderedParts.findIndex((o) => o.type === "hoverPart" && o.participant === e);
    if (s === -1)
      throw new Wt();
    return t - s;
  }
  _findRangeOfMarkdownHoverParts(e) {
    const t = this._renderedParts.slice(), n = t.findIndex((o) => o.type === "hoverPart" && o.participant === e), r = t.reverse().findIndex((o) => o.type === "hoverPart" && o.participant === e), s = r >= 0 ? t.length - r : r;
    return { start: n, endExclusive: s + 1 };
  }
  get domNode() {
    return this._fragment;
  }
  get domNodeHasChildren() {
    return this._fragment.hasChildNodes();
  }
  get focusedHoverPartIndex() {
    return this._focusedHoverPartIndex;
  }
  get hoverPartsCount() {
    return this._renderedParts.length;
  }
}, woe = pL, pL._DECORATION_OPTIONS = dn.register({
  description: "content-hover-highlight",
  className: "hoverHighlight"
}), pL);
Eoe = woe = L6e([
  Sz(4, Fi),
  Sz(5, od)
], Eoe);
var TSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ite = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let xoe = class extends ge {
  constructor(e, t, n, r) {
    super(), this._editor = e, this._instantiationService = t, this._keybindingService = n, this._hoverService = r, this._currentResult = null, this._renderedContentHover = this._register(new er()), this._onContentsChanged = this._register(new he()), this.onContentsChanged = this._onContentsChanged.event, this._contentHoverWidget = this._register(this._instantiationService.createInstance(Jse, this._editor)), this._participants = this._initializeHoverParticipants(), this._hoverOperation = this._register(new wBe(this._editor, new rz(this._editor, this._participants))), this._registerListeners();
  }
  _initializeHoverParticipants() {
    const e = [];
    for (const t of nk.getAll()) {
      const n = this._instantiationService.createInstance(t, this._editor);
      e.push(n);
    }
    return e.sort((t, n) => t.hoverOrdinal - n.hoverOrdinal), this._register(this._contentHoverWidget.onDidResize(() => {
      this._participants.forEach((t) => {
        var n;
        return (n = t.handleResize) == null ? void 0 : n.call(t);
      });
    })), this._register(this._contentHoverWidget.onDidScroll((t) => {
      this._participants.forEach((n) => {
        var r;
        return (r = n.handleScroll) == null ? void 0 : r.call(n, t);
      });
    })), this._register(this._contentHoverWidget.onContentsChanged(() => {
      this._participants.forEach((t) => {
        var n;
        return (n = t.handleContentsChanged) == null ? void 0 : n.call(t);
      });
    })), e;
  }
  _registerListeners() {
    this._register(this._hoverOperation.onResult((t) => {
      const n = t.hasLoadingMessage ? this._addLoadingMessage(t) : t.value;
      this._withResult(new LBe(n, t.isComplete, t.options));
    }));
    const e = this._contentHoverWidget.getDomNode();
    this._register(vo(e, "keydown", (t) => {
      t.equals(
        9
        /* KeyCode.Escape */
      ) && this.hide();
    })), this._register(vo(e, "mouseleave", (t) => {
      this._onMouseLeave(t);
    })), this._register(Ys.onDidChange(() => {
      this._contentHoverWidget.position && this._currentResult && this._setCurrentResult(this._currentResult);
    })), this._register(this._contentHoverWidget.onContentsChanged(() => {
      this._onContentsChanged.fire();
    }));
  }
  /**
   * Returns true if the hover shows now or will show.
   */
  _startShowingOrUpdateHover(e, t, n, r, s) {
    if (!(this._contentHoverWidget.position && this._currentResult))
      return e ? (this._startHoverOperationIfNecessary(e, t, n, r, !1), !0) : !1;
    const a = this._editor.getOption(
      69
      /* EditorOption.hover */
    ).sticky, l = s && this._contentHoverWidget.isMouseGettingCloser(s.event.posx, s.event.posy);
    return a && l ? (e && this._startHoverOperationIfNecessary(e, t, n, r, !0), !0) : e ? this._currentResult && this._currentResult.options.anchor.equals(e) ? !0 : this._currentResult && e.canAdoptVisibleHover(this._currentResult.options.anchor, this._contentHoverWidget.position) ? (this._currentResult && this._setCurrentResult(this._currentResult.filter(e)), this._startHoverOperationIfNecessary(e, t, n, r, !1), !0) : (this._setCurrentResult(null), this._startHoverOperationIfNecessary(e, t, n, r, !1), !0) : (this._setCurrentResult(null), !1);
  }
  _startHoverOperationIfNecessary(e, t, n, r, s) {
    if (this._hoverOperation.options && this._hoverOperation.options.anchor.equals(e))
      return;
    this._hoverOperation.cancel();
    const a = {
      anchor: e,
      source: n,
      shouldFocus: r,
      insistOnKeepingHoverVisible: s
    };
    this._hoverOperation.start(t, a);
  }
  _setCurrentResult(e) {
    let t = e;
    if (this._currentResult === t)
      return;
    t && t.hoverParts.length === 0 && (t = null), this._currentResult = t, this._currentResult ? this._showHover(this._currentResult) : this._hideHover();
  }
  _addLoadingMessage(e) {
    for (const t of this._participants) {
      if (!t.createLoadingMessage)
        continue;
      const n = t.createLoadingMessage(e.options.anchor);
      if (n)
        return e.value.slice(0).concat([n]);
    }
    return e.value;
  }
  _withResult(e) {
    if (this._contentHoverWidget.position && this._currentResult && this._currentResult.isComplete || this._setCurrentResult(e), !e.isComplete)
      return;
    const r = e.hoverParts.length === 0, s = e.options.insistOnKeepingHoverVisible;
    r && s || this._setCurrentResult(e);
  }
  _showHover(e) {
    const t = this._getHoverContext();
    this._renderedContentHover.value = new Soe(this._editor, e, this._participants, t, this._keybindingService, this._hoverService), this._renderedContentHover.value.domNodeHasChildren ? this._contentHoverWidget.show(this._renderedContentHover.value) : this._renderedContentHover.clear();
  }
  _hideHover() {
    this._contentHoverWidget.hide(), this._participants.forEach((e) => {
      var t;
      return (t = e.handleHide) == null ? void 0 : t.call(e);
    });
  }
  _getHoverContext() {
    return { hide: () => {
      this.hide();
    }, onContentsChanged: () => {
      this._contentHoverWidget.handleContentsChanged();
    }, setMinimumDimensions: (s) => {
      this._contentHoverWidget.setMinimumDimensions(s);
    }, focus: () => this.focus() };
  }
  showsOrWillShow(e) {
    if (this._contentHoverWidget.isResizing)
      return !0;
    const n = this._findHoverAnchorCandidates(e);
    if (!(n.length > 0))
      return this._startShowingOrUpdateHover(null, 0, 0, !1, e);
    const s = n[0];
    return this._startShowingOrUpdateHover(s, 0, 0, !1, e);
  }
  _findHoverAnchorCandidates(e) {
    const t = [];
    for (const r of this._participants) {
      if (!r.suggestHoverAnchor)
        continue;
      const s = r.suggestHoverAnchor(e);
      s && t.push(s);
    }
    const n = e.target;
    switch (n.type) {
      case 6: {
        t.push(new Kee(0, n.range, e.event.posx, e.event.posy));
        break;
      }
      case 7: {
        const r = this._editor.getOption(
          59
          /* EditorOption.fontInfo */
        ).typicalHalfwidthCharacterWidth / 2;
        if (!(!n.detail.isAfterLines && typeof n.detail.horizontalDistanceToText == "number" && n.detail.horizontalDistanceToText < r))
          break;
        t.push(new Kee(0, n.range, e.event.posx, e.event.posy));
        break;
      }
    }
    return t.sort((r, s) => s.priority - r.priority), t;
  }
  _onMouseLeave(e) {
    const t = this._editor.getDomNode();
    (!t || !CK(t, e.x, e.y)) && this.hide();
  }
  startShowingAtRange(e, t, n, r) {
    this._startShowingOrUpdateHover(new Kee(0, e, void 0, void 0), t, n, r, null);
  }
  async updateHoverVerbosityLevel(e, t, n) {
    var r;
    (r = this._renderedContentHover.value) == null || r.updateHoverVerbosityLevel(e, t, n);
  }
  focusedHoverPartIndex() {
    var e;
    return ((e = this._renderedContentHover.value) == null ? void 0 : e.focusedHoverPartIndex) ?? -1;
  }
  containsNode(e) {
    return e ? this._contentHoverWidget.getDomNode().contains(e) : !1;
  }
  focus() {
    var t;
    if (((t = this._renderedContentHover.value) == null ? void 0 : t.hoverPartsCount) === 1) {
      this.focusHoverPartWithIndex(0);
      return;
    }
    this._contentHoverWidget.focus();
  }
  focusHoverPartWithIndex(e) {
    var t;
    (t = this._renderedContentHover.value) == null || t.focusHoverPartWithIndex(e);
  }
  scrollUp() {
    this._contentHoverWidget.scrollUp();
  }
  scrollDown() {
    this._contentHoverWidget.scrollDown();
  }
  scrollLeft() {
    this._contentHoverWidget.scrollLeft();
  }
  scrollRight() {
    this._contentHoverWidget.scrollRight();
  }
  pageUp() {
    this._contentHoverWidget.pageUp();
  }
  pageDown() {
    this._contentHoverWidget.pageDown();
  }
  goToTop() {
    this._contentHoverWidget.goToTop();
  }
  goToBottom() {
    this._contentHoverWidget.goToBottom();
  }
  hide() {
    this._hoverOperation.cancel(), this._setCurrentResult(null);
  }
  getDomNode() {
    return this._contentHoverWidget.getDomNode();
  }
  get isColorPickerVisible() {
    var e;
    return ((e = this._renderedContentHover.value) == null ? void 0 : e.isColorPickerVisible()) ?? !1;
  }
  get isVisibleFromKeyboard() {
    return this._contentHoverWidget.isVisibleFromKeyboard;
  }
  get isVisible() {
    return this._contentHoverWidget.isVisible;
  }
  get isFocused() {
    return this._contentHoverWidget.isFocused;
  }
  get isResizing() {
    return this._contentHoverWidget.isResizing;
  }
  get widget() {
    return this._contentHoverWidget;
  }
};
xoe = TSt([
  ite(1, xt),
  ite(2, Fi),
  ite(3, od)
], xoe);
function T6e(i) {
  var t;
  const e = i.target;
  return !!e && e.type === 6 && ((t = e.detail.injectedText) == null ? void 0 : t.options.attachedData) === _Be;
}
var kSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, rte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Loe, mL;
let nc = (mL = class extends ge {
  constructor(e, t, n, r) {
    super(), this._editor = e, this._instantiationService = n, this._keybindingService = r, this._onHoverContentsChanged = this._register(new he()), this.shouldKeepOpenOnEditorMouseMoveOrLeave = !1, this._listenersStore = new ke(), this._isMouseDown = !1, this._ignoreMouseEvents = !1, this._reactToEditorMouseMoveRunner = this._register(new mr(() => {
      this._mouseMoveEvent && this._reactToEditorMouseMove(this._mouseMoveEvent);
    }, 0)), this._register(t.onDidShowContextMenu(() => {
      this.hideContentHover(), this._ignoreMouseEvents = !0;
    })), this._register(t.onDidHideContextMenu(() => {
      this._ignoreMouseEvents = !1;
    })), this._hookListeners(), this._register(this._editor.onDidChangeConfiguration((s) => {
      s.hasChanged(
        69
        /* EditorOption.hover */
      ) && (this._unhookListeners(), this._hookListeners());
    }));
  }
  static get(e) {
    return e.getContribution(Loe.ID);
  }
  _hookListeners() {
    const e = this._editor.getOption(
      69
      /* EditorOption.hover */
    );
    this._hoverSettings = {
      enabled: e.enabled,
      sticky: e.sticky,
      hidingDelay: e.hidingDelay
    }, e.enabled || this._cancelSchedulerAndHide(), this._listenersStore.add(this._editor.onMouseDown((t) => this._onEditorMouseDown(t))), this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())), this._listenersStore.add(this._editor.onMouseMove((t) => this._onEditorMouseMove(t))), this._listenersStore.add(this._editor.onKeyDown((t) => this._onKeyDown(t))), this._listenersStore.add(this._editor.onMouseLeave((t) => this._onEditorMouseLeave(t))), this._listenersStore.add(this._editor.onDidChangeModel(() => this._cancelSchedulerAndHide())), this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())), this._listenersStore.add(this._editor.onDidScrollChange((t) => this._onEditorScrollChanged(t)));
  }
  _unhookListeners() {
    this._listenersStore.clear();
  }
  _cancelSchedulerAndHide() {
    this._cancelScheduler(), this.hideContentHover();
  }
  _cancelScheduler() {
    this._mouseMoveEvent = void 0, this._reactToEditorMouseMoveRunner.cancel();
  }
  _onEditorScrollChanged(e) {
    this._ignoreMouseEvents || (e.scrollTopChanged || e.scrollLeftChanged) && this.hideContentHover();
  }
  _onEditorMouseDown(e) {
    this._ignoreMouseEvents || (this._isMouseDown = !0, this._shouldKeepHoverWidgetVisible(e)) || this.hideContentHover();
  }
  _shouldKeepHoverWidgetVisible(e) {
    return this._isMouseOnContentHoverWidget(e) || this._isContentWidgetResizing() || T6e(e);
  }
  _isMouseOnContentHoverWidget(e) {
    return this._contentWidget ? CK(this._contentWidget.getDomNode(), e.event.posx, e.event.posy) : !1;
  }
  _onEditorMouseUp() {
    this._ignoreMouseEvents || (this._isMouseDown = !1);
  }
  _onEditorMouseLeave(e) {
    this._ignoreMouseEvents || this.shouldKeepOpenOnEditorMouseMoveOrLeave || (this._cancelScheduler(), this._shouldKeepHoverWidgetVisible(e)) || this.hideContentHover();
  }
  _shouldKeepCurrentHover(e) {
    const t = this._contentWidget;
    if (!t)
      return !1;
    const n = this._hoverSettings.sticky, r = (u, d) => {
      const h = this._isMouseOnContentHoverWidget(u);
      return d && h;
    }, s = (u) => {
      const d = t.isColorPickerVisible, h = this._isMouseOnContentHoverWidget(u), g = d && h, m = d && this._isMouseDown;
      return g || m;
    }, o = (u, d) => {
      var g;
      const h = u.event.browserEvent.view;
      return h ? d && t.containsNode(h.document.activeElement) && !((g = h.getSelection()) != null && g.isCollapsed) : !1;
    }, a = t.isFocused, l = t.isResizing, c = this._hoverSettings.sticky && t.isVisibleFromKeyboard;
    return this.shouldKeepOpenOnEditorMouseMoveOrLeave || a || l || c || r(e, n) || s(e) || o(e, n);
  }
  _onEditorMouseMove(e) {
    if (this._ignoreMouseEvents)
      return;
    if (this._mouseMoveEvent = e, this._shouldKeepCurrentHover(e)) {
      this._reactToEditorMouseMoveRunner.cancel();
      return;
    }
    if (this._shouldRescheduleHoverComputation()) {
      this._reactToEditorMouseMoveRunner.isScheduled() || this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);
      return;
    }
    this._reactToEditorMouseMove(e);
  }
  _shouldRescheduleHoverComputation() {
    var n;
    const e = this._hoverSettings.hidingDelay;
    return (((n = this._contentWidget) == null ? void 0 : n.isVisible) ?? !1) && this._hoverSettings.sticky && e > 0;
  }
  _reactToEditorMouseMove(e) {
    this._hoverSettings.enabled && this._getOrCreateContentWidget().showsOrWillShow(e) || this.hideContentHover();
  }
  _onKeyDown(e) {
    if (this._ignoreMouseEvents || !this._contentWidget)
      return;
    const t = this._isPotentialKeyboardShortcut(e), n = this._isModifierKeyPressed(e);
    t || n || this._contentWidget.isFocused && e.keyCode === 2 || this.hideContentHover();
  }
  _isPotentialKeyboardShortcut(e) {
    if (!this._editor.hasModel() || !this._contentWidget)
      return !1;
    const t = this._keybindingService.softDispatch(e, this._editor.getDomNode()), n = t.kind === 1, r = t.kind === 2 && (t.commandId === bBe || t.commandId === vK || t.commandId === yK) && this._contentWidget.isVisible;
    return n || r;
  }
  _isModifierKeyPressed(e) {
    return e.keyCode === 5 || e.keyCode === 6 || e.keyCode === 57 || e.keyCode === 4;
  }
  hideContentHover() {
    var e;
    hA.dropDownVisible || (e = this._contentWidget) == null || e.hide();
  }
  _getOrCreateContentWidget() {
    return this._contentWidget || (this._contentWidget = this._instantiationService.createInstance(xoe, this._editor), this._listenersStore.add(this._contentWidget.onContentsChanged(() => this._onHoverContentsChanged.fire()))), this._contentWidget;
  }
  showContentHover(e, t, n, r) {
    this._getOrCreateContentWidget().startShowingAtRange(e, t, n, r);
  }
  _isContentWidgetResizing() {
    var e;
    return ((e = this._contentWidget) == null ? void 0 : e.widget.isResizing) || !1;
  }
  focusedHoverPartIndex() {
    return this._getOrCreateContentWidget().focusedHoverPartIndex();
  }
  updateHoverVerbosityLevel(e, t, n) {
    this._getOrCreateContentWidget().updateHoverVerbosityLevel(e, t, n);
  }
  focus() {
    var e;
    (e = this._contentWidget) == null || e.focus();
  }
  scrollUp() {
    var e;
    (e = this._contentWidget) == null || e.scrollUp();
  }
  scrollDown() {
    var e;
    (e = this._contentWidget) == null || e.scrollDown();
  }
  scrollLeft() {
    var e;
    (e = this._contentWidget) == null || e.scrollLeft();
  }
  scrollRight() {
    var e;
    (e = this._contentWidget) == null || e.scrollRight();
  }
  pageUp() {
    var e;
    (e = this._contentWidget) == null || e.pageUp();
  }
  pageDown() {
    var e;
    (e = this._contentWidget) == null || e.pageDown();
  }
  goToTop() {
    var e;
    (e = this._contentWidget) == null || e.goToTop();
  }
  goToBottom() {
    var e;
    (e = this._contentWidget) == null || e.goToBottom();
  }
  get isColorPickerVisible() {
    var e;
    return (e = this._contentWidget) == null ? void 0 : e.isColorPickerVisible;
  }
  get isHoverVisible() {
    var e;
    return (e = this._contentWidget) == null ? void 0 : e.isVisible;
  }
  dispose() {
    var e;
    super.dispose(), this._unhookListeners(), this._listenersStore.dispose(), (e = this._contentWidget) == null || e.dispose();
  }
}, Loe = mL, mL.ID = "editor.contrib.contentHover", mL);
nc = Loe = kSt([
  rte(1, Qh),
  rte(2, xt),
  rte(3, Fi)
], nc);
const QCe = class QCe extends ge {
  // ms
  constructor(e) {
    super(), this._editor = e, this._register(e.onMouseDown((t) => this.onMouseDown(t)));
  }
  dispose() {
    super.dispose();
  }
  onMouseDown(e) {
    const t = this._editor.getOption(
      168
      /* EditorOption.colorDecoratorsActivatedOn */
    );
    if (t !== "click" && t !== "clickAndHover" || !T6e(e))
      return;
    const n = this._editor.getContribution(nc.ID);
    if (!n || n.isColorPickerVisible)
      return;
    const r = e.target.range;
    if (!r)
      return;
    const s = new z(r.startLineNumber, r.startColumn + 1, r.endLineNumber, r.endColumn + 1);
    n.showContentHover(s, 1, 1, !1);
  }
};
QCe.ID = "editor.contrib.colorContribution";
let Ez = QCe;
var DSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ISt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class wpe {
  constructor(e, t, n, r) {
    this.owner = e, this.range = t, this.model = n, this.provider = r;
  }
  static fromBaseColor(e, t) {
    return new wpe(e, t.range, t.model, t.provider);
  }
}
class NSt extends ge {
  constructor(e, t, n, r) {
    super();
    const s = e.getModel(), o = n.model;
    this.color = n.model.color, this.colorPicker = this._register(new NBe(
      t.fragment,
      o,
      e.getOption(
        163
        /* EditorOption.pixelRatio */
      ),
      r,
      "standalone"
      /* ColorPickerWidgetType.Standalone */
    )), this._register(o.onColorFlushed((a) => {
      this.color = a;
    })), this._register(o.onDidChangeColor((a) => {
      i5(s, o, a, n.range, n);
    })), this._register(e.onDidChangeModelContent((a) => {
      t.hide(), e.focus();
    })), i5(s, o, this.color, n.range, n);
  }
}
let Toe = class {
  constructor(e, t) {
    this._editor = e, this._themeService = t;
  }
  async createColorHover(e, t, n) {
    if (!this._editor.hasModel() || !dA.get(this._editor))
      return null;
    const s = await gBe(n, this._editor.getModel(), $n.None);
    let o = null, a = null;
    for (const h of s) {
      const g = h.colorInfo;
      z.containsRange(g.range, e.range) && (o = g, a = h.provider);
    }
    const l = o ?? e, c = a ?? t, u = !!o;
    return { colorHover: wpe.fromBaseColor(this, await RBe(this._editor.getModel(), l, c)), foundInEditor: u };
  }
  async updateEditorModel(e) {
    if (!this._editor.hasModel())
      return;
    const t = e.model;
    let n = new z(e.range.startLineNumber, e.range.startColumn, e.range.endLineNumber, e.range.endColumn);
    this._color && (await i5(this._editor.getModel(), t, this._color, n, e), n = ABe(this._editor, n, t));
  }
  renderHoverParts(e, t) {
    if (!(t.length === 0 || !this._editor.hasModel()))
      return this._setMinimumDimensions(e), this._renderedParts = new NSt(this._editor, e, t[0], this._themeService), this._renderedParts;
  }
  _setMinimumDimensions(e) {
    const t = this._editor.getOption(
      75
      /* EditorOption.lineHeight */
    ) + 8;
    e.setMinimumDimensions(new Ji(302, t));
  }
  get _color() {
    var e;
    return (e = this._renderedParts) == null ? void 0 : e.color;
  }
};
Toe = DSt([
  ISt(1, to)
], Toe);
var RSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, oP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, koe;
class ASt {
  // The color picker result consists of: an array of color results and a boolean indicating if the color was found in the editor
  constructor(e, t) {
    this.value = e, this.foundInEditor = t;
  }
}
const jDe = 8, OSt = 22;
var _L;
let Doe = (_L = class extends ge {
  constructor(e, t, n, r, s, o, a, l) {
    var h;
    super(), this._editor = e, this._standaloneColorPickerVisible = t, this._standaloneColorPickerFocused = n, this._keybindingService = s, this._languageFeaturesService = o, this._editorWorkerService = a, this._hoverService = l, this.allowEditorOverflow = !0, this._position = void 0, this._body = document.createElement("div"), this._colorHover = null, this._selectionSetInEditor = !1, this._onResult = this._register(new he()), this.onResult = this._onResult.event, this._renderedHoverParts = this._register(new er()), this._renderedStatusBar = this._register(new er()), this._standaloneColorPickerVisible.set(!0), this._standaloneColorPickerParticipant = r.createInstance(Toe, this._editor), this._position = (h = this._editor._getViewModel()) == null ? void 0 : h.getPrimaryCursorState().modelState.position;
    const c = this._editor.getSelection(), u = c ? {
      startLineNumber: c.startLineNumber,
      startColumn: c.startColumn,
      endLineNumber: c.endLineNumber,
      endColumn: c.endColumn
    } : { startLineNumber: 0, endLineNumber: 0, endColumn: 0, startColumn: 0 }, d = this._register(qf(this._body));
    this._register(d.onDidBlur((g) => {
      this.hide();
    })), this._register(d.onDidFocus((g) => {
      this.focus();
    })), this._register(this._editor.onDidChangeCursorPosition(() => {
      this._selectionSetInEditor ? this._selectionSetInEditor = !1 : this.hide();
    })), this._register(this._editor.onMouseMove((g) => {
      var _;
      const m = (_ = g.target.element) == null ? void 0 : _.classList;
      m && m.contains("colorpicker-color-decoration") && this.hide();
    })), this._register(this.onResult((g) => {
      this._render(g.value, g.foundInEditor);
    })), this._start(u), this._body.style.zIndex = "50", this._editor.addContentWidget(this);
  }
  updateEditor() {
    this._colorHover && this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover);
  }
  getId() {
    return koe.ID;
  }
  getDomNode() {
    return this._body;
  }
  getPosition() {
    if (!this._position)
      return null;
    const e = this._editor.getOption(
      69
      /* EditorOption.hover */
    ).above;
    return {
      position: this._position,
      secondaryPosition: this._position,
      preference: e ? [
        1,
        2
        /* ContentWidgetPositionPreference.BELOW */
      ] : [
        2,
        1
        /* ContentWidgetPositionPreference.ABOVE */
      ],
      positionAffinity: 2
      /* PositionAffinity.None */
    };
  }
  hide() {
    this.dispose(), this._standaloneColorPickerVisible.set(!1), this._standaloneColorPickerFocused.set(!1), this._editor.removeContentWidget(this), this._editor.focus();
  }
  focus() {
    this._standaloneColorPickerFocused.set(!0), this._body.focus();
  }
  async _start(e) {
    const t = await this._computeAsync(e);
    t && this._onResult.fire(new ASt(t.result, t.foundInEditor));
  }
  async _computeAsync(e) {
    if (!this._editor.hasModel())
      return null;
    const t = {
      range: e,
      color: { red: 0, green: 0, blue: 0, alpha: 1 }
    }, n = await this._standaloneColorPickerParticipant.createColorHover(t, new e5(this._editorWorkerService), this._languageFeaturesService.colorProvider);
    return n ? { result: n.colorHover, foundInEditor: n.foundInEditor } : null;
  }
  _render(e, t) {
    const n = document.createDocumentFragment();
    this._renderedStatusBar.value = this._register(new sz(this._keybindingService, this._hoverService));
    const r = {
      fragment: n,
      statusBar: this._renderedStatusBar.value,
      onContentsChanged: () => {
      },
      setMinimumDimensions: () => {
      },
      hide: () => this.hide(),
      focus: () => this.focus()
    };
    if (this._colorHover = e, this._renderedHoverParts.value = this._standaloneColorPickerParticipant.renderHoverParts(r, [e]), !this._renderedHoverParts.value) {
      this._renderedStatusBar.clear(), this._renderedHoverParts.clear();
      return;
    }
    const s = this._renderedHoverParts.value.colorPicker;
    this._body.classList.add("standalone-colorpicker-body"), this._body.style.maxHeight = Math.max(this._editor.getLayoutInfo().height / 4, 250) + "px", this._body.style.maxWidth = Math.max(this._editor.getLayoutInfo().width * 0.66, 500) + "px", this._body.tabIndex = 0, this._body.appendChild(n), s.layout();
    const o = s.body, a = o.saturationBox.domNode.clientWidth, l = o.domNode.clientWidth - a - OSt - jDe, c = s.body.enterButton;
    c == null || c.onClicked(() => {
      this.updateEditor(), this.hide();
    });
    const u = s.header, d = u.pickedColorNode;
    d.style.width = a + jDe + "px";
    const h = u.originalColorNode;
    h.style.width = l + "px";
    const g = s.header.closeButton;
    g == null || g.onClicked(() => {
      this.hide();
    }), t && (c && (c.button.textContent = "Replace"), this._selectionSetInEditor = !0, this._editor.setSelection(e.range)), this._editor.layoutContentWidget(this);
  }
}, koe = _L, _L.ID = "editor.contrib.standaloneColorPickerWidget", _L);
Doe = koe = RSt([
  oP(3, xt),
  oP(4, Fi),
  oP(5, St),
  oP(6, sd),
  oP(7, od)
], Doe);
var MSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, GDe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Ioe, bL;
let kT = (bL = class extends ge {
  constructor(e, t, n) {
    super(), this._editor = e, this._instantiationService = n, this._standaloneColorPickerWidget = null, this._standaloneColorPickerVisible = se.standaloneColorPickerVisible.bindTo(t), this._standaloneColorPickerFocused = se.standaloneColorPickerFocused.bindTo(t);
  }
  showOrFocus() {
    var e;
    this._editor.hasModel() && (this._standaloneColorPickerVisible.get() ? this._standaloneColorPickerFocused.get() || (e = this._standaloneColorPickerWidget) == null || e.focus() : this._standaloneColorPickerWidget = this._instantiationService.createInstance(Doe, this._editor, this._standaloneColorPickerVisible, this._standaloneColorPickerFocused));
  }
  hide() {
    var e;
    this._standaloneColorPickerFocused.set(!1), this._standaloneColorPickerVisible.set(!1), (e = this._standaloneColorPickerWidget) == null || e.hide(), this._editor.focus();
  }
  insertColor() {
    var e;
    (e = this._standaloneColorPickerWidget) == null || e.updateEditor(), this.hide();
  }
  static get(e) {
    return e.getContribution(Ioe.ID);
  }
}, Ioe = bL, bL.ID = "editor.contrib.standaloneColorPickerController", bL);
kT = Ioe = MSt([
  GDe(1, Jt),
  GDe(2, xt)
], kT);
class PSt extends Qg {
  constructor() {
    super({
      id: "editor.action.showOrFocusStandaloneColorPicker",
      title: {
        ...Ee(884, "Show or Focus Standalone Color Picker"),
        mnemonicTitle: S(883, "&&Show or Focus Standalone Color Picker")
      },
      precondition: void 0,
      menu: [
        { id: wt.CommandPalette }
      ],
      metadata: {
        description: Ee(885, "Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")
      }
    });
  }
  runEditorCommand(e, t) {
    var n;
    (n = kT.get(t)) == null || n.showOrFocus();
  }
}
class FSt extends vt {
  constructor() {
    super({
      id: "editor.action.hideColorPicker",
      label: Ee(886, "Hide the Color Picker"),
      precondition: se.standaloneColorPickerVisible.isEqualTo(!0),
      kbOpts: {
        primary: 9,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(887, "Hide the standalone color picker.")
      }
    });
  }
  run(e, t) {
    var n;
    (n = kT.get(t)) == null || n.hide();
  }
}
class BSt extends vt {
  constructor() {
    super({
      id: "editor.action.insertColorWithStandaloneColorPicker",
      label: Ee(888, "Insert Color with Standalone Color Picker"),
      precondition: se.standaloneColorPickerFocused.isEqualTo(!0),
      kbOpts: {
        primary: 3,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(889, "Insert hex/rgb/hsl colors with the focused standalone color picker.")
      }
    });
  }
  run(e, t) {
    var n;
    (n = kT.get(t)) == null || n.insertColor();
  }
}
Je(FSt);
Je(BSt);
ar(PSt);
Si(
  Ez.ID,
  Ez,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Si(
  kT.ID,
  kT,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
Si(
  dA.ID,
  dA,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
u2(Kse);
nk.register(az);
_i.registerCommand("_executeDocumentColorProvider", function(i, ...e) {
  const [t] = e;
  if (!(t instanceof Ht))
    throw Bf();
  const { model: n, colorProviderRegistry: r, defaultColorDecoratorsEnablement: s } = mBe(i, t);
  return qge(new UCt(), r, n, $n.None, s);
});
_i.registerCommand("_executeColorPresentationProvider", function(i, ...e) {
  const [t, n] = e, { uri: r, range: s } = n;
  if (!(r instanceof Ht) || !Array.isArray(t) || t.length !== 4 || !z.isIRange(s))
    throw Bf();
  const { model: o, colorProviderRegistry: a, defaultColorDecoratorsEnablement: l } = mBe(i, r), [c, u, d, h] = t;
  return qge(new zCt({ range: s, color: { red: c, green: u, blue: d, alpha: h } }), a, o, $n.None, l);
});
class m1 {
  constructor(e, t, n) {
    this.languageConfigurationService = n, this._selection = e, this._insertSpace = t, this._usedEndToken = null;
  }
  static _haystackHasNeedleAtOffset(e, t, n) {
    if (n < 0)
      return !1;
    const r = t.length, s = e.length;
    if (n + r > s)
      return !1;
    for (let o = 0; o < r; o++) {
      const a = e.charCodeAt(n + o), l = t.charCodeAt(o);
      if (a !== l && !(a >= 65 && a <= 90 && a + 32 === l) && !(l >= 65 && l <= 90 && l + 32 === a))
        return !1;
    }
    return !0;
  }
  _createOperationsForBlockComment(e, t, n, r, s, o) {
    const a = e.startLineNumber, l = e.startColumn, c = e.endLineNumber, u = e.endColumn, d = s.getLineContent(a), h = s.getLineContent(c);
    let g = d.lastIndexOf(t, l - 1 + t.length), m = h.indexOf(n, u - 1 - n.length);
    if (g !== -1 && m !== -1)
      if (a === c)
        d.substring(g + t.length, m).indexOf(n) >= 0 && (g = -1, m = -1);
      else {
        const v = d.substring(g + t.length), w = h.substring(0, m);
        (v.indexOf(n) >= 0 || w.indexOf(n) >= 0) && (g = -1, m = -1);
      }
    let _;
    g !== -1 && m !== -1 ? (r && g + t.length < d.length && d.charCodeAt(g + t.length) === 32 && (t = t + " "), r && m > 0 && h.charCodeAt(m - 1) === 32 && (n = " " + n, m -= 1), _ = m1._createRemoveBlockCommentOperations(new z(a, g + t.length + 1, c, m + 1), t, n)) : (_ = m1._createAddBlockCommentOperations(e, t, n, this._insertSpace), this._usedEndToken = _.length === 1 ? n : null);
    for (const v of _)
      o.addTrackedEditOperation(v.range, v.text);
  }
  static _createRemoveBlockCommentOperations(e, t, n) {
    const r = [];
    return z.isEmpty(e) ? r.push(Xs.delete(new z(e.startLineNumber, e.startColumn - t.length, e.endLineNumber, e.endColumn + n.length))) : (r.push(Xs.delete(new z(e.startLineNumber, e.startColumn - t.length, e.startLineNumber, e.startColumn))), r.push(Xs.delete(new z(e.endLineNumber, e.endColumn, e.endLineNumber, e.endColumn + n.length)))), r;
  }
  static _createAddBlockCommentOperations(e, t, n, r) {
    const s = [];
    return z.isEmpty(e) ? s.push(Xs.replace(new z(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn), t + "  " + n)) : (s.push(Xs.insert(new de(e.startLineNumber, e.startColumn), t + (r ? " " : ""))), s.push(Xs.insert(new de(e.endLineNumber, e.endColumn), (r ? " " : "") + n))), s;
  }
  getEditOperations(e, t) {
    const n = this._selection.startLineNumber, r = this._selection.startColumn;
    e.tokenization.tokenizeIfCheap(n);
    const s = e.getLanguageIdAtPosition(n, r), o = this.languageConfigurationService.getLanguageConfiguration(s).comments;
    !o || !o.blockCommentStartToken || !o.blockCommentEndToken || this._createOperationsForBlockComment(this._selection, o.blockCommentStartToken, o.blockCommentEndToken, this._insertSpace, e, t);
  }
  computeCursorState(e, t) {
    const n = t.getInverseEditOperations();
    if (n.length === 2) {
      const r = n[0], s = n[1];
      return new bt(r.range.endLineNumber, r.range.endColumn, s.range.startLineNumber, s.range.startColumn);
    } else {
      const r = n[0].range, s = this._usedEndToken ? -this._usedEndToken.length - 1 : 0;
      return new bt(r.endLineNumber, r.endColumn + s, r.endLineNumber, r.endColumn + s);
    }
  }
}
class Qv {
  constructor(e, t, n, r, s, o, a) {
    this.languageConfigurationService = e, this._selection = t, this._indentSize = n, this._type = r, this._insertSpace = s, this._selectionId = null, this._deltaColumn = 0, this._moveEndPositionDown = !1, this._ignoreEmptyLines = o, this._ignoreFirstLine = a || !1;
  }
  /**
   * Do an initial pass over the lines and gather info about the line comment string.
   * Returns null if any of the lines doesn't support a line comment string.
   */
  static _gatherPreflightCommentStrings(e, t, n, r) {
    e.tokenization.tokenizeIfCheap(t);
    const s = e.getLanguageIdAtPosition(t, 1), o = r.getLanguageConfiguration(s).comments, a = o ? o.lineCommentToken : null;
    if (!a)
      return null;
    const l = [];
    for (let c = 0, u = n - t + 1; c < u; c++)
      l[c] = {
        ignore: !1,
        commentStr: a,
        commentStrOffset: 0,
        commentStrLength: a.length
      };
    return l;
  }
  /**
   * Analyze lines and decide which lines are relevant and what the toggle should do.
   * Also, build up several offsets and lengths useful in the generation of editor operations.
   */
  static _analyzeLines(e, t, n, r, s, o, a, l, c) {
    let u = !0;
    const d = l.getLanguageConfiguration(c).comments, h = (d == null ? void 0 : d.lineCommentNoIndent) ?? !1;
    let g;
    e === 0 ? g = !0 : e === 1 ? g = !1 : g = !0;
    for (let m = 0, _ = r.length; m < _; m++) {
      const v = r[m], w = s + m;
      if (w === s && a) {
        v.ignore = !0;
        continue;
      }
      const E = n.getLineContent(w), L = Tc(E);
      if (L === -1) {
        v.ignore = o, v.commentStrOffset = h ? 0 : E.length;
        continue;
      }
      u = !1;
      const T = h ? 0 : L;
      if (v.ignore = !1, v.commentStrOffset = T, g && !m1._haystackHasNeedleAtOffset(E, v.commentStr, T) && (e === 0 ? g = !1 : e === 1 || (v.ignore = !0)), g && t) {
        const D = L + v.commentStrLength;
        D < E.length && E.charCodeAt(D) === 32 && (v.commentStrLength += 1);
      }
    }
    if (e === 0 && u) {
      g = !1;
      for (let m = 0, _ = r.length; m < _; m++)
        r[m].ignore = !1;
    }
    return {
      supported: !0,
      shouldRemoveComments: g,
      lines: r
    };
  }
  /**
   * Analyze all lines and decide exactly what to do => not supported | insert line comments | remove line comments
   */
  static _gatherPreflightData(e, t, n, r, s, o, a, l) {
    const c = Qv._gatherPreflightCommentStrings(n, r, s, l), u = n.getLanguageIdAtPosition(r, 1);
    return c === null ? {
      supported: !1
    } : Qv._analyzeLines(e, t, n, c, r, o, a, l, u);
  }
  /**
   * Given a successful analysis, execute either insert line comments, either remove line comments
   */
  _executeLineComments(e, t, n, r) {
    let s;
    n.shouldRemoveComments ? s = Qv._createRemoveLineCommentsOperations(n.lines, r.startLineNumber) : (Qv._normalizeInsertionPoint(e, n.lines, r.startLineNumber, this._indentSize), s = this._createAddLineCommentsOperations(n.lines, r.startLineNumber));
    const o = new de(r.positionLineNumber, r.positionColumn);
    for (let a = 0, l = s.length; a < l; a++)
      t.addEditOperation(s[a].range, s[a].text), z.isEmpty(s[a].range) && z.getStartPosition(s[a].range).equals(o) && e.getLineContent(o.lineNumber).length + 1 === o.column && (this._deltaColumn = (s[a].text || "").length);
    this._selectionId = t.trackSelection(r);
  }
  _attemptRemoveBlockComment(e, t, n, r) {
    let s = t.startLineNumber, o = t.endLineNumber;
    const a = r.length + Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber), t.startColumn);
    let l = e.getLineContent(s).lastIndexOf(n, a - 1), c = e.getLineContent(o).indexOf(r, t.endColumn - 1 - n.length);
    return l !== -1 && c === -1 && (c = e.getLineContent(s).indexOf(r, l + n.length), o = s), l === -1 && c !== -1 && (l = e.getLineContent(o).lastIndexOf(n, c), s = o), t.isEmpty() && (l === -1 || c === -1) && (l = e.getLineContent(s).indexOf(n), l !== -1 && (c = e.getLineContent(s).indexOf(r, l + n.length))), l !== -1 && e.getLineContent(s).charCodeAt(l + n.length) === 32 && (n += " "), c !== -1 && e.getLineContent(o).charCodeAt(c - 1) === 32 && (r = " " + r, c -= 1), l !== -1 && c !== -1 ? m1._createRemoveBlockCommentOperations(new z(s, l + n.length + 1, o, c + 1), n, r) : null;
  }
  /**
   * Given an unsuccessful analysis, delegate to the block comment command
   */
  _executeBlockComment(e, t, n) {
    e.tokenization.tokenizeIfCheap(n.startLineNumber);
    const r = e.getLanguageIdAtPosition(n.startLineNumber, 1), s = this.languageConfigurationService.getLanguageConfiguration(r).comments;
    if (!s || !s.blockCommentStartToken || !s.blockCommentEndToken)
      return;
    const o = s.blockCommentStartToken, a = s.blockCommentEndToken;
    let l = this._attemptRemoveBlockComment(e, n, o, a);
    if (!l) {
      if (n.isEmpty()) {
        const c = e.getLineContent(n.startLineNumber);
        let u = Tc(c);
        u === -1 && (u = c.length), l = m1._createAddBlockCommentOperations(new z(n.startLineNumber, u + 1, n.startLineNumber, c.length + 1), o, a, this._insertSpace);
      } else
        l = m1._createAddBlockCommentOperations(new z(n.startLineNumber, e.getLineFirstNonWhitespaceColumn(n.startLineNumber), n.endLineNumber, e.getLineMaxColumn(n.endLineNumber)), o, a, this._insertSpace);
      l.length === 1 && (this._deltaColumn = o.length + 1);
    }
    this._selectionId = t.trackSelection(n);
    for (const c of l)
      t.addEditOperation(c.range, c.text);
  }
  getEditOperations(e, t) {
    let n = this._selection;
    if (this._moveEndPositionDown = !1, n.startLineNumber === n.endLineNumber && this._ignoreFirstLine) {
      t.addEditOperation(new z(n.startLineNumber, e.getLineMaxColumn(n.startLineNumber), n.startLineNumber + 1, 1), n.startLineNumber === e.getLineCount() ? "" : `
`), this._selectionId = t.trackSelection(n);
      return;
    }
    n.startLineNumber < n.endLineNumber && n.endColumn === 1 && (this._moveEndPositionDown = !0, n = n.setEndPosition(n.endLineNumber - 1, e.getLineMaxColumn(n.endLineNumber - 1)));
    const r = Qv._gatherPreflightData(this._type, this._insertSpace, e, n.startLineNumber, n.endLineNumber, this._ignoreEmptyLines, this._ignoreFirstLine, this.languageConfigurationService);
    return r.supported ? this._executeLineComments(e, t, r, n) : this._executeBlockComment(e, t, n);
  }
  computeCursorState(e, t) {
    let n = t.getTrackedSelection(this._selectionId);
    return this._moveEndPositionDown && (n = n.setEndPosition(n.endLineNumber + 1, 1)), new bt(n.selectionStartLineNumber, n.selectionStartColumn + this._deltaColumn, n.positionLineNumber, n.positionColumn + this._deltaColumn);
  }
  /**
   * Generate edit operations in the remove line comment case
   */
  static _createRemoveLineCommentsOperations(e, t) {
    const n = [];
    for (let r = 0, s = e.length; r < s; r++) {
      const o = e[r];
      o.ignore || n.push(Xs.delete(new z(t + r, o.commentStrOffset + 1, t + r, o.commentStrOffset + o.commentStrLength + 1)));
    }
    return n;
  }
  /**
   * Generate edit operations in the add line comment case
   */
  _createAddLineCommentsOperations(e, t) {
    const n = [], r = this._insertSpace ? " " : "";
    for (let s = 0, o = e.length; s < o; s++) {
      const a = e[s];
      a.ignore || n.push(Xs.insert(new de(t + s, a.commentStrOffset + 1), a.commentStr + r));
    }
    return n;
  }
  static nextVisibleColumn(e, t, n, r) {
    return n ? e + (t - e % t) : e + r;
  }
  /**
   * Adjust insertion points to have them vertically aligned in the add line comment case
   */
  static _normalizeInsertionPoint(e, t, n, r) {
    let s = 1073741824, o, a;
    for (let l = 0, c = t.length; l < c; l++) {
      if (t[l].ignore)
        continue;
      const u = e.getLineContent(n + l);
      let d = 0;
      for (let h = 0, g = t[l].commentStrOffset; d < s && h < g; h++)
        d = Qv.nextVisibleColumn(d, r, u.charCodeAt(h) === 9, 1);
      d < s && (s = d);
    }
    s = Math.floor(s / r) * r;
    for (let l = 0, c = t.length; l < c; l++) {
      if (t[l].ignore)
        continue;
      const u = e.getLineContent(n + l);
      let d = 0;
      for (o = 0, a = t[l].commentStrOffset; d < s && o < a; o++)
        d = Qv.nextVisibleColumn(d, r, u.charCodeAt(o) === 9, 1);
      d > s ? t[l].commentStrOffset = o - 1 : t[l].commentStrOffset = o;
    }
  }
}
class Spe extends vt {
  constructor(e, t) {
    super(t), this._type = e;
  }
  run(e, t) {
    const n = e.get(Ls);
    if (!t.hasModel())
      return;
    const r = t.getModel(), s = [], o = r.getOptions(), a = t.getOption(
      29
      /* EditorOption.comments */
    ), l = t.getSelections().map((u, d) => ({ selection: u, index: d, ignoreFirstLine: !1 }));
    l.sort((u, d) => z.compareRangesUsingStarts(u.selection, d.selection));
    let c = l[0];
    for (let u = 1; u < l.length; u++) {
      const d = l[u];
      c.selection.endLineNumber === d.selection.startLineNumber && (c.index < d.index ? d.ignoreFirstLine = !0 : (c.ignoreFirstLine = !0, c = d));
    }
    for (const u of l)
      s.push(new Qv(n, u.selection, o.indentSize, this._type, a.insertSpace, a.ignoreEmptyLines, u.ignoreFirstLine));
    t.pushUndoStop(), t.executeCommands(this.id, s), t.pushUndoStop();
  }
}
class HSt extends Spe {
  constructor() {
    super(0, {
      id: "editor.action.commentLine",
      label: Ee(892, "Toggle Line Comment"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 2138,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarEditMenu,
        group: "5_insert",
        title: S(890, "&&Toggle Line Comment"),
        order: 1
      }
    });
  }
}
class WSt extends Spe {
  constructor() {
    super(1, {
      id: "editor.action.addCommentLine",
      label: Ee(893, "Add Line Comment"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2081
          /* KeyCode.KeyC */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class VSt extends Spe {
  constructor() {
    super(2, {
      id: "editor.action.removeCommentLine",
      label: Ee(894, "Remove Line Comment"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2099
          /* KeyCode.KeyU */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class USt extends vt {
  constructor() {
    super({
      id: "editor.action.blockComment",
      label: Ee(895, "Toggle Block Comment"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 1567,
        linux: {
          primary: 3103
          /* KeyCode.KeyA */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarEditMenu,
        group: "5_insert",
        title: S(891, "Toggle &&Block Comment"),
        order: 2
      }
    });
  }
  run(e, t) {
    const n = e.get(Ls);
    if (!t.hasModel())
      return;
    const r = t.getOption(
      29
      /* EditorOption.comments */
    ), s = [], o = t.getSelections();
    for (const a of o)
      s.push(new m1(a, r.insertSpace, n));
    t.pushUndoStop(), t.executeCommands(this.id, s), t.pushUndoStop();
  }
}
Je(HSt);
Je(WSt);
Je(VSt);
Je(USt);
var zSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, hE = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Noe, vL;
let c5 = (vL = class {
  static get(e) {
    return e.getContribution(Noe.ID);
  }
  constructor(e, t, n, r, s, o, a, l) {
    this._contextMenuService = t, this._contextViewService = n, this._contextKeyService = r, this._keybindingService = s, this._menuService = o, this._configurationService = a, this._workspaceContextService = l, this._toDispose = new ke(), this._contextMenuIsBeingShownCount = 0, this._editor = e, this._toDispose.add(this._editor.onContextMenu((c) => this._onContextMenu(c))), this._toDispose.add(this._editor.onMouseWheel((c) => {
      if (this._contextMenuIsBeingShownCount > 0) {
        const u = this._contextViewService.getContextViewElement(), d = c.srcElement;
        d.shadowRoot && iw(u) === d.shadowRoot || this._contextViewService.hideContextView();
      }
    })), this._toDispose.add(this._editor.onKeyDown((c) => {
      this._editor.getOption(
        30
        /* EditorOption.contextmenu */
      ) && c.keyCode === 58 && (c.preventDefault(), c.stopPropagation(), this.showContextMenu());
    }));
  }
  _onContextMenu(e) {
    if (!this._editor.hasModel())
      return;
    if (!this._editor.getOption(
      30
      /* EditorOption.contextmenu */
    )) {
      this._editor.focus(), e.target.position && !this._editor.getSelection().containsPosition(e.target.position) && this._editor.setPosition(e.target.position);
      return;
    }
    if (e.target.type === 12 || e.target.type === 6 && e.target.detail.injectedText)
      return;
    if (e.event.preventDefault(), e.event.stopPropagation(), e.target.type === 11)
      return this._showScrollbarContextMenu(e.event);
    if (e.target.type !== 6 && e.target.type !== 7 && e.target.type !== 1)
      return;
    if (this._editor.focus(), e.target.position) {
      let n = !1;
      for (const r of this._editor.getSelections())
        if (r.containsPosition(e.target.position)) {
          n = !0;
          break;
        }
      n || this._editor.setPosition(e.target.position);
    }
    let t = null;
    e.target.type !== 1 && (t = e.event), this.showContextMenu(t);
  }
  showContextMenu(e) {
    if (!this._editor.getOption(
      30
      /* EditorOption.contextmenu */
    ) || !this._editor.hasModel())
      return;
    const t = this._getMenuActions(this._editor.getModel(), this._editor.contextMenuId);
    t.length > 0 && this._doShowContextMenu(t, e);
  }
  _getMenuActions(e, t) {
    const n = [], r = this._menuService.getMenuActions(t, this._contextKeyService, { arg: e.uri });
    for (const s of r) {
      const [, o] = s;
      let a = 0;
      for (const l of o)
        if (l instanceof Mx) {
          const c = this._getMenuActions(e, l.item.submenu);
          c.length > 0 && (n.push(new qR(l.id, l.label, c)), a++);
        } else
          n.push(l), a++;
      a && n.push(new fa());
    }
    return n.length && n.pop(), n;
  }
  _doShowContextMenu(e, t = null) {
    if (!this._editor.hasModel())
      return;
    let n = t;
    if (!n) {
      this._editor.revealPosition(
        this._editor.getPosition(),
        1
        /* ScrollType.Immediate */
      ), this._editor.render();
      const s = this._editor.getScrolledVisiblePosition(this._editor.getPosition()), o = ho(this._editor.getDomNode()), a = o.left + s.left, l = o.top + s.top + s.height;
      n = { x: a, y: l };
    }
    const r = this._editor.getOption(
      144
      /* EditorOption.useShadowDOM */
    ) && !jf;
    this._contextMenuIsBeingShownCount++, this._contextMenuService.showContextMenu({
      domForShadowRoot: r ? this._editor.getOverflowWidgetsDomNode() ?? this._editor.getDomNode() : void 0,
      getAnchor: () => n,
      getActions: () => e,
      getActionViewItem: (s) => {
        const o = this._keybindingFor(s);
        if (o)
          return new lA(s, s, { label: !0, keybinding: o.getLabel(), isMenu: !0 });
        const a = s;
        return typeof a.getActionViewItem == "function" ? a.getActionViewItem() : new lA(s, s, { icon: !0, label: !0, isMenu: !0 });
      },
      getKeyBinding: (s) => this._keybindingFor(s),
      onHide: (s) => {
        this._contextMenuIsBeingShownCount--;
      }
    });
  }
  _showScrollbarContextMenu(e) {
    if (!this._editor.hasModel() || W0t(this._workspaceContextService.getWorkspace()))
      return;
    const t = this._editor.getOption(
      81
      /* EditorOption.minimap */
    );
    let n = 0;
    const r = (c) => ({
      id: `menu-action-${++n}`,
      label: c.label,
      tooltip: "",
      class: void 0,
      enabled: typeof c.enabled > "u" ? !0 : c.enabled,
      checked: c.checked,
      run: c.run
    }), s = (c, u) => new qR(`menu-action-${++n}`, c, u, void 0), o = (c, u, d, h, g) => {
      if (!u)
        return r({ label: c, enabled: u, run: () => {
        } });
      const m = (v) => () => {
        this._configurationService.updateValue(d, v);
      }, _ = [];
      for (const v of g)
        _.push(r({
          label: v.label,
          checked: h === v.value,
          run: m(v.value)
        }));
      return s(c, _);
    }, a = [];
    a.push(r({
      label: S(896, "Minimap"),
      checked: t.enabled,
      run: () => {
        this._configurationService.updateValue("editor.minimap.enabled", !t.enabled);
      }
    })), a.push(new fa()), a.push(r({
      label: S(897, "Render Characters"),
      enabled: t.enabled,
      checked: t.renderCharacters,
      run: () => {
        this._configurationService.updateValue("editor.minimap.renderCharacters", !t.renderCharacters);
      }
    })), a.push(o(S(898, "Vertical size"), t.enabled, "editor.minimap.size", t.size, [{
      label: S(899, "Proportional"),
      value: "proportional"
    }, {
      label: S(900, "Fill"),
      value: "fill"
    }, {
      label: S(901, "Fit"),
      value: "fit"
    }])), a.push(o(S(902, "Slider"), t.enabled, "editor.minimap.showSlider", t.showSlider, [{
      label: S(903, "Mouse Over"),
      value: "mouseover"
    }, {
      label: S(904, "Always"),
      value: "always"
    }]));
    const l = this._editor.getOption(
      144
      /* EditorOption.useShadowDOM */
    ) && !jf;
    this._contextMenuIsBeingShownCount++, this._contextMenuService.showContextMenu({
      domForShadowRoot: l ? this._editor.getDomNode() : void 0,
      getAnchor: () => e,
      getActions: () => a,
      onHide: (c) => {
        this._contextMenuIsBeingShownCount--, this._editor.focus();
      }
    });
  }
  _keybindingFor(e) {
    return this._keybindingService.lookupKeybinding(e.id);
  }
  dispose() {
    this._contextMenuIsBeingShownCount > 0 && this._contextViewService.hideContextView(), this._toDispose.dispose();
  }
}, Noe = vL, vL.ID = "editor.contrib.contextmenu", vL);
c5 = Noe = zSt([
  hE(1, Qh),
  hE(2, g0),
  hE(3, Jt),
  hE(4, Fi),
  hE(5, eg),
  hE(6, xn),
  hE(7, i0)
], c5);
class $St extends vt {
  constructor() {
    super({
      id: "editor.action.showContextMenu",
      label: Ee(905, "Show Editor Context Menu"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 1092,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    var n;
    (n = c5.get(t)) == null || n.showContextMenu();
  }
}
Si(
  c5.ID,
  c5,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Je($St);
class ste {
  constructor(e) {
    this.selections = e;
  }
  equals(e) {
    const t = this.selections.length, n = e.selections.length;
    if (t !== n)
      return !1;
    for (let r = 0; r < t; r++)
      if (!this.selections[r].equalsSelection(e.selections[r]))
        return !1;
    return !0;
  }
}
class ote {
  constructor(e, t, n) {
    this.cursorState = e, this.scrollTop = t, this.scrollLeft = n;
  }
}
const gG = class gG extends ge {
  static get(e) {
    return e.getContribution(gG.ID);
  }
  constructor(e) {
    super(), this._editor = e, this._isCursorUndoRedo = !1, this._undoStack = [], this._redoStack = [], this._register(e.onDidChangeModel((t) => {
      this._undoStack = [], this._redoStack = [];
    })), this._register(e.onDidChangeModelContent((t) => {
      this._undoStack = [], this._redoStack = [];
    })), this._register(e.onDidChangeCursorSelection((t) => {
      if (this._isCursorUndoRedo || !t.oldSelections || t.oldModelVersionId !== t.modelVersionId)
        return;
      const n = new ste(t.oldSelections);
      this._undoStack.length > 0 && this._undoStack[this._undoStack.length - 1].cursorState.equals(n) || (this._undoStack.push(new ote(n, e.getScrollTop(), e.getScrollLeft())), this._redoStack = [], this._undoStack.length > 50 && this._undoStack.shift());
    }));
  }
  cursorUndo() {
    !this._editor.hasModel() || this._undoStack.length === 0 || (this._redoStack.push(new ote(new ste(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())), this._applyState(this._undoStack.pop()));
  }
  cursorRedo() {
    !this._editor.hasModel() || this._redoStack.length === 0 || (this._undoStack.push(new ote(new ste(this._editor.getSelections()), this._editor.getScrollTop(), this._editor.getScrollLeft())), this._applyState(this._redoStack.pop()));
  }
  _applyState(e) {
    this._isCursorUndoRedo = !0, this._editor.setSelections(e.cursorState.selections), this._editor.setScrollPosition({
      scrollTop: e.scrollTop,
      scrollLeft: e.scrollLeft
    }), this._isCursorUndoRedo = !1;
  }
};
gG.ID = "editor.contrib.cursorUndoRedoController";
let pA = gG;
class jSt extends vt {
  constructor() {
    super({
      id: "cursorUndo",
      label: Ee(906, "Cursor Undo"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 2099,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t, n) {
    var r;
    (r = pA.get(t)) == null || r.cursorUndo();
  }
}
class GSt extends vt {
  constructor() {
    super({
      id: "cursorRedo",
      label: Ee(907, "Cursor Redo"),
      precondition: void 0
    });
  }
  run(e, t, n) {
    var r;
    (r = pA.get(t)) == null || r.cursorRedo();
  }
}
Si(
  pA.ID,
  pA,
  0
  /* EditorContributionInstantiation.Eager */
);
Je(jSt);
Je(GSt);
class qSt {
  constructor(e, t, n) {
    this.selection = e, this.targetPosition = t, this.copy = n, this.targetSelection = null;
  }
  getEditOperations(e, t) {
    const n = e.getValueInRange(this.selection);
    if (this.copy || t.addEditOperation(this.selection, null), t.addEditOperation(new z(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column), n), this.selection.containsPosition(this.targetPosition) && !(this.copy && (this.selection.getEndPosition().equals(this.targetPosition) || this.selection.getStartPosition().equals(this.targetPosition)))) {
      this.targetSelection = this.selection;
      return;
    }
    if (this.copy) {
      this.targetSelection = new bt(this.targetPosition.lineNumber, this.targetPosition.column, this.selection.endLineNumber - this.selection.startLineNumber + this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn);
      return;
    }
    if (this.targetPosition.lineNumber > this.selection.endLineNumber) {
      this.targetSelection = new bt(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn);
      return;
    }
    if (this.targetPosition.lineNumber < this.selection.endLineNumber) {
      this.targetSelection = new bt(this.targetPosition.lineNumber, this.targetPosition.column, this.targetPosition.lineNumber + this.selection.endLineNumber - this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column + this.selection.endColumn - this.selection.startColumn : this.selection.endColumn);
      return;
    }
    this.selection.endColumn <= this.targetPosition.column ? this.targetSelection = new bt(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column - this.selection.endColumn + this.selection.startColumn : this.targetPosition.column - this.selection.endColumn + this.selection.startColumn, this.targetPosition.lineNumber, this.selection.startLineNumber === this.selection.endLineNumber ? this.targetPosition.column : this.selection.endColumn) : this.targetSelection = new bt(this.targetPosition.lineNumber - this.selection.endLineNumber + this.selection.startLineNumber, this.targetPosition.column, this.targetPosition.lineNumber, this.targetPosition.column + this.selection.endColumn - this.selection.startColumn);
  }
  computeCursorState(e, t) {
    return this.targetSelection;
  }
}
function xI(i) {
  return Kn ? i.altKey : i.ctrlKey;
}
const jC = class jC extends ge {
  constructor(e) {
    super(), this._editor = e, this._dndDecorationIds = this._editor.createDecorationsCollection(), this._register(this._editor.onMouseDown((t) => this._onEditorMouseDown(t))), this._register(this._editor.onMouseUp((t) => this._onEditorMouseUp(t))), this._register(this._editor.onMouseDrag((t) => this._onEditorMouseDrag(t))), this._register(this._editor.onMouseDrop((t) => this._onEditorMouseDrop(t))), this._register(this._editor.onMouseDropCanceled(() => this._onEditorMouseDropCanceled())), this._register(this._editor.onKeyDown((t) => this.onEditorKeyDown(t))), this._register(this._editor.onKeyUp((t) => this.onEditorKeyUp(t))), this._register(this._editor.onDidBlurEditorWidget(() => this.onEditorBlur())), this._register(this._editor.onDidBlurEditorText(() => this.onEditorBlur())), this._mouseDown = !1, this._modifierPressed = !1, this._dragSelection = null;
  }
  onEditorBlur() {
    this._removeDecoration(), this._dragSelection = null, this._mouseDown = !1, this._modifierPressed = !1;
  }
  onEditorKeyDown(e) {
    !this._editor.getOption(
      42
      /* EditorOption.dragAndDrop */
    ) || this._editor.getOption(
      28
      /* EditorOption.columnSelection */
    ) || (xI(e) && (this._modifierPressed = !0), this._mouseDown && xI(e) && this._editor.updateOptions({
      mouseStyle: "copy"
    }));
  }
  onEditorKeyUp(e) {
    !this._editor.getOption(
      42
      /* EditorOption.dragAndDrop */
    ) || this._editor.getOption(
      28
      /* EditorOption.columnSelection */
    ) || (xI(e) && (this._modifierPressed = !1), this._mouseDown && e.keyCode === jC.TRIGGER_KEY_VALUE && this._editor.updateOptions({
      mouseStyle: "default"
    }));
  }
  _onEditorMouseDown(e) {
    this._mouseDown = !0;
  }
  _onEditorMouseUp(e) {
    this._mouseDown = !1, this._editor.updateOptions({
      mouseStyle: "text"
    });
  }
  _onEditorMouseDrag(e) {
    const t = e.target;
    if (this._dragSelection === null) {
      const r = (this._editor.getSelections() || []).filter((s) => t.position && s.containsPosition(t.position));
      if (r.length === 1)
        this._dragSelection = r[0];
      else
        return;
    }
    xI(e.event) ? this._editor.updateOptions({
      mouseStyle: "copy"
    }) : this._editor.updateOptions({
      mouseStyle: "default"
    }), t.position && (this._dragSelection.containsPosition(t.position) ? this._removeDecoration() : this.showAt(t.position));
  }
  _onEditorMouseDropCanceled() {
    this._editor.updateOptions({
      mouseStyle: "text"
    }), this._removeDecoration(), this._dragSelection = null, this._mouseDown = !1;
  }
  _onEditorMouseDrop(e) {
    if (e.target && (this._hitContent(e.target) || this._hitMargin(e.target)) && e.target.position) {
      const t = new de(e.target.position.lineNumber, e.target.position.column);
      if (this._dragSelection === null) {
        let n = null;
        if (e.event.shiftKey) {
          const r = this._editor.getSelection();
          if (r) {
            const { selectionStartLineNumber: s, selectionStartColumn: o } = r;
            n = [new bt(s, o, t.lineNumber, t.column)];
          }
        } else
          n = (this._editor.getSelections() || []).map((r) => r.containsPosition(t) ? new bt(t.lineNumber, t.column, t.lineNumber, t.column) : r);
        this._editor.setSelections(
          n || [],
          "mouse",
          3
          /* CursorChangeReason.Explicit */
        );
      } else (!this._dragSelection.containsPosition(t) || (xI(e.event) || this._modifierPressed) && (this._dragSelection.getEndPosition().equals(t) || this._dragSelection.getStartPosition().equals(t))) && (this._editor.pushUndoStop(), this._editor.executeCommand(jC.ID, new qSt(this._dragSelection, t, xI(e.event) || this._modifierPressed)), this._editor.pushUndoStop());
    }
    this._editor.updateOptions({
      mouseStyle: "text"
    }), this._removeDecoration(), this._dragSelection = null, this._mouseDown = !1;
  }
  showAt(e) {
    this._dndDecorationIds.set([{
      range: new z(e.lineNumber, e.column, e.lineNumber, e.column),
      options: jC._DECORATION_OPTIONS
    }]), this._editor.revealPosition(
      e,
      1
      /* ScrollType.Immediate */
    );
  }
  _removeDecoration() {
    this._dndDecorationIds.clear();
  }
  _hitContent(e) {
    return e.type === 6 || e.type === 7;
  }
  _hitMargin(e) {
    return e.type === 2 || e.type === 3 || e.type === 4;
  }
  dispose() {
    this._removeDecoration(), this._dragSelection = null, this._mouseDown = !1, this._modifierPressed = !1, super.dispose();
  }
};
jC.ID = "editor.contrib.dragAndDrop", jC.TRIGGER_KEY_VALUE = Kn ? 6 : 5, jC._DECORATION_OPTIONS = dn.register({
  description: "dnd-target",
  className: "dnd-target"
});
let xz = jC;
Si(
  xz.ID,
  xz,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
const KSt = "editor.action.pasteAs";
Si(
  r0.ID,
  r0,
  0
  /* EditorContributionInstantiation.Eager */
);
u2(Ase);
ct(new class extends jo {
  constructor() {
    super({
      id: J5e,
      precondition: Uge,
      kbOpts: {
        weight: 100,
        primary: 2137
      }
    });
  }
  runEditorCommand(i, e) {
    var t;
    return (t = r0.get(e)) == null ? void 0 : t.changePasteType();
  }
}());
ct(new class extends jo {
  constructor() {
    super({
      id: "editor.hidePasteWidget",
      precondition: Uge,
      kbOpts: {
        weight: 100,
        primary: 9
      }
    });
  }
  runEditorCommand(i, e) {
    var t;
    (t = r0.get(e)) == null || t.clearWidgets();
  }
}());
var yL;
Je((yL = class extends vt {
  constructor() {
    super({
      id: KSt,
      label: Ee(910, "Paste As..."),
      precondition: se.writable,
      metadata: {
        description: "Paste as",
        args: [{
          name: "args",
          schema: yL.argsSchema
        }]
      }
    });
  }
  run(e, t, n) {
    var s;
    let r;
    return n && ("kind" in n ? r = { only: new Ps(n.kind) } : "preferences" in n && (r = { preferences: n.preferences.map((o) => new Ps(o)) })), (s = r0.get(t)) == null ? void 0 : s.pasteAs(r);
  }
}, yL.argsSchema = {
  oneOf: [
    {
      type: "object",
      required: ["kind"],
      properties: {
        kind: {
          type: "string",
          description: S(908, `The kind of the paste edit to try pasting with.
If there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.`)
        }
      }
    },
    {
      type: "object",
      required: ["preferences"],
      properties: {
        preferences: {
          type: "array",
          description: S(909, `List of preferred paste edit kind to try applying.
The first edit matching the preferences will be applied.`),
          items: { type: "string" }
        }
      }
    }
  ]
}, yL));
Je(class extends vt {
  constructor() {
    super({
      id: "editor.action.pasteAsText",
      label: Ee(911, "Paste as Text"),
      precondition: se.writable
    });
  }
  run(i, e) {
    var t;
    return (t = r0.get(e)) == null ? void 0 : t.pasteAs({ providerId: mT.id });
  }
});
class YSt {
  constructor() {
    this._dragOperations = /* @__PURE__ */ new Map();
  }
  removeDragOperationTransfer(e) {
    if (e && this._dragOperations.has(e)) {
      const t = this._dragOperations.get(e);
      return this._dragOperations.delete(e), t;
    }
  }
}
class qDe {
  constructor(e) {
    this.identifier = e;
  }
}
const k6e = Vn("treeViewsDndService");
ni(
  k6e,
  YSt,
  1
  /* InstantiationType.Delayed */
);
var XSt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, pH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, jv;
const ZSt = "editor.dropIntoEditor.preferences", D6e = "editor.changeDropType", Epe = new ut("dropWidgetVisible", !1, S(929, "Whether the drop widget is showing"));
var CL;
let mA = (CL = class extends ge {
  static get(e) {
    return e.getContribution(jv.ID);
  }
  constructor(e, t, n, r, s) {
    super(), this._configService = n, this._languageFeaturesService = r, this._treeViewsDragAndDropService = s, this.treeItemsTransfer = Lse.getInstance(), this._dropProgressManager = this._register(t.createInstance(YU, "dropIntoEditor", e)), this._postDropWidgetManager = this._register(t.createInstance(ez, "dropIntoEditor", e, Epe, { id: D6e, label: S(930, "Show drop options...") }, () => jv._configureDefaultAction ? [jv._configureDefaultAction] : [])), this._register(e.onDropIntoEditor((o) => this.onDropIntoEditor(e, o.position, o.event)));
  }
  clearWidgets() {
    this._postDropWidgetManager.clear();
  }
  changeDropType() {
    this._postDropWidgetManager.tryShowSelector();
  }
  async onDropIntoEditor(e, t, n) {
    var s;
    if (!n.dataTransfer || !e.hasModel())
      return;
    (s = jv._currentDropOperation) == null || s.cancel(), e.focus(), e.setPosition(t);
    const r = Jo(async (o) => {
      const a = new ke(), l = a.add(new t0(e, 1, void 0, o));
      try {
        const c = await this.extractDataTransferData(n);
        if (c.size === 0 || l.token.isCancellationRequested)
          return;
        const u = e.getModel();
        if (!u)
          return;
        const d = this._languageFeaturesService.documentDropEditProvider.ordered(u).filter((g) => g.dropMimeTypes ? g.dropMimeTypes.some((m) => c.matches(m)) : !0), h = a.add(await this.getDropEdits(d, u, t, c, l.token));
        if (l.token.isCancellationRequested)
          return;
        if (h.edits.length) {
          const g = this.getInitialActiveEditIndex(u, h.edits), m = e.getOption(
            43
            /* EditorOption.dropIntoEditor */
          ).showDropSelector === "afterDrop";
          await this._postDropWidgetManager.applyEditAndShowIfNeeded([z.fromPositions(t)], { activeEditIndex: g, allEdits: h.edits }, m, async (_) => _, o);
        }
      } finally {
        a.dispose(), jv._currentDropOperation === r && (jv._currentDropOperation = void 0);
      }
    });
    this._dropProgressManager.showWhile(t, S(931, "Running drop handlers. Click to cancel"), r, { cancel: () => r.cancel() }), jv._currentDropOperation = r;
  }
  async getDropEdits(e, t, n, r, s) {
    const o = new ke(), a = await $R(Promise.all(e.map(async (c) => {
      try {
        const u = await c.provideDocumentDropEdits(t, n, r, s);
        return u && o.add(u), u == null ? void 0 : u.edits.map((d) => ({ ...d, providerId: c.id }));
      } catch (u) {
        Xh(u) || console.error(u), console.error(u);
      }
    })), s), l = ym(a ?? []).flat();
    return {
      edits: K5e(l),
      dispose: () => o.dispose()
    };
  }
  getInitialActiveEditIndex(e, t) {
    const n = this._configService.getValue(ZSt, { resource: e.uri });
    for (const r of Array.isArray(n) ? n : []) {
      const s = new Ps(r), o = t.findIndex((a) => a.kind && s.contains(a.kind));
      if (o >= 0)
        return o;
    }
    return 0;
  }
  async extractDataTransferData(e) {
    if (!e.dataTransfer)
      return new M5e();
    const t = H5e(e.dataTransfer);
    if (this.treeItemsTransfer.hasData(qDe.prototype)) {
      const n = this.treeItemsTransfer.getData(qDe.prototype);
      if (Array.isArray(n))
        for (const r of n) {
          const s = await this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);
          if (s)
            for (const [o, a] of s)
              t.replace(o, a);
        }
    }
    return t;
  }
}, jv = CL, CL.ID = "editor.contrib.dropIntoEditorController", CL);
mA = jv = XSt([
  pH(1, xt),
  pH(2, xn),
  pH(3, St),
  pH(4, k6e)
], mA);
Si(
  mA.ID,
  mA,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
u2(Rse);
ct(new class extends jo {
  constructor() {
    super({
      id: D6e,
      precondition: Epe,
      kbOpts: {
        weight: 100,
        primary: 2137
      }
    });
  }
  runEditorCommand(i, e, t) {
    var n;
    (n = mA.get(e)) == null || n.changeDropType();
  }
}());
ct(new class extends jo {
  constructor() {
    super({
      id: "editor.hideDropWidget",
      precondition: Epe,
      kbOpts: {
        weight: 100,
        primary: 9
      }
    });
  }
  runEditorCommand(i, e, t) {
    var n;
    (n = mA.get(e)) == null || n.clearWidgets();
  }
}());
const pc = class pc {
  constructor(e) {
    this._editor = e, this._decorations = [], this._overviewRulerApproximateDecorations = [], this._findScopeDecorationIds = [], this._rangeHighlightDecorationId = null, this._highlightedDecorationId = null, this._startPosition = this._editor.getPosition();
  }
  dispose() {
    this._editor.removeDecorations(this._allDecorations()), this._decorations = [], this._overviewRulerApproximateDecorations = [], this._findScopeDecorationIds = [], this._rangeHighlightDecorationId = null, this._highlightedDecorationId = null;
  }
  reset() {
    this._decorations = [], this._overviewRulerApproximateDecorations = [], this._findScopeDecorationIds = [], this._rangeHighlightDecorationId = null, this._highlightedDecorationId = null;
  }
  getCount() {
    return this._decorations.length;
  }
  /** @deprecated use getFindScopes to support multiple selections */
  getFindScope() {
    return this._findScopeDecorationIds[0] ? this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]) : null;
  }
  getFindScopes() {
    if (this._findScopeDecorationIds.length) {
      const e = this._findScopeDecorationIds.map((t) => this._editor.getModel().getDecorationRange(t)).filter((t) => !!t);
      if (e.length)
        return e;
    }
    return null;
  }
  getStartPosition() {
    return this._startPosition;
  }
  setStartPosition(e) {
    this._startPosition = e, this.setCurrentFindMatch(null);
  }
  _getDecorationIndex(e) {
    const t = this._decorations.indexOf(e);
    return t >= 0 ? t + 1 : 1;
  }
  getDecorationRangeAt(e) {
    const t = e < this._decorations.length ? this._decorations[e] : null;
    return t ? this._editor.getModel().getDecorationRange(t) : null;
  }
  getCurrentMatchesPosition(e) {
    const t = this._editor.getModel().getDecorationsInRange(e);
    for (const n of t) {
      const r = n.options;
      if (r === pc._FIND_MATCH_DECORATION || r === pc._CURRENT_FIND_MATCH_DECORATION)
        return this._getDecorationIndex(n.id);
    }
    return 0;
  }
  setCurrentFindMatch(e) {
    let t = null, n = 0;
    if (e)
      for (let r = 0, s = this._decorations.length; r < s; r++) {
        const o = this._editor.getModel().getDecorationRange(this._decorations[r]);
        if (e.equalsRange(o)) {
          t = this._decorations[r], n = r + 1;
          break;
        }
      }
    return (this._highlightedDecorationId !== null || t !== null) && this._editor.changeDecorations((r) => {
      if (this._highlightedDecorationId !== null && (r.changeDecorationOptions(this._highlightedDecorationId, pc._FIND_MATCH_DECORATION), this._highlightedDecorationId = null), t !== null && (this._highlightedDecorationId = t, r.changeDecorationOptions(this._highlightedDecorationId, pc._CURRENT_FIND_MATCH_DECORATION)), this._rangeHighlightDecorationId !== null && (r.removeDecoration(this._rangeHighlightDecorationId), this._rangeHighlightDecorationId = null), t !== null) {
        let s = this._editor.getModel().getDecorationRange(t);
        if (s.startLineNumber !== s.endLineNumber && s.endColumn === 1) {
          const o = s.endLineNumber - 1, a = this._editor.getModel().getLineMaxColumn(o);
          s = new z(s.startLineNumber, s.startColumn, o, a);
        }
        this._rangeHighlightDecorationId = r.addDecoration(s, pc._RANGE_HIGHLIGHT_DECORATION);
      }
    }), n;
  }
  set(e, t) {
    this._editor.changeDecorations((n) => {
      let r = pc._FIND_MATCH_DECORATION;
      const s = [];
      if (e.length > 1e3) {
        r = pc._FIND_MATCH_NO_OVERVIEW_DECORATION;
        const a = this._editor.getModel().getLineCount(), c = this._editor.getLayoutInfo().height / a, u = Math.max(2, Math.ceil(3 / c));
        let d = e[0].range.startLineNumber, h = e[0].range.endLineNumber;
        for (let g = 1, m = e.length; g < m; g++) {
          const _ = e[g].range;
          h + u >= _.startLineNumber ? _.endLineNumber > h && (h = _.endLineNumber) : (s.push({
            range: new z(d, 1, h, 1),
            options: pc._FIND_MATCH_ONLY_OVERVIEW_DECORATION
          }), d = _.startLineNumber, h = _.endLineNumber);
        }
        s.push({
          range: new z(d, 1, h, 1),
          options: pc._FIND_MATCH_ONLY_OVERVIEW_DECORATION
        });
      }
      const o = new Array(e.length);
      for (let a = 0, l = e.length; a < l; a++)
        o[a] = {
          range: e[a].range,
          options: r
        };
      this._decorations = n.deltaDecorations(this._decorations, o), this._overviewRulerApproximateDecorations = n.deltaDecorations(this._overviewRulerApproximateDecorations, s), this._rangeHighlightDecorationId && (n.removeDecoration(this._rangeHighlightDecorationId), this._rangeHighlightDecorationId = null), this._findScopeDecorationIds.length && (this._findScopeDecorationIds.forEach((a) => n.removeDecoration(a)), this._findScopeDecorationIds = []), t != null && t.length && (this._findScopeDecorationIds = t.map((a) => n.addDecoration(a, pc._FIND_SCOPE_DECORATION)));
    });
  }
  matchBeforePosition(e) {
    if (this._decorations.length === 0)
      return null;
    for (let t = this._decorations.length - 1; t >= 0; t--) {
      const n = this._decorations[t], r = this._editor.getModel().getDecorationRange(n);
      if (!(!r || r.endLineNumber > e.lineNumber)) {
        if (r.endLineNumber < e.lineNumber)
          return r;
        if (!(r.endColumn > e.column))
          return r;
      }
    }
    return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length - 1]);
  }
  matchAfterPosition(e) {
    if (this._decorations.length === 0)
      return null;
    for (let t = 0, n = this._decorations.length; t < n; t++) {
      const r = this._decorations[t], s = this._editor.getModel().getDecorationRange(r);
      if (!(!s || s.startLineNumber < e.lineNumber)) {
        if (s.startLineNumber > e.lineNumber)
          return s;
        if (!(s.startColumn < e.column))
          return s;
      }
    }
    return this._editor.getModel().getDecorationRange(this._decorations[0]);
  }
  _allDecorations() {
    let e = [];
    return e = e.concat(this._decorations), e = e.concat(this._overviewRulerApproximateDecorations), this._findScopeDecorationIds.length && e.push(...this._findScopeDecorationIds), this._rangeHighlightDecorationId && e.push(this._rangeHighlightDecorationId), e;
  }
};
pc._CURRENT_FIND_MATCH_DECORATION = dn.register({
  description: "current-find-match",
  stickiness: 1,
  zIndex: 13,
  className: "currentFindMatch",
  inlineClassName: "currentFindMatchInline",
  showIfCollapsed: !0,
  overviewRuler: {
    color: Ks(JJ),
    position: zh.Center
  },
  minimap: {
    color: Ks(jie),
    position: 1
    /* MinimapPosition.Inline */
  }
}), pc._FIND_MATCH_DECORATION = dn.register({
  description: "find-match",
  stickiness: 1,
  zIndex: 10,
  className: "findMatch",
  inlineClassName: "findMatchInline",
  showIfCollapsed: !0,
  overviewRuler: {
    color: Ks(JJ),
    position: zh.Center
  },
  minimap: {
    color: Ks(jie),
    position: 1
    /* MinimapPosition.Inline */
  }
}), pc._FIND_MATCH_NO_OVERVIEW_DECORATION = dn.register({
  description: "find-match-no-overview",
  stickiness: 1,
  className: "findMatch",
  showIfCollapsed: !0
}), pc._FIND_MATCH_ONLY_OVERVIEW_DECORATION = dn.register({
  description: "find-match-only-overview",
  stickiness: 1,
  overviewRuler: {
    color: Ks(JJ),
    position: zh.Center
  }
}), pc._RANGE_HIGHLIGHT_DECORATION = dn.register({
  description: "find-range-highlight",
  stickiness: 1,
  className: "rangeHighlight",
  isWholeLine: !0
}), pc._FIND_SCOPE_DECORATION = dn.register({
  description: "find-scope",
  className: "findScope",
  isWholeLine: !0
});
let Roe = pc;
class QSt {
  constructor(e, t, n) {
    this._editorSelection = e, this._ranges = t, this._replaceStrings = n, this._trackedEditorSelectionId = null;
  }
  getEditOperations(e, t) {
    if (this._ranges.length > 0) {
      const n = [];
      for (let o = 0; o < this._ranges.length; o++)
        n.push({
          range: this._ranges[o],
          text: this._replaceStrings[o]
        });
      n.sort((o, a) => z.compareRangesUsingStarts(o.range, a.range));
      const r = [];
      let s = n[0];
      for (let o = 1; o < n.length; o++)
        s.range.endLineNumber === n[o].range.startLineNumber && s.range.endColumn === n[o].range.startColumn ? (s.range = s.range.plusRange(n[o].range), s.text = s.text + n[o].text) : (r.push(s), s = n[o]);
      r.push(s);
      for (const o of r)
        t.addEditOperation(o.range, o.text);
    }
    this._trackedEditorSelectionId = t.trackSelection(this._editorSelection);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._trackedEditorSelectionId);
  }
}
function I6e(i, e) {
  if (i && i[0] !== "") {
    const t = KDe(i, e, "-"), n = KDe(i, e, "_");
    return t && !n ? YDe(i, e, "-") : !t && n ? YDe(i, e, "_") : i[0].toUpperCase() === i[0] ? e.toUpperCase() : i[0].toLowerCase() === i[0] ? e.toLowerCase() : gnt(i[0][0]) && e.length > 0 ? e[0].toUpperCase() + e.substr(1) : i[0][0].toUpperCase() !== i[0][0] && e.length > 0 ? e[0].toLowerCase() + e.substr(1) : e;
  } else
    return e;
}
function KDe(i, e, t) {
  return i[0].indexOf(t) !== -1 && e.indexOf(t) !== -1 && i[0].split(t).length === e.split(t).length;
}
function YDe(i, e, t) {
  const n = e.split(t), r = i[0].split(t);
  let s = "";
  return n.forEach((o, a) => {
    s += I6e([r[a]], o) + t;
  }), s.slice(0, -1);
}
class XDe {
  constructor(e) {
    this.staticValue = e, this.kind = 0;
  }
}
class JSt {
  constructor(e) {
    this.pieces = e, this.kind = 1;
  }
}
class _A {
  static fromStaticValue(e) {
    return new _A([$x.staticValue(e)]);
  }
  get hasReplacementPatterns() {
    return this._state.kind === 1;
  }
  constructor(e) {
    !e || e.length === 0 ? this._state = new XDe("") : e.length === 1 && e[0].staticValue !== null ? this._state = new XDe(e[0].staticValue) : this._state = new JSt(e);
  }
  buildReplaceString(e, t) {
    if (this._state.kind === 0)
      return t ? I6e(e, this._state.staticValue) : this._state.staticValue;
    let n = "";
    for (let r = 0, s = this._state.pieces.length; r < s; r++) {
      const o = this._state.pieces[r];
      if (o.staticValue !== null) {
        n += o.staticValue;
        continue;
      }
      let a = _A._substitute(o.matchIndex, e);
      if (o.caseOps !== null && o.caseOps.length > 0) {
        const l = [], c = o.caseOps.length;
        let u = 0;
        for (let d = 0, h = a.length; d < h; d++) {
          if (u >= c) {
            l.push(a.slice(d));
            break;
          }
          switch (o.caseOps[u]) {
            case "U":
              l.push(a[d].toUpperCase());
              break;
            case "u":
              l.push(a[d].toUpperCase()), u++;
              break;
            case "L":
              l.push(a[d].toLowerCase());
              break;
            case "l":
              l.push(a[d].toLowerCase()), u++;
              break;
            default:
              l.push(a[d]);
          }
        }
        a = l.join("");
      }
      n += a;
    }
    return n;
  }
  static _substitute(e, t) {
    if (t === null)
      return "";
    if (e === 0)
      return t[0];
    let n = "";
    for (; e > 0; ) {
      if (e < t.length)
        return (t[e] || "") + n;
      n = String(e % 10) + n, e = Math.floor(e / 10);
    }
    return "$" + n;
  }
}
class $x {
  static staticValue(e) {
    return new $x(e, -1, null);
  }
  static caseOps(e, t) {
    return new $x(null, e, t);
  }
  constructor(e, t, n) {
    this.staticValue = e, this.matchIndex = t, !n || n.length === 0 ? this.caseOps = null : this.caseOps = n.slice(0);
  }
}
class eEt {
  constructor(e) {
    this._source = e, this._lastCharIndex = 0, this._result = [], this._resultLen = 0, this._currentStaticPiece = "";
  }
  emitUnchanged(e) {
    this._emitStatic(this._source.substring(this._lastCharIndex, e)), this._lastCharIndex = e;
  }
  emitStatic(e, t) {
    this._emitStatic(e), this._lastCharIndex = t;
  }
  _emitStatic(e) {
    e.length !== 0 && (this._currentStaticPiece += e);
  }
  emitMatchIndex(e, t, n) {
    this._currentStaticPiece.length !== 0 && (this._result[this._resultLen++] = $x.staticValue(this._currentStaticPiece), this._currentStaticPiece = ""), this._result[this._resultLen++] = $x.caseOps(e, n), this._lastCharIndex = t;
  }
  finalize() {
    return this.emitUnchanged(this._source.length), this._currentStaticPiece.length !== 0 && (this._result[this._resultLen++] = $x.staticValue(this._currentStaticPiece), this._currentStaticPiece = ""), new _A(this._result);
  }
}
function tEt(i) {
  if (!i || i.length === 0)
    return new _A(null);
  const e = [], t = new eEt(i);
  for (let n = 0, r = i.length; n < r; n++) {
    const s = i.charCodeAt(n);
    if (s === 92) {
      if (n++, n >= r)
        break;
      const o = i.charCodeAt(n);
      switch (o) {
        case 92:
          t.emitUnchanged(n - 1), t.emitStatic("\\", n + 1);
          break;
        case 110:
          t.emitUnchanged(n - 1), t.emitStatic(`
`, n + 1);
          break;
        case 116:
          t.emitUnchanged(n - 1), t.emitStatic("	", n + 1);
          break;
        // Case modification of string replacements, patterned after Boost, but only applied
        // to the replacement text, not subsequent content.
        case 117:
        // \u => upper-cases one character.
        case 85:
        // \U => upper-cases ALL following characters.
        case 108:
        // \l => lower-cases one character.
        case 76:
          t.emitUnchanged(n - 1), t.emitStatic("", n + 1), e.push(String.fromCharCode(o));
          break;
      }
      continue;
    }
    if (s === 36) {
      if (n++, n >= r)
        break;
      const o = i.charCodeAt(n);
      if (o === 36) {
        t.emitUnchanged(n - 1), t.emitStatic("$", n + 1);
        continue;
      }
      if (o === 48 || o === 38) {
        t.emitUnchanged(n - 1), t.emitMatchIndex(0, n + 1, e), e.length = 0;
        continue;
      }
      if (49 <= o && o <= 57) {
        let a = o - 48;
        if (n + 1 < r) {
          const l = i.charCodeAt(n + 1);
          if (48 <= l && l <= 57) {
            n++, a = a * 10 + (l - 48), t.emitUnchanged(n - 2), t.emitMatchIndex(a, n + 1, e), e.length = 0;
            continue;
          }
        }
        t.emitUnchanged(n - 1), t.emitMatchIndex(a, n + 1, e), e.length = 0;
        continue;
      }
    }
  }
  return t.finalize();
}
const m0 = new ut("findWidgetVisible", !1);
m0.toNegated();
const AK = new ut("findInputFocussed", !1), xpe = new ut("replaceInputFocussed", !1), mH = {
  primary: 545,
  mac: {
    primary: 2593
    /* KeyCode.KeyC */
  }
}, _H = {
  primary: 565,
  mac: {
    primary: 2613
    /* KeyCode.KeyW */
  }
}, bH = {
  primary: 560,
  mac: {
    primary: 2608
    /* KeyCode.KeyR */
  }
}, vH = {
  primary: 554,
  mac: {
    primary: 2602
    /* KeyCode.KeyL */
  }
}, yH = {
  primary: 558,
  mac: {
    primary: 2606
    /* KeyCode.KeyP */
  }
}, Xr = {
  StartFindAction: "actions.find",
  StartFindWithSelection: "actions.findWithSelection",
  StartFindWithArgs: "editor.actions.findWithArgs",
  NextMatchFindAction: "editor.action.nextMatchFindAction",
  PreviousMatchFindAction: "editor.action.previousMatchFindAction",
  GoToMatchFindAction: "editor.action.goToMatchFindAction",
  NextSelectionMatchFindAction: "editor.action.nextSelectionMatchFindAction",
  PreviousSelectionMatchFindAction: "editor.action.previousSelectionMatchFindAction",
  StartFindReplaceAction: "editor.action.startFindReplaceAction",
  CloseFindWidgetCommand: "closeFindWidget",
  ToggleCaseSensitiveCommand: "toggleFindCaseSensitive",
  ToggleWholeWordCommand: "toggleFindWholeWord",
  ToggleRegexCommand: "toggleFindRegex",
  ToggleSearchScopeCommand: "toggleFindInSelection",
  TogglePreserveCaseCommand: "togglePreserveCase",
  ReplaceOneAction: "editor.action.replaceOne",
  ReplaceAllAction: "editor.action.replaceAll",
  SelectAllMatchesAction: "editor.action.selectAllMatches"
}, _1 = 19999, nEt = 240;
class jF {
  constructor(e, t) {
    this._toDispose = new ke(), this._editor = e, this._state = t, this._isDisposed = !1, this._startSearchingTimer = new Gh(), this._decorations = new Roe(e), this._toDispose.add(this._decorations), this._updateDecorationsScheduler = new mr(() => {
      if (this._editor.hasModel())
        return this.research(!1);
    }, 100), this._toDispose.add(this._updateDecorationsScheduler), this._toDispose.add(this._editor.onDidChangeCursorPosition((n) => {
      (n.reason === 3 || n.reason === 5 || n.reason === 6) && this._decorations.setStartPosition(this._editor.getPosition());
    })), this._ignoreModelContentChanged = !1, this._toDispose.add(this._editor.onDidChangeModelContent((n) => {
      this._ignoreModelContentChanged || (n.isFlush && this._decorations.reset(), this._decorations.setStartPosition(this._editor.getPosition()), this._updateDecorationsScheduler.schedule());
    })), this._toDispose.add(this._state.onFindReplaceStateChange((n) => this._onStateChanged(n))), this.research(!1, this._state.searchScope);
  }
  dispose() {
    this._isDisposed = !0, or(this._startSearchingTimer), this._toDispose.dispose();
  }
  _onStateChanged(e) {
    this._isDisposed || this._editor.hasModel() && (e.searchString || e.isReplaceRevealed || e.isRegex || e.wholeWord || e.matchCase || e.searchScope) && (this._editor.getModel().isTooLargeForSyncing() ? (this._startSearchingTimer.cancel(), this._startSearchingTimer.setIfNotSet(() => {
      e.searchScope ? this.research(e.moveCursor, this._state.searchScope) : this.research(e.moveCursor);
    }, nEt)) : e.searchScope ? this.research(e.moveCursor, this._state.searchScope) : this.research(e.moveCursor));
  }
  static _getSearchRange(e, t) {
    return t || e.getFullModelRange();
  }
  research(e, t) {
    let n = null;
    typeof t < "u" ? t !== null && (Array.isArray(t) ? n = t : n = [t]) : n = this._decorations.getFindScopes(), n !== null && (n = n.map((a) => {
      if (a.startLineNumber !== a.endLineNumber) {
        let l = a.endLineNumber;
        return a.endColumn === 1 && (l = l - 1), new z(a.startLineNumber, 1, l, this._editor.getModel().getLineMaxColumn(l));
      }
      return a;
    }));
    const r = this._findMatches(n, !1, _1);
    this._decorations.set(r, n);
    const s = this._editor.getSelection();
    let o = this._decorations.getCurrentMatchesPosition(s);
    if (o === 0 && r.length > 0) {
      const a = S4(r.map((l) => l.range), (l) => z.compareRangesUsingStarts(l, s) >= 0);
      o = a > 0 ? a - 1 + 1 : o;
    }
    this._state.changeMatchInfo(o, this._decorations.getCount(), void 0), e && this._editor.getOption(
      50
      /* EditorOption.find */
    ).cursorMoveOnType && this._moveToNextMatch(this._decorations.getStartPosition());
  }
  _hasMatches() {
    return this._state.matchesCount > 0;
  }
  _cannotFind() {
    if (!this._hasMatches()) {
      const e = this._decorations.getFindScope();
      return e && this._editor.revealRangeInCenterIfOutsideViewport(
        e,
        0
        /* ScrollType.Smooth */
      ), !0;
    }
    return !1;
  }
  _setCurrentFindMatch(e) {
    const t = this._decorations.setCurrentFindMatch(e);
    this._state.changeMatchInfo(t, this._decorations.getCount(), e), this._editor.setSelection(e), this._editor.revealRangeInCenterIfOutsideViewport(
      e,
      0
      /* ScrollType.Smooth */
    );
  }
  _prevSearchPosition(e) {
    const t = this._state.isRegex && (this._state.searchString.indexOf("^") >= 0 || this._state.searchString.indexOf("$") >= 0);
    let { lineNumber: n, column: r } = e;
    const s = this._editor.getModel();
    return t || r === 1 ? (n === 1 ? n = s.getLineCount() : n--, r = s.getLineMaxColumn(n)) : r--, new de(n, r);
  }
  _moveToPrevMatch(e, t = !1) {
    if (!this._state.canNavigateBack()) {
      const u = this._decorations.matchAfterPosition(e);
      u && this._setCurrentFindMatch(u);
      return;
    }
    if (this._decorations.getCount() < _1) {
      let u = this._decorations.matchBeforePosition(e);
      u && u.isEmpty() && u.getStartPosition().equals(e) && (e = this._prevSearchPosition(e), u = this._decorations.matchBeforePosition(e)), u && this._setCurrentFindMatch(u);
      return;
    }
    if (this._cannotFind())
      return;
    const n = this._decorations.getFindScope(), r = jF._getSearchRange(this._editor.getModel(), n);
    r.getEndPosition().isBefore(e) && (e = r.getEndPosition()), e.isBefore(r.getStartPosition()) && (e = r.getEndPosition());
    const { lineNumber: s, column: o } = e, a = this._editor.getModel();
    let l = new de(s, o), c = a.findPreviousMatch(this._state.searchString, l, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null, !1);
    if (c && c.range.isEmpty() && c.range.getStartPosition().equals(l) && (l = this._prevSearchPosition(l), c = a.findPreviousMatch(this._state.searchString, l, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null, !1)), !!c) {
      if (!t && !r.containsRange(c.range))
        return this._moveToPrevMatch(c.range.getStartPosition(), !0);
      this._setCurrentFindMatch(c.range);
    }
  }
  moveToPrevMatch() {
    this._moveToPrevMatch(this._editor.getSelection().getStartPosition());
  }
  _nextSearchPosition(e) {
    const t = this._state.isRegex && (this._state.searchString.indexOf("^") >= 0 || this._state.searchString.indexOf("$") >= 0);
    let { lineNumber: n, column: r } = e;
    const s = this._editor.getModel();
    return t || r === s.getLineMaxColumn(n) ? (n === s.getLineCount() ? n = 1 : n++, r = 1) : r++, new de(n, r);
  }
  _moveToNextMatch(e) {
    if (!this._state.canNavigateForward()) {
      const n = this._decorations.matchBeforePosition(e);
      n && this._setCurrentFindMatch(n);
      return;
    }
    if (this._decorations.getCount() < _1) {
      let n = this._decorations.matchAfterPosition(e);
      n && n.isEmpty() && n.getStartPosition().equals(e) && (e = this._nextSearchPosition(e), n = this._decorations.matchAfterPosition(e)), n && this._setCurrentFindMatch(n);
      return;
    }
    const t = this._getNextMatch(e, !1, !0);
    t && this._setCurrentFindMatch(t.range);
  }
  _getNextMatch(e, t, n, r = !1) {
    if (this._cannotFind())
      return null;
    const s = this._decorations.getFindScope(), o = jF._getSearchRange(this._editor.getModel(), s);
    o.getEndPosition().isBefore(e) && (e = o.getStartPosition()), e.isBefore(o.getStartPosition()) && (e = o.getStartPosition());
    const { lineNumber: a, column: l } = e, c = this._editor.getModel();
    let u = new de(a, l), d = c.findNextMatch(this._state.searchString, u, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null, t);
    return n && d && d.range.isEmpty() && d.range.getStartPosition().equals(u) && (u = this._nextSearchPosition(u), d = c.findNextMatch(this._state.searchString, u, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null, t)), d ? !r && !o.containsRange(d.range) ? this._getNextMatch(d.range.getEndPosition(), t, n, !0) : d : null;
  }
  moveToNextMatch() {
    this._moveToNextMatch(this._editor.getSelection().getEndPosition());
  }
  _moveToMatch(e) {
    const t = this._decorations.getDecorationRangeAt(e);
    t && this._setCurrentFindMatch(t);
  }
  moveToMatch(e) {
    this._moveToMatch(e);
  }
  _getReplacePattern() {
    return this._state.isRegex ? tEt(this._state.replaceString) : _A.fromStaticValue(this._state.replaceString);
  }
  replace() {
    if (!this._hasMatches())
      return;
    const e = this._getReplacePattern(), t = this._editor.getSelection(), n = this._getNextMatch(t.getStartPosition(), !0, !1);
    if (n)
      if (t.equalsRange(n.range)) {
        const r = e.buildReplaceString(n.matches, this._state.preserveCase), s = new bl(t, r);
        this._executeEditorCommand("replace", s), this._decorations.setStartPosition(new de(t.startLineNumber, t.startColumn + r.length)), this.research(!0);
      } else
        this._decorations.setStartPosition(this._editor.getPosition()), this._setCurrentFindMatch(n.range);
  }
  _findMatches(e, t, n) {
    const r = (e || [null]).map((s) => jF._getSearchRange(this._editor.getModel(), s));
    return this._editor.getModel().findMatches(this._state.searchString, r, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null, t, n);
  }
  replaceAll() {
    if (!this._hasMatches())
      return;
    const e = this._decorations.getFindScopes();
    e === null && this._state.matchesCount >= _1 ? this._largeReplaceAll() : this._regularReplaceAll(e), this.research(!1);
  }
  _largeReplaceAll() {
    const t = new SE(this._state.searchString, this._state.isRegex, this._state.matchCase, this._state.wholeWord ? this._editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null).parseSearchRequest();
    if (!t)
      return;
    let n = t.regex;
    if (!n.multiline) {
      let d = "mu";
      n.ignoreCase && (d += "i"), n.global && (d += "g"), n = new RegExp(n.source, d);
    }
    const r = this._editor.getModel(), s = r.getValue(
      1
      /* EndOfLinePreference.LF */
    ), o = r.getFullModelRange(), a = this._getReplacePattern();
    let l;
    const c = this._state.preserveCase;
    a.hasReplacementPatterns || c ? l = s.replace(n, function() {
      return a.buildReplaceString(arguments, c);
    }) : l = s.replace(n, a.buildReplaceString(null, c));
    const u = new rfe(o, l, this._editor.getSelection());
    this._executeEditorCommand("replaceAll", u);
  }
  _regularReplaceAll(e) {
    const t = this._getReplacePattern(), n = this._findMatches(
      e,
      t.hasReplacementPatterns || this._state.preserveCase,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    ), r = [];
    for (let o = 0, a = n.length; o < a; o++)
      r[o] = t.buildReplaceString(n[o].matches, this._state.preserveCase);
    const s = new QSt(this._editor.getSelection(), n.map((o) => o.range), r);
    this._executeEditorCommand("replaceAll", s);
  }
  selectAllMatches() {
    if (!this._hasMatches())
      return;
    const e = this._decorations.getFindScopes();
    let n = this._findMatches(
      e,
      !1,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    ).map((s) => new bt(s.range.startLineNumber, s.range.startColumn, s.range.endLineNumber, s.range.endColumn));
    const r = this._editor.getSelection();
    for (let s = 0, o = n.length; s < o; s++)
      if (n[s].equalsRange(r)) {
        n = [r].concat(n.slice(0, s)).concat(n.slice(s + 1));
        break;
      }
    this._editor.setSelections(n);
  }
  _executeEditorCommand(e, t) {
    try {
      this._ignoreModelContentChanged = !0, this._editor.pushUndoStop(), this._editor.executeCommand(e, t), this._editor.pushUndoStop();
    } finally {
      this._ignoreModelContentChanged = !1;
    }
  }
}
const pG = class pG extends Xd {
  constructor(e, t, n) {
    super(), this._hideSoon = this._register(new mr(() => this._hide(), 2e3)), this._isVisible = !1, this._editor = e, this._state = t, this._keybindingService = n, this._domNode = document.createElement("div"), this._domNode.className = "findOptionsWidget", this._domNode.style.display = "none", this._domNode.style.top = "10px", this._domNode.style.zIndex = "12", this._domNode.setAttribute("role", "presentation"), this._domNode.setAttribute("aria-hidden", "true");
    const r = {
      inputActiveOptionBorder: je(qq),
      inputActiveOptionForeground: je(Kq),
      inputActiveOptionBackground: je(SB)
    }, s = this._register(oA());
    this.caseSensitive = this._register(new qBe({
      appendTitle: this._keybindingLabelFor(Xr.ToggleCaseSensitiveCommand),
      isChecked: this._state.matchCase,
      hoverDelegate: s,
      ...r
    })), this._domNode.appendChild(this.caseSensitive.domNode), this._register(this.caseSensitive.onChange(() => {
      this._state.change({
        matchCase: this.caseSensitive.checked
      }, !1);
    })), this.wholeWords = this._register(new KBe({
      appendTitle: this._keybindingLabelFor(Xr.ToggleWholeWordCommand),
      isChecked: this._state.wholeWord,
      hoverDelegate: s,
      ...r
    })), this._domNode.appendChild(this.wholeWords.domNode), this._register(this.wholeWords.onChange(() => {
      this._state.change({
        wholeWord: this.wholeWords.checked
      }, !1);
    })), this.regex = this._register(new YBe({
      appendTitle: this._keybindingLabelFor(Xr.ToggleRegexCommand),
      isChecked: this._state.isRegex,
      hoverDelegate: s,
      ...r
    })), this._domNode.appendChild(this.regex.domNode), this._register(this.regex.onChange(() => {
      this._state.change({
        isRegex: this.regex.checked
      }, !1);
    })), this._editor.addOverlayWidget(this), this._register(this._state.onFindReplaceStateChange((o) => {
      let a = !1;
      o.isRegex && (this.regex.checked = this._state.isRegex, a = !0), o.wholeWord && (this.wholeWords.checked = this._state.wholeWord, a = !0), o.matchCase && (this.caseSensitive.checked = this._state.matchCase, a = !0), !this._state.isRevealed && a && this._revealTemporarily();
    })), this._register(Ce(this._domNode, Xe.MOUSE_LEAVE, (o) => this._onMouseLeave())), this._register(Ce(this._domNode, "mouseover", (o) => this._onMouseOver()));
  }
  _keybindingLabelFor(e) {
    const t = this._keybindingService.lookupKeybinding(e);
    return t ? ` (${t.getLabel()})` : "";
  }
  dispose() {
    this._editor.removeOverlayWidget(this), super.dispose();
  }
  // ----- IOverlayWidget API
  getId() {
    return pG.ID;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return {
      preference: 0
      /* OverlayWidgetPositionPreference.TOP_RIGHT_CORNER */
    };
  }
  highlightFindOptions() {
    this._revealTemporarily();
  }
  _revealTemporarily() {
    this._show(), this._hideSoon.schedule();
  }
  _onMouseLeave() {
    this._hideSoon.schedule();
  }
  _onMouseOver() {
    this._hideSoon.cancel();
  }
  _show() {
    this._isVisible || (this._isVisible = !0, this._domNode.style.display = "block");
  }
  _hide() {
    this._isVisible && (this._isVisible = !1, this._domNode.style.display = "none");
  }
};
pG.ID = "editor.contrib.findOptionsWidget";
let Aoe = pG;
function CH(i, e) {
  return i === 1 ? !0 : i === 2 ? !1 : e;
}
class iEt extends ge {
  get searchString() {
    return this._searchString;
  }
  get replaceString() {
    return this._replaceString;
  }
  get isRevealed() {
    return this._isRevealed;
  }
  get isReplaceRevealed() {
    return this._isReplaceRevealed;
  }
  get isRegex() {
    return CH(this._isRegexOverride, this._isRegex);
  }
  get wholeWord() {
    return CH(this._wholeWordOverride, this._wholeWord);
  }
  get matchCase() {
    return CH(this._matchCaseOverride, this._matchCase);
  }
  get preserveCase() {
    return CH(this._preserveCaseOverride, this._preserveCase);
  }
  get actualIsRegex() {
    return this._isRegex;
  }
  get actualWholeWord() {
    return this._wholeWord;
  }
  get actualMatchCase() {
    return this._matchCase;
  }
  get actualPreserveCase() {
    return this._preserveCase;
  }
  get searchScope() {
    return this._searchScope;
  }
  get matchesPosition() {
    return this._matchesPosition;
  }
  get matchesCount() {
    return this._matchesCount;
  }
  get currentMatch() {
    return this._currentMatch;
  }
  constructor() {
    super(), this._onFindReplaceStateChange = this._register(new he()), this.onFindReplaceStateChange = this._onFindReplaceStateChange.event, this._searchString = "", this._replaceString = "", this._isRevealed = !1, this._isReplaceRevealed = !1, this._isRegex = !1, this._isRegexOverride = 0, this._wholeWord = !1, this._wholeWordOverride = 0, this._matchCase = !1, this._matchCaseOverride = 0, this._preserveCase = !1, this._preserveCaseOverride = 0, this._searchScope = null, this._matchesPosition = 0, this._matchesCount = 0, this._currentMatch = null, this._loop = !0, this._isSearching = !1, this._filters = null;
  }
  changeMatchInfo(e, t, n) {
    const r = {
      moveCursor: !1,
      updateHistory: !1,
      searchString: !1,
      replaceString: !1,
      isRevealed: !1,
      isReplaceRevealed: !1,
      isRegex: !1,
      wholeWord: !1,
      matchCase: !1,
      preserveCase: !1,
      searchScope: !1,
      matchesPosition: !1,
      matchesCount: !1,
      currentMatch: !1,
      loop: !1,
      isSearching: !1,
      filters: !1
    };
    let s = !1;
    t === 0 && (e = 0), e > t && (e = t), this._matchesPosition !== e && (this._matchesPosition = e, r.matchesPosition = !0, s = !0), this._matchesCount !== t && (this._matchesCount = t, r.matchesCount = !0, s = !0), typeof n < "u" && (z.equalsRange(this._currentMatch, n) || (this._currentMatch = n, r.currentMatch = !0, s = !0)), s && this._onFindReplaceStateChange.fire(r);
  }
  change(e, t, n = !0) {
    var u;
    const r = {
      moveCursor: t,
      updateHistory: n,
      searchString: !1,
      replaceString: !1,
      isRevealed: !1,
      isReplaceRevealed: !1,
      isRegex: !1,
      wholeWord: !1,
      matchCase: !1,
      preserveCase: !1,
      searchScope: !1,
      matchesPosition: !1,
      matchesCount: !1,
      currentMatch: !1,
      loop: !1,
      isSearching: !1,
      filters: !1
    };
    let s = !1;
    const o = this.isRegex, a = this.wholeWord, l = this.matchCase, c = this.preserveCase;
    typeof e.searchString < "u" && this._searchString !== e.searchString && (this._searchString = e.searchString, r.searchString = !0, s = !0), typeof e.replaceString < "u" && this._replaceString !== e.replaceString && (this._replaceString = e.replaceString, r.replaceString = !0, s = !0), typeof e.isRevealed < "u" && this._isRevealed !== e.isRevealed && (this._isRevealed = e.isRevealed, r.isRevealed = !0, s = !0), typeof e.isReplaceRevealed < "u" && this._isReplaceRevealed !== e.isReplaceRevealed && (this._isReplaceRevealed = e.isReplaceRevealed, r.isReplaceRevealed = !0, s = !0), typeof e.isRegex < "u" && (this._isRegex = e.isRegex), typeof e.wholeWord < "u" && (this._wholeWord = e.wholeWord), typeof e.matchCase < "u" && (this._matchCase = e.matchCase), typeof e.preserveCase < "u" && (this._preserveCase = e.preserveCase), typeof e.searchScope < "u" && ((u = e.searchScope) != null && u.every((d) => {
      var h;
      return (h = this._searchScope) == null ? void 0 : h.some((g) => !z.equalsRange(g, d));
    }) || (this._searchScope = e.searchScope, r.searchScope = !0, s = !0)), typeof e.loop < "u" && this._loop !== e.loop && (this._loop = e.loop, r.loop = !0, s = !0), typeof e.isSearching < "u" && this._isSearching !== e.isSearching && (this._isSearching = e.isSearching, r.isSearching = !0, s = !0), typeof e.filters < "u" && (this._filters ? this._filters.update(e.filters) : this._filters = e.filters, r.filters = !0, s = !0), this._isRegexOverride = typeof e.isRegexOverride < "u" ? e.isRegexOverride : 0, this._wholeWordOverride = typeof e.wholeWordOverride < "u" ? e.wholeWordOverride : 0, this._matchCaseOverride = typeof e.matchCaseOverride < "u" ? e.matchCaseOverride : 0, this._preserveCaseOverride = typeof e.preserveCaseOverride < "u" ? e.preserveCaseOverride : 0, o !== this.isRegex && (s = !0, r.isRegex = !0), a !== this.wholeWord && (s = !0, r.wholeWord = !0), l !== this.matchCase && (s = !0, r.matchCase = !0), c !== this.preserveCase && (s = !0, r.preserveCase = !0), s && this._onFindReplaceStateChange.fire(r);
  }
  canNavigateBack() {
    return this.canNavigateInLoop() || this.matchesPosition !== 1;
  }
  canNavigateForward() {
    return this.canNavigateInLoop() || this.matchesPosition < this.matchesCount;
  }
  canNavigateInLoop() {
    return this._loop || this.matchesCount >= _1;
  }
}
const rEt = S(5, "input"), sEt = S(6, "Preserve Case");
class oEt extends kw {
  constructor(e) {
    super({
      // TODO: does this need its own icon?
      icon: Pe.preserveCase,
      title: sEt + e.appendTitle,
      isChecked: e.isChecked,
      hoverDelegate: e.hoverDelegate ?? rd("element"),
      inputActiveOptionBorder: e.inputActiveOptionBorder,
      inputActiveOptionForeground: e.inputActiveOptionForeground,
      inputActiveOptionBackground: e.inputActiveOptionBackground
    });
  }
}
class aEt extends Xd {
  get onDidOptionChange() {
    return this._onDidOptionChange.event;
  }
  get onKeyDown() {
    return this._onKeyDown.event;
  }
  get onPreserveCaseKeyDown() {
    return this._onPreserveCaseKeyDown.event;
  }
  constructor(e, t, n, r) {
    super(), this._showOptionButtons = n, this.fixFocusOnOptionClickEnabled = !0, this.cachedOptionsWidth = 0, this._onDidOptionChange = this._register(new he()), this._onKeyDown = this._register(new he()), this._onMouseDown = this._register(new he()), this._onInput = this._register(new he()), this._onKeyUp = this._register(new he()), this._onPreserveCaseKeyDown = this._register(new he()), this.contextViewProvider = t, this.placeholder = r.placeholder || "", this.validation = r.validation, this.label = r.label || rEt;
    const s = r.appendPreserveCaseLabel || "", o = r.history || /* @__PURE__ */ new Set([]), a = !!r.flexibleHeight, l = !!r.flexibleWidth, c = r.flexibleMaxHeight;
    this.domNode = document.createElement("div"), this.domNode.classList.add("monaco-findInput"), this.inputBox = this._register(new ZBe(this.domNode, this.contextViewProvider, {
      ariaLabel: this.label || "",
      placeholder: this.placeholder || "",
      validationOptions: {
        validation: this.validation
      },
      history: o,
      showHistoryHint: r.showHistoryHint,
      flexibleHeight: a,
      flexibleWidth: l,
      flexibleMaxHeight: c,
      inputBoxStyles: r.inputBoxStyles
    })), this.preserveCase = this._register(new oEt({
      appendTitle: s,
      isChecked: !1,
      ...r.toggleStyles
    })), this._register(this.preserveCase.onChange((h) => {
      this._onDidOptionChange.fire(h), !h && this.fixFocusOnOptionClickEnabled && this.inputBox.focus(), this.validate();
    })), this._register(this.preserveCase.onKeyDown((h) => {
      this._onPreserveCaseKeyDown.fire(h);
    })), this._showOptionButtons ? this.cachedOptionsWidth = this.preserveCase.width() : this.cachedOptionsWidth = 0;
    const u = [this.preserveCase.domNode];
    this.onkeydown(this.domNode, (h) => {
      if (h.equals(
        15
        /* KeyCode.LeftArrow */
      ) || h.equals(
        17
        /* KeyCode.RightArrow */
      ) || h.equals(
        9
        /* KeyCode.Escape */
      )) {
        const g = u.indexOf(this.domNode.ownerDocument.activeElement);
        if (g >= 0) {
          let m = -1;
          h.equals(
            17
            /* KeyCode.RightArrow */
          ) ? m = (g + 1) % u.length : h.equals(
            15
            /* KeyCode.LeftArrow */
          ) && (g === 0 ? m = u.length - 1 : m = g - 1), h.equals(
            9
            /* KeyCode.Escape */
          ) ? (u[g].blur(), this.inputBox.focus()) : m >= 0 && u[m].focus(), Mi.stop(h, !0);
        }
      }
    });
    const d = document.createElement("div");
    d.className = "controls", d.style.display = this._showOptionButtons ? "block" : "none", d.appendChild(this.preserveCase.domNode), this.domNode.appendChild(d), e == null || e.appendChild(this.domNode), this.onkeydown(this.inputBox.inputElement, (h) => this._onKeyDown.fire(h)), this.onkeyup(this.inputBox.inputElement, (h) => this._onKeyUp.fire(h)), this.oninput(this.inputBox.inputElement, (h) => this._onInput.fire()), this.onmousedown(this.inputBox.inputElement, (h) => this._onMouseDown.fire(h));
  }
  enable() {
    this.domNode.classList.remove("disabled"), this.inputBox.enable(), this.preserveCase.enable();
  }
  disable() {
    this.domNode.classList.add("disabled"), this.inputBox.disable(), this.preserveCase.disable();
  }
  setEnabled(e) {
    e ? this.enable() : this.disable();
  }
  select() {
    this.inputBox.select();
  }
  focus() {
    this.inputBox.focus();
  }
  getPreserveCase() {
    return this.preserveCase.checked;
  }
  setPreserveCase(e) {
    this.preserveCase.checked = e;
  }
  focusOnPreserve() {
    this.preserveCase.focus();
  }
  validate() {
    var e;
    (e = this.inputBox) == null || e.validate();
  }
  set width(e) {
    this.inputBox.paddingRight = this.cachedOptionsWidth, this.domNode.style.width = e + "px";
  }
  dispose() {
    super.dispose();
  }
}
var N6e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, R6e = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const Lpe = new ut("suggestWidgetVisible", !1, S(1683, "Whether suggestion are visible")), Tpe = "historyNavigationWidgetFocus", A6e = "historyNavigationForwardsEnabled", O6e = "historyNavigationBackwardsEnabled";
let Hy;
const wH = [];
function M6e(i, e) {
  if (wH.includes(e))
    throw new Error("Cannot register the same widget multiple times");
  wH.push(e);
  const t = new ke(), n = new ut(Tpe, !1).bindTo(i), r = new ut(A6e, !0).bindTo(i), s = new ut(O6e, !0).bindTo(i), o = () => {
    n.set(!0), Hy = e;
  }, a = () => {
    n.set(!1), Hy === e && (Hy = void 0);
  };
  return wq(e.element) && o(), t.add(e.onDidFocus(() => o())), t.add(e.onDidBlur(() => a())), t.add(Et(() => {
    wH.splice(wH.indexOf(e), 1), a();
  })), {
    historyNavigationForwardsEnablement: r,
    historyNavigationBackwardsEnablement: s,
    dispose() {
      t.dispose();
    }
  };
}
let Ooe = class extends QBe {
  constructor(e, t, n, r) {
    super(e, t, n);
    const s = this._register(r.createScoped(this.inputBox.element));
    this._register(M6e(s, this.inputBox));
  }
};
Ooe = N6e([
  R6e(3, Jt)
], Ooe);
let Moe = class extends aEt {
  constructor(e, t, n, r, s = !1) {
    super(e, t, s, n);
    const o = this._register(r.createScoped(this.inputBox.element));
    this._register(M6e(o, this.inputBox));
  }
};
Moe = N6e([
  R6e(3, Jt)
], Moe);
Pa.registerCommandAndKeybindingRule({
  id: "history.showPrevious",
  weight: 200,
  when: Re.and(Re.has(Tpe), Re.equals(O6e, !0), Re.not("isComposing"), Lpe.isEqualTo(!1)),
  primary: 16,
  secondary: [
    528
    /* KeyCode.UpArrow */
  ],
  handler: (i) => {
    Hy == null || Hy.showPreviousValue();
  }
});
Pa.registerCommandAndKeybindingRule({
  id: "history.showNext",
  weight: 200,
  when: Re.and(Re.has(Tpe), Re.equals(A6e, !0), Re.not("isComposing"), Lpe.isEqualTo(!1)),
  primary: 18,
  secondary: [
    530
    /* KeyCode.DownArrow */
  ],
  handler: (i) => {
    Hy == null || Hy.showNextValue();
  }
});
function ZDe(i) {
  var e, t;
  return ((e = i.lookupKeybinding("history.showPrevious")) == null ? void 0 : e.getElectronAccelerator()) === "Up" && ((t = i.lookupKeybinding("history.showNext")) == null ? void 0 : t.getElectronAccelerator()) === "Down";
}
const QDe = es("find-collapsed", Pe.chevronRight, S(951, "Icon to indicate that the editor find widget is collapsed.")), JDe = es("find-expanded", Pe.chevronDown, S(952, "Icon to indicate that the editor find widget is expanded.")), lEt = es("find-selection", Pe.selection, S(953, "Icon for 'Find in Selection' in the editor find widget.")), cEt = es("find-replace", Pe.replace, S(954, "Icon for 'Replace' in the editor find widget.")), uEt = es("find-replace-all", Pe.replaceAll, S(955, "Icon for 'Replace All' in the editor find widget.")), dEt = es("find-previous-match", Pe.arrowUp, S(956, "Icon for 'Find Previous' in the editor find widget.")), hEt = es("find-next-match", Pe.arrowDown, S(957, "Icon for 'Find Next' in the editor find widget.")), fEt = S(958, "Find / Replace"), gEt = S(959, "Find"), pEt = S(960, "Find"), mEt = S(961, "Previous Match"), _Et = S(962, "Next Match"), bEt = S(963, "Find in Selection"), vEt = S(964, "Close"), yEt = S(965, "Replace"), CEt = S(966, "Replace"), wEt = S(967, "Replace"), SEt = S(968, "Replace All"), EEt = S(969, "Toggle Replace"), xEt = S(970, "Only the first {0} results are highlighted, but all find operations work on the entire text.", _1), LEt = S(971, "{0} of {1}"), eIe = S(972, "No results"), g_ = 419, TEt = 275, kEt = TEt - 54;
let aP = 69;
const DEt = 33, tIe = Kn ? 256 : 2048;
class ate {
  constructor(e) {
    this.afterLineNumber = e, this.heightInPx = DEt, this.suppressMouseDown = !1, this.domNode = document.createElement("div"), this.domNode.className = "dock-find-viewzone";
  }
}
function nIe(i, e, t) {
  const n = !!e.match(/\n/);
  if (t && n && t.selectionStart > 0) {
    i.stopPropagation();
    return;
  }
}
function iIe(i, e, t) {
  const n = !!e.match(/\n/);
  if (t && n && t.selectionEnd < t.value.length) {
    i.stopPropagation();
    return;
  }
}
const mG = class mG extends Xd {
  constructor(e, t, n, r, s, o, a, l, c) {
    super(), this._hoverService = a, this._findWidgetSearchHistory = l, this._replaceWidgetHistory = c, this._cachedHeight = null, this._revealTimeouts = [], this._codeEditor = e, this._controller = t, this._state = n, this._contextViewProvider = r, this._keybindingService = s, this._contextKeyService = o, this._isVisible = !1, this._isReplaceVisible = !1, this._ignoreChangeEvent = !1, this._updateHistoryDelayer = new Gf(500), this._register(Et(() => this._updateHistoryDelayer.cancel())), this._register(this._state.onFindReplaceStateChange((u) => this._onStateChanged(u))), this._buildDomNode(), this._updateButtons(), this._tryUpdateWidgetWidth(), this._findInput.inputBox.layout(), this._register(this._codeEditor.onDidChangeConfiguration((u) => {
      if (u.hasChanged(
        104
        /* EditorOption.readOnly */
      ) && (this._codeEditor.getOption(
        104
        /* EditorOption.readOnly */
      ) && this._state.change({ isReplaceRevealed: !1 }, !1), this._updateButtons()), u.hasChanged(
        165
        /* EditorOption.layoutInfo */
      ) && this._tryUpdateWidgetWidth(), u.hasChanged(
        2
        /* EditorOption.accessibilitySupport */
      ) && this.updateAccessibilitySupport(), u.hasChanged(
        50
        /* EditorOption.find */
      )) {
        const d = this._codeEditor.getOption(
          50
          /* EditorOption.find */
        ).loop;
        this._state.change({ loop: d }, !1);
        const h = this._codeEditor.getOption(
          50
          /* EditorOption.find */
        ).addExtraSpaceOnTop;
        h && !this._viewZone && (this._viewZone = new ate(0), this._showViewZone()), !h && this._viewZone && this._removeViewZone();
      }
    })), this.updateAccessibilitySupport(), this._register(this._codeEditor.onDidChangeCursorSelection(() => {
      this._isVisible && this._updateToggleSelectionFindButton();
    })), this._register(this._codeEditor.onDidFocusEditorWidget(async () => {
      if (this._isVisible) {
        const u = await this._controller.getGlobalBufferTerm();
        u && u !== this._state.searchString && (this._state.change({ searchString: u }, !1), this._findInput.select());
      }
    })), this._findInputFocused = AK.bindTo(o), this._findFocusTracker = this._register(qf(this._findInput.inputBox.inputElement)), this._register(this._findFocusTracker.onDidFocus(() => {
      this._findInputFocused.set(!0), this._updateSearchScope();
    })), this._register(this._findFocusTracker.onDidBlur(() => {
      this._findInputFocused.set(!1);
    })), this._replaceInputFocused = xpe.bindTo(o), this._replaceFocusTracker = this._register(qf(this._replaceInput.inputBox.inputElement)), this._register(this._replaceFocusTracker.onDidFocus(() => {
      this._replaceInputFocused.set(!0), this._updateSearchScope();
    })), this._register(this._replaceFocusTracker.onDidBlur(() => {
      this._replaceInputFocused.set(!1);
    })), this._codeEditor.addOverlayWidget(this), this._codeEditor.getOption(
      50
      /* EditorOption.find */
    ).addExtraSpaceOnTop && (this._viewZone = new ate(0)), this._register(this._codeEditor.onDidChangeModel(() => {
      this._isVisible && (this._viewZoneId = void 0);
    })), this._register(this._codeEditor.onDidScrollChange((u) => {
      if (u.scrollTopChanged) {
        this._layoutViewZone();
        return;
      }
      setTimeout(() => {
        this._layoutViewZone();
      }, 0);
    }));
  }
  // ----- IOverlayWidget API
  getId() {
    return mG.ID;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return this._isVisible ? {
      preference: 0
      /* OverlayWidgetPositionPreference.TOP_RIGHT_CORNER */
    } : null;
  }
  // ----- React to state changes
  _onStateChanged(e) {
    if (e.searchString) {
      try {
        this._ignoreChangeEvent = !0, this._findInput.setValue(this._state.searchString);
      } finally {
        this._ignoreChangeEvent = !1;
      }
      this._updateButtons();
    }
    if (e.replaceString && (this._replaceInput.inputBox.value = this._state.replaceString), e.isRevealed && (this._state.isRevealed ? this._reveal() : this._hide(!0)), e.isReplaceRevealed && (this._state.isReplaceRevealed ? !this._codeEditor.getOption(
      104
      /* EditorOption.readOnly */
    ) && !this._isReplaceVisible && (this._isReplaceVisible = !0, this._replaceInput.width = Td(this._findInput.domNode), this._updateButtons(), this._replaceInput.inputBox.layout()) : this._isReplaceVisible && (this._isReplaceVisible = !1, this._updateButtons())), (e.isRevealed || e.isReplaceRevealed) && (this._state.isRevealed || this._state.isReplaceRevealed) && this._tryUpdateHeight() && this._showViewZone(), e.isRegex && this._findInput.setRegex(this._state.isRegex), e.wholeWord && this._findInput.setWholeWords(this._state.wholeWord), e.matchCase && this._findInput.setCaseSensitive(this._state.matchCase), e.preserveCase && this._replaceInput.setPreserveCase(this._state.preserveCase), e.searchScope && (this._state.searchScope ? this._toggleSelectionFind.checked = !0 : this._toggleSelectionFind.checked = !1, this._updateToggleSelectionFindButton()), e.searchString || e.matchesCount || e.matchesPosition) {
      const t = this._state.searchString.length > 0 && this._state.matchesCount === 0;
      this._domNode.classList.toggle("no-results", t), this._updateMatchesCount(), this._updateButtons();
    }
    (e.searchString || e.currentMatch) && this._layoutViewZone(), e.updateHistory && this._delayedUpdateHistory(), e.loop && this._updateButtons();
  }
  _delayedUpdateHistory() {
    this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0, fn);
  }
  _updateHistory() {
    this._state.searchString && this._findInput.inputBox.addToHistory(), this._state.replaceString && this._replaceInput.inputBox.addToHistory();
  }
  _updateMatchesCount() {
    var t;
    this._matchesCount.style.minWidth = aP + "px", this._state.matchesCount >= _1 ? this._matchesCount.title = xEt : this._matchesCount.title = "", (t = this._matchesCount.firstChild) == null || t.remove();
    let e;
    if (this._state.matchesCount > 0) {
      let n = String(this._state.matchesCount);
      this._state.matchesCount >= _1 && (n += "+");
      let r = String(this._state.matchesPosition);
      r === "0" && (r = "?"), e = tT(LEt, r, n);
    } else
      e = eIe;
    this._matchesCount.appendChild(document.createTextNode(e)), lu(this._getAriaLabel(e, this._state.currentMatch, this._state.searchString)), aP = Math.max(aP, this._matchesCount.clientWidth);
  }
  // ----- actions
  _getAriaLabel(e, t, n) {
    if (e === eIe)
      return n === "" ? S(973, "{0} found", e) : S(974, "{0} found for '{1}'", e, n);
    if (t) {
      const r = S(975, "{0} found for '{1}', at {2}", e, n, t.startLineNumber + ":" + t.startColumn), s = this._codeEditor.getModel();
      return s && t.startLineNumber <= s.getLineCount() && t.startLineNumber >= 1 ? `${s.getLineContent(t.startLineNumber)}, ${r}` : r;
    }
    return S(976, "{0} found for '{1}'", e, n);
  }
  /**
   * If 'selection find' is ON we should not disable the button (its function is to cancel 'selection find').
   * If 'selection find' is OFF we enable the button only if there is a selection.
   */
  _updateToggleSelectionFindButton() {
    const e = this._codeEditor.getSelection(), t = e ? e.startLineNumber !== e.endLineNumber || e.startColumn !== e.endColumn : !1, n = this._toggleSelectionFind.checked;
    this._isVisible && (n || t) ? this._toggleSelectionFind.enable() : this._toggleSelectionFind.disable();
  }
  _updateButtons() {
    this._findInput.setEnabled(this._isVisible), this._replaceInput.setEnabled(this._isVisible && this._isReplaceVisible), this._updateToggleSelectionFindButton(), this._closeBtn.setEnabled(this._isVisible);
    const e = this._state.searchString.length > 0, t = !!this._state.matchesCount;
    this._prevBtn.setEnabled(this._isVisible && e && t && this._state.canNavigateBack()), this._nextBtn.setEnabled(this._isVisible && e && t && this._state.canNavigateForward()), this._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && e), this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && e), this._domNode.classList.toggle("replaceToggled", this._isReplaceVisible), this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);
    const n = !this._codeEditor.getOption(
      104
      /* EditorOption.readOnly */
    );
    this._toggleReplaceBtn.setEnabled(this._isVisible && n);
  }
  _reveal() {
    if (this._revealTimeouts.forEach((e) => {
      clearTimeout(e);
    }), this._revealTimeouts = [], !this._isVisible) {
      this._isVisible = !0;
      const e = this._codeEditor.getSelection();
      switch (this._codeEditor.getOption(
        50
        /* EditorOption.find */
      ).autoFindInSelection) {
        case "always":
          this._toggleSelectionFind.checked = !0;
          break;
        case "never":
          this._toggleSelectionFind.checked = !1;
          break;
        case "multiline": {
          const n = !!e && e.startLineNumber !== e.endLineNumber;
          this._toggleSelectionFind.checked = n;
          break;
        }
      }
      this._tryUpdateWidgetWidth(), this._updateButtons(), this._revealTimeouts.push(setTimeout(() => {
        this._domNode.classList.add("visible"), this._domNode.setAttribute("aria-hidden", "false");
      }, 0)), this._revealTimeouts.push(setTimeout(() => {
        this._findInput.validate();
      }, 200)), this._codeEditor.layoutOverlayWidget(this);
      let t = !0;
      if (this._codeEditor.getOption(
        50
        /* EditorOption.find */
      ).seedSearchStringFromSelection && e) {
        const n = this._codeEditor.getDomNode();
        if (n) {
          const r = ho(n), s = this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()), o = r.left + (s ? s.left : 0), a = s ? s.top : 0;
          if (this._viewZone && a < this._viewZone.heightInPx) {
            e.endLineNumber > e.startLineNumber && (t = !1);
            const l = kPe(this._domNode).left;
            o > l && (t = !1);
            const c = this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());
            r.left + (c ? c.left : 0) > l && (t = !1);
          }
        }
      }
      this._showViewZone(t);
    }
  }
  _hide(e) {
    this._revealTimeouts.forEach((t) => {
      clearTimeout(t);
    }), this._revealTimeouts = [], this._isVisible && (this._isVisible = !1, this._updateButtons(), this._domNode.classList.remove("visible"), this._domNode.setAttribute("aria-hidden", "true"), this._findInput.clearMessage(), e && this._codeEditor.focus(), this._codeEditor.layoutOverlayWidget(this), this._removeViewZone());
  }
  _layoutViewZone(e) {
    if (!this._codeEditor.getOption(
      50
      /* EditorOption.find */
    ).addExtraSpaceOnTop) {
      this._removeViewZone();
      return;
    }
    if (!this._isVisible)
      return;
    const n = this._viewZone;
    this._viewZoneId !== void 0 || !n || this._codeEditor.changeViewZones((r) => {
      n.heightInPx = this._getHeight(), this._viewZoneId = r.addZone(n), this._codeEditor.setScrollTop(e || this._codeEditor.getScrollTop() + n.heightInPx);
    });
  }
  _showViewZone(e = !0) {
    if (!this._isVisible || !this._codeEditor.getOption(
      50
      /* EditorOption.find */
    ).addExtraSpaceOnTop)
      return;
    this._viewZone === void 0 && (this._viewZone = new ate(0));
    const n = this._viewZone;
    this._codeEditor.changeViewZones((r) => {
      if (this._viewZoneId !== void 0) {
        const s = this._getHeight();
        if (s === n.heightInPx)
          return;
        const o = s - n.heightInPx;
        n.heightInPx = s, r.layoutZone(this._viewZoneId), e && this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + o);
        return;
      } else {
        let s = this._getHeight();
        if (s -= this._codeEditor.getOption(
          96
          /* EditorOption.padding */
        ).top, s <= 0)
          return;
        n.heightInPx = s, this._viewZoneId = r.addZone(n), e && this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + s);
      }
    });
  }
  _removeViewZone() {
    this._codeEditor.changeViewZones((e) => {
      this._viewZoneId !== void 0 && (e.removeZone(this._viewZoneId), this._viewZoneId = void 0, this._viewZone && (this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() - this._viewZone.heightInPx), this._viewZone = void 0));
    });
  }
  _tryUpdateWidgetWidth() {
    if (!this._isVisible || !this._domNode.isConnected)
      return;
    const e = this._codeEditor.getLayoutInfo();
    if (e.contentWidth <= 0) {
      this._domNode.classList.add("hiddenEditor");
      return;
    } else this._domNode.classList.contains("hiddenEditor") && this._domNode.classList.remove("hiddenEditor");
    const n = e.width, r = e.minimap.minimapWidth;
    let s = !1, o = !1, a = !1;
    if (this._resized && Td(this._domNode) > g_) {
      this._domNode.style.maxWidth = `${n - 28 - r - 15}px`, this._replaceInput.width = Td(this._findInput.domNode);
      return;
    }
    if (g_ + 28 + r >= n && (o = !0), g_ + 28 + r - aP >= n && (a = !0), g_ + 28 + r - aP >= n + 50 && (s = !0), this._domNode.classList.toggle("collapsed-find-widget", s), this._domNode.classList.toggle("narrow-find-widget", a), this._domNode.classList.toggle("reduced-find-widget", o), !a && !s && (this._domNode.style.maxWidth = `${n - 28 - r - 15}px`), this._findInput.layout({ collapsedFindWidget: s, narrowFindWidget: a, reducedFindWidget: o }), this._resized) {
      const l = this._findInput.inputBox.element.clientWidth;
      l > 0 && (this._replaceInput.width = l);
    } else this._isReplaceVisible && (this._replaceInput.width = Td(this._findInput.domNode));
  }
  _getHeight() {
    let e = 0;
    return e += 4, e += this._findInput.inputBox.height + 2, this._isReplaceVisible && (e += 4, e += this._replaceInput.inputBox.height + 2), e += 4, e;
  }
  _tryUpdateHeight() {
    const e = this._getHeight();
    return this._cachedHeight !== null && this._cachedHeight === e ? !1 : (this._cachedHeight = e, this._domNode.style.height = `${e}px`, !0);
  }
  // ----- Public
  focusFindInput() {
    this._findInput.select(), this._findInput.focus();
  }
  focusReplaceInput() {
    this._replaceInput.select(), this._replaceInput.focus();
  }
  highlightFindOptions() {
    this._findInput.highlightFindOptions();
  }
  _updateSearchScope() {
    if (this._codeEditor.hasModel() && this._toggleSelectionFind.checked) {
      const e = this._codeEditor.getSelections();
      e.map((t) => {
        t.endColumn === 1 && t.endLineNumber > t.startLineNumber && (t = t.setEndPosition(t.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber - 1)));
        const n = this._state.currentMatch;
        return t.startLineNumber !== t.endLineNumber && !z.equalsRange(t, n) ? t : null;
      }).filter((t) => !!t), e.length && this._state.change({ searchScope: e }, !0);
    }
  }
  _onFindInputMouseDown(e) {
    e.middleButton && e.stopPropagation();
  }
  _onFindInputKeyDown(e) {
    if (e.equals(
      tIe | 3
      /* KeyCode.Enter */
    ))
      if (this._keybindingService.dispatchEvent(e, e.target)) {
        e.preventDefault();
        return;
      } else {
        this._findInput.inputBox.insertAtCursor(`
`), e.preventDefault();
        return;
      }
    if (e.equals(
      2
      /* KeyCode.Tab */
    )) {
      this._isReplaceVisible ? this._replaceInput.focus() : this._findInput.focusOnCaseSensitive(), e.preventDefault();
      return;
    }
    if (e.equals(
      2066
      /* KeyCode.DownArrow */
    )) {
      this._codeEditor.focus(), e.preventDefault();
      return;
    }
    if (e.equals(
      16
      /* KeyCode.UpArrow */
    ))
      return nIe(e, this._findInput.getValue(), this._findInput.domNode.querySelector("textarea"));
    if (e.equals(
      18
      /* KeyCode.DownArrow */
    ))
      return iIe(e, this._findInput.getValue(), this._findInput.domNode.querySelector("textarea"));
  }
  _onReplaceInputKeyDown(e) {
    if (e.equals(
      tIe | 3
      /* KeyCode.Enter */
    ))
      if (this._keybindingService.dispatchEvent(e, e.target)) {
        e.preventDefault();
        return;
      } else {
        this._replaceInput.inputBox.insertAtCursor(`
`), e.preventDefault();
        return;
      }
    if (e.equals(
      2
      /* KeyCode.Tab */
    )) {
      this._findInput.focusOnCaseSensitive(), e.preventDefault();
      return;
    }
    if (e.equals(
      1026
      /* KeyCode.Tab */
    )) {
      this._findInput.focus(), e.preventDefault();
      return;
    }
    if (e.equals(
      2066
      /* KeyCode.DownArrow */
    )) {
      this._codeEditor.focus(), e.preventDefault();
      return;
    }
    if (e.equals(
      16
      /* KeyCode.UpArrow */
    ))
      return nIe(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector("textarea"));
    if (e.equals(
      18
      /* KeyCode.DownArrow */
    ))
      return iIe(e, this._replaceInput.inputBox.value, this._replaceInput.inputBox.element.querySelector("textarea"));
  }
  // ----- sash
  getVerticalSashLeft(e) {
    return 0;
  }
  // ----- initialization
  _keybindingLabelFor(e) {
    const t = this._keybindingService.lookupKeybinding(e);
    return t ? ` (${t.getLabel()})` : "";
  }
  _buildDomNode() {
    const n = this._codeEditor.getOption(
      50
      /* EditorOption.find */
    ).history, r = this._codeEditor.getOption(
      50
      /* EditorOption.find */
    ).replaceHistory;
    this._findInput = this._register(new Ooe(null, this._contextViewProvider, {
      width: kEt,
      label: gEt,
      placeholder: pEt,
      appendCaseSensitiveLabel: this._keybindingLabelFor(Xr.ToggleCaseSensitiveCommand),
      appendWholeWordsLabel: this._keybindingLabelFor(Xr.ToggleWholeWordCommand),
      appendRegexLabel: this._keybindingLabelFor(Xr.ToggleRegexCommand),
      validation: (h) => {
        if (h.length === 0 || !this._findInput.getRegex())
          return null;
        try {
          return new RegExp(h, "gu"), null;
        } catch (g) {
          return { content: g.message };
        }
      },
      flexibleHeight: !0,
      flexibleWidth: !0,
      flexibleMaxHeight: 118,
      showCommonFindToggles: !0,
      showHistoryHint: () => ZDe(this._keybindingService),
      inputBoxStyles: VU,
      toggleStyles: WU,
      history: n === "workspace" ? this._findWidgetSearchHistory : /* @__PURE__ */ new Set([])
    }, this._contextKeyService)), this._findInput.setRegex(!!this._state.isRegex), this._findInput.setCaseSensitive(!!this._state.matchCase), this._findInput.setWholeWords(!!this._state.wholeWord), this._register(this._findInput.onKeyDown((h) => {
      h.equals(
        3
        /* KeyCode.Enter */
      ) && !this._codeEditor.getOption(
        50
        /* EditorOption.find */
      ).findOnType && this._state.change({ searchString: this._findInput.getValue() }, !0), this._onFindInputKeyDown(h);
    })), this._register(this._findInput.inputBox.onDidChange(() => {
      this._ignoreChangeEvent || !this._codeEditor.getOption(
        50
        /* EditorOption.find */
      ).findOnType || this._state.change({ searchString: this._findInput.getValue() }, !0);
    })), this._register(this._findInput.onDidOptionChange(() => {
      this._state.change({
        isRegex: this._findInput.getRegex(),
        wholeWord: this._findInput.getWholeWords(),
        matchCase: this._findInput.getCaseSensitive()
      }, !0);
    })), this._register(this._findInput.onCaseSensitiveKeyDown((h) => {
      h.equals(
        1026
        /* KeyCode.Tab */
      ) && this._isReplaceVisible && (this._replaceInput.focus(), h.preventDefault());
    })), this._register(this._findInput.onRegexKeyDown((h) => {
      h.equals(
        2
        /* KeyCode.Tab */
      ) && this._isReplaceVisible && (this._replaceInput.focusOnPreserve(), h.preventDefault());
    })), this._register(this._findInput.inputBox.onDidHeightChange((h) => {
      this._tryUpdateHeight() && this._showViewZone();
    })), Qu && this._register(this._findInput.onMouseDown((h) => this._onFindInputMouseDown(h))), this._matchesCount = document.createElement("div"), this._matchesCount.className = "matchesCount", this._updateMatchesCount();
    const s = this._register(oA());
    this._prevBtn = this._register(new LI({
      label: mEt + this._keybindingLabelFor(Xr.PreviousMatchFindAction),
      icon: dEt,
      hoverDelegate: s,
      onTrigger: () => {
        i1(this._codeEditor.getAction(Xr.PreviousMatchFindAction)).run().then(void 0, fn);
      }
    }, this._hoverService)), this._nextBtn = this._register(new LI({
      label: _Et + this._keybindingLabelFor(Xr.NextMatchFindAction),
      icon: hEt,
      hoverDelegate: s,
      onTrigger: () => {
        i1(this._codeEditor.getAction(Xr.NextMatchFindAction)).run().then(void 0, fn);
      }
    }, this._hoverService));
    const o = document.createElement("div");
    o.className = "find-part", o.appendChild(this._findInput.domNode);
    const a = document.createElement("div");
    a.className = "find-actions", o.appendChild(a), a.appendChild(this._matchesCount), a.appendChild(this._prevBtn.domNode), a.appendChild(this._nextBtn.domNode), this._toggleSelectionFind = this._register(new kw({
      icon: lEt,
      title: bEt + this._keybindingLabelFor(Xr.ToggleSearchScopeCommand),
      isChecked: !1,
      hoverDelegate: s,
      inputActiveOptionBackground: je(SB),
      inputActiveOptionBorder: je(qq),
      inputActiveOptionForeground: je(Kq)
    })), this._register(this._toggleSelectionFind.onChange(() => {
      if (this._toggleSelectionFind.checked) {
        if (this._codeEditor.hasModel()) {
          let h = this._codeEditor.getSelections();
          h = h.map((g) => (g.endColumn === 1 && g.endLineNumber > g.startLineNumber && (g = g.setEndPosition(g.endLineNumber - 1, this._codeEditor.getModel().getLineMaxColumn(g.endLineNumber - 1))), g.isEmpty() ? null : g)).filter((g) => !!g), h.length && this._state.change({ searchScope: h }, !0);
        }
      } else
        this._state.change({ searchScope: null }, !0);
    })), a.appendChild(this._toggleSelectionFind.domNode), this._closeBtn = this._register(new LI({
      label: vEt + this._keybindingLabelFor(Xr.CloseFindWidgetCommand),
      icon: h5e,
      hoverDelegate: s,
      onTrigger: () => {
        this._state.change({ isRevealed: !1, searchScope: null }, !1);
      },
      onKeyDown: (h) => {
        h.equals(
          2
          /* KeyCode.Tab */
        ) && this._isReplaceVisible && (this._replaceBtn.isEnabled() ? this._replaceBtn.focus() : this._codeEditor.focus(), h.preventDefault());
      }
    }, this._hoverService)), this._replaceInput = this._register(new Moe(null, void 0, {
      label: yEt,
      placeholder: CEt,
      appendPreserveCaseLabel: this._keybindingLabelFor(Xr.TogglePreserveCaseCommand),
      history: r === "workspace" ? this._replaceWidgetHistory : /* @__PURE__ */ new Set([]),
      flexibleHeight: !0,
      flexibleWidth: !0,
      flexibleMaxHeight: 118,
      showHistoryHint: () => ZDe(this._keybindingService),
      inputBoxStyles: VU,
      toggleStyles: WU
    }, this._contextKeyService, !0)), this._replaceInput.setPreserveCase(!!this._state.preserveCase), this._register(this._replaceInput.onKeyDown((h) => this._onReplaceInputKeyDown(h))), this._register(this._replaceInput.inputBox.onDidChange(() => {
      this._state.change({ replaceString: this._replaceInput.inputBox.value }, !1);
    })), this._register(this._replaceInput.inputBox.onDidHeightChange((h) => {
      this._isReplaceVisible && this._tryUpdateHeight() && this._showViewZone();
    })), this._register(this._replaceInput.onDidOptionChange(() => {
      this._state.change({
        preserveCase: this._replaceInput.getPreserveCase()
      }, !0);
    })), this._register(this._replaceInput.onPreserveCaseKeyDown((h) => {
      h.equals(
        2
        /* KeyCode.Tab */
      ) && (this._prevBtn.isEnabled() ? this._prevBtn.focus() : this._nextBtn.isEnabled() ? this._nextBtn.focus() : this._toggleSelectionFind.enabled ? this._toggleSelectionFind.focus() : this._closeBtn.isEnabled() && this._closeBtn.focus(), h.preventDefault());
    }));
    const l = this._register(oA());
    this._replaceBtn = this._register(new LI({
      label: wEt + this._keybindingLabelFor(Xr.ReplaceOneAction),
      icon: cEt,
      hoverDelegate: l,
      onTrigger: () => {
        this._controller.replace();
      },
      onKeyDown: (h) => {
        h.equals(
          1026
          /* KeyCode.Tab */
        ) && (this._closeBtn.focus(), h.preventDefault());
      }
    }, this._hoverService)), this._replaceAllBtn = this._register(new LI({
      label: SEt + this._keybindingLabelFor(Xr.ReplaceAllAction),
      icon: uEt,
      hoverDelegate: l,
      onTrigger: () => {
        this._controller.replaceAll();
      }
    }, this._hoverService));
    const c = document.createElement("div");
    c.className = "replace-part", c.appendChild(this._replaceInput.domNode);
    const u = document.createElement("div");
    u.className = "replace-actions", c.appendChild(u), u.appendChild(this._replaceBtn.domNode), u.appendChild(this._replaceAllBtn.domNode), this._toggleReplaceBtn = this._register(new LI({
      label: EEt,
      className: "codicon toggle left",
      onTrigger: () => {
        this._state.change({ isReplaceRevealed: !this._isReplaceVisible }, !1), this._isReplaceVisible && (this._replaceInput.width = Td(this._findInput.domNode), this._replaceInput.inputBox.layout()), this._showViewZone();
      }
    }, this._hoverService)), this._toggleReplaceBtn.setExpanded(this._isReplaceVisible), this._domNode = document.createElement("div"), this._domNode.className = "editor-widget find-widget", this._domNode.setAttribute("aria-hidden", "true"), this._domNode.ariaLabel = fEt, this._domNode.role = "dialog", this._domNode.style.width = `${g_}px`, this._domNode.appendChild(this._toggleReplaceBtn.domNode), this._domNode.appendChild(o), this._domNode.appendChild(this._closeBtn.domNode), this._domNode.appendChild(c), this._resizeSash = this._register(new zl(this._domNode, this, { orientation: 0, size: 2 })), this._resized = !1;
    let d = g_;
    this._register(this._resizeSash.onDidStart(() => {
      d = Td(this._domNode);
    })), this._register(this._resizeSash.onDidChange((h) => {
      this._resized = !0;
      const g = d + h.startX - h.currentX;
      if (g < g_)
        return;
      const m = parseFloat(Cq(this._domNode).maxWidth) || 0;
      g > m || (this._domNode.style.width = `${g}px`, this._isReplaceVisible && (this._replaceInput.width = Td(this._findInput.domNode)), this._findInput.inputBox.layout(), this._tryUpdateHeight());
    })), this._register(this._resizeSash.onDidReset(() => {
      const h = Td(this._domNode);
      if (h < g_)
        return;
      let g = g_;
      if (!this._resized || h === g_) {
        const m = this._codeEditor.getLayoutInfo();
        g = m.width - 28 - m.minimap.minimapWidth - 15, this._resized = !0;
      }
      this._domNode.style.width = `${g}px`, this._isReplaceVisible && (this._replaceInput.width = Td(this._findInput.domNode)), this._findInput.inputBox.layout();
    }));
  }
  updateAccessibilitySupport() {
    const e = this._codeEditor.getOption(
      2
      /* EditorOption.accessibilitySupport */
    );
    this._findInput.setFocusInputOnOptionClick(
      e !== 2
      /* AccessibilitySupport.Enabled */
    );
  }
  getViewState() {
    let e = !1;
    return this._viewZone && this._viewZoneId && (e = this._viewZone.heightInPx > this._codeEditor.getScrollTop()), {
      widgetViewZoneVisible: e,
      scrollTop: this._codeEditor.getScrollTop()
    };
  }
  setViewState(e) {
    e && e.widgetViewZoneVisible && this._layoutViewZone(e.scrollTop);
  }
};
mG.ID = "editor.contrib.findWidget";
let Poe = mG;
class LI extends Xd {
  constructor(e, t) {
    super(), this._opts = e;
    let n = "button";
    this._opts.className && (n = n + " " + this._opts.className), this._opts.icon && (n = n + " " + qt.asClassName(this._opts.icon)), this._domNode = document.createElement("div"), this._domNode.tabIndex = 0, this._domNode.className = n, this._domNode.setAttribute("role", "button"), this._domNode.setAttribute("aria-label", this._opts.label), this._register(t.setupManagedHover(e.hoverDelegate ?? rd("element"), this._domNode, this._opts.label)), this.onclick(this._domNode, (r) => {
      this._opts.onTrigger(), r.preventDefault();
    }), this.onkeydown(this._domNode, (r) => {
      var s, o;
      if (r.equals(
        10
        /* KeyCode.Space */
      ) || r.equals(
        3
        /* KeyCode.Enter */
      )) {
        this._opts.onTrigger(), r.preventDefault();
        return;
      }
      (o = (s = this._opts).onKeyDown) == null || o.call(s, r);
    });
  }
  get domNode() {
    return this._domNode;
  }
  isEnabled() {
    return this._domNode.tabIndex >= 0;
  }
  focus() {
    this._domNode.focus();
  }
  setEnabled(e) {
    this._domNode.classList.toggle("disabled", !e), this._domNode.setAttribute("aria-disabled", String(!e)), this._domNode.tabIndex = e ? 0 : -1;
  }
  setExpanded(e) {
    this._domNode.setAttribute("aria-expanded", String(!!e)), e ? (this._domNode.classList.remove(...qt.asClassNameArray(QDe)), this._domNode.classList.add(...qt.asClassNameArray(JDe))) : (this._domNode.classList.remove(...qt.asClassNameArray(JDe)), this._domNode.classList.add(...qt.asClassNameArray(QDe)));
  }
}
ng((i, e) => {
  const t = i.getColor(a1);
  t && e.addRule(`.monaco-editor .findMatch { border: 1px ${am(i.type) ? "dotted" : "solid"} ${t}; box-sizing: border-box; }`);
  const n = i.getColor(Wat);
  n && e.addRule(`.monaco-editor .findScope { border: 1px ${am(i.type) ? "dashed" : "solid"} ${n}; }`);
  const r = i.getColor(hi);
  r && e.addRule(`.monaco-editor .find-widget { border: 1px solid ${r}; }`);
  const s = i.getColor(Bat);
  s && e.addRule(`.monaco-editor .findMatchInline { color: ${s}; }`);
  const o = i.getColor(Hat);
  o && e.addRule(`.monaco-editor .currentFindMatchInline { color: ${o}; }`);
});
var IEt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, NEt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, AC, $1;
let Foe = ($1 = class {
  static getOrCreate(e) {
    return AC._instance || (AC._instance = new AC(e)), AC._instance;
  }
  constructor(e) {
    this.storageService = e, this.inMemoryValues = /* @__PURE__ */ new Set(), this._onDidChangeEmitter = new he(), this.onDidChange = this._onDidChangeEmitter.event, this.load();
  }
  delete(e) {
    const t = this.inMemoryValues.delete(e);
    return this.save(), t;
  }
  add(e) {
    return this.inMemoryValues.add(e), this.save(), this;
  }
  has(e) {
    return this.inMemoryValues.has(e);
  }
  forEach(e, t) {
    return this.load(), this.inMemoryValues.forEach(e);
  }
  replace(e) {
    this.inMemoryValues = new Set(e), this.save();
  }
  load() {
    let e;
    const t = this.storageService.get(
      AC.FIND_HISTORY_KEY,
      1
      /* StorageScope.WORKSPACE */
    );
    if (t)
      try {
        e = JSON.parse(t);
      } catch {
      }
    this.inMemoryValues = new Set(e || []);
  }
  // Run saves async
  save() {
    const e = [];
    return this.inMemoryValues.forEach((t) => e.push(t)), new Promise((t) => {
      this.storageService.store(
        AC.FIND_HISTORY_KEY,
        JSON.stringify(e),
        1,
        0
        /* StorageTarget.USER */
      ), this._onDidChangeEmitter.fire(e), t();
    });
  }
}, AC = $1, $1.FIND_HISTORY_KEY = "workbench.find.history", $1._instance = null, $1);
Foe = AC = IEt([
  NEt(0, gu)
], Foe);
var REt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, AEt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, OC, j1;
let Boe = (j1 = class {
  static getOrCreate(e) {
    return OC._instance || (OC._instance = new OC(e)), OC._instance;
  }
  constructor(e) {
    this.storageService = e, this.inMemoryValues = /* @__PURE__ */ new Set(), this._onDidChangeEmitter = new he(), this.onDidChange = this._onDidChangeEmitter.event, this.load();
  }
  delete(e) {
    const t = this.inMemoryValues.delete(e);
    return this.save(), t;
  }
  add(e) {
    return this.inMemoryValues.add(e), this.save(), this;
  }
  has(e) {
    return this.inMemoryValues.has(e);
  }
  forEach(e, t) {
    return this.load(), this.inMemoryValues.forEach(e);
  }
  replace(e) {
    this.inMemoryValues = new Set(e), this.save();
  }
  load() {
    let e;
    const t = this.storageService.get(
      OC.FIND_HISTORY_KEY,
      1
      /* StorageScope.WORKSPACE */
    );
    if (t)
      try {
        e = JSON.parse(t);
      } catch {
      }
    this.inMemoryValues = new Set(e || []);
  }
  // Run saves async
  save() {
    const e = [];
    return this.inMemoryValues.forEach((t) => e.push(t)), new Promise((t) => {
      this.storageService.store(
        OC.FIND_HISTORY_KEY,
        JSON.stringify(e),
        1,
        0
        /* StorageTarget.USER */
      ), this._onDidChangeEmitter.fire(e), t();
    });
  }
}, OC = j1, j1.FIND_HISTORY_KEY = "workbench.replace.history", j1._instance = null, j1);
Boe = OC = REt([
  AEt(0, gu)
], Boe);
var P6e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Og = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Hoe;
const OEt = 524288;
function Woe(i, e = "single", t = !1) {
  if (!i.hasModel())
    return null;
  const n = i.getSelection();
  if (e === "single" && n.startLineNumber === n.endLineNumber || e === "multiple") {
    if (n.isEmpty()) {
      const r = i.getConfiguredWordAtPosition(n.getStartPosition());
      if (r && t === !1)
        return r.word;
    } else if (i.getModel().getValueLengthInRange(n) < OEt)
      return i.getModel().getValueInRange(n);
  }
  return null;
}
var wL;
let nd = (wL = class extends ge {
  get editor() {
    return this._editor;
  }
  static get(e) {
    return e.getContribution(Hoe.ID);
  }
  constructor(e, t, n, r, s, o) {
    super(), this._editor = e, this._findWidgetVisible = m0.bindTo(t), this._contextKeyService = t, this._storageService = n, this._clipboardService = r, this._notificationService = s, this._hoverService = o, this._updateHistoryDelayer = new Gf(500), this._state = this._register(new iEt()), this.loadQueryState(), this._register(this._state.onFindReplaceStateChange((a) => this._onStateChanged(a))), this._model = null, this._register(this._editor.onDidChangeModel(() => {
      const a = this._editor.getModel() && this._state.isRevealed;
      this.disposeModel(), this._state.change({
        searchScope: null,
        matchCase: this._storageService.getBoolean("editor.matchCase", 1, !1),
        wholeWord: this._storageService.getBoolean("editor.wholeWord", 1, !1),
        isRegex: this._storageService.getBoolean("editor.isRegex", 1, !1),
        preserveCase: this._storageService.getBoolean("editor.preserveCase", 1, !1)
      }, !1), a && this._start({
        forceRevealReplace: !1,
        seedSearchStringFromSelection: "none",
        seedSearchStringFromNonEmptySelection: !1,
        seedSearchStringFromGlobalClipboard: !1,
        shouldFocus: 0,
        shouldAnimate: !1,
        updateSearchScope: !1,
        loop: this._editor.getOption(
          50
          /* EditorOption.find */
        ).loop
      });
    }));
  }
  dispose() {
    this.disposeModel(), super.dispose();
  }
  disposeModel() {
    this._model && (this._model.dispose(), this._model = null);
  }
  _onStateChanged(e) {
    this.saveQueryState(e), e.isRevealed && (this._state.isRevealed ? this._findWidgetVisible.set(!0) : (this._findWidgetVisible.reset(), this.disposeModel())), e.searchString && this.setGlobalBufferTerm(this._state.searchString);
  }
  saveQueryState(e) {
    e.isRegex && this._storageService.store(
      "editor.isRegex",
      this._state.actualIsRegex,
      1,
      1
      /* StorageTarget.MACHINE */
    ), e.wholeWord && this._storageService.store(
      "editor.wholeWord",
      this._state.actualWholeWord,
      1,
      1
      /* StorageTarget.MACHINE */
    ), e.matchCase && this._storageService.store(
      "editor.matchCase",
      this._state.actualMatchCase,
      1,
      1
      /* StorageTarget.MACHINE */
    ), e.preserveCase && this._storageService.store(
      "editor.preserveCase",
      this._state.actualPreserveCase,
      1,
      1
      /* StorageTarget.MACHINE */
    );
  }
  loadQueryState() {
    this._state.change({
      matchCase: this._storageService.getBoolean("editor.matchCase", 1, this._state.matchCase),
      wholeWord: this._storageService.getBoolean("editor.wholeWord", 1, this._state.wholeWord),
      isRegex: this._storageService.getBoolean("editor.isRegex", 1, this._state.isRegex),
      preserveCase: this._storageService.getBoolean("editor.preserveCase", 1, this._state.preserveCase)
    }, !1);
  }
  isFindInputFocused() {
    return !!AK.getValue(this._contextKeyService);
  }
  getState() {
    return this._state;
  }
  closeFindWidget() {
    this._state.change({
      isRevealed: !1,
      searchScope: null
    }, !1), this._editor.focus();
  }
  toggleCaseSensitive() {
    this._state.change({ matchCase: !this._state.matchCase }, !1), this._state.isRevealed || this.highlightFindOptions();
  }
  toggleWholeWords() {
    this._state.change({ wholeWord: !this._state.wholeWord }, !1), this._state.isRevealed || this.highlightFindOptions();
  }
  toggleRegex() {
    this._state.change({ isRegex: !this._state.isRegex }, !1), this._state.isRevealed || this.highlightFindOptions();
  }
  togglePreserveCase() {
    this._state.change({ preserveCase: !this._state.preserveCase }, !1), this._state.isRevealed || this.highlightFindOptions();
  }
  toggleSearchScope() {
    if (this._state.searchScope)
      this._state.change({ searchScope: null }, !0);
    else if (this._editor.hasModel()) {
      let e = this._editor.getSelections();
      e = e.map((t) => (t.endColumn === 1 && t.endLineNumber > t.startLineNumber && (t = t.setEndPosition(t.endLineNumber - 1, this._editor.getModel().getLineMaxColumn(t.endLineNumber - 1))), t.isEmpty() ? null : t)).filter((t) => !!t), e.length && this._state.change({ searchScope: e }, !0);
    }
  }
  setSearchString(e) {
    this._state.isRegex && (e = zd(e)), this._state.change({ searchString: e }, !1);
  }
  highlightFindOptions(e = !1) {
  }
  async _start(e, t) {
    if (this.disposeModel(), !this._editor.hasModel())
      return;
    const n = {
      ...t,
      isRevealed: !0
    };
    if (e.seedSearchStringFromSelection === "single") {
      const r = Woe(this._editor, e.seedSearchStringFromSelection, e.seedSearchStringFromNonEmptySelection);
      r && (this._state.isRegex ? n.searchString = zd(r) : n.searchString = r);
    } else if (e.seedSearchStringFromSelection === "multiple" && !e.updateSearchScope) {
      const r = Woe(this._editor, e.seedSearchStringFromSelection);
      r && (n.searchString = r);
    }
    if (!n.searchString && e.seedSearchStringFromGlobalClipboard) {
      const r = await this.getGlobalBufferTerm();
      if (!this._editor.hasModel())
        return;
      r && (n.searchString = r);
    }
    if (e.forceRevealReplace || n.isReplaceRevealed ? n.isReplaceRevealed = !0 : this._findWidgetVisible.get() || (n.isReplaceRevealed = !1), e.updateSearchScope) {
      const r = this._editor.getSelections();
      r.some((s) => !s.isEmpty()) && (n.searchScope = r);
    }
    n.loop = e.loop, this._state.change(n, !1), this._model || (this._model = new jF(this._editor, this._state));
  }
  start(e, t) {
    return this._start(e, t);
  }
  moveToNextMatch() {
    return this._model ? (this._model.moveToNextMatch(), !0) : !1;
  }
  moveToPrevMatch() {
    return this._model ? (this._model.moveToPrevMatch(), !0) : !1;
  }
  goToMatch(e) {
    return this._model ? (this._model.moveToMatch(e), !0) : !1;
  }
  replace() {
    return this._model ? (this._model.replace(), !0) : !1;
  }
  replaceAll() {
    var e;
    return this._model ? (e = this._editor.getModel()) != null && e.isTooLargeForHeapOperation() ? (this._notificationService.warn(S(935, "The file is too large to perform a replace all operation.")), !1) : (this._model.replaceAll(), !0) : !1;
  }
  selectAllMatches() {
    return this._model ? (this._model.selectAllMatches(), this._editor.focus(), !0) : !1;
  }
  async getGlobalBufferTerm() {
    return this._editor.getOption(
      50
      /* EditorOption.find */
    ).globalFindClipboard && this._editor.hasModel() && !this._editor.getModel().isTooLargeForSyncing() ? this._clipboardService.readFindText() : "";
  }
  setGlobalBufferTerm(e) {
    this._editor.getOption(
      50
      /* EditorOption.find */
    ).globalFindClipboard && this._editor.hasModel() && !this._editor.getModel().isTooLargeForSyncing() && this._clipboardService.writeFindText(e);
  }
}, Hoe = wL, wL.ID = "editor.contrib.findController", wL);
nd = Hoe = P6e([
  Og(1, Jt),
  Og(2, gu),
  Og(3, _m),
  Og(4, no),
  Og(5, od)
], nd);
let Voe = class extends nd {
  constructor(e, t, n, r, s, o, a, l) {
    super(e, n, o, a, s, l), this._contextViewService = t, this._keybindingService = r, this._widget = null, this._findOptionsWidget = null, this._findWidgetSearchHistory = Foe.getOrCreate(o), this._replaceWidgetHistory = Boe.getOrCreate(o);
  }
  async _start(e, t) {
    this._widget || this._createFindWidget();
    const n = this._editor.getSelection();
    let r = !1;
    switch (this._editor.getOption(
      50
      /* EditorOption.find */
    ).autoFindInSelection) {
      case "always":
        r = !0;
        break;
      case "never":
        r = !1;
        break;
      case "multiline": {
        r = !!n && n.startLineNumber !== n.endLineNumber;
        break;
      }
    }
    e.updateSearchScope = e.updateSearchScope || r, await super._start(e, t), this._widget && (e.shouldFocus === 2 ? this._widget.focusReplaceInput() : e.shouldFocus === 1 && this._widget.focusFindInput());
  }
  highlightFindOptions(e = !1) {
    this._widget || this._createFindWidget(), this._state.isRevealed && !e ? this._widget.highlightFindOptions() : this._findOptionsWidget.highlightFindOptions();
  }
  _createFindWidget() {
    this._widget = this._register(new Poe(this._editor, this, this._state, this._contextViewService, this._keybindingService, this._contextKeyService, this._hoverService, this._findWidgetSearchHistory, this._replaceWidgetHistory)), this._findOptionsWidget = this._register(new Aoe(this._editor, this._state, this._keybindingService));
  }
  saveViewState() {
    var e;
    return (e = this._widget) == null ? void 0 : e.getViewState();
  }
  restoreViewState(e) {
    var t;
    (t = this._widget) == null || t.setViewState(e);
  }
};
Voe = P6e([
  Og(1, g0),
  Og(2, Jt),
  Og(3, Fi),
  Og(4, no),
  Og(5, gu),
  Og(6, _m),
  Og(7, od)
], Voe);
const MEt = ZPe(new XPe({
  id: Xr.StartFindAction,
  label: Ee(942, "Find"),
  precondition: Re.or(se.focus, Re.has("editorIsOpen")),
  kbOpts: {
    kbExpr: null,
    primary: 2084,
    weight: 100
    /* KeybindingWeight.EditorContrib */
  },
  menuOpts: {
    menuId: wt.MenubarEditMenu,
    group: "3_find",
    title: S(936, "&&Find"),
    order: 1
  }
}));
MEt.addImplementation(0, (i, e, t) => {
  const n = nd.get(e);
  return n ? n.start({
    forceRevealReplace: !1,
    seedSearchStringFromSelection: e.getOption(
      50
      /* EditorOption.find */
    ).seedSearchStringFromSelection !== "never" ? "single" : "none",
    seedSearchStringFromNonEmptySelection: e.getOption(
      50
      /* EditorOption.find */
    ).seedSearchStringFromSelection === "selection",
    seedSearchStringFromGlobalClipboard: e.getOption(
      50
      /* EditorOption.find */
    ).globalFindClipboard,
    shouldFocus: 1,
    shouldAnimate: !0,
    updateSearchScope: !1,
    loop: e.getOption(
      50
      /* EditorOption.find */
    ).loop
  }) : !1;
});
const PEt = {
  description: "Open a new In-Editor Find Widget.",
  args: [{
    name: "Open a new In-Editor Find Widget args",
    schema: {
      properties: {
        searchString: { type: "string" },
        replaceString: { type: "string" },
        isRegex: { type: "boolean" },
        matchWholeWord: { type: "boolean" },
        isCaseSensitive: { type: "boolean" },
        preserveCase: { type: "boolean" },
        findInSelection: { type: "boolean" }
      }
    }
  }]
};
class FEt extends vt {
  constructor() {
    super({
      id: Xr.StartFindWithArgs,
      label: Ee(943, "Find with Arguments"),
      precondition: void 0,
      kbOpts: {
        kbExpr: null,
        primary: 0,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: PEt
    });
  }
  async run(e, t, n) {
    const r = nd.get(t);
    if (r) {
      const s = n ? {
        searchString: n.searchString,
        replaceString: n.replaceString,
        isReplaceRevealed: n.replaceString !== void 0,
        isRegex: n.isRegex,
        // isRegexOverride: args.regexOverride,
        wholeWord: n.matchWholeWord,
        // wholeWordOverride: args.wholeWordOverride,
        matchCase: n.isCaseSensitive,
        // matchCaseOverride: args.matchCaseOverride,
        preserveCase: n.preserveCase
        // preserveCaseOverride: args.preserveCaseOverride,
      } : {};
      await r.start({
        forceRevealReplace: !1,
        seedSearchStringFromSelection: r.getState().searchString.length === 0 && t.getOption(
          50
          /* EditorOption.find */
        ).seedSearchStringFromSelection !== "never" ? "single" : "none",
        seedSearchStringFromNonEmptySelection: t.getOption(
          50
          /* EditorOption.find */
        ).seedSearchStringFromSelection === "selection",
        seedSearchStringFromGlobalClipboard: !0,
        shouldFocus: 1,
        shouldAnimate: !0,
        updateSearchScope: (n == null ? void 0 : n.findInSelection) || !1,
        loop: t.getOption(
          50
          /* EditorOption.find */
        ).loop
      }, s), r.setGlobalBufferTerm(r.getState().searchString);
    }
  }
}
class BEt extends vt {
  constructor() {
    super({
      id: Xr.StartFindWithSelection,
      label: Ee(944, "Find with Selection"),
      precondition: void 0,
      kbOpts: {
        kbExpr: null,
        primary: 0,
        mac: {
          primary: 2083
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  async run(e, t) {
    const n = nd.get(t);
    n && (await n.start({
      forceRevealReplace: !1,
      seedSearchStringFromSelection: "multiple",
      seedSearchStringFromNonEmptySelection: !1,
      seedSearchStringFromGlobalClipboard: !1,
      shouldFocus: 0,
      shouldAnimate: !0,
      updateSearchScope: !1,
      loop: t.getOption(
        50
        /* EditorOption.find */
      ).loop
    }), n.setGlobalBufferTerm(n.getState().searchString));
  }
}
class F6e extends vt {
  async run(e, t) {
    const n = nd.get(t);
    n && !this._run(n) && (await n.start({
      forceRevealReplace: !1,
      seedSearchStringFromSelection: n.getState().searchString.length === 0 && t.getOption(
        50
        /* EditorOption.find */
      ).seedSearchStringFromSelection !== "never" ? "single" : "none",
      seedSearchStringFromNonEmptySelection: t.getOption(
        50
        /* EditorOption.find */
      ).seedSearchStringFromSelection === "selection",
      seedSearchStringFromGlobalClipboard: !0,
      shouldFocus: 0,
      shouldAnimate: !0,
      updateSearchScope: !1,
      loop: t.getOption(
        50
        /* EditorOption.find */
      ).loop
    }), this._run(n));
  }
}
class HEt extends F6e {
  constructor() {
    super({
      id: Xr.NextMatchFindAction,
      label: Ee(945, "Find Next"),
      precondition: void 0,
      kbOpts: [{
        kbExpr: se.focus,
        primary: 61,
        mac: { primary: 2085, secondary: [
          61
          /* KeyCode.F3 */
        ] },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }, {
        kbExpr: Re.and(se.focus, AK),
        primary: 3,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }]
    });
  }
  _run(e) {
    return e.moveToNextMatch() ? (e.editor.pushUndoStop(), !0) : !1;
  }
}
class WEt extends F6e {
  constructor() {
    super({
      id: Xr.PreviousMatchFindAction,
      label: Ee(946, "Find Previous"),
      precondition: void 0,
      kbOpts: [
        {
          kbExpr: se.focus,
          primary: 1085,
          mac: { primary: 3109, secondary: [
            1085
            /* KeyCode.F3 */
          ] },
          weight: 100
          /* KeybindingWeight.EditorContrib */
        },
        {
          kbExpr: Re.and(se.focus, AK),
          primary: 1027,
          weight: 100
          /* KeybindingWeight.EditorContrib */
        }
      ]
    });
  }
  _run(e) {
    return e.moveToPrevMatch();
  }
}
class VEt extends vt {
  constructor() {
    super({
      id: Xr.GoToMatchFindAction,
      label: Ee(947, "Go to Match..."),
      precondition: m0
    }), this._highlightDecorations = [];
  }
  run(e, t, n) {
    const r = nd.get(t);
    if (!r)
      return;
    const s = r.getState().matchesCount;
    if (s < 1) {
      e.get(no).notify({
        severity: i2.Warning,
        message: S(937, "No matches. Try searching for something else.")
      });
      return;
    }
    const o = e.get(tc), a = new ke(), l = a.add(o.createInputBox());
    l.placeholder = S(938, "Type a number to go to a specific match (between 1 and {0})", s);
    const c = (d) => {
      const h = parseInt(d);
      if (isNaN(h))
        return;
      const g = r.getState().matchesCount;
      if (h > 0 && h <= g)
        return h - 1;
      if (h < 0 && h >= -g)
        return g + h;
    }, u = (d) => {
      const h = c(d);
      if (typeof h == "number") {
        l.validationMessage = void 0, r.goToMatch(h);
        const g = r.getState().currentMatch;
        g && this.addDecorations(t, g);
      } else
        l.validationMessage = S(939, "Please type a number between 1 and {0}", r.getState().matchesCount), this.clearDecorations(t);
    };
    a.add(l.onDidChangeValue((d) => {
      u(d);
    })), a.add(l.onDidAccept(() => {
      const d = c(l.value);
      typeof d == "number" ? (r.goToMatch(d), l.hide()) : l.validationMessage = S(940, "Please type a number between 1 and {0}", r.getState().matchesCount);
    })), a.add(l.onDidHide(() => {
      this.clearDecorations(t), a.dispose();
    })), l.show();
  }
  clearDecorations(e) {
    e.changeDecorations((t) => {
      this._highlightDecorations = t.deltaDecorations(this._highlightDecorations, []);
    });
  }
  addDecorations(e, t) {
    e.changeDecorations((n) => {
      this._highlightDecorations = n.deltaDecorations(this._highlightDecorations, [
        {
          range: t,
          options: {
            description: "find-match-quick-access-range-highlight",
            className: "rangeHighlight",
            isWholeLine: !0
          }
        },
        {
          range: t,
          options: {
            description: "find-match-quick-access-range-highlight-overview",
            overviewRuler: {
              color: Ks(f3e),
              position: zh.Full
            }
          }
        }
      ]);
    });
  }
}
class B6e extends vt {
  async run(e, t) {
    const n = nd.get(t);
    if (!n)
      return;
    const r = Woe(t, "single", !1);
    r && n.setSearchString(r), this._run(n) || (await n.start({
      forceRevealReplace: !1,
      seedSearchStringFromSelection: "none",
      seedSearchStringFromNonEmptySelection: !1,
      seedSearchStringFromGlobalClipboard: !1,
      shouldFocus: 0,
      shouldAnimate: !0,
      updateSearchScope: !1,
      loop: t.getOption(
        50
        /* EditorOption.find */
      ).loop
    }), this._run(n));
  }
}
class UEt extends B6e {
  constructor() {
    super({
      id: Xr.NextSelectionMatchFindAction,
      label: Ee(948, "Find Next Selection"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 2109,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  _run(e) {
    return e.moveToNextMatch();
  }
}
class zEt extends B6e {
  constructor() {
    super({
      id: Xr.PreviousSelectionMatchFindAction,
      label: Ee(949, "Find Previous Selection"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 3133,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  _run(e) {
    return e.moveToPrevMatch();
  }
}
const $Et = ZPe(new XPe({
  id: Xr.StartFindReplaceAction,
  label: Ee(950, "Replace"),
  precondition: Re.or(se.focus, Re.has("editorIsOpen")),
  kbOpts: {
    kbExpr: null,
    primary: 2086,
    mac: {
      primary: 2596
      /* KeyCode.KeyF */
    },
    weight: 100
    /* KeybindingWeight.EditorContrib */
  },
  menuOpts: {
    menuId: wt.MenubarEditMenu,
    group: "3_find",
    title: S(941, "&&Replace"),
    order: 2
  }
}));
$Et.addImplementation(0, (i, e, t) => {
  if (!e.hasModel() || e.getOption(
    104
    /* EditorOption.readOnly */
  ))
    return !1;
  const n = nd.get(e);
  if (!n)
    return !1;
  const r = e.getSelection(), s = n.isFindInputFocused(), o = !r.isEmpty() && r.startLineNumber === r.endLineNumber && e.getOption(
    50
    /* EditorOption.find */
  ).seedSearchStringFromSelection !== "never" && !s, a = s || o ? 2 : 1;
  return n.start({
    forceRevealReplace: !0,
    seedSearchStringFromSelection: o ? "single" : "none",
    seedSearchStringFromNonEmptySelection: e.getOption(
      50
      /* EditorOption.find */
    ).seedSearchStringFromSelection === "selection",
    seedSearchStringFromGlobalClipboard: e.getOption(
      50
      /* EditorOption.find */
    ).seedSearchStringFromSelection !== "never",
    shouldFocus: a,
    shouldAnimate: !0,
    updateSearchScope: !1,
    loop: e.getOption(
      50
      /* EditorOption.find */
    ).loop
  });
});
Si(
  nd.ID,
  Voe,
  0
  /* EditorContributionInstantiation.Eager */
);
Je(FEt);
Je(BEt);
Je(HEt);
Je(WEt);
Je(VEt);
Je(UEt);
Je(zEt);
const Sm = jo.bindToContribution(nd.get);
ct(new Sm({
  id: Xr.CloseFindWidgetCommand,
  precondition: m0,
  handler: (i) => i.closeFindWidget(),
  kbOpts: {
    weight: 105,
    kbExpr: Re.and(se.focus, Re.not("isComposing")),
    primary: 9,
    secondary: [
      1033
      /* KeyCode.Escape */
    ]
  }
}));
ct(new Sm({
  id: Xr.ToggleCaseSensitiveCommand,
  precondition: void 0,
  handler: (i) => i.toggleCaseSensitive(),
  kbOpts: {
    weight: 105,
    kbExpr: se.focus,
    primary: mH.primary,
    mac: mH.mac,
    win: mH.win,
    linux: mH.linux
  }
}));
ct(new Sm({
  id: Xr.ToggleWholeWordCommand,
  precondition: void 0,
  handler: (i) => i.toggleWholeWords(),
  kbOpts: {
    weight: 105,
    kbExpr: se.focus,
    primary: _H.primary,
    mac: _H.mac,
    win: _H.win,
    linux: _H.linux
  }
}));
ct(new Sm({
  id: Xr.ToggleRegexCommand,
  precondition: void 0,
  handler: (i) => i.toggleRegex(),
  kbOpts: {
    weight: 105,
    kbExpr: se.focus,
    primary: bH.primary,
    mac: bH.mac,
    win: bH.win,
    linux: bH.linux
  }
}));
ct(new Sm({
  id: Xr.ToggleSearchScopeCommand,
  precondition: void 0,
  handler: (i) => i.toggleSearchScope(),
  kbOpts: {
    weight: 105,
    kbExpr: se.focus,
    primary: vH.primary,
    mac: vH.mac,
    win: vH.win,
    linux: vH.linux
  }
}));
ct(new Sm({
  id: Xr.TogglePreserveCaseCommand,
  precondition: void 0,
  handler: (i) => i.togglePreserveCase(),
  kbOpts: {
    weight: 105,
    kbExpr: se.focus,
    primary: yH.primary,
    mac: yH.mac,
    win: yH.win,
    linux: yH.linux
  }
}));
ct(new Sm({
  id: Xr.ReplaceOneAction,
  precondition: m0,
  handler: (i) => i.replace(),
  kbOpts: {
    weight: 105,
    kbExpr: se.focus,
    primary: 3094
    /* KeyCode.Digit1 */
  }
}));
ct(new Sm({
  id: Xr.ReplaceOneAction,
  precondition: m0,
  handler: (i) => i.replace(),
  kbOpts: {
    weight: 105,
    kbExpr: Re.and(se.focus, xpe),
    primary: 3
    /* KeyCode.Enter */
  }
}));
ct(new Sm({
  id: Xr.ReplaceAllAction,
  precondition: m0,
  handler: (i) => i.replaceAll(),
  kbOpts: {
    weight: 105,
    kbExpr: se.focus,
    primary: 2563
    /* KeyCode.Enter */
  }
}));
ct(new Sm({
  id: Xr.ReplaceAllAction,
  precondition: m0,
  handler: (i) => i.replaceAll(),
  kbOpts: {
    weight: 105,
    kbExpr: Re.and(se.focus, xpe),
    primary: void 0,
    mac: {
      primary: 2051
    }
  }
}));
ct(new Sm({
  id: Xr.SelectAllMatchesAction,
  precondition: m0,
  handler: (i) => i.selectAllMatches(),
  kbOpts: {
    weight: 105,
    kbExpr: se.focus,
    primary: 515
    /* KeyCode.Enter */
  }
}));
const jEt = {
  0: " ",
  1: "u",
  2: "r"
}, rIe = 65535, Wp = 16777215, sIe = 4278190080;
class lte {
  constructor(e) {
    const t = Math.ceil(e / 32);
    this._states = new Uint32Array(t);
  }
  get(e) {
    const t = e / 32 | 0, n = e % 32;
    return (this._states[t] & 1 << n) !== 0;
  }
  set(e, t) {
    const n = e / 32 | 0, r = e % 32, s = this._states[n];
    t ? this._states[n] = s | 1 << r : this._states[n] = s & ~(1 << r);
  }
}
class Nh {
  constructor(e, t, n) {
    if (e.length !== t.length || e.length > rIe)
      throw new Error("invalid startIndexes or endIndexes size");
    this._startIndexes = e, this._endIndexes = t, this._collapseStates = new lte(e.length), this._userDefinedStates = new lte(e.length), this._recoveredStates = new lte(e.length), this._types = n, this._parentsComputed = !1;
  }
  ensureParentIndices() {
    if (!this._parentsComputed) {
      this._parentsComputed = !0;
      const e = [], t = (n, r) => {
        const s = e[e.length - 1];
        return this.getStartLineNumber(s) <= n && this.getEndLineNumber(s) >= r;
      };
      for (let n = 0, r = this._startIndexes.length; n < r; n++) {
        const s = this._startIndexes[n], o = this._endIndexes[n];
        if (s > Wp || o > Wp)
          throw new Error("startLineNumber or endLineNumber must not exceed " + Wp);
        for (; e.length > 0 && !t(s, o); )
          e.pop();
        const a = e.length > 0 ? e[e.length - 1] : -1;
        e.push(n), this._startIndexes[n] = s + ((a & 255) << 24), this._endIndexes[n] = o + ((a & 65280) << 16);
      }
    }
  }
  get length() {
    return this._startIndexes.length;
  }
  getStartLineNumber(e) {
    return this._startIndexes[e] & Wp;
  }
  getEndLineNumber(e) {
    return this._endIndexes[e] & Wp;
  }
  getType(e) {
    return this._types ? this._types[e] : void 0;
  }
  hasTypes() {
    return !!this._types;
  }
  isCollapsed(e) {
    return this._collapseStates.get(e);
  }
  setCollapsed(e, t) {
    this._collapseStates.set(e, t);
  }
  isUserDefined(e) {
    return this._userDefinedStates.get(e);
  }
  setUserDefined(e, t) {
    return this._userDefinedStates.set(e, t);
  }
  isRecovered(e) {
    return this._recoveredStates.get(e);
  }
  setRecovered(e, t) {
    return this._recoveredStates.set(e, t);
  }
  getSource(e) {
    return this.isUserDefined(e) ? 1 : this.isRecovered(e) ? 2 : 0;
  }
  setSource(e, t) {
    t === 1 ? (this.setUserDefined(e, !0), this.setRecovered(e, !1)) : t === 2 ? (this.setUserDefined(e, !1), this.setRecovered(e, !0)) : (this.setUserDefined(e, !1), this.setRecovered(e, !1));
  }
  setCollapsedAllOfType(e, t) {
    let n = !1;
    if (this._types)
      for (let r = 0; r < this._types.length; r++)
        this._types[r] === e && (this.setCollapsed(r, t), n = !0);
    return n;
  }
  toRegion(e) {
    return new GEt(this, e);
  }
  getParentIndex(e) {
    this.ensureParentIndices();
    const t = ((this._startIndexes[e] & sIe) >>> 24) + ((this._endIndexes[e] & sIe) >>> 16);
    return t === rIe ? -1 : t;
  }
  contains(e, t) {
    return this.getStartLineNumber(e) <= t && this.getEndLineNumber(e) >= t;
  }
  findIndex(e) {
    let t = 0, n = this._startIndexes.length;
    if (n === 0)
      return -1;
    for (; t < n; ) {
      const r = Math.floor((t + n) / 2);
      e < this.getStartLineNumber(r) ? n = r : t = r + 1;
    }
    return t - 1;
  }
  findRange(e) {
    let t = this.findIndex(e);
    if (t >= 0) {
      if (this.getEndLineNumber(t) >= e)
        return t;
      for (t = this.getParentIndex(t); t !== -1; ) {
        if (this.contains(t, e))
          return t;
        t = this.getParentIndex(t);
      }
    }
    return -1;
  }
  toString() {
    const e = [];
    for (let t = 0; t < this.length; t++)
      e[t] = `[${jEt[this.getSource(t)]}${this.isCollapsed(t) ? "+" : "-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;
    return e.join(", ");
  }
  toFoldRange(e) {
    return {
      startLineNumber: this._startIndexes[e] & Wp,
      endLineNumber: this._endIndexes[e] & Wp,
      type: this._types ? this._types[e] : void 0,
      isCollapsed: this.isCollapsed(e),
      source: this.getSource(e)
    };
  }
  static fromFoldRanges(e) {
    const t = e.length, n = new Uint32Array(t), r = new Uint32Array(t);
    let s = [], o = !1;
    for (let l = 0; l < t; l++) {
      const c = e[l];
      n[l] = c.startLineNumber, r[l] = c.endLineNumber, s.push(c.type), c.type && (o = !0);
    }
    o || (s = void 0);
    const a = new Nh(n, r, s);
    for (let l = 0; l < t; l++)
      e[l].isCollapsed && a.setCollapsed(l, !0), a.setSource(l, e[l].source);
    return a;
  }
  /**
   * Two inputs, each a FoldingRegions or a FoldRange[], are merged.
   * Each input must be pre-sorted on startLineNumber.
   * The first list is assumed to always include all regions currently defined by range providers.
   * The second list only contains the previously collapsed and all manual ranges.
   * If the line position matches, the range of the new range is taken, and the range is no longer manual
   * When an entry in one list overlaps an entry in the other, the second list's entry "wins" and
   * overlapping entries in the first list are discarded.
   * Invalid entries are discarded. An entry is invalid if:
   * 		the start and end line numbers aren't a valid range of line numbers,
   * 		it is out of sequence or has the same start line as a preceding entry,
   * 		it overlaps a preceding entry and is not fully contained by that entry.
   */
  static sanitizeAndMerge(e, t, n, r) {
    n = n ?? Number.MAX_VALUE;
    const s = (v, w) => Array.isArray(v) ? ((E) => E < w ? v[E] : void 0) : ((E) => E < w ? v.toFoldRange(E) : void 0), o = s(e, e.length), a = s(t, t.length);
    let l = 0, c = 0, u = o(0), d = a(0);
    const h = [];
    let g, m = 0;
    const _ = [];
    for (; u || d; ) {
      let v;
      if (d && (!u || u.startLineNumber >= d.startLineNumber))
        u && u.startLineNumber === d.startLineNumber ? (d.source === 1 ? v = d : (v = u, v.isCollapsed = d.isCollapsed && (u.endLineNumber === d.endLineNumber || !(r != null && r.startsInside(u.startLineNumber + 1, u.endLineNumber + 1))), v.source = 0), u = o(++l)) : (v = d, d.isCollapsed && d.source === 0 && (v.source = 2)), d = a(++c);
      else {
        let w = c, E = d;
        for (; ; ) {
          if (!E || E.startLineNumber > u.endLineNumber) {
            v = u;
            break;
          }
          if (E.source === 1 && E.endLineNumber > u.endLineNumber)
            break;
          E = a(++w);
        }
        u = o(++l);
      }
      if (v) {
        for (; g && g.endLineNumber < v.startLineNumber; )
          g = h.pop();
        v.endLineNumber > v.startLineNumber && v.startLineNumber > m && v.endLineNumber <= n && (!g || g.endLineNumber >= v.endLineNumber) && (_.push(v), m = v.startLineNumber, g && h.push(g), g = v);
      }
    }
    return _;
  }
}
class GEt {
  constructor(e, t) {
    this.ranges = e, this.index = t;
  }
  get startLineNumber() {
    return this.ranges.getStartLineNumber(this.index);
  }
  get endLineNumber() {
    return this.ranges.getEndLineNumber(this.index);
  }
  get regionIndex() {
    return this.index;
  }
  get parentIndex() {
    return this.ranges.getParentIndex(this.index);
  }
  get isCollapsed() {
    return this.ranges.isCollapsed(this.index);
  }
  containedBy(e) {
    return e.startLineNumber <= this.startLineNumber && e.endLineNumber >= this.endLineNumber;
  }
  containsLine(e) {
    return this.startLineNumber <= e && e <= this.endLineNumber;
  }
}
class qEt {
  get regions() {
    return this._regions;
  }
  get textModel() {
    return this._textModel;
  }
  constructor(e, t) {
    this._updateEventEmitter = new he(), this.onDidChange = this._updateEventEmitter.event, this._textModel = e, this._decorationProvider = t, this._regions = new Nh(new Uint32Array(0), new Uint32Array(0)), this._editorDecorationIds = [];
  }
  toggleCollapseState(e) {
    if (!e.length)
      return;
    e = e.sort((n, r) => n.regionIndex - r.regionIndex);
    const t = {};
    this._decorationProvider.changeDecorations((n) => {
      let r = 0, s = -1, o = -1;
      const a = (l) => {
        for (; r < l; ) {
          const c = this._regions.getEndLineNumber(r), u = this._regions.isCollapsed(r);
          if (c <= s) {
            const d = this.regions.getSource(r) !== 0;
            n.changeDecorationOptions(this._editorDecorationIds[r], this._decorationProvider.getDecorationOption(u, c <= o, d));
          }
          u && c > o && (o = c), r++;
        }
      };
      for (const l of e) {
        const c = l.regionIndex, u = this._editorDecorationIds[c];
        if (u && !t[u]) {
          t[u] = !0, a(c);
          const d = !this._regions.isCollapsed(c);
          this._regions.setCollapsed(c, d), s = Math.max(s, this._regions.getEndLineNumber(c));
        }
      }
      a(this._regions.length);
    }), this._updateEventEmitter.fire({ model: this, collapseStateChanged: e });
  }
  removeManualRanges(e) {
    const t = new Array(), n = (r) => {
      for (const s of e)
        if (!(s.startLineNumber > r.endLineNumber || r.startLineNumber > s.endLineNumber))
          return !0;
      return !1;
    };
    for (let r = 0; r < this._regions.length; r++) {
      const s = this._regions.toFoldRange(r);
      (s.source === 0 || !n(s)) && t.push(s);
    }
    this.updatePost(Nh.fromFoldRanges(t));
  }
  update(e, t) {
    const n = this._currentFoldedOrManualRanges(t), r = Nh.sanitizeAndMerge(e, n, this._textModel.getLineCount(), t);
    this.updatePost(Nh.fromFoldRanges(r));
  }
  updatePost(e) {
    const t = [];
    let n = -1;
    for (let r = 0, s = e.length; r < s; r++) {
      const o = e.getStartLineNumber(r), a = e.getEndLineNumber(r), l = e.isCollapsed(r), c = e.getSource(r) !== 0, u = {
        startLineNumber: o,
        startColumn: this._textModel.getLineMaxColumn(o),
        endLineNumber: a,
        endColumn: this._textModel.getLineMaxColumn(a) + 1
      };
      t.push({ range: u, options: this._decorationProvider.getDecorationOption(l, a <= n, c) }), l && a > n && (n = a);
    }
    this._decorationProvider.changeDecorations((r) => this._editorDecorationIds = r.deltaDecorations(this._editorDecorationIds, t)), this._regions = e, this._updateEventEmitter.fire({ model: this });
  }
  _currentFoldedOrManualRanges(e) {
    const t = [];
    for (let n = 0, r = this._regions.length; n < r; n++) {
      let s = this.regions.isCollapsed(n);
      const o = this.regions.getSource(n);
      if (s || o !== 0) {
        const a = this._regions.toFoldRange(n), l = this._textModel.getDecorationRange(this._editorDecorationIds[n]);
        l && (s && (e != null && e.startsInside(l.startLineNumber + 1, l.endLineNumber)) && (s = !1), t.push({
          startLineNumber: l.startLineNumber,
          endLineNumber: l.endLineNumber,
          type: a.type,
          isCollapsed: s,
          source: o
        }));
      }
    }
    return t;
  }
  /**
   * Collapse state memento, for persistence only
   */
  getMemento() {
    const e = this._currentFoldedOrManualRanges(), t = [], n = this._textModel.getLineCount();
    for (let r = 0, s = e.length; r < s; r++) {
      const o = e[r];
      if (o.startLineNumber >= o.endLineNumber || o.startLineNumber < 1 || o.endLineNumber > n)
        continue;
      const a = this._getLinesChecksum(o.startLineNumber + 1, o.endLineNumber);
      t.push({
        startLineNumber: o.startLineNumber,
        endLineNumber: o.endLineNumber,
        isCollapsed: o.isCollapsed,
        source: o.source,
        checksum: a
      });
    }
    return t.length > 0 ? t : void 0;
  }
  /**
   * Apply persisted state, for persistence only
   */
  applyMemento(e) {
    if (!Array.isArray(e))
      return;
    const t = [], n = this._textModel.getLineCount();
    for (const s of e) {
      if (s.startLineNumber >= s.endLineNumber || s.startLineNumber < 1 || s.endLineNumber > n)
        continue;
      const o = this._getLinesChecksum(s.startLineNumber + 1, s.endLineNumber);
      (!s.checksum || o === s.checksum) && t.push({
        startLineNumber: s.startLineNumber,
        endLineNumber: s.endLineNumber,
        type: void 0,
        isCollapsed: s.isCollapsed ?? !0,
        source: s.source ?? 0
        /* FoldSource.provider */
      });
    }
    const r = Nh.sanitizeAndMerge(this._regions, t, n);
    this.updatePost(Nh.fromFoldRanges(r));
  }
  _getLinesChecksum(e, t) {
    return bB(this._textModel.getLineContent(e) + this._textModel.getLineContent(t)) % 1e6;
  }
  dispose() {
    this._decorationProvider.removeDecorations(this._editorDecorationIds);
  }
  getAllRegionsAtLine(e, t) {
    const n = [];
    if (this._regions) {
      let r = this._regions.findRange(e), s = 1;
      for (; r >= 0; ) {
        const o = this._regions.toRegion(r);
        (!t || t(o, s)) && n.push(o), s++, r = o.parentIndex;
      }
    }
    return n;
  }
  getRegionAtLine(e) {
    if (this._regions) {
      const t = this._regions.findRange(e);
      if (t >= 0)
        return this._regions.toRegion(t);
    }
    return null;
  }
  getRegionsInside(e, t) {
    const n = [], r = e ? e.regionIndex + 1 : 0, s = e ? e.endLineNumber : Number.MAX_VALUE;
    if (t && t.length === 2) {
      const o = [];
      for (let a = r, l = this._regions.length; a < l; a++) {
        const c = this._regions.toRegion(a);
        if (this._regions.getStartLineNumber(a) < s) {
          for (; o.length > 0 && !c.containedBy(o[o.length - 1]); )
            o.pop();
          o.push(c), t(c, o.length) && n.push(c);
        } else
          break;
      }
    } else
      for (let o = r, a = this._regions.length; o < a; o++) {
        const l = this._regions.toRegion(o);
        if (this._regions.getStartLineNumber(o) < s)
          (!t || t(l)) && n.push(l);
        else
          break;
      }
    return n;
  }
}
function kpe(i, e, t) {
  const n = [];
  for (const r of t) {
    const s = i.getRegionAtLine(r);
    if (s) {
      const o = !s.isCollapsed;
      if (n.push(s), e > 1) {
        const a = i.getRegionsInside(s, (l, c) => l.isCollapsed !== o && c < e);
        n.push(...a);
      }
    }
  }
  i.toggleCollapseState(n);
}
function d2(i, e, t = Number.MAX_VALUE, n) {
  const r = [];
  if (n && n.length > 0)
    for (const s of n) {
      const o = i.getRegionAtLine(s);
      if (o && (o.isCollapsed !== e && r.push(o), t > 1)) {
        const a = i.getRegionsInside(o, (l, c) => l.isCollapsed !== e && c < t);
        r.push(...a);
      }
    }
  else {
    const s = i.getRegionsInside(null, (o, a) => o.isCollapsed !== e && a < t);
    r.push(...s);
  }
  i.toggleCollapseState(r);
}
function H6e(i, e, t, n) {
  const r = [];
  for (const s of n) {
    const o = i.getAllRegionsAtLine(s, (a, l) => a.isCollapsed !== e && l <= t);
    r.push(...o);
  }
  i.toggleCollapseState(r);
}
function KEt(i, e, t) {
  const n = [];
  for (const r of t) {
    const s = i.getAllRegionsAtLine(r, (o) => o.isCollapsed !== e);
    s.length > 0 && n.push(s[0]);
  }
  i.toggleCollapseState(n);
}
function YEt(i, e, t, n) {
  const r = (o, a) => a === e && o.isCollapsed !== t && !n.some((l) => o.containsLine(l)), s = i.getRegionsInside(null, r);
  i.toggleCollapseState(s);
}
function W6e(i, e, t) {
  const n = [];
  for (const o of t) {
    const a = i.getAllRegionsAtLine(o, void 0);
    a.length > 0 && n.push(a[0]);
  }
  const r = (o) => n.every((a) => !a.containedBy(o) && !o.containedBy(a)) && o.isCollapsed !== e, s = i.getRegionsInside(null, r);
  i.toggleCollapseState(s);
}
function Dpe(i, e, t) {
  const n = i.textModel, r = i.regions, s = [];
  for (let o = r.length - 1; o >= 0; o--)
    if (t !== r.isCollapsed(o)) {
      const a = r.getStartLineNumber(o);
      e.test(n.getLineContent(a)) && s.push(r.toRegion(o));
    }
  i.toggleCollapseState(s);
}
function Ipe(i, e, t) {
  const n = i.regions, r = [];
  for (let s = n.length - 1; s >= 0; s--)
    t !== n.isCollapsed(s) && e === n.getType(s) && r.push(n.toRegion(s));
  i.toggleCollapseState(r);
}
function XEt(i, e) {
  let t = null;
  const n = e.getRegionAtLine(i);
  if (n !== null && (t = n.startLineNumber, i === t)) {
    const r = n.parentIndex;
    r !== -1 ? t = e.regions.getStartLineNumber(r) : t = null;
  }
  return t;
}
function ZEt(i, e) {
  let t = e.getRegionAtLine(i);
  if (t !== null && t.startLineNumber === i) {
    if (i !== t.startLineNumber)
      return t.startLineNumber;
    {
      const n = t.parentIndex;
      let r = 0;
      for (n !== -1 && (r = e.regions.getStartLineNumber(t.parentIndex)); t !== null; )
        if (t.regionIndex > 0) {
          if (t = e.regions.toRegion(t.regionIndex - 1), t.startLineNumber <= r)
            return null;
          if (t.parentIndex === n)
            return t.startLineNumber;
        } else
          return null;
    }
  } else if (e.regions.length > 0)
    for (t = e.regions.toRegion(e.regions.length - 1); t !== null; ) {
      if (t.startLineNumber < i)
        return t.startLineNumber;
      t.regionIndex > 0 ? t = e.regions.toRegion(t.regionIndex - 1) : t = null;
    }
  return null;
}
function QEt(i, e) {
  let t = e.getRegionAtLine(i);
  if (t !== null && t.startLineNumber === i) {
    const n = t.parentIndex;
    let r = 0;
    if (n !== -1)
      r = e.regions.getEndLineNumber(t.parentIndex);
    else {
      if (e.regions.length === 0)
        return null;
      r = e.regions.getEndLineNumber(e.regions.length - 1);
    }
    for (; t !== null; )
      if (t.regionIndex < e.regions.length) {
        if (t = e.regions.toRegion(t.regionIndex + 1), t.startLineNumber >= r)
          return null;
        if (t.parentIndex === n)
          return t.startLineNumber;
      } else
        return null;
  } else if (e.regions.length > 0)
    for (t = e.regions.toRegion(0); t !== null; ) {
      if (t.startLineNumber > i)
        return t.startLineNumber;
      t.regionIndex < e.regions.length ? t = e.regions.toRegion(t.regionIndex + 1) : t = null;
    }
  return null;
}
class JEt {
  get onDidChange() {
    return this._updateEventEmitter.event;
  }
  get hiddenRanges() {
    return this._hiddenRanges;
  }
  constructor(e) {
    this._updateEventEmitter = new he(), this._hasLineChanges = !1, this._foldingModel = e, this._foldingModelListener = e.onDidChange((t) => this.updateHiddenRanges()), this._hiddenRanges = [], e.regions.length && this.updateHiddenRanges();
  }
  notifyChangeModelContent(e) {
    this._hiddenRanges.length && !this._hasLineChanges && (this._hasLineChanges = e.changes.some((t) => t.range.endLineNumber !== t.range.startLineNumber || lw(t.text)[0] !== 0));
  }
  updateHiddenRanges() {
    let e = !1;
    const t = [];
    let n = 0, r = 0, s = Number.MAX_VALUE, o = -1;
    const a = this._foldingModel.regions;
    for (; n < a.length; n++) {
      if (!a.isCollapsed(n))
        continue;
      const l = a.getStartLineNumber(n) + 1, c = a.getEndLineNumber(n);
      s <= l && c <= o || (!e && r < this._hiddenRanges.length && this._hiddenRanges[r].startLineNumber === l && this._hiddenRanges[r].endLineNumber === c ? (t.push(this._hiddenRanges[r]), r++) : (e = !0, t.push(new z(l, 1, c, 1))), s = l, o = c);
    }
    (this._hasLineChanges || e || r < this._hiddenRanges.length) && this.applyHiddenRanges(t);
  }
  applyHiddenRanges(e) {
    this._hiddenRanges = e, this._hasLineChanges = !1, this._updateEventEmitter.fire(e);
  }
  hasRanges() {
    return this._hiddenRanges.length > 0;
  }
  isHidden(e) {
    return oIe(this._hiddenRanges, e) !== null;
  }
  adjustSelections(e) {
    let t = !1;
    const n = this._foldingModel.textModel;
    let r = null;
    const s = (o) => ((!r || !ext(o, r)) && (r = oIe(this._hiddenRanges, o)), r ? r.startLineNumber - 1 : null);
    for (let o = 0, a = e.length; o < a; o++) {
      let l = e[o];
      const c = s(l.startLineNumber);
      c && (l = l.setStartPosition(c, n.getLineMaxColumn(c)), t = !0);
      const u = s(l.endLineNumber);
      u && (l = l.setEndPosition(u, n.getLineMaxColumn(u)), t = !0), e[o] = l;
    }
    return t;
  }
  dispose() {
    this.hiddenRanges.length > 0 && (this._hiddenRanges = [], this._updateEventEmitter.fire(this._hiddenRanges)), this._foldingModelListener && (this._foldingModelListener.dispose(), this._foldingModelListener = null);
  }
}
function ext(i, e) {
  return i >= e.startLineNumber && i <= e.endLineNumber;
}
function oIe(i, e) {
  const t = S4(i, (n) => e < n.startLineNumber) - 1;
  return t >= 0 && i[t].endLineNumber >= e ? i[t] : null;
}
const txt = 5e3, nxt = "indent";
class Npe {
  constructor(e, t, n) {
    this.editorModel = e, this.languageConfigurationService = t, this.foldingRangesLimit = n, this.id = nxt;
  }
  dispose() {
  }
  compute(e) {
    const t = this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules, n = t && !!t.offSide, r = t && t.markers;
    return Promise.resolve(sxt(this.editorModel, n, r, this.foldingRangesLimit));
  }
}
let ixt = class {
  constructor(e) {
    this._startIndexes = [], this._endIndexes = [], this._indentOccurrences = [], this._length = 0, this._foldingRangesLimit = e;
  }
  insertFirst(e, t, n) {
    if (e > Wp || t > Wp)
      return;
    const r = this._length;
    this._startIndexes[r] = e, this._endIndexes[r] = t, this._length++, n < 1e3 && (this._indentOccurrences[n] = (this._indentOccurrences[n] || 0) + 1);
  }
  toIndentRanges(e) {
    const t = this._foldingRangesLimit.limit;
    if (this._length <= t) {
      this._foldingRangesLimit.update(this._length, !1);
      const n = new Uint32Array(this._length), r = new Uint32Array(this._length);
      for (let s = this._length - 1, o = 0; s >= 0; s--, o++)
        n[o] = this._startIndexes[s], r[o] = this._endIndexes[s];
      return new Nh(n, r);
    } else {
      this._foldingRangesLimit.update(this._length, t);
      let n = 0, r = this._indentOccurrences.length;
      for (let l = 0; l < this._indentOccurrences.length; l++) {
        const c = this._indentOccurrences[l];
        if (c) {
          if (c + n > t) {
            r = l;
            break;
          }
          n += c;
        }
      }
      const s = e.getOptions().tabSize, o = new Uint32Array(t), a = new Uint32Array(t);
      for (let l = this._length - 1, c = 0; l >= 0; l--) {
        const u = this._startIndexes[l], d = e.getLineContent(u), h = iK(d, s);
        (h < r || h === r && n++ < t) && (o[c] = u, a[c] = this._endIndexes[l], c++);
      }
      return new Nh(o, a);
    }
  }
};
const rxt = {
  limit: txt,
  update: () => {
  }
};
function sxt(i, e, t, n = rxt) {
  const r = i.getOptions().tabSize, s = new ixt(n);
  let o;
  t && (o = new RegExp(`(${t.start.source})|(?:${t.end.source})`));
  const a = [], l = i.getLineCount() + 1;
  a.push({ indent: -1, endAbove: l, line: l });
  for (let c = i.getLineCount(); c > 0; c--) {
    const u = i.getLineContent(c), d = iK(u, r);
    let h = a[a.length - 1];
    if (d === -1) {
      e && (h.endAbove = c);
      continue;
    }
    let g;
    if (o && (g = u.match(o)))
      if (g[1]) {
        let m = a.length - 1;
        for (; m > 0 && a[m].indent !== -2; )
          m--;
        if (m > 0) {
          a.length = m + 1, h = a[m], s.insertFirst(c, h.line, d), h.line = c, h.indent = d, h.endAbove = c;
          continue;
        }
      } else {
        a.push({ indent: -2, endAbove: c, line: c });
        continue;
      }
    if (h.indent > d) {
      do
        a.pop(), h = a[a.length - 1];
      while (h.indent > d);
      const m = h.endAbove - 1;
      m - c >= 1 && s.insertFirst(c, m, d);
    }
    h.indent === d ? h.endAbove = c : a.push({ indent: d, endAbove: c, line: c });
  }
  return s.toIndentRanges(i);
}
const oxt = ie("editor.foldBackground", { light: hn(o1, 0.3), dark: hn(o1, 0.3), hcDark: null, hcLight: null }, S(997, "Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("editor.foldPlaceholderForeground", { light: "#808080", dark: "#808080", hcDark: null, hcLight: null }, S(998, "Color of the collapsed text after the first line of a folded range."));
ie("editorGutter.foldingControlForeground", eU, S(999, "Color of the folding control in the editor gutter."));
const Lz = es("folding-expanded", Pe.chevronDown, S(1e3, "Icon for expanded ranges in the editor glyph margin.")), Tz = es("folding-collapsed", Pe.chevronRight, S(1001, "Icon for collapsed ranges in the editor glyph margin.")), aIe = es("folding-manual-collapsed", Tz, S(1002, "Icon for manually collapsed ranges in the editor glyph margin.")), lIe = es("folding-manual-expanded", Lz, S(1003, "Icon for manually expanded ranges in the editor glyph margin.")), cte = {
  color: Ks(oxt),
  position: 1
  /* MinimapPosition.Inline */
}, TI = S(1004, "Click to expand the range."), SH = S(1005, "Click to collapse the range."), Po = class Po {
  constructor(e) {
    this.editor = e, this.showFoldingControls = "mouseover", this.showFoldingHighlights = !0;
  }
  getDecorationOption(e, t, n) {
    return t ? Po.HIDDEN_RANGE_DECORATION : this.showFoldingControls === "never" ? e ? this.showFoldingHighlights ? Po.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION : Po.NO_CONTROLS_COLLAPSED_RANGE_DECORATION : Po.NO_CONTROLS_EXPANDED_RANGE_DECORATION : e ? n ? this.showFoldingHighlights ? Po.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : Po.MANUALLY_COLLAPSED_VISUAL_DECORATION : this.showFoldingHighlights ? Po.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION : Po.COLLAPSED_VISUAL_DECORATION : this.showFoldingControls === "mouseover" ? n ? Po.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION : Po.EXPANDED_AUTO_HIDE_VISUAL_DECORATION : n ? Po.MANUALLY_EXPANDED_VISUAL_DECORATION : Po.EXPANDED_VISUAL_DECORATION;
  }
  changeDecorations(e) {
    return this.editor.changeDecorations(e);
  }
  removeDecorations(e) {
    this.editor.removeDecorations(e);
  }
};
Po.COLLAPSED_VISUAL_DECORATION = dn.register({
  description: "folding-collapsed-visual-decoration",
  stickiness: 0,
  afterContentClassName: "inline-folded",
  isWholeLine: !0,
  linesDecorationsTooltip: TI,
  firstLineDecorationClassName: qt.asClassName(Tz)
}), Po.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = dn.register({
  description: "folding-collapsed-highlighted-visual-decoration",
  stickiness: 0,
  afterContentClassName: "inline-folded",
  className: "folded-background",
  minimap: cte,
  isWholeLine: !0,
  linesDecorationsTooltip: TI,
  firstLineDecorationClassName: qt.asClassName(Tz)
}), Po.MANUALLY_COLLAPSED_VISUAL_DECORATION = dn.register({
  description: "folding-manually-collapsed-visual-decoration",
  stickiness: 0,
  afterContentClassName: "inline-folded",
  isWholeLine: !0,
  linesDecorationsTooltip: TI,
  firstLineDecorationClassName: qt.asClassName(aIe)
}), Po.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION = dn.register({
  description: "folding-manually-collapsed-highlighted-visual-decoration",
  stickiness: 0,
  afterContentClassName: "inline-folded",
  className: "folded-background",
  minimap: cte,
  isWholeLine: !0,
  linesDecorationsTooltip: TI,
  firstLineDecorationClassName: qt.asClassName(aIe)
}), Po.NO_CONTROLS_COLLAPSED_RANGE_DECORATION = dn.register({
  description: "folding-no-controls-range-decoration",
  stickiness: 0,
  afterContentClassName: "inline-folded",
  isWholeLine: !0,
  linesDecorationsTooltip: TI
}), Po.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION = dn.register({
  description: "folding-no-controls-range-decoration",
  stickiness: 0,
  afterContentClassName: "inline-folded",
  className: "folded-background",
  minimap: cte,
  isWholeLine: !0,
  linesDecorationsTooltip: TI
}), Po.EXPANDED_VISUAL_DECORATION = dn.register({
  description: "folding-expanded-visual-decoration",
  stickiness: 1,
  isWholeLine: !0,
  firstLineDecorationClassName: "alwaysShowFoldIcons " + qt.asClassName(Lz),
  linesDecorationsTooltip: SH
}), Po.EXPANDED_AUTO_HIDE_VISUAL_DECORATION = dn.register({
  description: "folding-expanded-auto-hide-visual-decoration",
  stickiness: 1,
  isWholeLine: !0,
  firstLineDecorationClassName: qt.asClassName(Lz),
  linesDecorationsTooltip: SH
}), Po.MANUALLY_EXPANDED_VISUAL_DECORATION = dn.register({
  description: "folding-manually-expanded-visual-decoration",
  stickiness: 0,
  isWholeLine: !0,
  firstLineDecorationClassName: "alwaysShowFoldIcons " + qt.asClassName(lIe),
  linesDecorationsTooltip: SH
}), Po.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION = dn.register({
  description: "folding-manually-expanded-auto-hide-visual-decoration",
  stickiness: 0,
  isWholeLine: !0,
  firstLineDecorationClassName: qt.asClassName(lIe),
  linesDecorationsTooltip: SH
}), Po.NO_CONTROLS_EXPANDED_RANGE_DECORATION = dn.register({
  description: "folding-no-controls-range-decoration",
  stickiness: 0,
  isWholeLine: !0
}), Po.HIDDEN_RANGE_DECORATION = dn.register({
  description: "folding-hidden-range-decoration",
  stickiness: 1
  /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
});
let Uoe = Po;
const axt = {}, lxt = "syntax";
class Rpe {
  constructor(e, t, n, r, s) {
    this.editorModel = e, this.providers = t, this.handleFoldingRangesChange = n, this.foldingRangesLimit = r, this.fallbackRangeProvider = s, this.id = lxt, this.disposables = new ke(), s && this.disposables.add(s);
    for (const o of t)
      typeof o.onDidChange == "function" && this.disposables.add(o.onDidChange(n));
  }
  compute(e) {
    return cxt(this.providers, this.editorModel, e).then((t) => {
      var n;
      return this.editorModel.isDisposed() ? null : t ? dxt(t, this.foldingRangesLimit) : ((n = this.fallbackRangeProvider) == null ? void 0 : n.compute(e)) ?? null;
    });
  }
  dispose() {
    this.disposables.dispose();
  }
}
function cxt(i, e, t) {
  let n = null;
  const r = i.map((s, o) => Promise.resolve(s.provideFoldingRanges(e, axt, t)).then((a) => {
    if (!t.isCancellationRequested && Array.isArray(a)) {
      Array.isArray(n) || (n = []);
      const l = e.getLineCount();
      for (const c of a)
        c.start > 0 && c.end > c.start && c.end <= l && n.push({ start: c.start, end: c.end, rank: o, kind: c.kind });
    }
  }, No));
  return Promise.all(r).then((s) => n);
}
class uxt {
  constructor(e) {
    this._startIndexes = [], this._endIndexes = [], this._nestingLevels = [], this._nestingLevelCounts = [], this._types = [], this._length = 0, this._foldingRangesLimit = e;
  }
  add(e, t, n, r) {
    if (e > Wp || t > Wp)
      return;
    const s = this._length;
    this._startIndexes[s] = e, this._endIndexes[s] = t, this._nestingLevels[s] = r, this._types[s] = n, this._length++, r < 30 && (this._nestingLevelCounts[r] = (this._nestingLevelCounts[r] || 0) + 1);
  }
  toIndentRanges() {
    const e = this._foldingRangesLimit.limit;
    if (this._length <= e) {
      this._foldingRangesLimit.update(this._length, !1);
      const t = new Uint32Array(this._length), n = new Uint32Array(this._length);
      for (let r = 0; r < this._length; r++)
        t[r] = this._startIndexes[r], n[r] = this._endIndexes[r];
      return new Nh(t, n, this._types);
    } else {
      this._foldingRangesLimit.update(this._length, e);
      let t = 0, n = this._nestingLevelCounts.length;
      for (let a = 0; a < this._nestingLevelCounts.length; a++) {
        const l = this._nestingLevelCounts[a];
        if (l) {
          if (l + t > e) {
            n = a;
            break;
          }
          t += l;
        }
      }
      const r = new Uint32Array(e), s = new Uint32Array(e), o = [];
      for (let a = 0, l = 0; a < this._length; a++) {
        const c = this._nestingLevels[a];
        (c < n || c === n && t++ < e) && (r[l] = this._startIndexes[a], s[l] = this._endIndexes[a], o[l] = this._types[a], l++);
      }
      return new Nh(r, s, o);
    }
  }
}
function dxt(i, e) {
  const t = i.sort((o, a) => {
    let l = o.start - a.start;
    return l === 0 && (l = o.rank - a.rank), l;
  }), n = new uxt(e);
  let r;
  const s = [];
  for (const o of t)
    if (!r)
      r = o, n.add(o.start, o.end, o.kind && o.kind.value, s.length);
    else if (o.start > r.start)
      if (o.end <= r.end)
        s.push(r), r = o, n.add(o.start, o.end, o.kind && o.kind.value, s.length);
      else {
        if (o.start > r.end) {
          do
            r = s.pop();
          while (r && o.start > r.end);
          r && s.push(r), r = o;
        }
        n.add(o.start, o.end, o.kind && o.kind.value, s.length);
      }
  return n.toIndentRanges();
}
var hxt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, lP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, DE;
const Ja = new ut("foldingEnabled", !1);
var SL;
let gw = (SL = class extends ge {
  static get(e) {
    return e.getContribution(DE.ID);
  }
  static getFoldingRangeProviders(e, t) {
    var r;
    const n = e.foldingRangeProvider.ordered(t);
    return ((r = DE._foldingRangeSelector) == null ? void 0 : r.call(DE, n, t)) ?? n;
  }
  constructor(e, t, n, r, s, o) {
    super(), this.contextKeyService = t, this.languageConfigurationService = n, this.languageFeaturesService = o, this.localToDispose = this._register(new ke()), this.editor = e, this._foldingLimitReporter = this._register(new V6e(e));
    const a = this.editor.getOptions();
    this._isEnabled = a.get(
      52
      /* EditorOption.folding */
    ), this._useFoldingProviders = a.get(
      53
      /* EditorOption.foldingStrategy */
    ) !== "indentation", this._unfoldOnClickAfterEndOfLine = a.get(
      57
      /* EditorOption.unfoldOnClickAfterEndOfLine */
    ), this._restoringViewState = !1, this._currentModelHasFoldedImports = !1, this._foldingImportsByDefault = a.get(
      55
      /* EditorOption.foldingImportsByDefault */
    ), this.updateDebounceInfo = s.for(o.foldingRangeProvider, "Folding", { min: 200 }), this.foldingModel = null, this.hiddenRangeModel = null, this.rangeProvider = null, this.foldingRegionPromise = null, this.foldingModelPromise = null, this.updateScheduler = null, this.cursorChangedScheduler = null, this.mouseDownInfo = null, this.foldingDecorationProvider = new Uoe(e), this.foldingDecorationProvider.showFoldingControls = a.get(
      126
      /* EditorOption.showFoldingControls */
    ), this.foldingDecorationProvider.showFoldingHighlights = a.get(
      54
      /* EditorOption.foldingHighlight */
    ), this.foldingEnabled = Ja.bindTo(this.contextKeyService), this.foldingEnabled.set(this._isEnabled), this._register(this.editor.onDidChangeModel(() => this.onModelChanged())), this._register(this.editor.onDidChangeConfiguration((l) => {
      if (l.hasChanged(
        52
        /* EditorOption.folding */
      ) && (this._isEnabled = this.editor.getOptions().get(
        52
        /* EditorOption.folding */
      ), this.foldingEnabled.set(this._isEnabled), this.onModelChanged()), l.hasChanged(
        56
        /* EditorOption.foldingMaximumRegions */
      ) && this.onModelChanged(), l.hasChanged(
        126
        /* EditorOption.showFoldingControls */
      ) || l.hasChanged(
        54
        /* EditorOption.foldingHighlight */
      )) {
        const c = this.editor.getOptions();
        this.foldingDecorationProvider.showFoldingControls = c.get(
          126
          /* EditorOption.showFoldingControls */
        ), this.foldingDecorationProvider.showFoldingHighlights = c.get(
          54
          /* EditorOption.foldingHighlight */
        ), this.triggerFoldingModelChanged();
      }
      l.hasChanged(
        53
        /* EditorOption.foldingStrategy */
      ) && (this._useFoldingProviders = this.editor.getOptions().get(
        53
        /* EditorOption.foldingStrategy */
      ) !== "indentation", this.onFoldingStrategyChanged()), l.hasChanged(
        57
        /* EditorOption.unfoldOnClickAfterEndOfLine */
      ) && (this._unfoldOnClickAfterEndOfLine = this.editor.getOptions().get(
        57
        /* EditorOption.unfoldOnClickAfterEndOfLine */
      )), l.hasChanged(
        55
        /* EditorOption.foldingImportsByDefault */
      ) && (this._foldingImportsByDefault = this.editor.getOptions().get(
        55
        /* EditorOption.foldingImportsByDefault */
      ));
    })), this.onModelChanged();
  }
  /**
   * Store view state.
   */
  saveViewState() {
    const e = this.editor.getModel();
    if (!e || !this._isEnabled || e.isTooLargeForTokenization())
      return {};
    if (this.foldingModel) {
      const t = this.foldingModel.getMemento(), n = this.rangeProvider ? this.rangeProvider.id : void 0;
      return { collapsedRegions: t, lineCount: e.getLineCount(), provider: n, foldedImports: this._currentModelHasFoldedImports };
    }
  }
  /**
   * Restore view state.
   */
  restoreViewState(e) {
    const t = this.editor.getModel();
    if (!(!t || !this._isEnabled || t.isTooLargeForTokenization() || !this.hiddenRangeModel) && e && (this._currentModelHasFoldedImports = !!e.foldedImports, e.collapsedRegions && e.collapsedRegions.length > 0 && this.foldingModel)) {
      this._restoringViewState = !0;
      try {
        this.foldingModel.applyMemento(e.collapsedRegions);
      } finally {
        this._restoringViewState = !1;
      }
    }
  }
  onModelChanged() {
    this.localToDispose.clear();
    const e = this.editor.getModel();
    !this._isEnabled || !e || e.isTooLargeForTokenization() || (this._currentModelHasFoldedImports = !1, this.foldingModel = new qEt(e, this.foldingDecorationProvider), this.localToDispose.add(this.foldingModel), this.hiddenRangeModel = new JEt(this.foldingModel), this.localToDispose.add(this.hiddenRangeModel), this.localToDispose.add(this.hiddenRangeModel.onDidChange((t) => this.onHiddenRangesChanges(t))), this.updateScheduler = new Gf(this.updateDebounceInfo.get(e)), this.localToDispose.add(this.updateScheduler), this.cursorChangedScheduler = new mr(() => this.revealCursor(), 200), this.localToDispose.add(this.cursorChangedScheduler), this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(() => this.onFoldingStrategyChanged())), this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(() => this.onFoldingStrategyChanged())), this.localToDispose.add(this.editor.onDidChangeModelContent((t) => this.onDidChangeModelContent(t))), this.localToDispose.add(this.editor.onDidChangeCursorPosition(() => this.onCursorPositionChanged())), this.localToDispose.add(this.editor.onMouseDown((t) => this.onEditorMouseDown(t))), this.localToDispose.add(this.editor.onMouseUp((t) => this.onEditorMouseUp(t))), this.localToDispose.add({
      dispose: () => {
        var t, n;
        this.foldingRegionPromise && (this.foldingRegionPromise.cancel(), this.foldingRegionPromise = null), (t = this.updateScheduler) == null || t.cancel(), this.updateScheduler = null, this.foldingModel = null, this.foldingModelPromise = null, this.hiddenRangeModel = null, this.cursorChangedScheduler = null, (n = this.rangeProvider) == null || n.dispose(), this.rangeProvider = null;
      }
    }), this.triggerFoldingModelChanged());
  }
  onFoldingStrategyChanged() {
    var e;
    (e = this.rangeProvider) == null || e.dispose(), this.rangeProvider = null, this.triggerFoldingModelChanged();
  }
  getRangeProvider(e) {
    if (this.rangeProvider)
      return this.rangeProvider;
    const t = new Npe(e, this.languageConfigurationService, this._foldingLimitReporter);
    if (this.rangeProvider = t, this._useFoldingProviders && this.foldingModel) {
      const n = DE.getFoldingRangeProviders(this.languageFeaturesService, e);
      n.length > 0 && (this.rangeProvider = new Rpe(e, n, () => this.triggerFoldingModelChanged(), this._foldingLimitReporter, t));
    }
    return this.rangeProvider;
  }
  getFoldingModel() {
    return this.foldingModelPromise;
  }
  onDidChangeModelContent(e) {
    var t;
    (t = this.hiddenRangeModel) == null || t.notifyChangeModelContent(e), this.triggerFoldingModelChanged();
  }
  triggerFoldingModelChanged() {
    this.updateScheduler && (this.foldingRegionPromise && (this.foldingRegionPromise.cancel(), this.foldingRegionPromise = null), this.foldingModelPromise = this.updateScheduler.trigger(() => {
      const e = this.foldingModel;
      if (!e)
        return null;
      const t = new _a(), n = this.getRangeProvider(e.textModel), r = this.foldingRegionPromise = Jo((s) => n.compute(s));
      return r.then((s) => {
        if (s && r === this.foldingRegionPromise) {
          let o;
          if (this._foldingImportsByDefault && !this._currentModelHasFoldedImports) {
            const c = s.setCollapsedAllOfType(Qy.Imports.value, !0);
            c && (o = mm.capture(this.editor), this._currentModelHasFoldedImports = c);
          }
          const a = this.editor.getSelections();
          e.update(s, fxt(a)), o == null || o.restore(this.editor);
          const l = this.updateDebounceInfo.update(e.textModel, t.elapsed());
          this.updateScheduler && (this.updateScheduler.defaultDelay = l);
        }
        return e;
      });
    }).then(void 0, (e) => (fn(e), null)));
  }
  onHiddenRangesChanges(e) {
    if (this.hiddenRangeModel && e.length && !this._restoringViewState) {
      const t = this.editor.getSelections();
      t && this.hiddenRangeModel.adjustSelections(t) && this.editor.setSelections(t);
    }
    this.editor.setHiddenAreas(e, this);
  }
  onCursorPositionChanged() {
    this.hiddenRangeModel && this.hiddenRangeModel.hasRanges() && this.cursorChangedScheduler.schedule();
  }
  revealCursor() {
    const e = this.getFoldingModel();
    e && e.then((t) => {
      if (t) {
        const n = this.editor.getSelections();
        if (n && n.length > 0) {
          const r = [];
          for (const s of n) {
            const o = s.selectionStartLineNumber;
            this.hiddenRangeModel && this.hiddenRangeModel.isHidden(o) && r.push(...t.getAllRegionsAtLine(o, (a) => a.isCollapsed && o > a.startLineNumber));
          }
          r.length && (t.toggleCollapseState(r), this.reveal(n[0].getPosition()));
        }
      }
    }).then(void 0, fn);
  }
  onEditorMouseDown(e) {
    if (this.mouseDownInfo = null, !this.hiddenRangeModel || !e.target || !e.target.range || !e.event.leftButton && !e.event.middleButton)
      return;
    const t = e.target.range;
    let n = !1;
    switch (e.target.type) {
      case 4: {
        const r = e.target.detail, s = e.target.element.offsetLeft;
        if (r.offsetX - s < 4)
          return;
        n = !0;
        break;
      }
      case 7: {
        if (this._unfoldOnClickAfterEndOfLine && this.hiddenRangeModel.hasRanges() && !e.target.detail.isAfterLines)
          break;
        return;
      }
      case 6: {
        if (this.hiddenRangeModel.hasRanges()) {
          const r = this.editor.getModel();
          if (r && t.startColumn === r.getLineMaxColumn(t.startLineNumber))
            break;
        }
        return;
      }
      default:
        return;
    }
    this.mouseDownInfo = { lineNumber: t.startLineNumber, iconClicked: n };
  }
  onEditorMouseUp(e) {
    const t = this.foldingModel;
    if (!t || !this.mouseDownInfo || !e.target)
      return;
    const n = this.mouseDownInfo.lineNumber, r = this.mouseDownInfo.iconClicked, s = e.target.range;
    if (!s || s.startLineNumber !== n)
      return;
    if (r) {
      if (e.target.type !== 4)
        return;
    } else {
      const a = this.editor.getModel();
      if (!a || s.startColumn !== a.getLineMaxColumn(n))
        return;
    }
    const o = t.getRegionAtLine(n);
    if (o && o.startLineNumber === n) {
      const a = o.isCollapsed;
      if (r || a) {
        const l = e.event.altKey;
        let c = [];
        if (l) {
          const u = (h) => !h.containedBy(o) && !o.containedBy(h), d = t.getRegionsInside(null, u);
          for (const h of d)
            h.isCollapsed && c.push(h);
          c.length === 0 && (c = d);
        } else {
          const u = e.event.middleButton || e.event.shiftKey;
          if (u)
            for (const d of t.getRegionsInside(o))
              d.isCollapsed === a && c.push(d);
          (a || !u || c.length === 0) && c.push(o);
        }
        t.toggleCollapseState(c), this.reveal({ lineNumber: n, column: 1 });
      }
    }
  }
  reveal(e) {
    this.editor.revealPositionInCenterIfOutsideViewport(
      e,
      0
      /* ScrollType.Smooth */
    );
  }
}, DE = SL, SL.ID = "editor.contrib.folding", SL);
gw = DE = hxt([
  lP(1, Jt),
  lP(2, Ls),
  lP(3, no),
  lP(4, ig),
  lP(5, St)
], gw);
class V6e extends ge {
  constructor(e) {
    super(), this.editor = e, this._onDidChange = this._register(new he()), this._computed = 0, this._limited = !1;
  }
  get limit() {
    return this.editor.getOptions().get(
      56
      /* EditorOption.foldingMaximumRegions */
    );
  }
  update(e, t) {
    (e !== this._computed || t !== this._limited) && (this._computed = e, this._limited = t, this._onDidChange.fire());
  }
}
class Sl extends vt {
  runEditorCommand(e, t, n) {
    const r = e.get(Ls), s = gw.get(t);
    if (!s)
      return;
    const o = s.getFoldingModel();
    if (o)
      return this.reportTelemetry(e, t), o.then((a) => {
        if (a) {
          this.invoke(s, a, t, n, r);
          const l = t.getSelection();
          l && s.reveal(l.getStartPosition());
        }
      });
  }
  getSelectedLines(e) {
    const t = e.getSelections();
    return t ? t.map((n) => n.startLineNumber) : [];
  }
  getLineNumbers(e, t) {
    return e && e.selectionLines ? e.selectionLines.map((n) => n + 1) : this.getSelectedLines(t);
  }
  run(e, t) {
  }
}
function fxt(i) {
  return !i || i.length === 0 ? {
    startsInside: () => !1
  } : {
    startsInside(e, t) {
      for (const n of i) {
        const r = n.startLineNumber;
        if (r >= e && r <= t)
          return !0;
      }
      return !1;
    }
  };
}
function U6e(i) {
  if (!Ec(i)) {
    if (!Ra(i))
      return !1;
    const e = i;
    if (!Ec(e.levels) && !zy(e.levels) || !Ec(e.direction) && !ga(e.direction) || !Ec(e.selectionLines) && (!Array.isArray(e.selectionLines) || !e.selectionLines.every(zy)))
      return !1;
  }
  return !0;
}
class gxt extends Sl {
  constructor() {
    super({
      id: "editor.unfold",
      label: Ee(977, "Unfold"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 3166,
        mac: {
          primary: 2654
          /* KeyCode.BracketRight */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: "Unfold the content in the editor",
        args: [
          {
            name: "Unfold editor argument",
            description: `Property-value pairs that can be passed through this argument:
						* 'levels': Number of levels to unfold. If not set, defaults to 1.
						* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
						* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
						`,
            constraint: U6e,
            schema: {
              type: "object",
              properties: {
                levels: {
                  type: "number",
                  default: 1
                },
                direction: {
                  type: "string",
                  enum: ["up", "down"],
                  default: "down"
                },
                selectionLines: {
                  type: "array",
                  items: {
                    type: "number"
                  }
                }
              }
            }
          }
        ]
      }
    });
  }
  invoke(e, t, n, r) {
    const s = r && r.levels || 1, o = this.getLineNumbers(r, n);
    r && r.direction === "up" ? H6e(t, !1, s, o) : d2(t, !1, s, o);
  }
}
class pxt extends Sl {
  constructor() {
    super({
      id: "editor.unfoldRecursively",
      label: Ee(978, "Unfold Recursively"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2142
          /* KeyCode.BracketRight */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n, r) {
    d2(t, !1, Number.MAX_VALUE, this.getSelectedLines(n));
  }
}
class mxt extends Sl {
  constructor() {
    super({
      id: "editor.fold",
      label: Ee(979, "Fold"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 3164,
        mac: {
          primary: 2652
          /* KeyCode.BracketLeft */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: "Fold the content in the editor",
        args: [
          {
            name: "Fold editor argument",
            description: `Property-value pairs that can be passed through this argument:
							* 'levels': Number of levels to fold.
							* 'direction': If 'up', folds given number of levels up otherwise folds down.
							* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.
							If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
						`,
            constraint: U6e,
            schema: {
              type: "object",
              properties: {
                levels: {
                  type: "number"
                },
                direction: {
                  type: "string",
                  enum: ["up", "down"]
                },
                selectionLines: {
                  type: "array",
                  items: {
                    type: "number"
                  }
                }
              }
            }
          }
        ]
      }
    });
  }
  invoke(e, t, n, r) {
    const s = this.getLineNumbers(r, n), o = r && r.levels, a = r && r.direction;
    typeof o != "number" && typeof a != "string" ? KEt(t, !0, s) : a === "up" ? H6e(t, !0, o || 1, s) : d2(t, !0, o || 1, s);
  }
}
class _xt extends Sl {
  constructor() {
    super({
      id: "editor.toggleFold",
      label: Ee(980, "Toggle Fold"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2090
          /* KeyCode.KeyL */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = this.getSelectedLines(n);
    kpe(t, 1, r);
  }
}
class bxt extends Sl {
  constructor() {
    super({
      id: "editor.foldRecursively",
      label: Ee(981, "Fold Recursively"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2140
          /* KeyCode.BracketLeft */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = this.getSelectedLines(n);
    d2(t, !0, Number.MAX_VALUE, r);
  }
}
class vxt extends Sl {
  constructor() {
    super({
      id: "editor.toggleFoldRecursively",
      label: Ee(982, "Toggle Fold Recursively"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          3114
          /* KeyCode.KeyL */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = this.getSelectedLines(n);
    kpe(t, Number.MAX_VALUE, r);
  }
}
class yxt extends Sl {
  constructor() {
    super({
      id: "editor.foldAllBlockComments",
      label: Ee(983, "Fold All Block Comments"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2138
          /* KeyCode.Slash */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n, r, s) {
    if (t.regions.hasTypes())
      Ipe(t, Qy.Comment.value, !0);
    else {
      const o = n.getModel();
      if (!o)
        return;
      const a = s.getLanguageConfiguration(o.getLanguageId()).comments;
      if (a && a.blockCommentStartToken) {
        const l = new RegExp("^\\s*" + zd(a.blockCommentStartToken));
        Dpe(t, l, !0);
      }
    }
  }
}
class Cxt extends Sl {
  constructor() {
    super({
      id: "editor.foldAllMarkerRegions",
      label: Ee(984, "Fold All Regions"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2077
          /* KeyCode.Digit8 */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n, r, s) {
    if (t.regions.hasTypes())
      Ipe(t, Qy.Region.value, !0);
    else {
      const o = n.getModel();
      if (!o)
        return;
      const a = s.getLanguageConfiguration(o.getLanguageId()).foldingRules;
      if (a && a.markers && a.markers.start) {
        const l = new RegExp(a.markers.start);
        Dpe(t, l, !0);
      }
    }
  }
}
class wxt extends Sl {
  constructor() {
    super({
      id: "editor.unfoldAllMarkerRegions",
      label: Ee(985, "Unfold All Regions"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2078
          /* KeyCode.Digit9 */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n, r, s) {
    if (t.regions.hasTypes())
      Ipe(t, Qy.Region.value, !1);
    else {
      const o = n.getModel();
      if (!o)
        return;
      const a = s.getLanguageConfiguration(o.getLanguageId()).foldingRules;
      if (a && a.markers && a.markers.start) {
        const l = new RegExp(a.markers.start);
        Dpe(t, l, !1);
      }
    }
  }
}
class Sxt extends Sl {
  constructor() {
    super({
      id: "editor.foldAllExcept",
      label: Ee(986, "Fold All Except Selected"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2136
          /* KeyCode.Minus */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = this.getSelectedLines(n);
    W6e(t, !0, r);
  }
}
class Ext extends Sl {
  constructor() {
    super({
      id: "editor.unfoldAllExcept",
      label: Ee(987, "Unfold All Except Selected"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2134
          /* KeyCode.Equal */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = this.getSelectedLines(n);
    W6e(t, !1, r);
  }
}
class xxt extends Sl {
  constructor() {
    super({
      id: "editor.foldAll",
      label: Ee(988, "Fold All"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2069
          /* KeyCode.Digit0 */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    d2(t, !0);
  }
}
class Lxt extends Sl {
  constructor() {
    super({
      id: "editor.unfoldAll",
      label: Ee(989, "Unfold All"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2088
          /* KeyCode.KeyJ */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    d2(t, !1);
  }
}
const HN = class HN extends Sl {
  getFoldingLevel() {
    return parseInt(this.id.substr(HN.ID_PREFIX.length));
  }
  invoke(e, t, n) {
    YEt(t, this.getFoldingLevel(), !0, this.getSelectedLines(n));
  }
};
HN.ID_PREFIX = "editor.foldLevel", HN.ID = (e) => HN.ID_PREFIX + e;
let kz = HN;
class Txt extends Sl {
  constructor() {
    super({
      id: "editor.gotoParentFold",
      label: Ee(990, "Go to Parent Fold"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = this.getSelectedLines(n);
    if (r.length > 0) {
      const s = XEt(r[0], t);
      s !== null && n.setSelection({
        startLineNumber: s,
        startColumn: 1,
        endLineNumber: s,
        endColumn: 1
      });
    }
  }
}
class kxt extends Sl {
  constructor() {
    super({
      id: "editor.gotoPreviousFold",
      label: Ee(991, "Go to Previous Folding Range"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = this.getSelectedLines(n);
    if (r.length > 0) {
      const s = ZEt(r[0], t);
      s !== null && n.setSelection({
        startLineNumber: s,
        startColumn: 1,
        endLineNumber: s,
        endColumn: 1
      });
    }
  }
}
class Dxt extends Sl {
  constructor() {
    super({
      id: "editor.gotoNextFold",
      label: Ee(992, "Go to Next Folding Range"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = this.getSelectedLines(n);
    if (r.length > 0) {
      const s = QEt(r[0], t);
      s !== null && n.setSelection({
        startLineNumber: s,
        startColumn: 1,
        endLineNumber: s,
        endColumn: 1
      });
    }
  }
}
class Ixt extends Sl {
  constructor() {
    super({
      id: "editor.createFoldingRangeFromSelection",
      label: Ee(993, "Create Folding Range from Selection"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2135
          /* KeyCode.Comma */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    var o;
    const r = [], s = n.getSelections();
    if (s) {
      for (const a of s) {
        let l = a.endLineNumber;
        a.endColumn === 1 && --l, l > a.startLineNumber && (r.push({
          startLineNumber: a.startLineNumber,
          endLineNumber: l,
          type: void 0,
          isCollapsed: !0,
          source: 1
          /* FoldSource.userDefined */
        }), n.setSelection({
          startLineNumber: a.startLineNumber,
          startColumn: 1,
          endLineNumber: a.startLineNumber,
          endColumn: 1
        }));
      }
      if (r.length > 0) {
        r.sort((l, c) => l.startLineNumber - c.startLineNumber);
        const a = Nh.sanitizeAndMerge(t.regions, r, (o = n.getModel()) == null ? void 0 : o.getLineCount());
        t.updatePost(Nh.fromFoldRanges(a));
      }
    }
  }
}
class Nxt extends Sl {
  constructor() {
    super({
      id: "editor.removeManualFoldingRanges",
      label: Ee(994, "Remove Manual Folding Ranges"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2137
          /* KeyCode.Period */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  invoke(e, t, n) {
    const r = n.getSelections();
    if (r) {
      const s = [];
      for (const o of r) {
        const { startLineNumber: a, endLineNumber: l } = o;
        s.push(l >= a ? { startLineNumber: a, endLineNumber: l } : { endLineNumber: l, startLineNumber: a });
      }
      t.removeManualRanges(s), e.triggerFoldingModelChanged();
    }
  }
}
class Rxt extends Sl {
  constructor() {
    super({
      id: "editor.toggleImportFold",
      label: Ee(995, "Toggle Import Fold"),
      precondition: Ja,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  async invoke(e, t) {
    const n = [], r = t.regions;
    for (let s = r.length - 1; s >= 0; s--)
      r.getType(s) === Qy.Imports.value && n.push(r.toRegion(s));
    t.toggleCollapseState(n), e.triggerFoldingModelChanged();
  }
}
Si(
  gw.ID,
  gw,
  0
  /* EditorContributionInstantiation.Eager */
);
Je(gxt);
Je(pxt);
Je(mxt);
Je(bxt);
Je(vxt);
Je(xxt);
Je(Lxt);
Je(yxt);
Je(Cxt);
Je(wxt);
Je(Sxt);
Je(Ext);
Je(_xt);
Je(Txt);
Je(kxt);
Je(Dxt);
Je(Ixt);
Je(Nxt);
Je(Rxt);
for (let i = 1; i <= 7; i++)
  Hrt(new kz({
    id: kz.ID(i),
    label: Ee(996, "Fold Level {0}", i),
    precondition: Ja,
    kbOpts: {
      kbExpr: se.editorTextFocus,
      primary: Ro(2089, 2048 | 21 + i),
      weight: 100
      /* KeybindingWeight.EditorContrib */
    }
  }));
_i.registerCommand("_executeFoldingRangeProvider", async function(i, ...e) {
  const [t] = e;
  if (!(t instanceof Ht))
    throw Bf();
  const n = i.get(St), r = i.get(xs).getModel(t);
  if (!r)
    throw Bf();
  const s = i.get(xn);
  if (!s.getValue("editor.folding", { resource: t }))
    return [];
  const o = i.get(Ls), a = s.getValue("editor.foldingStrategy", { resource: t }), l = {
    get limit() {
      return s.getValue("editor.foldingMaximumRegions", { resource: t });
    },
    update: (g, m) => {
    }
  }, c = new Npe(r, o, l);
  let u = c;
  if (a !== "indentation") {
    const g = gw.getFoldingRangeProviders(n, r);
    g.length && (u = new Rpe(r, g, () => {
    }, l, c));
  }
  const d = await u.compute($n.None), h = [];
  try {
    if (d)
      for (let g = 0; g < d.length; g++) {
        const m = d.getType(g);
        h.push({ start: d.getStartLineNumber(g), end: d.getEndLineNumber(g), kind: m ? Qy.fromValue(m) : void 0 });
      }
    return h;
  } finally {
    u.dispose();
  }
});
class Axt extends vt {
  constructor() {
    super({
      id: "editor.action.fontZoomIn",
      label: Ee(1006, "Increase Editor Font Size"),
      precondition: void 0
    });
  }
  run(e, t) {
    Of.setZoomLevel(Of.getZoomLevel() + 1);
  }
}
class Oxt extends vt {
  constructor() {
    super({
      id: "editor.action.fontZoomOut",
      label: Ee(1007, "Decrease Editor Font Size"),
      precondition: void 0
    });
  }
  run(e, t) {
    Of.setZoomLevel(Of.getZoomLevel() - 1);
  }
}
class Mxt extends vt {
  constructor() {
    super({
      id: "editor.action.fontZoomReset",
      label: Ee(1008, "Reset Editor Font Size"),
      precondition: void 0
    });
  }
  run(e, t) {
    Of.setZoomLevel(0);
  }
}
Je(Axt);
Je(Oxt);
Je(Mxt);
class bA {
  static _handleEolEdits(e, t) {
    let n;
    const r = [];
    for (const s of t)
      typeof s.eol == "number" && (n = s.eol), s.range && typeof s.text == "string" && r.push(s);
    return typeof n == "number" && e.hasModel() && e.getModel().pushEOL(n), r;
  }
  static _isFullModelReplaceEdit(e, t) {
    if (!e.hasModel())
      return !1;
    const n = e.getModel(), r = n.validateRange(t.range);
    return n.getFullModelRange().equalsRange(r);
  }
  static execute(e, t, n) {
    n && e.pushUndoStop();
    const r = mm.capture(e), s = bA._handleEolEdits(e, t);
    s.length === 1 && bA._isFullModelReplaceEdit(e, s[0]) ? e.executeEdits("formatEditsCommand", s.map((o) => Xs.replace(z.lift(o.range), o.text))) : e.executeEdits("formatEditsCommand", s.map((o) => Xs.replaceMove(z.lift(o.range), o.text))), n && e.pushUndoStop(), r.restoreRelativeVerticalPositionOfCursor(e);
  }
}
class cIe {
  constructor(e) {
    this.value = e, this._lower = e.toLowerCase();
  }
  /**
   * Gives the value by which to index (for equality).
   */
  static toKey(e) {
    return typeof e == "string" ? e.toLowerCase() : e._lower;
  }
}
class Pxt {
  constructor(e) {
    if (this._set = /* @__PURE__ */ new Set(), e)
      for (const t of e)
        this.add(t);
  }
  add(e) {
    this._set.add(cIe.toKey(e));
  }
  has(e) {
    return this._set.has(cIe.toKey(e));
  }
}
function z6e(i, e, t) {
  const n = [], r = new Pxt(), s = i.ordered(t);
  for (const a of s)
    n.push(a), a.extensionId && r.add(a.extensionId);
  const o = e.ordered(t);
  for (const a of o) {
    if (a.extensionId) {
      if (r.has(a.extensionId))
        continue;
      r.add(a.extensionId);
    }
    n.push({
      displayName: a.displayName,
      extensionId: a.extensionId,
      provideDocumentFormattingEdits(l, c, u) {
        return a.provideDocumentRangeFormattingEdits(l, l.getFullModelRange(), c, u);
      }
    });
  }
  return n;
}
const B3 = class B3 {
  static setFormatterSelector(e) {
    return { dispose: B3._selectors.unshift(e) };
  }
  static async select(e, t, n, r) {
    if (e.length === 0)
      return;
    const s = gi.first(B3._selectors);
    if (s)
      return await s(e, t, n, r);
  }
};
B3._selectors = new xc();
let u5 = B3;
async function $6e(i, e, t, n, r, s, o) {
  const a = i.get(xt), { documentRangeFormattingEditProvider: l } = i.get(St), c = vb(e) ? e.getModel() : e, u = l.ordered(c), d = await u5.select(
    u,
    c,
    n,
    2
    /* FormattingKind.Selection */
  );
  d && (r.report(d), await a.invokeFunction(Fxt, d, e, t, s, o));
}
async function Fxt(i, e, t, n, r, s) {
  var w, E;
  const o = i.get(sd), a = i.get($r), l = i.get(h0);
  let c, u;
  vb(t) ? (c = t.getModel(), u = new t0(t, 5, void 0, r)) : (c = t, u = new Bge(t, r));
  const d = [];
  let h = 0;
  for (const L of Ghe(n).sort(z.compareRangesUsingStarts))
    h > 0 && z.areIntersectingOrTouching(d[h - 1], L) ? d[h - 1] = z.fromPositions(d[h - 1].getStartPosition(), L.getEndPosition()) : h = d.push(L);
  const g = async (L) => {
    var D, N;
    a.trace("[format][provideDocumentRangeFormattingEdits] (request)", (D = e.extensionId) == null ? void 0 : D.value, L);
    const T = await e.provideDocumentRangeFormattingEdits(c, L, c.getFormattingOptions(), u.token) || [];
    return a.trace("[format][provideDocumentRangeFormattingEdits] (response)", (N = e.extensionId) == null ? void 0 : N.value, T), T;
  }, m = (L, T) => {
    if (!L.length || !T.length)
      return !1;
    const D = L.reduce((N, R) => z.plusRange(N, R.range), L[0].range);
    if (!T.some((N) => z.intersectRanges(D, N.range)))
      return !1;
    for (const N of L)
      for (const R of T)
        if (z.intersectRanges(N.range, R.range))
          return !0;
    return !1;
  }, _ = [], v = [];
  try {
    if (typeof e.provideDocumentRangesFormattingEdits == "function") {
      a.trace("[format][provideDocumentRangeFormattingEdits] (request)", (w = e.extensionId) == null ? void 0 : w.value, d);
      const L = await e.provideDocumentRangesFormattingEdits(c, d, c.getFormattingOptions(), u.token) || [];
      a.trace("[format][provideDocumentRangeFormattingEdits] (response)", (E = e.extensionId) == null ? void 0 : E.value, L), v.push(L);
    } else {
      for (const L of d) {
        if (u.token.isCancellationRequested)
          return !0;
        v.push(await g(L));
      }
      for (let L = 0; L < d.length; ++L)
        for (let T = L + 1; T < d.length; ++T) {
          if (u.token.isCancellationRequested)
            return !0;
          if (m(v[L], v[T])) {
            const D = z.plusRange(d[L], d[T]), N = await g(D);
            d.splice(T, 1), d.splice(L, 1), d.push(D), v.splice(T, 1), v.splice(L, 1), v.push(N), L = 0, T = 0;
          }
        }
    }
    for (const L of v) {
      if (u.token.isCancellationRequested)
        return !0;
      const T = await o.computeMoreMinimalEdits(c.uri, L);
      T && _.push(...T);
    }
    if (u.token.isCancellationRequested)
      return !0;
  } finally {
    u.dispose();
  }
  if (_.length === 0)
    return !1;
  if (vb(t))
    bA.execute(t, _, !0), t.revealPositionInCenterIfOutsideViewport(
      t.getPosition(),
      1
      /* ScrollType.Immediate */
    );
  else {
    const [{ range: L }] = _, T = new bt(L.startLineNumber, L.startColumn, L.endLineNumber, L.endColumn);
    c.pushEditOperations([T], _.map((D) => ({
      text: D.text,
      range: z.lift(D.range),
      forceMoveMarkers: !0
    })), (D) => {
      for (const { range: N } of D)
        if (z.areIntersectingOrTouching(N, T))
          return [new bt(N.startLineNumber, N.startColumn, N.endLineNumber, N.endColumn)];
      return null;
    });
  }
  return l.playSignal(tu.format, { userGesture: s }), !0;
}
async function Bxt(i, e, t, n, r, s) {
  const o = i.get(xt), a = i.get(St), l = vb(e) ? e.getModel() : e, c = z6e(a.documentFormattingEditProvider, a.documentRangeFormattingEditProvider, l), u = await u5.select(
    c,
    l,
    t,
    1
    /* FormattingKind.File */
  );
  u && (n.report(u), await o.invokeFunction(Hxt, u, e, t, r, s));
}
async function Hxt(i, e, t, n, r, s) {
  const o = i.get(sd), a = i.get(h0);
  let l, c;
  vb(t) ? (l = t.getModel(), c = new t0(t, 5, void 0, r)) : (l = t, c = new Bge(t, r));
  let u;
  try {
    const d = await e.provideDocumentFormattingEdits(l, l.getFormattingOptions(), c.token);
    if (u = await o.computeMoreMinimalEdits(l.uri, d), c.token.isCancellationRequested)
      return !0;
  } finally {
    c.dispose();
  }
  if (!u || u.length === 0)
    return !1;
  if (vb(t))
    bA.execute(
      t,
      u,
      n !== 2
      /* FormattingMode.Silent */
    ), n !== 2 && t.revealPositionInCenterIfOutsideViewport(
      t.getPosition(),
      1
      /* ScrollType.Immediate */
    );
  else {
    const [{ range: d }] = u, h = new bt(d.startLineNumber, d.startColumn, d.endLineNumber, d.endColumn);
    l.pushEditOperations([h], u.map((g) => ({
      text: g.text,
      range: z.lift(g.range),
      forceMoveMarkers: !0
    })), (g) => {
      for (const { range: m } of g)
        if (z.areIntersectingOrTouching(m, h))
          return [new bt(m.startLineNumber, m.startColumn, m.endLineNumber, m.endColumn)];
      return null;
    });
  }
  return a.playSignal(tu.format, { userGesture: s }), !0;
}
async function Wxt(i, e, t, n, r, s) {
  const o = e.documentRangeFormattingEditProvider.ordered(t);
  for (const a of o) {
    const l = await Promise.resolve(a.provideDocumentRangeFormattingEdits(t, n, r, s)).catch(No);
    if (kc(l))
      return await i.computeMoreMinimalEdits(t.uri, l);
  }
}
async function Vxt(i, e, t, n, r) {
  const s = z6e(e.documentFormattingEditProvider, e.documentRangeFormattingEditProvider, t);
  for (const o of s) {
    const a = await Promise.resolve(o.provideDocumentFormattingEdits(t, n, r)).catch(No);
    if (kc(a))
      return await i.computeMoreMinimalEdits(t.uri, a);
  }
}
function j6e(i, e, t, n, r, s, o) {
  const a = e.onTypeFormattingEditProvider.ordered(t);
  return a.length === 0 || a[0].autoFormatTriggerCharacters.indexOf(r) < 0 ? Promise.resolve(void 0) : Promise.resolve(a[0].provideOnTypeFormattingEdits(t, n, r, s, o)).catch(No).then((l) => i.computeMoreMinimalEdits(t.uri, l));
}
_i.registerCommand("_executeFormatRangeProvider", async function(i, ...e) {
  const [t, n, r] = e;
  Ii(Ht.isUri(t)), Ii(z.isIRange(n));
  const s = i.get(Ic), o = i.get(sd), a = i.get(St), l = await s.createModelReference(t);
  try {
    return Wxt(o, a, l.object.textEditorModel, z.lift(n), r, $n.None);
  } finally {
    l.dispose();
  }
});
_i.registerCommand("_executeFormatDocumentProvider", async function(i, ...e) {
  const [t, n] = e;
  Ii(Ht.isUri(t));
  const r = i.get(Ic), s = i.get(sd), o = i.get(St), a = await r.createModelReference(t);
  try {
    return Vxt(s, o, a.object.textEditorModel, n, $n.None);
  } finally {
    a.dispose();
  }
});
_i.registerCommand("_executeFormatOnTypeProvider", async function(i, ...e) {
  const [t, n, r, s] = e;
  Ii(Ht.isUri(t)), Ii(de.isIPosition(n)), Ii(typeof r == "string");
  const o = i.get(Ic), a = i.get(sd), l = i.get(St), c = await o.createModelReference(t);
  try {
    return j6e(a, l, c.object.textEditorModel, de.lift(n), r, s, $n.None);
  } finally {
    c.dispose();
  }
});
var G6e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, GF = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, xR;
let Dz = (xR = class {
  constructor(e, t, n, r) {
    this._editor = e, this._languageFeaturesService = t, this._workerService = n, this._accessibilitySignalService = r, this._disposables = new ke(), this._sessionDisposables = new ke(), this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update, this)), this._disposables.add(e.onDidChangeModel(() => this._update())), this._disposables.add(e.onDidChangeModelLanguage(() => this._update())), this._disposables.add(e.onDidChangeConfiguration((s) => {
      s.hasChanged(
        65
        /* EditorOption.formatOnType */
      ) && this._update();
    })), this._update();
  }
  dispose() {
    this._disposables.dispose(), this._sessionDisposables.dispose();
  }
  _update() {
    if (this._sessionDisposables.clear(), !this._editor.getOption(
      65
      /* EditorOption.formatOnType */
    ) || !this._editor.hasModel())
      return;
    const e = this._editor.getModel(), [t] = this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);
    if (!t || !t.autoFormatTriggerCharacters)
      return;
    const n = new UV();
    for (const r of t.autoFormatTriggerCharacters)
      n.add(r.charCodeAt(0));
    this._sessionDisposables.add(this._editor.onDidType((r) => {
      const s = r.charCodeAt(r.length - 1);
      n.has(s) && this._trigger(String.fromCharCode(s));
    }));
  }
  _trigger(e) {
    if (!this._editor.hasModel() || this._editor.getSelections().length > 1 || !this._editor.getSelection().isEmpty())
      return;
    const t = this._editor.getModel(), n = this._editor.getPosition(), r = new Ss(), s = this._editor.onDidChangeModelContent((o) => {
      if (o.isFlush) {
        r.cancel(), s.dispose();
        return;
      }
      for (let a = 0, l = o.changes.length; a < l; a++)
        if (o.changes[a].range.endLineNumber <= n.lineNumber) {
          r.cancel(), s.dispose();
          return;
        }
    });
    j6e(this._workerService, this._languageFeaturesService, t, n, e, t.getFormattingOptions(), r.token).then((o) => {
      r.token.isCancellationRequested || kc(o) && (this._accessibilitySignalService.playSignal(tu.format, { userGesture: !1 }), bA.execute(this._editor, o, !0));
    }).finally(() => {
      s.dispose();
    });
  }
}, xR.ID = "editor.contrib.autoFormat", xR);
Dz = G6e([
  GF(1, St),
  GF(2, sd),
  GF(3, h0)
], Dz);
var LR;
let Iz = (LR = class {
  constructor(e, t, n) {
    this.editor = e, this._languageFeaturesService = t, this._instantiationService = n, this._callOnDispose = new ke(), this._callOnModel = new ke(), this._callOnDispose.add(e.onDidChangeConfiguration(() => this._update())), this._callOnDispose.add(e.onDidChangeModel(() => this._update())), this._callOnDispose.add(e.onDidChangeModelLanguage(() => this._update())), this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update, this));
  }
  dispose() {
    this._callOnDispose.dispose(), this._callOnModel.dispose();
  }
  _update() {
    this._callOnModel.clear(), this.editor.getOption(
      64
      /* EditorOption.formatOnPaste */
    ) && this.editor.hasModel() && this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel()) && this._callOnModel.add(this.editor.onDidPaste(({ range: e }) => this._trigger(e)));
  }
  _trigger(e) {
    this.editor.hasModel() && (this.editor.getSelections().length > 1 || this._instantiationService.invokeFunction($6e, this.editor, e, 2, tm.None, $n.None, !1).catch(fn));
  }
}, LR.ID = "editor.contrib.formatOnPaste", LR);
Iz = G6e([
  GF(1, St),
  GF(2, xt)
], Iz);
class Uxt extends vt {
  constructor() {
    super({
      id: "editor.action.formatDocument",
      label: Ee(1009, "Format Document"),
      precondition: Re.and(se.notInCompositeEditor, se.writable, se.hasDocumentFormattingProvider),
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 1572,
        linux: {
          primary: 3111
          /* KeyCode.KeyI */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      contextMenuOpts: {
        group: "1_modification",
        order: 1.3
      }
    });
  }
  async run(e, t) {
    if (t.hasModel()) {
      const n = e.get(xt);
      await e.get(e0).showWhile(n.invokeFunction(Bxt, t, 1, tm.None, $n.None, !0), 250);
    }
  }
}
class zxt extends vt {
  constructor() {
    super({
      id: "editor.action.formatSelection",
      label: Ee(1010, "Format Selection"),
      precondition: Re.and(se.writable, se.hasDocumentSelectionFormattingProvider),
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2084
          /* KeyCode.KeyF */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      contextMenuOpts: {
        when: se.hasNonEmptySelection,
        group: "1_modification",
        order: 1.31
      }
    });
  }
  async run(e, t) {
    if (!t.hasModel())
      return;
    const n = e.get(xt), r = t.getModel(), s = t.getSelections().map((a) => a.isEmpty() ? new z(a.startLineNumber, 1, a.startLineNumber, r.getLineMaxColumn(a.startLineNumber)) : a);
    await e.get(e0).showWhile(n.invokeFunction($6e, t, s, 1, tm.None, $n.None, !0), 250);
  }
}
Si(
  Dz.ID,
  Dz,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Si(
  Iz.ID,
  Iz,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Je(Uxt);
Je(zxt);
_i.registerCommand("editor.action.format", async (i) => {
  const e = i.get(Ti).getFocusedCodeEditor();
  if (!e || !e.hasModel())
    return;
  const t = i.get(jr);
  e.getSelection().isEmpty() ? await t.executeCommand("editor.action.formatDocument") : await t.executeCommand("editor.action.formatSelection");
});
var $xt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ute = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class pN {
  remove() {
    var e;
    (e = this.parent) == null || e.children.delete(this.id);
  }
  static findId(e, t) {
    let n;
    typeof e == "string" ? n = `${t.id}/${e}` : (n = `${t.id}/${e.name}`, t.children.get(n) !== void 0 && (n = `${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));
    let r = n;
    for (let s = 0; t.children.get(r) !== void 0; s++)
      r = `${n}_${s}`;
    return r;
  }
  static empty(e) {
    return e.children.size === 0;
  }
}
class zoe extends pN {
  constructor(e, t, n) {
    super(), this.id = e, this.parent = t, this.symbol = n, this.children = /* @__PURE__ */ new Map();
  }
}
class q6e extends pN {
  constructor(e, t, n, r) {
    super(), this.id = e, this.parent = t, this.label = n, this.order = r, this.children = /* @__PURE__ */ new Map();
  }
}
class ly extends pN {
  static create(e, t, n) {
    const r = new Ss(n), s = new ly(t.uri), o = e.ordered(t), a = o.map((c, u) => {
      const d = pN.findId(`provider_${u}`, s), h = new q6e(d, s, c.displayName ?? "Unknown Outline Provider", u);
      return Promise.resolve(c.provideDocumentSymbols(t, r.token)).then((g) => {
        for (const m of g || [])
          ly._makeOutlineElement(m, h);
        return h;
      }, (g) => (No(g), h)).then((g) => {
        pN.empty(g) ? g.remove() : s._groups.set(d, g);
      });
    }), l = e.onDidChange(() => {
      const c = e.ordered(t);
      ds(c, o) || r.cancel();
    });
    return Promise.all(a).then(() => r.token.isCancellationRequested && !n.isCancellationRequested ? ly.create(e, t, n) : s._compact()).finally(() => {
      r.dispose(), l.dispose(), r.dispose();
    });
  }
  static _makeOutlineElement(e, t) {
    const n = pN.findId(e, t), r = new zoe(n, t, e);
    if (e.children)
      for (const s of e.children)
        ly._makeOutlineElement(s, r);
    t.children.set(r.id, r);
  }
  constructor(e) {
    super(), this.uri = e, this.id = "root", this.parent = void 0, this._groups = /* @__PURE__ */ new Map(), this.children = /* @__PURE__ */ new Map(), this.id = "root", this.parent = void 0;
  }
  _compact() {
    let e = 0;
    for (const [t, n] of this._groups)
      n.children.size === 0 ? this._groups.delete(t) : e += 1;
    if (e !== 1)
      this.children = this._groups;
    else {
      const t = gi.first(this._groups.values());
      for (const [, n] of t.children)
        n.parent = this, this.children.set(n.id, n);
    }
    return this;
  }
  getTopLevelSymbols() {
    const e = [];
    for (const t of this.children.values())
      t instanceof zoe ? e.push(t.symbol) : e.push(...gi.map(t.children.values(), (n) => n.symbol));
    return e.sort((t, n) => z.compareRangesUsingStarts(t.range, n.range));
  }
  asListOfDocumentSymbols() {
    const e = this.getTopLevelSymbols(), t = [];
    return ly._flattenDocumentSymbols(t, e, ""), t.sort((n, r) => de.compare(z.getStartPosition(n.range), z.getStartPosition(r.range)) || de.compare(z.getEndPosition(r.range), z.getEndPosition(n.range)));
  }
  static _flattenDocumentSymbols(e, t, n) {
    for (const r of t)
      e.push({
        kind: r.kind,
        tags: r.tags,
        name: r.name,
        detail: r.detail,
        containerName: r.containerName || n,
        range: r.range,
        selectionRange: r.selectionRange,
        children: void 0
        // we flatten it...
      }), r.children && ly._flattenDocumentSymbols(e, r.children, r.name);
  }
}
const YB = Vn("IOutlineModelService");
let $oe = class {
  constructor(e, t, n) {
    this._languageFeaturesService = e, this._disposables = new ke(), this._cache = new Tb(15, 0.7), this._debounceInformation = t.for(e.documentSymbolProvider, "DocumentSymbols", { min: 350 }), this._disposables.add(n.onModelRemoved((r) => {
      this._cache.delete(r.id);
    }));
  }
  dispose() {
    this._disposables.dispose();
  }
  async getOrCreate(e, t) {
    const n = this._languageFeaturesService.documentSymbolProvider, r = n.ordered(e);
    let s = this._cache.get(e.id);
    if (!s || s.versionId !== e.getVersionId() || !ds(s.provider, r)) {
      const a = new Ss();
      s = {
        versionId: e.getVersionId(),
        provider: r,
        promiseCnt: 0,
        source: a,
        promise: ly.create(n, e, a.token),
        model: void 0
      }, this._cache.set(e.id, s);
      const l = Date.now();
      s.promise.then((c) => {
        s.model = c, this._debounceInformation.update(e, Date.now() - l);
      }).catch((c) => {
        this._cache.delete(e.id);
      });
    }
    if (s.model)
      return s.model;
    s.promiseCnt += 1;
    const o = t.onCancellationRequested(() => {
      --s.promiseCnt === 0 && (s.source.cancel(), this._cache.delete(e.id));
    });
    try {
      return await s.promise;
    } finally {
      o.dispose();
    }
  }
};
$oe = $xt([
  ute(0, St),
  ute(1, ig),
  ute(2, xs)
], $oe);
ni(
  YB,
  $oe,
  1
  /* InstantiationType.Delayed */
);
_i.registerCommand("_executeDocumentSymbolProvider", async function(i, ...e) {
  const [t] = e;
  Ii(Ht.isUri(t));
  const n = i.get(YB), s = await i.get(Ic).createModelReference(t);
  try {
    return (await n.getOrCreate(s.object.textEditorModel, $n.None)).getTopLevelSymbols();
  } finally {
    s.dispose();
  }
});
const OK = new class {
  constructor() {
    this._implementations = [];
  }
  register(e) {
    return this._implementations.push(e), {
      dispose: () => {
        const t = this._implementations.indexOf(e);
        t !== -1 && this._implementations.splice(t, 1);
      }
    };
  }
  getImplementations() {
    return this._implementations;
  }
}();
var jxt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Gxt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
function qxt(i) {
  return i instanceof K6e ? i._instance : i;
}
let K6e = class {
  constructor(e) {
    this.instantiationService = e;
  }
  init(...e) {
  }
};
function Kxt(i) {
  return i.get();
}
let uIe = class extends K6e {
  constructor(e, t) {
    super(t), this.init(e);
  }
};
uIe = jxt([
  Gxt(1, xt)
], uIe);
const Wn = {
  Visible: Lpe,
  HasFocusedSuggestion: new ut("suggestWidgetHasFocusedSuggestion", !1, S(1440, "Whether any suggestion is focused")),
  DetailsVisible: new ut("suggestWidgetDetailsVisible", !1, S(1441, "Whether suggestion details are visible")),
  MultipleSuggestions: new ut("suggestWidgetMultipleSuggestions", !1, S(1442, "Whether there are multiple suggestions to pick from")),
  MakesTextEdit: new ut("suggestionMakesTextEdit", !0, S(1443, "Whether inserting the current suggestion yields in a change or has everything already been typed")),
  AcceptSuggestionsOnEnter: new ut("acceptSuggestionOnEnter", !0, S(1444, "Whether suggestions are inserted when pressing Enter")),
  HasInsertAndReplaceRange: new ut("suggestionHasInsertAndReplaceRange", !1, S(1445, "Whether the current suggestion has insert and replace behaviour")),
  InsertMode: new ut("suggestionInsertMode", void 0, { type: "string", description: S(1446, "Whether the default behaviour is to insert or replace") }),
  CanResolve: new ut("suggestionCanResolve", !1, S(1447, "Whether the current suggestion supports to resolve further details"))
}, A1 = new wt("suggestWidgetStatusBar");
class Yxt {
  constructor(e, t, n, r) {
    var s;
    this.position = e, this.completion = t, this.container = n, this.provider = r, this.isInvalid = !1, this.score = $g.Default, this.distance = 0, this.textLabel = typeof t.label == "string" ? t.label : (s = t.label) == null ? void 0 : s.label, this.labelLow = this.textLabel.toLowerCase(), this.isInvalid = !this.textLabel, this.sortTextLow = t.sortText && t.sortText.toLowerCase(), this.filterTextLow = t.filterText && t.filterText.toLowerCase(), this.extensionId = t.extensionId, z.isIRange(t.range) ? (this.editStart = new de(t.range.startLineNumber, t.range.startColumn), this.editInsertEnd = new de(t.range.endLineNumber, t.range.endColumn), this.editReplaceEnd = new de(t.range.endLineNumber, t.range.endColumn), this.isInvalid = this.isInvalid || z.spansMultipleLines(t.range) || t.range.startLineNumber !== e.lineNumber) : (this.editStart = new de(t.range.insert.startLineNumber, t.range.insert.startColumn), this.editInsertEnd = new de(t.range.insert.endLineNumber, t.range.insert.endColumn), this.editReplaceEnd = new de(t.range.replace.endLineNumber, t.range.replace.endColumn), this.isInvalid = this.isInvalid || z.spansMultipleLines(t.range.insert) || z.spansMultipleLines(t.range.replace) || t.range.insert.startLineNumber !== e.lineNumber || t.range.replace.startLineNumber !== e.lineNumber || t.range.insert.startColumn !== t.range.replace.startColumn), typeof r.resolveCompletionItem != "function" && (this._resolveCache = Promise.resolve(), this._resolveDuration = 0);
  }
  // ---- resolving
  get isResolved() {
    return this._resolveDuration !== void 0;
  }
  get resolveDuration() {
    return this._resolveDuration !== void 0 ? this._resolveDuration : -1;
  }
  async resolve(e) {
    if (!this._resolveCache) {
      const t = e.onCancellationRequested(() => {
        this._resolveCache = void 0, this._resolveDuration = void 0;
      }), n = new _a(!0);
      this._resolveCache = Promise.resolve(this.provider.resolveCompletionItem(this.completion, e)).then((r) => {
        Object.assign(this.completion, r), this._resolveDuration = n.elapsed();
      }, (r) => {
        Xh(r) && (this._resolveCache = void 0, this._resolveDuration = void 0);
      }).finally(() => {
        t.dispose();
      });
    }
    return this._resolveCache;
  }
}
const _G = class _G {
  constructor(e = 2, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), s = !0) {
    this.snippetSortOrder = e, this.kindFilter = t, this.providerFilter = n, this.providerItemsToReuse = r, this.showDeprecated = s;
  }
};
_G.default = new _G();
let d5 = _G;
class Xxt {
  constructor(e, t, n, r) {
    this.items = e, this.needsClipboard = t, this.durations = n, this.disposable = r;
  }
}
async function Ape(i, e, t, n = d5.default, r = {
  triggerKind: 0
  /* languages.CompletionTriggerKind.Invoke */
}, s = $n.None) {
  const o = new _a();
  t = t.clone();
  const a = e.getWordAtPosition(t), l = a ? new z(t.lineNumber, a.startColumn, t.lineNumber, a.endColumn) : z.fromPositions(t), c = { replace: l, insert: l.setEndPosition(t.lineNumber, t.column) }, u = [], d = new ke(), h = [];
  let g = !1;
  const m = (v, w, E) => {
    var T;
    let L = !1;
    if (!w)
      return L;
    for (const D of w.suggestions)
      if (!n.kindFilter.has(D.kind)) {
        if (!n.showDeprecated && ((T = D == null ? void 0 : D.tags) != null && T.includes(1)))
          continue;
        D.range || (D.range = c), D.sortText || (D.sortText = typeof D.label == "string" ? D.label : D.label.label), !g && D.insertTextRules && D.insertTextRules & 4 && (g = _T.guessNeedsClipboard(D.insertText)), u.push(new Yxt(t, D, w, v)), L = !0;
      }
    return UT(w) && d.add(w), h.push({
      providerName: v._debugDisplayName ?? "unknown_provider",
      elapsedProvider: w.duration ?? -1,
      elapsedOverall: E.elapsed()
    }), L;
  }, _ = (async () => {
  })();
  for (const v of i.orderedGroups(e)) {
    let w = !1;
    if (await Promise.all(v.map(async (E) => {
      if (n.providerItemsToReuse.has(E)) {
        const L = n.providerItemsToReuse.get(E);
        L.forEach((T) => u.push(T)), w = w || L.length > 0;
        return;
      }
      if (!(n.providerFilter.size > 0 && !n.providerFilter.has(E)))
        try {
          const L = new _a(), T = await E.provideCompletionItems(e, t, r, s);
          w = m(E, T, L) || w;
        } catch (L) {
          No(L);
        }
    })), w || s.isCancellationRequested)
      break;
  }
  return await _, s.isCancellationRequested ? (d.dispose(), Promise.reject(new $f())) : new Xxt(u.sort(Jxt(n.snippetSortOrder)), g, { entries: h, elapsed: o.elapsed() }, d);
}
function Ope(i, e) {
  if (i.sortTextLow && e.sortTextLow) {
    if (i.sortTextLow < e.sortTextLow)
      return -1;
    if (i.sortTextLow > e.sortTextLow)
      return 1;
  }
  return i.textLabel < e.textLabel ? -1 : i.textLabel > e.textLabel ? 1 : i.completion.kind - e.completion.kind;
}
function Zxt(i, e) {
  if (i.completion.kind !== e.completion.kind) {
    if (i.completion.kind === 28)
      return -1;
    if (e.completion.kind === 28)
      return 1;
  }
  return Ope(i, e);
}
function Qxt(i, e) {
  if (i.completion.kind !== e.completion.kind) {
    if (i.completion.kind === 28)
      return 1;
    if (e.completion.kind === 28)
      return -1;
  }
  return Ope(i, e);
}
const MK = /* @__PURE__ */ new Map();
MK.set(0, Zxt);
MK.set(2, Qxt);
MK.set(1, Ope);
function Jxt(i) {
  return MK.get(i);
}
_i.registerCommand("_executeCompletionItemProvider", async (i, ...e) => {
  const [t, n, r, s] = e;
  Ii(Ht.isUri(t)), Ii(de.isIPosition(n)), Ii(typeof r == "string" || !r), Ii(typeof s == "number" || !s);
  const { completionProvider: o } = i.get(St), a = await i.get(Ic).createModelReference(t);
  try {
    const l = {
      incomplete: !1,
      suggestions: []
    }, c = [], u = a.object.textEditorModel.validatePosition(n), d = await Ape(o, a.object.textEditorModel, u, void 0, {
      triggerCharacter: r ?? void 0,
      triggerKind: r ? 1 : 0
      /* languages.CompletionTriggerKind.Invoke */
    });
    for (const h of d.items)
      c.length < (s ?? 0) && c.push(h.resolve($n.None)), l.incomplete = l.incomplete || h.container.incomplete, l.suggestions.push(h.completion);
    try {
      return await Promise.all(c), l;
    } finally {
      setTimeout(() => d.disposable.dispose(), 100);
    }
  } finally {
    a.dispose();
  }
});
function eLt(i, e) {
  var t;
  (t = i.getContribution("editor.contrib.suggestController")) == null || t.triggerSuggest((/* @__PURE__ */ new Set()).add(e), void 0, !0);
}
class mN {
  static isAllOff(e) {
    return e.other === "off" && e.comments === "off" && e.strings === "off";
  }
  static isAllOn(e) {
    return e.other === "on" && e.comments === "on" && e.strings === "on";
  }
  static valueFor(e, t) {
    switch (t) {
      case 1:
        return e.comments;
      case 2:
        return e.strings;
      default:
        return e.other;
    }
  }
}
const Sh = class Sh {
};
Sh.inlineSuggestionVisible = new ut("inlineSuggestionVisible", !1, S(1184, "Whether an inline suggestion is visible")), Sh.inlineSuggestionHasIndentation = new ut("inlineSuggestionHasIndentation", !1, S(1185, "Whether the inline suggestion starts with whitespace")), Sh.inlineSuggestionHasIndentationLessThanTabSize = new ut("inlineSuggestionHasIndentationLessThanTabSize", !0, S(1186, "Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")), Sh.suppressSuggestions = new ut("inlineSuggestionSuppressSuggestions", void 0, S(1187, "Whether suggestions should be suppressed for the current suggestion")), Sh.cursorBeforeGhostText = new ut("cursorBeforeGhostText", !1, S(1188, "Whether the cursor is at ghost text")), Sh.cursorInIndentation = new ut("cursorInIndentation", !1, S(1189, "Whether the cursor is in indentation")), Sh.hasSelection = new ut("editor.hasSelection", !1, S(1190, "Whether the editor has a selection")), Sh.cursorAtInlineEdit = new ut("cursorAtInlineEdit", !1, S(1191, "Whether the cursor is at an inline edit")), Sh.inlineEditVisible = new ut("inlineEditIsVisible", !1, S(1192, "Whether an inline edit is visible")), Sh.tabShouldJumpToInlineEdit = new ut("tabShouldJumpToInlineEdit", !1, S(1193, "Whether tab should jump to an inline edit.")), Sh.tabShouldAcceptInlineEdit = new ut("tabShouldAcceptInlineEdit", !1, S(1194, "Whether tab should accept the inline edit.")), Sh.inInlineEditsPreviewEditor = new ut("inInlineEditsPreviewEditor", !0, S(1195, "Whether the current code editor is showing an inline edits preview"));
let Cr = Sh;
const Mpe = Vn("dataChannelService");
class tLt {
  getDataChannel(e) {
    return {
      sendData: () => {
      }
    };
  }
}
var nLt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, dIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
function iLt(i) {
  var e;
  return i.sourceId + " @@ " + JSON.stringify({ ...i, modelUri: (e = i.modelUri) == null ? void 0 : e.toString(), sourceId: void 0 });
}
let Nz = class extends ge {
  static cast() {
    return this;
  }
  constructor(e, t, n) {
    super(), this._key = e, this._contextKeyService = t, this._dataChannelService = n, this._isEnabledContextKeyValue = rLt("structuredLogger.enabled:" + this._key, this._contextKeyService).recomputeInitiallyAndOnChange(this._store), this.isEnabled = this._isEnabledContextKeyValue.map((r) => r !== void 0);
  }
  log(e) {
    return this._isEnabledContextKeyValue.get() ? (this._dataChannelService.getDataChannel("structuredLogger:" + this._key).sendData(e), !0) : !1;
  }
};
Nz = nLt([
  dIe(1, Jt),
  dIe(2, Mpe)
], Nz);
function rLt(i, e) {
  return ji(e.onDidChangeContext, () => e.getContextKeyValue(i));
}
var sLt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, hIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let joe = class extends ge {
  constructor(e, t, n) {
    var o;
    super(), this._editor = e, this._instantiationService = t, this._loggerService = n, this._structuredLogger = this._register(this._instantiationService.createInstance(Nz.cast(), "editor.inlineSuggest.logChangeReason.commandId"));
    const r = (o = this._loggerService) == null ? void 0 : o.createLogger("textModelChanges", { hidden: !1, name: "Text Model Changes Reason" }), s = ji(this, r.onDidChangeLogLevel, () => r.getLevel());
    this._register(Xt((a) => {
      qPe(s.read(a), da.Trace) && a.store.add(this._editor.onDidChangeModelContent((l) => {
        var c;
        ((c = this._editor.getModel()) == null ? void 0 : c.uri.scheme) !== "output" && r.trace("onDidChangeModelContent: " + l.detailedReasons.map((u) => u.toKey(Number.MAX_VALUE)).join(", "));
      }));
    })), this._register(Xt((a) => {
      this._editor instanceof uT && this._structuredLogger.isEnabled.read(a) && a.store.add(this._editor.onDidChangeModelContent((l) => {
        const c = this._editor.getModel();
        if (!c)
          return;
        const u = l.detailedReasons[0], d = {
          ...u.metadata,
          sourceId: "TextModel.setChangeReason",
          source: u.metadata.source,
          time: Date.now(),
          modelUri: c.uri,
          modelVersion: c.getVersionId()
        };
        setTimeout(() => {
          this._structuredLogger.log(d);
        }, 0);
      }));
    }));
  }
};
joe = sLt([
  hIe(1, xt),
  hIe(2, jPe)
], joe);
function fIe(i, e = Za) {
  return Trt(i, e) ? i.charAt(0).toUpperCase() + i.slice(1) : i;
}
var oLt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, aLt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class gIe {
  constructor(e) {
    this._delegates = e;
  }
  resolve(e) {
    for (const t of this._delegates) {
      const n = t.resolve(e);
      if (n !== void 0)
        return n;
    }
  }
}
class pIe {
  constructor(e, t, n, r) {
    this._model = e, this._selection = t, this._selectionIdx = n, this._overtypingCapturer = r;
  }
  resolve(e) {
    const { name: t } = e;
    if (t === "SELECTION" || t === "TM_SELECTED_TEXT") {
      let n = this._model.getValueInRange(this._selection) || void 0, r = this._selection.startLineNumber !== this._selection.endLineNumber;
      if (!n && this._overtypingCapturer) {
        const s = this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);
        s && (n = s.value, r = s.multiline);
      }
      if (n && r && e.snippet) {
        const s = this._model.getLineContent(this._selection.startLineNumber), o = Ir(s, 0, this._selection.startColumn - 1);
        let a = o;
        e.snippet.walk((c) => c === e ? !1 : (c instanceof su && (a = Ir($d(c.value).pop())), !0));
        const l = jg(a, o);
        n = n.replace(/(\r\n|\r|\n)(.*)/g, (c, u, d) => `${u}${a.substr(l)}${d}`);
      }
      return n;
    } else {
      if (t === "TM_CURRENT_LINE")
        return this._model.getLineContent(this._selection.positionLineNumber);
      if (t === "TM_CURRENT_WORD") {
        const n = this._model.getWordAtPosition({
          lineNumber: this._selection.positionLineNumber,
          column: this._selection.positionColumn
        });
        return n && n.word || void 0;
      } else {
        if (t === "TM_LINE_INDEX")
          return String(this._selection.positionLineNumber - 1);
        if (t === "TM_LINE_NUMBER")
          return String(this._selection.positionLineNumber);
        if (t === "CURSOR_INDEX")
          return String(this._selectionIdx);
        if (t === "CURSOR_NUMBER")
          return String(this._selectionIdx + 1);
      }
    }
  }
}
class mIe {
  constructor(e, t) {
    this._labelService = e, this._model = t;
  }
  resolve(e) {
    const { name: t } = e;
    if (t === "TM_FILENAME")
      return E1(this._model.uri.fsPath);
    if (t === "TM_FILENAME_BASE") {
      const n = E1(this._model.uri.fsPath), r = n.lastIndexOf(".");
      return r <= 0 ? n : n.slice(0, r);
    } else {
      if (t === "TM_DIRECTORY")
        return sPe(this._model.uri.fsPath) === "." ? "" : this._labelService.getUriLabel(Aq(this._model.uri));
      if (t === "TM_FILEPATH")
        return this._labelService.getUriLabel(this._model.uri);
      if (t === "RELATIVE_FILEPATH")
        return this._labelService.getUriLabel(this._model.uri, { relative: !0, noPrefix: !0 });
    }
  }
}
class _Ie {
  constructor(e, t, n, r) {
    this._readClipboardText = e, this._selectionIdx = t, this._selectionCount = n, this._spread = r;
  }
  resolve(e) {
    if (e.name !== "CLIPBOARD")
      return;
    const t = this._readClipboardText();
    if (t) {
      if (this._spread) {
        const n = t.split(/\r\n|\n|\r/).filter((r) => !qMe(r));
        if (n.length === this._selectionCount)
          return n[this._selectionIdx];
      }
      return t;
    }
  }
}
let Rz = class {
  constructor(e, t, n) {
    this._model = e, this._selection = t, this._languageConfigurationService = n;
  }
  resolve(e) {
    const { name: t } = e, n = this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber, this._selection.selectionStartColumn), r = this._languageConfigurationService.getLanguageConfiguration(n).comments;
    if (r) {
      if (t === "LINE_COMMENT")
        return r.lineCommentToken || void 0;
      if (t === "BLOCK_COMMENT_START")
        return r.blockCommentStartToken || void 0;
      if (t === "BLOCK_COMMENT_END")
        return r.blockCommentEndToken || void 0;
    }
  }
};
Rz = oLt([
  aLt(2, Ls)
], Rz);
const O_ = class O_ {
  constructor() {
    this._date = /* @__PURE__ */ new Date();
  }
  resolve(e) {
    const { name: t } = e;
    if (t === "CURRENT_YEAR")
      return String(this._date.getFullYear());
    if (t === "CURRENT_YEAR_SHORT")
      return String(this._date.getFullYear()).slice(-2);
    if (t === "CURRENT_MONTH")
      return String(this._date.getMonth().valueOf() + 1).padStart(2, "0");
    if (t === "CURRENT_DATE")
      return String(this._date.getDate().valueOf()).padStart(2, "0");
    if (t === "CURRENT_HOUR")
      return String(this._date.getHours().valueOf()).padStart(2, "0");
    if (t === "CURRENT_MINUTE")
      return String(this._date.getMinutes().valueOf()).padStart(2, "0");
    if (t === "CURRENT_SECOND")
      return String(this._date.getSeconds().valueOf()).padStart(2, "0");
    if (t === "CURRENT_DAY_NAME")
      return O_.dayNames[this._date.getDay()];
    if (t === "CURRENT_DAY_NAME_SHORT")
      return O_.dayNamesShort[this._date.getDay()];
    if (t === "CURRENT_MONTH_NAME")
      return O_.monthNames[this._date.getMonth()];
    if (t === "CURRENT_MONTH_NAME_SHORT")
      return O_.monthNamesShort[this._date.getMonth()];
    if (t === "CURRENT_SECONDS_UNIX")
      return String(Math.floor(this._date.getTime() / 1e3));
    if (t === "CURRENT_TIMEZONE_OFFSET") {
      const n = this._date.getTimezoneOffset(), r = n > 0 ? "-" : "+", s = Math.trunc(Math.abs(n / 60)), o = s < 10 ? "0" + s : s, a = Math.abs(n) - s * 60, l = a < 10 ? "0" + a : a;
      return r + o + ":" + l;
    }
  }
};
O_.dayNames = [S(1391, "Sunday"), S(1392, "Monday"), S(1393, "Tuesday"), S(1394, "Wednesday"), S(1395, "Thursday"), S(1396, "Friday"), S(1397, "Saturday")], O_.dayNamesShort = [S(1398, "Sun"), S(1399, "Mon"), S(1400, "Tue"), S(1401, "Wed"), S(1402, "Thu"), S(1403, "Fri"), S(1404, "Sat")], O_.monthNames = [S(1405, "January"), S(1406, "February"), S(1407, "March"), S(1408, "April"), S(1409, "May"), S(1410, "June"), S(1411, "July"), S(1412, "August"), S(1413, "September"), S(1414, "October"), S(1415, "November"), S(1416, "December")], O_.monthNamesShort = [S(1417, "Jan"), S(1418, "Feb"), S(1419, "Mar"), S(1420, "Apr"), S(1421, "May"), S(1422, "Jun"), S(1423, "Jul"), S(1424, "Aug"), S(1425, "Sep"), S(1426, "Oct"), S(1427, "Nov"), S(1428, "Dec")];
let Az = O_;
class bIe {
  constructor(e) {
    this._workspaceService = e;
  }
  resolve(e) {
    if (!this._workspaceService)
      return;
    const t = F0t(this._workspaceService.getWorkspace());
    if (!M0t(t)) {
      if (e.name === "WORKSPACE_NAME")
        return this._resolveWorkspaceName(t);
      if (e.name === "WORKSPACE_FOLDER")
        return this._resoveWorkspacePath(t);
    }
  }
  _resolveWorkspaceName(e) {
    if (Ise(e))
      return E1(e.uri.path);
    let t = E1(e.configPath.path);
    return t.endsWith(Nse) && (t = t.substr(0, t.length - Nse.length - 1)), t;
  }
  _resoveWorkspacePath(e) {
    if (Ise(e))
      return fIe(e.uri.fsPath);
    const t = E1(e.configPath.path);
    let n = e.configPath.fsPath;
    return n.endsWith(t) && (n = n.substr(0, n.length - t.length - 1)), n ? fIe(n) : "/";
  }
}
class vIe {
  resolve(e) {
    const { name: t } = e;
    if (t === "RANDOM")
      return Math.random().toString().slice(-6);
    if (t === "RANDOM_HEX")
      return Math.random().toString(16).slice(-6);
    if (t === "UUID")
      return XT();
  }
}
var lLt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, cLt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Dp;
const Rg = class Rg {
  constructor(e, t, n) {
    this._editor = e, this._snippet = t, this._snippetLineLeadingWhitespace = n, this._offset = -1, this._nestingLevel = 1, this._placeholderGroups = Dxe(t.placeholders, Df.compareByIndex), this._placeholderGroupsIdx = -1;
  }
  initialize(e) {
    this._offset = e.newPosition;
  }
  dispose() {
    this._placeholderDecorations && this._editor.removeDecorations([...this._placeholderDecorations.values()]), this._placeholderGroups.length = 0;
  }
  _initDecorations() {
    if (this._offset === -1)
      throw new Error("Snippet not initialized!");
    if (this._placeholderDecorations)
      return;
    this._placeholderDecorations = /* @__PURE__ */ new Map();
    const e = this._editor.getModel();
    this._editor.changeDecorations((t) => {
      for (const n of this._snippet.placeholders) {
        const r = this._snippet.offset(n), s = this._snippet.fullLen(n), o = z.fromPositions(e.getPositionAt(this._offset + r), e.getPositionAt(this._offset + r + s)), a = n.isFinalTabstop ? Rg._decor.inactiveFinal : Rg._decor.inactive, l = t.addDecoration(o, a);
        this._placeholderDecorations.set(n, l);
      }
    });
  }
  move(e) {
    if (!this._editor.hasModel())
      return [];
    if (this._initDecorations(), this._placeholderGroupsIdx >= 0) {
      const r = [];
      for (const s of this._placeholderGroups[this._placeholderGroupsIdx])
        if (s.transform) {
          const o = this._placeholderDecorations.get(s), a = this._editor.getModel().getDecorationRange(o), l = this._editor.getModel().getValueInRange(a), c = s.transform.resolve(l).split(/\r\n|\r|\n/);
          for (let u = 1; u < c.length; u++)
            c[u] = this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace + c[u]);
          r.push(Xs.replace(a, c.join(this._editor.getModel().getEOL())));
        }
      r.length > 0 && this._editor.executeEdits("snippet.placeholderTransform", r);
    }
    let t = !1;
    e === !0 && this._placeholderGroupsIdx < this._placeholderGroups.length - 1 ? (this._placeholderGroupsIdx += 1, t = !0) : e === !1 && this._placeholderGroupsIdx > 0 && (this._placeholderGroupsIdx -= 1, t = !0);
    const n = this._editor.getModel().changeDecorations((r) => {
      const s = /* @__PURE__ */ new Set(), o = [];
      for (const a of this._placeholderGroups[this._placeholderGroupsIdx]) {
        const l = this._placeholderDecorations.get(a), c = this._editor.getModel().getDecorationRange(l);
        o.push(new bt(c.startLineNumber, c.startColumn, c.endLineNumber, c.endColumn)), t = t && this._hasPlaceholderBeenCollapsed(a), r.changeDecorationOptions(l, a.isFinalTabstop ? Rg._decor.activeFinal : Rg._decor.active), s.add(a);
        for (const u of this._snippet.enclosingPlaceholders(a)) {
          const d = this._placeholderDecorations.get(u);
          r.changeDecorationOptions(d, u.isFinalTabstop ? Rg._decor.activeFinal : Rg._decor.active), s.add(u);
        }
      }
      for (const [a, l] of this._placeholderDecorations)
        s.has(a) || r.changeDecorationOptions(l, a.isFinalTabstop ? Rg._decor.inactiveFinal : Rg._decor.inactive);
      return o;
    });
    return t ? this.move(e) : n ?? [];
  }
  _hasPlaceholderBeenCollapsed(e) {
    let t = e;
    for (; t; ) {
      if (t instanceof Df) {
        const n = this._placeholderDecorations.get(t);
        if (this._editor.getModel().getDecorationRange(n).isEmpty() && t.toString().length > 0)
          return !0;
      }
      t = t.parent;
    }
    return !1;
  }
  get isAtFirstPlaceholder() {
    return this._placeholderGroupsIdx <= 0 || this._placeholderGroups.length === 0;
  }
  get isAtLastPlaceholder() {
    return this._placeholderGroupsIdx === this._placeholderGroups.length - 1;
  }
  get hasPlaceholder() {
    return this._snippet.placeholders.length > 0;
  }
  /**
   * A snippet is trivial when it has no placeholder or only a final placeholder at
   * its very end
   */
  get isTrivialSnippet() {
    if (this._snippet.placeholders.length === 0)
      return !0;
    if (this._snippet.placeholders.length === 1) {
      const [e] = this._snippet.placeholders;
      if (e.isFinalTabstop && this._snippet.rightMostDescendant === e)
        return !0;
    }
    return !1;
  }
  computePossibleSelections() {
    const e = /* @__PURE__ */ new Map();
    for (const t of this._placeholderGroups) {
      let n;
      for (const r of t) {
        if (r.isFinalTabstop)
          break;
        n || (n = [], e.set(r.index, n));
        const s = this._placeholderDecorations.get(r), o = this._editor.getModel().getDecorationRange(s);
        if (!o) {
          e.delete(r.index);
          break;
        }
        n.push(o);
      }
    }
    return e;
  }
  get activeChoice() {
    if (!this._placeholderDecorations)
      return;
    const e = this._placeholderGroups[this._placeholderGroupsIdx][0];
    if (!(e != null && e.choice))
      return;
    const t = this._placeholderDecorations.get(e);
    if (!t)
      return;
    const n = this._editor.getModel().getDecorationRange(t);
    if (n)
      return { range: n, choice: e.choice };
  }
  get hasChoice() {
    let e = !1;
    return this._snippet.walk((t) => (e = t instanceof l2, !e)), e;
  }
  merge(e) {
    const t = this._editor.getModel();
    this._nestingLevel *= 10, this._editor.changeDecorations((n) => {
      for (const r of this._placeholderGroups[this._placeholderGroupsIdx]) {
        const s = e.shift();
        console.assert(s._offset !== -1), console.assert(!s._placeholderDecorations);
        const o = s._snippet.placeholderInfo.last.index;
        for (const l of s._snippet.placeholderInfo.all)
          l.isFinalTabstop ? l.index = r.index + (o + 1) / this._nestingLevel : l.index = r.index + l.index / this._nestingLevel;
        this._snippet.replace(r, s._snippet.children);
        const a = this._placeholderDecorations.get(r);
        n.removeDecoration(a), this._placeholderDecorations.delete(r);
        for (const l of s._snippet.placeholders) {
          const c = s._snippet.offset(l), u = s._snippet.fullLen(l), d = z.fromPositions(t.getPositionAt(s._offset + c), t.getPositionAt(s._offset + c + u)), h = n.addDecoration(d, Rg._decor.inactive);
          this._placeholderDecorations.set(l, h);
        }
      }
      this._placeholderGroups = Dxe(this._snippet.placeholders, Df.compareByIndex);
    });
  }
};
Rg._decor = {
  active: dn.register({ description: "snippet-placeholder-1", stickiness: 0, className: "snippet-placeholder" }),
  inactive: dn.register({ description: "snippet-placeholder-2", stickiness: 1, className: "snippet-placeholder" }),
  activeFinal: dn.register({ description: "snippet-placeholder-3", stickiness: 1, className: "finish-snippet-placeholder" }),
  inactiveFinal: dn.register({ description: "snippet-placeholder-4", stickiness: 1, className: "finish-snippet-placeholder" })
};
let Oz = Rg;
const yIe = {
  overwriteBefore: 0,
  overwriteAfter: 0,
  adjustWhitespace: !0,
  clipboardText: void 0,
  overtypingCapturer: void 0
};
let Mz = Dp = class {
  static adjustWhitespace(e, t, n, r, s) {
    const o = e.getLineContent(t.lineNumber), a = Ir(o, 0, t.column - 1);
    let l;
    return r.walk((c) => {
      if (!(c instanceof su) || c.parent instanceof l2 || s && !s.has(c))
        return !0;
      const u = c.value.split(/\r\n|\r|\n/);
      if (n) {
        const h = r.offset(c);
        if (h === 0)
          u[0] = e.normalizeIndentation(u[0]);
        else {
          l = l ?? r.toString();
          const g = l.charCodeAt(h - 1);
          (g === 10 || g === 13) && (u[0] = e.normalizeIndentation(a + u[0]));
        }
        for (let g = 1; g < u.length; g++)
          u[g] = e.normalizeIndentation(a + u[g]);
      }
      const d = u.join(e.getEOL());
      return d !== c.value && (c.parent.replace(c, [new su(d)]), l = void 0), !0;
    }), a;
  }
  static adjustSelection(e, t, n, r) {
    if (n !== 0 || r !== 0) {
      const { positionLineNumber: s, positionColumn: o } = t, a = o - n, l = o + r, c = e.validateRange({
        startLineNumber: s,
        startColumn: a,
        endLineNumber: s,
        endColumn: l
      });
      t = bt.createWithDirection(c.startLineNumber, c.startColumn, c.endLineNumber, c.endColumn, t.getDirection());
    }
    return t;
  }
  static createEditsAndSnippetsFromSelections(e, t, n, r, s, o, a, l, c) {
    const u = [], d = [];
    if (!e.hasModel())
      return { edits: u, snippets: d };
    const h = e.getModel(), g = e.invokeWithinContext((T) => T.get(i0)), m = e.invokeWithinContext((T) => new mIe(T.get(LT), h)), _ = () => a, v = h.getValueInRange(Dp.adjustSelection(h, e.getSelection(), n, 0)), w = h.getValueInRange(Dp.adjustSelection(h, e.getSelection(), 0, r)), E = h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber), L = e.getSelections().map((T, D) => ({ selection: T, idx: D })).sort((T, D) => z.compareRangesUsingStarts(T.selection, D.selection));
    for (const { selection: T, idx: D } of L) {
      let N = Dp.adjustSelection(h, T, n, 0), R = Dp.adjustSelection(h, T, 0, r);
      v !== h.getValueInRange(N) && (N = T), w !== h.getValueInRange(R) && (R = T);
      const M = T.setStartPosition(N.startLineNumber, N.startColumn).setEndPosition(R.endLineNumber, R.endColumn), B = new _T().parse(t, !0, s), H = M.getStartPosition(), j = Dp.adjustWhitespace(h, H, o || D > 0 && E !== h.getLineFirstNonWhitespaceColumn(T.positionLineNumber), B);
      B.resolveVariables(new gIe([
        m,
        new _Ie(_, D, L.length, e.getOption(
          88
          /* EditorOption.multiCursorPaste */
        ) === "spread"),
        new pIe(h, T, D, l),
        new Rz(h, T, c),
        new Az(),
        new bIe(g),
        new vIe()
      ])), u[D] = Xs.replace(M, B.toString()), u[D].identifier = { major: D, minor: 0 }, u[D]._isTracked = !0, d[D] = new Oz(e, B, j);
    }
    return { edits: u, snippets: d };
  }
  static createEditsAndSnippetsFromEdits(e, t, n, r, s, o, a) {
    if (!e.hasModel() || t.length === 0)
      return { edits: [], snippets: [] };
    const l = [], c = e.getModel(), u = new _T(), d = new WB(), h = new gIe([
      e.invokeWithinContext((m) => new mIe(m.get(LT), c)),
      new _Ie(() => s, 0, e.getSelections().length, e.getOption(
        88
        /* EditorOption.multiCursorPaste */
      ) === "spread"),
      new pIe(c, e.getSelection(), 0, o),
      new Rz(c, e.getSelection(), a),
      new Az(),
      new bIe(e.invokeWithinContext((m) => m.get(i0))),
      new vIe()
    ]);
    t = t.sort((m, _) => z.compareRangesUsingStarts(m.range, _.range));
    let g = 0;
    for (let m = 0; m < t.length; m++) {
      const { range: _, template: v, keepWhitespace: w } = t[m];
      if (m > 0) {
        const N = t[m - 1].range, R = z.fromPositions(N.getEndPosition(), _.getStartPosition()), M = new su(c.getValueInRange(R));
        d.appendChild(M), g += M.value.length;
      }
      const E = u.parseFragment(v, d);
      Dp.adjustWhitespace(c, _.getStartPosition(), w !== void 0 ? !w : r, d, new Set(E)), d.resolveVariables(h);
      const L = d.toString(), T = L.slice(g);
      g = L.length;
      const D = Xs.replace(_, T);
      D.identifier = { major: m, minor: 0 }, D._isTracked = !0, l.push(D);
    }
    return u.ensureFinalTabstop(d, n, !0), {
      edits: l,
      snippets: [new Oz(e, d, "")]
    };
  }
  constructor(e, t, n = yIe, r) {
    this._editor = e, this._template = t, this._options = n, this._languageConfigurationService = r, this._templateMerges = [], this._snippets = [];
  }
  dispose() {
    or(this._snippets);
  }
  _logInfo() {
    return `template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`;
  }
  insert(e) {
    if (!this._editor.hasModel())
      return;
    const { edits: t, snippets: n } = typeof this._template == "string" ? Dp.createEditsAndSnippetsFromSelections(this._editor, this._template, this._options.overwriteBefore, this._options.overwriteAfter, !1, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer, this._languageConfigurationService) : Dp.createEditsAndSnippetsFromEdits(this._editor, this._template, !1, this._options.adjustWhitespace, this._options.clipboardText, this._options.overtypingCapturer, this._languageConfigurationService);
    this._snippets = n, this._editor.executeEdits(e ?? $l.snippet(), t, (r) => {
      const s = r.filter((o) => !!o.identifier);
      for (let o = 0; o < n.length; o++)
        n[o].initialize(s[o].textChange);
      return this._snippets[0].hasPlaceholder ? this._move(!0) : s.map((o) => bt.fromPositions(o.range.getEndPosition()));
    }), this._editor.revealRange(this._editor.getSelections()[0]);
  }
  merge(e, t = yIe) {
    if (!this._editor.hasModel())
      return;
    this._templateMerges.push([this._snippets[0]._nestingLevel, this._snippets[0]._placeholderGroupsIdx, e]);
    const { edits: n, snippets: r } = Dp.createEditsAndSnippetsFromSelections(this._editor, e, t.overwriteBefore, t.overwriteAfter, !0, t.adjustWhitespace, t.clipboardText, t.overtypingCapturer, this._languageConfigurationService);
    this._editor.executeEdits("snippet", n, (s) => {
      const o = s.filter((l) => !!l.identifier);
      for (let l = 0; l < r.length; l++)
        r[l].initialize(o[l].textChange);
      const a = r[0].isTrivialSnippet;
      if (!a) {
        for (const l of this._snippets)
          l.merge(r);
        console.assert(r.length === 0);
      }
      return this._snippets[0].hasPlaceholder && !a ? this._move(void 0) : o.map((l) => bt.fromPositions(l.range.getEndPosition()));
    });
  }
  next() {
    const e = this._move(!0);
    this._editor.setSelections(e), this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition());
  }
  prev() {
    const e = this._move(!1);
    this._editor.setSelections(e), this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition());
  }
  _move(e) {
    const t = [];
    for (const n of this._snippets) {
      const r = n.move(e);
      t.push(...r);
    }
    return t;
  }
  get isAtFirstPlaceholder() {
    return this._snippets[0].isAtFirstPlaceholder;
  }
  get isAtLastPlaceholder() {
    return this._snippets[0].isAtLastPlaceholder;
  }
  get hasPlaceholder() {
    return this._snippets[0].hasPlaceholder;
  }
  get hasChoice() {
    return this._snippets[0].hasChoice;
  }
  get activeChoice() {
    return this._snippets[0].activeChoice;
  }
  isSelectionWithinPlaceholders() {
    if (!this.hasPlaceholder)
      return !1;
    const e = this._editor.getSelections();
    if (e.length < this._snippets.length)
      return !1;
    const t = /* @__PURE__ */ new Map();
    for (const n of this._snippets) {
      const r = n.computePossibleSelections();
      if (t.size === 0)
        for (const [s, o] of r) {
          o.sort(z.compareRangesUsingStarts);
          for (const a of e)
            if (o[0].containsRange(a)) {
              t.set(s, []);
              break;
            }
        }
      if (t.size === 0)
        return !1;
      t.forEach((s, o) => {
        s.push(...r.get(o));
      });
    }
    e.sort(z.compareRangesUsingStarts);
    for (const [n, r] of t) {
      if (r.length !== e.length) {
        t.delete(n);
        continue;
      }
      r.sort(z.compareRangesUsingStarts);
      for (let s = 0; s < r.length; s++)
        if (!r[s].containsRange(e[s])) {
          t.delete(n);
          continue;
        }
    }
    return t.size > 0;
  }
};
Mz = Dp = lLt([
  cLt(3, Ls)
], Mz);
var uLt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, EH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, qI;
const CIe = {
  overwriteBefore: 0,
  overwriteAfter: 0,
  undoStopBefore: !0,
  undoStopAfter: !0,
  adjustWhitespace: !0,
  clipboardText: void 0,
  overtypingCapturer: void 0
};
var X_;
let Dc = (X_ = class {
  static get(e) {
    return e.getContribution(qI.ID);
  }
  constructor(e, t, n, r, s) {
    this._editor = e, this._logService = t, this._languageFeaturesService = n, this._languageConfigurationService = s, this._inSnippetObservable = Qt(this, !1), this._snippetListener = new ke(), this._modelVersionId = -1, this._inSnippet = qI.InSnippetMode.bindTo(r), this._hasNextTabstop = qI.HasNextTabstop.bindTo(r), this._hasPrevTabstop = qI.HasPrevTabstop.bindTo(r);
  }
  dispose() {
    var e;
    this._inSnippet.reset(), this._inSnippetObservable.set(!1, void 0), this._hasPrevTabstop.reset(), this._hasNextTabstop.reset(), (e = this._session) == null || e.dispose(), this._snippetListener.dispose();
  }
  insert(e, t) {
    try {
      this._doInsert(e, typeof t > "u" ? CIe : { ...CIe, ...t });
    } catch (n) {
      this.cancel(), this._logService.error(n), this._logService.error("snippet_error"), this._logService.error("insert_template=", e), this._logService.error("existing_template=", this._session ? this._session._logInfo() : "<no_session>");
    }
  }
  _doInsert(e, t) {
    var n;
    if (this._editor.hasModel()) {
      if (this._snippetListener.clear(), t.undoStopBefore && this._editor.getModel().pushStackElement(), this._session && typeof e != "string" && this.cancel(), this._session ? (Ii(typeof e == "string"), this._session.merge(e, t)) : (this._modelVersionId = this._editor.getModel().getAlternativeVersionId(), this._session = new Mz(this._editor, e, t, this._languageConfigurationService), this._session.insert(t.reason)), t.undoStopAfter && this._editor.getModel().pushStackElement(), (n = this._session) != null && n.hasChoice) {
        const r = {
          _debugDisplayName: "snippetChoiceCompletions",
          provideCompletionItems: (u, d) => {
            if (!this._session || u !== this._editor.getModel() || !de.equals(this._editor.getPosition(), d))
              return;
            const { activeChoice: h } = this._session;
            if (!h || h.choice.options.length === 0)
              return;
            const g = u.getValueInRange(h.range), m = !!h.choice.options.find((v) => v.value === g), _ = [];
            for (let v = 0; v < h.choice.options.length; v++) {
              const w = h.choice.options[v];
              _.push({
                kind: 13,
                label: w.value,
                insertText: w.value,
                sortText: "a".repeat(v + 1),
                range: h.range,
                filterText: m ? `${g}_${w.value}` : void 0,
                command: { id: "jumpToNextSnippetPlaceholder", title: S(1390, "Go to next placeholder...") }
              });
            }
            return { suggestions: _ };
          }
        }, s = this._editor.getModel();
        let o, a = !1;
        const l = () => {
          o == null || o.dispose(), a = !1;
        }, c = () => {
          a || (o = this._languageFeaturesService.completionProvider.register({
            language: s.getLanguageId(),
            pattern: s.uri.fsPath,
            scheme: s.uri.scheme,
            exclusive: !0
          }, r), this._snippetListener.add(o), a = !0);
        };
        this._choiceCompletions = { provider: r, enable: c, disable: l };
      }
      this._updateState(), this._snippetListener.add(this._editor.onDidChangeModelContent((r) => r.isFlush && this.cancel())), this._snippetListener.add(this._editor.onDidChangeModel(() => this.cancel())), this._snippetListener.add(this._editor.onDidChangeCursorSelection(() => this._updateState()));
    }
  }
  _updateState() {
    if (!(!this._session || !this._editor.hasModel())) {
      if (this._modelVersionId === this._editor.getModel().getAlternativeVersionId())
        return this.cancel();
      if (!this._session.hasPlaceholder)
        return this.cancel();
      if (this._session.isAtLastPlaceholder || !this._session.isSelectionWithinPlaceholders())
        return this._editor.getModel().pushStackElement(), this.cancel();
      this._inSnippet.set(!0), this._inSnippetObservable.set(!0, void 0), this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder), this._hasNextTabstop.set(!this._session.isAtLastPlaceholder), this._handleChoice();
    }
  }
  _handleChoice() {
    var t;
    if (!this._session || !this._editor.hasModel()) {
      this._currentChoice = void 0;
      return;
    }
    const { activeChoice: e } = this._session;
    if (!e || !this._choiceCompletions) {
      (t = this._choiceCompletions) == null || t.disable(), this._currentChoice = void 0;
      return;
    }
    this._currentChoice !== e.choice && (this._currentChoice = e.choice, this._choiceCompletions.enable(), queueMicrotask(() => {
      eLt(this._editor, this._choiceCompletions.provider);
    }));
  }
  finish() {
    for (; this._inSnippet.get(); )
      this.next();
  }
  cancel(e = !1) {
    var t;
    this._inSnippet.reset(), this._inSnippetObservable.set(!1, void 0), this._hasPrevTabstop.reset(), this._hasNextTabstop.reset(), this._snippetListener.clear(), this._currentChoice = void 0, (t = this._session) == null || t.dispose(), this._session = void 0, this._modelVersionId = -1, e && this._editor.setSelections([this._editor.getSelection()]);
  }
  prev() {
    var e;
    (e = this._session) == null || e.prev(), this._updateState();
  }
  next() {
    var e;
    (e = this._session) == null || e.next(), this._updateState();
  }
  isInSnippet() {
    return !!this._inSnippet.get();
  }
  get isInSnippetObservable() {
    return this._inSnippetObservable;
  }
}, qI = X_, X_.ID = "snippetController2", X_.InSnippetMode = new ut("inSnippetMode", !1, S(1387, "Whether the editor in current in snippet mode")), X_.HasNextTabstop = new ut("hasNextTabstop", !1, S(1388, "Whether there is a next tab stop when in snippet mode")), X_.HasPrevTabstop = new ut("hasPrevTabstop", !1, S(1389, "Whether there is a previous tab stop when in snippet mode")), X_);
Dc = qI = uLt([
  EH(1, $r),
  EH(2, St),
  EH(3, Jt),
  EH(4, Ls)
], Dc);
Si(
  Dc.ID,
  Dc,
  4
  /* EditorContributionInstantiation.Lazy */
);
const PK = jo.bindToContribution(Dc.get);
ct(new PK({
  id: "jumpToNextSnippetPlaceholder",
  precondition: Re.and(Dc.InSnippetMode, Dc.HasNextTabstop),
  handler: (i) => i.next(),
  kbOpts: {
    weight: 130,
    kbExpr: se.textInputFocus,
    primary: 2
    /* KeyCode.Tab */
  }
}));
ct(new PK({
  id: "jumpToPrevSnippetPlaceholder",
  precondition: Re.and(Dc.InSnippetMode, Dc.HasPrevTabstop),
  handler: (i) => i.prev(),
  kbOpts: {
    weight: 130,
    kbExpr: se.textInputFocus,
    primary: 1026
    /* KeyCode.Tab */
  }
}));
ct(new PK({
  id: "leaveSnippet",
  precondition: Dc.InSnippetMode,
  handler: (i) => i.cancel(!0),
  kbOpts: {
    weight: 130,
    kbExpr: se.textInputFocus,
    primary: 9,
    secondary: [
      1033
      /* KeyCode.Escape */
    ]
  }
}));
ct(new PK({
  id: "acceptSnippet",
  precondition: Dc.InSnippetMode,
  handler: (i) => i.finish()
  // kbOpts: {
  // 	weight: KeybindingWeight.EditorContrib + 30,
  // 	kbExpr: EditorContextKeys.textFocus,
  // 	primary: KeyCode.Enter,
  // }
}));
function h5(i) {
  return new dLt(i);
}
class dLt extends P3e {
  constructor(e) {
    super(), this._textModel = e;
  }
  getOffset(e) {
    return this._textModel.getOffsetAt(e);
  }
  getPosition(e) {
    return this._textModel.getPositionAt(e);
  }
}
const hLt = [];
function fLt() {
  return hLt;
}
function wIe(i) {
  return gLt(i).map((t) => t.getEndPosition());
}
function gLt(i) {
  const e = MV.createSortPermutation(i, yl((r) => r.range, z.compareRangesUsingStarts)), n = new Md(e.apply(i)).getNewRanges();
  return e.inverse().apply(n);
}
function pLt(i, e) {
  const t = h5(e), n = e.getValue();
  return i.map((o) => t.getStringReplacement(o)).map((o) => o.removeCommonSuffixPrefix(n)).map((o) => t.getTextReplacement(o));
}
function mLt(i, e) {
  const t = Qt("result", []), n = [];
  return e.add(Xt((r) => {
    const s = i.read(r);
    Fr((o) => {
      if (s.length !== n.length) {
        n.length = s.length;
        for (let a = 0; a < n.length; a++)
          n[a] || (n[a] = Qt("item", s[a]));
        t.set([...n], o);
      }
      n.forEach((a, l) => a.set(s[l], o));
    });
  })), t;
}
class _Lt {
  constructor(e) {
    this._contextKeyService = e;
  }
  bind(e, t) {
    return w_(e, this._contextKeyService, t instanceof Function ? t : (n) => t.read(n));
  }
}
function SIe(i, e) {
  return new Promise((t) => {
    let n;
    const r = setTimeout(() => {
      n && n.dispose(), t();
    }, i);
    e && (n = e.onCancellationRequested(() => {
      clearTimeout(r), n && n.dispose(), t();
    }));
  });
}
class bLt {
  constructor(e, t, n, r = vLt) {
    this.startValue = e, this.endValue = t, this.durationMs = n, this._interpolationFunction = r, this.startTimeMs = Date.now(), e === t && (this.durationMs = 0);
  }
  isFinished() {
    return Date.now() >= this.startTimeMs + this.durationMs;
  }
  getValue() {
    const e = Date.now() - this.startTimeMs;
    return e >= this.durationMs ? this.endValue : this._interpolationFunction(e, this.startValue, this.endValue - this.startValue, this.durationMs);
  }
}
function vLt(i, e, t, n) {
  return i === n ? e + t : t * (-Math.pow(2, -10 * i / n) + 1) + e;
}
function yLt(i, e, t, n) {
  return t * ((i = i / n - 1) * i * i + 1) + e;
}
class CLt {
  constructor(e) {
    this._value = Qt(this, e);
  }
  getValue(e) {
    const t = this._value.read(e);
    return t.isFinished() || Pz.instance.invalidateOnNextAnimationFrame(e), t.getValue();
  }
}
const bG = class bG {
  constructor() {
    this._counter = Nf(this), this._isScheduled = !1;
  }
  invalidateOnNextAnimationFrame(e) {
    this._counter.read(e), this._isScheduled || (this._isScheduled = !0, rr().requestAnimationFrame(() => {
      this._isScheduled = !1, this._update();
    }));
  }
  _update() {
    this._counter.trigger(void 0);
  }
};
bG.instance = new bG();
let Pz = bG;
class f5 {
  constructor(e, t) {
    this.lineNumber = e, this.parts = t, J1(() => hB(t, (n, r) => n.column <= r.column));
  }
  equals(e) {
    return this.lineNumber === e.lineNumber && this.parts.length === e.parts.length && this.parts.every((t, n) => t.equals(e.parts[n]));
  }
  renderForScreenReader(e) {
    if (this.parts.length === 0)
      return "";
    const t = this.parts[this.parts.length - 1], n = e.substr(0, t.column - 1);
    return new Md([
      ...this.parts.map((s) => new Wo(z.fromPositions(new de(1, s.column)), s.lines.map((o) => o.line).join(`
`)))
    ]).applyToString(n).substring(this.parts[0].column - 1);
  }
  isEmpty() {
    return this.parts.every((e) => e.lines.length === 0);
  }
  get lineCount() {
    return 1 + this.parts.reduce((e, t) => e + t.lines.length - 1, 0);
  }
}
class Fz {
  constructor(e, t, n, r = []) {
    this.column = e, this.text = t, this.preview = n, this._inlineDecorations = r, this.lines = $d(this.text).map((s, o) => ({
      line: s,
      lineDecorations: Lc.filter(this._inlineDecorations, o + 1, 1, s.length + 1)
    }));
  }
  equals(e) {
    return this.column === e.column && this.lines.length === e.lines.length && this.lines.every((t, n) => t.line === e.lines[n].line && Lc.equalsArr(t.lineDecorations, e.lines[n].lineDecorations));
  }
}
class Goe {
  constructor(e, t, n, r = 0) {
    this.lineNumber = e, this.columnRange = t, this.text = n, this.additionalReservedLineCount = r, this.parts = [
      new Fz(this.columnRange.endColumnExclusive, this.text, !1)
    ], this.newLines = $d(this.text);
  }
  renderForScreenReader(e) {
    return this.newLines.join(`
`);
  }
  get lineCount() {
    return this.newLines.length;
  }
  isEmpty() {
    return this.parts.every((e) => e.lines.length === 0);
  }
  equals(e) {
    return this.lineNumber === e.lineNumber && this.columnRange.equals(e.columnRange) && this.newLines.length === e.newLines.length && this.newLines.every((t, n) => t === e.newLines[n]) && this.additionalReservedLineCount === e.additionalReservedLineCount;
  }
}
function EIe(i, e) {
  return ds(i, e, Y6e);
}
function Y6e(i, e) {
  return i === e ? !0 : !i || !e ? !1 : i instanceof f5 && e instanceof f5 || i instanceof Goe && e instanceof Goe ? i.equals(e) : !1;
}
function Sy(i, e, t) {
  const n = t ? i.range.intersectRanges(t) : i.range;
  if (!n)
    return i;
  const r = i.text.replaceAll(`\r
`, `
`), s = e.getValueInRange(
    n,
    1
    /* EndOfLinePreference.LF */
  ), o = jg(s, r), a = ta.ofText(s.substring(0, o)).addToPosition(i.range.getStartPosition()), l = r.substring(o), c = z.fromPositions(a, i.range.getEndPosition());
  return new Wo(c, l);
}
function X6e(i, e) {
  return i.text.startsWith(e.text) && wLt(i.range, e.range);
}
function wLt(i, e) {
  return e.getStartPosition().equals(i.getStartPosition()) && e.getEndPosition().isBeforeOrEqual(i.getEndPosition());
}
function xIe(i, e, t, n, r = 0) {
  let s = Sy(i, e);
  if (s.range.endLineNumber !== s.range.startLineNumber)
    return;
  const o = e.getLineContent(s.range.startLineNumber), a = Ir(o).length;
  if (s.range.startColumn - 1 <= a) {
    const m = Ir(s.text).length, _ = o.substring(s.range.startColumn - 1, a), [v, w] = [s.range.getStartPosition(), s.range.getEndPosition()], E = v.column + _.length <= w.column ? v.delta(0, _.length) : w, L = z.fromPositions(E, w), T = s.text.startsWith(_) ? s.text.substring(_.length) : s.text.substring(m);
    s = new Wo(L, T);
  }
  const c = e.getValueInRange(s.range), u = SLt(c, s.text);
  if (!u)
    return;
  const d = s.range.startLineNumber, h = new Array();
  if (t === "prefix") {
    const m = u.filter((_) => _.originalLength === 0);
    if (m.length > 1 || m.length === 1 && m[0].originalStart !== c.length)
      return;
  }
  const g = s.text.length - r;
  for (const m of u) {
    const _ = s.range.startColumn + m.originalStart + m.originalLength;
    if (t === "subwordSmart" && n && n.lineNumber === s.range.startLineNumber && _ < n.column || m.originalLength > 0)
      return;
    if (m.modifiedLength === 0)
      continue;
    const v = m.modifiedStart + m.modifiedLength, w = Math.max(m.modifiedStart, Math.min(v, g)), E = s.text.substring(m.modifiedStart, w), L = s.text.substring(w, Math.max(m.modifiedStart, v));
    E.length > 0 && h.push(new Fz(_, E, !1)), L.length > 0 && h.push(new Fz(_, L, !0));
  }
  return new f5(d, h);
}
let p_;
function SLt(i, e) {
  if ((p_ == null ? void 0 : p_.originalValue) === i && (p_ == null ? void 0 : p_.newValue) === e)
    return p_ == null ? void 0 : p_.changes;
  {
    let t = TIe(i, e, !0);
    if (t) {
      const n = LIe(t);
      if (n > 0) {
        const r = TIe(i, e, !1);
        r && LIe(r) < n && (t = r);
      }
    }
    return p_ = {
      originalValue: i,
      newValue: e,
      changes: t
    }, t;
  }
}
function LIe(i) {
  let e = 0;
  for (const t of i)
    e += t.originalLength;
  return e;
}
function TIe(i, e, t) {
  if (i.length > 5e3 || e.length > 5e3)
    return;
  function n(c) {
    let u = 0;
    for (let d = 0, h = c.length; d < h; d++) {
      const g = c.charCodeAt(d);
      g > u && (u = g);
    }
    return u;
  }
  const r = Math.max(n(i), n(e));
  function s(c) {
    if (c < 0)
      throw new Error("unexpected");
    return r + c + 1;
  }
  function o(c) {
    let u = 0, d = 0;
    const h = new Int32Array(c.length);
    for (let g = 0, m = c.length; g < m; g++)
      if (t && c[g] === "(") {
        const _ = d * 100 + u;
        h[g] = s(2 * _), u++;
      } else if (t && c[g] === ")") {
        u = Math.max(u - 1, 0);
        const _ = d * 100 + u;
        h[g] = s(2 * _ + 1), u === 0 && d++;
      } else
        h[g] = c.charCodeAt(g);
    return h;
  }
  const a = o(i), l = o(e);
  return new K_({ getElements: () => a }, { getElements: () => l }).ComputeDiff(!1).changes;
}
function ELt(i, e) {
  let t, n = !1;
  const r = new vPe(new wl(i, void 0, e.update), (s, o) => {
    n || (t = e.initial instanceof Function ? e.initial() : e.initial, n = !0);
    const a = e.update(s, t, o);
    return t = a, a;
  }, e.changeTracker, () => {
    var s;
    n && ((s = e.disposeFinal) == null || s.call(e, t), n = !1);
  }, e.equalityComparer ?? qh, (s, o, a) => {
    if (!n)
      throw new Wt("Can only set when there is a listener! This is to prevent leaks.");
    Ax(o, (l) => {
      t = s, r.setValue(s, l, a);
    });
  }, ba.ofCaller());
  return r;
}
var xLt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, kIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class LLt {
  constructor(e, t) {
    this._baseService = e, this._intercept = t;
  }
  publicLog2(e, t) {
    this._intercept(e, t), this._baseService.publicLog2(e, t);
  }
}
let qoe = class extends LLt {
  constructor(e, t) {
    super(e, (n, r) => {
      let s = !0;
      r && Koe in r && (s = !!r[Koe]), s && t.getDataChannel("editTelemetry").sendData({ eventName: n, data: r });
    });
  }
};
qoe = xLt([
  kIe(0, rc),
  kIe(1, Mpe)
], qoe);
const Koe = Symbol("shouldForwardToChannel");
function TLt(i) {
  return {
    // This will not be sent via telemetry, it is just a marker
    [Koe]: i
  };
}
function kLt(i) {
  if (!i)
    return !1;
  const e = i.toLowerCase();
  return e === "github.copilot" || e === "github.copilot-chat";
}
function DLt(i) {
  const e = i.map((n) => new Ya(Tt.ofStartAndLength(n.rangeOffset, n.rangeLength), n.text));
  return e.reverse(), new Jy(e);
}
function ILt(i, e) {
  i.publicLog2("inlineCompletion.endOfLife", e);
}
const NLt = 3;
class RLt {
  computeDiff(e, t, n) {
    var l;
    const s = new MLt(e, t, {
      maxComputationTime: n.maxComputationTimeMs,
      shouldIgnoreTrimWhitespace: n.ignoreTrimWhitespace,
      shouldComputeCharChanges: !0,
      shouldMakePrettyDiff: !0,
      shouldPostProcessCharChanges: !0
    }).computeDiff(), o = [];
    let a = null;
    for (const c of s.changes) {
      let u;
      c.originalEndLineNumber === 0 ? u = new Zt(c.originalStartLineNumber + 1, c.originalStartLineNumber + 1) : u = new Zt(c.originalStartLineNumber, c.originalEndLineNumber + 1);
      let d;
      c.modifiedEndLineNumber === 0 ? d = new Zt(c.modifiedStartLineNumber + 1, c.modifiedStartLineNumber + 1) : d = new Zt(c.modifiedStartLineNumber, c.modifiedEndLineNumber + 1);
      let h = new jh(u, d, (l = c.charChanges) == null ? void 0 : l.map((g) => new nu(new z(g.originalStartLineNumber, g.originalStartColumn, g.originalEndLineNumber, g.originalEndColumn), new z(g.modifiedStartLineNumber, g.modifiedStartColumn, g.modifiedEndLineNumber, g.modifiedEndColumn))));
      a && (a.modified.endLineNumberExclusive === h.modified.startLineNumber || a.original.endLineNumberExclusive === h.original.startLineNumber) && (h = new jh(a.original.join(h.original), a.modified.join(h.modified), a.innerChanges && h.innerChanges ? a.innerChanges.concat(h.innerChanges) : void 0), o.pop()), o.push(h), a = h;
    }
    return J1(() => hB(o, (c, u) => u.original.startLineNumber - c.original.endLineNumberExclusive === u.modified.startLineNumber - c.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined)
    c.original.endLineNumberExclusive < u.original.startLineNumber && c.modified.endLineNumberExclusive < u.modified.startLineNumber)), new MW(o, [], s.quitEarly);
  }
}
function Z6e(i, e, t, n) {
  return new K_(i, e, t).ComputeDiff(n);
}
class DIe {
  constructor(e) {
    const t = [], n = [];
    for (let r = 0, s = e.length; r < s; r++)
      t[r] = Yoe(e[r], 1), n[r] = Xoe(e[r], 1);
    this.lines = e, this._startColumns = t, this._endColumns = n;
  }
  getElements() {
    const e = [];
    for (let t = 0, n = this.lines.length; t < n; t++)
      e[t] = this.lines[t].substring(this._startColumns[t] - 1, this._endColumns[t] - 1);
    return e;
  }
  getStrictElement(e) {
    return this.lines[e];
  }
  getStartLineNumber(e) {
    return e + 1;
  }
  getEndLineNumber(e) {
    return e + 1;
  }
  createCharSequence(e, t, n) {
    const r = [], s = [], o = [];
    let a = 0;
    for (let l = t; l <= n; l++) {
      const c = this.lines[l], u = e ? this._startColumns[l] : 1, d = e ? this._endColumns[l] : c.length + 1;
      for (let h = u; h < d; h++)
        r[a] = c.charCodeAt(h - 1), s[a] = l + 1, o[a] = h, a++;
      !e && l < n && (r[a] = 10, s[a] = l + 1, o[a] = c.length + 1, a++);
    }
    return new ALt(r, s, o);
  }
}
class ALt {
  constructor(e, t, n) {
    this._charCodes = e, this._lineNumbers = t, this._columns = n;
  }
  toString() {
    return "[" + this._charCodes.map((e, t) => (e === 10 ? "\\n" : String.fromCharCode(e)) + `-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ") + "]";
  }
  _assertIndex(e, t) {
    if (e < 0 || e >= t.length)
      throw new Error("Illegal index");
  }
  getElements() {
    return this._charCodes;
  }
  getStartLineNumber(e) {
    return e > 0 && e === this._lineNumbers.length ? this.getEndLineNumber(e - 1) : (this._assertIndex(e, this._lineNumbers), this._lineNumbers[e]);
  }
  getEndLineNumber(e) {
    return e === -1 ? this.getStartLineNumber(e + 1) : (this._assertIndex(e, this._lineNumbers), this._charCodes[e] === 10 ? this._lineNumbers[e] + 1 : this._lineNumbers[e]);
  }
  getStartColumn(e) {
    return e > 0 && e === this._columns.length ? this.getEndColumn(e - 1) : (this._assertIndex(e, this._columns), this._columns[e]);
  }
  getEndColumn(e) {
    return e === -1 ? this.getStartColumn(e + 1) : (this._assertIndex(e, this._columns), this._charCodes[e] === 10 ? 1 : this._columns[e] + 1);
  }
}
class cR {
  constructor(e, t, n, r, s, o, a, l) {
    this.originalStartLineNumber = e, this.originalStartColumn = t, this.originalEndLineNumber = n, this.originalEndColumn = r, this.modifiedStartLineNumber = s, this.modifiedStartColumn = o, this.modifiedEndLineNumber = a, this.modifiedEndColumn = l;
  }
  static createFromDiffChange(e, t, n) {
    const r = t.getStartLineNumber(e.originalStart), s = t.getStartColumn(e.originalStart), o = t.getEndLineNumber(e.originalStart + e.originalLength - 1), a = t.getEndColumn(e.originalStart + e.originalLength - 1), l = n.getStartLineNumber(e.modifiedStart), c = n.getStartColumn(e.modifiedStart), u = n.getEndLineNumber(e.modifiedStart + e.modifiedLength - 1), d = n.getEndColumn(e.modifiedStart + e.modifiedLength - 1);
    return new cR(r, s, o, a, l, c, u, d);
  }
}
function OLt(i) {
  if (i.length <= 1)
    return i;
  const e = [i[0]];
  let t = e[0];
  for (let n = 1, r = i.length; n < r; n++) {
    const s = i[n], o = s.originalStart - (t.originalStart + t.originalLength), a = s.modifiedStart - (t.modifiedStart + t.modifiedLength);
    Math.min(o, a) < NLt ? (t.originalLength = s.originalStart + s.originalLength - t.originalStart, t.modifiedLength = s.modifiedStart + s.modifiedLength - t.modifiedStart) : (e.push(s), t = s);
  }
  return e;
}
class qF {
  constructor(e, t, n, r, s) {
    this.originalStartLineNumber = e, this.originalEndLineNumber = t, this.modifiedStartLineNumber = n, this.modifiedEndLineNumber = r, this.charChanges = s;
  }
  static createFromDiffResult(e, t, n, r, s, o, a) {
    let l, c, u, d, h;
    if (t.originalLength === 0 ? (l = n.getStartLineNumber(t.originalStart) - 1, c = 0) : (l = n.getStartLineNumber(t.originalStart), c = n.getEndLineNumber(t.originalStart + t.originalLength - 1)), t.modifiedLength === 0 ? (u = r.getStartLineNumber(t.modifiedStart) - 1, d = 0) : (u = r.getStartLineNumber(t.modifiedStart), d = r.getEndLineNumber(t.modifiedStart + t.modifiedLength - 1)), o && t.originalLength > 0 && t.originalLength < 20 && t.modifiedLength > 0 && t.modifiedLength < 20 && s()) {
      const g = n.createCharSequence(e, t.originalStart, t.originalStart + t.originalLength - 1), m = r.createCharSequence(e, t.modifiedStart, t.modifiedStart + t.modifiedLength - 1);
      if (g.getElements().length > 0 && m.getElements().length > 0) {
        let _ = Z6e(g, m, s, !0).changes;
        a && (_ = OLt(_)), h = [];
        for (let v = 0, w = _.length; v < w; v++)
          h.push(cR.createFromDiffChange(_[v], g, m));
      }
    }
    return new qF(l, c, u, d, h);
  }
}
class MLt {
  constructor(e, t, n) {
    this.shouldComputeCharChanges = n.shouldComputeCharChanges, this.shouldPostProcessCharChanges = n.shouldPostProcessCharChanges, this.shouldIgnoreTrimWhitespace = n.shouldIgnoreTrimWhitespace, this.shouldMakePrettyDiff = n.shouldMakePrettyDiff, this.originalLines = e, this.modifiedLines = t, this.original = new DIe(e), this.modified = new DIe(t), this.continueLineDiff = IIe(n.maxComputationTime), this.continueCharDiff = IIe(n.maxComputationTime === 0 ? 0 : Math.min(n.maxComputationTime, 5e3));
  }
  computeDiff() {
    if (this.original.lines.length === 1 && this.original.lines[0].length === 0)
      return this.modified.lines.length === 1 && this.modified.lines[0].length === 0 ? {
        quitEarly: !1,
        changes: []
      } : {
        quitEarly: !1,
        changes: [{
          originalStartLineNumber: 1,
          originalEndLineNumber: 1,
          modifiedStartLineNumber: 1,
          modifiedEndLineNumber: this.modified.lines.length,
          charChanges: void 0
        }]
      };
    if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0)
      return {
        quitEarly: !1,
        changes: [{
          originalStartLineNumber: 1,
          originalEndLineNumber: this.original.lines.length,
          modifiedStartLineNumber: 1,
          modifiedEndLineNumber: 1,
          charChanges: void 0
        }]
      };
    const e = Z6e(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff), t = e.changes, n = e.quitEarly;
    if (this.shouldIgnoreTrimWhitespace) {
      const a = [];
      for (let l = 0, c = t.length; l < c; l++)
        a.push(qF.createFromDiffResult(this.shouldIgnoreTrimWhitespace, t[l], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
      return {
        quitEarly: n,
        changes: a
      };
    }
    const r = [];
    let s = 0, o = 0;
    for (let a = -1, l = t.length; a < l; a++) {
      const c = a + 1 < l ? t[a + 1] : null, u = c ? c.originalStart : this.originalLines.length, d = c ? c.modifiedStart : this.modifiedLines.length;
      for (; s < u && o < d; ) {
        const h = this.originalLines[s], g = this.modifiedLines[o];
        if (h !== g) {
          {
            let m = Yoe(h, 1), _ = Yoe(g, 1);
            for (; m > 1 && _ > 1; ) {
              const v = h.charCodeAt(m - 2), w = g.charCodeAt(_ - 2);
              if (v !== w)
                break;
              m--, _--;
            }
            (m > 1 || _ > 1) && this._pushTrimWhitespaceCharChange(r, s + 1, 1, m, o + 1, 1, _);
          }
          {
            let m = Xoe(h, 1), _ = Xoe(g, 1);
            const v = h.length + 1, w = g.length + 1;
            for (; m < v && _ < w; ) {
              const E = h.charCodeAt(m - 1), L = h.charCodeAt(_ - 1);
              if (E !== L)
                break;
              m++, _++;
            }
            (m < v || _ < w) && this._pushTrimWhitespaceCharChange(r, s + 1, m, v, o + 1, _, w);
          }
        }
        s++, o++;
      }
      c && (r.push(qF.createFromDiffResult(this.shouldIgnoreTrimWhitespace, c, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)), s += c.originalLength, o += c.modifiedLength);
    }
    return {
      quitEarly: n,
      changes: r
    };
  }
  _pushTrimWhitespaceCharChange(e, t, n, r, s, o, a) {
    if (this._mergeTrimWhitespaceCharChange(e, t, n, r, s, o, a))
      return;
    let l;
    this.shouldComputeCharChanges && (l = [new cR(t, n, t, r, s, o, s, a)]), e.push(new qF(t, t, s, s, l));
  }
  _mergeTrimWhitespaceCharChange(e, t, n, r, s, o, a) {
    const l = e.length;
    if (l === 0)
      return !1;
    const c = e[l - 1];
    return c.originalEndLineNumber === 0 || c.modifiedEndLineNumber === 0 ? !1 : c.originalEndLineNumber === t && c.modifiedEndLineNumber === s ? (this.shouldComputeCharChanges && c.charChanges && c.charChanges.push(new cR(t, n, t, r, s, o, s, a)), !0) : c.originalEndLineNumber + 1 === t && c.modifiedEndLineNumber + 1 === s ? (c.originalEndLineNumber = t, c.modifiedEndLineNumber = s, this.shouldComputeCharChanges && c.charChanges && c.charChanges.push(new cR(t, n, t, r, s, o, s, a)), !0) : !1;
  }
}
function Yoe(i, e) {
  const t = Tc(i);
  return t === -1 ? e : t + 1;
}
function Xoe(i, e) {
  const t = zg(i);
  return t === -1 ? e : t + 2;
}
function IIe(i) {
  if (i === 0)
    return () => !0;
  const e = Date.now();
  return () => Date.now() - e < i;
}
const Zoe = {
  getLegacy: () => new RLt(),
  getDefault: () => new $vt()
};
var Qoe;
(function(i) {
  function e(t, n) {
    return t.isInlineEdit ? YF.create(t, n) : KF.create(t, n);
  }
  i.create = e;
})(Qoe || (Qoe = {}));
class Q6e {
  constructor(e, t, n) {
    this._data = e, this.identity = t, this.displayLocation = n;
  }
  /**
   * A reference to the original inline completion list this inline completion has been constructed from.
   * Used for event data to ensure referential equality.
  */
  get source() {
    return this._data.source;
  }
  get isFromExplicitRequest() {
    return this._data.context.triggerKind === Vu.Explicit;
  }
  get forwardStable() {
    return this.source.inlineSuggestions.enableForwardStability ?? !1;
  }
  get editRange() {
    return this.getSingleTextEdit().range;
  }
  get targetRange() {
    var e;
    return ((e = this.displayLocation) == null ? void 0 : e.range) ?? this.editRange;
  }
  get insertText() {
    return this.getSingleTextEdit().text;
  }
  get semanticId() {
    return this.hash;
  }
  get action() {
    return this._sourceInlineCompletion.action;
  }
  get command() {
    return this._sourceInlineCompletion.command;
  }
  get warning() {
    return this._sourceInlineCompletion.warning;
  }
  get showInlineEditMenu() {
    return !!this._sourceInlineCompletion.showInlineEditMenu;
  }
  get hash() {
    return JSON.stringify([
      this.getSingleTextEdit().text,
      this.getSingleTextEdit().range.getStartPosition().toString()
    ]);
  }
  get requestUuid() {
    return this._data.context.requestUuid;
  }
  get partialAccepts() {
    return this._data.partialAccepts;
  }
  /**
   * A reference to the original inline completion this inline completion has been constructed from.
   * Used for event data to ensure referential equality.
  */
  get _sourceInlineCompletion() {
    return this._data.sourceInlineCompletion;
  }
  addRef() {
    this.identity.addRef(), this.source.addRef();
  }
  removeRef() {
    this.identity.removeRef(), this.source.removeRef();
  }
  reportInlineEditShown(e, t, n) {
    this._data.reportInlineEditShown(e, this.insertText, t, n);
  }
  reportPartialAccept(e, t, n) {
    this._data.reportPartialAccept(e, t, n);
  }
  reportEndOfLife(e) {
    this._data.reportEndOfLife(e);
  }
  setEndOfLifeReason(e) {
    this._data.setEndOfLifeReason(e);
  }
  reportInlineEditError(e) {
    this._data.reportInlineEditError(e);
  }
  setIsPreceeded(e) {
    this._data.setIsPreceeded(e.partialAccepts);
  }
  setNotShownReasonIfNotSet(e) {
    this._data.setNotShownReason(e);
  }
  /**
   * Avoid using this method. Instead introduce getters for the needed properties.
  */
  getSourceCompletion() {
    return this._sourceInlineCompletion;
  }
}
const vG = class vG {
  constructor() {
    this._onDispose = Nf(this), this._refCount = 1, this.id = "InlineCompletionIdentity" + vG.idCounter++;
  }
  addRef() {
    this._refCount++;
  }
  removeRef() {
    this._refCount--, this._refCount === 0 && this._onDispose.trigger(void 0);
  }
};
vG.idCounter = 0;
let Bz = vG;
class g5 {
  static create(e) {
    return new g5(e.range, e.label, e.kind);
  }
  constructor(e, t, n) {
    this.range = e, this.label = t, this.kind = n;
  }
  withEdit(e, t) {
    const n = new Tt(t.getOffset(this.range.getStartPosition()), t.getOffset(this.range.getEndPosition())), r = M3e([n], e)[0];
    if (!r)
      return;
    const s = t.getRange(r);
    return new g5(s, this.label, this.kind);
  }
}
class KF extends Q6e {
  static create(e, t) {
    const n = new Bz(), r = h5(t), s = e.insertText.replace(/\r\n|\r|\n/g, t.getEOL()), o = FLt(new Ya(r.getOffsetRange(e.range), s), t), a = o.removeCommonSuffixAndPrefix(t.getValue()), l = r.getTextReplacement(o), c = e.displayLocation ? g5.create(e.displayLocation) : void 0;
    return new KF(o, a, l, l.range, e.snippetInfo, e.additionalTextEdits, e, n, c);
  }
  constructor(e, t, n, r, s, o, a, l, c) {
    super(a, l, c), this._edit = e, this._trimmedEdit = t, this._textEdit = n, this._originalRange = r, this.snippetInfo = s, this.additionalTextEdits = o, this.isInlineEdit = !1;
  }
  get hash() {
    return JSON.stringify(this._trimmedEdit.toJson());
  }
  getSingleTextEdit() {
    return this._textEdit;
  }
  withIdentity(e) {
    return new KF(this._edit, this._trimmedEdit, this._textEdit, this._originalRange, this.snippetInfo, this.additionalTextEdits, this._data, e, this.displayLocation);
  }
  withEdit(e, t) {
    const n = M3e([this._edit.replaceRange], e);
    if (n.length === 0)
      return;
    const r = new Ya(n[0], this._textEdit.text), s = h5(t), o = s.getTextReplacement(r);
    let a = this.displayLocation;
    if (a && (a = a.withEdit(e, s), !a))
      return;
    const l = r.removeCommonSuffixAndPrefix(t.getValue());
    return new KF(r, l, o, this._originalRange, this.snippetInfo, this.additionalTextEdits, this._data, this.identity, a);
  }
  canBeReused(e, t) {
    const n = this._textEdit.range;
    return !!n && n.containsPosition(t) && this.isVisible(e, t) && ta.ofRange(n).isGreaterThanOrEqualTo(ta.ofRange(this._originalRange));
  }
  isVisible(e, t) {
    const n = this.getSingleTextEdit();
    return J6e(n, this._originalRange, e, t);
  }
}
function J6e(i, e, t, n) {
  const r = Sy(i, t), s = i.range;
  if (!s || e && !e.getStartPosition().equals(s.getStartPosition()) || n.lineNumber !== r.range.startLineNumber || r.isEmpty)
    return !1;
  const o = t.getValueInRange(
    r.range,
    1
    /* EndOfLinePreference.LF */
  ), a = r.text, l = Math.max(0, n.column - r.range.startColumn);
  let c = a.substring(0, l), u = a.substring(l), d = o.substring(0, l), h = o.substring(l);
  const g = t.getLineIndentColumn(r.range.startLineNumber);
  return r.range.startColumn <= g && (d = d.trimStart(), d.length === 0 && (h = h.trimStart()), c = c.trimStart(), c.length === 0 && (u = u.trimStart())), c.startsWith(d) && !!v4e(h, u);
}
class YF extends Q6e {
  static create(e, t) {
    const n = PLt(t, e.range, e.insertText), r = new gT(t), o = Md.fromStringEdit(n, r).toReplacement(r), a = new Bz(), l = n.replacements.map((u) => {
      const d = z.fromPositions(t.getPositionAt(u.replaceRange.start), t.getPositionAt(u.replaceRange.endExclusive)), h = t.getValueInRange(d);
      return Hz.create(u, h);
    }), c = e.displayLocation ? g5.create(e.displayLocation) : void 0;
    return new YF(n, o, e, a, l, c, !1, t.getVersionId());
  }
  constructor(e, t, n, r, s, o, a = !1, l) {
    super(n, r, o), this._edit = e, this._textEdit = t, this._edits = s, this._lastChangePartOfInlineEdit = a, this._inlineEditModelVersion = l, this.snippetInfo = void 0, this.additionalTextEdits = [], this.isInlineEdit = !0;
  }
  get updatedEditModelVersion() {
    return this._inlineEditModelVersion;
  }
  get updatedEdit() {
    return this._edit;
  }
  getSingleTextEdit() {
    return this._textEdit;
  }
  withIdentity(e) {
    return new YF(this._edit, this._textEdit, this._data, e, this._edits, this.displayLocation, this._lastChangePartOfInlineEdit, this._inlineEditModelVersion);
  }
  canBeReused(e, t) {
    return this._lastChangePartOfInlineEdit && this.updatedEditModelVersion === e.getVersionId();
  }
  withEdit(e, t) {
    return this._applyTextModelChanges(e, this._edits, t);
  }
  _applyTextModelChanges(e, t, n) {
    if (t = t.map((d) => d.applyTextModelChanges(e)), t.some((d) => d.edit === void 0))
      return;
    const r = n.getVersionId();
    let s = this._inlineEditModelVersion;
    const o = t.some((d) => d.lastChangeUpdatedEdit);
    if (o && (s = r ?? -1), r === null || s + 20 < r || (t = t.filter((d) => !d.edit.isEmpty), t.length === 0))
      return;
    const a = new Jy(t.map((d) => d.edit)), l = h5(n), c = l.getTextEdit(a).toReplacement(new gT(n));
    let u = this.displayLocation;
    if (!(u && (u = u.withEdit(e, l), !u)))
      return new YF(a, c, this._data, this.identity, t, u, o, s);
  }
}
function PLt(i, e, t) {
  const n = i.getEOL(), r = i.getValueInRange(e), s = t.replace(/\r\n|\r|\n/g, n), l = Zoe.getDefault().computeDiff($d(r), $d(s), {
    ignoreTrimWhitespace: !1,
    computeMoves: !1,
    extendToSubwords: !0,
    maxComputationTimeMs: 500
  }).changes.flatMap((h) => h.innerChanges ?? []);
  function c(h, g) {
    const m = ta.fromPosition(g.getStartPosition());
    return ta.ofRange(g).createRange(m.addToPosition(h));
  }
  const u = new u1(s);
  return new Jy(l.map((h) => {
    const g = c(e.getStartPosition(), h.originalRange), m = h5(i).getOffsetRange(g), _ = u.getValueOfRange(h.modifiedRange), v = new Ya(m, _), w = i.getValueInRange(g);
    return BLt(v, w, l.length, i);
  }));
}
class Hz {
  static create(e, t) {
    const n = jg(e.newText, t), r = Gy(e.newText, t), s = e.newText.substring(n, e.newText.length - r);
    return new Hz(e, s, n, r);
  }
  get edit() {
    return this._edit;
  }
  get lastChangeUpdatedEdit() {
    return this._lastChangeUpdatedEdit;
  }
  constructor(e, t, n, r, s = !1) {
    this._edit = e, this._trimmedNewText = t, this._prefixLength = n, this._suffixLength = r, this._lastChangeUpdatedEdit = s;
  }
  applyTextModelChanges(e) {
    const t = this._clone();
    return t._applyTextModelChanges(e), t;
  }
  _clone() {
    return new Hz(this._edit, this._trimmedNewText, this._prefixLength, this._suffixLength, this._lastChangeUpdatedEdit);
  }
  _applyTextModelChanges(e) {
    if (this._lastChangeUpdatedEdit = !1, !this._edit)
      throw new Wt("UpdatedInnerEdits: No edit to apply changes to");
    const t = this._applyChanges(this._edit, e);
    if (!t) {
      this._edit = void 0;
      return;
    }
    this._edit = t.edit, this._lastChangeUpdatedEdit = t.editHasChanged;
  }
  _applyChanges(e, t) {
    let n = e.replaceRange.start, r = e.replaceRange.endExclusive, s = e.newText, o = !1;
    const a = this._prefixLength > 0 || this._suffixLength > 0;
    for (let l = t.replacements.length - 1; l >= 0; l--) {
      const c = t.replacements[l], u = c.newText.length > 0 && c.replaceRange.isEmpty;
      if (u && !a && c.replaceRange.start === n && s.startsWith(c.newText)) {
        n += c.newText.length, s = s.substring(c.newText.length), r = Math.max(n, r), o = !0;
        continue;
      }
      if (u && a && c.replaceRange.start === n + this._prefixLength && this._trimmedNewText.startsWith(c.newText)) {
        r += c.newText.length, o = !0, this._prefixLength += c.newText.length, this._trimmedNewText = this._trimmedNewText.substring(c.newText.length);
        continue;
      }
      if (c.newText.length === 0 && c.replaceRange.length > 0 && c.replaceRange.start >= n + this._prefixLength && c.replaceRange.endExclusive <= r - this._suffixLength) {
        r -= c.replaceRange.length, o = !0;
        continue;
      }
      if (c.equals(e)) {
        o = !0, n = c.replaceRange.endExclusive, s = "";
        continue;
      }
      if (!(c.replaceRange.start > r)) {
        if (c.replaceRange.endExclusive < n) {
          n += c.newText.length - c.replaceRange.length, r += c.newText.length - c.replaceRange.length;
          continue;
        }
        return;
      }
    }
    return this._trimmedNewText.length === 0 && n + this._prefixLength === r - this._suffixLength ? { edit: new Ya(new Tt(n + this._prefixLength, n + this._prefixLength), ""), editHasChanged: !0 } : { edit: new Ya(new Tt(n, r), s), editHasChanged: o };
  }
}
function FLt(i, e) {
  const t = e.getEOL();
  return i.replaceRange.isEmpty && i.newText.includes(t) && (i = e8e(i, e)), i;
}
function BLt(i, e, t, n) {
  const r = n.getEOL();
  if (i.newText.endsWith(r) && e.endsWith(r) && (i = new Ya(i.replaceRange.deltaEnd(-r.length), i.newText.slice(0, -r.length))), t === 1 && i.replaceRange.isEmpty && i.newText.includes(r)) {
    const s = n.getPositionAt(i.replaceRange.start);
    n.getLineLength(s.lineNumber) !== 0 && (i = e8e(i, n));
  }
  if (t === 1) {
    const s = jg(e, i.newText), o = Gy(e.slice(s), i.newText.slice(s));
    if (s + o === e.length)
      return new Ya(i.replaceRange.deltaStart(s).deltaEnd(-o), i.newText.substring(s, i.newText.length - o));
    if (s + o === i.newText.length)
      return new Ya(i.replaceRange.deltaStart(s).deltaEnd(-o), "");
  }
  return i;
}
function e8e(i, e) {
  if (!i.replaceRange.isEmpty)
    throw new Wt("Unexpected original range");
  if (i.replaceRange.start === 0)
    return i;
  const t = e.getEOL(), n = e.getPositionAt(i.replaceRange.start), r = n.column, s = n.lineNumber;
  return r === 1 && s > 1 && i.newText.endsWith(t) && !i.newText.startsWith(t) ? new Ya(i.replaceRange.delta(-1), t + i.newText.slice(0, -t.length)) : i;
}
function HLt(i, e) {
  const t = new U3e(), n = new $3e(t, (c) => e.getLanguageConfiguration(c)), r = new z3e(new WLt([i]), n), s = Sre(r, [], void 0, !0);
  let o = "";
  const a = i.getLineContent();
  function l(c, u) {
    if (c.kind === 2)
      if (l(c.openingBracket, u), u = Zs(u, c.openingBracket.length), c.child && (l(c.child, u), u = Zs(u, c.child.length)), c.closingBracket)
        l(c.closingBracket, u), u = Zs(u, c.closingBracket.length);
      else {
        const h = n.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);
        o += h;
      }
    else if (c.kind !== 3) {
      if (c.kind === 0 || c.kind === 1)
        o += a.substring(u, Zs(u, c.length));
      else if (c.kind === 4)
        for (const d of c.children)
          l(d, u), u = Zs(u, d.length);
    }
  }
  return l(s, ou), o;
}
class WLt {
  constructor(e) {
    this.lines = e, this.tokenization = {
      getLineTokens: (t) => this.lines[t - 1]
    };
  }
  getLineCount() {
    return this.lines.length;
  }
  getLineLength(e) {
    return this.lines[e - 1].getLineContent().length;
  }
}
class Ppe {
  constructor() {
    this._nodes = /* @__PURE__ */ new Set(), this._outgoingEdges = /* @__PURE__ */ new Map();
  }
  static from(e, t) {
    const n = new Ppe();
    for (const r of e)
      n._nodes.add(r);
    for (const r of e) {
      const s = t(r);
      if (s.length > 0) {
        const o = /* @__PURE__ */ new Set();
        for (const a of s)
          o.add(a);
        n._outgoingEdges.set(r, o);
      }
    }
    return n;
  }
  /**
   * After this, the graph is guaranteed to have no cycles.
   */
  removeCycles() {
    const e = [], t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = [], s = (o) => {
      t.add(o), n.add(o);
      const a = this._outgoingEdges.get(o);
      if (a)
        for (const l of a)
          t.has(l) ? n.has(l) && (e.push(l), r.push({ from: o, to: l })) : s(l);
      n.delete(o);
    };
    for (const o of this._nodes)
      t.has(o) || s(o);
    for (const { from: o, to: a } of r) {
      const l = this._outgoingEdges.get(o);
      l && l.delete(a);
    }
    return { foundCycles: e };
  }
  getOutgoing(e) {
    const t = this._outgoingEdges.get(e);
    return t ? Array.from(t) : [];
  }
}
var Kl;
(function(i) {
  i.Jump = "jump", i.Accept = "accept", i.Inactive = "inactive";
})(Kl || (Kl = {}));
var yr;
(function(i) {
  i.GhostText = "ghostText", i.Custom = "custom", i.SideBySide = "sideBySide", i.Deletion = "deletion", i.InsertionInline = "insertionInline", i.InsertionMultiLine = "insertionMultiLine", i.WordReplacements = "wordReplacements", i.LineReplacement = "lineReplacement", i.Collapsed = "collapsed";
})(yr || (yr = {}));
function VLt(i, e, t, n, r, s) {
  const o = r3e("icr"), a = new Ss();
  let l;
  const c = { ...n, requestUuid: o }, u = jLt(e, t), d = Fgt(i, (w) => w.groupId), h = Ppe.from(i, (w) => {
    var E;
    return ((E = w.yieldsToGroupIds) == null ? void 0 : E.flatMap((L) => d.get(L) ?? [])) ?? [];
  }), { foundCycles: g } = h.removeCycles();
  g.length > 0 && No(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${g.map((w) => w.toString ? w.toString() : "" + w).join(" -> ")}`));
  let m = 0;
  const _ = new nie(async (w) => {
    try {
      if (m++, a.token.isCancellationRequested)
        return;
      const E = h.getOutgoing(w);
      for (const M of E) {
        const B = await _.get(M);
        if (B)
          for (const H of B.inlineSuggestions.items) {
            if (H.isInlineEdit || typeof H.insertText != "string")
              return;
            const j = new Wo(z.lift(H.range) ?? u, H.insertText);
            if (J6e(j, void 0, t, e))
              return;
          }
      }
      let L;
      const T = Date.now();
      try {
        L = await w.provideInlineCompletions(t, e, c, a.token);
      } catch (M) {
        No(M);
        return;
      }
      const D = Date.now();
      if (!L)
        return;
      const N = [], R = new $Lt(L, N, w);
      if (R.addRef(), t8e(a.token, () => R.removeRef(l)), a.token.isCancellationRequested)
        return;
      for (const M of L.items)
        N.push(ULt(M, R, u, t, s, c, r, { startTime: T, endTime: D }));
      return R;
    } finally {
      m--;
    }
  }), v = Hf.fromPromisesResolveOrder(i.map((w) => _.get(w))).filter(Aa);
  return {
    contextWithUuid: c,
    get didAllProvidersReturn() {
      return m === 0;
    },
    lists: v,
    cancelAndDispose: (w) => {
      l === void 0 && (l = w, a.dispose(!0));
    }
  };
}
function t8e(i, e) {
  if (i.isCancellationRequested)
    return e(), ge.None;
  {
    const t = i.onCancellationRequested(() => {
      t.dispose(), e();
    });
    return { dispose: () => t.dispose() };
  }
}
function ULt(i, e, t, n, r, s, o, a) {
  let l, c, u = i.range ? z.lift(i.range) : t;
  if (typeof i.insertText == "string") {
    if (l = i.insertText, r && i.completeBracketPairs) {
      l = NIe(l, u.getStartPosition(), n, r);
      const h = l.length - i.insertText.length;
      h !== 0 && (u = new z(u.startLineNumber, u.startColumn, u.endLineNumber, u.endColumn + h));
    }
    c = void 0;
  } else if ("snippet" in i.insertText) {
    const h = i.insertText.snippet.length;
    if (r && i.completeBracketPairs) {
      i.insertText.snippet = NIe(i.insertText.snippet, u.getStartPosition(), n, r);
      const m = i.insertText.snippet.length - h;
      m !== 0 && (u = new z(u.startLineNumber, u.startColumn, u.endLineNumber, u.endColumn + m));
    }
    const g = new _T().parse(i.insertText.snippet);
    g.children.length === 1 && g.children[0] instanceof su ? (l = g.children[0].value, c = void 0) : (l = g.toString(), c = {
      snippet: i.insertText.snippet,
      range: u
    });
  } else
    dB(i.insertText);
  const d = i.displayLocation ? {
    range: z.lift(i.displayLocation.range),
    label: i.displayLocation.label,
    kind: i.displayLocation.kind
  } : void 0;
  return new zLt(u, l, c, d, i.additionalTextEdits || fLt(), i, e, s, i.isInlineEdit ?? !1, o, a, i.correlationId);
}
class zLt {
  constructor(e, t, n, r, s, o, a, l, c, u, d, h) {
    this.range = e, this.insertText = t, this.snippetInfo = n, this.displayLocation = r, this.additionalTextEdits = s, this.sourceInlineCompletion = o, this.source = a, this.context = l, this.isInlineEdit = c, this._requestInfo = u, this._providerRequestInfo = d, this._correlationId = h, this._didShow = !1, this._timeUntilShown = void 0, this._showStartTime = void 0, this._shownDuration = 0, this._showUncollapsedStartTime = void 0, this._showUncollapsedDuration = 0, this._notShownReason = void 0, this._didReportEndOfLife = !1, this._lastSetEndOfLifeReason = void 0, this._isPreceeded = !1, this._partiallyAcceptedCount = 0, this._partiallyAcceptedSinceOriginal = { characters: 0, ratio: 0, count: 0 }, this._viewData = { editorType: u.editorType };
  }
  get showInlineEditMenu() {
    return this.sourceInlineCompletion.showInlineEditMenu ?? !1;
  }
  get partialAccepts() {
    return this._partiallyAcceptedSinceOriginal;
  }
  async reportInlineEditShown(e, t, n, r) {
    var o, a;
    if (this.updateShownDuration(n), this._didShow)
      return;
    this._didShow = !0, this._viewData.viewKind = n, this._viewData.renderData = r, this._timeUntilShown = Date.now() - this._requestInfo.startTime;
    const s = new P4(r.lineCountModified, r.lineCountOriginal, r.characterCountModified, r.characterCountOriginal);
    (a = (o = this.source.provider).handleItemDidShow) == null || a.call(o, this.source.inlineSuggestions, this.sourceInlineCompletion, t, s), this.sourceInlineCompletion.shownCommand && await e.executeCommand(this.sourceInlineCompletion.shownCommand.id, ...this.sourceInlineCompletion.shownCommand.arguments || []);
  }
  reportPartialAccept(e, t, n) {
    var r, s;
    this._partiallyAcceptedCount++, this._partiallyAcceptedSinceOriginal.characters += n.characters, this._partiallyAcceptedSinceOriginal.ratio = Math.min(this._partiallyAcceptedSinceOriginal.ratio + (1 - this._partiallyAcceptedSinceOriginal.ratio) * n.ratio, 1), this._partiallyAcceptedSinceOriginal.count += n.count, (s = (r = this.source.provider).handlePartialAccept) == null || s.call(r, this.source.inlineSuggestions, this.sourceInlineCompletion, e, t);
  }
  /**
   * Sends the end of life event to the provider.
   * If no reason is provided, the last set reason is used.
   * If no reason was set, the default reason is used.
  */
  reportEndOfLife(e) {
    if (!this._didReportEndOfLife && (this._didReportEndOfLife = !0, this.reportInlineEditHidden(), e || (e = this._lastSetEndOfLifeReason ?? { kind: oT.Ignored, userTypingDisagreed: !1, supersededBy: void 0 }), e.kind === oT.Rejected && this.source.provider.handleRejection && this.source.provider.handleRejection(this.source.inlineSuggestions, this.sourceInlineCompletion), this.source.provider.handleEndOfLifetime)) {
      const t = {
        requestUuid: this.context.requestUuid,
        correlationId: this._correlationId,
        selectedSuggestionInfo: !!this.context.selectedSuggestionInfo,
        partiallyAccepted: this._partiallyAcceptedCount,
        partiallyAcceptedCountSinceOriginal: this._partiallyAcceptedSinceOriginal.count,
        partiallyAcceptedRatioSinceOriginal: this._partiallyAcceptedSinceOriginal.ratio,
        partiallyAcceptedCharactersSinceOriginal: this._partiallyAcceptedSinceOriginal.characters,
        shown: this._didShow,
        shownDuration: this._shownDuration,
        shownDurationUncollapsed: this._showUncollapsedDuration,
        preceeded: this._isPreceeded,
        timeUntilShown: this._timeUntilShown,
        timeUntilProviderRequest: this._providerRequestInfo.startTime - this._requestInfo.startTime,
        timeUntilProviderResponse: this._providerRequestInfo.endTime - this._requestInfo.startTime,
        editorType: this._viewData.editorType,
        languageId: this._requestInfo.languageId,
        requestReason: this._requestInfo.reason,
        viewKind: this._viewData.viewKind,
        notShownReason: this._notShownReason,
        error: this._viewData.error,
        typingInterval: this._requestInfo.typingInterval,
        typingIntervalCharacterCount: this._requestInfo.typingIntervalCharacterCount,
        availableProviders: this._requestInfo.availableProviders.map((n) => n.toString()).join(","),
        ...this._viewData.renderData
      };
      this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions, this.sourceInlineCompletion, e, t);
    }
  }
  reportInlineEditError(e) {
    this._viewData.error ? this._viewData.error += `; ${e}` : this._viewData.error = e;
  }
  setIsPreceeded(e) {
    this._isPreceeded = !0, (this._partiallyAcceptedSinceOriginal.characters !== 0 || this._partiallyAcceptedSinceOriginal.ratio !== 0 || this._partiallyAcceptedSinceOriginal.count !== 0) && console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."), this._partiallyAcceptedSinceOriginal = e;
  }
  setNotShownReason(e) {
    this._notShownReason ?? (this._notShownReason = e);
  }
  /**
   * Sets the end of life reason, but does not send the event to the provider yet.
  */
  setEndOfLifeReason(e) {
    this.reportInlineEditHidden(), this._lastSetEndOfLifeReason = e;
  }
  updateShownDuration(e) {
    const t = Date.now();
    this._showStartTime || (this._showStartTime = t);
    const n = e === yr.Collapsed;
    !n && this._showUncollapsedStartTime === void 0 && (this._showUncollapsedStartTime = t), n && this._showUncollapsedStartTime !== void 0 && (this._showUncollapsedDuration += t - this._showUncollapsedStartTime);
  }
  reportInlineEditHidden() {
    if (this._showStartTime === void 0)
      return;
    const e = Date.now();
    this._shownDuration += e - this._showStartTime, this._showStartTime = void 0, this._showUncollapsedStartTime !== void 0 && (this._showUncollapsedDuration += e - this._showUncollapsedStartTime, this._showUncollapsedStartTime = void 0);
  }
}
var XF;
(function(i) {
  i.TextEditor = "textEditor", i.DiffEditor = "diffEditor", i.Notebook = "notebook";
})(XF || (XF = {}));
class $Lt {
  constructor(e, t, n) {
    this.inlineSuggestions = e, this.inlineSuggestionsData = t, this.provider = n, this.refCount = 0;
  }
  addRef() {
    this.refCount++;
  }
  removeRef(e = { kind: "other" }) {
    if (this.refCount--, this.refCount === 0) {
      for (const t of this.inlineSuggestionsData)
        t.reportEndOfLife();
      this.provider.disposeInlineCompletions(this.inlineSuggestions, e);
    }
  }
}
function jLt(i, e) {
  const t = e.getWordAtPosition(i), n = e.getLineMaxColumn(i.lineNumber);
  return t ? new z(i.lineNumber, t.startColumn, i.lineNumber, n) : z.fromPositions(i, i.with(void 0, n));
}
function NIe(i, e, t, n) {
  const r = t.getLineContent(e.lineNumber), s = Ya.replace(new Tt(e.column - 1, r.length), i), o = t.tokenization.tokenizeLinesAt(e.lineNumber, [s.replace(r)]), a = o == null ? void 0 : o[0].sliceZeroCopy(s.getRangeAfterReplace());
  return a ? HLt(a, n) : i;
}
var GLt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, xH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Joe, EL;
let eae = (EL = class extends ge {
  constructor(e, t, n, r, s, o, a, l) {
    super(), this._textModel = e, this._versionId = t, this._debounceValue = n, this._cursorPosition = r, this._languageConfigurationService = s, this._logService = o, this._configurationService = a, this._instantiationService = l, this._updateOperation = this._register(new er()), this._state = ELt(this, {
      initial: () => ({
        inlineCompletions: Mg.createEmpty(),
        suggestWidgetInlineCompletions: Mg.createEmpty()
      }),
      disposeFinal: (c) => {
        c.inlineCompletions.dispose(), c.suggestWidgetInlineCompletions.dispose();
      },
      changeTracker: bit(() => ({ versionId: this._versionId })),
      update: (c, u, d) => {
        const h = Jy.compose(d.changes.map((g) => g.change ? DLt(g.change.changes) : Jy.empty).filter(Aa));
        if (h.isEmpty())
          return u;
        try {
          return {
            inlineCompletions: u.inlineCompletions.createStateWithAppliedEdit(h, this._textModel),
            suggestWidgetInlineCompletions: u.suggestWidgetInlineCompletions.createStateWithAppliedEdit(h, this._textModel)
          };
        } finally {
          u.inlineCompletions.dispose(), u.suggestWidgetInlineCompletions.dispose();
        }
      }
    }), this.inlineCompletions = this._state.map(this, (c) => c.inlineCompletions), this.suggestWidgetInlineCompletions = this._state.map(this, (c) => c.suggestWidgetInlineCompletions), this.clearOperationOnTextModelChange = Ie(this, (c) => {
      this._versionId.read(c), this._updateOperation.clear();
    }), this._loadingCount = Qt(this, 0), this._loggingEnabled = XTe("editor.inlineSuggest.logFetch", !1, this._configurationService).recomputeInitiallyAndOnChange(this._store), this._sendRequestData = XTe("editor.inlineSuggest.emptyResponseInformation", !0, this._configurationService).recomputeInitiallyAndOnChange(this._store), this._structuredFetchLogger = this._register(this._instantiationService.createInstance(Nz.cast(), "editor.inlineSuggest.logFetch.commandId")), this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);
  }
  _log(e) {
    this._loggingEnabled.get() && this._logService.info(iLt(e)), this._structuredFetchLogger.log(e);
  }
  fetch(e, t, n, r, s, o, a) {
    var _, v;
    const l = this._cursorPosition.get(), c = new qLt(l, n, this._textModel.getVersionId(), new Set(e)), u = n.selectedSuggestionInfo ? this.suggestWidgetInlineCompletions.get() : this.inlineCompletions.get();
    if ((_ = this._updateOperation.value) != null && _.request.satisfies(c))
      return this._updateOperation.value.promise;
    if ((v = u == null ? void 0 : u.request) != null && v.satisfies(c))
      return Promise.resolve(!0);
    const d = !!this._updateOperation.value;
    this._updateOperation.clear();
    const h = new Ss(), g = (async () => {
      this._loadingCount.set(this._loadingCount.get() + 1, void 0);
      const w = new ke(), E = e.filter((T) => T.providerId), L = new KLt(n, a, E);
      try {
        const T = this._debounceValue.get(this._textModel), D = w3e(e.map((Q) => Q.debounceDelayMs), iit(Hd)) ?? T;
        if ((d || s && n.triggerKind === Vu.Automatic) && await SIe(D, h.token), h.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== c.versionId)
          return L.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"), !1;
        const R = Joe._requestId++;
        (this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) && this._log({
          sourceId: "InlineCompletions.fetch",
          kind: "start",
          requestId: R,
          modelUri: this._textModel.uri,
          modelVersion: this._textModel.getVersionId(),
          context: { triggerKind: n.triggerKind, suggestInfo: n.selectedSuggestionInfo ? !0 : void 0 },
          time: Date.now(),
          provider: t
        });
        const M = /* @__PURE__ */ new Date(), B = VLt(e, this._cursorPosition.get(), this._textModel, n, a, this._languageConfigurationService);
        t8e(h.token, () => B.cancelAndDispose({ kind: "tokenCancellation" }));
        let H = !1, j = !1;
        const K = [];
        for await (const Q of B.lists)
          if (Q) {
            Q.addRef(), w.add(Et(() => Q.removeRef(Q.inlineSuggestionsData.length === 0 ? { kind: "empty" } : { kind: "notTaken" })));
            for (const oe of Q.inlineSuggestionsData) {
              if (j = !0, !n.includeInlineEdits && (oe.isInlineEdit || oe.showInlineEditMenu)) {
                oe.setNotShownReason("notInlineEditRequested");
                continue;
              }
              if (!n.includeInlineCompletions && !(oe.isInlineEdit || oe.showInlineEditMenu)) {
                oe.setNotShownReason("notInlineCompletionRequested");
                continue;
              }
              const Z = Qoe.create(oe, this._textModel);
              K.push(Z), !Z.isInlineEdit && !Z.showInlineEditMenu && n.triggerKind === Vu.Automatic && Z.isVisible(this._textModel, this._cursorPosition.get()) && (H = !0);
            }
            if (H)
              break;
          }
        if (B.cancelAndDispose({ kind: "lostRace" }), this._loggingEnabled.get() || this._structuredFetchLogger.isEnabled.get()) {
          const Q = B.didAllProvidersReturn;
          let oe;
          (h.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== c.versionId) && (oe = "canceled");
          const Z = K.map((pe) => ({
            range: pe.editRange.toString(),
            text: pe.insertText,
            isInlineEdit: !!pe.isInlineEdit,
            source: pe.source.provider.groupId
          }));
          this._log({ sourceId: "InlineCompletions.fetch", kind: "end", requestId: R, durationMs: Date.now() - M.getTime(), error: oe, result: Z, time: Date.now(), didAllProvidersReturn: Q });
        }
        L.setRequestUuid(B.contextWithUuid.requestUuid), j ? (L.setHasProducedSuggestion(), K.length > 0 && h.token.isCancellationRequested && K.forEach((Q) => Q.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders"))) : h.token.isCancellationRequested ? L.setNoSuggestionReasonIfNotSet("canceled:whileFetching") : L.setNoSuggestionReasonIfNotSet("noSuggestion");
        const X = n.earliestShownDateTime - Date.now();
        if (X > 0 && await SIe(X, h.token), h.token.isCancellationRequested || this._store.isDisposed || this._textModel.getVersionId() !== c.versionId || o.get()) {
          const Q = h.token.isCancellationRequested ? "canceled:afterMinShowDelay" : this._store.isDisposed ? "canceled:disposed" : this._textModel.getVersionId() !== c.versionId ? "canceled:documentChanged" : o.get() ? "canceled:userJumped" : "unknown";
          return K.forEach((oe) => oe.setNotShownReasonIfNotSet(Q)), !1;
        }
        const Y = /* @__PURE__ */ new Date();
        this._debounceValue.update(this._textModel, Y.getTime() - M.getTime());
        const G = this._cursorPosition.get();
        this._updateOperation.clear(), Fr((Q) => {
          const oe = this._state.get();
          n.selectedSuggestionInfo ? this._state.set({
            inlineCompletions: Mg.createEmpty(),
            suggestWidgetInlineCompletions: oe.suggestWidgetInlineCompletions.createStateWithAppliedResults(K, c, this._textModel, G, r)
          }, Q) : this._state.set({
            inlineCompletions: oe.inlineCompletions.createStateWithAppliedResults(K, c, this._textModel, G, r),
            suggestWidgetInlineCompletions: Mg.createEmpty()
          }, Q), oe.inlineCompletions.dispose(), oe.suggestWidgetInlineCompletions.dispose();
        });
      } finally {
        this._loadingCount.set(this._loadingCount.get() - 1, void 0), w.dispose(), this.sendInlineCompletionsRequestTelemetry(L);
      }
      return !0;
    })(), m = new XLt(c, h, g);
    return this._updateOperation.value = m, g;
  }
  clear(e) {
    this._updateOperation.clear();
    const t = this._state.get();
    this._state.set({
      inlineCompletions: Mg.createEmpty(),
      suggestWidgetInlineCompletions: Mg.createEmpty()
    }, e), t.inlineCompletions.dispose(), t.suggestWidgetInlineCompletions.dispose();
  }
  seedInlineCompletionsWithSuggestWidget() {
    const e = this.inlineCompletions.get(), t = this.suggestWidgetInlineCompletions.get();
    t && Fr((n) => {
      var r, s;
      if (!e || (((r = t.request) == null ? void 0 : r.versionId) ?? -1) > (((s = e.request) == null ? void 0 : s.versionId) ?? -1)) {
        e == null || e.dispose();
        const o = this._state.get();
        this._state.set({
          inlineCompletions: t.clone(),
          suggestWidgetInlineCompletions: Mg.createEmpty()
        }, n), o.inlineCompletions.dispose(), o.suggestWidgetInlineCompletions.dispose();
      }
      this.clearSuggestWidgetInlineCompletions(n);
    });
  }
  sendInlineCompletionsRequestTelemetry(e) {
    if (!this._sendRequestData.get() || e.requestUuid === void 0 || e.hasProducedSuggestion)
      return;
    const t = {
      id: e.requestUuid,
      opportunityId: e.requestUuid,
      noSuggestionReason: e.noSuggestionReason ?? "unknown",
      extensionId: "vscode-core",
      extensionVersion: "0.0.0",
      groupId: "empty",
      shown: !1,
      editorType: e.requestInfo.editorType,
      requestReason: e.requestInfo.reason,
      typingInterval: e.requestInfo.typingInterval,
      typingIntervalCharacterCount: e.requestInfo.typingIntervalCharacterCount,
      languageId: e.requestInfo.languageId,
      selectedSuggestionInfo: !!e.context.selectedSuggestionInfo,
      availableProviders: e.providers.map((r) => {
        var s;
        return (s = r.providerId) == null ? void 0 : s.toString();
      }).filter(Aa).join(","),
      ...TLt(e.providers.some((r) => {
        var s;
        return kLt((s = r.providerId) == null ? void 0 : s.extensionId);
      })),
      timeUntilProviderRequest: void 0,
      timeUntilProviderResponse: void 0,
      viewKind: void 0,
      preceeded: void 0,
      error: void 0,
      superseded: void 0,
      reason: void 0,
      correlationId: void 0,
      shownDuration: void 0,
      shownDurationUncollapsed: void 0,
      timeUntilShown: void 0,
      partiallyAccepted: void 0,
      partiallyAcceptedCountSinceOriginal: void 0,
      partiallyAcceptedRatioSinceOriginal: void 0,
      partiallyAcceptedCharactersSinceOriginal: void 0,
      cursorColumnDistance: void 0,
      cursorLineDistance: void 0,
      lineCountOriginal: void 0,
      lineCountModified: void 0,
      characterCountOriginal: void 0,
      characterCountModified: void 0,
      disjointReplacements: void 0,
      sameShapeReplacements: void 0,
      notShownReason: void 0
    }, n = this._instantiationService.createInstance(qoe);
    ILt(n, t);
  }
  clearSuggestWidgetInlineCompletions(e) {
    var t;
    (t = this._updateOperation.value) != null && t.request.context.selectedSuggestionInfo && this._updateOperation.clear();
  }
  cancelUpdate() {
    this._updateOperation.clear();
  }
}, Joe = EL, EL._requestId = 0, EL);
eae = Joe = GLt([
  xH(4, Ls),
  xH(5, $r),
  xH(6, xn),
  xH(7, xt)
], eae);
class qLt {
  constructor(e, t, n, r) {
    this.position = e, this.context = t, this.versionId = n, this.providers = r;
  }
  satisfies(e) {
    return this.position.equals(e.position) && cx(this.context.selectedSuggestionInfo, e.context.selectedSuggestionInfo, qhe()) && (e.context.triggerKind === Vu.Automatic || this.context.triggerKind === Vu.Explicit) && this.versionId === e.versionId && YLt(e.providers, this.providers);
  }
}
class KLt {
  constructor(e, t, n) {
    this.context = e, this.requestInfo = t, this.providers = n, this.hasProducedSuggestion = !1;
  }
  setRequestUuid(e) {
    this.requestUuid = e;
  }
  setNoSuggestionReasonIfNotSet(e) {
    this.noSuggestionReason ?? (this.noSuggestionReason = e);
  }
  setHasProducedSuggestion() {
    this.hasProducedSuggestion = !0;
  }
}
function YLt(i, e) {
  return [...i].every((t) => e.has(t));
}
class XLt {
  constructor(e, t, n) {
    this.request = e, this.cancellationTokenSource = t, this.promise = n;
  }
  dispose() {
    this.cancellationTokenSource.cancel();
  }
}
class Mg extends ge {
  static createEmpty() {
    return new Mg([], void 0);
  }
  constructor(e, t) {
    for (const n of e)
      n.addRef();
    super(), this.inlineCompletions = e, this.request = t, this._register({
      dispose: () => {
        for (const n of this.inlineCompletions)
          n.removeRef();
      }
    });
  }
  _findById(e) {
    return this.inlineCompletions.find((t) => t.identity === e);
  }
  _findByHash(e) {
    return this.inlineCompletions.find((t) => t.hash === e);
  }
  /**
   * Applies the edit on the state.
  */
  createStateWithAppliedEdit(e, t) {
    const n = this.inlineCompletions.map((r) => r.withEdit(e, t)).filter(Aa);
    return new Mg(n, this.request);
  }
  createStateWithAppliedResults(e, t, n, r, s) {
    let o;
    if (s) {
      const c = this._findById(s);
      if (c && c.canBeReused(n, t.position)) {
        o = c;
        const u = e.find((d) => d.hash === c.hash);
        u ? e = QLt(u, e) : e = [c, ...e];
      }
    }
    const a = o ? !o.isInlineEdit : e.some((c) => !c.isInlineEdit && c.isVisible(n, r));
    let l = [];
    for (const c of e) {
      const u = this._findByHash(c.hash);
      let d;
      u && u !== c ? (d = c.withIdentity(u.identity), c.setIsPreceeded(u), u.setEndOfLifeReason({ kind: oT.Ignored, userTypingDisagreed: !1, supersededBy: c.getSourceCompletion() })) : d = c, a !== d.isInlineEdit && l.push(d);
    }
    return l.sort(yl((c) => c.showInlineEditMenu, pPe)), l = ZLt(l, (c) => c.semanticId), new Mg(l, t);
  }
  clone() {
    return new Mg(this.inlineCompletions, this.request);
  }
}
function ZLt(i, e) {
  const t = /* @__PURE__ */ new Set();
  return i.filter((n) => {
    const r = e(n);
    return t.has(r) ? !1 : (t.add(r), !0);
  });
}
function QLt(i, e) {
  const t = e.indexOf(i);
  return t > -1 ? [i, ...e.slice(0, t), ...e.slice(t + 1)] : e;
}
class JLt {
  constructor(e, t, n) {
    this.edit = e, this.commands = t, this.inlineCompletion = n;
  }
  equals(e) {
    return this.edit.equals(e.edit) && this.inlineCompletion === e.inlineCompletion;
  }
}
var eTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, RIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const FK = Vn("IInlineCompletionsService"), n8e = new ut("inlineCompletions.snoozed", !1, S(76, "Whether inline completions are currently snoozed"));
let tae = class extends ge {
  get snoozeTimeLeft() {
    return this._snoozeTimeEnd === void 0 ? 0 : Math.max(0, this._snoozeTimeEnd - Date.now());
  }
  constructor(e, t) {
    super(), this._contextKeyService = e, this._telemetryService = t, this._onDidChangeIsSnoozing = this._register(new he()), this.onDidChangeIsSnoozing = this._onDidChangeIsSnoozing.event, this._snoozeTimeEnd = void 0, this._recentCompletionIds = [], this._timer = this._register(new yq());
    const n = n8e.bindTo(this._contextKeyService);
    this._register(this.onDidChangeIsSnoozing(() => n.set(this.isSnoozing())));
  }
  setSnoozeDuration(e) {
    if (e < 0)
      throw new Wt(`Invalid snooze duration: ${e}. Duration must be non-negative.`);
    if (e === 0) {
      this.cancelSnooze();
      return;
    }
    const t = this.isSnoozing(), n = this.snoozeTimeLeft;
    this._snoozeTimeEnd = Date.now() + e, t || this._onDidChangeIsSnoozing.fire(!0), this._timer.cancelAndSet(() => {
      if (!this.isSnoozing())
        this._onDidChangeIsSnoozing.fire(!1);
      else
        throw new Wt("Snooze timer did not fire as expected");
    }, this.snoozeTimeLeft + 1), this._reportSnooze(e - n, e);
  }
  isSnoozing() {
    return this.snoozeTimeLeft > 0;
  }
  cancelSnooze() {
    this.isSnoozing() && (this._reportSnooze(-this.snoozeTimeLeft, 0), this._snoozeTimeEnd = void 0, this._timer.cancel(), this._onDidChangeIsSnoozing.fire(!1));
  }
  reportNewCompletion(e) {
    this._lastCompletionId = e, this._recentCompletionIds.unshift(e), this._recentCompletionIds.length > 5 && this._recentCompletionIds.pop();
  }
  _reportSnooze(e, t) {
    const n = Math.round(e / 1e3), r = Math.round(t / 1e3);
    this._telemetryService.publicLog2("inlineCompletions.snooze", {
      deltaSeconds: n,
      totalSeconds: r,
      lastCompletionId: this._lastCompletionId,
      recentCompletionIds: this._recentCompletionIds
    });
  }
};
tae = eTt([
  RIe(0, Jt),
  RIe(1, rc)
], tae);
ni(
  FK,
  tae,
  1
  /* InstantiationType.Delayed */
);
const tTt = "editor.action.inlineSuggest.snooze", nTt = "editor.action.inlineSuggest.cancelSnooze", AIe = "inlineCompletions.lastSnoozeDuration", yG = class yG extends Fa {
  constructor() {
    super({
      id: yG.ID,
      title: Ee(78, "Snooze Inline Suggestions"),
      precondition: Re.true(),
      f1: !0
    });
  }
  async run(e, ...t) {
    const n = e.get(tc), r = e.get(FK), s = e.get(gu);
    let o;
    t.length > 0 && typeof t[0] == "number" && (o = t[0]), o || (o = await this.getDurationFromUser(n, s)), o && r.setSnoozeDuration(o);
  }
  async getDurationFromUser(e, t) {
    const n = t.getNumber(AIe, 0, 3e5), r = [
      { label: "1 minute", id: "1", value: 6e4 },
      { label: "5 minutes", id: "5", value: 3e5 },
      { label: "10 minutes", id: "10", value: 6e5 },
      { label: "15 minutes", id: "15", value: 9e5 },
      { label: "30 minutes", id: "30", value: 18e5 },
      { label: "60 minutes", id: "60", value: 36e5 }
    ], s = await e.pick(r, {
      placeHolder: S(77, "Select snooze duration for Code completions and NES"),
      activeItem: r.find((o) => o.value === n)
    });
    if (s)
      return t.store(
        AIe,
        s.value,
        0,
        0
        /* StorageTarget.USER */
      ), s.value;
  }
};
yG.ID = tTt;
let nae = yG;
const CG = class CG extends Fa {
  constructor() {
    super({
      id: CG.ID,
      title: Ee(79, "Cancel Snooze Inline Suggestions"),
      precondition: n8e,
      f1: !0
    });
  }
  async run(e) {
    e.get(FK).cancelSnooze();
  }
};
CG.ID = nTt;
let iae = CG;
const wf = class wf extends ge {
  // Minimum characters needed for reliable speed calculation
  /**
   * Gets the current typing interval as average milliseconds between keystrokes
   * and the number of characters involved in the computation.
   * Higher interval values indicate slower typing.
   * Returns { interval: 0, characterCount: 0 } if no typing data is available.
   */
  getTypingInterval() {
    return (this._cacheInvalidated || this._cachedTypingIntervalResult === null) && (this._cachedTypingIntervalResult = this._calculateTypingInterval(), this._cacheInvalidated = !1), this._cachedTypingIntervalResult;
  }
  constructor(e) {
    super(), this._textModel = e, this._typingSessions = [], this._currentSession = null, this._lastChangeTime = 0, this._cachedTypingIntervalResult = null, this._cacheInvalidated = !0, this._register(this._textModel.onDidChangeContent((t) => this._updateTypingSpeed(t)));
  }
  _updateTypingSpeed(e) {
    const t = Date.now();
    if (!this._isUserTyping(e)) {
      this._finalizeCurrentSession();
      return;
    }
    this._currentSession && t - this._lastChangeTime > wf.MAX_SESSION_GAP_MS && this._finalizeCurrentSession(), this._currentSession || (this._currentSession = {
      startTime: t,
      endTime: t,
      characterCount: 0
    }), this._currentSession.endTime = t, this._currentSession.characterCount += this._getActualCharacterCount(e), this._lastChangeTime = t, this._cacheInvalidated = !0;
  }
  _getActualCharacterCount(e) {
    let t = 0;
    for (const n of e.changes)
      t += Math.max(n.text.length, n.rangeLength);
    return t;
  }
  _isUserTyping(e) {
    if (!e.detailedReasons || e.detailedReasons.length === 0)
      return !1;
    for (const t of e.detailedReasons)
      if (this._isUserTypingReason(t))
        return !0;
    return !1;
  }
  _isUserTypingReason(e) {
    if (e.metadata.isUndoing || e.metadata.isRedoing)
      return !1;
    switch (e.metadata.source) {
      case "cursor": {
        const t = e.metadata.kind;
        return t === "type" || t === "compositionType" || t === "compositionEnd";
      }
      default:
        return !1;
    }
  }
  _finalizeCurrentSession() {
    if (!this._currentSession)
      return;
    this._currentSession.endTime - this._currentSession.startTime >= wf.MIN_SESSION_DURATION_MS && this._currentSession.characterCount > 0 && (this._typingSessions.push(this._currentSession), this._typingSessions.length > wf.SESSION_HISTORY_LIMIT && this._typingSessions.shift()), this._currentSession = null;
  }
  _calculateTypingInterval() {
    if (this._currentSession) {
      const e = { ...this._currentSession };
      if (e.endTime - e.startTime >= wf.MIN_SESSION_DURATION_MS && e.characterCount > 0) {
        const n = [...this._typingSessions, e];
        return this._calculateSpeedFromSessions(n);
      }
    }
    return this._calculateSpeedFromSessions(this._typingSessions);
  }
  _calculateSpeedFromSessions(e) {
    if (e.length === 0)
      return { averageInterval: 0, characterCount: 0 };
    const t = [...e].sort((u, d) => d.endTime - u.endTime), n = Date.now() - wf.TYPING_SPEED_WINDOW_MS, r = t.filter((u) => u.endTime > n), s = t.splice(r.length);
    let o = PV(r.map((u) => u.characterCount));
    for (let u = 0; u < s.length && o < wf.MIN_CHARS_FOR_RELIABLE_SPEED; u++)
      r.push(s[u]), o += s[u].characterCount;
    const a = PV(r.map((u) => u.endTime - u.startTime));
    if (a === 0 || o <= 1)
      return { averageInterval: 0, characterCount: o };
    const l = Math.max(1, o - 1), c = a / l;
    return {
      averageInterval: Math.round(c),
      characterCount: o
    };
  }
  dispose() {
    this._finalizeCurrentSession(), super.dispose();
  }
};
wf.MAX_SESSION_GAP_MS = 3e3, wf.MIN_SESSION_DURATION_MS = 1e3, wf.SESSION_HISTORY_LIMIT = 50, wf.TYPING_SPEED_WINDOW_MS = 3e5, wf.MIN_CHARS_FOR_RELIABLE_SPEED = 20;
let rae = wf;
var iTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, fE = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let sae = class extends ge {
  get isAcceptingPartially() {
    return this._isAcceptingPartially;
  }
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g, m) {
    super(), this.textModel = e, this._selectedSuggestItem = t, this._textModelVersionId = n, this._positions = r, this._debounceValue = s, this._enabled = o, this._editor = a, this._instantiationService = l, this._commandService = c, this._languageConfigurationService = u, this._accessibilityService = d, this._languageFeaturesService = h, this._codeEditorService = g, this._inlineCompletionsService = m, this._isActive = Qt(this, !1), this._onlyRequestInlineEditsSignal = Nf(this), this._forceUpdateExplicitlySignal = Nf(this), this._noDelaySignal = Nf(this), this._fetchSpecificProviderSignal = Nf(this), this._selectedInlineCompletionId = Qt(this, void 0), this.primaryPosition = Ie(this, (T) => this._positions.read(T)[0] ?? new de(1, 1)), this._isAcceptingPartially = !1, this._appearedInsideViewport = Ie(this, (T) => {
      const D = this.state.read(T);
      if (!D || !D.inlineCompletion)
        return !1;
      const N = D.inlineCompletion.targetRange, R = this._editorObs.editor.getVisibleRanges();
      return R.length < 1 ? !1 : new z(R[0].startLineNumber, R[0].startColumn, R[R.length - 1].endLineNumber, R[R.length - 1].endColumn).containsRange(N);
    }), this._onDidAccept = new he(), this.onDidAccept = this._onDidAccept.event, this._lastShownInlineCompletionInfo = void 0, this._lastAcceptedInlineCompletionInfo = void 0, this._didUndoInlineEdits = Axe({
      owner: this,
      changeTracker: {
        createChangeSummary: () => ({ didUndo: !1 }),
        handleChange: (T, D) => {
          var N;
          return D.didUndo = T.didChange(this._textModelVersionId) && !!((N = T.change) != null && N.isUndoing), !0;
        }
      }
    }, (T, D) => {
      const N = this._textModelVersionId.read(T);
      return N !== null && this._lastAcceptedInlineCompletionInfo && this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter === N - 1 && this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit && D.didUndo ? (this._lastAcceptedInlineCompletionInfo = void 0, !0) : !1;
    }), this._preserveCurrentCompletionReasons = /* @__PURE__ */ new Set([
      Jv.Redo,
      Jv.Undo,
      Jv.AcceptWord
    ]), this.dontRefetchSignal = Nf(this), this._fetchInlineCompletionsPromise = Axe({
      owner: this,
      changeTracker: {
        createChangeSummary: () => ({
          dontRefetch: !1,
          preserveCurrentCompletion: !1,
          inlineCompletionTriggerKind: Vu.Automatic,
          onlyRequestInlineEdits: !1,
          shouldDebounce: !0,
          provider: void 0,
          textChange: !1,
          changeReason: ""
        }),
        handleChange: (T, D) => {
          var N;
          if (T.didChange(this._textModelVersionId)) {
            this._preserveCurrentCompletionReasons.has(this._getReason(T.change)) && (D.preserveCurrentCompletion = !0);
            const R = ((N = T.change) == null ? void 0 : N.detailedReasons) ?? [];
            D.changeReason = R.length > 0 ? R[0].getType() : "", D.textChange = !0;
          } else T.didChange(this._forceUpdateExplicitlySignal) ? (D.preserveCurrentCompletion = !0, D.inlineCompletionTriggerKind = Vu.Explicit) : T.didChange(this.dontRefetchSignal) ? D.dontRefetch = !0 : T.didChange(this._onlyRequestInlineEditsSignal) ? D.onlyRequestInlineEdits = !0 : T.didChange(this._fetchSpecificProviderSignal) && (D.provider = T.change);
          return !0;
        }
      }
    }, (T, D) => {
      var Z, pe, J;
      if (this._source.clearOperationOnTextModelChange.read(T), this._noDelaySignal.read(T), this.dontRefetchSignal.read(T), this._onlyRequestInlineEditsSignal.read(T), this._forceUpdateExplicitlySignal.read(T), this._fetchSpecificProviderSignal.read(T), !((this._enabled.read(T) && this._selectedSuggestItem.read(T) || this._isActive.read(T)) && (!this._inlineCompletionsService.isSnoozing() || D.inlineCompletionTriggerKind === Vu.Explicit))) {
        this._source.cancelUpdate();
        return;
      }
      this._textModelVersionId.read(T);
      const R = this._source.suggestWidgetInlineCompletions.read(void 0);
      let M = this._selectedSuggestItem.read(T);
      if (this._shouldShowOnSuggestConflict.read(void 0) && (M = void 0), R && !M && this._source.seedInlineCompletionsWithSuggestWidget(), D.dontRefetch)
        return Promise.resolve(!0);
      if (this._didUndoInlineEdits.read(T) && D.inlineCompletionTriggerKind !== Vu.Explicit) {
        Fr((ae) => {
          this._source.clear(ae);
        });
        return;
      }
      let B = "";
      D.provider ? B += "providerOnDidChange" : D.inlineCompletionTriggerKind === Vu.Explicit && (B += "explicit"), D.changeReason && (B += B.length > 0 ? `:${D.changeReason}` : D.changeReason);
      const H = this._typing.getTypingInterval(), j = {
        editorType: this.editorType,
        startTime: Date.now(),
        languageId: this.textModel.getLanguageId(),
        reason: B,
        typingInterval: H.averageInterval,
        typingIntervalCharacterCount: H.characterCount,
        availableProviders: []
      };
      let K = {
        triggerKind: D.inlineCompletionTriggerKind,
        selectedSuggestionInfo: M == null ? void 0 : M.toSelectedSuggestionInfo(),
        includeInlineCompletions: !D.onlyRequestInlineEdits,
        includeInlineEdits: this._inlineEditsEnabled.read(T),
        requestIssuedDateTime: j.startTime,
        earliestShownDateTime: j.startTime + (D.inlineCompletionTriggerKind === Vu.Explicit || this.inAcceptFlow.read(void 0) ? 0 : this._minShowDelay.read(void 0))
      };
      K.triggerKind === Vu.Automatic && D.textChange && this.textModel.getAlternativeVersionId() === ((Z = this._lastShownInlineCompletionInfo) == null ? void 0 : Z.alternateTextModelVersionId) && (K = {
        ...K,
        includeInlineCompletions: !this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,
        includeInlineEdits: this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit
      });
      const X = this.selectedInlineCompletion.read(void 0) ?? ((pe = this._inlineCompletionItems.read(void 0)) == null ? void 0 : pe.inlineEdit), Y = D.preserveCurrentCompletion || X != null && X.forwardStable ? X : void 0, G = this._jumpedToId.map((ae) => {
        var be, re;
        return !!ae && ae === ((re = (be = this._inlineCompletionItems.read(void 0)) == null ? void 0 : be.inlineEdit) == null ? void 0 : re.semanticId);
      }), Q = D.provider ? { providers: [D.provider], label: "single:" + ((J = D.provider.providerId) == null ? void 0 : J.toString()) } : { providers: this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel), label: void 0 }, oe = this.getAvailableProviders(Q.providers);
      return j.availableProviders = oe.map((ae) => ae.providerId).filter(Aa), this._source.fetch(oe, Q.label, K, Y == null ? void 0 : Y.identity, D.shouldDebounce, G, j);
    }), this._inlineCompletionItems = pl({ owner: this }, (T) => {
      const D = this._source.inlineCompletions.read(T);
      if (!D)
        return;
      const N = this.primaryPosition.read(T);
      let R;
      const M = [];
      for (const B of D.inlineCompletions)
        B.isInlineEdit ? R = B : B.isVisible(this.textModel, N) && M.push(B);
      return M.length !== 0 && (R = void 0), {
        inlineCompletions: M,
        inlineEdit: R
      };
    }), this._filteredInlineCompletionItems = pl({ owner: this, equalsFn: e4() }, (T) => {
      const D = this._inlineCompletionItems.read(T);
      return (D == null ? void 0 : D.inlineCompletions) ?? [];
    }), this.selectedInlineCompletionIndex = Ie(this, (T) => {
      const D = this._selectedInlineCompletionId.read(T), N = this._filteredInlineCompletionItems.read(T), R = this._selectedInlineCompletionId === void 0 ? -1 : N.findIndex((M) => M.semanticId === D);
      return R === -1 ? (this._selectedInlineCompletionId.set(void 0, void 0), 0) : R;
    }), this.selectedInlineCompletion = Ie(this, (T) => {
      const D = this._filteredInlineCompletionItems.read(T), N = this.selectedInlineCompletionIndex.read(T);
      return D[N];
    }), this.activeCommands = pl({ owner: this, equalsFn: e4() }, (T) => {
      var D;
      return ((D = this.selectedInlineCompletion.read(T)) == null ? void 0 : D.source.inlineSuggestions.commands) ?? [];
    }), this.inlineCompletionsCount = Ie(this, (T) => {
      if (this.lastTriggerKind.read(T) === Vu.Explicit)
        return this._filteredInlineCompletionItems.read(T).length;
    }), this._hasVisiblePeekWidgets = Ie(this, (T) => this._editorObs.openedPeekWidgets.read(T) > 0), this._shouldShowOnSuggestConflict = Ie(this, (T) => {
      const D = this._showOnSuggestConflict.read(T);
      if (D !== "never" && !!this.selectedInlineCompletion.read(T)) {
        const R = this._selectedSuggestItem.read(T);
        return R ? D === "whenSuggestListIsIncomplete" ? R.listIncomplete : !0 : !1;
      }
      return !1;
    }), this.state = pl({
      owner: this,
      equalsFn: (T, D) => !T || !D ? T === D : T.kind === "ghostText" && D.kind === "ghostText" ? EIe(T.ghostTexts, D.ghostTexts) && T.inlineCompletion === D.inlineCompletion && T.suggestItem === D.suggestItem : T.kind === "inlineEdit" && D.kind === "inlineEdit" ? T.inlineEdit.equals(D.inlineEdit) : !1
    }, (T) => {
      var B, H, j, K, X, Y, G;
      const D = this.textModel;
      if (this._suppressInSnippetMode.read(T) && this._isInSnippetMode.read(T))
        return;
      const N = this._inlineCompletionItems.read(T), R = N == null ? void 0 : N.inlineEdit;
      if (R) {
        if (this._hasVisiblePeekWidgets.read(T))
          return;
        let Q = R.getSingleTextEdit();
        Q = Sy(Q, D);
        const oe = this.primaryPosition.map((re) => Zt.fromRangeInclusive(R.targetRange).addMargin(1, 1).contains(re.lineNumber)), Z = R.source.inlineSuggestions.commands, pe = new JLt(Q, Z ?? [], R), J = R.updatedEdit, ae = J ? Md.fromStringEdit(J, new gT(this.textModel)).replacements : [Q], be = (((H = (B = N.inlineEdit) == null ? void 0 : B.command) == null ? void 0 : H.id) === "vscode.open" || ((K = (j = N.inlineEdit) == null ? void 0 : j.command) == null ? void 0 : K.id) === "_workbench.open") && ((Y = (X = N.inlineEdit) == null ? void 0 : X.command.arguments) != null && Y.length) ? Ht.from((G = N.inlineEdit) == null ? void 0 : G.command.arguments[0]) : void 0;
        return { kind: "inlineEdit", inlineEdit: pe, inlineCompletion: R, edits: ae, cursorAtInlineEdit: oe, nextEditUri: be };
      }
      const M = this._selectedSuggestItem.read(T);
      if (!this._shouldShowOnSuggestConflict.read(T) && M) {
        const Q = Sy(M.getSingleTextEdit(), D), oe = this._computeAugmentation(Q, T);
        if (!this._suggestPreviewEnabled.read(T) && !oe)
          return;
        const pe = (oe == null ? void 0 : oe.edit) ?? Q, J = oe ? oe.edit.text.length - Q.text.length : 0, ae = this._suggestPreviewMode.read(T), be = this._positions.read(T), ze = [pe, ...dte(this.textModel, be, pe)].map((et, at) => ({ edit: et, ghostText: et ? xIe(et, D, ae, be[at], J) : void 0 })).filter(({ edit: et, ghostText: at }) => et !== void 0 && at !== void 0), Ve = ze.map(({ edit: et }) => et), st = ze.map(({ ghostText: et }) => et), ot = st[0] ?? new f5(pe.range.endLineNumber, []);
        return { kind: "ghostText", edits: Ve, primaryGhostText: ot, ghostTexts: st, inlineCompletion: oe == null ? void 0 : oe.completion, suggestItem: M };
      } else {
        if (!this._isActive.read(T))
          return;
        const Q = this.selectedInlineCompletion.read(T);
        if (!Q)
          return;
        const oe = Q.getSingleTextEdit(), Z = this._inlineSuggestMode.read(T), pe = this._positions.read(T), ae = [oe, ...dte(this.textModel, pe, oe)].map((ze, Ve) => ({ edit: ze, ghostText: ze ? xIe(ze, D, Z, pe[Ve], 0) : void 0 })).filter(({ edit: ze, ghostText: Ve }) => ze !== void 0 && Ve !== void 0), be = ae.map(({ edit: ze }) => ze), re = ae.map(({ ghostText: ze }) => ze);
        return re[0] ? { kind: "ghostText", edits: be, primaryGhostText: re[0], ghostTexts: re, inlineCompletion: Q, suggestItem: void 0 } : void 0;
      }
    }), this.inlineCompletionState = Ie(this, (T) => {
      const D = this.state.read(T);
      if (!(!D || D.kind !== "ghostText") && !this._editorObs.inComposition.read(T))
        return D;
    }), this.inlineEditState = Ie(this, (T) => {
      const D = this.state.read(T);
      if (!(!D || D.kind !== "inlineEdit"))
        return D;
    }), this.inlineEditAvailable = Ie(this, (T) => !!this.inlineEditState.read(T)), this.warning = Ie(this, (T) => {
      var D, N;
      return (N = (D = this.inlineCompletionState.read(T)) == null ? void 0 : D.inlineCompletion) == null ? void 0 : N.warning;
    }), this.ghostTexts = pl({ owner: this, equalsFn: EIe }, (T) => {
      const D = this.inlineCompletionState.read(T);
      if (D)
        return D.ghostTexts;
    }), this.primaryGhostText = pl({ owner: this, equalsFn: Y6e }, (T) => {
      const D = this.inlineCompletionState.read(T);
      if (D)
        return D == null ? void 0 : D.primaryGhostText;
    }), this.showCollapsed = Ie(this, (T) => {
      const D = this.state.read(T);
      if (!D || D.kind !== "inlineEdit" || D.inlineCompletion.displayLocation)
        return !1;
      const N = D.inlineCompletion.updatedEditModelVersion === this._textModelVersionId.read(T);
      return (this._inlineEditsShowCollapsedEnabled.read(T) || !N) && this._jumpedToId.read(T) !== D.inlineCompletion.semanticId && !this._inAcceptFlow.read(T);
    }), this._tabShouldIndent = Ie(this, (T) => {
      if (this._inAcceptFlow.read(T))
        return !1;
      function D(M) {
        return M.startLineNumber !== M.endLineNumber;
      }
      function N(M, B) {
        const H = M.getLineIndentColumn(B), j = M.getLineLastNonWhitespaceColumn(B), K = Math.max(j, H);
        return new z(B, H, B, K);
      }
      const R = this._editorObs.selections.read(T);
      return R == null ? void 0 : R.some((M) => M.isEmpty() ? this.textModel.getLineLength(M.startLineNumber) === 0 : D(M) || M.containsRange(N(this.textModel, M.startLineNumber)));
    }), this.tabShouldJumpToInlineEdit = Ie(this, (T) => {
      if (this._tabShouldIndent.read(T))
        return !1;
      const D = this.inlineEditState.read(T);
      return D ? this.showCollapsed.read(T) ? !0 : this._inAcceptFlow.read(T) && this._appearedInsideViewport.read(T) ? !1 : !D.cursorAtInlineEdit.read(T) : !1;
    }), this.tabShouldAcceptInlineEdit = Ie(this, (T) => {
      const D = this.inlineEditState.read(T);
      return !D || this.showCollapsed.read(T) ? !1 : this._inAcceptFlow.read(T) && this._appearedInsideViewport.read(T) || D.inlineCompletion.targetRange.startLineNumber === this._editorObs.cursorLineNumber.read(T) || this._jumpedToId.read(T) === D.inlineCompletion.semanticId ? !0 : this._tabShouldIndent.read(T) ? !1 : D.cursorAtInlineEdit.read(T);
    }), this._jumpedToId = Qt(this, void 0), this._inAcceptFlow = Qt(this, !1), this.inAcceptFlow = this._inAcceptFlow, this._source = this._register(this._instantiationService.createInstance(eae, this.textModel, this._textModelVersionId, this._debounceValue, this.primaryPosition)), this.lastTriggerKind = this._source.inlineCompletions.map(this, (T) => {
      var D;
      return (D = T == null ? void 0 : T.request) == null ? void 0 : D.context.triggerKind;
    }), this._editorObs = Ms(this._editor);
    const _ = this._editorObs.getOption(
      134
      /* EditorOption.suggest */
    );
    this._suggestPreviewEnabled = _.map((T) => T.preview), this._suggestPreviewMode = _.map((T) => T.previewMode);
    const v = this._editorObs.getOption(
      71
      /* EditorOption.inlineSuggest */
    );
    this._inlineSuggestMode = v.map((T) => T.mode), this._suppressedInlineCompletionGroupIds = v.map((T) => new Set(T.experimental.suppressInlineSuggestions.split(","))), this._inlineEditsEnabled = v.map((T) => !!T.edits.enabled), this._inlineEditsShowCollapsedEnabled = v.map((T) => T.edits.showCollapsed), this._triggerCommandOnProviderChange = v.map((T) => T.triggerCommandOnProviderChange), this._minShowDelay = v.map((T) => T.minShowDelay), this._showOnSuggestConflict = v.map((T) => T.experimental.showOnSuggestConflict), this._suppressInSnippetMode = v.map((T) => T.suppressInSnippetMode);
    const w = Dc.get(this._editor);
    this._isInSnippetMode = (w == null ? void 0 : w.isInSnippetObservable) ?? Br(!1), this._typing = this._register(new rae(this.textModel)), this._register(this._inlineCompletionsService.onDidChangeIsSnoozing((T) => {
      T && this.stop();
    }));
    {
      const T = this.textModel.uri.scheme === "vscode-notebook-cell", [D] = this._codeEditorService.listDiffEditors().filter((N) => N.getOriginalEditor().getId() === this._editor.getId() || N.getModifiedEditor().getId() === this._editor.getId());
      this.isInDiffEditor = !!D, this.editorType = T ? XF.Notebook : this.isInDiffEditor ? XF.DiffEditor : XF.TextEditor;
    }
    this._register(GR(this.state, (T) => {
      T && T.inlineCompletion && this._inlineCompletionsService.reportNewCompletion(T.inlineCompletion.requestUuid);
    })), this._register(GR(this._fetchInlineCompletionsPromise)), this._register(Xt((T) => {
      this._editorObs.versionId.read(T), this._inAcceptFlow.set(!1, void 0);
    })), this._register(Xt((T) => {
      this.state.map((N, R) => !N || N.kind === "inlineEdit" && !N.cursorAtInlineEdit.read(R)).read(T) && this._jumpedToId.set(void 0, void 0);
    }));
    const E = this.inlineEditState.map((T) => T == null ? void 0 : T.inlineCompletion.semanticId);
    this._register(Xt((T) => {
      E.read(T) && (this._editor.pushUndoStop(), this._lastShownInlineCompletionInfo = {
        alternateTextModelVersionId: this.textModel.getAlternativeVersionId(),
        inlineCompletion: this.state.get().inlineCompletion
      });
    }));
    const L = ji(this._languageFeaturesService.inlineCompletionsProvider.onDidChange, () => this._languageFeaturesService.inlineCompletionsProvider.all(e));
    Zhe(this, L, (T, D) => {
      T.onDidChangeInlineCompletions && D.add(T.onDidChangeInlineCompletions(() => {
        var M;
        if (!this._enabled.get() || (this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor()) !== this._editor)
          return;
        if (this._triggerCommandOnProviderChange.get()) {
          this.trigger(void 0, { onlyFetchInlineEdits: !0 });
          return;
        }
        const R = this.state.get();
        R && (R.inlineCompletion || R.edits) && ((M = R.inlineCompletion) == null ? void 0 : M.source.provider) !== T || Fr((B) => {
          this._fetchSpecificProviderSignal.trigger(B, T), this.trigger(B);
        });
      }));
    }).recomputeInitiallyAndOnChange(this._store), this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store);
  }
  getIndentationInfo(e) {
    let t = !1, n = !0;
    const r = this == null ? void 0 : this.primaryGhostText.read(e);
    if (this != null && this._selectedSuggestItem && r && r.parts.length > 0) {
      const { column: s, lines: o } = r.parts[0], a = o[0].line, l = this.textModel.getLineIndentColumn(r.lineNumber);
      if (s <= l) {
        let u = Tc(a);
        u === -1 && (u = a.length - 1), t = u > 0;
        const d = this.textModel.getOptions().tabSize;
        n = As.visibleColumnFromColumn(a, u + 1, d) < d;
      }
    }
    return {
      startsWithIndentation: t,
      startsWithIndentationLessThanTabSize: n
    };
  }
  _getReason(e) {
    return e != null && e.isUndoing ? Jv.Undo : e != null && e.isRedoing ? Jv.Redo : this.isAcceptingPartially ? Jv.AcceptWord : Jv.Other;
  }
  // TODO: This is not an ideal implementation of excludesGroupIds, however as this is currently still behind proposed API
  // and due to the time constraints, we are using a simplified approach
  getAvailableProviders(e) {
    var o;
    const t = this._suppressedInlineCompletionGroupIds.get(), n = e.filter((a) => !(a.groupId && t.has(a.groupId))), r = /* @__PURE__ */ new Set();
    for (const a of n)
      (o = a.excludesGroupIds) == null || o.forEach((l) => r.add(l));
    const s = [];
    for (const a of n)
      a.groupId && r.has(a.groupId) || s.push(a);
    return s;
  }
  async trigger(e, t) {
    Ax(e, (n) => {
      t != null && t.onlyFetchInlineEdits && this._onlyRequestInlineEditsSignal.trigger(n), t != null && t.noDelay && this._noDelaySignal.trigger(n), this._isActive.set(!0, n);
    }), await this._fetchInlineCompletionsPromise.get();
  }
  async triggerExplicitly(e, t = !1) {
    Ax(e, (n) => {
      t && this._onlyRequestInlineEditsSignal.trigger(n), this._isActive.set(!0, n), this._inAcceptFlow.set(!0, n), this._forceUpdateExplicitlySignal.trigger(n);
    }), await this._fetchInlineCompletionsPromise.get();
  }
  stop(e = "automatic", t) {
    Ax(t, (n) => {
      var r;
      if (e === "explicitCancel") {
        const s = (r = this.state.get()) == null ? void 0 : r.inlineCompletion;
        s && s.reportEndOfLife({ kind: oT.Rejected });
      }
      this._isActive.set(!1, n), this._source.clear(n);
    });
  }
  _computeAugmentation(e, t) {
    const n = this.textModel, r = this._source.suggestWidgetInlineCompletions.read(t), s = r ? r.inlineCompletions.filter((a) => !a.isInlineEdit) : [this.selectedInlineCompletion.read(t)].filter(Aa);
    return mdt(s, (a) => {
      let l = a.getSingleTextEdit();
      return l = Sy(l, n, z.fromPositions(l.range.getStartPosition(), e.range.getEndPosition())), X6e(l, e) ? { completion: a, edit: l } : void 0;
    });
  }
  async _deltaSelectedInlineCompletionIndex(e) {
    await this.triggerExplicitly();
    const t = this._filteredInlineCompletionItems.get() || [];
    if (t.length > 0) {
      const n = (this.selectedInlineCompletionIndex.get() + e + t.length) % t.length;
      this._selectedInlineCompletionId.set(t[n].semanticId, void 0);
    } else
      this._selectedInlineCompletionId.set(void 0, void 0);
  }
  async next() {
    await this._deltaSelectedInlineCompletionIndex(1);
  }
  async previous() {
    await this._deltaSelectedInlineCompletionIndex(-1);
  }
  _getMetadata(e, t, n = void 0) {
    return n ? $l.inlineCompletionPartialAccept({
      nes: e.isInlineEdit,
      requestUuid: e.requestUuid,
      providerId: e.source.provider.providerId,
      languageId: t,
      type: n
    }) : $l.inlineCompletionAccept({
      nes: e.isInlineEdit,
      requestUuid: e.requestUuid,
      providerId: e.source.provider.providerId,
      languageId: t
    });
  }
  async accept(e = this._editor) {
    var s;
    if (e.getModel() !== this.textModel)
      throw new Wt();
    let t, n = !1;
    const r = this.state.get();
    if ((r == null ? void 0 : r.kind) === "ghostText") {
      if (!r || r.primaryGhostText.isEmpty() || !r.inlineCompletion)
        return;
      t = r.inlineCompletion;
    } else if ((r == null ? void 0 : r.kind) === "inlineEdit")
      t = r.inlineCompletion, n = !!r.nextEditUri;
    else
      return;
    t.addRef();
    try {
      if (e.pushUndoStop(), !n)
        if (t.snippetInfo) {
          const o = Wo.delete(t.editRange), a = t.additionalTextEdits.map((c) => new Wo(z.lift(c.range), c.text ?? "")), l = Md.fromParallelReplacementsUnsorted([o, ...a]);
          e.edit(l, this._getMetadata(t, this.textModel.getLanguageId())), e.setPosition(t.snippetInfo.range.getStartPosition(), "inlineCompletionAccept"), (s = Dc.get(e)) == null || s.insert(t.snippetInfo.snippet, { undoStopBefore: !1 });
        } else {
          const o = r.edits;
          let a = o;
          r.kind === "ghostText" && (a = pLt(o, this.textModel));
          const l = wIe(a).map((d) => bt.fromPositions(d)), c = t.additionalTextEdits.map((d) => new Wo(z.lift(d.range), d.text ?? "")), u = Md.fromParallelReplacementsUnsorted([...o, ...c]);
          if (e.edit(u, this._getMetadata(t, this.textModel.getLanguageId())), t.displayLocation === void 0 && e.setSelections(r.kind === "inlineEdit" ? l.slice(-1) : l, "inlineCompletionAccept"), r.kind === "inlineEdit" && !this._accessibilityService.isMotionReduced()) {
            const d = u.getNewRanges(), h = this._store.add(new rTt(e, d, () => {
              this._store.delete(h);
            }));
          }
        }
      this._onDidAccept.fire(), this.stop(), t.command && await this._commandService.executeCommand(t.command.id, ...t.command.arguments || []).then(void 0, No), t.reportEndOfLife({ kind: oT.Accepted });
    } finally {
      t.removeRef(), this._inAcceptFlow.set(!0, void 0), this._lastAcceptedInlineCompletionInfo = { textModelVersionIdAfter: this.textModel.getVersionId(), inlineCompletion: t };
    }
  }
  async acceptNextWord() {
    await this._acceptNext(
      this._editor,
      "word",
      (e, t) => {
        const n = this.textModel.getLanguageIdAtPosition(e.lineNumber, e.column), r = this._languageConfigurationService.getLanguageConfiguration(n), s = new RegExp(r.wordDefinition.source, r.wordDefinition.flags.replace("g", "")), o = t.match(s);
        let a = 0;
        o && o.index !== void 0 ? o.index === 0 ? a = o[0].length : a = o.index : a = t.length;
        const c = /\s+/g.exec(t);
        return c && c.index !== void 0 && c.index + c[0].length < a && (a = c.index + c[0].length), a;
      },
      0
      /* PartialAcceptTriggerKind.Word */
    );
  }
  async acceptNextLine() {
    await this._acceptNext(
      this._editor,
      "line",
      (e, t) => {
        const n = t.match(/\n/);
        return n && n.index !== void 0 ? n.index + 1 : t.length;
      },
      1
      /* PartialAcceptTriggerKind.Line */
    );
  }
  async _acceptNext(e, t, n, r) {
    if (e.getModel() !== this.textModel)
      throw new Wt();
    const s = this.inlineCompletionState.get();
    if (!s || s.primaryGhostText.isEmpty() || !s.inlineCompletion)
      return;
    const o = s.primaryGhostText, a = s.inlineCompletion;
    if (a.snippetInfo) {
      await this.accept(e);
      return;
    }
    const l = o.parts[0], c = new de(o.lineNumber, l.column), u = l.text, d = n(c, u);
    if (d === u.length && o.parts.length === 1) {
      this.accept(e);
      return;
    }
    const h = u.substring(0, d), g = this._positions.get(), m = g[0];
    a.addRef();
    try {
      this._isAcceptingPartially = !0;
      try {
        e.pushUndoStop();
        const E = z.fromPositions(m, c), L = e.getModel().getValueInRange(E) + h, T = new Wo(E, L), D = [T, ...dte(this.textModel, g, T)].filter(Aa), N = wIe(D).map((R) => bt.fromPositions(R));
        e.edit(Md.fromParallelReplacementsUnsorted(D), this._getMetadata(a, t)), e.setSelections(N, "inlineCompletionPartialAccept"), e.revealPositionInCenterIfOutsideViewport(
          e.getPosition(),
          1
          /* ScrollType.Immediate */
        );
      } finally {
        this._isAcceptingPartially = !1;
      }
      const _ = z.fromPositions(a.editRange.getStartPosition(), ta.ofText(h).addToPosition(c)), w = e.getModel().getValueInRange(
        _,
        1
        /* EndOfLinePreference.LF */
      ).length;
      a.reportPartialAccept(w, { kind: r, acceptedLength: w }, { characters: d, ratio: d / u.length, count: 1 });
    } finally {
      a.removeRef();
    }
  }
  handleSuggestAccepted(e) {
    const t = Sy(e.getSingleTextEdit(), this.textModel), n = this._computeAugmentation(t, void 0);
    if (!n)
      return;
    const s = this.textModel.getValueInRange(
      n.completion.editRange,
      1
      /* EndOfLinePreference.LF */
    ).length + t.text.length;
    n.completion.reportPartialAccept(t.text.length, {
      kind: 2,
      acceptedLength: s
    }, {
      characters: t.text.length,
      count: 1,
      ratio: 1
    });
  }
  extractReproSample() {
    var n;
    const e = this.textModel.getValue(), t = (n = this.state.get()) == null ? void 0 : n.inlineCompletion;
    return {
      documentValue: e,
      inlineCompletion: t == null ? void 0 : t.getSourceCompletion()
    };
  }
  jump() {
    const e = this.inlineEditState.get();
    e && Fr((t) => {
      this._jumpedToId.set(e.inlineCompletion.semanticId, t), this.dontRefetchSignal.trigger(t);
      const n = e.inlineCompletion.targetRange, r = n.getStartPosition();
      if (this._editor.setPosition(r, "inlineCompletions.jump"), n.isSingleLine() && (e.inlineCompletion.displayLocation || !e.inlineCompletion.insertText.includes(`
`)))
        this._editor.revealPosition(r);
      else {
        const o = new z(n.startLineNumber - 1, 1, n.endLineNumber + 1, 1);
        this._editor.revealRange(
          o,
          1
          /* ScrollType.Immediate */
        );
      }
      this._editor.focus();
    });
  }
  async handleInlineSuggestionShown(e, t, n) {
    await e.reportInlineEditShown(this._commandService, t, n);
  }
};
sae = iTt([
  fE(7, xt),
  fE(8, jr),
  fE(9, Ls),
  fE(10, Qa),
  fE(11, St),
  fE(12, Ti),
  fE(13, FK)
], sae);
var Jv;
(function(i) {
  i[i.Undo = 0] = "Undo", i[i.Redo = 1] = "Redo", i[i.AcceptWord = 2] = "AcceptWord", i[i.Other = 3] = "Other";
})(Jv || (Jv = {}));
function dte(i, e, t) {
  if (e.length === 1)
    return [];
  const n = new gT(i), r = n.getTransformer(), s = r.getOffset(e[0]), o = e.slice(1).map((h) => r.getOffset(h));
  t = t.removeCommonPrefixAndSuffix(n);
  const a = r.getStringReplacement(t), l = a.replaceRange.start - s, c = a.replaceRange.join(Tt.emptyAt(s)), u = n.getValueOfOffsetRange(c);
  return o.map((h) => {
    const g = h + l, m = g + a.replaceRange.length, _ = new Tt(g, m), v = _.join(Tt.emptyAt(h));
    if (n.getValueOfOffsetRange(v) !== u)
      return;
    const E = new Ya(_, a.newText);
    return r.getTextReplacement(E);
  }).filter(Aa);
}
class rTt extends ge {
  constructor(e, t, n) {
    super(), n && this._register({ dispose: () => n() }), this._register(Ms(e).setDecorations(Br(t.map((o) => ({
      range: o,
      options: {
        description: "animation",
        className: "edits-fadeout-decoration",
        zIndex: 1
      }
    })))));
    const r = new bLt(1, 0, 1e3, yLt), s = new CLt(r);
    this._register(Xt((o) => {
      const a = s.getValue(o);
      e.getContainerDomNode().style.setProperty("--animation-opacity", a.toString()), r.isFinished() && this.dispose();
    }));
  }
}
var sTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, OIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, QP;
class Fpe {
  constructor(e) {
    this.name = e;
  }
  select(e, t, n) {
    if (n.length === 0)
      return 0;
    const r = n[0].score[0];
    for (let s = 0; s < n.length; s++) {
      const { score: o, completion: a } = n[s];
      if (o[0] !== r)
        break;
      if (a.preselect)
        return s;
    }
    return 0;
  }
}
class MIe extends Fpe {
  constructor() {
    super("first");
  }
  memorize(e, t, n) {
  }
  toJSON() {
  }
  fromJSON() {
  }
}
class oTt extends Fpe {
  constructor() {
    super("recentlyUsed"), this._cache = new Tb(300, 0.66), this._seq = 0;
  }
  memorize(e, t, n) {
    const r = `${e.getLanguageId()}/${n.textLabel}`;
    this._cache.set(r, {
      touch: this._seq++,
      type: n.completion.kind,
      insertText: n.completion.insertText
    });
  }
  select(e, t, n) {
    if (n.length === 0)
      return 0;
    const r = e.getLineContent(t.lineNumber).substr(t.column - 10, t.column - 1);
    if (/\s$/.test(r))
      return super.select(e, t, n);
    const s = n[0].score[0];
    let o = -1, a = -1, l = -1;
    for (let c = 0; c < n.length && n[c].score[0] === s; c++) {
      const u = `${e.getLanguageId()}/${n[c].textLabel}`, d = this._cache.peek(u);
      if (d && d.touch > l && d.type === n[c].completion.kind && d.insertText === n[c].completion.insertText && (l = d.touch, a = c), n[c].completion.preselect && o === -1)
        return o = c;
    }
    return a !== -1 ? a : o !== -1 ? o : 0;
  }
  toJSON() {
    return this._cache.toJSON();
  }
  fromJSON(e) {
    this._cache.clear();
    const t = 0;
    for (const [n, r] of e)
      r.touch = t, r.type = typeof r.type == "number" ? r.type : iA.fromString(r.type), this._cache.set(n, r);
    this._seq = this._cache.size;
  }
}
class aTt extends Fpe {
  constructor() {
    super("recentlyUsedByPrefix"), this._trie = aR.forStrings(), this._seq = 0;
  }
  memorize(e, t, n) {
    const { word: r } = e.getWordUntilPosition(t), s = `${e.getLanguageId()}/${r}`;
    this._trie.set(s, {
      type: n.completion.kind,
      insertText: n.completion.insertText,
      touch: this._seq++
    });
  }
  select(e, t, n) {
    const { word: r } = e.getWordUntilPosition(t);
    if (!r)
      return super.select(e, t, n);
    const s = `${e.getLanguageId()}/${r}`;
    let o = this._trie.get(s);
    if (o || (o = this._trie.findSubstr(s)), o)
      for (let a = 0; a < n.length; a++) {
        const { kind: l, insertText: c } = n[a].completion;
        if (l === o.type && c === o.insertText)
          return a;
      }
    return super.select(e, t, n);
  }
  toJSON() {
    const e = [];
    return this._trie.forEach((t, n) => e.push([n, t])), e.sort((t, n) => -(t[1].touch - n[1].touch)).forEach((t, n) => t[1].touch = n), e.slice(0, 200);
  }
  fromJSON(e) {
    if (this._trie.clear(), e.length > 0) {
      this._seq = e[0][1].touch + 1;
      for (const [t, n] of e)
        n.type = typeof n.type == "number" ? n.type : iA.fromString(n.type), this._trie.set(t, n);
    }
  }
}
var G1;
let oae = (G1 = class {
  constructor(e, t) {
    this._storageService = e, this._configService = t, this._disposables = new ke(), this._persistSoon = new mr(() => this._saveState(), 500), this._disposables.add(e.onWillSaveState((n) => {
      n.reason === I1.SHUTDOWN && this._saveState();
    }));
  }
  dispose() {
    this._disposables.dispose(), this._persistSoon.dispose();
  }
  memorize(e, t, n) {
    this._withStrategy(e, t).memorize(e, t, n), this._persistSoon.schedule();
  }
  select(e, t, n) {
    return this._withStrategy(e, t).select(e, t, n);
  }
  _withStrategy(e, t) {
    var r;
    const n = this._configService.getValue("editor.suggestSelection", {
      overrideIdentifier: e.getLanguageIdAtPosition(t.lineNumber, t.column),
      resource: e.uri
    });
    if (((r = this._strategy) == null ? void 0 : r.name) !== n) {
      this._saveState();
      const s = QP._strategyCtors.get(n) || MIe;
      this._strategy = new s();
      try {
        const a = this._configService.getValue("editor.suggest.shareSuggestSelections") ? 0 : 1, l = this._storageService.get(`${QP._storagePrefix}/${n}`, a);
        l && this._strategy.fromJSON(JSON.parse(l));
      } catch {
      }
    }
    return this._strategy;
  }
  _saveState() {
    if (this._strategy) {
      const t = this._configService.getValue("editor.suggest.shareSuggestSelections") ? 0 : 1, n = JSON.stringify(this._strategy);
      this._storageService.store(
        `${QP._storagePrefix}/${this._strategy.name}`,
        n,
        t,
        1
        /* StorageTarget.MACHINE */
      );
    }
  }
}, QP = G1, G1._strategyCtors = /* @__PURE__ */ new Map([
  ["recentlyUsedByPrefix", aTt],
  ["recentlyUsed", oTt],
  ["first", MIe]
]), G1._storagePrefix = "suggest/memories", G1);
oae = QP = sTt([
  OIe(0, gu),
  OIe(1, xn)
], oae);
const BK = Vn("ISuggestMemories");
ni(
  BK,
  oae,
  1
  /* InstantiationType.Delayed */
);
var lTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, cTt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, aae, xL;
let Wz = (xL = class {
  constructor(e, t) {
    this._editor = e, this._enabled = !1, this._ckAtEnd = aae.AtEnd.bindTo(t), this._configListener = this._editor.onDidChangeConfiguration((n) => n.hasChanged(
      139
      /* EditorOption.tabCompletion */
    ) && this._update()), this._update();
  }
  dispose() {
    var e;
    this._configListener.dispose(), (e = this._selectionListener) == null || e.dispose(), this._ckAtEnd.reset();
  }
  _update() {
    const e = this._editor.getOption(
      139
      /* EditorOption.tabCompletion */
    ) === "on";
    if (this._enabled !== e)
      if (this._enabled = e, this._enabled) {
        const t = () => {
          if (!this._editor.hasModel()) {
            this._ckAtEnd.set(!1);
            return;
          }
          const n = this._editor.getModel(), r = this._editor.getSelection(), s = n.getWordAtPosition(r.getStartPosition());
          if (!s) {
            this._ckAtEnd.set(!1);
            return;
          }
          this._ckAtEnd.set(s.endColumn === r.getStartPosition().column && r.getStartPosition().lineNumber === r.getEndPosition().lineNumber);
        };
        this._selectionListener = this._editor.onDidChangeCursorSelection(t), t();
      } else this._selectionListener && (this._ckAtEnd.reset(), this._selectionListener.dispose(), this._selectionListener = void 0);
  }
}, aae = xL, xL.AtEnd = new ut("atEndOfWord", !1, { type: "boolean", description: S(1479, "A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled") }), xL);
Wz = aae = lTt([
  cTt(1, Jt)
], Wz);
var uTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, dTt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, JP, LL;
let vA = (LL = class {
  constructor(e, t) {
    this._editor = e, this._index = 0, this._ckOtherSuggestions = JP.OtherSuggestions.bindTo(t);
  }
  dispose() {
    this.reset();
  }
  reset() {
    var e;
    this._ckOtherSuggestions.reset(), (e = this._listener) == null || e.dispose(), this._model = void 0, this._acceptNext = void 0, this._ignore = !1;
  }
  set({ model: e, index: t }, n) {
    if (e.items.length === 0) {
      this.reset();
      return;
    }
    if (JP._moveIndex(!0, e, t) === t) {
      this.reset();
      return;
    }
    this._acceptNext = n, this._model = e, this._index = t, this._listener = this._editor.onDidChangeCursorPosition(() => {
      this._ignore || this.reset();
    }), this._ckOtherSuggestions.set(!0);
  }
  static _moveIndex(e, t, n) {
    let r = n;
    for (let s = t.items.length; s > 0 && (r = (r + t.items.length + (e ? 1 : -1)) % t.items.length, !(r === n || !t.items[r].completion.additionalTextEdits)); s--)
      ;
    return r;
  }
  next() {
    this._move(!0);
  }
  prev() {
    this._move(!1);
  }
  _move(e) {
    if (this._model)
      try {
        this._ignore = !0, this._index = JP._moveIndex(e, this._model, this._index), this._acceptNext({ index: this._index, item: this._model.items[this._index], model: this._model });
      } finally {
        this._ignore = !1;
      }
  }
}, JP = LL, LL.OtherSuggestions = new ut("hasOtherSuggestions", !1), LL);
vA = JP = uTt([
  dTt(1, Jt)
], vA);
class hTt {
  constructor(e, t, n, r) {
    this._disposables = new ke(), this._disposables.add(n.onDidSuggest((s) => {
      s.completionModel.items.length === 0 && this.reset();
    })), this._disposables.add(n.onDidCancel((s) => {
      this.reset();
    })), this._disposables.add(t.onDidShow(() => this._onItem(t.getFocusedItem()))), this._disposables.add(t.onDidFocus(this._onItem, this)), this._disposables.add(t.onDidHide(this.reset, this)), this._disposables.add(e.onWillType((s) => {
      if (this._active && !t.isFrozen() && n.state !== 0) {
        const o = s.charCodeAt(s.length - 1);
        this._active.acceptCharacters.has(o) && e.getOption(
          0
          /* EditorOption.acceptSuggestionOnCommitCharacter */
        ) && r(this._active.item);
      }
    }));
  }
  _onItem(e) {
    if (!e || !kc(e.item.completion.commitCharacters)) {
      this.reset();
      return;
    }
    if (this._active && this._active.item.item === e.item)
      return;
    const t = new UV();
    for (const n of e.item.completion.commitCharacters)
      n.length > 0 && t.add(n.charCodeAt(0));
    this._active = { acceptCharacters: t, item: e };
  }
  reset() {
    this._active = void 0;
  }
  dispose() {
    this._disposables.dispose();
  }
}
const Sf = class Sf {
  async provideSelectionRanges(e, t) {
    const n = [];
    for (const r of t) {
      const s = [];
      n.push(s);
      const o = /* @__PURE__ */ new Map();
      await new Promise((a) => Sf._bracketsRightYield(a, 0, e, r, o)), await new Promise((a) => Sf._bracketsLeftYield(a, 0, e, r, o, s));
    }
    return n;
  }
  static _bracketsRightYield(e, t, n, r, s) {
    const o = /* @__PURE__ */ new Map(), a = Date.now();
    for (; ; ) {
      if (t >= Sf._maxRounds) {
        e();
        break;
      }
      if (!r) {
        e();
        break;
      }
      const l = n.bracketPairs.findNextBracket(r);
      if (!l) {
        e();
        break;
      }
      if (Date.now() - a > Sf._maxDuration) {
        setTimeout(() => Sf._bracketsRightYield(e, t + 1, n, r, s));
        break;
      }
      if (l.bracketInfo.isOpeningBracket) {
        const u = l.bracketInfo.bracketText, d = o.has(u) ? o.get(u) : 0;
        o.set(u, d + 1);
      } else {
        const u = l.bracketInfo.getOpeningBrackets()[0].bracketText;
        let d = o.has(u) ? o.get(u) : 0;
        if (d -= 1, o.set(u, Math.max(0, d)), d < 0) {
          let h = s.get(u);
          h || (h = new xc(), s.set(u, h)), h.push(l.range);
        }
      }
      r = l.range.getEndPosition();
    }
  }
  static _bracketsLeftYield(e, t, n, r, s, o) {
    const a = /* @__PURE__ */ new Map(), l = Date.now();
    for (; ; ) {
      if (t >= Sf._maxRounds && s.size === 0) {
        e();
        break;
      }
      if (!r) {
        e();
        break;
      }
      const c = n.bracketPairs.findPrevBracket(r);
      if (!c) {
        e();
        break;
      }
      if (Date.now() - l > Sf._maxDuration) {
        setTimeout(() => Sf._bracketsLeftYield(e, t + 1, n, r, s, o));
        break;
      }
      if (c.bracketInfo.isOpeningBracket) {
        const d = c.bracketInfo.bracketText;
        let h = a.has(d) ? a.get(d) : 0;
        if (h -= 1, a.set(d, Math.max(0, h)), h < 0) {
          const g = s.get(d);
          if (g) {
            const m = g.shift();
            g.size === 0 && s.delete(d);
            const _ = z.fromPositions(c.range.getEndPosition(), m.getStartPosition()), v = z.fromPositions(c.range.getStartPosition(), m.getEndPosition());
            o.push({ range: _ }), o.push({ range: v }), Sf._addBracketLeading(n, v, o);
          }
        }
      } else {
        const d = c.bracketInfo.getOpeningBrackets()[0].bracketText, h = a.has(d) ? a.get(d) : 0;
        a.set(d, h + 1);
      }
      r = c.range.getStartPosition();
    }
  }
  static _addBracketLeading(e, t, n) {
    if (t.startLineNumber === t.endLineNumber)
      return;
    const r = t.startLineNumber, s = e.getLineFirstNonWhitespaceColumn(r);
    s !== 0 && s !== t.startColumn && (n.push({ range: z.fromPositions(new de(r, s), t.getEndPosition()) }), n.push({ range: z.fromPositions(new de(r, 1), t.getEndPosition()) }));
    const o = r - 1;
    if (o > 0) {
      const a = e.getLineFirstNonWhitespaceColumn(o);
      a === t.startColumn && a !== e.getLineLastNonWhitespaceColumn(o) && (n.push({ range: z.fromPositions(new de(o, a), t.getEndPosition()) }), n.push({ range: z.fromPositions(new de(o, 1), t.getEndPosition()) }));
    }
  }
};
Sf._maxDuration = 30, Sf._maxRounds = 2;
let Vz = Sf;
const M_ = class M_ {
  static async create(e, t) {
    if (!t.getOption(
      134
      /* EditorOption.suggest */
    ).localityBonus || !t.hasModel())
      return M_.None;
    const n = t.getModel(), r = t.getPosition();
    if (!e.canComputeWordRanges(n.uri))
      return M_.None;
    const [s] = await new Vz().provideSelectionRanges(n, [r]);
    if (s.length === 0)
      return M_.None;
    const o = await e.computeWordRanges(n.uri, s[0].range);
    if (!o)
      return M_.None;
    const a = n.getWordUntilPosition(r);
    return delete o[a.word], new class extends M_ {
      distance(l, c) {
        if (!r.equals(t.getPosition()))
          return 0;
        if (c.kind === 17)
          return 2 << 20;
        const u = typeof c.label == "string" ? c.label : c.label.label, d = o[u];
        if (fPe(d))
          return 2 << 20;
        const h = AV(d, z.fromPositions(l), z.compareRangesUsingStarts), g = h >= 0 ? d[h] : d[Math.max(0, ~h - 1)];
        let m = s.length;
        for (const _ of s) {
          if (!z.containsRange(_.range, g))
            break;
          m -= 1;
        }
        return m;
      }
    }();
  }
};
M_.None = new class extends M_ {
  distance() {
    return 0;
  }
}();
let Uz = M_, PIe = class {
  constructor(e, t) {
    this.leadingLineContent = e, this.characterCountDelta = t;
  }
};
class JC {
  constructor(e, t, n, r, s, o, a = H4.default, l = void 0) {
    this.clipboardText = l, this._snippetCompareFn = JC._compareCompletionItems, this._items = e, this._column = t, this._wordDistance = r, this._options = s, this._refilterKind = 1, this._lineContext = n, this._fuzzyScoreOptions = a, o === "top" ? this._snippetCompareFn = JC._compareCompletionItemsSnippetsUp : o === "bottom" && (this._snippetCompareFn = JC._compareCompletionItemsSnippetsDown);
  }
  get lineContext() {
    return this._lineContext;
  }
  set lineContext(e) {
    (this._lineContext.leadingLineContent !== e.leadingLineContent || this._lineContext.characterCountDelta !== e.characterCountDelta) && (this._refilterKind = this._lineContext.characterCountDelta < e.characterCountDelta && this._filteredItems ? 2 : 1, this._lineContext = e);
  }
  get items() {
    return this._ensureCachedState(), this._filteredItems;
  }
  getItemsByProvider() {
    return this._ensureCachedState(), this._itemsByProvider;
  }
  getIncompleteProvider() {
    this._ensureCachedState();
    const e = /* @__PURE__ */ new Set();
    for (const [t, n] of this.getItemsByProvider())
      n.length > 0 && n[0].container.incomplete && e.add(t);
    return e;
  }
  get stats() {
    return this._ensureCachedState(), this._stats;
  }
  _ensureCachedState() {
    this._refilterKind !== 0 && this._createCachedState();
  }
  _createCachedState() {
    this._itemsByProvider = /* @__PURE__ */ new Map();
    const e = [], { leadingLineContent: t, characterCountDelta: n } = this._lineContext;
    let r = "", s = "";
    const o = this._refilterKind === 1 ? this._items : this._filteredItems, a = [], l = !this._options.filterGraceful || o.length > 2e3 ? hT : Nmt;
    for (let c = 0; c < o.length; c++) {
      const u = o[c];
      if (u.isInvalid)
        continue;
      const d = this._itemsByProvider.get(u.provider);
      d ? d.push(u) : this._itemsByProvider.set(u.provider, [u]);
      const h = u.position.column - u.editStart.column, g = h + n - (u.position.column - this._column);
      if (r.length !== g && (r = g === 0 ? "" : t.slice(-g), s = r.toLowerCase()), u.word = r, g === 0)
        u.score = $g.Default;
      else {
        let m = 0;
        for (; m < h; ) {
          const _ = r.charCodeAt(m);
          if (_ === 32 || _ === 9)
            m += 1;
          else
            break;
        }
        if (m >= g)
          u.score = $g.Default;
        else if (typeof u.completion.filterText == "string") {
          const _ = l(r, s, m, u.completion.filterText, u.filterTextLow, 0, this._fuzzyScoreOptions);
          if (!_)
            continue;
          iie(u.completion.filterText, u.textLabel) === 0 ? u.score = _ : (u.score = Tmt(r, s, m, u.textLabel, u.labelLow, 0), u.score[0] = _[0]);
        } else {
          const _ = l(r, s, m, u.textLabel, u.labelLow, 0, this._fuzzyScoreOptions);
          if (!_)
            continue;
          u.score = _;
        }
      }
      u.idx = c, u.distance = this._wordDistance.distance(u.position, u.completion), a.push(u), e.push(u.textLabel.length);
    }
    this._filteredItems = a.sort(this._snippetCompareFn), this._refilterKind = 0, this._stats = {
      pLabelLen: e.length ? hie(e.length - 0.85, e, (c, u) => c - u) : 0
    };
  }
  static _compareCompletionItems(e, t) {
    return e.score[0] > t.score[0] ? -1 : e.score[0] < t.score[0] ? 1 : e.distance < t.distance ? -1 : e.distance > t.distance ? 1 : e.idx < t.idx ? -1 : e.idx > t.idx ? 1 : 0;
  }
  static _compareCompletionItemsSnippetsDown(e, t) {
    if (e.completion.kind !== t.completion.kind) {
      if (e.completion.kind === 28)
        return 1;
      if (t.completion.kind === 28)
        return -1;
    }
    return JC._compareCompletionItems(e, t);
  }
  static _compareCompletionItemsSnippetsUp(e, t) {
    if (e.completion.kind !== t.completion.kind) {
      if (e.completion.kind === 28)
        return -1;
      if (t.completion.kind === 28)
        return 1;
    }
    return JC._compareCompletionItems(e, t);
  }
}
var fTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, TC = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, lae;
class gE {
  static shouldAutoTrigger(e) {
    if (!e.hasModel())
      return !1;
    const t = e.getModel(), n = e.getPosition();
    t.tokenization.tokenizeIfCheap(n.lineNumber);
    const r = t.getWordAtPosition(n);
    return !(!r || r.endColumn !== n.column && r.startColumn + 1 !== n.column || !isNaN(Number(r.word)));
  }
  constructor(e, t, n) {
    this.leadingLineContent = e.getLineContent(t.lineNumber).substr(0, t.column - 1), this.leadingWord = e.getWordUntilPosition(t), this.lineNumber = t.lineNumber, this.column = t.column, this.triggerOptions = n;
  }
}
function gTt(i, e, t) {
  if (!e.getContextKeyValue(Cr.inlineSuggestionVisible.key))
    return !0;
  const n = e.getContextKeyValue(Cr.suppressSuggestions.key);
  return n !== void 0 ? !n : !i.getOption(
    71
    /* EditorOption.inlineSuggest */
  ).suppressSuggestions;
}
function pTt(i, e, t) {
  if (!e.getContextKeyValue("inlineSuggestionVisible"))
    return !0;
  const n = e.getContextKeyValue(Cr.suppressSuggestions.key);
  return n !== void 0 ? !n : !i.getOption(
    71
    /* EditorOption.inlineSuggest */
  ).suppressSuggestions;
}
let zz = lae = class {
  constructor(e, t, n, r, s, o, a, l, c) {
    this._editor = e, this._editorWorkerService = t, this._clipboardService = n, this._telemetryService = r, this._logService = s, this._contextKeyService = o, this._configurationService = a, this._languageFeaturesService = l, this._envService = c, this._toDispose = new ke(), this._triggerCharacterListener = new ke(), this._triggerQuickSuggest = new Gh(), this._triggerState = void 0, this._completionDisposables = new ke(), this._onDidCancel = new he(), this._onDidTrigger = new he(), this._onDidSuggest = new he(), this.onDidCancel = this._onDidCancel.event, this.onDidTrigger = this._onDidTrigger.event, this.onDidSuggest = this._onDidSuggest.event, this._currentSelection = this._editor.getSelection() || new bt(1, 1, 1, 1), this._toDispose.add(this._editor.onDidChangeModel(() => {
      this._updateTriggerCharacters(), this.cancel();
    })), this._toDispose.add(this._editor.onDidChangeModelLanguage(() => {
      this._updateTriggerCharacters(), this.cancel();
    })), this._toDispose.add(this._editor.onDidChangeConfiguration(() => {
      this._updateTriggerCharacters();
    })), this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(() => {
      this._updateTriggerCharacters(), this._updateActiveSuggestSession();
    }));
    let u = !1;
    this._toDispose.add(this._editor.onDidCompositionStart(() => {
      u = !0;
    })), this._toDispose.add(this._editor.onDidCompositionEnd(() => {
      u = !1, this._onCompositionEnd();
    })), this._toDispose.add(this._editor.onDidChangeCursorSelection((d) => {
      u || this._onCursorChange(d);
    })), this._toDispose.add(this._editor.onDidChangeModelContent(() => {
      !u && this._triggerState !== void 0 && this._refilterCompletionItems();
    })), this._updateTriggerCharacters();
  }
  dispose() {
    or(this._triggerCharacterListener), or([this._onDidCancel, this._onDidSuggest, this._onDidTrigger, this._triggerQuickSuggest]), this._toDispose.dispose(), this._completionDisposables.dispose(), this.cancel();
  }
  _updateTriggerCharacters() {
    if (this._triggerCharacterListener.clear(), this._editor.getOption(
      104
      /* EditorOption.readOnly */
    ) || !this._editor.hasModel() || !this._editor.getOption(
      137
      /* EditorOption.suggestOnTriggerCharacters */
    ))
      return;
    const e = /* @__PURE__ */ new Map();
    for (const n of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))
      for (const r of n.triggerCharacters || []) {
        let s = e.get(r);
        s || (s = /* @__PURE__ */ new Set(), e.set(r, s)), s.add(n);
      }
    const t = (n) => {
      var o;
      if (!pTt(this._editor, this._contextKeyService, this._configurationService) || gE.shouldAutoTrigger(this._editor))
        return;
      if (!n) {
        const a = this._editor.getPosition();
        n = this._editor.getModel().getLineContent(a.lineNumber).substr(0, a.column - 1);
      }
      let r = "";
      ew(n.charCodeAt(n.length - 1)) ? Qo(n.charCodeAt(n.length - 2)) && (r = n.substr(n.length - 2)) : r = n.charAt(n.length - 1);
      const s = e.get(r);
      if (s) {
        const a = /* @__PURE__ */ new Map();
        if (this._completionModel)
          for (const [l, c] of this._completionModel.getItemsByProvider())
            s.has(l) || a.set(l, c);
        this.trigger({
          auto: !0,
          triggerKind: 1,
          triggerCharacter: r,
          retrigger: !!this._completionModel,
          clipboardText: (o = this._completionModel) == null ? void 0 : o.clipboardText,
          completionOptions: { providerFilter: s, providerItemsToReuse: a }
        });
      }
    };
    this._triggerCharacterListener.add(this._editor.onDidType(t)), this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(() => t()));
  }
  // --- trigger/retrigger/cancel suggest
  get state() {
    return this._triggerState ? this._triggerState.auto ? 2 : 1 : 0;
  }
  cancel(e = !1) {
    var t;
    this._triggerState !== void 0 && (this._triggerQuickSuggest.cancel(), (t = this._requestToken) == null || t.cancel(), this._requestToken = void 0, this._triggerState = void 0, this._completionModel = void 0, this._context = void 0, this._onDidCancel.fire({ retrigger: e }));
  }
  clear() {
    this._completionDisposables.clear();
  }
  _updateActiveSuggestSession() {
    this._triggerState !== void 0 && (!this._editor.hasModel() || !this._languageFeaturesService.completionProvider.has(this._editor.getModel()) ? this.cancel() : this.trigger({ auto: this._triggerState.auto, retrigger: !0 }));
  }
  _onCursorChange(e) {
    if (!this._editor.hasModel())
      return;
    const t = this._currentSelection;
    if (this._currentSelection = this._editor.getSelection(), !e.selection.isEmpty() || e.reason !== 0 && e.reason !== 3 || e.source !== "keyboard" && e.source !== "deleteLeft") {
      this.cancel();
      return;
    }
    this._triggerState === void 0 && e.reason === 0 ? (t.containsRange(this._currentSelection) || t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition())) && this._doTriggerQuickSuggest() : this._triggerState !== void 0 && e.reason === 3 && this._refilterCompletionItems();
  }
  _onCompositionEnd() {
    this._triggerState === void 0 ? this._doTriggerQuickSuggest() : this._refilterCompletionItems();
  }
  _doTriggerQuickSuggest() {
    var e;
    mN.isAllOff(this._editor.getOption(
      102
      /* EditorOption.quickSuggestions */
    )) || this._editor.getOption(
      134
      /* EditorOption.suggest */
    ).snippetsPreventQuickSuggestions && ((e = Dc.get(this._editor)) != null && e.isInSnippet()) || (this.cancel(), this._triggerQuickSuggest.cancelAndSet(() => {
      if (this._triggerState !== void 0 || !gE.shouldAutoTrigger(this._editor) || !this._editor.hasModel() || !this._editor.hasWidgetFocus())
        return;
      const t = this._editor.getModel(), n = this._editor.getPosition(), r = this._editor.getOption(
        102
        /* EditorOption.quickSuggestions */
      );
      if (!mN.isAllOff(r)) {
        if (!mN.isAllOn(r)) {
          t.tokenization.tokenizeIfCheap(n.lineNumber);
          const s = t.tokenization.getLineTokens(n.lineNumber), o = s.getStandardTokenType(s.findTokenIndexAtOffset(Math.max(n.column - 1 - 1, 0)));
          if (mN.valueFor(r, o) !== "on")
            return;
        }
        gTt(this._editor, this._contextKeyService, this._configurationService) && this._languageFeaturesService.completionProvider.has(t) && this.trigger({ auto: !0 });
      }
    }, this._editor.getOption(
      103
      /* EditorOption.quickSuggestionsDelay */
    )));
  }
  _refilterCompletionItems() {
    Ii(this._editor.hasModel()), Ii(this._triggerState !== void 0);
    const e = this._editor.getModel(), t = this._editor.getPosition(), n = new gE(e, t, { ...this._triggerState, refilter: !0 });
    this._onNewContext(n);
  }
  trigger(e) {
    var h, g, m;
    if (!this._editor.hasModel())
      return;
    const t = this._editor.getModel(), n = new gE(t, this._editor.getPosition(), e);
    this.cancel(e.retrigger), this._triggerState = e, this._onDidTrigger.fire({ auto: e.auto, shy: e.shy ?? !1, position: this._editor.getPosition() }), this._context = n;
    let r = {
      triggerKind: e.triggerKind ?? 0
      /* CompletionTriggerKind.Invoke */
    };
    e.triggerCharacter && (r = {
      triggerKind: 1,
      triggerCharacter: e.triggerCharacter
    }), this._requestToken = new Ss();
    const s = this._editor.getOption(
      128
      /* EditorOption.snippetSuggestions */
    );
    let o = 1;
    switch (s) {
      case "top":
        o = 0;
        break;
      // 	↓ that's the default anyways...
      // case 'inline':
      // 	snippetSortOrder = SnippetSortOrder.Inline;
      // 	break;
      case "bottom":
        o = 2;
        break;
    }
    const { itemKind: a, showDeprecated: l } = lae.createSuggestFilter(this._editor), c = new d5(o, ((h = e.completionOptions) == null ? void 0 : h.kindFilter) ?? a, (g = e.completionOptions) == null ? void 0 : g.providerFilter, (m = e.completionOptions) == null ? void 0 : m.providerItemsToReuse, l), u = Uz.create(this._editorWorkerService, this._editor), d = Ape(this._languageFeaturesService.completionProvider, t, this._editor.getPosition(), c, r, this._requestToken.token);
    Promise.all([d, u]).then(async ([_, v]) => {
      var D;
      if ((D = this._requestToken) == null || D.dispose(), !this._editor.hasModel()) {
        _.disposable.dispose();
        return;
      }
      let w = e == null ? void 0 : e.clipboardText;
      if (!w && _.needsClipboard && (w = await this._clipboardService.readText()), this._triggerState === void 0) {
        _.disposable.dispose();
        return;
      }
      const E = this._editor.getModel(), L = new gE(E, this._editor.getPosition(), e), T = {
        ...H4.default,
        firstMatchCanBeWeak: !this._editor.getOption(
          134
          /* EditorOption.suggest */
        ).matchOnWordStartOnly
      };
      if (this._completionModel = new JC(_.items, this._context.column, {
        leadingLineContent: L.leadingLineContent,
        characterCountDelta: L.column - this._context.column
      }, v, this._editor.getOption(
        134
        /* EditorOption.suggest */
      ), this._editor.getOption(
        128
        /* EditorOption.snippetSuggestions */
      ), T, w), this._completionDisposables.add(_.disposable), this._onNewContext(L), this._reportDurationsTelemetry(_.durations), !this._envService.isBuilt || this._envService.isExtensionDevelopment)
        for (const N of _.items)
          N.isInvalid && this._logService.warn(`[suggest] did IGNORE invalid completion item from ${N.provider._debugDisplayName}`, N.completion);
    }).catch(fn);
  }
  /**
   * Report durations telemetry with a 1% sampling rate.
   * The telemetry is reported only if a random number between 0 and 100 is less than or equal to 1.
   */
  _reportDurationsTelemetry(e) {
    Math.random() > 1e-4 || setTimeout(() => {
      this._telemetryService.publicLog2("suggest.durations.json", { data: JSON.stringify(e) }), this._logService.debug("suggest.durations.json", e);
    });
  }
  static createSuggestFilter(e) {
    const t = /* @__PURE__ */ new Set();
    e.getOption(
      128
      /* EditorOption.snippetSuggestions */
    ) === "none" && t.add(
      28
      /* CompletionItemKind.Snippet */
    );
    const r = e.getOption(
      134
      /* EditorOption.suggest */
    );
    return r.showMethods || t.add(
      0
      /* CompletionItemKind.Method */
    ), r.showFunctions || t.add(
      1
      /* CompletionItemKind.Function */
    ), r.showConstructors || t.add(
      2
      /* CompletionItemKind.Constructor */
    ), r.showFields || t.add(
      3
      /* CompletionItemKind.Field */
    ), r.showVariables || t.add(
      4
      /* CompletionItemKind.Variable */
    ), r.showClasses || t.add(
      5
      /* CompletionItemKind.Class */
    ), r.showStructs || t.add(
      6
      /* CompletionItemKind.Struct */
    ), r.showInterfaces || t.add(
      7
      /* CompletionItemKind.Interface */
    ), r.showModules || t.add(
      8
      /* CompletionItemKind.Module */
    ), r.showProperties || t.add(
      9
      /* CompletionItemKind.Property */
    ), r.showEvents || t.add(
      10
      /* CompletionItemKind.Event */
    ), r.showOperators || t.add(
      11
      /* CompletionItemKind.Operator */
    ), r.showUnits || t.add(
      12
      /* CompletionItemKind.Unit */
    ), r.showValues || t.add(
      13
      /* CompletionItemKind.Value */
    ), r.showConstants || t.add(
      14
      /* CompletionItemKind.Constant */
    ), r.showEnums || t.add(
      15
      /* CompletionItemKind.Enum */
    ), r.showEnumMembers || t.add(
      16
      /* CompletionItemKind.EnumMember */
    ), r.showKeywords || t.add(
      17
      /* CompletionItemKind.Keyword */
    ), r.showWords || t.add(
      18
      /* CompletionItemKind.Text */
    ), r.showColors || t.add(
      19
      /* CompletionItemKind.Color */
    ), r.showFiles || t.add(
      20
      /* CompletionItemKind.File */
    ), r.showReferences || t.add(
      21
      /* CompletionItemKind.Reference */
    ), r.showColors || t.add(
      22
      /* CompletionItemKind.Customcolor */
    ), r.showFolders || t.add(
      23
      /* CompletionItemKind.Folder */
    ), r.showTypeParameters || t.add(
      24
      /* CompletionItemKind.TypeParameter */
    ), r.showSnippets || t.add(
      28
      /* CompletionItemKind.Snippet */
    ), r.showUsers || t.add(
      25
      /* CompletionItemKind.User */
    ), r.showIssues || t.add(
      26
      /* CompletionItemKind.Issue */
    ), { itemKind: t, showDeprecated: r.showDeprecated };
  }
  _onNewContext(e) {
    if (this._context) {
      if (e.lineNumber !== this._context.lineNumber) {
        this.cancel();
        return;
      }
      if (Ir(e.leadingLineContent) !== Ir(this._context.leadingLineContent)) {
        this.cancel();
        return;
      }
      if (e.column < this._context.column) {
        e.leadingWord.word ? this.trigger({ auto: this._context.triggerOptions.auto, retrigger: !0 }) : this.cancel();
        return;
      }
      if (this._completionModel) {
        if (e.leadingWord.word.length !== 0 && e.leadingWord.startColumn > this._context.leadingWord.startColumn) {
          if (gE.shouldAutoTrigger(this._editor) && this._context) {
            const n = this._completionModel.getItemsByProvider();
            this.trigger({
              auto: this._context.triggerOptions.auto,
              retrigger: !0,
              clipboardText: this._completionModel.clipboardText,
              completionOptions: { providerItemsToReuse: n }
            });
          }
          return;
        }
        if (e.column > this._context.column && this._completionModel.getIncompleteProvider().size > 0 && e.leadingWord.word.length !== 0) {
          const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
          for (const [r, s] of this._completionModel.getItemsByProvider())
            s.length > 0 && s[0].container.incomplete ? n.add(r) : t.set(r, s);
          this.trigger({
            auto: this._context.triggerOptions.auto,
            triggerKind: 2,
            retrigger: !0,
            clipboardText: this._completionModel.clipboardText,
            completionOptions: { providerFilter: n, providerItemsToReuse: t }
          });
        } else {
          const t = this._completionModel.lineContext;
          let n = !1;
          if (this._completionModel.lineContext = {
            leadingLineContent: e.leadingLineContent,
            characterCountDelta: e.column - this._context.column
          }, this._completionModel.items.length === 0) {
            const r = gE.shouldAutoTrigger(this._editor);
            if (!this._context) {
              this.cancel();
              return;
            }
            if (r && this._context.leadingWord.endColumn < e.leadingWord.startColumn) {
              this.trigger({ auto: this._context.triggerOptions.auto, retrigger: !0 });
              return;
            }
            if (this._context.triggerOptions.auto) {
              this.cancel();
              return;
            } else if (this._completionModel.lineContext = t, n = this._completionModel.items.length > 0, n && e.leadingWord.word.length === 0) {
              this.cancel();
              return;
            }
          }
          this._onDidSuggest.fire({
            completionModel: this._completionModel,
            triggerOptions: e.triggerOptions,
            isFrozen: n
          });
        }
      }
    }
  }
};
zz = lae = fTt([
  TC(1, sd),
  TC(2, _m),
  TC(3, rc),
  TC(4, $r),
  TC(5, Jt),
  TC(6, xn),
  TC(7, St),
  TC(8, Gge)
], zz);
const wG = class wG {
  constructor(e, t) {
    this._disposables = new ke(), this._lastOvertyped = [], this._locked = !1, this._disposables.add(e.onWillType(() => {
      if (this._locked || !e.hasModel())
        return;
      const n = e.getSelections(), r = n.length;
      let s = !1;
      for (let a = 0; a < r; a++)
        if (!n[a].isEmpty()) {
          s = !0;
          break;
        }
      if (!s) {
        this._lastOvertyped.length !== 0 && (this._lastOvertyped.length = 0);
        return;
      }
      this._lastOvertyped = [];
      const o = e.getModel();
      for (let a = 0; a < r; a++) {
        const l = n[a];
        if (o.getValueLengthInRange(l) > wG._maxSelectionLength)
          return;
        this._lastOvertyped[a] = { value: o.getValueInRange(l), multiline: l.startLineNumber !== l.endLineNumber };
      }
    })), this._disposables.add(t.onDidTrigger((n) => {
      this._locked = !0;
    })), this._disposables.add(t.onDidCancel((n) => {
      this._locked = !1;
    }));
  }
  getLastOvertypedInfo(e) {
    if (e >= 0 && e < this._lastOvertyped.length)
      return this._lastOvertyped[e];
  }
  dispose() {
    this._disposables.dispose();
  }
};
wG._maxSelectionLength = 51200;
let cae = wG;
var mTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, hte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let uae = class {
  constructor(e, t, n, r, s) {
    this._menuId = t, this._menuService = r, this._contextKeyService = s, this._menuDisposables = new ke(), this.element = Fe(e, Ge(".suggest-status-bar"));
    const o = ((a) => a instanceof Uh ? n.createInstance(Age, a, { useComma: !1 }) : void 0);
    this._leftActions = new qu(this.element, { actionViewItemProvider: o }), this._rightActions = new qu(this.element, { actionViewItemProvider: o }), this._leftActions.domNode.classList.add("left"), this._rightActions.domNode.classList.add("right");
  }
  dispose() {
    this._menuDisposables.dispose(), this._leftActions.dispose(), this._rightActions.dispose(), this.element.remove();
  }
  show() {
    const e = this._menuService.createMenu(this._menuId, this._contextKeyService), t = () => {
      const n = [], r = [];
      for (const [s, o] of e.getActions())
        s === "left" ? n.push(...o) : r.push(...o);
      this._leftActions.clear(), this._leftActions.push(n), this._rightActions.clear(), this._rightActions.push(r);
    };
    this._menuDisposables.add(e.onDidChange(() => t())), this._menuDisposables.add(e);
  }
  hide() {
    this._menuDisposables.clear();
  }
};
uae = mTt([
  hte(2, xt),
  hte(3, eg),
  hte(4, Jt)
], uae);
var _Tt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, bTt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
function Bpe(i) {
  return !!i && !!(i.completion.documentation || i.completion.detail && i.completion.detail !== i.completion.label);
}
let dae = class {
  constructor(e, t) {
    this._editor = e, this._onDidClose = new he(), this.onDidClose = this._onDidClose.event, this._onDidChangeContents = new he(), this.onDidChangeContents = this._onDidChangeContents.event, this._disposables = new ke(), this._renderDisposeable = new ke(), this._borderWidth = 1, this._size = new Ji(330, 0), this.domNode = Ge(".suggest-details"), this.domNode.classList.add("no-docs"), this._markdownRenderer = t.createInstance(n0, { editor: e }), this._body = Ge(".body"), this._scrollbar = new LB(this._body, {
      alwaysConsumeMouseWheel: !0
    }), Fe(this.domNode, this._scrollbar.getDomNode()), this._disposables.add(this._scrollbar), this._header = Fe(this._body, Ge(".header")), this._close = Fe(this._header, Ge("span" + qt.asCSSSelector(Pe.close))), this._close.title = S(1475, "Close"), this._close.role = "button", this._close.tabIndex = -1, this._type = Fe(this._header, Ge("p.type")), this._docs = Fe(this._body, Ge("p.docs")), this._configureFont(), this._disposables.add(this._editor.onDidChangeConfiguration((n) => {
      n.hasChanged(
        59
        /* EditorOption.fontInfo */
      ) && this._configureFont();
    }));
  }
  dispose() {
    this._disposables.dispose(), this._renderDisposeable.dispose();
  }
  _configureFont() {
    const e = this._editor.getOptions(), t = e.get(
      59
      /* EditorOption.fontInfo */
    ), n = t.getMassagedFontFamily(), r = e.get(
      135
      /* EditorOption.suggestFontSize */
    ) || t.fontSize, s = e.get(
      136
      /* EditorOption.suggestLineHeight */
    ) || t.lineHeight, o = t.fontWeight, a = `${r}px`, l = `${s}px`;
    this.domNode.style.fontSize = a, this.domNode.style.lineHeight = `${s / r}`, this.domNode.style.fontWeight = o, this.domNode.style.fontFeatureSettings = t.fontFeatureSettings, this._type.style.fontFamily = n, this._close.style.height = l, this._close.style.width = l;
  }
  getLayoutInfo() {
    const e = this._editor.getOption(
      136
      /* EditorOption.suggestLineHeight */
    ) || this._editor.getOption(
      59
      /* EditorOption.fontInfo */
    ).lineHeight, t = this._borderWidth, n = t * 2;
    return {
      lineHeight: e,
      borderWidth: t,
      borderHeight: n,
      verticalPadding: 22,
      horizontalPadding: 14
    };
  }
  renderLoading() {
    this._type.textContent = S(1476, "Loading..."), this._docs.textContent = "", this.domNode.classList.remove("no-docs", "no-type"), this.layout(this.size.width, this.getLayoutInfo().lineHeight * 2), this._onDidChangeContents.fire(this);
  }
  renderItem(e, t) {
    var s;
    this._renderDisposeable.clear();
    let { detail: n, documentation: r } = e.completion;
    if (t) {
      let o = "";
      o += `score: ${e.score[0]}
`, o += `prefix: ${e.word ?? "(no prefix)"}
`, o += `word: ${e.completion.filterText ? e.completion.filterText + " (filterText)" : e.textLabel}
`, o += `distance: ${e.distance} (localityBonus-setting)
`, o += `index: ${e.idx}, based on ${e.completion.sortText && `sortText: "${e.completion.sortText}"` || "label"}
`, o += `commit_chars: ${(s = e.completion.commitCharacters) == null ? void 0 : s.join("")}
`, r = new ql().appendCodeblock("empty", o), n = `Provider: ${e.provider._debugDisplayName}`;
    }
    if (!t && !Bpe(e)) {
      this.clearContents();
      return;
    }
    if (this.domNode.classList.remove("no-docs", "no-type"), n) {
      const o = n.length > 1e5 ? `${n.substr(0, 1e5)}…` : n;
      this._type.textContent = o, this._type.title = o, Id(this._type), this._type.classList.toggle("auto-wrap", !/\r?\n^\s+/gmi.test(o));
    } else
      Xa(this._type), this._type.title = "", eu(this._type), this.domNode.classList.add("no-type");
    if (Xa(this._docs), typeof r == "string")
      this._docs.classList.remove("markdown-docs"), this._docs.textContent = r;
    else if (r) {
      this._docs.classList.add("markdown-docs"), Xa(this._docs);
      const o = this._markdownRenderer.render(r, {
        asyncRenderCallback: () => {
          this.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight), this._onDidChangeContents.fire(this);
        }
      });
      this._docs.appendChild(o.element), this._renderDisposeable.add(o);
    }
    this.domNode.classList.toggle("detail-and-doc", !!n && !!r), this.domNode.style.userSelect = "text", this.domNode.tabIndex = -1, this._close.onmousedown = (o) => {
      o.preventDefault(), o.stopPropagation();
    }, this._close.onclick = (o) => {
      o.preventDefault(), o.stopPropagation(), this._onDidClose.fire();
    }, this._body.scrollTop = 0, this.layout(this._size.width, this._type.clientHeight + this._docs.clientHeight), this._onDidChangeContents.fire(this);
  }
  clearContents() {
    this.domNode.classList.add("no-docs"), this._type.textContent = "", this._docs.textContent = "";
  }
  get isEmpty() {
    return this.domNode.classList.contains("no-docs");
  }
  get size() {
    return this._size;
  }
  layout(e, t) {
    const n = new Ji(e, t);
    Ji.equals(n, this._size) || (this._size = n, Pit(this.domNode, e, t)), this._scrollbar.scanDomNode();
  }
  scrollDown(e = 8) {
    this._body.scrollTop += e;
  }
  scrollUp(e = 8) {
    this._body.scrollTop -= e;
  }
  scrollTop() {
    this._body.scrollTop = 0;
  }
  scrollBottom() {
    this._body.scrollTop = this._body.scrollHeight;
  }
  pageDown() {
    this.scrollDown(80);
  }
  pageUp() {
    this.scrollUp(80);
  }
  set borderWidth(e) {
    this._borderWidth = e;
  }
  get borderWidth() {
    return this._borderWidth;
  }
  focus() {
    this.domNode.focus();
  }
};
dae = _Tt([
  bTt(1, xt)
], dae);
class vTt {
  constructor(e, t) {
    this.widget = e, this._editor = t, this.allowEditorOverflow = !0, this._disposables = new ke(), this._added = !1, this._preferAlignAtTop = !0, this._resizable = new Yge(), this._resizable.domNode.classList.add("suggest-details-container"), this._resizable.domNode.appendChild(e.domNode), this._resizable.enableSashes(!1, !0, !0, !1);
    let n, r, s = 0, o = 0;
    this._disposables.add(this._resizable.onDidWillResize(() => {
      n = this._topLeft, r = this._resizable.size;
    })), this._disposables.add(this._resizable.onDidResize((a) => {
      if (n && r) {
        this.widget.layout(a.dimension.width, a.dimension.height);
        let l = !1;
        a.west && (o = r.width - a.dimension.width, l = !0), a.north && (s = r.height - a.dimension.height, l = !0), l && this._applyTopLeft({
          top: n.top + s,
          left: n.left + o
        });
      }
      a.done && (n = void 0, r = void 0, s = 0, o = 0, this._userSize = a.dimension);
    })), this._disposables.add(this.widget.onDidChangeContents(() => {
      this._anchorBox && this._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, this._preferAlignAtTop);
    }));
  }
  dispose() {
    this._resizable.dispose(), this._disposables.dispose(), this.hide();
  }
  getId() {
    return "suggest.details";
  }
  getDomNode() {
    return this._resizable.domNode;
  }
  getPosition() {
    return this._topLeft ? { preference: this._topLeft } : null;
  }
  show() {
    this._added || (this._editor.addOverlayWidget(this), this._added = !0);
  }
  hide(e = !1) {
    this._resizable.clearSashHoverState(), this._added && (this._editor.removeOverlayWidget(this), this._added = !1, this._anchorBox = void 0, this._topLeft = void 0), e && (this._userSize = void 0, this.widget.clearContents());
  }
  placeAtAnchor(e, t) {
    const n = e.getBoundingClientRect();
    this._anchorBox = n, this._preferAlignAtTop = t, this._placeAtAnchor(this._anchorBox, this._userSize ?? this.widget.size, t);
  }
  _placeAtAnchor(e, t, n) {
    const r = nw(this.getDomNode().ownerDocument.body), s = this.widget.getLayoutInfo(), o = new Ji(220, 2 * s.lineHeight), a = e.top, l = (function() {
      const D = r.width - (e.left + e.width + s.borderWidth + s.horizontalPadding), N = -s.borderWidth + e.left + e.width, R = new Ji(D, r.height - e.top - s.borderHeight - s.verticalPadding), M = R.with(void 0, e.top + e.height - s.borderHeight - s.verticalPadding);
      return { top: a, left: N, fit: D - t.width, maxSizeTop: R, maxSizeBottom: M, minSize: o.with(Math.min(D, o.width)) };
    })(), c = (function() {
      const D = e.left - s.borderWidth - s.horizontalPadding, N = Math.max(s.horizontalPadding, e.left - t.width - s.borderWidth), R = new Ji(D, r.height - e.top - s.borderHeight - s.verticalPadding), M = R.with(void 0, e.top + e.height - s.borderHeight - s.verticalPadding);
      return { top: a, left: N, fit: D - t.width, maxSizeTop: R, maxSizeBottom: M, minSize: o.with(Math.min(D, o.width)) };
    })(), u = (function() {
      const D = e.left, N = -s.borderWidth + e.top + e.height, R = new Ji(e.width - s.borderHeight, r.height - e.top - e.height - s.verticalPadding);
      return { top: N, left: D, fit: R.height - t.height, maxSizeBottom: R, maxSizeTop: R, minSize: o.with(R.width) };
    })(), d = [l, c, u], h = d.find((D) => D.fit >= 0) ?? d.sort((D, N) => N.fit - D.fit)[0], g = e.top + e.height - s.borderHeight;
    let m, _ = t.height;
    const v = Math.max(h.maxSizeTop.height, h.maxSizeBottom.height);
    _ > v && (_ = v);
    let w;
    n ? _ <= h.maxSizeTop.height ? (m = !0, w = h.maxSizeTop) : (m = !1, w = h.maxSizeBottom) : _ <= h.maxSizeBottom.height ? (m = !1, w = h.maxSizeBottom) : (m = !0, w = h.maxSizeTop);
    let { top: E, left: L } = h;
    !m && _ > e.height && (E = g - _);
    const T = this._editor.getDomNode();
    if (T) {
      const D = T.getBoundingClientRect();
      E -= D.top, L -= D.left;
    }
    this._applyTopLeft({ left: L, top: E }), this._resizable.enableSashes(!m, h === l, m, h !== l), this._resizable.minSize = h.minSize, this._resizable.maxSize = w, this._resizable.layout(_, Math.min(w.width, t.width)), this.widget.layout(this._resizable.size.width, this._resizable.size.height);
  }
  _applyTopLeft(e) {
    this._topLeft = e, this._editor.layoutOverlayWidget(this);
  }
}
const FIe = Vn("fileService");
var tb;
(function(i) {
  i[i.FILE = 0] = "FILE", i[i.FOLDER = 1] = "FOLDER", i[i.ROOT_FOLDER = 2] = "ROOT_FOLDER";
})(tb || (tb = {}));
const yTt = /(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;
function LH(i, e, t, n, r) {
  if (qt.isThemeIcon(r))
    return [`codicon-${r.id}`, "predefined-file-icon"];
  if (Ht.isUri(r))
    return [];
  const s = n === tb.ROOT_FOLDER ? ["rootfolder-icon"] : n === tb.FOLDER ? ["folder-icon"] : ["file-icon"];
  if (t) {
    let o;
    if (t.scheme === Yt.data)
      o = sw.parseMetaData(t).get(sw.META_DATA_LABEL);
    else {
      const a = t.path.match(yTt);
      a ? (o = TH(a[2].toLowerCase()), a[1] && s.push(`${TH(a[1].toLowerCase())}-name-dir-icon`)) : o = TH(t.authority.toLowerCase());
    }
    if (n === tb.ROOT_FOLDER)
      s.push(`${o}-root-name-folder-icon`);
    else if (n === tb.FOLDER)
      s.push(`${o}-name-folder-icon`);
    else {
      if (o) {
        if (s.push(`${o}-name-file-icon`), s.push("name-file-icon"), o.length <= 255) {
          const l = o.split(".");
          for (let c = 1; c < l.length; c++)
            s.push(`${l.slice(c).join(".")}-ext-file-icon`);
        }
        s.push("ext-file-icon");
      }
      const a = CTt(i, e, t);
      a && s.push(`${TH(a)}-lang-file-icon`);
    }
  }
  return s;
}
function CTt(i, e, t) {
  if (!t)
    return null;
  let n = null;
  if (t.scheme === Yt.data) {
    const s = sw.parseMetaData(t).get(sw.META_DATA_MIME);
    s && (n = e.getLanguageIdByMimeType(s));
  } else {
    const r = i.getModel(t);
    r && (n = r.getLanguageId());
  }
  return n && n !== $h ? n : e.guessLanguageIdByFilepathOrFirstLine(t);
}
function TH(i) {
  return i.replace(/[\s]/g, "/");
}
var wTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, fte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const STt = es("suggest-more-info", Pe.chevronRight, S(1477, "Icon for more information in the suggest widget."));
var qp;
const ETt = new (qp = class {
  extract(e, t) {
    if (e.textLabel.match(qp._regexStrict))
      return t[0] = e.textLabel, !0;
    if (e.completion.detail && e.completion.detail.match(qp._regexStrict))
      return t[0] = e.completion.detail, !0;
    if (e.completion.documentation) {
      const n = typeof e.completion.documentation == "string" ? e.completion.documentation : e.completion.documentation.value, r = qp._regexRelaxed.exec(n);
      if (r && (r.index === 0 || r.index + r[0].length === n.length))
        return t[0] = r[0], !0;
    }
    return !1;
  }
}, qp._regexRelaxed = /(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/, qp._regexStrict = new RegExp(`^${qp._regexRelaxed.source}$`, "i"), qp)();
let hae = class {
  constructor(e, t, n, r) {
    this._editor = e, this._modelService = t, this._languageService = n, this._themeService = r, this._onDidToggleDetails = new he(), this.onDidToggleDetails = this._onDidToggleDetails.event, this.templateId = "suggestion";
  }
  dispose() {
    this._onDidToggleDetails.dispose();
  }
  renderTemplate(e) {
    const t = new ke(), n = e;
    n.classList.add("show-file-icons");
    const r = Fe(e, Ge(".icon")), s = Fe(r, Ge("span.colorspan")), o = Fe(e, Ge(".contents")), a = Fe(o, Ge(".main")), l = Fe(a, Ge(".icon-label.codicon")), c = Fe(a, Ge("span.left")), u = Fe(a, Ge("span.right")), d = new a5(c, { supportHighlights: !0, supportIcons: !0 });
    t.add(d);
    const h = Fe(c, Ge("span.signature-label")), g = Fe(c, Ge("span.qualifier-label")), m = Fe(u, Ge("span.details-label")), _ = Fe(u, Ge("span.readMore" + qt.asCSSSelector(STt)));
    return _.title = S(1478, "Read More"), { root: n, left: c, right: u, icon: r, colorspan: s, iconLabel: d, iconContainer: l, parametersLabel: h, qualifierLabel: g, detailsLabel: m, readMore: _, disposables: t, configureFont: () => {
      const w = this._editor.getOptions(), E = w.get(
        59
        /* EditorOption.fontInfo */
      ), L = E.getMassagedFontFamily(), T = E.fontFeatureSettings, D = E.fontVariationSettings, N = w.get(
        135
        /* EditorOption.suggestFontSize */
      ) || E.fontSize, R = w.get(
        136
        /* EditorOption.suggestLineHeight */
      ) || E.lineHeight, M = E.fontWeight, B = E.letterSpacing, H = `${N}px`, j = `${R}px`, K = `${B}px`;
      n.style.fontSize = H, n.style.fontWeight = M, n.style.letterSpacing = K, a.style.fontFamily = L, a.style.fontFeatureSettings = T, a.style.fontVariationSettings = D, a.style.lineHeight = j, r.style.height = j, r.style.width = j, _.style.height = j, _.style.width = j;
    } };
  }
  renderElement(e, t, n) {
    n.configureFont();
    const { completion: r } = e;
    n.colorspan.style.backgroundColor = "";
    const s = {
      labelEscapeNewLines: !0,
      matches: IB(e.score)
    }, o = [];
    if (r.kind === 19 && ETt.extract(e, o))
      n.icon.className = "icon customcolor", n.iconContainer.className = "icon hide", n.colorspan.style.backgroundColor = o[0];
    else if (r.kind === 20 && this._themeService.getFileIconTheme().hasFileIcons) {
      n.icon.className = "icon hide", n.iconContainer.className = "icon hide";
      const a = LH(this._modelService, this._languageService, Ht.from({ scheme: "fake", path: e.textLabel }), tb.FILE), l = LH(this._modelService, this._languageService, Ht.from({ scheme: "fake", path: r.detail }), tb.FILE);
      s.extraClasses = a.length > l.length ? a : l;
    } else r.kind === 23 && this._themeService.getFileIconTheme().hasFolderIcons ? (n.icon.className = "icon hide", n.iconContainer.className = "icon hide", s.extraClasses = [
      LH(this._modelService, this._languageService, Ht.from({ scheme: "fake", path: e.textLabel }), tb.FOLDER),
      LH(this._modelService, this._languageService, Ht.from({ scheme: "fake", path: r.detail }), tb.FOLDER)
    ].flat()) : (n.icon.className = "icon hide", n.iconContainer.className = "", n.iconContainer.classList.add("suggest-icon", ...qt.asClassNameArray(iA.toIcon(r.kind))));
    r.tags && r.tags.indexOf(
      1
      /* CompletionItemTag.Deprecated */
    ) >= 0 && (s.extraClasses = (s.extraClasses || []).concat(["deprecated"]), s.matches = []), n.iconLabel.setLabel(e.textLabel, void 0, s), typeof r.label == "string" ? (n.parametersLabel.textContent = "", n.detailsLabel.textContent = gte(r.detail || ""), n.root.classList.add("string-label")) : (n.parametersLabel.textContent = gte(r.label.detail || ""), n.detailsLabel.textContent = gte(r.label.description || ""), n.root.classList.remove("string-label")), this._editor.getOption(
      134
      /* EditorOption.suggest */
    ).showInlineDetails ? Id(n.detailsLabel) : eu(n.detailsLabel), Bpe(e) ? (n.right.classList.add("can-expand-details"), Id(n.readMore), n.readMore.onmousedown = (a) => {
      a.stopPropagation(), a.preventDefault();
    }, n.readMore.onclick = (a) => {
      a.stopPropagation(), a.preventDefault(), this._onDidToggleDetails.fire();
    }) : (n.right.classList.remove("can-expand-details"), eu(n.readMore), n.readMore.onmousedown = null, n.readMore.onclick = null);
  }
  disposeTemplate(e) {
    e.disposables.dispose();
  }
};
hae = wTt([
  fte(1, xs),
  fte(2, Gr),
  fte(3, to)
], hae);
function gte(i) {
  return i.replace(/\r\n|\r|\n/g, "");
}
var xTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, kH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, KI;
ie("editorSuggestWidget.background", Bh, S(1458, "Background color of the suggest widget."));
ie("editorSuggestWidget.border", vfe, S(1459, "Border color of the suggest widget."));
const LTt = ie("editorSuggestWidget.foreground", kb, S(1460, "Foreground color of the suggest widget."));
ie("editorSuggestWidget.selectedForeground", b4, S(1461, "Foreground color of the selected entry in the suggest widget."));
ie("editorSuggestWidget.selectedIconForeground", Ife, S(1462, "Icon foreground color of the selected entry in the suggest widget."));
const TTt = ie("editorSuggestWidget.selectedBackground", v4, S(1463, "Background color of the selected entry in the suggest widget."));
ie("editorSuggestWidget.highlightForeground", oN, S(1464, "Color of the match highlights in the suggest widget."));
ie("editorSuggestWidget.focusHighlightForeground", $lt, S(1465, "Color of the match highlights in the suggest widget when an item is focused."));
ie("editorSuggestWidgetStatus.foreground", hn(LTt, 0.5), S(1466, "Foreground color of the suggest widget status."));
class kTt {
  constructor(e, t) {
    this._service = e, this._key = `suggestWidget.size/${t.getEditorType()}/${t instanceof s0}`;
  }
  restore() {
    const e = this._service.get(
      this._key,
      0
      /* StorageScope.PROFILE */
    ) ?? "";
    try {
      const t = JSON.parse(e);
      if (Ji.is(t))
        return Ji.lift(t);
    } catch {
    }
  }
  store(e) {
    this._service.store(
      this._key,
      JSON.stringify(e),
      0,
      1
      /* StorageTarget.MACHINE */
    );
  }
  reset() {
    this._service.remove(
      this._key,
      0
      /* StorageScope.PROFILE */
    );
  }
}
var q1;
let fae = (q1 = class {
  constructor(e, t, n, r, s) {
    this.editor = e, this._storageService = t, this._state = 0, this._isAuto = !1, this._pendingLayout = new er(), this._pendingShowDetails = new er(), this._ignoreFocusEvents = !1, this._forceRenderingAbove = !1, this._explainMode = !1, this._showTimeout = new Gh(), this._disposables = new ke(), this._onDidSelect = new eT(), this._onDidFocus = new eT(), this._onDidHide = new he(), this._onDidShow = new he(), this.onDidSelect = this._onDidSelect.event, this.onDidFocus = this._onDidFocus.event, this.onDidHide = this._onDidHide.event, this.onDidShow = this._onDidShow.event, this._onDetailsKeydown = new he(), this.onDetailsKeyDown = this._onDetailsKeydown.event, this.element = new Yge(), this.element.domNode.classList.add("editor-widget", "suggest-widget"), this._contentWidget = new DTt(this, e), this._persistedSize = new kTt(t, e);
    class o {
      constructor(g, m, _ = !1, v = !1) {
        this.persistedSize = g, this.currentSize = m, this.persistHeight = _, this.persistWidth = v;
      }
    }
    let a;
    this._disposables.add(this.element.onDidWillResize(() => {
      this._contentWidget.lockPreference(), a = new o(this._persistedSize.restore(), this.element.size);
    })), this._disposables.add(this.element.onDidResize((h) => {
      var g, m;
      if (this._resize(h.dimension.width, h.dimension.height), a && (a.persistHeight = a.persistHeight || !!h.north || !!h.south, a.persistWidth = a.persistWidth || !!h.east || !!h.west), !!h.done) {
        if (a) {
          const { itemHeight: _, defaultSize: v } = this.getLayoutInfo(), w = Math.round(_ / 2);
          let { width: E, height: L } = this.element.size;
          (!a.persistHeight || Math.abs(a.currentSize.height - L) <= w) && (L = ((g = a.persistedSize) == null ? void 0 : g.height) ?? v.height), (!a.persistWidth || Math.abs(a.currentSize.width - E) <= w) && (E = ((m = a.persistedSize) == null ? void 0 : m.width) ?? v.width), this._persistedSize.store(new Ji(E, L));
        }
        this._contentWidget.unlockPreference(), a = void 0;
      }
    })), this._messageElement = Fe(this.element.domNode, Ge(".message")), this._listElement = Fe(this.element.domNode, Ge(".tree"));
    const l = this._disposables.add(s.createInstance(dae, this.editor));
    l.onDidClose(() => this.toggleDetails(), this, this._disposables), this._details = new vTt(l, this.editor);
    const c = () => this.element.domNode.classList.toggle("no-icons", !this.editor.getOption(
      134
      /* EditorOption.suggest */
    ).showIcons);
    c();
    const u = s.createInstance(hae, this.editor);
    this._disposables.add(u), this._disposables.add(u.onDidToggleDetails(() => this.toggleDetails())), this._list = new Zh("SuggestWidget", this._listElement, {
      getHeight: (h) => this.getLayoutInfo().itemHeight,
      getTemplateId: (h) => "suggestion"
    }, [u], {
      alwaysConsumeMouseWheel: !0,
      useShadows: !1,
      mouseSupport: !1,
      multipleSelectionSupport: !1,
      accessibilityProvider: {
        getRole: () => Za ? "listitem" : "option",
        getWidgetAriaLabel: () => S(1469, "Suggest"),
        getWidgetRole: () => "listbox",
        getAriaLabel: (h) => {
          let g = h.textLabel;
          const m = iA.toLabel(h.completion.kind);
          if (typeof h.completion.label != "string") {
            const { detail: E, description: L } = h.completion.label;
            E && L ? g = S(1470, "{0} {1}, {2}, {3}", g, E, L, m) : E ? g = S(1471, "{0} {1}, {2}", g, E, m) : L && (g = S(1472, "{0}, {1}, {2}", g, L, m));
          } else
            g = S(1473, "{0}, {1}", g, m);
          if (!h.isResolved || !this._isDetailsVisible())
            return g;
          const { documentation: _, detail: v } = h.completion, w = tT("{0}{1}", v || "", _ ? typeof _ == "string" ? _ : _.value : "");
          return S(1474, "{0}, docs: {1}", g, w);
        }
      }
    }), this._list.style(JT({
      listInactiveFocusBackground: TTt,
      listInactiveFocusOutline: fs
    })), this._status = s.createInstance(uae, this.element.domNode, A1);
    const d = () => this.element.domNode.classList.toggle("with-status-bar", this.editor.getOption(
      134
      /* EditorOption.suggest */
    ).showStatusBar);
    d(), this._disposables.add(r.onDidColorThemeChange((h) => this._onThemeChange(h))), this._onThemeChange(r.getColorTheme()), this._disposables.add(this._list.onMouseDown((h) => this._onListMouseDownOrTap(h))), this._disposables.add(this._list.onTap((h) => this._onListMouseDownOrTap(h))), this._disposables.add(this._list.onDidChangeSelection((h) => this._onListSelection(h))), this._disposables.add(this._list.onDidChangeFocus((h) => this._onListFocus(h))), this._disposables.add(this.editor.onDidChangeCursorSelection(() => this._onCursorSelectionChanged())), this._disposables.add(this.editor.onDidChangeConfiguration((h) => {
      h.hasChanged(
        134
        /* EditorOption.suggest */
      ) && (d(), c()), this._completionModel && (h.hasChanged(
        59
        /* EditorOption.fontInfo */
      ) || h.hasChanged(
        135
        /* EditorOption.suggestFontSize */
      ) || h.hasChanged(
        136
        /* EditorOption.suggestLineHeight */
      )) && this._list.splice(0, this._list.length, this._completionModel.items);
    })), this._ctxSuggestWidgetVisible = Wn.Visible.bindTo(n), this._ctxSuggestWidgetDetailsVisible = Wn.DetailsVisible.bindTo(n), this._ctxSuggestWidgetMultipleSuggestions = Wn.MultipleSuggestions.bindTo(n), this._ctxSuggestWidgetHasFocusedSuggestion = Wn.HasFocusedSuggestion.bindTo(n), this._disposables.add(vo(this._details.widget.domNode, "keydown", (h) => {
      this._onDetailsKeydown.fire(h);
    })), this._disposables.add(this.editor.onMouseDown((h) => this._onEditorMouseDown(h)));
  }
  dispose() {
    var e;
    this._details.widget.dispose(), this._details.dispose(), this._list.dispose(), this._status.dispose(), this._disposables.dispose(), (e = this._loadingTimeout) == null || e.dispose(), this._pendingLayout.dispose(), this._pendingShowDetails.dispose(), this._showTimeout.dispose(), this._contentWidget.dispose(), this.element.dispose();
  }
  _onEditorMouseDown(e) {
    this._details.widget.domNode.contains(e.target.element) ? this._details.widget.domNode.focus() : this.element.domNode.contains(e.target.element) && this.editor.focus();
  }
  _onCursorSelectionChanged() {
    this._state !== 0 && this._contentWidget.layout();
  }
  _onListMouseDownOrTap(e) {
    typeof e.element > "u" || typeof e.index > "u" || (e.browserEvent.preventDefault(), e.browserEvent.stopPropagation(), this._select(e.element, e.index));
  }
  _onListSelection(e) {
    e.elements.length && this._select(e.elements[0], e.indexes[0]);
  }
  _select(e, t) {
    const n = this._completionModel;
    n && (this._onDidSelect.fire({ item: e, index: t, model: n }), this.editor.focus());
  }
  _onThemeChange(e) {
    this._details.widget.borderWidth = am(e.type) ? 2 : 1;
  }
  _onListFocus(e) {
    var r;
    if (this._ignoreFocusEvents)
      return;
    if (this._state === 5 && this._setState(
      3
      /* State.Open */
    ), !e.elements.length) {
      this._currentSuggestionDetails && (this._currentSuggestionDetails.cancel(), this._currentSuggestionDetails = void 0, this._focusedItem = void 0), this.editor.setAriaOptions({ activeDescendant: void 0 }), this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);
      return;
    }
    if (!this._completionModel)
      return;
    this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);
    const t = e.elements[0], n = e.indexes[0];
    t !== this._focusedItem && ((r = this._currentSuggestionDetails) == null || r.cancel(), this._currentSuggestionDetails = void 0, this._focusedItem = t, this._list.reveal(n), this._currentSuggestionDetails = Jo(async (s) => {
      const o = jy(() => {
        this._isDetailsVisible() && this._showDetails(!0, !1);
      }, 250), a = s.onCancellationRequested(() => o.dispose());
      try {
        return await t.resolve(s);
      } finally {
        o.dispose(), a.dispose();
      }
    }), this._currentSuggestionDetails.then(() => {
      n >= this._list.length || t !== this._list.element(n) || (this._ignoreFocusEvents = !0, this._list.splice(n, 1, [t]), this._list.setFocus([n]), this._ignoreFocusEvents = !1, this._isDetailsVisible() ? this._showDetails(!1, !1) : this.element.domNode.classList.remove("docs-side"), this.editor.setAriaOptions({ activeDescendant: this._list.getElementID(n) }));
    }).catch(fn)), this._onDidFocus.fire({ item: t, index: n, model: this._completionModel });
  }
  _setState(e) {
    if (this._state !== e)
      switch (this._state = e, this.element.domNode.classList.toggle(
        "frozen",
        e === 4
        /* State.Frozen */
      ), this.element.domNode.classList.remove("message"), e) {
        case 0:
          eu(this._messageElement, this._listElement, this._status.element), this._details.hide(!0), this._status.hide(), this._contentWidget.hide(), this._ctxSuggestWidgetVisible.reset(), this._ctxSuggestWidgetMultipleSuggestions.reset(), this._ctxSuggestWidgetHasFocusedSuggestion.reset(), this._showTimeout.cancel(), this.element.domNode.classList.remove("visible"), this._list.splice(0, this._list.length), this._focusedItem = void 0, this._cappedHeight = void 0, this._explainMode = !1;
          break;
        case 1:
          this.element.domNode.classList.add("message"), this._messageElement.textContent = KI.LOADING_MESSAGE, eu(this._listElement, this._status.element), Id(this._messageElement), this._details.hide(), this._show(), this._focusedItem = void 0, hb(KI.LOADING_MESSAGE);
          break;
        case 2:
          this.element.domNode.classList.add("message"), this._messageElement.textContent = KI.NO_SUGGESTIONS_MESSAGE, eu(this._listElement, this._status.element), Id(this._messageElement), this._details.hide(), this._show(), this._focusedItem = void 0, hb(KI.NO_SUGGESTIONS_MESSAGE);
          break;
        case 3:
          eu(this._messageElement), Id(this._listElement, this._status.element), this._show();
          break;
        case 4:
          eu(this._messageElement), Id(this._listElement, this._status.element), this._show();
          break;
        case 5:
          eu(this._messageElement), Id(this._listElement, this._status.element), this._details.show(), this._show(), this._details.widget.focus();
          break;
      }
  }
  _show() {
    this._status.show(), this._contentWidget.show(), this._layout(this._persistedSize.restore()), this._ctxSuggestWidgetVisible.set(!0), this._showTimeout.cancelAndSet(() => {
      this.element.domNode.classList.add("visible"), this._onDidShow.fire(this);
    }, 100);
  }
  showTriggered(e, t) {
    this._state === 0 && (this._contentWidget.setPosition(this.editor.getPosition()), this._isAuto = !!e, this._isAuto || (this._loadingTimeout = jy(() => this._setState(
      1
      /* State.Loading */
    ), t)));
  }
  showSuggestions(e, t, n, r, s) {
    var l, c;
    if (this._contentWidget.setPosition(this.editor.getPosition()), (l = this._loadingTimeout) == null || l.dispose(), (c = this._currentSuggestionDetails) == null || c.cancel(), this._currentSuggestionDetails = void 0, this._completionModel !== e && (this._completionModel = e), n && this._state !== 2 && this._state !== 0) {
      this._setState(
        4
        /* State.Frozen */
      );
      return;
    }
    const o = this._completionModel.items.length, a = o === 0;
    if (this._ctxSuggestWidgetMultipleSuggestions.set(o > 1), a) {
      this._setState(
        r ? 0 : 2
        /* State.Empty */
      ), this._completionModel = void 0;
      return;
    }
    this._focusedItem = void 0, this._onDidFocus.pause(), this._onDidSelect.pause();
    try {
      this._list.splice(0, this._list.length, this._completionModel.items), this._setState(
        n ? 4 : 3
        /* State.Open */
      ), this._list.reveal(t, 0, t === 0 ? 0 : this.getLayoutInfo().itemHeight * 0.33), this._list.setFocus(s ? [] : [t]);
    } finally {
      this._onDidFocus.resume(), this._onDidSelect.resume();
    }
    this._pendingLayout.value = FV(At(this.element.domNode), () => {
      this._pendingLayout.clear(), this._layout(this.element.size), this._details.widget.domNode.classList.remove("focused");
    });
  }
  focusSelected() {
    this._list.length > 0 && this._list.setFocus([0]);
  }
  selectNextPage() {
    switch (this._state) {
      case 0:
        return !1;
      case 5:
        return this._details.widget.pageDown(), !0;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusNextPage(), !0;
    }
  }
  selectNext() {
    switch (this._state) {
      case 0:
        return !1;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusNext(1, !0), !0;
    }
  }
  selectLast() {
    switch (this._state) {
      case 0:
        return !1;
      case 5:
        return this._details.widget.scrollBottom(), !0;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusLast(), !0;
    }
  }
  selectPreviousPage() {
    switch (this._state) {
      case 0:
        return !1;
      case 5:
        return this._details.widget.pageUp(), !0;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusPreviousPage(), !0;
    }
  }
  selectPrevious() {
    switch (this._state) {
      case 0:
        return !1;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusPrevious(1, !0), !1;
    }
  }
  selectFirst() {
    switch (this._state) {
      case 0:
        return !1;
      case 5:
        return this._details.widget.scrollTop(), !0;
      case 1:
        return !this._isAuto;
      default:
        return this._list.focusFirst(), !0;
    }
  }
  getFocusedItem() {
    if (this._state !== 0 && this._state !== 2 && this._state !== 1 && this._completionModel && this._list.getFocus().length > 0)
      return {
        item: this._list.getFocusedElements()[0],
        index: this._list.getFocus()[0],
        model: this._completionModel
      };
  }
  toggleDetailsFocus() {
    this._state === 5 ? (this._list.setFocus(this._list.getFocus()), this._setState(
      3
      /* State.Open */
    )) : this._state === 3 && (this._setState(
      5
      /* State.Details */
    ), this._isDetailsVisible() ? this._details.widget.focus() : this.toggleDetails(!0));
  }
  toggleDetails(e = !1) {
    this._isDetailsVisible() ? (this._pendingShowDetails.clear(), this._ctxSuggestWidgetDetailsVisible.set(!1), this._setDetailsVisible(!1), this._details.hide(), this.element.domNode.classList.remove("shows-details")) : (Bpe(this._list.getFocusedElements()[0]) || this._explainMode) && (this._state === 3 || this._state === 5 || this._state === 4) && (this._ctxSuggestWidgetDetailsVisible.set(!0), this._setDetailsVisible(!0), this._showDetails(!1, e));
  }
  _showDetails(e, t) {
    this._pendingShowDetails.value = FV(At(this.element.domNode), () => {
      this._pendingShowDetails.clear(), this._details.show();
      let n = !1;
      e ? this._details.widget.renderLoading() : this._details.widget.renderItem(this._list.getFocusedElements()[0], this._explainMode), this._details.widget.isEmpty ? this._details.hide() : (this._positionDetails(), this.element.domNode.classList.add("shows-details"), t && (this._details.widget.focus(), n = !0)), n || this.editor.focus();
    });
  }
  toggleExplainMode() {
    this._list.getFocusedElements()[0] && (this._explainMode = !this._explainMode, this._isDetailsVisible() ? this._showDetails(!1, !1) : this.toggleDetails());
  }
  resetPersistedSize() {
    this._persistedSize.reset();
  }
  hideWidget() {
    var n;
    this._pendingLayout.clear(), this._pendingShowDetails.clear(), (n = this._loadingTimeout) == null || n.dispose(), this._setState(
      0
      /* State.Hidden */
    ), this._onDidHide.fire(this), this.element.clearSashHoverState();
    const e = this._persistedSize.restore(), t = Math.ceil(this.getLayoutInfo().itemHeight * 4.3);
    e && e.height < t && this._persistedSize.store(e.with(void 0, t));
  }
  isFrozen() {
    return this._state === 4;
  }
  _afterRender(e) {
    if (e === null) {
      this._isDetailsVisible() && this._details.hide();
      return;
    }
    this._state === 2 || this._state === 1 || (this._isDetailsVisible() && !this._details.widget.isEmpty && this._details.show(), this._positionDetails());
  }
  _layout(e) {
    var o, a;
    if (!this.editor.hasModel() || !this.editor.getDomNode())
      return;
    const t = nw(this.element.domNode.ownerDocument.body), n = this.getLayoutInfo();
    e || (e = n.defaultSize);
    let r = e.height, s = e.width;
    if (this._status.element.style.height = `${n.itemHeight}px`, this._state === 2 || this._state === 1)
      r = n.itemHeight + n.borderHeight, s = n.defaultSize.width / 2, this.element.enableSashes(!1, !1, !1, !1), this.element.minSize = this.element.maxSize = new Ji(s, r), this._contentWidget.setPreference(
        2
        /* ContentWidgetPositionPreference.BELOW */
      );
    else {
      const l = t.width - n.borderHeight - 2 * n.horizontalPadding;
      s > l && (s = l);
      const c = this._completionModel ? this._completionModel.stats.pLabelLen * n.typicalHalfwidthCharacterWidth : s, u = n.statusBarHeight + this._list.contentHeight + n.borderHeight, d = n.itemHeight + n.statusBarHeight, h = ho(this.editor.getDomNode()), g = this.editor.getScrolledVisiblePosition(this.editor.getPosition()), m = h.top + g.top + g.height, _ = Math.min(t.height - m - n.verticalPadding, u), v = h.top + g.top - n.verticalPadding, w = Math.min(v, u);
      let E = Math.min(Math.max(w, _) + n.borderHeight, u);
      r === ((o = this._cappedHeight) == null ? void 0 : o.capped) && (r = this._cappedHeight.wanted), r < d && (r = d), r > E && (r = E), r > _ && w > _ || this._forceRenderingAbove && v > 150 ? (this._contentWidget.setPreference(
        1
        /* ContentWidgetPositionPreference.ABOVE */
      ), this.element.enableSashes(!0, !0, !1, !1), E = w) : (this._contentWidget.setPreference(
        2
        /* ContentWidgetPositionPreference.BELOW */
      ), this.element.enableSashes(!1, !0, !0, !1), E = _), this.element.preferredSize = new Ji(c, n.defaultSize.height), this.element.maxSize = new Ji(l, E), this.element.minSize = new Ji(220, d), this._cappedHeight = r === u ? { wanted: ((a = this._cappedHeight) == null ? void 0 : a.wanted) ?? e.height, capped: r } : void 0;
    }
    this._resize(s, r);
  }
  _resize(e, t) {
    const { width: n, height: r } = this.element.maxSize;
    e = Math.min(n, e), t = Math.min(r, t);
    const { statusBarHeight: s } = this.getLayoutInfo();
    this._list.layout(t - s, e), this._listElement.style.height = `${t - s}px`, this.element.layout(t, e), this._contentWidget.layout(), this._positionDetails();
  }
  _positionDetails() {
    var e;
    this._isDetailsVisible() && this._details.placeAtAnchor(
      this.element.domNode,
      ((e = this._contentWidget.getPosition()) == null ? void 0 : e.preference[0]) === 2
      /* ContentWidgetPositionPreference.BELOW */
    );
  }
  getLayoutInfo() {
    const e = this.editor.getOption(
      59
      /* EditorOption.fontInfo */
    ), t = Jc(this.editor.getOption(
      136
      /* EditorOption.suggestLineHeight */
    ) || e.lineHeight, 8, 1e3), n = !this.editor.getOption(
      134
      /* EditorOption.suggest */
    ).showStatusBar || this._state === 2 || this._state === 1 ? 0 : t, r = this._details.widget.borderWidth, s = 2 * r;
    return {
      itemHeight: t,
      statusBarHeight: n,
      borderWidth: r,
      borderHeight: s,
      typicalHalfwidthCharacterWidth: e.typicalHalfwidthCharacterWidth,
      verticalPadding: 22,
      horizontalPadding: 14,
      defaultSize: new Ji(430, n + 12 * t)
    };
  }
  _isDetailsVisible() {
    return this._storageService.getBoolean("expandSuggestionDocs", 0, !1);
  }
  _setDetailsVisible(e) {
    this._storageService.store(
      "expandSuggestionDocs",
      e,
      0,
      0
      /* StorageTarget.USER */
    );
  }
  forceRenderingAbove() {
    this._forceRenderingAbove || (this._forceRenderingAbove = !0, this._layout(this._persistedSize.restore()));
  }
  stopForceRenderingAbove() {
    this._forceRenderingAbove = !1;
  }
}, KI = q1, q1.LOADING_MESSAGE = S(1467, "Loading..."), q1.NO_SUGGESTIONS_MESSAGE = S(1468, "No suggestions."), q1);
fae = KI = xTt([
  kH(1, gu),
  kH(2, Jt),
  kH(3, to),
  kH(4, xt)
], fae);
class DTt {
  constructor(e, t) {
    this._widget = e, this._editor = t, this.allowEditorOverflow = !0, this.suppressMouseDown = !1, this._preferenceLocked = !1, this._added = !1, this._hidden = !1;
  }
  dispose() {
    this._added && (this._added = !1, this._editor.removeContentWidget(this));
  }
  getId() {
    return "editor.widget.suggestWidget";
  }
  getDomNode() {
    return this._widget.element.domNode;
  }
  show() {
    this._hidden = !1, this._added || (this._added = !0, this._editor.addContentWidget(this));
  }
  hide() {
    this._hidden || (this._hidden = !0, this.layout());
  }
  layout() {
    this._editor.layoutContentWidget(this);
  }
  getPosition() {
    return this._hidden || !this._position || !this._preference ? null : {
      position: this._position,
      preference: [this._preference]
    };
  }
  beforeRender() {
    const { height: e, width: t } = this._widget.element.size, { borderWidth: n, horizontalPadding: r } = this._widget.getLayoutInfo();
    return new Ji(t + 2 * n + r, e + 2 * n);
  }
  afterRender(e) {
    this._widget._afterRender(e);
  }
  setPreference(e) {
    this._preferenceLocked || (this._preference = e);
  }
  lockPreference() {
    this._preferenceLocked = !0;
  }
  unlockPreference() {
    this._preferenceLocked = !1;
  }
  setPosition(e) {
    this._position = e;
  }
}
var ITt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, kI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, gae;
class NTt {
  constructor(e, t) {
    if (this._model = e, this._position = t, this._decorationOptions = dn.register({
      description: "suggest-line-suffix",
      stickiness: 1
      /* TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges */
    }), e.getLineMaxColumn(t.lineNumber) !== t.column) {
      const r = e.getOffsetAt(t), s = e.getPositionAt(r + 1);
      e.changeDecorations((o) => {
        this._marker && o.removeDecoration(this._marker), this._marker = o.addDecoration(z.fromPositions(t, s), this._decorationOptions);
      });
    }
  }
  dispose() {
    this._marker && !this._model.isDisposed() && this._model.changeDecorations((e) => {
      e.removeDecoration(this._marker), this._marker = void 0;
    });
  }
  delta(e) {
    if (this._model.isDisposed() || this._position.lineNumber !== e.lineNumber)
      return 0;
    if (this._marker) {
      const t = this._model.getDecorationRange(this._marker);
      return this._model.getOffsetAt(t.getStartPosition()) - this._model.getOffsetAt(e);
    } else
      return this._model.getLineMaxColumn(e.lineNumber) - e.column;
  }
}
var TL;
let nm = (TL = class {
  static get(e) {
    return e.getContribution(gae.ID);
  }
  get onWillInsertSuggestItem() {
    return this._onWillInsertSuggestItem.event;
  }
  constructor(e, t, n, r, s, o, a) {
    this._memoryService = t, this._commandService = n, this._contextKeyService = r, this._instantiationService = s, this._logService = o, this._telemetryService = a, this._lineSuffix = new er(), this._toDispose = new ke(), this._selectors = new RTt((d) => d.priority), this._onWillInsertSuggestItem = new he(), this._wantsForceRenderingAbove = !1, this.editor = e, this.model = s.createInstance(zz, this.editor), this._selectors.register({
      priority: 0,
      select: (d, h, g) => this._memoryService.select(d, h, g)
    });
    const l = Wn.InsertMode.bindTo(r);
    l.set(e.getOption(
      134
      /* EditorOption.suggest */
    ).insertMode), this._toDispose.add(this.model.onDidTrigger(() => l.set(e.getOption(
      134
      /* EditorOption.suggest */
    ).insertMode))), this.widget = this._toDispose.add(new BJ(At(e.getDomNode()), () => {
      const d = this._instantiationService.createInstance(fae, this.editor);
      this._toDispose.add(d), this._toDispose.add(d.onDidSelect((v) => this._insertSuggestion(
        v,
        0
        /* InsertFlags.None */
      ), this));
      const h = new hTt(this.editor, d, this.model, (v) => this._insertSuggestion(
        v,
        2
        /* InsertFlags.NoAfterUndoStop */
      ));
      this._toDispose.add(h);
      const g = Wn.MakesTextEdit.bindTo(this._contextKeyService), m = Wn.HasInsertAndReplaceRange.bindTo(this._contextKeyService), _ = Wn.CanResolve.bindTo(this._contextKeyService);
      return this._toDispose.add(Et(() => {
        g.reset(), m.reset(), _.reset();
      })), this._toDispose.add(d.onDidFocus(({ item: v }) => {
        const w = this.editor.getPosition(), E = v.editStart.column, L = w.column;
        let T = !0;
        this.editor.getOption(
          1
          /* EditorOption.acceptSuggestionOnEnter */
        ) === "smart" && this.model.state === 2 && !v.completion.additionalTextEdits && !(v.completion.insertTextRules & 4) && L - E === v.completion.insertText.length && (T = this.editor.getModel().getValueInRange({
          startLineNumber: w.lineNumber,
          startColumn: E,
          endLineNumber: w.lineNumber,
          endColumn: L
        }) !== v.completion.insertText), g.set(T), m.set(!de.equals(v.editInsertEnd, v.editReplaceEnd)), _.set(!!v.provider.resolveCompletionItem || !!v.completion.documentation || v.completion.detail !== v.completion.label);
      })), this._toDispose.add(d.onDetailsKeyDown((v) => {
        if (v.toKeyCodeChord().equals(new $y(
          !0,
          !1,
          !1,
          !1,
          33
          /* KeyCode.KeyC */
        )) || Kn && v.toKeyCodeChord().equals(new $y(
          !1,
          !1,
          !1,
          !0,
          33
          /* KeyCode.KeyC */
        ))) {
          v.stopPropagation();
          return;
        }
        v.toKeyCodeChord().isModifierKey() || this.editor.focus();
      })), this._wantsForceRenderingAbove && d.forceRenderingAbove(), d;
    })), this._overtypingCapturer = this._toDispose.add(new BJ(At(e.getDomNode()), () => this._toDispose.add(new cae(this.editor, this.model)))), this._alternatives = this._toDispose.add(new BJ(At(e.getDomNode()), () => this._toDispose.add(new vA(this.editor, this._contextKeyService)))), this._toDispose.add(s.createInstance(Wz, e)), this._toDispose.add(this.model.onDidTrigger((d) => {
      this.widget.value.showTriggered(d.auto, d.shy ? 250 : 50), this._lineSuffix.value = new NTt(this.editor.getModel(), d.position);
    })), this._toDispose.add(this.model.onDidSuggest((d) => {
      if (d.triggerOptions.shy)
        return;
      let h = -1;
      for (const m of this._selectors.itemsOrderedByPriorityDesc)
        if (h = m.select(this.editor.getModel(), this.editor.getPosition(), d.completionModel.items), h !== -1)
          break;
      if (h === -1 && (h = 0), this.model.state === 0)
        return;
      let g = !1;
      if (d.triggerOptions.auto) {
        const m = this.editor.getOption(
          134
          /* EditorOption.suggest */
        );
        m.selectionMode === "never" || m.selectionMode === "always" ? g = m.selectionMode === "never" : m.selectionMode === "whenTriggerCharacter" ? g = d.triggerOptions.triggerKind !== 1 : m.selectionMode === "whenQuickSuggestion" && (g = d.triggerOptions.triggerKind === 1 && !d.triggerOptions.refilter);
      }
      this.widget.value.showSuggestions(d.completionModel, h, d.isFrozen, d.triggerOptions.auto, g);
    })), this._toDispose.add(this.model.onDidCancel((d) => {
      d.retrigger || this.widget.value.hideWidget();
    })), this._toDispose.add(this.editor.onDidBlurEditorWidget(() => {
      this.model.cancel(), this.model.clear();
    }));
    const c = Wn.AcceptSuggestionsOnEnter.bindTo(r), u = () => {
      const d = this.editor.getOption(
        1
        /* EditorOption.acceptSuggestionOnEnter */
      );
      c.set(d === "on" || d === "smart");
    };
    this._toDispose.add(this.editor.onDidChangeConfiguration(() => u())), u();
  }
  dispose() {
    this._alternatives.dispose(), this._toDispose.dispose(), this.widget.dispose(), this.model.dispose(), this._lineSuffix.dispose(), this._onWillInsertSuggestItem.dispose();
  }
  _insertSuggestion(e, t) {
    var m;
    if (!e || !e.item) {
      this._alternatives.value.reset(), this.model.cancel(), this.model.clear();
      return;
    }
    if (!this.editor.hasModel())
      return;
    const n = Dc.get(this.editor);
    if (!n)
      return;
    this._onWillInsertSuggestItem.fire({ item: e.item });
    const r = this.editor.getModel(), s = r.getAlternativeVersionId(), { item: o } = e, a = [], l = new Ss();
    t & 1 || this.editor.pushUndoStop();
    const c = this.getOverwriteInfo(o, !!(t & 8));
    this._memoryService.memorize(r, this.editor.getPosition(), o);
    const u = o.isResolved;
    let d = -1, h = -1;
    if (Array.isArray(o.completion.additionalTextEdits)) {
      this.model.cancel();
      const _ = mm.capture(this.editor);
      this.editor.executeEdits("suggestController.additionalTextEdits.sync", o.completion.additionalTextEdits.map((v) => {
        let w = z.lift(v.range);
        if (w.startLineNumber === o.position.lineNumber && w.startColumn > o.position.column) {
          const E = this.editor.getPosition().column - o.position.column, L = E, T = z.spansMultipleLines(w) ? 0 : E;
          w = new z(w.startLineNumber, w.startColumn + L, w.endLineNumber, w.endColumn + T);
        }
        return Xs.replaceMove(w, v.text);
      })), _.restoreRelativeVerticalPositionOfCursor(this.editor);
    } else if (!u) {
      const _ = new _a();
      let v;
      const w = r.onDidChangeContent((D) => {
        if (D.isFlush) {
          l.cancel(), w.dispose();
          return;
        }
        for (const N of D.changes) {
          const R = z.getEndPosition(N.range);
          (!v || de.isBefore(R, v)) && (v = R);
        }
      }), E = t;
      t |= 2;
      let L = !1;
      const T = this.editor.onWillType(() => {
        T.dispose(), L = !0, E & 2 || this.editor.pushUndoStop();
      });
      a.push(o.resolve(l.token).then(() => {
        if (!o.completion.additionalTextEdits || l.token.isCancellationRequested)
          return;
        if (v && o.completion.additionalTextEdits.some((N) => de.isBefore(v, z.getStartPosition(N.range))))
          return !1;
        L && this.editor.pushUndoStop();
        const D = mm.capture(this.editor);
        return this.editor.executeEdits("suggestController.additionalTextEdits.async", o.completion.additionalTextEdits.map((N) => Xs.replaceMove(z.lift(N.range), N.text))), D.restoreRelativeVerticalPositionOfCursor(this.editor), (L || !(E & 2)) && this.editor.pushUndoStop(), !0;
      }).then((D) => {
        this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)", _.elapsed(), D), h = D === !0 ? 1 : D === !1 ? 0 : -2;
      }).finally(() => {
        w.dispose(), T.dispose();
      }));
    }
    let { insertText: g } = o.completion;
    if (o.completion.insertTextRules & 4 || (g = _T.escape(g)), this.model.cancel(), n.insert(g, {
      overwriteBefore: c.overwriteBefore,
      overwriteAfter: c.overwriteAfter,
      undoStopBefore: !1,
      undoStopAfter: !1,
      adjustWhitespace: !(o.completion.insertTextRules & 1),
      clipboardText: e.model.clipboardText,
      overtypingCapturer: this._overtypingCapturer.value,
      reason: $l.suggest({ providerId: sK.fromExtensionId((m = o.extensionId) == null ? void 0 : m.value) })
    }), t & 2 || this.editor.pushUndoStop(), o.completion.command)
      if (o.completion.command.id === $z.id)
        this.model.trigger({ auto: !0, retrigger: !0 });
      else {
        const _ = new _a();
        a.push(this._commandService.executeCommand(o.completion.command.id, ...o.completion.command.arguments ? [...o.completion.command.arguments] : []).catch((v) => {
          o.completion.extensionId ? No(v) : fn(v);
        }).finally(() => {
          d = _.elapsed();
        }));
      }
    t & 4 && this._alternatives.value.set(e, (_) => {
      for (l.cancel(); r.canUndo(); ) {
        s !== r.getAlternativeVersionId() && r.undo(), this._insertSuggestion(_, 3 | (t & 8 ? 8 : 0));
        break;
      }
    }), this._alertCompletionItem(o), Promise.all(a).finally(() => {
      this._reportSuggestionAcceptedTelemetry(o, r, u, d, h, e.index, e.model.items), this.model.clear(), l.dispose();
    });
  }
  _reportSuggestionAcceptedTelemetry(e, t, n, r, s, o, a) {
    var h;
    if (Math.random() > 1e-4)
      return;
    const l = /* @__PURE__ */ new Map();
    for (let g = 0; g < Math.min(30, a.length); g++) {
      const m = a[g].textLabel;
      l.has(m) ? l.get(m).push(g) : l.set(m, [g]);
    }
    const c = l.get(e.textLabel), d = c && c.length > 1 ? c[0] : -1;
    this._telemetryService.publicLog2("suggest.acceptedSuggestion", {
      extensionId: ((h = e.extensionId) == null ? void 0 : h.value) ?? "unknown",
      providerId: e.provider._debugDisplayName ?? "unknown",
      kind: e.completion.kind,
      basenameHash: bB(Kf(t.uri)).toString(16),
      languageId: t.getLanguageId(),
      fileExtension: Irt(t.uri),
      resolveInfo: e.provider.resolveCompletionItem ? n ? 1 : 0 : -1,
      resolveDuration: e.resolveDuration,
      commandDuration: r,
      additionalEditsAsync: s,
      index: o,
      firstIndex: d
    });
  }
  getOverwriteInfo(e, t) {
    Ii(this.editor.hasModel());
    let n = this.editor.getOption(
      134
      /* EditorOption.suggest */
    ).insertMode === "replace";
    t && (n = !n);
    const r = e.position.column - e.editStart.column, s = (n ? e.editReplaceEnd.column : e.editInsertEnd.column) - e.position.column, o = this.editor.getPosition().column - e.position.column, a = this._lineSuffix.value ? this._lineSuffix.value.delta(this.editor.getPosition()) : 0;
    return {
      overwriteBefore: r + o,
      overwriteAfter: s + a
    };
  }
  _alertCompletionItem(e) {
    if (kc(e.completion.additionalTextEdits)) {
      const t = S(1448, "Accepting '{0}' made {1} additional edits", e.textLabel, e.completion.additionalTextEdits.length);
      lu(t);
    }
  }
  triggerSuggest(e, t, n) {
    this.editor.hasModel() && (this.model.trigger({
      auto: t ?? !1,
      completionOptions: { providerFilter: e, kindFilter: n ? /* @__PURE__ */ new Set() : void 0 }
    }), this.editor.revealPosition(
      this.editor.getPosition(),
      0
      /* ScrollType.Smooth */
    ), this.editor.focus());
  }
  triggerSuggestAndAcceptBest(e) {
    if (!this.editor.hasModel())
      return;
    const t = this.editor.getPosition(), n = () => {
      t.equals(this.editor.getPosition()) && this._commandService.executeCommand(e.fallback);
    }, r = (s) => {
      if (s.completion.insertTextRules & 4 || s.completion.additionalTextEdits)
        return !0;
      const o = this.editor.getPosition(), a = s.editStart.column, l = o.column;
      return l - a !== s.completion.insertText.length ? !0 : this.editor.getModel().getValueInRange({
        startLineNumber: o.lineNumber,
        startColumn: a,
        endLineNumber: o.lineNumber,
        endColumn: l
      }) !== s.completion.insertText;
    };
    Ze.once(this.model.onDidTrigger)((s) => {
      const o = [];
      Ze.any(this.model.onDidTrigger, this.model.onDidCancel)(() => {
        or(o), n();
      }, void 0, o), this.model.onDidSuggest(({ completionModel: a }) => {
        if (or(o), a.items.length === 0) {
          n();
          return;
        }
        const l = this._memoryService.select(this.editor.getModel(), this.editor.getPosition(), a.items), c = a.items[l];
        if (!r(c)) {
          n();
          return;
        }
        this.editor.pushUndoStop(), this._insertSuggestion(
          { index: l, item: c, model: a },
          7
          /* InsertFlags.NoAfterUndoStop */
        );
      }, void 0, o);
    }), this.model.trigger({ auto: !1, shy: !0 }), this.editor.revealPosition(
      t,
      0
      /* ScrollType.Smooth */
    ), this.editor.focus();
  }
  acceptSelectedSuggestion(e, t) {
    const n = this.widget.value.getFocusedItem();
    let r = 0;
    e && (r |= 4), t && (r |= 8), this._insertSuggestion(n, r);
  }
  acceptNextSuggestion() {
    this._alternatives.value.next();
  }
  acceptPrevSuggestion() {
    this._alternatives.value.prev();
  }
  cancelSuggestWidget() {
    this.model.cancel(), this.model.clear(), this.widget.value.hideWidget();
  }
  focusSuggestion() {
    this.widget.value.focusSelected();
  }
  selectNextSuggestion() {
    this.widget.value.selectNext();
  }
  selectNextPageSuggestion() {
    this.widget.value.selectNextPage();
  }
  selectLastSuggestion() {
    this.widget.value.selectLast();
  }
  selectPrevSuggestion() {
    this.widget.value.selectPrevious();
  }
  selectPrevPageSuggestion() {
    this.widget.value.selectPreviousPage();
  }
  selectFirstSuggestion() {
    this.widget.value.selectFirst();
  }
  toggleSuggestionDetails() {
    this.widget.value.toggleDetails();
  }
  toggleExplainMode() {
    this.widget.value.toggleExplainMode();
  }
  toggleSuggestionFocus() {
    this.widget.value.toggleDetailsFocus();
  }
  resetWidgetSize() {
    this.widget.value.resetPersistedSize();
  }
  forceRenderingAbove() {
    this.widget.isInitialized ? this.widget.value.forceRenderingAbove() : this._wantsForceRenderingAbove = !0;
  }
  stopForceRenderingAbove() {
    this.widget.isInitialized ? this.widget.value.stopForceRenderingAbove() : this._wantsForceRenderingAbove = !1;
  }
  registerSelector(e) {
    return this._selectors.register(e);
  }
}, gae = TL, TL.ID = "editor.contrib.suggestController", TL);
nm = gae = ITt([
  kI(1, BK),
  kI(2, jr),
  kI(3, Jt),
  kI(4, xt),
  kI(5, $r),
  kI(6, rc)
], nm);
class RTt {
  constructor(e) {
    this.prioritySelector = e, this._items = new Array();
  }
  register(e) {
    if (this._items.indexOf(e) !== -1)
      throw new Error("Value is already registered");
    return this._items.push(e), this._items.sort((t, n) => this.prioritySelector(n) - this.prioritySelector(t)), {
      dispose: () => {
        const t = this._items.indexOf(e);
        t >= 0 && this._items.splice(t, 1);
      }
    };
  }
  get itemsOrderedByPriorityDesc() {
    return this._items;
  }
}
const SG = class SG extends vt {
  constructor() {
    super({
      id: SG.id,
      label: Ee(1456, "Trigger Suggest"),
      precondition: Re.and(se.writable, se.hasCompletionItemProvider, Wn.Visible.toNegated()),
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 2058,
        secondary: [
          2087
          /* KeyCode.KeyI */
        ],
        mac: { primary: 266, secondary: [
          521,
          2087
          /* KeyCode.KeyI */
        ] },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t, n) {
    const r = nm.get(t);
    if (!r)
      return;
    let s;
    n && typeof n == "object" && n.auto === !0 && (s = !0), r.triggerSuggest(void 0, s, void 0);
  }
};
SG.id = "editor.action.triggerSuggest";
let $z = SG;
Si(
  nm.ID,
  nm,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Je($z);
const Yh = 190, pu = jo.bindToContribution(nm.get);
ct(new pu({
  id: "acceptSelectedSuggestion",
  precondition: Re.and(Wn.Visible, Wn.HasFocusedSuggestion),
  handler(i) {
    i.acceptSelectedSuggestion(!0, !1);
  },
  kbOpts: [{
    // normal tab
    primary: 2,
    kbExpr: Re.and(Wn.Visible, se.textInputFocus),
    weight: Yh
  }, {
    // accept on enter has special rules
    primary: 3,
    kbExpr: Re.and(Wn.Visible, se.textInputFocus, Wn.AcceptSuggestionsOnEnter, Wn.MakesTextEdit),
    weight: Yh
  }],
  menuOpts: [{
    menuId: A1,
    title: S(1449, "Insert"),
    group: "left",
    order: 1,
    when: Wn.HasInsertAndReplaceRange.toNegated()
  }, {
    menuId: A1,
    title: S(1450, "Insert"),
    group: "left",
    order: 1,
    when: Re.and(Wn.HasInsertAndReplaceRange, Wn.InsertMode.isEqualTo("insert"))
  }, {
    menuId: A1,
    title: S(1451, "Replace"),
    group: "left",
    order: 1,
    when: Re.and(Wn.HasInsertAndReplaceRange, Wn.InsertMode.isEqualTo("replace"))
  }]
}));
ct(new pu({
  id: "acceptAlternativeSelectedSuggestion",
  precondition: Re.and(Wn.Visible, se.textInputFocus, Wn.HasFocusedSuggestion),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 1027,
    secondary: [
      1026
      /* KeyCode.Tab */
    ]
  },
  handler(i) {
    i.acceptSelectedSuggestion(!1, !0);
  },
  menuOpts: [{
    menuId: A1,
    group: "left",
    order: 2,
    when: Re.and(Wn.HasInsertAndReplaceRange, Wn.InsertMode.isEqualTo("insert")),
    title: S(1452, "Replace")
  }, {
    menuId: A1,
    group: "left",
    order: 2,
    when: Re.and(Wn.HasInsertAndReplaceRange, Wn.InsertMode.isEqualTo("replace")),
    title: S(1453, "Insert")
  }]
}));
_i.registerCommandAlias("acceptSelectedSuggestionOnEnter", "acceptSelectedSuggestion");
ct(new pu({
  id: "hideSuggestWidget",
  precondition: Wn.Visible,
  handler: (i) => i.cancelSuggestWidget(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 9,
    secondary: [
      1033
      /* KeyCode.Escape */
    ]
  }
}));
ct(new pu({
  id: "selectNextSuggestion",
  precondition: Re.and(Wn.Visible, Re.or(Wn.MultipleSuggestions, Wn.HasFocusedSuggestion.negate())),
  handler: (i) => i.selectNextSuggestion(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 18,
    secondary: [
      2066
      /* KeyCode.DownArrow */
    ],
    mac: { primary: 18, secondary: [
      2066,
      300
      /* KeyCode.KeyN */
    ] }
  }
}));
ct(new pu({
  id: "selectNextPageSuggestion",
  precondition: Re.and(Wn.Visible, Re.or(Wn.MultipleSuggestions, Wn.HasFocusedSuggestion.negate())),
  handler: (i) => i.selectNextPageSuggestion(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 12,
    secondary: [
      2060
      /* KeyCode.PageDown */
    ]
  }
}));
ct(new pu({
  id: "selectLastSuggestion",
  precondition: Re.and(Wn.Visible, Re.or(Wn.MultipleSuggestions, Wn.HasFocusedSuggestion.negate())),
  handler: (i) => i.selectLastSuggestion()
}));
ct(new pu({
  id: "selectPrevSuggestion",
  precondition: Re.and(Wn.Visible, Re.or(Wn.MultipleSuggestions, Wn.HasFocusedSuggestion.negate())),
  handler: (i) => i.selectPrevSuggestion(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 16,
    secondary: [
      2064
      /* KeyCode.UpArrow */
    ],
    mac: { primary: 16, secondary: [
      2064,
      302
      /* KeyCode.KeyP */
    ] }
  }
}));
ct(new pu({
  id: "selectPrevPageSuggestion",
  precondition: Re.and(Wn.Visible, Re.or(Wn.MultipleSuggestions, Wn.HasFocusedSuggestion.negate())),
  handler: (i) => i.selectPrevPageSuggestion(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 11,
    secondary: [
      2059
      /* KeyCode.PageUp */
    ]
  }
}));
ct(new pu({
  id: "selectFirstSuggestion",
  precondition: Re.and(Wn.Visible, Re.or(Wn.MultipleSuggestions, Wn.HasFocusedSuggestion.negate())),
  handler: (i) => i.selectFirstSuggestion()
}));
ct(new pu({
  id: "focusSuggestion",
  precondition: Re.and(Wn.Visible, Wn.HasFocusedSuggestion.negate()),
  handler: (i) => i.focusSuggestion(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 2058,
    secondary: [
      2087
      /* KeyCode.KeyI */
    ],
    mac: { primary: 266, secondary: [
      2087
      /* KeyCode.KeyI */
    ] }
  }
}));
ct(new pu({
  id: "focusAndAcceptSuggestion",
  precondition: Re.and(Wn.Visible, Wn.HasFocusedSuggestion.negate()),
  handler: (i) => {
    i.focusSuggestion(), i.acceptSelectedSuggestion(!0, !1);
  }
}));
ct(new pu({
  id: "toggleSuggestionDetails",
  precondition: Re.and(Wn.Visible, Wn.HasFocusedSuggestion),
  handler: (i) => i.toggleSuggestionDetails(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 2058,
    secondary: [
      2087
      /* KeyCode.KeyI */
    ],
    mac: { primary: 266, secondary: [
      2087
      /* KeyCode.KeyI */
    ] }
  },
  menuOpts: [{
    menuId: A1,
    group: "right",
    order: 1,
    when: Re.and(Wn.DetailsVisible, Wn.CanResolve),
    title: S(1454, "Show Less")
  }, {
    menuId: A1,
    group: "right",
    order: 1,
    when: Re.and(Wn.DetailsVisible.toNegated(), Wn.CanResolve),
    title: S(1455, "Show More")
  }]
}));
ct(new pu({
  id: "toggleExplainMode",
  precondition: Wn.Visible,
  handler: (i) => i.toggleExplainMode(),
  kbOpts: {
    weight: 100,
    primary: 2138
  }
}));
ct(new pu({
  id: "toggleSuggestionFocus",
  precondition: Wn.Visible,
  handler: (i) => i.toggleSuggestionFocus(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 2570,
    mac: {
      primary: 778
      /* KeyCode.Space */
    }
  }
}));
ct(new pu({
  id: "insertBestCompletion",
  precondition: Re.and(se.textInputFocus, Re.equals("config.editor.tabCompletion", "on"), Wz.AtEnd, Wn.Visible.toNegated(), vA.OtherSuggestions.toNegated(), Dc.InSnippetMode.toNegated()),
  handler: (i, e) => {
    i.triggerSuggestAndAcceptBest(Ra(e) ? { fallback: "tab", ...e } : { fallback: "tab" });
  },
  kbOpts: {
    weight: Yh,
    primary: 2
    /* KeyCode.Tab */
  }
}));
ct(new pu({
  id: "insertNextSuggestion",
  precondition: Re.and(se.textInputFocus, Re.equals("config.editor.tabCompletion", "on"), vA.OtherSuggestions, Wn.Visible.toNegated(), Dc.InSnippetMode.toNegated()),
  handler: (i) => i.acceptNextSuggestion(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 2
    /* KeyCode.Tab */
  }
}));
ct(new pu({
  id: "insertPrevSuggestion",
  precondition: Re.and(se.textInputFocus, Re.equals("config.editor.tabCompletion", "on"), vA.OtherSuggestions, Wn.Visible.toNegated(), Dc.InSnippetMode.toNegated()),
  handler: (i) => i.acceptPrevSuggestion(),
  kbOpts: {
    weight: Yh,
    kbExpr: se.textInputFocus,
    primary: 1026
    /* KeyCode.Tab */
  }
}));
Je(class extends vt {
  constructor() {
    super({
      id: "editor.action.resetSuggestSize",
      label: Ee(1457, "Reset Suggest Widget Size"),
      precondition: void 0
    });
  }
  run(i, e) {
    var t;
    (t = nm.get(e)) == null || t.resetWidgetSize();
  }
});
class ATt extends ge {
  get selectedItem() {
    return this._currentSuggestItemInfo;
  }
  constructor(e, t, n) {
    super(), this.editor = e, this.suggestControllerPreselector = t, this.onWillAccept = n, this.isSuggestWidgetVisible = !1, this.isShiftKeyPressed = !1, this._isActive = !1, this._currentSuggestItemInfo = void 0, this._onDidSelectedItemChange = this._register(new he()), this.onDidSelectedItemChange = this._onDidSelectedItemChange.event, this._register(e.onKeyDown((s) => {
      s.shiftKey && !this.isShiftKeyPressed && (this.isShiftKeyPressed = !0, this.update(this._isActive));
    })), this._register(e.onKeyUp((s) => {
      s.shiftKey && this.isShiftKeyPressed && (this.isShiftKeyPressed = !1, this.update(this._isActive));
    }));
    const r = nm.get(this.editor);
    if (r) {
      this._register(r.registerSelector({
        priority: 100,
        select: (a, l, c) => {
          const u = this.editor.getModel();
          if (!u)
            return -1;
          const d = this.suggestControllerPreselector(), h = d ? Sy(d, u) : void 0;
          if (!h)
            return -1;
          const g = de.lift(l), m = c.map((v, w) => {
            const E = ZF.fromSuggestion(r, u, g, v, this.isShiftKeyPressed), L = Sy(E.getSingleTextEdit(), u), T = X6e(h, L);
            return { index: w, valid: T, prefixLength: L.text.length, suggestItem: v };
          }).filter((v) => v && v.valid && v.prefixLength > 0), _ = Mfe(m, yl((v) => v.prefixLength, Hd));
          return _ ? _.index : -1;
        }
      }));
      let s = !1;
      const o = () => {
        s || (s = !0, this._register(r.widget.value.onDidShow(() => {
          this.isSuggestWidgetVisible = !0, this.update(!0);
        })), this._register(r.widget.value.onDidHide(() => {
          this.isSuggestWidgetVisible = !1, this.update(!1);
        })), this._register(r.widget.value.onDidFocus(() => {
          this.isSuggestWidgetVisible = !0, this.update(!0);
        })));
      };
      this._register(Ze.once(r.model.onDidTrigger)((a) => {
        o();
      })), this._register(r.onWillInsertSuggestItem((a) => {
        const l = this.editor.getPosition(), c = this.editor.getModel();
        if (!l || !c)
          return;
        const u = ZF.fromSuggestion(r, c, l, a.item, this.isShiftKeyPressed);
        this.onWillAccept(u);
      }));
    }
    this.update(this._isActive);
  }
  update(e) {
    const t = this.getSuggestItemInfo();
    (this._isActive !== e || !OTt(this._currentSuggestItemInfo, t)) && (this._isActive = e, this._currentSuggestItemInfo = t, this._onDidSelectedItemChange.fire());
  }
  getSuggestItemInfo() {
    const e = nm.get(this.editor);
    if (!e || !this.isSuggestWidgetVisible)
      return;
    const t = e.widget.value.getFocusedItem(), n = this.editor.getPosition(), r = this.editor.getModel();
    if (!(!t || !n || !r))
      return ZF.fromSuggestion(e, r, n, t.item, this.isShiftKeyPressed);
  }
  stopForceRenderingAbove() {
    const e = nm.get(this.editor);
    e == null || e.stopForceRenderingAbove();
  }
  forceRenderingAbove() {
    const e = nm.get(this.editor);
    e == null || e.forceRenderingAbove();
  }
}
class ZF {
  static fromSuggestion(e, t, n, r, s) {
    let { insertText: o } = r.completion, a = !1;
    if (r.completion.insertTextRules & 4) {
      const c = new _T().parse(o);
      c.children.length < 100 && Mz.adjustWhitespace(t, n, !0, c), o = c.toString(), a = !0;
    }
    const l = e.getOverwriteInfo(r, s);
    return new ZF(z.fromPositions(n.delta(0, -l.overwriteBefore), n.delta(0, Math.max(l.overwriteAfter, 0))), o, r.completion.kind, a, r.container.incomplete ?? !1);
  }
  constructor(e, t, n, r, s) {
    this.range = e, this.insertText = t, this.completionItemKind = n, this.isSnippetText = r, this.listIncomplete = s;
  }
  equals(e) {
    return this.range.equalsRange(e.range) && this.insertText === e.insertText && this.completionItemKind === e.completionItemKind && this.isSnippetText === e.isSnippetText;
  }
  toSelectedSuggestionInfo() {
    return new L3e(this.range, this.insertText, this.completionItemKind, this.isSnippetText);
  }
  getSingleTextEdit() {
    return new Wo(this.range, this.insertText);
  }
}
function OTt(i, e) {
  return i === e ? !0 : !i || !e ? !1 : i.equals(e);
}
class MTt extends ge {
  constructor(e, t, n) {
    super(), this._editorObs = e, this._handleSuggestAccepted = t, this._suggestControllerPreselector = n, this._suggestWidgetAdaptor = this._register(new ATt(this._editorObs.editor, () => (this._editorObs.forceUpdate(), this._suggestControllerPreselector()), (r) => this._editorObs.forceUpdate((s) => {
      this._handleSuggestAccepted(r);
    }))), this.selectedItem = ji(this, (r) => this._suggestWidgetAdaptor.onDidSelectedItemChange(() => {
      this._editorObs.forceUpdate((s) => r(void 0));
    }), () => this._suggestWidgetAdaptor.selectedItem);
  }
  stopForceRenderingAbove() {
    this._suggestWidgetAdaptor.stopForceRenderingAbove();
  }
  forceRenderingAbove() {
    this._suggestWidgetAdaptor.forceRenderingAbove();
  }
}
class PTt {
  constructor(e, t) {
    this.lineNumber = e, this.columnRange = t;
  }
}
class BIe {
  constructor(e, t) {
    if (this.startColumn = e, this.endColumnExclusive = t, e > t)
      throw new Wt(`startColumn ${e} cannot be after endColumnExclusive ${t}`);
  }
  toRange(e) {
    return new z(e, this.startColumn, e, this.endColumnExclusive);
  }
  equals(e) {
    return this.startColumn === e.startColumn && this.endColumnExclusive === e.endColumnExclusive;
  }
  toZeroBasedOffsetRange() {
    return new Tt(this.startColumn - 1, this.endColumnExclusive - 1);
  }
}
class wx {
  static fromLineTokens(e) {
    const t = [];
    for (let n = 0; n < e.getCount(); n++)
      t.push(new HIe(e.getTokenText(n), e.getMetadata(n)));
    return wx.create(t);
  }
  static create(e) {
    return new wx(e);
  }
  constructor(e) {
    this._tokenInfo = e;
  }
  toLineTokens(e) {
    return fo.createFromTextAndMetadata(this.map((t, n) => ({ text: n.text, metadata: n.metadata })), e);
  }
  map(e) {
    const t = [];
    let n = 0;
    for (const r of this._tokenInfo) {
      const s = new Tt(n, n + r.text.length);
      t.push(e(s, r)), n += r.text.length;
    }
    return t;
  }
  slice(e) {
    const t = [];
    let n = 0;
    for (const r of this._tokenInfo) {
      const s = n, o = s + r.text.length;
      if (o > e.start) {
        if (s >= e.endExclusive)
          break;
        const a = Math.max(0, e.start - s), l = Math.max(0, o - e.endExclusive);
        t.push(new HIe(r.text.slice(a, r.text.length - l), r.metadata));
      }
      n += r.text.length;
    }
    return wx.create(t);
  }
  append(e) {
    const t = this._tokenInfo.concat(e._tokenInfo);
    return wx.create(t);
  }
}
class HIe {
  constructor(e, t) {
    this.text = e, this.metadata = t;
  }
}
var FTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, BTt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, pae;
const i8e = "ghost-text";
var kL;
let p5 = (kL = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._editor = e, this._model = t, this._options = n, this._shouldKeepCursorStable = r, this._isClickable = s, this._languageService = o, this._isDisposed = Qt(this, !1), this._editorObs = Ms(this._editor), this._warningState = Ie((a) => {
      const l = this._model.ghostText.read(a);
      if (!l)
        return;
      const c = this._model.warning.read(a);
      if (c)
        return { lineNumber: l.lineNumber, position: new de(l.lineNumber, l.parts[0].column), icon: c.icon };
    }), this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._useSyntaxHighlighting = this._options.map((a) => a.syntaxHighlightingEnabled), this._extraClassNames = Ie(this, (a) => {
      const l = [...this._options.read(a).extraClasses ?? []];
      return this._useSyntaxHighlighting.read(a) && l.push("syntax-highlighted"), this._warningState.read(a) && l.push("warning"), l.map((u) => ` ${u}`).join("");
    }), this.uiState = Ie(this, (a) => {
      var j, K;
      if (this._isDisposed.read(a))
        return;
      const l = this._editorObs.model.read(a);
      if (l !== this._model.targetTextModel.read(a))
        return;
      const c = this._model.ghostText.read(a);
      if (!c)
        return;
      const u = c instanceof Goe ? c.columnRange : void 0, d = this._useSyntaxHighlighting.read(a), h = this._extraClassNames.read(a), { inlineTexts: g, additionalLines: m, hiddenRange: _, additionalLinesOriginalSuffix: v } = HTt(c, l, i8e + h), w = l.getLineContent(c.lineNumber), E = new Jy(g.map((X) => Ya.insert(X.column - 1, X.text))), L = d ? l.tokenization.tokenizeLinesAt(c.lineNumber, [E.apply(w), ...m.map((X) => X.content)]) : void 0, T = E.getNewRanges(), D = g.map((X, Y) => {
        var G;
        return { ...X, tokens: (G = L == null ? void 0 : L[0]) == null ? void 0 : G.getTokensInRange(T[Y]) };
      }), N = m.map((X, Y) => {
        let G = (L == null ? void 0 : L[Y + 1]) ?? fo.createEmpty(X.content, this._languageService.languageIdCodec);
        if (Y === m.length - 1 && v) {
          const oe = wx.fromLineTokens(l.tokenization.getLineTokens(v.lineNumber)).slice(v.columnRange.toZeroBasedOffsetRange());
          G = wx.fromLineTokens(G).append(oe).toLineTokens(G.languageIdCodec);
        }
        return {
          content: G,
          decorations: X.decorations
        };
      }), R = (j = this._editor.getSelection()) == null ? void 0 : j.getStartPosition().column, M = D.filter((X) => X.text !== ""), B = M.length !== 0, H = {
        cursorColumnDistance: (B ? M[0].column : 1) - R,
        cursorLineDistance: B ? 0 : m.findIndex((X) => X.content !== "") + 1,
        lineCountOriginal: B ? 1 : 0,
        lineCountModified: m.length + (B ? 1 : 0),
        characterCountOriginal: 0,
        characterCountModified: PV(M.map((X) => X.text.length)) + PV(N.map((X) => X.content.getTextLength())),
        disjointReplacements: M.length + (m.length > 0 ? 1 : 0),
        sameShapeReplacements: M.length > 1 && N.length === 0 ? M.every((X) => X.text === M[0].text) : void 0
      };
      return (K = this._model.handleInlineCompletionShown.read(a)) == null || K(H), {
        replacedRange: u,
        inlineTexts: D,
        additionalLines: N,
        hiddenRange: _,
        lineNumber: c.lineNumber,
        additionalReservedLineCount: this._model.minReservedLineCount.read(a),
        targetTextModel: l,
        syntaxHighlightingEnabled: d
      };
    }), this.decorations = Ie(this, (a) => {
      const l = this.uiState.read(a);
      if (!l)
        return [];
      const c = [], u = this._extraClassNames.read(a);
      l.replacedRange && c.push({
        range: l.replacedRange.toRange(l.lineNumber),
        options: { inlineClassName: "inline-completion-text-to-replace" + u, description: "GhostTextReplacement" }
      }), l.hiddenRange && c.push({
        range: l.hiddenRange.toRange(l.lineNumber),
        options: { inlineClassName: "ghost-text-hidden", description: "ghost-text-hidden" }
      });
      for (const d of l.inlineTexts)
        c.push({
          range: z.fromPositions(new de(l.lineNumber, d.column)),
          options: {
            description: "ghost-text-decoration",
            after: {
              content: d.text,
              tokens: d.tokens,
              inlineClassName: (d.preview ? "ghost-text-decoration-preview" : "ghost-text-decoration") + (this._isClickable ? " clickable" : "") + u + d.lineDecorations.map((h) => " " + h.className).join(" "),
              // TODO: take the ranges into account for line decorations
              cursorStops: Af.Left,
              attachedData: new pte(this)
            },
            showIfCollapsed: !0
          }
        });
      return c;
    }), this._additionalLinesWidget = this._register(new WTt(this._editor, Ie((a) => {
      const l = this.uiState.read(a);
      return l ? {
        lineNumber: l.lineNumber,
        additionalLines: l.additionalLines,
        minReservedLineCount: l.additionalReservedLineCount,
        targetTextModel: l.targetTextModel
      } : void 0;
    }), this._shouldKeepCursorStable, this._isClickable)), this._isInlineTextHovered = this._editorObs.isTargetHovered((a) => {
      var l;
      return a.target.type === 6 && ((l = a.target.detail.injectedText) == null ? void 0 : l.options.attachedData) instanceof pte && a.target.detail.injectedText.options.attachedData.owner === this;
    }, this._store), this.isHovered = Ie(this, (a) => this._isDisposed.read(a) ? !1 : this._isInlineTextHovered.read(a) || this._additionalLinesWidget.isHovered.read(a)), this.height = Ie(this, (a) => this._editorObs.getOption(
      75
      /* EditorOption.lineHeight */
    ).read(a) + (this._additionalLinesWidget.viewZoneHeight.read(a) ?? 0)), this._register(Et(() => {
      this._isDisposed.set(!0, void 0);
    })), this._register(this._editorObs.setDecorations(this.decorations)), this._isClickable && (this._register(this._additionalLinesWidget.onDidClick((a) => this._onDidClick.fire(a))), this._register(this._editor.onMouseUp((a) => {
      var c;
      if (a.target.type !== 6)
        return;
      const l = (c = a.target.detail.injectedText) == null ? void 0 : c.options.attachedData;
      l instanceof pte && l.owner === this && this._onDidClick.fire(a.event);
    }))), this._register(Ql((a, l) => {
    }));
  }
  static getWarningWidgetContext(e) {
    const t = e.ghostTextViewWarningWidgetData;
    if (t)
      return t;
    if (e.parentElement)
      return this.getWarningWidgetContext(e.parentElement);
  }
  ownsViewZone(e) {
    return this._additionalLinesWidget.viewZoneId === e;
  }
}, pae = kL, kL.hot = cK(pae), kL);
p5 = pae = FTt([
  BTt(5, Gr)
], p5);
class pte {
  constructor(e) {
    this.owner = e;
  }
}
function HTt(i, e, t) {
  const n = [], r = [];
  function s(d, h) {
    if (r.length > 0) {
      const g = r[r.length - 1];
      h && g.decorations.push(new Lc(
        g.content.length + 1,
        g.content.length + 1 + d[0].line.length,
        h,
        0
        /* InlineDecorationType.Regular */
      )), g.content += d[0].line, d = d.slice(1);
    }
    for (const g of d)
      r.push({
        content: g.line,
        decorations: h ? [new Lc(
          1,
          g.line.length + 1,
          h,
          0
          /* InlineDecorationType.Regular */
        ), ...g.lineDecorations] : [...g.lineDecorations]
      });
  }
  const o = e.getLineContent(i.lineNumber);
  let a, l = 0;
  for (const d of i.parts) {
    let h = d.lines;
    a === void 0 ? (n.push({ column: d.column, text: h[0].line, preview: d.preview, lineDecorations: h[0].lineDecorations }), h = h.slice(1)) : s([{ line: o.substring(l, d.column - 1), lineDecorations: [] }], void 0), h.length > 0 && (s(h, t), a === void 0 && d.column <= o.length && (a = d.column)), l = d.column - 1;
  }
  let c;
  a !== void 0 && (c = new PTt(i.lineNumber, new BIe(l + 1, o.length + 1)));
  const u = a !== void 0 ? new BIe(a, o.length + 1) : void 0;
  return {
    inlineTexts: n,
    additionalLines: r,
    hiddenRange: u,
    additionalLinesOriginalSuffix: c
  };
}
class WTt extends ge {
  get viewZoneId() {
    var e;
    return (e = this._viewZoneInfo) == null ? void 0 : e.viewZoneId;
  }
  get viewZoneHeight() {
    return this._viewZoneHeight;
  }
  constructor(e, t, n, r) {
    super(), this._editor = e, this._lines = t, this._shouldKeepCursorStable = n, this._isClickable = r, this._viewZoneHeight = Qt("viewZoneHeight", void 0), this.editorOptionsChanged = Dd("editorOptionChanged", Ze.filter(this._editor.onDidChangeConfiguration, (s) => s.hasChanged(
      40
      /* EditorOption.disableMonospaceOptimizations */
    ) || s.hasChanged(
      133
      /* EditorOption.stopRenderingLineAfter */
    ) || s.hasChanged(
      113
      /* EditorOption.renderWhitespace */
    ) || s.hasChanged(
      108
      /* EditorOption.renderControlCharacters */
    ) || s.hasChanged(
      60
      /* EditorOption.fontLigatures */
    ) || s.hasChanged(
      59
      /* EditorOption.fontInfo */
    ) || s.hasChanged(
      75
      /* EditorOption.lineHeight */
    ))), this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._viewZoneListener = this._register(new er()), this.isHovered = Ms(this._editor).isTargetHovered((s) => WIe(s.target.element), this._store), this.hasBeenAccepted = !1, this._editor instanceof uT && this._shouldKeepCursorStable && this._register(this._editor.onBeforeExecuteEdit((s) => this.hasBeenAccepted = s.source === "inlineSuggestion.accept")), this._register(Xt((s) => {
      const o = this._lines.read(s);
      this.editorOptionsChanged.read(s), o ? (this.hasBeenAccepted = !1, this.updateLines(o.lineNumber, o.additionalLines, o.minReservedLineCount)) : this.clear();
    }));
  }
  dispose() {
    super.dispose(), this.clear();
  }
  clear() {
    this._viewZoneListener.clear(), this._editor.changeViewZones((e) => {
      this.removeActiveViewZone(e);
    });
  }
  updateLines(e, t, n) {
    const r = this._editor.getModel();
    if (!r)
      return;
    const { tabSize: s } = r.getOptions();
    this._editor.changeViewZones((o) => {
      const a = new ke();
      this.removeActiveViewZone(o);
      const l = Math.max(t.length, n);
      if (l > 0) {
        const c = document.createElement("div");
        VTt(c, s, t, this._editor.getOptions(), this._isClickable), this._isClickable && (a.add(Ce(c, "mousedown", (u) => {
          u.preventDefault();
        })), a.add(Ce(c, "click", (u) => {
          WIe(u.target) && this._onDidClick.fire(new vl(At(u), u));
        }))), this.addViewZone(o, e, l, c);
      }
      this._viewZoneListener.value = a;
    });
  }
  addViewZone(e, t, n, r) {
    const s = e.addZone({
      afterLineNumber: t,
      heightInLines: n,
      domNode: r,
      afterColumnAffinity: 1,
      onComputedHeight: (o) => {
        this._viewZoneHeight.set(o, void 0);
      }
    });
    this.keepCursorStable(t, n), this._viewZoneInfo = { viewZoneId: s, heightInLines: n, lineNumber: t };
  }
  removeActiveViewZone(e) {
    this._viewZoneInfo && (e.removeZone(this._viewZoneInfo.viewZoneId), this.hasBeenAccepted || this.keepCursorStable(this._viewZoneInfo.lineNumber, -this._viewZoneInfo.heightInLines), this._viewZoneInfo = void 0, this._viewZoneHeight.set(void 0, void 0));
  }
  keepCursorStable(e, t) {
    var r, s;
    if (!this._shouldKeepCursorStable)
      return;
    const n = (s = (r = this._editor.getSelection()) == null ? void 0 : r.getStartPosition()) == null ? void 0 : s.lineNumber;
    n !== void 0 && e < n && this._editor.setScrollTop(this._editor.getScrollTop() + t * this._editor.getOption(
      75
      /* EditorOption.lineHeight */
    ));
  }
}
function WIe(i) {
  return eo(i) && i.classList.contains(i8e);
}
function VTt(i, e, t, n, r) {
  const s = n.get(
    40
    /* EditorOption.disableMonospaceOptimizations */
  ), o = n.get(
    133
    /* EditorOption.stopRenderingLineAfter */
  ), a = "none", l = n.get(
    108
    /* EditorOption.renderControlCharacters */
  ), c = n.get(
    60
    /* EditorOption.fontLigatures */
  ), u = n.get(
    59
    /* EditorOption.fontInfo */
  ), d = n.get(
    75
    /* EditorOption.lineHeight */
  );
  let h = "suggest-preview-text";
  r && (h += " clickable");
  const g = new ww(1e4);
  g.appendString(`<div class="${h}">`);
  for (let v = 0, w = t.length; v < w; v++) {
    const E = t[v], L = E.content;
    g.appendString('<div class="view-line'), g.appendString('" style="top:'), g.appendString(String(v * d)), g.appendString('px;width:1000000px;">');
    const T = L.getLineContent(), D = _B(T), N = jR(T);
    t2(new d0(u.isMonospace && !s, u.canUseHalfwidthRightwardsArrow, T, !1, D, N, 0, L, E.decorations, e, 0, u.spaceWidth, u.middotWidth, u.wsmiddotWidth, o, a, l, c !== Yy.OFF, null, null, 0), g), g.appendString("</div>");
  }
  g.appendString("</div>"), Ma(i, u);
  const m = g.build(), _ = VIe ? VIe.createHTML(m) : m;
  i.innerHTML = _;
}
const VIe = Db("editorGhostText", { createHTML: (i) => i }), EG = class EG {
  constructor(e) {
    this.replacements = e, K3(hB(e, (t, n) => t.lineRange.endLineNumberExclusive <= n.lineRange.startLineNumber));
  }
  toString() {
    return this.replacements.map((e) => e.toString()).join(",");
  }
  getNewLineRanges() {
    const e = [];
    let t = 0;
    for (const n of this.replacements)
      e.push(Zt.ofLength(n.lineRange.startLineNumber + t, n.newLines.length)), t += n.newLines.length - n.lineRange.length;
    return e;
  }
};
EG.empty = new EG([]);
let mae = EG;
class Hpe {
  static fromSingleTextEdit(e, t) {
    const n = $d(e.text);
    let r = e.range.startLineNumber;
    const s = t.getValueOfRange(z.fromPositions(new de(e.range.startLineNumber, 1), e.range.getStartPosition()));
    n[0] = s + n[0];
    let o = e.range.endLineNumber + 1;
    const a = t.getTransformer().getLineLength(e.range.endLineNumber) + 1, l = t.getValueOfRange(z.fromPositions(e.range.getEndPosition(), new de(e.range.endLineNumber, a)));
    n[n.length - 1] = n[n.length - 1] + l;
    const c = e.range.startColumn === t.getTransformer().getLineLength(e.range.startLineNumber) + 1, u = e.range.endColumn === 1;
    return c && n[0].length === s.length && (r++, n.shift()), n.length > 0 && r < o && u && n[n.length - 1].length === l.length && (o--, n.pop()), new Hpe(new Zt(r, o), n);
  }
  constructor(e, t) {
    this.lineRange = e, this.newLines = t;
  }
  toString() {
    return `${this.lineRange}->${JSON.stringify(this.newLines)}`;
  }
  toLineEdit() {
    return new mae([this]);
  }
}
class r8e {
  get lineEdit() {
    return Hpe.fromSingleTextEdit(this.edit.toReplacement(this.originalText), this.originalText);
  }
  get originalLineRange() {
    return this.lineEdit.lineRange;
  }
  get modifiedLineRange() {
    return this.lineEdit.toLineEdit().getNewLineRanges()[0];
  }
  get displayRange() {
    return this.originalText.lineRange.intersect(this.originalLineRange.join(Zt.ofLength(this.originalLineRange.startLineNumber, this.lineEdit.newLines.length)));
  }
  constructor(e, t, n, r, s) {
    this.originalText = e, this.edit = t, this.cursorPosition = n, this.commands = r, this.inlineCompletion = s;
  }
}
class s8e {
  constructor(e, t, n) {
    this._model = e, this.inlineEdit = t, this.tabAction = n, this.action = this.inlineEdit.inlineCompletion.action, this.displayName = this.inlineEdit.inlineCompletion.source.provider.displayName ?? S(1209, "Inline Edit"), this.extensionCommands = this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands ?? [], this.isInDiffEditor = this._model.isInDiffEditor, this.displayLocation = this.inlineEdit.inlineCompletion.displayLocation, this.showCollapsed = this._model.showCollapsed;
  }
  accept() {
    this._model.accept();
  }
  jump() {
    this._model.jump();
  }
  abort(e) {
    console.error(e), this.inlineEdit.inlineCompletion.reportInlineEditError(e), this._model.stop();
  }
  handleInlineEditShown(e, t) {
    this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion, e, t);
  }
}
class UTt {
  constructor(e) {
    this._model = e, this.onDidAccept = this._model.onDidAccept, this.inAcceptFlow = this._model.inAcceptFlow;
  }
}
class zTt {
  constructor(e, t, n, r) {
    this.lineRange = n;
    const s = Ms(e), o = Ie(this, (a) => s.isFocused.read(a) && r.showInlineEditMenu ? Kl.Accept : Kl.Inactive);
    this.model = new s8e(t, new r8e(new u1(""), new Md([r.getSingleTextEdit()]), t.primaryPosition.get(), r.source.inlineSuggestions.commands ?? [], r), o);
  }
}
class xr {
  static fromPoints(e, t) {
    return new xr(e.x, e.y, t.x, t.y);
  }
  static fromPointSize(e, t) {
    return new xr(e.x, e.y, e.x + t.x, e.y + t.y);
  }
  static fromLeftTopRightBottom(e, t, n, r) {
    return new xr(e, t, n, r);
  }
  static fromLeftTopWidthHeight(e, t, n, r) {
    return new xr(e, t, e + n, t + r);
  }
  static fromRanges(e, t) {
    return new xr(e.start, t.start, e.endExclusive, t.endExclusive);
  }
  static hull(e) {
    let t = Number.MAX_SAFE_INTEGER, n = Number.MAX_SAFE_INTEGER, r = Number.MIN_SAFE_INTEGER, s = Number.MIN_SAFE_INTEGER;
    for (const o of e)
      t = Math.min(t, o.left), n = Math.min(n, o.top), r = Math.max(r, o.right), s = Math.max(s, o.bottom);
    return new xr(t, n, r, s);
  }
  get width() {
    return this.right - this.left;
  }
  get height() {
    return this.bottom - this.top;
  }
  constructor(e, t, n, r) {
    if (this.left = e, this.top = t, this.right = n, this.bottom = r, e > n)
      throw new Wt("Invalid arguments: Horizontally offset by " + (e - n));
    if (t > r)
      throw new Wt("Invalid arguments: Vertically offset by " + (t - r));
  }
  withMargin(e, t, n, r) {
    let s, o, a, l;
    return t === void 0 && n === void 0 && r === void 0 ? s = o = a = l = e : n === void 0 && r === void 0 ? (s = o = t, a = l = e) : (s = r, o = t, a = e, l = n), new xr(this.left - s, this.top - a, this.right + o, this.bottom + l);
  }
  intersectVertical(e) {
    const t = Math.max(this.top, e.start), n = Math.min(this.bottom, e.endExclusive);
    return new xr(this.left, t, this.right, Math.max(t, n));
  }
  intersectHorizontal(e) {
    const t = Math.max(this.left, e.start), n = Math.min(this.right, e.endExclusive);
    return new xr(t, this.top, Math.max(t, n), this.bottom);
  }
  toString() {
    return `Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`;
  }
  intersect(e) {
    const t = Math.max(this.left, e.left), n = Math.min(this.right, e.right), r = Math.max(this.top, e.top), s = Math.min(this.bottom, e.bottom);
    if (!(t > n || r > s))
      return new xr(t, r, n, s);
  }
  containsRect(e) {
    return this.left <= e.left && this.top <= e.top && this.right >= e.right && this.bottom >= e.bottom;
  }
  containsPoint(e) {
    return this.left <= e.x && this.top <= e.y && this.right >= e.x && this.bottom >= e.y;
  }
  moveToBeContainedIn(e) {
    const t = this.width, n = this.height;
    let r = this.left, s = this.top;
    return r < e.left ? r = e.left : r + t > e.right && (r = e.right - t), s < e.top ? s = e.top : s + n > e.bottom && (s = e.bottom - n), new xr(r, s, r + t, s + n);
  }
  withWidth(e) {
    return new xr(this.left, this.top, this.left + e, this.bottom);
  }
  withHeight(e) {
    return new xr(this.left, this.top, this.right, this.top + e);
  }
  withTop(e) {
    return new xr(this.left, e, this.right, this.bottom);
  }
  withLeft(e) {
    return new xr(e, this.top, this.right, this.bottom);
  }
  translateX(e) {
    return new xr(this.left + e, this.top, this.right + e, this.bottom);
  }
  translateY(e) {
    return new xr(this.left, this.top + e, this.right, this.bottom + e);
  }
  getLeftBottom() {
    return new ha(this.left, this.bottom);
  }
  getRightBottom() {
    return new ha(this.right, this.bottom);
  }
  getRightTop() {
    return new ha(this.right, this.top);
  }
  toStyles() {
    return {
      position: "absolute",
      left: `${this.left}px`,
      top: `${this.top}px`,
      width: `${this.width}px`,
      height: `${this.height}px`
    };
  }
}
class QF {
  constructor(e, t, n, r = null) {
    this.startLineNumbers = e, this.endLineNumbers = t, this.lastLineRelativePosition = n, this.showEndForLine = r;
  }
  equals(e) {
    return !!e && this.lastLineRelativePosition === e.lastLineRelativePosition && this.showEndForLine === e.showEndForLine && ds(this.startLineNumbers, e.startLineNumbers) && ds(this.endLineNumbers, e.endLineNumbers);
  }
  static get Empty() {
    return new QF([], [], 0);
  }
}
const UIe = Db("stickyScrollViewLayer", { createHTML: (i) => i }), mte = "data-sticky-line-index", zIe = "data-sticky-is-line", $Tt = "data-sticky-is-line-number", $Ie = "data-sticky-is-folding-icon";
class jTt extends ge {
  get height() {
    return this._height;
  }
  constructor(e) {
    super(), this._foldingIconStore = new ke(), this._rootDomNode = document.createElement("div"), this._lineNumbersDomNode = document.createElement("div"), this._linesDomNodeScrollable = document.createElement("div"), this._linesDomNode = document.createElement("div"), this._renderedStickyLines = [], this._lineNumbers = [], this._lastLineRelativePosition = 0, this._minContentWidthInPx = 0, this._isOnGlyphMargin = !1, this._height = -1, this._onDidChangeStickyScrollHeight = this._register(new he()), this.onDidChangeStickyScrollHeight = this._onDidChangeStickyScrollHeight.event, this._editor = e, this._lineHeight = e.getOption(
      75
      /* EditorOption.lineHeight */
    ), this._lineNumbersDomNode.className = "sticky-widget-line-numbers", this._lineNumbersDomNode.setAttribute("role", "none"), this._linesDomNode.className = "sticky-widget-lines", this._linesDomNode.setAttribute("role", "list"), this._linesDomNodeScrollable.className = "sticky-widget-lines-scrollable", this._linesDomNodeScrollable.appendChild(this._linesDomNode), this._rootDomNode.className = "sticky-widget", this._rootDomNode.classList.toggle("peek", e instanceof s0), this._rootDomNode.appendChild(this._lineNumbersDomNode), this._rootDomNode.appendChild(this._linesDomNodeScrollable), this._setHeight(0);
    const t = () => {
      this._linesDomNode.style.left = this._editor.getOption(
        131
        /* EditorOption.stickyScroll */
      ).scrollWithEditor ? `-${this._editor.getScrollLeft()}px` : "0px";
    };
    this._register(this._editor.onDidChangeConfiguration((n) => {
      n.hasChanged(
        131
        /* EditorOption.stickyScroll */
      ) && t(), n.hasChanged(
        75
        /* EditorOption.lineHeight */
      ) && (this._lineHeight = this._editor.getOption(
        75
        /* EditorOption.lineHeight */
      ));
    })), this._register(this._editor.onDidScrollChange((n) => {
      n.scrollLeftChanged && t(), n.scrollWidthChanged && this._updateWidgetWidth();
    })), this._register(this._editor.onDidChangeModel(() => {
      t(), this._updateWidgetWidth();
    })), this._register(this._foldingIconStore), t(), this._register(this._editor.onDidLayoutChange((n) => {
      this._updateWidgetWidth();
    })), this._updateWidgetWidth();
  }
  get lineNumbers() {
    return this._lineNumbers;
  }
  get lineNumberCount() {
    return this._lineNumbers.length;
  }
  getRenderedStickyLine(e) {
    return this._renderedStickyLines.find((t) => t.lineNumber === e);
  }
  getCurrentLines() {
    return this._lineNumbers;
  }
  setState(e, t, n) {
    const r = !this._state && !e, s = this._state && this._state.equals(e);
    if (n === void 0 && (r || s))
      return;
    const o = this._findRenderingData(e), a = this._lineNumbers;
    this._lineNumbers = o.lineNumbers, this._lastLineRelativePosition = o.lastLineRelativePosition;
    const l = this._findIndexToRebuildFrom(a, this._lineNumbers, n);
    this._renderRootNode(this._lineNumbers, this._lastLineRelativePosition, t, l), this._state = e;
  }
  _findRenderingData(e) {
    if (!e)
      return { lineNumbers: [], lastLineRelativePosition: 0 };
    const t = [...e.startLineNumbers];
    e.showEndForLine !== null && (t[e.showEndForLine] = e.endLineNumbers[e.showEndForLine]);
    let n = 0;
    for (let r = 0; r < t.length; r++)
      n += this._editor.getLineHeightForPosition(new de(t[r], 1));
    return n === 0 ? { lineNumbers: [], lastLineRelativePosition: 0 } : { lineNumbers: t, lastLineRelativePosition: e.lastLineRelativePosition };
  }
  _findIndexToRebuildFrom(e, t, n) {
    if (t.length === 0)
      return 0;
    if (n !== void 0)
      return n;
    const r = t.findIndex((s) => !e.includes(s));
    return r === -1 ? 0 : r;
  }
  _updateWidgetWidth() {
    const e = this._editor.getLayoutInfo(), t = e.contentLeft;
    this._lineNumbersDomNode.style.width = `${t}px`, this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth", `${this._editor.getScrollWidth() - e.verticalScrollbarWidth}px`), this._rootDomNode.style.width = `${e.width - e.verticalScrollbarWidth}px`;
  }
  _useFoldingOpacityTransition(e) {
    this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition", `opacity ${e ? 0.5 : 0}s`);
  }
  _setFoldingIconsVisibility(e) {
    for (const t of this._renderedStickyLines) {
      const n = t.foldingIcon;
      n && n.setVisible(e ? !0 : n.isCollapsed);
    }
  }
  async _renderRootNode(e, t, n, r) {
    const s = this._editor._getViewModel();
    if (!s) {
      this._clearWidget();
      return;
    }
    if (e.length === 0) {
      this._clearWidget();
      return;
    }
    const o = [], a = e[e.length - 1];
    let l = 0;
    for (let u = 0; u < this._renderedStickyLines.length; u++)
      if (u < r) {
        const d = this._renderedStickyLines[u];
        o.push(this._updatePosition(d, l, d.lineNumber === a)), l += d.height;
      } else {
        const d = this._renderedStickyLines[u];
        d.lineNumberDomNode.remove(), d.lineDomNode.remove();
      }
    const c = this._editor.getLayoutInfo();
    for (let u = r; u < e.length; u++) {
      const d = this._renderChildNode(s, u, e[u], l, a === e[u], n, c);
      l += d.height, this._linesDomNode.appendChild(d.lineDomNode), this._lineNumbersDomNode.appendChild(d.lineNumberDomNode), o.push(d);
    }
    n && (this._setFoldingHoverListeners(), this._useFoldingOpacityTransition(!this._isOnGlyphMargin)), this._minContentWidthInPx = Math.max(...this._renderedStickyLines.map((u) => u.scrollWidth)) + c.verticalScrollbarWidth, this._renderedStickyLines = o, this._setHeight(l + t), this._editor.layoutOverlayWidget(this);
  }
  _clearWidget() {
    for (let e = 0; e < this._renderedStickyLines.length; e++) {
      const t = this._renderedStickyLines[e];
      t.lineNumberDomNode.remove(), t.lineDomNode.remove();
    }
    this._setHeight(0);
  }
  _setHeight(e) {
    this._height !== e && (this._height = e, this._height === 0 ? this._rootDomNode.style.display = "none" : (this._rootDomNode.style.display = "block", this._lineNumbersDomNode.style.height = `${this._height}px`, this._linesDomNodeScrollable.style.height = `${this._height}px`, this._rootDomNode.style.height = `${this._height}px`), this._onDidChangeStickyScrollHeight.fire({ height: this._height }));
  }
  _setFoldingHoverListeners() {
    this._editor.getOption(
      126
      /* EditorOption.showFoldingControls */
    ) === "mouseover" && (this._foldingIconStore.add(Ce(this._lineNumbersDomNode, Xe.MOUSE_ENTER, () => {
      this._isOnGlyphMargin = !0, this._setFoldingIconsVisibility(!0);
    })), this._foldingIconStore.add(Ce(this._lineNumbersDomNode, Xe.MOUSE_LEAVE, () => {
      this._isOnGlyphMargin = !1, this._useFoldingOpacityTransition(!0), this._setFoldingIconsVisibility(!1);
    })));
  }
  _renderChildNode(e, t, n, r, s, o, a) {
    const l = e.coordinatesConverter.convertModelPositionToViewPosition(new de(n, 1)).lineNumber, c = e.getViewLineRenderingData(l), u = this._editor.getOption(
      76
      /* EditorOption.lineNumbers */
    ), d = this._editor.getOption(
      117
      /* EditorOption.scrollbar */
    ).verticalScrollbarSize;
    let h;
    try {
      h = Lc.filter(c.inlineDecorations, l, c.minColumn, c.maxColumn);
    } catch {
      h = [];
    }
    const g = this._editor.getLineHeightForPosition(new de(n, 1)), m = e.getTextDirection(n), _ = new d0(!0, !0, c.content, c.continuesWithWrappedLine, c.isBasicASCII, c.containsRTL, 0, c.tokens, h, c.tabSize, c.startVisibleColumn, 1, 1, 1, 500, "none", !0, !0, null, m, d), v = new ww(2e3), w = t2(_, v);
    let E;
    UIe ? E = UIe.createHTML(v.build()) : E = v.build();
    const L = document.createElement("span");
    L.setAttribute(mte, String(t)), L.setAttribute(zIe, ""), L.setAttribute("role", "listitem"), L.tabIndex = 0, L.className = "sticky-line-content", L.classList.add(`stickyLine${n}`), L.style.lineHeight = `${g}px`, L.innerHTML = E;
    const T = document.createElement("span");
    T.setAttribute(mte, String(t)), T.setAttribute($Tt, ""), T.className = "sticky-line-number", T.style.lineHeight = `${g}px`;
    const D = a.contentLeft;
    T.style.width = `${D}px`;
    const N = document.createElement("span");
    u.renderType === 1 || u.renderType === 3 && n % 10 === 0 ? N.innerText = n.toString() : u.renderType === 2 && (N.innerText = Math.abs(n - this._editor.getPosition().lineNumber).toString()), N.className = "sticky-line-number-inner", N.style.width = `${a.lineNumbersWidth}px`, N.style.paddingLeft = `${a.lineNumbersLeft}px`, T.appendChild(N);
    const R = this._renderFoldingIconForLine(o, n);
    R && (T.appendChild(R.domNode), R.domNode.style.left = `${a.lineNumbersWidth + a.lineNumbersLeft}px`, R.domNode.style.lineHeight = `${g}px`), this._editor.applyFontInfo(L), this._editor.applyFontInfo(T), T.style.lineHeight = `${g}px`, L.style.lineHeight = `${g}px`, T.style.height = `${g}px`, L.style.height = `${g}px`;
    const M = new GTt(t, n, L, T, R, w.characterMapping, L.scrollWidth, g);
    return this._updatePosition(M, r, s);
  }
  _updatePosition(e, t, n) {
    var o;
    const r = e.lineDomNode, s = e.lineNumberDomNode;
    if (n) {
      r.style.zIndex = "0", s.style.zIndex = "0";
      const l = `${t + this._lastLineRelativePosition + ((o = e.foldingIcon) != null && o.isCollapsed ? 1 : 0)}px`;
      r.style.top = l, s.style.top = l;
    } else
      r.style.zIndex = "1", s.style.zIndex = "1", r.style.top = `${t}px`, s.style.top = `${t}px`;
    return e;
  }
  _renderFoldingIconForLine(e, t) {
    const n = this._editor.getOption(
      126
      /* EditorOption.showFoldingControls */
    );
    if (!e || n === "never")
      return;
    const r = e.regions, s = r.findRange(t), o = r.getStartLineNumber(s);
    if (!(t === o))
      return;
    const l = r.isCollapsed(s), c = new qTt(l, o, r.getEndLineNumber(s), this._lineHeight);
    return c.setVisible(this._isOnGlyphMargin ? !0 : l || n === "always"), c.domNode.setAttribute($Ie, ""), c;
  }
  getId() {
    return "editor.contrib.stickyScrollWidget";
  }
  getDomNode() {
    return this._rootDomNode;
  }
  getPosition() {
    return {
      preference: 2,
      stackOridinal: 10
    };
  }
  getMinContentWidthInPx() {
    return this._minContentWidthInPx;
  }
  focusLineWithIndex(e) {
    0 <= e && e < this._renderedStickyLines.length && this._renderedStickyLines[e].lineDomNode.focus();
  }
  /**
   * Given a leaf dom node, tries to find the editor position.
   */
  getEditorPositionFromNode(e) {
    if (!e || e.children.length > 0)
      return null;
    const t = this._getRenderedStickyLineFromChildDomNode(e);
    if (!t)
      return null;
    const n = y4(t.characterMapping, e, 0);
    return new de(t.lineNumber, n);
  }
  getLineNumberFromChildDomNode(e) {
    var t;
    return ((t = this._getRenderedStickyLineFromChildDomNode(e)) == null ? void 0 : t.lineNumber) ?? null;
  }
  _getRenderedStickyLineFromChildDomNode(e) {
    const t = this.getLineIndexFromChildDomNode(e);
    return t === null || t < 0 || t >= this._renderedStickyLines.length ? null : this._renderedStickyLines[t];
  }
  /**
   * Given a child dom node, tries to find the line number attribute that was stored in the node.
   * @returns the attribute value or null if none is found.
   */
  getLineIndexFromChildDomNode(e) {
    const t = this._getAttributeValue(e, mte);
    return t ? parseInt(t, 10) : null;
  }
  /**
   * Given a child dom node, tries to find if it is (contained in) a sticky line.
   * @returns a boolean.
   */
  isInStickyLine(e) {
    return this._getAttributeValue(e, zIe) !== void 0;
  }
  /**
   * Given a child dom node, tries to find if this dom node is (contained in) a sticky folding icon.
   * @returns a boolean.
   */
  isInFoldingIconDomNode(e) {
    return this._getAttributeValue(e, $Ie) !== void 0;
  }
  /**
   * Given the dom node, finds if it or its parent sequence contains the given attribute.
   * @returns the attribute value or undefined.
   */
  _getAttributeValue(e, t) {
    for (; e && e !== this._rootDomNode; ) {
      const n = e.getAttribute(t);
      if (n !== null)
        return n;
      e = e.parentElement;
    }
  }
}
class GTt {
  constructor(e, t, n, r, s, o, a, l) {
    this.index = e, this.lineNumber = t, this.lineDomNode = n, this.lineNumberDomNode = r, this.foldingIcon = s, this.characterMapping = o, this.scrollWidth = a, this.height = l;
  }
}
class qTt {
  constructor(e, t, n, r) {
    this.isCollapsed = e, this.foldingStartLine = t, this.foldingEndLine = n, this.dimension = r, this.domNode = document.createElement("div"), this.domNode.style.width = "26px", this.domNode.style.height = `${r}px`, this.domNode.style.lineHeight = `${r}px`, this.domNode.className = qt.asClassName(e ? Tz : Lz);
  }
  setVisible(e) {
    this.domNode.style.cursor = e ? "pointer" : "default", this.domNode.style.opacity = e ? "1" : "0";
  }
}
class JF {
  constructor(e, t) {
    this.startLineNumber = e, this.endLineNumber = t;
  }
}
class jz {
  constructor(e, t, n) {
    this.range = e, this.children = t, this.parent = n;
  }
}
class o8e {
  constructor(e, t, n, r) {
    this.uri = e, this.version = t, this.element = n, this.outlineProviderId = r;
  }
}
var HK = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, m5 = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, e3;
(function(i) {
  i.OUTLINE_MODEL = "outlineModel", i.FOLDING_PROVIDER_MODEL = "foldingProviderModel", i.INDENTATION_MODEL = "indentationModel";
})(e3 || (e3 = {}));
var b1;
(function(i) {
  i[i.VALID = 0] = "VALID", i[i.INVALID = 1] = "INVALID", i[i.CANCELED = 2] = "CANCELED";
})(b1 || (b1 = {}));
let _ae = class extends ge {
  constructor(e, t, n, r) {
    switch (super(), this._editor = e, this._modelProviders = [], this._modelPromise = null, this._updateScheduler = this._register(new Gf(300)), this._updateOperation = this._register(new ke()), this._editor.getOption(
      131
      /* EditorOption.stickyScroll */
    ).defaultModel) {
      case e3.OUTLINE_MODEL:
        this._modelProviders.push(new bae(this._editor, r));
      // fall through
      case e3.FOLDING_PROVIDER_MODEL:
        this._modelProviders.push(new yae(this._editor, t, r));
      // fall through
      case e3.INDENTATION_MODEL:
        this._modelProviders.push(new vae(this._editor, n));
        break;
    }
  }
  dispose() {
    this._modelProviders.forEach((e) => e.dispose()), this._updateOperation.clear(), this._cancelModelPromise(), super.dispose();
  }
  _cancelModelPromise() {
    this._modelPromise && (this._modelPromise.cancel(), this._modelPromise = null);
  }
  async update(e) {
    return this._updateOperation.clear(), this._updateOperation.add({
      dispose: () => {
        this._cancelModelPromise(), this._updateScheduler.cancel();
      }
    }), this._cancelModelPromise(), await this._updateScheduler.trigger(async () => {
      for (const t of this._modelProviders) {
        const { statusPromise: n, modelPromise: r } = t.computeStickyModel(e);
        this._modelPromise = r;
        const s = await n;
        if (this._modelPromise !== r)
          return null;
        switch (s) {
          case b1.CANCELED:
            return this._updateOperation.clear(), null;
          case b1.VALID:
            return t.stickyModel;
        }
      }
      return null;
    }).catch((t) => (fn(t), null));
  }
};
_ae = HK([
  m5(2, xt),
  m5(3, St)
], _ae);
class a8e extends ge {
  constructor(e) {
    super(), this._editor = e, this._stickyModel = null;
  }
  get stickyModel() {
    return this._stickyModel;
  }
  _invalid() {
    return this._stickyModel = null, b1.INVALID;
  }
  computeStickyModel(e) {
    if (e.isCancellationRequested || !this.isProviderValid())
      return { statusPromise: this._invalid(), modelPromise: null };
    const t = Jo((n) => this.createModelFromProvider(n));
    return {
      statusPromise: t.then((n) => this.isModelValid(n) ? e.isCancellationRequested ? b1.CANCELED : (this._stickyModel = this.createStickyModel(e, n), b1.VALID) : this._invalid()).then(void 0, (n) => (fn(n), b1.CANCELED)),
      modelPromise: t
    };
  }
  /**
   * Method which checks whether the model returned by the provider is valid and can be used to compute a sticky model.
   * This method by default returns true.
   * @param model model returned by the provider
   * @returns boolean indicating whether the model is valid
   */
  isModelValid(e) {
    return !0;
  }
  /**
   * Method which checks whether the provider is valid before applying it to find the provider model.
   * This method by default returns true.
   * @returns boolean indicating whether the provider is valid
   */
  isProviderValid() {
    return !0;
  }
}
let bae = class extends a8e {
  constructor(e, t) {
    super(e), this._languageFeaturesService = t;
  }
  createModelFromProvider(e) {
    return ly.create(this._languageFeaturesService.documentSymbolProvider, this._editor.getModel(), e);
  }
  createStickyModel(e, t) {
    var o;
    const { stickyOutlineElement: n, providerID: r } = this._stickyModelFromOutlineModel(t, (o = this._stickyModel) == null ? void 0 : o.outlineProviderId), s = this._editor.getModel();
    return new o8e(s.uri, s.getVersionId(), n, r);
  }
  isModelValid(e) {
    return e && e.children.size > 0;
  }
  _stickyModelFromOutlineModel(e, t) {
    let n;
    if (gi.first(e.children.values()) instanceof q6e) {
      const a = gi.find(e.children.values(), (l) => l.id === t);
      if (a)
        n = a.children;
      else {
        let l = "", c = -1, u;
        for (const [d, h] of e.children.entries()) {
          const g = this._findSumOfRangesOfGroup(h);
          g > c && (u = h, c = g, l = h.id);
        }
        t = l, n = u.children;
      }
    } else
      n = e.children;
    const r = [], s = Array.from(n.values()).sort((a, l) => {
      const c = new JF(a.symbol.range.startLineNumber, a.symbol.range.endLineNumber), u = new JF(l.symbol.range.startLineNumber, l.symbol.range.endLineNumber);
      return this._comparator(c, u);
    });
    for (const a of s)
      r.push(this._stickyModelFromOutlineElement(a, a.symbol.selectionRange.startLineNumber));
    return {
      stickyOutlineElement: new jz(void 0, r, void 0),
      providerID: t
    };
  }
  _stickyModelFromOutlineElement(e, t) {
    const n = [];
    for (const s of e.children.values())
      if (s.symbol.selectionRange.startLineNumber !== s.symbol.range.endLineNumber)
        if (s.symbol.selectionRange.startLineNumber !== t)
          n.push(this._stickyModelFromOutlineElement(s, s.symbol.selectionRange.startLineNumber));
        else
          for (const o of s.children.values())
            n.push(this._stickyModelFromOutlineElement(o, s.symbol.selectionRange.startLineNumber));
    n.sort((s, o) => this._comparator(s.range, o.range));
    const r = new JF(e.symbol.selectionRange.startLineNumber, e.symbol.range.endLineNumber);
    return new jz(r, n, void 0);
  }
  _comparator(e, t) {
    return e.startLineNumber !== t.startLineNumber ? e.startLineNumber - t.startLineNumber : t.endLineNumber - e.endLineNumber;
  }
  _findSumOfRangesOfGroup(e) {
    let t = 0;
    for (const n of e.children.values())
      t += this._findSumOfRangesOfGroup(n);
    return e instanceof zoe ? t + e.symbol.range.endLineNumber - e.symbol.selectionRange.startLineNumber : t;
  }
};
bae = HK([
  m5(1, St)
], bae);
class l8e extends a8e {
  constructor(e) {
    super(e), this._foldingLimitReporter = this._register(new V6e(e));
  }
  createStickyModel(e, t) {
    const n = this._fromFoldingRegions(t), r = this._editor.getModel();
    return new o8e(r.uri, r.getVersionId(), n, void 0);
  }
  isModelValid(e) {
    return e !== null;
  }
  _fromFoldingRegions(e) {
    const t = e.length, n = [], r = new jz(void 0, [], void 0);
    for (let s = 0; s < t; s++) {
      const o = e.getParentIndex(s);
      let a;
      o !== -1 ? a = n[o] : a = r;
      const l = new jz(new JF(e.getStartLineNumber(s), e.getEndLineNumber(s) + 1), [], a);
      a.children.push(l), n.push(l);
    }
    return r;
  }
}
let vae = class extends l8e {
  constructor(e, t) {
    super(e), this._languageConfigurationService = t, this.provider = this._register(new Npe(e.getModel(), this._languageConfigurationService, this._foldingLimitReporter));
  }
  async createModelFromProvider(e) {
    return this.provider.compute(e);
  }
};
vae = HK([
  m5(1, Ls)
], vae);
let yae = class extends l8e {
  constructor(e, t, n) {
    super(e), this._languageFeaturesService = n, this.provider = this._register(new er()), this._register(this._languageFeaturesService.foldingRangeProvider.onDidChange(() => {
      this._updateProvider(e, t);
    })), this._updateProvider(e, t);
  }
  _updateProvider(e, t) {
    const n = gw.getFoldingRangeProviders(this._languageFeaturesService, e.getModel());
    n.length !== 0 && (this.provider.value = new Rpe(e.getModel(), n, t, this._foldingLimitReporter, void 0));
  }
  isProviderValid() {
    return this.provider !== void 0;
  }
  async createModelFromProvider(e) {
    var t;
    return ((t = this.provider.value) == null ? void 0 : t.compute(e)) ?? null;
  }
};
yae = HK([
  m5(2, St)
], yae);
var KTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, jIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class YTt {
  constructor(e, t, n, r) {
    this.startLineNumber = e, this.endLineNumber = t, this.top = n, this.height = r;
  }
}
let Cae = class extends ge {
  constructor(e, t, n) {
    super(), this._languageFeaturesService = t, this._languageConfigurationService = n, this._onDidChangeStickyScroll = this._register(new he()), this.onDidChangeStickyScroll = this._onDidChangeStickyScroll.event, this._model = null, this._cts = null, this._stickyModelProvider = null, this._editor = e, this._sessionStore = this._register(new ke()), this._updateSoon = this._register(new mr(() => this.update(), 50)), this._register(this._editor.onDidChangeConfiguration((r) => {
      r.hasChanged(
        131
        /* EditorOption.stickyScroll */
      ) && this.readConfiguration();
    })), this.readConfiguration();
  }
  /**
   * Read and apply the sticky scroll configuration.
   */
  readConfiguration() {
    this._sessionStore.clear(), this._editor.getOption(
      131
      /* EditorOption.stickyScroll */
    ).enabled && (this._sessionStore.add(this._editor.onDidChangeModel(() => {
      this._model = null, this.updateStickyModelProvider(), this._onDidChangeStickyScroll.fire(), this.update();
    })), this._sessionStore.add(this._editor.onDidChangeHiddenAreas(() => this.update())), this._sessionStore.add(this._editor.onDidChangeModelContent(() => this._updateSoon.schedule())), this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(() => this.update())), this._sessionStore.add(Et(() => {
      var t;
      (t = this._stickyModelProvider) == null || t.dispose(), this._stickyModelProvider = null;
    })), this.updateStickyModelProvider(), this.update());
  }
  /**
   * Get the version ID of the sticky model.
   */
  getVersionId() {
    var e;
    return (e = this._model) == null ? void 0 : e.version;
  }
  /**
   * Update the sticky model provider.
   */
  updateStickyModelProvider() {
    var e;
    (e = this._stickyModelProvider) == null || e.dispose(), this._stickyModelProvider = null, this._editor.hasModel() && (this._stickyModelProvider = new _ae(this._editor, () => this._updateSoon.schedule(), this._languageConfigurationService, this._languageFeaturesService));
  }
  /**
   * Update the sticky line candidates.
   */
  async update() {
    var e;
    (e = this._cts) == null || e.dispose(!0), this._cts = new Ss(), await this.updateStickyModel(this._cts.token), this._onDidChangeStickyScroll.fire();
  }
  /**
   * Update the sticky model based on the current editor state.
   */
  async updateStickyModel(e) {
    if (!this._editor.hasModel() || !this._stickyModelProvider || this._editor.getModel().isTooLargeForTokenization()) {
      this._model = null;
      return;
    }
    const t = await this._stickyModelProvider.update(e);
    e.isCancellationRequested || (this._model = t);
  }
  /**
   * Get sticky line candidates intersecting a given range.
   */
  getCandidateStickyLinesIntersecting(e) {
    var n;
    if (!((n = this._model) != null && n.element))
      return [];
    const t = [];
    return this.getCandidateStickyLinesIntersectingFromStickyModel(e, this._model.element, t, 0, 0, -1), this.filterHiddenRanges(t);
  }
  /**
   * Get sticky line candidates intersecting a given range from the sticky model.
   */
  getCandidateStickyLinesIntersectingFromStickyModel(e, t, n, r, s, o) {
    const a = this._editor.getModel();
    if (!a || t.children.length === 0)
      return;
    let l = o;
    const c = [];
    for (let h = 0; h < t.children.length; h++) {
      const g = t.children[h];
      g.range && c.push(g.range.startLineNumber);
    }
    const u = this.updateIndex(AV(c, e.startLineNumber, (h, g) => h - g)), d = this.updateIndex(AV(c, e.endLineNumber, (h, g) => h - g));
    for (let h = u; h <= d; h++) {
      const g = t.children[h];
      if (!g || !g.range)
        continue;
      const { startLineNumber: m, endLineNumber: _ } = g.range;
      if (_ > m + 1 && e.startLineNumber <= _ + 1 && m - 1 <= e.endLineNumber && m !== l && a.isValidRange(new z(m, 1, _, 1))) {
        l = m;
        const v = this._editor.getLineHeightForPosition(new de(m, 1));
        n.push(new YTt(m, _ - 1, s, v)), this.getCandidateStickyLinesIntersectingFromStickyModel(e, g, n, r + 1, s + v, m);
      }
    }
  }
  /**
   * Filter out sticky line candidates that are within hidden ranges.
   */
  filterHiddenRanges(e) {
    var n;
    const t = (n = this._editor._getViewModel()) == null ? void 0 : n.getHiddenAreas();
    return t ? e.filter((r) => !t.some((s) => r.startLineNumber >= s.startLineNumber && r.endLineNumber <= s.endLineNumber + 1)) : e;
  }
  /**
   * Update the binary search index.
   */
  updateIndex(e) {
    return e === -1 ? 0 : e < 0 ? -e - 2 : e;
  }
};
Cae = KTt([
  jIe(1, St),
  jIe(2, Ls)
], Cae);
var XTt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, DI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, wae, DL;
let Kg = (DL = class extends ge {
  constructor(e, t, n, r, s, o, a) {
    super(), this._editor = e, this._contextMenuService = t, this._languageFeaturesService = n, this._instaService = r, this._contextKeyService = a, this._sessionStore = new ke(), this._maxStickyLines = Number.MAX_SAFE_INTEGER, this._candidateDefinitionsLength = -1, this._focusedStickyElementIndex = -1, this._enabled = !1, this._focused = !1, this._positionRevealed = !1, this._onMouseDown = !1, this._endLineNumbers = [], this._mouseTarget = null, this._onDidChangeStickyScrollHeight = this._register(new he()), this.onDidChangeStickyScrollHeight = this._onDidChangeStickyScrollHeight.event, this._stickyScrollWidget = new jTt(this._editor), this._stickyLineCandidateProvider = new Cae(this._editor, n, s), this._register(this._stickyScrollWidget), this._register(this._stickyLineCandidateProvider), this._widgetState = QF.Empty;
    const l = this._stickyScrollWidget.getDomNode();
    this._register(this._editor.onDidChangeLineHeight((u) => {
      u.changes.forEach((d) => {
        const h = d.lineNumber;
        this._widgetState.startLineNumbers.includes(h) && this._renderStickyScroll(h);
      });
    })), this._register(this._editor.onDidChangeFont((u) => {
      u.changes.forEach((d) => {
        const h = d.lineNumber;
        this._widgetState.startLineNumbers.includes(h) && this._renderStickyScroll(h);
      });
    })), this._register(this._editor.onDidChangeConfiguration((u) => {
      this._readConfigurationChange(u);
    })), this._register(Ce(l, Xe.CONTEXT_MENU, async (u) => {
      this._onContextMenu(At(l), u);
    })), this._stickyScrollFocusedContextKey = se.stickyScrollFocused.bindTo(this._contextKeyService), this._stickyScrollVisibleContextKey = se.stickyScrollVisible.bindTo(this._contextKeyService);
    const c = this._register(qf(l));
    this._register(c.onDidBlur((u) => {
      this._positionRevealed === !1 && l.clientHeight === 0 ? (this._focusedStickyElementIndex = -1, this.focus()) : this._disposeFocusStickyScrollStore();
    })), this._register(c.onDidFocus((u) => {
      this.focus();
    })), this._registerMouseListeners(), this._register(Ce(l, Xe.MOUSE_DOWN, (u) => {
      this._onMouseDown = !0;
    })), this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight((u) => {
      this._onDidChangeStickyScrollHeight.fire(u);
    })), this._onDidResize(), this._readConfiguration();
  }
  get stickyScrollWidgetHeight() {
    return this._stickyScrollWidget.height;
  }
  static get(e) {
    return e.getContribution(wae.ID);
  }
  _disposeFocusStickyScrollStore() {
    var e;
    this._stickyScrollFocusedContextKey.set(!1), (e = this._focusDisposableStore) == null || e.dispose(), this._focused = !1, this._positionRevealed = !1, this._onMouseDown = !1;
  }
  isFocused() {
    return this._focused;
  }
  focus() {
    if (this._onMouseDown) {
      this._onMouseDown = !1, this._editor.focus();
      return;
    }
    this._stickyScrollFocusedContextKey.get() !== !0 && (this._focused = !0, this._focusDisposableStore = new ke(), this._stickyScrollFocusedContextKey.set(!0), this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumbers.length - 1, this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex));
  }
  focusNext() {
    this._focusedStickyElementIndex < this._stickyScrollWidget.lineNumberCount - 1 && this._focusNav(!0);
  }
  focusPrevious() {
    this._focusedStickyElementIndex > 0 && this._focusNav(!1);
  }
  selectEditor() {
    this._editor.focus();
  }
  // True is next, false is previous
  _focusNav(e) {
    this._focusedStickyElementIndex = e ? this._focusedStickyElementIndex + 1 : this._focusedStickyElementIndex - 1, this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);
  }
  goToFocused() {
    const e = this._stickyScrollWidget.lineNumbers;
    this._disposeFocusStickyScrollStore(), this._revealPosition({ lineNumber: e[this._focusedStickyElementIndex], column: 1 });
  }
  _revealPosition(e) {
    this._reveaInEditor(e, () => this._editor.revealPosition(e));
  }
  _revealLineInCenterIfOutsideViewport(e) {
    this._reveaInEditor(e, () => this._editor.revealLineInCenterIfOutsideViewport(
      e.lineNumber,
      0
      /* ScrollType.Smooth */
    ));
  }
  _reveaInEditor(e, t) {
    this._focused && this._disposeFocusStickyScrollStore(), this._positionRevealed = !0, t(), this._editor.setSelection(z.fromPositions(e)), this._editor.focus();
  }
  _registerMouseListeners() {
    const e = this._register(new ke()), t = this._register(new SK(this._editor, {
      extractLineNumberFromMouseEvent: (s) => {
        const o = this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);
        return o ? o.lineNumber : 0;
      }
    })), n = (s) => {
      if (!this._editor.hasModel() || s.target.type !== 12 || s.target.detail !== this._stickyScrollWidget.getId())
        return null;
      const o = s.target.element;
      if (!o || o.innerText !== o.innerHTML)
        return null;
      const a = this._stickyScrollWidget.getEditorPositionFromNode(o);
      return a ? {
        range: new z(a.lineNumber, a.column, a.lineNumber, a.column + o.innerText.length),
        textElement: o
      } : null;
    }, r = this._stickyScrollWidget.getDomNode();
    this._register(vo(r, Xe.CLICK, (s) => {
      if (s.ctrlKey || s.altKey || s.metaKey || !s.leftButton)
        return;
      if (s.shiftKey) {
        const c = this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);
        if (c === null)
          return;
        const u = new de(this._endLineNumbers[c], 1);
        this._revealLineInCenterIfOutsideViewport(u);
        return;
      }
      if (this._stickyScrollWidget.isInFoldingIconDomNode(s.target)) {
        const c = this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);
        this._toggleFoldingRegionForLine(c);
        return;
      }
      if (!this._stickyScrollWidget.isInStickyLine(s.target))
        return;
      let l = this._stickyScrollWidget.getEditorPositionFromNode(s.target);
      if (!l) {
        const c = this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);
        if (c === null)
          return;
        l = new de(c, 1);
      }
      this._revealPosition(l);
    })), this._register(Ce(fr, Xe.MOUSE_MOVE, (s) => {
      this._mouseTarget = s.target, this._onMouseMoveOrKeyDown(s);
    })), this._register(Ce(fr, Xe.KEY_DOWN, (s) => {
      this._onMouseMoveOrKeyDown(s);
    })), this._register(Ce(fr, Xe.KEY_UP, () => {
      this._showEndForLine !== void 0 && (this._showEndForLine = void 0, this._renderStickyScroll());
    })), this._register(t.onMouseMoveOrRelevantKeyDown(([s, o]) => {
      const a = n(s);
      if (!a || !s.hasTriggerModifier || !this._editor.hasModel()) {
        e.clear();
        return;
      }
      const { range: l, textElement: c } = a;
      if (!l.equalsRange(this._stickyRangeProjectedOnEditor))
        this._stickyRangeProjectedOnEditor = l, e.clear();
      else if (c.style.textDecoration === "underline")
        return;
      const u = new Ss();
      e.add(Et(() => u.dispose(!0)));
      let d;
      GB(this._languageFeaturesService.definitionProvider, this._editor.getModel(), new de(l.startLineNumber, l.startColumn + 1), !1, u.token).then(((h) => {
        if (!u.token.isCancellationRequested)
          if (h.length !== 0) {
            this._candidateDefinitionsLength = h.length;
            const g = c;
            d !== g ? (e.clear(), d = g, d.style.textDecoration = "underline", e.add(Et(() => {
              d.style.textDecoration = "none";
            }))) : d || (d = g, d.style.textDecoration = "underline", e.add(Et(() => {
              d.style.textDecoration = "none";
            })));
          } else
            e.clear();
      }));
    })), this._register(t.onCancel(() => {
      e.clear();
    })), this._register(t.onExecute(async (s) => {
      if (s.target.type !== 12 || s.target.detail !== this._stickyScrollWidget.getId())
        return;
      const o = this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);
      o && (!this._editor.hasModel() || !this._stickyRangeProjectedOnEditor || (this._candidateDefinitionsLength > 1 && (this._focused && this._disposeFocusStickyScrollStore(), this._revealPosition({ lineNumber: o.lineNumber, column: 1 })), this._instaService.invokeFunction(E6e, s, this._editor, { uri: this._editor.getModel().uri, range: this._stickyRangeProjectedOnEditor })));
    }));
  }
  _onContextMenu(e, t) {
    const n = new vl(e, t);
    this._contextMenuService.showContextMenu({
      menuId: wt.StickyScrollContext,
      getAnchor: () => n
    });
  }
  _onMouseMoveOrKeyDown(e) {
    if (!e.shiftKey || !this._mouseTarget || !eo(this._mouseTarget))
      return;
    const t = this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);
    t === null || this._showEndForLine === t || (this._showEndForLine = t, this._renderStickyScroll());
  }
  _toggleFoldingRegionForLine(e) {
    if (!this._foldingModel || e === null)
      return;
    const t = this._stickyScrollWidget.getRenderedStickyLine(e), n = t == null ? void 0 : t.foldingIcon;
    if (!n)
      return;
    kpe(this._foldingModel, 1, [e]), n.isCollapsed = !n.isCollapsed;
    const r = (n.isCollapsed ? this._editor.getTopForLineNumber(n.foldingEndLine) : this._editor.getTopForLineNumber(n.foldingStartLine)) - this._editor.getOption(
      75
      /* EditorOption.lineHeight */
    ) * t.index + 1;
    this._editor.setScrollTop(r), this._renderStickyScroll(e);
  }
  _readConfiguration() {
    const e = this._editor.getOption(
      131
      /* EditorOption.stickyScroll */
    );
    if (e.enabled === !1) {
      this._editor.removeOverlayWidget(this._stickyScrollWidget), this._resetState(), this._sessionStore.clear(), this._enabled = !1;
      return;
    } else e.enabled && !this._enabled && (this._editor.addOverlayWidget(this._stickyScrollWidget), this._sessionStore.add(this._editor.onDidScrollChange((n) => {
      n.scrollTopChanged && (this._showEndForLine = void 0, this._renderStickyScroll());
    })), this._sessionStore.add(this._editor.onDidLayoutChange(() => this._onDidResize())), this._sessionStore.add(this._editor.onDidChangeModelTokens((n) => this._onTokensChange(n))), this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(() => {
      this._showEndForLine = void 0, this._renderStickyScroll();
    })), this._enabled = !0);
    this._editor.getOption(
      76
      /* EditorOption.lineNumbers */
    ).renderType === 2 && this._sessionStore.add(this._editor.onDidChangeCursorPosition(() => {
      this._showEndForLine = void 0, this._renderStickyScroll(0);
    }));
  }
  _readConfigurationChange(e) {
    (e.hasChanged(
      131
      /* EditorOption.stickyScroll */
    ) || e.hasChanged(
      81
      /* EditorOption.minimap */
    ) || e.hasChanged(
      75
      /* EditorOption.lineHeight */
    ) || e.hasChanged(
      126
      /* EditorOption.showFoldingControls */
    ) || e.hasChanged(
      76
      /* EditorOption.lineNumbers */
    )) && this._readConfiguration(), (e.hasChanged(
      76
      /* EditorOption.lineNumbers */
    ) || e.hasChanged(
      52
      /* EditorOption.folding */
    ) || e.hasChanged(
      126
      /* EditorOption.showFoldingControls */
    )) && this._renderStickyScroll(0);
  }
  _needsUpdate(e) {
    const t = this._stickyScrollWidget.getCurrentLines();
    for (const n of t)
      for (const r of e.ranges)
        if (n >= r.fromLineNumber && n <= r.toLineNumber)
          return !0;
    return !1;
  }
  _onTokensChange(e) {
    this._needsUpdate(e) && this._renderStickyScroll(0);
  }
  _onDidResize() {
    const t = this._editor.getLayoutInfo().height / this._editor.getOption(
      75
      /* EditorOption.lineHeight */
    );
    this._maxStickyLines = Math.round(t * 0.25), this._renderStickyScroll(0);
  }
  async _renderStickyScroll(e) {
    const t = this._editor.getModel();
    if (!t || t.isTooLargeForTokenization()) {
      this._resetState();
      return;
    }
    const n = this._updateAndGetMinRebuildFromLine(e), r = this._stickyLineCandidateProvider.getVersionId();
    if (r === void 0 || r === t.getVersionId())
      if (!this._focused)
        await this._updateState(n);
      else if (this._focusedStickyElementIndex === -1)
        await this._updateState(n), this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumberCount - 1, this._focusedStickyElementIndex !== -1 && this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);
      else {
        const o = this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];
        await this._updateState(n), this._stickyScrollWidget.lineNumberCount === 0 ? this._focusedStickyElementIndex = -1 : (this._stickyScrollWidget.lineNumbers.includes(o) || (this._focusedStickyElementIndex = this._stickyScrollWidget.lineNumberCount - 1), this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex));
      }
  }
  _updateAndGetMinRebuildFromLine(e) {
    if (e !== void 0) {
      const t = this._minRebuildFromLine !== void 0 ? this._minRebuildFromLine : 1 / 0;
      this._minRebuildFromLine = Math.min(e, t);
    }
    return this._minRebuildFromLine;
  }
  async _updateState(e) {
    var n;
    this._minRebuildFromLine = void 0, this._foldingModel = await ((n = gw.get(this._editor)) == null ? void 0 : n.getFoldingModel()) ?? void 0, this._widgetState = this.findScrollWidgetState();
    const t = this._widgetState.startLineNumbers.length > 0;
    this._stickyScrollVisibleContextKey.set(t), this._stickyScrollWidget.setState(this._widgetState, this._foldingModel, e);
  }
  async _resetState() {
    this._minRebuildFromLine = void 0, this._foldingModel = void 0, this._widgetState = QF.Empty, this._stickyScrollVisibleContextKey.set(!1), this._stickyScrollWidget.setState(void 0, void 0);
  }
  findScrollWidgetState() {
    const e = Math.min(this._maxStickyLines, this._editor.getOption(
      131
      /* EditorOption.stickyScroll */
    ).maxLineCount), t = this._editor.getScrollTop();
    let n = 0;
    const r = [], s = [], o = this._editor.getVisibleRanges();
    if (o.length !== 0) {
      const a = new JF(o[0].startLineNumber, o[o.length - 1].endLineNumber), l = this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(a);
      for (const c of l) {
        const u = c.startLineNumber, d = c.endLineNumber, h = c.top, g = h + c.height, m = this._editor.getTopForLineNumber(u) - t, _ = this._editor.getBottomForLineNumber(d) - t;
        if (h > m && h <= _ && (r.push(u), s.push(d + 1), g > _ && (n = _ - g)), r.length === e)
          break;
      }
    }
    return this._endLineNumbers = s, new QF(r, s, n, this._showEndForLine);
  }
  dispose() {
    super.dispose(), this._sessionStore.dispose();
  }
}, wae = DL, DL.ID = "store.contrib.stickyScrollController", DL);
Kg = wae = XTt([
  DI(1, Qh),
  DI(2, St),
  DI(3, xt),
  DI(4, Ls),
  DI(5, ig),
  DI(6, Jt)
], Kg);
const t3 = ie("inlineEdit.originalBackground", hn(l1, 0.2), S(1210, "Background color for the original text in inline edits."), !0), c8e = ie("inlineEdit.modifiedBackground", hn(fx, 0.3), S(1211, "Background color for the modified text in inline edits."), !0);
ie("inlineEdit.originalChangedLineBackground", hn(l1, 0.8), S(1212, "Background color for the changed lines in the original text of inline edits."), !0);
const ZTt = ie("inlineEdit.originalChangedTextBackground", hn(l1, 0.8), S(1213, "Overlay color for the changed text in the original text of inline edits."), !0), QTt = ie("inlineEdit.modifiedChangedLineBackground", {
  light: hn(M7, 0.7),
  dark: hn(M7, 0.7),
  hcDark: M7,
  hcLight: M7
}, S(1214, "Background color for the changed lines in the modified text of inline edits."), !0), JTt = ie("inlineEdit.modifiedChangedTextBackground", hn(fx, 0.7), S(1215, "Overlay color for the changed text in the modified text of inline edits."), !0), ekt = ie("inlineEdit.gutterIndicator.primaryForeground", Xq, S(1216, "Foreground color for the primary inline edit gutter indicator.")), _N = ie("inlineEdit.gutterIndicator.primaryBorder", gx, S(1217, "Border color for the primary inline edit gutter indicator.")), u8e = ie("inlineEdit.gutterIndicator.primaryBackground", {
  light: hn(_N, 0.5),
  dark: hn(_N, 0.4),
  hcDark: hn(_N, 0.4),
  hcLight: hn(_N, 0.5)
}, S(1218, "Background color for the primary inline edit gutter indicator.")), tkt = ie("inlineEdit.gutterIndicator.secondaryForeground", HFe, S(1219, "Foreground color for the secondary inline edit gutter indicator.")), d8e = ie("inlineEdit.gutterIndicator.secondaryBorder", nU, S(1220, "Border color for the secondary inline edit gutter indicator.")), h8e = ie("inlineEdit.gutterIndicator.secondaryBackground", d8e, S(1221, "Background color for the secondary inline edit gutter indicator.")), nkt = ie("inlineEdit.gutterIndicator.successfulForeground", Xq, S(1222, "Foreground color for the successful inline edit gutter indicator.")), f8e = ie("inlineEdit.gutterIndicator.successfulBorder", gx, S(1223, "Border color for the successful inline edit gutter indicator.")), g8e = ie("inlineEdit.gutterIndicator.successfulBackground", f8e, S(1224, "Background color for the successful inline edit gutter indicator.")), ikt = ie("inlineEdit.gutterIndicator.background", {
  hcDark: hn("tab.inactiveBackground", 0.5),
  hcLight: hn("tab.inactiveBackground", 0.5),
  dark: hn("tab.inactiveBackground", 0.5),
  light: "#5f5f5f18"
}, S(1225, "Background color for the inline edit gutter indicator.")), eF = ie("inlineEdit.originalBorder", {
  light: l1,
  dark: l1,
  hcDark: l1,
  hcLight: l1
}, S(1226, "Border color for the original text in inline edits.")), tF = ie("inlineEdit.modifiedBorder", {
  light: ju(fx, 0.6),
  dark: fx,
  hcDark: fx,
  hcLight: fx
}, S(1227, "Border color for the modified text in inline edits.")), rkt = ie("inlineEdit.tabWillAcceptModifiedBorder", {
  light: ju(tF, 0),
  dark: ju(tF, 0),
  hcDark: ju(tF, 0),
  hcLight: ju(tF, 0)
}, S(1228, "Modified border color for the inline edits widget when tab will accept it.")), skt = ie("inlineEdit.tabWillAcceptOriginalBorder", {
  light: ju(eF, 0),
  dark: ju(eF, 0),
  hcDark: ju(eF, 0),
  hcLight: ju(eF, 0)
}, S(1229, "Original border color for the inline edits widget over the original text when tab will accept it."));
function _5(i) {
  return i.map((e) => e === Kl.Accept ? rkt : tF);
}
function WK(i) {
  return i.map((e) => e === Kl.Accept ? skt : eF);
}
function Ef(i, e) {
  let t;
  typeof i == "string" ? t = _te(i, e) : t = i.map((r, s) => _te(r, e).read(s));
  const n = _te(yo, e);
  return t.map((r, s) => (
    /** @description makeOpaque */
    r.makeOpaque(n.read(s))
  ));
}
function _te(i, e) {
  return CPe({
    owner: { observeColor: i },
    equalsFn: (t, n) => t.equals(n),
    debugName: () => `observeColor(${i})`
  }, e.onDidColorThemeChange, () => {
    const t = e.getColorTheme().getColor(i);
    if (!t)
      throw new Wt(`Missing color: ${i}`);
    return t;
  });
}
function v1(i, e, t) {
  i.layoutInfo.read(t), i.value.read(t);
  const n = i.model.read(t);
  if (!n)
    return 0;
  let r = 0;
  i.scrollTop.read(t);
  for (let o = e.startLineNumber; o < e.endLineNumberExclusive; o++) {
    const a = n.getLineMaxColumn(o);
    let l = i.editor.getOffsetForColumn(o, a);
    if (l === -1) {
      const c = i.editor.getOption(
        59
        /* EditorOption.fontInfo */
      ).typicalHalfwidthCharacterWidth;
      l = a * c;
    }
    r = Math.max(r, l);
  }
  const s = e.mapToLineArray((o) => n.getLineContent(o));
  return r < 5 && s.some((o) => o.length > 0) && n.uri.scheme !== "file" && console.error("unexpected width"), r;
}
function okt(i, e, t) {
  return i.layoutInfo.read(t), i.value.read(t), i.model.read(t) ? (i.scrollTop.read(t), i.editor.getOffsetForColumn(e.lineNumber, e.column)) : 0;
}
function Wpe(i, e, t, n) {
  const r = n.getModel();
  if (!r)
    return { prefixTrim: 0, prefixLeftOffset: 0 };
  const s = i.map((d) => d.isSingleLine() ? d.startColumn - 1 : 0), o = e.mapToLineArray((d) => Mre(r.getLineContent(d))), a = t.filter((d) => d !== "").map((d) => Mre(d)), l = Math.min(...s, ...o, ...a);
  let c;
  if (r.getLineIndentColumn(e.startLineNumber) >= l + 1)
    c = n.getOffsetForColumn(e.startLineNumber, l + 1);
  else if (t.length > 0)
    c = Vpe(t[0].slice(0, l), n, r);
  else
    return { prefixTrim: 0, prefixLeftOffset: 0 };
  return { prefixTrim: l, prefixLeftOffset: c };
}
function Vpe(i, e, t) {
  const n = e.getOption(
    59
    /* EditorOption.fontInfo */
  ).typicalHalfwidthCharacterWidth, r = t.getOptions().tabSize * n, s = i.split("	").length - 1;
  return (i.length - s) * n + s * r;
}
function Upe(i) {
  const e = i.layoutInfoContentLeft, t = Ie({ name: "editor.validOverlay.width" }, (r) => {
    const s = i.layoutInfoMinimap.read(r).minimapLeft !== 0, o = i.layoutInfoWidth.read(r) - e.read(r);
    if (s) {
      const a = i.layoutInfoMinimap.read(r).minimapWidth + i.layoutInfoVerticalScrollbarWidth.read(r);
      return o - a;
    }
    return o;
  }), n = Ie({ name: "editor.validOverlay.height" }, (r) => i.layoutInfoHeight.read(r) + i.contentHeight.read(r));
  return Ie({ name: "editor.validOverlay" }, (r) => xr.fromLeftTopWidthHeight(e.read(r), 0, t.read(r), n.read(r)));
}
function akt(i, e) {
  const t = [];
  for (const n of i) {
    const r = e.mapRange(n.modifiedRange);
    t.push(new nu(n.originalRange, r));
  }
  return t;
}
function bte(...i) {
  return i.filter((e) => typeof e == "string").join(" ");
}
function lkt(i, e) {
  return new z(e.lineNumber, e.column + i.start, e.lineNumber, e.column + i.endExclusive);
}
function ckt(i, e) {
  let t = 0;
  e: for (let n = 0, r = i.length; n < r; n++)
    switch (i.charCodeAt(n)) {
      case 9:
        t += e;
        break;
      case 32:
        t++;
        break;
      default:
        break e;
    }
  return t - t % e;
}
function ukt(i, e, t) {
  let n = e - e % t, r = 0;
  for (; r < i.length && n !== 0; r++)
    switch (i.charCodeAt(r)) {
      case 9:
        n -= t;
        break;
      case 32:
        n--;
        break;
      default:
        throw new Wt("Unexpected character found while calculating indent length");
    }
  return r;
}
function dkt(i, e, t) {
  const n = $d(i), r = [], s = S3e(e.mapToLineArray((o) => ckt(n[o - 1], t)), Hd);
  return e.forEach((o) => {
    const a = ukt(n[o - 1], s, t);
    r.push(new Wo(lkt(new Tt(0, a), new de(o, 1)), ""));
  }), new Md(r);
}
class Sae {
  constructor() {
    this._data = "";
  }
  moveTo(e) {
    return this._data += `M ${e.x} ${e.y} `, this;
  }
  lineTo(e) {
    return this._data += `L ${e.x} ${e.y} `, this;
  }
  build() {
    return this._data;
  }
}
function Sb(i) {
  const e = u0(void 0, (t, n) => i.read(t) || n);
  return pl({
    debugName: () => `${i.debugName}.mapOutFalsy`
  }, (t) => {
    if (e.read(t), !!i.read(t))
      return e;
  });
}
function Pf(i) {
  return {
    left: Ie({ name: "editor.validOverlay.left" }, (e) => (
      /** @description left */
      i(e).left
    )),
    top: Ie({ name: "editor.validOverlay.top" }, (e) => (
      /** @description top */
      i(e).top
    )),
    width: Ie({ name: "editor.validOverlay.width" }, (e) => (
      /** @description width */
      i(e).right - i(e).left
    )),
    height: Ie({ name: "editor.validOverlay.height" }, (e) => (
      /** @description height */
      i(e).bottom - i(e).top
    ))
  };
}
var hkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, vte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Eae = class {
  constructor(e, t, n, r, s, o) {
    this._model = e, this._close = t, this._editorObs = n, this._contextKeyService = r, this._keybindingService = s, this._commandService = o, this._inlineEditsShowCollapsed = this._editorObs.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).map((a) => a.edits.showCollapsed);
  }
  toDisposableLiveElement() {
    return this._createHoverContent().toDisposableLiveElement();
  }
  _createHoverContent() {
    const e = Qt("active", void 0), t = (d) => ({
      title: d.title,
      icon: d.icon,
      keybinding: typeof d.commandId == "string" ? this._getKeybinding(d.commandArgs ? void 0 : d.commandId) : Ie(this, (h) => typeof d.commandId == "string" ? void 0 : this._getKeybinding(d.commandArgs ? void 0 : d.commandId.read(h)).read(h)),
      isActive: e.map((h) => h === d.id),
      onHoverChange: (h) => e.set(h ? d.id : void 0, void 0),
      onAction: () => (this._close(!0), this._commandService.executeCommand(typeof d.commandId == "string" ? d.commandId : d.commandId.get(), ...d.commandArgs ?? []))
    }), n = gkt(this._model.displayName), r = II(t({
      id: "gotoAndAccept",
      title: `${S(1203, "Go To")} / ${S(1204, "Accept")}`,
      icon: Pe.check,
      commandId: t5
    })), s = II(t({
      id: "reject",
      title: S(1205, "Reject"),
      icon: Pe.close,
      commandId: CBe
    })), o = this._model.extensionCommands.map((d, h) => II(t({
      id: d.command.id + "_" + h,
      title: d.command.title,
      icon: d.icon ?? Pe.symbolEvent,
      commandId: d.command.id,
      commandArgs: d.command.arguments
    }))), a = this._inlineEditsShowCollapsed.map((d) => II(t(d ? {
      id: "showExpanded",
      title: S(1206, "Show Expanded"),
      icon: Pe.expandAll,
      commandId: Xse
    } : {
      id: "showCollapsed",
      title: S(1207, "Show Collapsed"),
      icon: Pe.collapseAll,
      commandId: Xse
    }))), l = II(t({
      id: "settings",
      title: S(1208, "Settings"),
      icon: Pe.gear,
      commandId: "workbench.action.openSettings",
      commandArgs: ["@tag:nextEditSuggestions"]
    })), c = this._model.action ? [this._model.action] : [], u = c.length > 0 ? pkt(c.map((d) => ({
      id: d.id,
      label: d.title + "...",
      enabled: !0,
      run: () => this._commandService.executeCommand(d.id, ...d.arguments ?? []),
      class: void 0,
      tooltip: d.tooltip ?? d.title
    })), {
      hoverDelegate: Hyt
      /* unable to show hover inside another hover */
    }) : void 0;
    return fkt([
      n,
      r,
      s,
      a,
      o.length ? GIe() : void 0,
      l,
      ...o,
      u ? GIe() : void 0,
      u
    ]);
  }
  _getKeybinding(e) {
    return e ? ji(this._contextKeyService.onDidChangeContext, () => this._keybindingService.lookupKeybinding(e)) : Br(void 0);
  }
};
Eae = hkt([
  vte(3, Jt),
  vte(4, Fi),
  vte(5, jr)
], Eae);
function fkt(i) {
  return Tn.div({
    class: "content",
    style: {
      margin: 4,
      minWidth: 180
    }
  }, i);
}
function gkt(i) {
  return Tn.div({
    class: "header",
    style: {
      color: je(IFe),
      fontSize: "13px",
      fontWeight: "600",
      padding: "0 4px",
      lineHeight: 28
    }
  }, [i]);
}
function II(i) {
  return Ie({ name: "inlineEdits.option" }, (e) => {
    var t;
    return Tn.div({
      class: ["monaco-menu-option", (t = i.isActive) == null ? void 0 : t.map((n) => n && "active")],
      onmouseenter: () => {
        var n;
        return (n = i.onHoverChange) == null ? void 0 : n.call(i, !0);
      },
      onmouseleave: () => {
        var n;
        return (n = i.onHoverChange) == null ? void 0 : n.call(i, !1);
      },
      onclick: i.onAction,
      onkeydown: (n) => {
        var r;
        n.key === "Enter" && ((r = i.onAction) == null || r.call(i));
      },
      tabIndex: 0,
      style: {
        borderRadius: 3
        // same as hover widget border radius
      }
    }, [
      Tn.elem("span", {
        style: {
          fontSize: 16,
          display: "flex"
        }
      }, [qt.isThemeIcon(i.icon) ? _b(i.icon) : i.icon.map((n) => _b(n))]),
      Tn.elem("span", {}, [i.title]),
      Tn.div({
        style: { marginLeft: "auto" },
        ref: (n) => {
          const r = e.store.add(new c2(n, Ad, {
            disableTitle: !0,
            ...y5e,
            keybindingLabelShadow: void 0,
            keybindingLabelForeground: je(IFe),
            keybindingLabelBackground: "transparent",
            keybindingLabelBorder: "transparent",
            keybindingLabelBottomBorder: void 0
          }));
          e.store.add(Xt((s) => {
            r.set(i.keybinding.read(s));
          }));
        }
      })
    ]);
  });
}
function pkt(i, e) {
  return Ie({ name: "inlineEdits.actionBar" }, (t) => Tn.div({
    class: ["action-widget-action-bar"],
    style: {
      padding: "3px 24px"
    }
  }, [
    Tn.div({
      ref: (n) => {
        t.store.add(new qu(n, e)).push(i, { icon: !1, label: !0 });
      }
    })
  ]));
}
function GIe() {
  return Tn.div({
    id: "inline-edit-gutter-indicator-menu-separator",
    class: "menu-separator",
    style: {
      color: je(Qlt),
      padding: "2px 0"
    }
  }, Tn.div({
    style: {
      borderBottom: `1px solid ${je(Cfe)}`
    }
  }));
}
var mkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, DH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let xae = class extends ge {
  get model() {
    const e = this._model.get();
    if (!e)
      throw new Wt("Inline Edit Model not available");
    return e;
  }
  constructor(e, t, n, r, s, o, a, l, c, u) {
    super(), this._editorObs = e, this._originalRange = t, this._verticalOffset = n, this._model = r, this._isHoveringOverInlineEdit = s, this._focusIsInMenu = o, this._hoverService = a, this._instantiationService = l, this._accessibilityService = c, this._tabAction = Ie(this, (d) => {
      const h = this._model.read(d);
      return h ? h.tabAction.read(d) : Kl.Inactive;
    }), this._hoverVisible = Qt(this, !1), this.isHoverVisible = this._hoverVisible, this._isHoveredOverIcon = Qt(this, !1), this._isHoveredOverIconDebounced = Pxe(this._isHoveredOverIcon, 100), this.isHoveredOverIcon = this._isHoveredOverIconDebounced, this._isHoveredOverInlineEditDebounced = Pxe(this._isHoveringOverInlineEdit, 100), this._gutterIndicatorStyles = this._tabAction.map(this, (d, h) => {
      switch (d) {
        case Kl.Inactive:
          return {
            background: Ef(h8e, u).read(h).toString(),
            foreground: Ef(tkt, u).read(h).toString(),
            border: Ef(d8e, u).read(h).toString()
          };
        case Kl.Jump:
          return {
            background: Ef(u8e, u).read(h).toString(),
            foreground: Ef(ekt, u).read(h).toString(),
            border: Ef(_N, u).read(h).toString()
          };
        case Kl.Accept:
          return {
            background: Ef(g8e, u).read(h).toString(),
            foreground: Ef(nkt, u).read(h).toString(),
            border: Ef(f8e, u).read(h).toString()
          };
        default:
          dB();
      }
    }), this._originalRangeObs = Sb(this._originalRange), this._state = Ie(this, (d) => {
      const h = this._originalRangeObs.read(d);
      if (h)
        return {
          range: h,
          lineOffsetRange: this._editorObs.observeLineOffsetRange(h, this._store)
        };
    }), this._stickyScrollController = Kg.get(this._editorObs.editor), this._stickyScrollHeight = this._stickyScrollController ? ji(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController.stickyScrollWidgetHeight) : Br(0), this._lineNumberToRender = Ie(this, (d) => {
      var m;
      if (this._verticalOffset.read(d) !== 0)
        return "";
      const h = (m = this._originalRange.read(d)) == null ? void 0 : m.startLineNumber, g = this._editorObs.getOption(
        76
        /* EditorOption.lineNumbers */
      ).read(d);
      if (h === void 0 || g.renderType === 0)
        return "";
      if (g.renderType === 3) {
        const _ = this._editorObs.cursorPosition.read(d);
        return h % 10 === 0 || _ && _.lineNumber === h ? h.toString() : "";
      }
      if (g.renderType === 2) {
        const _ = this._editorObs.cursorPosition.read(d);
        if (!_)
          return "";
        const v = Math.abs(h - _.lineNumber);
        return v === 0 ? h.toString() : v.toString();
      }
      return g.renderType === 4 ? g.renderFn ? g.renderFn(h) : "" : h.toString();
    }), this._availableWidthForIcon = Ie(this, (d) => {
      const h = this._editorObs.editor.getModel(), g = this._editorObs.editor, m = this._editorObs.layoutInfo.read(d), _ = m.decorationsLeft + m.decorationsWidth - m.glyphMarginLeft;
      if (!h || _ <= 0)
        return () => 0;
      if (m.lineNumbersLeft === 0)
        return () => _;
      const v = this._editorObs.getOption(
        76
        /* EditorOption.lineNumbers */
      ).read(d);
      if (v.renderType === 2 || /* likely to flicker */
      v.renderType === 0)
        return () => _;
      const w = g.getOption(
        59
        /* EditorOption.fontInfo */
      ).typicalHalfwidthCharacterWidth, E = m.lineNumbersLeft + m.lineNumbersWidth, T = (h.getLineCount() + 1).toString().length, D = [];
      for (let N = 1; N <= T; N++) {
        const R = 10 ** (N - 1), M = g.getTopForLineNumber(R), B = N * w, H = Math.min(_, Math.max(0, E - B - m.glyphMarginLeft));
        D.push({ firstLineNumberWithDigitCount: R, topOfLineNumber: M, usableWidthLeftOfLineNumber: H });
      }
      return (N) => {
        for (let R = D.length - 1; R >= 0; R--)
          if (N >= D[R].topOfLineNumber)
            return D[R].usableWidthLeftOfLineNumber;
        throw new Wt("Could not find avilable width for icon");
      };
    }), this._layout = Ie(this, (d) => {
      const h = this._state.read(d);
      if (!h)
        return;
      const g = this._editorObs.layoutInfo.read(d), m = this._editorObs.observeLineHeightForLine(h.range.map((be) => be.startLineNumber)).read(d), _ = 2, v = g.decorationsLeft + g.decorationsWidth - g.glyphMarginLeft - 2 * _, w = g.height - 2 * _, E = xr.fromLeftTopWidthHeight(_, _, v, w), L = E.withTop(this._stickyScrollHeight.read(d)), T = E.withTop(L.top + _), D = h.lineOffsetRange.read(d), N = xr.fromRanges(Tt.fromTo(T.left, T.right), D), R = m, M = this._verticalOffset.read(d), B = N.withHeight(R).translateY(M), H = L.containsRect(B), j = this._tabAction.map((be) => be === Kl.Accept ? Pe.keyboardTab : Pe.arrowRight), K = Ie(this, (be) => {
        if (this._isHoveredOverIconDebounced.read(be) || this._isHoveredOverInlineEditDebounced.read(be))
          return Pe.check;
        if (this._tabAction.read(be) === Kl.Accept)
          return Pe.keyboardTab;
        const re = this._editorObs.cursorLineNumber.read(be) ?? 0, ze = h.range.read(be).startLineNumber;
        return re <= ze ? Pe.keyboardTabAbove : Pe.keyboardTabBelow;
      }), X = 22, Y = 16, G = (be) => {
        const re = this._availableWidthForIcon.read(void 0)(be.bottom + this._editorObs.editor.getScrollTop()) - _;
        return Math.max(Math.min(re, X), Y);
      };
      if (H) {
        const be = B;
        let re;
        g.lineNumbersWidth === 0 ? re = Math.min(Math.max(g.lineNumbersLeft - E.left, 0), be.width - X) : re = Math.max(g.lineNumbersLeft + g.lineNumbersWidth - E.left, 0);
        const ze = be.withWidth(re), Ve = Math.max(Math.min(g.decorationsWidth, X), Y), st = be.withWidth(Ve).translateX(re);
        return {
          gutterEditArea: N,
          icon: K,
          iconDirection: "right",
          iconRect: st,
          pillRect: be,
          lineNumberRect: ze
        };
      }
      const Q = E.intersect(N);
      if (Q && Q.height >= R) {
        const be = B.moveToBeContainedIn(T).moveToBeContainedIn(Q), re = be.withWidth(G(be));
        return {
          gutterEditArea: N,
          icon: K,
          iconDirection: "right",
          iconRect: re,
          pillRect: re
        };
      }
      const Z = B.moveToBeContainedIn(E), pe = Z.withWidth(G(Z)), J = pe, ae = pe.top < B.top ? "top" : "bottom";
      return {
        gutterEditArea: N,
        icon: j,
        iconDirection: ae,
        iconRect: J,
        pillRect: pe
      };
    }), this._iconRef = Tn.ref(), this.isVisible = this._layout.map((d) => !!d), this._indicator = Tn.div({
      class: "inline-edits-view-gutter-indicator",
      onclick: () => {
        const d = this._layout.get(), h = (d == null ? void 0 : d.icon.get()) === Pe.check;
        this._editorObs.editor.focus(), h ? this.model.accept() : this.model.jump();
      },
      tabIndex: 0,
      style: {
        position: "absolute",
        overflow: "visible"
      }
    }, Sb(this._layout).map((d) => d ? [
      Tn.div({
        style: {
          position: "absolute",
          background: je(ikt),
          borderRadius: "4px",
          ...Pf((h) => d.read(h).gutterEditArea)
        }
      }),
      Tn.div({
        class: "icon",
        ref: this._iconRef,
        onmouseenter: () => {
          this._showHover();
        },
        style: {
          cursor: "pointer",
          zIndex: "20",
          position: "absolute",
          backgroundColor: this._gutterIndicatorStyles.map((h) => h.background),
          "--vscodeIconForeground": this._gutterIndicatorStyles.map((h) => h.foreground),
          border: this._gutterIndicatorStyles.map((h) => `1px solid ${h.border}`),
          boxSizing: "border-box",
          borderRadius: "4px",
          display: "flex",
          justifyContent: "flex-end",
          transition: "background-color 0.2s ease-in-out, width 0.2s ease-in-out",
          ...Pf((h) => d.read(h).pillRect)
        }
      }, [
        Tn.div({
          className: "line-number",
          style: {
            lineHeight: d.map((h) => h.lineNumberRect ? h.lineNumberRect.height : 0),
            display: d.map((h) => h.lineNumberRect ? "flex" : "none"),
            alignItems: "center",
            justifyContent: "flex-end",
            width: d.map((h) => h.lineNumberRect ? h.lineNumberRect.width : 0),
            height: "100%",
            color: this._gutterIndicatorStyles.map((h) => h.foreground)
          }
        }, this._lineNumberToRender),
        Tn.div({
          style: {
            rotate: d.map((h) => `${_kt(h.iconDirection)}deg`),
            transition: "rotate 0.2s ease-in-out",
            display: "flex",
            alignItems: "center",
            justifyContent: "center",
            height: "100%",
            marginRight: d.map((h) => {
              var g;
              return h.pillRect.width - h.iconRect.width - (((g = h.lineNumberRect) == null ? void 0 : g.width) ?? 0);
            }),
            width: d.map((h) => h.iconRect.width)
          }
        }, [
          d.map((h, g) => _b(h.icon.read(g)))
        ])
      ])
    ] : [])).keepUpdated(this._store), this._register(this._editorObs.createOverlayWidget({
      domNode: this._indicator.element,
      position: Br(null),
      allowEditorOverflow: !1,
      minContentWidthInPx: Br(0)
    })), this._register(this._editorObs.editor.onMouseMove((d) => {
      if (this._state.get() === void 0)
        return;
      const m = this._iconRef.element.getBoundingClientRect(), _ = xr.fromLeftTopWidthHeight(m.left, m.top, m.width, m.height), v = new ha(d.event.posx, d.event.posy);
      this._isHoveredOverIcon.set(_.containsPoint(v), void 0);
    })), this._register(this._editorObs.editor.onDidScrollChange(() => {
      this._isHoveredOverIcon.set(!1, void 0);
    })), this._register(rm(this._isHoveredOverInlineEditDebounced, (d) => {
      d && this.triggerAnimation();
    })), this._register(Xt((d) => {
      this._indicator.readEffect(d), this._indicator.element && this._editorObs.editor.applyFontInfo(this._indicator.element);
    }));
  }
  triggerAnimation() {
    return this._accessibilityService.isMotionReduced() ? new Animation(null, null).finished : this._iconRef.element.animate([
      {
        outline: `2px solid ${this._gutterIndicatorStyles.map((t) => t.border).get()}`,
        outlineOffset: "-1px",
        offset: 0
      },
      {
        outline: "2px solid transparent",
        outlineOffset: "10px",
        offset: 1
      }
    ], { duration: 500 }).finished;
  }
  _showHover() {
    if (this._hoverVisible.get())
      return;
    const e = new ke(), t = e.add(this._instantiationService.createInstance(Eae, this.model, (s) => {
      s && this._editorObs.editor.focus(), r == null || r.dispose();
    }, this._editorObs).toDisposableLiveElement()), n = e.add(qf(t.element));
    e.add(n.onDidBlur(() => this._focusIsInMenu.set(!1, void 0))), e.add(n.onDidFocus(() => this._focusIsInMenu.set(!0, void 0))), e.add(Et(() => this._focusIsInMenu.set(!1, void 0)));
    const r = this._hoverService.showInstantHover({
      target: this._iconRef.element,
      content: t.element
    });
    r ? (this._hoverVisible.set(!0, void 0), e.add(this._editorObs.editor.onDidScrollChange(() => r.dispose())), e.add(r.onDispose(() => {
      this._hoverVisible.set(!1, void 0), e.dispose();
    }))) : e.dispose();
  }
};
xae = mkt([
  DH(6, od),
  DH(7, xt),
  DH(8, Qa),
  DH(9, to)
], xae);
function _kt(i) {
  switch (i) {
    case "top":
      return 90;
    case "bottom":
      return -90;
    case "right":
      return 0;
  }
}
var bkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, qIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Ch;
(function(i) {
  i.FirstTime = "firstTime", i.SecondTime = "secondTime", i.Active = "active";
})(Ch || (Ch = {}));
let Lae = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._host = e, this._model = t, this._indicator = n, this._collapsedView = r, this._storageService = s, this._configurationService = o, this._disposables = this._register(new er()), this._setupDone = Qt({ name: "setupDone" }, !1), this._activeCompletionId = Ie((a) => {
      const l = this._model.read(a);
      if (!l || !this._setupDone.read(a))
        return;
      const c = this._indicator.read(a);
      if (!(!c || !c.isVisible.read(a)))
        return l.inlineEdit.inlineCompletion.identity.id;
    }), this._register(this._initializeDebugSetting()), this._disposables.value = this.setupNewUserExperience(), this._setupDone.set(!0, void 0);
  }
  setupNewUserExperience() {
    if (this.getNewUserType() === Ch.Active)
      return;
    const e = new ke();
    let t = !1, n = !1, r = 0, s = 0;
    return e.add(Cit(this._activeCompletionId, async (o, a, l, c) => {
      var d, h;
      if (o === void 0)
        return;
      let u = this.getNewUserType();
      switch (u) {
        case Ch.FirstTime: {
          (r++ >= 5 || t) && (u = Ch.SecondTime, this.setNewUserType(u));
          break;
        }
        case Ch.SecondTime: {
          s++ >= 3 && n && (u = Ch.Active, this.setNewUserType(u));
          break;
        }
      }
      switch (u) {
        case Ch.FirstTime: {
          for (let g = 0; g < 3 && !c.isCancellationRequested; g++)
            await ((d = this._indicator.get()) == null ? void 0 : d.triggerAnimation()), await db(500);
          break;
        }
        case Ch.SecondTime: {
          (h = this._indicator.get()) == null || h.triggerAnimation();
          break;
        }
      }
    })), e.add(Xt((o) => {
      this._collapsedView.isVisible.read(o) && this.getNewUserType() !== Ch.Active && this._collapsedView.triggerAnimation();
    })), e.add(Ql((o, a) => {
      const l = this._indicator.read(o);
      l && a.add(rm(l.isHoveredOverIcon, async (c) => {
        c && (t = !0);
      }));
    })), e.add(Ql((o, a) => {
      const l = this._host.read(o);
      l && a.add(l.onDidAccept(() => {
        n = !0;
      }));
    })), e;
  }
  getNewUserType() {
    return this._storageService.get("inlineEditsGutterIndicatorUserKind", -1, Ch.FirstTime);
  }
  setNewUserType(e) {
    switch (e) {
      case Ch.FirstTime:
        throw new Wt("UserKind should not be set to first time");
      case Ch.SecondTime:
        break;
      case Ch.Active:
        this._disposables.clear();
        break;
    }
    this._storageService.store(
      "inlineEditsGutterIndicatorUserKind",
      e,
      -1,
      0
      /* StorageTarget.USER */
    );
  }
  _initializeDebugSetting() {
    const e = "editor.inlineSuggest.edits.resetNewUserExperience";
    return this._configurationService.getValue(e) && this._storageService.remove(
      "inlineEditsGutterIndicatorUserKind",
      -1
      /* StorageScope.APPLICATION */
    ), this._configurationService.onDidChangeConfiguration((n) => {
      n.affectsConfiguration(e) && this._configurationService.getValue(e) && (this._storageService.remove(
        "inlineEditsGutterIndicatorUserKind",
        -1
        /* StorageScope.APPLICATION */
      ), this._disposables.value = this.setupNewUserExperience());
    });
  }
};
Lae = bkt([
  qIe(4, gu),
  qIe(5, xn)
], Lae);
var vkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ykt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Tae = class extends ge {
  constructor(e, t, n) {
    super(), this._editor = e, this._edit = t, this._accessibilityService = n, this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._iconRef = Tn.ref(), this.isHovered = Br(!1), this._editorObs = Ms(this._editor);
    const s = this._edit.map((c) => (c == null ? void 0 : c.edit.replacements[0]) ?? null).map((c) => c ? Sy(c, this._editor.getModel()).range.getStartPosition() : null), o = this._editorObs.observePosition(s, this._store), a = Ie((c) => {
      const u = o.read(c);
      if (!u)
        return null;
      const d = this._editorObs.layoutInfoContentLeft.read(c), h = this._editorObs.scrollLeft.read(c);
      return new ha(d + u.x - h, u.y);
    }), l = Tn.div({
      class: "inline-edits-collapsed-view",
      style: {
        position: "absolute",
        overflow: "visible",
        top: "0px",
        left: "0px",
        display: "block"
      }
    }, [
      [this.getCollapsedIndicator(a)]
    ]).keepUpdated(this._store).element;
    this._register(this._editorObs.createOverlayWidget({
      domNode: l,
      position: Br(null),
      allowEditorOverflow: !1,
      minContentWidthInPx: Br(0)
    })), this.isVisible = this._edit.map((c, u) => !!c && a.read(u) !== null);
  }
  triggerAnimation() {
    return this._accessibilityService.isMotionReduced() ? new Animation(null, null).finished : this._iconRef.element.animate([
      { offset: 0, transform: "translateY(-3px)" },
      { offset: 0.2, transform: "translateY(1px)" },
      { offset: 0.36, transform: "translateY(-1px)" },
      { offset: 0.52, transform: "translateY(1px)" },
      { offset: 0.68, transform: "translateY(-1px)" },
      { offset: 0.84, transform: "translateY(1px)" },
      { offset: 1, transform: "translateY(0px)" }
    ], { duration: 2e3 }).finished;
  }
  getCollapsedIndicator(e) {
    const t = this._editorObs.layoutInfoContentLeft, n = e.map((s, o) => s ? s.deltaX(-t.read(o)) : null), r = this.createIconPath(n);
    return Tn.svg({
      class: "collapsedView",
      ref: this._iconRef,
      style: {
        position: "absolute",
        ...Pf((s) => Upe(this._editorObs).read(s)),
        overflow: "hidden",
        pointerEvents: "none"
      }
    }, [
      Tn.svgElem("path", {
        class: "collapsedViewPath",
        d: r,
        fill: je(_N)
      })
    ]);
  }
  createIconPath(e) {
    return e.map((s) => {
      if (!s)
        return new Sae().build();
      const o = s.deltaX(-6 / 2).deltaY(-1), a = o.deltaX(6), l = o.deltaY(1), c = a.deltaY(1), u = l.deltaX(6 / 2).deltaY(3);
      return new Sae().moveTo(o).lineTo(a).lineTo(c).lineTo(u).lineTo(l).lineTo(o).build();
    });
  }
};
Tae = vkt([
  ykt(2, Qa)
], Tae);
var Ckt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, KIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const IH = 14, yte = 0, Fv = 4, NH = 4, YIe = 2;
let kae = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._editor = e, this._languageService = s, this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._isHovered = Qt(this, !1), this.isHovered = this._isHovered, this._viewRef = Tn.ref(), this._editorObs = Ms(this._editor);
    const o = n.map((u, d) => {
      let h;
      switch (u) {
        case Kl.Inactive:
          h = h8e;
          break;
        case Kl.Jump:
          h = u8e;
          break;
        case Kl.Accept:
          h = g8e;
          break;
      }
      return {
        border: Ef(h, r).read(d).toString(),
        background: je(yo)
      };
    }), a = t.map((u) => u ? this.getState(u) : void 0), l = a.map((u) => u ? this.getRendering(u, o) : void 0);
    this.minEditorScrollHeight = Ie(this, (u) => {
      const d = a.read(u);
      return d ? d.rect.read(u).bottom + this._editor.getScrollTop() : 0;
    });
    const c = Tn.div({
      class: "inline-edits-custom-view",
      style: {
        position: "absolute",
        overflow: "visible",
        top: "0px",
        left: "0px",
        display: "block"
      }
    }, [l]).keepUpdated(this._store);
    this._register(this._editorObs.createOverlayWidget({
      domNode: c.element,
      position: Br(null),
      allowEditorOverflow: !1,
      minContentWidthInPx: u0(this, (u, d) => {
        const h = a.read(u);
        if (!h)
          return d ?? 0;
        const g = h.rect.map((m) => m.right).read(u) + this._editorObs.layoutInfoVerticalScrollbarWidth.read(u) + Fv - this._editorObs.layoutInfoContentLeft.read(u);
        return Math.max(d ?? 0, g);
      }).recomputeInitiallyAndOnChange(this._store)
    })), this._register(Xt((u) => {
      if (!l.read(u)) {
        this._isHovered.set(!1, void 0);
        return;
      }
      this._isHovered.set(c.isHovered.read(u), void 0);
    }));
  }
  // TODO: this is very similar to side by side `fitsInsideViewport`, try to use the same function
  fitsInsideViewport(e, t, n) {
    const r = this._editorObs.layoutInfoWidth.read(n), s = this._editorObs.layoutInfoContentLeft.read(n), o = this._editor.getLayoutInfo().verticalScrollbarWidth, a = this._editorObs.layoutInfoMinimap.read(n).minimapLeft !== 0 ? this._editorObs.layoutInfoMinimap.read(n).minimapWidth : 0, l = v1(this._editorObs, e, void 0), c = Vpe(t, this._editor, this._editor.getModel()), u = Fv + IH;
    return l + c + u < r - s - o - a;
  }
  getState(e) {
    const t = Ie(this, (a) => {
      var E;
      const l = e.range.startLineNumber, c = e.range.endLineNumber, u = e.range.startColumn, d = e.range.endColumn, h = ((E = this._editor.getModel()) == null ? void 0 : E.getLineCount()) ?? 0, g = v1(this._editorObs, new Zt(l, l + 1), a), m = l + 1 <= h ? v1(this._editorObs, new Zt(l + 1, l + 2), a) : void 0, _ = l - 1 >= 1 ? v1(this._editorObs, new Zt(l - 1, l), a) : void 0, v = this._editor.getOffsetForColumn(l, u), w = this._editor.getOffsetForColumn(c, d);
      return {
        lineWidth: g,
        lineWidthBelow: m,
        lineWidthAbove: _,
        startContentLeftOffset: v,
        endContentLeftOffset: w
      };
    }), n = e.range.startLineNumber, r = e.range.endLineNumber, s = this.fitsInsideViewport(new Zt(n, r + 1), e.label, void 0);
    return {
      rect: Ie(this, (a) => {
        const l = this._editorObs.getOption(
          59
          /* EditorOption.fontInfo */
        ).read(a).typicalHalfwidthCharacterWidth, { lineWidth: c, lineWidthBelow: u, lineWidthAbove: d, startContentLeftOffset: h, endContentLeftOffset: g } = t.read(a), m = this._editorObs.layoutInfoContentLeft.read(a), _ = this._editorObs.observeLineHeightForLine(n).recomputeInitiallyAndOnChange(a.store).read(a), v = this._editorObs.scrollTop.read(a), w = this._editorObs.scrollLeft.read(a);
        let E;
        n === r && g + 5 * l >= c && s ? E = "end" : u !== void 0 && u + IH - NH - Fv < h ? E = "below" : d !== void 0 && d + IH - NH - Fv < h ? E = "above" : E = "end";
        let L, T, D = 0, N = 0;
        switch (E) {
          case "end": {
            L = this._editorObs.editor.getTopForLineNumber(n), T = c, D = Fv + IH;
            break;
          }
          case "below": {
            L = this._editorObs.editor.getTopForLineNumber(n + 1), T = h, D = Fv + NH, N = yte + YIe;
            break;
          }
          case "above": {
            L = this._editorObs.editor.getTopForLineNumber(n - 1), T = h, D = Fv + NH, N = -yte + YIe;
            break;
          }
        }
        return xr.fromLeftTopWidthHeight(m + T - w, L - v, l * e.label.length, _).withMargin(yte, Fv).translateX(D).translateY(N);
      }),
      label: e.label,
      kind: e.kind
    };
  }
  getRendering(e, t) {
    var l;
    const n = document.createElement("div"), r = (l = this._editor.getModel().tokenization.tokenizeLinesAt(1, [e.label])) == null ? void 0 : l[0];
    let s;
    r && e.kind === rre.Code ? s = Oy.fromLineTokens(r).toLineTokens(e.label, this._languageService.languageIdCodec) : s = fo.createEmpty(e.label, this._languageService.languageIdCodec);
    const o = PB(new FB([s]), By.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0), [], n, !0);
    n.style.width = `${o.minWidthInPx}px`;
    const a = e.rect.map((c) => c.withMargin(0, Fv));
    return Tn.div({
      class: "collapsedView",
      ref: this._viewRef,
      style: {
        position: "absolute",
        ...Pf((c) => a.read(c)),
        overflow: "hidden",
        boxSizing: "border-box",
        cursor: "pointer",
        border: t.map((c) => `1px solid ${c.border}`),
        borderRadius: "4px",
        backgroundColor: t.map((c) => c.background),
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        whiteSpace: "nowrap"
      },
      onmousedown: (c) => {
        c.preventDefault();
      },
      onclick: (c) => {
        this._onDidClick.fire(new vl(At(c), c));
      }
    }, [
      n
    ]);
  }
};
kae = Ckt([
  KIe(3, to),
  KIe(4, Gr)
], kae);
const wkt = 0, Skt = 0, Cte = 1, Ekt = 1, xkt = 3, wte = 4;
class Lkt extends ge {
  constructor(e, t, n, r) {
    super(), this._editor = e, this._edit = t, this._uiState = n, this._tabAction = r, this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._display = Ie(this, (a) => this._uiState.read(a) ? "block" : "none"), this._editorMaxContentWidthInRange = Ie(this, (a) => {
      const l = this._originalDisplayRange.read(a);
      return l ? (this._editorObs.versionId.read(a), u0(this, (c, u) => {
        const d = v1(this._editorObs, l, c);
        return Math.max(d, u ?? 0);
      })) : Br(0);
    }).map((a, l) => a.read(l)), this._maxPrefixTrim = Ie(this, (a) => {
      const l = this._uiState.read(a);
      return l ? Wpe(l.deletions, l.originalRange, [], this._editor) : { prefixTrim: 0, prefixLeftOffset: 0 };
    }), this._editorLayoutInfo = Ie(this, (a) => {
      const l = this._edit.read(a);
      if (!l || !this._uiState.read(a))
        return null;
      const u = this._editorObs.layoutInfo.read(a), d = this._editorObs.scrollLeft.read(a), h = this._editorObs.getOption(
        59
        /* EditorOption.fontInfo */
      ).map((L) => L.typicalHalfwidthCharacterWidth).read(a), g = u.contentLeft + Math.max(this._editorMaxContentWidthInRange.read(a), h) - d, m = l.originalLineRange, _ = this._originalVerticalStartPosition.read(a) ?? this._editor.getTopForLineNumber(m.startLineNumber) - this._editorObs.scrollTop.read(a), v = this._originalVerticalEndPosition.read(a) ?? this._editor.getTopForLineNumber(m.endLineNumberExclusive) - this._editorObs.scrollTop.read(a), w = u.contentLeft + this._maxPrefixTrim.read(a).prefixLeftOffset - d;
      return g <= w ? null : {
        codeRect: xr.fromLeftTopRightBottom(w, _, g, v).withMargin(Skt, wkt),
        contentLeft: u.contentLeft
      };
    }).recomputeInitiallyAndOnChange(this._store), this._originalOverlay = Tn.div({
      style: { pointerEvents: "none" }
    }, Ie(this, (a) => {
      const l = Sb(this._editorLayoutInfo).read(a);
      if (!l)
        return;
      const c = l.map((g) => xr.fromLeftTopRightBottom(g.contentLeft - wte - Cte, g.codeRect.top, g.contentLeft, g.codeRect.bottom)), u = Ie(this, (g) => {
        const m = l.read(g).codeRect, _ = c.read(g);
        return m.intersectHorizontal(new Tt(_.left, Number.MAX_SAFE_INTEGER));
      }), d = this._uiState.map((g) => g != null && g.inDiffEditor ? xkt : Ekt).read(a), h = u.map((g) => g.withMargin(d, d));
      return [
        Tn.div({
          class: "originalSeparatorDeletion",
          style: {
            ...h.read(a).toStyles(),
            borderRadius: `${wte}px`,
            border: `${Cte + d}px solid ${je(yo)}`,
            boxSizing: "border-box"
          }
        }),
        Tn.div({
          class: "originalOverlayDeletion",
          style: {
            ...u.read(a).toStyles(),
            borderRadius: `${wte}px`,
            border: WK(this._tabAction).map((g) => `${Cte}px solid ${je(g)}`),
            boxSizing: "border-box",
            backgroundColor: je(t3)
          }
        }),
        Tn.div({
          class: "originalOverlayHiderDeletion",
          style: {
            ...c.read(a).toStyles(),
            backgroundColor: je(yo)
          }
        })
      ];
    })).keepUpdated(this._store), this._nonOverflowView = Tn.div({
      class: "inline-edits-view",
      style: {
        position: "absolute",
        overflow: "visible",
        top: "0px",
        left: "0px",
        display: this._display
      }
    }, [
      [this._originalOverlay]
    ]).keepUpdated(this._store), this.isHovered = Br(!1), this._editorObs = Ms(this._editor);
    const s = Ie(this, (a) => {
      const l = this._edit.read(a);
      return l ? new de(l.originalLineRange.startLineNumber, 1) : null;
    }), o = Ie(this, (a) => {
      const l = this._edit.read(a);
      return l ? new de(l.originalLineRange.endLineNumberExclusive, 1) : null;
    });
    this._originalDisplayRange = this._uiState.map((a) => a == null ? void 0 : a.originalRange), this._originalVerticalStartPosition = this._editorObs.observePosition(s, this._store).map((a) => a == null ? void 0 : a.y), this._originalVerticalEndPosition = this._editorObs.observePosition(o, this._store).map((a) => a == null ? void 0 : a.y), this._register(this._editorObs.createOverlayWidget({
      domNode: this._nonOverflowView.element,
      position: Br(null),
      allowEditorOverflow: !1,
      minContentWidthInPx: Ie(this, (a) => {
        const l = this._editorLayoutInfo.read(a);
        return l === null ? 0 : l.codeRect.width;
      })
    }));
  }
}
var Tkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, XIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const cP = 1, kkt = 1, Dkt = 3, Ste = 4;
let Dae = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._editor = e, this._input = t, this._tabAction = n, this._languageService = s, this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._state = Ie(this, (o) => {
      const a = this._input.read(o);
      if (!a)
        return;
      const l = this._editor.getModel(), c = l.getEOL();
      if (a.startColumn === 1 && a.lineNumber > 1 && l.getLineLength(a.lineNumber) !== 0 && a.text.endsWith(c) && !a.text.startsWith(c)) {
        const u = l.getLineLength(a.lineNumber - 1) + 1;
        return { lineNumber: a.lineNumber - 1, column: u, text: c + a.text.slice(0, -c.length) };
      }
      return { lineNumber: a.lineNumber, column: a.startColumn, text: a.text };
    }), this._trimVertically = Ie(this, (o) => {
      const a = this._state.read(o), l = a == null ? void 0 : a.text;
      if (!l || l.trim() === "")
        return { topOffset: 0, bottomOffset: 0, linesTop: 0, linesBottom: 0 };
      const c = this._editor.getLineHeightForPosition(new de(a.lineNumber, 1)), u = this._editor.getModel().getEOL();
      let d = 0, h = 0, g = 0;
      for (; g < l.length && l.startsWith(u, g); g += u.length)
        d += 1;
      for (let m = l.length; m > g && l.endsWith(u, m); m -= u.length)
        h += 1;
      return { topOffset: d * c, bottomOffset: h * c, linesTop: d, linesBottom: h };
    }), this._maxPrefixTrim = Ie(this, (o) => {
      const a = this._state.read(o);
      if (!a)
        return { prefixLeftOffset: 0, prefixTrim: 0 };
      const l = this._editor.getModel(), c = l.getEOL(), u = this._trimVertically.read(o), d = a.text.split(c), h = d.slice(u.linesTop, d.length - u.linesBottom);
      u.linesTop === 0 && (h[0] = l.getLineContent(a.lineNumber) + h[0]);
      const g = new Zt(a.lineNumber, a.lineNumber + (u.linesTop > 0 ? 0 : 1));
      return Wpe([], g, h, this._editor);
    }), this._ghostText = Ie((o) => {
      const a = this._state.read(o), l = this._maxPrefixTrim.read(o);
      if (!a)
        return;
      const u = this._editor.getModel().getEOL(), h = a.text.split(u).map((g, m) => new zx(
        new z(m + 1, m === 0 ? 1 : l.prefixTrim + 1, m + 1, g.length + 1),
        "modified-background",
        0
        /* InlineDecorationType.Regular */
      ));
      return new f5(a.lineNumber, [new Fz(a.column, a.text, !1, h)]);
    }), this._display = Ie(this, (o) => this._state.read(o) ? "block" : "none"), this._editorMaxContentWidthInRange = Ie(this, (o) => {
      const a = this._state.read(o);
      if (!a)
        return 0;
      this._editorObs.versionId.read(o);
      const l = this._editor.getModel(), c = l.getEOL(), u = a.text.startsWith(c) ? "" : l.getValueInRange(new z(a.lineNumber, 1, a.lineNumber, a.column)), d = l.getValueInRange(new z(a.lineNumber, a.column, a.lineNumber, l.getLineLength(a.lineNumber) + 1)), g = (u + a.text + d).split(c), m = By.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0), _ = g.map((v) => {
        var L;
        const w = (L = l.tokenization.tokenizeLinesAt(a.lineNumber, [v])) == null ? void 0 : L[0];
        let E;
        return w ? E = Oy.fromLineTokens(w).toLineTokens(v, this._languageService.languageIdCodec) : E = fo.createEmpty(v, this._languageService.languageIdCodec), PB(new FB([E]), m, [], Ge("div"), !0).minWidthInPx;
      });
      return Math.max(..._);
    }), this.startLineOffset = this._trimVertically.map((o) => o.topOffset), this.originalLines = this._state.map((o) => o ? new Zt(o.lineNumber, Math.min(o.lineNumber + 2, this._editor.getModel().getLineCount() + 1)) : void 0), this._overlayLayout = Ie(this, (o) => {
      this._ghostText.read(o);
      const a = this._state.read(o);
      if (!a)
        return null;
      this._editorObs.observePosition(Qt(this, new de(a.lineNumber, a.column)), o.store).read(o);
      const l = this._editorObs.layoutInfo.read(o), c = this._editorObs.scrollLeft.read(o), u = this._editorObs.layoutInfoVerticalScrollbarWidth.read(o), d = l.contentLeft + this._editorMaxContentWidthInRange.read(o) - c, h = this._maxPrefixTrim.read(o).prefixLeftOffset ?? 0, g = l.contentLeft + h - c;
      if (d <= g)
        return null;
      const { topOffset: m, bottomOffset: _ } = this._trimVertically.read(o), v = this._editorObs.scrollTop.read(o), w = this._ghostTextView.height.read(o) - m - _, E = this._editor.getTopForLineNumber(a.lineNumber) - v + m, L = E + w, T = new xr(g, E, d, L);
      return {
        overlay: T,
        startsAtContentLeft: h === 0,
        contentLeft: l.contentLeft,
        minContentWidthRequired: h + T.width + u
      };
    }).recomputeInitiallyAndOnChange(this._store), this._modifiedOverlay = Tn.div({
      style: { pointerEvents: "none" }
    }, Ie(this, (o) => {
      const a = Sb(this._overlayLayout).read(o);
      if (!a)
        return;
      const l = a.map((h) => xr.fromLeftTopRightBottom(h.contentLeft - Ste - cP, h.overlay.top, h.contentLeft, h.overlay.bottom)).read(o), c = this._input.map((h) => h != null && h.inDiffEditor ? Dkt : kkt).read(o), u = a.map((h) => h.overlay.withMargin(0, cP, 0, h.startsAtContentLeft ? 0 : cP).intersectHorizontal(new Tt(l.left, Number.MAX_SAFE_INTEGER))), d = u.map((h) => h.withMargin(c, c));
      return [
        Tn.div({
          class: "originalUnderlayInsertion",
          style: {
            ...d.read(o).toStyles(),
            borderRadius: Ste,
            border: `${cP + c}px solid ${je(yo)}`,
            boxSizing: "border-box"
          }
        }),
        Tn.div({
          class: "originalOverlayInsertion",
          style: {
            ...u.read(o).toStyles(),
            borderRadius: Ste,
            border: _5(this._tabAction).map((h) => `${cP}px solid ${je(h)}`),
            boxSizing: "border-box",
            backgroundColor: je(c8e)
          }
        }),
        Tn.div({
          class: "originalOverlayHiderInsertion",
          style: {
            ...l.toStyles(),
            backgroundColor: je(yo)
          }
        })
      ];
    })).keepUpdated(this._store), this._view = Tn.div({
      class: "inline-edits-view",
      style: {
        position: "absolute",
        overflow: "visible",
        top: "0px",
        left: "0px",
        display: this._display
      }
    }, [
      [this._modifiedOverlay]
    ]).keepUpdated(this._store), this._editorObs = Ms(this._editor), this._ghostTextView = this._register(r.createInstance(p5, this._editor, {
      ghostText: this._ghostText,
      minReservedLineCount: Br(0),
      targetTextModel: this._editorObs.model.map((o) => o ?? void 0),
      warning: Br(void 0),
      handleInlineCompletionShown: Br(() => {
      })
    }, Qt(this, { syntaxHighlightingEnabled: !0, extraClasses: ["inline-edit"] }), !0, !0)), this.isHovered = this._ghostTextView.isHovered, this._register(this._ghostTextView.onDidClick((o) => {
      this._onDidClick.fire(o);
    })), this._register(this._editorObs.createOverlayWidget({
      domNode: this._view.element,
      position: Br(null),
      allowEditorOverflow: !1,
      minContentWidthInPx: Ie(this, (o) => {
        const a = this._overlayLayout.read(o);
        return a === null ? 0 : a.minContentWidthRequired;
      })
    }));
  }
};
Dae = Tkt([
  XIe(3, xt),
  XIe(4, Gr)
], Dae);
var Ikt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ZIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Iae = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._editor = e, this._edit = t, this._isInDiffEditor = n, this._tabAction = r, this._languageService = s, this._themeService = o, this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._maxPrefixTrim = this._edit.map((a) => a ? Wpe(a.replacements.flatMap((l) => [l.originalRange, l.modifiedRange]), a.originalRange, a.modifiedLines, this._editor.editor) : void 0), this._modifiedLineElements = Ie(this, (a) => {
      var v;
      const l = [];
      let c = 0;
      const u = this._maxPrefixTrim.read(a), d = this._edit.read(a);
      if (!d || !u)
        return;
      const h = u.prefixTrim, g = Nkt(d.replacements.map((w) => w.modifiedRange)).map((w) => new z(w.startLineNumber, w.startColumn - h, w.endLineNumber, w.endColumn - h)), m = this._editor.model.get(), _ = d.modifiedRange.startLineNumber;
      for (let w = 0; w < d.modifiedRange.length; w++) {
        const E = document.createElement("div"), L = _ + w, T = d.modifiedLines[w].slice(h), D = (v = m.tokenization.tokenizeLinesAt(L, [T])) == null ? void 0 : v[0];
        let N;
        D ? N = Oy.fromLineTokens(D).toLineTokens(T, this._languageService.languageIdCodec) : N = fo.createEmpty(T, this._languageService.languageIdCodec);
        const R = [];
        for (const B of g.filter((H) => H.startLineNumber === L)) {
          const H = Math.min(B.endColumn, T.length + 1);
          R.push(new zx(
            new z(1, B.startColumn, 1, H),
            "inlineCompletions-modified-bubble",
            0
            /* InlineDecorationType.Regular */
          ));
        }
        const M = PB(new FB([N]), By.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0), R, E, !0);
        this._editor.getOption(
          59
          /* EditorOption.fontInfo */
        ).read(a), c = Math.max(c, M.minWidthInPx), l.push(E);
      }
      return { lines: l, requiredWidth: c };
    }), this._layout = Ie(this, (a) => {
      const l = this._modifiedLineElements.read(a), c = this._maxPrefixTrim.read(a), u = this._edit.read(a);
      if (!l || !c || !u)
        return;
      const { prefixLeftOffset: d } = c, { requiredWidth: h } = l, g = this._editor.observeLineHeightsForLineRange(u.originalRange).read(a), m = (() => {
        const Q = g.slice(0, u.modifiedRange.length);
        for (; Q.length < u.modifiedRange.length; )
          Q.push(g[g.length - 1]);
        return Q;
      })(), _ = this._editor.layoutInfoContentLeft.read(a), v = this._editor.layoutInfoVerticalScrollbarWidth.read(a), w = this._editor.scrollLeft.read(a), E = this._editor.scrollTop.read(a), L = _ - w, T = this._editor.editor.getModel(), D = u.originalRange.mapToLineArray((Q) => this._editor.editor.getOffsetForColumn(Q, T.getLineMaxColumn(Q)) - d), N = Math.max(...D, h), R = u.originalRange.startLineNumber, M = u.originalRange.endLineNumberExclusive - 1, B = this._editor.editor.getTopForLineNumber(R) - E, H = this._editor.editor.getBottomForLineNumber(M) - E, j = xr.fromLeftTopWidthHeight(L + d, B, N, H - B), K = xr.fromLeftTopWidthHeight(j.left, j.bottom, j.width, m.reduce((Q, oe) => Q + oe, 0)), X = xr.hull([j, K]), Y = X.intersectVertical(new Tt(j.bottom, Number.MAX_SAFE_INTEGER)), G = new xr(Y.left, Y.top, Y.right, Y.bottom);
      return {
        originalLinesOverlay: j,
        modifiedLinesOverlay: K,
        background: X,
        lowerBackground: Y,
        lowerText: G,
        modifiedLineHeights: m,
        minContentWidthRequired: d + N + v
      };
    }), this._viewZoneInfo = Ie((a) => {
      if (!this._editor.getOption(
        71
        /* EditorOption.inlineSuggest */
      ).map((g) => g.edits.allowCodeShifting === "always").read(a))
        return;
      const c = this._layout.read(a), u = this._edit.read(a);
      if (!c || !u)
        return;
      const d = c.lowerBackground.height, h = u.originalRange.endLineNumberExclusive;
      return { height: d, lineNumber: h };
    }), this.minEditorScrollHeight = Ie(this, (a) => {
      const l = Sb(this._layout).read(a);
      return !l || this._viewZoneInfo.read(a) !== void 0 ? 0 : l.read(a).lowerText.bottom + this._editor.editor.getScrollTop();
    }), this._div = Tn.div({
      class: "line-replacement"
    }, [
      Ie(this, (a) => {
        const l = Sb(this._layout).read(a), c = this._modifiedLineElements.read(a);
        if (!l || !c)
          return [];
        const u = l.read(a), d = this._editor.layoutInfoContentLeft.read(a), h = this._isInDiffEditor.read(a) ? 3 : 1;
        c.lines.forEach((_, v) => {
          _.style.width = `${u.lowerText.width}px`, _.style.height = `${u.modifiedLineHeights[v]}px`, _.style.position = "relative";
        });
        const g = _5(this._tabAction).read(a), m = WK(this._tabAction).read(a);
        return [
          Tn.div({
            style: {
              position: "absolute",
              ...Pf((_) => Upe(this._editor).read(_)),
              overflow: "hidden",
              pointerEvents: "none"
            }
          }, [
            Tn.div({
              class: "borderAroundLineReplacement",
              style: {
                position: "absolute",
                ...Pf((_) => l.read(_).background.translateX(-d).withMargin(h)),
                borderRadius: "4px",
                border: `${h + 1}px solid ${je(yo)}`,
                boxSizing: "border-box",
                pointerEvents: "none"
              }
            }),
            Tn.div({
              class: "originalOverlayLineReplacement",
              style: {
                position: "absolute",
                ...Pf((_) => l.read(_).background.translateX(-d)),
                borderRadius: "4px",
                border: Ef(m, this._themeService).map((_) => `1px solid ${_.toString()}`),
                pointerEvents: "none",
                boxSizing: "border-box",
                background: je(t3)
              }
            }),
            Tn.div({
              class: "modifiedOverlayLineReplacement",
              style: {
                position: "absolute",
                ...Pf((_) => l.read(_).lowerBackground.translateX(-d)),
                borderRadius: "0 0 4px 4px",
                background: je(yo),
                boxShadow: `${je(zq)} 0 6px 6px -6px`,
                border: `1px solid ${je(g)}`,
                boxSizing: "border-box",
                overflow: "hidden",
                cursor: "pointer",
                pointerEvents: "auto"
              },
              onmousedown: (_) => {
                _.preventDefault();
              },
              onclick: (_) => this._onDidClick.fire(new vl(At(_), _))
            }, [
              Tn.div({
                style: {
                  position: "absolute",
                  top: 0,
                  left: 0,
                  width: "100%",
                  height: "100%",
                  background: je(QTt)
                }
              })
            ]),
            Tn.div({
              class: "modifiedLinesLineReplacement",
              style: {
                position: "absolute",
                boxSizing: "border-box",
                ...Pf((_) => l.read(_).lowerText.translateX(-d)),
                fontFamily: this._editor.getOption(
                  58
                  /* EditorOption.fontFamily */
                ),
                fontSize: this._editor.getOption(
                  61
                  /* EditorOption.fontSize */
                ),
                fontWeight: this._editor.getOption(
                  62
                  /* EditorOption.fontWeight */
                ),
                pointerEvents: "none",
                whiteSpace: "nowrap",
                borderRadius: "0 0 4px 4px",
                overflow: "hidden"
              }
            }, [...c.lines])
          ])
        ];
      })
    ]).keepUpdated(this._store), this.isHovered = this._editor.isTargetHovered((a) => this._isMouseOverWidget(a), this._store), this._previousViewZoneInfo = void 0, this._register(Et(() => this._editor.editor.changeViewZones((a) => this.removePreviousViewZone(a)))), this._register(fit(this._viewZoneInfo, ({ lastValue: a, newValue: l }) => {
      a === l || (a == null ? void 0 : a.height) === (l == null ? void 0 : l.height) && (a == null ? void 0 : a.lineNumber) === (l == null ? void 0 : l.lineNumber) || this._editor.editor.changeViewZones((c) => {
        this.removePreviousViewZone(c), l && this.addViewZone(l, c);
      });
    })), this._register(this._editor.createOverlayWidget({
      domNode: this._div.element,
      minContentWidthInPx: Ie(this, (a) => {
        var l;
        return ((l = this._layout.read(a)) == null ? void 0 : l.minContentWidthRequired) ?? 0;
      }),
      position: Br({ preference: { top: 0, left: 0 } }),
      allowEditorOverflow: !1
    }));
  }
  _isMouseOverWidget(e) {
    const t = this._layout.get();
    return !t || !(e.event instanceof Zy) ? !1 : t.lowerBackground.containsPoint(new ha(e.event.relativePos.x, e.event.relativePos.y));
  }
  removePreviousViewZone(e) {
    if (!this._previousViewZoneInfo)
      return;
    e.removeZone(this._previousViewZoneInfo.id);
    const t = this._editor.cursorLineNumber.get();
    t !== null && t >= this._previousViewZoneInfo.lineNumber && this._editor.editor.setScrollTop(this._editor.scrollTop.get() - this._previousViewZoneInfo.height), this._previousViewZoneInfo = void 0;
  }
  addViewZone(e, t) {
    const n = t.addZone({
      afterLineNumber: e.lineNumber - 1,
      heightInPx: e.height,
      // move computation to layout?
      domNode: Ge("div")
    });
    this._previousViewZoneInfo = { height: e.height, lineNumber: e.lineNumber, id: n };
    const r = this._editor.cursorLineNumber.get();
    r !== null && r >= e.lineNumber && this._editor.editor.setScrollTop(this._editor.scrollTop.get() + e.height);
  }
};
Iae = Ikt([
  ZIe(4, Gr),
  ZIe(5, to)
], Iae);
function Nkt(i) {
  const e = [];
  for (; i.length; ) {
    let t = i.shift();
    t.startLineNumber !== t.endLineNumber && (i.push(new z(t.startLineNumber + 1, 1, t.endLineNumber, t.endColumn)), t = new z(t.startLineNumber, t.startColumn, t.startLineNumber, Number.MAX_SAFE_INTEGER)), e.push(t);
  }
  return e;
}
var Rkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, QIe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const NI = 0, uP = 0, Lp = 1, Akt = 1, Okt = 3, Bv = 4, Ete = 20, JIe = 12;
let Gz = class extends ge {
  // This is an approximation and should be improved by using the real parameters used bellow
  static fitsInsideViewport(e, t, n, r) {
    const s = Ms(e), o = s.layoutInfoWidth.read(r), a = s.layoutInfoContentLeft.read(r), l = e.getLayoutInfo().verticalScrollbarWidth, c = s.layoutInfoMinimap.read(r).minimapLeft !== 0 ? s.layoutInfoMinimap.read(r).minimapWidth : 0, u = v1(
      s,
      n.displayRange,
      void 0
      /* do not reconsider on each layout info change */
    ), d = n.lineEdit.newLines.reduce((m, _) => Math.max(m, Vpe(_, e, t)), 0), h = Ete, g = JIe + 2 * Lp;
    return u + d + h + g < o - a - l - c;
  }
  constructor(e, t, n, r, s, o, a) {
    super(), this._editor = e, this._edit = t, this._previewTextModel = n, this._uiState = r, this._tabAction = s, this._instantiationService = o, this._themeService = a, this._editorObs = Ms(this._editor), this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._display = Ie(this, (c) => this._uiState.read(c) ? "block" : "none"), this.previewRef = Tn.ref();
    const l = this._uiState.map((c) => c != null && c.isInDiffEditor ? Okt : Akt);
    this._editorContainer = Tn.div({
      class: ["editorContainer"],
      style: { position: "absolute", overflow: "hidden", cursor: "pointer" },
      onmousedown: (c) => {
        c.preventDefault();
      },
      onclick: (c) => {
        this._onDidClick.fire(new vl(At(c), c));
      }
    }, [
      Tn.div({ class: "preview", style: { pointerEvents: "none" }, ref: this.previewRef })
    ]).keepUpdated(this._store), this.isHovered = this._editorContainer.didMouseMoveDuringHover, this.previewEditor = this._register(this._instantiationService.createInstance(s0, this.previewRef.element, {
      glyphMargin: !1,
      lineNumbers: "off",
      minimap: { enabled: !1 },
      guides: {
        indentation: !1,
        bracketPairs: !1,
        bracketPairsHorizontal: !1,
        highlightActiveIndentation: !1
      },
      rulers: [],
      padding: { top: 0, bottom: 0 },
      folding: !1,
      selectOnLineNumbers: !1,
      selectionHighlight: !1,
      columnSelection: !1,
      overviewRulerBorder: !1,
      overviewRulerLanes: 0,
      lineDecorationsWidth: 0,
      lineNumbersMinChars: 0,
      revealHorizontalRightPadding: 0,
      bracketPairColorization: { enabled: !0, independentColorPoolPerBracketType: !1 },
      scrollBeyondLastLine: !1,
      scrollbar: {
        vertical: "hidden",
        horizontal: "hidden",
        handleMouseWheel: !1
      },
      readOnly: !0,
      wordWrap: "off",
      wordWrapOverride1: "off",
      wordWrapOverride2: "off"
    }, {
      contextKeyValues: {
        [Cr.inInlineEditsPreviewEditor.key]: !0
      },
      contributions: []
    }, this._editor)), this._previewEditorObs = Ms(this.previewEditor), this._activeViewZones = [], this._updatePreviewEditor = Ie(this, (c) => {
      this._editorContainer.readEffect(c), this._previewEditorObs.model.read(c), this._display.read(c), this._nonOverflowView && (this._nonOverflowView.element.style.display = this._display.read(c));
      const u = this._uiState.read(c), d = this._edit.read(c);
      if (!u || !d)
        return;
      const h = d.originalLineRange, g = [];
      h.startLineNumber > 1 && g.push(new z(1, 1, h.startLineNumber - 1, 1)), h.startLineNumber + u.newTextLineCount < this._previewTextModel.getLineCount() + 1 && g.push(new z(h.startLineNumber + u.newTextLineCount, 1, this._previewTextModel.getLineCount() + 1, 1)), this.previewEditor.setHiddenAreas(g, void 0, !0);
      const m = [...this._activeViewZones];
      this._activeViewZones = [];
      const _ = h.endLineNumberExclusive - h.startLineNumber - u.newTextLineCount;
      this.previewEditor.changeViewZones((v) => {
        m.forEach((w) => v.removeZone(w)), _ > 0 && this._activeViewZones.push(v.addZone({
          afterLineNumber: h.startLineNumber + u.newTextLineCount - 1,
          heightInLines: _,
          showInHiddenAreas: !0,
          domNode: Ge("div.diagonal-fill.inline-edits-view-zone")
        }));
      });
    }), this._previewEditorWidth = Ie(this, (c) => {
      const u = this._edit.read(c);
      return u ? (this._updatePreviewEditor.read(c), v1(this._previewEditorObs, u.modifiedLineRange, c)) : 0;
    }), this._cursorPosIfTouchesEdit = Ie(this, (c) => {
      const u = this._editorObs.cursorPosition.read(c), d = this._edit.read(c);
      if (!(!d || !u))
        return d.modifiedLineRange.contains(u.lineNumber) ? u : void 0;
    }), this._originalStartPosition = Ie(this, (c) => {
      const u = this._edit.read(c);
      return u ? new de(u.originalLineRange.startLineNumber, 1) : null;
    }), this._originalEndPosition = Ie(this, (c) => {
      const u = this._edit.read(c);
      return u ? new de(u.originalLineRange.endLineNumberExclusive, 1) : null;
    }), this._originalVerticalStartPosition = this._editorObs.observePosition(this._originalStartPosition, this._store).map((c) => c == null ? void 0 : c.y), this._originalVerticalEndPosition = this._editorObs.observePosition(this._originalEndPosition, this._store).map((c) => c == null ? void 0 : c.y), this._originalDisplayRange = this._edit.map((c) => c == null ? void 0 : c.displayRange), this._editorMaxContentWidthInRange = Ie(this, (c) => {
      const u = this._originalDisplayRange.read(c);
      return u ? (this._editorObs.versionId.read(c), u0(this, (d, h) => {
        const g = v1(this._editorObs, u, d);
        return Math.max(g, h ?? 0);
      })) : Br(0);
    }).map((c, u) => c.read(u)), this._previewEditorLayoutInfo = Ie(this, (c) => {
      const u = this._edit.read(c);
      if (!u || !this._uiState.read(c))
        return null;
      const h = u.originalLineRange, g = this._editorObs.scrollLeft.read(c), m = this._editorMaxContentWidthInRange.read(c), _ = this._editorObs.layoutInfo.read(c), v = this._previewEditorWidth.read(c), w = _.contentWidth - _.verticalScrollbarWidth, E = this._editor.getContainerDomNode().getBoundingClientRect(), L = _.contentLeft + _.contentWidth + E.left, T = At(this._editor.getContainerDomNode()).innerWidth - L, D = At(this._editor.getContainerDomNode()).innerWidth - E.right, N = Math.min(_.contentWidth * 0.3, v, 100), R = 0, M = R + T, B = this._cursorPosIfTouchesEdit.read(c), H = Math.max(
        // We're starting from the content area right and moving it left by IN_EDITOR_DISPLACEMENT and also by an amount to ensure some minimum desired width
        w + g - R - Math.max(0, N - M),
        // But we don't want that the moving left ends up covering the cursor, so this will push it to the right again
        Math.min(B ? okt(this._editorObs, B, c) + 50 : 0, w + g)
      ), j = Math.min(m + Ete, H), K = m + Ete + v + 70, X = H - j;
      let Y, G;
      j > g ? (Y = 0, G = _.contentLeft + j - g) : (Y = g - j, G = _.contentLeft);
      const Q = this._originalVerticalStartPosition.read(c) ?? this._editor.getTopForLineNumber(h.startLineNumber) - this._editorObs.scrollTop.read(c), oe = this._originalVerticalEndPosition.read(c) ?? this._editor.getBottomForLineNumber(h.endLineNumberExclusive - 1) - this._editorObs.scrollTop.read(c), Z = _.contentLeft - g;
      let pe = xr.fromLeftTopRightBottom(Z, Q, G, oe);
      const J = pe.height === 0;
      J || (pe = pe.withMargin(uP, NI));
      const be = this._previewEditorObs.observeLineHeightsForLineRange(u.modifiedLineRange).read(c).reduce((at, en) => at + en, 0), re = oe - Q, ze = Math.max(re, be), Ve = X === 0, st = 0, ot = Math.min(v + JIe, D + _.width - _.contentLeft - st);
      let et = xr.fromLeftTopWidthHeight(pe.right + st, Q, ot, ze);
      return J ? et = et.withMargin(uP, NI).translateY(uP) : et = et.withMargin(uP, NI).translateX(NI + Lp), {
        codeRect: pe,
        editRect: et,
        codeScrollLeft: g,
        contentLeft: _.contentLeft,
        isInsertion: J,
        maxContentWidth: K,
        shouldShowShadow: Ve,
        desiredPreviewEditorScrollLeft: Y,
        previewEditorWidth: ot
      };
    }), this._stickyScrollController = Kg.get(this._editorObs.editor), this._stickyScrollHeight = this._stickyScrollController ? ji(this._stickyScrollController.onDidChangeStickyScrollHeight, () => this._stickyScrollController.stickyScrollWidgetHeight) : Br(0), this._shouldOverflow = Ie(this, (c) => !1), this._originalBackgroundColor = ji(this, this._themeService.onDidColorThemeChange, () => this._themeService.getColorTheme().getColor(t3) ?? De.transparent), this._backgroundSvg = Tn.svg({
      transform: "translate(-0.5 -0.5)",
      style: { overflow: "visible", pointerEvents: "none", position: "absolute" }
    }, [
      Tn.svgElem("path", {
        class: "rightOfModifiedBackgroundCoverUp",
        d: Ie(this, (c) => {
          const u = this._previewEditorLayoutInfo.read(c);
          if (!(!u || this._originalBackgroundColor.read(c).isTransparent()))
            return new Sae().moveTo(u.codeRect.getRightTop()).lineTo(u.codeRect.getRightTop().deltaX(1e3)).lineTo(u.codeRect.getRightBottom().deltaX(1e3)).lineTo(u.codeRect.getRightBottom()).build();
        }),
        style: {
          fill: LFe(yo, "transparent")
        }
      })
    ]).keepUpdated(this._store), this._originalOverlay = Tn.div({
      style: { pointerEvents: "none", display: this._previewEditorLayoutInfo.map((c) => c != null && c.isInsertion ? "none" : "block") }
    }, Ie(this, (c) => {
      const u = Sb(this._previewEditorLayoutInfo).read(c);
      if (!u)
        return;
      const d = l.read(c), h = WK(this._tabAction).map((N) => `${Lp}px solid ${je(N)}`), g = `${Lp + d}px solid ${je(yo)}`, m = u.read(c).codeScrollLeft !== 0, _ = u.map((N) => N.codeRect.bottom < N.editRect.bottom), v = Bv * 2 + Lp * 2, w = u.map((N) => xr.fromLeftTopRightBottom(N.contentLeft - Bv - Lp, N.codeRect.top, N.contentLeft, N.codeRect.bottom + v)).read(c), E = new Tt(w.left, Number.MAX_SAFE_INTEGER), L = u.map((N) => N.codeRect.intersectHorizontal(E)), T = L.map((N) => N.withMargin(d, 0, d, d).intersectHorizontal(E)), D = L.map((N) => xr.fromLeftTopWidthHeight(N.right - v + Lp, N.bottom - Lp, v, v).intersectHorizontal(E));
      return [
        Tn.div({
          class: "originalSeparatorSideBySide",
          style: {
            ...T.read(c).toStyles(),
            boxSizing: "border-box",
            borderRadius: `${Bv}px 0 0 ${Bv}px`,
            borderTop: g,
            borderBottom: g,
            borderLeft: m ? "none" : g
          }
        }),
        Tn.div({
          class: "originalOverlaySideBySide",
          style: {
            ...L.read(c).toStyles(),
            boxSizing: "border-box",
            borderRadius: `${Bv}px 0 0 ${Bv}px`,
            borderTop: h,
            borderBottom: h,
            borderLeft: m ? "none" : h,
            backgroundColor: je(t3)
          }
        }),
        Tn.div({
          class: "originalCornerCutoutSideBySide",
          style: {
            pointerEvents: "none",
            display: _.map((N) => N ? "block" : "none"),
            ...D.read(c).toStyles()
          }
        }, [
          Tn.div({
            class: "originalCornerCutoutBackground",
            style: {
              position: "absolute",
              top: "0px",
              left: "0px",
              width: "100%",
              height: "100%",
              backgroundColor: Ef(t3, this._themeService).map((N) => N.toString())
            }
          }),
          Tn.div({
            class: "originalCornerCutoutBorder",
            style: {
              position: "absolute",
              top: "0px",
              left: "0px",
              width: "100%",
              height: "100%",
              boxSizing: "border-box",
              borderTop: h,
              borderRight: h,
              borderRadius: "0 100% 0 0",
              backgroundColor: je(yo)
            }
          })
        ]),
        Tn.div({
          class: "originalOverlaySideBySideHider",
          style: {
            ...w.toStyles(),
            backgroundColor: je(yo)
          }
        })
      ];
    })).keepUpdated(this._store), this._modifiedOverlay = Tn.div({
      style: { pointerEvents: "none" }
    }, Ie(this, (c) => {
      const u = Sb(this._previewEditorLayoutInfo).read(c);
      if (!u)
        return;
      const d = u.map((L) => L.codeRect.bottom < L.editRect.bottom), h = l.read(c), g = d.map((L) => `0 ${Bv}px ${Bv}px ${L ? Bv : 0}px`), m = Ef(_5(this._tabAction), this._themeService).map((L) => `1px solid ${L.toString()}`), _ = `${Lp + h}px solid ${je(yo)}`, v = u.map((L) => L.editRect.withMargin(0, Lp)), w = v.map((L) => L.withMargin(h, h, h, 0)), E = Ie(this, (L) => {
        const T = v.read(L), D = u.read(L);
        return !D.isInsertion || D.contentLeft >= T.left ? xr.fromLeftTopWidthHeight(T.left, T.top, 0, 0) : new xr(D.contentLeft, T.top, T.left, T.top + Lp * 2);
      });
      return [
        Tn.div({
          class: "modifiedInsertionSideBySide",
          style: {
            ...E.read(c).toStyles(),
            backgroundColor: _5(this._tabAction).map((L) => je(L))
          }
        }),
        Tn.div({
          class: "modifiedSeparatorSideBySide",
          style: {
            ...w.read(c).toStyles(),
            borderRadius: g,
            borderTop: _,
            borderBottom: _,
            borderRight: _,
            boxSizing: "border-box"
          }
        }),
        Tn.div({
          class: "modifiedOverlaySideBySide",
          style: {
            ...v.read(c).toStyles(),
            borderRadius: g,
            border: m,
            boxSizing: "border-box",
            backgroundColor: je(c8e)
          }
        })
      ];
    })).keepUpdated(this._store), this._nonOverflowView = Tn.div({
      class: "inline-edits-view",
      style: {
        position: "absolute",
        overflow: "visible",
        top: "0px",
        left: "0px",
        display: this._display
      }
    }, [
      this._backgroundSvg,
      Ie(this, (c) => this._shouldOverflow.read(c) ? [] : [this._editorContainer, this._originalOverlay, this._modifiedOverlay])
    ]).keepUpdated(this._store), this._register(this._editorObs.createOverlayWidget({
      domNode: this._nonOverflowView.element,
      position: Br(null),
      allowEditorOverflow: !1,
      minContentWidthInPx: Ie(this, (c) => {
        var d;
        const u = (d = this._previewEditorLayoutInfo.read(c)) == null ? void 0 : d.maxContentWidth;
        return u === void 0 ? 0 : u;
      })
    })), this.previewEditor.setModel(this._previewTextModel), this._register(Xt((c) => {
      const u = this._previewEditorLayoutInfo.read(c);
      if (!u)
        return;
      const d = u.editRect.withMargin(-uP, -NI);
      this.previewEditor.layout({
        height: d.height,
        width: u.previewEditorWidth + 15
        /* Make sure editor does not scroll horizontally */
      }), this._editorContainer.element.style.top = `${d.top}px`, this._editorContainer.element.style.left = `${d.left}px`, this._editorContainer.element.style.width = `${u.previewEditorWidth + NI}px`;
    })), this._register(Xt((c) => {
      const u = this._previewEditorLayoutInfo.read(c);
      u && this._previewEditorObs.editor.setScrollLeft(u.desiredPreviewEditorScrollLeft);
    })), this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store);
  }
};
Gz = Rkt([
  QIe(5, xt),
  QIe(6, to)
], Gz);
var Mkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Pkt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const Hv = 1;
var TR;
let bN = (TR = class extends ge {
  constructor(e, t, n, r) {
    super(), this._editor = e, this._edit = t, this._tabAction = n, this._languageService = r, this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this._start = this._editor.observePosition(Br(this._edit.range.getStartPosition()), this._store), this._end = this._editor.observePosition(Br(this._edit.range.getEndPosition()), this._store), this._line = document.createElement("div"), this._hoverableElement = Qt(this, null), this.isHovered = this._hoverableElement.map((o, a) => (o == null ? void 0 : o.didMouseMoveDuringHover.read(a)) ?? !1), this._renderTextEffect = Ie(this, (o) => {
      var m;
      const a = this._editor.model.get(), l = a.getLineContent(this._edit.range.startLineNumber), c = Ya.replace(new Tt(this._edit.range.startColumn - 1, this._edit.range.endColumn - 1), this._edit.text), u = c.replace(l), d = (m = a.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber, [u])) == null ? void 0 : m[0];
      let h;
      d ? h = Oy.fromLineTokens(d).slice(c.getRangeAfterReplace()).toLineTokens(this._edit.text, this._languageService.languageIdCodec) : h = fo.createEmpty(this._edit.text, this._languageService.languageIdCodec);
      const g = PB(new FB([h]), By.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0), [], this._line, !0);
      this._line.style.width = `${g.minWidthInPx}px`;
    });
    const s = this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());
    this._layout = Ie(this, (o) => {
      this._renderTextEffect.read(o);
      const a = this._start.read(o), l = this._end.read(o);
      if (!a || !l || a.x > l.x || a.y > l.y)
        return;
      const c = s.read(o), u = this._editor.scrollLeft.read(o), d = this._editor.getOption(
        59
        /* EditorOption.fontInfo */
      ).read(o).typicalHalfwidthCharacterWidth, h = 3 * d, g = 4, m = new ha(h, g), _ = xr.fromPoints(a, l).withHeight(c).translateX(-u), v = xr.fromPointSize(_.getLeftBottom().add(m), new ha(this._edit.text.length * d, _.height)), w = v.withLeft(_.left);
      return {
        originalLine: _,
        modifiedLine: v,
        lowerBackground: w,
        lineHeight: c
      };
    }), this.minEditorScrollHeight = Ie(this, (o) => {
      const a = Sb(this._layout).read(o);
      return a ? a.read(o).modifiedLine.bottom + Hv + this._editor.editor.getScrollTop() : 0;
    }), this._root = Tn.div({
      class: "word-replacement"
    }, [
      Ie(this, (o) => {
        const a = Sb(this._layout).read(o);
        if (!a)
          return [];
        const l = WK(this._tabAction).map((u) => je(u)).read(o), c = _5(this._tabAction).map((u) => je(u)).read(o);
        return [
          Tn.div({
            style: {
              position: "absolute",
              ...Pf((u) => Upe(this._editor).read(u)),
              overflow: "hidden",
              pointerEvents: "none"
            }
          }, [
            Tn.div({
              style: {
                position: "absolute",
                ...Pf((u) => a.read(u).lowerBackground.withMargin(Hv, 2 * Hv, Hv, 0)),
                background: je(yo),
                //boxShadow: `${asCssVariable(scrollbarShadow)} 0 6px 6px -6px`,
                cursor: "pointer",
                pointerEvents: "auto"
              },
              onmousedown: (u) => {
                u.preventDefault();
              },
              onmouseup: (u) => this._onDidClick.fire(new vl(At(u), u)),
              obsRef: (u) => {
                this._hoverableElement.set(u, void 0);
              }
            }),
            Tn.div({
              style: {
                position: "absolute",
                ...Pf((u) => a.read(u).modifiedLine.withMargin(Hv, 2 * Hv)),
                fontFamily: this._editor.getOption(
                  58
                  /* EditorOption.fontFamily */
                ),
                fontSize: this._editor.getOption(
                  61
                  /* EditorOption.fontSize */
                ),
                fontWeight: this._editor.getOption(
                  62
                  /* EditorOption.fontWeight */
                ),
                pointerEvents: "none",
                boxSizing: "border-box",
                borderRadius: "4px",
                border: `${Hv}px solid ${c}`,
                background: je(JTt),
                display: "flex",
                justifyContent: "center",
                alignItems: "center",
                outline: `2px solid ${je(yo)}`
              }
            }, [this._line]),
            Tn.div({
              style: {
                position: "absolute",
                ...Pf((u) => a.read(u).originalLine.withMargin(Hv)),
                boxSizing: "border-box",
                borderRadius: "4px",
                border: `${Hv}px solid ${l}`,
                background: je(ZTt),
                pointerEvents: "none"
              }
            }, []),
            Tn.svg({
              width: 11,
              height: 14,
              viewBox: "0 0 11 14",
              fill: "none",
              style: {
                position: "absolute",
                left: a.map((u) => u.modifiedLine.left - 16),
                top: a.map((u) => u.modifiedLine.top + Math.round((u.lineHeight - 14 - 5) / 2))
              }
            }, [
              Tn.svgElem("path", {
                d: "M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",
                stroke: je(ELe)
              }),
              Tn.svgElem("path", {
                d: "M6 7.5L9.99999 10.49998L6 13.5",
                stroke: je(ELe)
              })
            ])
          ])
        ];
      })
    ]).keepUpdated(this._store), this._register(this._editor.createOverlayWidget({
      domNode: this._root.element,
      minContentWidthInPx: Br(0),
      position: Br({ preference: { top: 0, left: 0 } }),
      allowEditorOverflow: !1
    }));
  }
}, TR.MAX_LENGTH = 100, TR);
bN = Mkt([
  Pkt(3, Gr)
], bN);
class Fkt extends ge {
  constructor(e, t, n) {
    super(), this._originalEditor = e, this._state = t, this._modifiedTextModel = n, this._onDidClick = this._register(new he()), this.onDidClick = this._onDidClick.event, this.isHovered = Ms(this._originalEditor).isTargetHovered((s) => {
      var o;
      return s.target.type === 6 && ((o = s.target.detail.injectedText) == null ? void 0 : o.options.attachedData) instanceof xte && s.target.detail.injectedText.options.attachedData.owner === this;
    }, this._store), this._tokenizationFinished = Wkt(this._modifiedTextModel), this._decorations = Ie(this, (s) => {
      var N, R;
      const o = this._state.read(s);
      if (!o)
        return;
      const a = o.modifiedText, l = o.mode === "insertionInline", c = o.diff.length === 1 && ((N = o.diff[0].innerChanges) == null ? void 0 : N.length) === 1, u = !0, d = [], h = [], g = dn.register({
        className: "inlineCompletions-line-insert",
        description: "line-insert",
        isWholeLine: !0,
        marginClassName: "gutter-insert"
      }), m = dn.register({
        className: "inlineCompletions-line-delete",
        description: "line-delete",
        isWholeLine: !0,
        marginClassName: "gutter-delete"
      }), _ = dn.register({
        className: "inlineCompletions-char-delete",
        description: "char-delete",
        isWholeLine: !1,
        zIndex: 1
        // be on top of diff background decoration
      }), v = dn.register({
        className: "inlineCompletions-char-insert",
        description: "char-insert",
        isWholeLine: !0
      }), w = dn.register({
        className: "inlineCompletions-char-insert",
        description: "char-insert",
        shouldFillLineOnLineBreak: !0
      }), E = dn.register({
        className: "inlineCompletions-char-insert diff-range-empty",
        description: "char-insert diff-range-empty"
      }), L = dn.register({
        className: "inlineCompletions-original-lines",
        description: "inlineCompletions-original-lines",
        isWholeLine: !1,
        shouldFillLineOnLineBreak: !0
      }), T = o.mode !== "sideBySide" && o.mode !== "deletion" && o.mode !== "insertionInline" && o.mode !== "lineReplacement", D = o.mode === "lineReplacement";
      for (const M of o.diff)
        if (T && (M.original.isEmpty || d.push({
          range: M.original.toInclusiveRange(),
          options: m
        }), M.modified.isEmpty || h.push({
          range: M.modified.toInclusiveRange(),
          options: g
        })), M.modified.isEmpty || M.original.isEmpty)
          M.original.isEmpty || d.push({ range: M.original.toInclusiveRange(), options: _ }), M.modified.isEmpty || h.push({ range: M.modified.toInclusiveRange(), options: v });
        else {
          const B = l && Bkt(M);
          for (const H of M.innerChanges || []) {
            if (M.original.contains(H.originalRange.startLineNumber) && !(D && H.originalRange.isEmpty())) {
              const j = (R = this._originalEditor.getModel()) == null ? void 0 : R.getValueInRange(H.originalRange, 1);
              d.push({
                range: H.originalRange,
                options: {
                  description: "char-delete",
                  shouldFillLineOnLineBreak: !1,
                  className: bte("inlineCompletions-char-delete", H.originalRange.isSingleLine() && o.mode === "insertionInline" && "single-line-inline", H.originalRange.isEmpty() && "empty", (H.originalRange.isEmpty() && c || o.mode === "deletion" && j === `
`) && u && !B && "diff-range-empty"),
                  inlineClassName: B ? bte("strike-through", "inlineCompletions") : null,
                  zIndex: 1
                }
              });
            }
            if (M.modified.contains(H.modifiedRange.startLineNumber) && h.push({
              range: H.modifiedRange,
              options: H.modifiedRange.isEmpty() && u && !B && c ? E : w
            }), B) {
              const j = a.getValueOfRange(H.modifiedRange), K = j.length > 3 ? [
                { text: j.slice(0, 1), extraClasses: ["start"], offsetRange: new Tt(H.modifiedRange.startColumn - 1, H.modifiedRange.startColumn) },
                { text: j.slice(1, -1), extraClasses: [], offsetRange: new Tt(H.modifiedRange.startColumn, H.modifiedRange.endColumn - 2) },
                { text: j.slice(-1), extraClasses: ["end"], offsetRange: new Tt(H.modifiedRange.endColumn - 2, H.modifiedRange.endColumn - 1) }
              ] : [
                { text: j, extraClasses: ["start", "end"], offsetRange: new Tt(H.modifiedRange.startColumn - 1, H.modifiedRange.endColumn) }
              ];
              this._tokenizationFinished.read(s);
              const X = this._modifiedTextModel.tokenization.getLineTokens(H.modifiedRange.startLineNumber);
              for (const { text: Y, extraClasses: G, offsetRange: Q } of K)
                d.push({
                  range: z.fromPositions(H.originalRange.getEndPosition()),
                  options: {
                    description: "inserted-text",
                    before: {
                      tokens: X.getTokensInRange(Q),
                      content: Y,
                      inlineClassName: bte(
                        "inlineCompletions-char-insert",
                        H.modifiedRange.isSingleLine() && o.mode === "insertionInline" && "single-line-inline",
                        ...G
                        // include extraClasses for additional styling if provided
                      ),
                      cursorStops: Af.None,
                      attachedData: new xte(this)
                    },
                    zIndex: 2,
                    showIfCollapsed: !0
                  }
                });
            }
          }
        }
      if (o.isInDiffEditor)
        for (const M of o.diff)
          M.original.isEmpty || d.push({
            range: M.original.toExclusiveRange(),
            options: L
          });
      return { originalDecorations: d, modifiedDecorations: h };
    }), this._register(Ms(this._originalEditor).setDecorations(this._decorations.map((s) => (s == null ? void 0 : s.originalDecorations) ?? [])));
    const r = this._state.map((s) => s == null ? void 0 : s.modifiedCodeEditor);
    this._register(Ql((s, o) => {
      const a = r.read(s);
      a && o.add(Ms(a).setDecorations(this._decorations.map((l) => (l == null ? void 0 : l.modifiedDecorations) ?? [])));
    })), this._register(this._originalEditor.onMouseUp((s) => {
      var a;
      if (s.target.type !== 6)
        return;
      const o = (a = s.target.detail.injectedText) == null ? void 0 : a.options.attachedData;
      o instanceof xte && o.owner === this && this._onDidClick.fire(s.event);
    }));
  }
}
class xte {
  constructor(e) {
    this.owner = e;
  }
}
function Bkt(i) {
  return i.innerChanges ? i.innerChanges.every((e) => PU(e.modifiedRange) && PU(e.originalRange)) : !1;
}
let Hkt = 0;
function Wkt(i) {
  return ji(i.onDidChangeTokens, () => Hkt++);
}
var Vkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Ukt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Nae = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._editor = e, this._host = t, this._model = n, this._ghostTextIndicator = r, this._focusIsInMenu = s, this._instantiationService = o, this._editorObs = Ms(this._editor), this._tabAction = Ie((u) => {
      var d;
      return ((d = this._model.read(u)) == null ? void 0 : d.tabAction.read(u)) ?? Kl.Inactive;
    }), this._constructorDone = Qt(this, !1), this._uiState = Ie(this, (u) => {
      var E, L;
      const d = this._model.read(u);
      if (!d || !this._constructorDone.read(u))
        return;
      const h = d.inlineEdit;
      let g = nu.fromEdit(h.edit), m = h.edit.apply(h.originalText), _ = AU(g, h.originalText, new u1(m)), v = this.determineRenderState(d, u, _, new u1(m));
      if (!v) {
        d.abort(`unable to determine view: tried to render ${(E = this._previousView) == null ? void 0 : E.view}`);
        return;
      }
      if (v.kind === yr.SideBySide) {
        const T = dkt(m, h.modifiedLineRange, l.getOptions().tabSize);
        m = T.applyToString(m), g = akt(g, T), _ = AU(g, h.originalText, new u1(m));
      }
      return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()), this._previewTextModel.getValue() !== m && this._previewTextModel.setValue(m), d.showCollapsed.read(u) && !((L = this._indicator.read(u)) != null && L.isHoverVisible.read(u)) && (v = { kind: yr.Collapsed, viewData: v.viewData }), d.handleInlineEditShown(v.kind, v.viewData), {
        state: v,
        diff: _,
        edit: h,
        newText: m,
        newTextLineCount: h.modifiedLineRange.length,
        isInDiffEditor: d.isInDiffEditor
      };
    }), this._previewTextModel = this._register(this._instantiationService.createInstance(cT, "", this._editor.getModel().getLanguageId(), { ...cT.DEFAULT_CREATION_OPTIONS, bracketPairColorizationOptions: { enabled: !0, independentColorPoolPerBracketType: !1 } }, null)), this._indicatorCyclicDependencyCircuitBreaker = Qt(this, !1), this._indicator = Ie(this, (u) => {
      if (!this._indicatorCyclicDependencyCircuitBreaker.read(u))
        return;
      const d = pl({ owner: this, equalsFn: cx(qhe()) }, (g) => {
        var v, w, E;
        const m = this._ghostTextIndicator.read(g);
        if (m)
          return m.lineRange;
        const _ = this._uiState.read(g);
        if (_) {
          if (((v = _.state) == null ? void 0 : v.kind) === "custom") {
            const L = (w = _.state.displayLocation) == null ? void 0 : w.range;
            if (!L)
              throw new Wt("custom view should have a range");
            return new Zt(L.startLineNumber, L.endLineNumber);
          }
          return ((E = _.state) == null ? void 0 : E.kind) === "insertionMultiLine" ? this._insertion.originalLines.read(g) : _.edit.displayRange;
        }
      }), h = Ie(this, (g) => {
        const m = this._model.read(g);
        if (m)
          return m;
        const _ = this._ghostTextIndicator.read(g);
        return _ ? _.model : m;
      });
      return u.store.add(this._instantiationService.createInstance(xae, this._editorObs, d, this._gutterIndicatorOffset, h, this._inlineEditsIsHovered, this._focusIsInMenu));
    }), this._inlineEditsIsHovered = Ie(this, (u) => this._sideBySide.isHovered.read(u) || this._wordReplacementViews.read(u).some((d) => d.isHovered.read(u)) || this._deletion.isHovered.read(u) || this._inlineDiffView.isHovered.read(u) || this._lineReplacementView.isHovered.read(u) || this._insertion.isHovered.read(u) || this._customView.isHovered.read(u)), this._gutterIndicatorOffset = Ie(this, (u) => {
      var h, g;
      if (((g = (h = this._uiState.read(u)) == null ? void 0 : h.state) == null ? void 0 : g.kind) === "insertionMultiLine")
        return this._insertion.startLineOffset.read(u);
      const d = this._ghostTextIndicator.read(u);
      return d ? jkt(d, this._editor) : 0;
    }), this._sideBySide = this._register(this._instantiationService.createInstance(Gz, this._editor, this._model.map((u) => u == null ? void 0 : u.inlineEdit), this._previewTextModel, this._uiState.map((u) => {
      var d;
      return u && ((d = u.state) == null ? void 0 : d.kind) === yr.SideBySide ? {
        newTextLineCount: u.newTextLineCount,
        isInDiffEditor: u.isInDiffEditor
      } : void 0;
    }), this._tabAction)), this._deletion = this._register(this._instantiationService.createInstance(Lkt, this._editor, this._model.map((u) => u == null ? void 0 : u.inlineEdit), this._uiState.map((u) => {
      var d;
      return u && ((d = u.state) == null ? void 0 : d.kind) === yr.Deletion ? {
        originalRange: u.state.originalRange,
        deletions: u.state.deletions,
        inDiffEditor: u.isInDiffEditor
      } : void 0;
    }), this._tabAction)), this._insertion = this._register(this._instantiationService.createInstance(Dae, this._editor, this._uiState.map((u) => {
      var d;
      return u && ((d = u.state) == null ? void 0 : d.kind) === yr.InsertionMultiLine ? {
        lineNumber: u.state.lineNumber,
        startColumn: u.state.column,
        text: u.state.text,
        inDiffEditor: u.isInDiffEditor
      } : void 0;
    }), this._tabAction)), this._inlineDiffViewState = Ie(this, (u) => {
      const d = this._uiState.read(u);
      if (!(!d || !d.state) && !(d.state.kind === "wordReplacements" || d.state.kind === "insertionMultiLine" || d.state.kind === "collapsed" || d.state.kind === "custom"))
        return {
          modifiedText: new u1(d.newText),
          diff: d.diff,
          mode: d.state.kind,
          modifiedCodeEditor: this._sideBySide.previewEditor,
          isInDiffEditor: d.isInDiffEditor
        };
    }), this._inlineCollapsedView = this._register(this._instantiationService.createInstance(Tae, this._editor, this._model.map((u, d) => {
      var h, g;
      return ((g = (h = this._uiState.read(d)) == null ? void 0 : h.state) == null ? void 0 : g.kind) === "collapsed" ? u == null ? void 0 : u.inlineEdit : void 0;
    }))), this._customView = this._register(this._instantiationService.createInstance(kae, this._editor, this._model.map((u, d) => {
      var h, g;
      return ((g = (h = this._uiState.read(d)) == null ? void 0 : h.state) == null ? void 0 : g.kind) === "custom" ? u == null ? void 0 : u.displayLocation : void 0;
    }), this._tabAction)), this._inlineDiffView = this._register(new Fkt(this._editor, this._inlineDiffViewState, this._previewTextModel)), this._wordReplacementViews = Zhe(this, this._uiState.map((u) => {
      var d;
      return ((d = u == null ? void 0 : u.state) == null ? void 0 : d.kind) === "wordReplacements" ? u.state.replacements : [];
    }), (u, d) => d.add(this._instantiationService.createInstance(bN, this._editorObs, u, this._tabAction))), this._lineReplacementView = this._register(this._instantiationService.createInstance(Iae, this._editorObs, this._uiState.map((u) => {
      var d;
      return ((d = u == null ? void 0 : u.state) == null ? void 0 : d.kind) === yr.LineReplacement ? {
        originalRange: u.state.originalRange,
        modifiedRange: u.state.modifiedRange,
        modifiedLines: u.state.modifiedLines,
        replacements: u.state.replacements
      } : void 0;
    }), this._uiState.map((u) => (u == null ? void 0 : u.isInDiffEditor) ?? !1), this._tabAction)), this._useCodeShifting = this._editorObs.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).map((u) => u.edits.allowCodeShifting), this._renderSideBySide = this._editorObs.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).map((u) => u.edits.renderSideBySide), this._register(Ql((u, d) => {
      const h = this._model.read(u);
      h && d.add(Ze.any(this._sideBySide.onDidClick, this._deletion.onDidClick, this._lineReplacementView.onDidClick, this._insertion.onDidClick, ...this._wordReplacementViews.read(u).map((g) => g.onDidClick), this._inlineDiffView.onDidClick, this._customView.onDidClick)((g) => {
        this._viewHasBeenShownLongerThan(350) && (g.preventDefault(), h.accept());
      }));
    })), this._indicator.recomputeInitiallyAndOnChange(this._store), this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store), this._indicatorCyclicDependencyCircuitBreaker.set(!0, void 0), this._register(this._instantiationService.createInstance(Lae, this._host, this._model, this._indicator, this._inlineCollapsedView));
    const a = Ie(this, (u) => Math.max(...this._wordReplacementViews.read(u).map((d) => d.minEditorScrollHeight.read(u)), this._lineReplacementView.minEditorScrollHeight.read(u), this._customView.minEditorScrollHeight.read(u))).recomputeInitiallyAndOnChange(this._store), l = this._editor.getModel();
    let c;
    this._register(Xt((u) => {
      const d = a.read(u);
      this._editor.changeViewZones((h) => {
        const g = this._editor.getScrollHeight(), m = d - g + 1;
        m !== 0 && c && (h.removeZone(c), c = void 0), !(m <= 0) && (c = h.addZone({
          afterLineNumber: l.getLineCount(),
          heightInPx: m,
          domNode: Ge("div.minScrollHeightViewZone")
        }));
      });
    })), this._constructorDone.set(!0, void 0);
  }
  getCacheId(e) {
    return e.inlineEdit.inlineCompletion.identity.id;
  }
  determineView(e, t, n, r) {
    var h, g, m, _;
    const s = e.inlineEdit, o = ((h = this._previousView) == null ? void 0 : h.id) === this.getCacheId(e), a = ((g = this._previousView) == null ? void 0 : g.editorWidth) !== this._editorObs.layoutInfoWidth.read(t) && (((m = this._previousView) == null ? void 0 : m.view) === yr.SideBySide || ((_ = this._previousView) == null ? void 0 : _.view) === yr.LineReplacement);
    if (o && !a)
      return this._previousView.view;
    if (e.displayLocation)
      return yr.Custom;
    const l = s.originalLineRange.length, c = s.modifiedLineRange.length, u = n.flatMap((v) => v.innerChanges ?? []), d = u.length === 1;
    if (!e.isInDiffEditor) {
      if (d && this._useCodeShifting.read(t) !== "never" && p8e(n))
        return zkt(n, s.cursorPosition) ? yr.InsertionInline : yr.LineReplacement;
      if (tNe(u, s, r))
        return yr.Deletion;
      if (eNe(n) && this._useCodeShifting.read(t) === "always")
        return yr.InsertionMultiLine;
      if (u.every((w) => ta.ofRange(w.originalRange).columnCount < bN.MAX_LENGTH && ta.ofRange(w.modifiedRange).columnCount < bN.MAX_LENGTH) && d && l === 1 && c === 1) {
        const w = u.map((L) => r.getValueOfRange(L.modifiedRange)), E = u.map((L) => e.inlineEdit.originalText.getValueOfRange(L.originalRange));
        if (!w.some((L) => L.includes("	")) && !E.some((L) => L.includes("	")) && (!u.some((L) => L.originalRange.isEmpty()) || !nNe(u.map((L) => new Wo(L.originalRange, "")), s.originalText).some((L) => L.range.isEmpty() && ta.ofRange(L.range).columnCount < bN.MAX_LENGTH)))
          return yr.WordReplacements;
      }
    }
    if (l > 0 && c > 0)
      return l === 1 && c === 1 && !e.isInDiffEditor ? yr.LineReplacement : this._renderSideBySide.read(t) !== "never" && Gz.fitsInsideViewport(this._editor, this._previewTextModel, s, t) ? yr.SideBySide : yr.LineReplacement;
    if (e.isInDiffEditor) {
      if (tNe(u, s, r))
        return yr.Deletion;
      if (eNe(n) && this._useCodeShifting.read(t) === "always")
        return yr.InsertionMultiLine;
    }
    return yr.SideBySide;
  }
  determineRenderState(e, t, n, r) {
    const s = e.inlineEdit, o = this.determineView(e, t, n, r);
    this._previousView = { id: this.getCacheId(e), view: o, editorWidth: this._editor.getLayoutInfo().width, timestamp: Date.now() };
    const a = n.flatMap((m) => m.innerChanges ?? []), l = this._editor.getModel(), c = a.map((m) => ({
      originalRange: m.originalRange,
      modifiedRange: m.modifiedRange,
      original: l.getValueInRange(m.originalRange),
      modified: r.getValueOfRange(m.modifiedRange)
    })), u = s.cursorPosition, d = c[0].modified.startsWith(l.getEOL()), h = {
      cursorColumnDistance: s.edit.replacements[0].range.getStartPosition().column - u.column,
      cursorLineDistance: s.lineEdit.lineRange.startLineNumber - u.lineNumber + (d && s.lineEdit.lineRange.startLineNumber >= u.lineNumber ? 1 : 0),
      lineCountOriginal: s.lineEdit.lineRange.length,
      lineCountModified: s.lineEdit.newLines.length,
      characterCountOriginal: c.reduce((m, _) => m + _.original.length, 0),
      characterCountModified: c.reduce((m, _) => m + _.modified.length, 0),
      disjointReplacements: c.length,
      sameShapeReplacements: c.every((m) => m.original === c[0].original && m.modified === c[0].modified)
    };
    switch (o) {
      case yr.InsertionInline:
        return { kind: yr.InsertionInline, viewData: h };
      case yr.SideBySide:
        return { kind: yr.SideBySide, viewData: h };
      case yr.Collapsed:
        return { kind: yr.Collapsed, viewData: h };
      case yr.Custom:
        return { kind: yr.Custom, displayLocation: e.displayLocation, viewData: h };
    }
    if (o === yr.Deletion)
      return {
        kind: yr.Deletion,
        originalRange: s.originalLineRange,
        deletions: a.map((m) => m.originalRange),
        viewData: h
      };
    if (o === yr.InsertionMultiLine) {
      const m = a[0];
      return {
        kind: yr.InsertionMultiLine,
        lineNumber: m.originalRange.startLineNumber,
        column: m.originalRange.startColumn,
        text: r.getValueOfRange(m.modifiedRange),
        viewData: h
      };
    }
    const g = c.map((m) => new Wo(m.originalRange, m.modified));
    if (g.length !== 0) {
      if (o === yr.WordReplacements) {
        let m = $kt(g, s.originalText);
        return m.some((_) => _.range.isEmpty()) && (m = nNe(g, s.originalText)), {
          kind: yr.WordReplacements,
          replacements: m,
          viewData: h
        };
      }
      if (o === yr.LineReplacement)
        return {
          kind: yr.LineReplacement,
          originalRange: s.originalLineRange,
          modifiedRange: s.modifiedLineRange,
          modifiedLines: s.modifiedLineRange.mapToLineArray((m) => r.getLineAt(m)),
          replacements: a.map((m) => ({ originalRange: m.originalRange, modifiedRange: m.modifiedRange })),
          viewData: h
        };
    }
  }
  _viewHasBeenShownLongerThan(e) {
    var r;
    const t = (r = this._previousView) == null ? void 0 : r.timestamp;
    if (!t)
      throw new Wt("viewHasBeenShownLongThan called before a view has been shown");
    return Date.now() - t >= e;
  }
};
Nae = Vkt([
  Ukt(5, xt)
], Nae);
function p8e(i) {
  return i.every((t) => t.innerChanges.every((n) => e(n)));
  function e(t) {
    return !(!t.originalRange.isEmpty() || !(t.modifiedRange.startLineNumber === t.modifiedRange.endLineNumber));
  }
}
function zkt(i, e) {
  if (!e || !p8e(i))
    return !1;
  const t = e;
  return i.every((r) => r.innerChanges.every((s) => n(s)));
  function n(r) {
    const s = r.originalRange.getStartPosition();
    return !!(t.isBeforeOrEqual(s) || s.lineNumber < t.lineNumber);
  }
}
function eNe(i) {
  const e = i.flatMap((n) => n.innerChanges ?? []);
  if (e.length !== 1)
    return !1;
  const t = e[0];
  return !(!t.originalRange.isEmpty() || t.modifiedRange.startLineNumber === t.modifiedRange.endLineNumber);
}
function tNe(i, e, t) {
  return i.map((r) => ({ original: e.originalText.getValueOfRange(r.originalRange), modified: t.getValueOfRange(r.modifiedRange) })).every(({ original: r, modified: s }) => s.trim() === "" && r.length > 0 && (r.length > s.length || r.trim() !== ""));
}
function $kt(i, e) {
  return m8e(i, e, (t) => /^[a-zA-Z]$/.test(t));
}
function nNe(i, e) {
  return m8e(i, e, (t) => !/^\s$/.test(t));
}
function m8e(i, e, t) {
  const n = [];
  i.sort((s, o) => z.compareRangesUsingStarts(s.range, o.range));
  for (const s of i) {
    let o = s.range.startColumn - 1, a = s.range.endColumn - 2, l = "", c = "";
    const u = e.getLineAt(s.range.startLineNumber), d = e.getLineAt(s.range.endLineNumber);
    if (r(u[o]))
      for (; r(u[o - 1]); )
        l = u[o - 1] + l, o--;
    if (r(d[a]) || a < o)
      for (; r(d[a + 1]); )
        c += d[a + 1], a++;
    let h = new Wo(new z(s.range.startLineNumber, o + 1, s.range.endLineNumber, a + 2), l + s.text + c);
    n.length > 0 && z.areIntersectingOrTouching(n[n.length - 1].range, h.range) && (h = Wo.joinReplacements([n.pop(), h], e)), n.push(h);
  }
  function r(s) {
    return s === void 0 ? !1 : t(s);
  }
  return n;
}
function jkt(i, e) {
  const t = i.model.inlineEdit.edit.replacements;
  if (t.length !== 1)
    return 0;
  const n = e.getModel();
  if (!n)
    return 0;
  const r = n.getEOL(), s = t[0];
  if (s.range.isEmpty() && s.text.startsWith(r)) {
    const o = e.getLineHeightForPosition(s.range.getStartPosition());
    return Gkt(s.text, r) * o;
  }
  return 0;
}
function Gkt(i, e) {
  if (!e.length)
    return 0;
  let t = 0, n = 0;
  for (; i.startsWith(e, n); )
    t++, n += e.length;
  return t;
}
var qkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Kkt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Rae, IL;
let Aae = (IL = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._editor = e, this._edit = t, this._model = n, this._focusIsInMenu = r, this._inlineEdit = Ie(this, (o) => {
      var m;
      const a = this._model.read(o);
      if (!a)
        return;
      const l = this._edit.read(o);
      if (!l)
        return;
      const c = this._editor.getModel();
      if (!c)
        return;
      const u = (m = a.inlineEditState.read(void 0)) == null ? void 0 : m.inlineCompletion.updatedEdit;
      if (!u)
        return;
      const d = u.replacements.map((_) => {
        const v = z.fromPositions(c.getPositionAt(_.replaceRange.start), c.getPositionAt(_.replaceRange.endExclusive));
        return new Wo(v, _.newText);
      }), h = new Md(d), g = new gT(c);
      return new r8e(g, h, a.primaryPosition.read(void 0), l.commands, l.inlineCompletion);
    }), this._inlineEditModel = Ie(this, (o) => {
      const a = this._model.read(o);
      if (!a)
        return;
      const l = this._inlineEdit.read(o);
      if (!l)
        return;
      const c = Ie(this, (u) => {
        if (this._editorObs.isFocused.read(u)) {
          if (a.tabShouldJumpToInlineEdit.read(u))
            return Kl.Jump;
          if (a.tabShouldAcceptInlineEdit.read(u))
            return Kl.Accept;
        }
        return Kl.Inactive;
      });
      return new s8e(a, l, c);
    }), this._inlineEditHost = Ie(this, (o) => {
      const a = this._model.read(o);
      if (a)
        return new UTt(a);
    }), this._ghostTextIndicator = Ie(this, (o) => {
      const a = this._model.read(o);
      if (!a)
        return;
      const l = a.inlineCompletionState.read(o);
      if (!l)
        return;
      const c = l.inlineCompletion;
      if (!c || !c.showInlineEditMenu)
        return;
      const u = Zt.ofLength(l.primaryGhostText.lineNumber, 1);
      return new zTt(this._editor, a, u, c);
    }), this._editorObs = Ms(this._editor), this._register(s.createInstance(Nae, this._editor, this._inlineEditHost, this._inlineEditModel, this._ghostTextIndicator, this._focusIsInMenu));
  }
}, Rae = IL, IL.hot = cK(Rae), IL);
Aae = Rae = qkt([
  Kkt(4, xt)
], Aae);
var Ykt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Xkt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Oae = class extends ge {
  constructor(e, t, n, r) {
    super(), this._editor = e, this._model = t, this._focusIsInMenu = n, this._instantiationService = r, this._ghostTexts = Ie(this, (s) => {
      const o = this._model.read(s);
      return (o == null ? void 0 : o.ghostTexts.read(s)) ?? [];
    }), this._stablizedGhostTexts = mLt(this._ghostTexts, this._store), this._editorObs = Ms(this._editor), this._ghostTextWidgets = Zhe(this, this._stablizedGhostTexts, (s, o) => xf((a) => this._instantiationService.createInstance(p5.hot.read(a), this._editor, {
      ghostText: s,
      warning: this._model.map((l, c) => {
        var d;
        const u = (d = l == null ? void 0 : l.warning) == null ? void 0 : d.read(c);
        return u ? { icon: u.icon } : void 0;
      }),
      minReservedLineCount: Br(0),
      targetTextModel: this._model.map((l) => l == null ? void 0 : l.textModel),
      handleInlineCompletionShown: this._model.map((l, c) => {
        var d;
        const u = (d = l == null ? void 0 : l.inlineCompletionState.read(c)) == null ? void 0 : d.inlineCompletion;
        return u ? (h) => l.handleInlineSuggestionShown(u, yr.GhostText, h) : () => {
        };
      })
    }, this._editorObs.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).map((l) => ({ syntaxHighlightingEnabled: l.syntaxHighlightingEnabled })), !1, !1)).recomputeInitiallyAndOnChange(o)).recomputeInitiallyAndOnChange(this._store), this._inlineEdit = Ie(this, (s) => {
      var o, a;
      return (a = (o = this._model.read(s)) == null ? void 0 : o.inlineEditState.read(s)) == null ? void 0 : a.inlineEdit;
    }), this._everHadInlineEdit = u0(this, (s, o) => {
      var a, l, c;
      return o || !!this._inlineEdit.read(s) || !!((c = (l = (a = this._model.read(s)) == null ? void 0 : a.inlineCompletionState.read(s)) == null ? void 0 : l.inlineCompletion) != null && c.showInlineEditMenu);
    }), this._inlineEditWidget = xf((s) => {
      if (this._everHadInlineEdit.read(s))
        return this._instantiationService.createInstance(Aae.hot.read(s), this._editor, this._inlineEdit, this._model, this._focusIsInMenu);
    }).recomputeInitiallyAndOnChange(this._store), this._fontFamily = this._editorObs.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).map((s) => s.fontFamily), this._register(Eat(Ie((s) => `
.monaco-editor .ghost-text-decoration,
.monaco-editor .ghost-text-decoration-preview,
.monaco-editor .ghost-text {
	font-family: ${this._fontFamily.read(s)};
}`))), this._register(new Zse(this._editor, this._model, this._instantiationService));
  }
  shouldShowHoverAtViewZone(e) {
    var t;
    return ((t = this._ghostTextWidgets.get()[0]) == null ? void 0 : t.get().ownsViewZone(e)) ?? !1;
  }
};
Oae = Ykt([
  Xkt(3, xt)
], Oae);
var Zkt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Wv = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Ip, Ny;
let du = (Ny = class extends ge {
  /**
   * Find the controller in the focused editor or in the outer editor (if applicable)
   */
  static getInFocusedEditorOrParent(e) {
    const t = PBe(e);
    return t ? Ip.get(t) : null;
  }
  static get(e) {
    return qxt(e.getContribution(Ip.ID));
  }
  constructor(e, t, n, r, s, o, a, l, c, u) {
    super(), this.editor = e, this._instantiationService = t, this._contextKeyService = n, this._configurationService = r, this._commandService = s, this._debounceService = o, this._languageFeaturesService = a, this._accessibilitySignalService = l, this._keybindingService = c, this._accessibilityService = u, this._editorObs = Ms(this.editor), this._positions = Ie(this, (m) => {
      var _;
      return ((_ = this._editorObs.selections.read(m)) == null ? void 0 : _.map((v) => v.getEndPosition())) ?? [new de(1, 1)];
    }), this._suggestWidgetAdapter = this._register(new MTt(this._editorObs, (m) => {
      var _;
      return (_ = this.model.get()) == null ? void 0 : _.handleSuggestAccepted(m);
    }, () => {
      var m, _;
      return (_ = (m = this.model.get()) == null ? void 0 : m.selectedInlineCompletion.get()) == null ? void 0 : _.getSingleTextEdit();
    })), this._enabledInConfig = ji(this, this.editor.onDidChangeConfiguration, () => this.editor.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).enabled), this._isScreenReaderEnabled = ji(this, this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized()), this._editorDictationInProgress = ji(this, this._contextKeyService.onDidChangeContext, () => this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress") === !0), this._enabled = Ie(this, (m) => this._enabledInConfig.read(m) && (!this._isScreenReaderEnabled.read(m) || !this._editorDictationInProgress.read(m))), this._debounceValue = this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider, "InlineCompletionsDebounce", { min: 50, max: 50 }), this._focusIsInMenu = Qt(this, !1), this._focusIsInEditorOrMenu = Ie(this, (m) => {
      const _ = this._editorObs.isFocused.read(m), v = this._focusIsInMenu.read(m);
      return _ || v;
    }), this._cursorIsInIndentation = Ie(this, (m) => {
      const _ = this._editorObs.cursorPosition.read(m);
      if (_ === null)
        return !1;
      const v = this._editorObs.model.read(m);
      if (!v)
        return !1;
      this._editorObs.versionId.read(m);
      const w = v.getLineIndentColumn(_.lineNumber);
      return _.column <= w;
    }), this.model = xf(this, (m) => {
      if (this._editorObs.isReadonly.read(m))
        return;
      const _ = this._editorObs.model.read(m);
      return _ ? this._instantiationService.createInstance(sae, _, this._suggestWidgetAdapter.selectedItem, this._editorObs.versionId, this._positions, this._debounceValue, this._enabled, this.editor) : void 0;
    }).recomputeInitiallyAndOnChange(this._store), this._playAccessibilitySignal = Nf(this), this._hideInlineEditOnSelectionChange = this._editorObs.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).map((m) => !0), this._view = this._register(this._instantiationService.createInstance(Oae, this.editor, this.model, this._focusIsInMenu)), Ip._instances.add(this), this._register(Et(() => Ip._instances.delete(this))), this._register(Xt((m) => {
      var E, L;
      const _ = this.model.read(m);
      if (!_)
        return;
      const v = _.state.read(m);
      if (!v || !this._focusIsInEditorOrMenu.read(void 0))
        return;
      const w = v.kind === "inlineEdit" ? v.nextEditUri : void 0;
      for (const T of Ip._instances)
        T !== this && (w && rw(w, (E = T.editor.getModel()) == null ? void 0 : E.uri) ? (L = T.model.read(void 0)) == null || L.trigger() : T.reject());
    })), this._register(Xt((m) => {
      var w;
      const _ = this.model.read(m), v = (w = this.editor.getModel()) == null ? void 0 : w.uri;
      !_ || !v || m.store.add(_.onDidAccept(() => {
        var E, L;
        for (const T of Ip._instances) {
          if (T === this)
            continue;
          const D = (E = T.model.read(void 0)) == null ? void 0 : E.state.read(void 0);
          (D == null ? void 0 : D.kind) === "inlineEdit" && rw(D.nextEditUri, v) && ((L = T.model.read(void 0)) == null || L.stop("automatic"));
        }
      }));
    })), this._register(rm(this._editorObs.onDidType, (m, _) => {
      var v;
      this._enabled.get() && ((v = this.model.get()) == null || v.trigger());
    })), this._register(rm(this._editorObs.onDidPaste, (m, _) => {
      var v;
      this._enabled.get() && ((v = this.model.get()) == null || v.trigger());
    })), this._register(this._commandService.onDidExecuteCommand((m) => {
      if ((/* @__PURE__ */ new Set([
        KN.Tab.id,
        KN.DeleteLeft.id,
        KN.DeleteRight.id,
        t5,
        "acceptSelectedSuggestion"
      ])).has(m.commandId) && e.hasTextFocus() && this._enabled.get()) {
        let v = !1;
        m.commandId === t5 && (v = !0), this._editorObs.forceUpdate((w) => {
          var E;
          (E = this.model.get()) == null || E.trigger(w, { noDelay: v });
        });
      }
    })), this._register(rm(this._editorObs.selections, (m, _, v) => {
      var w, E, L, T;
      if (v.some((D) => D.reason === 3 || D.source === "api")) {
        if (!this._hideInlineEditOnSelectionChange.get() && ((E = (w = this.model.get()) == null ? void 0 : w.state.get()) == null ? void 0 : E.kind) === "inlineEdit")
          return;
        const D = this.model.get();
        if (!D)
          return;
        ((L = D.state.get()) == null ? void 0 : L.kind) === "ghostText" && ((T = this.model.get()) == null || T.stop());
      }
    })), this._register(Xt((m) => {
      var w, E;
      const _ = this._focusIsInEditorOrMenu.read(m), v = this.model.read(void 0);
      if (_) {
        const L = v == null ? void 0 : v.state.read(void 0);
        (!L || L.kind !== "inlineEdit" || !L.nextEditUri) && Fr((T) => {
          var D;
          for (const N of Ip._instances)
            N !== this && ((D = N.model.read(void 0)) == null || D.stop("automatic", T));
        });
        return;
      }
      this._contextKeyService.getContextKeyValue("accessibleViewIsShown") || this._configurationService.getValue("editor.inlineSuggest.keepOnBlur") || e.getOption(
        71
        /* EditorOption.inlineSuggest */
      ).keepOnBlur || hA.dropDownVisible || v && ((E = (w = v.state.read(void 0)) == null ? void 0 : w.inlineCompletion) != null && E.isFromExplicitRequest && v.inlineEditAvailable.read(void 0) || Fr((L) => {
        v.stop("automatic", L);
      }));
    })), this._register(Xt((m) => {
      var v;
      const _ = (v = this.model.read(m)) == null ? void 0 : v.inlineCompletionState.read(m);
      _ != null && _.suggestItem ? _.primaryGhostText.lineCount >= 2 && this._suggestWidgetAdapter.forceRenderingAbove() : this._suggestWidgetAdapter.stopForceRenderingAbove();
    })), this._register(Et(() => {
      this._suggestWidgetAdapter.stopForceRenderingAbove();
    }));
    const d = u0(this, (m, _) => {
      var E;
      const v = this.model.read(m), w = v == null ? void 0 : v.state.read(m);
      return this._suggestWidgetAdapter.selectedItem.get() ? _ : (E = w == null ? void 0 : w.inlineCompletion) == null ? void 0 : E.semanticId;
    });
    this._register(wPe(Ie((m) => (this._playAccessibilitySignal.read(m), d.read(m), {})), async (m, _, v, w) => {
      let E = this.model.get(), L = E == null ? void 0 : E.state.get();
      if (!L || !E || (await db(50, eie(w)), await yPe(this._suggestWidgetAdapter.selectedItem, Ec, () => !1, eie(w)), E = this.model.get(), L = E == null ? void 0 : E.state.get(), !L || !E))
        return;
      const T = L.kind === "ghostText" ? E.textModel.getLineContent(L.primaryGhostText.lineNumber) : "";
      this._accessibilitySignalService.playSignal(L.kind === "ghostText" ? tu.inlineSuggestion : tu.nextEditSuggestion), this.editor.getOption(
        12
        /* EditorOption.screenReaderAnnounceInlineSuggestion */
      ) && (L.kind === "ghostText" ? this._provideScreenReaderUpdate(L.primaryGhostText.renderForScreenReader(T)) : this._provideScreenReaderUpdate(""));
    })), this._register(this._configurationService.onDidChangeConfiguration((m) => {
      m.affectsConfiguration("accessibility.verbosity.inlineCompletions") && this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue("accessibility.verbosity.inlineCompletions") });
    })), this.editor.updateOptions({ inlineCompletionsAccessibilityVerbose: this._configurationService.getValue("accessibility.verbosity.inlineCompletions") });
    const h = new _Lt(this._contextKeyService);
    this._register(h.bind(Cr.cursorInIndentation, this._cursorIsInIndentation)), this._register(h.bind(Cr.hasSelection, (m) => {
      var _;
      return !((_ = this._editorObs.cursorSelection.read(m)) != null && _.isEmpty());
    })), this._register(h.bind(Cr.cursorAtInlineEdit, this.model.map((m, _) => {
      var v, w;
      return (w = (v = m == null ? void 0 : m.inlineEditState) == null ? void 0 : v.read(_)) == null ? void 0 : w.cursorAtInlineEdit.read(_);
    }))), this._register(h.bind(Cr.tabShouldAcceptInlineEdit, this.model.map((m, _) => !!(m != null && m.tabShouldAcceptInlineEdit.read(_))))), this._register(h.bind(Cr.tabShouldJumpToInlineEdit, this.model.map((m, _) => !!(m != null && m.tabShouldJumpToInlineEdit.read(_))))), this._register(h.bind(Cr.inlineEditVisible, (m) => {
      var _;
      return ((_ = this.model.read(m)) == null ? void 0 : _.inlineEditState.read(m)) !== void 0;
    })), this._register(h.bind(Cr.inlineSuggestionHasIndentation, (m) => {
      var _, v;
      return (v = (_ = this.model.read(m)) == null ? void 0 : _.getIndentationInfo(m)) == null ? void 0 : v.startsWithIndentation;
    })), this._register(h.bind(Cr.inlineSuggestionHasIndentationLessThanTabSize, (m) => {
      var _, v;
      return (v = (_ = this.model.read(m)) == null ? void 0 : _.getIndentationInfo(m)) == null ? void 0 : v.startsWithIndentationLessThanTabSize;
    })), this._register(h.bind(Cr.suppressSuggestions, (m) => {
      const _ = this.model.read(m), v = _ == null ? void 0 : _.inlineCompletionState.read(m);
      return v != null && v.primaryGhostText && (v != null && v.inlineCompletion) ? v.inlineCompletion.source.inlineSuggestions.suppressSuggestions : void 0;
    })), this._register(h.bind(Cr.inlineSuggestionVisible, (m) => {
      const _ = this.model.read(m), v = _ == null ? void 0 : _.inlineCompletionState.read(m);
      return !!(v != null && v.inlineCompletion) && (v == null ? void 0 : v.primaryGhostText) !== void 0 && !(v != null && v.primaryGhostText.isEmpty());
    }));
    const g = Ie(this, (m) => {
      const _ = this.model.read(m), v = _ == null ? void 0 : _.inlineCompletionState.read(m), w = v == null ? void 0 : v.primaryGhostText;
      return !w || w.isEmpty() ? void 0 : new de(w.lineNumber, w.parts[0].column);
    });
    this._register(h.bind(Cr.cursorBeforeGhostText, (m) => {
      const _ = g.read(m);
      if (!_)
        return !1;
      const v = this._editorObs.cursorPosition.read(m);
      return v ? _.equals(v) : !1;
    })), this._register(this._instantiationService.createInstance(joe, this.editor));
  }
  playAccessibilitySignal(e) {
    this._playAccessibilitySignal.trigger(e);
  }
  _provideScreenReaderUpdate(e) {
    const t = this._contextKeyService.getContextKeyValue("accessibleViewIsShown"), n = this._keybindingService.lookupKeybinding("editor.action.accessibleView");
    let r;
    !t && n && this.editor.getOption(
      169
      /* EditorOption.inlineCompletionsAccessibilityVerbose */
    ) && (r = S(1196, "Inspect this in the accessible view ({0})", n.getAriaLabel())), lu(r ? e + ", " + r : e);
  }
  shouldShowHoverAt(e) {
    var n;
    const t = (n = this.model.get()) == null ? void 0 : n.primaryGhostText.get();
    return t ? t.parts.some((r) => e.containsPosition(new de(t.lineNumber, r.column))) : !1;
  }
  shouldShowHoverAtViewZone(e) {
    return this._view.shouldShowHoverAtViewZone(e);
  }
  reject() {
    Fr((e) => {
      var n;
      const t = this.model.get();
      if (t && (t.stop("explicitCancel", e), this._focusIsInEditorOrMenu.get()))
        for (const r of Ip._instances)
          r !== this && ((n = r.model.get()) == null || n.stop("automatic", e));
    });
  }
  jump() {
    const e = this.model.get();
    e && e.jump();
  }
}, Ip = Ny, Ny._instances = /* @__PURE__ */ new Set(), Ny.hot = cK(Ip), Ny.ID = "editor.contrib.inlineCompletionsController", Ny);
du = Ip = Zkt([
  Wv(1, xt),
  Wv(2, Jt),
  Wv(3, xn),
  Wv(4, jr),
  Wv(5, ig),
  Wv(6, St),
  Wv(7, h0),
  Wv(8, Fi),
  Wv(9, Qa)
], du);
const xG = class xG extends vt {
  constructor() {
    super({
      id: xG.ID,
      label: Ee(1174, "Show Next Inline Suggestion"),
      precondition: Re.and(se.writable, Cr.inlineSuggestionVisible),
      kbOpts: {
        weight: 100,
        primary: 606
      }
    });
  }
  async run(e, t) {
    var r;
    const n = du.get(t);
    (r = n == null ? void 0 : n.model.get()) == null || r.next();
  }
};
xG.ID = yBe;
let Mae = xG;
const LG = class LG extends vt {
  constructor() {
    super({
      id: LG.ID,
      label: Ee(1175, "Show Previous Inline Suggestion"),
      precondition: Re.and(se.writable, Cr.inlineSuggestionVisible),
      kbOpts: {
        weight: 100,
        primary: 604
      }
    });
  }
  async run(e, t) {
    var r;
    const n = du.get(t);
    (r = n == null ? void 0 : n.model.get()) == null || r.previous();
  }
};
LG.ID = vBe;
let Pae = LG;
class Qkt extends vt {
  constructor() {
    super({
      id: "editor.action.inlineSuggest.trigger",
      label: Ee(1176, "Trigger Inline Suggestion"),
      precondition: se.writable
    });
  }
  async run(e, t) {
    const n = du.get(t);
    await sit(async (r) => {
      var s;
      await ((s = n == null ? void 0 : n.model.get()) == null ? void 0 : s.triggerExplicitly(r)), n == null || n.playAccessibilitySignal(r);
    });
  }
}
class Jkt extends vt {
  constructor() {
    super({
      id: "editor.action.inlineSuggest.triggerInlineEditExplicit",
      label: Ee(1177, "Trigger Next Edit Suggestion"),
      precondition: se.writable
    });
  }
  async run(e, t) {
    var s, o;
    const n = e.get(no), r = du.get(t);
    await ((s = r == null ? void 0 : r.model.get()) == null ? void 0 : s.triggerExplicitly(void 0, !0)), (o = r == null ? void 0 : r.model.get()) != null && o.inlineEditAvailable.get() || n.notify({
      severity: i2.Info,
      message: S(1165, "No inline edit is available.")
    });
  }
}
class eDt extends jo {
  constructor() {
    super({
      id: "editor.action.inlineSuggest.triggerInlineEdit",
      precondition: se.writable
    });
  }
  async runEditorCommand(e, t, n) {
    var s;
    const r = du.get(t);
    await ((s = r == null ? void 0 : r.model.get()) == null ? void 0 : s.trigger(void 0, { onlyFetchInlineEdits: !0 }));
  }
}
class tDt extends vt {
  constructor() {
    super({
      id: "editor.action.inlineSuggest.acceptNextWord",
      label: Ee(1178, "Accept Next Word Of Inline Suggestion"),
      precondition: Re.and(se.writable, Cr.inlineSuggestionVisible),
      kbOpts: {
        weight: 101,
        primary: 2065,
        kbExpr: Re.and(se.writable, Cr.inlineSuggestionVisible, Cr.cursorBeforeGhostText, QA.negate())
      },
      menuOpts: [{
        menuId: wt.InlineSuggestionToolbar,
        title: S(1166, "Accept Word"),
        group: "primary",
        order: 2
      }]
    });
  }
  async run(e, t) {
    var r;
    const n = du.get(t);
    await ((r = n == null ? void 0 : n.model.get()) == null ? void 0 : r.acceptNextWord());
  }
}
class nDt extends vt {
  constructor() {
    super({
      id: "editor.action.inlineSuggest.acceptNextLine",
      label: Ee(1179, "Accept Next Line Of Inline Suggestion"),
      precondition: Re.and(se.writable, Cr.inlineSuggestionVisible),
      kbOpts: {
        weight: 101
      },
      menuOpts: [{
        menuId: wt.InlineSuggestionToolbar,
        title: S(1167, "Accept Line"),
        group: "secondary",
        order: 2
      }]
    });
  }
  async run(e, t) {
    var r;
    const n = du.get(t);
    await ((r = n == null ? void 0 : n.model.get()) == null ? void 0 : r.acceptNextLine());
  }
}
class iDt extends vt {
  constructor() {
    super({
      id: t5,
      label: Ee(1180, "Accept Inline Suggestion"),
      precondition: Re.or(Cr.inlineSuggestionVisible, Cr.inlineEditVisible),
      menuOpts: [{
        menuId: wt.InlineSuggestionToolbar,
        title: S(1168, "Accept"),
        group: "primary",
        order: 2
      }, {
        menuId: wt.InlineEditsActions,
        title: S(1169, "Accept"),
        group: "primary",
        order: 2
      }],
      kbOpts: [
        {
          primary: 2,
          weight: 200,
          kbExpr: Re.or(Re.and(Cr.inlineSuggestionVisible, se.tabMovesFocus.toNegated(), Wn.Visible.toNegated(), se.hoverFocused.toNegated(), Cr.hasSelection.toNegated(), Cr.inlineSuggestionHasIndentationLessThanTabSize), Re.and(Cr.inlineEditVisible, se.tabMovesFocus.toNegated(), Wn.Visible.toNegated(), se.hoverFocused.toNegated(), Cr.tabShouldAcceptInlineEdit))
        }
      ]
    });
  }
  async run(e, t) {
    var r;
    const n = du.getInFocusedEditorOrParent(e);
    n && ((r = n.model.get()) == null || r.accept(n.editor), n.editor.focus());
  }
}
Pa.registerKeybindingRule({
  id: t5,
  weight: 202,
  // greater than jump
  primary: 2,
  when: Re.and(Cr.inInlineEditsPreviewEditor)
});
class rDt extends vt {
  constructor() {
    super({
      id: r1t,
      label: Ee(1181, "Jump to next inline edit"),
      precondition: Cr.inlineEditVisible,
      menuOpts: [{
        menuId: wt.InlineEditsActions,
        title: S(1170, "Jump"),
        group: "primary",
        order: 1,
        when: Cr.cursorAtInlineEdit.toNegated()
      }],
      kbOpts: {
        primary: 2,
        weight: 201,
        kbExpr: Re.and(Cr.inlineEditVisible, se.tabMovesFocus.toNegated(), Wn.Visible.toNegated(), se.hoverFocused.toNegated(), Cr.tabShouldJumpToInlineEdit)
      }
    });
  }
  async run(e, t) {
    const n = du.get(t);
    n && n.jump();
  }
}
const TG = class TG extends vt {
  constructor() {
    super({
      id: TG.ID,
      label: Ee(1182, "Hide Inline Suggestion"),
      precondition: Re.or(Cr.inlineSuggestionVisible, Cr.inlineEditVisible),
      kbOpts: {
        weight: 190,
        // same as hiding the suggest widget
        primary: 9
      },
      menuOpts: [{
        menuId: wt.InlineEditsActions,
        title: S(1171, "Reject"),
        group: "primary",
        order: 3
      }]
    });
  }
  async run(e, t) {
    const n = du.getInFocusedEditorOrParent(e);
    Fr((r) => {
      var s;
      (s = n == null ? void 0 : n.model.get()) == null || s.stop("explicitCancel", r);
    }), n == null || n.editor.focus();
  }
};
TG.ID = CBe;
let qz = TG;
const kG = class kG extends vt {
  constructor() {
    super({
      id: kG.ID,
      label: Ee(1183, "Toggle Inline Suggestions Show Collapsed"),
      precondition: Re.true()
    });
  }
  async run(e, t) {
    const n = e.get(xn), r = n.getValue("editor.inlineSuggest.edits.showCollapsed");
    n.updateValue("editor.inlineSuggest.edits.showCollapsed", !r);
  }
};
kG.ID = Xse;
let Fae = kG;
Pa.registerKeybindingRule({
  id: qz.ID,
  weight: -1,
  // very weak
  primary: 9,
  secondary: [
    1033
    /* KeyCode.Escape */
  ],
  when: Re.and(Cr.inInlineEditsPreviewEditor)
});
const DG = class DG extends Fa {
  constructor() {
    super({
      id: DG.ID,
      title: S(1172, "Always Show Toolbar"),
      f1: !1,
      precondition: void 0,
      menu: [{
        id: wt.InlineSuggestionToolbar,
        group: "secondary",
        order: 10
      }],
      toggled: Re.equals("config.editor.inlineSuggest.showToolbar", "always")
    });
  }
  async run(e) {
    const t = e.get(xn), r = t.getValue("editor.inlineSuggest.showToolbar") === "always" ? "onHover" : "always";
    t.updateValue("editor.inlineSuggest.showToolbar", r);
  }
};
DG.ID = "editor.action.inlineSuggest.toggleAlwaysShowToolbar";
let Bae = DG;
class sDt extends vt {
  constructor() {
    super({
      id: "editor.action.inlineSuggest.dev.extractRepro",
      label: S(1173, "Developer: Extract Inline Suggest State"),
      alias: "Developer: Inline Suggest Extract Repro",
      precondition: Re.or(Cr.inlineEditVisible, Cr.inlineSuggestionVisible)
    });
  }
  async run(e, t) {
    const n = e.get(_m), r = du.get(t), s = r == null ? void 0 : r.model.get();
    if (!s)
      return;
    const o = s.extractReproSample(), l = $d(JSON.stringify({ inlineCompletion: o.inlineCompletion }, null, 4)).map((u) => "// " + u).join(`
`), c = `${o.documentValue}

// <json>
${l}
// </json>
`;
    return await n.writeText(c), { reproCase: c };
  }
}
var oDt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, dP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class aDt {
  constructor(e, t, n) {
    this.owner = e, this.range = t, this.controller = n;
  }
  isValidForHoverAnchor(e) {
    return e.type === 1 && this.range.startColumn <= e.range.startColumn && this.range.endColumn >= e.range.endColumn;
  }
}
let Hae = class {
  constructor(e, t, n, r, s, o) {
    this._editor = e, this._languageService = t, this._openerService = n, this.accessibilityService = r, this._instantiationService = s, this._telemetryService = o, this.hoverOrdinal = 4;
  }
  suggestHoverAnchor(e) {
    const t = du.get(this._editor);
    if (!t)
      return null;
    const n = e.target;
    if (n.type === 8) {
      const r = n.detail;
      if (t.shouldShowHoverAtViewZone(r.viewZoneId))
        return new YP(1e3, this, z.fromPositions(this._editor.getModel().validatePosition(r.positionBefore || r.position)), e.event.posx, e.event.posy, !1);
    }
    if (n.type === 7 && t.shouldShowHoverAt(n.range))
      return new YP(1e3, this, n.range, e.event.posx, e.event.posy, !1);
    if (n.type === 6 && n.detail.mightBeForeignElement && t.shouldShowHoverAt(n.range))
      return new YP(1e3, this, n.range, e.event.posx, e.event.posy, !1);
    if (n.type === 9 && n.element) {
      const r = p5.getWarningWidgetContext(n.element);
      if (r && t.shouldShowHoverAt(r.range))
        return new YP(1e3, this, r.range, e.event.posx, e.event.posy, !1);
    }
    return null;
  }
  computeSync(e, t) {
    if (this._editor.getOption(
      71
      /* EditorOption.inlineSuggest */
    ).showToolbar !== "onHover")
      return [];
    const n = du.get(this._editor);
    return n && n.shouldShowHoverAt(e.range) ? [new aDt(this, e.range, n)] : [];
  }
  renderHoverParts(e, t) {
    const n = new ke(), r = t[0];
    this._telemetryService.publicLog2("inlineCompletionHover.shown"), this.accessibilityService.isScreenReaderOptimized() && !this._editor.getOption(
      12
      /* EditorOption.screenReaderAnnounceInlineSuggestion */
    ) && n.add(this.renderScreenReaderText(e, r));
    const s = r.controller.model.get(), o = document.createElement("div");
    e.fragment.appendChild(o), n.add(Ql((l, c) => {
      const u = c.add(this._instantiationService.createInstance(hA.hot.read(l), this._editor, !1, Br(null), s.selectedInlineCompletionIndex, s.inlineCompletionsCount, s.activeCommands, s.warning, () => {
        e.onContentsChanged();
      }));
      o.replaceChildren(u.getDomNode());
    })), s.triggerExplicitly();
    const a = {
      hoverPart: r,
      hoverElement: o,
      dispose() {
        n.dispose();
      }
    };
    return new wT([a]);
  }
  renderScreenReaderText(e, t) {
    const n = new ke(), r = Ge, s = r("div.hover-row.markdown-hover"), o = Fe(s, r("div.hover-contents", { "aria-live": "assertive" })), a = new n0({ editor: this._editor }, this._languageService, this._openerService), l = (c) => {
      const u = S(1197, "Suggestion:"), d = n.add(a.render(new ql().appendText(u).appendCodeblock("text", c), {
        asyncRenderCallback: () => {
          o.className = "hover-contents code-hover-contents", e.onContentsChanged();
        }
      }));
      o.replaceChildren(d.element);
    };
    return n.add(Xt((c) => {
      var d;
      const u = (d = t.controller.model.read(c)) == null ? void 0 : d.primaryGhostText.read(c);
      if (u) {
        const h = this._editor.getModel().getLineContent(u.lineNumber);
        l(u.renderForScreenReader(h));
      } else
        ma(o);
    })), e.fragment.appendChild(s), n;
  }
};
Hae = oDt([
  dP(1, Gr),
  dP(2, ad),
  dP(3, Qa),
  dP(4, xt),
  dP(5, rc)
], Hae);
class lDt {
}
Si(
  du.ID,
  Kxt(du.hot),
  3
  /* EditorContributionInstantiation.Eventually */
);
Je(Qkt);
Je(Jkt);
ct(new eDt());
Je(Mae);
Je(Pae);
Je(tDt);
Je(nDt);
Je(iDt);
Je(Fae);
Je(qz);
Je(rDt);
ar(Bae);
Je(sDt);
ar(nae);
ar(iae);
nk.register(Hae);
OK.register(new lDt());
var cDt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Lte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, nF, K1;
let b5 = (K1 = class {
  constructor(e, t, n, r) {
    this.textModelResolverService = t, this.languageService = n, this.languageFeaturesService = r, this.toUnhook = new ke(), this.toUnhookForKeyboard = new ke(), this.currentWordAtPosition = null, this.previousPromise = null, this.editor = e, this.linkDecorations = this.editor.createDecorationsCollection();
    const s = new SK(e);
    this.toUnhook.add(s), this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown(([o, a]) => {
      this.startFindDefinitionFromMouse(o, a ?? void 0);
    })), this.toUnhook.add(s.onExecute((o) => {
      this.isEnabled(o) && this.gotoDefinition(o.target.position, o.hasSideBySideModifier).catch((a) => {
        fn(a);
      }).finally(() => {
        this.removeLinkDecorations();
      });
    })), this.toUnhook.add(s.onCancel(() => {
      this.removeLinkDecorations(), this.currentWordAtPosition = null;
    }));
  }
  static get(e) {
    return e.getContribution(nF.ID);
  }
  async startFindDefinitionFromCursor(e) {
    await this.startFindDefinition(e), this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(() => {
      this.currentWordAtPosition = null, this.removeLinkDecorations(), this.toUnhookForKeyboard.clear();
    })), this.toUnhookForKeyboard.add(this.editor.onKeyDown((t) => {
      t && (this.currentWordAtPosition = null, this.removeLinkDecorations(), this.toUnhookForKeyboard.clear());
    }));
  }
  startFindDefinitionFromMouse(e, t) {
    if (e.target.type === 9 && this.linkDecorations.length > 0)
      return;
    if (!this.editor.hasModel() || !this.isEnabled(e, t)) {
      this.currentWordAtPosition = null, this.removeLinkDecorations();
      return;
    }
    const n = e.target.position;
    this.startFindDefinition(n);
  }
  async startFindDefinition(e) {
    var o;
    this.toUnhookForKeyboard.clear();
    const t = e ? (o = this.editor.getModel()) == null ? void 0 : o.getWordAtPosition(e) : null;
    if (!t) {
      this.currentWordAtPosition = null, this.removeLinkDecorations();
      return;
    }
    if (this.currentWordAtPosition && this.currentWordAtPosition.startColumn === t.startColumn && this.currentWordAtPosition.endColumn === t.endColumn && this.currentWordAtPosition.word === t.word)
      return;
    this.currentWordAtPosition = t;
    const n = new V5e(
      this.editor,
      15
      /* CodeEditorStateFlag.Scroll */
    );
    this.previousPromise && (this.previousPromise.cancel(), this.previousPromise = null), this.previousPromise = Jo((a) => this.findDefinition(e, a));
    let r;
    try {
      r = await this.previousPromise;
    } catch (a) {
      fn(a);
      return;
    }
    if (!r || !r.length || !n.validate(this.editor)) {
      this.removeLinkDecorations();
      return;
    }
    const s = r[0].originSelectionRange ? z.lift(r[0].originSelectionRange) : new z(e.lineNumber, t.startColumn, e.lineNumber, t.endColumn);
    if (r.length > 1) {
      let a = s;
      for (const { originSelectionRange: l } of r)
        l && (a = z.plusRange(a, l));
      this.addDecoration(a, new ql().appendText(S(1072, "Click to show {0} definitions.", r.length)));
    } else {
      const a = r[0];
      return a.uri ? this.textModelResolverService.createModelReference(a.uri).then((l) => {
        if (!l.object || !l.object.textEditorModel) {
          l.dispose();
          return;
        }
        const { object: { textEditorModel: c } } = l, { startLineNumber: u } = a.range;
        if (u < 1 || u > c.getLineCount()) {
          l.dispose();
          return;
        }
        const d = this.getPreviewValue(c, u, a), h = this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);
        this.addDecoration(s, d ? new ql().appendCodeblock(h || "", d) : void 0), l.dispose();
      }) : void 0;
    }
  }
  getPreviewValue(e, t, n) {
    let r = n.range;
    return r.endLineNumber - r.startLineNumber >= nF.MAX_SOURCE_PREVIEW_LINES && (r = this.getPreviewRangeBasedOnIndentation(e, t)), r = e.validateRange(r), this.stripIndentationFromPreviewRange(e, t, r);
  }
  stripIndentationFromPreviewRange(e, t, n) {
    let s = e.getLineFirstNonWhitespaceColumn(t);
    for (let a = t + 1; a < n.endLineNumber; a++) {
      const l = e.getLineFirstNonWhitespaceColumn(a);
      s = Math.min(s, l);
    }
    return e.getValueInRange(n).replace(new RegExp(`^\\s{${s - 1}}`, "gm"), "").trim();
  }
  getPreviewRangeBasedOnIndentation(e, t) {
    const n = e.getLineFirstNonWhitespaceColumn(t), r = Math.min(e.getLineCount(), t + nF.MAX_SOURCE_PREVIEW_LINES);
    let s = t + 1;
    for (; s < r; s++) {
      const o = e.getLineFirstNonWhitespaceColumn(s);
      if (n === o)
        break;
    }
    return new z(t, 1, s + 1, 1);
  }
  addDecoration(e, t) {
    const n = {
      range: e,
      options: {
        description: "goto-definition-link",
        inlineClassName: "goto-definition-link",
        hoverMessage: t
      }
    };
    this.linkDecorations.set([n]);
  }
  removeLinkDecorations() {
    this.linkDecorations.clear();
  }
  isEnabled(e, t) {
    var n;
    return this.editor.hasModel() && e.isLeftClick && e.isNoneOrSingleMouseDown && e.target.type === 6 && !(((n = e.target.detail.injectedText) == null ? void 0 : n.options) instanceof uw) && (e.hasTriggerModifier || (t ? t.keyCodeIsTriggerKey : !1)) && this.languageFeaturesService.definitionProvider.has(this.editor.getModel());
  }
  findDefinition(e, t) {
    const n = this.editor.getModel();
    return n ? GB(this.languageFeaturesService.definitionProvider, n, e, !1, t) : Promise.resolve(null);
  }
  gotoDefinition(e, t) {
    return this.editor.setPosition(e), this.editor.invokeWithinContext((n) => {
      const r = !t && this.editor.getOption(
        101
        /* EditorOption.definitionLinkOpensInPeek */
      ) && !this.isInPeekEditor(n);
      return new KB({ openToSide: t, openInPeek: r, muteMessage: !0 }, { title: { value: "", original: "" }, id: "", precondition: void 0 }).run(n);
    });
  }
  isInPeekEditor(e) {
    const t = e.get(Jt);
    return td.inPeekEditor.getValue(t);
  }
  dispose() {
    this.toUnhook.dispose(), this.toUnhookForKeyboard.dispose();
  }
}, nF = K1, K1.ID = "editor.contrib.gotodefinitionatposition", K1.MAX_SOURCE_PREVIEW_LINES = 8, K1);
b5 = nF = cDt([
  Lte(1, Ic),
  Lte(2, Gr),
  Lte(3, St)
], b5);
Si(
  b5.ID,
  b5,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
var _8e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Kz = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class iNe {
  constructor(e, t, n) {
    this.marker = e, this.index = t, this.total = n;
  }
}
let Wae = class {
  constructor(e, t, n) {
    this._markerService = t, this._configService = n, this._onDidChange = new he(), this.onDidChange = this._onDidChange.event, this._dispoables = new ke(), this._markers = [], this._nextIdx = -1, Ht.isUri(e) ? this._resourceFilter = (a) => a.toString() === e.toString() : e && (this._resourceFilter = e);
    const r = this._configService.getValue("problems.sortOrder"), s = (a, l) => {
      let c = Q3(a.resource.toString(), l.resource.toString());
      return c === 0 && (r === "position" ? c = z.compareRangesUsingStarts(a, l) || Os.compare(a.severity, l.severity) : c = Os.compare(a.severity, l.severity) || z.compareRangesUsingStarts(a, l)), c;
    }, o = () => {
      let a = this._markerService.read({
        resource: Ht.isUri(e) ? e : void 0,
        severities: Os.Error | Os.Warning | Os.Info
      });
      return typeof e == "function" && (a = a.filter((l) => this._resourceFilter(l.resource))), a.sort(s), ds(a, this._markers, (l, c) => l.resource.toString() === c.resource.toString() && l.startLineNumber === c.startLineNumber && l.startColumn === c.startColumn && l.endLineNumber === c.endLineNumber && l.endColumn === c.endColumn && l.severity === c.severity && l.message === c.message) ? !1 : (this._markers = a, !0);
    };
    o(), this._dispoables.add(t.onMarkerChanged((a) => {
      (!this._resourceFilter || a.some((l) => this._resourceFilter(l))) && o() && (this._nextIdx = -1, this._onDidChange.fire());
    }));
  }
  dispose() {
    this._dispoables.dispose(), this._onDidChange.dispose();
  }
  matches(e) {
    return !this._resourceFilter && !e ? !0 : !this._resourceFilter || !e ? !1 : this._resourceFilter(e);
  }
  get selected() {
    const e = this._markers[this._nextIdx];
    return e && new iNe(e, this._nextIdx + 1, this._markers.length);
  }
  _initIdx(e, t, n) {
    let r = this._markers.findIndex((s) => rw(s.resource, e.uri));
    if (r < 0)
      r = $he(this._markers.length, (s) => Q3(this._markers[s].resource.toString(), e.uri.toString())), r < 0 && (r = ~r), n ? this._nextIdx = r : this._nextIdx = (this._markers.length + r - 1) % this._markers.length;
    else {
      let s = !1, o = !1;
      for (let a = r; a < this._markers.length; a++) {
        let l = z.lift(this._markers[a]);
        if (l.isEmpty()) {
          const c = e.getWordAtPosition(l.getStartPosition());
          c && (l = new z(l.startLineNumber, c.startColumn, l.startLineNumber, c.endColumn));
        }
        if (t && (l.containsPosition(t) || t.isBeforeOrEqual(l.getStartPosition()))) {
          this._nextIdx = a, s = !0, o = !l.containsPosition(t);
          break;
        }
        if (this._markers[a].resource.toString() !== e.uri.toString())
          break;
      }
      s ? o && !n && (this._nextIdx -= 1) : this._nextIdx = n ? 0 : this._markers.length - 1;
    }
    this._nextIdx < 0 && (this._nextIdx = this._markers.length - 1);
  }
  resetIndex() {
    this._nextIdx = -1;
  }
  move(e, t, n) {
    if (this._markers.length === 0)
      return !1;
    const r = this._nextIdx;
    return this._nextIdx === -1 ? this._initIdx(t, n, e) : e ? this._nextIdx = (this._nextIdx + 1) % this._markers.length : e || (this._nextIdx = (this._nextIdx - 1 + this._markers.length) % this._markers.length), r !== this._nextIdx;
  }
  find(e, t) {
    let n = this._markers.findIndex((r) => r.resource.toString() === e.toString());
    if (!(n < 0)) {
      for (; n < this._markers.length; n++)
        if (z.containsPosition(this._markers[n], t))
          return new iNe(this._markers[n], n + 1, this._markers.length);
    }
  }
};
Wae = _8e([
  Kz(1, Nb),
  Kz(2, xn)
], Wae);
const b8e = Vn("IMarkerNavigationService");
let Vae = class {
  constructor(e, t) {
    this._markerService = e, this._configService = t, this._provider = new xc();
  }
  getMarkerList(e) {
    for (const t of this._provider) {
      const n = t.getMarkerList(e);
      if (n)
        return n;
    }
    return new Wae(e, this._markerService, this._configService);
  }
};
Vae = _8e([
  Kz(0, Nb),
  Kz(1, xn)
], Vae);
ni(
  b8e,
  Vae,
  1
  /* InstantiationType.Delayed */
);
var Uae;
(function(i) {
  function e(t) {
    switch (t) {
      case Rs.Ignore:
        return "severity-ignore " + qt.asClassName(Pe.info);
      case Rs.Info:
        return qt.asClassName(Pe.info);
      case Rs.Warning:
        return qt.asClassName(Pe.warning);
      case Rs.Error:
        return qt.asClassName(Pe.error);
      default:
        return "";
    }
  }
  i.className = e;
})(Uae || (Uae = {}));
var uDt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, RI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, zae;
class dDt {
  constructor(e, t, n, r, s) {
    this._openerService = r, this._labelService = s, this._lines = 0, this._longestLineLength = 0, this._relatedDiagnostics = /* @__PURE__ */ new WeakMap(), this._disposables = new ke(), this._editor = t;
    const o = document.createElement("div");
    o.className = "descriptioncontainer", this._messageBlock = document.createElement("div"), this._messageBlock.classList.add("message"), this._messageBlock.setAttribute("aria-live", "assertive"), this._messageBlock.setAttribute("role", "alert"), o.appendChild(this._messageBlock), this._relatedBlock = document.createElement("div"), o.appendChild(this._relatedBlock), this._disposables.add(vo(this._relatedBlock, "click", (a) => {
      a.preventDefault();
      const l = this._relatedDiagnostics.get(a.target);
      l && n(l);
    })), this._scrollable = new e3e(o, {
      horizontal: 1,
      vertical: 1,
      useShadows: !1,
      horizontalScrollbarSize: 6,
      verticalScrollbarSize: 6
    }), e.appendChild(this._scrollable.getDomNode()), this._disposables.add(this._scrollable.onScroll((a) => {
      o.style.left = `-${a.scrollLeft}px`, o.style.top = `-${a.scrollTop}px`;
    })), this._disposables.add(this._scrollable);
  }
  dispose() {
    or(this._disposables);
  }
  update(e) {
    const { source: t, message: n, relatedInformation: r, code: s } = e;
    let o = ((t == null ? void 0 : t.length) || 0) + 2;
    s && (typeof s == "string" ? o += s.length : o += s.value.length);
    const a = $d(n);
    this._lines = a.length, this._longestLineLength = 0;
    for (const h of a)
      this._longestLineLength = Math.max(h.length + o, this._longestLineLength);
    Xa(this._messageBlock), this._messageBlock.setAttribute("aria-label", this.getAriaLabel(e)), this._editor.applyFontInfo(this._messageBlock);
    let l = this._messageBlock;
    for (const h of a)
      l = document.createElement("div"), l.innerText = h, h === "" && (l.style.height = this._messageBlock.style.lineHeight), this._messageBlock.appendChild(l);
    if (t || s) {
      const h = document.createElement("span");
      if (h.classList.add("details"), l.appendChild(h), t) {
        const g = document.createElement("span");
        g.innerText = t, g.classList.add("source"), h.appendChild(g);
      }
      if (s)
        if (typeof s == "string") {
          const g = document.createElement("span");
          g.innerText = `(${s})`, g.classList.add("code"), h.appendChild(g);
        } else {
          this._codeLink = Ge("a.code-link"), this._codeLink.setAttribute("href", `${s.target.toString()}`), this._codeLink.onclick = (m) => {
            this._openerService.open(s.target, { allowCommands: !0 }), m.preventDefault(), m.stopPropagation();
          };
          const g = Fe(this._codeLink, Ge("span"));
          g.innerText = s.value, h.appendChild(this._codeLink);
        }
    }
    if (Xa(this._relatedBlock), this._editor.applyFontInfo(this._relatedBlock), kc(r)) {
      const h = this._relatedBlock.appendChild(document.createElement("div"));
      h.style.paddingTop = `${Math.floor(this._editor.getOption(
        75
        /* EditorOption.lineHeight */
      ) * 0.66)}px`, this._lines += 1;
      for (const g of r) {
        const m = document.createElement("div"), _ = document.createElement("a");
        _.classList.add("filename"), _.innerText = `${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `, _.title = this._labelService.getUriLabel(g.resource), this._relatedDiagnostics.set(_, g);
        const v = document.createElement("span");
        v.innerText = g.message, m.appendChild(_), m.appendChild(v), this._lines += 1, h.appendChild(m);
      }
    }
    const c = this._editor.getOption(
      59
      /* EditorOption.fontInfo */
    ), u = Math.ceil(c.typicalFullwidthCharacterWidth * this._longestLineLength * 0.75), d = c.lineHeight * this._lines;
    this._scrollable.setScrollDimensions({ scrollWidth: u, scrollHeight: d });
  }
  layout(e, t) {
    this._scrollable.getDomNode().style.height = `${e}px`, this._scrollable.getDomNode().style.width = `${t}px`, this._scrollable.setScrollDimensions({ width: t, height: e });
  }
  getHeightInLines() {
    return Math.min(17, this._lines);
  }
  getAriaLabel(e) {
    let t = "";
    switch (e.severity) {
      case Os.Error:
        t = S(1019, "Error");
        break;
      case Os.Warning:
        t = S(1020, "Warning");
        break;
      case Os.Info:
        t = S(1021, "Info");
        break;
      case Os.Hint:
        t = S(1022, "Hint");
        break;
    }
    let n = S(1023, "{0} at {1}. ", t, e.startLineNumber + ":" + e.startColumn);
    const r = this._editor.getModel();
    return r && e.startLineNumber <= r.getLineCount() && e.startLineNumber >= 1 && (n = `${r.getLineContent(e.startLineNumber)}, ${n}`), n;
  }
}
var NL;
let v5 = (NL = class extends uz {
  constructor(e, t, n, r, s, o, a) {
    super(e, { showArrow: !0, showFrame: !0, isAccessible: !0, frameWidth: 1 }, s), this._themeService = t, this._openerService = n, this._menuService = r, this._contextKeyService = o, this._labelService = a, this._callOnDispose = new ke(), this._onDidSelectRelatedInformation = new he(), this.onDidSelectRelatedInformation = this._onDidSelectRelatedInformation.event, this._severity = Os.Warning, this._backgroundColor = De.white, this._applyTheme(t.getColorTheme()), this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))), this.create();
  }
  _applyTheme(e) {
    this._backgroundColor = e.getColor(pDt);
    let t = $ae, n = hDt;
    this._severity === Os.Warning ? (t = GW, n = fDt) : this._severity === Os.Info && (t = jae, n = gDt);
    const r = e.getColor(t), s = e.getColor(n);
    this.style({
      arrowColor: r,
      frameColor: r,
      headerBackgroundColor: s,
      primaryHeadingColor: e.getColor(WBe),
      secondaryHeadingColor: e.getColor(VBe)
    });
  }
  _applyStyles() {
    this._parentContainer && (this._parentContainer.style.backgroundColor = this._backgroundColor ? this._backgroundColor.toString() : ""), super._applyStyles();
  }
  dispose() {
    this._callOnDispose.dispose(), super.dispose();
  }
  _fillHead(e) {
    super._fillHead(e), this._disposables.add(this._actionbarWidget.actionRunner.onWillRun((r) => this.editor.focus()));
    const t = this._menuService.getMenuActions(zae.TitleMenu, this._contextKeyService), n = Myt(t);
    this._actionbarWidget.push(n, { label: !1, icon: !0, index: 0 });
  }
  _fillTitleIcon(e) {
    this._icon = Fe(e, Ge(""));
  }
  _fillBody(e) {
    this._parentContainer = e, e.classList.add("marker-widget"), this._parentContainer.tabIndex = 0, this._parentContainer.setAttribute("role", "tooltip"), this._container = document.createElement("div"), e.appendChild(this._container), this._message = new dDt(this._container, this.editor, (t) => this._onDidSelectRelatedInformation.fire(t), this._openerService, this._labelService), this._disposables.add(this._message);
  }
  show() {
    throw new Error("call showAtMarker");
  }
  showAtMarker(e, t, n) {
    this._container.classList.remove("stale"), this._message.update(e), this._severity = e.severity, this._applyTheme(this._themeService.getColorTheme());
    const r = z.lift(e), s = this.editor.getPosition(), o = s && r.containsPosition(s) ? s : r.getStartPosition();
    super.show(o, this.computeRequiredHeight());
    const a = this.editor.getModel();
    if (a) {
      const l = n > 1 ? S(1024, "{0} of {1} problems", t, n) : S(1025, "{0} of {1} problem", t, n);
      this.setTitle(Kf(a.uri), l);
    }
    this._icon.className = `codicon ${Uae.className(Os.toSeverity(this._severity))}`, this.editor.revealPositionNearTop(
      o,
      0
      /* ScrollType.Smooth */
    ), this.editor.focus();
  }
  updateMarker(e) {
    this._container.classList.remove("stale"), this._message.update(e);
  }
  showStale() {
    this._container.classList.add("stale"), this._relayout();
  }
  _doLayoutBody(e, t) {
    super._doLayoutBody(e, t), this._heightInPixel = e, this._message.layout(e, t), this._container.style.height = `${e}px`;
  }
  _onWidth(e) {
    this._message.layout(this._heightInPixel, e);
  }
  _relayout() {
    super._relayout(this.computeRequiredHeight());
  }
  computeRequiredHeight() {
    return 3 + this._message.getHeightInLines();
  }
}, zae = NL, NL.TitleMenu = new wt("gotoErrorTitleMenu"), NL);
v5 = zae = uDt([
  RI(1, to),
  RI(2, ad),
  RI(3, eg),
  RI(4, xt),
  RI(5, Jt),
  RI(6, LT)
], v5);
const rNe = g4(jq, Aat), sNe = g4(Xy, p4), oNe = g4(gb, m4), $ae = ie("editorMarkerNavigationError.background", { dark: rNe, light: rNe, hcDark: hi, hcLight: hi }, S(1026, "Editor marker navigation widget error color.")), hDt = ie("editorMarkerNavigationError.headerBackground", { dark: hn($ae, 0.1), light: hn($ae, 0.1), hcDark: null, hcLight: null }, S(1027, "Editor marker navigation widget error heading background.")), GW = ie("editorMarkerNavigationWarning.background", { dark: sNe, light: sNe, hcDark: hi, hcLight: hi }, S(1028, "Editor marker navigation widget warning color.")), fDt = ie("editorMarkerNavigationWarning.headerBackground", { dark: hn(GW, 0.1), light: hn(GW, 0.1), hcDark: "#0C141F", hcLight: hn(GW, 0.2) }, S(1029, "Editor marker navigation widget warning heading background.")), jae = ie("editorMarkerNavigationInfo.background", { dark: oNe, light: oNe, hcDark: hi, hcLight: hi }, S(1030, "Editor marker navigation widget info color.")), gDt = ie("editorMarkerNavigationInfo.headerBackground", { dark: hn(jae, 0.1), light: hn(jae, 0.1), hcDark: null, hcLight: null }, S(1031, "Editor marker navigation widget info heading background.")), pDt = ie("editorMarkerNavigation.background", yo, S(1032, "Editor marker navigation widget background."));
var mDt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, RH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, iF, RL;
let DT = (RL = class {
  static get(e) {
    return e.getContribution(iF.ID);
  }
  constructor(e, t, n, r, s) {
    this._markerNavigationService = t, this._contextKeyService = n, this._editorService = r, this._instantiationService = s, this._sessionDispoables = new ke(), this._editor = e, this._widgetVisible = v8e.bindTo(this._contextKeyService);
  }
  dispose() {
    this._cleanUp(), this._sessionDispoables.dispose();
  }
  _cleanUp() {
    this._widgetVisible.reset(), this._sessionDispoables.clear(), this._widget = void 0, this._model = void 0;
  }
  _getOrCreateModel(e) {
    if (this._model && this._model.matches(e))
      return this._model;
    let t = !1;
    return this._model && (t = !0, this._cleanUp()), this._model = this._markerNavigationService.getMarkerList(e), t && this._model.move(!0, this._editor.getModel(), this._editor.getPosition()), this._widget = this._instantiationService.createInstance(v5, this._editor), this._widget.onDidClose(() => this.close(), this, this._sessionDispoables), this._widgetVisible.set(!0), this._sessionDispoables.add(this._model), this._sessionDispoables.add(this._widget), this._sessionDispoables.add(this._editor.onDidChangeCursorPosition((n) => {
      var r, s, o;
      (!((r = this._model) != null && r.selected) || !z.containsPosition((s = this._model) == null ? void 0 : s.selected.marker, n.position)) && ((o = this._model) == null || o.resetIndex());
    })), this._sessionDispoables.add(this._model.onDidChange(() => {
      if (!this._widget || !this._widget.position || !this._model)
        return;
      const n = this._model.find(this._editor.getModel().uri, this._widget.position);
      n ? this._widget.updateMarker(n.marker) : this._widget.showStale();
    })), this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((n) => {
      this._editorService.openCodeEditor({
        resource: n.resource,
        options: { pinned: !0, revealIfOpened: !0, selection: z.lift(n).collapseToStart() }
      }, this._editor), this.close(!1);
    })), this._sessionDispoables.add(this._editor.onDidChangeModel(() => this._cleanUp())), this._model;
  }
  close(e = !0) {
    this._cleanUp(), e && this._editor.focus();
  }
  showAtMarker(e) {
    if (!this._editor.hasModel())
      return;
    const t = this._editor.getModel(), n = this._getOrCreateModel(t.uri);
    n.resetIndex(), n.move(!0, t, new de(e.startLineNumber, e.startColumn)), n.selected && this._widget.showAtMarker(n.selected.marker, n.selected.index, n.selected.total);
  }
  async navigate(e, t) {
    var s, o;
    if (!this._editor.hasModel())
      return;
    const n = this._editor.getModel(), r = this._getOrCreateModel(t ? void 0 : n.uri);
    if (r.move(e, n, this._editor.getPosition()), !!r.selected)
      if (r.selected.marker.resource.toString() !== n.uri.toString()) {
        this._cleanUp();
        const a = await this._editorService.openCodeEditor({
          resource: r.selected.marker.resource,
          options: { pinned: !1, revealIfOpened: !0, selectionRevealType: 2, selection: r.selected.marker }
        }, this._editor);
        a && ((s = iF.get(a)) == null || s.close(), (o = iF.get(a)) == null || o.navigate(e, t));
      } else
        this._widget.showAtMarker(r.selected.marker, r.selected.index, r.selected.total);
  }
}, iF = RL, RL.ID = "editor.contrib.markerController", RL);
DT = iF = mDt([
  RH(1, b8e),
  RH(2, Jt),
  RH(3, Ti),
  RH(4, xt)
], DT);
class VK extends vt {
  constructor(e, t, n) {
    super(n), this._next = e, this._multiFile = t;
  }
  async run(e, t) {
    var n;
    t.hasModel() && await ((n = DT.get(t)) == null ? void 0 : n.navigate(this._next, this._multiFile));
  }
}
const sx = class sx extends VK {
  constructor() {
    super(!0, !1, {
      id: sx.ID,
      label: sx.LABEL,
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 578,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: v5.TitleMenu,
        title: sx.LABEL.value,
        icon: es("marker-navigation-next", Pe.arrowDown, S(1011, "Icon for goto next marker.")),
        group: "navigation",
        order: 1
      }
    });
  }
};
sx.ID = "editor.action.marker.next", sx.LABEL = Ee(1015, "Go to Next Problem (Error, Warning, Info)");
let Yz = sx;
const ox = class ox extends VK {
  constructor() {
    super(!1, !1, {
      id: ox.ID,
      label: ox.LABEL,
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 1602,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: v5.TitleMenu,
        title: ox.LABEL.value,
        icon: es("marker-navigation-previous", Pe.arrowUp, S(1012, "Icon for goto previous marker.")),
        group: "navigation",
        order: 2
      }
    });
  }
};
ox.ID = "editor.action.marker.prev", ox.LABEL = Ee(1016, "Go to Previous Problem (Error, Warning, Info)");
let Gae = ox;
class _Dt extends VK {
  constructor() {
    super(!0, !0, {
      id: "editor.action.marker.nextInFiles",
      label: Ee(1017, "Go to Next Problem in Files (Error, Warning, Info)"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 66,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarGoMenu,
        title: S(1013, "Next &&Problem"),
        group: "6_problem_nav",
        order: 1
      }
    });
  }
}
class bDt extends VK {
  constructor() {
    super(!1, !0, {
      id: "editor.action.marker.prevInFiles",
      label: Ee(1018, "Go to Previous Problem in Files (Error, Warning, Info)"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 1090,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarGoMenu,
        title: S(1014, "Previous &&Problem"),
        group: "6_problem_nav",
        order: 2
      }
    });
  }
}
Si(
  DT.ID,
  DT,
  4
  /* EditorContributionInstantiation.Lazy */
);
Je(Yz);
Je(Gae);
Je(_Dt);
Je(bDt);
const v8e = new ut("markersNavigationVisible", !1), vDt = jo.bindToContribution(DT.get);
ct(new vDt({
  id: "closeMarkersNavigation",
  precondition: v8e,
  handler: (i) => i.close(),
  kbOpts: {
    weight: 150,
    kbExpr: se.focus,
    primary: 9,
    secondary: [
      1033
      /* KeyCode.Escape */
    ]
  }
}));
class yDt extends vt {
  constructor() {
    super({
      id: "editor.action.debugEditorGpuRenderer",
      label: Ee(1096, "Developer: Debug Editor GPU Renderer"),
      // TODO: Why doesn't `ContextKeyExpr.equals('config:editor.experimentalGpuAcceleration', 'on')` work?
      precondition: Re.true()
    });
  }
  async run(e, t) {
    const n = e.get(xt), s = await e.get(tc).pick([
      {
        label: S(1093, "Log Texture Atlas Stats"),
        id: "logTextureAtlasStats"
      },
      {
        label: S(1094, "Save Texture Atlas"),
        id: "saveTextureAtlas"
      },
      {
        label: S(1095, "Draw Glyph"),
        id: "drawGlyph"
      }
    ], { canPickMany: !1 });
    if (s)
      switch (s.id) {
        case "logTextureAtlasStats":
          n.invokeFunction((o) => {
            const a = o.get($r), l = Cc.atlas;
            if (!Cc.atlas) {
              a.error("No texture atlas found");
              return;
            }
            const c = l.getStats();
            a.info(["Texture atlas stats", ...c].join(`

`));
          });
          break;
        case "saveTextureAtlas":
          n.invokeFunction(async (o) => {
            const a = o.get(i0), l = o.get(FIe), c = a.getWorkspace().folders;
            if (c.length > 0) {
              const u = Cc.atlas, d = [];
              for (const [h, g] of u.pages.entries())
                d.push(l.writeFile(Ht.joinPath(c[0].uri, `textureAtlasPage${h}_actual.png`), x1.wrap(new Uint8Array(await (await g.source.convertToBlob()).arrayBuffer()))), l.writeFile(Ht.joinPath(c[0].uri, `textureAtlasPage${h}_usage.png`), x1.wrap(new Uint8Array(await (await g.getUsagePreview()).arrayBuffer()))));
              await Promise.all(d);
            }
          });
          break;
        case "drawGlyph":
          n.invokeFunction(async (o) => {
            var H, j, K;
            const a = o.get(xn), l = o.get(FIe), c = o.get(tc), d = o.get(i0).getWorkspace().folders;
            if (d.length === 0)
              return;
            const h = Cc.atlas, g = a.getValue("editor.fontFamily"), m = a.getValue("editor.fontSize"), _ = new I4(m, g, rr().devicePixelRatio, Cc.decorationStyleCache);
            let v = await c.input({
              prompt: "Enter a character to draw (prefix with 0x for code point))"
            });
            if (!v)
              return;
            const w = (j = (H = v.match(/0x(?<codePoint>[0-9a-f]+)/i)) == null ? void 0 : H.groups) == null ? void 0 : j.codePoint;
            w !== void 0 && (v = String.fromCodePoint(parseInt(w, 16)));
            const E = 0, T = h.getGlyph(_, v, E, 0, 0);
            if (!T)
              return;
            const D = (K = h.pages[T.pageIndex].source.getContext("2d")) == null ? void 0 : K.getImageData(T.x, T.y, T.w, T.h);
            if (!D)
              return;
            const N = new OffscreenCanvas(D.width, D.height);
            aT(N.getContext("2d")).putImageData(D, 0, 0);
            const M = await N.convertToBlob({ type: "image/png" }), B = Ht.joinPath(d[0].uri, `glyph_${v}_${E}_${m}px_${g.replaceAll(/[,\\\/\.'\s]/g, "_")}.png`);
            await l.writeFile(B, x1.wrap(new Uint8Array(await M.arrayBuffer())));
          });
          break;
      }
  }
}
Je(yDt);
var Ap;
(function(i) {
  i.NoAutoFocus = "noAutoFocus", i.FocusIfVisible = "focusIfVisible", i.AutoFocusImmediately = "autoFocusImmediately";
})(Ap || (Ap = {}));
class CDt extends vt {
  constructor() {
    super({
      id: bBe,
      label: Ee(1102, "Show or Focus Hover"),
      metadata: {
        description: Ee(1103, "Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),
        args: [{
          name: "args",
          schema: {
            type: "object",
            properties: {
              focus: {
                description: "Controls if and when the hover should take focus upon being triggered by this action.",
                enum: [Ap.NoAutoFocus, Ap.FocusIfVisible, Ap.AutoFocusImmediately],
                enumDescriptions: [
                  S(1099, "The hover will not automatically take focus."),
                  S(1100, "The hover will take focus only if it is already visible."),
                  S(1101, "The hover will automatically take focus when it appears.")
                ],
                default: Ap.FocusIfVisible
              }
            }
          }
        }]
      },
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2087
          /* KeyCode.KeyI */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t, n) {
    if (!t.hasModel())
      return;
    const r = nc.get(t);
    if (!r)
      return;
    const s = n == null ? void 0 : n.focus;
    let o = Ap.FocusIfVisible;
    Object.values(Ap).includes(s) ? o = s : typeof s == "boolean" && s && (o = Ap.AutoFocusImmediately);
    const a = (c) => {
      const u = t.getPosition(), d = new z(u.lineNumber, u.column, u.lineNumber, u.column);
      r.showContentHover(d, 1, 2, c);
    }, l = t.getOption(
      2
      /* EditorOption.accessibilitySupport */
    ) === 2;
    r.isHoverVisible ? o !== Ap.NoAutoFocus ? r.focus() : a(l) : a(l || o === Ap.AutoFocusImmediately);
  }
}
class wDt extends vt {
  constructor() {
    super({
      id: GCt,
      label: Ee(1104, "Show Definition Preview Hover"),
      precondition: void 0,
      metadata: {
        description: Ee(1105, "Show the definition preview hover in the editor.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    if (!n)
      return;
    const r = t.getPosition();
    if (!r)
      return;
    const s = new z(r.lineNumber, r.column, r.lineNumber, r.column), o = b5.get(t);
    if (!o)
      return;
    o.startFindDefinitionFromCursor(r).then(() => {
      n.showContentHover(s, 1, 2, !0);
    });
  }
}
class SDt extends vt {
  constructor() {
    super({
      id: qCt,
      label: Ee(1106, "Hide Hover"),
      alias: "Hide Content Hover",
      precondition: void 0
    });
  }
  run(e, t) {
    var n;
    (n = nc.get(t)) == null || n.hideContentHover();
  }
}
class EDt extends vt {
  constructor() {
    super({
      id: KCt,
      label: Ee(1107, "Scroll Up Hover"),
      precondition: se.hoverFocused,
      kbOpts: {
        kbExpr: se.hoverFocused,
        primary: 16,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1108, "Scroll up the editor hover.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    n && n.scrollUp();
  }
}
class xDt extends vt {
  constructor() {
    super({
      id: YCt,
      label: Ee(1109, "Scroll Down Hover"),
      precondition: se.hoverFocused,
      kbOpts: {
        kbExpr: se.hoverFocused,
        primary: 18,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1110, "Scroll down the editor hover.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    n && n.scrollDown();
  }
}
class LDt extends vt {
  constructor() {
    super({
      id: XCt,
      label: Ee(1111, "Scroll Left Hover"),
      precondition: se.hoverFocused,
      kbOpts: {
        kbExpr: se.hoverFocused,
        primary: 15,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1112, "Scroll left the editor hover.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    n && n.scrollLeft();
  }
}
class TDt extends vt {
  constructor() {
    super({
      id: ZCt,
      label: Ee(1113, "Scroll Right Hover"),
      precondition: se.hoverFocused,
      kbOpts: {
        kbExpr: se.hoverFocused,
        primary: 17,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1114, "Scroll right the editor hover.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    n && n.scrollRight();
  }
}
class kDt extends vt {
  constructor() {
    super({
      id: QCt,
      label: Ee(1115, "Page Up Hover"),
      precondition: se.hoverFocused,
      kbOpts: {
        kbExpr: se.hoverFocused,
        primary: 11,
        secondary: [
          528
          /* KeyCode.UpArrow */
        ],
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1116, "Page up the editor hover.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    n && n.pageUp();
  }
}
class DDt extends vt {
  constructor() {
    super({
      id: JCt,
      label: Ee(1117, "Page Down Hover"),
      precondition: se.hoverFocused,
      kbOpts: {
        kbExpr: se.hoverFocused,
        primary: 12,
        secondary: [
          530
          /* KeyCode.DownArrow */
        ],
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1118, "Page down the editor hover.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    n && n.pageDown();
  }
}
class IDt extends vt {
  constructor() {
    super({
      id: e1t,
      label: Ee(1119, "Go To Top Hover"),
      precondition: se.hoverFocused,
      kbOpts: {
        kbExpr: se.hoverFocused,
        primary: 14,
        secondary: [
          2064
          /* KeyCode.UpArrow */
        ],
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1120, "Go to the top of the editor hover.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    n && n.goToTop();
  }
}
class NDt extends vt {
  constructor() {
    super({
      id: t1t,
      label: Ee(1121, "Go To Bottom Hover"),
      precondition: se.hoverFocused,
      kbOpts: {
        kbExpr: se.hoverFocused,
        primary: 13,
        secondary: [
          2066
          /* KeyCode.DownArrow */
        ],
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1122, "Go to the bottom of the editor hover.")
      }
    });
  }
  run(e, t) {
    const n = nc.get(t);
    n && n.goToBottom();
  }
}
class RDt extends vt {
  constructor() {
    super({
      id: vK,
      label: n1t,
      alias: "Increase Hover Verbosity Level",
      precondition: se.hoverVisible
    });
  }
  run(e, t, n) {
    const r = nc.get(t);
    if (!r)
      return;
    const s = (n == null ? void 0 : n.index) !== void 0 ? n.index : r.focusedHoverPartIndex();
    r.updateHoverVerbosityLevel(kd.Increase, s, n == null ? void 0 : n.focus);
  }
}
class ADt extends vt {
  constructor() {
    super({
      id: yK,
      label: i1t,
      alias: "Decrease Hover Verbosity Level",
      precondition: se.hoverVisible
    });
  }
  run(e, t, n) {
    var o;
    const r = nc.get(t);
    if (!r)
      return;
    const s = (n == null ? void 0 : n.index) !== void 0 ? n.index : r.focusedHoverPartIndex();
    (o = nc.get(t)) == null || o.updateHoverVerbosityLevel(kd.Decrease, s, n == null ? void 0 : n.focus);
  }
}
var ODt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Tte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const Sg = Ge;
class MDt {
  constructor(e, t, n) {
    this.owner = e, this.range = t, this.marker = n;
  }
  isValidForHoverAnchor(e) {
    return e.type === 1 && this.range.startColumn <= e.range.startColumn && this.range.endColumn >= e.range.endColumn;
  }
}
const aNe = {
  type: 1,
  filter: { include: cs.QuickFix },
  triggerAction: Gd.QuickFixHover
};
let qae = class {
  constructor(e, t, n, r) {
    this._editor = e, this._markerDecorationsService = t, this._openerService = n, this._languageFeaturesService = r, this.hoverOrdinal = 1, this.recentMarkerCodeActionsInfo = void 0;
  }
  computeSync(e, t) {
    if (!this._editor.hasModel() || e.type !== 1 && !e.supportsMarkerHover)
      return [];
    const n = this._editor.getModel(), r = e.range;
    if (!n.isValidRange(e.range))
      return [];
    const s = r.startLineNumber, o = n.getLineMaxColumn(s), a = [];
    for (const l of t) {
      const c = l.range.startLineNumber === s ? l.range.startColumn : 1, u = l.range.endLineNumber === s ? l.range.endColumn : o, d = this._markerDecorationsService.getMarker(n.uri, l);
      if (!d)
        continue;
      const h = new z(e.range.startLineNumber, c, e.range.startLineNumber, u);
      a.push(new MDt(this, h, d));
    }
    return a;
  }
  renderHoverParts(e, t) {
    if (!t.length)
      return new wT([]);
    const n = [];
    t.forEach((o) => {
      const a = this._renderMarkerHover(o);
      e.fragment.appendChild(a.hoverElement), n.push(a);
    });
    const r = t.length === 1 ? t[0] : t.sort((o, a) => Os.compare(o.marker.severity, a.marker.severity))[0], s = this._renderMarkerStatusbar(e, r);
    return new wT(n, s);
  }
  _renderMarkerHover(e) {
    const t = new ke(), n = Sg("div.hover-row"), r = Fe(n, Sg("div.marker.hover-contents")), { source: s, message: o, code: a, relatedInformation: l } = e.marker;
    this._editor.applyFontInfo(r);
    const c = Fe(r, Sg("span"));
    if (c.style.whiteSpace = "pre-wrap", c.innerText = o, s || a)
      if (a && typeof a != "string") {
        const d = Sg("span");
        if (s) {
          const _ = Fe(d, Sg("span"));
          _.innerText = s;
        }
        const h = Fe(d, Sg("a.code-link"));
        h.setAttribute("href", a.target.toString(!0)), t.add(Ce(h, "click", (_) => {
          this._openerService.open(a.target, { allowCommands: !0 }), _.preventDefault(), _.stopPropagation();
        }));
        const g = Fe(h, Sg("span"));
        g.innerText = a.value;
        const m = Fe(r, d);
        m.style.opacity = "0.6", m.style.paddingLeft = "6px";
      } else {
        const d = Fe(r, Sg("span"));
        d.style.opacity = "0.6", d.style.paddingLeft = "6px", d.innerText = s && a ? `${s}(${a})` : s || `(${a})`;
      }
    if (kc(l))
      for (const { message: d, resource: h, startLineNumber: g, startColumn: m } of l) {
        const _ = Fe(r, Sg("div"));
        _.style.marginTop = "8px";
        const v = Fe(_, Sg("a"));
        v.innerText = `${Kf(h)}(${g}, ${m}): `, v.style.cursor = "pointer", t.add(Ce(v, "click", (E) => {
          if (E.stopPropagation(), E.preventDefault(), this._openerService) {
            const L = { selection: { startLineNumber: g, startColumn: m } };
            this._openerService.open(h, {
              fromUserGesture: !0,
              editorOptions: L
            }).catch(fn);
          }
        }));
        const w = Fe(_, Sg("span"));
        w.innerText = d, this._editor.applyFontInfo(w);
      }
    return {
      hoverPart: e,
      hoverElement: n,
      dispose: () => t.dispose()
    };
  }
  _renderMarkerStatusbar(e, t) {
    const n = new ke();
    if (t.marker.severity === Os.Error || t.marker.severity === Os.Warning || t.marker.severity === Os.Info) {
      const r = DT.get(this._editor);
      r && e.statusBar.addAction({
        label: S(1132, "View Problem"),
        commandId: Yz.ID,
        run: () => {
          e.hide(), r.showAtMarker(t.marker), this._editor.focus();
        }
      });
    }
    if (!this._editor.getOption(
      104
      /* EditorOption.readOnly */
    )) {
      const r = e.statusBar.append(Sg("div"));
      this.recentMarkerCodeActionsInfo && (nz.makeKey(this.recentMarkerCodeActionsInfo.marker) === nz.makeKey(t.marker) ? this.recentMarkerCodeActionsInfo.hasCodeActions || (r.textContent = S(1133, "No quick fixes available")) : this.recentMarkerCodeActionsInfo = void 0);
      const s = this.recentMarkerCodeActionsInfo && !this.recentMarkerCodeActionsInfo.hasCodeActions ? ge.None : jy(() => r.textContent = S(1134, "Checking for quick fixes..."), 200, n);
      r.textContent || (r.textContent = " ");
      const o = this.getCodeActions(t.marker);
      n.add(Et(() => o.cancel())), o.then((a) => {
        var u;
        if (s.dispose(), this.recentMarkerCodeActionsInfo = { marker: t.marker, hasCodeActions: a.validActions.length > 0 }, !this.recentMarkerCodeActionsInfo.hasCodeActions) {
          a.dispose(), r.textContent = S(1135, "No quick fixes available");
          return;
        }
        r.style.display = "none";
        let l = !1;
        n.add(Et(() => {
          l || a.dispose();
        })), e.statusBar.addAction({
          label: S(1136, "Quick Fix..."),
          commandId: $ge,
          run: (d) => {
            l = !0;
            const h = CT.get(this._editor), g = ho(d);
            e.hide(), h == null || h.showCodeActions(aNe, a, {
              x: g.left,
              y: g.top,
              width: g.width,
              height: g.height
            });
          }
        });
        const c = a.validActions.find((d) => d.action.isAI);
        c && e.statusBar.addAction({
          label: c.action.title,
          commandId: ((u = c.action.command) == null ? void 0 : u.id) ?? "",
          iconClass: qt.asClassName(Pe.sparkle),
          run: () => {
            const d = CT.get(this._editor);
            d == null || d.applyCodeAction(c, !1, !1, p1.FromProblemsHover);
          }
        }), e.onContentsChanged();
      }, fn);
    }
    return n;
  }
  getCodeActions(e) {
    return Jo((t) => gN(this._languageFeaturesService.codeActionProvider, this._editor.getModel(), new z(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn), aNe, tm.None, t));
  }
};
qae = ODt([
  Tte(1, mfe),
  Tte(2, ad),
  Tte(3, St)
], qae);
class PDt {
  constructor(e) {
    this._editor = e;
  }
  computeSync(e) {
    var o;
    const t = (a) => ({
      value: a
    }), n = this._editor.getLineDecorations(e.lineNumber), r = [], s = e.laneOrLine === "lineNo";
    if (!n)
      return r;
    for (const a of n) {
      const l = ((o = a.options.glyphMargin) == null ? void 0 : o.position) ?? fm.Center;
      if (!s && l !== e.laneOrLine)
        continue;
      const c = s ? a.options.lineNumberHoverMessage : a.options.glyphMarginHoverMessage;
      !c || aA(c) || r.push(...Ghe(c).map(t));
    }
    return r;
  }
}
var FDt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, lNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Kae;
const cNe = Ge;
var AL;
let Yae = (AL = class extends ge {
  constructor(e, t, n) {
    super(), this._renderDisposeables = this._register(new ke()), this._editor = e, this._isVisible = !1, this._messages = [], this._hover = this._register(new Xge(!0)), this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible), this._markdownRenderer = new n0({ editor: this._editor }, t, n), this._hoverOperation = this._register(new wBe(this._editor, new PDt(this._editor))), this._register(this._hoverOperation.onResult((r) => this._withResult(r))), this._register(this._editor.onDidChangeModelDecorations(() => this._onModelDecorationsChanged())), this._register(this._editor.onDidChangeConfiguration((r) => {
      r.hasChanged(
        59
        /* EditorOption.fontInfo */
      ) && this._updateFont();
    })), this._register(vo(this._hover.containerDomNode, "mouseleave", (r) => {
      this._onMouseLeave(r);
    })), this._editor.addOverlayWidget(this);
  }
  dispose() {
    this._hoverComputerOptions = void 0, this._editor.removeOverlayWidget(this), super.dispose();
  }
  getId() {
    return Kae.ID;
  }
  getDomNode() {
    return this._hover.containerDomNode;
  }
  getPosition() {
    return null;
  }
  _updateFont() {
    Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((t) => this._editor.applyFontInfo(t));
  }
  _onModelDecorationsChanged() {
    this._isVisible && this._hoverComputerOptions && (this._hoverOperation.cancel(), this._hoverOperation.start(0, this._hoverComputerOptions));
  }
  showsOrWillShow(e) {
    const t = e.target;
    return t.type === 2 && t.detail.glyphMarginLane ? (this._startShowingAt(t.position.lineNumber, t.detail.glyphMarginLane), !0) : t.type === 3 ? (this._startShowingAt(t.position.lineNumber, "lineNo"), !0) : !1;
  }
  _startShowingAt(e, t) {
    this._hoverComputerOptions && this._hoverComputerOptions.lineNumber === e && this._hoverComputerOptions.laneOrLine === t || (this._hoverOperation.cancel(), this.hide(), this._hoverComputerOptions = { lineNumber: e, laneOrLine: t }, this._hoverOperation.start(0, this._hoverComputerOptions));
  }
  hide() {
    this._hoverComputerOptions = void 0, this._hoverOperation.cancel(), this._isVisible && (this._isVisible = !1, this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible));
  }
  _withResult(e) {
    this._messages = e.value, this._messages.length > 0 ? this._renderMessages(e.options.lineNumber, e.options.laneOrLine, this._messages) : this.hide();
  }
  _renderMessages(e, t, n) {
    this._renderDisposeables.clear();
    const r = document.createDocumentFragment();
    for (const s of n) {
      const o = cNe("div.hover-row.markdown-hover"), a = Fe(o, cNe("div.hover-contents")), l = this._renderDisposeables.add(this._markdownRenderer.render(s.value));
      a.appendChild(l.element), r.appendChild(o);
    }
    this._updateContents(r), this._showAt(e, t);
  }
  _updateContents(e) {
    this._hover.contentsDomNode.textContent = "", this._hover.contentsDomNode.appendChild(e), this._updateFont();
  }
  _showAt(e, t) {
    this._isVisible || (this._isVisible = !0, this._hover.containerDomNode.classList.toggle("hidden", !this._isVisible));
    const n = this._editor.getLayoutInfo(), r = this._editor.getTopForLineNumber(e), s = this._editor.getScrollTop(), o = this._editor.getOption(
      75
      /* EditorOption.lineHeight */
    ), a = this._hover.containerDomNode.clientHeight, l = r - s - (a - o) / 2, c = n.glyphMarginLeft + n.glyphMarginWidth + (t === "lineNo" ? n.lineNumbersWidth : 0);
    this._hover.containerDomNode.style.left = `${c}px`, this._hover.containerDomNode.style.top = `${Math.max(Math.round(l), 0)}px`, this._hover.containerDomNode.style.zIndex = "11";
  }
  _onMouseLeave(e) {
    const t = this._editor.getDomNode();
    (!t || !CK(t, e.x, e.y)) && this.hide();
  }
}, Kae = AL, AL.ID = "editor.contrib.modesGlyphHoverWidget", AL);
Yae = Kae = FDt([
  lNe(1, Gr),
  lNe(2, ad)
], Yae);
var BDt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, HDt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, kR;
let Xz = (kR = class extends ge {
  constructor(e, t) {
    super(), this._editor = e, this._instantiationService = t, this.shouldKeepOpenOnEditorMouseMoveOrLeave = !1, this._listenersStore = new ke(), this._hoverState = {
      mouseDown: !1
    }, this._reactToEditorMouseMoveRunner = this._register(new mr(() => this._reactToEditorMouseMove(this._mouseMoveEvent), 0)), this._hookListeners(), this._register(this._editor.onDidChangeConfiguration((n) => {
      n.hasChanged(
        69
        /* EditorOption.hover */
      ) && (this._unhookListeners(), this._hookListeners());
    }));
  }
  _hookListeners() {
    const e = this._editor.getOption(
      69
      /* EditorOption.hover */
    );
    this._hoverSettings = {
      enabled: e.enabled,
      sticky: e.sticky,
      hidingDelay: e.hidingDelay
    }, e.enabled ? (this._listenersStore.add(this._editor.onMouseDown((t) => this._onEditorMouseDown(t))), this._listenersStore.add(this._editor.onMouseUp(() => this._onEditorMouseUp())), this._listenersStore.add(this._editor.onMouseMove((t) => this._onEditorMouseMove(t))), this._listenersStore.add(this._editor.onKeyDown((t) => this._onKeyDown(t)))) : (this._listenersStore.add(this._editor.onMouseMove((t) => this._onEditorMouseMove(t))), this._listenersStore.add(this._editor.onKeyDown((t) => this._onKeyDown(t)))), this._listenersStore.add(this._editor.onMouseLeave((t) => this._onEditorMouseLeave(t))), this._listenersStore.add(this._editor.onDidChangeModel(() => {
      this._cancelScheduler(), this.hideGlyphHover();
    })), this._listenersStore.add(this._editor.onDidChangeModelContent(() => this._cancelScheduler())), this._listenersStore.add(this._editor.onDidScrollChange((t) => this._onEditorScrollChanged(t)));
  }
  _unhookListeners() {
    this._listenersStore.clear();
  }
  _cancelScheduler() {
    this._mouseMoveEvent = void 0, this._reactToEditorMouseMoveRunner.cancel();
  }
  _onEditorScrollChanged(e) {
    (e.scrollTopChanged || e.scrollLeftChanged) && this.hideGlyphHover();
  }
  _onEditorMouseDown(e) {
    this._hoverState.mouseDown = !0, !this._isMouseOnGlyphHoverWidget(e) && this.hideGlyphHover();
  }
  _isMouseOnGlyphHoverWidget(e) {
    var n;
    const t = (n = this._glyphWidget) == null ? void 0 : n.getDomNode();
    return t ? CK(t, e.event.posx, e.event.posy) : !1;
  }
  _onEditorMouseUp() {
    this._hoverState.mouseDown = !1;
  }
  _onEditorMouseLeave(e) {
    this.shouldKeepOpenOnEditorMouseMoveOrLeave || (this._cancelScheduler(), this._isMouseOnGlyphHoverWidget(e)) || this.hideGlyphHover();
  }
  _shouldNotRecomputeCurrentHoverWidget(e) {
    const t = this._hoverSettings.sticky, n = this._isMouseOnGlyphHoverWidget(e);
    return t && n;
  }
  _onEditorMouseMove(e) {
    if (this.shouldKeepOpenOnEditorMouseMoveOrLeave)
      return;
    if (this._mouseMoveEvent = e, this._shouldNotRecomputeCurrentHoverWidget(e)) {
      this._reactToEditorMouseMoveRunner.cancel();
      return;
    }
    this._reactToEditorMouseMove(e);
  }
  _reactToEditorMouseMove(e) {
    !e || this._tryShowHoverWidget(e) || this.hideGlyphHover();
  }
  _tryShowHoverWidget(e) {
    return this._getOrCreateGlyphWidget().showsOrWillShow(e);
  }
  _onKeyDown(e) {
    this._editor.hasModel() && (e.keyCode === 5 || e.keyCode === 6 || e.keyCode === 57 || e.keyCode === 4 || this.hideGlyphHover());
  }
  hideGlyphHover() {
    var e;
    (e = this._glyphWidget) == null || e.hide();
  }
  _getOrCreateGlyphWidget() {
    return this._glyphWidget || (this._glyphWidget = this._instantiationService.createInstance(Yae, this._editor)), this._glyphWidget;
  }
  dispose() {
    var e;
    super.dispose(), this._unhookListeners(), this._listenersStore.dispose(), (e = this._glyphWidget) == null || e.dispose();
  }
}, kR.ID = "editor.contrib.marginHover", kR);
Xz = BDt([
  HDt(1, xt)
], Xz);
class WDt {
}
class VDt {
}
class UDt {
}
Si(
  nc.ID,
  nc,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Si(
  Xz.ID,
  Xz,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Je(CDt);
Je(wDt);
Je(SDt);
Je(EDt);
Je(xDt);
Je(LDt);
Je(TDt);
Je(kDt);
Je(DDt);
Je(IDt);
Je(NDt);
Je(RDt);
Je(ADt);
nk.register(n5);
nk.register(qae);
ng((i, e) => {
  const t = i.getColor(Cfe);
  t && (e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(0.5)}; }`), e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(0.5)}; }`), e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(0.5)}; }`));
});
OK.register(new WDt());
OK.register(new VDt());
OK.register(new UDt());
function Ld(i, e) {
  let t = 0;
  for (let n = 0; n < i.length; n++)
    i.charAt(n) === "	" ? t += e : t++;
  return t;
}
function n3(i, e, t) {
  i = i < 0 ? 0 : i;
  let n = "";
  if (!t) {
    const r = Math.floor(i / e);
    i = i % e;
    for (let s = 0; s < r; s++)
      n += "	";
  }
  for (let r = 0; r < i; r++)
    n += " ";
  return n;
}
function y8e(i, e, t, n) {
  if (i.getLineCount() === 1 && i.getLineMaxColumn(1) === 1)
    return [];
  const r = e.getLanguageConfiguration(i.getLanguageId()).indentRulesSupport;
  if (!r)
    return [];
  const s = new ufe(i, r, e);
  for (n = Math.min(n, i.getLineCount()); t <= n && s.shouldIgnore(t); )
    t++;
  if (t > n - 1)
    return [];
  const { tabSize: o, indentSize: a, insertSpaces: l } = i.getOptions(), c = (_, v) => (v = v || 1, Xf.shiftIndent(_, _.length + v, o, a, l)), u = (_, v) => (v = v || 1, Xf.unshiftIndent(_, _.length + v, o, a, l)), d = [], h = i.getLineContent(t);
  let g = Ir(h), m = g;
  s.shouldIncrease(t) ? (m = c(m), g = c(g)) : s.shouldIndentNextLine(t) && (m = c(m)), t++;
  for (let _ = t; _ <= n; _++) {
    if (zDt(i, _))
      continue;
    const v = i.getLineContent(_), w = Ir(v), E = m;
    s.shouldDecrease(_, E) && (m = u(m), g = u(g)), w !== m && d.push(Xs.replaceMove(new bt(_, 1, _, w.length + 1), ife(m, a, l))), !s.shouldIgnore(_) && (s.shouldIncrease(_, E) ? (g = c(g), m = g) : s.shouldIndentNextLine(_, E) ? m = c(m) : m = g);
  }
  return d;
}
function zDt(i, e) {
  return i.tokenization.isCheapToTokenize(e) ? i.tokenization.getLineTokens(e).getStandardTokenType(0) === 2 : !1;
}
var $Dt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, jDt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const IG = class IG extends vt {
  constructor() {
    super({
      id: IG.ID,
      label: Ee(1141, "Convert Indentation to Spaces"),
      precondition: se.writable,
      metadata: {
        description: Ee(1142, "Convert the tab indentation to spaces.")
      }
    });
  }
  run(e, t) {
    const n = t.getModel();
    if (!n)
      return;
    const r = n.getOptions(), s = t.getSelection();
    if (!s)
      return;
    const o = new XDt(s, r.tabSize);
    t.pushUndoStop(), t.executeCommands(this.id, [o]), t.pushUndoStop(), n.updateOptions({
      insertSpaces: !0
    });
  }
};
IG.ID = "editor.action.indentationToSpaces";
let Xae = IG;
const NG = class NG extends vt {
  constructor() {
    super({
      id: NG.ID,
      label: Ee(1143, "Convert Indentation to Tabs"),
      precondition: se.writable,
      metadata: {
        description: Ee(1144, "Convert the spaces indentation to tabs.")
      }
    });
  }
  run(e, t) {
    const n = t.getModel();
    if (!n)
      return;
    const r = n.getOptions(), s = t.getSelection();
    if (!s)
      return;
    const o = new ZDt(s, r.tabSize);
    t.pushUndoStop(), t.executeCommands(this.id, [o]), t.pushUndoStop(), n.updateOptions({
      insertSpaces: !1
    });
  }
};
NG.ID = "editor.action.indentationToTabs";
let Zae = NG;
class zpe extends vt {
  constructor(e, t, n) {
    super(n), this.insertSpaces = e, this.displaySizeOnly = t;
  }
  run(e, t) {
    const n = e.get(tc), r = e.get(xs), s = t.getModel();
    if (!s)
      return;
    const o = r.getCreationOptions(s.getLanguageId(), s.uri, s.isForSimpleWidget), a = s.getOptions(), l = [1, 2, 3, 4, 5, 6, 7, 8].map((u) => ({
      id: u.toString(),
      label: u.toString(),
      // add description for tabSize value set in the configuration
      description: u === o.tabSize && u === a.tabSize ? S(1137, "Configured Tab Size") : u === o.tabSize ? S(1138, "Default Tab Size") : u === a.tabSize ? S(1139, "Current Tab Size") : void 0
    })), c = Math.min(s.getOptions().tabSize - 1, 7);
    setTimeout(
      () => {
        n.pick(l, { placeHolder: S(1140, "Select Tab Size for Current File"), activeItem: l[c] }).then((u) => {
          if (u && s && !s.isDisposed()) {
            const d = parseInt(u.label, 10);
            this.displaySizeOnly ? s.updateOptions({
              tabSize: d
            }) : s.updateOptions({
              tabSize: d,
              indentSize: d,
              insertSpaces: this.insertSpaces
            });
          }
        });
      },
      50
      /* quick input is sensitive to being opened so soon after another */
    );
  }
}
const RG = class RG extends zpe {
  constructor() {
    super(!1, !1, {
      id: RG.ID,
      label: Ee(1145, "Indent Using Tabs"),
      precondition: void 0,
      metadata: {
        description: Ee(1146, "Use indentation with tabs.")
      }
    });
  }
};
RG.ID = "editor.action.indentUsingTabs";
let Qae = RG;
const AG = class AG extends zpe {
  constructor() {
    super(!0, !1, {
      id: AG.ID,
      label: Ee(1147, "Indent Using Spaces"),
      precondition: void 0,
      metadata: {
        description: Ee(1148, "Use indentation with spaces.")
      }
    });
  }
};
AG.ID = "editor.action.indentUsingSpaces";
let Jae = AG;
const OG = class OG extends zpe {
  constructor() {
    super(!0, !0, {
      id: OG.ID,
      label: Ee(1149, "Change Tab Display Size"),
      precondition: void 0,
      metadata: {
        description: Ee(1150, "Change the space size equivalent of the tab.")
      }
    });
  }
};
OG.ID = "editor.action.changeTabDisplaySize";
let ele = OG;
const MG = class MG extends vt {
  constructor() {
    super({
      id: MG.ID,
      label: Ee(1151, "Detect Indentation from Content"),
      precondition: void 0,
      metadata: {
        description: Ee(1152, "Detect the indentation from content.")
      }
    });
  }
  run(e, t) {
    const n = e.get(xs), r = t.getModel();
    if (!r)
      return;
    const s = n.getCreationOptions(r.getLanguageId(), r.uri, r.isForSimpleWidget);
    r.detectIndentation(s.insertSpaces, s.tabSize);
  }
};
MG.ID = "editor.action.detectIndentation";
let tle = MG;
class GDt extends vt {
  constructor() {
    super({
      id: "editor.action.reindentlines",
      label: Ee(1153, "Reindent Lines"),
      precondition: se.writable,
      metadata: {
        description: Ee(1154, "Reindent the lines of the editor.")
      }
    });
  }
  run(e, t) {
    const n = e.get(Ls), r = t.getModel();
    if (!r)
      return;
    const s = y8e(r, n, 1, r.getLineCount());
    s.length > 0 && (t.pushUndoStop(), t.executeEdits(this.id, s), t.pushUndoStop());
  }
}
class qDt extends vt {
  constructor() {
    super({
      id: "editor.action.reindentselectedlines",
      label: Ee(1155, "Reindent Selected Lines"),
      precondition: se.writable,
      metadata: {
        description: Ee(1156, "Reindent the selected lines of the editor.")
      }
    });
  }
  run(e, t) {
    const n = e.get(Ls), r = t.getModel();
    if (!r)
      return;
    const s = t.getSelections();
    if (s === null)
      return;
    const o = [];
    for (const a of s) {
      let l = a.startLineNumber, c = a.endLineNumber;
      if (l !== c && a.endColumn === 1 && c--, l === 1) {
        if (l === c)
          continue;
      } else
        l--;
      const u = y8e(r, n, l, c);
      o.push(...u);
    }
    o.length > 0 && (t.pushUndoStop(), t.executeEdits(this.id, o), t.pushUndoStop());
  }
}
class KDt {
  constructor(e, t) {
    this._initialSelection = t, this._edits = [], this._selectionId = null;
    for (const n of e)
      n.range && typeof n.text == "string" && this._edits.push(n);
  }
  getEditOperations(e, t) {
    for (const r of this._edits)
      t.addEditOperation(z.lift(r.range), r.text);
    let n = !1;
    Array.isArray(this._edits) && this._edits.length === 1 && this._initialSelection.isEmpty() && (this._edits[0].range.startColumn === this._initialSelection.endColumn && this._edits[0].range.startLineNumber === this._initialSelection.endLineNumber ? (n = !0, this._selectionId = t.trackSelection(this._initialSelection, !0)) : this._edits[0].range.endColumn === this._initialSelection.startColumn && this._edits[0].range.endLineNumber === this._initialSelection.startLineNumber && (n = !0, this._selectionId = t.trackSelection(this._initialSelection, !1))), n || (this._selectionId = t.trackSelection(this._initialSelection));
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._selectionId);
  }
}
var DR;
let Zz = (DR = class {
  constructor(e, t) {
    this.editor = e, this._languageConfigurationService = t, this.callOnDispose = new ke(), this.callOnModel = new ke(), this.callOnDispose.add(e.onDidChangeConfiguration(() => this.update())), this.callOnDispose.add(e.onDidChangeModel(() => this.update())), this.callOnDispose.add(e.onDidChangeModelLanguage(() => this.update()));
  }
  update() {
    this.callOnModel.clear(), !(!this.editor.getOption(
      17
      /* EditorOption.autoIndentOnPaste */
    ) || this.editor.getOption(
      16
      /* EditorOption.autoIndent */
    ) < 4) && this.editor.hasModel() && this.callOnModel.add(this.editor.onDidPaste(({ range: e }) => {
      this.trigger(e);
    }));
  }
  trigger(e) {
    const t = this.editor.getSelections();
    if (t === null || t.length > 1)
      return;
    const n = this.editor.getModel();
    if (!n || this.rangeContainsOnlyWhitespaceCharacters(n, e) || !this.editor.getOption(
      18
      /* EditorOption.autoIndentOnPasteWithinString */
    ) && YDt(n, e) || !n.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))
      return;
    const s = this.editor.getOption(
      16
      /* EditorOption.autoIndent */
    ), { tabSize: o, indentSize: a, insertSpaces: l } = n.getOptions(), c = [], u = {
      shiftIndent: (m) => Xf.shiftIndent(m, m.length + 1, o, a, l),
      unshiftIndent: (m) => Xf.unshiftIndent(m, m.length + 1, o, a, l)
    };
    let d = e.startLineNumber, h = n.getLineContent(d);
    if (!/\S/.test(h.substring(0, e.startColumn - 1))) {
      const m = SF(s, n, n.getLanguageId(), d, u, this._languageConfigurationService);
      if (m !== null) {
        const _ = Ir(h), v = Ld(m, o), w = Ld(_, o);
        if (v !== w) {
          const E = n3(v, o, l);
          c.push({
            range: new z(d, 1, d, _.length + 1),
            text: E
          }), h = E + h.substring(_.length);
        } else {
          const E = bFe(n, d, this._languageConfigurationService);
          if (E === 0 || E === 8)
            return;
        }
      }
    }
    const g = d;
    for (; d < e.endLineNumber; ) {
      if (!/\S/.test(n.getLineContent(d + 1))) {
        d++;
        continue;
      }
      break;
    }
    if (d !== e.endLineNumber) {
      const _ = SF(s, {
        tokenization: {
          getLineTokens: (v) => n.tokenization.getLineTokens(v),
          getLanguageId: () => n.getLanguageId(),
          getLanguageIdAtPosition: (v, w) => n.getLanguageIdAtPosition(v, w)
        },
        getLineContent: (v) => v === g ? h : n.getLineContent(v)
      }, n.getLanguageId(), d + 1, u, this._languageConfigurationService);
      if (_ !== null) {
        const v = Ld(_, o), w = Ld(Ir(n.getLineContent(d + 1)), o);
        if (v !== w) {
          const E = v - w;
          for (let L = d + 1; L <= e.endLineNumber; L++) {
            const T = n.getLineContent(L), D = Ir(T), R = Ld(D, o) + E, M = n3(R, o, l);
            M !== D && c.push({
              range: new z(L, 1, L, D.length + 1),
              text: M
            });
          }
        }
      }
    }
    if (c.length > 0) {
      this.editor.pushUndoStop();
      const m = new KDt(c, this.editor.getSelection());
      this.editor.executeCommand("autoIndentOnPaste", m), this.editor.pushUndoStop();
    }
  }
  rangeContainsOnlyWhitespaceCharacters(e, t) {
    const n = (s) => s.trim().length === 0;
    let r = !0;
    if (t.startLineNumber === t.endLineNumber) {
      const o = e.getLineContent(t.startLineNumber).substring(t.startColumn - 1, t.endColumn - 1);
      r = n(o);
    } else
      for (let s = t.startLineNumber; s <= t.endLineNumber; s++) {
        const o = e.getLineContent(s);
        if (s === t.startLineNumber) {
          const a = o.substring(t.startColumn - 1);
          r = n(a);
        } else if (s === t.endLineNumber) {
          const a = o.substring(0, t.endColumn - 1);
          r = n(a);
        } else
          r = e.getLineFirstNonWhitespaceColumn(s) === 0;
        if (!r)
          break;
      }
    return r;
  }
  dispose() {
    this.callOnDispose.dispose(), this.callOnModel.dispose();
  }
}, DR.ID = "editor.contrib.autoIndentOnPaste", DR);
Zz = $Dt([
  jDt(1, Ls)
], Zz);
function YDt(i, e) {
  const t = (n) => Bst(i, n) === 2;
  return t(e.getStartPosition()) || t(e.getEndPosition());
}
function C8e(i, e, t, n) {
  if (i.getLineCount() === 1 && i.getLineMaxColumn(1) === 1)
    return;
  let r = "";
  for (let o = 0; o < t; o++)
    r += " ";
  const s = new RegExp(r, "gi");
  for (let o = 1, a = i.getLineCount(); o <= a; o++) {
    let l = i.getLineFirstNonWhitespaceColumn(o);
    if (l === 0 && (l = i.getLineMaxColumn(o)), l === 1)
      continue;
    const c = new z(o, 1, o, l), u = i.getValueInRange(c), d = n ? u.replace(/\t/ig, r) : u.replace(s, "	");
    e.addEditOperation(c, d);
  }
}
class XDt {
  constructor(e, t) {
    this.selection = e, this.tabSize = t, this.selectionId = null;
  }
  getEditOperations(e, t) {
    this.selectionId = t.trackSelection(this.selection), C8e(e, t, this.tabSize, !0);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this.selectionId);
  }
}
class ZDt {
  constructor(e, t) {
    this.selection = e, this.tabSize = t, this.selectionId = null;
  }
  getEditOperations(e, t) {
    this.selectionId = t.trackSelection(this.selection), C8e(e, t, this.tabSize, !1);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this.selectionId);
  }
}
Si(
  Zz.ID,
  Zz,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Je(Xae);
Je(Zae);
Je(Qae);
Je(Jae);
Je(ele);
Je(tle);
Je(GDt);
Je(qDt);
Si(
  l5.ID,
  l5,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
nk.register(wz);
class QDt {
  constructor(e, t, n) {
    this._editRange = e, this._originalSelection = t, this._text = n;
  }
  getEditOperations(e, t) {
    t.addTrackedEditOperation(this._editRange, this._text);
  }
  computeCursorState(e, t) {
    const r = t.getInverseEditOperations()[0].range;
    return this._originalSelection.isEmpty() ? new bt(r.endLineNumber, Math.min(this._originalSelection.positionColumn, r.endColumn), r.endLineNumber, Math.min(this._originalSelection.positionColumn, r.endColumn)) : new bt(r.endLineNumber, r.endColumn - this._text.length, r.endLineNumber, r.endColumn);
  }
}
var JDt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, eIt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, qW, Y1;
let yA = (Y1 = class {
  static get(e) {
    return e.getContribution(qW.ID);
  }
  constructor(e, t) {
    this.editor = e, this.editorWorkerService = t, this.decorations = this.editor.createDecorationsCollection();
  }
  dispose() {
  }
  run(e, t) {
    var l;
    (l = this.currentRequest) == null || l.cancel();
    const n = this.editor.getSelection(), r = this.editor.getModel();
    if (!r || !n)
      return;
    let s = n;
    if (s.startLineNumber !== s.endLineNumber)
      return;
    const o = new V5e(
      this.editor,
      5
      /* CodeEditorStateFlag.Position */
    ), a = r.uri;
    return this.editorWorkerService.canNavigateValueSet(a) ? (this.currentRequest = Jo((c) => this.editorWorkerService.navigateValueSet(a, s, t)), this.currentRequest.then((c) => {
      var m;
      if (!c || !c.range || !c.value || !o.validate(this.editor))
        return;
      const u = z.lift(c.range);
      let d = c.range;
      const h = c.value.length - (s.endColumn - s.startColumn);
      d = {
        startLineNumber: d.startLineNumber,
        startColumn: d.startColumn,
        endLineNumber: d.endLineNumber,
        endColumn: d.startColumn + c.value.length
      }, h > 1 && (s = new bt(s.startLineNumber, s.startColumn, s.endLineNumber, s.endColumn + h - 1));
      const g = new QDt(u, s, c.value);
      this.editor.pushUndoStop(), this.editor.executeCommand(e, g), this.editor.pushUndoStop(), this.decorations.set([{
        range: d,
        options: qW.DECORATION
      }]), (m = this.decorationRemover) == null || m.cancel(), this.decorationRemover = db(350), this.decorationRemover.then(() => this.decorations.clear()).catch(fn);
    }).catch(fn)) : Promise.resolve(void 0);
  }
}, qW = Y1, Y1.ID = "editor.contrib.inPlaceReplaceController", Y1.DECORATION = dn.register({
  description: "in-place-replace",
  className: "valueSetReplacement"
}), Y1);
yA = qW = JDt([
  eIt(1, sd)
], yA);
class tIt extends vt {
  constructor() {
    super({
      id: "editor.action.inPlaceReplace.up",
      label: Ee(1230, "Replace with Previous Value"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 3159,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    const n = yA.get(t);
    return n ? n.run(this.id, !1) : Promise.resolve(void 0);
  }
}
class nIt extends vt {
  constructor() {
    super({
      id: "editor.action.inPlaceReplace.down",
      label: Ee(1231, "Replace with Next Value"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 3161,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    const n = yA.get(t);
    return n ? n.run(this.id, !0) : Promise.resolve(void 0);
  }
}
Si(
  yA.ID,
  yA,
  4
  /* EditorContributionInstantiation.Lazy */
);
Je(tIt);
Je(nIt);
class iIt {
  constructor(e) {
    this._selection = e, this._selectionId = null;
  }
  getEditOperations(e, t) {
    const n = rIt(e);
    n && t.addEditOperation(n.range, n.text), this._selectionId = t.trackSelection(this._selection);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._selectionId);
  }
}
function rIt(i) {
  const e = i.getLineCount(), t = i.getLineContent(e), n = zg(t) === -1;
  if (!(!e || n))
    return Xs.insert(new de(e, i.getLineMaxColumn(e)), i.getEOL());
}
const PG = class PG extends vt {
  constructor() {
    super({
      id: PG.ID,
      label: Ee(1232, "Insert Final New Line"),
      precondition: se.writable
    });
  }
  run(e, t, n) {
    const r = t.getSelection();
    if (r === null)
      return;
    const s = new iIt(r);
    t.pushUndoStop(), t.executeCommands(this.id, [s]), t.pushUndoStop();
  }
};
PG.ID = "editor.action.insertFinalNewLine";
let nle = PG;
Je(nle);
class sIt extends vt {
  constructor() {
    super({
      id: "expandLineSelection",
      label: Ee(1233, "Expand Line Selection"),
      precondition: void 0,
      kbOpts: {
        weight: 0,
        kbExpr: se.textInputFocus,
        primary: 2090
        /* KeyCode.KeyL */
      }
    });
  }
  run(e, t, n) {
    if (n = n || {}, !t.hasModel())
      return;
    const r = t._getViewModel();
    r.model.pushStackElement(), r.setCursorStates(n.source, 3, $a.expandLineSelection(r, r.getCursorStates())), r.revealAllCursors(n.source, !0);
  }
}
Je(sIt);
class oIt {
  constructor(e, t, n) {
    this._selection = e, this._cursors = t, this._selectionId = null, this._trimInRegexesAndStrings = n;
  }
  getEditOperations(e, t) {
    const n = aIt(e, this._cursors, this._trimInRegexesAndStrings);
    for (let r = 0, s = n.length; r < s; r++) {
      const o = n[r];
      t.addEditOperation(o.range, o.text);
    }
    this._selectionId = t.trackSelection(this._selection);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this._selectionId);
  }
}
function aIt(i, e, t) {
  e.sort((a, l) => a.lineNumber === l.lineNumber ? a.column - l.column : a.lineNumber - l.lineNumber);
  for (let a = e.length - 2; a >= 0; a--)
    e[a].lineNumber === e[a + 1].lineNumber && e.splice(a, 1);
  const n = [];
  let r = 0, s = 0;
  const o = e.length;
  for (let a = 1, l = i.getLineCount(); a <= l; a++) {
    const c = i.getLineContent(a), u = c.length + 1;
    let d = 0;
    if (s < o && e[s].lineNumber === a && (d = e[s].column, s++, d === u) || c.length === 0)
      continue;
    const h = zg(c);
    let g = 0;
    if (h === -1)
      g = 1;
    else if (h !== c.length - 1)
      g = h + 2;
    else
      continue;
    if (!t) {
      if (!i.tokenization.hasAccurateTokensForLine(a))
        continue;
      const m = i.tokenization.getLineTokens(a), _ = m.getStandardTokenType(m.findTokenIndexAtOffset(g));
      if (_ === 2 || _ === 3)
        continue;
    }
    g = Math.max(d, g), n[r++] = Xs.delete(new z(a, g, a, u));
  }
  return n;
}
class w8e {
  constructor(e, t, n) {
    this._selection = e, this._isCopyingDown = t, this._noop = n || !1, this._selectionDirection = 0, this._selectionId = null, this._startLineNumberDelta = 0, this._endLineNumberDelta = 0;
  }
  getEditOperations(e, t) {
    let n = this._selection;
    this._startLineNumberDelta = 0, this._endLineNumberDelta = 0, n.startLineNumber < n.endLineNumber && n.endColumn === 1 && (this._endLineNumberDelta = 1, n = n.setEndPosition(n.endLineNumber - 1, e.getLineMaxColumn(n.endLineNumber - 1)));
    const r = [];
    for (let o = n.startLineNumber; o <= n.endLineNumber; o++)
      r.push(e.getLineContent(o));
    const s = r.join(`
`);
    s === "" && this._isCopyingDown && (this._startLineNumberDelta++, this._endLineNumberDelta++), this._noop ? t.addEditOperation(new z(n.endLineNumber, e.getLineMaxColumn(n.endLineNumber), n.endLineNumber + 1, 1), n.endLineNumber === e.getLineCount() ? "" : `
`) : this._isCopyingDown ? t.addEditOperation(new z(n.startLineNumber, 1, n.startLineNumber, 1), s + `
`) : t.addEditOperation(new z(n.endLineNumber, e.getLineMaxColumn(n.endLineNumber), n.endLineNumber, e.getLineMaxColumn(n.endLineNumber)), `
` + s), this._selectionId = t.trackSelection(n), this._selectionDirection = this._selection.getDirection();
  }
  computeCursorState(e, t) {
    let n = t.getTrackedSelection(this._selectionId);
    if (this._startLineNumberDelta !== 0 || this._endLineNumberDelta !== 0) {
      let r = n.startLineNumber, s = n.startColumn, o = n.endLineNumber, a = n.endColumn;
      this._startLineNumberDelta !== 0 && (r = r + this._startLineNumberDelta, s = 1), this._endLineNumberDelta !== 0 && (o = o + this._endLineNumberDelta, a = 1), n = bt.createWithDirection(r, s, o, a, this._selectionDirection);
    }
    return n;
  }
}
var lIt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, cIt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let ile = class {
  constructor(e, t, n, r) {
    this._languageConfigurationService = r, this._selection = e, this._isMovingDown = t, this._autoIndent = n, this._selectionId = null, this._moveEndLineSelectionShrink = !1;
  }
  getEditOperations(e, t) {
    const n = () => e.getLanguageId(), r = (d, h) => e.getLanguageIdAtPosition(d, h), s = e.getLineCount();
    if (this._isMovingDown && this._selection.endLineNumber === s) {
      this._selectionId = t.trackSelection(this._selection);
      return;
    }
    if (!this._isMovingDown && this._selection.startLineNumber === 1) {
      this._selectionId = t.trackSelection(this._selection);
      return;
    }
    this._moveEndPositionDown = !1;
    let o = this._selection;
    o.startLineNumber < o.endLineNumber && o.endColumn === 1 && (this._moveEndPositionDown = !0, o = o.setEndPosition(o.endLineNumber - 1, e.getLineMaxColumn(o.endLineNumber - 1)));
    const { tabSize: a, indentSize: l, insertSpaces: c } = e.getOptions(), u = this.buildIndentConverter(a, l, c);
    if (o.startLineNumber === o.endLineNumber && e.getLineMaxColumn(o.startLineNumber) === 1) {
      const d = o.startLineNumber, h = this._isMovingDown ? d + 1 : d - 1;
      e.getLineMaxColumn(h) === 1 ? t.addEditOperation(new z(1, 1, 1, 1), null) : (t.addEditOperation(new z(d, 1, d, 1), e.getLineContent(h)), t.addEditOperation(new z(h, 1, h, e.getLineMaxColumn(h)), null)), o = new bt(h, 1, h, 1);
    } else {
      let d, h;
      if (this._isMovingDown) {
        d = o.endLineNumber + 1, h = e.getLineContent(d), t.addEditOperation(new z(d - 1, e.getLineMaxColumn(d - 1), d, e.getLineMaxColumn(d)), null);
        let g = h;
        if (this.shouldAutoIndent(e, o)) {
          const m = this.matchEnterRule(e, u, a, d, o.startLineNumber - 1);
          if (m !== null) {
            const v = Ir(e.getLineContent(d)), w = m + Ld(v, a);
            g = n3(w, a, c) + this.trimStart(h);
          } else {
            const v = {
              tokenization: {
                getLineTokens: (E) => E === o.startLineNumber ? e.tokenization.getLineTokens(d) : e.tokenization.getLineTokens(E),
                getLanguageId: n,
                getLanguageIdAtPosition: r
              },
              getLineContent: (E) => E === o.startLineNumber ? e.getLineContent(d) : e.getLineContent(E)
            }, w = SF(this._autoIndent, v, e.getLanguageIdAtPosition(d, 1), o.startLineNumber, u, this._languageConfigurationService);
            if (w !== null) {
              const E = Ir(e.getLineContent(d)), L = Ld(w, a), T = Ld(E, a);
              L !== T && (g = n3(L, a, c) + this.trimStart(h));
            }
          }
          t.addEditOperation(new z(o.startLineNumber, 1, o.startLineNumber, 1), g + `
`);
          const _ = this.matchEnterRuleMovingDown(e, u, a, o.startLineNumber, d, g);
          if (_ !== null)
            _ !== 0 && this.getIndentEditsOfMovingBlock(e, t, o, a, c, _);
          else {
            const v = {
              tokenization: {
                getLineTokens: (E) => E === o.startLineNumber ? e.tokenization.getLineTokens(d) : E >= o.startLineNumber + 1 && E <= o.endLineNumber + 1 ? e.tokenization.getLineTokens(E - 1) : e.tokenization.getLineTokens(E),
                getLanguageId: n,
                getLanguageIdAtPosition: r
              },
              getLineContent: (E) => E === o.startLineNumber ? g : E >= o.startLineNumber + 1 && E <= o.endLineNumber + 1 ? e.getLineContent(E - 1) : e.getLineContent(E)
            }, w = SF(this._autoIndent, v, e.getLanguageIdAtPosition(d, 1), o.startLineNumber + 1, u, this._languageConfigurationService);
            if (w !== null) {
              const E = Ir(e.getLineContent(o.startLineNumber)), L = Ld(w, a), T = Ld(E, a);
              if (L !== T) {
                const D = L - T;
                this.getIndentEditsOfMovingBlock(e, t, o, a, c, D);
              }
            }
          }
        } else
          t.addEditOperation(new z(o.startLineNumber, 1, o.startLineNumber, 1), g + `
`);
      } else if (d = o.startLineNumber - 1, h = e.getLineContent(d), t.addEditOperation(new z(d, 1, d + 1, 1), null), t.addEditOperation(new z(o.endLineNumber, e.getLineMaxColumn(o.endLineNumber), o.endLineNumber, e.getLineMaxColumn(o.endLineNumber)), `
` + h), this.shouldAutoIndent(e, o)) {
        const g = {
          tokenization: {
            getLineTokens: (_) => _ === d ? e.tokenization.getLineTokens(o.startLineNumber) : e.tokenization.getLineTokens(_),
            getLanguageId: n,
            getLanguageIdAtPosition: r
          },
          getLineContent: (_) => _ === d ? e.getLineContent(o.startLineNumber) : e.getLineContent(_)
        }, m = this.matchEnterRule(e, u, a, o.startLineNumber, o.startLineNumber - 2);
        if (m !== null)
          m !== 0 && this.getIndentEditsOfMovingBlock(e, t, o, a, c, m);
        else {
          const _ = SF(this._autoIndent, g, e.getLanguageIdAtPosition(o.startLineNumber, 1), d, u, this._languageConfigurationService);
          if (_ !== null) {
            const v = Ir(e.getLineContent(o.startLineNumber)), w = Ld(_, a), E = Ld(v, a);
            if (w !== E) {
              const L = w - E;
              this.getIndentEditsOfMovingBlock(e, t, o, a, c, L);
            }
          }
        }
      }
    }
    this._selectionId = t.trackSelection(o);
  }
  buildIndentConverter(e, t, n) {
    return {
      shiftIndent: (r) => Xf.shiftIndent(r, r.length + 1, e, t, n),
      unshiftIndent: (r) => Xf.unshiftIndent(r, r.length + 1, e, t, n)
    };
  }
  parseEnterResult(e, t, n, r, s) {
    if (s) {
      let o = s.indentation;
      s.indentAction === Vo.None || s.indentAction === Vo.Indent ? o = s.indentation + s.appendText : s.indentAction === Vo.IndentOutdent ? o = s.indentation : s.indentAction === Vo.Outdent && (o = t.unshiftIndent(s.indentation) + s.appendText);
      const a = e.getLineContent(r);
      if (this.trimStart(a).indexOf(this.trimStart(o)) >= 0) {
        const l = Ir(e.getLineContent(r));
        let c = Ir(o);
        const u = bFe(e, r, this._languageConfigurationService);
        u !== null && u & 2 && (c = t.unshiftIndent(c));
        const d = Ld(c, n), h = Ld(l, n);
        return d - h;
      }
    }
    return null;
  }
  /**
   *
   * @param model
   * @param indentConverter
   * @param tabSize
   * @param line the line moving down
   * @param futureAboveLineNumber the line which will be at the `line` position
   * @param futureAboveLineText
   */
  matchEnterRuleMovingDown(e, t, n, r, s, o) {
    if (zg(o) >= 0) {
      const a = e.getLineMaxColumn(s), l = qN(this._autoIndent, e, new z(s, a, s, a), this._languageConfigurationService);
      return this.parseEnterResult(e, t, n, r, l);
    } else {
      let a = r - 1;
      for (; a >= 1; ) {
        const u = e.getLineContent(a);
        if (zg(u) >= 0)
          break;
        a--;
      }
      if (a < 1 || r > e.getLineCount())
        return null;
      const l = e.getLineMaxColumn(a), c = qN(this._autoIndent, e, new z(a, l, a, l), this._languageConfigurationService);
      return this.parseEnterResult(e, t, n, r, c);
    }
  }
  matchEnterRule(e, t, n, r, s, o) {
    let a = s;
    for (; a >= 1; ) {
      let u;
      if (a === s && o !== void 0 ? u = o : u = e.getLineContent(a), zg(u) >= 0)
        break;
      a--;
    }
    if (a < 1 || r > e.getLineCount())
      return null;
    const l = e.getLineMaxColumn(a), c = qN(this._autoIndent, e, new z(a, l, a, l), this._languageConfigurationService);
    return this.parseEnterResult(e, t, n, r, c);
  }
  trimStart(e) {
    return e.replace(/^\s+/, "");
  }
  shouldAutoIndent(e, t) {
    if (this._autoIndent < 4 || !e.tokenization.isCheapToTokenize(t.startLineNumber))
      return !1;
    const n = e.getLanguageIdAtPosition(t.startLineNumber, 1), r = e.getLanguageIdAtPosition(t.endLineNumber, 1);
    return !(n !== r || this._languageConfigurationService.getLanguageConfiguration(n).indentRulesSupport === null);
  }
  getIndentEditsOfMovingBlock(e, t, n, r, s, o) {
    for (let a = n.startLineNumber; a <= n.endLineNumber; a++) {
      const l = e.getLineContent(a), c = Ir(l), d = Ld(c, r) + o, h = n3(d, r, s);
      h !== c && (t.addEditOperation(new z(a, 1, a, c.length + 1), h), a === n.endLineNumber && n.endColumn <= c.length + 1 && h === "" && (this._moveEndLineSelectionShrink = !0));
    }
  }
  computeCursorState(e, t) {
    let n = t.getTrackedSelection(this._selectionId);
    return this._moveEndPositionDown && (n = n.setEndPosition(n.endLineNumber + 1, 1)), this._moveEndLineSelectionShrink && n.startLineNumber < n.endLineNumber && (n = n.setEndPosition(n.endLineNumber, 2)), n;
  }
};
ile = lIt([
  cIt(3, Ls)
], ile);
const JCe = class JCe {
  constructor(e, t) {
    this.selection = e, this.descending = t, this.selectionId = null;
  }
  getEditOperations(e, t) {
    const n = uIt(e, this.selection, this.descending);
    n && t.addEditOperation(n.range, n.text), this.selectionId = t.trackSelection(this.selection);
  }
  computeCursorState(e, t) {
    return t.getTrackedSelection(this.selectionId);
  }
  static canRun(e, t, n) {
    if (e === null)
      return !1;
    const r = S8e(e, t, n);
    if (!r)
      return !1;
    for (let s = 0, o = r.before.length; s < o; s++)
      if (r.before[s] !== r.after[s])
        return !0;
    return !1;
  }
};
JCe._COLLATOR = qT.Collator();
let y5 = JCe;
function S8e(i, e, t) {
  const n = e.startLineNumber;
  let r = e.endLineNumber;
  if (e.endColumn === 1 && r--, n >= r)
    return null;
  const s = [];
  for (let a = n; a <= r; a++)
    s.push(i.getLineContent(a));
  let o = s.slice(0);
  return o.sort(y5._COLLATOR.value.compare), t === !0 && (o = o.reverse()), {
    startLineNumber: n,
    endLineNumber: r,
    before: s,
    after: o
  };
}
function uIt(i, e, t) {
  const n = S8e(i, e, t);
  return n ? Xs.replace(new z(n.startLineNumber, 1, n.endLineNumber, i.getLineMaxColumn(n.endLineNumber)), n.after.join(`
`)) : null;
}
class E8e extends vt {
  constructor(e, t) {
    super(t), this.down = e;
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getSelections().map((o, a) => ({ selection: o, index: a, ignore: !1 }));
    n.sort((o, a) => z.compareRangesUsingStarts(o.selection, a.selection));
    let r = n[0];
    for (let o = 1; o < n.length; o++) {
      const a = n[o];
      r.selection.endLineNumber === a.selection.startLineNumber && (r.index < a.index ? a.ignore = !0 : (r.ignore = !0, r = a));
    }
    const s = [];
    for (const o of n)
      s.push(new w8e(o.selection, this.down, o.ignore));
    t.pushUndoStop(), t.executeCommands(this.id, s), t.pushUndoStop();
  }
}
class dIt extends E8e {
  constructor() {
    super(!1, {
      id: "editor.action.copyLinesUpAction",
      label: Ee(1239, "Copy Line Up"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 1552,
        linux: {
          primary: 3600
          /* KeyCode.UpArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "2_line",
        title: S(1234, "&&Copy Line Up"),
        order: 1
      }
    });
  }
}
class hIt extends E8e {
  constructor() {
    super(!0, {
      id: "editor.action.copyLinesDownAction",
      label: Ee(1240, "Copy Line Down"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 1554,
        linux: {
          primary: 3602
          /* KeyCode.DownArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "2_line",
        title: S(1235, "Co&&py Line Down"),
        order: 2
      }
    });
  }
}
class fIt extends vt {
  constructor() {
    super({
      id: "editor.action.duplicateSelection",
      label: Ee(1241, "Duplicate Selection"),
      precondition: se.writable,
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "2_line",
        title: S(1236, "&&Duplicate Selection"),
        order: 5
      }
    });
  }
  run(e, t, n) {
    if (!t.hasModel())
      return;
    const r = [], s = t.getSelections(), o = t.getModel();
    for (const a of s)
      if (a.isEmpty())
        r.push(new w8e(a, !0));
      else {
        const l = new bt(a.endLineNumber, a.endColumn, a.endLineNumber, a.endColumn);
        r.push(new Xrt(l, o.getValueInRange(a)));
      }
    t.pushUndoStop(), t.executeCommands(this.id, r), t.pushUndoStop();
  }
}
class x8e extends vt {
  constructor(e, t) {
    super(t), this.down = e;
  }
  run(e, t) {
    const n = e.get(Ls), r = [], s = t.getSelections() || [], o = t.getOption(
      16
      /* EditorOption.autoIndent */
    );
    for (const a of s)
      r.push(new ile(a, this.down, o, n));
    t.pushUndoStop(), t.executeCommands(this.id, r), t.pushUndoStop();
  }
}
class gIt extends x8e {
  constructor() {
    super(!1, {
      id: "editor.action.moveLinesUpAction",
      label: Ee(1242, "Move Line Up"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 528,
        linux: {
          primary: 528
          /* KeyCode.UpArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "2_line",
        title: S(1237, "Mo&&ve Line Up"),
        order: 3
      }
    });
  }
}
class pIt extends x8e {
  constructor() {
    super(!0, {
      id: "editor.action.moveLinesDownAction",
      label: Ee(1243, "Move Line Down"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 530,
        linux: {
          primary: 530
          /* KeyCode.DownArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "2_line",
        title: S(1238, "Move &&Line Down"),
        order: 4
      }
    });
  }
}
class L8e extends vt {
  constructor(e, t) {
    super(t), this.descending = e;
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getModel();
    let r = t.getSelections();
    r.length === 1 && r[0].isEmpty() && (r = [new bt(1, 1, n.getLineCount(), n.getLineMaxColumn(n.getLineCount()))]);
    for (const o of r)
      if (!y5.canRun(t.getModel(), o, this.descending))
        return;
    const s = [];
    for (let o = 0, a = r.length; o < a; o++)
      s[o] = new y5(r[o], this.descending);
    t.pushUndoStop(), t.executeCommands(this.id, s), t.pushUndoStop();
  }
}
class mIt extends L8e {
  constructor() {
    super(!1, {
      id: "editor.action.sortLinesAscending",
      label: Ee(1244, "Sort Lines Ascending"),
      precondition: se.writable
    });
  }
}
class _It extends L8e {
  constructor() {
    super(!0, {
      id: "editor.action.sortLinesDescending",
      label: Ee(1245, "Sort Lines Descending"),
      precondition: se.writable
    });
  }
}
class bIt extends vt {
  constructor() {
    super({
      id: "editor.action.removeDuplicateLines",
      label: Ee(1246, "Delete Duplicate Lines"),
      precondition: se.writable
    });
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getModel();
    if (n.getLineCount() === 1 && n.getLineMaxColumn(1) === 1)
      return;
    const r = [], s = [];
    let o = 0, a = !0, l = t.getSelections();
    l.length === 1 && l[0].isEmpty() && (l = [new bt(1, 1, n.getLineCount(), n.getLineMaxColumn(n.getLineCount()))], a = !1);
    for (const c of l) {
      const u = /* @__PURE__ */ new Set(), d = [];
      for (let _ = c.startLineNumber; _ <= c.endLineNumber; _++) {
        const v = n.getLineContent(_);
        u.has(v) || (d.push(v), u.add(v));
      }
      const h = new bt(c.startLineNumber, 1, c.endLineNumber, n.getLineMaxColumn(c.endLineNumber)), g = c.startLineNumber - o, m = new bt(g, 1, g + d.length - 1, d[d.length - 1].length);
      r.push(Xs.replace(h, d.join(`
`))), s.push(m), o += c.endLineNumber - c.startLineNumber + 1 - d.length;
    }
    t.pushUndoStop(), t.executeEdits(this.id, r, a ? s : void 0), t.pushUndoStop();
  }
}
class vIt extends vt {
  constructor() {
    super({
      id: "editor.action.reverseLines",
      label: Ee(1247, "Reverse lines"),
      precondition: se.writable
    });
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getModel(), r = t.getSelections();
    let s = r;
    s.length === 1 && s[0].isEmpty() && (s = [new bt(1, 1, n.getLineCount(), n.getLineMaxColumn(n.getLineCount()))]);
    const o = [], a = [];
    for (let l = 0; l < s.length; l++) {
      const c = s[l], u = r[l];
      let d = c.endLineNumber;
      c.startLineNumber < c.endLineNumber && c.endColumn === 1 && d--;
      let h = new z(c.startLineNumber, 1, d, n.getLineMaxColumn(d));
      d === n.getLineCount() && n.getLineContent(h.endLineNumber) === "" && (h = h.setEndPosition(h.endLineNumber - 1, n.getLineMaxColumn(h.endLineNumber - 1)));
      const g = [];
      for (let w = h.endLineNumber; w >= h.startLineNumber; w--)
        g.push(n.getLineContent(w));
      const m = Xs.replace(h, g.join(`
`));
      o.push(m);
      const _ = function(w) {
        return w <= h.endLineNumber ? h.endLineNumber - w + h.startLineNumber : w;
      }, v = function(w) {
        if (w.isEmpty())
          return new bt(_(w.positionLineNumber), w.positionColumn, _(w.positionLineNumber), w.positionColumn);
        {
          const E = _(w.selectionStartLineNumber), L = _(w.positionLineNumber), T = w.selectionStartColumn, D = w.positionColumn;
          return new bt(E, T, L, D);
        }
      };
      a.push(v(u));
    }
    t.pushUndoStop(), t.executeEdits(this.id, o, a), t.pushUndoStop();
  }
}
const FG = class FG extends vt {
  constructor() {
    super({
      id: FG.ID,
      label: Ee(1248, "Trim Trailing Whitespace"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: Ro(
          2089,
          2102
          /* KeyCode.KeyX */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t, n) {
    let r = [];
    n.reason === "auto-save" && (r = (t.getSelections() || []).map((u) => new de(u.positionLineNumber, u.positionColumn)));
    const s = t.getSelection();
    if (s === null)
      return;
    const o = e.get(xn), a = t.getModel(), l = o.getValue("files.trimTrailingWhitespaceInRegexAndStrings", { overrideIdentifier: a == null ? void 0 : a.getLanguageId(), resource: a == null ? void 0 : a.uri }), c = new oIt(s, r, l);
    t.pushUndoStop(), t.executeCommands(this.id, [c]), t.pushUndoStop();
  }
};
FG.ID = "editor.action.trimTrailingWhitespace";
let rle = FG;
class yIt extends vt {
  constructor() {
    super({
      id: "editor.action.deleteLines",
      label: Ee(1249, "Delete Line"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 3113,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = this._getLinesToRemove(t), r = t.getModel();
    if (r.getLineCount() === 1 && r.getLineMaxColumn(1) === 1)
      return;
    let s = 0;
    const o = [], a = [];
    for (let l = 0, c = n.length; l < c; l++) {
      const u = n[l];
      let d = u.startLineNumber, h = u.endLineNumber, g = 1, m = r.getLineMaxColumn(h);
      h < r.getLineCount() ? (h += 1, m = 1) : d > 1 && (d -= 1, g = r.getLineMaxColumn(d)), o.push(Xs.replace(new bt(d, g, h, m), "")), a.push(new bt(d - s, u.positionColumn, d - s, u.positionColumn)), s += u.endLineNumber - u.startLineNumber + 1;
    }
    t.pushUndoStop(), t.executeEdits(this.id, o, a), t.pushUndoStop();
  }
  _getLinesToRemove(e) {
    const t = e.getSelections().map((s) => {
      let o = s.endLineNumber;
      return s.startLineNumber < s.endLineNumber && s.endColumn === 1 && (o -= 1), {
        startLineNumber: s.startLineNumber,
        selectionStartColumn: s.selectionStartColumn,
        endLineNumber: o,
        positionColumn: s.positionColumn
      };
    });
    t.sort((s, o) => s.startLineNumber === o.startLineNumber ? s.endLineNumber - o.endLineNumber : s.startLineNumber - o.startLineNumber);
    const n = [];
    let r = t[0];
    for (let s = 1; s < t.length; s++)
      r.endLineNumber + 1 >= t[s].startLineNumber ? r.endLineNumber = t[s].endLineNumber : (n.push(r), r = t[s]);
    return n.push(r), n;
  }
}
class CIt extends vt {
  constructor() {
    super({
      id: "editor.action.indentLines",
      label: Ee(1250, "Indent Line"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 2142,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    const n = t._getViewModel();
    n && (t.pushUndoStop(), t.executeCommands(this.id, YC.indent(n.cursorConfig, t.getModel(), t.getSelections())), t.pushUndoStop());
  }
}
class wIt extends vt {
  constructor() {
    super({
      id: "editor.action.outdentLines",
      label: Ee(1251, "Outdent Line"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 2140,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    KN.Outdent.runEditorCommand(e, t, null);
  }
}
class SIt extends vt {
  constructor() {
    super({
      id: "editor.action.insertLineBefore",
      label: Ee(1252, "Insert Line Above"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 3075,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    const n = t._getViewModel();
    n && (t.pushUndoStop(), t.executeCommands(this.id, Hq.lineInsertBefore(n.cursorConfig, t.getModel(), t.getSelections())));
  }
}
class EIt extends vt {
  constructor() {
    super({
      id: "editor.action.insertLineAfter",
      label: Ee(1253, "Insert Line Below"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 2051,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    const n = t._getViewModel();
    n && (t.pushUndoStop(), t.executeCommands(this.id, Hq.lineInsertAfter(n.cursorConfig, t.getModel(), t.getSelections())));
  }
}
class T8e extends vt {
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getSelection(), r = this._getRangesToDelete(t), s = [];
    for (let l = 0, c = r.length - 1; l < c; l++) {
      const u = r[l], d = r[l + 1];
      z.intersectRanges(u, d) === null ? s.push(u) : r[l + 1] = z.plusRange(u, d);
    }
    s.push(r[r.length - 1]);
    const o = this._getEndCursorState(n, s), a = s.map((l) => Xs.replace(l, ""));
    t.pushUndoStop(), t.executeEdits(this.id, a, o), t.pushUndoStop();
  }
}
class xIt extends T8e {
  constructor() {
    super({
      id: "deleteAllLeft",
      label: Ee(1254, "Delete All Left"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: {
          primary: 2049
          /* KeyCode.Backspace */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  _getEndCursorState(e, t) {
    let n = null;
    const r = [];
    let s = 0;
    return t.forEach((o) => {
      let a;
      if (o.endColumn === 1 && s > 0) {
        const l = o.startLineNumber - s;
        a = new bt(l, o.startColumn, l, o.startColumn);
      } else
        a = new bt(o.startLineNumber, o.startColumn, o.startLineNumber, o.startColumn);
      s += o.endLineNumber - o.startLineNumber, o.intersectRanges(e) ? n = a : r.push(a);
    }), n && r.unshift(n), r;
  }
  _getRangesToDelete(e) {
    const t = e.getSelections();
    if (t === null)
      return [];
    let n = t;
    const r = e.getModel();
    return r === null ? [] : (n.sort(z.compareRangesUsingStarts), n = n.map((s) => {
      if (s.isEmpty())
        if (s.startColumn === 1) {
          const o = Math.max(1, s.startLineNumber - 1), a = s.startLineNumber === 1 ? 1 : r.getLineLength(o) + 1;
          return new z(o, a, s.startLineNumber, 1);
        } else
          return new z(s.startLineNumber, 1, s.startLineNumber, s.startColumn);
      else
        return new z(s.startLineNumber, 1, s.endLineNumber, s.endColumn);
    }), n);
  }
}
class LIt extends T8e {
  constructor() {
    super({
      id: "deleteAllRight",
      label: Ee(1255, "Delete All Right"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: { primary: 297, secondary: [
          2068
          /* KeyCode.Delete */
        ] },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  _getEndCursorState(e, t) {
    let n = null;
    const r = [];
    for (let s = 0, o = t.length, a = 0; s < o; s++) {
      const l = t[s], c = new bt(l.startLineNumber - a, l.startColumn, l.startLineNumber - a, l.startColumn);
      l.intersectRanges(e) ? n = c : r.push(c);
    }
    return n && r.unshift(n), r;
  }
  _getRangesToDelete(e) {
    const t = e.getModel();
    if (t === null)
      return [];
    const n = e.getSelections();
    if (n === null)
      return [];
    const r = n.map((s) => {
      if (s.isEmpty()) {
        const o = t.getLineMaxColumn(s.startLineNumber);
        return s.startColumn === o ? new z(s.startLineNumber, s.startColumn, s.startLineNumber + 1, 1) : new z(s.startLineNumber, s.startColumn, s.startLineNumber, o);
      }
      return s;
    });
    return r.sort(z.compareRangesUsingStarts), r;
  }
}
class TIt extends vt {
  constructor() {
    super({
      id: "editor.action.joinLines",
      label: Ee(1256, "Join Lines"),
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 0,
        mac: {
          primary: 296
          /* KeyCode.KeyJ */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    const n = t.getSelections();
    if (n === null)
      return;
    let r = t.getSelection();
    if (r === null)
      return;
    n.sort(z.compareRangesUsingStarts);
    const s = [], o = n.reduce((h, g) => h.isEmpty() ? h.endLineNumber === g.startLineNumber ? (r.equalsSelection(h) && (r = g), g) : g.startLineNumber > h.endLineNumber + 1 ? (s.push(h), g) : new bt(h.startLineNumber, h.startColumn, g.endLineNumber, g.endColumn) : g.startLineNumber > h.endLineNumber ? (s.push(h), g) : new bt(h.startLineNumber, h.startColumn, g.endLineNumber, g.endColumn));
    s.push(o);
    const a = t.getModel();
    if (a === null)
      return;
    const l = [], c = [];
    let u = r, d = 0;
    for (let h = 0, g = s.length; h < g; h++) {
      const m = s[h], _ = m.startLineNumber, v = 1;
      let w = 0, E, L;
      const T = a.getLineLength(m.endLineNumber) - m.endColumn;
      if (m.isEmpty() || m.startLineNumber === m.endLineNumber) {
        const R = m.getStartPosition();
        R.lineNumber < a.getLineCount() ? (E = _ + 1, L = a.getLineMaxColumn(E)) : (E = R.lineNumber, L = a.getLineMaxColumn(R.lineNumber));
      } else
        E = m.endLineNumber, L = a.getLineMaxColumn(E);
      let D = a.getLineContent(_);
      for (let R = _ + 1; R <= E; R++) {
        const M = a.getLineContent(R), B = a.getLineFirstNonWhitespaceColumn(R);
        if (B >= 1) {
          let H = !0;
          D === "" && (H = !1), H && (D.charAt(D.length - 1) === " " || D.charAt(D.length - 1) === "	") && (H = !1, D = D.replace(/[\s\uFEFF\xA0]+$/g, " "));
          const j = M.substr(B - 1);
          D += (H ? " " : "") + j, H ? w = j.length + 1 : w = j.length;
        } else
          w = 0;
      }
      const N = new z(_, v, E, L);
      if (!N.isEmpty()) {
        let R;
        m.isEmpty() ? (l.push(Xs.replace(N, D)), R = new bt(N.startLineNumber - d, D.length - w + 1, _ - d, D.length - w + 1)) : m.startLineNumber === m.endLineNumber ? (l.push(Xs.replace(N, D)), R = new bt(m.startLineNumber - d, m.startColumn, m.endLineNumber - d, m.endColumn)) : (l.push(Xs.replace(N, D)), R = new bt(m.startLineNumber - d, m.startColumn, m.startLineNumber - d, D.length - T)), z.intersectRanges(N, r) !== null ? u = R : c.push(R);
      }
      d += N.endLineNumber - N.startLineNumber;
    }
    c.unshift(u), t.pushUndoStop(), t.executeEdits(this.id, l, c), t.pushUndoStop();
  }
}
class kIt extends vt {
  constructor() {
    super({
      id: "editor.action.transpose",
      label: Ee(1257, "Transpose Characters around the Cursor"),
      precondition: se.writable
    });
  }
  run(e, t) {
    const n = t.getSelections();
    if (n === null)
      return;
    const r = t.getModel();
    if (r === null)
      return;
    const s = [];
    for (let o = 0, a = n.length; o < a; o++) {
      const l = n[o];
      if (!l.isEmpty())
        continue;
      const c = l.getStartPosition(), u = r.getLineMaxColumn(c.lineNumber);
      if (c.column >= u) {
        if (c.lineNumber === r.getLineCount())
          continue;
        const d = new z(c.lineNumber, Math.max(1, c.column - 1), c.lineNumber + 1, 1), h = r.getValueInRange(d).split("").reverse().join("");
        s.push(new bl(new bt(c.lineNumber, Math.max(1, c.column - 1), c.lineNumber + 1, 1), h));
      } else {
        const d = new z(c.lineNumber, Math.max(1, c.column - 1), c.lineNumber, c.column + 1), h = r.getValueInRange(d).split("").reverse().join("");
        s.push(new rfe(d, h, new bt(c.lineNumber, c.column + 1, c.lineNumber, c.column + 1)));
      }
    }
    t.pushUndoStop(), t.executeCommands(this.id, s), t.pushUndoStop();
  }
}
class ok extends vt {
  run(e, t) {
    const n = t.getSelections();
    if (n === null)
      return;
    const r = t.getModel();
    if (r === null)
      return;
    const s = t.getOption(
      148
      /* EditorOption.wordSeparators */
    ), o = [];
    for (const a of n)
      if (a.isEmpty()) {
        const l = a.getStartPosition(), c = t.getConfiguredWordAtPosition(l);
        if (!c)
          continue;
        const u = new z(l.lineNumber, c.startColumn, l.lineNumber, c.endColumn), d = r.getValueInRange(u);
        o.push(Xs.replace(u, this._modifyText(d, s)));
      } else {
        const l = r.getValueInRange(a);
        o.push(Xs.replace(a, this._modifyText(l, s)));
      }
    t.pushUndoStop(), t.executeEdits(this.id, o), t.pushUndoStop();
  }
}
class DIt extends ok {
  constructor() {
    super({
      id: "editor.action.transformToUppercase",
      label: Ee(1258, "Transform to Uppercase"),
      precondition: se.writable
    });
  }
  _modifyText(e, t) {
    return e.toLocaleUpperCase();
  }
}
class IIt extends ok {
  constructor() {
    super({
      id: "editor.action.transformToLowercase",
      label: Ee(1259, "Transform to Lowercase"),
      precondition: se.writable
    });
  }
  _modifyText(e, t) {
    return e.toLocaleLowerCase();
  }
}
class lm {
  constructor(e, t) {
    this._pattern = e, this._flags = t, this._actual = null, this._evaluated = !1;
  }
  get() {
    if (!this._evaluated) {
      this._evaluated = !0;
      try {
        this._actual = new RegExp(this._pattern, this._flags);
      } catch {
      }
    }
    return this._actual;
  }
  isSupported() {
    return this.get() !== null;
  }
}
const BG = class BG extends ok {
  constructor() {
    super({
      id: "editor.action.transformToTitlecase",
      label: Ee(1260, "Transform to Title Case"),
      precondition: se.writable
    });
  }
  _modifyText(e, t) {
    const n = BG.titleBoundary.get();
    return n ? e.toLocaleLowerCase().replace(n, (r) => r.toLocaleUpperCase()) : e;
  }
};
BG.titleBoundary = new lm("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}", "gmu");
let Qz = BG;
const WN = class WN extends ok {
  constructor() {
    super({
      id: "editor.action.transformToSnakecase",
      label: Ee(1261, "Transform to Snake Case"),
      precondition: se.writable
    });
  }
  _modifyText(e, t) {
    const n = WN.caseBoundary.get(), r = WN.singleLetters.get();
    return !n || !r ? e : e.replace(n, "$1_$2").replace(r, "$1_$2$3").toLocaleLowerCase();
  }
};
WN.caseBoundary = new lm("(\\p{Ll})(\\p{Lu})", "gmu"), WN.singleLetters = new lm("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})", "gmu");
let i3 = WN;
const GC = class GC extends ok {
  constructor() {
    super({
      id: "editor.action.transformToCamelcase",
      label: Ee(1262, "Transform to Camel Case"),
      precondition: se.writable
    });
  }
  _modifyText(e, t) {
    var a;
    const n = /\r\n|\r|\n/.test(e) ? GC.multiLineWordBoundary.get() : GC.singleLineWordBoundary.get(), r = GC.validWordStart.get();
    if (!n || !r)
      return e;
    const s = e.split(n);
    return ((a = s.shift()) == null ? void 0 : a.replace(r, (l) => l.toLocaleLowerCase())) + s.map((l) => l.substring(0, 1).toLocaleUpperCase() + l.substring(1)).join("");
  }
};
GC.singleLineWordBoundary = new lm("[_\\s-]+", "gm"), GC.multiLineWordBoundary = new lm("[_-]+", "gm"), GC.validWordStart = new lm("^(\\p{Lu}[^\\p{Lu}])", "gmu");
let r3 = GC;
const VN = class VN extends ok {
  constructor() {
    super({
      id: "editor.action.transformToPascalcase",
      label: Ee(1263, "Transform to Pascal Case"),
      precondition: se.writable
    });
  }
  _modifyText(e, t) {
    const n = VN.wordBoundary.get(), r = VN.wordBoundaryToMaintain.get();
    return !n || !r ? e : e.split(r).map((a) => a.split(n)).flat().map((a) => a.substring(0, 1).toLocaleUpperCase() + a.substring(1)).join("");
  }
};
VN.wordBoundary = new lm("[_ \\t-]", "gm"), VN.wordBoundaryToMaintain = new lm("(?<=\\.)", "gm");
let Jz = VN;
const qC = class qC extends ok {
  static isSupported() {
    return [
      this.caseBoundary,
      this.singleLetters,
      this.underscoreBoundary
    ].every((t) => t.isSupported());
  }
  constructor() {
    super({
      id: "editor.action.transformToKebabcase",
      label: Ee(1264, "Transform to Kebab Case"),
      precondition: se.writable
    });
  }
  _modifyText(e, t) {
    const n = qC.caseBoundary.get(), r = qC.singleLetters.get(), s = qC.underscoreBoundary.get();
    return !n || !r || !s ? e : e.replace(s, "$1-$3").replace(n, "$1-$2").replace(r, "$1-$2").toLocaleLowerCase();
  }
};
qC.caseBoundary = new lm("(\\p{Ll})(\\p{Lu})", "gmu"), qC.singleLetters = new lm("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})", "gmu"), qC.underscoreBoundary = new lm("(\\S)(_)(\\S)", "gm");
let e$ = qC;
Je(dIt);
Je(hIt);
Je(fIt);
Je(gIt);
Je(pIt);
Je(mIt);
Je(_It);
Je(bIt);
Je(rle);
Je(yIt);
Je(CIt);
Je(wIt);
Je(SIt);
Je(EIt);
Je(xIt);
Je(LIt);
Je(TIt);
Je(kIt);
Je(DIt);
Je(IIt);
Je(vIt);
i3.caseBoundary.isSupported() && i3.singleLetters.isSupported() && Je(i3);
r3.singleLineWordBoundary.isSupported() && r3.multiLineWordBoundary.isSupported() && Je(r3);
Jz.wordBoundary.isSupported() && Je(Jz);
Qz.titleBoundary.isSupported() && Je(Qz);
e$.isSupported() && Je(e$);
var NIt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, AH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, KW;
const k8e = new ut("LinkedEditingInputVisible", !1), RIt = "linked-editing-decoration";
var X1;
let CA = (X1 = class extends ge {
  static get(e) {
    return e.getContribution(KW.ID);
  }
  constructor(e, t, n, r, s) {
    super(), this.languageConfigurationService = r, this._syncRangesToken = 0, this._localToDispose = this._register(new ke()), this._editor = e, this._providers = n.linkedEditingRangeProvider, this._enabled = !1, this._visibleContextKey = k8e.bindTo(t), this._debounceInformation = s.for(this._providers, "Linked Editing", { max: 200 }), this._currentDecorations = this._editor.createDecorationsCollection(), this._languageWordPattern = null, this._currentWordPattern = null, this._ignoreChangeEvent = !1, this._localToDispose = this._register(new ke()), this._rangeUpdateTriggerPromise = null, this._rangeSyncTriggerPromise = null, this._currentRequestCts = null, this._currentRequestPosition = null, this._currentRequestModelVersion = null, this._register(this._editor.onDidChangeModel(() => this.reinitialize(!0))), this._register(this._editor.onDidChangeConfiguration((o) => {
      (o.hasChanged(
        78
        /* EditorOption.linkedEditing */
      ) || o.hasChanged(
        106
        /* EditorOption.renameOnType */
      )) && this.reinitialize(!1);
    })), this._register(this._providers.onDidChange(() => this.reinitialize(!1))), this._register(this._editor.onDidChangeModelLanguage(() => this.reinitialize(!0))), this.reinitialize(!0);
  }
  reinitialize(e) {
    const t = this._editor.getModel(), n = t !== null && (this._editor.getOption(
      78
      /* EditorOption.linkedEditing */
    ) || this._editor.getOption(
      106
      /* EditorOption.renameOnType */
    )) && this._providers.has(t);
    if (n === this._enabled && !e || (this._enabled = n, this.clearRanges(), this._localToDispose.clear(), !n || t === null))
      return;
    this._localToDispose.add(Ze.runAndSubscribe(t.onDidChangeLanguageConfiguration, () => {
      this._languageWordPattern = this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition();
    }));
    const r = new Gf(this._debounceInformation.get(t)), s = () => {
      this._rangeUpdateTriggerPromise = r.trigger(() => this.updateRanges(), this._debounceDuration ?? this._debounceInformation.get(t));
    }, o = new Gf(0), a = (l) => {
      this._rangeSyncTriggerPromise = o.trigger(() => this._syncRanges(l));
    };
    this._localToDispose.add(this._editor.onDidChangeCursorPosition(() => {
      s();
    })), this._localToDispose.add(this._editor.onDidChangeModelContent((l) => {
      if (!this._ignoreChangeEvent && this._currentDecorations.length > 0) {
        const c = this._currentDecorations.getRange(0);
        if (c && l.changes.every((u) => c.intersectRanges(u.range))) {
          a(this._syncRangesToken);
          return;
        }
      }
      s();
    })), this._localToDispose.add({
      dispose: () => {
        r.dispose(), o.dispose();
      }
    }), this.updateRanges();
  }
  _syncRanges(e) {
    if (!this._editor.hasModel() || e !== this._syncRangesToken || this._currentDecorations.length === 0)
      return;
    const t = this._editor.getModel(), n = this._currentDecorations.getRange(0);
    if (!n || n.startLineNumber !== n.endLineNumber)
      return this.clearRanges();
    const r = t.getValueInRange(n);
    if (this._currentWordPattern) {
      const o = r.match(this._currentWordPattern);
      if ((o ? o[0].length : 0) !== r.length)
        return this.clearRanges();
    }
    const s = [];
    for (let o = 1, a = this._currentDecorations.length; o < a; o++) {
      const l = this._currentDecorations.getRange(o);
      if (l)
        if (l.startLineNumber !== l.endLineNumber)
          s.push({
            range: l,
            text: r
          });
        else {
          let c = t.getValueInRange(l), u = r, d = l.startColumn, h = l.endColumn;
          const g = jg(c, u);
          d += g, c = c.substr(g), u = u.substr(g);
          const m = Gy(c, u);
          h -= m, c = c.substr(0, c.length - m), u = u.substr(0, u.length - m), (d !== h || u.length !== 0) && s.push({
            range: new z(l.startLineNumber, d, l.endLineNumber, h),
            text: u
          });
        }
    }
    if (s.length !== 0)
      try {
        this._editor.popUndoStop(), this._ignoreChangeEvent = !0;
        const o = this._editor._getViewModel().getPrevEditOperationType();
        this._editor.executeEdits("linkedEditing", s), this._editor._getViewModel().setPrevEditOperationType(o);
      } finally {
        this._ignoreChangeEvent = !1;
      }
  }
  dispose() {
    this.clearRanges(), super.dispose();
  }
  clearRanges() {
    this._visibleContextKey.set(!1), this._currentDecorations.clear(), this._currentRequestCts && (this._currentRequestCts.cancel(), this._currentRequestCts = null, this._currentRequestPosition = null);
  }
  async updateRanges(e = !1) {
    var o;
    if (!this._editor.hasModel()) {
      this.clearRanges();
      return;
    }
    const t = this._editor.getPosition();
    if (!this._enabled && !e || this._editor.getSelections().length > 1) {
      this.clearRanges();
      return;
    }
    const n = this._editor.getModel(), r = n.getVersionId();
    if (this._currentRequestPosition && this._currentRequestModelVersion === r) {
      if (t.equals(this._currentRequestPosition))
        return;
      if (this._currentDecorations.length > 0) {
        const a = this._currentDecorations.getRange(0);
        if (a && a.containsPosition(t))
          return;
      }
    }
    if (!((o = this._currentRequestPosition) != null && o.equals(t))) {
      const a = this._currentDecorations.getRange(0);
      a != null && a.containsPosition(t) || this.clearRanges();
    }
    this._currentRequestPosition = t, this._currentRequestModelVersion = r;
    const s = this._currentRequestCts = new Ss();
    try {
      const a = new _a(!1), l = await D8e(this._providers, n, t, s.token);
      if (this._debounceInformation.update(n, a.elapsed()), s !== this._currentRequestCts || (this._currentRequestCts = null, r !== n.getVersionId()))
        return;
      let c = [];
      l != null && l.ranges && (c = l.ranges), this._currentWordPattern = (l == null ? void 0 : l.wordPattern) || this._languageWordPattern;
      let u = !1;
      for (let h = 0, g = c.length; h < g; h++)
        if (z.containsPosition(c[h], t)) {
          if (u = !0, h !== 0) {
            const m = c[h];
            c.splice(h, 1), c.unshift(m);
          }
          break;
        }
      if (!u) {
        this.clearRanges();
        return;
      }
      const d = c.map((h) => ({ range: h, options: KW.DECORATION }));
      this._visibleContextKey.set(!0), this._currentDecorations.set(d), this._syncRangesToken++;
    } catch (a) {
      Xh(a) || fn(a), (this._currentRequestCts === s || !this._currentRequestCts) && this.clearRanges();
    }
  }
}, KW = X1, X1.ID = "editor.contrib.linkedEditing", X1.DECORATION = dn.register({
  description: "linked-editing",
  stickiness: 0,
  className: RIt
}), X1);
CA = KW = NIt([
  AH(1, Jt),
  AH(2, St),
  AH(3, Ls),
  AH(4, ig)
], CA);
class AIt extends vt {
  constructor() {
    super({
      id: "editor.action.linkedEditing",
      label: Ee(1266, "Start Linked Editing"),
      precondition: Re.and(se.writable, se.hasRenameProvider),
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 3132,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  runCommand(e, t) {
    const n = e.get(Ti), [r, s] = Array.isArray(t) && t || [void 0, void 0];
    return Ht.isUri(r) && de.isIPosition(s) ? n.openCodeEditor({ resource: r }, n.getActiveCodeEditor()).then((o) => {
      o && (o.setPosition(s), o.invokeWithinContext((a) => (this.reportTelemetry(a, o), this.run(a, o))));
    }, fn) : super.runCommand(e, t);
  }
  run(e, t) {
    const n = CA.get(t);
    return n ? Promise.resolve(n.updateRanges(!0)) : Promise.resolve();
  }
}
const OIt = jo.bindToContribution(CA.get);
ct(new OIt({
  id: "cancelLinkedEditingInput",
  precondition: k8e,
  handler: (i) => i.clearRanges(),
  kbOpts: {
    kbExpr: se.editorTextFocus,
    weight: 199,
    primary: 9,
    secondary: [
      1033
      /* KeyCode.Escape */
    ]
  }
}));
function D8e(i, e, t, n) {
  const r = i.ordered(e);
  return Rhe(r.map((s) => async () => {
    try {
      return await s.provideLinkedEditingRanges(e, t, n);
    } catch (o) {
      No(o);
      return;
    }
  }), (s) => !!s && kc(s == null ? void 0 : s.ranges));
}
ie("editor.linkedEditingBackground", { dark: De.fromHex("#f00").transparent(0.3), light: De.fromHex("#f00").transparent(0.3), hcDark: De.fromHex("#f00").transparent(0.3), hcLight: De.white }, S(1265, "Background color when the editor auto renames on type."));
id("_executeLinkedEditingProvider", (i, e, t) => {
  const { linkedEditingRangeProvider: n } = i.get(St);
  return D8e(n, e, t, $n.None);
});
Si(
  CA.ID,
  CA,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
Je(AIt);
let MIt = class {
  constructor(e, t) {
    this._link = e, this._provider = t;
  }
  toJSON() {
    return {
      range: this.range,
      url: this.url,
      tooltip: this.tooltip
    };
  }
  get range() {
    return this._link.range;
  }
  get url() {
    return this._link.url;
  }
  get tooltip() {
    return this._link.tooltip;
  }
  async resolve(e) {
    return this._link.url ? this._link.url : typeof this._provider.resolveLink == "function" ? Promise.resolve(this._provider.resolveLink(this._link, e)).then((t) => (this._link = t || this._link, this._link.url ? this.resolve(e) : Promise.reject(new Error("missing")))) : Promise.reject(new Error("missing"));
  }
};
const H3 = class H3 {
  constructor(e) {
    this._disposables = new ke();
    let t = [];
    for (const [n, r] of e) {
      const s = n.links.map((o) => new MIt(o, r));
      t = H3._union(t, s), UT(n) && (this._disposables ?? (this._disposables = new ke()), this._disposables.add(n));
    }
    this.links = t;
  }
  dispose() {
    var e;
    (e = this._disposables) == null || e.dispose(), this.links.length = 0;
  }
  static _union(e, t) {
    const n = [];
    let r, s, o, a;
    for (r = 0, o = 0, s = e.length, a = t.length; r < s && o < a; ) {
      const l = e[r], c = t[o];
      if (z.areIntersectingOrTouching(l.range, c.range)) {
        r++;
        continue;
      }
      z.compareRangesUsingStarts(l.range, c.range) < 0 ? (n.push(l), r++) : (n.push(c), o++);
    }
    for (; r < s; r++)
      n.push(e[r]);
    for (; o < a; o++)
      n.push(t[o]);
    return n;
  }
};
H3.Empty = new H3([]);
let t$ = H3;
async function I8e(i, e, t) {
  const n = [], r = i.ordered(e).reverse().map(async (o, a) => {
    try {
      const l = await o.provideLinks(e, t);
      l && (n[a] = [l, o]);
    } catch (l) {
      No(l);
    }
  });
  await Promise.all(r);
  let s = new t$(ym(n));
  return t.isCancellationRequested && (s.dispose(), s = t$.Empty), s;
}
_i.registerCommand("_executeLinkProvider", async (i, ...e) => {
  let [t, n] = e;
  Ii(t instanceof Ht), typeof n != "number" && (n = 0);
  const { linkProvider: r } = i.get(St), s = i.get(xs).getModel(t);
  if (!s)
    return [];
  const o = await I8e(r, s, $n.None);
  if (!o)
    return [];
  for (let l = 0; l < Math.min(n, o.links.length); l++)
    await o.links[l].resolve($n.None);
  const a = o.links.slice(0);
  return o.dispose(), a;
});
var PIt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, OH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, sle, OL;
let C5 = (OL = class extends ge {
  static get(e) {
    return e.getContribution(sle.ID);
  }
  constructor(e, t, n, r, s) {
    super(), this.editor = e, this.openerService = t, this.notificationService = n, this.languageFeaturesService = r, this.providers = this.languageFeaturesService.linkProvider, this.debounceInformation = s.for(this.providers, "Links", { min: 1e3, max: 4e3 }), this.computeLinks = this._register(new mr(() => this.computeLinksNow(), 1e3)), this.computePromise = null, this.activeLinksList = null, this.currentOccurrences = {}, this.activeLinkDecorationId = null;
    const o = this._register(new SK(e));
    this._register(o.onMouseMoveOrRelevantKeyDown(([a, l]) => {
      this._onEditorMouseMove(a, l);
    })), this._register(o.onExecute((a) => {
      this.onEditorMouseUp(a);
    })), this._register(o.onCancel((a) => {
      this.cleanUpActiveLinkDecoration();
    })), this._register(e.onDidChangeConfiguration((a) => {
      a.hasChanged(
        79
        /* EditorOption.links */
      ) && (this.updateDecorations([]), this.stop(), this.computeLinks.schedule(0));
    })), this._register(e.onDidChangeModelContent((a) => {
      this.editor.hasModel() && this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()));
    })), this._register(e.onDidChangeModel((a) => {
      this.currentOccurrences = {}, this.activeLinkDecorationId = null, this.stop(), this.computeLinks.schedule(0);
    })), this._register(e.onDidChangeModelLanguage((a) => {
      this.stop(), this.computeLinks.schedule(0);
    })), this._register(this.providers.onDidChange((a) => {
      this.stop(), this.computeLinks.schedule(0);
    })), this.computeLinks.schedule(0);
  }
  async computeLinksNow() {
    if (!this.editor.hasModel() || !this.editor.getOption(
      79
      /* EditorOption.links */
    ))
      return;
    const e = this.editor.getModel();
    if (!e.isTooLargeForSyncing() && this.providers.has(e)) {
      this.activeLinksList && (this.activeLinksList.dispose(), this.activeLinksList = null), this.computePromise = Jo((t) => I8e(this.providers, e, t));
      try {
        const t = new _a(!1);
        if (this.activeLinksList = await this.computePromise, this.debounceInformation.update(e, t.elapsed()), e.isDisposed())
          return;
        this.updateDecorations(this.activeLinksList.links);
      } catch (t) {
        fn(t);
      } finally {
        this.computePromise = null;
      }
    }
  }
  updateDecorations(e) {
    const t = this.editor.getOption(
      86
      /* EditorOption.multiCursorModifier */
    ) === "altKey", n = [], r = Object.keys(this.currentOccurrences);
    for (const o of r) {
      const a = this.currentOccurrences[o];
      n.push(a.decorationId);
    }
    const s = [];
    if (e)
      for (const o of e)
        s.push(uR.decoration(o, t));
    this.editor.changeDecorations((o) => {
      const a = o.deltaDecorations(n, s);
      this.currentOccurrences = {}, this.activeLinkDecorationId = null;
      for (let l = 0, c = a.length; l < c; l++) {
        const u = new uR(e[l], a[l]);
        this.currentOccurrences[u.decorationId] = u;
      }
    });
  }
  _onEditorMouseMove(e, t) {
    const n = this.editor.getOption(
      86
      /* EditorOption.multiCursorModifier */
    ) === "altKey";
    if (this.isEnabled(e, t)) {
      this.cleanUpActiveLinkDecoration();
      const r = this.getLinkOccurrence(e.target.position);
      r && this.editor.changeDecorations((s) => {
        r.activate(s, n), this.activeLinkDecorationId = r.decorationId;
      });
    } else
      this.cleanUpActiveLinkDecoration();
  }
  cleanUpActiveLinkDecoration() {
    const e = this.editor.getOption(
      86
      /* EditorOption.multiCursorModifier */
    ) === "altKey";
    if (this.activeLinkDecorationId) {
      const t = this.currentOccurrences[this.activeLinkDecorationId];
      t && this.editor.changeDecorations((n) => {
        t.deactivate(n, e);
      }), this.activeLinkDecorationId = null;
    }
  }
  onEditorMouseUp(e) {
    if (!this.isEnabled(e))
      return;
    const t = this.getLinkOccurrence(e.target.position);
    t && this.openLinkOccurrence(
      t,
      e.hasSideBySideModifier,
      !0
      /* from user gesture */
    );
  }
  openLinkOccurrence(e, t, n = !1) {
    if (!this.openerService)
      return;
    const { link: r } = e;
    r.resolve($n.None).then((s) => {
      if (typeof s == "string" && this.editor.hasModel()) {
        const o = this.editor.getModel().uri;
        if (o.scheme === Yt.file && s.startsWith(`${Yt.file}:`)) {
          const a = Ht.parse(s);
          if (a.scheme === Yt.file) {
            const l = v_(a);
            let c = null;
            l.startsWith("/./") || l.startsWith("\\.\\") ? c = `.${l.substr(1)}` : (l.startsWith("//./") || l.startsWith("\\\\.\\")) && (c = `.${l.substr(2)}`), c && (s = $Pe(o, c));
          }
        }
      }
      return this.openerService.open(s, { openToSide: t, fromUserGesture: n, allowContributedOpeners: !0, allowCommands: !0, fromWorkspace: !0 });
    }, (s) => {
      const o = s instanceof Error ? s.message : s;
      o === "invalid" ? this.notificationService.warn(S(1267, "Failed to open this link because it is not well-formed: {0}", r.url.toString())) : o === "missing" ? this.notificationService.warn(S(1268, "Failed to open this link because its target is missing.")) : fn(s);
    });
  }
  getLinkOccurrence(e) {
    if (!this.editor.hasModel() || !e)
      return null;
    const t = this.editor.getModel().getDecorationsInRange({
      startLineNumber: e.lineNumber,
      startColumn: e.column,
      endLineNumber: e.lineNumber,
      endColumn: e.column
    }, 0, !0);
    for (const n of t) {
      const r = this.currentOccurrences[n.id];
      if (r)
        return r;
    }
    return null;
  }
  isEnabled(e, t) {
    return !!(e.target.type === 6 && (e.hasTriggerModifier || t && t.keyCodeIsTriggerKey || e.isMiddleClick && e.mouseMiddleClickAction === "openLink"));
  }
  stop() {
    var e;
    this.computeLinks.cancel(), this.activeLinksList && ((e = this.activeLinksList) == null || e.dispose(), this.activeLinksList = null), this.computePromise && (this.computePromise.cancel(), this.computePromise = null);
  }
  dispose() {
    super.dispose(), this.stop();
  }
}, sle = OL, OL.ID = "editor.linkDetector", OL);
C5 = sle = PIt([
  OH(1, ad),
  OH(2, no),
  OH(3, St),
  OH(4, ig)
], C5);
const uNe = {
  general: dn.register({
    description: "detected-link",
    stickiness: 1,
    collapseOnReplaceEdit: !0,
    inlineClassName: "detected-link"
  }),
  active: dn.register({
    description: "detected-link-active",
    stickiness: 1,
    collapseOnReplaceEdit: !0,
    inlineClassName: "detected-link-active"
  })
};
class uR {
  static decoration(e, t) {
    return {
      range: e.range,
      options: uR._getOptions(e, t, !1)
    };
  }
  static _getOptions(e, t, n) {
    const r = { ...n ? uNe.active : uNe.general };
    return r.hoverMessage = FIt(e, t), r;
  }
  constructor(e, t) {
    this.link = e, this.decorationId = t;
  }
  activate(e, t) {
    e.changeDecorationOptions(this.decorationId, uR._getOptions(this.link, t, !0));
  }
  deactivate(e, t) {
    e.changeDecorationOptions(this.decorationId, uR._getOptions(this.link, t, !1));
  }
}
function FIt(i, e) {
  const t = i.url && /^command:/i.test(i.url.toString()), n = i.tooltip ? i.tooltip : t ? S(1269, "Execute command") : S(1270, "Follow link"), r = e ? Kn ? S(1271, "cmd + click") : S(1272, "ctrl + click") : Kn ? S(1273, "option + click") : S(1274, "alt + click");
  if (i.url) {
    let s = "";
    if (/^command:/i.test(i.url.toString())) {
      const a = i.url.toString().match(/^command:([^?#]+)/);
      if (a) {
        const l = a[1];
        s = S(1275, "Execute command {0}", l);
      }
    }
    return new ql("", !0).appendLink(i.url.toString(!0).replace(/ /g, "%20"), n, s).appendMarkdown(` (${r})`);
  } else
    return new ql().appendText(`${n} (${r})`);
}
class BIt extends vt {
  constructor() {
    super({
      id: "editor.action.openLink",
      label: Ee(1276, "Open Link"),
      precondition: void 0
    });
  }
  run(e, t) {
    const n = C5.get(t);
    if (!n || !t.hasModel())
      return;
    const r = t.getSelections();
    for (const s of r) {
      const o = n.getLinkOccurrence(s.getEndPosition());
      o && n.openLinkOccurrence(o, !1);
    }
  }
}
Si(
  C5.ID,
  C5,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
Je(BIt);
const e1e = class e1e extends ge {
  constructor(e) {
    super(), this._editor = e, this._register(this._editor.onMouseDown((t) => {
      const n = this._editor.getOption(
        133
        /* EditorOption.stopRenderingLineAfter */
      );
      n >= 0 && t.target.type === 6 && t.target.position.column >= n && this._editor.updateOptions({
        stopRenderingLineAfter: -1
      });
    }));
  }
};
e1e.ID = "editor.contrib.longLinesHelper";
let n$ = e1e;
Si(
  n$.ID,
  n$,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
const t1e = class t1e extends ge {
  constructor(e) {
    super(), this._editor = e;
    const t = Ms(this._editor), n = t.getOption(
      171
      /* EditorOption.scrollOnMiddleClick */
    );
    this._register(Xt((r) => {
      if (!n.read(r))
        return;
      const s = t.domNode.read(r);
      if (!s)
        return;
      const o = r.store.add(Yhe("scrollingSession", void 0));
      r.store.add(this._editor.onMouseDown((l) => {
        if (o.read(void 0)) {
          o.set(void 0, void 0);
          return;
        }
        if (!l.event.middleButton)
          return;
        l.event.stopPropagation(), l.event.preventDefault();
        const u = new ke(), d = new ha(l.event.posx, l.event.posy), g = HIt(At(s), d, u).map((v) => v.subtract(d).withThreshold(5)), m = s.getBoundingClientRect(), _ = new ha(d.x - m.left, d.y - m.top);
        o.set({
          mouseDeltaAfterThreshold: g,
          initialMousePosInEditor: _,
          didScroll: !1,
          dispose: () => u.dispose()
        }, void 0), u.add(this._editor.onMouseUp((v) => {
          const w = o.read(void 0);
          w && w.didScroll && o.set(void 0, void 0);
        })), u.add(this._editor.onKeyDown((v) => {
          o.set(void 0, void 0);
        }));
      })), r.store.add(Xt((l) => {
        const c = o.read(l);
        if (!c)
          return;
        let u = Date.now();
        l.store.add(Xt((h) => {
          Pz.instance.invalidateOnNextAnimationFrame(h);
          const g = Date.now(), m = g - u;
          u = g;
          const _ = c.mouseDeltaAfterThreshold.read(void 0), v = m / 32, w = _.scale(v), E = new ha(this._editor.getScrollLeft(), this._editor.getScrollTop());
          this._editor.setScrollPosition(WIt(E.add(w))), w.isZero() || (c.didScroll = !0);
        }));
        const d = Ie((h) => {
          const g = c.mouseDeltaAfterThreshold.read(h);
          let m = "";
          return m += g.y < 0 ? "n" : g.y > 0 ? "s" : "", m += g.x < 0 ? "w" : g.x > 0 ? "e" : "", m;
        });
        l.store.add(Xt((h) => {
          s.setAttribute("data-scroll-direction", d.read(h));
        }));
      }));
      const a = r.store.add(Tn.div({
        class: ["scroll-editor-on-middle-click-dot", o.map((l) => l ? "" : "hidden")],
        style: {
          left: o.map((l) => l ? l.initialMousePosInEditor.x : 0),
          top: o.map((l) => l ? l.initialMousePosInEditor.y : 0)
        }
      }).toDisposableLiveElement());
      r.store.add(hN(s, a.element)), r.store.add(Xt((l) => {
        const c = o.read(l);
        s.classList.toggle("scroll-editor-on-middle-click-editor", !!c);
      }));
    }));
  }
};
t1e.ID = "editor.contrib.middleScroll";
let i$ = t1e;
function HIt(i, e, t) {
  const n = Qt("pos", e);
  return t.add(Ce(i, "mousemove", (r) => {
    n.set(new ha(r.pageX, r.pageY), void 0);
  })), n;
}
function WIt(i) {
  return {
    scrollLeft: i.x,
    scrollTop: i.y
  };
}
Si(
  i$.ID,
  i$,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
const VIt = ie("editor.wordHighlightBackground", { dark: "#575757B8", light: "#57575740", hcDark: null, hcLight: null }, S(1548, "Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("editor.wordHighlightStrongBackground", { dark: "#004972B8", light: "#0e639c40", hcDark: null, hcLight: null }, S(1549, "Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."), !0);
ie("editor.wordHighlightTextBackground", VIt, S(1550, "Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."), !0);
const UIt = ie("editor.wordHighlightBorder", { light: null, dark: null, hcDark: fs, hcLight: fs }, S(1551, "Border color of a symbol during read-access, like reading a variable."));
ie("editor.wordHighlightStrongBorder", { light: null, dark: null, hcDark: fs, hcLight: fs }, S(1552, "Border color of a symbol during write-access, like writing to a variable."));
ie("editor.wordHighlightTextBorder", UIt, S(1553, "Border color of a textual occurrence for a symbol."));
const zIt = ie("editorOverviewRuler.wordHighlightForeground", "#A0A0A0CC", S(1554, "Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."), !0), $It = ie("editorOverviewRuler.wordHighlightStrongForeground", "#C0A0C0CC", S(1555, "Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."), !0), jIt = ie("editorOverviewRuler.wordHighlightTextForeground", PFe, S(1556, "Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."), !0), GIt = dn.register({
  description: "word-highlight-strong",
  stickiness: 1,
  className: "wordHighlightStrong",
  overviewRuler: {
    color: Ks($It),
    position: zh.Center
  },
  minimap: {
    color: Ks(Gq),
    position: 1
    /* MinimapPosition.Inline */
  }
}), qIt = dn.register({
  description: "word-highlight-text",
  stickiness: 1,
  className: "wordHighlightText",
  overviewRuler: {
    color: Ks(jIt),
    position: zh.Center
  },
  minimap: {
    color: Ks(Gq),
    position: 1
    /* MinimapPosition.Inline */
  }
}), KIt = dn.register({
  description: "selection-highlight-overview",
  stickiness: 1,
  className: "selectionHighlight",
  overviewRuler: {
    color: Ks(PFe),
    position: zh.Center
  },
  minimap: {
    color: Ks(Gq),
    position: 1
    /* MinimapPosition.Inline */
  }
}), YIt = dn.register({
  description: "selection-highlight",
  stickiness: 1,
  className: "selectionHighlight"
}), XIt = dn.register({
  description: "word-highlight",
  stickiness: 1,
  className: "wordHighlight",
  overviewRuler: {
    color: Ks(zIt),
    position: zh.Center
  },
  minimap: {
    color: Ks(Gq),
    position: 1
    /* MinimapPosition.Inline */
  }
});
function ZIt(i) {
  return i === rA.Write ? GIt : i === rA.Text ? qIt : XIt;
}
function QIt(i) {
  return i ? YIt : KIt;
}
ng((i, e) => {
  const t = i.getColor(yfe);
  t && e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(0.5)}; }`);
});
var JIt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, eNt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, ole;
function Dw(i, e) {
  const t = e.filter((n) => !i.find((r) => r.equals(n)));
  if (t.length >= 1) {
    const n = t.map((s) => `line ${s.viewState.position.lineNumber} column ${s.viewState.position.column}`).join(", "), r = t.length === 1 ? S(1278, "Cursor added: {0}", n) : S(1279, "Cursors added: {0}", n);
    hb(r);
  }
}
class tNt extends vt {
  constructor() {
    super({
      id: "editor.action.insertCursorAbove",
      label: Ee(1288, "Add Cursor Above"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 2576,
        linux: {
          primary: 1552,
          secondary: [
            3088
            /* KeyCode.UpArrow */
          ]
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "3_multi",
        title: S(1280, "&&Add Cursor Above"),
        order: 2
      }
    });
  }
  run(e, t, n) {
    if (!t.hasModel())
      return;
    let r = !0;
    n && n.logicalLine === !1 && (r = !1);
    const s = t._getViewModel();
    if (s.cursorConfig.readOnly)
      return;
    s.model.pushStackElement();
    const o = s.getCursorStates();
    s.setCursorStates(n.source, 3, $a.addCursorUp(s, o, r)), s.revealTopMostCursor(n.source), Dw(o, s.getCursorStates());
  }
}
class nNt extends vt {
  constructor() {
    super({
      id: "editor.action.insertCursorBelow",
      label: Ee(1289, "Add Cursor Below"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 2578,
        linux: {
          primary: 1554,
          secondary: [
            3090
            /* KeyCode.DownArrow */
          ]
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "3_multi",
        title: S(1281, "A&&dd Cursor Below"),
        order: 3
      }
    });
  }
  run(e, t, n) {
    if (!t.hasModel())
      return;
    let r = !0;
    n && n.logicalLine === !1 && (r = !1);
    const s = t._getViewModel();
    if (s.cursorConfig.readOnly)
      return;
    s.model.pushStackElement();
    const o = s.getCursorStates();
    s.setCursorStates(n.source, 3, $a.addCursorDown(s, o, r)), s.revealBottomMostCursor(n.source), Dw(o, s.getCursorStates());
  }
}
class iNt extends vt {
  constructor() {
    super({
      id: "editor.action.insertCursorAtEndOfEachLineSelected",
      label: Ee(1290, "Add Cursors to Line Ends"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 1575,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "3_multi",
        title: S(1282, "Add C&&ursors to Line Ends"),
        order: 4
      }
    });
  }
  getCursorsForSelection(e, t, n) {
    if (!e.isEmpty()) {
      for (let r = e.startLineNumber; r < e.endLineNumber; r++) {
        const s = t.getLineMaxColumn(r);
        n.push(new bt(r, s, r, s));
      }
      e.endColumn > 1 && n.push(new bt(e.endLineNumber, e.endColumn, e.endLineNumber, e.endColumn));
    }
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getModel(), r = t.getSelections(), s = t._getViewModel(), o = s.getCursorStates(), a = [];
    r.forEach((l) => this.getCursorsForSelection(l, n, a)), a.length > 0 && t.setSelections(a), Dw(o, s.getCursorStates());
  }
}
class rNt extends vt {
  constructor() {
    super({
      id: "editor.action.addCursorsToBottom",
      label: Ee(1291, "Add Cursors to Bottom"),
      precondition: void 0
    });
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getSelections(), r = t.getModel().getLineCount(), s = [];
    for (let l = n[0].startLineNumber; l <= r; l++)
      s.push(new bt(l, n[0].startColumn, l, n[0].endColumn));
    const o = t._getViewModel(), a = o.getCursorStates();
    s.length > 0 && t.setSelections(s), Dw(a, o.getCursorStates());
  }
}
class sNt extends vt {
  constructor() {
    super({
      id: "editor.action.addCursorsToTop",
      label: Ee(1292, "Add Cursors to Top"),
      precondition: void 0
    });
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getSelections(), r = [];
    for (let a = n[0].startLineNumber; a >= 1; a--)
      r.push(new bt(a, n[0].startColumn, a, n[0].endColumn));
    const s = t._getViewModel(), o = s.getCursorStates();
    r.length > 0 && t.setSelections(r), Dw(o, s.getCursorStates());
  }
}
class MH {
  constructor(e, t, n) {
    this.selections = e, this.revealRange = t, this.revealScrollType = n;
  }
}
class w5 {
  static create(e, t) {
    if (!e.hasModel())
      return null;
    const n = t.getState();
    if (!e.hasTextFocus() && n.isRevealed && n.searchString.length > 0)
      return new w5(e, t, !1, n.searchString, n.wholeWord, n.matchCase, null);
    let r = !1, s, o;
    const a = e.getSelections();
    a.length === 1 && a[0].isEmpty() ? (r = !0, s = !0, o = !0) : (s = n.wholeWord, o = n.matchCase);
    const l = e.getSelection();
    let c, u = null;
    if (l.isEmpty()) {
      const d = e.getConfiguredWordAtPosition(l.getStartPosition());
      if (!d)
        return null;
      c = d.word, u = new bt(l.startLineNumber, d.startColumn, l.startLineNumber, d.endColumn);
    } else
      c = e.getModel().getValueInRange(l).replace(/\r\n/g, `
`);
    return new w5(e, t, r, c, s, o, u);
  }
  constructor(e, t, n, r, s, o, a) {
    this._editor = e, this.findController = t, this.isDisconnectedFromFindController = n, this.searchText = r, this.wholeWord = s, this.matchCase = o, this.currentMatch = a;
  }
  addSelectionToNextFindMatch() {
    if (!this._editor.hasModel())
      return null;
    const e = this._getNextMatch();
    if (!e)
      return null;
    const t = this._editor.getSelections();
    return new MH(
      t.concat(e),
      e,
      0
      /* ScrollType.Smooth */
    );
  }
  moveSelectionToNextFindMatch() {
    if (!this._editor.hasModel())
      return null;
    const e = this._getNextMatch();
    if (!e)
      return null;
    const t = this._editor.getSelections();
    return new MH(
      t.slice(0, t.length - 1).concat(e),
      e,
      0
      /* ScrollType.Smooth */
    );
  }
  _getNextMatch() {
    if (!this._editor.hasModel())
      return null;
    if (this.currentMatch) {
      const r = this.currentMatch;
      return this.currentMatch = null, r;
    }
    this.findController.highlightFindOptions();
    const e = this._editor.getSelections(), t = e[e.length - 1], n = this._editor.getModel().findNextMatch(this.searchText, t.getEndPosition(), !1, this.matchCase, this.wholeWord ? this._editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null, !1);
    return n ? new bt(n.range.startLineNumber, n.range.startColumn, n.range.endLineNumber, n.range.endColumn) : null;
  }
  addSelectionToPreviousFindMatch() {
    if (!this._editor.hasModel())
      return null;
    const e = this._getPreviousMatch();
    if (!e)
      return null;
    const t = this._editor.getSelections();
    return new MH(
      t.concat(e),
      e,
      0
      /* ScrollType.Smooth */
    );
  }
  moveSelectionToPreviousFindMatch() {
    if (!this._editor.hasModel())
      return null;
    const e = this._getPreviousMatch();
    if (!e)
      return null;
    const t = this._editor.getSelections();
    return new MH(
      t.slice(0, t.length - 1).concat(e),
      e,
      0
      /* ScrollType.Smooth */
    );
  }
  _getPreviousMatch() {
    if (!this._editor.hasModel())
      return null;
    if (this.currentMatch) {
      const r = this.currentMatch;
      return this.currentMatch = null, r;
    }
    this.findController.highlightFindOptions();
    const e = this._editor.getSelections(), t = e[e.length - 1], n = this._editor.getModel().findPreviousMatch(this.searchText, t.getStartPosition(), !1, this.matchCase, this.wholeWord ? this._editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null, !1);
    return n ? new bt(n.range.startLineNumber, n.range.startColumn, n.range.endLineNumber, n.range.endColumn) : null;
  }
  selectAll(e) {
    if (!this._editor.hasModel())
      return [];
    this.findController.highlightFindOptions();
    const t = this._editor.getModel();
    return e ? t.findMatches(
      this.searchText,
      e,
      !1,
      this.matchCase,
      this.wholeWord ? this._editor.getOption(
        148
        /* EditorOption.wordSeparators */
      ) : null,
      !1,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    ) : t.findMatches(
      this.searchText,
      !0,
      !1,
      this.matchCase,
      this.wholeWord ? this._editor.getOption(
        148
        /* EditorOption.wordSeparators */
      ) : null,
      !1,
      1073741824
      /* Constants.MAX_SAFE_SMALL_INTEGER */
    );
  }
}
const HG = class HG extends ge {
  static get(e) {
    return e.getContribution(HG.ID);
  }
  constructor(e) {
    super(), this._sessionDispose = this._register(new ke()), this._editor = e, this._ignoreSelectionChange = !1, this._session = null;
  }
  dispose() {
    this._endSession(), super.dispose();
  }
  _beginSessionIfNeeded(e) {
    if (!this._session) {
      const t = w5.create(this._editor, e);
      if (!t)
        return;
      this._session = t;
      const n = { searchString: this._session.searchText };
      this._session.isDisconnectedFromFindController && (n.wholeWordOverride = 1, n.matchCaseOverride = 1, n.isRegexOverride = 2), e.getState().change(n, !1), this._sessionDispose.add(this._editor.onDidChangeCursorSelection((r) => {
        this._ignoreSelectionChange || this._endSession();
      })), this._sessionDispose.add(this._editor.onDidBlurEditorText(() => {
        this._endSession();
      })), this._sessionDispose.add(e.getState().onFindReplaceStateChange((r) => {
        (r.matchCase || r.wholeWord) && this._endSession();
      }));
    }
  }
  _endSession() {
    if (this._sessionDispose.clear(), this._session && this._session.isDisconnectedFromFindController) {
      const e = {
        wholeWordOverride: 0,
        matchCaseOverride: 0,
        isRegexOverride: 0
      };
      this._session.findController.getState().change(e, !1);
    }
    this._session = null;
  }
  _setSelections(e) {
    this._ignoreSelectionChange = !0, this._editor.setSelections(e), this._ignoreSelectionChange = !1;
  }
  _expandEmptyToWord(e, t) {
    if (!t.isEmpty())
      return t;
    const n = this._editor.getConfiguredWordAtPosition(t.getStartPosition());
    return n ? new bt(t.startLineNumber, n.startColumn, t.startLineNumber, n.endColumn) : t;
  }
  _applySessionResult(e) {
    e && (this._setSelections(e.selections), e.revealRange && this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange, e.revealScrollType));
  }
  getSession(e) {
    return this._session;
  }
  addSelectionToNextFindMatch(e) {
    if (this._editor.hasModel()) {
      if (!this._session) {
        const t = this._editor.getSelections();
        if (t.length > 1) {
          const r = e.getState().matchCase;
          if (!N8e(this._editor.getModel(), t, r)) {
            const o = this._editor.getModel(), a = [];
            for (let l = 0, c = t.length; l < c; l++)
              a[l] = this._expandEmptyToWord(o, t[l]);
            this._editor.setSelections(a);
            return;
          }
        }
      }
      this._beginSessionIfNeeded(e), this._session && this._applySessionResult(this._session.addSelectionToNextFindMatch());
    }
  }
  addSelectionToPreviousFindMatch(e) {
    this._beginSessionIfNeeded(e), this._session && this._applySessionResult(this._session.addSelectionToPreviousFindMatch());
  }
  moveSelectionToNextFindMatch(e) {
    this._beginSessionIfNeeded(e), this._session && this._applySessionResult(this._session.moveSelectionToNextFindMatch());
  }
  moveSelectionToPreviousFindMatch(e) {
    this._beginSessionIfNeeded(e), this._session && this._applySessionResult(this._session.moveSelectionToPreviousFindMatch());
  }
  selectAll(e) {
    if (!this._editor.hasModel())
      return;
    let t = null;
    const n = e.getState();
    if (n.isRevealed && n.searchString.length > 0 && n.isRegex) {
      const r = this._editor.getModel();
      n.searchScope ? t = r.findMatches(
        n.searchString,
        n.searchScope,
        n.isRegex,
        n.matchCase,
        n.wholeWord ? this._editor.getOption(
          148
          /* EditorOption.wordSeparators */
        ) : null,
        !1,
        1073741824
        /* Constants.MAX_SAFE_SMALL_INTEGER */
      ) : t = r.findMatches(
        n.searchString,
        !0,
        n.isRegex,
        n.matchCase,
        n.wholeWord ? this._editor.getOption(
          148
          /* EditorOption.wordSeparators */
        ) : null,
        !1,
        1073741824
        /* Constants.MAX_SAFE_SMALL_INTEGER */
      );
    } else {
      if (this._beginSessionIfNeeded(e), !this._session)
        return;
      t = this._session.selectAll(n.searchScope);
    }
    if (t.length > 0) {
      const r = this._editor.getSelection();
      for (let s = 0, o = t.length; s < o; s++) {
        const a = t[s];
        if (a.range.intersectRanges(r)) {
          t[s] = t[0], t[0] = a;
          break;
        }
      }
      this._setSelections(t.map((s) => new bt(s.range.startLineNumber, s.range.startColumn, s.range.endLineNumber, s.range.endColumn)));
    }
  }
};
HG.ID = "editor.contrib.multiCursorController";
let wA = HG;
class h2 extends vt {
  run(e, t) {
    const n = wA.get(t);
    if (!n)
      return;
    const r = t._getViewModel();
    if (r) {
      const s = r.getCursorStates(), o = nd.get(t);
      if (o)
        this._run(n, o);
      else {
        const a = e.get(xt).createInstance(nd, t);
        this._run(n, a), a.dispose();
      }
      Dw(s, r.getCursorStates());
    }
  }
}
class oNt extends h2 {
  constructor() {
    super({
      id: "editor.action.addSelectionToNextFindMatch",
      label: Ee(1293, "Add Selection to Next Find Match"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 2082,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "3_multi",
        title: S(1283, "Add &&Next Occurrence"),
        order: 5
      }
    });
  }
  _run(e, t) {
    e.addSelectionToNextFindMatch(t);
  }
}
class aNt extends h2 {
  constructor() {
    super({
      id: "editor.action.addSelectionToPreviousFindMatch",
      label: Ee(1294, "Add Selection to Previous Find Match"),
      precondition: void 0,
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "3_multi",
        title: S(1284, "Add P&&revious Occurrence"),
        order: 6
      }
    });
  }
  _run(e, t) {
    e.addSelectionToPreviousFindMatch(t);
  }
}
class lNt extends h2 {
  constructor() {
    super({
      id: "editor.action.moveSelectionToNextFindMatch",
      label: Ee(1295, "Move Last Selection to Next Find Match"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: Ro(
          2089,
          2082
          /* KeyCode.KeyD */
        ),
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  _run(e, t) {
    e.moveSelectionToNextFindMatch(t);
  }
}
class cNt extends h2 {
  constructor() {
    super({
      id: "editor.action.moveSelectionToPreviousFindMatch",
      label: Ee(1296, "Move Last Selection to Previous Find Match"),
      precondition: void 0
    });
  }
  _run(e, t) {
    e.moveSelectionToPreviousFindMatch(t);
  }
}
class uNt extends h2 {
  constructor() {
    super({
      id: "editor.action.selectHighlights",
      label: Ee(1297, "Select All Occurrences of Find Match"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 3114,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "3_multi",
        title: S(1285, "Select All &&Occurrences"),
        order: 7
      }
    });
  }
  _run(e, t) {
    e.selectAll(t);
  }
}
class dNt extends h2 {
  constructor() {
    super({
      id: "editor.action.changeAll",
      label: Ee(1298, "Change All Occurrences"),
      precondition: Re.and(se.writable, se.editorTextFocus),
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 2108,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      contextMenuOpts: {
        group: "1_modification",
        order: 1.2
      }
    });
  }
  _run(e, t) {
    e.selectAll(t);
  }
}
class hNt {
  constructor(e, t, n, r, s) {
    this._model = e, this._searchText = t, this._matchCase = n, this._wordSeparators = r, this._cachedFindMatches = null, this._modelVersionId = this._model.getVersionId(), s && this._model === s._model && this._searchText === s._searchText && this._matchCase === s._matchCase && this._wordSeparators === s._wordSeparators && this._modelVersionId === s._modelVersionId && (this._cachedFindMatches = s._cachedFindMatches);
  }
  findMatches() {
    return this._cachedFindMatches === null && (this._cachedFindMatches = this._model.findMatches(this._searchText, !0, !1, this._matchCase, this._wordSeparators, !1).map((e) => e.range), this._cachedFindMatches.sort(z.compareRangesUsingStarts)), this._cachedFindMatches;
  }
}
var ML;
let r$ = (ML = class extends ge {
  constructor(e, t) {
    super(), this._languageFeaturesService = t, this.editor = e, this._isEnabled = e.getOption(
      122
      /* EditorOption.selectionHighlight */
    ), this._isEnabledMultiline = e.getOption(
      124
      /* EditorOption.selectionHighlightMultiline */
    ), this._maxLength = e.getOption(
      123
      /* EditorOption.selectionHighlightMaxLength */
    ), this._decorations = e.createDecorationsCollection(), this.updateSoon = this._register(new mr(() => this._update(), 300)), this.state = null, this._register(e.onDidChangeConfiguration((r) => {
      this._isEnabled = e.getOption(
        122
        /* EditorOption.selectionHighlight */
      ), this._isEnabledMultiline = e.getOption(
        124
        /* EditorOption.selectionHighlightMultiline */
      ), this._maxLength = e.getOption(
        123
        /* EditorOption.selectionHighlightMaxLength */
      );
    })), this._register(e.onDidChangeCursorSelection((r) => {
      this._isEnabled && (r.selection.isEmpty() ? r.reason === 3 ? (this.state && this._setState(null), this.updateSoon.schedule()) : this._setState(null) : this._update());
    })), this._register(e.onDidChangeModel((r) => {
      this._setState(null);
    })), this._register(e.onDidChangeModelContent((r) => {
      this._isEnabled && this.updateSoon.schedule();
    }));
    const n = nd.get(e);
    n && this._register(n.getState().onFindReplaceStateChange((r) => {
      this._update();
    })), this.updateSoon.schedule();
  }
  _update() {
    this._setState(ole._createState(this.state, this._isEnabled, this._isEnabledMultiline, this._maxLength, this.editor));
  }
  static _createState(e, t, n, r, s) {
    if (!t || !s.hasModel())
      return null;
    if (!n) {
      const d = s.getSelection();
      if (d.startLineNumber !== d.endLineNumber)
        return null;
    }
    const o = wA.get(s);
    if (!o)
      return null;
    const a = nd.get(s);
    if (!a)
      return null;
    let l = o.getSession(a);
    if (!l) {
      const d = s.getSelections();
      if (d.length > 1) {
        const g = a.getState().matchCase;
        if (!N8e(s.getModel(), d, g))
          return null;
      }
      l = w5.create(s, a);
    }
    if (!l || l.currentMatch || /^[ \t]+$/.test(l.searchText) || r > 0 && l.searchText.length > r)
      return null;
    const c = a.getState(), u = c.matchCase;
    if (c.isRevealed) {
      let d = c.searchString;
      u || (d = d.toLowerCase());
      let h = l.searchText;
      if (u || (h = h.toLowerCase()), d === h && l.matchCase === c.matchCase && l.wholeWord === c.wholeWord && !c.isRegex)
        return null;
    }
    return new hNt(s.getModel(), l.searchText, l.matchCase, l.wholeWord ? s.getOption(
      148
      /* EditorOption.wordSeparators */
    ) : null, e);
  }
  _setState(e) {
    if (this.state = e, !this.state) {
      this._decorations.clear();
      return;
    }
    if (!this.editor.hasModel())
      return;
    const t = this.editor.getModel();
    if (t.isTooLargeForTokenization())
      return;
    const n = this.state.findMatches(), r = this.editor.getSelections();
    r.sort(z.compareRangesUsingStarts);
    const s = [];
    for (let c = 0, u = 0, d = n.length, h = r.length; c < d; ) {
      const g = n[c];
      if (u >= h)
        s.push(g), c++;
      else {
        const m = z.compareRangesUsingStarts(g, r[u]);
        m < 0 ? ((r[u].isEmpty() || !z.areIntersecting(g, r[u])) && s.push(g), c++) : (m > 0 || c++, u++);
      }
    }
    const o = this.editor.getOption(
      90
      /* EditorOption.occurrencesHighlight */
    ) !== "off", a = this._languageFeaturesService.documentHighlightProvider.has(t) && o, l = s.map((c) => ({
      range: c,
      options: QIt(a)
    }));
    this._decorations.set(l);
  }
  dispose() {
    this._setState(null), super.dispose();
  }
}, ole = ML, ML.ID = "editor.contrib.selectionHighlighter", ML);
r$ = ole = JIt([
  eNt(1, St)
], r$);
function N8e(i, e, t) {
  const n = dNe(i, e[0], !t);
  for (let r = 1, s = e.length; r < s; r++) {
    const o = e[r];
    if (o.isEmpty())
      return !1;
    const a = dNe(i, o, !t);
    if (n !== a)
      return !1;
  }
  return !0;
}
function dNe(i, e, t) {
  const n = i.getValueInRange(e);
  return t ? n.toLowerCase() : n;
}
class fNt extends vt {
  constructor() {
    super({
      id: "editor.action.focusNextCursor",
      label: Ee(1299, "Focus Next Cursor"),
      metadata: {
        description: S(1286, "Focuses the next cursor"),
        args: []
      },
      precondition: void 0
    });
  }
  run(e, t, n) {
    if (!t.hasModel())
      return;
    const r = t._getViewModel();
    if (r.cursorConfig.readOnly)
      return;
    r.model.pushStackElement();
    const s = Array.from(r.getCursorStates()), o = s.shift();
    o && (s.push(o), r.setCursorStates(n.source, 3, s), r.revealPrimaryCursor(n.source, !0), Dw(s, r.getCursorStates()));
  }
}
class gNt extends vt {
  constructor() {
    super({
      id: "editor.action.focusPreviousCursor",
      label: Ee(1300, "Focus Previous Cursor"),
      metadata: {
        description: S(1287, "Focuses the previous cursor"),
        args: []
      },
      precondition: void 0
    });
  }
  run(e, t, n) {
    if (!t.hasModel())
      return;
    const r = t._getViewModel();
    if (r.cursorConfig.readOnly)
      return;
    r.model.pushStackElement();
    const s = Array.from(r.getCursorStates()), o = s.pop();
    o && (s.unshift(o), r.setCursorStates(n.source, 3, s), r.revealPrimaryCursor(n.source, !0), Dw(s, r.getCursorStates()));
  }
}
Si(
  wA.ID,
  wA,
  4
  /* EditorContributionInstantiation.Lazy */
);
Si(
  r$.ID,
  r$,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
Je(tNt);
Je(nNt);
Je(iNt);
Je(oNt);
Je(aNt);
Je(lNt);
Je(cNt);
Je(uNt);
Je(dNt);
Je(rNt);
Je(sNt);
Je(fNt);
Je(gNt);
const IT = {
  Visible: new ut("parameterHintsVisible", !1),
  MultipleSignatures: new ut("parameterHintsMultipleSignatures", !1)
};
async function R8e(i, e, t, n, r) {
  const s = i.ordered(e);
  for (const o of s)
    try {
      const a = await o.provideSignatureHelp(e, t, r, n);
      if (a)
        return a;
    } catch (a) {
      No(a);
    }
}
_i.registerCommand("_executeSignatureHelpProvider", async (i, ...e) => {
  const [t, n, r] = e;
  Ii(Ht.isUri(t)), Ii(de.isIPosition(n)), Ii(typeof r == "string" || !r);
  const s = i.get(St), o = await i.get(Ic).createModelReference(t);
  try {
    const a = await R8e(s.signatureHelpProvider, o.object.textEditorModel, de.lift(n), {
      triggerKind: rb.Invoke,
      isRetrigger: !1,
      triggerCharacter: r
    }, $n.None);
    return a ? (setTimeout(() => a.dispose(), 0), a.value) : void 0;
  } finally {
    o.dispose();
  }
});
var WC;
(function(i) {
  i.Default = {
    type: 0
    /* Type.Default */
  };
  class e {
    constructor(r, s) {
      this.request = r, this.previouslyActiveHints = s, this.type = 2;
    }
  }
  i.Pending = e;
  class t {
    constructor(r) {
      this.hints = r, this.type = 1;
    }
  }
  i.Active = t;
})(WC || (WC = {}));
const WG = class WG extends ge {
  // ms
  constructor(e, t, n = WG.DEFAULT_DELAY) {
    super(), this._onChangedHints = this._register(new he()), this.onChangedHints = this._onChangedHints.event, this.triggerOnType = !1, this._state = WC.Default, this._pendingTriggers = [], this._lastSignatureHelpResult = this._register(new er()), this.triggerChars = new UV(), this.retriggerChars = new UV(), this.triggerId = 0, this.editor = e, this.providers = t, this.throttledDelayer = new Gf(n), this._register(this.editor.onDidBlurEditorWidget(() => this.cancel())), this._register(this.editor.onDidChangeConfiguration(() => this.onEditorConfigurationChange())), this._register(this.editor.onDidChangeModel((r) => this.onModelChanged())), this._register(this.editor.onDidChangeModelLanguage((r) => this.onModelChanged())), this._register(this.editor.onDidChangeCursorSelection((r) => this.onCursorChange(r))), this._register(this.editor.onDidChangeModelContent((r) => this.onModelContentChange())), this._register(this.providers.onDidChange(this.onModelChanged, this)), this._register(this.editor.onDidType((r) => this.onDidType(r))), this.onEditorConfigurationChange(), this.onModelChanged();
  }
  get state() {
    return this._state;
  }
  set state(e) {
    this._state.type === 2 && this._state.request.cancel(), this._state = e;
  }
  cancel(e = !1) {
    this.state = WC.Default, this.throttledDelayer.cancel(), e || this._onChangedHints.fire(void 0);
  }
  trigger(e, t) {
    const n = this.editor.getModel();
    if (!n || !this.providers.has(n))
      return;
    const r = ++this.triggerId;
    this._pendingTriggers.push(e), this.throttledDelayer.trigger(() => this.doTrigger(r), t).catch(fn);
  }
  next() {
    if (this.state.type !== 1)
      return;
    const e = this.state.hints.signatures.length, t = this.state.hints.activeSignature, n = t % e === e - 1, r = this.editor.getOption(
      98
      /* EditorOption.parameterHints */
    ).cycle;
    if ((e < 2 || n) && !r) {
      this.cancel();
      return;
    }
    this.updateActiveSignature(n && r ? 0 : t + 1);
  }
  previous() {
    if (this.state.type !== 1)
      return;
    const e = this.state.hints.signatures.length, t = this.state.hints.activeSignature, n = t === 0, r = this.editor.getOption(
      98
      /* EditorOption.parameterHints */
    ).cycle;
    if ((e < 2 || n) && !r) {
      this.cancel();
      return;
    }
    this.updateActiveSignature(n && r ? e - 1 : t - 1);
  }
  updateActiveSignature(e) {
    this.state.type === 1 && (this.state = new WC.Active({ ...this.state.hints, activeSignature: e }), this._onChangedHints.fire(this.state.hints));
  }
  async doTrigger(e) {
    const t = this.state.type === 1 || this.state.type === 2, n = this.getLastActiveHints();
    if (this.cancel(!0), this._pendingTriggers.length === 0)
      return !1;
    const r = this._pendingTriggers.reduce(pNt);
    this._pendingTriggers = [];
    const s = {
      triggerKind: r.triggerKind,
      triggerCharacter: r.triggerCharacter,
      isRetrigger: t,
      activeSignatureHelp: n
    };
    if (!this.editor.hasModel())
      return !1;
    const o = this.editor.getModel(), a = this.editor.getPosition();
    this.state = new WC.Pending(Jo((l) => R8e(this.providers, o, a, s, l)), n);
    try {
      const l = await this.state.request;
      return e !== this.triggerId ? (l == null || l.dispose(), !1) : !l || !l.value.signatures || l.value.signatures.length === 0 ? (l == null || l.dispose(), this._lastSignatureHelpResult.clear(), this.cancel(), !1) : (this.state = new WC.Active(l.value), this._lastSignatureHelpResult.value = l, this._onChangedHints.fire(this.state.hints), !0);
    } catch (l) {
      return e === this.triggerId && (this.state = WC.Default), fn(l), !1;
    }
  }
  getLastActiveHints() {
    switch (this.state.type) {
      case 1:
        return this.state.hints;
      case 2:
        return this.state.previouslyActiveHints;
      default:
        return;
    }
  }
  get isTriggered() {
    return this.state.type === 1 || this.state.type === 2 || this.throttledDelayer.isTriggered();
  }
  onModelChanged() {
    this.cancel(), this.triggerChars.clear(), this.retriggerChars.clear();
    const e = this.editor.getModel();
    if (e)
      for (const t of this.providers.ordered(e)) {
        for (const n of t.signatureHelpTriggerCharacters || [])
          if (n.length) {
            const r = n.charCodeAt(0);
            this.triggerChars.add(r), this.retriggerChars.add(r);
          }
        for (const n of t.signatureHelpRetriggerCharacters || [])
          n.length && this.retriggerChars.add(n.charCodeAt(0));
      }
  }
  onDidType(e) {
    if (!this.triggerOnType)
      return;
    const t = e.length - 1, n = e.charCodeAt(t);
    (this.triggerChars.has(n) || this.isTriggered && this.retriggerChars.has(n)) && this.trigger({
      triggerKind: rb.TriggerCharacter,
      triggerCharacter: e.charAt(t)
    });
  }
  onCursorChange(e) {
    e.source === "mouse" ? this.cancel() : this.isTriggered && this.trigger({ triggerKind: rb.ContentChange });
  }
  onModelContentChange() {
    this.isTriggered && this.trigger({ triggerKind: rb.ContentChange });
  }
  onEditorConfigurationChange() {
    this.triggerOnType = this.editor.getOption(
      98
      /* EditorOption.parameterHints */
    ).enabled, this.triggerOnType || this.cancel();
  }
  dispose() {
    this.cancel(!0), super.dispose();
  }
};
WG.DEFAULT_DELAY = 120;
let ale = WG;
function pNt(i, e) {
  switch (e.triggerKind) {
    case rb.Invoke:
      return e;
    case rb.ContentChange:
      return i;
    case rb.TriggerCharacter:
    default:
      return e;
  }
}
var mNt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, kte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, lle;
const ph = Ge, _Nt = es("parameter-hints-next", Pe.chevronDown, S(1302, "Icon for show next parameter hint.")), bNt = es("parameter-hints-previous", Pe.chevronUp, S(1303, "Icon for show previous parameter hint."));
var PL;
let cle = (PL = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this.editor = e, this.model = t, this.renderDisposeables = this._register(new ke()), this.visible = !1, this.announcedLabel = null, this.allowEditorOverflow = !0, this.markdownRenderer = new n0({ editor: e }, s, r), this.keyVisible = IT.Visible.bindTo(n), this.keyMultipleSignatures = IT.MultipleSignatures.bindTo(n);
  }
  createParameterHintDOMNodes() {
    const e = ph(".editor-widget.parameter-hints-widget"), t = Fe(e, ph(".phwrapper"));
    t.tabIndex = -1;
    const n = Fe(t, ph(".controls")), r = Fe(n, ph(".button" + qt.asCSSSelector(bNt))), s = Fe(n, ph(".overloads")), o = Fe(n, ph(".button" + qt.asCSSSelector(_Nt)));
    this._register(Ce(r, "click", (h) => {
      Mi.stop(h), this.previous();
    })), this._register(Ce(o, "click", (h) => {
      Mi.stop(h), this.next();
    }));
    const a = ph(".body"), l = new LB(a, {
      alwaysConsumeMouseWheel: !0
    });
    this._register(l), t.appendChild(l.getDomNode());
    const c = Fe(a, ph(".signature")), u = Fe(a, ph(".docs"));
    e.style.userSelect = "text", this.domNodes = {
      element: e,
      signature: c,
      overloads: s,
      docs: u,
      scrollbar: l
    }, this.editor.addContentWidget(this), this.hide(), this._register(this.editor.onDidChangeCursorSelection((h) => {
      this.visible && this.editor.layoutContentWidget(this);
    }));
    const d = () => {
      if (!this.domNodes)
        return;
      const h = this.editor.getOption(
        59
        /* EditorOption.fontInfo */
      ), g = this.domNodes.element;
      g.style.fontSize = `${h.fontSize}px`, g.style.lineHeight = `${h.lineHeight / h.fontSize}`, g.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily", h.fontFamily), g.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault", au.fontFamily);
    };
    d(), this._register(Ze.chain(this.editor.onDidChangeConfiguration.bind(this.editor), (h) => h.filter((g) => g.hasChanged(
      59
      /* EditorOption.fontInfo */
    )))(d)), this._register(this.editor.onDidLayoutChange((h) => this.updateMaxHeight())), this.updateMaxHeight();
  }
  show() {
    this.visible || (this.domNodes || this.createParameterHintDOMNodes(), this.keyVisible.set(!0), this.visible = !0, setTimeout(() => {
      var e;
      (e = this.domNodes) == null || e.element.classList.add("visible");
    }, 100), this.editor.layoutContentWidget(this));
  }
  hide() {
    var e;
    this.renderDisposeables.clear(), this.visible && (this.keyVisible.reset(), this.visible = !1, this.announcedLabel = null, (e = this.domNodes) == null || e.element.classList.remove("visible"), this.editor.layoutContentWidget(this));
  }
  getPosition() {
    return this.visible ? {
      position: this.editor.getPosition(),
      preference: [
        1,
        2
        /* ContentWidgetPositionPreference.BELOW */
      ]
    } : null;
  }
  render(e) {
    if (this.renderDisposeables.clear(), !this.domNodes)
      return;
    const t = e.signatures.length > 1;
    this.domNodes.element.classList.toggle("multiple", t), this.keyMultipleSignatures.set(t), this.domNodes.signature.innerText = "", this.domNodes.docs.innerText = "";
    const n = e.signatures[e.activeSignature];
    if (!n)
      return;
    const r = Fe(this.domNodes.signature, ph(".code")), s = n.parameters.length > 0, o = n.activeParameter ?? e.activeParameter;
    if (s)
      this.renderParameters(r, n, o);
    else {
      const c = Fe(r, ph("span"));
      c.textContent = n.label;
    }
    const a = n.parameters[o];
    if (a != null && a.documentation) {
      const c = ph("span.documentation");
      if (typeof a.documentation == "string")
        c.textContent = a.documentation;
      else {
        const u = this.renderMarkdownDocs(a.documentation);
        c.appendChild(u.element);
      }
      Fe(this.domNodes.docs, ph("p", {}, c));
    }
    if (n.documentation !== void 0) if (typeof n.documentation == "string")
      Fe(this.domNodes.docs, ph("p", {}, n.documentation));
    else {
      const c = this.renderMarkdownDocs(n.documentation);
      Fe(this.domNodes.docs, c.element);
    }
    const l = this.hasDocs(n, a);
    if (this.domNodes.signature.classList.toggle("has-docs", l), this.domNodes.docs.classList.toggle("empty", !l), this.domNodes.overloads.textContent = String(e.activeSignature + 1).padStart(e.signatures.length.toString().length, "0") + "/" + e.signatures.length, a) {
      let c = "";
      const u = n.parameters[o];
      Array.isArray(u.label) ? c = n.label.substring(u.label[0], u.label[1]) : c = u.label, u.documentation && (c += typeof u.documentation == "string" ? `, ${u.documentation}` : `, ${u.documentation.value}`), n.documentation && (c += typeof n.documentation == "string" ? `, ${n.documentation}` : `, ${n.documentation.value}`), this.announcedLabel !== c && (lu(S(1304, "{0}, hint", c)), this.announcedLabel = c);
    }
    this.editor.layoutContentWidget(this), this.domNodes.scrollbar.scanDomNode();
  }
  renderMarkdownDocs(e) {
    const t = this.renderDisposeables.add(this.markdownRenderer.render(e, {
      asyncRenderCallback: () => {
        var n;
        (n = this.domNodes) == null || n.scrollbar.scanDomNode();
      }
    }));
    return t.element.classList.add("markdown-docs"), t;
  }
  hasDocs(e, t) {
    return !!(t && typeof t.documentation == "string" && i1(t.documentation).length > 0 || t && typeof t.documentation == "object" && i1(t.documentation).value.length > 0 || e.documentation && typeof e.documentation == "string" && i1(e.documentation).length > 0 || e.documentation && typeof e.documentation == "object" && i1(e.documentation.value).length > 0);
  }
  renderParameters(e, t, n) {
    const [r, s] = this.getParameterLabelOffsets(t, n), o = document.createElement("span");
    o.textContent = t.label.substring(0, r);
    const a = document.createElement("span");
    a.textContent = t.label.substring(r, s), a.className = "parameter active";
    const l = document.createElement("span");
    l.textContent = t.label.substring(s), Fe(e, o, a, l);
  }
  getParameterLabelOffsets(e, t) {
    const n = e.parameters[t];
    if (n) {
      if (Array.isArray(n.label))
        return n.label;
      if (n.label.length) {
        const r = new RegExp(`(\\W|^)${zd(n.label)}(?=\\W|$)`, "g");
        r.test(e.label);
        const s = r.lastIndex - n.label.length;
        return s >= 0 ? [s, r.lastIndex] : [0, 0];
      } else
        return [0, 0];
    } else return [0, 0];
  }
  next() {
    this.editor.focus(), this.model.next();
  }
  previous() {
    this.editor.focus(), this.model.previous();
  }
  getDomNode() {
    return this.domNodes || this.createParameterHintDOMNodes(), this.domNodes.element;
  }
  getId() {
    return lle.ID;
  }
  updateMaxHeight() {
    if (!this.domNodes)
      return;
    const t = `${Math.max(this.editor.getLayoutInfo().height / 4, 250)}px`;
    this.domNodes.element.style.maxHeight = t;
    const n = this.domNodes.element.getElementsByClassName("phwrapper");
    n.length && (n[0].style.maxHeight = t);
  }
}, lle = PL, PL.ID = "editor.widget.parameterHintsWidget", PL);
cle = lle = mNt([
  kte(2, Jt),
  kte(3, ad),
  kte(4, Gr)
], cle);
ie("editorHoverWidget.highlightForeground", oN, S(1305, "Foreground color of the active item in the parameter hint."));
var vNt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, hNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, ule, FL;
let SA = (FL = class extends ge {
  static get(e) {
    return e.getContribution(ule.ID);
  }
  constructor(e, t, n) {
    super(), this.editor = e, this.model = this._register(new ale(e, n.signatureHelpProvider)), this._register(this.model.onChangedHints((r) => {
      var s;
      r ? (this.widget.value.show(), this.widget.value.render(r)) : (s = this.widget.rawValue) == null || s.hide();
    })), this.widget = new _l(() => this._register(t.createInstance(cle, this.editor, this.model)));
  }
  cancel() {
    this.model.cancel();
  }
  previous() {
    var e;
    (e = this.widget.rawValue) == null || e.previous();
  }
  next() {
    var e;
    (e = this.widget.rawValue) == null || e.next();
  }
  trigger(e) {
    this.model.trigger(e, 0);
  }
}, ule = FL, FL.ID = "editor.controller.parameterHints", FL);
SA = ule = vNt([
  hNe(1, xt),
  hNe(2, St)
], SA);
class yNt extends vt {
  constructor() {
    super({
      id: "editor.action.triggerParameterHints",
      label: Ee(1301, "Trigger Parameter Hints"),
      precondition: se.hasSignatureHelpProvider,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 3082,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t) {
    const n = SA.get(t);
    n == null || n.trigger({
      triggerKind: rb.Invoke
    });
  }
}
Si(
  SA.ID,
  SA,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
Je(yNt);
const $pe = 175, jpe = jo.bindToContribution(SA.get);
ct(new jpe({
  id: "closeParameterHints",
  precondition: IT.Visible,
  handler: (i) => i.cancel(),
  kbOpts: {
    weight: $pe,
    kbExpr: se.focus,
    primary: 9,
    secondary: [
      1033
      /* KeyCode.Escape */
    ]
  }
}));
ct(new jpe({
  id: "showPrevParameterHint",
  precondition: Re.and(IT.Visible, IT.MultipleSignatures),
  handler: (i) => i.previous(),
  kbOpts: {
    weight: $pe,
    kbExpr: se.focus,
    primary: 16,
    secondary: [
      528
      /* KeyCode.UpArrow */
    ],
    mac: { primary: 16, secondary: [
      528,
      302
      /* KeyCode.KeyP */
    ] }
  }
}));
ct(new jpe({
  id: "showNextParameterHint",
  precondition: Re.and(IT.Visible, IT.MultipleSignatures),
  handler: (i) => i.next(),
  kbOpts: {
    weight: $pe,
    kbExpr: se.focus,
    primary: 18,
    secondary: [
      530
      /* KeyCode.DownArrow */
    ],
    mac: { primary: 18, secondary: [
      530,
      300
      /* KeyCode.KeyN */
    ] }
  }
}));
const n1e = class n1e extends ge {
  constructor(e) {
    super(), this._editor = e, this._editorObs = Ms(this._editor), this._placeholderText = this._editorObs.getOption(
      100
      /* EditorOption.placeholder */
    ), this._state = pl({ owner: this, equalsFn: gie }, (t) => {
      const n = this._placeholderText.read(t);
      if (n && this._editorObs.valueIsEmpty.read(t))
        return { placeholder: n };
    }), this._shouldViewBeAlive = CNt(this, (t) => {
      var n;
      return ((n = this._state.read(t)) == null ? void 0 : n.placeholder) !== void 0;
    }), this._view = Ie((t) => {
      if (!this._shouldViewBeAlive.read(t))
        return;
      const n = Li("div.editorPlaceholder");
      t.store.add(Xt((r) => {
        const s = this._state.read(r), o = (s == null ? void 0 : s.placeholder) !== void 0;
        n.root.style.display = o ? "block" : "none", n.root.innerText = (s == null ? void 0 : s.placeholder) ?? "";
      })), t.store.add(Xt((r) => {
        const s = this._editorObs.layoutInfo.read(r);
        n.root.style.left = `${s.contentLeft}px`, n.root.style.width = s.contentWidth - s.verticalScrollbarWidth + "px", n.root.style.top = `${this._editor.getTopForLineNumber(0)}px`;
      })), t.store.add(Xt((r) => {
        n.root.style.fontFamily = this._editorObs.getOption(
          58
          /* EditorOption.fontFamily */
        ).read(r), n.root.style.fontSize = this._editorObs.getOption(
          61
          /* EditorOption.fontSize */
        ).read(r) + "px", n.root.style.lineHeight = this._editorObs.getOption(
          75
          /* EditorOption.lineHeight */
        ).read(r) + "px";
      })), t.store.add(this._editorObs.createOverlayWidget({
        allowEditorOverflow: !1,
        minContentWidthInPx: Br(0),
        position: Br(null),
        domNode: n.root
      }));
    }), this._view.recomputeInitiallyAndOnChange(this._store);
  }
};
n1e.ID = "editor.contrib.placeholderText";
let s$ = n1e;
function CNt(i, e) {
  return u0(i, (t, n) => n === !0 ? !0 : e(t));
}
var wNt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, SNt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class ENt {
  constructor(e) {
    this.instantiationService = e;
  }
  init(...e) {
  }
}
function xNt(i) {
  return i();
}
let fNe = class extends ENt {
  constructor(e, t) {
    super(t), this.init(e);
  }
};
fNe = wNt([
  SNt(1, xt)
], fNe);
Si(
  s$.ID,
  xNt(() => s$),
  0
  /* EditorContributionInstantiation.Eager */
);
ie("editor.placeholder.foreground", Hut, S(1324, "Foreground color of the placeholder text in the editor."));
const UK = Vn("textResourceConfigurationService"), A8e = Vn("textResourcePropertiesService");
var LNt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, PH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const f2 = new ut("renameInputVisible", !1, S(1376, "Whether the rename input widget is visible"));
new ut("renameInputFocused", !1, S(1377, "Whether the rename input widget is focused"));
let dle = class {
  constructor(e, t, n, r, s, o) {
    this._editor = e, this._acceptKeybindings = t, this._themeService = n, this._keybindingService = r, this._logService = o, this.allowEditorOverflow = !0, this._disposables = new ke(), this._visibleContextKey = f2.bindTo(s), this._isEditingRenameCandidate = !1, this._nRenameSuggestionsInvocations = 0, this._hadAutomaticRenameSuggestionsInvocation = !1, this._candidates = /* @__PURE__ */ new Set(), this._beforeFirstInputFieldEditSW = new _a(), this._inputWithButton = new TNt(), this._disposables.add(this._inputWithButton), this._editor.addContentWidget(this), this._disposables.add(this._editor.onDidChangeConfiguration((a) => {
      a.hasChanged(
        59
        /* EditorOption.fontInfo */
      ) && this._updateFont();
    })), this._disposables.add(n.onDidColorThemeChange(this._updateStyles, this));
  }
  dispose() {
    this._disposables.dispose(), this._editor.removeContentWidget(this);
  }
  getId() {
    return "__renameInputWidget";
  }
  getDomNode() {
    return this._domNode || (this._domNode = document.createElement("div"), this._domNode.className = "monaco-editor rename-box", this._domNode.appendChild(this._inputWithButton.domNode), this._renameCandidateListView = this._disposables.add(new Gpe(this._domNode, {
      fontInfo: this._editor.getOption(
        59
        /* EditorOption.fontInfo */
      ),
      onFocusChange: (e) => {
        this._inputWithButton.input.value = e, this._isEditingRenameCandidate = !1;
      },
      onSelectionChange: () => {
        this._isEditingRenameCandidate = !1, this.acceptInput(!1);
      }
    })), this._disposables.add(this._inputWithButton.onDidInputChange(() => {
      var e, t, n;
      ((e = this._renameCandidateListView) == null ? void 0 : e.focusedCandidate) !== void 0 && (this._isEditingRenameCandidate = !0), this._timeBeforeFirstInputFieldEdit ?? (this._timeBeforeFirstInputFieldEdit = this._beforeFirstInputFieldEditSW.elapsed()), ((t = this._renameCandidateProvidersCts) == null ? void 0 : t.token.isCancellationRequested) === !1 && this._renameCandidateProvidersCts.cancel(), (n = this._renameCandidateListView) == null || n.clearFocus();
    })), this._label = document.createElement("div"), this._label.className = "rename-label", this._domNode.appendChild(this._label), this._updateFont(), this._updateStyles(this._themeService.getColorTheme())), this._domNode;
  }
  _updateStyles(e) {
    if (!this._domNode)
      return;
    const t = e.getColor(e2), n = e.getColor(Efe);
    this._domNode.style.backgroundColor = String(e.getColor(Bh) ?? ""), this._domNode.style.boxShadow = t ? ` 0 0 8px 2px ${t}` : "", this._domNode.style.border = n ? `1px solid ${n}` : "", this._domNode.style.color = String(e.getColor(FFe) ?? "");
    const r = e.getColor(BFe);
    this._inputWithButton.domNode.style.backgroundColor = String(e.getColor(Gie) ?? ""), this._inputWithButton.input.style.backgroundColor = String(e.getColor(Gie) ?? ""), this._inputWithButton.domNode.style.borderWidth = r ? "1px" : "0px", this._inputWithButton.domNode.style.borderStyle = r ? "solid" : "none", this._inputWithButton.domNode.style.borderColor = (r == null ? void 0 : r.toString()) ?? "none";
  }
  _updateFont() {
    if (this._domNode === void 0)
      return;
    Ii(this._label !== void 0, "RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"), this._editor.applyFontInfo(this._inputWithButton.input);
    const e = this._editor.getOption(
      59
      /* EditorOption.fontInfo */
    );
    this._label.style.fontSize = `${this._computeLabelFontSize(e.fontSize)}px`;
  }
  _computeLabelFontSize(e) {
    return e * 0.8;
  }
  getPosition() {
    if (!this._visible || !this._editor.hasModel() || // @ulugbekna: shouldn't happen
    !this._editor.getDomNode())
      return null;
    const e = nw(this.getDomNode().ownerDocument.body), t = ho(this._editor.getDomNode()), n = this._getTopForPosition();
    this._nPxAvailableAbove = n + t.top, this._nPxAvailableBelow = e.height - this._nPxAvailableAbove;
    const r = this._editor.getOption(
      75
      /* EditorOption.lineHeight */
    ), { totalHeight: s } = S5.getLayoutInfo({ lineHeight: r }), o = this._nPxAvailableBelow > s * 6 ? [
      2,
      1
      /* ContentWidgetPositionPreference.ABOVE */
    ] : [
      1,
      2
      /* ContentWidgetPositionPreference.BELOW */
    ];
    return {
      position: this._position,
      preference: o
    };
  }
  beforeRender() {
    var n, r;
    const [e, t] = this._acceptKeybindings;
    return this._label.innerText = S(1378, "{0} to Rename, {1} to Preview", (n = this._keybindingService.lookupKeybinding(e)) == null ? void 0 : n.getLabel(), (r = this._keybindingService.lookupKeybinding(t)) == null ? void 0 : r.getLabel()), this._domNode.style.minWidth = "200px", null;
  }
  afterRender(e) {
    if (e === null) {
      this.cancelInput(!0, "afterRender (because position is null)");
      return;
    }
    if (!this._editor.hasModel() || // shouldn't happen
    !this._editor.getDomNode())
      return;
    Ii(this._renameCandidateListView), Ii(this._nPxAvailableAbove !== void 0), Ii(this._nPxAvailableBelow !== void 0);
    const t = _y(this._inputWithButton.domNode), n = _y(this._label);
    let r;
    e === 2 ? r = this._nPxAvailableBelow : r = this._nPxAvailableAbove, this._renameCandidateListView.layout({
      height: r - n - t,
      width: Td(this._inputWithButton.domNode)
    });
  }
  acceptInput(e) {
    var t;
    this._trace("invoking acceptInput"), (t = this._currentAcceptInput) == null || t.call(this, e);
  }
  cancelInput(e, t) {
    var n;
    (n = this._currentCancelInput) == null || n.call(this, e);
  }
  focusNextRenameSuggestion() {
    var e;
    (e = this._renameCandidateListView) != null && e.focusNext() || (this._inputWithButton.input.value = this._currentName);
  }
  focusPreviousRenameSuggestion() {
    var e;
    (e = this._renameCandidateListView) != null && e.focusPrevious() || (this._inputWithButton.input.value = this._currentName);
  }
  /**
   * @param requestRenameCandidates is `undefined` when there are no rename suggestion providers
   */
  getInput(e, t, n, r, s) {
    const { start: o, end: a } = this._getSelection(e, t);
    this._renameCts = s;
    const l = new ke();
    this._nRenameSuggestionsInvocations = 0, this._hadAutomaticRenameSuggestionsInvocation = !1, r === void 0 ? this._inputWithButton.button.style.display = "none" : (this._inputWithButton.button.style.display = "flex", this._requestRenameCandidatesOnce = r, this._requestRenameCandidates(t, !1), l.add(Ce(this._inputWithButton.button, "click", () => this._requestRenameCandidates(t, !0))), l.add(Ce(this._inputWithButton.button, Xe.KEY_DOWN, (u) => {
      const d = new wr(u);
      (d.equals(
        3
        /* KeyCode.Enter */
      ) || d.equals(
        10
        /* KeyCode.Space */
      )) && (d.stopPropagation(), d.preventDefault(), this._requestRenameCandidates(t, !0));
    }))), this._isEditingRenameCandidate = !1, this._domNode.classList.toggle("preview", n), this._position = new de(e.startLineNumber, e.startColumn), this._currentName = t, this._inputWithButton.input.value = t, this._inputWithButton.input.setAttribute("selectionStart", o.toString()), this._inputWithButton.input.setAttribute("selectionEnd", a.toString()), this._inputWithButton.input.size = Math.max((e.endColumn - e.startColumn) * 1.1, 20), this._beforeFirstInputFieldEditSW.reset(), l.add(Et(() => {
      this._renameCts = void 0, s.dispose(!0);
    })), l.add(Et(() => {
      this._renameCandidateProvidersCts !== void 0 && (this._renameCandidateProvidersCts.dispose(!0), this._renameCandidateProvidersCts = void 0);
    })), l.add(Et(() => this._candidates.clear()));
    const c = new zT();
    return c.p.finally(() => {
      l.dispose(), this._hide();
    }), this._currentCancelInput = (u) => {
      var d;
      return this._trace("invoking _currentCancelInput"), this._currentAcceptInput = void 0, this._currentCancelInput = void 0, (d = this._renameCandidateListView) == null || d.clearCandidates(), c.complete(u), !0;
    }, this._currentAcceptInput = (u) => {
      this._trace("invoking _currentAcceptInput"), Ii(this._renameCandidateListView !== void 0);
      const d = this._renameCandidateListView.nCandidates;
      let h, g;
      const m = this._renameCandidateListView.focusedCandidate;
      if (m !== void 0 ? (this._trace("using new name from renameSuggestion"), h = m, g = { k: "renameSuggestion" }) : (this._trace("using new name from inputField"), h = this._inputWithButton.input.value, g = this._isEditingRenameCandidate ? { k: "userEditedRenameSuggestion" } : { k: "inputField" }), h === t || h.trim().length === 0) {
        this.cancelInput(!0, "_currentAcceptInput (because newName === value || newName.trim().length === 0)");
        return;
      }
      this._currentAcceptInput = void 0, this._currentCancelInput = void 0, this._renameCandidateListView.clearCandidates(), c.complete({
        newName: h,
        wantsPreview: n && u,
        stats: {
          source: g,
          nRenameSuggestions: d,
          timeBeforeFirstInputFieldEdit: this._timeBeforeFirstInputFieldEdit,
          nRenameSuggestionsInvocations: this._nRenameSuggestionsInvocations,
          hadAutomaticRenameSuggestionsInvocation: this._hadAutomaticRenameSuggestionsInvocation
        }
      });
    }, l.add(s.token.onCancellationRequested(() => this.cancelInput(!0, "cts.token.onCancellationRequested"))), l.add(this._editor.onDidBlurEditorWidget(() => {
      var u;
      return this.cancelInput(!((u = this._domNode) != null && u.ownerDocument.hasFocus()), "editor.onDidBlurEditorWidget");
    })), this._show(), c.p;
  }
  _requestRenameCandidates(e, t) {
    if (this._requestRenameCandidatesOnce !== void 0 && (this._renameCandidateProvidersCts !== void 0 && this._renameCandidateProvidersCts.dispose(!0), Ii(this._renameCts), this._inputWithButton.buttonState !== "stop")) {
      this._renameCandidateProvidersCts = new Ss();
      const n = t ? L4.Invoke : L4.Automatic, r = this._requestRenameCandidatesOnce(n, this._renameCandidateProvidersCts.token);
      if (r.length === 0) {
        this._inputWithButton.setSparkleButton();
        return;
      }
      t || (this._hadAutomaticRenameSuggestionsInvocation = !0), this._nRenameSuggestionsInvocations += 1, this._inputWithButton.setStopButton(), this._updateRenameCandidates(r, e, this._renameCts.token);
    }
  }
  /**
   * This allows selecting only part of the symbol name in the input field based on the selection in the editor
   */
  _getSelection(e, t) {
    Ii(this._editor.hasModel());
    const n = this._editor.getSelection();
    let r = 0, s = t.length;
    return !z.isEmpty(n) && !z.spansMultipleLines(n) && z.containsRange(e, n) && (r = Math.max(0, n.startColumn - e.startColumn), s = Math.min(e.endColumn, n.endColumn) - e.startColumn), { start: r, end: s };
  }
  _show() {
    this._trace("invoking _show"), this._editor.revealLineInCenterIfOutsideViewport(
      this._position.lineNumber,
      0
      /* ScrollType.Smooth */
    ), this._visible = !0, this._visibleContextKey.set(!0), this._editor.layoutContentWidget(this), setTimeout(() => {
      this._inputWithButton.input.focus(), this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")), parseInt(this._inputWithButton.input.getAttribute("selectionEnd")));
    }, 100);
  }
  async _updateRenameCandidates(e, t, n) {
    const r = (...c) => this._trace("_updateRenameCandidates", ...c);
    r("start");
    const s = await $R(Promise.allSettled(e), n);
    if (this._inputWithButton.setSparkleButton(), s === void 0) {
      r("returning early - received updateRenameCandidates results - undefined");
      return;
    }
    const o = s.flatMap((c) => c.status === "fulfilled" && Aa(c.value) ? c.value : []);
    r(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);
    const a = qy(o, (c) => c.newSymbolName);
    r(`distinct candidates - ${a.length} candidates.`);
    const l = a.filter(({ newSymbolName: c }) => c.trim().length > 0 && c !== this._inputWithButton.input.value && c !== t && !this._candidates.has(c));
    if (r(`valid distinct candidates - ${o.length} candidates.`), l.forEach((c) => this._candidates.add(c.newSymbolName)), l.length < 1) {
      r("returning early - no valid distinct candidates");
      return;
    }
    r("setting candidates"), this._renameCandidateListView.setCandidates(l), r("asking editor to re-layout"), this._editor.layoutContentWidget(this);
  }
  _hide() {
    this._trace("invoked _hide"), this._visible = !1, this._visibleContextKey.reset(), this._editor.layoutContentWidget(this);
  }
  _getTopForPosition() {
    const e = this._editor.getVisibleRanges();
    let t;
    return e.length > 0 ? t = e[0].startLineNumber : (this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"), t = Math.max(1, this._position.lineNumber - 5)), this._editor.getTopForLineNumber(this._position.lineNumber) - this._editor.getTopForLineNumber(t);
  }
  _trace(...e) {
    this._logService.trace("RenameWidget", ...e);
  }
};
dle = LNt([
  PH(2, to),
  PH(3, Fi),
  PH(4, Jt),
  PH(5, $r)
], dle);
class Gpe {
  // FIXME@ulugbekna: rewrite using event emitters
  constructor(e, t) {
    this._disposables = new ke(), this._availableHeight = 0, this._minimumWidth = 0, this._lineHeight = t.fontInfo.lineHeight, this._typicalHalfwidthCharacterWidth = t.fontInfo.typicalHalfwidthCharacterWidth, this._listContainer = document.createElement("div"), this._listContainer.className = "rename-box rename-candidate-list-container", e.appendChild(this._listContainer), this._listWidget = Gpe._createListWidget(this._listContainer, this._candidateViewHeight, t.fontInfo), this._disposables.add(this._listWidget.onDidChangeFocus((n) => {
      n.elements.length === 1 && t.onFocusChange(n.elements[0].newSymbolName);
    }, this._disposables)), this._disposables.add(this._listWidget.onDidChangeSelection((n) => {
      n.elements.length === 1 && t.onSelectionChange();
    }, this._disposables)), this._disposables.add(this._listWidget.onDidBlur((n) => {
      this._listWidget.setFocus([]);
    })), this._listWidget.style(JT({
      listInactiveFocusForeground: b4,
      listInactiveFocusBackground: v4
    }));
  }
  dispose() {
    this._listWidget.dispose(), this._disposables.dispose();
  }
  // height - max height allowed by parent element
  layout({ height: e, width: t }) {
    this._availableHeight = e, this._minimumWidth = t;
  }
  setCandidates(e) {
    this._listWidget.splice(0, 0, e);
    const t = this._pickListHeight(this._listWidget.length), n = this._pickListWidth(e);
    this._listWidget.layout(t, n), this._listContainer.style.height = `${t}px`, this._listContainer.style.width = `${n}px`, hb(S(1379, "Received {0} rename suggestions", e.length));
  }
  clearCandidates() {
    this._listContainer.style.height = "0px", this._listContainer.style.width = "0px", this._listWidget.splice(0, this._listWidget.length, []);
  }
  get nCandidates() {
    return this._listWidget.length;
  }
  get focusedCandidate() {
    if (this._listWidget.length === 0)
      return;
    const e = this._listWidget.getSelectedElements()[0];
    if (e !== void 0)
      return e.newSymbolName;
    const t = this._listWidget.getFocusedElements()[0];
    if (t !== void 0)
      return t.newSymbolName;
  }
  focusNext() {
    if (this._listWidget.length === 0)
      return !1;
    const e = this._listWidget.getFocus();
    if (e.length === 0)
      return this._listWidget.focusFirst(), this._listWidget.reveal(0), !0;
    if (e[0] === this._listWidget.length - 1)
      return this._listWidget.setFocus([]), this._listWidget.reveal(0), !1;
    {
      this._listWidget.focusNext();
      const t = this._listWidget.getFocus()[0];
      return this._listWidget.reveal(t), !0;
    }
  }
  /**
   * @returns true if focus is moved to previous element
   */
  focusPrevious() {
    if (this._listWidget.length === 0)
      return !1;
    const e = this._listWidget.getFocus();
    if (e.length === 0) {
      this._listWidget.focusLast();
      const t = this._listWidget.getFocus()[0];
      return this._listWidget.reveal(t), !0;
    } else {
      if (e[0] === 0)
        return this._listWidget.setFocus([]), !1;
      {
        this._listWidget.focusPrevious();
        const t = this._listWidget.getFocus()[0];
        return this._listWidget.reveal(t), !0;
      }
    }
  }
  clearFocus() {
    this._listWidget.setFocus([]);
  }
  get _candidateViewHeight() {
    const { totalHeight: e } = S5.getLayoutInfo({ lineHeight: this._lineHeight });
    return e;
  }
  _pickListHeight(e) {
    const t = this._candidateViewHeight * e;
    return Math.min(t, this._availableHeight, this._candidateViewHeight * 7);
  }
  _pickListWidth(e) {
    const t = Math.ceil(Math.max(...e.map((r) => r.newSymbolName.length)) * this._typicalHalfwidthCharacterWidth);
    return Math.max(
      this._minimumWidth,
      25 + t + 10
      /* (possibly visible) scrollbar width */
      // TODO@ulugbekna: approximate calc - clean this up
    );
  }
  static _createListWidget(e, t, n) {
    const r = new class {
      getTemplateId(o) {
        return "candidate";
      }
      getHeight(o) {
        return t;
      }
    }(), s = new class {
      constructor() {
        this.templateId = "candidate";
      }
      renderTemplate(o) {
        return new S5(o, n);
      }
      renderElement(o, a, l) {
        l.populate(o);
      }
      disposeTemplate(o) {
        o.dispose();
      }
    }();
    return new Zh("NewSymbolNameCandidates", e, r, [s], {
      keyboardSupport: !1,
      // @ulugbekna: because we handle keyboard events through proper commands & keybinding service, see `rename.ts`
      mouseSupport: !0,
      multipleSelectionSupport: !1
    });
  }
}
class TNt {
  constructor() {
    this._buttonHoverContent = "", this._onDidInputChange = new he(), this.onDidInputChange = this._onDidInputChange.event, this._disposables = new ke();
  }
  get domNode() {
    return this._domNode || (this._domNode = document.createElement("div"), this._domNode.className = "rename-input-with-button", this._domNode.style.display = "flex", this._domNode.style.flexDirection = "row", this._domNode.style.alignItems = "center", this._inputNode = document.createElement("input"), this._inputNode.className = "rename-input", this._inputNode.type = "text", this._inputNode.style.border = "none", this._inputNode.setAttribute("aria-label", S(1380, "Rename input. Type new name and press Enter to commit.")), this._domNode.appendChild(this._inputNode), this._buttonNode = document.createElement("div"), this._buttonNode.className = "rename-suggestions-button", this._buttonNode.setAttribute("tabindex", "0"), this._buttonGenHoverText = S(1381, "Generate new name suggestions"), this._buttonCancelHoverText = S(1382, "Cancel"), this._buttonHoverContent = this._buttonGenHoverText, this._disposables.add(Jg().setupDelayedHover(this._buttonNode, () => ({
      content: this._buttonHoverContent,
      appearance: {
        showPointer: !0,
        compact: !0
      }
    }))), this._domNode.appendChild(this._buttonNode), this._disposables.add(Ce(this.input, Xe.INPUT, () => this._onDidInputChange.fire())), this._disposables.add(Ce(this.input, Xe.KEY_DOWN, (e) => {
      const t = new wr(e);
      (t.keyCode === 15 || t.keyCode === 17) && this._onDidInputChange.fire();
    })), this._disposables.add(Ce(this.input, Xe.CLICK, () => this._onDidInputChange.fire())), this._disposables.add(Ce(this.input, Xe.FOCUS, () => {
      this.domNode.style.outlineWidth = "1px", this.domNode.style.outlineStyle = "solid", this.domNode.style.outlineOffset = "-1px", this.domNode.style.outlineColor = "var(--vscode-focusBorder)";
    })), this._disposables.add(Ce(this.input, Xe.BLUR, () => {
      this.domNode.style.outline = "none";
    }))), this._domNode;
  }
  get input() {
    return Ii(this._inputNode), this._inputNode;
  }
  get button() {
    return Ii(this._buttonNode), this._buttonNode;
  }
  get buttonState() {
    return this._buttonState;
  }
  setSparkleButton() {
    this._buttonState = "sparkle", this._sparkleIcon ?? (this._sparkleIcon = _b(Pe.sparkle)), Xa(this.button), this.button.appendChild(this._sparkleIcon), this.button.setAttribute("aria-label", "Generating new name suggestions"), this._buttonHoverContent = this._buttonGenHoverText, this.input.focus();
  }
  setStopButton() {
    this._buttonState = "stop", this._stopIcon ?? (this._stopIcon = _b(Pe.stopCircle)), Xa(this.button), this.button.appendChild(this._stopIcon), this.button.setAttribute("aria-label", "Cancel generating new name suggestions"), this._buttonHoverContent = this._buttonCancelHoverText, this.input.focus();
  }
  dispose() {
    this._disposables.dispose();
  }
}
const W3 = class W3 {
  constructor(e, t) {
    this._domNode = document.createElement("div"), this._domNode.className = "rename-box rename-candidate", this._domNode.style.display = "flex", this._domNode.style.columnGap = "5px", this._domNode.style.alignItems = "center", this._domNode.style.height = `${t.lineHeight}px`, this._domNode.style.padding = `${W3._PADDING}px`;
    const n = document.createElement("div");
    n.style.display = "flex", n.style.alignItems = "center", n.style.width = n.style.height = `${t.lineHeight * 0.8}px`, this._domNode.appendChild(n), this._icon = _b(Pe.sparkle), this._icon.style.display = "none", n.appendChild(this._icon), this._label = document.createElement("div"), Ma(this._label, t), this._domNode.appendChild(this._label), e.appendChild(this._domNode);
  }
  populate(e) {
    this._updateIcon(e), this._updateLabel(e);
  }
  _updateIcon(e) {
    var n;
    const t = !!((n = e.tags) != null && n.includes(sre.AIGenerated));
    this._icon.style.display = t ? "inherit" : "none";
  }
  _updateLabel(e) {
    this._label.innerText = e.newSymbolName;
  }
  static getLayoutInfo({ lineHeight: e }) {
    return { totalHeight: e + W3._PADDING * 2 };
  }
  dispose() {
  }
};
W3._PADDING = 2;
let S5 = W3;
var kNt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, pE = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, hle;
class qpe {
  constructor(e, t, n) {
    this.model = e, this.position = t, this._providerRenameIdx = 0, this._providers = n.ordered(e);
  }
  hasProvider() {
    return this._providers.length > 0;
  }
  async resolveRenameLocation(e) {
    const t = [];
    for (this._providerRenameIdx = 0; this._providerRenameIdx < this._providers.length; this._providerRenameIdx++) {
      const r = this._providers[this._providerRenameIdx];
      if (!r.resolveRenameLocation)
        break;
      const s = await r.resolveRenameLocation(this.model, this.position, e);
      if (s) {
        if (s.rejectReason) {
          t.push(s.rejectReason);
          continue;
        }
        return s;
      }
    }
    this._providerRenameIdx = 0;
    const n = this.model.getWordAtPosition(this.position);
    return n ? {
      range: new z(this.position.lineNumber, n.startColumn, this.position.lineNumber, n.endColumn),
      text: n.word,
      rejectReason: t.length > 0 ? t.join(`
`) : void 0
    } : {
      range: z.fromPositions(this.position),
      text: "",
      rejectReason: t.length > 0 ? t.join(`
`) : void 0
    };
  }
  async provideRenameEdits(e, t) {
    return this._provideRenameEdits(e, this._providerRenameIdx, [], t);
  }
  async _provideRenameEdits(e, t, n, r) {
    const s = this._providers[t];
    if (!s)
      return {
        edits: [],
        rejectReason: n.join(`
`)
      };
    const o = await s.provideRenameEdits(this.model, this.position, e, r);
    if (o) {
      if (o.rejectReason)
        return this._provideRenameEdits(e, t + 1, n.concat(o.rejectReason), r);
    } else return this._provideRenameEdits(e, t + 1, n.concat(S(1365, "No result.")), r);
    return o;
  }
}
async function DNt(i, e, t, n) {
  const r = new qpe(e, t, i), s = await r.resolveRenameLocation($n.None);
  return s != null && s.rejectReason ? { edits: [], rejectReason: s.rejectReason } : r.provideRenameEdits(n, $n.None);
}
var BL;
let pw = (BL = class {
  static get(e) {
    return e.getContribution(hle.ID);
  }
  constructor(e, t, n, r, s, o, a, l) {
    this.editor = e, this._instaService = t, this._notificationService = n, this._bulkEditService = r, this._progressService = s, this._logService = o, this._configService = a, this._languageFeaturesService = l, this._disposableStore = new ke(), this._cts = new Ss(), this._renameWidget = this._disposableStore.add(this._instaService.createInstance(dle, this.editor, ["acceptRenameInput", "acceptRenameInputWithPreview"]));
  }
  dispose() {
    this._disposableStore.dispose(), this._cts.dispose(!0);
  }
  async run() {
    var m, _;
    const e = this._logService.trace.bind(this._logService, "[rename]");
    if (this._cts.dispose(!0), this._cts = new Ss(), !this.editor.hasModel()) {
      e("editor has no model");
      return;
    }
    const t = this.editor.getPosition(), n = new qpe(this.editor.getModel(), t, this._languageFeaturesService.renameProvider);
    if (!n.hasProvider()) {
      e("skeleton has no provider");
      return;
    }
    const r = new t0(this.editor, 5, void 0, this._cts.token);
    let s;
    try {
      e("resolving rename location");
      const v = n.resolveRenameLocation(r.token);
      this._progressService.showWhile(v, 250), s = await v, e("resolved rename location");
    } catch (v) {
      v instanceof $f ? e("resolve rename location cancelled", JSON.stringify(v, null, "	")) : (e("resolve rename location failed", v instanceof Error ? v : JSON.stringify(v, null, "	")), (typeof v == "string" || ob(v)) && ((m = Vd.get(this.editor)) == null || m.showMessage(v || S(1366, "An unknown error occurred while resolving rename location"), t)));
      return;
    } finally {
      r.dispose();
    }
    if (!s) {
      e("returning early - no loc");
      return;
    }
    if (s.rejectReason) {
      e(`returning early - rejected with reason: ${s.rejectReason}`, s.rejectReason), (_ = Vd.get(this.editor)) == null || _.showMessage(s.rejectReason, t);
      return;
    }
    if (r.token.isCancellationRequested) {
      e("returning early - cts1 cancelled");
      return;
    }
    const o = new t0(this.editor, 5, s.range, this._cts.token), a = this.editor.getModel(), l = this._languageFeaturesService.newSymbolNamesProvider.all(a), c = await Promise.all(l.map(async (v) => [v, await v.supportsAutomaticNewSymbolNamesTriggerKind ?? !1])), u = (v, w) => {
      let E = c.slice();
      return v === L4.Automatic && (E = E.filter(([L, T]) => T)), E.map(([L]) => L.provideNewSymbolNames(a, s.range, v, w));
    };
    e("creating rename input field and awaiting its result");
    const d = this._bulkEditService.hasPreviewHandler() && this._configService.getValue(this.editor.getModel().uri, "editor.rename.enablePreview"), h = await this._renameWidget.getInput(s.range, s.text, d, l.length > 0 ? u : void 0, o);
    if (e("received response from rename input field"), typeof h == "boolean") {
      e(`returning early - rename input field response - ${h}`), h && this.editor.focus(), o.dispose();
      return;
    }
    this.editor.focus(), e("requesting rename edits");
    const g = $R(n.provideRenameEdits(h.newName, o.token), o.token).then(async (v) => {
      if (!v) {
        e("returning early - no rename edits result");
        return;
      }
      if (!this.editor.hasModel()) {
        e("returning early - no model after rename edits are provided");
        return;
      }
      if (v.rejectReason) {
        e(`returning early - rejected with reason: ${v.rejectReason}`), this._notificationService.info(v.rejectReason);
        return;
      }
      this.editor.setSelection(z.fromPositions(this.editor.getSelection().getPosition())), e("applying edits"), this._bulkEditService.apply(v, {
        editor: this.editor,
        showPreview: h.wantsPreview,
        label: S(1367, "Renaming '{0}' to '{1}'", s == null ? void 0 : s.text, h.newName),
        code: "undoredo.rename",
        quotableLabel: S(1368, "Renaming {0} to {1}", s == null ? void 0 : s.text, h.newName),
        respectAutoSaveConfig: !0,
        reason: $l.rename()
      }).then((w) => {
        e("edits applied"), w.ariaSummary && lu(S(1369, "Successfully renamed '{0}' to '{1}'. Summary: {2}", s.text, h.newName, w.ariaSummary));
      }).catch((w) => {
        e(`error when applying edits ${JSON.stringify(w, null, "	")}`), this._notificationService.error(S(1370, "Rename failed to apply edits")), this._logService.error(w);
      });
    }, (v) => {
      e("error when providing rename edits", JSON.stringify(v, null, "	")), this._notificationService.error(S(1371, "Rename failed to compute edits")), this._logService.error(v);
    }).finally(() => {
      o.dispose();
    });
    return e("returning rename operation"), this._progressService.showWhile(g, 250), g;
  }
  acceptRenameInput(e) {
    this._renameWidget.acceptInput(e);
  }
  cancelRenameInput() {
    this._renameWidget.cancelInput(!0, "cancelRenameInput command");
  }
  focusNextRenameSuggestion() {
    this._renameWidget.focusNextRenameSuggestion();
  }
  focusPreviousRenameSuggestion() {
    this._renameWidget.focusPreviousRenameSuggestion();
  }
}, hle = BL, BL.ID = "editor.contrib.renameController", BL);
pw = hle = kNt([
  pE(1, xt),
  pE(2, no),
  pE(3, HB),
  pE(4, e0),
  pE(5, $r),
  pE(6, UK),
  pE(7, St)
], pw);
class INt extends vt {
  constructor() {
    super({
      id: "editor.action.rename",
      label: Ee(1373, "Rename Symbol"),
      precondition: Re.and(se.writable, se.hasRenameProvider),
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 60,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      contextMenuOpts: {
        group: "1_modification",
        order: 1.1
      }
    });
  }
  runCommand(e, t) {
    const n = e.get(Ti), [r, s] = Array.isArray(t) && t || [void 0, void 0];
    return Ht.isUri(r) && de.isIPosition(s) ? n.openCodeEditor({ resource: r }, n.getActiveCodeEditor()).then((o) => {
      o && (o.setPosition(s), o.invokeWithinContext((a) => (this.reportTelemetry(a, o), this.run(a, o))));
    }, fn) : super.runCommand(e, t);
  }
  run(e, t) {
    const n = e.get($r), r = pw.get(t);
    return r ? (n.trace("[RenameAction] got controller, running..."), r.run()) : (n.trace("[RenameAction] returning early - controller missing"), Promise.resolve());
  }
}
Si(
  pw.ID,
  pw,
  4
  /* EditorContributionInstantiation.Lazy */
);
Je(INt);
const Kpe = jo.bindToContribution(pw.get);
ct(new Kpe({
  id: "acceptRenameInput",
  precondition: f2,
  handler: (i) => i.acceptRenameInput(!1),
  kbOpts: {
    weight: 199,
    kbExpr: Re.and(se.focus, Re.not("isComposing")),
    primary: 3
    /* KeyCode.Enter */
  }
}));
ct(new Kpe({
  id: "acceptRenameInputWithPreview",
  precondition: Re.and(f2, Re.has("config.editor.rename.enablePreview")),
  handler: (i) => i.acceptRenameInput(!0),
  kbOpts: {
    weight: 199,
    kbExpr: Re.and(se.focus, Re.not("isComposing")),
    primary: 2051
    /* KeyCode.Enter */
  }
}));
ct(new Kpe({
  id: "cancelRenameInput",
  precondition: f2,
  handler: (i) => i.cancelRenameInput(),
  kbOpts: {
    weight: 199,
    kbExpr: se.focus,
    primary: 9,
    secondary: [
      1033
      /* KeyCode.Escape */
    ]
  }
}));
ar(class extends Fa {
  constructor() {
    super({
      id: "focusNextRenameSuggestion",
      title: {
        ...Ee(1374, "Focus Next Rename Suggestion")
      },
      precondition: f2,
      keybinding: [
        {
          primary: 18,
          weight: 199
        }
      ]
    });
  }
  run(e) {
    const t = e.get(Ti).getFocusedCodeEditor();
    if (!t)
      return;
    const n = pw.get(t);
    n && n.focusNextRenameSuggestion();
  }
});
ar(class extends Fa {
  constructor() {
    super({
      id: "focusPreviousRenameSuggestion",
      title: {
        ...Ee(1375, "Focus Previous Rename Suggestion")
      },
      precondition: f2,
      keybinding: [
        {
          primary: 16,
          weight: 199
        }
      ]
    });
  }
  run(e) {
    const t = e.get(Ti).getFocusedCodeEditor();
    if (!t)
      return;
    const n = pw.get(t);
    n && n.focusPreviousRenameSuggestion();
  }
});
id("_executeDocumentRenameProvider", function(i, e, t, ...n) {
  const [r] = n;
  Ii(typeof r == "string");
  const { renameProvider: s } = i.get(St);
  return DNt(s, e, t, r);
});
id("_executePrepareRename", async function(i, e, t) {
  const { renameProvider: n } = i.get(St), s = await new qpe(e, t, n).resolveRenameLocation($n.None);
  if (s != null && s.rejectReason)
    throw new Error(s.rejectReason);
  return s;
});
Fs.as(Cm.Configuration).registerConfiguration({
  id: "editor",
  properties: {
    "editor.rename.enablePreview": {
      scope: 6,
      description: S(1372, "Enable/disable the ability to preview changes before renaming"),
      default: !0,
      type: "boolean"
    }
  }
});
var NNt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, gNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, IR;
let o$ = (IR = class extends ge {
  constructor(e, t, n) {
    super(), this.editor = e, this.languageConfigurationService = t, this.editorWorkerService = n, this.decorations = this.editor.createDecorationsCollection(), this.options = this.createOptions(e.getOption(
      81
      /* EditorOption.minimap */
    )), this.computePromise = null, this.currentOccurrences = {}, this._register(e.onDidChangeModel((r) => {
      this.currentOccurrences = {}, this.options = this.createOptions(e.getOption(
        81
        /* EditorOption.minimap */
      )), this.stop(), this.computeSectionHeaders.schedule(0);
    })), this._register(e.onDidChangeModelLanguage((r) => {
      this.currentOccurrences = {}, this.options = this.createOptions(e.getOption(
        81
        /* EditorOption.minimap */
      )), this.stop(), this.computeSectionHeaders.schedule(0);
    })), this._register(t.onDidChange((r) => {
      var o;
      const s = (o = this.editor.getModel()) == null ? void 0 : o.getLanguageId();
      s && r.affects(s) && (this.currentOccurrences = {}, this.options = this.createOptions(e.getOption(
        81
        /* EditorOption.minimap */
      )), this.stop(), this.computeSectionHeaders.schedule(0));
    })), this._register(e.onDidChangeConfiguration((r) => {
      this.options && !r.hasChanged(
        81
        /* EditorOption.minimap */
      ) || (this.options = this.createOptions(e.getOption(
        81
        /* EditorOption.minimap */
      )), this.updateDecorations([]), this.stop(), this.computeSectionHeaders.schedule(0));
    })), this._register(this.editor.onDidChangeModelContent((r) => {
      this.computeSectionHeaders.schedule();
    })), this._register(e.onDidChangeModelTokens((r) => {
      this.computeSectionHeaders.isScheduled() || this.computeSectionHeaders.schedule(1e3);
    })), this.computeSectionHeaders = this._register(new mr(() => {
      this.findSectionHeaders();
    }, 250)), this.computeSectionHeaders.schedule(0);
  }
  createOptions(e) {
    if (!e || !this.editor.hasModel())
      return;
    const t = this.editor.getModel().getLanguageId();
    if (!t)
      return;
    const n = this.languageConfigurationService.getLanguageConfiguration(t).comments, r = this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;
    if (!(!n && !(r != null && r.markers)))
      return {
        foldingRules: r,
        markSectionHeaderRegex: e.markSectionHeaderRegex,
        findMarkSectionHeaders: e.showMarkSectionHeaders,
        findRegionSectionHeaders: e.showRegionSectionHeaders
      };
  }
  findSectionHeaders() {
    var n, r;
    if (!this.editor.hasModel() || !((n = this.options) != null && n.findMarkSectionHeaders) && !((r = this.options) != null && r.findRegionSectionHeaders))
      return;
    const e = this.editor.getModel();
    if (e.isDisposed() || e.isTooLargeForSyncing())
      return;
    const t = e.getVersionId();
    this.editorWorkerService.findSectionHeaders(e.uri, this.options).then((s) => {
      e.isDisposed() || e.getVersionId() !== t || this.updateDecorations(s);
    });
  }
  updateDecorations(e) {
    const t = this.editor.getModel();
    t && (e = e.filter((s) => {
      if (!s.shouldBeInComments)
        return !0;
      const o = t.validateRange(s.range), a = t.tokenization.getLineTokens(o.startLineNumber), l = a.findTokenIndexAtOffset(o.startColumn - 1), c = a.getStandardTokenType(l);
      return a.getLanguageId(l) === t.getLanguageId() && c === 1;
    }));
    const n = Object.values(this.currentOccurrences).map((s) => s.decorationId), r = e.map((s) => RNt(s));
    this.editor.changeDecorations((s) => {
      const o = s.deltaDecorations(n, r);
      this.currentOccurrences = {};
      for (let a = 0, l = o.length; a < l; a++) {
        const c = { sectionHeader: e[a], decorationId: o[a] };
        this.currentOccurrences[c.decorationId] = c;
      }
    });
  }
  stop() {
    this.computeSectionHeaders.cancel(), this.computePromise && (this.computePromise.cancel(), this.computePromise = null);
  }
  dispose() {
    super.dispose(), this.stop(), this.decorations.clear();
  }
}, IR.ID = "editor.sectionHeaderDetector", IR);
o$ = NNt([
  gNe(1, Ls),
  gNe(2, sd)
], o$);
function RNt(i) {
  return {
    range: i.range,
    options: dn.createDynamic({
      description: "section-header",
      stickiness: 3,
      collapseOnReplaceEdit: !0,
      minimap: {
        color: void 0,
        position: 1,
        sectionHeaderStyle: i.hasSeparatorLine ? 2 : 1,
        sectionHeaderText: i.text
      }
    })
  };
}
Si(
  o$.ID,
  o$,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
class ANt {
  constructor(e = 5) {
    this.timesPerSecond = e, this._lastRun = 0, this._minimumTimeBetweenRuns = 1e3 / e;
  }
  runIfNotLimited(e) {
    const t = Date.now();
    t - this._lastRun >= this._minimumTimeBetweenRuns && (this._lastRun = t, e());
  }
}
class s3 {
  static create(e, t) {
    return new s3(e, new fle(t));
  }
  /**
   * (Inclusive) start line number for these tokens.
   */
  get startLineNumber() {
    return this._startLineNumber;
  }
  /**
   * (Inclusive) end line number for these tokens.
   */
  get endLineNumber() {
    return this._endLineNumber;
  }
  constructor(e, t) {
    this._startLineNumber = e, this._tokens = t, this._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();
  }
  toString() {
    return this._tokens.toString(this._startLineNumber);
  }
  _updateEndLineNumber() {
    this._endLineNumber = this._startLineNumber + this._tokens.getMaxDeltaLine();
  }
  isEmpty() {
    return this._tokens.isEmpty();
  }
  getLineTokens(e) {
    return this._startLineNumber <= e && e <= this._endLineNumber ? this._tokens.getLineTokens(e - this._startLineNumber) : null;
  }
  getRange() {
    const e = this._tokens.getRange();
    return e && new z(this._startLineNumber + e.startLineNumber, e.startColumn, this._startLineNumber + e.endLineNumber, e.endColumn);
  }
  removeTokens(e) {
    const t = e.startLineNumber - this._startLineNumber, n = e.endLineNumber - this._startLineNumber;
    this._startLineNumber += this._tokens.removeTokens(t, e.startColumn - 1, n, e.endColumn - 1), this._updateEndLineNumber();
  }
  split(e) {
    const t = e.startLineNumber - this._startLineNumber, n = e.endLineNumber - this._startLineNumber, [r, s, o] = this._tokens.split(t, e.startColumn - 1, n, e.endColumn - 1);
    return [new s3(this._startLineNumber, r), new s3(this._startLineNumber + o, s)];
  }
  applyEdit(e, t) {
    const [n, r, s] = lw(t);
    this.acceptEdit(
      e,
      n,
      r,
      s,
      t.length > 0 ? t.charCodeAt(0) : 0
      /* CharCode.Null */
    );
  }
  acceptEdit(e, t, n, r, s) {
    this._acceptDeleteRange(e), this._acceptInsertText(new de(e.startLineNumber, e.startColumn), t, n, r, s), this._updateEndLineNumber();
  }
  _acceptDeleteRange(e) {
    if (e.startLineNumber === e.endLineNumber && e.startColumn === e.endColumn)
      return;
    const t = e.startLineNumber - this._startLineNumber, n = e.endLineNumber - this._startLineNumber;
    if (n < 0) {
      const s = n - t;
      this._startLineNumber -= s;
      return;
    }
    const r = this._tokens.getMaxDeltaLine();
    if (!(t >= r + 1)) {
      if (t < 0 && n >= r + 1) {
        this._startLineNumber = 0, this._tokens.clear();
        return;
      }
      if (t < 0) {
        const s = -t;
        this._startLineNumber -= s, this._tokens.acceptDeleteRange(e.startColumn - 1, 0, 0, n, e.endColumn - 1);
      } else
        this._tokens.acceptDeleteRange(0, t, e.startColumn - 1, n, e.endColumn - 1);
    }
  }
  _acceptInsertText(e, t, n, r, s) {
    if (t === 0 && n === 0)
      return;
    const o = e.lineNumber - this._startLineNumber;
    if (o < 0) {
      this._startLineNumber += t;
      return;
    }
    const a = this._tokens.getMaxDeltaLine();
    o >= a + 1 || this._tokens.acceptInsertText(o, e.column - 1, t, n, r, s);
  }
  reportIfInvalid(e) {
    this._tokens.reportIfInvalid(e, this._startLineNumber);
  }
}
const KC = class KC {
  constructor(e) {
    this._tokens = e, this._tokenCount = e.length / 4;
  }
  toString(e) {
    const t = [];
    for (let n = 0; n < this._tokenCount; n++)
      t.push(`(${this._getDeltaLine(n) + e},${this._getStartCharacter(n)}-${this._getEndCharacter(n)})`);
    return `[${t.join(",")}]`;
  }
  getMaxDeltaLine() {
    const e = this._getTokenCount();
    return e === 0 ? -1 : this._getDeltaLine(e - 1);
  }
  getRange() {
    const e = this._getTokenCount();
    if (e === 0)
      return null;
    const t = this._getStartCharacter(0), n = this._getDeltaLine(e - 1), r = this._getEndCharacter(e - 1);
    return new z(0, t + 1, n, r + 1);
  }
  _getTokenCount() {
    return this._tokenCount;
  }
  _getDeltaLine(e) {
    return this._tokens[4 * e];
  }
  _getStartCharacter(e) {
    return this._tokens[4 * e + 1];
  }
  _getEndCharacter(e) {
    return this._tokens[4 * e + 2];
  }
  isEmpty() {
    return this._getTokenCount() === 0;
  }
  getLineTokens(e) {
    let t = 0, n = this._getTokenCount() - 1;
    for (; t < n; ) {
      const r = t + Math.floor((n - t) / 2), s = this._getDeltaLine(r);
      if (s < e)
        t = r + 1;
      else if (s > e)
        n = r - 1;
      else {
        let o = r;
        for (; o > t && this._getDeltaLine(o - 1) === e; )
          o--;
        let a = r;
        for (; a < n && this._getDeltaLine(a + 1) === e; )
          a++;
        return new pNe(this._tokens.subarray(4 * o, 4 * a + 4));
      }
    }
    return this._getDeltaLine(t) === e ? new pNe(this._tokens.subarray(4 * t, 4 * t + 4)) : null;
  }
  clear() {
    this._tokenCount = 0;
  }
  removeTokens(e, t, n, r) {
    const s = this._tokens, o = this._tokenCount;
    let a = 0, l = !1, c = 0;
    for (let u = 0; u < o; u++) {
      const d = 4 * u, h = s[d], g = s[d + 1], m = s[d + 2], _ = s[d + 3];
      if ((h > e || h === e && m >= t) && (h < n || h === n && g <= r))
        l = !0;
      else {
        if (a === 0 && (c = h), l) {
          const v = 4 * a;
          s[v] = h - c, s[v + 1] = g, s[v + 2] = m, s[v + 3] = _;
        }
        a++;
      }
    }
    return this._tokenCount = a, c;
  }
  split(e, t, n, r) {
    const s = this._tokens, o = this._tokenCount, a = [], l = [];
    let c = a, u = 0, d = 0;
    for (let h = 0; h < o; h++) {
      const g = 4 * h, m = s[g], _ = s[g + 1], v = s[g + 2], w = s[g + 3];
      if (m > e || m === e && v >= t) {
        if (m < n || m === n && _ <= r)
          continue;
        c !== l && (c = l, u = 0, d = m);
      }
      c[u++] = m - d, c[u++] = _, c[u++] = v, c[u++] = w;
    }
    return [new KC(new Uint32Array(a)), new KC(new Uint32Array(l)), d];
  }
  acceptDeleteRange(e, t, n, r, s) {
    const o = this._tokens, a = this._tokenCount, l = r - t;
    let c = 0, u = !1;
    for (let d = 0; d < a; d++) {
      const h = 4 * d;
      let g = o[h], m = o[h + 1], _ = o[h + 2];
      const v = o[h + 3];
      if (g < t || g === t && _ <= n) {
        c++;
        continue;
      } else if (g === t && m < n)
        g === r && _ > s ? _ -= s - n : _ = n;
      else if (g === t && m === n)
        if (g === r && _ > s)
          _ -= s - n;
        else {
          u = !0;
          continue;
        }
      else if (g < r || g === r && m < s)
        if (g === r && _ > s)
          g = t, m = n, _ = m + (_ - s);
        else {
          u = !0;
          continue;
        }
      else if (g > r) {
        if (l === 0 && !u) {
          c = a;
          break;
        }
        g -= l;
      } else if (g === r && m >= s)
        e && g === 0 && (m += e, _ += e), g -= l, m -= s - n, _ -= s - n;
      else
        throw new Error("Not possible!");
      const w = 4 * c;
      o[w] = g, o[w + 1] = m, o[w + 2] = _, o[w + 3] = v, c++;
    }
    this._tokenCount = c;
  }
  acceptInsertText(e, t, n, r, s, o) {
    const a = n === 0 && r === 1 && (o >= 48 && o <= 57 || o >= 65 && o <= 90 || o >= 97 && o <= 122), l = this._tokens, c = this._tokenCount;
    for (let u = 0; u < c; u++) {
      const d = 4 * u;
      let h = l[d], g = l[d + 1], m = l[d + 2];
      if (!(h < e || h === e && m < t)) {
        if (h === e && m === t)
          if (a)
            m += 1;
          else
            continue;
        else if (h === e && g < t && t < m)
          n === 0 ? m += r : m = t;
        else {
          if (h === e && g === t && a)
            continue;
          if (h === e)
            if (h += n, n === 0)
              g += r, m += r;
            else {
              const _ = m - g;
              g = s + (g - t), m = g + _;
            }
          else
            h += n;
        }
        l[d] = h, l[d + 1] = g, l[d + 2] = m;
      }
    }
  }
  // limit to 10 times per minute
  reportIfInvalid(e, t) {
    for (let n = 0; n < this._tokenCount; n++) {
      const r = this._getDeltaLine(n) + t;
      r < 1 ? KC._rateLimiter.runIfNotLimited(() => {
        console.error("Invalid Semantic Tokens Data From Extension: lineNumber < 1");
      }) : r > e.getLineCount() ? KC._rateLimiter.runIfNotLimited(() => {
        console.error("Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()");
      }) : this._getEndCharacter(n) > e.getLineLength(r) && KC._rateLimiter.runIfNotLimited(() => {
        console.error("Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)");
      });
    }
  }
};
KC._rateLimiter = new ANt(10 / 60);
let fle = KC;
class pNe {
  constructor(e) {
    this._tokens = e;
  }
  getCount() {
    return this._tokens.length / 4;
  }
  getStartCharacter(e) {
    return this._tokens[4 * e + 1];
  }
  getEndCharacter(e) {
    return this._tokens[4 * e + 2];
  }
  getMetadata(e) {
    return this._tokens[4 * e + 3];
  }
}
var ONt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Dte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let gle = class {
  constructor(e, t, n, r) {
    this._legend = e, this._themeService = t, this._languageService = n, this._logService = r, this._hasWarnedOverlappingTokens = !1, this._hasWarnedInvalidLengthTokens = !1, this._hasWarnedInvalidEditStart = !1, this._hashTable = new ple();
  }
  getMetadata(e, t, n) {
    const r = this._languageService.languageIdCodec.encodeLanguageId(n), s = this._hashTable.get(e, t, r);
    let o;
    if (s)
      o = s.metadata;
    else {
      let a = this._legend.tokenTypes[e];
      const l = [];
      if (a) {
        let c = t;
        for (let d = 0; c > 0 && d < this._legend.tokenModifiers.length; d++)
          c & 1 && l.push(this._legend.tokenModifiers[d]), c = c >> 1;
        const u = this._themeService.getColorTheme().getTokenStyleMetadata(a, l, n);
        if (typeof u > "u")
          o = 2147483647;
        else {
          if (o = 0, typeof u.italic < "u") {
            const d = (u.italic ? 1 : 0) << 11;
            o |= d | 1;
          }
          if (typeof u.bold < "u") {
            const d = (u.bold ? 2 : 0) << 11;
            o |= d | 2;
          }
          if (typeof u.underline < "u") {
            const d = (u.underline ? 4 : 0) << 11;
            o |= d | 4;
          }
          if (typeof u.strikethrough < "u") {
            const d = (u.strikethrough ? 8 : 0) << 11;
            o |= d | 8;
          }
          if (u.foreground) {
            const d = u.foreground << 15;
            o |= d | 16;
          }
          o === 0 && (o = 2147483647);
        }
      } else
        o = 2147483647, a = "not-in-legend";
      this._hashTable.add(e, t, r, o);
    }
    return o;
  }
  warnOverlappingSemanticTokens(e, t) {
    this._hasWarnedOverlappingTokens || (this._hasWarnedOverlappingTokens = !0, this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`));
  }
  warnInvalidLengthSemanticTokens(e, t) {
    this._hasWarnedInvalidLengthTokens || (this._hasWarnedInvalidLengthTokens = !0, this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`));
  }
  warnInvalidEditStart(e, t, n, r, s) {
    this._hasWarnedInvalidEditStart || (this._hasWarnedInvalidEditStart = !0, this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${n}: The provided start offset ${r} is outside the previous data (length ${s}).`));
  }
};
gle = ONt([
  Dte(1, to),
  Dte(2, Gr),
  Dte(3, $r)
], gle);
function O8e(i, e, t) {
  const n = i.data, r = i.data.length / 5 | 0, s = Math.max(
    Math.ceil(
      r / 1024
      /* SemanticColoringConstants.DesiredMaxAreas */
    ),
    400
    /* SemanticColoringConstants.DesiredTokensPerArea */
  ), o = [];
  let a = 0, l = 1, c = 0;
  for (; a < r; ) {
    const u = a;
    let d = Math.min(u + s, r);
    if (d < r) {
      let E = d;
      for (; E - 1 > u && n[5 * E] === 0; )
        E--;
      if (E - 1 === u) {
        let L = d;
        for (; L + 1 < r && n[5 * L] === 0; )
          L++;
        d = L;
      } else
        d = E;
    }
    let h = new Uint32Array((d - u) * 4), g = 0, m = 0, _ = 0, v = 0;
    for (; a < d; ) {
      const E = 5 * a, L = n[E], T = n[E + 1], D = l + L | 0, N = L === 0 ? c + T | 0 : T, R = n[E + 2], M = N + R | 0, B = n[E + 3], H = n[E + 4];
      if (M <= N)
        e.warnInvalidLengthSemanticTokens(D, N + 1);
      else if (_ === D && v > N)
        e.warnOverlappingSemanticTokens(D, N + 1);
      else {
        const j = e.getMetadata(B, H, t);
        j !== 2147483647 && (m === 0 && (m = D), h[g] = D - m, h[g + 1] = N, h[g + 2] = M, h[g + 3] = j, g += 4, _ = D, v = M);
      }
      l = D, c = N, a++;
    }
    g !== h.length && (h = h.subarray(0, g));
    const w = s3.create(m, h);
    o.push(w);
  }
  return o;
}
class MNt {
  constructor(e, t, n, r) {
    this.tokenTypeIndex = e, this.tokenModifierSet = t, this.languageId = n, this.metadata = r, this.next = null;
  }
}
const ry = class ry {
  constructor() {
    this._elementsCount = 0, this._currentLengthIndex = 0, this._currentLength = ry._SIZES[this._currentLengthIndex], this._growCount = Math.round(this._currentLengthIndex + 1 < ry._SIZES.length ? 2 / 3 * this._currentLength : 0), this._elements = [], ry._nullOutEntries(this._elements, this._currentLength);
  }
  static _nullOutEntries(e, t) {
    for (let n = 0; n < t; n++)
      e[n] = null;
  }
  _hash2(e, t) {
    return (e << 5) - e + t | 0;
  }
  _hashFunc(e, t, n) {
    return this._hash2(this._hash2(e, t), n) % this._currentLength;
  }
  get(e, t, n) {
    const r = this._hashFunc(e, t, n);
    let s = this._elements[r];
    for (; s; ) {
      if (s.tokenTypeIndex === e && s.tokenModifierSet === t && s.languageId === n)
        return s;
      s = s.next;
    }
    return null;
  }
  add(e, t, n, r) {
    if (this._elementsCount++, this._growCount !== 0 && this._elementsCount >= this._growCount) {
      const s = this._elements;
      this._currentLengthIndex++, this._currentLength = ry._SIZES[this._currentLengthIndex], this._growCount = Math.round(this._currentLengthIndex + 1 < ry._SIZES.length ? 2 / 3 * this._currentLength : 0), this._elements = [], ry._nullOutEntries(this._elements, this._currentLength);
      for (const o of s) {
        let a = o;
        for (; a; ) {
          const l = a.next;
          a.next = null, this._add(a), a = l;
        }
      }
    }
    this._add(new MNt(e, t, n, r));
  }
  _add(e) {
    const t = this._hashFunc(e.tokenTypeIndex, e.tokenModifierSet, e.languageId);
    e.next = this._elements[t], this._elements[t] = e;
  }
};
ry._SIZES = [3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143];
let ple = ry;
const zK = Vn("semanticTokensStylingService");
function PNt(i) {
  for (let e = 0, t = i.length; e < t; e += 4) {
    const n = i[e + 0], r = i[e + 1], s = i[e + 2], o = i[e + 3];
    i[e + 0] = o, i[e + 1] = s, i[e + 2] = r, i[e + 3] = n;
  }
}
function FNt(i) {
  const e = new Uint8Array(i.buffer, i.byteOffset, i.length * 4);
  return FMe() || PNt(e), x1.wrap(e);
}
function M8e(i) {
  const e = new Uint32Array(BNt(i));
  let t = 0;
  if (e[t++] = i.id, i.type === "full")
    e[t++] = 1, e[t++] = i.data.length, e.set(i.data, t), t += i.data.length;
  else {
    e[t++] = 2, e[t++] = i.deltas.length;
    for (const n of i.deltas)
      e[t++] = n.start, e[t++] = n.deleteCount, n.data ? (e[t++] = n.data.length, e.set(n.data, t), t += n.data.length) : e[t++] = 0;
  }
  return FNt(e);
}
function BNt(i) {
  let e = 0;
  if (e += 2, i.type === "full")
    e += 1 + i.data.length;
  else {
    e += 1, e += 3 * i.deltas.length;
    for (const t of i.deltas)
      t.data && (e += t.data.length);
  }
  return e;
}
function $K(i) {
  return i && !!i.data;
}
function P8e(i) {
  return i && Array.isArray(i.edits);
}
class HNt {
  constructor(e, t, n) {
    this.provider = e, this.tokens = t, this.error = n;
  }
}
function F8e(i, e) {
  return i.has(e);
}
function WNt(i, e) {
  const t = i.orderedGroups(e);
  return t.length > 0 ? t[0] : [];
}
async function B8e(i, e, t, n, r) {
  const s = WNt(i, e), o = await Promise.all(s.map(async (a) => {
    let l, c = null;
    try {
      l = await a.provideDocumentSemanticTokens(e, a === t ? n : null, r);
    } catch (u) {
      c = u, l = null;
    }
    return (!l || !$K(l) && !P8e(l)) && (l = null), new HNt(a, l, c);
  }));
  for (const a of o) {
    if (a.error)
      throw a.error;
    if (a.tokens)
      return a;
  }
  return o.length > 0 ? o[0] : null;
}
function VNt(i, e) {
  const t = i.orderedGroups(e);
  return t.length > 0 ? t[0] : null;
}
class UNt {
  constructor(e, t) {
    this.provider = e, this.tokens = t;
  }
}
function zNt(i, e) {
  return i.has(e);
}
function H8e(i, e) {
  const t = i.orderedGroups(e);
  return t.length > 0 ? t[0] : [];
}
async function Ype(i, e, t, n) {
  const r = H8e(i, e), s = await Promise.all(r.map(async (o) => {
    let a;
    try {
      a = await o.provideDocumentRangeSemanticTokens(e, t, n);
    } catch (l) {
      No(l), a = null;
    }
    return (!a || !$K(a)) && (a = null), new UNt(o, a);
  }));
  for (const o of s)
    if (o.tokens)
      return o;
  return s.length > 0 ? s[0] : null;
}
_i.registerCommand("_provideDocumentSemanticTokensLegend", async (i, ...e) => {
  const [t] = e;
  Ii(t instanceof Ht);
  const n = i.get(xs).getModel(t);
  if (!n)
    return;
  const { documentSemanticTokensProvider: r } = i.get(St), s = VNt(r, n);
  return s ? s[0].getLegend() : i.get(jr).executeCommand("_provideDocumentRangeSemanticTokensLegend", t);
});
_i.registerCommand("_provideDocumentSemanticTokens", async (i, ...e) => {
  const [t] = e;
  Ii(t instanceof Ht);
  const n = i.get(xs).getModel(t);
  if (!n)
    return;
  const { documentSemanticTokensProvider: r } = i.get(St);
  if (!F8e(r, n))
    return i.get(jr).executeCommand("_provideDocumentRangeSemanticTokens", t, n.getFullModelRange());
  const s = await B8e(r, n, null, null, $n.None);
  if (!s)
    return;
  const { provider: o, tokens: a } = s;
  if (!a || !$K(a))
    return;
  const l = M8e({
    id: 0,
    type: "full",
    data: a.data
  });
  return a.resultId && o.releaseDocumentSemanticTokens(a.resultId), l;
});
_i.registerCommand("_provideDocumentRangeSemanticTokensLegend", async (i, ...e) => {
  const [t, n] = e;
  Ii(t instanceof Ht);
  const r = i.get(xs).getModel(t);
  if (!r)
    return;
  const { documentRangeSemanticTokensProvider: s } = i.get(St), o = H8e(s, r);
  if (o.length === 0)
    return;
  if (o.length === 1)
    return o[0].getLegend();
  if (!n || !z.isIRange(n))
    return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"), o[0].getLegend();
  const a = await Ype(s, r, z.lift(n), $n.None);
  if (a)
    return a.provider.getLegend();
});
_i.registerCommand("_provideDocumentRangeSemanticTokens", async (i, ...e) => {
  const [t, n] = e;
  Ii(t instanceof Ht), Ii(z.isIRange(n));
  const r = i.get(xs).getModel(t);
  if (!r)
    return;
  const { documentRangeSemanticTokensProvider: s } = i.get(St), o = await Ype(s, r, z.lift(n), $n.None);
  if (!(!o || !o.tokens))
    return M8e({
      id: 0,
      type: "full",
      data: o.tokens.data
    });
});
const Xpe = "editor.semanticHighlighting";
function YW(i, e, t) {
  var r;
  const n = (r = t.getValue(Xpe, { overrideIdentifier: i.getLanguageId(), resource: i.uri })) == null ? void 0 : r.enabled;
  return typeof n == "boolean" ? n : e.getColorTheme().semanticHighlighting;
}
var W8e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, z_ = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, MC;
let mle = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._watchers = new Co();
    const a = (u) => {
      var d;
      (d = this._watchers.get(u.uri)) == null || d.dispose(), this._watchers.set(u.uri, new _le(u, e, n, s, o));
    }, l = (u, d) => {
      d.dispose(), this._watchers.delete(u.uri);
    }, c = () => {
      for (const u of t.getModels()) {
        const d = this._watchers.get(u.uri);
        YW(u, n, r) ? d || a(u) : d && l(u, d);
      }
    };
    t.getModels().forEach((u) => {
      YW(u, n, r) && a(u);
    }), this._register(t.onModelAdded((u) => {
      YW(u, n, r) && a(u);
    })), this._register(t.onModelRemoved((u) => {
      const d = this._watchers.get(u.uri);
      d && l(u, d);
    })), this._register(r.onDidChangeConfiguration((u) => {
      u.affectsConfiguration(Xpe) && c();
    })), this._register(n.onDidColorThemeChange(c));
  }
  dispose() {
    or(this._watchers.values()), this._watchers.clear(), super.dispose();
  }
};
mle = W8e([
  z_(0, zK),
  z_(1, xs),
  z_(2, to),
  z_(3, xn),
  z_(4, ig),
  z_(5, St)
], mle);
var Z1;
let _le = (Z1 = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._semanticTokensStylingService = t, this._isDisposed = !1, this._model = e, this._provider = s.documentSemanticTokensProvider, this._debounceInformation = r.for(this._provider, "DocumentSemanticTokens", { min: MC.REQUEST_MIN_DELAY, max: MC.REQUEST_MAX_DELAY }), this._fetchDocumentSemanticTokens = this._register(new mr(() => this._fetchDocumentSemanticTokensNow(), MC.REQUEST_MIN_DELAY)), this._currentDocumentResponse = null, this._currentDocumentRequestCancellationTokenSource = null, this._documentProvidersChangeListeners = [], this._providersChangedDuringRequest = !1, this._register(this._model.onDidChangeContent(() => {
      this._fetchDocumentSemanticTokens.isScheduled() || this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    })), this._register(this._model.onDidChangeAttached(() => {
      this._fetchDocumentSemanticTokens.isScheduled() || this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    })), this._register(this._model.onDidChangeLanguage(() => {
      this._currentDocumentResponse && (this._currentDocumentResponse.dispose(), this._currentDocumentResponse = null), this._currentDocumentRequestCancellationTokenSource && (this._currentDocumentRequestCancellationTokenSource.cancel(), this._currentDocumentRequestCancellationTokenSource = null), this._setDocumentSemanticTokens(null, null, null, []), this._fetchDocumentSemanticTokens.schedule(0);
    }));
    const o = () => {
      or(this._documentProvidersChangeListeners), this._documentProvidersChangeListeners = [];
      for (const a of this._provider.all(e))
        typeof a.onDidChange == "function" && this._documentProvidersChangeListeners.push(a.onDidChange(() => {
          if (this._currentDocumentRequestCancellationTokenSource) {
            this._providersChangedDuringRequest = !0;
            return;
          }
          this._fetchDocumentSemanticTokens.schedule(0);
        }));
    };
    o(), this._register(this._provider.onDidChange(() => {
      o(), this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    })), this._register(n.onDidColorThemeChange((a) => {
      this._setDocumentSemanticTokens(null, null, null, []), this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    })), this._fetchDocumentSemanticTokens.schedule(0);
  }
  dispose() {
    this._currentDocumentResponse && (this._currentDocumentResponse.dispose(), this._currentDocumentResponse = null), this._currentDocumentRequestCancellationTokenSource && (this._currentDocumentRequestCancellationTokenSource.cancel(), this._currentDocumentRequestCancellationTokenSource = null), or(this._documentProvidersChangeListeners), this._documentProvidersChangeListeners = [], this._setDocumentSemanticTokens(null, null, null, []), this._isDisposed = !0, super.dispose();
  }
  _fetchDocumentSemanticTokensNow() {
    if (this._currentDocumentRequestCancellationTokenSource)
      return;
    if (!F8e(this._provider, this._model)) {
      this._currentDocumentResponse && this._model.tokenization.setSemanticTokens(null, !1);
      return;
    }
    if (!this._model.isAttachedToEditor())
      return;
    const e = new Ss(), t = this._currentDocumentResponse ? this._currentDocumentResponse.provider : null, n = this._currentDocumentResponse && this._currentDocumentResponse.resultId || null, r = B8e(this._provider, this._model, t, n, e.token);
    this._currentDocumentRequestCancellationTokenSource = e, this._providersChangedDuringRequest = !1;
    const s = [], o = this._model.onDidChangeContent((l) => {
      s.push(l);
    }), a = new _a(!1);
    r.then((l) => {
      if (this._debounceInformation.update(this._model, a.elapsed()), this._currentDocumentRequestCancellationTokenSource = null, o.dispose(), !l)
        this._setDocumentSemanticTokens(null, null, null, s);
      else {
        const { provider: c, tokens: u } = l, d = this._semanticTokensStylingService.getStyling(c);
        this._setDocumentSemanticTokens(c, u || null, d, s);
      }
    }, (l) => {
      l && (Xh(l) || typeof l.message == "string" && l.message.indexOf("busy") !== -1) || fn(l), this._currentDocumentRequestCancellationTokenSource = null, o.dispose(), (s.length > 0 || this._providersChangedDuringRequest) && (this._fetchDocumentSemanticTokens.isScheduled() || this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)));
    });
  }
  static _copy(e, t, n, r, s) {
    s = Math.min(s, n.length - r, e.length - t);
    for (let o = 0; o < s; o++)
      n[r + o] = e[t + o];
  }
  _setDocumentSemanticTokens(e, t, n, r) {
    const s = this._currentDocumentResponse, o = () => {
      (r.length > 0 || this._providersChangedDuringRequest) && !this._fetchDocumentSemanticTokens.isScheduled() && this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model));
    };
    if (this._currentDocumentResponse && (this._currentDocumentResponse.dispose(), this._currentDocumentResponse = null), this._isDisposed) {
      e && t && e.releaseDocumentSemanticTokens(t.resultId);
      return;
    }
    if (!e || !n) {
      this._model.tokenization.setSemanticTokens(null, !1);
      return;
    }
    if (!t) {
      this._model.tokenization.setSemanticTokens(null, !0), o();
      return;
    }
    if (P8e(t)) {
      if (!s) {
        this._model.tokenization.setSemanticTokens(null, !0);
        return;
      }
      if (t.edits.length === 0)
        t = {
          resultId: t.resultId,
          data: s.data
        };
      else {
        let a = 0;
        for (const h of t.edits)
          a += (h.data ? h.data.length : 0) - h.deleteCount;
        const l = s.data, c = new Uint32Array(l.length + a);
        let u = l.length, d = c.length;
        for (let h = t.edits.length - 1; h >= 0; h--) {
          const g = t.edits[h];
          if (g.start > l.length) {
            n.warnInvalidEditStart(s.resultId, t.resultId, h, g.start, l.length), this._model.tokenization.setSemanticTokens(null, !0);
            return;
          }
          const m = u - (g.start + g.deleteCount);
          m > 0 && (MC._copy(l, u - m, c, d - m, m), d -= m), g.data && (MC._copy(g.data, 0, c, d - g.data.length, g.data.length), d -= g.data.length), u = g.start;
        }
        u > 0 && MC._copy(l, 0, c, 0, u), t = {
          resultId: t.resultId,
          data: c
        };
      }
    }
    if ($K(t)) {
      this._currentDocumentResponse = new $Nt(e, t.resultId, t.data);
      const a = O8e(t, n, this._model.getLanguageId());
      if (r.length > 0)
        for (const l of r)
          for (const c of a)
            for (const u of l.changes)
              c.applyEdit(u.range, u.text);
      this._model.tokenization.setSemanticTokens(a, !0);
    } else
      this._model.tokenization.setSemanticTokens(null, !0);
    o();
  }
}, MC = Z1, Z1.REQUEST_MIN_DELAY = 300, Z1.REQUEST_MAX_DELAY = 2e3, Z1);
_le = MC = W8e([
  z_(1, zK),
  z_(2, to),
  z_(3, ig),
  z_(4, St)
], _le);
class $Nt {
  constructor(e, t, n) {
    this.provider = e, this.resultId = t, this.data = n;
  }
  dispose() {
    this.provider.releaseDocumentSemanticTokens(this.resultId);
  }
}
u2(mle);
var jNt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, hP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, NR;
let a$ = (NR = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._semanticTokensStylingService = t, this._themeService = n, this._configurationService = r, this._editor = e, this._provider = o.documentRangeSemanticTokensProvider, this._debounceInformation = s.for(this._provider, "DocumentRangeSemanticTokens", { min: 100, max: 500 }), this._tokenizeViewport = this._register(new mr(() => this._tokenizeViewportNow(), 100)), this._outstandingRequests = [];
    const a = () => {
      this._editor.hasModel() && this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()));
    };
    this._register(this._editor.onDidScrollChange(() => {
      a();
    })), this._register(this._editor.onDidChangeModel(() => {
      this._cancelAll(), a();
    })), this._register(this._editor.onDidChangeModelContent((l) => {
      this._cancelAll(), a();
    })), this._register(this._provider.onDidChange(() => {
      this._cancelAll(), a();
    })), this._register(this._configurationService.onDidChangeConfiguration((l) => {
      l.affectsConfiguration(Xpe) && (this._cancelAll(), a());
    })), this._register(this._themeService.onDidColorThemeChange(() => {
      this._cancelAll(), a();
    })), a();
  }
  _cancelAll() {
    for (const e of this._outstandingRequests)
      e.cancel();
    this._outstandingRequests = [];
  }
  _removeOutstandingRequest(e) {
    for (let t = 0, n = this._outstandingRequests.length; t < n; t++)
      if (this._outstandingRequests[t] === e) {
        this._outstandingRequests.splice(t, 1);
        return;
      }
  }
  _tokenizeViewportNow() {
    if (!this._editor.hasModel())
      return;
    const e = this._editor.getModel();
    if (e.tokenization.hasCompleteSemanticTokens())
      return;
    if (!YW(e, this._themeService, this._configurationService)) {
      e.tokenization.hasSomeSemanticTokens() && e.tokenization.setSemanticTokens(null, !1);
      return;
    }
    if (!zNt(this._provider, e)) {
      e.tokenization.hasSomeSemanticTokens() && e.tokenization.setSemanticTokens(null, !1);
      return;
    }
    const t = this._editor.getVisibleRangesPlusViewportAboveBelow();
    this._outstandingRequests = this._outstandingRequests.concat(t.map((n) => this._requestRange(e, n)));
  }
  _requestRange(e, t) {
    const n = e.getVersionId(), r = Jo((o) => Promise.resolve(Ype(this._provider, e, t, o))), s = new _a(!1);
    return r.then((o) => {
      if (this._debounceInformation.update(e, s.elapsed()), !o || !o.tokens || e.isDisposed() || e.getVersionId() !== n)
        return;
      const { provider: a, tokens: l } = o, c = this._semanticTokensStylingService.getStyling(a);
      e.tokenization.setPartialSemanticTokens(t, O8e(l, c, e.getLanguageId()));
    }).then(() => this._removeOutstandingRequest(r), () => this._removeOutstandingRequest(r)), r;
  }
}, NR.ID = "editor.contrib.viewportSemanticTokens", NR);
a$ = jNt([
  hP(1, zK),
  hP(2, to),
  hP(3, xn),
  hP(4, ig),
  hP(5, St)
], a$);
Si(
  a$.ID,
  a$,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
class GNt {
  constructor(e = !0) {
    this.selectSubwords = e;
  }
  provideSelectionRanges(e, t) {
    const n = [];
    for (const r of t) {
      const s = [];
      n.push(s), this.selectSubwords && this._addInWordRanges(s, e, r), this._addWordRanges(s, e, r), this._addWhitespaceLine(s, e, r), s.push({ range: e.getFullModelRange() });
    }
    return n;
  }
  _addInWordRanges(e, t, n) {
    const r = t.getWordAtPosition(n);
    if (!r)
      return;
    const { word: s, startColumn: o } = r, a = n.column - o;
    let l = a, c = a, u = 0;
    for (; l >= 0; l--) {
      const d = s.charCodeAt(l);
      if (l !== a && (d === 95 || d === 45))
        break;
      if (r1(d) && H_(u))
        break;
      u = d;
    }
    for (l += 1; c < s.length; c++) {
      const d = s.charCodeAt(c);
      if (H_(d) && r1(u))
        break;
      if (d === 95 || d === 45)
        break;
      u = d;
    }
    l < c && e.push({ range: new z(n.lineNumber, o + l, n.lineNumber, o + c) });
  }
  _addWordRanges(e, t, n) {
    const r = t.getWordAtPosition(n);
    r && e.push({ range: new z(n.lineNumber, r.startColumn, n.lineNumber, r.endColumn) });
  }
  _addWhitespaceLine(e, t, n) {
    t.getLineLength(n.lineNumber) > 0 && t.getLineFirstNonWhitespaceColumn(n.lineNumber) === 0 && t.getLineLastNonWhitespaceColumn(n.lineNumber) === 0 && e.push({ range: new z(n.lineNumber, 1, n.lineNumber, t.getLineMaxColumn(n.lineNumber)) });
  }
}
var qNt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, KNt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, ble;
class Zpe {
  constructor(e, t) {
    this.index = e, this.ranges = t;
  }
  mov(e) {
    const t = this.index + (e ? 1 : -1);
    if (t < 0 || t >= this.ranges.length)
      return this;
    const n = new Zpe(t, this.ranges);
    return n.ranges[t].equalsRange(this.ranges[this.index]) ? n.mov(e) : n;
  }
}
var HL;
let E5 = (HL = class {
  static get(e) {
    return e.getContribution(ble.ID);
  }
  constructor(e, t) {
    this._editor = e, this._languageFeaturesService = t, this._ignoreSelection = !1;
  }
  dispose() {
    var e;
    (e = this._selectionListener) == null || e.dispose();
  }
  async run(e) {
    if (!this._editor.hasModel())
      return;
    const t = this._editor.getSelections(), n = this._editor.getModel();
    if (this._state || await U8e(this._languageFeaturesService.selectionRangeProvider, n, t.map((s) => s.getPosition()), this._editor.getOption(
      129
      /* EditorOption.smartSelect */
    ), $n.None).then((s) => {
      var o;
      if (!(!kc(s) || s.length !== t.length) && !(!this._editor.hasModel() || !ds(this._editor.getSelections(), t, (a, l) => a.equalsSelection(l)))) {
        for (let a = 0; a < s.length; a++)
          s[a] = s[a].filter((l) => l.containsPosition(t[a].getStartPosition()) && l.containsPosition(t[a].getEndPosition())), s[a].unshift(t[a]);
        this._state = s.map((a) => new Zpe(0, a)), (o = this._selectionListener) == null || o.dispose(), this._selectionListener = this._editor.onDidChangeCursorPosition(() => {
          var a;
          this._ignoreSelection || ((a = this._selectionListener) == null || a.dispose(), this._state = void 0);
        });
      }
    }), !this._state)
      return;
    this._state = this._state.map((s) => s.mov(e));
    const r = this._state.map((s) => bt.fromPositions(s.ranges[s.index].getStartPosition(), s.ranges[s.index].getEndPosition()));
    this._ignoreSelection = !0;
    try {
      this._editor.setSelections(r);
    } finally {
      this._ignoreSelection = !1;
    }
  }
}, ble = HL, HL.ID = "editor.contrib.smartSelectController", HL);
E5 = ble = qNt([
  KNt(1, St)
], E5);
class V8e extends vt {
  constructor(e, t) {
    super(t), this._forward = e;
  }
  async run(e, t) {
    const n = E5.get(t);
    n && await n.run(this._forward);
  }
}
class YNt extends V8e {
  constructor() {
    super(!0, {
      id: "editor.action.smartSelect.expand",
      label: Ee(1385, "Expand Selection"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 1553,
        mac: {
          primary: 3345,
          secondary: [
            1297
            /* KeyCode.RightArrow */
          ]
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "1_basic",
        title: S(1383, "&&Expand Selection"),
        order: 2
      }
    });
  }
}
_i.registerCommandAlias("editor.action.smartSelect.grow", "editor.action.smartSelect.expand");
class XNt extends V8e {
  constructor() {
    super(!1, {
      id: "editor.action.smartSelect.shrink",
      label: Ee(1386, "Shrink Selection"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 1551,
        mac: {
          primary: 3343,
          secondary: [
            1295
            /* KeyCode.LeftArrow */
          ]
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      menuOpts: {
        menuId: wt.MenubarSelectionMenu,
        group: "1_basic",
        title: S(1384, "&&Shrink Selection"),
        order: 3
      }
    });
  }
}
Si(
  E5.ID,
  E5,
  4
  /* EditorContributionInstantiation.Lazy */
);
Je(YNt);
Je(XNt);
async function U8e(i, e, t, n, r) {
  const s = i.all(e).concat(new GNt(n.selectSubwords));
  s.length === 1 && s.unshift(new Vz());
  const o = [], a = [];
  for (const l of s)
    o.push(Promise.resolve(l.provideSelectionRanges(e, t, r)).then((c) => {
      if (kc(c) && c.length === t.length)
        for (let u = 0; u < t.length; u++) {
          a[u] || (a[u] = []);
          for (const d of c[u])
            z.isIRange(d.range) && z.containsPosition(d.range, t[u]) && a[u].push(z.lift(d.range));
        }
    }, No));
  return await Promise.all(o), a.map((l) => {
    if (l.length === 0)
      return [];
    l.sort((h, g) => de.isBefore(h.getStartPosition(), g.getStartPosition()) ? 1 : de.isBefore(g.getStartPosition(), h.getStartPosition()) || de.isBefore(h.getEndPosition(), g.getEndPosition()) ? -1 : de.isBefore(g.getEndPosition(), h.getEndPosition()) ? 1 : 0);
    const c = [];
    let u;
    for (const h of l)
      (!u || z.containsRange(h, u) && !z.equalsRange(h, u)) && (c.push(h), u = h);
    if (!n.selectLeadingAndTrailingWhitespace)
      return c;
    const d = [c[0]];
    for (let h = 1; h < c.length; h++) {
      const g = c[h - 1], m = c[h];
      if (m.startLineNumber !== g.startLineNumber || m.endLineNumber !== g.endLineNumber) {
        const _ = new z(g.startLineNumber, e.getLineFirstNonWhitespaceColumn(g.startLineNumber), g.endLineNumber, e.getLineLastNonWhitespaceColumn(g.endLineNumber));
        _.containsRange(g) && !_.equalsRange(g) && m.containsRange(_) && !m.equalsRange(_) && d.push(_);
        const v = new z(g.startLineNumber, 1, g.endLineNumber, e.getLineMaxColumn(g.endLineNumber));
        v.containsRange(g) && !v.equalsRange(_) && m.containsRange(v) && !m.equalsRange(v) && d.push(v);
      }
      d.push(m);
    }
    return d;
  });
}
_i.registerCommand("_executeSelectionRangeProvider", async function(i, ...e) {
  const [t, n] = e;
  Ii(Ht.isUri(t));
  const r = i.get(St).selectionRangeProvider, s = await i.get(Ic).createModelReference(t);
  try {
    return U8e(r, s.object.textEditorModel, n, { selectLeadingAndTrailingWhitespace: !0, selectSubwords: !0 }, $n.None);
  } finally {
    s.dispose();
  }
});
const ZNt = Object.freeze({
  View: Ee(1623, "View"),
  Help: Ee(1624, "Help"),
  Test: Ee(1625, "Test"),
  File: Ee(1626, "File"),
  Preferences: Ee(1627, "Preferences"),
  Developer: Ee(1628, "Developer")
});
class QNt extends Qg {
  constructor() {
    super({
      id: "editor.action.toggleStickyScroll",
      title: {
        ...Ee(1433, "Toggle Editor Sticky Scroll"),
        mnemonicTitle: S(1429, "&&Toggle Editor Sticky Scroll")
      },
      metadata: {
        description: Ee(1434, "Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")
      },
      category: ZNt.View,
      toggled: {
        condition: Re.equals("config.editor.stickyScroll.enabled", !0),
        title: S(1430, "Sticky Scroll"),
        mnemonicTitle: S(1431, "&&Sticky Scroll")
      },
      menu: [
        { id: wt.CommandPalette },
        { id: wt.MenubarAppearanceMenu, group: "4_editor", order: 3 },
        { id: wt.StickyScrollContext }
      ]
    });
  }
  async runEditorCommand(e, t) {
    var o;
    const n = e.get(xn), r = !n.getValue("editor.stickyScroll.enabled"), s = (o = Kg.get(t)) == null ? void 0 : o.isFocused();
    n.updateValue("editor.stickyScroll.enabled", r), s && t.focus();
  }
}
const jK = 100;
class JNt extends Qg {
  constructor() {
    super({
      id: "editor.action.focusStickyScroll",
      title: {
        ...Ee(1435, "Focus Editor Sticky Scroll"),
        mnemonicTitle: S(1432, "&&Focus Editor Sticky Scroll")
      },
      precondition: Re.and(Re.has("config.editor.stickyScroll.enabled"), se.stickyScrollVisible),
      menu: [
        { id: wt.CommandPalette }
      ]
    });
  }
  runEditorCommand(e, t) {
    var n;
    (n = Kg.get(t)) == null || n.focus();
  }
}
class eRt extends Qg {
  constructor() {
    super({
      id: "editor.action.selectNextStickyScrollLine",
      title: Ee(1436, "Select the next editor sticky scroll line"),
      precondition: se.stickyScrollFocused.isEqualTo(!0),
      keybinding: {
        weight: jK,
        primary: 18
        /* KeyCode.DownArrow */
      }
    });
  }
  runEditorCommand(e, t) {
    var n;
    (n = Kg.get(t)) == null || n.focusNext();
  }
}
class tRt extends Qg {
  constructor() {
    super({
      id: "editor.action.selectPreviousStickyScrollLine",
      title: Ee(1437, "Select the previous sticky scroll line"),
      precondition: se.stickyScrollFocused.isEqualTo(!0),
      keybinding: {
        weight: jK,
        primary: 16
        /* KeyCode.UpArrow */
      }
    });
  }
  runEditorCommand(e, t) {
    var n;
    (n = Kg.get(t)) == null || n.focusPrevious();
  }
}
class nRt extends Qg {
  constructor() {
    super({
      id: "editor.action.goToFocusedStickyScrollLine",
      title: Ee(1438, "Go to the focused sticky scroll line"),
      precondition: se.stickyScrollFocused.isEqualTo(!0),
      keybinding: {
        weight: jK,
        primary: 3
        /* KeyCode.Enter */
      }
    });
  }
  runEditorCommand(e, t) {
    var n;
    (n = Kg.get(t)) == null || n.goToFocused();
  }
}
class iRt extends Qg {
  constructor() {
    super({
      id: "editor.action.selectEditor",
      title: Ee(1439, "Select Editor"),
      precondition: se.stickyScrollFocused.isEqualTo(!0),
      keybinding: {
        weight: jK,
        primary: 9
        /* KeyCode.Escape */
      }
    });
  }
  runEditorCommand(e, t) {
    var n;
    (n = Kg.get(t)) == null || n.selectEditor();
  }
}
Si(
  Kg.ID,
  Kg,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
ar(QNt);
ar(JNt);
ar(tRt);
ar(eRt);
ar(nRt);
ar(iRt);
var z8e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, rF = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class rRt {
  constructor(e, t, n, r, s, o, a) {
    this.range = e, this.insertText = t, this.filterText = n, this.additionalTextEdits = r, this.command = s, this.action = o, this.completion = a;
  }
}
let vle = class extends Htt {
  constructor(e, t, n, r, s, o) {
    super(s.disposable), this.model = e, this.line = t, this.word = n, this.completionModel = r, this._suggestMemoryService = o;
  }
  canBeReused(e, t, n) {
    return this.model === e && this.line === t && this.word.word.length > 0 && this.word.startColumn === n.startColumn && this.word.endColumn < n.endColumn && this.completionModel.getIncompleteProvider().size === 0;
  }
  get items() {
    const e = [], { items: t } = this.completionModel, n = this._suggestMemoryService.select(this.model, { lineNumber: this.line, column: this.word.endColumn + this.completionModel.lineContext.characterCountDelta }, t), r = gi.slice(t, n), s = gi.slice(t, 0, n);
    let o = 5;
    for (const a of gi.concat(r, s)) {
      if (a.score === $g.Default)
        continue;
      const l = new z(
        a.editStart.lineNumber,
        a.editStart.column,
        a.editInsertEnd.lineNumber,
        a.editInsertEnd.column + this.completionModel.lineContext.characterCountDelta
        // end PLUS character delta
      ), c = a.completion.insertTextRules && a.completion.insertTextRules & 4 ? { snippet: a.completion.insertText } : a.completion.insertText;
      e.push(new rRt(l, c, a.filterTextLow ?? a.labelLow, a.completion.additionalTextEdits, a.completion.command, a.completion.action, a)), o-- >= 0 && a.resolve($n.None);
    }
    return e;
  }
};
vle = z8e([
  rF(5, BK)
], vle);
let yle = class extends ge {
  constructor(e, t, n, r) {
    super(), this._languageFeatureService = e, this._clipboardService = t, this._suggestMemoryService = n, this._editorService = r, this._store.add(e.inlineCompletionsProvider.register("*", this));
  }
  async provideInlineCompletions(e, t, n, r) {
    var g;
    if (n.selectedSuggestionInfo)
      return;
    let s;
    for (const m of this._editorService.listCodeEditors())
      if (m.getModel() === e) {
        s = m;
        break;
      }
    if (!s)
      return;
    const o = s.getOption(
      102
      /* EditorOption.quickSuggestions */
    );
    if (mN.isAllOff(o))
      return;
    e.tokenization.tokenizeIfCheap(t.lineNumber);
    const a = e.tokenization.getLineTokens(t.lineNumber), l = a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column - 1 - 1, 0)));
    if (mN.valueFor(o, l) !== "inline")
      return;
    let c = e.getWordAtPosition(t), u;
    if (c != null && c.word || (u = this._getTriggerCharacterInfo(e, t)), !(c != null && c.word) && !u || (c || (c = e.getWordUntilPosition(t)), c.endColumn !== t.column))
      return;
    let d;
    const h = e.getValueInRange(new z(t.lineNumber, 1, t.lineNumber, t.column));
    if (!u && ((g = this._lastResult) != null && g.canBeReused(e, t.lineNumber, c))) {
      const m = new PIe(h, t.column - this._lastResult.word.endColumn);
      this._lastResult.completionModel.lineContext = m, this._lastResult.acquire(), d = this._lastResult;
    } else {
      const m = await Ape(this._languageFeatureService.completionProvider, e, t, new d5(void 0, zz.createSuggestFilter(s).itemKind, u == null ? void 0 : u.providers), u && { triggerKind: 1, triggerCharacter: u.ch }, r);
      let _;
      m.needsClipboard && (_ = await this._clipboardService.readText());
      const v = new JC(m.items, t.column, new PIe(h, 0), Uz.None, s.getOption(
        134
        /* EditorOption.suggest */
      ), s.getOption(
        128
        /* EditorOption.snippetSuggestions */
      ), { boostFullMatch: !1, firstMatchCanBeWeak: !1 }, _);
      d = new vle(e, t.lineNumber, c, v, m, this._suggestMemoryService);
    }
    return this._lastResult = d, d;
  }
  handleItemDidShow(e, t) {
    t.completion.resolve($n.None);
  }
  disposeInlineCompletions(e) {
    e.release();
  }
  _getTriggerCharacterInfo(e, t) {
    var s;
    const n = e.getValueInRange(z.fromPositions({ lineNumber: t.lineNumber, column: t.column - 1 }, t)), r = /* @__PURE__ */ new Set();
    for (const o of this._languageFeatureService.completionProvider.all(e))
      (s = o.triggerCharacters) != null && s.includes(n) && r.add(o);
    if (r.size !== 0)
      return { providers: r, ch: n };
  }
};
yle = z8e([
  rF(0, St),
  rF(1, _m),
  rF(2, BK),
  rF(3, Ti)
], yle);
u2(yle);
class sRt extends vt {
  constructor() {
    super({
      id: "editor.action.forceRetokenize",
      label: Ee(1517, "Developer: Force Retokenize"),
      precondition: void 0
    });
  }
  run(e, t) {
    if (!t.hasModel())
      return;
    const n = t.getModel();
    n.tokenization.resetTokenization();
    const r = new _a();
    n.tokenization.forceTokenization(n.getLineCount()), r.stop(), console.log(`tokenization took ${r.elapsed()}`);
  }
}
Je(sRt);
const VG = class VG extends Fa {
  constructor() {
    super({
      id: VG.ID,
      title: Ee(1515, "Toggle Tab Key Moves Focus"),
      precondition: void 0,
      keybinding: {
        primary: 2091,
        mac: {
          primary: 1323
          /* KeyCode.KeyM */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      metadata: {
        description: Ee(1516, "Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")
      },
      f1: !0
    });
  }
  run() {
    const t = !YR.getTabFocusMode();
    YR.setTabFocusMode(t), lu(t ? S(1513, "Pressing Tab will now move focus to the next focusable element") : S(1514, "Pressing Tab will now insert the tab character"));
  }
};
VG.ID = "editor.action.toggleTabFocusMode";
let Cle = VG;
ar(Cle);
class Qpe {
  static computeUnicodeHighlights(e, t, n) {
    const r = n ? n.startLineNumber : 1, s = n ? n.endLineNumber : e.getLineCount(), o = new mNe(t), a = o.getCandidateCodePoints();
    let l;
    a === "allNonBasicAscii" ? l = new RegExp("[^\\t\\n\\r\\x20-\\x7E]", "g") : l = new RegExp(`${oRt(Array.from(a))}`, "g");
    const c = new uN(null, l), u = [];
    let d = !1, h, g = 0, m = 0, _ = 0;
    e: for (let v = r, w = s; v <= w; v++) {
      const E = e.getLineContent(v), L = E.length;
      c.reset(0);
      do
        if (h = c.next(E), h) {
          let T = h.index, D = h.index + h[0].length;
          if (T > 0) {
            const B = E.charCodeAt(T - 1);
            Qo(B) && T--;
          }
          if (D + 1 < L) {
            const B = E.charCodeAt(D - 1);
            Qo(B) && D++;
          }
          const N = E.substring(T, D);
          let R = c4(T + 1, sfe, E, 0);
          R && R.endColumn <= T + 1 && (R = null);
          const M = o.shouldHighlightNonBasicASCII(N, R ? R.word : null);
          if (M !== 0) {
            if (M === 3 ? g++ : M === 2 ? m++ : M === 1 ? _++ : dB(), u.length >= 1e3) {
              d = !0;
              break e;
            }
            u.push(new z(v, T + 1, v, D + 1));
          }
        }
      while (h);
    }
    return {
      ranges: u,
      hasMore: d,
      ambiguousCharacterCount: g,
      invisibleCharacterCount: m,
      nonBasicAsciiCharacterCount: _
    };
  }
  static computeUnicodeHighlightReason(e, t) {
    const n = new mNe(t);
    switch (n.shouldHighlightNonBasicASCII(e, null)) {
      case 0:
        return null;
      case 2:
        return {
          kind: 1
          /* UnicodeHighlighterReasonKind.Invisible */
        };
      case 3: {
        const s = e.codePointAt(0), o = n.ambiguousCharacters.getPrimaryConfusable(s), a = J3.getLocales().filter((l) => !J3.getInstance(/* @__PURE__ */ new Set([...t.allowedLocales, l])).isAmbiguous(s));
        return { kind: 0, confusableWith: String.fromCodePoint(o), notAmbiguousInLocales: a };
      }
      case 1:
        return {
          kind: 2
          /* UnicodeHighlighterReasonKind.NonBasicAscii */
        };
    }
  }
}
function oRt(i, e) {
  return `[${zd(i.map((n) => String.fromCodePoint(n)).join(""))}]`;
}
class mNe {
  constructor(e) {
    this.options = e, this.allowedCodePoints = new Set(e.allowedCodePoints), this.ambiguousCharacters = J3.getInstance(new Set(e.allowedLocales));
  }
  getCandidateCodePoints() {
    if (this.options.nonBasicASCII)
      return "allNonBasicAscii";
    const e = /* @__PURE__ */ new Set();
    if (this.options.invisibleCharacters)
      for (const t of Ix.codePoints)
        _Ne(String.fromCodePoint(t)) || e.add(t);
    if (this.options.ambiguousCharacters)
      for (const t of this.ambiguousCharacters.getConfusableCodePoints())
        e.add(t);
    for (const t of this.allowedCodePoints)
      e.delete(t);
    return e;
  }
  shouldHighlightNonBasicASCII(e, t) {
    const n = e.codePointAt(0);
    if (this.allowedCodePoints.has(n))
      return 0;
    if (this.options.nonBasicASCII)
      return 1;
    let r = !1, s = !1;
    if (t)
      for (const o of t) {
        const a = o.codePointAt(0), l = _B(o);
        r = r || l, !l && !this.ambiguousCharacters.isAmbiguous(a) && !Ix.isInvisibleCharacter(a) && (s = !0);
      }
    return (
      /* Don't allow mixing weird looking characters with ASCII */
      !r && /* Is there an obviously weird looking character? */
      s ? 0 : this.options.invisibleCharacters && !_Ne(e) && Ix.isInvisibleCharacter(n) ? 2 : this.options.ambiguousCharacters && this.ambiguousCharacters.isAmbiguous(n) ? 3 : 0
    );
  }
}
function _Ne(i) {
  return i === " " || i === `
` || i === "	";
}
var aRt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, bNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let wle = class extends ge {
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    e ? (this.el.setAttribute("aria-disabled", "false"), this.el.tabIndex = 0, this.el.style.pointerEvents = "auto", this.el.style.opacity = "1", this.el.style.cursor = "pointer", this._enabled = !1) : (this.el.setAttribute("aria-disabled", "true"), this.el.tabIndex = -1, this.el.style.pointerEvents = "none", this.el.style.opacity = "0.4", this.el.style.cursor = "default", this._enabled = !0), this._enabled = e;
  }
  constructor(e, t, n = {}, r, s) {
    super(), this._link = t, this._hoverService = r, this._enabled = !0, this.el = Fe(e, Ge("a.monaco-link", {
      tabIndex: t.tabIndex ?? 0,
      href: t.href
    }, t.label)), this.hoverDelegate = n.hoverDelegate ?? rd("mouse"), this.setTooltip(t.title), this.el.setAttribute("role", "button");
    const o = this._register(new ir(this.el, "click")), a = this._register(new ir(this.el, "keypress")), l = Ze.chain(a.event, (d) => d.map((h) => new wr(h)).filter(
      (h) => h.keyCode === 3
      /* KeyCode.Enter */
    )), c = this._register(new ir(this.el, zr.Tap)).event;
    this._register(ec.addTarget(this.el));
    const u = Ze.any(o.event, l, c);
    this._register(u((d) => {
      this.enabled && (Mi.stop(d, !0), n != null && n.opener ? n.opener(this._link.href) : s.open(this._link.href, { allowCommands: !0 }));
    })), this.enabled = !0;
  }
  setTooltip(e) {
    !this.hover && e ? this.hover = this._register(this._hoverService.setupManagedHover(this.hoverDelegate, this.el, e)) : this.hover && this.hover.update(e);
  }
};
wle = aRt([
  bNe(3, od),
  bNe(4, ad)
], wle);
var $8e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, j8e = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const lRt = 26;
let Sle = class extends ge {
  constructor(e, t) {
    super(), this._editor = e, this.instantiationService = t, this.banner = this._register(this.instantiationService.createInstance(Ele));
  }
  hide() {
    this._editor.setBanner(null, 0), this.banner.clear();
  }
  show(e) {
    this.banner.show({
      ...e,
      onClose: () => {
        var t;
        this.hide(), (t = e.onClose) == null || t.call(e);
      }
    }), this._editor.setBanner(this.banner.element, lRt);
  }
};
Sle = $8e([
  j8e(1, xt)
], Sle);
let Ele = class extends ge {
  constructor(e) {
    super(), this.instantiationService = e, this.markdownRenderer = this.instantiationService.createInstance(n0, {}), this.element = Ge("div.editor-banner"), this.element.tabIndex = 0;
  }
  getAriaLabel(e) {
    if (e.ariaLabel)
      return e.ariaLabel;
    if (typeof e.message == "string")
      return e.message;
  }
  getBannerMessage(e) {
    if (typeof e == "string") {
      const t = Ge("span");
      return t.innerText = e, t;
    }
    return this.markdownRenderer.render(e).element;
  }
  clear() {
    Xa(this.element);
  }
  show(e) {
    Xa(this.element);
    const t = this.getAriaLabel(e);
    t && this.element.setAttribute("aria-label", t);
    const n = Fe(this.element, Ge("div.icon-container"));
    n.setAttribute("aria-hidden", "true"), e.icon && n.appendChild(Ge(`div${qt.asCSSSelector(e.icon)}`));
    const r = Fe(this.element, Ge("div.message-container"));
    if (r.setAttribute("aria-hidden", "true"), r.appendChild(this.getBannerMessage(e.message)), this.messageActionsContainer = Fe(this.element, Ge("div.message-actions-container")), e.actions)
      for (const o of e.actions)
        this._register(this.instantiationService.createInstance(wle, this.messageActionsContainer, { ...o, tabIndex: -1 }, {}));
    const s = Fe(this.element, Ge("div.action-container"));
    this.actionBar = this._register(new qu(s)), this.actionBar.push(this._register(new Vh("banner.close", S(1518, "Close Banner"), qt.asClassName(h5e), !0, () => {
      typeof e.onClose == "function" && e.onClose();
    })), { icon: !0, label: !1 }), this.actionBar.setFocusable(!1);
  }
};
Ele = $8e([
  j8e(0, xt)
], Ele);
const G8e = Vn("workspaceTrustManagementService");
var Jpe = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, dR = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const cRt = es("extensions-warning-message", Pe.warning, S(1519, "Icon shown with a warning message in the extensions editor."));
var RR;
let x5 = (RR = class extends ge {
  constructor(e, t, n, r) {
    super(), this._editor = e, this._editorWorkerService = t, this._workspaceTrustService = n, this._highlighter = null, this._bannerClosed = !1, this._updateState = (s) => {
      if (s && s.hasMore) {
        if (this._bannerClosed)
          return;
        const o = Math.max(s.ambiguousCharacterCount, s.nonBasicAsciiCharacterCount, s.invisibleCharacterCount);
        let a;
        if (s.nonBasicAsciiCharacterCount >= o)
          a = {
            message: S(1520, "This document contains many non-basic ASCII unicode characters"),
            command: new T5()
          };
        else if (s.ambiguousCharacterCount >= o)
          a = {
            message: S(1521, "This document contains many ambiguous unicode characters"),
            command: new NT()
          };
        else if (s.invisibleCharacterCount >= o)
          a = {
            message: S(1522, "This document contains many invisible unicode characters"),
            command: new L5()
          };
        else
          throw new Error("Unreachable");
        this._bannerController.show({
          id: "unicodeHighlightBanner",
          message: a.message,
          icon: cRt,
          actions: [
            {
              label: a.command.shortLabel,
              href: `command:${a.command.desc.id}`
            }
          ],
          onClose: () => {
            this._bannerClosed = !0;
          }
        });
      } else
        this._bannerController.hide();
    }, this._bannerController = this._register(r.createInstance(Sle, e)), this._register(this._editor.onDidChangeModel(() => {
      this._bannerClosed = !1, this._updateHighlighter();
    })), this._options = e.getOption(
      142
      /* EditorOption.unicodeHighlighting */
    ), this._register(n.onDidChangeTrust((s) => {
      this._updateHighlighter();
    })), this._register(e.onDidChangeConfiguration((s) => {
      s.hasChanged(
        142
        /* EditorOption.unicodeHighlighting */
      ) && (this._options = e.getOption(
        142
        /* EditorOption.unicodeHighlighting */
      ), this._updateHighlighter());
    })), this._updateHighlighter();
  }
  dispose() {
    this._highlighter && (this._highlighter.dispose(), this._highlighter = null), super.dispose();
  }
  _updateHighlighter() {
    if (this._updateState(null), this._highlighter && (this._highlighter.dispose(), this._highlighter = null), !this._editor.hasModel())
      return;
    const e = uRt(this._workspaceTrustService.isWorkspaceTrusted(), this._options);
    if ([
      e.nonBasicASCII,
      e.ambiguousCharacters,
      e.invisibleCharacters
    ].every((n) => n === !1))
      return;
    const t = {
      nonBasicASCII: e.nonBasicASCII,
      ambiguousCharacters: e.ambiguousCharacters,
      invisibleCharacters: e.invisibleCharacters,
      includeComments: e.includeComments,
      includeStrings: e.includeStrings,
      allowedCodePoints: Object.keys(e.allowedCharacters).map((n) => n.codePointAt(0)),
      allowedLocales: Object.keys(e.allowedLocales).map((n) => n === "_os" ? qT.NumberFormat().value.resolvedOptions().locale : n === "_vscode" ? wtt : n)
    };
    this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri) ? this._highlighter = new xle(this._editor, t, this._updateState, this._editorWorkerService) : this._highlighter = new dRt(this._editor, t, this._updateState);
  }
  getDecorationInfo(e) {
    return this._highlighter ? this._highlighter.getDecorationInfo(e) : null;
  }
}, RR.ID = "editor.contrib.unicodeHighlighter", RR);
x5 = Jpe([
  dR(1, sd),
  dR(2, G8e),
  dR(3, xt)
], x5);
function uRt(i, e) {
  return {
    nonBasicASCII: e.nonBasicASCII === xh ? !i : e.nonBasicASCII,
    ambiguousCharacters: e.ambiguousCharacters,
    invisibleCharacters: e.invisibleCharacters,
    includeComments: e.includeComments === xh ? !i : e.includeComments,
    includeStrings: e.includeStrings === xh ? !i : e.includeStrings,
    allowedCharacters: e.allowedCharacters,
    allowedLocales: e.allowedLocales
  };
}
let xle = class extends ge {
  constructor(e, t, n, r) {
    super(), this._editor = e, this._options = t, this._updateState = n, this._editorWorkerService = r, this._model = this._editor.getModel(), this._decorations = this._editor.createDecorationsCollection(), this._updateSoon = this._register(new mr(() => this._update(), 250)), this._register(this._editor.onDidChangeModelContent(() => {
      this._updateSoon.schedule();
    })), this._updateSoon.schedule();
  }
  dispose() {
    this._decorations.clear(), super.dispose();
  }
  _update() {
    if (this._model.isDisposed())
      return;
    if (!this._model.mightContainNonBasicASCII()) {
      this._decorations.clear();
      return;
    }
    const e = this._model.getVersionId();
    this._editorWorkerService.computedUnicodeHighlights(this._model.uri, this._options).then((t) => {
      if (this._model.isDisposed() || this._model.getVersionId() !== e)
        return;
      this._updateState(t);
      const n = [];
      if (!t.hasMore)
        for (const r of t.ranges)
          n.push({
            range: r,
            options: l$.instance.getDecorationFromOptions(this._options)
          });
      this._decorations.set(n);
    });
  }
  getDecorationInfo(e) {
    if (!this._decorations.has(e))
      return null;
    const t = this._editor.getModel();
    if (!Ffe(t, e))
      return null;
    const n = t.getValueInRange(e.range);
    return {
      reason: K8e(n, this._options),
      inComment: Bfe(t, e),
      inString: Hfe(t, e)
    };
  }
};
xle = Jpe([
  dR(3, sd)
], xle);
class dRt extends ge {
  constructor(e, t, n) {
    super(), this._editor = e, this._options = t, this._updateState = n, this._model = this._editor.getModel(), this._decorations = this._editor.createDecorationsCollection(), this._updateSoon = this._register(new mr(() => this._update(), 250)), this._register(this._editor.onDidLayoutChange(() => {
      this._updateSoon.schedule();
    })), this._register(this._editor.onDidScrollChange(() => {
      this._updateSoon.schedule();
    })), this._register(this._editor.onDidChangeHiddenAreas(() => {
      this._updateSoon.schedule();
    })), this._register(this._editor.onDidChangeModelContent(() => {
      this._updateSoon.schedule();
    })), this._updateSoon.schedule();
  }
  dispose() {
    this._decorations.clear(), super.dispose();
  }
  _update() {
    if (this._model.isDisposed())
      return;
    if (!this._model.mightContainNonBasicASCII()) {
      this._decorations.clear();
      return;
    }
    const e = this._editor.getVisibleRanges(), t = [], n = {
      ranges: [],
      ambiguousCharacterCount: 0,
      invisibleCharacterCount: 0,
      nonBasicAsciiCharacterCount: 0,
      hasMore: !1
    };
    for (const r of e) {
      const s = Qpe.computeUnicodeHighlights(this._model, this._options, r);
      for (const o of s.ranges)
        n.ranges.push(o);
      n.ambiguousCharacterCount += n.ambiguousCharacterCount, n.invisibleCharacterCount += n.invisibleCharacterCount, n.nonBasicAsciiCharacterCount += n.nonBasicAsciiCharacterCount, n.hasMore = n.hasMore || s.hasMore;
    }
    if (!n.hasMore)
      for (const r of n.ranges)
        t.push({ range: r, options: l$.instance.getDecorationFromOptions(this._options) });
    this._updateState(n), this._decorations.set(t);
  }
  getDecorationInfo(e) {
    if (!this._decorations.has(e))
      return null;
    const t = this._editor.getModel(), n = t.getValueInRange(e.range);
    return Ffe(t, e) ? {
      reason: K8e(n, this._options),
      inComment: Bfe(t, e),
      inString: Hfe(t, e)
    } : null;
  }
}
const q8e = S(1523, "Configure Unicode Highlight Options");
let Lle = class {
  constructor(e, t, n) {
    this._editor = e, this._languageService = t, this._openerService = n, this.hoverOrdinal = 5;
  }
  computeSync(e, t) {
    if (!this._editor.hasModel() || e.type !== 1)
      return [];
    const n = this._editor.getModel(), r = this._editor.getContribution(x5.ID);
    if (!r)
      return [];
    const s = [], o = /* @__PURE__ */ new Set();
    let a = 300;
    for (const l of t) {
      const c = r.getDecorationInfo(l);
      if (!c)
        continue;
      const d = n.getValueInRange(l.range).codePointAt(0), h = Ite(d);
      let g;
      switch (c.reason.kind) {
        case 0: {
          _B(c.reason.confusableWith) ? g = S(1524, "The character {0} could be confused with the ASCII character {1}, which is more common in source code.", h, Ite(c.reason.confusableWith.codePointAt(0))) : g = S(1525, "The character {0} could be confused with the character {1}, which is more common in source code.", h, Ite(c.reason.confusableWith.codePointAt(0)));
          break;
        }
        case 1:
          g = S(1526, "The character {0} is invisible.", h);
          break;
        case 2:
          g = S(1527, "The character {0} is not a basic ASCII character.", h);
          break;
      }
      if (o.has(g))
        continue;
      o.add(g);
      const m = {
        codePoint: d,
        reason: c.reason,
        inComment: c.inComment,
        inString: c.inString
      }, _ = S(1528, "Adjust settings"), v = D4e(c$.ID, m), w = new ql("", !0).appendMarkdown(g).appendText(" ").appendLink(v, _, q8e);
      s.push(new Wg(this, l.range, [w], !1, a++));
    }
    return s;
  }
  renderHoverParts(e, t) {
    return S1t(e, t, this._editor, this._languageService, this._openerService);
  }
};
Lle = Jpe([
  dR(1, Gr),
  dR(2, ad)
], Lle);
function Tle(i) {
  return `U+${i.toString(16).padStart(4, "0")}`;
}
function Ite(i) {
  let e = `\`${Tle(i)}\``;
  return Ix.isInvisibleCharacter(i) || (e += ` "${`${hRt(i)}`}"`), e;
}
function hRt(i) {
  return i === 96 ? "`` ` ``" : "`" + String.fromCodePoint(i) + "`";
}
function K8e(i, e) {
  return Qpe.computeUnicodeHighlightReason(i, e);
}
const UG = class UG {
  constructor() {
    this.map = /* @__PURE__ */ new Map();
  }
  getDecorationFromOptions(e) {
    return this.getDecoration(!e.includeComments, !e.includeStrings);
  }
  getDecoration(e, t) {
    const n = `${e}${t}`;
    let r = this.map.get(n);
    return r || (r = dn.createDynamic({
      description: "unicode-highlight",
      stickiness: 1,
      className: "unicode-highlight",
      showIfCollapsed: !0,
      overviewRuler: null,
      minimap: null,
      hideInCommentTokens: e,
      hideInStringTokens: t
    }), this.map.set(n, r)), r;
  }
};
UG.instance = new UG();
let l$ = UG;
class fRt extends vt {
  constructor() {
    super({
      id: NT.ID,
      label: Ee(1537, "Disable highlighting of characters in comments"),
      precondition: void 0
    }), this.shortLabel = S(1529, "Disable Highlight In Comments");
  }
  async run(e, t, n) {
    const r = e.get(xn);
    r && this.runAction(r);
  }
  async runAction(e) {
    await e.updateValue(
      zu.includeComments,
      !1,
      2
      /* ConfigurationTarget.USER */
    );
  }
}
class gRt extends vt {
  constructor() {
    super({
      id: NT.ID,
      label: Ee(1538, "Disable highlighting of characters in strings"),
      precondition: void 0
    }), this.shortLabel = S(1530, "Disable Highlight In Strings");
  }
  async run(e, t, n) {
    const r = e.get(xn);
    r && this.runAction(r);
  }
  async runAction(e) {
    await e.updateValue(
      zu.includeStrings,
      !1,
      2
      /* ConfigurationTarget.USER */
    );
  }
}
const zG = class zG extends Fa {
  constructor() {
    super({
      id: zG.ID,
      title: Ee(1539, "Disable highlighting of ambiguous characters"),
      precondition: void 0,
      f1: !1
    }), this.shortLabel = S(1531, "Disable Ambiguous Highlight");
  }
  async run(e, t, n) {
    const r = e.get(xn);
    r && this.runAction(r);
  }
  async runAction(e) {
    await e.updateValue(
      zu.ambiguousCharacters,
      !1,
      2
      /* ConfigurationTarget.USER */
    );
  }
};
zG.ID = "editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";
let NT = zG;
const $G = class $G extends Fa {
  constructor() {
    super({
      id: $G.ID,
      title: Ee(1540, "Disable highlighting of invisible characters"),
      precondition: void 0,
      f1: !1
    }), this.shortLabel = S(1532, "Disable Invisible Highlight");
  }
  async run(e, t, n) {
    const r = e.get(xn);
    r && this.runAction(r);
  }
  async runAction(e) {
    await e.updateValue(
      zu.invisibleCharacters,
      !1,
      2
      /* ConfigurationTarget.USER */
    );
  }
};
$G.ID = "editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";
let L5 = $G;
const jG = class jG extends Fa {
  constructor() {
    super({
      id: jG.ID,
      title: Ee(1541, "Disable highlighting of non basic ASCII characters"),
      precondition: void 0,
      f1: !1
    }), this.shortLabel = S(1533, "Disable Non ASCII Highlight");
  }
  async run(e, t, n) {
    const r = e.get(xn);
    r && this.runAction(r);
  }
  async runAction(e) {
    await e.updateValue(
      zu.nonBasicASCII,
      !1,
      2
      /* ConfigurationTarget.USER */
    );
  }
};
jG.ID = "editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";
let T5 = jG;
const GG = class GG extends Fa {
  constructor() {
    super({
      id: GG.ID,
      title: Ee(1542, "Show Exclude Options"),
      precondition: void 0,
      f1: !1
    });
  }
  async run(e, t) {
    const { codePoint: n, reason: r, inString: s, inComment: o } = t, a = String.fromCodePoint(n), l = e.get(tc), c = e.get(xn);
    function u(m) {
      return Ix.isInvisibleCharacter(m) ? S(1534, "Exclude {0} (invisible character) from being highlighted", Tle(m)) : S(1535, "Exclude {0} from being highlighted", `${Tle(m)} "${a}"`);
    }
    const d = [];
    if (r.kind === 0)
      for (const m of r.notAmbiguousInLocales)
        d.push({
          label: S(1536, 'Allow unicode characters that are more common in the language "{0}".', m),
          run: async () => {
            mRt(c, [m]);
          }
        });
    if (d.push({
      label: u(n),
      run: () => pRt(c, [n])
    }), o) {
      const m = new fRt();
      d.push({ label: m.label, run: async () => m.runAction(c) });
    } else if (s) {
      const m = new gRt();
      d.push({ label: m.label, run: async () => m.runAction(c) });
    }
    function h(m) {
      return typeof m.desc.title == "string" ? m.desc.title : m.desc.title.value;
    }
    if (r.kind === 0) {
      const m = new NT();
      d.push({ label: h(m), run: async () => m.runAction(c) });
    } else if (r.kind === 1) {
      const m = new L5();
      d.push({ label: h(m), run: async () => m.runAction(c) });
    } else if (r.kind === 2) {
      const m = new T5();
      d.push({ label: h(m), run: async () => m.runAction(c) });
    } else
      _Rt(r);
    const g = await l.pick(d, { title: q8e });
    g && await g.run();
  }
};
GG.ID = "editor.action.unicodeHighlight.showExcludeOptions";
let c$ = GG;
async function pRt(i, e) {
  const t = i.getValue(zu.allowedCharacters);
  let n;
  typeof t == "object" && t ? n = t : n = {};
  for (const r of e)
    n[String.fromCodePoint(r)] = !0;
  await i.updateValue(
    zu.allowedCharacters,
    n,
    2
    /* ConfigurationTarget.USER */
  );
}
async function mRt(i, e) {
  var r;
  const t = (r = i.inspect(zu.allowedLocales).user) == null ? void 0 : r.value;
  let n;
  typeof t == "object" && t ? n = Object.assign({}, t) : n = {};
  for (const s of e)
    n[s] = !0;
  await i.updateValue(
    zu.allowedLocales,
    n,
    2
    /* ConfigurationTarget.USER */
  );
}
function _Rt(i) {
  throw new Error(`Unexpected value: ${i}`);
}
ar(NT);
ar(L5);
ar(T5);
ar(c$);
Si(
  x5.ID,
  x5,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
nk.register(Lle);
const XB = Vn("dialogService");
var bRt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, vNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const Y8e = "ignoreUnusualLineTerminators";
function vRt(i, e, t) {
  i.setModelProperty(e.uri, Y8e, t);
}
function yRt(i, e) {
  return i.getModelProperty(e.uri, Y8e);
}
var AR;
let u$ = (AR = class extends ge {
  constructor(e, t, n) {
    super(), this._editor = e, this._dialogService = t, this._codeEditorService = n, this._isPresentingDialog = !1, this._config = this._editor.getOption(
      143
      /* EditorOption.unusualLineTerminators */
    ), this._register(this._editor.onDidChangeConfiguration((r) => {
      r.hasChanged(
        143
        /* EditorOption.unusualLineTerminators */
      ) && (this._config = this._editor.getOption(
        143
        /* EditorOption.unusualLineTerminators */
      ), this._checkForUnusualLineTerminators());
    })), this._register(this._editor.onDidChangeModel(() => {
      this._checkForUnusualLineTerminators();
    })), this._register(this._editor.onDidChangeModelContent((r) => {
      r.isUndoing || this._checkForUnusualLineTerminators();
    })), this._checkForUnusualLineTerminators();
  }
  async _checkForUnusualLineTerminators() {
    if (this._config === "off" || !this._editor.hasModel())
      return;
    const e = this._editor.getModel();
    if (!e.mightContainUnusualLineTerminators() || yRt(this._codeEditorService, e) === !0 || this._editor.getOption(
      104
      /* EditorOption.readOnly */
    ))
      return;
    if (this._config === "auto") {
      e.removeUnusualLineTerminators(this._editor.getSelections());
      return;
    }
    if (this._isPresentingDialog)
      return;
    let n;
    try {
      this._isPresentingDialog = !0, n = await this._dialogService.confirm({
        title: S(1543, "Unusual Line Terminators"),
        message: S(1544, "Detected unusual line terminators"),
        detail: S(1545, "The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.", Kf(e.uri)),
        primaryButton: S(1546, "&&Remove Unusual Line Terminators"),
        cancelButton: S(1547, "Ignore")
      });
    } finally {
      this._isPresentingDialog = !1;
    }
    if (!n.confirmed) {
      vRt(this._codeEditorService, e, !0);
      return;
    }
    e.removeUnusualLineTerminators(this._editor.getSelections());
  }
}, AR.ID = "editor.contrib.unusualLineTerminatorsDetector", AR);
u$ = bRt([
  vNe(1, XB),
  vNe(2, Ti)
], u$);
Si(
  u$.ID,
  u$,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
const FH = "**", yNe = "/", XW = "[/\\\\]", ZW = "[^/\\\\]", CRt = /\//g;
function CNe(i, e) {
  switch (i) {
    case 0:
      return "";
    case 1:
      return `${ZW}*?`;
    // 1 star matches any number of characters except path separator (/ and \) - non greedy (?)
    default:
      return `(?:${XW}|${ZW}+${XW}${e ? `|${XW}${ZW}+` : ""})*?`;
  }
}
function wNe(i, e) {
  if (!i)
    return [];
  const t = [];
  let n = !1, r = !1, s = "";
  for (const o of i) {
    switch (o) {
      case e:
        if (!n && !r) {
          t.push(s), s = "";
          continue;
        }
        break;
      case "{":
        n = !0;
        break;
      case "}":
        n = !1;
        break;
      case "[":
        r = !0;
        break;
      case "]":
        r = !1;
        break;
    }
    s += o;
  }
  return s && t.push(s), t;
}
function X8e(i) {
  if (!i)
    return "";
  let e = "";
  const t = wNe(i, yNe);
  if (t.every((n) => n === FH))
    e = ".*";
  else {
    let n = !1;
    t.forEach((r, s) => {
      if (r === FH) {
        if (n)
          return;
        e += CNe(2, s === t.length - 1);
      } else {
        let o = !1, a = "", l = !1, c = "";
        for (const u of r) {
          if (u !== "}" && o) {
            a += u;
            continue;
          }
          if (l && (u !== "]" || !c)) {
            let d;
            u === "-" ? d = u : (u === "^" || u === "!") && !c ? d = "^" : u === yNe ? d = "" : d = zd(u), c += d;
            continue;
          }
          switch (u) {
            case "{":
              o = !0;
              continue;
            case "[":
              l = !0;
              continue;
            case "}": {
              const h = `(?:${wNe(a, ",").map((g) => X8e(g)).join("|")})`;
              e += h, o = !1, a = "";
              break;
            }
            case "]": {
              e += "[" + c + "]", l = !1, c = "";
              break;
            }
            case "?":
              e += ZW;
              continue;
            case "*":
              e += CNe(1);
              continue;
            default:
              e += zd(u);
          }
        }
        s < t.length - 1 && // more segments to come after this
        (t[s + 1] !== FH || // next segment is not **, or...
        s + 2 < t.length) && (e += XW);
      }
      n = r === FH;
    });
  }
  return e;
}
const wRt = /^\*\*\/\*\.[\w\.-]+$/, SRt = /^\*\*\/([\w\.-]+)\/?$/, ERt = /^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/, xRt = /^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/, LRt = /^\*\*((\/[\w\.-]+)+)\/?$/, TRt = /^([\w\.-]+(\/[\w\.-]+)*)\/?$/, SNe = new Tb(1e4), ENe = function() {
  return !1;
}, lb = function() {
  return null;
};
function eme(i, e) {
  if (!i)
    return lb;
  let t;
  typeof i != "string" ? t = i.pattern : t = i, t = t.trim();
  const n = `${t}_${!!e.trimForExclusions}`;
  let r = SNe.get(n);
  if (r)
    return xNe(r, i);
  let s;
  return wRt.test(t) ? r = kRt(t.substr(4), t) : (s = SRt.exec(Nte(t, e))) ? r = DRt(s[1], t) : (e.trimForExclusions ? xRt : ERt).test(t) ? r = IRt(t, e) : (s = LRt.exec(Nte(t, e))) ? r = LNe(s[1].substr(1), t, !0) : (s = TRt.exec(Nte(t, e))) ? r = LNe(s[1], t, !1) : r = NRt(t), SNe.set(n, r), xNe(r, i);
}
function xNe(i, e) {
  if (typeof e == "string")
    return i;
  const t = function(n, r) {
    return Eie(n, e.base, !Qu) ? i(pB(n.substr(e.base.length), im), r) : null;
  };
  return t.allBasenames = i.allBasenames, t.allPaths = i.allPaths, t.basenames = i.basenames, t.patterns = i.patterns, t;
}
function Nte(i, e) {
  return e.trimForExclusions && i.endsWith("/**") ? i.substr(0, i.length - 2) : i;
}
function kRt(i, e) {
  return function(t, n) {
    return typeof t == "string" && t.endsWith(i) ? e : null;
  };
}
function DRt(i, e) {
  const t = `/${i}`, n = `\\${i}`, r = function(o, a) {
    return typeof o != "string" ? null : a ? a === i ? e : null : o === i || o.endsWith(t) || o.endsWith(n) ? e : null;
  }, s = [i];
  return r.basenames = s, r.patterns = [e], r.allBasenames = s, r;
}
function IRt(i, e) {
  const t = Q8e(i.slice(1, -1).split(",").map((a) => eme(a, e)).filter((a) => a !== lb), i), n = t.length;
  if (!n)
    return lb;
  if (n === 1)
    return t[0];
  const r = function(a, l) {
    for (let c = 0, u = t.length; c < u; c++)
      if (t[c](a, l))
        return i;
    return null;
  }, s = t.find((a) => !!a.allBasenames);
  s && (r.allBasenames = s.allBasenames);
  const o = t.reduce((a, l) => l.allPaths ? a.concat(l.allPaths) : a, []);
  return o.length && (r.allPaths = o), r;
}
function LNe(i, e, t) {
  const n = im === Ho.sep, r = n ? i : i.replace(CRt, im), s = im + r, o = Ho.sep + i;
  let a;
  return t ? a = function(l, c) {
    return typeof l == "string" && (l === r || l.endsWith(s) || !n && (l === i || l.endsWith(o))) ? e : null;
  } : a = function(l, c) {
    return typeof l == "string" && (l === r || !n && l === i) ? e : null;
  }, a.allPaths = [(t ? "*/" : "./") + i], a;
}
function NRt(i) {
  try {
    const e = new RegExp(`^${X8e(i)}$`);
    return function(t) {
      return e.lastIndex = 0, typeof t == "string" && e.test(t) ? i : null;
    };
  } catch {
    return lb;
  }
}
function RRt(i, e, t) {
  return !i || typeof e != "string" ? !1 : Z8e(i)(e, void 0, t);
}
function Z8e(i, e = {}) {
  if (!i)
    return ENe;
  if (typeof i == "string" || ARt(i)) {
    const t = eme(i, e);
    if (t === lb)
      return ENe;
    const n = function(r, s) {
      return !!t(r, s);
    };
    return t.allBasenames && (n.allBasenames = t.allBasenames), t.allPaths && (n.allPaths = t.allPaths), n;
  }
  return ORt(i, e);
}
function ARt(i) {
  const e = i;
  return e ? typeof e.base == "string" && typeof e.pattern == "string" : !1;
}
function ORt(i, e) {
  const t = Q8e(Object.getOwnPropertyNames(i).map((a) => MRt(a, i[a], e)).filter((a) => a !== lb)), n = t.length;
  if (!n)
    return lb;
  if (!t.some((a) => !!a.requiresSiblings)) {
    if (n === 1)
      return t[0];
    const a = function(u, d) {
      let h;
      for (let g = 0, m = t.length; g < m; g++) {
        const _ = t[g](u, d);
        if (typeof _ == "string")
          return _;
        tie(_) && (h || (h = []), h.push(_));
      }
      return h ? (async () => {
        for (const g of h) {
          const m = await g;
          if (typeof m == "string")
            return m;
        }
        return null;
      })() : null;
    }, l = t.find((u) => !!u.allBasenames);
    l && (a.allBasenames = l.allBasenames);
    const c = t.reduce((u, d) => d.allPaths ? u.concat(d.allPaths) : u, []);
    return c.length && (a.allPaths = c), a;
  }
  const r = function(a, l, c) {
    let u, d;
    for (let h = 0, g = t.length; h < g; h++) {
      const m = t[h];
      m.requiresSiblings && c && (l || (l = E1(a)), u || (u = l.substr(0, l.length - Int(a).length)));
      const _ = m(a, l, u, c);
      if (typeof _ == "string")
        return _;
      tie(_) && (d || (d = []), d.push(_));
    }
    return d ? (async () => {
      for (const h of d) {
        const g = await h;
        if (typeof g == "string")
          return g;
      }
      return null;
    })() : null;
  }, s = t.find((a) => !!a.allBasenames);
  s && (r.allBasenames = s.allBasenames);
  const o = t.reduce((a, l) => l.allPaths ? a.concat(l.allPaths) : a, []);
  return o.length && (r.allPaths = o), r;
}
function MRt(i, e, t) {
  if (e === !1)
    return lb;
  const n = eme(i, t);
  if (n === lb)
    return lb;
  if (typeof e == "boolean")
    return n;
  if (e) {
    const r = e.when;
    if (typeof r == "string") {
      const s = (o, a, l, c) => {
        if (!c || !n(o, a))
          return null;
        const u = r.replace("$(basename)", () => l), d = c(u);
        return tie(d) ? d.then((h) => h ? i : null) : d ? i : null;
      };
      return s.requiresSiblings = !0, s;
    }
  }
  return n;
}
function Q8e(i, e) {
  const t = i.filter((a) => !!a.basenames);
  if (t.length < 2)
    return i;
  const n = t.reduce((a, l) => {
    const c = l.basenames;
    return c ? a.concat(c) : a;
  }, []);
  let r;
  if (e) {
    r = [];
    for (let a = 0, l = n.length; a < l; a++)
      r.push(e);
  } else
    r = t.reduce((a, l) => {
      const c = l.patterns;
      return c ? a.concat(c) : a;
    }, []);
  const s = function(a, l) {
    if (typeof a != "string")
      return null;
    if (!l) {
      let u;
      for (u = a.length; u > 0; u--) {
        const d = a.charCodeAt(u - 1);
        if (d === 47 || d === 92)
          break;
      }
      l = a.substr(u);
    }
    const c = n.indexOf(l);
    return c !== -1 ? r[c] : null;
  };
  s.basenames = n, s.patterns = r, s.allBasenames = n;
  const o = i.filter((a) => !a.basenames);
  return o.push(s), o;
}
function tme(i, e, t, n, r, s) {
  if (Array.isArray(i)) {
    let o = 0;
    for (const a of i) {
      const l = tme(a, e, t, n, r, s);
      if (l === 10)
        return l;
      l > o && (o = l);
    }
    return o;
  } else {
    if (typeof i == "string")
      return n ? i === "*" ? 5 : i === t ? 10 : 0 : 0;
    if (i) {
      const { language: o, pattern: a, scheme: l, hasAccessToAllModels: c, notebookType: u } = i;
      if (!n && !c)
        return 0;
      u && r && (e = r);
      let d = 0;
      if (l)
        if (l === e.scheme)
          d = 10;
        else if (l === "*")
          d = 5;
        else
          return 0;
      if (o)
        if (o === t)
          d = 10;
        else if (o === "*")
          d = Math.max(d, 5);
        else
          return 0;
      if (u)
        if (u === s)
          d = 10;
        else if (u === "*" && s !== void 0)
          d = Math.max(d, 5);
        else
          return 0;
      if (a) {
        let h;
        if (typeof a == "string" ? h = a : h = { ...a, base: rPe(a.base) }, h === e.fsPath || RRt(h, e.fsPath))
          d = 10;
        else
          return 0;
      }
      return d;
    } else
      return 0;
  }
}
var PRt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, FRt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class TNe {
  constructor() {
    this.selector = { language: "*" };
  }
  provideDocumentHighlights(e, t, n) {
    const r = [], s = e.getWordAtPosition({
      lineNumber: t.lineNumber,
      column: t.column
    });
    return s ? e.isDisposed() ? void 0 : e.findMatches(s.word, !0, !1, !0, $V, !1).map((a) => ({
      range: a.range,
      kind: rA.Text
    })) : Promise.resolve(r);
  }
  provideMultiDocumentHighlights(e, t, n, r) {
    const s = new Co(), o = e.getWordAtPosition({
      lineNumber: t.lineNumber,
      column: t.column
    });
    if (!o)
      return Promise.resolve(s);
    for (const a of [e, ...n]) {
      if (a.isDisposed())
        continue;
      const c = a.findMatches(o.word, !0, !1, !0, $V, !1).map((u) => ({
        range: u.range,
        kind: rA.Text
      }));
      c && s.set(a.uri, c);
    }
    return s;
  }
}
let kle = class extends ge {
  constructor(e) {
    super(), this._register(e.documentHighlightProvider.register("*", new TNe())), this._register(e.multiDocumentHighlightProvider.register("*", new TNe()));
  }
};
kle = PRt([
  FRt(0, St)
], kle);
var J8e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, $_ = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, qs, Dle;
const nme = new ut("hasWordHighlights", !1);
function e9e(i, e, t, n) {
  const r = i.ordered(e);
  return Rhe(r.map((s) => () => Promise.resolve(s.provideDocumentHighlights(e, t, n)).then(void 0, No)), (s) => s != null).then((s) => {
    if (s) {
      const o = new Co();
      return o.set(e.uri, s), o;
    }
    return new Co();
  });
}
function BRt(i, e, t, n, r) {
  const s = i.ordered(e);
  return Rhe(s.map((o) => () => {
    const a = r.filter((l) => rFe(l)).filter((l) => tme(o.selector, l.uri, l.getLanguageId(), !0, void 0, void 0) > 0);
    return Promise.resolve(o.provideMultiDocumentHighlights(e, t, a, n)).then(void 0, No);
  }), (o) => o != null);
}
class t9e {
  constructor(e, t, n) {
    this._model = e, this._selection = t, this._wordSeparators = n, this._wordRange = this._getCurrentWordRange(e, t), this._result = null;
  }
  get result() {
    return this._result || (this._result = Jo((e) => this._compute(this._model, this._selection, this._wordSeparators, e))), this._result;
  }
  _getCurrentWordRange(e, t) {
    const n = e.getWordAtPosition(t.getPosition());
    return n ? new z(t.startLineNumber, n.startColumn, t.startLineNumber, n.endColumn) : null;
  }
  cancel() {
    this.result.cancel();
  }
}
class HRt extends t9e {
  constructor(e, t, n, r) {
    super(e, t, n), this._providers = r;
  }
  _compute(e, t, n, r) {
    return e9e(this._providers, e, t.getPosition(), r).then((s) => s || new Co());
  }
}
class WRt extends t9e {
  constructor(e, t, n, r, s) {
    super(e, t, n), this._providers = r, this._otherModels = s;
  }
  _compute(e, t, n, r) {
    return BRt(this._providers, e, t.getPosition(), r, this._otherModels).then((s) => s || new Co());
  }
}
function VRt(i, e, t, n) {
  return new HRt(e, t, n, i);
}
function URt(i, e, t, n, r) {
  return new WRt(e, t, n, i, r);
}
id("_executeDocumentHighlights", async (i, e, t) => {
  const n = i.get(St), r = await e9e(n.documentHighlightProvider, e, t, $n.None);
  return r == null ? void 0 : r.get(e.uri);
});
var Q1;
let Ile = (Q1 = class {
  constructor(e, t, n, r, s, o, a, l) {
    this.toUnhook = new ke(), this.workerRequestTokenId = 0, this.workerRequestCompleted = !1, this.workerRequestValue = new Co(), this.lastCursorPositionChangeTime = 0, this.renderDecorationsTimer = void 0, this.runDelayer = this.toUnhook.add(new Gf(50)), this.editor = e, this.providers = t, this.multiDocumentProviders = n, this.codeEditorService = o, this.textModelService = s, this.configurationService = a, this.logService = l, this._hasWordHighlights = nme.bindTo(r), this._ignorePositionChangeEvent = !1, this.occurrencesHighlightEnablement = this.editor.getOption(
      90
      /* EditorOption.occurrencesHighlight */
    ), this.occurrencesHighlightDelay = this.configurationService.getValue("editor.occurrencesHighlightDelay"), this.model = this.editor.getModel(), this.toUnhook.add(e.onDidChangeCursorPosition((c) => {
      this._ignorePositionChangeEvent || this.occurrencesHighlightEnablement !== "off" && this.runDelayer.trigger(() => {
        this._onPositionChanged(c);
      });
    })), this.toUnhook.add(e.onDidFocusEditorText((c) => {
      this.occurrencesHighlightEnablement !== "off" && (this.workerRequest || this.runDelayer.trigger(() => {
        this._run();
      }));
    })), this.toUnhook.add(e.onDidChangeModelContent((c) => {
      mq(this.model.uri, "output") || this._stopAll();
    })), this.toUnhook.add(e.onDidChangeModel((c) => {
      !c.newModelUrl && c.oldModelUrl ? this._stopSingular() : qs.query && this._run();
    })), this.toUnhook.add(e.onDidChangeConfiguration((c) => {
      var d, h;
      const u = this.editor.getOption(
        90
        /* EditorOption.occurrencesHighlight */
      );
      if (this.occurrencesHighlightEnablement !== u)
        switch (this.occurrencesHighlightEnablement = u, u) {
          case "off":
            this._stopAll();
            break;
          case "singleFile":
            this._stopAll((h = (d = qs.query) == null ? void 0 : d.modelInfo) == null ? void 0 : h.modelURI);
            break;
          case "multiFile":
            qs.query && this._run(!0);
            break;
          default:
            console.warn("Unknown occurrencesHighlight setting value:", u);
            break;
        }
    })), this.toUnhook.add(this.configurationService.onDidChangeConfiguration((c) => {
      if (c.affectsConfiguration("editor.occurrencesHighlightDelay")) {
        const u = a.getValue("editor.occurrencesHighlightDelay");
        this.occurrencesHighlightDelay !== u && (this.occurrencesHighlightDelay = u);
      }
    })), this.toUnhook.add(e.onDidBlurEditorWidget(() => {
      var u, d;
      const c = this.codeEditorService.getFocusedCodeEditor();
      c ? ((u = c.getModel()) == null ? void 0 : u.uri.scheme) === Yt.vscodeNotebookCell && ((d = this.editor.getModel()) == null ? void 0 : d.uri.scheme) !== Yt.vscodeNotebookCell && this._stopAll() : this._stopAll();
    })), this.decorations = this.editor.createDecorationsCollection(), this.workerRequestTokenId = 0, this.workerRequest = null, this.workerRequestCompleted = !1, this.lastCursorPositionChangeTime = 0, this.renderDecorationsTimer = void 0, qs.query && this._run();
  }
  hasDecorations() {
    return this.decorations.length > 0;
  }
  restore(e) {
    this.occurrencesHighlightEnablement !== "off" && (this.runDelayer.cancel(), this.runDelayer.trigger(() => {
      this._run(!1, e);
    }));
  }
  stop() {
    this.occurrencesHighlightEnablement !== "off" && this._stopAll();
  }
  _getSortedHighlights() {
    return this.decorations.getRanges().sort(z.compareRangesUsingStarts);
  }
  moveNext() {
    const e = this._getSortedHighlights(), n = (e.findIndex((s) => s.containsPosition(this.editor.getPosition())) + 1) % e.length, r = e[n];
    try {
      this._ignorePositionChangeEvent = !0, this.editor.setPosition(r.getStartPosition()), this.editor.revealRangeInCenterIfOutsideViewport(r);
      const s = this._getWord();
      if (s) {
        const o = this.editor.getModel().getLineContent(r.startLineNumber);
        lu(`${o}, ${n + 1} of ${e.length} for '${s.word}'`);
      }
    } finally {
      this._ignorePositionChangeEvent = !1;
    }
  }
  moveBack() {
    const e = this._getSortedHighlights(), n = (e.findIndex((s) => s.containsPosition(this.editor.getPosition())) - 1 + e.length) % e.length, r = e[n];
    try {
      this._ignorePositionChangeEvent = !0, this.editor.setPosition(r.getStartPosition()), this.editor.revealRangeInCenterIfOutsideViewport(r);
      const s = this._getWord();
      if (s) {
        const o = this.editor.getModel().getLineContent(r.startLineNumber);
        lu(`${o}, ${n + 1} of ${e.length} for '${s.word}'`);
      }
    } finally {
      this._ignorePositionChangeEvent = !1;
    }
  }
  _removeSingleDecorations() {
    if (!this.editor.hasModel())
      return;
    const e = qs.storedDecorationIDs.get(this.editor.getModel().uri);
    e && (this.editor.removeDecorations(e), qs.storedDecorationIDs.delete(this.editor.getModel().uri), this.decorations.length > 0 && (this.decorations.clear(), this._hasWordHighlights.set(!1)));
  }
  _removeAllDecorations(e) {
    const t = this.codeEditorService.listCodeEditors(), n = [];
    for (const r of t) {
      if (!r.hasModel() || rw(r.getModel().uri, e))
        continue;
      const s = qs.storedDecorationIDs.get(r.getModel().uri);
      if (!s)
        continue;
      r.removeDecorations(s), n.push(r.getModel().uri);
      const o = mw.get(r);
      o != null && o.wordHighlighter && o.wordHighlighter.decorations.length > 0 && (o.wordHighlighter.decorations.clear(), o.wordHighlighter.workerRequest = null, o.wordHighlighter._hasWordHighlights.set(!1));
    }
    for (const r of n)
      qs.storedDecorationIDs.delete(r);
  }
  _stopSingular() {
    var e, t, n, r;
    this._removeSingleDecorations(), this.editor.hasTextFocus() && (((e = this.editor.getModel()) == null ? void 0 : e.uri.scheme) !== Yt.vscodeNotebookCell && ((n = (t = qs.query) == null ? void 0 : t.modelInfo) == null ? void 0 : n.modelURI.scheme) !== Yt.vscodeNotebookCell ? (qs.query = null, this._run()) : (r = qs.query) != null && r.modelInfo && (qs.query.modelInfo = null)), this.renderDecorationsTimer !== void 0 && (clearTimeout(this.renderDecorationsTimer), this.renderDecorationsTimer = void 0), this.workerRequest !== null && (this.workerRequest.cancel(), this.workerRequest = null), this.workerRequestCompleted || (this.workerRequestTokenId++, this.workerRequestCompleted = !0);
  }
  _stopAll(e) {
    this._removeAllDecorations(e), this.renderDecorationsTimer !== void 0 && (clearTimeout(this.renderDecorationsTimer), this.renderDecorationsTimer = void 0), this.workerRequest !== null && (this.workerRequest.cancel(), this.workerRequest = null), this.workerRequestCompleted || (this.workerRequestTokenId++, this.workerRequestCompleted = !0);
  }
  _onPositionChanged(e) {
    if (this.occurrencesHighlightEnablement === "off") {
      this._stopAll();
      return;
    }
    if (e.source !== "api" && e.reason !== 3) {
      this._stopAll();
      return;
    }
    this._run();
  }
  _getWord() {
    const e = this.editor.getSelection(), t = e.startLineNumber, n = e.startColumn;
    return this.model.isDisposed() ? null : this.model.getWordAtPosition({
      lineNumber: t,
      column: n
    });
  }
  getOtherModelsToHighlight(e) {
    if (!e)
      return [];
    if (e.uri.scheme === Yt.vscodeNotebookCell) {
      const s = [], o = this.codeEditorService.listCodeEditors();
      for (const a of o) {
        const l = a.getModel();
        l && l !== e && l.uri.scheme === Yt.vscodeNotebookCell && s.push(l);
      }
      return s;
    }
    const n = [], r = this.codeEditorService.listCodeEditors();
    for (const s of r) {
      if (!Jge(s))
        continue;
      const o = s.getModel();
      o && e === o.modified && n.push(o.modified);
    }
    if (n.length)
      return n;
    if (this.occurrencesHighlightEnablement === "singleFile")
      return [];
    for (const s of r) {
      const o = s.getModel();
      o && o !== e && n.push(o);
    }
    return n;
  }
  async _run(e, t) {
    var r, s, o;
    if (this.editor.hasTextFocus()) {
      const a = this.editor.getSelection();
      if (!a || a.startLineNumber !== a.endLineNumber) {
        qs.query = null, this._stopAll();
        return;
      }
      const l = a.startColumn, c = a.endColumn, u = this._getWord();
      if (!u || u.startColumn > l || u.endColumn < c) {
        qs.query = null, this._stopAll();
        return;
      }
      qs.query = {
        modelInfo: {
          modelURI: this.model.uri,
          selection: a
        }
      };
    } else if (!qs.query) {
      this._stopAll();
      return;
    }
    if (this.lastCursorPositionChangeTime = (/* @__PURE__ */ new Date()).getTime(), rw(this.editor.getModel().uri, (r = qs.query.modelInfo) == null ? void 0 : r.modelURI)) {
      if (!e) {
        const u = this.decorations.getRanges();
        for (const d of u)
          if (d.containsPosition(this.editor.getPosition()))
            return;
      }
      this._stopAll(e ? this.model.uri : void 0);
      const a = ++this.workerRequestTokenId;
      this.workerRequestCompleted = !1;
      const l = this.getOtherModelsToHighlight(this.editor.getModel());
      if (!qs.query || !qs.query.modelInfo)
        return;
      const c = await this.textModelService.createModelReference(qs.query.modelInfo.modelURI);
      try {
        this.workerRequest = this.computeWithModel(c.object.textEditorModel, qs.query.modelInfo.selection, l), (s = this.workerRequest) == null || s.result.then((u) => {
          a === this.workerRequestTokenId && (this.workerRequestCompleted = !0, this.workerRequestValue = u || [], this._beginRenderDecorations(t ?? this.occurrencesHighlightDelay));
        }, fn);
      } catch (u) {
        this.logService.error("Unexpected error during occurrence request. Log: ", u);
      } finally {
        c.dispose();
      }
    } else if (this.model.uri.scheme === Yt.vscodeNotebookCell) {
      const a = ++this.workerRequestTokenId;
      if (this.workerRequestCompleted = !1, !qs.query || !qs.query.modelInfo)
        return;
      const l = await this.textModelService.createModelReference(qs.query.modelInfo.modelURI);
      try {
        this.workerRequest = this.computeWithModel(l.object.textEditorModel, qs.query.modelInfo.selection, [this.model]), (o = this.workerRequest) == null || o.result.then((c) => {
          a === this.workerRequestTokenId && (this.workerRequestCompleted = !0, this.workerRequestValue = c || [], this._beginRenderDecorations(t ?? this.occurrencesHighlightDelay));
        }, fn);
      } catch (c) {
        this.logService.error("Unexpected error during occurrence request. Log: ", c);
      } finally {
        l.dispose();
      }
    }
  }
  computeWithModel(e, t, n) {
    return n.length ? URt(this.multiDocumentProviders, e, t, this.editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ), n) : VRt(this.providers, e, t, this.editor.getOption(
      148
      /* EditorOption.wordSeparators */
    ));
  }
  _beginRenderDecorations(e) {
    const t = (/* @__PURE__ */ new Date()).getTime(), n = this.lastCursorPositionChangeTime + e;
    t >= n ? (this.renderDecorationsTimer = void 0, this.renderDecorations()) : this.renderDecorationsTimer = setTimeout(() => {
      this.renderDecorations();
    }, n - t);
  }
  renderDecorations() {
    var t, n, r;
    this.renderDecorationsTimer = void 0;
    const e = this.codeEditorService.listCodeEditors();
    for (const s of e) {
      const o = mw.get(s);
      if (!o)
        continue;
      const a = [], l = (t = s.getModel()) == null ? void 0 : t.uri;
      if (l && this.workerRequestValue.has(l)) {
        const c = qs.storedDecorationIDs.get(l), u = this.workerRequestValue.get(l);
        if (u)
          for (const h of u)
            h.range && a.push({
              range: h.range,
              options: ZIt(h.kind)
            });
        let d = [];
        s.changeDecorations((h) => {
          d = h.deltaDecorations(c ?? [], a);
        }), qs.storedDecorationIDs = qs.storedDecorationIDs.set(l, d), a.length > 0 && ((n = o.wordHighlighter) == null || n.decorations.set(a), (r = o.wordHighlighter) == null || r._hasWordHighlights.set(!0));
      }
    }
    this.workerRequest = null;
  }
  dispose() {
    this._stopSingular(), this.toUnhook.dispose();
  }
}, qs = Q1, Q1.storedDecorationIDs = new Co(), Q1.query = null, Q1);
Ile = qs = J8e([
  $_(4, Ic),
  $_(5, Ti),
  $_(6, xn),
  $_(7, $r)
], Ile);
var WL;
let mw = (WL = class extends ge {
  static get(e) {
    return e.getContribution(Dle.ID);
  }
  constructor(e, t, n, r, s, o, a) {
    super(), this._wordHighlighter = null;
    const l = () => {
      e.hasModel() && !e.getModel().isTooLargeForTokenization() && e.getModel().uri.scheme !== Yt.accessibleView && (this._wordHighlighter = new Ile(e, n.documentHighlightProvider, n.multiDocumentHighlightProvider, t, s, r, o, a));
    };
    this._register(e.onDidChangeModel((c) => {
      var u, d;
      this._wordHighlighter && (!c.newModelUrl && ((u = c.oldModelUrl) == null ? void 0 : u.scheme) !== Yt.vscodeNotebookCell && ((d = this.wordHighlighter) == null || d.stop()), this._wordHighlighter.dispose(), this._wordHighlighter = null), l();
    })), l();
  }
  get wordHighlighter() {
    return this._wordHighlighter;
  }
  saveViewState() {
    return !!(this._wordHighlighter && this._wordHighlighter.hasDecorations());
  }
  moveNext() {
    var e;
    (e = this._wordHighlighter) == null || e.moveNext();
  }
  moveBack() {
    var e;
    (e = this._wordHighlighter) == null || e.moveBack();
  }
  restoreViewState(e) {
    this._wordHighlighter && e && this._wordHighlighter.restore(250);
  }
  dispose() {
    this._wordHighlighter && (this._wordHighlighter.dispose(), this._wordHighlighter = null), super.dispose();
  }
}, Dle = WL, WL.ID = "editor.contrib.wordHighlighter", WL);
mw = Dle = J8e([
  $_(1, Jt),
  $_(2, St),
  $_(3, Ti),
  $_(4, Ic),
  $_(5, xn),
  $_(6, $r)
], mw);
class n9e extends vt {
  constructor(e, t) {
    super(t), this._isNext = e;
  }
  run(e, t) {
    const n = mw.get(t);
    n && (this._isNext ? n.moveNext() : n.moveBack());
  }
}
class zRt extends n9e {
  constructor() {
    super(!0, {
      id: "editor.action.wordHighlight.next",
      label: Ee(1557, "Go to Next Symbol Highlight"),
      precondition: nme,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 65,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class $Rt extends n9e {
  constructor() {
    super(!1, {
      id: "editor.action.wordHighlight.prev",
      label: Ee(1558, "Go to Previous Symbol Highlight"),
      precondition: nme,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 1089,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class jRt extends vt {
  constructor() {
    super({
      id: "editor.action.wordHighlight.trigger",
      label: Ee(1559, "Trigger Symbol Highlight"),
      precondition: void 0,
      kbOpts: {
        kbExpr: se.editorTextFocus,
        primary: 0,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e, t, n) {
    const r = mw.get(t);
    r && r.restoreViewState(!0);
  }
}
Si(
  mw.ID,
  mw,
  0
  /* EditorContributionInstantiation.Eager */
);
Je(zRt);
Je($Rt);
Je(jRt);
u2(kle);
class GK extends jo {
  constructor(e) {
    super(e), this._inSelectionMode = e.inSelectionMode, this._wordNavigationType = e.wordNavigationType;
  }
  runEditorCommand(e, t, n) {
    if (!t.hasModel())
      return;
    const r = Yf(t.getOption(
      148
      /* EditorOption.wordSeparators */
    ), t.getOption(
      147
      /* EditorOption.wordSegmenterLocales */
    )), s = t.getModel(), o = t.getSelections(), a = o.length > 1, l = o.map((c) => {
      const u = new de(c.positionLineNumber, c.positionColumn), d = this._move(r, s, u, this._wordNavigationType, a);
      return this._moveTo(c, d, this._inSelectionMode);
    });
    if (s.pushStackElement(), t._getViewModel().setCursorStates("moveWordCommand", 3, l.map((c) => Di.fromModelSelection(c))), l.length === 1) {
      const c = new de(l[0].positionLineNumber, l[0].positionColumn);
      t.revealPosition(
        c,
        0
        /* ScrollType.Smooth */
      );
    }
  }
  _moveTo(e, t, n) {
    return n ? new bt(e.selectionStartLineNumber, e.selectionStartColumn, t.lineNumber, t.column) : new bt(t.lineNumber, t.column, t.lineNumber, t.column);
  }
}
class Iw extends GK {
  _move(e, t, n, r, s) {
    return Qi.moveWordLeft(e, t, n, r, s);
  }
}
class Nw extends GK {
  _move(e, t, n, r, s) {
    return Qi.moveWordRight(e, t, n, r);
  }
}
class GRt extends Iw {
  constructor() {
    super({
      inSelectionMode: !1,
      wordNavigationType: 0,
      id: "cursorWordStartLeft",
      precondition: void 0
    });
  }
}
class qRt extends Iw {
  constructor() {
    super({
      inSelectionMode: !1,
      wordNavigationType: 2,
      id: "cursorWordEndLeft",
      precondition: void 0
    });
  }
}
class KRt extends Iw {
  constructor() {
    var e;
    super({
      inSelectionMode: !1,
      wordNavigationType: 1,
      id: "cursorWordLeft",
      precondition: void 0,
      kbOpts: {
        kbExpr: Re.and(se.textInputFocus, (e = Re.and(QA, EK)) == null ? void 0 : e.negate()),
        primary: 2063,
        mac: {
          primary: 527
          /* KeyCode.LeftArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class YRt extends Iw {
  constructor() {
    super({
      inSelectionMode: !0,
      wordNavigationType: 0,
      id: "cursorWordStartLeftSelect",
      precondition: void 0
    });
  }
}
class XRt extends Iw {
  constructor() {
    super({
      inSelectionMode: !0,
      wordNavigationType: 2,
      id: "cursorWordEndLeftSelect",
      precondition: void 0
    });
  }
}
class ZRt extends Iw {
  constructor() {
    var e;
    super({
      inSelectionMode: !0,
      wordNavigationType: 1,
      id: "cursorWordLeftSelect",
      precondition: void 0,
      kbOpts: {
        kbExpr: Re.and(se.textInputFocus, (e = Re.and(QA, EK)) == null ? void 0 : e.negate()),
        primary: 3087,
        mac: {
          primary: 1551
          /* KeyCode.LeftArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class QRt extends Iw {
  constructor() {
    super({
      inSelectionMode: !1,
      wordNavigationType: 3,
      id: "cursorWordAccessibilityLeft",
      precondition: void 0
    });
  }
  _move(e, t, n, r, s) {
    return super._move(Yf(wm.wordSeparators.defaultValue, e.intlSegmenterLocales), t, n, r, s);
  }
}
class JRt extends Iw {
  constructor() {
    super({
      inSelectionMode: !0,
      wordNavigationType: 3,
      id: "cursorWordAccessibilityLeftSelect",
      precondition: void 0
    });
  }
  _move(e, t, n, r, s) {
    return super._move(Yf(wm.wordSeparators.defaultValue, e.intlSegmenterLocales), t, n, r, s);
  }
}
class eAt extends Nw {
  constructor() {
    super({
      inSelectionMode: !1,
      wordNavigationType: 0,
      id: "cursorWordStartRight",
      precondition: void 0
    });
  }
}
class tAt extends Nw {
  constructor() {
    var e;
    super({
      inSelectionMode: !1,
      wordNavigationType: 2,
      id: "cursorWordEndRight",
      precondition: void 0,
      kbOpts: {
        kbExpr: Re.and(se.textInputFocus, (e = Re.and(QA, EK)) == null ? void 0 : e.negate()),
        primary: 2065,
        mac: {
          primary: 529
          /* KeyCode.RightArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class nAt extends Nw {
  constructor() {
    super({
      inSelectionMode: !1,
      wordNavigationType: 2,
      id: "cursorWordRight",
      precondition: void 0
    });
  }
}
class iAt extends Nw {
  constructor() {
    super({
      inSelectionMode: !0,
      wordNavigationType: 0,
      id: "cursorWordStartRightSelect",
      precondition: void 0
    });
  }
}
class rAt extends Nw {
  constructor() {
    var e;
    super({
      inSelectionMode: !0,
      wordNavigationType: 2,
      id: "cursorWordEndRightSelect",
      precondition: void 0,
      kbOpts: {
        kbExpr: Re.and(se.textInputFocus, (e = Re.and(QA, EK)) == null ? void 0 : e.negate()),
        primary: 3089,
        mac: {
          primary: 1553
          /* KeyCode.RightArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class sAt extends Nw {
  constructor() {
    super({
      inSelectionMode: !0,
      wordNavigationType: 2,
      id: "cursorWordRightSelect",
      precondition: void 0
    });
  }
}
class oAt extends Nw {
  constructor() {
    super({
      inSelectionMode: !1,
      wordNavigationType: 3,
      id: "cursorWordAccessibilityRight",
      precondition: void 0
    });
  }
  _move(e, t, n, r, s) {
    return super._move(Yf(wm.wordSeparators.defaultValue, e.intlSegmenterLocales), t, n, r, s);
  }
}
class aAt extends Nw {
  constructor() {
    super({
      inSelectionMode: !0,
      wordNavigationType: 3,
      id: "cursorWordAccessibilityRightSelect",
      precondition: void 0
    });
  }
  _move(e, t, n, r, s) {
    return super._move(Yf(wm.wordSeparators.defaultValue, e.intlSegmenterLocales), t, n, r, s);
  }
}
class qK extends jo {
  constructor(e) {
    super(e), this._whitespaceHeuristics = e.whitespaceHeuristics, this._wordNavigationType = e.wordNavigationType;
  }
  runEditorCommand(e, t, n) {
    const r = e == null ? void 0 : e.get(Ls);
    if (!t.hasModel() || !r)
      return;
    const s = Yf(t.getOption(
      148
      /* EditorOption.wordSeparators */
    ), t.getOption(
      147
      /* EditorOption.wordSegmenterLocales */
    )), o = t.getModel(), a = t.getSelections(), l = t.getOption(
      10
      /* EditorOption.autoClosingBrackets */
    ), c = t.getOption(
      15
      /* EditorOption.autoClosingQuotes */
    ), u = r.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(), d = t._getViewModel(), h = a.map((g) => {
      const m = this._delete({
        wordSeparators: s,
        model: o,
        selection: g,
        whitespaceHeuristics: this._whitespaceHeuristics,
        autoClosingDelete: t.getOption(
          13
          /* EditorOption.autoClosingDelete */
        ),
        autoClosingBrackets: l,
        autoClosingQuotes: c,
        autoClosingPairs: u,
        autoClosedCharacters: d.getCursorAutoClosedCharacters()
      }, this._wordNavigationType);
      return new bl(m, "");
    });
    t.pushUndoStop(), t.executeCommands(this.id, h), t.pushUndoStop();
  }
}
class ime extends qK {
  _delete(e, t) {
    const n = Qi.deleteWordLeft(e, t);
    return n || new z(1, 1, 1, 1);
  }
}
class rme extends qK {
  _delete(e, t) {
    const n = Qi.deleteWordRight(e, t);
    if (n)
      return n;
    const r = e.model.getLineCount(), s = e.model.getLineMaxColumn(r);
    return new z(r, s, r, s);
  }
}
class lAt extends ime {
  constructor() {
    super({
      whitespaceHeuristics: !1,
      wordNavigationType: 0,
      id: "deleteWordStartLeft",
      precondition: se.writable
    });
  }
}
class cAt extends ime {
  constructor() {
    super({
      whitespaceHeuristics: !1,
      wordNavigationType: 2,
      id: "deleteWordEndLeft",
      precondition: se.writable
    });
  }
}
class uAt extends ime {
  constructor() {
    super({
      whitespaceHeuristics: !0,
      wordNavigationType: 0,
      id: "deleteWordLeft",
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 2049,
        mac: {
          primary: 513
          /* KeyCode.Backspace */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class dAt extends rme {
  constructor() {
    super({
      whitespaceHeuristics: !1,
      wordNavigationType: 0,
      id: "deleteWordStartRight",
      precondition: se.writable
    });
  }
}
class hAt extends rme {
  constructor() {
    super({
      whitespaceHeuristics: !1,
      wordNavigationType: 2,
      id: "deleteWordEndRight",
      precondition: se.writable
    });
  }
}
class fAt extends rme {
  constructor() {
    super({
      whitespaceHeuristics: !0,
      wordNavigationType: 2,
      id: "deleteWordRight",
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 2068,
        mac: {
          primary: 532
          /* KeyCode.Delete */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class gAt extends vt {
  constructor() {
    super({
      id: "deleteInsideWord",
      precondition: se.writable,
      label: Ee(1560, "Delete Word")
    });
  }
  run(e, t, n) {
    if (!t.hasModel())
      return;
    const r = Yf(t.getOption(
      148
      /* EditorOption.wordSeparators */
    ), t.getOption(
      147
      /* EditorOption.wordSegmenterLocales */
    )), s = t.getModel(), a = t.getSelections().map((l) => {
      const c = Qi.deleteInsideWord(r, s, l);
      return new bl(c, "");
    });
    t.pushUndoStop(), t.executeCommands(this.id, a), t.pushUndoStop();
  }
}
ct(new GRt());
ct(new qRt());
ct(new KRt());
ct(new YRt());
ct(new XRt());
ct(new ZRt());
ct(new eAt());
ct(new tAt());
ct(new nAt());
ct(new iAt());
ct(new rAt());
ct(new sAt());
ct(new QRt());
ct(new JRt());
ct(new oAt());
ct(new aAt());
ct(new lAt());
ct(new cAt());
ct(new uAt());
ct(new dAt());
ct(new hAt());
ct(new fAt());
Je(gAt);
class pAt extends qK {
  constructor() {
    super({
      whitespaceHeuristics: !0,
      wordNavigationType: 0,
      id: "deleteWordPartLeft",
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: {
          primary: 769
          /* KeyCode.Backspace */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  _delete(e, t) {
    const n = Mq.deleteWordPartLeft(e);
    return n || new z(1, 1, 1, 1);
  }
}
class mAt extends qK {
  constructor() {
    super({
      whitespaceHeuristics: !0,
      wordNavigationType: 2,
      id: "deleteWordPartRight",
      precondition: se.writable,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: {
          primary: 788
          /* KeyCode.Delete */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  _delete(e, t) {
    const n = Mq.deleteWordPartRight(e);
    if (n)
      return n;
    const r = e.model.getLineCount(), s = e.model.getLineMaxColumn(r);
    return new z(r, s, r, s);
  }
}
class i9e extends GK {
  _move(e, t, n, r, s) {
    return Mq.moveWordPartLeft(e, t, n, s);
  }
}
class _At extends i9e {
  constructor() {
    super({
      inSelectionMode: !1,
      wordNavigationType: 0,
      id: "cursorWordPartLeft",
      precondition: void 0,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: {
          primary: 783
          /* KeyCode.LeftArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
_i.registerCommandAlias("cursorWordPartStartLeft", "cursorWordPartLeft");
class bAt extends i9e {
  constructor() {
    super({
      inSelectionMode: !0,
      wordNavigationType: 0,
      id: "cursorWordPartLeftSelect",
      precondition: void 0,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: {
          primary: 1807
          /* KeyCode.LeftArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
_i.registerCommandAlias("cursorWordPartStartLeftSelect", "cursorWordPartLeftSelect");
class r9e extends GK {
  _move(e, t, n, r, s) {
    return Mq.moveWordPartRight(e, t, n);
  }
}
class vAt extends r9e {
  constructor() {
    super({
      inSelectionMode: !1,
      wordNavigationType: 2,
      id: "cursorWordPartRight",
      precondition: void 0,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: {
          primary: 785
          /* KeyCode.RightArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
class yAt extends r9e {
  constructor() {
    super({
      inSelectionMode: !0,
      wordNavigationType: 2,
      id: "cursorWordPartRightSelect",
      precondition: void 0,
      kbOpts: {
        kbExpr: se.textInputFocus,
        primary: 0,
        mac: {
          primary: 1809
          /* KeyCode.RightArrow */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
}
ct(new pAt());
ct(new mAt());
ct(new _At());
ct(new bAt());
ct(new vAt());
ct(new yAt());
const i1e = class i1e extends ge {
  constructor(e) {
    super(), this.editor = e, this._register(this.editor.onDidAttemptReadOnlyEdit(() => this._onDidAttemptReadOnlyEdit()));
  }
  _onDidAttemptReadOnlyEdit() {
    const e = Vd.get(this.editor);
    if (e && this.editor.hasModel()) {
      let t = this.editor.getOptions().get(
        105
        /* EditorOption.readOnlyMessage */
      );
      t || (this.editor.isSimpleWidget ? t = new ql(S(1363, "Cannot edit in read-only input")) : t = new ql(S(1364, "Cannot edit in read-only editor"))), e.showMessage(t, this.editor.getPosition());
    }
  }
};
i1e.ID = "editor.contrib.readOnlyMessageController";
let d$ = i1e;
Si(
  d$.ID,
  d$,
  2
  /* EditorContributionInstantiation.BeforeFirstInteraction */
);
var CAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, kNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Nle = class extends ge {
  constructor(e, t, n) {
    super(), this._textModel = e, this._languageFeaturesService = t, this._outlineModelService = n, this._currentModel = Qt(this, void 0);
    const r = Dd("documentSymbolProvider.onDidChange", this._languageFeaturesService.documentSymbolProvider.onDidChange), s = Dd("_textModel.onDidChangeContent", Ze.debounce((o) => this._textModel.onDidChangeContent(o), () => {
    }, 100));
    this._register(Ql(async (o, a) => {
      r.read(o), s.read(o);
      const l = a.add(new ivt()), c = await this._outlineModelService.getOrCreate(this._textModel, l.token);
      a.isDisposed || this._currentModel.set(c, void 0);
    }));
  }
  getBreadcrumbItems(e, t) {
    const n = this._currentModel.read(t);
    if (!n)
      return [];
    const r = n.asListOfDocumentSymbols().filter((s) => e.contains(s.range.startLineNumber) && !e.contains(s.range.endLineNumber));
    return r.sort(mPe(yl((s) => s.range.endLineNumber - s.range.startLineNumber, Hd))), r.map((s) => ({ name: s.name, kind: s.kind, startLineNumber: s.range.startLineNumber }));
  }
};
Nle = CAt([
  kNe(1, St),
  kNe(2, YB)
], Nle);
$U.setBreadcrumbsSourceFactory((i, e) => e.createInstance(Nle, i));
var wAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Rte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, OR;
let h$ = (OR = class extends ge {
  constructor(e, t, n, r) {
    super();
    const s = this._register(Ms(e)), o = this._register(r.createMenu(wt.EditorContent, e.contextKeyService)), a = ji(this, o.onDidChange, () => o.getActions().length === 0);
    this._register(Xt((l) => {
      if (a.read(l))
        return;
      const u = Li("div.floating-menu-overlay-widget");
      u.root.style.height = "28px";
      const d = t.createInstance(q4, u.root, wt.EditorContent, {
        actionViewItemProvider: (h, g) => {
          if (!(h instanceof Uh))
            return;
          const m = n.lookupKeybinding(h.id);
          if (m)
            return t.createInstance(class extends hw {
              updateLabel() {
                this.options.label && this.label && (this.label.textContent = `${this._commandAction.label} (${m.getLabel()})`);
              }
            }, h, { ...g, keybindingNotRenderedWithLabel: !0 });
        },
        hiddenItemStrategy: 0,
        menuOptions: {
          shouldForwardArgs: !0
        },
        telemetrySource: "editor.overlayToolbar",
        toolbarOptions: {
          primaryGroup: () => !0,
          useSeparatorsInPrimaryActions: !0
        }
      });
      l.store.add(d), l.store.add(Xt((h) => {
        const g = s.model.read(h);
        d.context = g == null ? void 0 : g.uri;
      })), l.store.add(s.createOverlayWidget({
        allowEditorOverflow: !1,
        domNode: u.root,
        minContentWidthInPx: Br(0),
        position: Br({
          preference: 1
          /* OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER */
        })
      }));
    }));
  }
}, OR.ID = "editor.contrib.floatingToolbar", OR);
h$ = wAt([
  Rte(1, xt),
  Rte(2, Fi),
  Rte(3, eg)
], h$);
Si(
  h$.ID,
  h$,
  1
  /* EditorContributionInstantiation.AfterFirstRender */
);
var Rle;
(function(i) {
  i.inspectTokensAction = S(782, "Developer: Inspect Tokens");
})(Rle || (Rle = {}));
var f$;
(function(i) {
  i.gotoLineActionLabel = S(783, "Go to Line/Column...");
})(f$ || (f$ = {}));
var Ale;
(function(i) {
  i.helpQuickAccessActionLabel = S(784, "Show all Quick Access Providers");
})(Ale || (Ale = {}));
var g$;
(function(i) {
  i.quickCommandActionLabel = S(785, "Command Palette"), i.quickCommandHelp = S(786, "Show And Run Commands");
})(g$ || (g$ = {}));
var k5;
(function(i) {
  i.quickOutlineActionLabel = S(787, "Go to Symbol..."), i.quickOutlineByCategoryActionLabel = S(788, "Go to Symbol by Category...");
})(k5 || (k5 = {}));
var Ole;
(function(i) {
  i.editorViewAccessibleLabel = S(789, "Editor content");
})(Ole || (Ole = {}));
var Mle;
(function(i) {
  i.toggleHighContrast = S(790, "Toggle High Contrast Theme");
})(Mle || (Mle = {}));
var Ple;
(function(i) {
  i.bulkEditServiceSummary = S(791, "Made {0} edits in {1} files");
})(Ple || (Ple = {}));
const r1e = class r1e extends ge {
  constructor(e) {
    super(), this.editor = e, this.widget = null, jf && (this._register(e.onDidChangeConfiguration(() => this.update())), this.update());
  }
  update() {
    const e = !this.editor.getOption(
      104
      /* EditorOption.readOnly */
    );
    !this.widget && e ? this.widget = new Fle(this.editor) : this.widget && !e && (this.widget.dispose(), this.widget = null);
  }
  dispose() {
    super.dispose(), this.widget && (this.widget.dispose(), this.widget = null);
  }
};
r1e.ID = "editor.contrib.iPadShowKeyboard";
let p$ = r1e;
const qG = class qG extends ge {
  constructor(e) {
    super(), this.editor = e, this._domNode = document.createElement("textarea"), this._domNode.className = "iPadShowKeyboard", this._register(Ce(this._domNode, "touchstart", (t) => {
      this.editor.focus();
    })), this._register(Ce(this._domNode, "focus", (t) => {
      this.editor.focus();
    })), this.editor.addOverlayWidget(this);
  }
  dispose() {
    this.editor.removeOverlayWidget(this), super.dispose();
  }
  // ----- IOverlayWidget API
  getId() {
    return qG.ID;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return {
      preference: 1
      /* OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER */
    };
  }
};
qG.ID = "editor.contrib.ShowKeyboardWidget";
let Fle = qG;
Si(
  p$.ID,
  p$,
  3
  /* EditorContributionInstantiation.Eventually */
);
const Jh = Vn("themeService");
var SAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, DNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Ble, VL;
let D5 = (VL = class extends ge {
  static get(e) {
    return e.getContribution(Ble.ID);
  }
  constructor(e, t, n) {
    super(), this._editor = e, this._languageService = n, this._widget = null, this._register(this._editor.onDidChangeModel((r) => this.stop())), this._register(this._editor.onDidChangeModelLanguage((r) => this.stop())), this._register(Ys.onDidChange((r) => this.stop())), this._register(this._editor.onKeyUp((r) => r.keyCode === 9 && this.stop()));
  }
  dispose() {
    this.stop(), super.dispose();
  }
  launch() {
    this._widget || this._editor.hasModel() && (this._widget = new Hle(this._editor, this._languageService));
  }
  stop() {
    this._widget && (this._widget.dispose(), this._widget = null);
  }
}, Ble = VL, VL.ID = "editor.contrib.inspectTokens", VL);
D5 = Ble = SAt([
  DNe(1, Jh),
  DNe(2, Gr)
], D5);
class EAt extends vt {
  constructor() {
    super({
      id: "editor.action.inspectTokens",
      label: Rle.inspectTokensAction,
      alias: "Developer: Inspect Tokens",
      precondition: void 0
    });
  }
  run(e, t) {
    const n = D5.get(t);
    n == null || n.launch();
  }
}
function xAt(i) {
  let e = "";
  for (let t = 0, n = i.length; t < n; t++) {
    const r = i.charCodeAt(t);
    switch (r) {
      case 9:
        e += "→";
        break;
      case 32:
        e += "·";
        break;
      default:
        e += String.fromCharCode(r);
    }
  }
  return e;
}
function LAt(i, e) {
  const t = Ys.get(e);
  if (t)
    return t;
  const n = i.encodeLanguageId(e);
  return {
    getInitialState: () => sA,
    tokenize: (r, s, o) => ege(e, o),
    tokenizeEncoded: (r, s, o) => aK(n, o)
  };
}
const KG = class KG extends ge {
  constructor(e, t) {
    super(), this.allowEditorOverflow = !0, this._editor = e, this._languageService = t, this._model = this._editor.getModel(), this._domNode = document.createElement("div"), this._domNode.className = "tokens-inspect-widget", this._tokenizationSupport = LAt(this._languageService.languageIdCodec, this._model.getLanguageId()), this._compute(this._editor.getPosition()), this._register(this._editor.onDidChangeCursorPosition((n) => this._compute(this._editor.getPosition()))), this._editor.addContentWidget(this);
  }
  dispose() {
    this._editor.removeContentWidget(this), super.dispose();
  }
  getId() {
    return KG._ID;
  }
  _compute(e) {
    const t = this._getTokensAtLine(e.lineNumber);
    let n = 0;
    for (let l = t.tokens1.length - 1; l >= 0; l--) {
      const c = t.tokens1[l];
      if (e.column - 1 >= c.offset) {
        n = l;
        break;
      }
    }
    let r = 0;
    for (let l = t.tokens2.length >>> 1; l >= 0; l--)
      if (e.column - 1 >= t.tokens2[l << 1]) {
        r = l;
        break;
      }
    const s = this._model.getLineContent(e.lineNumber);
    let o = "";
    if (n < t.tokens1.length) {
      const l = t.tokens1[n].offset, c = n + 1 < t.tokens1.length ? t.tokens1[n + 1].offset : s.length;
      o = s.substring(l, c);
    }
    ma(this._domNode, Ge("h2.tm-token", void 0, xAt(o), Ge("span.tm-token-length", void 0, `${o.length} ${o.length === 1 ? "char" : "chars"}`))), Fe(this._domNode, Ge("hr.tokens-inspect-separator", { style: "clear:both" }));
    const a = (r << 1) + 1 < t.tokens2.length ? this._decodeMetadata(t.tokens2[(r << 1) + 1]) : null;
    Fe(this._domNode, Ge("table.tm-metadata-table", void 0, Ge("tbody", void 0, Ge("tr", void 0, Ge("td.tm-metadata-key", void 0, "language"), Ge("td.tm-metadata-value", void 0, `${a ? a.languageId : "-?-"}`)), Ge("tr", void 0, Ge("td.tm-metadata-key", void 0, "token type"), Ge("td.tm-metadata-value", void 0, `${a ? this._tokenTypeToString(a.tokenType) : "-?-"}`)), Ge("tr", void 0, Ge("td.tm-metadata-key", void 0, "font style"), Ge("td.tm-metadata-value", void 0, `${a ? this._fontStyleToString(a.fontStyle) : "-?-"}`)), Ge("tr", void 0, Ge("td.tm-metadata-key", void 0, "foreground"), Ge("td.tm-metadata-value", void 0, `${a ? De.Format.CSS.formatHex(a.foreground) : "-?-"}`)), Ge("tr", void 0, Ge("td.tm-metadata-key", void 0, "background"), Ge("td.tm-metadata-value", void 0, `${a ? De.Format.CSS.formatHex(a.background) : "-?-"}`))))), Fe(this._domNode, Ge("hr.tokens-inspect-separator")), n < t.tokens1.length && Fe(this._domNode, Ge("span.tm-token-type", void 0, t.tokens1[n].type)), this._editor.layoutContentWidget(this);
  }
  _decodeMetadata(e) {
    const t = Ys.getColorMap(), n = jl.getLanguageId(e), r = jl.getTokenType(e), s = jl.getFontStyle(e), o = jl.getForeground(e), a = jl.getBackground(e);
    return {
      languageId: this._languageService.languageIdCodec.decodeLanguageId(n),
      tokenType: r,
      fontStyle: s,
      foreground: t[o],
      background: t[a]
    };
  }
  _tokenTypeToString(e) {
    switch (e) {
      case 0:
        return "Other";
      case 1:
        return "Comment";
      case 2:
        return "String";
      case 3:
        return "RegEx";
      default:
        return "??";
    }
  }
  _fontStyleToString(e) {
    let t = "";
    return e & 1 && (t += "italic "), e & 2 && (t += "bold "), e & 4 && (t += "underline "), e & 8 && (t += "strikethrough "), t.length === 0 && (t = "---"), t;
  }
  _getTokensAtLine(e) {
    const t = this._getStateBeforeLine(e), n = this._tokenizationSupport.tokenize(this._model.getLineContent(e), !0, t), r = this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e), !0, t);
    return {
      startState: t,
      tokens1: n.tokens,
      tokens2: r.tokens,
      endState: n.endState
    };
  }
  _getStateBeforeLine(e) {
    let t = this._tokenizationSupport.getInitialState();
    for (let n = 1; n < e; n++)
      t = this._tokenizationSupport.tokenize(this._model.getLineContent(n), !0, t).endState;
    return t;
  }
  getDomNode() {
    return this._domNode;
  }
  getPosition() {
    return {
      position: this._editor.getPosition(),
      preference: [
        2,
        1
        /* ContentWidgetPositionPreference.ABOVE */
      ]
    };
  }
};
KG._ID = "editor.contrib.inspectTokensWidget";
let Hle = KG;
Si(
  D5.ID,
  D5,
  4
  /* EditorContributionInstantiation.Lazy */
);
Je(EAt);
var Wle;
(function(i) {
  i[i.PRESERVE = 0] = "PRESERVE", i[i.LAST = 1] = "LAST";
})(Wle || (Wle = {}));
const ak = {
  Quickaccess: "workbench.contributions.quickaccess"
};
class TAt {
  constructor() {
    this.providers = [], this.defaultProvider = void 0;
  }
  registerQuickAccessProvider(e) {
    return e.prefix.length === 0 ? this.defaultProvider = e : this.providers.push(e), this.providers.sort((t, n) => n.prefix.length - t.prefix.length), Et(() => {
      this.providers.splice(this.providers.indexOf(e), 1), this.defaultProvider === e && (this.defaultProvider = void 0);
    });
  }
  getQuickAccessProviders() {
    return ym([this.defaultProvider, ...this.providers]);
  }
  getQuickAccessProvider(e) {
    return e && this.providers.find((n) => e.startsWith(n.prefix)) || void 0 || this.defaultProvider;
  }
}
Fs.add(ak.Quickaccess, new TAt());
var kAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, INe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, sF, UL;
let Vle = (UL = class {
  constructor(e, t) {
    this.quickInputService = e, this.keybindingService = t, this.registry = Fs.as(ak.Quickaccess);
  }
  provide(e) {
    const t = new ke();
    return t.add(e.onDidAccept(() => {
      const [n] = e.selectedItems;
      n && this.quickInputService.quickAccess.show(n.prefix, { preserveValue: !0 });
    })), t.add(e.onDidChangeValue((n) => {
      const r = this.registry.getQuickAccessProvider(n.substr(sF.PREFIX.length));
      r && r.prefix && r.prefix !== sF.PREFIX && this.quickInputService.quickAccess.show(r.prefix, { preserveValue: !0 });
    })), e.items = this.getQuickAccessProviders().filter((n) => n.prefix !== sF.PREFIX), t;
  }
  getQuickAccessProviders() {
    return this.registry.getQuickAccessProviders().sort((t, n) => t.prefix.localeCompare(n.prefix)).flatMap((t) => this.createPicks(t));
  }
  createPicks(e) {
    return e.helpEntries.map((t) => {
      const n = t.prefix || e.prefix, r = n || "…";
      return {
        prefix: n,
        label: r,
        keybinding: t.commandId ? this.keybindingService.lookupKeybinding(t.commandId) : void 0,
        ariaLabel: S(1730, "{0}, {1}", r, t.description),
        description: t.description
      };
    });
  }
}, sF = UL, UL.PREFIX = "?", UL);
Vle = sF = kAt([
  INe(0, tc),
  INe(1, Fi)
], Vle);
Fs.as(ak.Quickaccess).registerQuickAccessProvider({
  ctor: Vle,
  prefix: "",
  helpEntries: [{ description: Ale.helpQuickAccessActionLabel }]
});
class s9e {
  constructor(e) {
    this.options = e, this.rangeHighlightDecorationId = void 0;
  }
  //#region Provider methods
  provide(e, t, n) {
    var o;
    const r = new ke();
    e.canAcceptInBackground = !!((o = this.options) != null && o.canAcceptInBackground), e.matchOnLabel = e.matchOnDescription = e.matchOnDetail = e.sortByLabel = !1;
    const s = r.add(new er());
    return s.value = this.doProvide(e, t, n), r.add(this.onDidActiveTextEditorControlChange(() => {
      s.value = void 0, s.value = this.doProvide(e, t);
    })), r;
  }
  doProvide(e, t, n) {
    const r = new ke(), s = this.activeTextEditorControl;
    if (s && this.canProvideWithTextEditor(s)) {
      const o = { editor: s }, a = MBe(s);
      if (a) {
        let l = s.saveViewState() ?? void 0;
        r.add(a.onDidChangeCursorPosition(() => {
          l = s.saveViewState() ?? void 0;
        })), o.restoreViewState = () => {
          l && s === this.activeTextEditorControl && s.restoreViewState(l);
        }, r.add(JL(t.onCancellationRequested)(() => {
          var c;
          return (c = o.restoreViewState) == null ? void 0 : c.call(o);
        }));
      }
      r.add(Et(() => this.clearDecorations(s))), r.add(this.provideWithTextEditor(o, e, t, n));
    } else
      r.add(this.provideWithoutTextEditor(e, t));
    return r;
  }
  /**
   * Subclasses to implement if they can operate on the text editor.
   */
  canProvideWithTextEditor(e) {
    return !0;
  }
  gotoLocation({ editor: e }, t) {
    e.setSelection(
      t.range,
      "code.jump"
      /* TextEditorSelectionSource.JUMP */
    ), e.revealRangeInCenter(
      t.range,
      0
      /* ScrollType.Smooth */
    ), t.preserveFocus || e.focus();
    const n = e.getModel();
    n && "getLineContent" in n && hb(`${n.getLineContent(t.range.startLineNumber)}`);
  }
  getModel(e) {
    var t;
    return Jge(e) ? (t = e.getModel()) == null ? void 0 : t.modified : e.getModel();
  }
  addDecorations(e, t) {
    e.changeDecorations((n) => {
      const r = [];
      this.rangeHighlightDecorationId && (r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId), r.push(this.rangeHighlightDecorationId.rangeHighlightId), this.rangeHighlightDecorationId = void 0);
      const s = [
        // highlight the entire line on the range
        {
          range: t,
          options: {
            description: "quick-access-range-highlight",
            className: "rangeHighlight",
            isWholeLine: !0
          }
        },
        // also add overview ruler highlight
        {
          range: t,
          options: {
            description: "quick-access-range-highlight-overview",
            overviewRuler: {
              color: Ks(f3e),
              position: zh.Full
            }
          }
        }
      ], [o, a] = n.deltaDecorations(r, s);
      this.rangeHighlightDecorationId = { rangeHighlightId: o, overviewRulerDecorationId: a };
    });
  }
  clearDecorations(e) {
    const t = this.rangeHighlightDecorationId;
    t && (e.changeDecorations((n) => {
      n.deltaDecorations([
        t.overviewRulerDecorationId,
        t.rangeHighlightId
      ], []);
    }), this.rangeHighlightDecorationId = void 0);
  }
}
const YG = class YG extends s9e {
  constructor() {
    super({ canAcceptInBackground: !0 });
  }
  provideWithoutTextEditor(e) {
    const t = S(1325, "Open a text editor first to go to a line.");
    return e.items = [{ label: t }], e.ariaLabel = t, ge.None;
  }
  provideWithTextEditor(e, t, n) {
    const r = e.editor, s = new ke();
    s.add(t.onDidAccept((l) => {
      const [c] = t.selectedItems;
      if (c) {
        if (!this.isValidLineNumber(r, c.lineNumber))
          return;
        this.gotoLocation(e, { range: this.toRange(c.lineNumber, c.column), keyMods: t.keyMods, preserveFocus: l.inBackground }), l.inBackground || t.hide();
      }
    }));
    const o = () => {
      const l = this.parsePosition(r, t.value.trim().substr(YG.PREFIX.length)), c = this.getPickLabel(r, l.lineNumber, l.column);
      if (t.items = [{
        lineNumber: l.lineNumber,
        column: l.column,
        label: c
      }], t.ariaLabel = c, !this.isValidLineNumber(r, l.lineNumber)) {
        this.clearDecorations(r);
        return;
      }
      const u = this.toRange(l.lineNumber, l.column);
      r.revealRangeInCenter(
        u,
        0
        /* ScrollType.Smooth */
      ), this.addDecorations(r, u);
    };
    o(), s.add(t.onDidChangeValue(() => o()));
    const a = MBe(r);
    return a && a.getOptions().get(
      76
      /* EditorOption.lineNumbers */
    ).renderType === 2 && (a.updateOptions({ lineNumbers: "on" }), s.add(Et(() => a.updateOptions({ lineNumbers: "relative" })))), s;
  }
  toRange(e = 1, t = 1) {
    return {
      startLineNumber: e,
      startColumn: t,
      endLineNumber: e,
      endColumn: t
    };
  }
  parsePosition(e, t) {
    const n = t.split(/,|:|#/).map((s) => parseInt(s, 10)).filter((s) => !isNaN(s)), r = this.lineCount(e) + 1;
    return {
      lineNumber: n[0] > 0 ? n[0] : r + n[0],
      column: n[1]
    };
  }
  getPickLabel(e, t, n) {
    if (this.isValidLineNumber(e, t))
      return this.isValidColumn(e, t, n) ? S(1326, "Go to line {0} and character {1}.", t, n) : S(1327, "Go to line {0}.", t);
    const r = e.getPosition() || { lineNumber: 1, column: 1 }, s = this.lineCount(e);
    return s > 1 ? S(1328, "Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.", r.lineNumber, r.column, s) : S(1329, "Current Line: {0}, Character: {1}. Type a line number to navigate to.", r.lineNumber, r.column);
  }
  isValidLineNumber(e, t) {
    return !t || typeof t != "number" ? !1 : t > 0 && t <= this.lineCount(e);
  }
  isValidColumn(e, t, n) {
    if (!n || typeof n != "number")
      return !1;
    const r = this.getModel(e);
    if (!r)
      return !1;
    const s = { lineNumber: t, column: n };
    return r.validatePosition(s).equals(s);
  }
  lineCount(e) {
    var t;
    return ((t = this.getModel(e)) == null ? void 0 : t.getLineCount()) ?? 0;
  }
};
YG.PREFIX = ":";
let Ule = YG;
var DAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, IAt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let I5 = class extends Ule {
  constructor(e) {
    super(), this.editorService = e, this.onDidActiveTextEditorControlChange = Ze.None;
  }
  get activeTextEditorControl() {
    return this.editorService.getFocusedCodeEditor() ?? void 0;
  }
};
I5 = DAt([
  IAt(0, Ti)
], I5);
var zL;
let o9e = (zL = class extends vt {
  constructor() {
    super({
      id: zL.ID,
      label: f$.gotoLineActionLabel,
      alias: "Go to Line/Column...",
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 2085,
        mac: {
          primary: 293
          /* KeyCode.KeyG */
        },
        weight: 100
        /* KeybindingWeight.EditorContrib */
      }
    });
  }
  run(e) {
    e.get(tc).quickAccess.show(I5.PREFIX);
  }
}, zL.ID = "editor.action.gotoLine", zL);
Je(o9e);
Fs.as(ak.Quickaccess).registerQuickAccessProvider({
  ctor: I5,
  prefix: I5.PREFIX,
  helpEntries: [{ description: f$.gotoLineActionLabel, commandId: o9e.ID }]
});
const a9e = [void 0, []];
function Ate(i, e, t = 0, n = 0) {
  const r = e;
  return r.values && r.values.length > 1 ? NAt(i, r.values, t, n) : l9e(i, e, t, n);
}
function NAt(i, e, t, n) {
  let r = 0;
  const s = [];
  for (const o of e) {
    const [a, l] = l9e(i, o, t, n);
    if (typeof a != "number")
      return a9e;
    r += a, s.push(...l);
  }
  return [r, RAt(s)];
}
function l9e(i, e, t, n) {
  const r = hT(e.original, e.originalLowercase, t, i, i.toLowerCase(), n, { firstMatchCanBeWeak: !0, boostFullMatch: !0 });
  return r ? [r[0], IB(r)] : a9e;
}
function RAt(i) {
  const e = i.sort((r, s) => r.start - s.start), t = [];
  let n;
  for (const r of e)
    !n || !AAt(n, r) ? (n = r, t.push(r)) : (n.start = Math.min(n.start, r.start), n.end = Math.max(n.end, r.end));
  return t;
}
function AAt(i, e) {
  return !(i.end < e.start || e.end < i.start);
}
function NNe(i) {
  return i.startsWith('"') && i.endsWith('"');
}
const c9e = " ";
function zle(i) {
  typeof i != "string" && (i = "");
  const e = i.toLowerCase(), { pathNormalized: t, normalized: n, normalizedLowercase: r } = RNe(i), s = t.indexOf(im) >= 0, o = NNe(i);
  let a;
  const l = i.split(c9e);
  if (l.length > 1)
    for (const c of l) {
      const u = NNe(c), { pathNormalized: d, normalized: h, normalizedLowercase: g } = RNe(c);
      h && (a || (a = []), a.push({
        original: c,
        originalLowercase: c.toLowerCase(),
        pathNormalized: d,
        normalized: h,
        normalizedLowercase: g,
        expectContiguousMatch: u
      }));
    }
  return { original: i, originalLowercase: e, pathNormalized: t, normalized: n, normalizedLowercase: r, values: a, containsPathSeparator: s, expectContiguousMatch: o };
}
function RNe(i) {
  let e;
  Za ? e = i.replace(/\//g, im) : e = i.replace(/\\/g, im);
  const t = e.replace(/[\*\u2026\s"]/g, "");
  return {
    pathNormalized: e,
    normalized: t,
    normalizedLowercase: t.toLowerCase()
  };
}
function ANe(i) {
  return Array.isArray(i) ? zle(i.map((e) => e.original).join(c9e)) : zle(i.original);
}
var OAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, ONe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, QW, Kp;
let jx = (Kp = class extends s9e {
  constructor(e, t, n = /* @__PURE__ */ Object.create(null)) {
    super(n), this._languageFeaturesService = e, this._outlineModelService = t, this.options = n, this.options.canAcceptInBackground = !0;
  }
  provideWithoutTextEditor(e) {
    return this.provideLabelPick(e, S(1330, "To go to a symbol, first open a text editor with symbol information.")), ge.None;
  }
  provideWithTextEditor(e, t, n, r) {
    const s = e.editor, o = this.getModel(s);
    return o ? this._languageFeaturesService.documentSymbolProvider.has(o) ? this.doProvideWithEditorSymbols(e, o, t, n, r) : this.doProvideWithoutEditorSymbols(e, o, t, n) : ge.None;
  }
  doProvideWithoutEditorSymbols(e, t, n, r) {
    const s = new ke();
    return this.provideLabelPick(n, S(1331, "The active text editor does not provide symbol information.")), (async () => !await this.waitForLanguageSymbolRegistry(t, s) || r.isCancellationRequested || s.add(this.doProvideWithEditorSymbols(e, t, n, r)))(), s;
  }
  provideLabelPick(e, t) {
    e.items = [{
      label: t,
      index: 0,
      kind: 14
      /* SymbolKind.String */
    }], e.ariaLabel = t;
  }
  async waitForLanguageSymbolRegistry(e, t) {
    if (this._languageFeaturesService.documentSymbolProvider.has(e))
      return !0;
    const n = new zT(), r = t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(() => {
      this._languageFeaturesService.documentSymbolProvider.has(e) && (r.dispose(), n.complete(!0));
    }));
    return t.add(Et(() => n.complete(!1))), n.p;
  }
  doProvideWithEditorSymbols(e, t, n, r, s) {
    var d;
    const o = e.editor, a = new ke();
    a.add(n.onDidAccept((h) => {
      var m;
      const [g] = n.selectedItems;
      g && g.range && (this.gotoLocation(e, { range: g.range.selection, keyMods: n.keyMods, preserveFocus: h.inBackground }), (m = s == null ? void 0 : s.handleAccept) == null || m.call(s, g, h.inBackground), h.inBackground || n.hide());
    })), a.add(n.onDidTriggerItemButton(({ item: h }) => {
      h && h.range && (this.gotoLocation(e, { range: h.range.selection, keyMods: n.keyMods, forceSideBySide: !0 }), n.hide());
    }));
    const l = this.getDocumentSymbols(t, r), c = a.add(new er()), u = async (h) => {
      var g;
      (g = c == null ? void 0 : c.value) == null || g.cancel(), n.busy = !1, c.value = new Ss(), n.busy = !0;
      try {
        const m = zle(n.value.substr(QW.PREFIX.length).trim()), _ = await this.doGetSymbolPicks(l, m, void 0, c.value.token, t);
        if (r.isCancellationRequested)
          return;
        if (_.length > 0) {
          if (n.items = _, h && m.original.length === 0) {
            const v = w4(_, (w) => !!(w.type !== "separator" && w.range && z.containsPosition(w.range.decoration, h)));
            v && (n.activeItems = [v]);
          }
        } else
          m.original.length > 0 ? this.provideLabelPick(n, S(1332, "No matching editor symbols")) : this.provideLabelPick(n, S(1333, "No editor symbols"));
      } finally {
        r.isCancellationRequested || (n.busy = !1);
      }
    };
    return a.add(n.onDidChangeValue(() => u(void 0))), u((d = o.getSelection()) == null ? void 0 : d.getPosition()), a.add(n.onDidChangeActive(() => {
      const [h] = n.activeItems;
      h && h.range && (o.revealRangeInCenter(
        h.range.selection,
        0
        /* ScrollType.Smooth */
      ), this.addDecorations(o, h.range.decoration));
    })), a;
  }
  async doGetSymbolPicks(e, t, n, r, s) {
    var v, w;
    const o = await e;
    if (r.isCancellationRequested)
      return [];
    const a = t.original.indexOf(QW.SCOPE_PREFIX) === 0, l = a ? 1 : 0;
    let c, u;
    t.values && t.values.length > 1 ? (c = ANe(t.values[0]), u = ANe(t.values.slice(1))) : c = t;
    let d;
    const h = (w = (v = this.options) == null ? void 0 : v.openSideBySideDirection) == null ? void 0 : w.call(v);
    h && (d = [{
      iconClass: h === "right" ? qt.asClassName(Pe.splitHorizontal) : qt.asClassName(Pe.splitVertical),
      tooltip: h === "right" ? S(1334, "Open to the Side") : S(1335, "Open to the Bottom")
    }]);
    const g = [];
    for (let E = 0; E < o.length; E++) {
      const L = o[E], T = ant(L.name), D = `$(${dU.toIcon(L.kind).id}) ${T}`, N = D.length - T.length;
      let R = L.containerName;
      n != null && n.extraContainerLabel && (R ? R = `${n.extraContainerLabel} • ${R}` : R = n.extraContainerLabel);
      let M, B, H, j;
      if (t.original.length > l) {
        let X = !1;
        if (c !== t && ([M, B] = Ate(D, {
          ...t,
          values: void 0
          /* disable multi-query support */
        }, l, N), typeof M == "number" && (X = !0)), typeof M != "number" && ([M, B] = Ate(D, c, l, N), typeof M != "number"))
          continue;
        if (!X && u) {
          if (R && u.original.length > 0 && ([H, j] = Ate(R, u)), typeof H != "number")
            continue;
          typeof M == "number" && (M += H);
        }
      }
      const K = L.tags && L.tags.indexOf(
        1
        /* SymbolTag.Deprecated */
      ) >= 0;
      g.push({
        index: E,
        kind: L.kind,
        score: M,
        label: D,
        ariaLabel: kdt(L.name, L.kind),
        description: R,
        highlights: K ? void 0 : {
          label: B,
          description: j
        },
        range: {
          selection: z.collapseToStart(L.selectionRange),
          decoration: L.range
        },
        uri: s.uri,
        symbolName: T,
        strikethrough: K,
        buttons: d
      });
    }
    const m = g.sort((E, L) => a ? this.compareByKindAndScore(E, L) : this.compareByScore(E, L));
    let _ = [];
    if (a) {
      let D = function() {
        L && typeof E == "number" && T > 0 && (L.label = tT(Mte[E] || Ote, T));
      }, E, L, T = 0;
      for (const N of m)
        E !== N.kind ? (D(), E = N.kind, T = 1, L = { type: "separator" }, _.push(L)) : T++, _.push(N);
      D();
    } else m.length > 0 && (_ = [
      { label: S(1336, "symbols ({0})", g.length), type: "separator" },
      ...m
    ]);
    return _;
  }
  compareByScore(e, t) {
    if (typeof e.score != "number" && typeof t.score == "number")
      return 1;
    if (typeof e.score == "number" && typeof t.score != "number")
      return -1;
    if (typeof e.score == "number" && typeof t.score == "number") {
      if (e.score > t.score)
        return -1;
      if (e.score < t.score)
        return 1;
    }
    return e.index < t.index ? -1 : e.index > t.index ? 1 : 0;
  }
  compareByKindAndScore(e, t) {
    const n = Mte[e.kind] || Ote, r = Mte[t.kind] || Ote, s = n.localeCompare(r);
    return s === 0 ? this.compareByScore(e, t) : s;
  }
  async getDocumentSymbols(e, t) {
    const n = await this._outlineModelService.getOrCreate(e, t);
    return t.isCancellationRequested ? [] : n.asListOfDocumentSymbols();
  }
}, QW = Kp, Kp.PREFIX = "@", Kp.SCOPE_PREFIX = ":", Kp.PREFIX_BY_CATEGORY = `${Kp.PREFIX}${Kp.SCOPE_PREFIX}`, Kp);
jx = QW = OAt([
  ONe(0, St),
  ONe(1, YB)
], jx);
const Ote = S(1337, "properties ({0})"), Mte = {
  5: S(1338, "methods ({0})"),
  11: S(1339, "functions ({0})"),
  8: S(1340, "constructors ({0})"),
  12: S(1341, "variables ({0})"),
  4: S(1342, "classes ({0})"),
  22: S(1343, "structs ({0})"),
  23: S(1344, "events ({0})"),
  24: S(1345, "operators ({0})"),
  10: S(1346, "interfaces ({0})"),
  2: S(1347, "namespaces ({0})"),
  3: S(1348, "packages ({0})"),
  25: S(1349, "type parameters ({0})"),
  1: S(1350, "modules ({0})"),
  6: S(1351, "properties ({0})"),
  9: S(1352, "enumerations ({0})"),
  21: S(1353, "enumeration members ({0})"),
  14: S(1354, "strings ({0})"),
  0: S(1355, "files ({0})"),
  17: S(1356, "arrays ({0})"),
  15: S(1357, "numbers ({0})"),
  16: S(1358, "booleans ({0})"),
  18: S(1359, "objects ({0})"),
  19: S(1360, "keys ({0})"),
  7: S(1361, "fields ({0})"),
  13: S(1362, "constants ({0})")
};
var MAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Pte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let $le = class extends jx {
  constructor(e, t, n) {
    super(t, n), this.editorService = e, this.onDidActiveTextEditorControlChange = Ze.None;
  }
  get activeTextEditorControl() {
    return this.editorService.getFocusedCodeEditor() ?? void 0;
  }
};
$le = MAt([
  Pte(0, Ti),
  Pte(1, St),
  Pte(2, YB)
], $le);
const XG = class XG extends vt {
  constructor() {
    super({
      id: XG.ID,
      label: k5.quickOutlineActionLabel,
      alias: "Go to Symbol...",
      precondition: se.hasDocumentSymbolProvider,
      kbOpts: {
        kbExpr: se.focus,
        primary: 3117,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      contextMenuOpts: {
        group: "navigation",
        order: 3
      }
    });
  }
  run(e) {
    e.get(tc).quickAccess.show(jx.PREFIX, { itemActivation: Bp.NONE });
  }
};
XG.ID = "editor.action.quickOutline";
let m$ = XG;
Je(m$);
Fs.as(ak.Quickaccess).registerQuickAccessProvider({
  ctor: $le,
  prefix: jx.PREFIX,
  helpEntries: [
    { description: k5.quickOutlineActionLabel, prefix: jx.PREFIX, commandId: m$.ID },
    { description: k5.quickOutlineByCategoryActionLabel, prefix: jx.PREFIX_BY_CATEGORY }
  ]
});
function PAt(i) {
  const e = /* @__PURE__ */ new Map();
  for (const t of i)
    e.set(t, (e.get(t) ?? 0) + 1);
  return e;
}
class o3 {
  constructor() {
    this.chunkCount = 0, this.chunkOccurrences = /* @__PURE__ */ new Map(), this.documents = /* @__PURE__ */ new Map();
  }
  calculateScores(e, t) {
    const n = this.computeEmbedding(e), r = /* @__PURE__ */ new Map(), s = [];
    for (const [o, a] of this.documents) {
      if (t.isCancellationRequested)
        return [];
      for (const l of a.chunks) {
        const c = this.computeSimilarityScore(l, n, r);
        c > 0 && s.push({ key: o, score: c });
      }
    }
    return s;
  }
  /**
   * Count how many times each term (word) appears in a string.
   */
  static termFrequencies(e) {
    return PAt(o3.splitTerms(e));
  }
  /**
   * Break a string into terms (words).
   */
  static *splitTerms(e) {
    const t = (n) => n.toLowerCase();
    for (const [n] of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b", "gu"))) {
      yield t(n);
      const r = n.replace(/([a-z])([A-Z])/g, "$1 $2").split(/\s+/g);
      if (r.length > 1)
        for (const s of r)
          s.length > 2 && new RegExp("\\p{Letter}{3,}", "gu").test(s) && (yield t(s));
    }
  }
  updateDocuments(e) {
    for (const { key: t } of e)
      this.deleteDocument(t);
    for (const t of e) {
      const n = [];
      for (const r of t.textChunks) {
        const s = o3.termFrequencies(r);
        for (const o of s.keys())
          this.chunkOccurrences.set(o, (this.chunkOccurrences.get(o) ?? 0) + 1);
        n.push({ text: r, tf: s });
      }
      this.chunkCount += n.length, this.documents.set(t.key, { chunks: n });
    }
    return this;
  }
  deleteDocument(e) {
    const t = this.documents.get(e);
    if (t) {
      this.documents.delete(e), this.chunkCount -= t.chunks.length;
      for (const n of t.chunks)
        for (const r of n.tf.keys()) {
          const s = this.chunkOccurrences.get(r);
          if (typeof s == "number") {
            const o = s - 1;
            o <= 0 ? this.chunkOccurrences.delete(r) : this.chunkOccurrences.set(r, o);
          }
        }
    }
  }
  computeSimilarityScore(e, t, n) {
    let r = 0;
    for (const [s, o] of Object.entries(t)) {
      const a = e.tf.get(s);
      if (!a)
        continue;
      let l = n.get(s);
      typeof l != "number" && (l = this.computeIdf(s), n.set(s, l));
      const c = a * l;
      r += c * o;
    }
    return r;
  }
  computeEmbedding(e) {
    const t = o3.termFrequencies(e);
    return this.computeTfidf(t);
  }
  computeIdf(e) {
    const t = this.chunkOccurrences.get(e) ?? 0;
    return t > 0 ? Math.log((this.chunkCount + 1) / t) : 0;
  }
  computeTfidf(e) {
    const t = /* @__PURE__ */ Object.create(null);
    for (const [n, r] of e) {
      const s = this.computeIdf(n);
      s > 0 && (t[n] = r * s);
    }
    return t;
  }
}
function FAt(i) {
  var n;
  const e = i.slice(0);
  e.sort((r, s) => s.score - r.score);
  const t = ((n = e[0]) == null ? void 0 : n.score) ?? 0;
  if (t > 0)
    for (const r of e)
      r.score /= t;
  return e;
}
var vN;
(function(i) {
  i[i.NO_ACTION = 0] = "NO_ACTION", i[i.CLOSE_PICKER = 1] = "CLOSE_PICKER", i[i.REFRESH_PICKER = 2] = "REFRESH_PICKER", i[i.REMOVE_ITEM = 3] = "REMOVE_ITEM";
})(vN || (vN = {}));
function Fte(i) {
  return Array.isArray(i.items);
}
function MNe(i) {
  const e = i;
  return !!e.picks && e.additionalPicks instanceof Promise;
}
class BAt extends ge {
  constructor(e, t) {
    super(), this.prefix = e, this.options = t;
  }
  provide(e, t, n) {
    var c;
    const r = new ke();
    e.canAcceptInBackground = !!((c = this.options) != null && c.canAcceptInBackground), e.matchOnLabel = e.matchOnDescription = e.matchOnDetail = e.sortByLabel = !1;
    let s;
    const o = r.add(new er()), a = async () => {
      var v;
      s == null || s.dispose(!0), e.busy = !1;
      const u = o.value = new ke();
      s = u.add(new Ss(t));
      const d = s.token;
      let h = e.value.substring(this.prefix.length);
      (v = this.options) != null && v.shouldSkipTrimPickFilter || (h = h.trim());
      const g = this._getPicks(h, u, d, n), m = (w, E) => {
        var D;
        let L, T;
        if (Fte(w) ? (L = w.items, T = w.active) : L = w, L.length === 0) {
          if (E)
            return !1;
          (h.length > 0 || e.hideInput) && ((D = this.options) != null && D.noResultsPick) && (ZL(this.options.noResultsPick) ? L = [this.options.noResultsPick(h)] : L = [this.options.noResultsPick]);
        }
        return e.items = L, T && (e.activeItems = [T]), !0;
      }, _ = async (w) => {
        let E = !1, L = !1;
        await Promise.all([
          // Fast Picks: if `mergeDelay` is configured, in order to reduce
          // amount of flicker, we race against the slow picks over some delay
          // and then set the fast picks.
          // If the slow picks are faster, we reduce the flicker by only
          // setting the items once.
          (async () => {
            typeof w.mergeDelay == "number" && (await db(w.mergeDelay), d.isCancellationRequested) || L || (E = m(
              w.picks,
              !0
              /* skip over empty to reduce flicker */
            ));
          })(),
          // Slow Picks: we await the slow picks and then set them at
          // once together with the fast picks, but only if we actually
          // have additional results.
          (async () => {
            e.busy = !0;
            try {
              const T = await w.additionalPicks;
              if (d.isCancellationRequested)
                return;
              let D, N;
              Fte(w.picks) ? (D = w.picks.items, N = w.picks.active) : D = w.picks;
              let R, M;
              if (Fte(T) ? (R = T.items, M = T.active) : R = T, R.length > 0 || !E) {
                let B;
                if (!N && !M) {
                  const H = e.activeItems[0];
                  H && D.indexOf(H) !== -1 && (B = H);
                }
                m({
                  items: [...D, ...R],
                  active: N || M || B
                });
              }
            } finally {
              d.isCancellationRequested || (e.busy = !1), L = !0;
            }
          })()
        ]);
      };
      if (g !== null) if (MNe(g))
        await _(g);
      else if (!(g instanceof Promise))
        m(g);
      else {
        e.busy = !0;
        try {
          const w = await g;
          if (d.isCancellationRequested)
            return;
          MNe(w) ? await _(w) : m(w);
        } finally {
          d.isCancellationRequested || (e.busy = !1);
        }
      }
    };
    r.add(e.onDidChangeValue(() => a())), a(), r.add(e.onDidAccept((u) => {
      var h;
      if (n != null && n.handleAccept) {
        u.inBackground || e.hide(), (h = n.handleAccept) == null || h.call(n, e.activeItems[0], u.inBackground);
        return;
      }
      const [d] = e.selectedItems;
      typeof (d == null ? void 0 : d.accept) == "function" && (u.inBackground || e.hide(), d.accept(e.keyMods, u));
    }));
    const l = async (u, d) => {
      var g;
      if (typeof d.trigger != "function")
        return;
      const h = ((g = d.buttons) == null ? void 0 : g.indexOf(u)) ?? -1;
      if (h >= 0) {
        const m = d.trigger(h, e.keyMods), _ = typeof m == "number" ? m : await m;
        if (t.isCancellationRequested)
          return;
        switch (_) {
          case vN.NO_ACTION:
            break;
          case vN.CLOSE_PICKER:
            e.hide();
            break;
          case vN.REFRESH_PICKER:
            a();
            break;
          case vN.REMOVE_ITEM: {
            const v = e.items.indexOf(d);
            if (v !== -1) {
              const w = e.items.slice(), E = w.splice(v, 1), L = e.activeItems.filter((D) => D !== E[0]), T = e.keepScrollPosition;
              e.keepScrollPosition = !0, e.items = w, L && (e.activeItems = L), e.keepScrollPosition = T;
            }
            break;
          }
        }
      }
    };
    return r.add(e.onDidTriggerItemButton(({ button: u, item: d }) => l(u, d))), r.add(e.onDidTriggerSeparatorButton(({ button: u, separator: d }) => l(u, d))), r;
  }
}
var u9e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, e1 = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, IE, zo, Z_;
let jle = (Z_ = class extends BAt {
  constructor(e, t, n, r, s, o) {
    super(IE.PREFIX, e), this.keybindingService = n, this.commandService = r, this.telemetryService = s, this.dialogService = o, this.commandsHistory = this._register(t.createInstance(Gle)), this.options = e;
  }
  async _getPicks(e, t, n, r) {
    var g, m;
    const s = await this.getCommandPicks(n);
    if (n.isCancellationRequested)
      return [];
    const o = JL(() => {
      const _ = new o3();
      _.updateDocuments(s.map((w) => ({
        key: w.commandId,
        textChunks: [this.getTfIdfChunk(w)]
      })));
      const v = _.calculateScores(e, n);
      return FAt(v).filter((w) => w.score > IE.TFIDF_THRESHOLD).slice(0, IE.TFIDF_MAX_RESULTS);
    }), a = [];
    for (const _ of s) {
      const v = IE.WORD_FILTER(e, _.label) ?? void 0, w = _.commandAlias ? IE.WORD_FILTER(e, _.commandAlias) ?? void 0 : void 0;
      if (v || w)
        _.highlights = {
          label: v,
          detail: this.options.showAlias ? w : void 0
        }, a.push(_);
      else if (e === _.commandId)
        a.push(_);
      else if (e.length >= 3) {
        const E = o();
        if (n.isCancellationRequested)
          return [];
        const L = E.find((T) => T.key === _.commandId);
        L && (_.tfIdfScore = L.score, a.push(_));
      }
    }
    const l = /* @__PURE__ */ new Map();
    for (const _ of a) {
      const v = l.get(_.label);
      v ? (_.description = _.commandId, v.description = v.commandId) : l.set(_.label, _);
    }
    a.sort((_, v) => {
      if (_.tfIdfScore && v.tfIdfScore)
        return _.tfIdfScore === v.tfIdfScore ? _.label.localeCompare(v.label) : v.tfIdfScore - _.tfIdfScore;
      if (_.tfIdfScore)
        return 1;
      if (v.tfIdfScore)
        return -1;
      const w = this.commandsHistory.peek(_.commandId), E = this.commandsHistory.peek(v.commandId);
      if (w && E)
        return w > E ? -1 : 1;
      if (w)
        return -1;
      if (E)
        return 1;
      if (this.options.suggestedCommandIds) {
        const L = this.options.suggestedCommandIds.has(_.commandId), T = this.options.suggestedCommandIds.has(v.commandId);
        if (L && T)
          return 0;
        if (L)
          return -1;
        if (T)
          return 1;
      }
      return _.label.localeCompare(v.label);
    });
    const c = [];
    let u = !1, d = !0, h = !!this.options.suggestedCommandIds;
    for (let _ = 0; _ < a.length; _++) {
      const v = a[_];
      _ === 0 && this.commandsHistory.peek(v.commandId) && (c.push({ type: "separator", label: S(1723, "recently used") }), u = !0), d && v.tfIdfScore !== void 0 && (c.push({ type: "separator", label: S(1724, "similar commands") }), d = !1), h && v.tfIdfScore === void 0 && !this.commandsHistory.peek(v.commandId) && ((g = this.options.suggestedCommandIds) != null && g.has(v.commandId)) && (c.push({ type: "separator", label: S(1725, "commonly used") }), u = !0, h = !1), u && v.tfIdfScore === void 0 && !this.commandsHistory.peek(v.commandId) && !((m = this.options.suggestedCommandIds) != null && m.has(v.commandId)) && (c.push({ type: "separator", label: S(1726, "other commands") }), u = !1), c.push(this.toCommandPick(v, r));
    }
    return this.hasAdditionalCommandPicks(e, n) ? {
      picks: c,
      additionalPicks: (async () => {
        var w;
        const _ = await this.getAdditionalCommandPicks(s, a, e, n);
        if (n.isCancellationRequested)
          return [];
        const v = _.map((E) => this.toCommandPick(E, r));
        return d && ((w = v[0]) == null ? void 0 : w.type) !== "separator" && v.unshift({ type: "separator", label: S(1727, "similar commands") }), v;
      })()
    } : c;
  }
  toCommandPick(e, t) {
    if (e.type === "separator")
      return e;
    const n = this.keybindingService.lookupKeybinding(e.commandId), r = n ? S(1728, "{0}, {1}", e.label, n.getAriaLabel()) : e.label;
    return {
      ...e,
      ariaLabel: r,
      detail: this.options.showAlias && e.commandAlias !== e.label ? e.commandAlias : void 0,
      keybinding: n,
      accept: async () => {
        var s;
        this.commandsHistory.push(e.commandId), this.telemetryService.publicLog2("workbenchActionExecuted", {
          id: e.commandId,
          from: (t == null ? void 0 : t.from) ?? "quick open"
        });
        try {
          (s = e.args) != null && s.length ? await this.commandService.executeCommand(e.commandId, ...e.args) : await this.commandService.executeCommand(e.commandId);
        } catch (o) {
          Xh(o) || this.dialogService.error(S(1729, "Command '{0}' resulted in an error", e.label), QU(o));
        }
      }
    };
  }
  // TF-IDF string to be indexed
  getTfIdfChunk({ label: e, commandAlias: t, commandDescription: n }) {
    let r = e;
    return t && t !== e && (r += ` - ${t}`), n && n.value !== e && (r += ` - ${n.value === n.original ? n.value : `${n.value} (${n.original})`}`), r;
  }
}, IE = Z_, Z_.PREFIX = ">", Z_.TFIDF_THRESHOLD = 0.5, Z_.TFIDF_MAX_RESULTS = 5, Z_.WORD_FILTER = lge(B4, Smt, b4e), Z_);
jle = IE = u9e([
  e1(1, xt),
  e1(2, Fi),
  e1(3, jr),
  e1(4, rc),
  e1(5, XB)
], jle);
var Yp;
let Gle = (Yp = class extends ge {
  constructor(e, t, n) {
    super(), this.storageService = e, this.configurationService = t, this.logService = n, this.configuredCommandsHistoryLength = 0, this.updateConfiguration(), this.load(), this.registerListeners();
  }
  registerListeners() {
    this._register(this.configurationService.onDidChangeConfiguration((e) => this.updateConfiguration(e))), this._register(this.storageService.onWillSaveState((e) => {
      e.reason === I1.SHUTDOWN && this.saveState();
    }));
  }
  updateConfiguration(e) {
    e && !e.affectsConfiguration("workbench.commandPalette.history") || (this.configuredCommandsHistoryLength = zo.getConfiguredCommandHistoryLength(this.configurationService), zo.cache && zo.cache.limit !== this.configuredCommandsHistoryLength && (zo.cache.limit = this.configuredCommandsHistoryLength, zo.hasChanges = !0));
  }
  load() {
    const e = this.storageService.get(
      zo.PREF_KEY_CACHE,
      0
      /* StorageScope.PROFILE */
    );
    let t;
    if (e)
      try {
        t = JSON.parse(e);
      } catch (r) {
        this.logService.error(`[CommandsHistory] invalid data: ${r}`);
      }
    const n = zo.cache = new Tb(this.configuredCommandsHistoryLength, 1);
    if (t) {
      let r;
      t.usesLRU ? r = t.entries : r = t.entries.sort((s, o) => s.value - o.value), r.forEach((s) => n.set(s.key, s.value));
    }
    zo.counter = this.storageService.getNumber(zo.PREF_KEY_COUNTER, 0, zo.counter);
  }
  push(e) {
    zo.cache && (zo.cache.set(e, zo.counter++), zo.hasChanges = !0);
  }
  peek(e) {
    var t;
    return (t = zo.cache) == null ? void 0 : t.peek(e);
  }
  saveState() {
    if (!zo.cache || !zo.hasChanges)
      return;
    const e = { usesLRU: !0, entries: [] };
    zo.cache.forEach((t, n) => e.entries.push({ key: n, value: t })), this.storageService.store(
      zo.PREF_KEY_CACHE,
      JSON.stringify(e),
      0,
      0
      /* StorageTarget.USER */
    ), this.storageService.store(
      zo.PREF_KEY_COUNTER,
      zo.counter,
      0,
      0
      /* StorageTarget.USER */
    ), zo.hasChanges = !1;
  }
  static getConfiguredCommandHistoryLength(e) {
    var r, s;
    const n = (s = (r = e.getValue().workbench) == null ? void 0 : r.commandPalette) == null ? void 0 : s.history;
    return typeof n == "number" ? n : zo.DEFAULT_COMMANDS_HISTORY_LENGTH;
  }
}, zo = Yp, Yp.DEFAULT_COMMANDS_HISTORY_LENGTH = 50, Yp.PREF_KEY_CACHE = "commandPalette.mru.cache", Yp.PREF_KEY_COUNTER = "commandPalette.mru.counter", Yp.counter = 1, Yp.hasChanges = !1, Yp);
Gle = zo = u9e([
  e1(0, gu),
  e1(1, xn),
  e1(2, $r)
], Gle);
class HAt extends jle {
  constructor(e, t, n, r, s, o) {
    super(e, t, n, r, s, o);
  }
  getCodeEditorCommandPicks() {
    var n;
    const e = this.activeTextEditorControl;
    if (!e)
      return [];
    const t = [];
    for (const r of e.getSupportedActions()) {
      let s;
      (n = r.metadata) != null && n.description && (yyt(r.metadata.description) ? s = r.metadata.description : s = { original: r.metadata.description, value: r.metadata.description }), t.push({
        commandId: r.id,
        commandAlias: r.alias,
        commandDescription: s,
        label: gge(r.label) || r.id
      });
    }
    return t;
  }
}
var WAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, AI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let N5 = class extends HAt {
  get activeTextEditorControl() {
    return this.codeEditorService.getFocusedCodeEditor() ?? void 0;
  }
  constructor(e, t, n, r, s, o) {
    super({ showAlias: !1 }, e, n, r, s, o), this.codeEditorService = t;
  }
  async getCommandPicks() {
    return this.getCodeEditorCommandPicks();
  }
  hasAdditionalCommandPicks() {
    return !1;
  }
  async getAdditionalCommandPicks() {
    return [];
  }
};
N5 = WAt([
  AI(0, xt),
  AI(1, Ti),
  AI(2, Fi),
  AI(3, jr),
  AI(4, rc),
  AI(5, XB)
], N5);
const ZG = class ZG extends vt {
  constructor() {
    super({
      id: ZG.ID,
      label: g$.quickCommandActionLabel,
      alias: "Command Palette",
      precondition: void 0,
      kbOpts: {
        kbExpr: se.focus,
        primary: 59,
        weight: 100
        /* KeybindingWeight.EditorContrib */
      },
      contextMenuOpts: {
        group: "z_commands",
        order: 1
      }
    });
  }
  run(e) {
    e.get(tc).quickAccess.show(N5.PREFIX);
  }
};
ZG.ID = "editor.action.quickCommand";
let _$ = ZG;
Je(_$);
Fs.as(ak.Quickaccess).registerQuickAccessProvider({
  ctor: N5,
  prefix: N5.PREFIX,
  helpEntries: [{ description: g$.quickCommandHelp, commandId: _$.ID }]
});
var VAt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, OI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let qle = class extends TT {
  constructor(e, t, n, r, s, o, a) {
    super(!0, e, t, n, r, s, o, a);
  }
};
qle = VAt([
  OI(1, Jt),
  OI(2, Ti),
  OI(3, no),
  OI(4, xt),
  OI(5, gu),
  OI(6, xn)
], qle);
Si(
  TT.ID,
  qle,
  4
  /* EditorContributionInstantiation.Lazy */
);
class UAt {
  constructor(e, t, n, r, s) {
    this._parsedThemeRuleBrand = void 0, this.token = e, this.index = t, this.fontStyle = n, this.foreground = r, this.background = s;
  }
}
function zAt(i) {
  if (!i || !Array.isArray(i))
    return [];
  const e = [];
  let t = 0;
  for (let n = 0, r = i.length; n < r; n++) {
    const s = i[n];
    let o = -1;
    if (typeof s.fontStyle == "string") {
      o = 0;
      const c = s.fontStyle.split(" ");
      for (let u = 0, d = c.length; u < d; u++)
        switch (c[u]) {
          case "italic":
            o = o | 1;
            break;
          case "bold":
            o = o | 2;
            break;
          case "underline":
            o = o | 4;
            break;
          case "strikethrough":
            o = o | 8;
            break;
        }
    }
    let a = null;
    typeof s.foreground == "string" && (a = s.foreground);
    let l = null;
    typeof s.background == "string" && (l = s.background), e[t++] = new UAt(s.token || "", n, o, a, l);
  }
  return e;
}
function $At(i, e) {
  i.sort((u, d) => {
    const h = YAt(u.token, d.token);
    return h !== 0 ? h : u.index - d.index;
  });
  let t = 0, n = "000000", r = "ffffff";
  for (; i.length >= 1 && i[0].token === ""; ) {
    const u = i.shift();
    u.fontStyle !== -1 && (t = u.fontStyle), u.foreground !== null && (n = u.foreground), u.background !== null && (r = u.background);
  }
  const s = new GAt();
  for (const u of e)
    s.getId(u);
  const o = s.getId(n), a = s.getId(r), l = new sme(t, o, a), c = new ome(l);
  for (let u = 0, d = i.length; u < d; u++) {
    const h = i[u];
    c.insert(h.token, h.fontStyle, s.getId(h.foreground), s.getId(h.background));
  }
  return new d9e(s, c);
}
const jAt = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;
class GAt {
  constructor() {
    this._lastColorId = 0, this._id2color = [], this._color2id = /* @__PURE__ */ new Map();
  }
  getId(e) {
    if (e === null)
      return 0;
    const t = e.match(jAt);
    if (!t)
      throw new Error("Illegal value for token color: " + e);
    e = t[1].toUpperCase();
    let n = this._color2id.get(e);
    return n || (n = ++this._lastColorId, this._color2id.set(e, n), this._id2color[n] = De.fromHex("#" + e), n);
  }
  getColorMap() {
    return this._id2color.slice(0);
  }
}
class d9e {
  static createFromRawTokenTheme(e, t) {
    return this.createFromParsedTokenTheme(zAt(e), t);
  }
  static createFromParsedTokenTheme(e, t) {
    return $At(e, t);
  }
  constructor(e, t) {
    this._colorMap = e, this._root = t, this._cache = /* @__PURE__ */ new Map();
  }
  getColorMap() {
    return this._colorMap.getColorMap();
  }
  _match(e) {
    return this._root.match(e);
  }
  match(e, t) {
    let n = this._cache.get(t);
    if (typeof n > "u") {
      const r = this._match(t), s = KAt(t);
      n = (r.metadata | s << 8) >>> 0, this._cache.set(t, n);
    }
    return (n | e << 0) >>> 0;
  }
}
const qAt = /\b(comment|string|regex|regexp)\b/;
function KAt(i) {
  const e = i.match(qAt);
  if (!e)
    return 0;
  switch (e[1]) {
    case "comment":
      return 1;
    case "string":
      return 2;
    case "regex":
      return 3;
    case "regexp":
      return 3;
  }
  throw new Error("Unexpected match for standard token type!");
}
function YAt(i, e) {
  return i < e ? -1 : i > e ? 1 : 0;
}
class sme {
  constructor(e, t, n) {
    this._themeTrieElementRuleBrand = void 0, this._fontStyle = e, this._foreground = t, this._background = n, this.metadata = (this._fontStyle << 11 | this._foreground << 15 | this._background << 24) >>> 0;
  }
  clone() {
    return new sme(this._fontStyle, this._foreground, this._background);
  }
  acceptOverwrite(e, t, n) {
    e !== -1 && (this._fontStyle = e), t !== 0 && (this._foreground = t), n !== 0 && (this._background = n), this.metadata = (this._fontStyle << 11 | this._foreground << 15 | this._background << 24) >>> 0;
  }
}
class ome {
  constructor(e) {
    this._themeTrieElementBrand = void 0, this._mainRule = e, this._children = /* @__PURE__ */ new Map();
  }
  match(e) {
    if (e === "")
      return this._mainRule;
    const t = e.indexOf(".");
    let n, r;
    t === -1 ? (n = e, r = "") : (n = e.substring(0, t), r = e.substring(t + 1));
    const s = this._children.get(n);
    return typeof s < "u" ? s.match(r) : this._mainRule;
  }
  insert(e, t, n, r) {
    if (e === "") {
      this._mainRule.acceptOverwrite(t, n, r);
      return;
    }
    const s = e.indexOf(".");
    let o, a;
    s === -1 ? (o = e, a = "") : (o = e.substring(0, s), a = e.substring(s + 1));
    let l = this._children.get(o);
    typeof l > "u" && (l = new ome(this._mainRule.clone()), this._children.set(o, l)), l.insert(a, t, n, r);
  }
}
function XAt(i) {
  const e = [];
  for (let t = 1, n = i.length; t < n; t++) {
    const r = i[t];
    e[t] = `.mtk${t} { color: ${r}; }`;
  }
  return e.push(".mtki { font-style: italic; }"), e.push(".mtkb { font-weight: bold; }"), e.push(".mtku { text-decoration: underline; text-underline-position: under; }"), e.push(".mtks { text-decoration: line-through; }"), e.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"), e.join(`
`);
}
const ZAt = {
  base: "vs",
  inherit: !1,
  rules: [
    { token: "", foreground: "000000", background: "fffffe" },
    { token: "invalid", foreground: "cd3131" },
    { token: "emphasis", fontStyle: "italic" },
    { token: "strong", fontStyle: "bold" },
    { token: "variable", foreground: "001188" },
    { token: "variable.predefined", foreground: "4864AA" },
    { token: "constant", foreground: "dd0000" },
    { token: "comment", foreground: "008000" },
    { token: "number", foreground: "098658" },
    { token: "number.hex", foreground: "3030c0" },
    { token: "regexp", foreground: "800000" },
    { token: "annotation", foreground: "808080" },
    { token: "type", foreground: "008080" },
    { token: "delimiter", foreground: "000000" },
    { token: "delimiter.html", foreground: "383838" },
    { token: "delimiter.xml", foreground: "0000FF" },
    { token: "tag", foreground: "800000" },
    { token: "tag.id.pug", foreground: "4F76AC" },
    { token: "tag.class.pug", foreground: "4F76AC" },
    { token: "meta.scss", foreground: "800000" },
    { token: "metatag", foreground: "e00000" },
    { token: "metatag.content.html", foreground: "FF0000" },
    { token: "metatag.html", foreground: "808080" },
    { token: "metatag.xml", foreground: "808080" },
    { token: "metatag.php", fontStyle: "bold" },
    { token: "key", foreground: "863B00" },
    { token: "string.key.json", foreground: "A31515" },
    { token: "string.value.json", foreground: "0451A5" },
    { token: "attribute.name", foreground: "FF0000" },
    { token: "attribute.value", foreground: "0451A5" },
    { token: "attribute.value.number", foreground: "098658" },
    { token: "attribute.value.unit", foreground: "098658" },
    { token: "attribute.value.html", foreground: "0000FF" },
    { token: "attribute.value.xml", foreground: "0000FF" },
    { token: "string", foreground: "A31515" },
    { token: "string.html", foreground: "0000FF" },
    { token: "string.sql", foreground: "FF0000" },
    { token: "string.yaml", foreground: "0451A5" },
    { token: "keyword", foreground: "0000FF" },
    { token: "keyword.json", foreground: "0451A5" },
    { token: "keyword.flow", foreground: "AF00DB" },
    { token: "keyword.flow.scss", foreground: "0000FF" },
    { token: "operator.scss", foreground: "666666" },
    { token: "operator.sql", foreground: "778899" },
    { token: "operator.swift", foreground: "666666" },
    { token: "predefined.sql", foreground: "C700C7" }
  ],
  colors: {
    [yo]: "#FFFFFE",
    [kb]: "#000000",
    [OFe]: "#E5EBF1",
    [TB]: "#D3D3D3",
    [kB]: "#939393",
    [yfe]: "#ADD6FF4D"
  }
}, QAt = {
  base: "vs-dark",
  inherit: !1,
  rules: [
    { token: "", foreground: "D4D4D4", background: "1E1E1E" },
    { token: "invalid", foreground: "f44747" },
    { token: "emphasis", fontStyle: "italic" },
    { token: "strong", fontStyle: "bold" },
    { token: "variable", foreground: "74B0DF" },
    { token: "variable.predefined", foreground: "4864AA" },
    { token: "variable.parameter", foreground: "9CDCFE" },
    { token: "constant", foreground: "569CD6" },
    { token: "comment", foreground: "608B4E" },
    { token: "number", foreground: "B5CEA8" },
    { token: "number.hex", foreground: "5BB498" },
    { token: "regexp", foreground: "B46695" },
    { token: "annotation", foreground: "cc6666" },
    { token: "type", foreground: "3DC9B0" },
    { token: "delimiter", foreground: "DCDCDC" },
    { token: "delimiter.html", foreground: "808080" },
    { token: "delimiter.xml", foreground: "808080" },
    { token: "tag", foreground: "569CD6" },
    { token: "tag.id.pug", foreground: "4F76AC" },
    { token: "tag.class.pug", foreground: "4F76AC" },
    { token: "meta.scss", foreground: "A79873" },
    { token: "meta.tag", foreground: "CE9178" },
    { token: "metatag", foreground: "DD6A6F" },
    { token: "metatag.content.html", foreground: "9CDCFE" },
    { token: "metatag.html", foreground: "569CD6" },
    { token: "metatag.xml", foreground: "569CD6" },
    { token: "metatag.php", fontStyle: "bold" },
    { token: "key", foreground: "9CDCFE" },
    { token: "string.key.json", foreground: "9CDCFE" },
    { token: "string.value.json", foreground: "CE9178" },
    { token: "attribute.name", foreground: "9CDCFE" },
    { token: "attribute.value", foreground: "CE9178" },
    { token: "attribute.value.number.css", foreground: "B5CEA8" },
    { token: "attribute.value.unit.css", foreground: "B5CEA8" },
    { token: "attribute.value.hex.css", foreground: "D4D4D4" },
    { token: "string", foreground: "CE9178" },
    { token: "string.sql", foreground: "FF0000" },
    { token: "keyword", foreground: "569CD6" },
    { token: "keyword.flow", foreground: "C586C0" },
    { token: "keyword.json", foreground: "CE9178" },
    { token: "keyword.flow.scss", foreground: "569CD6" },
    { token: "operator.scss", foreground: "909090" },
    { token: "operator.sql", foreground: "778899" },
    { token: "operator.swift", foreground: "909090" },
    { token: "predefined.sql", foreground: "FF00FF" }
  ],
  colors: {
    [yo]: "#1E1E1E",
    [kb]: "#D4D4D4",
    [OFe]: "#3A3D41",
    [TB]: "#404040",
    [kB]: "#707070",
    [yfe]: "#ADD6FF26"
  }
}, JAt = {
  base: "hc-black",
  inherit: !1,
  rules: [
    { token: "", foreground: "FFFFFF", background: "000000" },
    { token: "invalid", foreground: "f44747" },
    { token: "emphasis", fontStyle: "italic" },
    { token: "strong", fontStyle: "bold" },
    { token: "variable", foreground: "1AEBFF" },
    { token: "variable.parameter", foreground: "9CDCFE" },
    { token: "constant", foreground: "569CD6" },
    { token: "comment", foreground: "608B4E" },
    { token: "number", foreground: "FFFFFF" },
    { token: "regexp", foreground: "C0C0C0" },
    { token: "annotation", foreground: "569CD6" },
    { token: "type", foreground: "3DC9B0" },
    { token: "delimiter", foreground: "FFFF00" },
    { token: "delimiter.html", foreground: "FFFF00" },
    { token: "tag", foreground: "569CD6" },
    { token: "tag.id.pug", foreground: "4F76AC" },
    { token: "tag.class.pug", foreground: "4F76AC" },
    { token: "meta", foreground: "D4D4D4" },
    { token: "meta.tag", foreground: "CE9178" },
    { token: "metatag", foreground: "569CD6" },
    { token: "metatag.content.html", foreground: "1AEBFF" },
    { token: "metatag.html", foreground: "569CD6" },
    { token: "metatag.xml", foreground: "569CD6" },
    { token: "metatag.php", fontStyle: "bold" },
    { token: "key", foreground: "9CDCFE" },
    { token: "string.key", foreground: "9CDCFE" },
    { token: "string.value", foreground: "CE9178" },
    { token: "attribute.name", foreground: "569CD6" },
    { token: "attribute.value", foreground: "3FF23F" },
    { token: "string", foreground: "CE9178" },
    { token: "string.sql", foreground: "FF0000" },
    { token: "keyword", foreground: "569CD6" },
    { token: "keyword.flow", foreground: "C586C0" },
    { token: "operator.sql", foreground: "778899" },
    { token: "operator.swift", foreground: "909090" },
    { token: "predefined.sql", foreground: "FF00FF" }
  ],
  colors: {
    [yo]: "#000000",
    [kb]: "#FFFFFF",
    [TB]: "#FFFFFF",
    [kB]: "#FFFFFF"
  }
}, e2t = {
  base: "hc-light",
  inherit: !1,
  rules: [
    { token: "", foreground: "292929", background: "FFFFFF" },
    { token: "invalid", foreground: "B5200D" },
    { token: "emphasis", fontStyle: "italic" },
    { token: "strong", fontStyle: "bold" },
    { token: "variable", foreground: "264F70" },
    { token: "variable.predefined", foreground: "4864AA" },
    { token: "constant", foreground: "dd0000" },
    { token: "comment", foreground: "008000" },
    { token: "number", foreground: "098658" },
    { token: "number.hex", foreground: "3030c0" },
    { token: "regexp", foreground: "800000" },
    { token: "annotation", foreground: "808080" },
    { token: "type", foreground: "008080" },
    { token: "delimiter", foreground: "000000" },
    { token: "delimiter.html", foreground: "383838" },
    { token: "tag", foreground: "800000" },
    { token: "tag.id.pug", foreground: "4F76AC" },
    { token: "tag.class.pug", foreground: "4F76AC" },
    { token: "meta.scss", foreground: "800000" },
    { token: "metatag", foreground: "e00000" },
    { token: "metatag.content.html", foreground: "B5200D" },
    { token: "metatag.html", foreground: "808080" },
    { token: "metatag.xml", foreground: "808080" },
    { token: "metatag.php", fontStyle: "bold" },
    { token: "key", foreground: "863B00" },
    { token: "string.key.json", foreground: "A31515" },
    { token: "string.value.json", foreground: "0451A5" },
    { token: "attribute.name", foreground: "264F78" },
    { token: "attribute.value", foreground: "0451A5" },
    { token: "string", foreground: "A31515" },
    { token: "string.sql", foreground: "B5200D" },
    { token: "keyword", foreground: "0000FF" },
    { token: "keyword.flow", foreground: "AF00DB" },
    { token: "operator.sql", foreground: "778899" },
    { token: "operator.swift", foreground: "666666" },
    { token: "predefined.sql", foreground: "C700C7" }
  ],
  colors: {
    [yo]: "#FFFFFF",
    [kb]: "#292929",
    [TB]: "#292929",
    [kB]: "#292929"
  }
};
function t2t(i) {
  const e = new ke(), t = e.add(new he()), n = c5e();
  return e.add(n.onDidChange(() => t.fire())), i && e.add(i.onDidProductIconThemeChange(() => t.fire())), {
    dispose: () => e.dispose(),
    onDidChange: t.event,
    getCSS() {
      const r = i ? i.getProductIconTheme() : new h9e(), s = {}, o = new wee(), a = new wee();
      for (const l of n.getIcons()) {
        const c = r.getIcon(l);
        if (!c)
          continue;
        const u = c.font, d = xd`--vscode-icon-${Q7(l.id)}-font-family`, h = xd`--vscode-icon-${Q7(l.id)}-content`;
        u ? (s[u.id] = u.definition, a.push(xd`${d}: ${xC(u.id)};`, xd`${h}: ${xC(c.fontCharacter)};`), o.push(xd`.codicon-${Q7(l.id)}:before { content: ${xC(c.fontCharacter)}; font-family: ${xC(u.id)}; }`)) : (a.push(xd`${h}: ${xC(c.fontCharacter)}; ${d}: 'codicon';`), o.push(xd`.codicon-${Q7(l.id)}:before { content: ${xC(c.fontCharacter)}; }`));
      }
      for (const l in s) {
        const c = s[l], u = c.weight ? xd`font-weight: ${ZTe(c.weight)};` : xd``, d = c.style ? xd`font-style: ${ZTe(c.style)};` : xd``, h = new wee();
        for (const g of c.src)
          h.push(xd`${mb(g.location)} format(${xC(g.format)})`);
        o.push(xd`@font-face { src: ${h.join(", ")}; font-family: ${xC(l)};${u}${d} font-display: block; }`);
      }
      return o.push(xd`:root { ${a.join(" ")} }`), o.join(`
`);
    }
  };
}
class h9e {
  getIcon(e) {
    const t = c5e();
    let n = e.defaults;
    for (; qt.isThemeIcon(n); ) {
      const r = t.getIcon(n.id);
      if (!r)
        return;
      n = r.defaults;
    }
    return n;
  }
}
const fy = "vs", hR = "vs-dark", Gx = "hc-black", qx = "hc-light", f9e = Fs.as(TFe.ColorContribution), n2t = Fs.as(l3e.ThemingContribution);
class g9e {
  constructor(e, t) {
    this.semanticHighlighting = !1, this.themeData = t;
    const n = t.base;
    e.length > 0 ? (JW(e) ? this.id = e : this.id = n + " " + e, this.themeName = e) : (this.id = n, this.themeName = n), this.colors = null, this.defaultColors = /* @__PURE__ */ Object.create(null), this._tokenTheme = null;
  }
  get base() {
    return this.themeData.base;
  }
  notifyBaseUpdated() {
    this.themeData.inherit && (this.colors = null, this._tokenTheme = null);
  }
  getColors() {
    if (!this.colors) {
      const e = /* @__PURE__ */ new Map();
      for (const t in this.themeData.colors)
        e.set(t, De.fromHex(this.themeData.colors[t]));
      if (this.themeData.inherit) {
        const t = Kle(this.themeData.base);
        for (const n in t.colors)
          e.has(n) || e.set(n, De.fromHex(t.colors[n]));
      }
      this.colors = e;
    }
    return this.colors;
  }
  getColor(e, t) {
    const n = this.getColors().get(e);
    if (n)
      return n;
    if (t !== !1)
      return this.getDefault(e);
  }
  getDefault(e) {
    let t = this.defaultColors[e];
    return t || (t = f9e.resolveDefaultColor(e, this), this.defaultColors[e] = t, t);
  }
  defines(e) {
    return this.getColors().has(e);
  }
  get type() {
    switch (this.base) {
      case fy:
        return Ff.LIGHT;
      case Gx:
        return Ff.HIGH_CONTRAST_DARK;
      case qx:
        return Ff.HIGH_CONTRAST_LIGHT;
      default:
        return Ff.DARK;
    }
  }
  get tokenTheme() {
    if (!this._tokenTheme) {
      let e = [], t = [];
      if (this.themeData.inherit) {
        const s = Kle(this.themeData.base);
        e = s.rules, s.encodedTokensColors && (t = s.encodedTokensColors);
      }
      const n = this.themeData.colors["editor.foreground"], r = this.themeData.colors["editor.background"];
      if (n || r) {
        const s = { token: "" };
        n && (s.foreground = n), r && (s.background = r), e.push(s);
      }
      e = e.concat(this.themeData.rules), this.themeData.encodedTokensColors && (t = this.themeData.encodedTokensColors), this._tokenTheme = d9e.createFromRawTokenTheme(e, t);
    }
    return this._tokenTheme;
  }
  getTokenStyleMetadata(e, t, n) {
    const s = this.tokenTheme._match([e].concat(t).join(".")).metadata, o = jl.getForeground(s), a = jl.getFontStyle(s);
    return {
      foreground: o,
      italic: !!(a & 1),
      bold: !!(a & 2),
      underline: !!(a & 4),
      strikethrough: !!(a & 8)
    };
  }
  get tokenColorMap() {
    return [];
  }
}
function JW(i) {
  return i === fy || i === hR || i === Gx || i === qx;
}
function Kle(i) {
  switch (i) {
    case fy:
      return ZAt;
    case hR:
      return QAt;
    case Gx:
      return JAt;
    case qx:
      return e2t;
  }
}
function BH(i) {
  const e = Kle(i);
  return new g9e(i, e);
}
class i2t extends ge {
  constructor() {
    super(), this._onColorThemeChange = this._register(new he()), this.onDidColorThemeChange = this._onColorThemeChange.event, this._onProductIconThemeChange = this._register(new he()), this.onDidProductIconThemeChange = this._onProductIconThemeChange.event, this._environment = /* @__PURE__ */ Object.create(null), this._builtInProductIconTheme = new h9e(), this._autoDetectHighContrast = !0, this._knownThemes = /* @__PURE__ */ new Map(), this._knownThemes.set(fy, BH(fy)), this._knownThemes.set(hR, BH(hR)), this._knownThemes.set(Gx, BH(Gx)), this._knownThemes.set(qx, BH(qx));
    const e = this._register(t2t(this));
    this._codiconCSS = e.getCSS(), this._themeCSS = "", this._allCSS = `${this._codiconCSS}
${this._themeCSS}`, this._globalStyleElement = null, this._styleElements = [], this._colorMapOverride = null, this.setTheme(fy), this._onOSSchemeChanged(), this._register(e.onDidChange(() => {
      this._codiconCSS = e.getCSS(), this._updateCSS();
    })), NMe(fr, "(forced-colors: active)", () => {
      this._onOSSchemeChanged();
    });
  }
  registerEditorContainer(e) {
    return BV(e) ? this._registerShadowDomContainer(e) : this._registerRegularEditorContainer();
  }
  _registerRegularEditorContainer() {
    return this._globalStyleElement || (this._globalStyleElement = Zf(void 0, (e) => {
      e.className = "monaco-colors", e.textContent = this._allCSS;
    }), this._styleElements.push(this._globalStyleElement)), ge.None;
  }
  _registerShadowDomContainer(e) {
    const t = Zf(e, (n) => {
      n.className = "monaco-colors", n.textContent = this._allCSS;
    });
    return this._styleElements.push(t), {
      dispose: () => {
        for (let n = 0; n < this._styleElements.length; n++)
          if (this._styleElements[n] === t) {
            this._styleElements.splice(n, 1);
            return;
          }
      }
    };
  }
  defineTheme(e, t) {
    if (!/^[a-z0-9\-]+$/i.test(e))
      throw new Error("Illegal theme name!");
    if (!JW(t.base) && !JW(e))
      throw new Error("Illegal theme base!");
    this._knownThemes.set(e, new g9e(e, t)), JW(e) && this._knownThemes.forEach((n) => {
      n.base === e && n.notifyBaseUpdated();
    }), this._theme.themeName === e && this.setTheme(e);
  }
  getColorTheme() {
    return this._theme;
  }
  setColorMapOverride(e) {
    this._colorMapOverride = e, this._updateThemeOrColorMap();
  }
  setTheme(e) {
    let t;
    this._knownThemes.has(e) ? t = this._knownThemes.get(e) : t = this._knownThemes.get(fy), this._updateActualTheme(t);
  }
  _updateActualTheme(e) {
    !e || this._theme === e || (this._theme = e, this._updateThemeOrColorMap());
  }
  _onOSSchemeChanged() {
    if (this._autoDetectHighContrast) {
      const e = fr.matchMedia("(forced-colors: active)").matches;
      if (e !== am(this._theme.type)) {
        let t;
        sT(this._theme.type) ? t = e ? Gx : hR : t = e ? qx : fy, this._updateActualTheme(this._knownThemes.get(t));
      }
    }
  }
  setAutoDetectHighContrast(e) {
    this._autoDetectHighContrast = e, this._onOSSchemeChanged();
  }
  _updateThemeOrColorMap() {
    const e = [], t = {}, n = {
      addRule: (o) => {
        t[o] || (e.push(o), t[o] = !0);
      }
    };
    n2t.getThemingParticipants().forEach((o) => o(this._theme, n, this._environment));
    const r = [];
    for (const o of f9e.getColors()) {
      const a = this._theme.getColor(o.id, !0);
      a && r.push(`${bfe(o.id)}: ${a.toString()};`);
    }
    n.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${r.join(`
`)} }`);
    const s = this._colorMapOverride || this._theme.tokenTheme.getColorMap();
    n.addRule(XAt(s)), n.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"), this._themeCSS = e.join(`
`), this._updateCSS(), Ys.setColorMap(s), this._onColorThemeChange.fire(this._theme);
  }
  _updateCSS() {
    this._allCSS = `${this._codiconCSS}
${this._themeCSS}`, this._styleElements.forEach((e) => e.textContent = this._allCSS);
  }
  getFileIconTheme() {
    return {
      hasFileIcons: !1,
      hasFolderIcons: !1,
      hidesExplorerArrows: !1
    };
  }
  getProductIconTheme() {
    return this._builtInProductIconTheme;
  }
}
class r2t extends vt {
  constructor() {
    super({
      id: "editor.action.toggleHighContrast",
      label: Mle.toggleHighContrast,
      alias: "Toggle High Contrast Theme",
      precondition: void 0
    }), this._originalThemeName = null;
  }
  run(e, t) {
    const n = e.get(Jh), r = n.getColorTheme();
    am(r.type) ? (n.setTheme(this._originalThemeName || (sT(r.type) ? hR : fy)), this._originalThemeName = null) : (n.setTheme(sT(r.type) ? Gx : qx), this._originalThemeName = r.themeName);
  }
}
Je(r2t);
var Yle;
(function(i) {
  i[i.Unknown = 0] = "Unknown", i[i.Disabled = 1] = "Disabled", i[i.Enabled = 2] = "Enabled";
})(Yle || (Yle = {}));
var Xle;
(function(i) {
  i[i.Invoke = 1] = "Invoke", i[i.Auto = 2] = "Auto";
})(Xle || (Xle = {}));
var Zle;
(function(i) {
  i[i.None = 0] = "None", i[i.KeepWhitespace = 1] = "KeepWhitespace", i[i.InsertAsSnippet = 4] = "InsertAsSnippet";
})(Zle || (Zle = {}));
var Qle;
(function(i) {
  i[i.Method = 0] = "Method", i[i.Function = 1] = "Function", i[i.Constructor = 2] = "Constructor", i[i.Field = 3] = "Field", i[i.Variable = 4] = "Variable", i[i.Class = 5] = "Class", i[i.Struct = 6] = "Struct", i[i.Interface = 7] = "Interface", i[i.Module = 8] = "Module", i[i.Property = 9] = "Property", i[i.Event = 10] = "Event", i[i.Operator = 11] = "Operator", i[i.Unit = 12] = "Unit", i[i.Value = 13] = "Value", i[i.Constant = 14] = "Constant", i[i.Enum = 15] = "Enum", i[i.EnumMember = 16] = "EnumMember", i[i.Keyword = 17] = "Keyword", i[i.Text = 18] = "Text", i[i.Color = 19] = "Color", i[i.File = 20] = "File", i[i.Reference = 21] = "Reference", i[i.Customcolor = 22] = "Customcolor", i[i.Folder = 23] = "Folder", i[i.TypeParameter = 24] = "TypeParameter", i[i.User = 25] = "User", i[i.Issue = 26] = "Issue", i[i.Tool = 27] = "Tool", i[i.Snippet = 28] = "Snippet";
})(Qle || (Qle = {}));
var Jle;
(function(i) {
  i[i.Deprecated = 1] = "Deprecated";
})(Jle || (Jle = {}));
var ece;
(function(i) {
  i[i.Invoke = 0] = "Invoke", i[i.TriggerCharacter = 1] = "TriggerCharacter", i[i.TriggerForIncompleteCompletions = 2] = "TriggerForIncompleteCompletions";
})(ece || (ece = {}));
var tce;
(function(i) {
  i[i.EXACT = 0] = "EXACT", i[i.ABOVE = 1] = "ABOVE", i[i.BELOW = 2] = "BELOW";
})(tce || (tce = {}));
var nce;
(function(i) {
  i[i.NotSet = 0] = "NotSet", i[i.ContentFlush = 1] = "ContentFlush", i[i.RecoverFromMarkers = 2] = "RecoverFromMarkers", i[i.Explicit = 3] = "Explicit", i[i.Paste = 4] = "Paste", i[i.Undo = 5] = "Undo", i[i.Redo = 6] = "Redo";
})(nce || (nce = {}));
var ice;
(function(i) {
  i[i.LF = 1] = "LF", i[i.CRLF = 2] = "CRLF";
})(ice || (ice = {}));
var rce;
(function(i) {
  i[i.Text = 0] = "Text", i[i.Read = 1] = "Read", i[i.Write = 2] = "Write";
})(rce || (rce = {}));
var sce;
(function(i) {
  i[i.None = 0] = "None", i[i.Keep = 1] = "Keep", i[i.Brackets = 2] = "Brackets", i[i.Advanced = 3] = "Advanced", i[i.Full = 4] = "Full";
})(sce || (sce = {}));
var oce;
(function(i) {
  i[i.acceptSuggestionOnCommitCharacter = 0] = "acceptSuggestionOnCommitCharacter", i[i.acceptSuggestionOnEnter = 1] = "acceptSuggestionOnEnter", i[i.accessibilitySupport = 2] = "accessibilitySupport", i[i.accessibilityPageSize = 3] = "accessibilityPageSize", i[i.allowOverflow = 4] = "allowOverflow", i[i.allowVariableLineHeights = 5] = "allowVariableLineHeights", i[i.allowVariableFonts = 6] = "allowVariableFonts", i[i.allowVariableFontsInAccessibilityMode = 7] = "allowVariableFontsInAccessibilityMode", i[i.ariaLabel = 8] = "ariaLabel", i[i.ariaRequired = 9] = "ariaRequired", i[i.autoClosingBrackets = 10] = "autoClosingBrackets", i[i.autoClosingComments = 11] = "autoClosingComments", i[i.screenReaderAnnounceInlineSuggestion = 12] = "screenReaderAnnounceInlineSuggestion", i[i.autoClosingDelete = 13] = "autoClosingDelete", i[i.autoClosingOvertype = 14] = "autoClosingOvertype", i[i.autoClosingQuotes = 15] = "autoClosingQuotes", i[i.autoIndent = 16] = "autoIndent", i[i.autoIndentOnPaste = 17] = "autoIndentOnPaste", i[i.autoIndentOnPasteWithinString = 18] = "autoIndentOnPasteWithinString", i[i.automaticLayout = 19] = "automaticLayout", i[i.autoSurround = 20] = "autoSurround", i[i.bracketPairColorization = 21] = "bracketPairColorization", i[i.guides = 22] = "guides", i[i.codeLens = 23] = "codeLens", i[i.codeLensFontFamily = 24] = "codeLensFontFamily", i[i.codeLensFontSize = 25] = "codeLensFontSize", i[i.colorDecorators = 26] = "colorDecorators", i[i.colorDecoratorsLimit = 27] = "colorDecoratorsLimit", i[i.columnSelection = 28] = "columnSelection", i[i.comments = 29] = "comments", i[i.contextmenu = 30] = "contextmenu", i[i.copyWithSyntaxHighlighting = 31] = "copyWithSyntaxHighlighting", i[i.cursorBlinking = 32] = "cursorBlinking", i[i.cursorSmoothCaretAnimation = 33] = "cursorSmoothCaretAnimation", i[i.cursorStyle = 34] = "cursorStyle", i[i.cursorSurroundingLines = 35] = "cursorSurroundingLines", i[i.cursorSurroundingLinesStyle = 36] = "cursorSurroundingLinesStyle", i[i.cursorWidth = 37] = "cursorWidth", i[i.cursorHeight = 38] = "cursorHeight", i[i.disableLayerHinting = 39] = "disableLayerHinting", i[i.disableMonospaceOptimizations = 40] = "disableMonospaceOptimizations", i[i.domReadOnly = 41] = "domReadOnly", i[i.dragAndDrop = 42] = "dragAndDrop", i[i.dropIntoEditor = 43] = "dropIntoEditor", i[i.editContext = 44] = "editContext", i[i.emptySelectionClipboard = 45] = "emptySelectionClipboard", i[i.experimentalGpuAcceleration = 46] = "experimentalGpuAcceleration", i[i.experimentalWhitespaceRendering = 47] = "experimentalWhitespaceRendering", i[i.extraEditorClassName = 48] = "extraEditorClassName", i[i.fastScrollSensitivity = 49] = "fastScrollSensitivity", i[i.find = 50] = "find", i[i.fixedOverflowWidgets = 51] = "fixedOverflowWidgets", i[i.folding = 52] = "folding", i[i.foldingStrategy = 53] = "foldingStrategy", i[i.foldingHighlight = 54] = "foldingHighlight", i[i.foldingImportsByDefault = 55] = "foldingImportsByDefault", i[i.foldingMaximumRegions = 56] = "foldingMaximumRegions", i[i.unfoldOnClickAfterEndOfLine = 57] = "unfoldOnClickAfterEndOfLine", i[i.fontFamily = 58] = "fontFamily", i[i.fontInfo = 59] = "fontInfo", i[i.fontLigatures = 60] = "fontLigatures", i[i.fontSize = 61] = "fontSize", i[i.fontWeight = 62] = "fontWeight", i[i.fontVariations = 63] = "fontVariations", i[i.formatOnPaste = 64] = "formatOnPaste", i[i.formatOnType = 65] = "formatOnType", i[i.glyphMargin = 66] = "glyphMargin", i[i.gotoLocation = 67] = "gotoLocation", i[i.hideCursorInOverviewRuler = 68] = "hideCursorInOverviewRuler", i[i.hover = 69] = "hover", i[i.inDiffEditor = 70] = "inDiffEditor", i[i.inlineSuggest = 71] = "inlineSuggest", i[i.letterSpacing = 72] = "letterSpacing", i[i.lightbulb = 73] = "lightbulb", i[i.lineDecorationsWidth = 74] = "lineDecorationsWidth", i[i.lineHeight = 75] = "lineHeight", i[i.lineNumbers = 76] = "lineNumbers", i[i.lineNumbersMinChars = 77] = "lineNumbersMinChars", i[i.linkedEditing = 78] = "linkedEditing", i[i.links = 79] = "links", i[i.matchBrackets = 80] = "matchBrackets", i[i.minimap = 81] = "minimap", i[i.mouseStyle = 82] = "mouseStyle", i[i.mouseWheelScrollSensitivity = 83] = "mouseWheelScrollSensitivity", i[i.mouseWheelZoom = 84] = "mouseWheelZoom", i[i.multiCursorMergeOverlapping = 85] = "multiCursorMergeOverlapping", i[i.multiCursorModifier = 86] = "multiCursorModifier", i[i.mouseMiddleClickAction = 87] = "mouseMiddleClickAction", i[i.multiCursorPaste = 88] = "multiCursorPaste", i[i.multiCursorLimit = 89] = "multiCursorLimit", i[i.occurrencesHighlight = 90] = "occurrencesHighlight", i[i.occurrencesHighlightDelay = 91] = "occurrencesHighlightDelay", i[i.overtypeCursorStyle = 92] = "overtypeCursorStyle", i[i.overtypeOnPaste = 93] = "overtypeOnPaste", i[i.overviewRulerBorder = 94] = "overviewRulerBorder", i[i.overviewRulerLanes = 95] = "overviewRulerLanes", i[i.padding = 96] = "padding", i[i.pasteAs = 97] = "pasteAs", i[i.parameterHints = 98] = "parameterHints", i[i.peekWidgetDefaultFocus = 99] = "peekWidgetDefaultFocus", i[i.placeholder = 100] = "placeholder", i[i.definitionLinkOpensInPeek = 101] = "definitionLinkOpensInPeek", i[i.quickSuggestions = 102] = "quickSuggestions", i[i.quickSuggestionsDelay = 103] = "quickSuggestionsDelay", i[i.readOnly = 104] = "readOnly", i[i.readOnlyMessage = 105] = "readOnlyMessage", i[i.renameOnType = 106] = "renameOnType", i[i.renderRichScreenReaderContent = 107] = "renderRichScreenReaderContent", i[i.renderControlCharacters = 108] = "renderControlCharacters", i[i.renderFinalNewline = 109] = "renderFinalNewline", i[i.renderLineHighlight = 110] = "renderLineHighlight", i[i.renderLineHighlightOnlyWhenFocus = 111] = "renderLineHighlightOnlyWhenFocus", i[i.renderValidationDecorations = 112] = "renderValidationDecorations", i[i.renderWhitespace = 113] = "renderWhitespace", i[i.revealHorizontalRightPadding = 114] = "revealHorizontalRightPadding", i[i.roundedSelection = 115] = "roundedSelection", i[i.rulers = 116] = "rulers", i[i.scrollbar = 117] = "scrollbar", i[i.scrollBeyondLastColumn = 118] = "scrollBeyondLastColumn", i[i.scrollBeyondLastLine = 119] = "scrollBeyondLastLine", i[i.scrollPredominantAxis = 120] = "scrollPredominantAxis", i[i.selectionClipboard = 121] = "selectionClipboard", i[i.selectionHighlight = 122] = "selectionHighlight", i[i.selectionHighlightMaxLength = 123] = "selectionHighlightMaxLength", i[i.selectionHighlightMultiline = 124] = "selectionHighlightMultiline", i[i.selectOnLineNumbers = 125] = "selectOnLineNumbers", i[i.showFoldingControls = 126] = "showFoldingControls", i[i.showUnused = 127] = "showUnused", i[i.snippetSuggestions = 128] = "snippetSuggestions", i[i.smartSelect = 129] = "smartSelect", i[i.smoothScrolling = 130] = "smoothScrolling", i[i.stickyScroll = 131] = "stickyScroll", i[i.stickyTabStops = 132] = "stickyTabStops", i[i.stopRenderingLineAfter = 133] = "stopRenderingLineAfter", i[i.suggest = 134] = "suggest", i[i.suggestFontSize = 135] = "suggestFontSize", i[i.suggestLineHeight = 136] = "suggestLineHeight", i[i.suggestOnTriggerCharacters = 137] = "suggestOnTriggerCharacters", i[i.suggestSelection = 138] = "suggestSelection", i[i.tabCompletion = 139] = "tabCompletion", i[i.tabIndex = 140] = "tabIndex", i[i.trimWhitespaceOnDelete = 141] = "trimWhitespaceOnDelete", i[i.unicodeHighlighting = 142] = "unicodeHighlighting", i[i.unusualLineTerminators = 143] = "unusualLineTerminators", i[i.useShadowDOM = 144] = "useShadowDOM", i[i.useTabStops = 145] = "useTabStops", i[i.wordBreak = 146] = "wordBreak", i[i.wordSegmenterLocales = 147] = "wordSegmenterLocales", i[i.wordSeparators = 148] = "wordSeparators", i[i.wordWrap = 149] = "wordWrap", i[i.wordWrapBreakAfterCharacters = 150] = "wordWrapBreakAfterCharacters", i[i.wordWrapBreakBeforeCharacters = 151] = "wordWrapBreakBeforeCharacters", i[i.wordWrapColumn = 152] = "wordWrapColumn", i[i.wordWrapOverride1 = 153] = "wordWrapOverride1", i[i.wordWrapOverride2 = 154] = "wordWrapOverride2", i[i.wrappingIndent = 155] = "wrappingIndent", i[i.wrappingStrategy = 156] = "wrappingStrategy", i[i.showDeprecated = 157] = "showDeprecated", i[i.inertialScroll = 158] = "inertialScroll", i[i.inlayHints = 159] = "inlayHints", i[i.wrapOnEscapedLineFeeds = 160] = "wrapOnEscapedLineFeeds", i[i.effectiveCursorStyle = 161] = "effectiveCursorStyle", i[i.editorClassName = 162] = "editorClassName", i[i.pixelRatio = 163] = "pixelRatio", i[i.tabFocusMode = 164] = "tabFocusMode", i[i.layoutInfo = 165] = "layoutInfo", i[i.wrappingInfo = 166] = "wrappingInfo", i[i.defaultColorDecorators = 167] = "defaultColorDecorators", i[i.colorDecoratorsActivatedOn = 168] = "colorDecoratorsActivatedOn", i[i.inlineCompletionsAccessibilityVerbose = 169] = "inlineCompletionsAccessibilityVerbose", i[i.effectiveEditContext = 170] = "effectiveEditContext", i[i.scrollOnMiddleClick = 171] = "scrollOnMiddleClick", i[i.effectiveAllowVariableFonts = 172] = "effectiveAllowVariableFonts";
})(oce || (oce = {}));
var ace;
(function(i) {
  i[i.TextDefined = 0] = "TextDefined", i[i.LF = 1] = "LF", i[i.CRLF = 2] = "CRLF";
})(ace || (ace = {}));
var lce;
(function(i) {
  i[i.LF = 0] = "LF", i[i.CRLF = 1] = "CRLF";
})(lce || (lce = {}));
var cce;
(function(i) {
  i[i.Left = 1] = "Left", i[i.Center = 2] = "Center", i[i.Right = 3] = "Right";
})(cce || (cce = {}));
var uce;
(function(i) {
  i[i.Increase = 0] = "Increase", i[i.Decrease = 1] = "Decrease";
})(uce || (uce = {}));
var dce;
(function(i) {
  i[i.None = 0] = "None", i[i.Indent = 1] = "Indent", i[i.IndentOutdent = 2] = "IndentOutdent", i[i.Outdent = 3] = "Outdent";
})(dce || (dce = {}));
var hce;
(function(i) {
  i[i.Both = 0] = "Both", i[i.Right = 1] = "Right", i[i.Left = 2] = "Left", i[i.None = 3] = "None";
})(hce || (hce = {}));
var fce;
(function(i) {
  i[i.Type = 1] = "Type", i[i.Parameter = 2] = "Parameter";
})(fce || (fce = {}));
var gce;
(function(i) {
  i[i.Code = 1] = "Code", i[i.Label = 2] = "Label";
})(gce || (gce = {}));
var pce;
(function(i) {
  i[i.Accepted = 0] = "Accepted", i[i.Rejected = 1] = "Rejected", i[i.Ignored = 2] = "Ignored";
})(pce || (pce = {}));
var mce;
(function(i) {
  i[i.Automatic = 0] = "Automatic", i[i.Explicit = 1] = "Explicit";
})(mce || (mce = {}));
var _ce;
(function(i) {
  i[i.DependsOnKbLayout = -1] = "DependsOnKbLayout", i[i.Unknown = 0] = "Unknown", i[i.Backspace = 1] = "Backspace", i[i.Tab = 2] = "Tab", i[i.Enter = 3] = "Enter", i[i.Shift = 4] = "Shift", i[i.Ctrl = 5] = "Ctrl", i[i.Alt = 6] = "Alt", i[i.PauseBreak = 7] = "PauseBreak", i[i.CapsLock = 8] = "CapsLock", i[i.Escape = 9] = "Escape", i[i.Space = 10] = "Space", i[i.PageUp = 11] = "PageUp", i[i.PageDown = 12] = "PageDown", i[i.End = 13] = "End", i[i.Home = 14] = "Home", i[i.LeftArrow = 15] = "LeftArrow", i[i.UpArrow = 16] = "UpArrow", i[i.RightArrow = 17] = "RightArrow", i[i.DownArrow = 18] = "DownArrow", i[i.Insert = 19] = "Insert", i[i.Delete = 20] = "Delete", i[i.Digit0 = 21] = "Digit0", i[i.Digit1 = 22] = "Digit1", i[i.Digit2 = 23] = "Digit2", i[i.Digit3 = 24] = "Digit3", i[i.Digit4 = 25] = "Digit4", i[i.Digit5 = 26] = "Digit5", i[i.Digit6 = 27] = "Digit6", i[i.Digit7 = 28] = "Digit7", i[i.Digit8 = 29] = "Digit8", i[i.Digit9 = 30] = "Digit9", i[i.KeyA = 31] = "KeyA", i[i.KeyB = 32] = "KeyB", i[i.KeyC = 33] = "KeyC", i[i.KeyD = 34] = "KeyD", i[i.KeyE = 35] = "KeyE", i[i.KeyF = 36] = "KeyF", i[i.KeyG = 37] = "KeyG", i[i.KeyH = 38] = "KeyH", i[i.KeyI = 39] = "KeyI", i[i.KeyJ = 40] = "KeyJ", i[i.KeyK = 41] = "KeyK", i[i.KeyL = 42] = "KeyL", i[i.KeyM = 43] = "KeyM", i[i.KeyN = 44] = "KeyN", i[i.KeyO = 45] = "KeyO", i[i.KeyP = 46] = "KeyP", i[i.KeyQ = 47] = "KeyQ", i[i.KeyR = 48] = "KeyR", i[i.KeyS = 49] = "KeyS", i[i.KeyT = 50] = "KeyT", i[i.KeyU = 51] = "KeyU", i[i.KeyV = 52] = "KeyV", i[i.KeyW = 53] = "KeyW", i[i.KeyX = 54] = "KeyX", i[i.KeyY = 55] = "KeyY", i[i.KeyZ = 56] = "KeyZ", i[i.Meta = 57] = "Meta", i[i.ContextMenu = 58] = "ContextMenu", i[i.F1 = 59] = "F1", i[i.F2 = 60] = "F2", i[i.F3 = 61] = "F3", i[i.F4 = 62] = "F4", i[i.F5 = 63] = "F5", i[i.F6 = 64] = "F6", i[i.F7 = 65] = "F7", i[i.F8 = 66] = "F8", i[i.F9 = 67] = "F9", i[i.F10 = 68] = "F10", i[i.F11 = 69] = "F11", i[i.F12 = 70] = "F12", i[i.F13 = 71] = "F13", i[i.F14 = 72] = "F14", i[i.F15 = 73] = "F15", i[i.F16 = 74] = "F16", i[i.F17 = 75] = "F17", i[i.F18 = 76] = "F18", i[i.F19 = 77] = "F19", i[i.F20 = 78] = "F20", i[i.F21 = 79] = "F21", i[i.F22 = 80] = "F22", i[i.F23 = 81] = "F23", i[i.F24 = 82] = "F24", i[i.NumLock = 83] = "NumLock", i[i.ScrollLock = 84] = "ScrollLock", i[i.Semicolon = 85] = "Semicolon", i[i.Equal = 86] = "Equal", i[i.Comma = 87] = "Comma", i[i.Minus = 88] = "Minus", i[i.Period = 89] = "Period", i[i.Slash = 90] = "Slash", i[i.Backquote = 91] = "Backquote", i[i.BracketLeft = 92] = "BracketLeft", i[i.Backslash = 93] = "Backslash", i[i.BracketRight = 94] = "BracketRight", i[i.Quote = 95] = "Quote", i[i.OEM_8 = 96] = "OEM_8", i[i.IntlBackslash = 97] = "IntlBackslash", i[i.Numpad0 = 98] = "Numpad0", i[i.Numpad1 = 99] = "Numpad1", i[i.Numpad2 = 100] = "Numpad2", i[i.Numpad3 = 101] = "Numpad3", i[i.Numpad4 = 102] = "Numpad4", i[i.Numpad5 = 103] = "Numpad5", i[i.Numpad6 = 104] = "Numpad6", i[i.Numpad7 = 105] = "Numpad7", i[i.Numpad8 = 106] = "Numpad8", i[i.Numpad9 = 107] = "Numpad9", i[i.NumpadMultiply = 108] = "NumpadMultiply", i[i.NumpadAdd = 109] = "NumpadAdd", i[i.NUMPAD_SEPARATOR = 110] = "NUMPAD_SEPARATOR", i[i.NumpadSubtract = 111] = "NumpadSubtract", i[i.NumpadDecimal = 112] = "NumpadDecimal", i[i.NumpadDivide = 113] = "NumpadDivide", i[i.KEY_IN_COMPOSITION = 114] = "KEY_IN_COMPOSITION", i[i.ABNT_C1 = 115] = "ABNT_C1", i[i.ABNT_C2 = 116] = "ABNT_C2", i[i.AudioVolumeMute = 117] = "AudioVolumeMute", i[i.AudioVolumeUp = 118] = "AudioVolumeUp", i[i.AudioVolumeDown = 119] = "AudioVolumeDown", i[i.BrowserSearch = 120] = "BrowserSearch", i[i.BrowserHome = 121] = "BrowserHome", i[i.BrowserBack = 122] = "BrowserBack", i[i.BrowserForward = 123] = "BrowserForward", i[i.MediaTrackNext = 124] = "MediaTrackNext", i[i.MediaTrackPrevious = 125] = "MediaTrackPrevious", i[i.MediaStop = 126] = "MediaStop", i[i.MediaPlayPause = 127] = "MediaPlayPause", i[i.LaunchMediaPlayer = 128] = "LaunchMediaPlayer", i[i.LaunchMail = 129] = "LaunchMail", i[i.LaunchApp2 = 130] = "LaunchApp2", i[i.Clear = 131] = "Clear", i[i.MAX_VALUE = 132] = "MAX_VALUE";
})(_ce || (_ce = {}));
var bce;
(function(i) {
  i[i.Hint = 1] = "Hint", i[i.Info = 2] = "Info", i[i.Warning = 4] = "Warning", i[i.Error = 8] = "Error";
})(bce || (bce = {}));
var vce;
(function(i) {
  i[i.Unnecessary = 1] = "Unnecessary", i[i.Deprecated = 2] = "Deprecated";
})(vce || (vce = {}));
var yce;
(function(i) {
  i[i.Inline = 1] = "Inline", i[i.Gutter = 2] = "Gutter";
})(yce || (yce = {}));
var Cce;
(function(i) {
  i[i.Normal = 1] = "Normal", i[i.Underlined = 2] = "Underlined";
})(Cce || (Cce = {}));
var wce;
(function(i) {
  i[i.UNKNOWN = 0] = "UNKNOWN", i[i.TEXTAREA = 1] = "TEXTAREA", i[i.GUTTER_GLYPH_MARGIN = 2] = "GUTTER_GLYPH_MARGIN", i[i.GUTTER_LINE_NUMBERS = 3] = "GUTTER_LINE_NUMBERS", i[i.GUTTER_LINE_DECORATIONS = 4] = "GUTTER_LINE_DECORATIONS", i[i.GUTTER_VIEW_ZONE = 5] = "GUTTER_VIEW_ZONE", i[i.CONTENT_TEXT = 6] = "CONTENT_TEXT", i[i.CONTENT_EMPTY = 7] = "CONTENT_EMPTY", i[i.CONTENT_VIEW_ZONE = 8] = "CONTENT_VIEW_ZONE", i[i.CONTENT_WIDGET = 9] = "CONTENT_WIDGET", i[i.OVERVIEW_RULER = 10] = "OVERVIEW_RULER", i[i.SCROLLBAR = 11] = "SCROLLBAR", i[i.OVERLAY_WIDGET = 12] = "OVERLAY_WIDGET", i[i.OUTSIDE_EDITOR = 13] = "OUTSIDE_EDITOR";
})(wce || (wce = {}));
var Sce;
(function(i) {
  i[i.AIGenerated = 1] = "AIGenerated";
})(Sce || (Sce = {}));
var Ece;
(function(i) {
  i[i.Invoke = 0] = "Invoke", i[i.Automatic = 1] = "Automatic";
})(Ece || (Ece = {}));
var xce;
(function(i) {
  i[i.TOP_RIGHT_CORNER = 0] = "TOP_RIGHT_CORNER", i[i.BOTTOM_RIGHT_CORNER = 1] = "BOTTOM_RIGHT_CORNER", i[i.TOP_CENTER = 2] = "TOP_CENTER";
})(xce || (xce = {}));
var Lce;
(function(i) {
  i[i.Left = 1] = "Left", i[i.Center = 2] = "Center", i[i.Right = 4] = "Right", i[i.Full = 7] = "Full";
})(Lce || (Lce = {}));
var Tce;
(function(i) {
  i[i.Word = 0] = "Word", i[i.Line = 1] = "Line", i[i.Suggest = 2] = "Suggest";
})(Tce || (Tce = {}));
var kce;
(function(i) {
  i[i.Left = 0] = "Left", i[i.Right = 1] = "Right", i[i.None = 2] = "None", i[i.LeftOfInjectedText = 3] = "LeftOfInjectedText", i[i.RightOfInjectedText = 4] = "RightOfInjectedText";
})(kce || (kce = {}));
var Dce;
(function(i) {
  i[i.Off = 0] = "Off", i[i.On = 1] = "On", i[i.Relative = 2] = "Relative", i[i.Interval = 3] = "Interval", i[i.Custom = 4] = "Custom";
})(Dce || (Dce = {}));
var Ice;
(function(i) {
  i[i.None = 0] = "None", i[i.Text = 1] = "Text", i[i.Blocks = 2] = "Blocks";
})(Ice || (Ice = {}));
var Nce;
(function(i) {
  i[i.Smooth = 0] = "Smooth", i[i.Immediate = 1] = "Immediate";
})(Nce || (Nce = {}));
var Rce;
(function(i) {
  i[i.Auto = 1] = "Auto", i[i.Hidden = 2] = "Hidden", i[i.Visible = 3] = "Visible";
})(Rce || (Rce = {}));
var Ace;
(function(i) {
  i[i.LTR = 0] = "LTR", i[i.RTL = 1] = "RTL";
})(Ace || (Ace = {}));
var Oce;
(function(i) {
  i.Off = "off", i.OnCode = "onCode", i.On = "on";
})(Oce || (Oce = {}));
var Mce;
(function(i) {
  i[i.Invoke = 1] = "Invoke", i[i.TriggerCharacter = 2] = "TriggerCharacter", i[i.ContentChange = 3] = "ContentChange";
})(Mce || (Mce = {}));
var Pce;
(function(i) {
  i[i.File = 0] = "File", i[i.Module = 1] = "Module", i[i.Namespace = 2] = "Namespace", i[i.Package = 3] = "Package", i[i.Class = 4] = "Class", i[i.Method = 5] = "Method", i[i.Property = 6] = "Property", i[i.Field = 7] = "Field", i[i.Constructor = 8] = "Constructor", i[i.Enum = 9] = "Enum", i[i.Interface = 10] = "Interface", i[i.Function = 11] = "Function", i[i.Variable = 12] = "Variable", i[i.Constant = 13] = "Constant", i[i.String = 14] = "String", i[i.Number = 15] = "Number", i[i.Boolean = 16] = "Boolean", i[i.Array = 17] = "Array", i[i.Object = 18] = "Object", i[i.Key = 19] = "Key", i[i.Null = 20] = "Null", i[i.EnumMember = 21] = "EnumMember", i[i.Struct = 22] = "Struct", i[i.Event = 23] = "Event", i[i.Operator = 24] = "Operator", i[i.TypeParameter = 25] = "TypeParameter";
})(Pce || (Pce = {}));
var Fce;
(function(i) {
  i[i.Deprecated = 1] = "Deprecated";
})(Fce || (Fce = {}));
var Bce;
(function(i) {
  i[i.LTR = 0] = "LTR", i[i.RTL = 1] = "RTL";
})(Bce || (Bce = {}));
var Hce;
(function(i) {
  i[i.Hidden = 0] = "Hidden", i[i.Blink = 1] = "Blink", i[i.Smooth = 2] = "Smooth", i[i.Phase = 3] = "Phase", i[i.Expand = 4] = "Expand", i[i.Solid = 5] = "Solid";
})(Hce || (Hce = {}));
var Wce;
(function(i) {
  i[i.Line = 1] = "Line", i[i.Block = 2] = "Block", i[i.Underline = 3] = "Underline", i[i.LineThin = 4] = "LineThin", i[i.BlockOutline = 5] = "BlockOutline", i[i.UnderlineThin = 6] = "UnderlineThin";
})(Wce || (Wce = {}));
var Vce;
(function(i) {
  i[i.AlwaysGrowsWhenTypingAtEdges = 0] = "AlwaysGrowsWhenTypingAtEdges", i[i.NeverGrowsWhenTypingAtEdges = 1] = "NeverGrowsWhenTypingAtEdges", i[i.GrowsOnlyWhenTypingBefore = 2] = "GrowsOnlyWhenTypingBefore", i[i.GrowsOnlyWhenTypingAfter = 3] = "GrowsOnlyWhenTypingAfter";
})(Vce || (Vce = {}));
var Uce;
(function(i) {
  i[i.None = 0] = "None", i[i.Same = 1] = "Same", i[i.Indent = 2] = "Indent", i[i.DeepIndent = 3] = "DeepIndent";
})(Uce || (Uce = {}));
var Ry;
let s2t = (Ry = class {
  static chord(e, t) {
    return Ro(e, t);
  }
}, Ry.CtrlCmd = 2048, Ry.Shift = 1024, Ry.Alt = 512, Ry.WinCtrl = 256, Ry);
function p9e() {
  return {
    editor: void 0,
    // undefined override expected here
    languages: void 0,
    // undefined override expected here
    CancellationTokenSource: Ss,
    Emitter: he,
    KeyCode: _ce,
    KeyMod: s2t,
    Position: de,
    Range: z,
    Selection: bt,
    SelectionDirection: Ace,
    MarkerSeverity: bce,
    MarkerTag: vce,
    Uri: Ht,
    Token: E4
  };
}
const PNe = "default", o2t = "$initialize";
let FNe = !1;
function zce(i) {
  Lb && (FNe || (FNe = !0, console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")), console.warn(i.message));
}
class a2t {
  constructor(e, t, n, r, s) {
    this.vsWorker = e, this.req = t, this.channel = n, this.method = r, this.args = s, this.type = 0;
  }
}
class BNe {
  constructor(e, t, n, r) {
    this.vsWorker = e, this.seq = t, this.res = n, this.err = r, this.type = 1;
  }
}
class l2t {
  constructor(e, t, n, r, s) {
    this.vsWorker = e, this.req = t, this.channel = n, this.eventName = r, this.arg = s, this.type = 2;
  }
}
class c2t {
  constructor(e, t, n) {
    this.vsWorker = e, this.req = t, this.event = n, this.type = 3;
  }
}
class u2t {
  constructor(e, t) {
    this.vsWorker = e, this.req = t, this.type = 4;
  }
}
class d2t {
  constructor(e) {
    this._workerId = -1, this._handler = e, this._lastSentReq = 0, this._pendingReplies = /* @__PURE__ */ Object.create(null), this._pendingEmitters = /* @__PURE__ */ new Map(), this._pendingEvents = /* @__PURE__ */ new Map();
  }
  setWorkerId(e) {
    this._workerId = e;
  }
  sendMessage(e, t, n) {
    const r = String(++this._lastSentReq);
    return new Promise((s, o) => {
      this._pendingReplies[r] = {
        resolve: s,
        reject: o
      }, this._send(new a2t(this._workerId, r, e, t, n));
    });
  }
  listen(e, t, n) {
    let r = null;
    const s = new he({
      onWillAddFirstListener: () => {
        r = String(++this._lastSentReq), this._pendingEmitters.set(r, s), this._send(new l2t(this._workerId, r, e, t, n));
      },
      onDidRemoveLastListener: () => {
        this._pendingEmitters.delete(r), this._send(new u2t(this._workerId, r)), r = null;
      }
    });
    return s.event;
  }
  handleMessage(e) {
    !e || !e.vsWorker || this._workerId !== -1 && e.vsWorker !== this._workerId || this._handleMessage(e);
  }
  createProxyToRemoteChannel(e, t) {
    const n = {
      get: (r, s) => (typeof s == "string" && !r[s] && (_9e(s) ? r[s] = (o) => this.listen(e, s, o) : m9e(s) ? r[s] = this.listen(e, s, void 0) : s.charCodeAt(0) === 36 && (r[s] = async (...o) => (await (t == null ? void 0 : t()), this.sendMessage(e, s, o)))), r[s])
    };
    return new Proxy(/* @__PURE__ */ Object.create(null), n);
  }
  _handleMessage(e) {
    switch (e.type) {
      case 1:
        return this._handleReplyMessage(e);
      case 0:
        return this._handleRequestMessage(e);
      case 2:
        return this._handleSubscribeEventMessage(e);
      case 3:
        return this._handleEventMessage(e);
      case 4:
        return this._handleUnsubscribeEventMessage(e);
    }
  }
  _handleReplyMessage(e) {
    if (!this._pendingReplies[e.seq]) {
      console.warn("Got reply to unknown seq");
      return;
    }
    const t = this._pendingReplies[e.seq];
    if (delete this._pendingReplies[e.seq], e.err) {
      let n = e.err;
      e.err.$isError && (n = new Error(), n.name = e.err.name, n.message = e.err.message, n.stack = e.err.stack), t.reject(n);
      return;
    }
    t.resolve(e.res);
  }
  _handleRequestMessage(e) {
    const t = e.req;
    this._handler.handleMessage(e.channel, e.method, e.args).then((r) => {
      this._send(new BNe(this._workerId, t, r, void 0));
    }, (r) => {
      r.detail instanceof Error && (r.detail = qne(r.detail)), this._send(new BNe(this._workerId, t, void 0, qne(r)));
    });
  }
  _handleSubscribeEventMessage(e) {
    const t = e.req, n = this._handler.handleEvent(e.channel, e.eventName, e.arg)((r) => {
      this._send(new c2t(this._workerId, t, r));
    });
    this._pendingEvents.set(t, n);
  }
  _handleEventMessage(e) {
    if (!this._pendingEmitters.has(e.req)) {
      console.warn("Got event for unknown req");
      return;
    }
    this._pendingEmitters.get(e.req).fire(e.event);
  }
  _handleUnsubscribeEventMessage(e) {
    if (!this._pendingEvents.has(e.req)) {
      console.warn("Got unsubscribe for unknown req");
      return;
    }
    this._pendingEvents.get(e.req).dispose(), this._pendingEvents.delete(e.req);
  }
  _send(e) {
    const t = [];
    if (e.type === 0)
      for (let n = 0; n < e.args.length; n++)
        e.args[n] instanceof ArrayBuffer && t.push(e.args[n]);
    else e.type === 1 && e.res instanceof ArrayBuffer && t.push(e.res);
    this._handler.sendMessage(e, t);
  }
}
class h2t extends ge {
  constructor(e) {
    super(), this._localChannels = /* @__PURE__ */ new Map(), this._worker = this._register(e), this._register(this._worker.onMessage((t) => {
      this._protocol.handleMessage(t);
    })), this._register(this._worker.onError((t) => {
      zce(t), fn(t);
    })), this._protocol = new d2t({
      sendMessage: (t, n) => {
        this._worker.postMessage(t, n);
      },
      handleMessage: (t, n, r) => this._handleMessage(t, n, r),
      handleEvent: (t, n, r) => this._handleEvent(t, n, r)
    }), this._protocol.setWorkerId(this._worker.getId()), this._onModuleLoaded = this._protocol.sendMessage(PNe, o2t, [
      this._worker.getId()
    ]), this.proxy = this._protocol.createProxyToRemoteChannel(PNe, async () => {
      await this._onModuleLoaded;
    }), this._onModuleLoaded.catch((t) => {
      this._onError("Worker failed to load ", t);
    });
  }
  _handleMessage(e, t, n) {
    const r = this._localChannels.get(e);
    if (!r)
      return Promise.reject(new Error(`Missing channel ${e} on main thread`));
    if (typeof r[t] != "function")
      return Promise.reject(new Error(`Missing method ${t} on main thread channel ${e}`));
    try {
      return Promise.resolve(r[t].apply(r, n));
    } catch (s) {
      return Promise.reject(s);
    }
  }
  _handleEvent(e, t, n) {
    const r = this._localChannels.get(e);
    if (!r)
      throw new Error(`Missing channel ${e} on main thread`);
    if (_9e(t)) {
      const s = r[t].call(r, n);
      if (typeof s != "function")
        throw new Error(`Missing dynamic event ${t} on main thread channel ${e}.`);
      return s;
    }
    if (m9e(t)) {
      const s = r[t];
      if (typeof s != "function")
        throw new Error(`Missing event ${t} on main thread channel ${e}.`);
      return s;
    }
    throw new Error(`Malformed event name ${t}`);
  }
  setChannel(e, t) {
    this._localChannels.set(e, t);
  }
  _onError(e, t) {
    console.error(e), console.info(t);
  }
}
function m9e(i) {
  return i[0] === "o" && i[1] === "n" && H_(i.charCodeAt(2));
}
function _9e(i) {
  return /^onDynamic/.test(i) && H_(i.charCodeAt(9));
}
let yN;
typeof self == "object" && self.constructor && self.constructor.name === "DedicatedWorkerGlobalScope" && globalThis.workerttPolicy !== void 0 ? yN = globalThis.workerttPolicy : yN = Db("defaultWorkerFactory", { createScriptURL: (i) => i });
function f2t(i, e) {
  const t = i.label || "anonymous" + e, n = globalThis.MonacoEnvironment;
  if (n) {
    if (typeof n.getWorker == "function")
      return n.getWorker("workerMain.js", t);
    if (typeof n.getWorkerUrl == "function") {
      const s = n.getWorkerUrl("workerMain.js", t);
      return new Worker(yN ? yN.createScriptURL(s) : s, { name: t, type: "module" });
    }
  }
  const r = i.esmModuleLocation;
  if (r) {
    const s = g2t(t, r.toString(!0)), o = new Worker(yN ? yN.createScriptURL(s) : s, { name: t, type: "module" });
    return p2t(o);
  }
  throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker");
}
function g2t(i, e) {
  if (!(/^((http:)|(https:)|(file:))/.test(e) && e.substring(0, globalThis.origin.length) !== globalThis.origin)) {
    const n = e.lastIndexOf("?"), r = e.lastIndexOf("#", n), s = n > 0 ? new URLSearchParams(e.substring(n + 1, ~r ? r : void 0)) : new URLSearchParams();
    cie.addSearchParam(s, !0, !0), s.toString() ? e = `${e}?${s.toString()}#${i}` : e = `${e}#${i}`;
  }
  const t = new Blob([ym([
    `/*${i}*/`,
    `globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(DMe())};`,
    `globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(Ehe())};`,
    `globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`,
    "const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });",
    "globalThis.workerttPolicy = ttPolicy;",
    `await import(ttPolicy?.createScriptURL(${JSON.stringify(e)}) ?? ${JSON.stringify(e)});`,
    "globalThis.postMessage({ type: 'vscode-worker-ready' });",
    `/*${i}*/`
  ]).join("")], { type: "application/javascript" });
  return URL.createObjectURL(t);
}
function p2t(i) {
  return new Promise((e, t) => {
    i.onmessage = function(n) {
      n.data.type === "vscode-worker-ready" && (i.onmessage = null, e(i));
    }, i.onerror = t;
  });
}
function m2t(i) {
  return !!i && typeof i.then == "function";
}
const QG = class QG extends ge {
  constructor(e) {
    super(), this._onMessage = this._register(new he()), this.onMessage = this._onMessage.event, this._onError = this._register(new he()), this.onError = this._onError.event, this.id = ++QG.LAST_WORKER_ID;
    const t = e instanceof Worker || "then" in e ? e : f2t(e, this.id);
    m2t(t) ? this.worker = t : this.worker = Promise.resolve(t), this.postMessage("-please-ignore-", []);
    const n = (r) => {
      this._onError.fire(r);
    };
    this.worker.then((r) => {
      r.onmessage = (s) => {
        this._onMessage.fire(s.data);
      }, r.onmessageerror = (s) => {
        this._onError.fire(s);
      }, typeof r.addEventListener == "function" && r.addEventListener("error", n);
    }), this._register(Et(() => {
      var r;
      (r = this.worker) == null || r.then((s) => {
        s.onmessage = null, s.onmessageerror = null, s.removeEventListener("error", n), s.terminate();
      }), this.worker = null;
    }));
  }
  getId() {
    return this.id;
  }
  postMessage(e, t) {
    var n;
    (n = this.worker) == null || n.then((r) => {
      try {
        r.postMessage(e, t);
      } catch (s) {
        fn(s), fn(new Error("FAILED to post message to worker", { cause: s }));
      }
    });
  }
};
QG.LAST_WORKER_ID = 0;
let $ce = QG;
class _2t {
  constructor(e, t) {
    this.esmModuleLocation = e, this.label = t;
  }
}
function b2t(i, e) {
  const t = Ht.isUri(i) ? new _2t(i, e) : i;
  return new h2t(new $ce(t));
}
class v2t {
  constructor(e, t, n) {
    const r = new Uint8Array(e * t);
    for (let s = 0, o = e * t; s < o; s++)
      r[s] = n;
    this._data = r, this.rows = e, this.cols = t;
  }
  get(e, t) {
    return this._data[e * this.cols + t];
  }
  set(e, t, n) {
    this._data[e * this.cols + t] = n;
  }
}
class y2t {
  constructor(e) {
    let t = 0, n = 0;
    for (let s = 0, o = e.length; s < o; s++) {
      const [a, l, c] = e[s];
      l > t && (t = l), a > n && (n = a), c > n && (n = c);
    }
    t++, n++;
    const r = new v2t(
      n,
      t,
      0
      /* State.Invalid */
    );
    for (let s = 0, o = e.length; s < o; s++) {
      const [a, l, c] = e[s];
      r.set(a, l, c);
    }
    this._states = r, this._maxCharCode = t;
  }
  nextState(e, t) {
    return t < 0 || t >= this._maxCharCode ? 0 : this._states.get(e, t);
  }
}
let Bte = null;
function C2t() {
  return Bte === null && (Bte = new y2t([
    [
      1,
      104,
      2
      /* State.H */
    ],
    [
      1,
      72,
      2
      /* State.H */
    ],
    [
      1,
      102,
      6
      /* State.F */
    ],
    [
      1,
      70,
      6
      /* State.F */
    ],
    [
      2,
      116,
      3
      /* State.HT */
    ],
    [
      2,
      84,
      3
      /* State.HT */
    ],
    [
      3,
      116,
      4
      /* State.HTT */
    ],
    [
      3,
      84,
      4
      /* State.HTT */
    ],
    [
      4,
      112,
      5
      /* State.HTTP */
    ],
    [
      4,
      80,
      5
      /* State.HTTP */
    ],
    [
      5,
      115,
      9
      /* State.BeforeColon */
    ],
    [
      5,
      83,
      9
      /* State.BeforeColon */
    ],
    [
      5,
      58,
      10
      /* State.AfterColon */
    ],
    [
      6,
      105,
      7
      /* State.FI */
    ],
    [
      6,
      73,
      7
      /* State.FI */
    ],
    [
      7,
      108,
      8
      /* State.FIL */
    ],
    [
      7,
      76,
      8
      /* State.FIL */
    ],
    [
      8,
      101,
      9
      /* State.BeforeColon */
    ],
    [
      8,
      69,
      9
      /* State.BeforeColon */
    ],
    [
      9,
      58,
      10
      /* State.AfterColon */
    ],
    [
      10,
      47,
      11
      /* State.AlmostThere */
    ],
    [
      11,
      47,
      12
      /* State.End */
    ]
  ])), Bte;
}
let fP = null;
function w2t() {
  if (fP === null) {
    fP = new YA(
      0
      /* CharacterClass.None */
    );
    const i = ` 	<>'"、。｡､，．：；‘〈「『〔（［｛｢｣｝］）〕』」〉’｀～…|`;
    for (let t = 0; t < i.length; t++)
      fP.set(
        i.charCodeAt(t),
        1
        /* CharacterClass.ForceTermination */
      );
    const e = ".,;:";
    for (let t = 0; t < e.length; t++)
      fP.set(
        e.charCodeAt(t),
        2
        /* CharacterClass.CannotEndIn */
      );
  }
  return fP;
}
class b$ {
  static _createLink(e, t, n, r, s) {
    let o = s - 1;
    do {
      const a = t.charCodeAt(o);
      if (e.get(a) !== 2)
        break;
      o--;
    } while (o > r);
    if (r > 0) {
      const a = t.charCodeAt(r - 1), l = t.charCodeAt(o);
      (a === 40 && l === 41 || a === 91 && l === 93 || a === 123 && l === 125) && o--;
    }
    return {
      range: {
        startLineNumber: n,
        startColumn: r + 1,
        endLineNumber: n,
        endColumn: o + 2
      },
      url: t.substring(r, o + 1)
    };
  }
  static computeLinks(e, t = C2t()) {
    const n = w2t(), r = [];
    for (let s = 1, o = e.getLineCount(); s <= o; s++) {
      const a = e.getLineContent(s), l = a.length;
      let c = 0, u = 0, d = 0, h = 1, g = !1, m = !1, _ = !1, v = !1;
      for (; c < l; ) {
        let w = !1;
        const E = a.charCodeAt(c);
        if (h === 13) {
          let L;
          switch (E) {
            case 40:
              g = !0, L = 0;
              break;
            case 41:
              L = g ? 0 : 1;
              break;
            case 91:
              _ = !0, m = !0, L = 0;
              break;
            case 93:
              _ = !1, L = m ? 0 : 1;
              break;
            case 123:
              v = !0, L = 0;
              break;
            case 125:
              L = v ? 0 : 1;
              break;
            // The following three rules make it that ' or " or ` are allowed inside links
            // only if the link is wrapped by some other quote character
            case 39:
            case 34:
            case 96:
              d === E ? L = 1 : d === 39 || d === 34 || d === 96 ? L = 0 : L = 1;
              break;
            case 42:
              L = d === 42 ? 1 : 0;
              break;
            case 32:
              L = _ ? 0 : 1;
              break;
            default:
              L = n.get(E);
          }
          L === 1 && (r.push(b$._createLink(n, a, s, u, c)), w = !0);
        } else if (h === 12) {
          let L;
          E === 91 ? (m = !0, L = 0) : L = n.get(E), L === 1 ? w = !0 : h = 13;
        } else
          h = t.nextState(h, E), h === 0 && (w = !0);
        w && (h = 1, g = !1, m = !1, v = !1, u = c + 1, d = E), c++;
      }
      h === 13 && r.push(b$._createLink(n, a, s, u, l));
    }
    return r;
  }
}
function S2t(i) {
  return !i || typeof i.getLineCount != "function" || typeof i.getLineContent != "function" ? [] : b$.computeLinks(i);
}
const JG = class JG {
  constructor() {
    this._defaultValueSet = [
      ["true", "false"],
      ["True", "False"],
      ["Private", "Public", "Friend", "ReadOnly", "Partial", "Protected", "WriteOnly"],
      ["public", "protected", "private"]
    ];
  }
  navigateValueSet(e, t, n, r, s) {
    if (e && t) {
      const o = this.doNavigateValueSet(t, s);
      if (o)
        return {
          range: e,
          value: o
        };
    }
    if (n && r) {
      const o = this.doNavigateValueSet(r, s);
      if (o)
        return {
          range: n,
          value: o
        };
    }
    return null;
  }
  doNavigateValueSet(e, t) {
    const n = this.numberReplace(e, t);
    return n !== null ? n : this.textReplace(e, t);
  }
  numberReplace(e, t) {
    const n = Math.pow(10, e.length - (e.lastIndexOf(".") + 1));
    let r = Number(e);
    const s = parseFloat(e);
    return !isNaN(r) && !isNaN(s) && r === s ? r === 0 && !t ? null : (r = Math.floor(r * n), r += t ? n : -n, String(r / n)) : null;
  }
  textReplace(e, t) {
    return this.valueSetsReplace(this._defaultValueSet, e, t);
  }
  valueSetsReplace(e, t, n) {
    let r = null;
    for (let s = 0, o = e.length; r === null && s < o; s++)
      r = this.valueSetReplace(e[s], t, n);
    return r;
  }
  valueSetReplace(e, t, n) {
    let r = e.indexOf(t);
    return r >= 0 ? (r += n ? 1 : -1, r < 0 ? r = e.length - 1 : r %= e.length, e[r]) : null;
  }
};
JG.INSTANCE = new JG();
let jce = JG;
function b9e(i) {
  const e = [];
  for (const t of i) {
    const n = Number(t);
    (n || n === 0 && t.replace(/\s/g, "") !== "") && e.push(n);
  }
  return e;
}
function ame(i, e, t, n) {
  return {
    red: i / 255,
    blue: t / 255,
    green: e / 255,
    alpha: n
  };
}
function gP(i, e) {
  const t = e.index, n = e[0].length;
  if (t === void 0)
    return;
  const r = i.positionAt(t);
  return {
    startLineNumber: r.lineNumber,
    startColumn: r.column,
    endLineNumber: r.lineNumber,
    endColumn: r.column + n
  };
}
function E2t(i, e) {
  if (!i)
    return;
  const t = De.Format.CSS.parseHex(e);
  if (t)
    return {
      range: i,
      color: ame(t.rgba.r, t.rgba.g, t.rgba.b, t.rgba.a)
    };
}
function HNe(i, e, t) {
  if (!i || e.length !== 1)
    return;
  const r = e[0].values(), s = b9e(r);
  return {
    range: i,
    color: ame(s[0], s[1], s[2], t ? s[3] : 1)
  };
}
function WNe(i, e, t) {
  if (!i || e.length !== 1)
    return;
  const r = e[0].values(), s = b9e(r), o = new De(new Pg(s[0], s[1] / 100, s[2] / 100, t ? s[3] : 1));
  return {
    range: i,
    color: ame(o.rgba.r, o.rgba.g, o.rgba.b, o.rgba.a)
  };
}
function pP(i, e) {
  return typeof i == "string" ? [...i.matchAll(e)] : i.findMatches(e);
}
function x2t(i) {
  const e = [], t = new RegExp(`\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{8})\\b`, "gm"), n = pP(i, t);
  if (n.length > 0)
    for (const r of n) {
      const s = r.filter((c) => c !== void 0), o = s[1], a = s[2];
      if (!a)
        continue;
      let l;
      if (o === "rgb") {
        const c = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;
        l = HNe(gP(i, r), pP(a, c), !1);
      } else if (o === "rgba") {
        const c = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;
        l = HNe(gP(i, r), pP(a, c), !0);
      } else if (o === "hsl") {
        const c = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;
        l = WNe(gP(i, r), pP(a, c), !1);
      } else if (o === "hsla") {
        const c = /^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;
        l = WNe(gP(i, r), pP(a, c), !0);
      } else o === "#" && (l = E2t(gP(i, r), o + a));
      l && e.push(l);
    }
  return e;
}
function L2t(i) {
  return !i || typeof i.getValue != "function" || typeof i.positionAt != "function" ? [] : x2t(i);
}
const T2t = /^-+|-+$/g, VNe = 100, k2t = 5;
function D2t(i, e) {
  var n;
  let t = [];
  if (e.findRegionSectionHeaders && ((n = e.foldingRules) != null && n.markers)) {
    const r = I2t(i, e);
    t = t.concat(r);
  }
  if (e.findMarkSectionHeaders) {
    const r = N2t(i, e);
    t = t.concat(r);
  }
  return t;
}
function I2t(i, e) {
  const t = [], n = i.getLineCount();
  for (let r = 1; r <= n; r++) {
    const s = i.getLineContent(r), o = s.match(e.foldingRules.markers.start);
    if (o) {
      const a = { startLineNumber: r, startColumn: o[0].length + 1, endLineNumber: r, endColumn: s.length + 1 };
      if (a.endColumn > a.startColumn) {
        const l = {
          range: a,
          ...R2t(s.substring(o[0].length)),
          shouldBeInComments: !1
        };
        (l.text || l.hasSeparatorLine) && t.push(l);
      }
    }
  }
  return t;
}
function N2t(i, e) {
  const t = [], n = i.getLineCount();
  if (!e.markSectionHeaderRegex || e.markSectionHeaderRegex.trim() === "")
    return t;
  const r = i4e(e.markSectionHeaderRegex), s = new RegExp(e.markSectionHeaderRegex, `gdm${r ? "s" : ""}`);
  if (XMe(s))
    return t;
  for (let o = 1; o <= n; o += VNe - k2t) {
    const a = Math.min(o + VNe - 1, n), l = [];
    for (let d = o; d <= a; d++)
      l.push(i.getLineContent(d));
    const c = l.join(`
`);
    s.lastIndex = 0;
    let u;
    for (; (u = s.exec(c)) !== null; ) {
      const d = c.substring(0, u.index), h = (d.match(/\n/g) || []).length, g = o + h, m = u[0].split(`
`), _ = m.length, v = g + _ - 1, w = d.lastIndexOf(`
`) + 1, E = u.index - w + 1, L = m[m.length - 1], T = _ === 1 ? E + u[0].length : L.length + 1, D = {
        startLineNumber: g,
        startColumn: E,
        endLineNumber: v,
        endColumn: T
      }, N = (u.groups ?? {}).label ?? "", R = ((u.groups ?? {}).separator ?? "") !== "", M = {
        range: D,
        text: N,
        hasSeparatorLine: R,
        shouldBeInComments: !0
      };
      (M.text || M.hasSeparatorLine) && (t.length === 0 || t[t.length - 1].range.endLineNumber < M.range.startLineNumber) && t.push(M), s.lastIndex = u.index + u[0].length;
    }
  }
  return t;
}
function R2t(i) {
  i = i.trim();
  const e = i.startsWith("-");
  return i = i.replace(T2t, ""), { text: i, hasSeparatorLine: e };
}
class A2t {
  constructor(e, t, n, r) {
    this._uri = e, this._lines = t, this._eol = n, this._versionId = r, this._lineStarts = null, this._cachedTextValue = null;
  }
  dispose() {
    this._lines.length = 0;
  }
  get version() {
    return this._versionId;
  }
  getText() {
    return this._cachedTextValue === null && (this._cachedTextValue = this._lines.join(this._eol)), this._cachedTextValue;
  }
  onEvents(e) {
    e.eol && e.eol !== this._eol && (this._eol = e.eol, this._lineStarts = null);
    const t = e.changes;
    for (const n of t)
      this._acceptDeleteRange(n.range), this._acceptInsertText(new de(n.range.startLineNumber, n.range.startColumn), n.text);
    this._versionId = e.versionId, this._cachedTextValue = null;
  }
  _ensureLineStarts() {
    if (!this._lineStarts) {
      const e = this._eol.length, t = this._lines.length, n = new Uint32Array(t);
      for (let r = 0; r < t; r++)
        n[r] = this._lines[r].length + e;
      this._lineStarts = new zpt(n);
    }
  }
  /**
   * All changes to a line's text go through this method
   */
  _setLineText(e, t) {
    this._lines[e] = t, this._lineStarts && this._lineStarts.setValue(e, this._lines[e].length + this._eol.length);
  }
  _acceptDeleteRange(e) {
    if (e.startLineNumber === e.endLineNumber) {
      if (e.startColumn === e.endColumn)
        return;
      this._setLineText(e.startLineNumber - 1, this._lines[e.startLineNumber - 1].substring(0, e.startColumn - 1) + this._lines[e.startLineNumber - 1].substring(e.endColumn - 1));
      return;
    }
    this._setLineText(e.startLineNumber - 1, this._lines[e.startLineNumber - 1].substring(0, e.startColumn - 1) + this._lines[e.endLineNumber - 1].substring(e.endColumn - 1)), this._lines.splice(e.startLineNumber, e.endLineNumber - e.startLineNumber), this._lineStarts && this._lineStarts.removeValues(e.startLineNumber, e.endLineNumber - e.startLineNumber);
  }
  _acceptInsertText(e, t) {
    if (t.length === 0)
      return;
    const n = $d(t);
    if (n.length === 1) {
      this._setLineText(e.lineNumber - 1, this._lines[e.lineNumber - 1].substring(0, e.column - 1) + n[0] + this._lines[e.lineNumber - 1].substring(e.column - 1));
      return;
    }
    n[n.length - 1] += this._lines[e.lineNumber - 1].substring(e.column - 1), this._setLineText(e.lineNumber - 1, this._lines[e.lineNumber - 1].substring(0, e.column - 1) + n[0]);
    const r = new Uint32Array(n.length - 1);
    for (let s = 1; s < n.length; s++)
      this._lines.splice(e.lineNumber + s - 1, 0, n[s]), r[s - 1] = n[s].length + this._eol.length;
    this._lineStarts && this._lineStarts.insertValues(e.lineNumber, r);
  }
}
const UNe = 60 * 1e3;
class O2t extends ge {
  constructor(e, t, n = !1) {
    if (super(), this._syncedModels = /* @__PURE__ */ Object.create(null), this._syncedModelsLastUsedTime = /* @__PURE__ */ Object.create(null), this._proxy = e, this._modelService = t, !n) {
      const r = new Ahe();
      r.cancelAndSet(() => this._checkStopModelSync(), Math.round(UNe / 2)), this._register(r);
    }
  }
  dispose() {
    for (const e in this._syncedModels)
      or(this._syncedModels[e]);
    this._syncedModels = /* @__PURE__ */ Object.create(null), this._syncedModelsLastUsedTime = /* @__PURE__ */ Object.create(null), super.dispose();
  }
  ensureSyncedResources(e, t = !1) {
    for (const n of e) {
      const r = n.toString();
      this._syncedModels[r] || this._beginModelSync(n, t), this._syncedModels[r] && (this._syncedModelsLastUsedTime[r] = (/* @__PURE__ */ new Date()).getTime());
    }
  }
  _checkStopModelSync() {
    const e = (/* @__PURE__ */ new Date()).getTime(), t = [];
    for (const n in this._syncedModelsLastUsedTime)
      e - this._syncedModelsLastUsedTime[n] > UNe && t.push(n);
    for (const n of t)
      this._stopModelSync(n);
  }
  _beginModelSync(e, t) {
    const n = this._modelService.getModel(e);
    if (!n || !t && n.isTooLargeForSyncing())
      return;
    const r = e.toString();
    this._proxy.$acceptNewModel({
      url: n.uri.toString(),
      lines: n.getLinesContent(),
      EOL: n.getEOL(),
      versionId: n.getVersionId()
    });
    const s = new ke();
    s.add(n.onDidChangeContent((o) => {
      this._proxy.$acceptModelChanged(r.toString(), o);
    })), s.add(n.onWillDispose(() => {
      this._stopModelSync(r);
    })), s.add(Et(() => {
      this._proxy.$acceptRemovedModel(r);
    })), this._syncedModels[r] = s;
  }
  _stopModelSync(e) {
    const t = this._syncedModels[e];
    delete this._syncedModels[e], delete this._syncedModelsLastUsedTime[e], or(t);
  }
}
class M2t {
  constructor() {
    this._models = /* @__PURE__ */ Object.create(null);
  }
  getModel(e) {
    return this._models[e];
  }
  getModels() {
    const e = [];
    return Object.keys(this._models).forEach((t) => e.push(this._models[t])), e;
  }
  $acceptNewModel(e) {
    this._models[e.url] = new P2t(Ht.parse(e.url), e.lines, e.EOL, e.versionId);
  }
  $acceptModelChanged(e, t) {
    if (!this._models[e])
      return;
    this._models[e].onEvents(t);
  }
  $acceptRemovedModel(e) {
    this._models[e] && delete this._models[e];
  }
}
class P2t extends A2t {
  get uri() {
    return this._uri;
  }
  get eol() {
    return this._eol;
  }
  getValue() {
    return this.getText();
  }
  findMatches(e) {
    const t = [];
    for (let n = 0; n < this._lines.length; n++) {
      const r = this._lines[n], s = this.offsetAt(new de(n + 1, 1)), o = r.matchAll(e);
      for (const a of o)
        (a.index || a.index === 0) && (a.index = a.index + s), t.push(a);
    }
    return t;
  }
  getLinesContent() {
    return this._lines.slice(0);
  }
  getLineCount() {
    return this._lines.length;
  }
  getLineContent(e) {
    return this._lines[e - 1];
  }
  getWordAtPosition(e, t) {
    const n = c4(e.column, ofe(t), this._lines[e.lineNumber - 1], 0);
    return n ? new z(e.lineNumber, n.startColumn, e.lineNumber, n.endColumn) : null;
  }
  words(e) {
    const t = this._lines, n = this._wordenize.bind(this);
    let r = 0, s = "", o = 0, a = [];
    return {
      *[Symbol.iterator]() {
        for (; ; )
          if (o < a.length) {
            const l = s.substring(a[o].start, a[o].end);
            o += 1, yield l;
          } else if (r < t.length)
            s = t[r], a = n(s, e), o = 0, r += 1;
          else
            break;
      }
    };
  }
  getLineWords(e, t) {
    const n = this._lines[e - 1], r = this._wordenize(n, t), s = [];
    for (const o of r)
      s.push({
        word: n.substring(o.start, o.end),
        startColumn: o.start + 1,
        endColumn: o.end + 1
      });
    return s;
  }
  _wordenize(e, t) {
    const n = [];
    let r;
    for (t.lastIndex = 0; (r = t.exec(e)) && r[0].length !== 0; )
      n.push({ start: r.index, end: r.index + r[0].length });
    return n;
  }
  getValueInRange(e) {
    if (e = this._validateRange(e), e.startLineNumber === e.endLineNumber)
      return this._lines[e.startLineNumber - 1].substring(e.startColumn - 1, e.endColumn - 1);
    const t = this._eol, n = e.startLineNumber - 1, r = e.endLineNumber - 1, s = [];
    s.push(this._lines[n].substring(e.startColumn - 1));
    for (let o = n + 1; o < r; o++)
      s.push(this._lines[o]);
    return s.push(this._lines[r].substring(0, e.endColumn - 1)), s.join(t);
  }
  offsetAt(e) {
    return e = this._validatePosition(e), this._ensureLineStarts(), this._lineStarts.getPrefixSum(e.lineNumber - 2) + (e.column - 1);
  }
  positionAt(e) {
    e = Math.floor(e), e = Math.max(0, e), this._ensureLineStarts();
    const t = this._lineStarts.getIndexOf(e), n = this._lines[t.index].length;
    return {
      lineNumber: 1 + t.index,
      column: 1 + Math.min(t.remainder, n)
    };
  }
  _validateRange(e) {
    const t = this._validatePosition({ lineNumber: e.startLineNumber, column: e.startColumn }), n = this._validatePosition({ lineNumber: e.endLineNumber, column: e.endColumn });
    return t.lineNumber !== e.startLineNumber || t.column !== e.startColumn || n.lineNumber !== e.endLineNumber || n.column !== e.endColumn ? {
      startLineNumber: t.lineNumber,
      startColumn: t.column,
      endLineNumber: n.lineNumber,
      endColumn: n.column
    } : e;
  }
  _validatePosition(e) {
    if (!de.isIPosition(e))
      throw new Error("bad position");
    let { lineNumber: t, column: n } = e, r = !1;
    if (t < 1)
      t = 1, n = 1, r = !0;
    else if (t > this._lines.length)
      t = this._lines.length, n = this._lines[t - 1].length + 1, r = !0;
    else {
      const s = this._lines[t - 1].length + 1;
      n < 1 ? (n = 1, r = !0) : n > s && (n = s, r = !0);
    }
    return r ? { lineNumber: t, column: n } : e;
  }
}
const ax = class ax {
  constructor(e = null) {
    this._foreignModule = e, this._workerTextModelSyncServer = new M2t();
  }
  dispose() {
  }
  async $ping() {
    return "pong";
  }
  _getModel(e) {
    return this._workerTextModelSyncServer.getModel(e);
  }
  getModels() {
    return this._workerTextModelSyncServer.getModels();
  }
  $acceptNewModel(e) {
    this._workerTextModelSyncServer.$acceptNewModel(e);
  }
  $acceptModelChanged(e, t) {
    this._workerTextModelSyncServer.$acceptModelChanged(e, t);
  }
  $acceptRemovedModel(e) {
    this._workerTextModelSyncServer.$acceptRemovedModel(e);
  }
  async $computeUnicodeHighlights(e, t, n) {
    const r = this._getModel(e);
    return r ? Qpe.computeUnicodeHighlights(r, t, n) : { ranges: [], hasMore: !1, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 };
  }
  async $findSectionHeaders(e, t) {
    const n = this._getModel(e);
    return n ? D2t(n, t) : [];
  }
  // ---- BEGIN diff --------------------------------------------------------------------------
  async $computeDiff(e, t, n, r) {
    const s = this._getModel(e), o = this._getModel(t);
    return !s || !o ? null : ax.computeDiff(s, o, n, r);
  }
  static computeDiff(e, t, n, r) {
    const s = r === "advanced" ? Zoe.getDefault() : Zoe.getLegacy(), o = e.getLinesContent(), a = t.getLinesContent(), l = s.computeDiff(o, a, n), c = l.changes.length > 0 ? !1 : this._modelsAreIdentical(e, t);
    function u(d) {
      return d.map((h) => {
        var g;
        return [h.original.startLineNumber, h.original.endLineNumberExclusive, h.modified.startLineNumber, h.modified.endLineNumberExclusive, (g = h.innerChanges) == null ? void 0 : g.map((m) => [
          m.originalRange.startLineNumber,
          m.originalRange.startColumn,
          m.originalRange.endLineNumber,
          m.originalRange.endColumn,
          m.modifiedRange.startLineNumber,
          m.modifiedRange.startColumn,
          m.modifiedRange.endLineNumber,
          m.modifiedRange.endColumn
        ])];
      });
    }
    return {
      identical: c,
      quitEarly: l.hitTimeout,
      changes: u(l.changes),
      moves: l.moves.map((d) => [
        d.lineRangeMapping.original.startLineNumber,
        d.lineRangeMapping.original.endLineNumberExclusive,
        d.lineRangeMapping.modified.startLineNumber,
        d.lineRangeMapping.modified.endLineNumberExclusive,
        u(d.changes)
      ])
    };
  }
  static _modelsAreIdentical(e, t) {
    const n = e.getLineCount(), r = t.getLineCount();
    if (n !== r)
      return !1;
    for (let s = 1; s <= n; s++) {
      const o = e.getLineContent(s), a = t.getLineContent(s);
      if (o !== a)
        return !1;
    }
    return !0;
  }
  async $computeMoreMinimalEdits(e, t, n) {
    const r = this._getModel(e);
    if (!r)
      return t;
    const s = [];
    let o;
    t = t.slice(0).sort((l, c) => {
      if (l.range && c.range)
        return z.compareRangesUsingStarts(l.range, c.range);
      const u = l.range ? 0 : 1, d = c.range ? 0 : 1;
      return u - d;
    });
    let a = 0;
    for (let l = 1; l < t.length; l++)
      z.getEndPosition(t[a].range).equals(z.getStartPosition(t[l].range)) ? (t[a].range = z.fromPositions(z.getStartPosition(t[a].range), z.getEndPosition(t[l].range)), t[a].text += t[l].text) : (a++, t[a] = t[l]);
    t.length = a + 1;
    for (let { range: l, text: c, eol: u } of t) {
      if (typeof u == "number" && (o = u), z.isEmpty(l) && !c)
        continue;
      const d = r.getValueInRange(l);
      if (c = c.replace(/\r\n|\n|\r/g, r.eol), d === c)
        continue;
      if (Math.max(c.length, d.length) > ax._diffLimit) {
        s.push({ range: l, text: c });
        continue;
      }
      const h = _wt(d, c, n), g = r.offsetAt(z.lift(l).getStartPosition());
      for (const m of h) {
        const _ = r.positionAt(g + m.originalStart), v = r.positionAt(g + m.originalStart + m.originalLength), w = {
          text: c.substr(m.modifiedStart, m.modifiedLength),
          range: { startLineNumber: _.lineNumber, startColumn: _.column, endLineNumber: v.lineNumber, endColumn: v.column }
        };
        r.getValueInRange(w.range) !== w.text && s.push(w);
      }
    }
    return typeof o == "number" && s.push({ eol: o, text: "", range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }), s;
  }
  // ---- END minimal edits ---------------------------------------------------------------
  async $computeLinks(e) {
    const t = this._getModel(e);
    return t ? S2t(t) : null;
  }
  // --- BEGIN default document colors -----------------------------------------------------------
  async $computeDefaultDocumentColors(e) {
    const t = this._getModel(e);
    return t ? L2t(t) : null;
  }
  async $textualSuggest(e, t, n, r) {
    const s = new _a(), o = new RegExp(n, r), a = /* @__PURE__ */ new Set();
    e: for (const l of e) {
      const c = this._getModel(l);
      if (c) {
        for (const u of c.words(o))
          if (!(u === t || !isNaN(Number(u))) && (a.add(u), a.size > ax._suggestionsLimit))
            break e;
      }
    }
    return { words: Array.from(a), duration: s.elapsed() };
  }
  // ---- END suggest --------------------------------------------------------------------------
  //#region -- word ranges --
  async $computeWordRanges(e, t, n, r) {
    const s = this._getModel(e);
    if (!s)
      return /* @__PURE__ */ Object.create(null);
    const o = new RegExp(n, r), a = /* @__PURE__ */ Object.create(null);
    for (let l = t.startLineNumber; l < t.endLineNumber; l++) {
      const c = s.getLineWords(l, o);
      for (const u of c) {
        if (!isNaN(Number(u.word)))
          continue;
        let d = a[u.word];
        d || (d = [], a[u.word] = d), d.push({
          startLineNumber: l,
          startColumn: u.startColumn,
          endLineNumber: l,
          endColumn: u.endColumn
        });
      }
    }
    return a;
  }
  //#endregion
  async $navigateValueSet(e, t, n, r, s) {
    const o = this._getModel(e);
    if (!o)
      return null;
    const a = new RegExp(r, s);
    t.startColumn === t.endColumn && (t = {
      startLineNumber: t.startLineNumber,
      startColumn: t.startColumn,
      endLineNumber: t.endLineNumber,
      endColumn: t.endColumn + 1
    });
    const l = o.getValueInRange(t), c = o.getWordAtPosition({ lineNumber: t.startLineNumber, column: t.startColumn }, a);
    if (!c)
      return null;
    const u = o.getValueInRange(c);
    return jce.INSTANCE.navigateValueSet(t, l, c, u, n);
  }
  // ---- BEGIN foreign module support --------------------------------------------------------------------------
  // foreign method request
  $fmr(e, t) {
    if (!this._foreignModule || typeof this._foreignModule[e] != "function")
      return Promise.reject(new Error("Missing requestHandler or method: " + e));
    try {
      return Promise.resolve(this._foreignModule[e].apply(this._foreignModule, t));
    } catch (n) {
      return Promise.reject(n);
    }
  }
};
ax._diffLimit = 1e5, ax._suggestionsLimit = 1e4;
let Gce = ax;
typeof importScripts == "function" && (globalThis.monaco = p9e());
const V3 = class V3 {
  static getChannel(e) {
    return e.getChannel(V3.CHANNEL_NAME);
  }
  static setChannel(e, t) {
    e.setChannel(V3.CHANNEL_NAME, t);
  }
};
V3.CHANNEL_NAME = "editorWorkerHost";
let qce = V3;
var lme = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, qE = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const zNe = 300 * 1e3;
function KE(i, e) {
  const t = i.getModel(e);
  return !(!t || t.isTooLargeForSyncing());
}
let Kce = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._languageConfigurationService = s, this._modelService = t, this._workerManager = this._register(new Yce(e, this._modelService)), this._logService = r, this._register(o.linkProvider.register({ language: "*", hasAccessToAllModels: !0 }, {
      provideLinks: async (a, l) => {
        if (!KE(this._modelService, a.uri))
          return Promise.resolve({ links: [] });
        const u = await (await this._workerWithResources([a.uri])).$computeLinks(a.uri.toString());
        return u && { links: u };
      }
    })), this._register(o.completionProvider.register("*", new F2t(this._workerManager, n, this._modelService, this._languageConfigurationService, this._logService)));
  }
  dispose() {
    super.dispose();
  }
  canComputeUnicodeHighlights(e) {
    return KE(this._modelService, e);
  }
  async computedUnicodeHighlights(e, t, n) {
    return (await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(), t, n);
  }
  async computeDiff(e, t, n, r) {
    const o = await (await this._workerWithResources(
      [e, t],
      /* forceLargeModels */
      !0
    )).$computeDiff(e.toString(), t.toString(), n, r);
    if (!o)
      return null;
    return {
      identical: o.identical,
      quitEarly: o.quitEarly,
      changes: l(o.changes),
      moves: o.moves.map((c) => new m5e(new wc(new Zt(c[0], c[1]), new Zt(c[2], c[3])), l(c[4])))
    };
    function l(c) {
      return c.map((u) => {
        var d;
        return new jh(new Zt(u[0], u[1]), new Zt(u[2], u[3]), (d = u[4]) == null ? void 0 : d.map((h) => new nu(new z(h[0], h[1], h[2], h[3]), new z(h[4], h[5], h[6], h[7]))));
      });
    }
  }
  async computeMoreMinimalEdits(e, t, n = !1) {
    if (kc(t)) {
      if (!KE(this._modelService, e))
        return Promise.resolve(t);
      const r = _a.create(), s = this._workerWithResources([e]).then((o) => o.$computeMoreMinimalEdits(e.toString(), t, n));
      return s.finally(() => this._logService.trace("FORMAT#computeMoreMinimalEdits", e.toString(!0), r.elapsed())), Promise.race([s, db(1e3).then(() => t)]);
    } else
      return Promise.resolve(void 0);
  }
  canNavigateValueSet(e) {
    return KE(this._modelService, e);
  }
  async navigateValueSet(e, t, n) {
    const r = this._modelService.getModel(e);
    if (!r)
      return null;
    const s = this._languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(), o = s.source, a = s.flags;
    return (await this._workerWithResources([e])).$navigateValueSet(e.toString(), t, n, o, a);
  }
  canComputeWordRanges(e) {
    return KE(this._modelService, e);
  }
  async computeWordRanges(e, t) {
    const n = this._modelService.getModel(e);
    if (!n)
      return Promise.resolve(null);
    const r = this._languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(), s = r.source, o = r.flags;
    return (await this._workerWithResources([e])).$computeWordRanges(e.toString(), t, s, o);
  }
  async findSectionHeaders(e, t) {
    return (await this._workerWithResources([e])).$findSectionHeaders(e.toString(), t);
  }
  async computeDefaultDocumentColors(e) {
    return (await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString());
  }
  async _workerWithResources(e, t = !1) {
    return await (await this._workerManager.withWorker()).workerWithSyncedResources(e, t);
  }
};
Kce = lme([
  qE(1, xs),
  qE(2, UK),
  qE(3, $r),
  qE(4, Ls),
  qE(5, St)
], Kce);
class F2t {
  constructor(e, t, n, r, s) {
    this.languageConfigurationService = r, this.logService = s, this._debugDisplayName = "wordbasedCompletions", this._workerManager = e, this._configurationService = t, this._modelService = n;
  }
  async provideCompletionItems(e, t) {
    const n = this._configurationService.getValue(e.uri, t, "editor");
    if (n.wordBasedSuggestions === "off")
      return;
    const r = [];
    if (n.wordBasedSuggestions === "currentDocument")
      KE(this._modelService, e.uri) && r.push(e.uri);
    else
      for (const d of this._modelService.getModels())
        KE(this._modelService, d.uri) && (d === e ? r.unshift(d.uri) : (n.wordBasedSuggestions === "allDocuments" || d.getLanguageId() === e.getLanguageId()) && r.push(d.uri));
    if (r.length === 0)
      return;
    const s = this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(), o = e.getWordAtPosition(t), a = o ? new z(t.lineNumber, o.startColumn, t.lineNumber, o.endColumn) : z.fromPositions(t), l = a.setEndPosition(t.lineNumber, t.column);
    this.logService.trace("[WordBasedCompletionItemProvider]", `word: "${(o == null ? void 0 : o.word) || ""}", wordDef: "${s}", replace: [${a.toString()}], insert: [${l.toString()}]`);
    const u = await (await this._workerManager.withWorker()).textualSuggest(r, o == null ? void 0 : o.word, s);
    if (u)
      return {
        duration: u.duration,
        suggestions: u.words.map((d) => ({
          kind: 18,
          label: d,
          insertText: d,
          range: { insert: l, replace: a }
        }))
      };
  }
}
let Yce = class extends ge {
  constructor(e, t) {
    super(), this._workerDescriptor = e, this._modelService = t, this._editorWorkerClient = null, this._lastWorkerUsedTime = (/* @__PURE__ */ new Date()).getTime(), this._register(new yq()).cancelAndSet(() => this._checkStopIdleWorker(), Math.round(zNe / 2), fr), this._register(this._modelService.onModelRemoved((r) => this._checkStopEmptyWorker()));
  }
  dispose() {
    this._editorWorkerClient && (this._editorWorkerClient.dispose(), this._editorWorkerClient = null), super.dispose();
  }
  /**
   * Check if the model service has no more models and stop the worker if that is the case.
   */
  _checkStopEmptyWorker() {
    if (!this._editorWorkerClient)
      return;
    this._modelService.getModels().length === 0 && (this._editorWorkerClient.dispose(), this._editorWorkerClient = null);
  }
  /**
   * Check if the worker has been idle for a while and then stop it.
   */
  _checkStopIdleWorker() {
    if (!this._editorWorkerClient)
      return;
    (/* @__PURE__ */ new Date()).getTime() - this._lastWorkerUsedTime > zNe && (this._editorWorkerClient.dispose(), this._editorWorkerClient = null);
  }
  withWorker() {
    return this._lastWorkerUsedTime = (/* @__PURE__ */ new Date()).getTime(), this._editorWorkerClient || (this._editorWorkerClient = new v$(this._workerDescriptor, !1, this._modelService)), Promise.resolve(this._editorWorkerClient);
  }
};
Yce = lme([
  qE(1, xs)
], Yce);
class B2t {
  constructor(e) {
    this._instance = e, this.proxy = this._instance;
  }
  dispose() {
    this._instance.dispose();
  }
  setChannel(e, t) {
    throw new Error("Not supported");
  }
}
let v$ = class extends ge {
  constructor(e, t, n) {
    super(), this._workerDescriptorOrWorker = e, this._disposed = !1, this._modelService = n, this._keepIdleModels = t, this._worker = null, this._modelManager = null;
  }
  // foreign host request
  fhr(e, t) {
    throw new Error("Not implemented!");
  }
  _getOrCreateWorker() {
    if (!this._worker)
      try {
        this._worker = this._register(b2t(this._workerDescriptorOrWorker)), qce.setChannel(this._worker, this._createEditorWorkerHost());
      } catch (e) {
        zce(e), this._worker = this._createFallbackLocalWorker();
      }
    return this._worker;
  }
  async _getProxy() {
    try {
      const e = this._getOrCreateWorker().proxy;
      return await e.$ping(), e;
    } catch (e) {
      return zce(e), this._worker = this._createFallbackLocalWorker(), this._worker.proxy;
    }
  }
  _createFallbackLocalWorker() {
    return new B2t(new Gce(null));
  }
  _createEditorWorkerHost() {
    return {
      $fhr: (e, t) => this.fhr(e, t)
    };
  }
  _getOrCreateModelManager(e) {
    return this._modelManager || (this._modelManager = this._register(new O2t(e, this._modelService, this._keepIdleModels))), this._modelManager;
  }
  async workerWithSyncedResources(e, t = !1) {
    if (this._disposed)
      return Promise.reject(htt());
    const n = await this._getProxy();
    return this._getOrCreateModelManager(n).ensureSyncedResources(e, t), n;
  }
  async textualSuggest(e, t, n) {
    const r = await this.workerWithSyncedResources(e), s = n.source, o = n.flags;
    return r.$textualSuggest(e.map((a) => a.toString()), t, s, o);
  }
  dispose() {
    super.dispose(), this._disposed = !0;
  }
};
v$ = lme([
  qE(2, xs)
], v$);
function H2t(i, e) {
  return new W2t(i, e);
}
class W2t extends v$ {
  constructor(e, t) {
    super(t.worker, t.keepIdleModels || !1, e), this._foreignModuleHost = t.host || null, this._foreignProxy = this._getProxy().then((n) => new Proxy({}, {
      get(r, s, o) {
        if (s !== "then") {
          if (typeof s != "string")
            throw new Error("Not supported");
          return (...a) => n.$fmr(s, a);
        }
      }
    }));
  }
  // foreign host request
  fhr(e, t) {
    if (!this._foreignModuleHost || typeof this._foreignModuleHost[e] != "function")
      return Promise.reject(new Error("Missing method " + e + " or missing main thread foreign host."));
    try {
      return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost, t));
    } catch (n) {
      return Promise.reject(n);
    }
  }
  getProxy() {
    return this._foreignProxy;
  }
  withSyncedResources(e) {
    return this.workerWithSyncedResources(e).then((t) => this.getProxy());
  }
}
function V2t(i) {
  return Array.isArray(i);
}
function U2t(i) {
  return !V2t(i);
}
function v9e(i) {
  return typeof i == "string";
}
function $Ne(i) {
  return !v9e(i);
}
function YE(i) {
  return !i;
}
function Wy(i, e) {
  return i.ignoreCase && e ? e.toLowerCase() : e;
}
function jNe(i) {
  return i.replace(/[&<>'"_]/g, "-");
}
function z2t(i, e) {
  console.log(`${i.languageId}: ${e}`);
}
function as(i, e) {
  return new Error(`${i.languageId}: ${e}`);
}
function t1(i, e, t, n, r) {
  const s = /\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;
  let o = null;
  return e.replace(s, function(a, l, c, u, d, h, g, m, _) {
    return YE(c) ? YE(u) ? !YE(d) && d < n.length ? Wy(i, n[d]) : !YE(g) && i && typeof i[g] == "string" ? i[g] : (o === null && (o = r.split("."), o.unshift(r)), !YE(h) && h < o.length ? Wy(i, o[h]) : "") : Wy(i, t) : "$";
  });
}
function $2t(i, e, t) {
  const n = /\$[sS](\d\d?)/g;
  let r = null;
  return e.replace(n, function(s, o) {
    return r === null && (r = t.split("."), r.unshift(t)), !YE(o) && o < r.length ? zd(Wy(i, r[o])) : "";
  });
}
function HH(i, e) {
  let t = e;
  for (; t && t.length > 0; ) {
    const n = i.tokenizer[t];
    if (n)
      return n;
    const r = t.lastIndexOf(".");
    r < 0 ? t = null : t = t.substr(0, r);
  }
  return null;
}
function j2t(i, e) {
  let t = e;
  for (; t && t.length > 0; ) {
    if (i.stateNames[t])
      return !0;
    const r = t.lastIndexOf(".");
    r < 0 ? t = null : t = t.substr(0, r);
  }
  return !1;
}
var G2t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, q2t = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Xce;
const y9e = 5, eq = class eq {
  static create(e, t) {
    return this._INSTANCE.create(e, t);
  }
  constructor(e) {
    this._maxCacheDepth = e, this._entries = /* @__PURE__ */ Object.create(null);
  }
  create(e, t) {
    if (e !== null && e.depth >= this._maxCacheDepth)
      return new fR(e, t);
    let n = fR.getStackElementId(e);
    n.length > 0 && (n += "|"), n += t;
    let r = this._entries[n];
    return r || (r = new fR(e, t), this._entries[n] = r, r);
  }
};
eq._INSTANCE = new eq(y9e);
let R5 = eq;
class fR {
  constructor(e, t) {
    this.parent = e, this.state = t, this.depth = (this.parent ? this.parent.depth : 0) + 1;
  }
  static getStackElementId(e) {
    let t = "";
    for (; e !== null; )
      t.length > 0 && (t += "|"), t += e.state, e = e.parent;
    return t;
  }
  static _equals(e, t) {
    for (; e !== null && t !== null; ) {
      if (e === t)
        return !0;
      if (e.state !== t.state)
        return !1;
      e = e.parent, t = t.parent;
    }
    return e === null && t === null;
  }
  equals(e) {
    return fR._equals(this, e);
  }
  push(e) {
    return R5.create(this, e);
  }
  pop() {
    return this.parent;
  }
  popall() {
    let e = this;
    for (; e.parent; )
      e = e.parent;
    return e;
  }
  switchTo(e) {
    return R5.create(this.parent, e);
  }
}
class CN {
  constructor(e, t) {
    this.languageId = e, this.state = t;
  }
  equals(e) {
    return this.languageId === e.languageId && this.state.equals(e.state);
  }
  clone() {
    return this.state.clone() === this.state ? this : new CN(this.languageId, this.state);
  }
}
const tq = class tq {
  static create(e, t) {
    return this._INSTANCE.create(e, t);
  }
  constructor(e) {
    this._maxCacheDepth = e, this._entries = /* @__PURE__ */ Object.create(null);
  }
  create(e, t) {
    if (t !== null)
      return new a3(e, t);
    if (e !== null && e.depth >= this._maxCacheDepth)
      return new a3(e, t);
    const n = fR.getStackElementId(e);
    let r = this._entries[n];
    return r || (r = new a3(e, null), this._entries[n] = r, r);
  }
};
tq._INSTANCE = new tq(y9e);
let n1 = tq;
class a3 {
  constructor(e, t) {
    this.stack = e, this.embeddedLanguageData = t;
  }
  clone() {
    return (this.embeddedLanguageData ? this.embeddedLanguageData.clone() : null) === this.embeddedLanguageData ? this : n1.create(this.stack, this.embeddedLanguageData);
  }
  equals(e) {
    return !(e instanceof a3) || !this.stack.equals(e.stack) ? !1 : this.embeddedLanguageData === null && e.embeddedLanguageData === null ? !0 : this.embeddedLanguageData === null || e.embeddedLanguageData === null ? !1 : this.embeddedLanguageData.equals(e.embeddedLanguageData);
  }
}
class K2t {
  constructor() {
    this._tokens = [], this._languageId = null, this._lastTokenType = null, this._lastTokenLanguage = null;
  }
  enterLanguage(e) {
    this._languageId = e;
  }
  emit(e, t) {
    this._lastTokenType === t && this._lastTokenLanguage === this._languageId || (this._lastTokenType = t, this._lastTokenLanguage = this._languageId, this._tokens.push(new E4(e, t, this._languageId)));
  }
  nestedLanguageTokenize(e, t, n, r) {
    const s = n.languageId, o = n.state, a = Ys.get(s);
    if (!a)
      return this.enterLanguage(s), this.emit(r, ""), o;
    const l = a.tokenize(e, t, o);
    if (r !== 0)
      for (const c of l.tokens)
        this._tokens.push(new E4(c.offset + r, c.type, c.language));
    else
      this._tokens = this._tokens.concat(l.tokens);
    return this._lastTokenType = null, this._lastTokenLanguage = null, this._languageId = null, l.endState;
  }
  finalize(e) {
    return new Pfe(this._tokens, e);
  }
}
class y$ {
  constructor(e, t) {
    this._languageService = e, this._theme = t, this._prependTokens = null, this._tokens = [], this._currentLanguageId = 0, this._lastTokenMetadata = 0;
  }
  enterLanguage(e) {
    this._currentLanguageId = this._languageService.languageIdCodec.encodeLanguageId(e);
  }
  emit(e, t) {
    const n = this._theme.match(this._currentLanguageId, t) | 1024;
    this._lastTokenMetadata !== n && (this._lastTokenMetadata = n, this._tokens.push(e), this._tokens.push(n));
  }
  static _merge(e, t, n) {
    const r = e !== null ? e.length : 0, s = t.length, o = n !== null ? n.length : 0;
    if (r === 0 && s === 0 && o === 0)
      return new Uint32Array(0);
    if (r === 0 && s === 0)
      return n;
    if (s === 0 && o === 0)
      return e;
    const a = new Uint32Array(r + s + o);
    e !== null && a.set(e);
    for (let l = 0; l < s; l++)
      a[r + l] = t[l];
    return n !== null && a.set(n, r + s), a;
  }
  nestedLanguageTokenize(e, t, n, r) {
    const s = n.languageId, o = n.state, a = Ys.get(s);
    if (!a)
      return this.enterLanguage(s), this.emit(r, ""), o;
    const l = a.tokenizeEncoded(e, t, o);
    if (r !== 0)
      for (let c = 0, u = l.tokens.length; c < u; c += 2)
        l.tokens[c] += r;
    return this._prependTokens = y$._merge(this._prependTokens, this._tokens, l.tokens), this._tokens = [], this._currentLanguageId = 0, this._lastTokenMetadata = 0, l.endState;
  }
  finalize(e) {
    return new rK(y$._merge(this._prependTokens, this._tokens, null), e);
  }
}
let A5 = Xce = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._configurationService = s, this._languageService = e, this._standaloneThemeService = t, this._languageId = n, this._lexer = r, this._embeddedLanguages = /* @__PURE__ */ Object.create(null), this.embeddedLoaded = Promise.resolve(void 0);
    let o = !1;
    this._register(Ys.onDidChange((a) => {
      if (o)
        return;
      let l = !1;
      for (let c = 0, u = a.changedLanguages.length; c < u; c++) {
        const d = a.changedLanguages[c];
        if (this._embeddedLanguages[d]) {
          l = !0;
          break;
        }
      }
      l && (o = !0, Ys.handleChange([this._languageId]), o = !1);
    })), this._maxTokenizationLineLength = this._configurationService.getValue("editor.maxTokenizationLineLength", {
      overrideIdentifier: this._languageId
    }), this._register(this._configurationService.onDidChangeConfiguration((a) => {
      a.affectsConfiguration("editor.maxTokenizationLineLength") && (this._maxTokenizationLineLength = this._configurationService.getValue("editor.maxTokenizationLineLength", {
        overrideIdentifier: this._languageId
      }));
    }));
  }
  getLoadStatus() {
    const e = [];
    for (const t in this._embeddedLanguages) {
      const n = Ys.get(t);
      if (n) {
        if (n instanceof Xce) {
          const r = n.getLoadStatus();
          r.loaded === !1 && e.push(r.promise);
        }
        continue;
      }
      Ys.isResolved(t) || e.push(Ys.getOrCreate(t));
    }
    return e.length === 0 ? {
      loaded: !0
    } : {
      loaded: !1,
      promise: Promise.all(e).then((t) => {
      })
    };
  }
  getInitialState() {
    const e = R5.create(null, this._lexer.start);
    return n1.create(e, null);
  }
  tokenize(e, t, n) {
    if (e.length >= this._maxTokenizationLineLength)
      return ege(this._languageId, n);
    const r = new K2t(), s = this._tokenize(e, t, n, r);
    return r.finalize(s);
  }
  tokenizeEncoded(e, t, n) {
    if (e.length >= this._maxTokenizationLineLength)
      return aK(this._languageService.languageIdCodec.encodeLanguageId(this._languageId), n);
    const r = new y$(this._languageService, this._standaloneThemeService.getColorTheme().tokenTheme), s = this._tokenize(e, t, n, r);
    return r.finalize(s);
  }
  _tokenize(e, t, n, r) {
    return n.embeddedLanguageData ? this._nestedTokenize(e, t, n, 0, r) : this._myTokenize(e, t, n, 0, r);
  }
  _findLeavingNestedLanguageOffset(e, t) {
    let n = this._lexer.tokenizer[t.stack.state];
    if (!n && (n = HH(this._lexer, t.stack.state), !n))
      throw as(this._lexer, "tokenizer state is not defined: " + t.stack.state);
    let r = -1, s = !1;
    for (const o of n) {
      if (!$Ne(o.action) || !(o.action.nextEmbedded === "@pop" || o.action.hasEmbeddedEndInCases))
        continue;
      s = !0;
      let a = o.resolveRegex(t.stack.state);
      const l = a.source;
      if (l.substr(0, 4) === "^(?:" && l.substr(l.length - 1, 1) === ")") {
        const u = (a.ignoreCase ? "i" : "") + (a.unicode ? "u" : "");
        a = new RegExp(l.substr(4, l.length - 5), u);
      }
      const c = e.search(a);
      c === -1 || c !== 0 && o.matchOnlyAtLineStart || (r === -1 || c < r) && (r = c);
    }
    if (!s)
      throw as(this._lexer, 'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: ' + t.stack.state);
    return r;
  }
  _nestedTokenize(e, t, n, r, s) {
    const o = this._findLeavingNestedLanguageOffset(e, n);
    if (o === -1) {
      const c = s.nestedLanguageTokenize(e, t, n.embeddedLanguageData, r);
      return n1.create(n.stack, new CN(n.embeddedLanguageData.languageId, c));
    }
    const a = e.substring(0, o);
    a.length > 0 && s.nestedLanguageTokenize(a, !1, n.embeddedLanguageData, r);
    const l = e.substring(o);
    return this._myTokenize(l, t, n, r + o, s);
  }
  _safeRuleName(e) {
    return e ? e.name : "(unknown)";
  }
  _myTokenize(e, t, n, r, s) {
    s.enterLanguage(this._languageId);
    const o = e.length, a = t && this._lexer.includeLF ? e + `
` : e, l = a.length;
    let c = n.embeddedLanguageData, u = n.stack, d = 0, h = null, g = !0;
    for (; g || d < l; ) {
      const m = d, _ = u.depth, v = h ? h.groups.length : 0, w = u.state;
      let E = null, L = null, T = null, D = null, N = null;
      if (h) {
        E = h.matches;
        const B = h.groups.shift();
        L = B.matched, T = B.action, D = h.rule, h.groups.length === 0 && (h = null);
      } else {
        if (!g && d >= l)
          break;
        g = !1;
        let B = this._lexer.tokenizer[w];
        if (!B && (B = HH(this._lexer, w), !B))
          throw as(this._lexer, "tokenizer state is not defined: " + w);
        const H = a.substr(d);
        for (const j of B)
          if ((d === 0 || !j.matchOnlyAtLineStart) && (E = H.match(j.resolveRegex(w)), E)) {
            L = E[0], T = j.action;
            break;
          }
      }
      if (E || (E = [""], L = ""), T || (d < l && (E = [a.charAt(d)], L = E[0]), T = this._lexer.defaultToken), L === null)
        break;
      for (d += L.length; U2t(T) && $Ne(T) && T.test; )
        T = T.test(L, E, w, d === l);
      let R = null;
      if (typeof T == "string" || Array.isArray(T))
        R = T;
      else if (T.group)
        R = T.group;
      else if (T.token !== null && T.token !== void 0) {
        if (T.tokenSubst ? R = t1(this._lexer, T.token, L, E, w) : R = T.token, T.nextEmbedded)
          if (T.nextEmbedded === "@pop") {
            if (!c)
              throw as(this._lexer, "cannot pop embedded language if not inside one");
            c = null;
          } else {
            if (c)
              throw as(this._lexer, "cannot enter embedded language from within an embedded language");
            N = t1(this._lexer, T.nextEmbedded, L, E, w);
          }
        if (T.goBack && (d = Math.max(0, d - T.goBack)), T.switchTo && typeof T.switchTo == "string") {
          let B = t1(this._lexer, T.switchTo, L, E, w);
          if (B[0] === "@" && (B = B.substr(1)), HH(this._lexer, B))
            u = u.switchTo(B);
          else
            throw as(this._lexer, "trying to switch to a state '" + B + "' that is undefined in rule: " + this._safeRuleName(D));
        } else {
          if (T.transform && typeof T.transform == "function")
            throw as(this._lexer, "action.transform not supported");
          if (T.next)
            if (T.next === "@push") {
              if (u.depth >= this._lexer.maxStack)
                throw as(this._lexer, "maximum tokenizer stack size reached: [" + u.state + "," + u.parent.state + ",...]");
              u = u.push(w);
            } else if (T.next === "@pop") {
              if (u.depth <= 1)
                throw as(this._lexer, "trying to pop an empty stack in rule: " + this._safeRuleName(D));
              u = u.pop();
            } else if (T.next === "@popall")
              u = u.popall();
            else {
              let B = t1(this._lexer, T.next, L, E, w);
              if (B[0] === "@" && (B = B.substr(1)), HH(this._lexer, B))
                u = u.push(B);
              else
                throw as(this._lexer, "trying to set a next state '" + B + "' that is undefined in rule: " + this._safeRuleName(D));
            }
        }
        T.log && typeof T.log == "string" && z2t(this._lexer, this._lexer.languageId + ": " + t1(this._lexer, T.log, L, E, w));
      }
      if (R === null)
        throw as(this._lexer, "lexer rule has no well-defined action in rule: " + this._safeRuleName(D));
      const M = (B) => {
        const H = this._languageService.getLanguageIdByLanguageName(B) || this._languageService.getLanguageIdByMimeType(B) || B, j = this._getNestedEmbeddedLanguageData(H);
        if (d < l) {
          const K = e.substr(d);
          return this._nestedTokenize(K, t, n1.create(u, j), r + d, s);
        } else
          return n1.create(u, j);
      };
      if (Array.isArray(R)) {
        if (h && h.groups.length > 0)
          throw as(this._lexer, "groups cannot be nested: " + this._safeRuleName(D));
        if (E.length !== R.length + 1)
          throw as(this._lexer, "matched number of groups does not match the number of actions in rule: " + this._safeRuleName(D));
        let B = 0;
        for (let H = 1; H < E.length; H++)
          B += E[H].length;
        if (B !== L.length)
          throw as(this._lexer, "with groups, all characters should be matched in consecutive groups in rule: " + this._safeRuleName(D));
        h = {
          rule: D,
          matches: E,
          groups: []
        };
        for (let H = 0; H < R.length; H++)
          h.groups[H] = {
            action: R[H],
            matched: E[H + 1]
          };
        d -= L.length;
        continue;
      } else {
        if (R === "@rematch" && (d -= L.length, L = "", E = null, R = "", N !== null))
          return M(N);
        if (L.length === 0) {
          if (l === 0 || _ !== u.depth || w !== u.state || (h ? h.groups.length : 0) !== v)
            continue;
          throw as(this._lexer, "no progress in tokenizer in rule: " + this._safeRuleName(D));
        }
        let B = null;
        if (v9e(R) && R.indexOf("@brackets") === 0) {
          const H = R.substr(9), j = Y2t(this._lexer, L);
          if (!j)
            throw as(this._lexer, "@brackets token returned but no bracket defined as: " + L);
          B = jNe(j.token + H);
        } else {
          const H = R === "" ? "" : R + this._lexer.tokenPostfix;
          B = jNe(H);
        }
        m < o && s.emit(m + r, B);
      }
      if (N !== null)
        return M(N);
    }
    return n1.create(u, c);
  }
  _getNestedEmbeddedLanguageData(e) {
    if (!this._languageService.isRegisteredLanguageId(e))
      return new CN(e, sA);
    e !== this._languageId && (this._languageService.requestBasicLanguageFeatures(e), Ys.getOrCreate(e), this._embeddedLanguages[e] = !0);
    const t = Ys.get(e);
    return t ? new CN(e, t.getInitialState()) : new CN(e, sA);
  }
};
A5 = Xce = G2t([
  q2t(4, xn)
], A5);
function Y2t(i, e) {
  if (!e)
    return null;
  e = Wy(i, e);
  const t = i.brackets;
  for (const n of t) {
    if (n.open === e)
      return {
        token: n.token,
        bracketType: 1
        /* monarchCommon.MonarchBracket.Open */
      };
    if (n.close === e)
      return {
        token: n.token,
        bracketType: -1
        /* monarchCommon.MonarchBracket.Close */
      };
  }
  return null;
}
const Hte = Db("standaloneColorizer", { createHTML: (i) => i });
class cme {
  static colorizeElement(e, t, n, r) {
    r = r || {};
    const s = r.theme || "vs", o = r.mimeType || n.getAttribute("lang") || n.getAttribute("data-lang");
    if (!o)
      return console.error("Mode not detected"), Promise.resolve();
    const a = t.getLanguageIdByMimeType(o) || o;
    e.setTheme(s);
    const l = n.firstChild ? n.firstChild.nodeValue : "";
    n.className += " " + s;
    const c = (u) => {
      const d = (Hte == null ? void 0 : Hte.createHTML(u)) ?? u;
      n.innerHTML = d;
    };
    return this.colorize(t, l || "", a, r).then(c, (u) => console.error(u));
  }
  static async colorize(e, t, n, r) {
    const s = e.languageIdCodec;
    let o = 4;
    r && typeof r.tabSize == "number" && (o = r.tabSize), Vhe(t) && (t = t.substr(1));
    const a = $d(t);
    if (!e.isRegisteredLanguageId(n))
      return GNe(a, o, s);
    const l = await Ys.getOrCreate(n);
    return l ? X2t(a, o, l, s) : GNe(a, o, s);
  }
  static colorizeLine(e, t, n, r, s = 4) {
    const o = Kh.isBasicASCII(e, t), a = Kh.containsRTL(e, o, n);
    return Jq(new d0(!1, !0, e, !1, o, a, 0, r, [], s, 0, 0, 0, 0, -1, "none", !1, !1, null, null, 0)).html;
  }
  static colorizeModelLine(e, t, n = 4) {
    const r = e.getLineContent(t);
    e.tokenization.forceTokenization(t);
    const o = e.tokenization.getLineTokens(t).inflate();
    return this.colorizeLine(r, e.mightContainNonBasicASCII(), e.mightContainRTL(), o, n);
  }
}
function X2t(i, e, t, n) {
  return new Promise((r, s) => {
    const o = () => {
      const a = Z2t(i, e, t, n);
      if (t instanceof A5) {
        const l = t.getLoadStatus();
        if (l.loaded === !1) {
          l.promise.then(o, s);
          return;
        }
      }
      r(a);
    };
    o();
  });
}
function GNe(i, e, t) {
  let n = [];
  const s = new Uint32Array(2);
  s[0] = 0, s[1] = 33587200;
  for (let o = 0, a = i.length; o < a; o++) {
    const l = i[o];
    s[0] = l.length;
    const c = new fo(s, l, t), u = Kh.isBasicASCII(
      l,
      /* check for basic ASCII */
      !0
    ), d = Kh.containsRTL(
      l,
      u,
      /* check for RTL */
      !0
    ), h = Jq(new d0(!1, !0, l, !1, u, d, 0, c, [], e, 0, 0, 0, 0, -1, "none", !1, !1, null, null, 0));
    n = n.concat(h.html), n.push("<br/>");
  }
  return n.join("");
}
function Z2t(i, e, t, n) {
  let r = [], s = t.getInitialState();
  for (let o = 0, a = i.length; o < a; o++) {
    const l = i[o], c = t.tokenizeEncoded(l, !0, s);
    fo.convertToEndOffset(c.tokens, l.length);
    const u = new fo(c.tokens, l, n), d = Kh.isBasicASCII(
      l,
      /* check for basic ASCII */
      !0
    ), h = Kh.containsRTL(
      l,
      d,
      /* check for RTL */
      !0
    ), g = Jq(new d0(!1, !0, l, !1, d, h, 0, u.inflate(), [], e, 0, 0, 0, 0, -1, "none", !1, !1, null, null, 0));
    r = r.concat(g.html), r.push("<br/>"), s = c.endState;
  }
  return r.join("");
}
var Q2t = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, J2t = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Zce = class extends ge {
  constructor(e) {
    super(), this._themeService = e, this._onWillCreateCodeEditor = this._register(new he()), this._onCodeEditorAdd = this._register(new he()), this.onCodeEditorAdd = this._onCodeEditorAdd.event, this._onCodeEditorRemove = this._register(new he()), this.onCodeEditorRemove = this._onCodeEditorRemove.event, this._onWillCreateDiffEditor = this._register(new he()), this._onDiffEditorAdd = this._register(new he()), this.onDiffEditorAdd = this._onDiffEditorAdd.event, this._onDiffEditorRemove = this._register(new he()), this.onDiffEditorRemove = this._onDiffEditorRemove.event, this._decorationOptionProviders = /* @__PURE__ */ new Map(), this._codeEditorOpenHandlers = new xc(), this._modelProperties = /* @__PURE__ */ new Map(), this._codeEditors = /* @__PURE__ */ Object.create(null), this._diffEditors = /* @__PURE__ */ Object.create(null), this._globalStyleSheet = null;
  }
  willCreateCodeEditor() {
    this._onWillCreateCodeEditor.fire();
  }
  addCodeEditor(e) {
    this._codeEditors[e.getId()] = e, this._onCodeEditorAdd.fire(e);
  }
  removeCodeEditor(e) {
    delete this._codeEditors[e.getId()] && this._onCodeEditorRemove.fire(e);
  }
  listCodeEditors() {
    return Object.keys(this._codeEditors).map((e) => this._codeEditors[e]);
  }
  willCreateDiffEditor() {
    this._onWillCreateDiffEditor.fire();
  }
  addDiffEditor(e) {
    this._diffEditors[e.getId()] = e, this._onDiffEditorAdd.fire(e);
  }
  listDiffEditors() {
    return Object.keys(this._diffEditors).map((e) => this._diffEditors[e]);
  }
  getFocusedCodeEditor() {
    let e = null;
    const t = this.listCodeEditors();
    for (const n of t) {
      if (n.hasTextFocus())
        return n;
      n.hasWidgetFocus() && (e = n);
    }
    return e;
  }
  removeDecorationType(e) {
    const t = this._decorationOptionProviders.get(e);
    t && (t.refCount--, t.refCount <= 0 && (this._decorationOptionProviders.delete(e), t.dispose(), this.listCodeEditors().forEach((n) => n.removeDecorationsByType(e))));
  }
  setModelProperty(e, t, n) {
    const r = e.toString();
    let s;
    this._modelProperties.has(r) ? s = this._modelProperties.get(r) : (s = /* @__PURE__ */ new Map(), this._modelProperties.set(r, s)), s.set(t, n);
  }
  getModelProperty(e, t) {
    const n = e.toString();
    if (this._modelProperties.has(n))
      return this._modelProperties.get(n).get(t);
  }
  async openCodeEditor(e, t, n) {
    for (const r of this._codeEditorOpenHandlers) {
      const s = await r(e, t, n);
      if (s !== null)
        return s;
    }
    return null;
  }
  registerCodeEditorOpenHandler(e) {
    const t = this._codeEditorOpenHandlers.unshift(e);
    return Et(t);
  }
};
Zce = Q2t([
  J2t(0, to)
], Zce);
var eOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, qNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let C$ = class extends Zce {
  constructor(e, t) {
    super(t), this._register(this.onCodeEditorAdd(() => this._checkContextKey())), this._register(this.onCodeEditorRemove(() => this._checkContextKey())), this._editorIsOpen = e.createKey("editorIsOpen", !1), this._activeCodeEditor = null, this._register(this.registerCodeEditorOpenHandler(async (n, r, s) => r ? this.doOpenEditor(r, n) : null));
  }
  _checkContextKey() {
    let e = !1;
    for (const t of this.listCodeEditors())
      if (!t.isSimpleWidget) {
        e = !0;
        break;
      }
    this._editorIsOpen.set(e);
  }
  setActiveCodeEditor(e) {
    this._activeCodeEditor = e;
  }
  getActiveCodeEditor() {
    return this._activeCodeEditor;
  }
  doOpenEditor(e, t) {
    if (!this.findModel(e, t.resource)) {
      if (t.resource) {
        const s = t.resource.scheme;
        if (s === Yt.http || s === Yt.https)
          return OPe(t.resource.toString()), e;
      }
      return null;
    }
    const r = t.options ? t.options.selection : null;
    if (r)
      if (typeof r.endLineNumber == "number" && typeof r.endColumn == "number")
        e.setSelection(r), e.revealRangeInCenter(
          r,
          1
          /* ScrollType.Immediate */
        );
      else {
        const s = {
          lineNumber: r.startLineNumber,
          column: r.startColumn
        };
        e.setPosition(s), e.revealPositionInCenter(
          s,
          1
          /* ScrollType.Immediate */
        );
      }
    return e;
  }
  findModel(e, t) {
    const n = e.getModel();
    return n && n.uri.toString() !== t.toString() ? null : n;
  }
};
C$ = eOt([
  qNe(0, Jt),
  qNe(1, to)
], C$);
ni(
  Ti,
  C$,
  0
  /* InstantiationType.Eager */
);
var C9e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, w9e = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let w$ = class {
  get mainContainer() {
    var e;
    return ((e = this._codeEditorService.listCodeEditors().at(0)) == null ? void 0 : e.getContainerDomNode()) ?? fr.document.body;
  }
  get activeContainer() {
    const e = this._codeEditorService.getFocusedCodeEditor() ?? this._codeEditorService.getActiveCodeEditor();
    return (e == null ? void 0 : e.getContainerDomNode()) ?? this.mainContainer;
  }
  get mainContainerDimension() {
    return nw(this.mainContainer);
  }
  get activeContainerDimension() {
    return nw(this.activeContainer);
  }
  get containers() {
    return ym(this._codeEditorService.listCodeEditors().map((e) => e.getContainerDomNode()));
  }
  getContainer() {
    return this.activeContainer;
  }
  whenContainerStylesLoaded() {
  }
  focus() {
    var e;
    (e = this._codeEditorService.getFocusedCodeEditor()) == null || e.focus();
  }
  constructor(e) {
    this._codeEditorService = e, this.onDidLayoutMainContainer = Ze.None, this.onDidLayoutActiveContainer = Ze.None, this.onDidLayoutContainer = Ze.None, this.onDidChangeActiveContainer = Ze.None, this.onDidAddContainer = Ze.None, this.mainContainerOffset = { top: 0, quickPickTop: 0 }, this.activeContainerOffset = { top: 0, quickPickTop: 0 };
  }
};
w$ = C9e([
  w9e(0, Ti)
], w$);
let Qce = class extends w$ {
  get mainContainer() {
    return this._container;
  }
  constructor(e, t) {
    super(t), this._container = e;
  }
};
Qce = C9e([
  w9e(1, Ti)
], Qce);
ni(
  Ib,
  w$,
  1
  /* InstantiationType.Delayed */
);
var tOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, KNe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
function WH(i) {
  return i.scheme === Yt.file ? i.fsPath : i.path;
}
let S9e = 0;
class VH {
  constructor(e, t, n, r, s, o, a) {
    this.id = ++S9e, this.type = 0, this.actual = e, this.label = e.label, this.confirmBeforeUndo = e.confirmBeforeUndo || !1, this.resourceLabel = t, this.strResource = n, this.resourceLabels = [this.resourceLabel], this.strResources = [this.strResource], this.groupId = r, this.groupOrder = s, this.sourceId = o, this.sourceOrder = a, this.isValid = !0;
  }
  setValid(e) {
    this.isValid = e;
  }
  toString() {
    return `[id:${this.id}] [group:${this.groupId}] [${this.isValid ? "  VALID" : "INVALID"}] ${this.actual.constructor.name} - ${this.actual}`;
  }
}
class YNe {
  constructor(e, t) {
    this.resourceLabel = e, this.reason = t;
  }
}
class XNe {
  constructor() {
    this.elements = /* @__PURE__ */ new Map();
  }
  createMessage() {
    const e = [], t = [];
    for (const [, r] of this.elements)
      (r.reason === 0 ? e : t).push(r.resourceLabel);
    const n = [];
    return e.length > 0 && n.push(S(2012, "The following files have been closed and modified on disk: {0}.", e.join(", "))), t.length > 0 && n.push(S(2013, "The following files have been modified in an incompatible way: {0}.", t.join(", "))), n.join(`
`);
  }
  get size() {
    return this.elements.size;
  }
  has(e) {
    return this.elements.has(e);
  }
  set(e, t) {
    this.elements.set(e, t);
  }
  delete(e) {
    return this.elements.delete(e);
  }
}
class nOt {
  constructor(e, t, n, r, s, o, a) {
    this.id = ++S9e, this.type = 1, this.actual = e, this.label = e.label, this.confirmBeforeUndo = e.confirmBeforeUndo || !1, this.resourceLabels = t, this.strResources = n, this.groupId = r, this.groupOrder = s, this.sourceId = o, this.sourceOrder = a, this.removedResources = null, this.invalidatedResources = null;
  }
  canSplit() {
    return typeof this.actual.split == "function";
  }
  removeResource(e, t, n) {
    this.removedResources || (this.removedResources = new XNe()), this.removedResources.has(t) || this.removedResources.set(t, new YNe(e, n));
  }
  setValid(e, t, n) {
    n ? this.invalidatedResources && (this.invalidatedResources.delete(t), this.invalidatedResources.size === 0 && (this.invalidatedResources = null)) : (this.invalidatedResources || (this.invalidatedResources = new XNe()), this.invalidatedResources.has(t) || this.invalidatedResources.set(t, new YNe(
      e,
      0
      /* RemovedResourceReason.ExternalRemoval */
    )));
  }
  toString() {
    return `[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources ? "INVALID" : "  VALID"}] ${this.actual.constructor.name} - ${this.actual}`;
  }
}
class E9e {
  constructor(e, t) {
    this.resourceLabel = e, this.strResource = t, this._past = [], this._future = [], this.locked = !1, this.versionId = 1;
  }
  dispose() {
    for (const e of this._past)
      e.type === 1 && e.removeResource(
        this.resourceLabel,
        this.strResource,
        0
        /* RemovedResourceReason.ExternalRemoval */
      );
    for (const e of this._future)
      e.type === 1 && e.removeResource(
        this.resourceLabel,
        this.strResource,
        0
        /* RemovedResourceReason.ExternalRemoval */
      );
    this.versionId++;
  }
  toString() {
    const e = [];
    e.push(`* ${this.strResource}:`);
    for (let t = 0; t < this._past.length; t++)
      e.push(`   * [UNDO] ${this._past[t]}`);
    for (let t = this._future.length - 1; t >= 0; t--)
      e.push(`   * [REDO] ${this._future[t]}`);
    return e.join(`
`);
  }
  flushAllElements() {
    this._past = [], this._future = [], this.versionId++;
  }
  _setElementValidFlag(e, t) {
    e.type === 1 ? e.setValid(this.resourceLabel, this.strResource, t) : e.setValid(t);
  }
  setElementsValidFlag(e, t) {
    for (const n of this._past)
      t(n.actual) && this._setElementValidFlag(n, e);
    for (const n of this._future)
      t(n.actual) && this._setElementValidFlag(n, e);
  }
  pushElement(e) {
    for (const t of this._future)
      t.type === 1 && t.removeResource(
        this.resourceLabel,
        this.strResource,
        1
        /* RemovedResourceReason.NoParallelUniverses */
      );
    this._future = [], this._past.push(e), this.versionId++;
  }
  createSnapshot(e) {
    const t = [];
    for (let n = 0, r = this._past.length; n < r; n++)
      t.push(this._past[n].id);
    for (let n = this._future.length - 1; n >= 0; n--)
      t.push(this._future[n].id);
    return new u4e(e, t);
  }
  restoreSnapshot(e) {
    const t = e.elements.length;
    let n = !0, r = 0, s = -1;
    for (let a = 0, l = this._past.length; a < l; a++, r++) {
      const c = this._past[a];
      n && (r >= t || c.id !== e.elements[r]) && (n = !1, s = 0), !n && c.type === 1 && c.removeResource(
        this.resourceLabel,
        this.strResource,
        0
        /* RemovedResourceReason.ExternalRemoval */
      );
    }
    let o = -1;
    for (let a = this._future.length - 1; a >= 0; a--, r++) {
      const l = this._future[a];
      n && (r >= t || l.id !== e.elements[r]) && (n = !1, o = a), !n && l.type === 1 && l.removeResource(
        this.resourceLabel,
        this.strResource,
        0
        /* RemovedResourceReason.ExternalRemoval */
      );
    }
    s !== -1 && (this._past = this._past.slice(0, s)), o !== -1 && (this._future = this._future.slice(o + 1)), this.versionId++;
  }
  getElements() {
    const e = [], t = [];
    for (const n of this._past)
      e.push(n.actual);
    for (const n of this._future)
      t.push(n.actual);
    return { past: e, future: t };
  }
  getClosestPastElement() {
    return this._past.length === 0 ? null : this._past[this._past.length - 1];
  }
  getSecondClosestPastElement() {
    return this._past.length < 2 ? null : this._past[this._past.length - 2];
  }
  getClosestFutureElement() {
    return this._future.length === 0 ? null : this._future[this._future.length - 1];
  }
  hasPastElements() {
    return this._past.length > 0;
  }
  hasFutureElements() {
    return this._future.length > 0;
  }
  splitPastWorkspaceElement(e, t) {
    for (let n = this._past.length - 1; n >= 0; n--)
      if (this._past[n] === e) {
        t.has(this.strResource) ? this._past[n] = t.get(this.strResource) : this._past.splice(n, 1);
        break;
      }
    this.versionId++;
  }
  splitFutureWorkspaceElement(e, t) {
    for (let n = this._future.length - 1; n >= 0; n--)
      if (this._future[n] === e) {
        t.has(this.strResource) ? this._future[n] = t.get(this.strResource) : this._future.splice(n, 1);
        break;
      }
    this.versionId++;
  }
  moveBackward(e) {
    this._past.pop(), this._future.push(e), this.versionId++;
  }
  moveForward(e) {
    this._future.pop(), this._past.push(e), this.versionId++;
  }
}
class Wte {
  constructor(e) {
    this.editStacks = e, this._versionIds = [];
    for (let t = 0, n = this.editStacks.length; t < n; t++)
      this._versionIds[t] = this.editStacks[t].versionId;
  }
  isValid() {
    for (let e = 0, t = this.editStacks.length; e < t; e++)
      if (this._versionIds[e] !== this.editStacks[e].versionId)
        return !1;
    return !0;
  }
}
const x9e = new E9e("", "");
x9e.locked = !0;
let Jce = class {
  constructor(e, t) {
    this._dialogService = e, this._notificationService = t, this._editStacks = /* @__PURE__ */ new Map(), this._uriComparisonKeyComputers = [];
  }
  getUriComparisonKey(e) {
    for (const t of this._uriComparisonKeyComputers)
      if (t[0] === e.scheme)
        return t[1].getComparisonKey(e);
    return e.toString();
  }
  _print(e) {
    console.log("------------------------------------"), console.log(`AFTER ${e}: `);
    const t = [];
    for (const n of this._editStacks)
      t.push(n[1].toString());
    console.log(t.join(`
`));
  }
  pushElement(e, t = Ore.None, n = $E.None) {
    if (e.type === 0) {
      const r = WH(e.resource), s = this.getUriComparisonKey(e.resource);
      this._pushElement(new VH(e, r, s, t.id, t.nextOrder(), n.id, n.nextOrder()));
    } else {
      const r = /* @__PURE__ */ new Set(), s = [], o = [];
      for (const a of e.resources) {
        const l = WH(a), c = this.getUriComparisonKey(a);
        r.has(c) || (r.add(c), s.push(l), o.push(c));
      }
      s.length === 1 ? this._pushElement(new VH(e, s[0], o[0], t.id, t.nextOrder(), n.id, n.nextOrder())) : this._pushElement(new nOt(e, s, o, t.id, t.nextOrder(), n.id, n.nextOrder()));
    }
  }
  _pushElement(e) {
    for (let t = 0, n = e.strResources.length; t < n; t++) {
      const r = e.resourceLabels[t], s = e.strResources[t];
      let o;
      this._editStacks.has(s) ? o = this._editStacks.get(s) : (o = new E9e(r, s), this._editStacks.set(s, o)), o.pushElement(e);
    }
  }
  getLastElement(e) {
    const t = this.getUriComparisonKey(e);
    if (this._editStacks.has(t)) {
      const n = this._editStacks.get(t);
      if (n.hasFutureElements())
        return null;
      const r = n.getClosestPastElement();
      return r ? r.actual : null;
    }
    return null;
  }
  _splitPastWorkspaceElement(e, t) {
    const n = e.actual.split(), r = /* @__PURE__ */ new Map();
    for (const s of n) {
      const o = WH(s.resource), a = this.getUriComparisonKey(s.resource), l = new VH(s, o, a, 0, 0, 0, 0);
      r.set(l.strResource, l);
    }
    for (const s of e.strResources) {
      if (t && t.has(s))
        continue;
      this._editStacks.get(s).splitPastWorkspaceElement(e, r);
    }
  }
  _splitFutureWorkspaceElement(e, t) {
    const n = e.actual.split(), r = /* @__PURE__ */ new Map();
    for (const s of n) {
      const o = WH(s.resource), a = this.getUriComparisonKey(s.resource), l = new VH(s, o, a, 0, 0, 0, 0);
      r.set(l.strResource, l);
    }
    for (const s of e.strResources) {
      if (t && t.has(s))
        continue;
      this._editStacks.get(s).splitFutureWorkspaceElement(e, r);
    }
  }
  removeElements(e) {
    const t = typeof e == "string" ? e : this.getUriComparisonKey(e);
    this._editStacks.has(t) && (this._editStacks.get(t).dispose(), this._editStacks.delete(t));
  }
  setElementsValidFlag(e, t, n) {
    const r = this.getUriComparisonKey(e);
    this._editStacks.has(r) && this._editStacks.get(r).setElementsValidFlag(t, n);
  }
  createSnapshot(e) {
    const t = this.getUriComparisonKey(e);
    return this._editStacks.has(t) ? this._editStacks.get(t).createSnapshot(e) : new u4e(e, []);
  }
  restoreSnapshot(e) {
    const t = this.getUriComparisonKey(e.resource);
    if (this._editStacks.has(t)) {
      const n = this._editStacks.get(t);
      n.restoreSnapshot(e), !n.hasPastElements() && !n.hasFutureElements() && (n.dispose(), this._editStacks.delete(t));
    }
  }
  getElements(e) {
    const t = this.getUriComparisonKey(e);
    return this._editStacks.has(t) ? this._editStacks.get(t).getElements() : { past: [], future: [] };
  }
  _findClosestUndoElementWithSource(e) {
    if (!e)
      return [null, null];
    let t = null, n = null;
    for (const [r, s] of this._editStacks) {
      const o = s.getClosestPastElement();
      o && o.sourceId === e && (!t || o.sourceOrder > t.sourceOrder) && (t = o, n = r);
    }
    return [t, n];
  }
  canUndo(e) {
    if (e instanceof $E) {
      const [, n] = this._findClosestUndoElementWithSource(e.id);
      return !!n;
    }
    const t = this.getUriComparisonKey(e);
    return this._editStacks.has(t) ? this._editStacks.get(t).hasPastElements() : !1;
  }
  _onError(e, t) {
    fn(e);
    for (const n of t.strResources)
      this.removeElements(n);
    this._notificationService.error(e);
  }
  _acquireLocks(e) {
    for (const t of e.editStacks)
      if (t.locked)
        throw new Error("Cannot acquire edit stack lock");
    for (const t of e.editStacks)
      t.locked = !0;
    return () => {
      for (const t of e.editStacks)
        t.locked = !1;
    };
  }
  _safeInvokeWithLocks(e, t, n, r, s) {
    const o = this._acquireLocks(n);
    let a;
    try {
      a = t();
    } catch (l) {
      return o(), r.dispose(), this._onError(l, e);
    }
    return a ? a.then(() => (o(), r.dispose(), s()), (l) => (o(), r.dispose(), this._onError(l, e))) : (o(), r.dispose(), s());
  }
  async _invokeWorkspacePrepare(e) {
    if (typeof e.actual.prepareUndoRedo > "u")
      return ge.None;
    const t = e.actual.prepareUndoRedo();
    return typeof t > "u" ? ge.None : t;
  }
  _invokeResourcePrepare(e, t) {
    if (e.actual.type !== 1 || typeof e.actual.prepareUndoRedo > "u")
      return t(ge.None);
    const n = e.actual.prepareUndoRedo();
    return n ? UT(n) ? t(n) : n.then((r) => t(r)) : t(ge.None);
  }
  _getAffectedEditStacks(e) {
    const t = [];
    for (const n of e.strResources)
      t.push(this._editStacks.get(n) || x9e);
    return new Wte(t);
  }
  _tryToSplitAndUndo(e, t, n, r) {
    if (t.canSplit())
      return this._splitPastWorkspaceElement(t, n), this._notificationService.warn(r), new UH(this._undo(e, 0, !0));
    for (const s of t.strResources)
      this.removeElements(s);
    return this._notificationService.warn(r), new UH();
  }
  _checkWorkspaceUndo(e, t, n, r) {
    if (t.removedResources)
      return this._tryToSplitAndUndo(e, t, t.removedResources, S(2014, "Could not undo '{0}' across all files. {1}", t.label, t.removedResources.createMessage()));
    if (r && t.invalidatedResources)
      return this._tryToSplitAndUndo(e, t, t.invalidatedResources, S(2015, "Could not undo '{0}' across all files. {1}", t.label, t.invalidatedResources.createMessage()));
    const s = [];
    for (const a of n.editStacks)
      a.getClosestPastElement() !== t && s.push(a.resourceLabel);
    if (s.length > 0)
      return this._tryToSplitAndUndo(e, t, null, S(2016, "Could not undo '{0}' across all files because changes were made to {1}", t.label, s.join(", ")));
    const o = [];
    for (const a of n.editStacks)
      a.locked && o.push(a.resourceLabel);
    return o.length > 0 ? this._tryToSplitAndUndo(e, t, null, S(2017, "Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}", t.label, o.join(", "))) : n.isValid() ? null : this._tryToSplitAndUndo(e, t, null, S(2018, "Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime", t.label));
  }
  _workspaceUndo(e, t, n) {
    const r = this._getAffectedEditStacks(t), s = this._checkWorkspaceUndo(
      e,
      t,
      r,
      /*invalidated resources will be checked after the prepare call*/
      !1
    );
    return s ? s.returnValue : this._confirmAndExecuteWorkspaceUndo(e, t, r, n);
  }
  _isPartOfUndoGroup(e) {
    if (!e.groupId)
      return !1;
    for (const [, t] of this._editStacks) {
      const n = t.getClosestPastElement();
      if (n) {
        if (n === e) {
          const r = t.getSecondClosestPastElement();
          if (r && r.groupId === e.groupId)
            return !0;
        }
        if (n.groupId === e.groupId)
          return !0;
      }
    }
    return !1;
  }
  async _confirmAndExecuteWorkspaceUndo(e, t, n, r) {
    if (t.canSplit() && !this._isPartOfUndoGroup(t)) {
      let a;
      (function(u) {
        u[u.All = 0] = "All", u[u.This = 1] = "This", u[u.Cancel = 2] = "Cancel";
      })(a || (a = {}));
      const { result: l } = await this._dialogService.prompt({
        type: Rs.Info,
        message: S(2019, "Would you like to undo '{0}' across all files?", t.label),
        buttons: [
          {
            label: S(2020, "&&Undo in {0} Files", n.editStacks.length),
            run: () => a.All
          },
          {
            label: S(2021, "Undo this &&File"),
            run: () => a.This
          }
        ],
        cancelButton: {
          run: () => a.Cancel
        }
      });
      if (l === a.Cancel)
        return;
      if (l === a.This)
        return this._splitPastWorkspaceElement(t, null), this._undo(e, 0, !0);
      const c = this._checkWorkspaceUndo(
        e,
        t,
        n,
        /*invalidated resources will be checked after the prepare call*/
        !1
      );
      if (c)
        return c.returnValue;
      r = !0;
    }
    let s;
    try {
      s = await this._invokeWorkspacePrepare(t);
    } catch (a) {
      return this._onError(a, t);
    }
    const o = this._checkWorkspaceUndo(
      e,
      t,
      n,
      /*now also check that there are no more invalidated resources*/
      !0
    );
    if (o)
      return s.dispose(), o.returnValue;
    for (const a of n.editStacks)
      a.moveBackward(t);
    return this._safeInvokeWithLocks(t, () => t.actual.undo(), n, s, () => this._continueUndoInGroup(t.groupId, r));
  }
  _resourceUndo(e, t, n) {
    if (!t.isValid) {
      e.flushAllElements();
      return;
    }
    if (e.locked) {
      const r = S(2022, "Could not undo '{0}' because there is already an undo or redo operation running.", t.label);
      this._notificationService.warn(r);
      return;
    }
    return this._invokeResourcePrepare(t, (r) => (e.moveBackward(t), this._safeInvokeWithLocks(t, () => t.actual.undo(), new Wte([e]), r, () => this._continueUndoInGroup(t.groupId, n))));
  }
  _findClosestUndoElementInGroup(e) {
    if (!e)
      return [null, null];
    let t = null, n = null;
    for (const [r, s] of this._editStacks) {
      const o = s.getClosestPastElement();
      o && o.groupId === e && (!t || o.groupOrder > t.groupOrder) && (t = o, n = r);
    }
    return [t, n];
  }
  _continueUndoInGroup(e, t) {
    if (!e)
      return;
    const [, n] = this._findClosestUndoElementInGroup(e);
    if (n)
      return this._undo(n, 0, t);
  }
  undo(e) {
    if (e instanceof $E) {
      const [, t] = this._findClosestUndoElementWithSource(e.id);
      return t ? this._undo(t, e.id, !1) : void 0;
    }
    return typeof e == "string" ? this._undo(e, 0, !1) : this._undo(this.getUriComparisonKey(e), 0, !1);
  }
  _undo(e, t = 0, n) {
    if (!this._editStacks.has(e))
      return;
    const r = this._editStacks.get(e), s = r.getClosestPastElement();
    if (!s)
      return;
    if (s.groupId) {
      const [a, l] = this._findClosestUndoElementInGroup(s.groupId);
      if (s !== a && l)
        return this._undo(l, t, n);
    }
    if ((s.sourceId !== t || s.confirmBeforeUndo) && !n)
      return this._confirmAndContinueUndo(e, t, s);
    try {
      return s.type === 1 ? this._workspaceUndo(e, s, n) : this._resourceUndo(r, s, n);
    } finally {
    }
  }
  async _confirmAndContinueUndo(e, t, n) {
    if ((await this._dialogService.confirm({
      message: S(2023, "Would you like to undo '{0}'?", n.label),
      primaryButton: S(2024, "&&Yes"),
      cancelButton: S(2025, "No")
    })).confirmed)
      return this._undo(e, t, !0);
  }
  _findClosestRedoElementWithSource(e) {
    if (!e)
      return [null, null];
    let t = null, n = null;
    for (const [r, s] of this._editStacks) {
      const o = s.getClosestFutureElement();
      o && o.sourceId === e && (!t || o.sourceOrder < t.sourceOrder) && (t = o, n = r);
    }
    return [t, n];
  }
  canRedo(e) {
    if (e instanceof $E) {
      const [, n] = this._findClosestRedoElementWithSource(e.id);
      return !!n;
    }
    const t = this.getUriComparisonKey(e);
    return this._editStacks.has(t) ? this._editStacks.get(t).hasFutureElements() : !1;
  }
  _tryToSplitAndRedo(e, t, n, r) {
    if (t.canSplit())
      return this._splitFutureWorkspaceElement(t, n), this._notificationService.warn(r), new UH(this._redo(e));
    for (const s of t.strResources)
      this.removeElements(s);
    return this._notificationService.warn(r), new UH();
  }
  _checkWorkspaceRedo(e, t, n, r) {
    if (t.removedResources)
      return this._tryToSplitAndRedo(e, t, t.removedResources, S(2026, "Could not redo '{0}' across all files. {1}", t.label, t.removedResources.createMessage()));
    if (r && t.invalidatedResources)
      return this._tryToSplitAndRedo(e, t, t.invalidatedResources, S(2027, "Could not redo '{0}' across all files. {1}", t.label, t.invalidatedResources.createMessage()));
    const s = [];
    for (const a of n.editStacks)
      a.getClosestFutureElement() !== t && s.push(a.resourceLabel);
    if (s.length > 0)
      return this._tryToSplitAndRedo(e, t, null, S(2028, "Could not redo '{0}' across all files because changes were made to {1}", t.label, s.join(", ")));
    const o = [];
    for (const a of n.editStacks)
      a.locked && o.push(a.resourceLabel);
    return o.length > 0 ? this._tryToSplitAndRedo(e, t, null, S(2029, "Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}", t.label, o.join(", "))) : n.isValid() ? null : this._tryToSplitAndRedo(e, t, null, S(2030, "Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime", t.label));
  }
  _workspaceRedo(e, t) {
    const n = this._getAffectedEditStacks(t), r = this._checkWorkspaceRedo(
      e,
      t,
      n,
      /*invalidated resources will be checked after the prepare call*/
      !1
    );
    return r ? r.returnValue : this._executeWorkspaceRedo(e, t, n);
  }
  async _executeWorkspaceRedo(e, t, n) {
    let r;
    try {
      r = await this._invokeWorkspacePrepare(t);
    } catch (o) {
      return this._onError(o, t);
    }
    const s = this._checkWorkspaceRedo(
      e,
      t,
      n,
      /*now also check that there are no more invalidated resources*/
      !0
    );
    if (s)
      return r.dispose(), s.returnValue;
    for (const o of n.editStacks)
      o.moveForward(t);
    return this._safeInvokeWithLocks(t, () => t.actual.redo(), n, r, () => this._continueRedoInGroup(t.groupId));
  }
  _resourceRedo(e, t) {
    if (!t.isValid) {
      e.flushAllElements();
      return;
    }
    if (e.locked) {
      const n = S(2031, "Could not redo '{0}' because there is already an undo or redo operation running.", t.label);
      this._notificationService.warn(n);
      return;
    }
    return this._invokeResourcePrepare(t, (n) => (e.moveForward(t), this._safeInvokeWithLocks(t, () => t.actual.redo(), new Wte([e]), n, () => this._continueRedoInGroup(t.groupId))));
  }
  _findClosestRedoElementInGroup(e) {
    if (!e)
      return [null, null];
    let t = null, n = null;
    for (const [r, s] of this._editStacks) {
      const o = s.getClosestFutureElement();
      o && o.groupId === e && (!t || o.groupOrder < t.groupOrder) && (t = o, n = r);
    }
    return [t, n];
  }
  _continueRedoInGroup(e) {
    if (!e)
      return;
    const [, t] = this._findClosestRedoElementInGroup(e);
    if (t)
      return this._redo(t);
  }
  redo(e) {
    if (e instanceof $E) {
      const [, t] = this._findClosestRedoElementWithSource(e.id);
      return t ? this._redo(t) : void 0;
    }
    return typeof e == "string" ? this._redo(e) : this._redo(this.getUriComparisonKey(e));
  }
  _redo(e) {
    if (!this._editStacks.has(e))
      return;
    const t = this._editStacks.get(e), n = t.getClosestFutureElement();
    if (n) {
      if (n.groupId) {
        const [r, s] = this._findClosestRedoElementInGroup(n.groupId);
        if (n !== r && s)
          return this._redo(s);
      }
      try {
        return n.type === 1 ? this._workspaceRedo(e, n) : this._resourceRedo(t, n);
      } finally {
      }
    }
  }
};
Jce = tOt([
  KNe(0, XB),
  KNe(1, no)
], Jce);
class UH {
  constructor(e) {
    this.returnValue = e;
  }
}
ni(
  ige,
  Jce,
  1
  /* InstantiationType.Delayed */
);
var iOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Vte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let eue = class extends ge {
  constructor(e, t, n) {
    super(), this._themeService = e, this._logService = t, this._languageService = n, this._caches = /* @__PURE__ */ new WeakMap(), this._register(this._themeService.onDidColorThemeChange(() => {
      this._caches = /* @__PURE__ */ new WeakMap();
    }));
  }
  getStyling(e) {
    return this._caches.has(e) || this._caches.set(e, new gle(e.getLegend(), this._themeService, this._languageService, this._logService)), this._caches.get(e);
  }
};
eue = iOt([
  Vte(0, to),
  Vte(1, $r),
  Vte(2, Gr)
], eue);
ni(
  zK,
  eue,
  1
  /* InstantiationType.Delayed */
);
function L9e(i) {
  return typeof i == "string" ? !1 : Array.isArray(i) ? i.every(L9e) : !!i.exclusive;
}
class ZNe {
  constructor(e, t, n, r, s) {
    this.uri = e, this.languageId = t, this.notebookUri = n, this.notebookType = r, this.recursive = s;
  }
  equals(e) {
    var t, n;
    return this.notebookType === e.notebookType && this.languageId === e.languageId && this.uri.toString() === e.uri.toString() && ((t = this.notebookUri) == null ? void 0 : t.toString()) === ((n = e.notebookUri) == null ? void 0 : n.toString()) && this.recursive === e.recursive;
  }
}
class Ns {
  get onDidChange() {
    return this._onDidChange.event;
  }
  constructor(e) {
    this._notebookInfoResolver = e, this._clock = 0, this._entries = [], this._onDidChange = new he();
  }
  register(e, t) {
    let n = {
      selector: e,
      provider: t,
      _score: -1,
      _time: this._clock++
    };
    return this._entries.push(n), this._lastCandidate = void 0, this._onDidChange.fire(this._entries.length), Et(() => {
      if (n) {
        const r = this._entries.indexOf(n);
        r >= 0 && (this._entries.splice(r, 1), this._lastCandidate = void 0, this._onDidChange.fire(this._entries.length), n = void 0);
      }
    });
  }
  has(e) {
    return this.all(e).length > 0;
  }
  all(e) {
    if (!e)
      return [];
    this._updateScores(e, !1);
    const t = [];
    for (const n of this._entries)
      n._score > 0 && t.push(n.provider);
    return t;
  }
  ordered(e, t = !1) {
    const n = [];
    return this._orderedForEach(e, t, (r) => n.push(r.provider)), n;
  }
  orderedGroups(e) {
    const t = [];
    let n, r;
    return this._orderedForEach(e, !1, (s) => {
      n && r === s._score ? n.push(s.provider) : (r = s._score, n = [s.provider], t.push(n));
    }), t;
  }
  _orderedForEach(e, t, n) {
    this._updateScores(e, t);
    for (const r of this._entries)
      r._score > 0 && n(r);
  }
  _updateScores(e, t) {
    var s, o;
    const n = (s = this._notebookInfoResolver) == null ? void 0 : s.call(this, e.uri), r = n ? new ZNe(e.uri, e.getLanguageId(), n.uri, n.type, t) : new ZNe(e.uri, e.getLanguageId(), void 0, void 0, t);
    if (!((o = this._lastCandidate) != null && o.equals(r))) {
      this._lastCandidate = r;
      for (const a of this._entries)
        if (a._score = tme(a.selector, r.uri, r.languageId, rFe(e), r.notebookUri, r.notebookType), L9e(a.selector) && a._score > 0)
          if (t)
            a._score = 0;
          else {
            for (const l of this._entries)
              l._score = 0;
            a._score = 1e3;
            break;
          }
      this._entries.sort(Ns._compareByScoreAndTime);
    }
  }
  static _compareByScoreAndTime(e, t) {
    return e._score < t._score ? 1 : e._score > t._score ? -1 : oF(e.selector) && !oF(t.selector) ? 1 : !oF(e.selector) && oF(t.selector) ? -1 : e._time < t._time ? 1 : e._time > t._time ? -1 : 0;
  }
}
function oF(i) {
  return typeof i == "string" ? !1 : Array.isArray(i) ? i.some(oF) : !!i.isBuiltin;
}
class rOt {
  constructor() {
    this.referenceProvider = new Ns(this._score.bind(this)), this.renameProvider = new Ns(this._score.bind(this)), this.newSymbolNamesProvider = new Ns(this._score.bind(this)), this.codeActionProvider = new Ns(this._score.bind(this)), this.definitionProvider = new Ns(this._score.bind(this)), this.typeDefinitionProvider = new Ns(this._score.bind(this)), this.declarationProvider = new Ns(this._score.bind(this)), this.implementationProvider = new Ns(this._score.bind(this)), this.documentSymbolProvider = new Ns(this._score.bind(this)), this.inlayHintsProvider = new Ns(this._score.bind(this)), this.colorProvider = new Ns(this._score.bind(this)), this.codeLensProvider = new Ns(this._score.bind(this)), this.documentFormattingEditProvider = new Ns(this._score.bind(this)), this.documentRangeFormattingEditProvider = new Ns(this._score.bind(this)), this.onTypeFormattingEditProvider = new Ns(this._score.bind(this)), this.signatureHelpProvider = new Ns(this._score.bind(this)), this.hoverProvider = new Ns(this._score.bind(this)), this.documentHighlightProvider = new Ns(this._score.bind(this)), this.multiDocumentHighlightProvider = new Ns(this._score.bind(this)), this.selectionRangeProvider = new Ns(this._score.bind(this)), this.foldingRangeProvider = new Ns(this._score.bind(this)), this.linkProvider = new Ns(this._score.bind(this)), this.inlineCompletionsProvider = new Ns(this._score.bind(this)), this.completionProvider = new Ns(this._score.bind(this)), this.linkedEditingRangeProvider = new Ns(this._score.bind(this)), this.documentRangeSemanticTokensProvider = new Ns(this._score.bind(this)), this.documentSemanticTokensProvider = new Ns(this._score.bind(this)), this.documentDropEditProvider = new Ns(this._score.bind(this)), this.documentPasteEditProvider = new Ns(this._score.bind(this));
  }
  _score(e) {
    var t;
    return (t = this._notebookTypeResolver) == null ? void 0 : t.call(this, e);
  }
}
ni(
  St,
  rOt,
  1
  /* InstantiationType.Delayed */
);
var sOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, mP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const m_ = Ge;
let tue = class extends Xd {
  get _targetWindow() {
    return At(this._target.targetElements[0]);
  }
  get _targetDocumentElement() {
    return At(this._target.targetElements[0]).document.documentElement;
  }
  get isDisposed() {
    return this._isDisposed;
  }
  get isMouseIn() {
    return this._lockMouseTracker.isMouseIn;
  }
  get domNode() {
    return this._hover.containerDomNode;
  }
  get onDispose() {
    return this._onDispose.event;
  }
  get onRequestLayout() {
    return this._onRequestLayout.event;
  }
  get anchor() {
    return this._hoverPosition === 2 ? 0 : 1;
  }
  get x() {
    return this._x;
  }
  get y() {
    return this._y;
  }
  /**
   * Whether the hover is "locked" by holding the alt/option key. When locked, the hover will not
   * hide and can be hovered regardless of whether the `hideOnHover` hover option is set.
   */
  get isLocked() {
    return this._isLocked;
  }
  set isLocked(e) {
    this._isLocked !== e && (this._isLocked = e, this._hoverContainer.classList.toggle("locked", this._isLocked));
  }
  constructor(e, t, n, r, s, o) {
    var g, m, _, v, w, E, L, T;
    super(), this._keybindingService = t, this._configurationService = n, this._openerService = r, this._instantiationService = s, this._accessibilityService = o, this._messageListeners = new ke(), this._isDisposed = !1, this._forcePosition = !1, this._x = 0, this._y = 0, this._isLocked = !1, this._enableFocusTraps = !1, this._addedFocusTrap = !1, this._maxHeightRatioRelativeToWindow = 0.5, this._onDispose = this._register(new he()), this._onRequestLayout = this._register(new he()), this._linkHandler = e.linkHandler || ((D) => Hge(this._openerService, D, ob(e.content) ? e.content.isTrusted : void 0)), this._target = "targetElements" in e.target ? e.target : new oOt(e.target), this._hoverPointer = (g = e.appearance) != null && g.showPointer ? m_("div.workbench-hover-pointer") : void 0, this._hover = this._register(new Xge(!((m = e.appearance) != null && m.skipFadeInAnimation))), this._hover.containerDomNode.classList.add("workbench-hover"), (_ = e.appearance) != null && _.compact && this._hover.containerDomNode.classList.add("workbench-hover", "compact"), e.additionalClasses && this._hover.containerDomNode.classList.add(...e.additionalClasses), (v = e.position) != null && v.forcePosition && (this._forcePosition = !0), e.trapFocus && (this._enableFocusTraps = !0);
    const a = (w = e.appearance) == null ? void 0 : w.maxHeightRatio;
    a !== void 0 && a > 0 && a <= 1 && (this._maxHeightRatioRelativeToWindow = a), this._hoverPosition = ((E = e.position) == null ? void 0 : E.hoverPosition) === void 0 ? 3 : zy(e.position.hoverPosition) ? e.position.hoverPosition : 2, this.onmousedown(this._hover.containerDomNode, (D) => D.stopPropagation()), this.onkeydown(this._hover.containerDomNode, (D) => {
      D.equals(
        9
        /* KeyCode.Escape */
      ) && this.dispose();
    }), this._register(Ce(this._targetWindow, "blur", () => this.dispose()));
    const l = m_("div.hover-row.markdown-hover"), c = m_("div.hover-contents");
    if (typeof e.content == "string")
      c.textContent = e.content, c.style.whiteSpace = "pre-wrap";
    else if (eo(e.content))
      c.appendChild(e.content), c.classList.add("html-hover-contents");
    else {
      const D = e.content, N = this._instantiationService.createInstance(n0, { codeBlockFontFamily: this._configurationService.getValue("editor").fontFamily || au.fontFamily }), { element: R, dispose: M } = N.render(D, {
        actionHandler: (B) => this._linkHandler(B),
        asyncRenderCallback: () => {
          c.classList.add("code-hover-contents"), this.layout(), this._onRequestLayout.fire();
        }
      });
      c.appendChild(R), this._register(Et(M));
    }
    if (l.appendChild(c), this._hover.contentsDomNode.appendChild(l), e.actions && e.actions.length > 0) {
      const D = m_("div.hover-row.status-bar"), N = m_("div.actions");
      e.actions.forEach((R) => {
        const M = this._keybindingService.lookupKeybinding(R.commandId), B = M ? M.getLabel() : null;
        this._register(wK.render(N, {
          label: R.label,
          commandId: R.commandId,
          run: (H) => {
            R.run(H), this.dispose();
          },
          iconClass: R.iconClass
        }, B));
      }), D.appendChild(N), this._hover.containerDomNode.appendChild(D);
    }
    this._hoverContainer = m_("div.workbench-hover-container"), this._hoverPointer && this._hoverContainer.appendChild(this._hoverPointer), this._hoverContainer.appendChild(this._hover.containerDomNode);
    let u;
    if (e.actions && e.actions.length > 0 ? u = !1 : ((L = e.persistence) == null ? void 0 : L.hideOnHover) === void 0 ? u = typeof e.content == "string" || ob(e.content) && !e.content.value.includes("](") && !e.content.value.includes("</a>") : u = e.persistence.hideOnHover, (T = e.appearance) != null && T.showHoverHint) {
      const D = m_("div.hover-row.status-bar"), N = m_("div.info");
      N.textContent = S(74, "Hold {0} key to mouse over", Kn ? "Option" : "Alt"), D.appendChild(N), this._hover.containerDomNode.appendChild(D);
    }
    const d = [...this._target.targetElements];
    u || d.push(this._hoverContainer);
    const h = this._register(new QNe(d));
    if (this._register(h.onMouseOut(() => {
      this._isLocked || this.dispose();
    })), u) {
      const D = [...this._target.targetElements, this._hoverContainer];
      this._lockMouseTracker = this._register(new QNe(D)), this._register(this._lockMouseTracker.onMouseOut(() => {
        this._isLocked || this.dispose();
      }));
    } else
      this._lockMouseTracker = h;
  }
  addFocusTrap() {
    if (!this._enableFocusTraps || this._addedFocusTrap)
      return;
    this._addedFocusTrap = !0;
    const e = this._hover.containerDomNode, t = this.findLastFocusableChild(this._hover.containerDomNode);
    if (t) {
      const n = Sq(this._hoverContainer, m_("div")), r = Fe(this._hoverContainer, m_("div"));
      n.tabIndex = 0, r.tabIndex = 0, this._register(Ce(r, "focus", (s) => {
        e.focus(), s.preventDefault();
      })), this._register(Ce(n, "focus", (s) => {
        t.focus(), s.preventDefault();
      }));
    }
  }
  findLastFocusableChild(e) {
    if (e.hasChildNodes())
      for (let t = 0; t < e.childNodes.length; t++) {
        const n = e.childNodes.item(e.childNodes.length - t - 1);
        if (n.nodeType === n.ELEMENT_NODE) {
          const s = n;
          if (typeof s.tabIndex == "number" && s.tabIndex >= 0)
            return s;
        }
        const r = this.findLastFocusableChild(n);
        if (r)
          return r;
      }
  }
  render(e) {
    var r;
    e.appendChild(this._hoverContainer);
    const n = this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement) && SBe(this._configurationService.getValue("accessibility.verbosity.hover") === !0 && this._accessibilityService.isScreenReaderOptimized(), (r = this._keybindingService.lookupKeybinding("editor.action.accessibleView")) == null ? void 0 : r.getAriaLabel());
    n && hb(n), this.layout(), this.addFocusTrap();
  }
  layout() {
    this._hover.containerDomNode.classList.remove("right-aligned"), this._hover.contentsDomNode.style.maxHeight = "";
    const e = (u) => {
      const d = DPe(u), h = u.getBoundingClientRect();
      return {
        top: h.top * d,
        bottom: h.bottom * d,
        right: h.right * d,
        left: h.left * d
      };
    }, t = this._target.targetElements.map((u) => e(u)), { top: n, right: r, bottom: s, left: o } = t[0], a = r - o, l = s - n, c = {
      top: n,
      right: r,
      bottom: s,
      left: o,
      width: a,
      height: l,
      center: {
        x: o + a / 2,
        y: n + l / 2
      }
    };
    if (this.adjustHorizontalHoverPosition(c), this.adjustVerticalHoverPosition(c), this.adjustHoverMaxHeight(c), this._hoverContainer.style.padding = "", this._hoverContainer.style.margin = "", this._hoverPointer) {
      switch (this._hoverPosition) {
        case 1:
          c.left += 3, c.right += 3, this._hoverContainer.style.paddingLeft = "3px", this._hoverContainer.style.marginLeft = "-3px";
          break;
        case 0:
          c.left -= 3, c.right -= 3, this._hoverContainer.style.paddingRight = "3px", this._hoverContainer.style.marginRight = "-3px";
          break;
        case 2:
          c.top += 3, c.bottom += 3, this._hoverContainer.style.paddingTop = "3px", this._hoverContainer.style.marginTop = "-3px";
          break;
        case 3:
          c.top -= 3, c.bottom -= 3, this._hoverContainer.style.paddingBottom = "3px", this._hoverContainer.style.marginBottom = "-3px";
          break;
      }
      c.center.x = c.left + a / 2, c.center.y = c.top + l / 2;
    }
    this.computeXCordinate(c), this.computeYCordinate(c), this._hoverPointer && (this._hoverPointer.classList.remove("top"), this._hoverPointer.classList.remove("left"), this._hoverPointer.classList.remove("right"), this._hoverPointer.classList.remove("bottom"), this.setHoverPointerPosition(c)), this._hover.onContentsChanged();
  }
  computeXCordinate(e) {
    const t = this._hover.containerDomNode.clientWidth + 2;
    this._target.x !== void 0 ? this._x = this._target.x : this._hoverPosition === 1 ? this._x = e.right : this._hoverPosition === 0 ? this._x = e.left - t : (this._hoverPointer ? this._x = e.center.x - this._hover.containerDomNode.clientWidth / 2 : this._x = e.left, this._x + t >= this._targetDocumentElement.clientWidth && (this._hover.containerDomNode.classList.add("right-aligned"), this._x = Math.max(this._targetDocumentElement.clientWidth - t - 2, this._targetDocumentElement.clientLeft))), this._x < this._targetDocumentElement.clientLeft && (this._x = e.left + 2);
  }
  computeYCordinate(e) {
    this._target.y !== void 0 ? this._y = this._target.y : this._hoverPosition === 3 ? this._y = e.top : this._hoverPosition === 2 ? this._y = e.bottom - 2 : this._hoverPointer ? this._y = e.center.y + this._hover.containerDomNode.clientHeight / 2 : this._y = e.bottom, this._y > this._targetWindow.innerHeight && (this._y = e.bottom);
  }
  adjustHorizontalHoverPosition(e) {
    if (this._target.x !== void 0)
      return;
    const t = this._hoverPointer ? 3 : 0;
    if (this._forcePosition) {
      const n = t + 2;
      this._hoverPosition === 1 ? this._hover.containerDomNode.style.maxWidth = `${this._targetDocumentElement.clientWidth - e.right - n}px` : this._hoverPosition === 0 && (this._hover.containerDomNode.style.maxWidth = `${e.left - n}px`);
      return;
    }
    this._hoverPosition === 1 ? this._targetDocumentElement.clientWidth - e.right < this._hover.containerDomNode.clientWidth + t && (e.left >= this._hover.containerDomNode.clientWidth + t ? this._hoverPosition = 0 : this._hoverPosition = 2) : this._hoverPosition === 0 && (e.left < this._hover.containerDomNode.clientWidth + t && (this._targetDocumentElement.clientWidth - e.right >= this._hover.containerDomNode.clientWidth + t ? this._hoverPosition = 1 : this._hoverPosition = 2), e.left - this._hover.containerDomNode.clientWidth - t <= this._targetDocumentElement.clientLeft && (this._hoverPosition = 1));
  }
  adjustVerticalHoverPosition(e) {
    if (this._target.y !== void 0 || this._forcePosition)
      return;
    const t = this._hoverPointer ? 3 : 0;
    this._hoverPosition === 3 ? e.top - this._hover.containerDomNode.clientHeight - t < 0 && (this._hoverPosition = 2) : this._hoverPosition === 2 && e.bottom + this._hover.containerDomNode.clientHeight + t > this._targetWindow.innerHeight && (this._hoverPosition = 3);
  }
  adjustHoverMaxHeight(e) {
    let t = this._targetWindow.innerHeight * this._maxHeightRatioRelativeToWindow;
    if (this._forcePosition) {
      const n = (this._hoverPointer ? 3 : 0) + 2;
      this._hoverPosition === 3 ? t = Math.min(t, e.top - n) : this._hoverPosition === 2 && (t = Math.min(t, this._targetWindow.innerHeight - e.bottom - n));
    }
    if (this._hover.containerDomNode.style.maxHeight = `${t}px`, this._hover.contentsDomNode.clientHeight < this._hover.contentsDomNode.scrollHeight) {
      const n = `${this._hover.scrollbar.options.verticalScrollbarSize}px`;
      this._hover.contentsDomNode.style.paddingRight !== n && (this._hover.contentsDomNode.style.paddingRight = n);
    }
  }
  setHoverPointerPosition(e) {
    if (this._hoverPointer)
      switch (this._hoverPosition) {
        case 0:
        case 1: {
          this._hoverPointer.classList.add(this._hoverPosition === 0 ? "right" : "left");
          const t = this._hover.containerDomNode.clientHeight;
          t > e.height ? this._hoverPointer.style.top = `${e.center.y - (this._y - t) - 3}px` : this._hoverPointer.style.top = `${Math.round(t / 2) - 3}px`;
          break;
        }
        case 3:
        case 2: {
          this._hoverPointer.classList.add(this._hoverPosition === 3 ? "bottom" : "top");
          const t = this._hover.containerDomNode.clientWidth;
          let n = Math.round(t / 2) - 3;
          const r = this._x + n;
          (r < e.left || r > e.right) && (n = e.center.x - this._x - 3), this._hoverPointer.style.left = `${n}px`;
          break;
        }
      }
  }
  focus() {
    this._hover.containerDomNode.focus();
  }
  dispose() {
    var e, t;
    this._isDisposed || (this._onDispose.fire(), (t = (e = this._target).dispose) == null || t.call(e), this._hoverContainer.remove(), this._messageListeners.dispose(), super.dispose()), this._isDisposed = !0;
  }
};
tue = sOt([
  mP(1, Fi),
  mP(2, xn),
  mP(3, ad),
  mP(4, xt),
  mP(5, Qa)
], tue);
class QNe extends Xd {
  get onMouseOut() {
    return this._onMouseOut.event;
  }
  get isMouseIn() {
    return this._isMouseIn;
  }
  /**
   * @param _elements The target elements to track mouse in/out events on.
   * @param _eventDebounceDelay The delay in ms to debounce the event firing. This is used to
   * allow a short period for the mouse to move into the hover or a nearby target element. For
   * example hovering a scroll bar will not hide the hover immediately.
   */
  constructor(e, t = 200) {
    super(), this._elements = e, this._eventDebounceDelay = t, this._isMouseIn = !0, this._mouseTimer = this._register(new er()), this._onMouseOut = this._register(new he());
    for (const n of this._elements)
      this.onmouseover(n, () => this._onTargetMouseOver()), this.onmouseleave(n, () => this._onTargetMouseLeave());
  }
  _onTargetMouseOver() {
    this._isMouseIn = !0, this._mouseTimer.clear();
  }
  _onTargetMouseLeave() {
    this._isMouseIn = !1, this._mouseTimer.value = new Gh(() => this._fireIfMouseOutside(), this._eventDebounceDelay);
  }
  _fireIfMouseOutside() {
    this._isMouseIn || this._onMouseOut.fire();
  }
}
class oOt {
  constructor(e) {
    this._element = e, this.targetElements = [this._element];
  }
  dispose() {
  }
}
function aOt(i) {
  const e = i;
  return !!e && typeof e.x == "number" && typeof e.y == "number";
}
var y1;
(function(i) {
  i[i.AVOID = 0] = "AVOID", i[i.ALIGN = 1] = "ALIGN";
})(y1 || (y1 = {}));
function wN(i, e, t) {
  const n = t.mode === y1.ALIGN ? t.offset : t.offset + t.size, r = t.mode === y1.ALIGN ? t.offset + t.size : t.offset;
  return t.position === 0 ? e <= i - n ? n : e <= r ? r - e : Math.max(i - e, 0) : e <= r ? r - e : e <= i - n ? n : 0;
}
const UN = class UN extends ge {
  constructor(e, t) {
    super(), this.container = null, this.useFixedPosition = !1, this.useShadowDOM = !1, this.delegate = null, this.toDisposeOnClean = ge.None, this.toDisposeOnSetContainer = ge.None, this.shadowRoot = null, this.shadowRootHostElement = null, this.view = Ge(".context-view"), eu(this.view), this.setContainer(e, t), this._register(Et(() => this.setContainer(
      null,
      1
      /* ContextViewDOMPosition.ABSOLUTE */
    )));
  }
  setContainer(e, t) {
    var r;
    this.useFixedPosition = t !== 1;
    const n = this.useShadowDOM;
    if (this.useShadowDOM = t === 3, !(e === this.container && n === this.useShadowDOM) && (this.container && (this.toDisposeOnSetContainer.dispose(), this.view.remove(), this.shadowRoot && (this.shadowRoot = null, (r = this.shadowRootHostElement) == null || r.remove(), this.shadowRootHostElement = null), this.container = null), e)) {
      if (this.container = e, this.useShadowDOM) {
        this.shadowRootHostElement = Ge(".shadow-root-host"), this.container.appendChild(this.shadowRootHostElement), this.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: "open" });
        const o = document.createElement("style");
        o.textContent = lOt, this.shadowRoot.appendChild(o), this.shadowRoot.appendChild(this.view), this.shadowRoot.appendChild(Ge("slot"));
      } else
        this.container.appendChild(this.view);
      const s = new ke();
      UN.BUBBLE_UP_EVENTS.forEach((o) => {
        s.add(vo(this.container, o, (a) => {
          this.onDOMEvent(a, !1);
        }));
      }), UN.BUBBLE_DOWN_EVENTS.forEach((o) => {
        s.add(vo(this.container, o, (a) => {
          this.onDOMEvent(a, !0);
        }, !0));
      }), this.toDisposeOnSetContainer = s;
    }
  }
  show(e) {
    var t, n;
    this.isVisible() && this.hide(), Xa(this.view), this.view.className = "context-view monaco-component", this.view.style.top = "0px", this.view.style.left = "0px", this.view.style.zIndex = `${2575 + (e.layer ?? 0)}`, this.view.style.position = this.useFixedPosition ? "fixed" : "absolute", Id(this.view), this.toDisposeOnClean = e.render(this.view) || ge.None, this.delegate = e, this.doLayout(), (n = (t = this.delegate).focus) == null || n.call(t);
  }
  getViewElement() {
    return this.view;
  }
  layout() {
    var e, t;
    if (this.isVisible()) {
      if (this.delegate.canRelayout === !1 && !(jf && fB.pointerEvents)) {
        this.hide();
        return;
      }
      (t = (e = this.delegate) == null ? void 0 : e.layout) == null || t.call(e), this.doLayout();
    }
  }
  doLayout() {
    if (!this.isVisible())
      return;
    const e = this.delegate.getAnchor();
    let t;
    if (eo(e)) {
      const m = ho(e), _ = DPe(e);
      t = {
        top: m.top * _,
        left: m.left * _,
        width: m.width * _,
        height: m.height * _
      };
    } else aOt(e) ? t = {
      top: e.y,
      left: e.x,
      width: e.width || 1,
      height: e.height || 2
    } : t = {
      top: e.posy,
      left: e.posx,
      // We are about to position the context view where the mouse
      // cursor is. To prevent the view being exactly under the mouse
      // when showing and thus potentially triggering an action within,
      // we treat the mouse location like a small sized block element.
      width: 2,
      height: 2
    };
    const n = Td(this.view), r = _y(this.view), s = this.delegate.anchorPosition ?? 0, o = this.delegate.anchorAlignment ?? 0, a = this.delegate.anchorAxisAlignment ?? 0;
    let l, c;
    const u = rr();
    if (a === 0) {
      const m = {
        offset: t.top - u.pageYOffset,
        size: t.height,
        position: s === 0 ? 0 : 1
        /* LayoutAnchorPosition.After */
      }, _ = { offset: t.left, size: t.width, position: o === 0 ? 0 : 1, mode: y1.ALIGN };
      l = wN(u.innerHeight, r, m) + u.pageYOffset, Ul.intersects({ start: l, end: l + r }, { start: m.offset, end: m.offset + m.size }) && (_.mode = y1.AVOID), c = wN(u.innerWidth, n, _);
    } else {
      const m = {
        offset: t.left,
        size: t.width,
        position: o === 0 ? 0 : 1
        /* LayoutAnchorPosition.After */
      }, _ = { offset: t.top, size: t.height, position: s === 0 ? 0 : 1, mode: y1.ALIGN };
      c = wN(u.innerWidth, n, m), Ul.intersects({ start: c, end: c + n }, { start: m.offset, end: m.offset + m.size }) && (_.mode = y1.AVOID), l = wN(u.innerHeight, r, _) + u.pageYOffset;
    }
    this.view.classList.remove("top", "bottom", "left", "right"), this.view.classList.add(s === 0 ? "bottom" : "top"), this.view.classList.add(o === 0 ? "left" : "right"), this.view.classList.toggle("fixed", this.useFixedPosition);
    const d = ho(this.container), h = this.container.scrollTop || 0, g = this.container.scrollLeft || 0;
    this.view.style.top = `${l - (this.useFixedPosition ? ho(this.view).top : d.top) + h}px`, this.view.style.left = `${c - (this.useFixedPosition ? ho(this.view).left : d.left) + g}px`, this.view.style.width = "initial";
  }
  hide(e) {
    const t = this.delegate;
    this.delegate = null, t != null && t.onHide && t.onHide(e), this.toDisposeOnClean.dispose(), eu(this.view);
  }
  isVisible() {
    return !!this.delegate;
  }
  onDOMEvent(e, t) {
    this.delegate && (this.delegate.onDOMEvent ? this.delegate.onDOMEvent(e, At(e).document.activeElement) : t && !pa(e.target, this.container) && this.hide());
  }
  dispose() {
    this.hide(), super.dispose();
  }
};
UN.BUBBLE_UP_EVENTS = ["click", "keydown", "focus", "blur"], UN.BUBBLE_DOWN_EVENTS = ["click"];
let nue = UN;
const lOt = (
  /* css */
  `
	:host {
		all: initial; /* 1st rule so subsequent properties are reset. */
	}

	.codicon[class*='codicon-'] {
		font: normal normal normal 16px/1 codicon;
		display: inline-block;
		text-decoration: none;
		text-rendering: auto;
		text-align: center;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		user-select: none;
		-webkit-user-select: none;
		-ms-user-select: none;
	}

	:host {
		font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
	}

	:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
	:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
	:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
	:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
	:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Nanum Gothic", "AppleGothic", sans-serif; }

	:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
	:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
	:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
	:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
	:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }

	:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
	:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
	:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
	:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
	:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
`
);
var cOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, uOt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let S$ = class extends ge {
  constructor(e) {
    super(), this.layoutService = e, this.contextView = this._register(new nue(
      this.layoutService.mainContainer,
      1
      /* ContextViewDOMPosition.ABSOLUTE */
    )), this.layout(), this._register(e.onDidLayoutContainer(() => this.layout()));
  }
  // ContextView
  showContextView(e, t, n) {
    let r;
    t ? t === this.layoutService.getContainer(At(t)) ? r = 1 : n ? r = 3 : r = 2 : r = 1, this.contextView.setContainer(t ?? this.layoutService.activeContainer, r), this.contextView.show(e);
    const s = {
      close: () => {
        this.openContextView === s && this.hideContextView();
      }
    };
    return this.openContextView = s, s;
  }
  layout() {
    this.contextView.layout();
  }
  hideContextView(e) {
    this.contextView.hide(e), this.openContextView = void 0;
  }
};
S$ = cOt([
  uOt(0, Ib)
], S$);
class dOt extends S$ {
  getContextViewElement() {
    return this.contextView.getViewElement();
  }
}
function T9e(i) {
  const e = i;
  return typeof e == "object" && "markdown" in e && "markdownNotSupportedFallback" in e;
}
class hOt {
  constructor(e, t, n) {
    this.hoverDelegate = e, this.target = t, this.fadeInAnimation = n;
  }
  async update(e, t, n) {
    if (this._cancellationTokenSource && (this._cancellationTokenSource.dispose(!0), this._cancellationTokenSource = void 0), this.isDisposed)
      return;
    let r;
    if (ga(e) || eo(e) || e === void 0)
      r = e;
    else {
      this._cancellationTokenSource = new Ss();
      const s = this._cancellationTokenSource.token;
      let o;
      if (T9e(e) ? ZL(e.markdown) ? o = e.markdown(s).then((a) => a ?? e.markdownNotSupportedFallback) : o = e.markdown ?? e.markdownNotSupportedFallback : o = e.element(s), o instanceof Promise ? (this._hoverWidget || this.show(S(75, "Loading..."), t, n), r = await o) : r = o, this.isDisposed || s.isCancellationRequested)
        return;
    }
    this.show(r, t, n);
  }
  show(e, t, n) {
    var s;
    const r = this._hoverWidget;
    if (this.hasContent(e)) {
      const o = {
        content: e,
        target: this.target,
        actions: n == null ? void 0 : n.actions,
        linkHandler: n == null ? void 0 : n.linkHandler,
        trapFocus: n == null ? void 0 : n.trapFocus,
        appearance: {
          showPointer: this.hoverDelegate.placement === "element",
          skipFadeInAnimation: !this.fadeInAnimation || !!r,
          // do not fade in if the hover is already showing
          showHoverHint: (s = n == null ? void 0 : n.appearance) == null ? void 0 : s.showHoverHint
        },
        position: {
          hoverPosition: 2
        }
      };
      this._hoverWidget = this.hoverDelegate.showHover(o, t);
    }
    r == null || r.dispose();
  }
  hasContent(e) {
    return e ? ob(e) ? !!e.value : !0 : !1;
  }
  get isDisposed() {
    var e;
    return (e = this._hoverWidget) == null ? void 0 : e.isDisposed;
  }
  dispose() {
    var e, t;
    (e = this._hoverWidget) == null || e.dispose(), (t = this._cancellationTokenSource) == null || t.dispose(!0), this._cancellationTokenSource = void 0;
  }
}
var fOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, MI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let iue = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._instantiationService = e, this._configurationService = t, this._keybindingService = r, this._layoutService = s, this._accessibilityService = o, this._currentDelayedHoverWasShown = !1, this._delayedHovers = /* @__PURE__ */ new Map(), this._managedHovers = /* @__PURE__ */ new Map(), this._register(n.onDidShowContextMenu(() => this.hideHover())), this._contextViewHandler = this._register(new S$(this._layoutService)), this._register(Pa.registerCommandAndKeybindingRule({
      id: "workbench.action.showHover",
      weight: 199,
      when: se.editorTextFocus.negate(),
      primary: Ro(
        2089,
        2087
        /* KeyCode.KeyI */
      ),
      handler: () => {
        this._showAndFocusHoverForActiveElement();
      }
    }));
  }
  showInstantHover(e, t, n, r) {
    const s = this._createHover(e, n);
    if (s)
      return this._showHover(s, e, t), s;
  }
  showDelayedHover(e, t) {
    var r;
    if (e.id === void 0 && (e.id = JNe(e.content)), !this._currentDelayedHover || this._currentDelayedHoverWasShown) {
      if ((r = this._currentHover) != null && r.isLocked)
        return;
      if (kC(this._currentHoverOptions) === kC(e))
        return this._currentHover;
      if (this._currentHover && !this._currentHover.isDisposed && this._currentDelayedHoverGroupId !== void 0 && this._currentDelayedHoverGroupId === (t == null ? void 0 : t.groupId))
        return this.showInstantHover({
          ...e,
          appearance: {
            ...e.appearance,
            skipFadeInAnimation: !0
          }
        });
    } else if (this._currentDelayedHover && kC(this._currentHoverOptions) === kC(e))
      return this._currentDelayedHover;
    const n = this._createHover(e, void 0);
    if (!n) {
      this._currentDelayedHover = void 0, this._currentDelayedHoverWasShown = !1, this._currentDelayedHoverGroupId = void 0;
      return;
    }
    return this._currentDelayedHover = n, this._currentDelayedHoverWasShown = !1, this._currentDelayedHoverGroupId = t == null ? void 0 : t.groupId, db(this._configurationService.getValue("workbench.hover.delay")).then(() => {
      n && !n.isDisposed && (this._currentDelayedHoverWasShown = !0, this._showHover(n, e));
    }), n;
  }
  setupDelayedHover(e, t, n) {
    const r = () => ({
      ...typeof t == "function" ? t() : t,
      target: e
    });
    return this._setupDelayedHover(e, r, n);
  }
  setupDelayedHoverAtMouse(e, t, n) {
    const r = (s) => ({
      ...typeof t == "function" ? t() : t,
      target: {
        targetElements: [e],
        x: s !== void 0 ? s.x + 10 : void 0
      }
    });
    return this._setupDelayedHover(e, r, n);
  }
  _setupDelayedHover(e, t, n) {
    const r = new ke();
    return r.add(Ce(e, Xe.MOUSE_OVER, (s) => {
      this.showDelayedHover(t(s), {
        groupId: n == null ? void 0 : n.groupId
      });
    })), n != null && n.setupKeyboardEvents && r.add(Ce(e, Xe.KEY_DOWN, (s) => {
      const o = new wr(s);
      (o.equals(
        10
        /* KeyCode.Space */
      ) || o.equals(
        3
        /* KeyCode.Enter */
      )) && this.showInstantHover(t(), !0);
    })), this._delayedHovers.set(e, { show: (s) => {
      this.showInstantHover(t(), s);
    } }), r.add(Et(() => this._delayedHovers.delete(e))), r;
  }
  _createHover(e, t) {
    var a, l, c, u;
    if (this._currentDelayedHover = void 0, (a = this._currentHover) != null && a.isLocked || (e.id === void 0 && (e.id = JNe(e.content)), kC(this._currentHoverOptions) === kC(e)))
      return;
    this._currentHoverOptions = e, this._lastHoverOptions = e;
    const n = e.trapFocus || this._accessibilityService.isScreenReaderOptimized(), r = ea();
    t || (n && r ? r.classList.contains("monaco-hover") || (this._lastFocusedElementBeforeOpen = r) : this._lastFocusedElementBeforeOpen = void 0);
    const s = new ke(), o = this._instantiationService.createInstance(tue, e);
    if ((l = e.persistence) != null && l.sticky && (o.isLocked = !0), (c = e.position) != null && c.hoverPosition && !zy(e.position.hoverPosition) && (e.target = {
      targetElements: eo(e.target) ? [e.target] : e.target.targetElements,
      x: e.position.hoverPosition.x + 10
    }), o.onDispose(() => {
      var h, g;
      ((h = this._currentHover) == null ? void 0 : h.domNode) && NPe(this._currentHover.domNode) && ((g = this._lastFocusedElementBeforeOpen) == null || g.focus()), kC(this._currentHoverOptions) === kC(e) && this.doHideHover(), s.dispose();
    }, void 0, s), !e.container) {
      const d = eo(e.target) ? e.target : e.target.targetElements[0];
      e.container = this._layoutService.getContainer(At(d));
    }
    if (o.onRequestLayout(() => this._contextViewHandler.layout(), void 0, s), (u = e.persistence) != null && u.sticky)
      s.add(Ce(At(e.container).document, Xe.MOUSE_DOWN, (d) => {
        pa(d.target, o.domNode) || this.doHideHover();
      }));
    else {
      if ("targetElements" in e.target)
        for (const h of e.target.targetElements)
          s.add(Ce(h, Xe.CLICK, () => this.hideHover()));
      else
        s.add(Ce(e.target, Xe.CLICK, () => this.hideHover()));
      const d = ea();
      if (d) {
        const h = At(d).document;
        s.add(Ce(d, Xe.KEY_DOWN, (g) => {
          var m;
          return this._keyDown(g, o, !!((m = e.persistence) != null && m.hideOnKeyDown));
        })), s.add(Ce(h, Xe.KEY_DOWN, (g) => {
          var m;
          return this._keyDown(g, o, !!((m = e.persistence) != null && m.hideOnKeyDown));
        })), s.add(Ce(d, Xe.KEY_UP, (g) => this._keyUp(g, o))), s.add(Ce(h, Xe.KEY_UP, (g) => this._keyUp(g, o)));
      }
    }
    if ("IntersectionObserver" in fr) {
      const d = new IntersectionObserver((g) => this._intersectionChange(g, o), { threshold: 0 }), h = "targetElements" in e.target ? e.target.targetElements[0] : e.target;
      d.observe(h), s.add(Et(() => d.disconnect()));
    }
    return this._currentHover = o, o;
  }
  _showHover(e, t, n) {
    this._contextViewHandler.showContextView(new pOt(e, n), t.container);
  }
  hideHover(e) {
    var t;
    !e && ((t = this._currentHover) != null && t.isLocked) || !this._currentHoverOptions || this.doHideHover();
  }
  doHideHover() {
    this._currentHover = void 0, this._currentHoverOptions = void 0, this._contextViewHandler.hideContextView();
  }
  _intersectionChange(e, t) {
    e[e.length - 1].isIntersecting || t.dispose();
  }
  showAndFocusLastHover() {
    this._lastHoverOptions && this.showInstantHover(this._lastHoverOptions, !0, !0);
  }
  _showAndFocusHoverForActiveElement() {
    let e = ea();
    for (; e; ) {
      const t = this._delayedHovers.get(e) ?? this._managedHovers.get(e);
      if (t) {
        t.show(!0);
        return;
      }
      e = e.parentElement;
    }
  }
  _keyDown(e, t, n) {
    var o, a;
    if (e.key === "Alt") {
      t.isLocked = !0;
      return;
    }
    const r = new wr(e);
    this._keybindingService.resolveKeyboardEvent(r).getSingleModifierDispatchChords().some((l) => !!l) || this._keybindingService.softDispatch(r, r.target).kind !== 0 || n && (!((o = this._currentHoverOptions) != null && o.trapFocus) || e.key !== "Tab") && (this.hideHover(), (a = this._lastFocusedElementBeforeOpen) == null || a.focus());
  }
  _keyUp(e, t) {
    var n;
    e.key === "Alt" && (t.isLocked = !1, t.isMouseIn || (this.hideHover(), (n = this._lastFocusedElementBeforeOpen) == null || n.focus()));
  }
  // TODO: Investigate performance of this function. There seems to be a lot of content created
  //       and thrown away on start up
  setupManagedHover(e, t, n, r) {
    if (e.showNativeHover)
      return gOt(t, n);
    t.setAttribute("custom-hover", "true"), t.title !== "" && (console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."), console.trace("Stack trace:", t.title), t.title = "");
    let s, o;
    const a = (g, m) => {
      var v;
      const _ = o !== void 0;
      g && (o == null || o.dispose(), o = void 0), m && (s == null || s.dispose(), s = void 0), _ && ((v = e.onDidHideHover) == null || v.call(e), o = void 0);
    }, l = (g, m, _, v) => new Gh(async () => {
      (!o || o.isDisposed) && (o = new hOt(e, _ || t, g > 0), await o.update(typeof n == "function" ? n() : n, m, { ...r, trapFocus: v }));
    }, g), c = new ke();
    let u = !1;
    c.add(Ce(t, Xe.MOUSE_DOWN, () => {
      u = !0, a(!0, !0);
    }, !0)), c.add(Ce(t, Xe.MOUSE_UP, () => {
      u = !1;
    }, !0)), c.add(Ce(t, Xe.MOUSE_LEAVE, (g) => {
      u = !1, a(!1, g.fromElement === t);
    }, !0)), c.add(Ce(t, Xe.MOUSE_OVER, (g) => {
      if (s)
        return;
      const m = new ke(), _ = {
        targetElements: [t],
        dispose: () => {
        }
      };
      if (e.placement === void 0 || e.placement === "mouse") {
        const v = (w) => {
          _.x = w.x + 10, eo(w.target) && tRe(w.target, t) !== t && a(!0, !0);
        };
        m.add(Ce(t, Xe.MOUSE_MOVE, v, !0));
      }
      s = m, !(eo(g.target) && tRe(g.target, t) !== t) && m.add(l(typeof e.delay == "function" ? e.delay(n) : e.delay, !1, _));
    }, !0));
    const d = () => {
      if (u || s)
        return;
      const g = {
        targetElements: [t],
        dispose: () => {
        }
      }, m = new ke(), _ = () => a(!0, !0);
      m.add(Ce(t, Xe.BLUR, _, !0)), m.add(l(typeof e.delay == "function" ? e.delay(n) : e.delay, !1, g)), s = m;
    };
    sm(t) || c.add(Ce(t, Xe.FOCUS, d, !0));
    const h = {
      show: (g) => {
        a(!1, !0), l(0, g, void 0, g);
      },
      hide: () => {
        a(!0, !0);
      },
      update: async (g, m) => {
        n = g, await (o == null ? void 0 : o.update(n, void 0, m));
      },
      dispose: () => {
        this._managedHovers.delete(t), c.dispose(), a(!0, !0);
      }
    };
    return this._managedHovers.set(t, h), h;
  }
  showManagedHover(e) {
    const t = this._managedHovers.get(e);
    t && t.show(!0);
  }
  dispose() {
    this._managedHovers.forEach((e) => e.dispose()), super.dispose();
  }
};
iue = fOt([
  MI(0, xt),
  MI(1, xn),
  MI(2, Qh),
  MI(3, Fi),
  MI(4, Ib),
  MI(5, Qa)
], iue);
function kC(i) {
  if (i !== void 0)
    return (i == null ? void 0 : i.id) ?? i;
}
function JNe(i) {
  if (!eo(i))
    return typeof i == "string" ? i.toString() : i.value;
}
function eRe(i) {
  const e = typeof i == "function" ? i() : i;
  if (ga(e))
    return gge(e);
  if (T9e(e))
    return e.markdownNotSupportedFallback;
}
function gOt(i, e) {
  function t(n) {
    n ? i.setAttribute("title", n) : i.removeAttribute("title");
  }
  return t(eRe(e)), {
    update: (n) => t(eRe(n)),
    show: () => {
    },
    hide: () => {
    },
    dispose: () => t(void 0)
  };
}
class pOt {
  get anchorPosition() {
    return this._hover.anchor;
  }
  constructor(e, t = !1) {
    this._hover = e, this._focus = t, this.layer = 1;
  }
  render(e) {
    return this._hover.render(e), this._focus && this._hover.focus(), this._hover;
  }
  getAnchor() {
    return {
      x: this._hover.x,
      y: this._hover.y
    };
  }
  layout() {
    this._hover.layout();
  }
}
function tRe(i, e) {
  for (e = e ?? At(i).document.body; !i.hasAttribute("custom-hover") && i !== e; )
    i = i.parentElement;
  return i;
}
ni(
  od,
  iue,
  1
  /* InstantiationType.Delayed */
);
ng((i, e) => {
  const t = i.getColor(Cfe);
  t && (e.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(0.5)}; }`), e.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${t.transparent(0.5)}; }`));
});
function zH(i) {
  return Object.isFrozen(i) ? i : Jrt(i);
}
class Ga {
  static createEmptyModel(e) {
    return new Ga({}, [], [], void 0, e);
  }
  constructor(e, t, n, r, s) {
    this._contents = e, this._keys = t, this._overrides = n, this.raw = r, this.logService = s, this.overrideConfigurations = /* @__PURE__ */ new Map();
  }
  get rawConfiguration() {
    if (!this._rawConfiguration)
      if (this.raw) {
        const e = (Array.isArray(this.raw) ? this.raw : [this.raw]).map((t) => {
          if (t instanceof Ga)
            return t;
          const n = new mOt("", this.logService);
          return n.parseRaw(t), n.configurationModel;
        });
        this._rawConfiguration = e.reduce((t, n) => n === t ? n : t.merge(n), e[0]);
      } else
        this._rawConfiguration = this;
    return this._rawConfiguration;
  }
  get contents() {
    return this._contents;
  }
  get overrides() {
    return this._overrides;
  }
  get keys() {
    return this._keys;
  }
  isEmpty() {
    return this._keys.length === 0 && Object.keys(this._contents).length === 0 && this._overrides.length === 0;
  }
  getValue(e) {
    return e ? sLe(this.contents, e) : this.contents;
  }
  inspect(e, t) {
    const n = this;
    return {
      get value() {
        return zH(n.rawConfiguration.getValue(e));
      },
      get override() {
        return t ? zH(n.rawConfiguration.getOverrideValue(e, t)) : void 0;
      },
      get merged() {
        return zH(t ? n.rawConfiguration.override(t).getValue(e) : n.rawConfiguration.getValue(e));
      },
      get overrides() {
        const r = [];
        for (const { contents: s, identifiers: o, keys: a } of n.rawConfiguration.overrides) {
          const l = new Ga(s, a, [], void 0, n.logService).getValue(e);
          l !== void 0 && r.push({ identifiers: o, value: l });
        }
        return r.length ? zH(r) : void 0;
      }
    };
  }
  getOverrideValue(e, t) {
    const n = this.getContentsForOverrideIdentifer(t);
    return n ? e ? sLe(n, e) : n : void 0;
  }
  override(e) {
    let t = this.overrideConfigurations.get(e);
    return t || (t = this.createOverrideConfigurationModel(e), this.overrideConfigurations.set(e, t)), t;
  }
  merge(...e) {
    const t = W_(this.contents), n = W_(this.overrides), r = [...this.keys], s = this.raw ? Array.isArray(this.raw) ? [...this.raw] : [this.raw] : [this];
    for (const o of e)
      if (s.push(...o.raw ? Array.isArray(o.raw) ? o.raw : [o.raw] : [o]), !o.isEmpty()) {
        this.mergeContents(t, o.contents);
        for (const a of o.overrides) {
          const [l] = n.filter((c) => ds(c.identifiers, a.identifiers));
          l ? (this.mergeContents(l.contents, a.contents), l.keys.push(...a.keys), l.keys = qy(l.keys)) : n.push(W_(a));
        }
        for (const a of o.keys)
          r.indexOf(a) === -1 && r.push(a);
      }
    return new Ga(t, r, n, !s.length || s.every((o) => o instanceof Ga) ? void 0 : s, this.logService);
  }
  createOverrideConfigurationModel(e) {
    const t = this.getContentsForOverrideIdentifer(e);
    if (!t || typeof t != "object" || !Object.keys(t).length)
      return this;
    const n = {};
    for (const r of qy([...Object.keys(this.contents), ...Object.keys(t)])) {
      let s = this.contents[r];
      const o = t[r];
      o && (typeof s == "object" && typeof o == "object" ? (s = W_(s), this.mergeContents(s, o)) : s = o), n[r] = s;
    }
    return new Ga(n, this.keys, this.overrides, void 0, this.logService);
  }
  mergeContents(e, t) {
    for (const n of Object.keys(t)) {
      if (n in e && Ra(e[n]) && Ra(t[n])) {
        this.mergeContents(e[n], t[n]);
        continue;
      }
      e[n] = W_(t[n]);
    }
  }
  getContentsForOverrideIdentifer(e) {
    let t = null, n = null;
    const r = (s) => {
      s && (n ? this.mergeContents(n, s) : n = W_(s));
    };
    for (const s of this.overrides)
      s.identifiers.length === 1 && s.identifiers[0] === e ? t = s.contents : s.identifiers.includes(e) && r(s.contents);
    return r(t), n;
  }
  toJSON() {
    return {
      contents: this.contents,
      overrides: this.overrides,
      keys: this.keys
    };
  }
  setValue(e, t) {
    this.updateValue(e, t, !1);
  }
  removeValue(e) {
    const t = this.keys.indexOf(e);
    t !== -1 && (this.keys.splice(t, 1), bst(this.contents, e), aw.test(e) && this.overrides.splice(this.overrides.findIndex((n) => ds(n.identifiers, GV(e))), 1));
  }
  updateValue(e, t, n) {
    if (uFe(this.contents, e, t, (r) => this.logService.error(r)), n = n || this.keys.indexOf(e) === -1, n && this.keys.push(e), aw.test(e)) {
      const r = GV(e), s = {
        identifiers: r,
        keys: Object.keys(this.contents[e]),
        contents: Die(this.contents[e], (a) => this.logService.error(a))
      }, o = this.overrides.findIndex((a) => ds(a.identifiers, r));
      o !== -1 ? this.overrides[o] = s : this.overrides.push(s);
    }
  }
}
class mOt {
  constructor(e, t) {
    this._name = e, this.logService = t, this._raw = null, this._configurationModel = null, this._restrictedConfigurations = [];
  }
  get configurationModel() {
    return this._configurationModel || Ga.createEmptyModel(this.logService);
  }
  parseRaw(e, t) {
    this._raw = e;
    const { contents: n, keys: r, overrides: s, restricted: o, hasExcludedProperties: a } = this.doParseRaw(e, t);
    this._configurationModel = new Ga(n, r, s, a ? [e] : void 0, this.logService), this._restrictedConfigurations = o || [];
  }
  doParseRaw(e, t) {
    const n = Fs.as(Cm.Configuration), r = n.getConfigurationProperties(), s = n.getExcludedConfigurationProperties(), o = this.filter(e, r, s, !0, t);
    e = o.raw;
    const a = Die(e, (u) => this.logService.error(`Conflict in settings file ${this._name}: ${u}`)), l = Object.keys(e), c = this.toOverrides(e, (u) => this.logService.error(`Conflict in settings file ${this._name}: ${u}`));
    return { contents: a, keys: l, overrides: c, restricted: o.restricted, hasExcludedProperties: o.hasExcludedProperties };
  }
  filter(e, t, n, r, s) {
    var c;
    let o = !1;
    if (!(s != null && s.scopes) && !(s != null && s.skipRestricted) && !(s != null && s.skipUnregistered) && !((c = s == null ? void 0 : s.exclude) != null && c.length))
      return { raw: e, restricted: [], hasExcludedProperties: o };
    const a = {}, l = [];
    for (const u in e)
      if (aw.test(u) && r) {
        const d = this.filter(e[u], t, n, !1, s);
        a[u] = d.raw, o = o || d.hasExcludedProperties, l.push(...d.restricted);
      } else {
        const d = t[u];
        d != null && d.restricted && l.push(u), this.shouldInclude(u, d, n, s) ? a[u] = e[u] : o = !0;
      }
    return { raw: a, restricted: l, hasExcludedProperties: o };
  }
  shouldInclude(e, t, n, r) {
    var a, l;
    if ((a = r.exclude) != null && a.includes(e))
      return !1;
    if ((l = r.include) != null && l.includes(e))
      return !0;
    if (r.skipRestricted && (t != null && t.restricted) || r.skipUnregistered && !t)
      return !1;
    const s = t ?? n[e], o = s ? typeof s.scope < "u" ? s.scope : 4 : void 0;
    return o === void 0 || r.scopes === void 0 ? !0 : r.scopes.includes(o);
  }
  toOverrides(e, t) {
    const n = [];
    for (const r of Object.keys(e))
      if (aw.test(r)) {
        const s = {};
        for (const o in e[r])
          s[o] = e[r][o];
        n.push({
          identifiers: GV(r),
          keys: Object.keys(s),
          contents: Die(s, t)
        });
      }
    return n;
  }
}
class _Ot {
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g) {
    this.key = e, this.overrides = t, this._value = n, this.overrideIdentifiers = r, this.defaultConfiguration = s, this.policyConfiguration = o, this.applicationConfiguration = a, this.userConfiguration = l, this.localUserConfiguration = c, this.remoteUserConfiguration = u, this.workspaceConfiguration = d, this.folderConfigurationModel = h, this.memoryConfigurationModel = g;
  }
  toInspectValue(e) {
    return (e == null ? void 0 : e.value) !== void 0 || (e == null ? void 0 : e.override) !== void 0 || (e == null ? void 0 : e.overrides) !== void 0 ? e : void 0;
  }
  get userInspectValue() {
    return this._userInspectValue || (this._userInspectValue = this.userConfiguration.inspect(this.key, this.overrides.overrideIdentifier)), this._userInspectValue;
  }
  get user() {
    return this.toInspectValue(this.userInspectValue);
  }
}
class KK {
  constructor(e, t, n, r, s, o, a, l, c, u) {
    this._defaultConfiguration = e, this._policyConfiguration = t, this._applicationConfiguration = n, this._localUserConfiguration = r, this._remoteUserConfiguration = s, this._workspaceConfiguration = o, this._folderConfigurations = a, this._memoryConfiguration = l, this._memoryConfigurationByResource = c, this.logService = u, this._workspaceConsolidatedConfiguration = null, this._foldersConsolidatedConfigurations = new Co(), this._userConfiguration = null;
  }
  getValue(e, t, n) {
    return this.getConsolidatedConfigurationModel(e, t, n).getValue(e);
  }
  updateValue(e, t, n = {}) {
    let r;
    n.resource ? (r = this._memoryConfigurationByResource.get(n.resource), r || (r = Ga.createEmptyModel(this.logService), this._memoryConfigurationByResource.set(n.resource, r))) : r = this._memoryConfiguration, t === void 0 ? r.removeValue(e) : r.setValue(e, t), n.resource || (this._workspaceConsolidatedConfiguration = null);
  }
  inspect(e, t, n) {
    const r = this.getConsolidatedConfigurationModel(e, t, n), s = this.getFolderConfigurationModelForResource(t.resource, n), o = t.resource ? this._memoryConfigurationByResource.get(t.resource) || this._memoryConfiguration : this._memoryConfiguration, a = /* @__PURE__ */ new Set();
    for (const l of r.overrides)
      for (const c of l.identifiers)
        r.getOverrideValue(e, c) !== void 0 && a.add(c);
    return new _Ot(e, t, r.getValue(e), a.size ? [...a] : void 0, this._defaultConfiguration, this._policyConfiguration.isEmpty() ? void 0 : this._policyConfiguration, this.applicationConfiguration.isEmpty() ? void 0 : this.applicationConfiguration, this.userConfiguration, this.localUserConfiguration, this.remoteUserConfiguration, n ? this._workspaceConfiguration : void 0, s || void 0, o);
  }
  get applicationConfiguration() {
    return this._applicationConfiguration;
  }
  get userConfiguration() {
    if (!this._userConfiguration)
      if (this._remoteUserConfiguration.isEmpty())
        this._userConfiguration = this._localUserConfiguration;
      else {
        const e = this._localUserConfiguration.merge(this._remoteUserConfiguration);
        this._userConfiguration = new Ga(e.contents, e.keys, e.overrides, void 0, this.logService);
      }
    return this._userConfiguration;
  }
  get localUserConfiguration() {
    return this._localUserConfiguration;
  }
  get remoteUserConfiguration() {
    return this._remoteUserConfiguration;
  }
  getConsolidatedConfigurationModel(e, t, n) {
    let r = this.getConsolidatedConfigurationModelForResource(t, n);
    if (t.overrideIdentifier && (r = r.override(t.overrideIdentifier)), !this._policyConfiguration.isEmpty() && this._policyConfiguration.getValue(e) !== void 0) {
      r = r.merge();
      for (const s of this._policyConfiguration.keys)
        r.setValue(s, this._policyConfiguration.getValue(s));
    }
    return r;
  }
  getConsolidatedConfigurationModelForResource({ resource: e }, t) {
    let n = this.getWorkspaceConsolidatedConfiguration();
    if (t && e) {
      const r = t.getFolder(e);
      r && (n = this.getFolderConsolidatedConfiguration(r.uri) || n);
      const s = this._memoryConfigurationByResource.get(e);
      s && (n = n.merge(s));
    }
    return n;
  }
  getWorkspaceConsolidatedConfiguration() {
    return this._workspaceConsolidatedConfiguration || (this._workspaceConsolidatedConfiguration = this._defaultConfiguration.merge(this.applicationConfiguration, this.userConfiguration, this._workspaceConfiguration, this._memoryConfiguration)), this._workspaceConsolidatedConfiguration;
  }
  getFolderConsolidatedConfiguration(e) {
    let t = this._foldersConsolidatedConfigurations.get(e);
    if (!t) {
      const n = this.getWorkspaceConsolidatedConfiguration(), r = this._folderConfigurations.get(e);
      r ? (t = n.merge(r), this._foldersConsolidatedConfigurations.set(e, t)) : t = n;
    }
    return t;
  }
  getFolderConfigurationModelForResource(e, t) {
    if (t && e) {
      const n = t.getFolder(e);
      if (n)
        return this._folderConfigurations.get(n.uri);
    }
  }
  toData() {
    return {
      defaults: {
        contents: this._defaultConfiguration.contents,
        overrides: this._defaultConfiguration.overrides,
        keys: this._defaultConfiguration.keys
      },
      policy: {
        contents: this._policyConfiguration.contents,
        overrides: this._policyConfiguration.overrides,
        keys: this._policyConfiguration.keys
      },
      application: {
        contents: this.applicationConfiguration.contents,
        overrides: this.applicationConfiguration.overrides,
        keys: this.applicationConfiguration.keys,
        raw: Array.isArray(this.applicationConfiguration.raw) ? void 0 : this.applicationConfiguration.raw
      },
      userLocal: {
        contents: this.localUserConfiguration.contents,
        overrides: this.localUserConfiguration.overrides,
        keys: this.localUserConfiguration.keys,
        raw: Array.isArray(this.localUserConfiguration.raw) ? void 0 : this.localUserConfiguration.raw
      },
      userRemote: {
        contents: this.remoteUserConfiguration.contents,
        overrides: this.remoteUserConfiguration.overrides,
        keys: this.remoteUserConfiguration.keys,
        raw: Array.isArray(this.remoteUserConfiguration.raw) ? void 0 : this.remoteUserConfiguration.raw
      },
      workspace: {
        contents: this._workspaceConfiguration.contents,
        overrides: this._workspaceConfiguration.overrides,
        keys: this._workspaceConfiguration.keys
      },
      folders: [...this._folderConfigurations.keys()].reduce((e, t) => {
        const { contents: n, overrides: r, keys: s } = this._folderConfigurations.get(t);
        return e.push([t, { contents: n, overrides: r, keys: s }]), e;
      }, [])
    };
  }
  static parse(e, t) {
    const n = this.parseConfigurationModel(e.defaults, t), r = this.parseConfigurationModel(e.policy, t), s = this.parseConfigurationModel(e.application, t), o = this.parseConfigurationModel(e.userLocal, t), a = this.parseConfigurationModel(e.userRemote, t), l = this.parseConfigurationModel(e.workspace, t), c = e.folders.reduce((u, d) => (u.set(Ht.revive(d[0]), this.parseConfigurationModel(d[1], t)), u), new Co());
    return new KK(n, r, s, o, a, l, c, Ga.createEmptyModel(t), new Co(), t);
  }
  static parseConfigurationModel(e, t) {
    return new Ga(e.contents, e.keys, e.overrides, e.raw, t);
  }
}
class bOt {
  constructor(e, t, n, r, s) {
    this.change = e, this.previous = t, this.currentConfiguraiton = n, this.currentWorkspace = r, this.logService = s, this._marker = `
`, this._markerCode1 = this._marker.charCodeAt(0), this._markerCode2 = 46, this.affectedKeys = /* @__PURE__ */ new Set(), this._previousConfiguration = void 0;
    for (const o of e.keys)
      this.affectedKeys.add(o);
    for (const [, o] of e.overrides)
      for (const a of o)
        this.affectedKeys.add(a);
    this._affectsConfigStr = this._marker;
    for (const o of this.affectedKeys)
      this._affectsConfigStr += o + this._marker;
  }
  get previousConfiguration() {
    return !this._previousConfiguration && this.previous && (this._previousConfiguration = KK.parse(this.previous.data, this.logService)), this._previousConfiguration;
  }
  affectsConfiguration(e, t) {
    var a;
    const n = this._marker + e, r = this._affectsConfigStr.indexOf(n);
    if (r < 0)
      return !1;
    const s = r + n.length;
    if (s >= this._affectsConfigStr.length)
      return !1;
    const o = this._affectsConfigStr.charCodeAt(s);
    if (o !== this._markerCode1 && o !== this._markerCode2)
      return !1;
    if (t) {
      const l = this.previousConfiguration ? this.previousConfiguration.getValue(e, t, (a = this.previous) == null ? void 0 : a.workspace) : void 0, c = this.currentConfiguraiton.getValue(e, t, this.currentWorkspace);
      return !Wd(l, c);
    }
    return !0;
  }
}
const E$ = {
  kind: 0
  /* ResultKind.NoMatchingKb */
}, vOt = {
  kind: 1
  /* ResultKind.MoreChordsNeeded */
};
function yOt(i, e, t) {
  return { kind: 2, commandId: i, commandArgs: e, isBubble: t };
}
class l3 {
  constructor(e, t, n) {
    var r;
    this._log = n, this._defaultKeybindings = e, this._defaultBoundCommands = /* @__PURE__ */ new Map();
    for (const s of e) {
      const o = s.command;
      o && o.charAt(0) !== "-" && this._defaultBoundCommands.set(o, !0);
    }
    this._map = /* @__PURE__ */ new Map(), this._lookupMap = /* @__PURE__ */ new Map(), this._keybindings = l3.handleRemovals([].concat(e).concat(t));
    for (let s = 0, o = this._keybindings.length; s < o; s++) {
      const a = this._keybindings[s];
      if (a.chords.length === 0)
        continue;
      const l = (r = a.when) == null ? void 0 : r.substituteConstants();
      l && l.type === 0 || this._addKeyPress(a.chords[0], a);
    }
  }
  static _isTargetedForRemoval(e, t, n) {
    if (t) {
      for (let r = 0; r < t.length; r++)
        if (t[r] !== e.chords[r])
          return !1;
    }
    return !(n && n.type !== 1 && (!e.when || !grt(n, e.when)));
  }
  /**
   * Looks for rules containing "-commandId" and removes them.
   */
  static handleRemovals(e) {
    const t = /* @__PURE__ */ new Map();
    for (let r = 0, s = e.length; r < s; r++) {
      const o = e[r];
      if (o.command && o.command.charAt(0) === "-") {
        const a = o.command.substring(1);
        t.has(a) ? t.get(a).push(o) : t.set(a, [o]);
      }
    }
    if (t.size === 0)
      return e;
    const n = [];
    for (let r = 0, s = e.length; r < s; r++) {
      const o = e[r];
      if (!o.command || o.command.length === 0) {
        n.push(o);
        continue;
      }
      if (o.command.charAt(0) === "-")
        continue;
      const a = t.get(o.command);
      if (!a || !o.isDefault) {
        n.push(o);
        continue;
      }
      let l = !1;
      for (const c of a) {
        const u = c.when;
        if (this._isTargetedForRemoval(o, c.chords, u)) {
          l = !0;
          break;
        }
      }
      if (!l) {
        n.push(o);
        continue;
      }
    }
    return n;
  }
  _addKeyPress(e, t) {
    const n = this._map.get(e);
    if (typeof n > "u") {
      this._map.set(e, [t]), this._addToLookupMap(t);
      return;
    }
    for (let r = n.length - 1; r >= 0; r--) {
      const s = n[r];
      if (s.command === t.command)
        continue;
      let o = !0;
      for (let a = 1; a < s.chords.length && a < t.chords.length; a++)
        if (s.chords[a] !== t.chords[a]) {
          o = !1;
          break;
        }
      o && l3.whenIsEntirelyIncluded(s.when, t.when) && this._removeFromLookupMap(s);
    }
    n.push(t), this._addToLookupMap(t);
  }
  _addToLookupMap(e) {
    if (!e.command)
      return;
    let t = this._lookupMap.get(e.command);
    typeof t > "u" ? (t = [e], this._lookupMap.set(e.command, t)) : t.push(e);
  }
  _removeFromLookupMap(e) {
    if (!e.command)
      return;
    const t = this._lookupMap.get(e.command);
    if (!(typeof t > "u")) {
      for (let n = 0, r = t.length; n < r; n++)
        if (t[n] === e) {
          t.splice(n, 1);
          return;
        }
    }
  }
  /**
   * Returns true if it is provable `a` implies `b`.
   */
  static whenIsEntirelyIncluded(e, t) {
    return !t || t.type === 1 ? !0 : !e || e.type === 1 ? !1 : Sie(e, t);
  }
  getKeybindings() {
    return this._keybindings;
  }
  lookupPrimaryKeybinding(e, t, n = !1) {
    const r = this._lookupMap.get(e);
    if (typeof r > "u" || r.length === 0)
      return null;
    if (r.length === 1 && !n)
      return r[0];
    for (let s = r.length - 1; s >= 0; s--) {
      const o = r[s];
      if (t.contextMatchesRules(o.when))
        return o;
    }
    return n ? null : r[r.length - 1];
  }
  /**
   * Looks up a keybinding trigged as a result of pressing a sequence of chords - `[...currentChords, keypress]`
   *
   * Example: resolving 3 chords pressed sequentially - `cmd+k cmd+p cmd+i`:
   * 	`currentChords = [ 'cmd+k' , 'cmd+p' ]` and `keypress = `cmd+i` - last pressed chord
   */
  resolve(e, t, n) {
    const r = [...t, n];
    this._log(`| Resolving ${r}`);
    const s = this._map.get(r[0]);
    if (s === void 0)
      return this._log("\\ No keybinding entries."), E$;
    let o = null;
    if (r.length < 2)
      o = s;
    else {
      o = [];
      for (let l = 0, c = s.length; l < c; l++) {
        const u = s[l];
        if (r.length > u.chords.length)
          continue;
        let d = !0;
        for (let h = 1; h < r.length; h++)
          if (u.chords[h] !== r[h]) {
            d = !1;
            break;
          }
        d && o.push(u);
      }
    }
    const a = this._findCommand(e, o);
    return a ? r.length < a.chords.length ? (this._log(`\\ From ${o.length} keybinding entries, awaiting ${a.chords.length - r.length} more chord(s), when: ${nRe(a.when)}, source: ${iRe(a)}.`), vOt) : (this._log(`\\ From ${o.length} keybinding entries, matched ${a.command}, when: ${nRe(a.when)}, source: ${iRe(a)}.`), yOt(a.command, a.commandArgs, a.bubble)) : (this._log(`\\ From ${o.length} keybinding entries, no when clauses matched the context.`), E$);
  }
  _findCommand(e, t) {
    for (let n = t.length - 1; n >= 0; n--) {
      const r = t[n];
      if (l3._contextMatchesRules(e, r.when))
        return r;
    }
    return null;
  }
  static _contextMatchesRules(e, t) {
    return t ? t.evaluate(e) : !0;
  }
}
function nRe(i) {
  return i ? `${i.serialize()}` : "no when condition";
}
function iRe(i) {
  return i.extensionId ? i.isBuiltinExtension ? `built-in extension ${i.extensionId}` : `user extension ${i.extensionId}` : i.isDefault ? "built-in" : "user";
}
const COt = /^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;
class wOt extends ge {
  get onDidUpdateKeybindings() {
    return this._onDidUpdateKeybindings ? this._onDidUpdateKeybindings.event : Ze.None;
  }
  get inChordMode() {
    return this._currentChords.length > 0;
  }
  constructor(e, t, n, r, s) {
    super(), this._contextKeyService = e, this._commandService = t, this._telemetryService = n, this._notificationService = r, this._logService = s, this._onDidUpdateKeybindings = this._register(new he()), this._currentChords = [], this._currentChordChecker = new Ahe(), this._currentChordStatusMessage = null, this._ignoreSingleModifiers = SN.EMPTY, this._currentSingleModifier = null, this._currentSingleModifierClearTimeout = new Gh(), this._currentlyDispatchingCommandId = null, this._logging = !1;
  }
  dispose() {
    super.dispose();
  }
  _log(e) {
    this._logging && this._logService.info(`[KeybindingService]: ${e}`);
  }
  getKeybindings() {
    return this._getResolver().getKeybindings();
  }
  lookupKeybinding(e, t, n = !1) {
    const r = this._getResolver().lookupPrimaryKeybinding(e, t || this._contextKeyService, n);
    if (r)
      return r.resolvedKeybinding;
  }
  dispatchEvent(e, t) {
    return this._dispatch(e, t);
  }
  // TODO@ulugbekna: update namings to align with `_doDispatch`
  // TODO@ulugbekna: this fn doesn't seem to take into account single-modifier keybindings, eg `shift shift`
  softDispatch(e, t) {
    this._log("/ Soft dispatching keyboard event");
    const n = this.resolveKeyboardEvent(e);
    if (n.hasMultipleChords())
      return console.warn("keyboard event should not be mapped to multiple chords"), E$;
    const [r] = n.getDispatchChords();
    if (r === null)
      return this._log("\\ Keyboard event cannot be dispatched"), E$;
    const s = this._contextKeyService.getContext(t), o = this._currentChords.map((({ keypress: a }) => a));
    return this._getResolver().resolve(s, o, r);
  }
  _scheduleLeaveChordMode() {
    const e = Date.now();
    this._currentChordChecker.cancelAndSet(() => {
      if (!this._documentHasFocus()) {
        this._leaveChordMode();
        return;
      }
      Date.now() - e > 5e3 && this._leaveChordMode();
    }, 500);
  }
  _expectAnotherChord(e, t) {
    switch (this._currentChords.push({ keypress: e, label: t }), this._currentChords.length) {
      case 0:
        throw LV("impossible");
      case 1:
        this._currentChordStatusMessage = this._notificationService.status(S(1684, "({0}) was pressed. Waiting for second key of chord...", t));
        break;
      default: {
        const n = this._currentChords.map(({ label: r }) => r).join(", ");
        this._currentChordStatusMessage = this._notificationService.status(S(1685, "({0}) was pressed. Waiting for next key of chord...", n));
      }
    }
    this._scheduleLeaveChordMode(), sb.enabled && sb.disable();
  }
  _leaveChordMode() {
    this._currentChordStatusMessage && (this._currentChordStatusMessage.close(), this._currentChordStatusMessage = null), this._currentChordChecker.cancel(), this._currentChords = [], sb.enable();
  }
  _dispatch(e, t) {
    return this._doDispatch(
      this.resolveKeyboardEvent(e),
      t,
      /*isSingleModiferChord*/
      !1
    );
  }
  _singleModifierDispatch(e, t) {
    const n = this.resolveKeyboardEvent(e), [r] = n.getSingleModifierDispatchChords();
    if (r)
      return this._ignoreSingleModifiers.has(r) ? (this._log(`+ Ignoring single modifier ${r} due to it being pressed together with other keys.`), this._ignoreSingleModifiers = SN.EMPTY, this._currentSingleModifierClearTimeout.cancel(), this._currentSingleModifier = null, !1) : (this._ignoreSingleModifiers = SN.EMPTY, this._currentSingleModifier === null ? (this._log(`+ Storing single modifier for possible chord ${r}.`), this._currentSingleModifier = r, this._currentSingleModifierClearTimeout.cancelAndSet(() => {
        this._log("+ Clearing single modifier due to 300ms elapsed."), this._currentSingleModifier = null;
      }, 300), !1) : r === this._currentSingleModifier ? (this._log(`/ Dispatching single modifier chord ${r} ${r}`), this._currentSingleModifierClearTimeout.cancel(), this._currentSingleModifier = null, this._doDispatch(
        n,
        t,
        /*isSingleModiferChord*/
        !0
      )) : (this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${r}`), this._currentSingleModifierClearTimeout.cancel(), this._currentSingleModifier = null, !1));
    const [s] = n.getChords();
    return this._ignoreSingleModifiers = new SN(s), this._currentSingleModifier !== null && this._log("+ Clearing single modifier due to other key up."), this._currentSingleModifierClearTimeout.cancel(), this._currentSingleModifier = null, !1;
  }
  _doDispatch(e, t, n = !1) {
    let r = !1;
    if (e.hasMultipleChords())
      return console.warn("Unexpected keyboard event mapped to multiple chords"), !1;
    let s = null, o = null;
    if (n) {
      const [u] = e.getSingleModifierDispatchChords();
      s = u, o = u ? [u] : [];
    } else
      [s] = e.getDispatchChords(), o = this._currentChords.map(({ keypress: u }) => u);
    if (s === null)
      return this._log("\\ Keyboard event cannot be dispatched in keydown phase."), r;
    const a = this._contextKeyService.getContext(t), l = e.getLabel(), c = this._getResolver().resolve(a, o, s);
    switch (c.kind) {
      case 0: {
        if (this._logService.trace("KeybindingService#dispatch", l, "[ No matching keybinding ]"), this.inChordMode) {
          const u = this._currentChords.map(({ label: d }) => d).join(", ");
          this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${l}".`), this._notificationService.status(S(1686, "The key combination ({0}, {1}) is not a command.", u, l), {
            hideAfter: 10 * 1e3
            /* 10s */
          }), this._leaveChordMode(), r = !0;
        }
        return r;
      }
      case 1:
        return this._logService.trace("KeybindingService#dispatch", l, "[ Several keybindings match - more chords needed ]"), r = !0, this._expectAnotherChord(s, l), this._log(this._currentChords.length === 1 ? "+ Entering multi-chord mode..." : "+ Continuing multi-chord mode..."), r;
      case 2: {
        if (this._logService.trace("KeybindingService#dispatch", l, `[ Will dispatch command ${c.commandId} ]`), c.commandId === null || c.commandId === "") {
          if (this.inChordMode) {
            const u = this._currentChords.map(({ label: d }) => d).join(", ");
            this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${l}".`), this._notificationService.status(S(1687, "The key combination ({0}, {1}) is not a command.", u, l), {
              hideAfter: 10 * 1e3
              /* 10s */
            }), this._leaveChordMode(), r = !0;
          }
        } else {
          this.inChordMode && this._leaveChordMode(), c.isBubble || (r = !0), this._log(`+ Invoking command ${c.commandId}.`), this._currentlyDispatchingCommandId = c.commandId;
          try {
            typeof c.commandArgs > "u" ? this._commandService.executeCommand(c.commandId).then(void 0, (u) => this._notificationService.warn(u)) : this._commandService.executeCommand(c.commandId, c.commandArgs).then(void 0, (u) => this._notificationService.warn(u));
          } finally {
            this._currentlyDispatchingCommandId = null;
          }
          COt.test(c.commandId) || this._telemetryService.publicLog2("workbenchActionExecuted", { id: c.commandId, from: "keybinding", detail: e.getUserSettingsLabel() ?? void 0 });
        }
        return r;
      }
    }
  }
  mightProducePrintableCharacter(e) {
    return e.ctrlKey || e.metaKey ? !1 : e.keyCode >= 31 && e.keyCode <= 56 || e.keyCode >= 21 && e.keyCode <= 30;
  }
}
const nq = class nq {
  constructor(e) {
    this._ctrlKey = e ? e.ctrlKey : !1, this._shiftKey = e ? e.shiftKey : !1, this._altKey = e ? e.altKey : !1, this._metaKey = e ? e.metaKey : !1;
  }
  has(e) {
    switch (e) {
      case "ctrl":
        return this._ctrlKey;
      case "shift":
        return this._shiftKey;
      case "alt":
        return this._altKey;
      case "meta":
        return this._metaKey;
    }
  }
};
nq.EMPTY = new nq(null);
let SN = nq;
class rRe {
  constructor(e, t, n, r, s, o, a) {
    this._resolvedKeybindingItemBrand = void 0, this.resolvedKeybinding = e, this.chords = e ? rue(e.getDispatchChords()) : [], e && this.chords.length === 0 && (this.chords = rue(e.getSingleModifierDispatchChords())), this.bubble = t ? t.charCodeAt(0) === 94 : !1, this.command = this.bubble ? t.substr(1) : t, this.commandArgs = n, this.when = r, this.isDefault = s, this.extensionId = o, this.isBuiltinExtension = a;
  }
}
function rue(i) {
  const e = [];
  for (let t = 0, n = i.length; t < n; t++) {
    const r = i[t];
    if (!r)
      return [];
    e.push(r);
  }
  return e;
}
class SOt extends Itt {
  constructor(e, t) {
    if (super(), t.length === 0)
      throw Bf("chords");
    this._os = e, this._chords = t;
  }
  getLabel() {
    return Nge.toLabel(this._os, this._chords, (e) => this._getLabel(e));
  }
  getAriaLabel() {
    return myt.toLabel(this._os, this._chords, (e) => this._getAriaLabel(e));
  }
  getElectronAccelerator() {
    return this._chords.length > 1 || this._chords[0].isDuplicateModifierCase() ? null : _yt.toLabel(this._os, this._chords, (e) => this._getElectronAccelerator(e));
  }
  getUserSettingsLabel() {
    return byt.toLabel(this._os, this._chords, (e) => this._getUserSettingsLabel(e));
  }
  hasMultipleChords() {
    return this._chords.length > 1;
  }
  getChords() {
    return this._chords.map((e) => this._getChord(e));
  }
  _getChord(e) {
    return new Dtt(e.ctrlKey, e.shiftKey, e.altKey, e.metaKey, this._getLabel(e), this._getAriaLabel(e));
  }
  getDispatchChords() {
    return this._chords.map((e) => this._getChordDispatch(e));
  }
  getSingleModifierDispatchChords() {
    return this._chords.map((e) => this._getSingleModifierChordDispatch(e));
  }
}
class O5 extends SOt {
  constructor(e, t) {
    super(t, e);
  }
  _keyCodeToUILabel(e) {
    if (this._os === 2)
      switch (e) {
        case 15:
          return "←";
        case 16:
          return "↑";
        case 17:
          return "→";
        case 18:
          return "↓";
      }
    return cy.toString(e);
  }
  _getLabel(e) {
    return e.isDuplicateModifierCase() ? "" : this._keyCodeToUILabel(e.keyCode);
  }
  _getAriaLabel(e) {
    return e.isDuplicateModifierCase() ? "" : cy.toString(e.keyCode);
  }
  _getElectronAccelerator(e) {
    return cy.toElectronAccelerator(e.keyCode);
  }
  _getUserSettingsLabel(e) {
    if (e.isDuplicateModifierCase())
      return "";
    const t = cy.toUserSettingsUS(e.keyCode);
    return t && t.toLowerCase();
  }
  _getChordDispatch(e) {
    return O5.getDispatchStr(e);
  }
  static getDispatchStr(e) {
    if (e.isModifierKey())
      return null;
    let t = "";
    return e.ctrlKey && (t += "ctrl+"), e.shiftKey && (t += "shift+"), e.altKey && (t += "alt+"), e.metaKey && (t += "meta+"), t += cy.toString(e.keyCode), t;
  }
  _getSingleModifierChordDispatch(e) {
    return e.keyCode === 5 && !e.shiftKey && !e.altKey && !e.metaKey ? "ctrl" : e.keyCode === 4 && !e.ctrlKey && !e.altKey && !e.metaKey ? "shift" : e.keyCode === 6 && !e.ctrlKey && !e.shiftKey && !e.metaKey ? "alt" : e.keyCode === 57 && !e.ctrlKey && !e.shiftKey && !e.altKey ? "meta" : null;
  }
  /**
   * *NOTE*: Check return value for `KeyCode.Unknown`.
   */
  static _scanCodeToKeyCode(e) {
    const t = Ihe[e];
    if (t !== -1)
      return t;
    switch (e) {
      case 10:
        return 31;
      case 11:
        return 32;
      case 12:
        return 33;
      case 13:
        return 34;
      case 14:
        return 35;
      case 15:
        return 36;
      case 16:
        return 37;
      case 17:
        return 38;
      case 18:
        return 39;
      case 19:
        return 40;
      case 20:
        return 41;
      case 21:
        return 42;
      case 22:
        return 43;
      case 23:
        return 44;
      case 24:
        return 45;
      case 25:
        return 46;
      case 26:
        return 47;
      case 27:
        return 48;
      case 28:
        return 49;
      case 29:
        return 50;
      case 30:
        return 51;
      case 31:
        return 52;
      case 32:
        return 53;
      case 33:
        return 54;
      case 34:
        return 55;
      case 35:
        return 56;
      case 36:
        return 22;
      case 37:
        return 23;
      case 38:
        return 24;
      case 39:
        return 25;
      case 40:
        return 26;
      case 41:
        return 27;
      case 42:
        return 28;
      case 43:
        return 29;
      case 44:
        return 30;
      case 45:
        return 21;
      case 51:
        return 88;
      case 52:
        return 86;
      case 53:
        return 92;
      case 54:
        return 94;
      case 55:
        return 93;
      case 56:
        return 0;
      // missing
      case 57:
        return 85;
      case 58:
        return 95;
      case 59:
        return 91;
      case 60:
        return 87;
      case 61:
        return 89;
      case 62:
        return 90;
      case 106:
        return 97;
    }
    return 0;
  }
  static _toKeyCodeChord(e) {
    if (!e)
      return null;
    if (e instanceof $y)
      return e;
    const t = this._scanCodeToKeyCode(e.scanCode);
    return t === 0 ? null : new $y(e.ctrlKey, e.shiftKey, e.altKey, e.metaKey, t);
  }
  static resolveKeybinding(e, t) {
    const n = rue(e.chords.map((r) => this._toKeyCodeChord(r)));
    return n.length > 0 ? [new O5(n, t)] : [];
  }
}
let EA = [], ume = [], k9e = [];
function $H(i, e = !1) {
  EOt(i, !1, e);
}
function EOt(i, e, t) {
  const n = xOt(i, e);
  EA.push(n), n.userConfigured ? k9e.push(n) : ume.push(n), t && !n.userConfigured && EA.forEach((r) => {
    r.mime === n.mime || r.userConfigured || (n.extension && r.extension === n.extension && console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`), n.filename && r.filename === n.filename && console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`), n.filepattern && r.filepattern === n.filepattern && console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`), n.firstline && r.firstline === n.firstline && console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`));
  });
}
function xOt(i, e) {
  return {
    id: i.id,
    mime: i.mime,
    filename: i.filename,
    extension: i.extension,
    filepattern: i.filepattern,
    firstline: i.firstline,
    userConfigured: e,
    filenameLowercase: i.filename ? i.filename.toLowerCase() : void 0,
    extensionLowercase: i.extension ? i.extension.toLowerCase() : void 0,
    filepatternLowercase: i.filepattern ? Z8e(i.filepattern.toLowerCase()) : void 0,
    filepatternOnPath: i.filepattern ? i.filepattern.indexOf(Ho.sep) >= 0 : !1
  };
}
function LOt() {
  EA = EA.filter((i) => i.userConfigured), ume = [];
}
function TOt(i, e) {
  return kOt(i, e).map((t) => t.id);
}
function kOt(i, e) {
  let t;
  if (i)
    switch (i.scheme) {
      case Yt.file:
        t = i.fsPath;
        break;
      case Yt.data: {
        t = sw.parseMetaData(i).get(sw.META_DATA_LABEL);
        break;
      }
      case Yt.vscodeNotebookCell:
        t = void 0;
        break;
      default:
        t = i.path;
    }
  if (!t)
    return [{ id: "unknown", mime: co.unknown }];
  t = t.toLowerCase();
  const n = E1(t), r = sRe(t, n, k9e);
  if (r)
    return [r, { id: $h, mime: co.text }];
  const s = sRe(t, n, ume);
  if (s)
    return [s, { id: $h, mime: co.text }];
  if (e) {
    const o = DOt(e);
    if (o)
      return [o, { id: $h, mime: co.text }];
  }
  return [{ id: "unknown", mime: co.unknown }];
}
function sRe(i, e, t) {
  var o;
  let n, r, s;
  for (let a = t.length - 1; a >= 0; a--) {
    const l = t[a];
    if (e === l.filenameLowercase) {
      n = l;
      break;
    }
    if (l.filepattern && (!r || l.filepattern.length > r.filepattern.length)) {
      const c = l.filepatternOnPath ? i : e;
      (o = l.filepatternLowercase) != null && o.call(l, c) && (r = l);
    }
    l.extension && (!s || l.extension.length > s.extension.length) && e.endsWith(l.extensionLowercase) && (s = l);
  }
  if (n)
    return n;
  if (r)
    return r;
  if (s)
    return s;
}
function DOt(i) {
  if (Vhe(i) && (i = i.substr(1)), i.length > 0)
    for (let e = EA.length - 1; e >= 0; e--) {
      const t = EA[e];
      if (!t.firstline)
        continue;
      const n = i.match(t.firstline);
      if (n && n.length > 0)
        return t;
    }
}
const jH = Object.prototype.hasOwnProperty, oRe = "vs.editor.nullLanguage";
class IOt {
  constructor() {
    this._languageIdToLanguage = [], this._languageToLanguageId = /* @__PURE__ */ new Map(), this._register(
      oRe,
      0
      /* LanguageId.Null */
    ), this._register(
      $h,
      1
      /* LanguageId.PlainText */
    ), this._nextLanguageId = 2;
  }
  _register(e, t) {
    this._languageIdToLanguage[t] = e, this._languageToLanguageId.set(e, t);
  }
  register(e) {
    if (this._languageToLanguageId.has(e))
      return;
    const t = this._nextLanguageId++;
    this._register(e, t);
  }
  encodeLanguageId(e) {
    return this._languageToLanguageId.get(e) || 0;
  }
  decodeLanguageId(e) {
    return this._languageIdToLanguage[e] || oRe;
  }
}
const U3 = class U3 extends ge {
  constructor(e = !0, t = !1) {
    super(), this._onDidChange = this._register(new he()), this.onDidChange = this._onDidChange.event, U3.instanceCount++, this._warnOnOverwrite = t, this.languageIdCodec = new IOt(), this._dynamicLanguages = [], this._languages = {}, this._mimeTypesMap = {}, this._nameMap = {}, this._lowercaseNameMap = {}, e && (this._initializeFromRegistry(), this._register(KR.onDidChangeLanguages((n) => {
      this._initializeFromRegistry();
    })));
  }
  dispose() {
    U3.instanceCount--, super.dispose();
  }
  _initializeFromRegistry() {
    this._languages = {}, this._mimeTypesMap = {}, this._nameMap = {}, this._lowercaseNameMap = {}, LOt();
    const e = [].concat(KR.getLanguages()).concat(this._dynamicLanguages);
    this._registerLanguages(e);
  }
  _registerLanguages(e) {
    for (const t of e)
      this._registerLanguage(t);
    this._mimeTypesMap = {}, this._nameMap = {}, this._lowercaseNameMap = {}, Object.keys(this._languages).forEach((t) => {
      const n = this._languages[t];
      n.name && (this._nameMap[n.name] = n.identifier), n.aliases.forEach((r) => {
        this._lowercaseNameMap[r.toLowerCase()] = n.identifier;
      }), n.mimetypes.forEach((r) => {
        this._mimeTypesMap[r] = n.identifier;
      });
    }), Fs.as(Cm.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()), this._onDidChange.fire();
  }
  _registerLanguage(e) {
    const t = e.id;
    let n;
    jH.call(this._languages, t) ? n = this._languages[t] : (this.languageIdCodec.register(t), n = {
      identifier: t,
      name: null,
      mimetypes: [],
      aliases: [],
      extensions: [],
      filenames: [],
      configurationFiles: [],
      icons: []
    }, this._languages[t] = n), this._mergeLanguage(n, e);
  }
  _mergeLanguage(e, t) {
    const n = t.id;
    let r = null;
    if (Array.isArray(t.mimetypes) && t.mimetypes.length > 0 && (e.mimetypes.push(...t.mimetypes), r = t.mimetypes[0]), r || (r = `text/x-${n}`, e.mimetypes.push(r)), Array.isArray(t.extensions)) {
      t.configuration ? e.extensions = t.extensions.concat(e.extensions) : e.extensions = e.extensions.concat(t.extensions);
      for (const a of t.extensions)
        $H({ id: n, mime: r, extension: a }, this._warnOnOverwrite);
    }
    if (Array.isArray(t.filenames))
      for (const a of t.filenames)
        $H({ id: n, mime: r, filename: a }, this._warnOnOverwrite), e.filenames.push(a);
    if (Array.isArray(t.filenamePatterns))
      for (const a of t.filenamePatterns)
        $H({ id: n, mime: r, filepattern: a }, this._warnOnOverwrite);
    if (typeof t.firstLine == "string" && t.firstLine.length > 0) {
      let a = t.firstLine;
      a.charAt(0) !== "^" && (a = "^" + a);
      try {
        const l = new RegExp(a);
        XMe(l) || $H({ id: n, mime: r, firstline: l }, this._warnOnOverwrite);
      } catch (l) {
        console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `, l);
      }
    }
    e.aliases.push(n);
    let s = null;
    if (typeof t.aliases < "u" && Array.isArray(t.aliases) && (t.aliases.length === 0 ? s = [null] : s = t.aliases), s !== null)
      for (const a of s)
        !a || a.length === 0 || e.aliases.push(a);
    const o = s !== null && s.length > 0;
    if (!(o && s[0] === null)) {
      const a = (o ? s[0] : null) || n;
      (o || !e.name) && (e.name = a);
    }
    t.configuration && e.configurationFiles.push(t.configuration), t.icon && e.icons.push(t.icon);
  }
  isRegisteredLanguageId(e) {
    return e ? jH.call(this._languages, e) : !1;
  }
  getRegisteredLanguageIds() {
    return Object.keys(this._languages);
  }
  getLanguageIdByLanguageName(e) {
    const t = e.toLowerCase();
    return jH.call(this._lowercaseNameMap, t) ? this._lowercaseNameMap[t] : null;
  }
  getLanguageIdByMimeType(e) {
    return e && jH.call(this._mimeTypesMap, e) ? this._mimeTypesMap[e] : null;
  }
  guessLanguageIdByFilepathOrFirstLine(e, t) {
    return !e && !t ? [] : TOt(e, t);
  }
};
U3.instanceCount = 0;
let sue = U3;
const z3 = class z3 extends ge {
  constructor(e = !1) {
    super(), this._onDidRequestBasicLanguageFeatures = this._register(new he()), this.onDidRequestBasicLanguageFeatures = this._onDidRequestBasicLanguageFeatures.event, this._onDidRequestRichLanguageFeatures = this._register(new he()), this.onDidRequestRichLanguageFeatures = this._onDidRequestRichLanguageFeatures.event, this._onDidChange = this._register(new he({
      leakWarningThreshold: 200
      /* https://github.com/microsoft/vscode/issues/119968 */
    })), this.onDidChange = this._onDidChange.event, this._requestedBasicLanguages = /* @__PURE__ */ new Set(), this._requestedRichLanguages = /* @__PURE__ */ new Set(), z3.instanceCount++, this._registry = this._register(new sue(!0, e)), this.languageIdCodec = this._registry.languageIdCodec, this._register(this._registry.onDidChange(() => this._onDidChange.fire()));
  }
  dispose() {
    z3.instanceCount--, super.dispose();
  }
  isRegisteredLanguageId(e) {
    return this._registry.isRegisteredLanguageId(e);
  }
  getLanguageIdByLanguageName(e) {
    return this._registry.getLanguageIdByLanguageName(e);
  }
  getLanguageIdByMimeType(e) {
    return this._registry.getLanguageIdByMimeType(e);
  }
  guessLanguageIdByFilepathOrFirstLine(e, t) {
    return this._registry.guessLanguageIdByFilepathOrFirstLine(e, t).at(0) ?? null;
  }
  createById(e) {
    return new aRe(this.onDidChange, () => this._createAndGetLanguageIdentifier(e));
  }
  createByFilepathOrFirstLine(e, t) {
    return new aRe(this.onDidChange, () => {
      const n = this.guessLanguageIdByFilepathOrFirstLine(e, t);
      return this._createAndGetLanguageIdentifier(n);
    });
  }
  _createAndGetLanguageIdentifier(e) {
    return (!e || !this.isRegisteredLanguageId(e)) && (e = $h), e;
  }
  requestBasicLanguageFeatures(e) {
    this._requestedBasicLanguages.has(e) || (this._requestedBasicLanguages.add(e), this._onDidRequestBasicLanguageFeatures.fire(e));
  }
  requestRichLanguageFeatures(e) {
    this._requestedRichLanguages.has(e) || (this._requestedRichLanguages.add(e), this.requestBasicLanguageFeatures(e), Ys.getOrCreate(e), this._onDidRequestRichLanguageFeatures.fire(e));
  }
};
z3.instanceCount = 0;
let oue = z3;
class aRe {
  constructor(e, t) {
    this._value = ji(this, e, () => t()), this.onDidChange = Ze.fromObservable(this._value);
  }
  get languageId() {
    return this._value.get();
  }
}
const aue = /\(&([^\s&])\)|(^|[^&])&([^\s&])/, Ute = /(&amp;)?(&amp;)([^\s&])/g;
var x$;
(function(i) {
  i[i.Right = 0] = "Right", i[i.Left = 1] = "Left";
})(x$ || (x$ = {}));
var lue;
(function(i) {
  i[i.Above = 0] = "Above", i[i.Below = 1] = "Below";
})(lue || (lue = {}));
class gR extends qu {
  constructor(e, t, n, r) {
    e.classList.add("monaco-menu-container"), e.setAttribute("role", "presentation");
    const s = document.createElement("div");
    s.classList.add("monaco-menu"), s.setAttribute("role", "presentation"), super(s, {
      orientation: 1,
      actionViewItemProvider: (c) => this.doGetActionViewItem(c, n, o),
      context: n.context,
      actionRunner: n.actionRunner,
      ariaLabel: n.ariaLabel,
      ariaRole: "menu",
      focusOnlyEnabledItems: !0,
      triggerKeys: { keys: [3, ...Kn || Qu ? [
        10
        /* KeyCode.Space */
      ] : []], keyDown: !0 }
    }), this.menuStyles = r, this.menuElement = s, this.actionsList.tabIndex = 0, this.initializeOrUpdateStyleSheet(e, r), this._register(ec.addTarget(s)), this._register(Ce(s, Xe.KEY_DOWN, (c) => {
      new wr(c).equals(
        2
        /* KeyCode.Tab */
      ) && c.preventDefault();
    })), n.enableMnemonics && this._register(Ce(s, Xe.KEY_DOWN, (c) => {
      const u = c.key.toLocaleLowerCase();
      if (this.mnemonics.has(u)) {
        Mi.stop(c, !0);
        const d = this.mnemonics.get(u);
        if (d.length === 1 && (d[0] instanceof lRe && d[0].container && this.focusItemByElement(d[0].container), d[0].onClick(c)), d.length > 1) {
          const h = d.shift();
          h && h.container && (this.focusItemByElement(h.container), d.push(h)), this.mnemonics.set(u, d);
        }
      }
    })), Qu && this._register(Ce(s, Xe.KEY_DOWN, (c) => {
      const u = new wr(c);
      u.equals(
        14
        /* KeyCode.Home */
      ) || u.equals(
        11
        /* KeyCode.PageUp */
      ) ? (this.focusedItem = this.viewItems.length - 1, this.focusNext(), Mi.stop(c, !0)) : (u.equals(
        13
        /* KeyCode.End */
      ) || u.equals(
        12
        /* KeyCode.PageDown */
      )) && (this.focusedItem = 0, this.focusPrevious(), Mi.stop(c, !0));
    })), this._register(Ce(this.domNode, Xe.MOUSE_OUT, (c) => {
      const u = c.relatedTarget;
      pa(u, this.domNode) || (this.focusedItem = void 0, this.updateFocus(), c.stopPropagation());
    })), this._register(Ce(this.actionsList, Xe.MOUSE_OVER, (c) => {
      let u = c.target;
      if (!(!u || !pa(u, this.actionsList) || u === this.actionsList)) {
        for (; u.parentElement !== this.actionsList && u.parentElement !== null; )
          u = u.parentElement;
        if (u.classList.contains("action-item")) {
          const d = this.focusedItem;
          this.setFocusedItem(u), d !== this.focusedItem && this.updateFocus();
        }
      }
    })), this._register(ec.addTarget(this.actionsList)), this._register(Ce(this.actionsList, zr.Tap, (c) => {
      let u = c.initialTarget;
      if (!(!u || !pa(u, this.actionsList) || u === this.actionsList)) {
        for (; u.parentElement !== this.actionsList && u.parentElement !== null; )
          u = u.parentElement;
        if (u.classList.contains("action-item")) {
          const d = this.focusedItem;
          this.setFocusedItem(u), d !== this.focusedItem && this.updateFocus();
        }
      }
    }));
    const o = {
      parent: this
    };
    this.mnemonics = /* @__PURE__ */ new Map(), this.scrollableElement = this._register(new LB(s, {
      alwaysConsumeMouseWheel: !0,
      horizontal: 2,
      vertical: 3,
      verticalScrollbarSize: 7,
      handleMouseWheel: !0,
      useShadows: !0
    }));
    const a = this.scrollableElement.getDomNode();
    a.style.position = "", this.styleScrollElement(a, r), this._register(Ce(s, zr.Change, (c) => {
      Mi.stop(c, !0);
      const u = this.scrollableElement.getScrollPosition().scrollTop;
      this.scrollableElement.setScrollPosition({ scrollTop: u - c.translationY });
    })), this._register(Ce(a, Xe.MOUSE_UP, (c) => {
      c.preventDefault();
    }));
    const l = At(e);
    s.style.maxHeight = `${Math.max(10, l.innerHeight - e.getBoundingClientRect().top - 35)}px`, t = t.filter((c, u) => {
      var d;
      return (d = n.submenuIds) != null && d.has(c.id) ? (console.warn(`Found submenu cycle: ${c.id}`), !1) : !(c instanceof fa && (u === t.length - 1 || u === 0 || t[u - 1] instanceof fa));
    }), this.push(t, { icon: !0, label: !0, isMenu: !0 }), e.appendChild(this.scrollableElement.getDomNode()), this.scrollableElement.scanDomNode(), this.viewItems.filter((c) => !(c instanceof cRe)).forEach((c, u, d) => {
      c.updatePositionInSet(u + 1, d.length);
    });
  }
  initializeOrUpdateStyleSheet(e, t) {
    this.styleSheet || (BV(e) ? this.styleSheet = Zf(e) : (gR.globalStyleSheet || (gR.globalStyleSheet = Zf()), this.styleSheet = gR.globalStyleSheet)), this.styleSheet.textContent = ROt(t, BV(e));
  }
  styleScrollElement(e, t) {
    const n = t.foregroundColor ?? "", r = t.backgroundColor ?? "", s = t.borderColor ? `1px solid ${t.borderColor}` : "", o = "5px", a = t.shadowColor ? `0 2px 8px ${t.shadowColor}` : "";
    e.style.outline = s, e.style.borderRadius = o, e.style.color = n, e.style.backgroundColor = r, e.style.boxShadow = a;
  }
  getContainer() {
    return this.scrollableElement.getDomNode();
  }
  get onScroll() {
    return this.scrollableElement.onScroll;
  }
  focusItemByElement(e) {
    const t = this.focusedItem;
    this.setFocusedItem(e), t !== this.focusedItem && this.updateFocus();
  }
  setFocusedItem(e) {
    for (let t = 0; t < this.actionsList.children.length; t++) {
      const n = this.actionsList.children[t];
      if (e === n) {
        this.focusedItem = t;
        break;
      }
    }
  }
  updateFocus(e) {
    super.updateFocus(e, !0, !0), typeof this.focusedItem < "u" && this.scrollableElement.setScrollPosition({
      scrollTop: Math.round(this.menuElement.scrollTop)
    });
  }
  doGetActionViewItem(e, t, n) {
    var r, s;
    if (e instanceof fa)
      return new cRe(t.context, e, { icon: !0 }, this.menuStyles);
    if (e instanceof qR) {
      const o = new lRe(e, e.actions, n, { ...t, submenuIds: /* @__PURE__ */ new Set([...t.submenuIds || [], e.id]) }, this.menuStyles);
      if (t.enableMnemonics) {
        const a = o.getMnemonic();
        if (a && o.isEnabled()) {
          let l = [];
          this.mnemonics.has(a) && (l = this.mnemonics.get(a)), l.push(o), this.mnemonics.set(a, l);
        }
      }
      return o;
    } else {
      const o = (s = (r = t.getKeyBinding) == null ? void 0 : r.call(t, e)) == null ? void 0 : s.getLabel(), a = {
        enableMnemonics: t.enableMnemonics,
        useEventAsContext: t.useEventAsContext,
        keybinding: o
      }, l = new D9e(t.context, e, a, this.menuStyles);
      if (t.enableMnemonics) {
        const c = l.getMnemonic();
        if (c && l.isEnabled()) {
          let u = [];
          this.mnemonics.has(c) && (u = this.mnemonics.get(c)), u.push(l), this.mnemonics.set(c, u);
        }
      }
      return l;
    }
  }
}
class D9e extends zp {
  constructor(e, t, n, r) {
    if (n = {
      ...n,
      isMenu: !0,
      icon: n.icon !== void 0 ? n.icon : !1,
      label: n.label !== void 0 ? n.label : !0
    }, super(t, t, n), this.menuStyle = r, this.options = n, this.cssClass = "", this.options.label && n.enableMnemonics) {
      const s = this.action.label;
      if (s) {
        const o = aue.exec(s);
        o && (this.mnemonic = (o[1] ? o[1] : o[3]).toLocaleLowerCase());
      }
    }
    this.runOnceToEnableMouseUp = new mr(() => {
      this.element && (this._register(Ce(this.element, Xe.MOUSE_UP, (s) => {
        if (Mi.stop(s, !0), Zu) {
          if (new vl(At(this.element), s).rightButton)
            return;
          this.onClick(s);
        } else
          setTimeout(() => {
            this.onClick(s);
          }, 0);
      })), this._register(Ce(this.element, Xe.CONTEXT_MENU, (s) => {
        Mi.stop(s, !0);
      })));
    }, 100), this._register(this.runOnceToEnableMouseUp);
  }
  render(e) {
    super.render(e), this.element && (this.container = e, this.item = Fe(this.element, Ge("a.action-menu-item")), this._action.id === fa.ID ? this.item.setAttribute("role", "presentation") : (this.item.setAttribute("role", "menuitem"), this.mnemonic && this.item.setAttribute("aria-keyshortcuts", `${this.mnemonic}`)), this.check = Fe(this.item, Ge("span.menu-item-check" + qt.asCSSSelector(Pe.menuSelection))), this.check.setAttribute("role", "none"), this.label = Fe(this.item, Ge("span.action-label")), this.options.label && this.options.keybinding && (Fe(this.item, Ge("span.keybinding")).textContent = this.options.keybinding), this.runOnceToEnableMouseUp.schedule(), this.updateClass(), this.updateLabel(), this.updateTooltip(), this.updateEnabled(), this.updateChecked(), this.applyStyle());
  }
  blur() {
    super.blur(), this.applyStyle();
  }
  focus() {
    var e;
    super.focus(), (e = this.item) == null || e.focus(), this.applyStyle();
  }
  updatePositionInSet(e, t) {
    this.item && (this.item.setAttribute("aria-posinset", `${e}`), this.item.setAttribute("aria-setsize", `${t}`));
  }
  updateLabel() {
    var e;
    if (this.label && this.options.label) {
      Xa(this.label);
      let t = gge(this.action.label);
      if (t) {
        const n = NOt(t);
        this.options.enableMnemonics || (t = n), this.label.setAttribute("aria-label", n.replace(/&&/g, "&"));
        const r = aue.exec(t);
        if (r) {
          t = Ug(t), Ute.lastIndex = 0;
          let s = Ute.exec(t);
          for (; s && s[1]; )
            s = Ute.exec(t);
          const o = (a) => a.replace(/&amp;&amp;/g, "&amp;");
          s ? this.label.append(pB(o(t.substr(0, s.index)), " "), Ge("u", { "aria-hidden": "true" }, s[3]), KMe(o(t.substr(s.index + s[0].length)), " ")) : this.label.textContent = o(t).trim(), (e = this.item) == null || e.setAttribute("aria-keyshortcuts", (r[1] ? r[1] : r[3]).toLocaleLowerCase());
        } else
          this.label.textContent = t.replace(/&&/g, "&").trim();
      }
    }
  }
  updateTooltip() {
  }
  updateClass() {
    this.cssClass && this.item && this.item.classList.remove(...this.cssClass.split(" ")), this.options.icon && this.label ? (this.cssClass = this.action.class || "", this.label.classList.add("icon"), this.cssClass && this.label.classList.add(...this.cssClass.split(" ")), this.updateEnabled()) : this.label && this.label.classList.remove("icon");
  }
  updateEnabled() {
    this.action.enabled ? (this.element && (this.element.classList.remove("disabled"), this.element.removeAttribute("aria-disabled")), this.item && (this.item.classList.remove("disabled"), this.item.removeAttribute("aria-disabled"), this.item.tabIndex = 0)) : (this.element && (this.element.classList.add("disabled"), this.element.setAttribute("aria-disabled", "true")), this.item && (this.item.classList.add("disabled"), this.item.setAttribute("aria-disabled", "true")));
  }
  updateChecked() {
    if (!this.item)
      return;
    const e = this.action.checked;
    this.item.classList.toggle("checked", !!e), e !== void 0 ? (this.item.setAttribute("role", "menuitemcheckbox"), this.item.setAttribute("aria-checked", e ? "true" : "false")) : (this.item.setAttribute("role", "menuitem"), this.item.setAttribute("aria-checked", ""));
  }
  getMnemonic() {
    return this.mnemonic;
  }
  applyStyle() {
    const e = this.element && this.element.classList.contains("focused"), t = e && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor, n = e && this.menuStyle.selectionBackgroundColor ? this.menuStyle.selectionBackgroundColor : void 0, r = e && this.menuStyle.selectionBorderColor ? `1px solid ${this.menuStyle.selectionBorderColor}` : "", s = e && this.menuStyle.selectionBorderColor ? "-1px" : "";
    this.item && (this.item.style.color = t ?? "", this.item.style.backgroundColor = n ?? "", this.item.style.outline = r, this.item.style.outlineOffset = s), this.check && (this.check.style.color = t ?? "");
  }
}
class lRe extends D9e {
  constructor(e, t, n, r, s) {
    super(e, e, r, s), this.submenuActions = t, this.parentData = n, this.submenuOptions = r, this.mysubmenu = null, this.submenuDisposables = this._register(new ke()), this.mouseOver = !1, this.expandDirection = r && r.expandDirection !== void 0 ? r.expandDirection : { horizontal: x$.Right, vertical: lue.Below }, this.showScheduler = new mr(() => {
      this.mouseOver && (this.cleanupExistingSubmenu(!1), this.createSubmenu(!1));
    }, 250), this.hideScheduler = new mr(() => {
      this.element && !pa(ea(), this.element) && this.parentData.submenu === this.mysubmenu && (this.parentData.parent.focus(!1), this.cleanupExistingSubmenu(!0));
    }, 750);
  }
  render(e) {
    super.render(e), this.element && (this.item && (this.item.classList.add("monaco-submenu-item"), this.item.tabIndex = 0, this.item.setAttribute("aria-haspopup", "true"), this.updateAriaExpanded("false"), this.submenuIndicator = Fe(this.item, Ge("span.submenu-indicator" + qt.asCSSSelector(Pe.menuSubmenu))), this.submenuIndicator.setAttribute("aria-hidden", "true")), this._register(Ce(this.element, Xe.KEY_UP, (t) => {
      const n = new wr(t);
      (n.equals(
        17
        /* KeyCode.RightArrow */
      ) || n.equals(
        3
        /* KeyCode.Enter */
      )) && (Mi.stop(t, !0), this.createSubmenu(!0));
    })), this._register(Ce(this.element, Xe.KEY_DOWN, (t) => {
      const n = new wr(t);
      ea() === this.item && (n.equals(
        17
        /* KeyCode.RightArrow */
      ) || n.equals(
        3
        /* KeyCode.Enter */
      )) && Mi.stop(t, !0);
    })), this._register(Ce(this.element, Xe.MOUSE_OVER, (t) => {
      this.mouseOver || (this.mouseOver = !0, this.showScheduler.schedule());
    })), this._register(Ce(this.element, Xe.MOUSE_LEAVE, (t) => {
      this.mouseOver = !1;
    })), this._register(Ce(this.element, Xe.FOCUS_OUT, (t) => {
      this.element && !pa(ea(), this.element) && this.hideScheduler.schedule();
    })), this._register(this.parentData.parent.onScroll(() => {
      this.parentData.submenu === this.mysubmenu && (this.parentData.parent.focus(!1), this.cleanupExistingSubmenu(!0));
    })));
  }
  updateEnabled() {
  }
  onClick(e) {
    Mi.stop(e, !0), this.cleanupExistingSubmenu(!1), this.createSubmenu(!0);
  }
  cleanupExistingSubmenu(e) {
    if (this.parentData.submenu && (e || this.parentData.submenu !== this.mysubmenu)) {
      try {
        this.parentData.submenu.dispose();
      } catch {
      }
      this.parentData.submenu = void 0, this.updateAriaExpanded("false"), this.submenuContainer && (this.submenuDisposables.clear(), this.submenuContainer = void 0);
    }
  }
  calculateSubmenuMenuLayout(e, t, n, r) {
    const s = { top: 0, left: 0 };
    return s.left = wN(e.width, t.width, { position: r.horizontal === x$.Right ? 0 : 1, offset: n.left, size: n.width }), s.left >= n.left && s.left < n.left + n.width && (n.left + 10 + t.width <= e.width && (s.left = n.left + 10), n.top += 10, n.height = 0), s.top = wN(e.height, t.height, { position: 0, offset: n.top, size: 0 }), s.top + t.height === n.top && s.top + n.height + t.height <= e.height && (s.top += n.height), s;
  }
  createSubmenu(e = !0) {
    if (this.element)
      if (this.parentData.submenu)
        this.parentData.submenu.focus(!1);
      else {
        this.updateAriaExpanded("true"), this.submenuContainer = Fe(this.element, Ge("div.monaco-submenu")), this.submenuContainer.classList.add("menubar-menu-items-holder", "context-view");
        const t = At(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode), n = parseFloat(t.paddingTop || "0") || 0;
        this.submenuContainer.style.position = "fixed", this.submenuContainer.style.top = "0", this.submenuContainer.style.left = "0", this.submenuContainer.style.zIndex = "1", this.parentData.submenu = new gR(this.submenuContainer, this.submenuActions.length ? this.submenuActions : [new yie()], this.submenuOptions, this.menuStyle);
        const r = this.element.getBoundingClientRect(), s = {
          top: r.top - n,
          left: r.left,
          height: r.height + 2 * n,
          width: r.width
        }, o = this.submenuContainer.getBoundingClientRect(), a = At(this.element), { top: l, left: c } = this.calculateSubmenuMenuLayout(new Ji(a.innerWidth, a.innerHeight), Ji.lift(o), s, this.expandDirection);
        this.submenuContainer.style.left = `${c - o.left}px`, this.submenuContainer.style.top = `${l - o.top}px`, this.submenuDisposables.add(Ce(this.submenuContainer, Xe.KEY_UP, (u) => {
          new wr(u).equals(
            15
            /* KeyCode.LeftArrow */
          ) && (Mi.stop(u, !0), this.parentData.parent.focus(), this.cleanupExistingSubmenu(!0));
        })), this.submenuDisposables.add(Ce(this.submenuContainer, Xe.KEY_DOWN, (u) => {
          new wr(u).equals(
            15
            /* KeyCode.LeftArrow */
          ) && Mi.stop(u, !0);
        })), this.submenuDisposables.add(this.parentData.submenu.onDidCancel(() => {
          this.parentData.parent.focus(), this.cleanupExistingSubmenu(!0);
        })), this.parentData.submenu.focus(e), this.mysubmenu = this.parentData.submenu;
      }
  }
  updateAriaExpanded(e) {
    var t;
    this.item && ((t = this.item) == null || t.setAttribute("aria-expanded", e));
  }
  applyStyle() {
    super.applyStyle();
    const t = this.element && this.element.classList.contains("focused") && this.menuStyle.selectionForegroundColor ? this.menuStyle.selectionForegroundColor : this.menuStyle.foregroundColor;
    this.submenuIndicator && (this.submenuIndicator.style.color = t ?? "");
  }
  dispose() {
    super.dispose(), this.hideScheduler.dispose(), this.mysubmenu && (this.mysubmenu.dispose(), this.mysubmenu = null), this.submenuContainer && (this.submenuContainer = void 0);
  }
}
class cRe extends lA {
  constructor(e, t, n, r) {
    super(e, t, n), this.menuStyles = r;
  }
  render(e) {
    super.render(e), this.label && (this.label.style.borderBottomColor = this.menuStyles.separatorColor ? `${this.menuStyles.separatorColor}` : "");
  }
}
function NOt(i) {
  const e = aue, t = e.exec(i);
  if (!t)
    return i;
  const n = !t[1];
  return i.replace(e, n ? "$2$3" : "").trim();
}
function uRe(i) {
  const e = BPe()[i.id];
  return `.codicon-${i.id}:before { content: '\\${e.toString(16)}'; }`;
}
function ROt(i, e) {
  let t = (
    /* css */
    `
.monaco-menu {
	font-size: 13px;
	border-radius: 5px;
	min-width: 160px;
}

${uRe(Pe.menuSelection)}
${uRe(Pe.menuSubmenu)}

.monaco-menu .monaco-action-bar {
	text-align: right;
	overflow: hidden;
	white-space: nowrap;
}

.monaco-menu .monaco-action-bar .actions-container {
	display: flex;
	margin: 0 auto;
	padding: 0;
	width: 100%;
	justify-content: flex-end;
}

.monaco-menu .monaco-action-bar.vertical .actions-container {
	display: inline-block;
}

.monaco-menu .monaco-action-bar.reverse .actions-container {
	flex-direction: row-reverse;
}

.monaco-menu .monaco-action-bar .action-item {
	cursor: pointer;
	display: inline-block;
	transition: transform 50ms ease;
	position: relative;  /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
}

.monaco-menu .monaco-action-bar .action-item.disabled {
	cursor: default;
}

.monaco-menu .monaco-action-bar .action-item .icon,
.monaco-menu .monaco-action-bar .action-item .codicon {
	display: inline-block;
}

.monaco-menu .monaco-action-bar .action-item .codicon {
	display: flex;
	align-items: center;
}

.monaco-menu .monaco-action-bar .action-label {
	font-size: 11px;
	margin-right: 4px;
}

.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
	color: var(--vscode-disabledForeground);
}

/* Vertical actions */

.monaco-menu .monaco-action-bar.vertical {
	text-align: left;
}

.monaco-menu .monaco-action-bar.vertical .action-item {
	display: block;
}

.monaco-menu .monaco-action-bar.vertical .action-label.separator {
	display: block;
	border-bottom: 1px solid var(--vscode-menu-separatorBackground);
	padding-top: 1px;
	padding: 30px;
}

.monaco-menu .secondary-actions .monaco-action-bar .action-label {
	margin-left: 6px;
}

/* Action Items */
.monaco-menu .monaco-action-bar .action-item.select-container {
	overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
	flex: 1;
	max-width: 170px;
	min-width: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 10px;
}

.monaco-menu .monaco-action-bar.vertical {
	margin-left: 0;
	overflow: visible;
}

.monaco-menu .monaco-action-bar.vertical .actions-container {
	display: block;
}

.monaco-menu .monaco-action-bar.vertical .action-item {
	padding: 0;
	transform: none;
	display: flex;
}

.monaco-menu .monaco-action-bar.vertical .action-item.active {
	transform: none;
}

.monaco-menu .monaco-action-bar.vertical .action-menu-item {
	flex: 1 1 auto;
	display: flex;
	height: 2em;
	align-items: center;
	position: relative;
	margin: 0 4px;
	border-radius: 4px;
}

.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
	opacity: unset;
}

.monaco-menu .monaco-action-bar.vertical .action-label {
	flex: 1 1 auto;
	text-decoration: none;
	padding: 0 1em;
	background: none;
	font-size: 12px;
	line-height: 1;
}

.monaco-menu .monaco-action-bar.vertical .keybinding,
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
	display: inline-block;
	flex: 2 1 auto;
	padding: 0 1em;
	text-align: right;
	font-size: 12px;
	line-height: 1;
	opacity: 0.7;
}

.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
	height: 100%;
}

.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
	font-size: 16px !important;
	display: flex;
	align-items: center;
}

.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
	margin-left: auto;
	margin-right: -20px;
}

.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
	opacity: 0.4;
}

.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
	display: inline-block;
	box-sizing: border-box;
	margin: 0;
}

.monaco-menu .monaco-action-bar.vertical .action-item {
	position: static;
	overflow: visible;
}

.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
	position: absolute;
}

.monaco-menu .monaco-action-bar.vertical .action-label.separator {
	width: 100%;
	height: 0px !important;
	opacity: 1;
}

.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
	padding: 0.7em 1em 0.1em 1em;
	font-weight: bold;
	opacity: 1;
}

.monaco-menu .monaco-action-bar.vertical .action-label:hover {
	color: inherit;
}

.monaco-menu .monaco-action-bar.vertical .menu-item-check {
	position: absolute;
	visibility: hidden;
	width: 1em;
	height: 100%;
}

.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
	visibility: visible;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Context Menu */

.context-view.monaco-menu-container {
	outline: 0;
	border: none;
	animation: fadeIn 0.083s linear;
	-webkit-app-region: no-drag;
}

.context-view.monaco-menu-container :focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
	outline: 0;
}

.hc-black .context-view.monaco-menu-container,
.hc-light .context-view.monaco-menu-container,
:host-context(.hc-black) .context-view.monaco-menu-container,
:host-context(.hc-light) .context-view.monaco-menu-container {
	box-shadow: none;
}

.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
	background: none;
}

/* Vertical Action Bar Styles */

.monaco-menu .monaco-action-bar.vertical {
	padding: 4px 0;
}

.monaco-menu .monaco-action-bar.vertical .action-menu-item {
	height: 2em;
}

.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
.monaco-menu .monaco-action-bar.vertical .keybinding {
	font-size: inherit;
	padding: 0 2em;
	max-height: 100%;
}

.monaco-menu .monaco-action-bar.vertical .menu-item-check {
	font-size: inherit;
	width: 2em;
}

.monaco-menu .monaco-action-bar.vertical .action-label.separator {
	font-size: inherit;
	margin: 5px 0 !important;
	padding: 0;
	border-radius: 0;
}

.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
	margin-left: 0;
	margin-right: 0;
}

.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
	font-size: 60%;
	padding: 0 1.8em;
}

.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
	height: 100%;
	mask-size: 10px 10px;
	-webkit-mask-size: 10px 10px;
}

.monaco-menu .action-item {
	cursor: default;
}`
  );
  if (e) {
    t += `
			/* Arrows */
			.monaco-scrollable-element > .scrollbar > .scra {
				cursor: pointer;
				font-size: 11px !important;
			}

			.monaco-scrollable-element > .visible {
				opacity: 1;

				/* Background rule added for IE9 - to allow clicks on dom node */
				background:rgba(0,0,0,0);

				transition: opacity 100ms linear;
			}
			.monaco-scrollable-element > .invisible {
				opacity: 0;
				pointer-events: none;
			}
			.monaco-scrollable-element > .invisible.fade {
				transition: opacity 800ms linear;
			}

			/* Scrollable Content Inset Shadow */
			.monaco-scrollable-element > .shadow {
				position: absolute;
				display: none;
			}
			.monaco-scrollable-element > .shadow.top {
				display: block;
				top: 0;
				left: 3px;
				height: 3px;
				width: 100%;
			}
			.monaco-scrollable-element > .shadow.left {
				display: block;
				top: 3px;
				left: 0;
				height: 100%;
				width: 3px;
			}
			.monaco-scrollable-element > .shadow.top-left-corner {
				display: block;
				top: 0;
				left: 0;
				height: 3px;
				width: 3px;
			}
			/* Fix for https://github.com/microsoft/vscode/issues/103170 */
			.monaco-menu .action-item .monaco-submenu {
				z-index: 1;
			}
		`;
    const n = i.scrollbarShadow;
    n && (t += `
				.monaco-scrollable-element > .shadow.top {
					box-shadow: ${n} 0 6px 6px -6px inset;
				}

				.monaco-scrollable-element > .shadow.left {
					box-shadow: ${n} 6px 0 6px -6px inset;
				}

				.monaco-scrollable-element > .shadow.top.left {
					box-shadow: ${n} 6px 6px 6px -6px inset;
				}
			`);
    const r = i.scrollbarSliderBackground;
    r && (t += `
				.monaco-scrollable-element > .scrollbar > .slider {
					background: ${r};
				}
			`);
    const s = i.scrollbarSliderHoverBackground;
    s && (t += `
				.monaco-scrollable-element > .scrollbar > .slider:hover {
					background: ${s};
				}
			`);
    const o = i.scrollbarSliderActiveBackground;
    o && (t += `
				.monaco-scrollable-element > .scrollbar > .slider.active {
					background: ${o};
				}
			`);
  }
  return t;
}
class AOt {
  constructor(e, t, n, r) {
    this.contextViewService = e, this.telemetryService = t, this.notificationService = n, this.keybindingService = r, this.focusToReturn = null, this.lastContainer = null, this.block = null, this.blockDisposable = null, this.options = { blockMouse: !0 };
  }
  configure(e) {
    this.options = e;
  }
  showContextMenu(e) {
    const t = e.getActions();
    if (!t.length)
      return;
    this.focusToReturn = ea();
    let n;
    const r = eo(e.domForShadowRoot) ? e.domForShadowRoot : void 0;
    this.contextViewService.showContextView({
      getAnchor: () => e.getAnchor(),
      canRelayout: !1,
      anchorAlignment: e.anchorAlignment,
      anchorAxisAlignment: e.anchorAxisAlignment,
      layer: e.layer,
      render: (s) => {
        var u;
        this.lastContainer = s;
        const o = e.getMenuClassName ? e.getMenuClassName() : "";
        o && (s.className += " " + o), this.options.blockMouse && (this.block = s.appendChild(Ge(".context-view-block")), this.block.style.position = "fixed", this.block.style.cursor = "initial", this.block.style.left = "0", this.block.style.top = "0", this.block.style.width = "100%", this.block.style.height = "100%", this.block.style.zIndex = "-1", (u = this.blockDisposable) == null || u.dispose(), this.blockDisposable = Ce(this.block, Xe.MOUSE_DOWN, (d) => d.stopPropagation()));
        const a = new ke(), l = e.actionRunner || a.add(new nT());
        l.onWillRun((d) => this.onActionRun(d, !e.skipTelemetry), this, a), l.onDidRun(this.onDidActionRun, this, a), n = new gR(s, t, {
          actionViewItemProvider: e.getActionViewItem,
          context: e.getActionsContext ? e.getActionsContext() : null,
          actionRunner: l,
          getKeyBinding: e.getKeyBinding ? e.getKeyBinding : (d) => this.keybindingService.lookupKeybinding(d.id)
        }, Dyt), n.onDidCancel(() => this.contextViewService.hideContextView(!0), null, a), n.onDidBlur(() => this.contextViewService.hideContextView(!0), null, a);
        const c = At(s);
        return a.add(Ce(c, Xe.BLUR, () => this.contextViewService.hideContextView(!0))), a.add(Ce(c, Xe.MOUSE_DOWN, (d) => {
          if (d.defaultPrevented)
            return;
          const h = new vl(c, d);
          let g = h.target;
          if (!h.rightButton) {
            for (; g; ) {
              if (g === s)
                return;
              g = g.parentElement;
            }
            this.contextViewService.hideContextView(!0);
          }
        })), Vg(a, n);
      },
      focus: () => {
        n == null || n.focus(!!e.autoSelectFirstItem);
      },
      onHide: (s) => {
        var o, a, l;
        (o = e.onHide) == null || o.call(e, !!s), this.block && (this.block.remove(), this.block = null), (a = this.blockDisposable) == null || a.dispose(), this.blockDisposable = null, this.lastContainer && (ea() === this.lastContainer || pa(ea(), this.lastContainer)) && ((l = this.focusToReturn) == null || l.focus()), this.lastContainer = null;
      }
    }, r, !!r);
  }
  onActionRun(e, t) {
    t && this.telemetryService.publicLog2("workbenchActionExecuted", { id: e.action.id, from: "contextMenu" }), this.contextViewService.hideContextView(!1);
  }
  onDidActionRun(e) {
    e.error && !Xh(e.error) && this.notificationService.error(e.error);
  }
}
var OOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, PI = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let cue = class extends ge {
  get contextMenuHandler() {
    return this._contextMenuHandler || (this._contextMenuHandler = new AOt(this.contextViewService, this.telemetryService, this.notificationService, this.keybindingService)), this._contextMenuHandler;
  }
  constructor(e, t, n, r, s, o) {
    super(), this.telemetryService = e, this.notificationService = t, this.contextViewService = n, this.keybindingService = r, this.menuService = s, this.contextKeyService = o, this._contextMenuHandler = void 0, this._onDidShowContextMenu = this._store.add(new he()), this.onDidShowContextMenu = this._onDidShowContextMenu.event, this._onDidHideContextMenu = this._store.add(new he()), this.onDidHideContextMenu = this._onDidHideContextMenu.event;
  }
  configure(e) {
    this.contextMenuHandler.configure(e);
  }
  // ContextMenu
  showContextMenu(e) {
    e = uue.transform(e, this.menuService, this.contextKeyService), this.contextMenuHandler.showContextMenu({
      ...e,
      onHide: (t) => {
        var n;
        (n = e.onHide) == null || n.call(e, t), this._onDidHideContextMenu.fire();
      }
    }), by.getInstance().resetKeyStatus(), this._onDidShowContextMenu.fire();
  }
};
cue = OOt([
  PI(0, rc),
  PI(1, no),
  PI(2, g0),
  PI(3, Fi),
  PI(4, eg),
  PI(5, Jt)
], cue);
var uue;
(function(i) {
  function e(n) {
    return n && n.menuId instanceof wt;
  }
  function t(n, r, s) {
    if (!e(n))
      return n;
    const { menuId: o, menuActionOptions: a, contextKeyService: l } = n;
    return {
      ...n,
      getActions: () => {
        let c = [];
        if (o) {
          const u = r.getMenuActions(o, l ?? s, a);
          c = Ayt(u);
        }
        return n.getActions ? fa.join(n.getActions(), c) : c;
      }
    };
  }
  i.transform = t;
})(uue || (uue = {}));
var L$;
(function(i) {
  i[i.API = 0] = "API", i[i.USER = 1] = "USER";
})(L$ || (L$ = {}));
var dme = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, T$ = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let due = class {
  constructor(e) {
    this._commandService = e;
  }
  async open(e, t) {
    if (!mq(e, Yt.command))
      return !1;
    if (!(t != null && t.allowCommands) || (typeof e == "string" && (e = Ht.parse(e)), Array.isArray(t.allowCommands) && !t.allowCommands.includes(e.path)))
      return !0;
    let n = [];
    try {
      n = qre(decodeURIComponent(e.query));
    } catch {
      try {
        n = qre(e.query);
      } catch {
      }
    }
    return Array.isArray(n) || (n = [n]), await this._commandService.executeCommand(e.path, ...n), !0;
  }
};
due = dme([
  T$(0, jr)
], due);
let hue = class {
  constructor(e) {
    this._editorService = e;
  }
  async open(e, t) {
    typeof e == "string" && (e = Ht.parse(e));
    const { selection: n, uri: r } = L0t(e);
    return e = r, e.scheme === Yt.file && (e = Nrt(e)), await this._editorService.openCodeEditor({
      resource: e,
      options: {
        selection: n,
        source: t != null && t.fromUserGesture ? L$.USER : L$.API,
        ...t == null ? void 0 : t.editorOptions
      }
    }, this._editorService.getFocusedCodeEditor(), t == null ? void 0 : t.openToSide), !0;
  }
};
hue = dme([
  T$(0, Ti)
], hue);
let fue = class {
  constructor(e, t) {
    this._openers = new xc(), this._validators = new xc(), this._resolvers = new xc(), this._resolvedUriTargets = new Co((n) => n.with({ path: null, fragment: null, query: null }).toString()), this._externalOpeners = new xc(), this._defaultExternalOpener = {
      openExternal: async (n) => (aie(n, Yt.http, Yt.https) ? OPe(n) : fr.location.href = n, !0)
    }, this._openers.push({
      open: async (n, r) => r != null && r.openExternal || aie(n, Yt.mailto, Yt.http, Yt.https, Yt.vsls) ? (await this._doOpenExternal(n, r), !0) : !1
    }), this._openers.push(new due(t)), this._openers.push(new hue(e));
  }
  registerOpener(e) {
    return { dispose: this._openers.unshift(e) };
  }
  async open(e, t) {
    if (!(t != null && t.skipValidation)) {
      const n = typeof e == "string" ? Ht.parse(e) : e, r = this._resolvedUriTargets.get(n) ?? e;
      for (const s of this._validators)
        if (!await s.shouldOpen(r, t))
          return !1;
    }
    for (const n of this._openers)
      if (await n.open(e, t))
        return !0;
    return !1;
  }
  async resolveExternalUri(e, t) {
    for (const n of this._resolvers)
      try {
        const r = await n.resolveExternalUri(e, t);
        if (r)
          return this._resolvedUriTargets.has(r.resolved) || this._resolvedUriTargets.set(r.resolved, e), r;
      } catch {
      }
    throw new Error("Could not resolve external URI: " + e.toString());
  }
  async _doOpenExternal(e, t) {
    const n = typeof e == "string" ? Ht.parse(e) : e;
    let r;
    try {
      r = (await this.resolveExternalUri(n, t)).resolved;
    } catch {
      r = n;
    }
    let s;
    if (typeof e == "string" && n.toString() === r.toString() ? s = e : s = encodeURI(r.toString(!0)), t != null && t.allowContributedOpeners) {
      const o = typeof (t == null ? void 0 : t.allowContributedOpeners) == "string" ? t == null ? void 0 : t.allowContributedOpeners : void 0;
      for (const a of this._externalOpeners)
        if (await a.openExternal(s, {
          sourceUri: n,
          preferredOpenerId: o
        }, $n.None))
          return !0;
    }
    return this._defaultExternalOpener.openExternal(s, { sourceUri: n }, $n.None);
  }
  dispose() {
    this._validators.clear();
  }
};
fue = dme([
  T$(0, Ti),
  T$(1, jr)
], fue);
var MOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, dRe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let gue = class extends ge {
  constructor(e, t) {
    super(), this._markerService = t, this._onDidChangeMarker = this._register(new he()), this._suppressedRanges = new Co(), this._markerDecorations = new Co(), e.getModels().forEach((n) => this._onModelAdded(n)), this._register(e.onModelAdded(this._onModelAdded, this)), this._register(e.onModelRemoved(this._onModelRemoved, this)), this._register(this._markerService.onMarkerChanged(this._handleMarkerChange, this));
  }
  dispose() {
    super.dispose(), this._markerDecorations.forEach((e) => e.dispose()), this._markerDecorations.clear();
  }
  getMarker(e, t) {
    const n = this._markerDecorations.get(e);
    return n && n.getMarker(t) || null;
  }
  _handleMarkerChange(e) {
    e.forEach((t) => {
      const n = this._markerDecorations.get(t);
      n && this._updateDecorations(n);
    });
  }
  _onModelAdded(e) {
    const t = new POt(e);
    this._markerDecorations.set(e.uri, t), this._updateDecorations(t);
  }
  _onModelRemoved(e) {
    var n;
    const t = this._markerDecorations.get(e.uri);
    t && (t.dispose(), this._markerDecorations.delete(e.uri)), (e.uri.scheme === Yt.inMemory || e.uri.scheme === Yt.internal || e.uri.scheme === Yt.vscode) && ((n = this._markerService) == null || n.read({ resource: e.uri }).map((r) => r.owner).forEach((r) => this._markerService.remove(r, [e.uri])));
  }
  _updateDecorations(e) {
    let t = this._markerService.read({ resource: e.model.uri, take: 500 });
    const n = this._suppressedRanges.get(e.model.uri);
    n && (t = t.filter((r) => !gi.some(n, (s) => z.areIntersectingOrTouching(s, r)))), e.update(t) && this._onDidChangeMarker.fire(e.model);
  }
};
gue = MOt([
  dRe(0, xs),
  dRe(1, Nb)
], gue);
class POt extends ge {
  constructor(e) {
    super(), this.model = e, this._map = new xrt(), this._register(Et(() => {
      this.model.deltaDecorations([...this._map.values()], []), this._map.clear();
    }));
  }
  update(e) {
    const { added: t, removed: n } = Bgt(new Set(this._map.keys()), new Set(e));
    if (t.length === 0 && n.length === 0)
      return !1;
    const r = n.map((a) => this._map.get(a)), s = t.map((a) => ({
      range: this._createDecorationRange(this.model, a),
      options: this._createDecorationOption(a)
    })), o = this.model.deltaDecorations(r, s);
    for (const a of n)
      this._map.delete(a);
    for (let a = 0; a < o.length; a++)
      this._map.set(t[a], o[a]);
    return !0;
  }
  getMarker(e) {
    return this._map.getKey(e.id);
  }
  _createDecorationRange(e, t) {
    let n = z.lift(t);
    if (t.severity === Os.Hint && !this._hasMarkerTag(
      t,
      1
      /* MarkerTag.Unnecessary */
    ) && !this._hasMarkerTag(
      t,
      2
      /* MarkerTag.Deprecated */
    ) && (n = n.setEndPosition(n.startLineNumber, n.startColumn + 2)), n = e.validateRange(n), n.isEmpty()) {
      const r = e.getLineLastNonWhitespaceColumn(n.startLineNumber) || e.getLineMaxColumn(n.startLineNumber);
      if (r === 1 || n.endColumn >= r)
        return n;
      const s = e.getWordAtPosition(n.getStartPosition());
      s && (n = new z(n.startLineNumber, s.startColumn, n.endLineNumber, s.endColumn));
    } else if (t.endColumn === Number.MAX_VALUE && t.startColumn === 1 && n.startLineNumber === n.endLineNumber) {
      const r = e.getLineFirstNonWhitespaceColumn(t.startLineNumber);
      r < n.endColumn && (n = new z(n.startLineNumber, r, n.endLineNumber, n.endColumn), t.startColumn = r);
    }
    return n;
  }
  _createDecorationOption(e) {
    let t, n, r, s, o;
    switch (e.severity) {
      case Os.Hint:
        this._hasMarkerTag(
          e,
          2
          /* MarkerTag.Deprecated */
        ) ? t = void 0 : this._hasMarkerTag(
          e,
          1
          /* MarkerTag.Unnecessary */
        ) ? t = "squiggly-unnecessary" : t = "squiggly-hint", r = 0;
        break;
      case Os.Info:
        t = "squiggly-info", n = Ks(zut), r = 10, o = {
          color: Ks(elt),
          position: 1
          /* MinimapPosition.Inline */
        };
        break;
      case Os.Warning:
        t = "squiggly-warning", n = Ks(Uut), r = 20, o = {
          color: Ks(tlt),
          position: 1
          /* MinimapPosition.Inline */
        };
        break;
      case Os.Error:
      default:
        t = "squiggly-error", n = Ks(Vut), r = 30, o = {
          color: Ks(nlt),
          position: 1
          /* MinimapPosition.Inline */
        };
        break;
    }
    return e.tags && (e.tags.indexOf(
      1
      /* MarkerTag.Unnecessary */
    ) !== -1 && (s = "squiggly-inline-unnecessary"), e.tags.indexOf(
      2
      /* MarkerTag.Deprecated */
    ) !== -1 && (s = "squiggly-inline-deprecated")), {
      description: "marker-decoration",
      stickiness: 1,
      className: t,
      showIfCollapsed: !0,
      overviewRuler: {
        color: n,
        position: zh.Right
      },
      minimap: o,
      zIndex: r,
      inlineClassName: s
    };
  }
  _hasMarkerTag(e, t) {
    return e.tags ? e.tags.indexOf(t) >= 0 : !1;
  }
}
var FOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, GH = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, YI;
function mE(i) {
  return i.toString();
}
class BOt {
  constructor(e, t, n) {
    this.model = e, this._modelEventListeners = new ke(), this.model = e, this._modelEventListeners.add(e.onWillDispose(() => t(e))), this._modelEventListeners.add(e.onDidChangeLanguage((r) => n(e, r)));
  }
  dispose() {
    this._modelEventListeners.dispose();
  }
}
const HOt = Qu || Kn ? 1 : 2;
class WOt {
  constructor(e, t, n, r, s, o, a, l) {
    this.uri = e, this.initialUndoRedoSnapshot = t, this.time = n, this.sharesUndoRedoStack = r, this.heapSize = s, this.sha1 = o, this.versionId = a, this.alternativeVersionId = l;
  }
}
var $L;
let pue = ($L = class extends ge {
  constructor(e, t, n, r) {
    super(), this._configurationService = e, this._resourcePropertiesService = t, this._undoRedoService = n, this._instantiationService = r, this._onModelAdded = this._register(new he()), this.onModelAdded = this._onModelAdded.event, this._onModelRemoved = this._register(new he()), this.onModelRemoved = this._onModelRemoved.event, this._onModelModeChanged = this._register(new he()), this.onModelLanguageChanged = this._onModelModeChanged.event, this._modelCreationOptionsByLanguageAndResource = /* @__PURE__ */ Object.create(null), this._models = {}, this._disposedModels = /* @__PURE__ */ new Map(), this._disposedModelsHeapSize = 0, this._register(this._configurationService.onDidChangeConfiguration((s) => this._updateModelOptions(s))), this._updateModelOptions(void 0);
  }
  static _readModelOptions(e, t) {
    var h;
    let n = Gl.tabSize;
    if (e.editor && typeof e.editor.tabSize < "u") {
      const g = parseInt(e.editor.tabSize, 10);
      isNaN(g) || (n = g), n < 1 && (n = 1);
    }
    let r = "tabSize";
    if (e.editor && typeof e.editor.indentSize < "u" && e.editor.indentSize !== "tabSize") {
      const g = parseInt(e.editor.indentSize, 10);
      isNaN(g) || (r = Math.max(g, 1));
    }
    let s = Gl.insertSpaces;
    e.editor && typeof e.editor.insertSpaces < "u" && (s = e.editor.insertSpaces === "false" ? !1 : !!e.editor.insertSpaces);
    let o = HOt;
    const a = e.eol;
    a === `\r
` ? o = 2 : a === `
` && (o = 1);
    let l = Gl.trimAutoWhitespace;
    e.editor && typeof e.editor.trimAutoWhitespace < "u" && (l = e.editor.trimAutoWhitespace === "false" ? !1 : !!e.editor.trimAutoWhitespace);
    let c = Gl.detectIndentation;
    e.editor && typeof e.editor.detectIndentation < "u" && (c = e.editor.detectIndentation === "false" ? !1 : !!e.editor.detectIndentation);
    let u = Gl.largeFileOptimizations;
    e.editor && typeof e.editor.largeFileOptimizations < "u" && (u = e.editor.largeFileOptimizations === "false" ? !1 : !!e.editor.largeFileOptimizations);
    let d = Gl.bracketPairColorizationOptions;
    return (h = e.editor) != null && h.bracketPairColorization && typeof e.editor.bracketPairColorization == "object" && (d = {
      enabled: !!e.editor.bracketPairColorization.enabled,
      independentColorPoolPerBracketType: !!e.editor.bracketPairColorization.independentColorPoolPerBracketType
    }), {
      isForSimpleWidget: t,
      tabSize: n,
      indentSize: r,
      insertSpaces: s,
      detectIndentation: c,
      defaultEOL: o,
      trimAutoWhitespace: l,
      largeFileOptimizations: u,
      bracketPairColorizationOptions: d
    };
  }
  _getEOL(e, t) {
    if (e)
      return this._resourcePropertiesService.getEOL(e, t);
    const n = this._configurationService.getValue("files.eol", { overrideIdentifier: t });
    return n && typeof n == "string" && n !== "auto" ? n : Ad === 3 || Ad === 2 ? `
` : `\r
`;
  }
  _shouldRestoreUndoStack() {
    const e = this._configurationService.getValue("files.restoreUndoStack");
    return typeof e == "boolean" ? e : !0;
  }
  getCreationOptions(e, t, n) {
    const r = typeof e == "string" ? e : e.languageId;
    let s = this._modelCreationOptionsByLanguageAndResource[r + t];
    if (!s) {
      const o = this._configurationService.getValue("editor", { overrideIdentifier: r, resource: t }), a = this._getEOL(t, r);
      s = YI._readModelOptions({ editor: o, eol: a }, n), this._modelCreationOptionsByLanguageAndResource[r + t] = s;
    }
    return s;
  }
  _updateModelOptions(e) {
    const t = this._modelCreationOptionsByLanguageAndResource;
    this._modelCreationOptionsByLanguageAndResource = /* @__PURE__ */ Object.create(null);
    const n = Object.keys(this._models);
    for (let r = 0, s = n.length; r < s; r++) {
      const o = n[r], a = this._models[o], l = a.model.getLanguageId(), c = a.model.uri;
      if (e && !e.affectsConfiguration("editor", { overrideIdentifier: l, resource: c }) && !e.affectsConfiguration("files.eol", { overrideIdentifier: l, resource: c }))
        continue;
      const u = t[l + c], d = this.getCreationOptions(l, c, a.model.isForSimpleWidget);
      YI._setModelOptionsForModel(a.model, d, u);
    }
  }
  static _setModelOptionsForModel(e, t, n) {
    n && n.defaultEOL !== t.defaultEOL && e.getLineCount() === 1 && e.setEOL(
      t.defaultEOL === 1 ? 0 : 1
      /* EndOfLineSequence.CRLF */
    ), !(n && n.detectIndentation === t.detectIndentation && n.insertSpaces === t.insertSpaces && n.tabSize === t.tabSize && n.indentSize === t.indentSize && n.trimAutoWhitespace === t.trimAutoWhitespace && Wd(n.bracketPairColorizationOptions, t.bracketPairColorizationOptions)) && (t.detectIndentation ? (e.detectIndentation(t.insertSpaces, t.tabSize), e.updateOptions({
      trimAutoWhitespace: t.trimAutoWhitespace,
      bracketColorizationOptions: t.bracketPairColorizationOptions
    })) : e.updateOptions({
      insertSpaces: t.insertSpaces,
      tabSize: t.tabSize,
      indentSize: t.indentSize,
      trimAutoWhitespace: t.trimAutoWhitespace,
      bracketColorizationOptions: t.bracketPairColorizationOptions
    }));
  }
  // --- begin IModelService
  _insertDisposedModel(e) {
    this._disposedModels.set(mE(e.uri), e), this._disposedModelsHeapSize += e.heapSize;
  }
  _removeDisposedModel(e) {
    const t = this._disposedModels.get(mE(e));
    return t && (this._disposedModelsHeapSize -= t.heapSize), this._disposedModels.delete(mE(e)), t;
  }
  _ensureDisposedModelsHeapSize(e) {
    if (this._disposedModelsHeapSize > e) {
      const t = [];
      for (this._disposedModels.forEach((n) => {
        n.sharesUndoRedoStack || t.push(n);
      }), t.sort((n, r) => n.time - r.time); t.length > 0 && this._disposedModelsHeapSize > e; ) {
        const n = t.shift();
        this._removeDisposedModel(n.uri), n.initialUndoRedoSnapshot !== null && this._undoRedoService.restoreSnapshot(n.initialUndoRedoSnapshot);
      }
    }
  }
  _createModelData(e, t, n, r) {
    const s = this.getCreationOptions(t, n, r), o = this._instantiationService.createInstance(cT, e, t, s, n);
    if (n && this._disposedModels.has(mE(n))) {
      const c = this._removeDisposedModel(n), u = this._undoRedoService.getElements(n), d = this._getSHA1Computer(), h = d.canComputeSHA1(o) ? d.computeSHA1(o) === c.sha1 : !1;
      if (h || c.sharesUndoRedoStack) {
        for (const g of u.past)
          ay(g) && g.matchesResource(n) && g.setModel(o);
        for (const g of u.future)
          ay(g) && g.matchesResource(n) && g.setModel(o);
        this._undoRedoService.setElementsValidFlag(n, !0, (g) => ay(g) && g.matchesResource(n)), h && (o._overwriteVersionId(c.versionId), o._overwriteAlternativeVersionId(c.alternativeVersionId), o._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot));
      } else
        c.initialUndoRedoSnapshot !== null && this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot);
    }
    const a = mE(o.uri);
    if (this._models[a])
      throw new Error("ModelService: Cannot add model because it already exists!");
    const l = new BOt(o, (c) => this._onWillDispose(c), (c, u) => this._onDidChangeLanguage(c, u));
    return this._models[a] = l, l;
  }
  createModel(e, t, n, r = !1) {
    let s;
    return t ? s = this._createModelData(e, t, n, r) : s = this._createModelData(e, $h, n, r), this._onModelAdded.fire(s.model), s.model;
  }
  getModels() {
    const e = [], t = Object.keys(this._models);
    for (let n = 0, r = t.length; n < r; n++) {
      const s = t[n];
      e.push(this._models[s].model);
    }
    return e;
  }
  getModel(e) {
    const t = mE(e), n = this._models[t];
    return n ? n.model : null;
  }
  // --- end IModelService
  _schemaShouldMaintainUndoRedoElements(e) {
    return e.scheme === Yt.file || e.scheme === Yt.vscodeRemote || e.scheme === Yt.vscodeUserData || e.scheme === Yt.vscodeNotebookCell || e.scheme === "fake-fs";
  }
  _onWillDispose(e) {
    const t = mE(e.uri), n = this._models[t], r = this._undoRedoService.getUriComparisonKey(e.uri) !== e.uri.toString();
    let s = !1, o = 0;
    if (r || this._shouldRestoreUndoStack() && this._schemaShouldMaintainUndoRedoElements(e.uri)) {
      const c = this._undoRedoService.getElements(e.uri);
      if (c.past.length > 0 || c.future.length > 0) {
        for (const u of c.past)
          ay(u) && u.matchesResource(e.uri) && (s = !0, o += u.heapSize(e.uri), u.setModel(e.uri));
        for (const u of c.future)
          ay(u) && u.matchesResource(e.uri) && (s = !0, o += u.heapSize(e.uri), u.setModel(e.uri));
      }
    }
    const a = YI.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK, l = this._getSHA1Computer();
    if (s)
      if (!r && (o > a || !l.canComputeSHA1(e))) {
        const c = n.model.getInitialUndoRedoSnapshot();
        c !== null && this._undoRedoService.restoreSnapshot(c);
      } else
        this._ensureDisposedModelsHeapSize(a - o), this._undoRedoService.setElementsValidFlag(e.uri, !1, (c) => ay(c) && c.matchesResource(e.uri)), this._insertDisposedModel(new WOt(e.uri, n.model.getInitialUndoRedoSnapshot(), Date.now(), r, o, l.computeSHA1(e), e.getVersionId(), e.getAlternativeVersionId()));
    else if (!r) {
      const c = n.model.getInitialUndoRedoSnapshot();
      c !== null && this._undoRedoService.restoreSnapshot(c);
    }
    delete this._models[t], n.dispose(), delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId() + e.uri], this._onModelRemoved.fire(e);
  }
  _onDidChangeLanguage(e, t) {
    const n = t.oldLanguage, r = e.getLanguageId(), s = this.getCreationOptions(n, e.uri, e.isForSimpleWidget), o = this.getCreationOptions(r, e.uri, e.isForSimpleWidget);
    YI._setModelOptionsForModel(e, o, s), this._onModelModeChanged.fire({ model: e, oldLanguageId: n });
  }
  _getSHA1Computer() {
    return new mue();
  }
}, YI = $L, $L.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK = 20 * 1024 * 1024, $L);
pue = YI = FOt([
  GH(0, xn),
  GH(1, A8e),
  GH(2, ige),
  GH(3, xt)
], pue);
const iq = class iq {
  // takes 200ms to compute a sha1 on a 10MB model on a new machine
  canComputeSHA1(e) {
    return e.getValueLength() <= iq.MAX_MODEL_SIZE;
  }
  computeSHA1(e) {
    const t = new uie(), n = e.createSnapshot();
    let r;
    for (; r = n.read(); )
      t.update(r);
    return t.digest();
  }
};
iq.MAX_MODEL_SIZE = 10 * 1024 * 1024;
let mue = iq;
var VOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, hRe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let _ue = class extends ge {
  constructor(e, t) {
    super(), this.quickInputService = e, this.instantiationService = t, this.registry = Fs.as(ak.Quickaccess), this.mapProviderToDescriptor = /* @__PURE__ */ new Map(), this.lastAcceptedPickerValues = /* @__PURE__ */ new Map(), this.visibleQuickAccess = void 0, this._register(Et(() => {
      var n;
      for (const r of this.mapProviderToDescriptor.values())
        UT(r) && r.dispose();
      (n = this.visibleQuickAccess) == null || n.picker.dispose();
    }));
  }
  show(e = "", t) {
    this.doShowOrPick(e, !1, t);
  }
  doShowOrPick(e, t, n) {
    var m, _;
    const [r, s] = this.getOrInstantiateProvider(e, n == null ? void 0 : n.enabledProviderPrefixes), o = this.visibleQuickAccess, a = o == null ? void 0 : o.descriptor;
    if (o && s && a === s) {
      e !== s.prefix && !(n != null && n.preserveValue) && (o.picker.value = e), this.adjustValueSelection(o.picker, s, n);
      return;
    }
    if (s && !(n != null && n.preserveValue)) {
      let v;
      if (o && a && a !== s) {
        const w = o.value.substr(a.prefix.length);
        w && (v = `${s.prefix}${w}`);
      }
      if (!v) {
        const w = r == null ? void 0 : r.defaultFilterValue;
        w === Wle.LAST ? v = this.lastAcceptedPickerValues.get(s) : typeof w == "string" && (v = `${s.prefix}${w}`);
      }
      typeof v == "string" && (e = v);
    }
    const l = (m = o == null ? void 0 : o.picker) == null ? void 0 : m.valueSelection, c = (_ = o == null ? void 0 : o.picker) == null ? void 0 : _.value, u = new ke(), d = u.add(this.quickInputService.createQuickPick({ useSeparators: !0 }));
    d.value = e, this.adjustValueSelection(d, s, n), d.placeholder = (n == null ? void 0 : n.placeholder) ?? (s == null ? void 0 : s.placeholder), d.quickNavigate = n == null ? void 0 : n.quickNavigateConfiguration, d.hideInput = !!d.quickNavigate && !o, (typeof (n == null ? void 0 : n.itemActivation) == "number" || n != null && n.quickNavigateConfiguration) && (d.itemActivation = (n == null ? void 0 : n.itemActivation) ?? Bp.SECOND), d.contextKey = s == null ? void 0 : s.contextKey, d.filterValue = (v) => v.substring(s ? s.prefix.length : 0);
    let h;
    t && (h = new zT(), u.add(Ze.once(d.onWillAccept)((v) => {
      v.veto(), d.hide();
    }))), u.add(this.registerPickerListeners(d, r, s, e, n));
    const g = u.add(new Ss());
    if (r && u.add(r.provide(d, g.token, n == null ? void 0 : n.providerOptions)), Ze.once(d.onDidHide)(() => {
      d.selectedItems.length === 0 && g.cancel(), u.dispose(), h == null || h.complete(d.selectedItems.slice(0));
    }), d.show(), l && c === e && (d.valueSelection = l), t)
      return h == null ? void 0 : h.p;
  }
  adjustValueSelection(e, t, n) {
    let r;
    n != null && n.preserveValue ? r = [e.value.length, e.value.length] : r = [(t == null ? void 0 : t.prefix.length) ?? 0, e.value.length], e.valueSelection = r;
  }
  registerPickerListeners(e, t, n, r, s) {
    const o = new ke(), a = this.visibleQuickAccess = { picker: e, descriptor: n, value: r };
    return o.add(Et(() => {
      a === this.visibleQuickAccess && (this.visibleQuickAccess = void 0);
    })), o.add(e.onDidChangeValue((l) => {
      const [c] = this.getOrInstantiateProvider(l, s == null ? void 0 : s.enabledProviderPrefixes);
      c !== t ? this.show(l, {
        enabledProviderPrefixes: s == null ? void 0 : s.enabledProviderPrefixes,
        // do not rewrite value from user typing!
        preserveValue: !0,
        // persist the value of the providerOptions from the original showing
        providerOptions: s == null ? void 0 : s.providerOptions
      }) : a.value = l;
    })), n && o.add(e.onDidAccept(() => {
      this.lastAcceptedPickerValues.set(n, e.value);
    })), o;
  }
  getOrInstantiateProvider(e, t) {
    const n = this.registry.getQuickAccessProvider(e);
    if (!n || t && !(t != null && t.includes(n.prefix)))
      return [void 0, void 0];
    let r = this.mapProviderToDescriptor.get(n);
    return r || (r = this.instantiationService.createInstance(n.ctor), this.mapProviderToDescriptor.set(n, r)), [r, n];
  }
};
_ue = VOt([
  hRe(0, tc),
  hRe(1, xt)
], _ue);
var UOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
};
class I9e {
  constructor(e) {
    this.nodes = e;
  }
  toString() {
    return this.nodes.map((e) => typeof e == "string" ? e : e.label).join("");
  }
}
UOt([
  go
], I9e.prototype, "toString", null);
const zOt = /\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;
function $Ot(i) {
  const e = [];
  let t = 0, n;
  for (; n = zOt.exec(i); ) {
    n.index - t > 0 && e.push(i.substring(t, n.index));
    const [, r, s, , o] = n;
    o ? e.push({ label: r, href: s, title: o }) : e.push({ label: r, href: s }), t = n.index + n[0].length;
  }
  return t < i.length && e.push(i.substring(t)), new I9e(e);
}
const zte = {}, jOt = new pge("quick-input-button-icon-");
function GOt(i) {
  if (!i)
    return;
  let e;
  const t = i.dark.toString();
  return zte[t] ? e = zte[t] : (e = jOt.nextId(), JV(`.${e}, .hc-light .${e}`, `background-image: ${mb(i.light || i.dark)}`), JV(`.vs-dark .${e}, .hc-black .${e}`, `background-image: ${mb(i.dark)}`), zte[t] = e), e;
}
function pR(i, e, t) {
  let n = i.iconClass || GOt(i.iconPath);
  return i.alwaysVisible && (n = n ? `${n} always-visible` : "always-visible"), {
    id: e,
    label: "",
    tooltip: i.tooltip || "",
    class: n,
    enabled: !0,
    run: t
  };
}
function qOt(i, e, t) {
  ma(e);
  const n = $Ot(i);
  let r = 0;
  for (const s of n.nodes)
    if (typeof s == "string")
      e.append(...D1(s));
    else {
      let o = s.title;
      !o && s.href.startsWith("command:") ? o = S(1754, "Click to execute command '{0}'", s.href.substring(8)) : o || (o = s.href);
      const a = Ge("a", { href: s.href, title: o, tabIndex: r++ }, s.label);
      a.style.textDecoration = "underline";
      const l = (g) => {
        Wit(g) && Mi.stop(g, !0), t.callback(s.href);
      }, c = t.disposables.add(new ir(a, Xe.CLICK)).event, u = t.disposables.add(new ir(a, Xe.KEY_DOWN)).event, d = Ze.chain(u, (g) => g.filter((m) => {
        const _ = new wr(m);
        return _.equals(
          10
          /* KeyCode.Space */
        ) || _.equals(
          3
          /* KeyCode.Enter */
        );
      }));
      t.disposables.add(ec.addTarget(a));
      const h = t.disposables.add(new ir(a, zr.Tap)).event;
      Ze.any(c, h, d)(l, null, t.disposables), e.appendChild(a);
    }
}
var KOt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, fRe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const N9e = "inQuickInput", YOt = new ut(N9e, !1, S(1731, "Whether keyboard focus is inside the quick input control")), YK = Re.has(N9e), XOt = "quickInputAlignment", ZOt = new ut(XOt, "top", S(1732, "The alignment of the quick input")), M5 = "quickInputType", QOt = new ut(M5, void 0, S(1733, "The type of the currently visible quick input")), R9e = "cursorAtEndOfQuickInputBox", JOt = new ut(R9e, !1, S(1734, "Whether the cursor in the quick input is at the end of the input box")), eMt = Re.has(R9e), bue = {
  iconClass: qt.asClassName(Pe.quickInputBack),
  tooltip: S(1735, "Back")
}, rq = class rq extends ge {
  constructor(e) {
    super(), this.ui = e, this._visible = Qt("visible", !1), this._widgetUpdated = !1, this._enabled = !0, this._busy = !1, this._ignoreFocusOut = !1, this._leftButtons = [], this._rightButtons = [], this._inlineButtons = [], this.buttonsUpdated = !1, this._toggles = [], this.togglesUpdated = !1, this.noValidationMessage = rq.noPromptMessage, this._severity = Rs.Ignore, this.onDidTriggerButtonEmitter = this._register(new he()), this.onDidHideEmitter = this._register(new he()), this.onWillHideEmitter = this._register(new he()), this.onDisposeEmitter = this._register(new he()), this.visibleDisposables = this._register(new ke()), this.onDidHide = this.onDidHideEmitter.event;
  }
  get visible() {
    return this._visible.get();
  }
  get title() {
    return this._title;
  }
  set title(e) {
    this._title = e, this.update();
  }
  get description() {
    return this._description;
  }
  set description(e) {
    this._description = e, this.update();
  }
  get step() {
    return this._steps;
  }
  set step(e) {
    this._steps = e, this.update();
  }
  get totalSteps() {
    return this._totalSteps;
  }
  set totalSteps(e) {
    this._totalSteps = e, this.update();
  }
  get enabled() {
    return this._enabled;
  }
  set enabled(e) {
    this._enabled = e, this.update();
  }
  get contextKey() {
    return this._contextKey;
  }
  set contextKey(e) {
    this._contextKey = e, this.update();
  }
  get busy() {
    return this._busy;
  }
  set busy(e) {
    this._busy = e, this.update();
  }
  get ignoreFocusOut() {
    return this._ignoreFocusOut;
  }
  set ignoreFocusOut(e) {
    const t = this._ignoreFocusOut !== e && !jf;
    this._ignoreFocusOut = e && !jf, t && this.update();
  }
  get titleButtons() {
    return this._leftButtons.length ? [...this._leftButtons, this._rightButtons] : this._rightButtons;
  }
  get buttons() {
    return [
      ...this._leftButtons,
      ...this._rightButtons,
      ...this._inlineButtons
    ];
  }
  set buttons(e) {
    this._leftButtons = e.filter((t) => t === bue), this._rightButtons = e.filter((t) => t !== bue && t.location !== KU.Inline), this._inlineButtons = e.filter((t) => t.location === KU.Inline), this.buttonsUpdated = !0, this.update();
  }
  get toggles() {
    return this._toggles;
  }
  set toggles(e) {
    this._toggles = e ?? [], this.togglesUpdated = !0, this.update();
  }
  get validationMessage() {
    return this._validationMessage;
  }
  set validationMessage(e) {
    this._validationMessage = e, this.update();
  }
  get severity() {
    return this._severity;
  }
  set severity(e) {
    this._severity = e, this.update();
  }
  show() {
    this.visible || (this.visibleDisposables.add(this.ui.onDidTriggerButton((e) => {
      this.buttons.indexOf(e) !== -1 && this.onDidTriggerButtonEmitter.fire(e);
    })), this.ui.show(this), this._visible.set(!0, void 0), this._lastValidationMessage = void 0, this._lastSeverity = void 0, this.buttons.length && (this.buttonsUpdated = !0), this.toggles.length && (this.togglesUpdated = !0), this.update());
  }
  hide() {
    this.visible && this.ui.hide();
  }
  didHide(e = Y4.Other) {
    this._visible.set(!1, void 0), this.visibleDisposables.clear(), this.onDidHideEmitter.fire({ reason: e });
  }
  willHide(e = Y4.Other) {
    this.onWillHideEmitter.fire({ reason: e });
  }
  update() {
    var r;
    if (!this.visible)
      return;
    const e = this.getTitle();
    e && this.ui.title.textContent !== e ? this.ui.title.textContent = e : !e && this.ui.title.innerHTML !== "&nbsp;" && (this.ui.title.innerText = " ");
    const t = this.getDescription();
    if (this.ui.description1.textContent !== t && (this.ui.description1.textContent = t), this.ui.description2.textContent !== t && (this.ui.description2.textContent = t), this._widgetUpdated && (this._widgetUpdated = !1, this._widget ? ma(this.ui.widget, this._widget) : ma(this.ui.widget)), this.busy && !this.busyDelay && (this.busyDelay = new Gh(), this.busyDelay.setIfNotSet(() => {
      this.visible && this.ui.progressBar.infinite();
    }, 800)), !this.busy && this.busyDelay && (this.ui.progressBar.stop(), this.busyDelay.cancel(), this.busyDelay = void 0), this.buttonsUpdated) {
      this.buttonsUpdated = !1, this.ui.leftActionBar.clear();
      const s = this._leftButtons.map((l, c) => pR(l, `id-${c}`, async () => this.onDidTriggerButtonEmitter.fire(l)));
      this.ui.leftActionBar.push(s, { icon: !0, label: !1 }), this.ui.rightActionBar.clear();
      const o = this._rightButtons.map((l, c) => pR(l, `id-${c}`, async () => this.onDidTriggerButtonEmitter.fire(l)));
      this.ui.rightActionBar.push(o, { icon: !0, label: !1 }), this.ui.inlineActionBar.clear();
      const a = this._inlineButtons.map((l, c) => pR(l, `id-${c}`, async () => this.onDidTriggerButtonEmitter.fire(l)));
      this.ui.inlineActionBar.push(a, { icon: !0, label: !1 });
    }
    if (this.togglesUpdated) {
      this.togglesUpdated = !1;
      const s = ((r = this.toggles) == null ? void 0 : r.filter((o) => o instanceof kw)) ?? [];
      this.ui.inputBox.toggles = s;
    }
    this.ui.ignoreFocusOut = this.ignoreFocusOut, this.ui.setEnabled(this.enabled), this.ui.setContextKey(this.contextKey);
    const n = this.validationMessage || this.noValidationMessage;
    this._lastValidationMessage !== n && (this._lastValidationMessage = n, ma(this.ui.message), qOt(n, this.ui.message, {
      callback: (s) => {
        this.ui.linkOpenerDelegate(s);
      },
      disposables: this.visibleDisposables
    })), this._lastSeverity !== this.severity && (this._lastSeverity = this.severity, this.showMessageDecoration(this.severity));
  }
  getTitle() {
    return this.title && this.step ? `${this.title} (${this.getSteps()})` : this.title ? this.title : this.step ? this.getSteps() : "";
  }
  getDescription() {
    return this.description || "";
  }
  getSteps() {
    return this.step && this.totalSteps ? S(1737, "{0}/{1}", this.step, this.totalSteps) : this.step ? String(this.step) : "";
  }
  showMessageDecoration(e) {
    if (this.ui.inputBox.showDecoration(e), e !== Rs.Ignore) {
      const t = this.ui.inputBox.stylesForType(e);
      this.ui.message.style.color = t.foreground ? `${t.foreground}` : "", this.ui.message.style.backgroundColor = t.background ? `${t.background}` : "", this.ui.message.style.border = t.border ? `1px solid ${t.border}` : "", this.ui.message.style.marginBottom = "-2px";
    } else
      this.ui.message.style.color = "", this.ui.message.style.backgroundColor = "", this.ui.message.style.border = "", this.ui.message.style.marginBottom = "";
  }
  dispose() {
    this.hide(), this.onDisposeEmitter.fire(), super.dispose();
  }
};
rq.noPromptMessage = S(1736, "Press 'Enter' to confirm your input or 'Escape' to cancel");
let P5 = rq;
const sq = class sq extends P5 {
  constructor() {
    super(...arguments), this._value = "", this.onDidChangeValueEmitter = this._register(new he()), this.onWillAcceptEmitter = this._register(new he()), this.onDidAcceptEmitter = this._register(new he()), this.onDidCustomEmitter = this._register(new he()), this._items = [], this.itemsUpdated = !1, this._canSelectMany = !1, this._canAcceptInBackground = !1, this._matchOnDescription = !1, this._matchOnDetail = !1, this._matchOnLabel = !0, this._matchOnLabelMode = "fuzzy", this._sortByLabel = !0, this._keepScrollPosition = !1, this._itemActivation = Bp.FIRST, this._activeItems = [], this.activeItemsUpdated = !1, this.activeItemsToConfirm = [], this.onDidChangeActiveEmitter = this._register(new he()), this._selectedItems = [], this.selectedItemsUpdated = !1, this.selectedItemsToConfirm = [], this.onDidChangeSelectionEmitter = this._register(new he()), this.onDidTriggerItemButtonEmitter = this._register(new he()), this.onDidTriggerSeparatorButtonEmitter = this._register(new he()), this.valueSelectionUpdated = !0, this._ok = "default", this._customButton = !1, this._focusEventBufferer = new gB(), this.type = "quickPick", this.filterValue = (e) => e, this.onDidChangeValue = this.onDidChangeValueEmitter.event, this.onWillAccept = this.onWillAcceptEmitter.event, this.onDidAccept = this.onDidAcceptEmitter.event, this.onDidChangeActive = this.onDidChangeActiveEmitter.event, this.onDidChangeSelection = this.onDidChangeSelectionEmitter.event, this.onDidTriggerItemButton = this.onDidTriggerItemButtonEmitter.event, this.onDidTriggerSeparatorButton = this.onDidTriggerSeparatorButtonEmitter.event;
  }
  get quickNavigate() {
    return this._quickNavigate;
  }
  set quickNavigate(e) {
    this._quickNavigate = e, this.update();
  }
  get value() {
    return this._value;
  }
  set value(e) {
    this.doSetValue(e);
  }
  doSetValue(e, t) {
    this._value !== e && (this._value = e, t || this.update(), this.visible && this.ui.list.filter(this.filterValue(this._value)) && this.trySelectFirst(), this.onDidChangeValueEmitter.fire(this._value));
  }
  set ariaLabel(e) {
    this._ariaLabel = e, this.update();
  }
  get ariaLabel() {
    return this._ariaLabel;
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e) {
    this._placeholder = e, this.update();
  }
  get items() {
    return this._items;
  }
  get scrollTop() {
    return this.ui.list.scrollTop;
  }
  set scrollTop(e) {
    this.ui.list.scrollTop = e;
  }
  set items(e) {
    this._items = e, this.itemsUpdated = !0, this.update();
  }
  get canSelectMany() {
    return this._canSelectMany;
  }
  set canSelectMany(e) {
    this._canSelectMany = e, this.update();
  }
  get canAcceptInBackground() {
    return this._canAcceptInBackground;
  }
  set canAcceptInBackground(e) {
    this._canAcceptInBackground = e;
  }
  get matchOnDescription() {
    return this._matchOnDescription;
  }
  set matchOnDescription(e) {
    this._matchOnDescription = e, this.update();
  }
  get matchOnDetail() {
    return this._matchOnDetail;
  }
  set matchOnDetail(e) {
    this._matchOnDetail = e, this.update();
  }
  get matchOnLabel() {
    return this._matchOnLabel;
  }
  set matchOnLabel(e) {
    this._matchOnLabel = e, this.update();
  }
  get matchOnLabelMode() {
    return this._matchOnLabelMode;
  }
  set matchOnLabelMode(e) {
    this._matchOnLabelMode = e, this.update();
  }
  get sortByLabel() {
    return this._sortByLabel;
  }
  set sortByLabel(e) {
    this._sortByLabel = e, this.update();
  }
  get keepScrollPosition() {
    return this._keepScrollPosition;
  }
  set keepScrollPosition(e) {
    this._keepScrollPosition = e;
  }
  get itemActivation() {
    return this._itemActivation;
  }
  set itemActivation(e) {
    this._itemActivation = e;
  }
  get activeItems() {
    return this._activeItems;
  }
  set activeItems(e) {
    this._activeItems = e, this.activeItemsUpdated = !0, this.update();
  }
  get selectedItems() {
    return this._selectedItems;
  }
  set selectedItems(e) {
    this._selectedItems = e, this.selectedItemsUpdated = !0, this.update();
  }
  get keyMods() {
    return this._quickNavigate ? m0t : this.ui.keyMods;
  }
  get valueSelection() {
    const e = this.ui.inputBox.getSelection();
    if (e)
      return [e.start, e.end];
  }
  set valueSelection(e) {
    this._valueSelection = e, this.valueSelectionUpdated = !0, this.update();
  }
  get customButton() {
    return this._customButton;
  }
  set customButton(e) {
    this._customButton = e, this.update();
  }
  get customLabel() {
    return this._customButtonLabel;
  }
  set customLabel(e) {
    this._customButtonLabel = e, this.update();
  }
  get customHover() {
    return this._customButtonHover;
  }
  set customHover(e) {
    this._customButtonHover = e, this.update();
  }
  get ok() {
    return this._ok;
  }
  set ok(e) {
    this._ok = e, this.update();
  }
  get okLabel() {
    return this._okLabel ?? S(1739, "OK");
  }
  set okLabel(e) {
    this._okLabel = e, this.update();
  }
  get hideInput() {
    return !!this._hideInput;
  }
  set hideInput(e) {
    this._hideInput = e, this.update();
  }
  trySelectFirst() {
    this.canSelectMany || this.ui.list.focus(Yr.First);
  }
  show() {
    this.visible || (this.visibleDisposables.add(this.ui.inputBox.onDidChange((e) => {
      this.doSetValue(
        e,
        !0
        /* skip update since this originates from the UI */
      );
    })), this.visibleDisposables.add(this.ui.onDidAccept(() => {
      this.canSelectMany ? this.ui.list.getCheckedElements().length || (this._selectedItems = [], this.onDidChangeSelectionEmitter.fire(this.selectedItems)) : this.activeItems[0] && (this._selectedItems = [this.activeItems[0]], this.onDidChangeSelectionEmitter.fire(this.selectedItems)), this.handleAccept(!1);
    })), this.visibleDisposables.add(this.ui.onDidCustom(() => {
      this.onDidCustomEmitter.fire();
    })), this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(
      this.ui.list.onDidChangeFocus,
      // Only fire the last event
      (e, t) => t
    )((e) => {
      this.activeItemsUpdated || this.activeItemsToConfirm !== this._activeItems && ds(e, this._activeItems, (t, n) => t === n) || (this._activeItems = e, this.onDidChangeActiveEmitter.fire(e));
    })), this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({ items: e, event: t }) => {
      if (this.canSelectMany && !e.some((n) => n.pickable === !1)) {
        e.length && this.ui.list.setSelectedElements([]);
        return;
      }
      this.selectedItemsToConfirm !== this._selectedItems && ds(e, this._selectedItems, (n, r) => n === r) || (this._selectedItems = e, this.onDidChangeSelectionEmitter.fire(e), e.length && this.handleAccept(
        Jhe(t) && t.button === 1
        /* mouse middle click */
      ));
    })), this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e) => {
      !this.canSelectMany || !this.visible || this.selectedItemsToConfirm !== this._selectedItems && ds(e, this._selectedItems, (t, n) => t === n) || (this._selectedItems = e, this.onDidChangeSelectionEmitter.fire(e));
    })), this.visibleDisposables.add(this.ui.list.onButtonTriggered((e) => this.onDidTriggerItemButtonEmitter.fire(e))), this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered((e) => this.onDidTriggerSeparatorButtonEmitter.fire(e))), this.visibleDisposables.add(this.registerQuickNavigation()), this.valueSelectionUpdated = !0), super.show();
  }
  handleAccept(e) {
    let t = !1;
    this.onWillAcceptEmitter.fire({ veto: () => t = !0 }), t || this.onDidAcceptEmitter.fire({ inBackground: e });
  }
  registerQuickNavigation() {
    return Ce(this.ui.container, Xe.KEY_UP, (e) => {
      if (this.canSelectMany || !this._quickNavigate)
        return;
      const t = new wr(e), n = t.keyCode;
      this._quickNavigate.keybindings.some((o) => {
        const a = o.getChords();
        return a.length > 1 ? !1 : a[0].shiftKey && n === 4 ? !(t.ctrlKey || t.altKey || t.metaKey) : !!(a[0].altKey && n === 6 || a[0].ctrlKey && n === 5 || a[0].metaKey && n === 57);
      }) && (this.activeItems[0] && (this._selectedItems = [this.activeItems[0]], this.onDidChangeSelectionEmitter.fire(this.selectedItems), this.handleAccept(!1)), this._quickNavigate = void 0);
    });
  }
  update() {
    if (!this.visible)
      return;
    const e = this.keepScrollPosition ? this.scrollTop : 0, t = !!this.description, n = {
      title: !!this.title || !!this.step || !!this.titleButtons.length,
      description: t,
      checkAll: this.canSelectMany && !this._hideCheckAll,
      checkBox: this.canSelectMany,
      inputBox: !this._hideInput,
      progressBar: !this._hideInput || t,
      visibleCount: !0,
      count: this.canSelectMany && !this._hideCountBadge,
      ok: this.ok === "default" ? this.canSelectMany : this.ok,
      list: !0,
      message: !!this.validationMessage,
      customButton: this.customButton
    };
    this.ui.setVisibilities(n), super.update(), this.ui.inputBox.value !== this.value && (this.ui.inputBox.value = this.value), this.valueSelectionUpdated && (this.valueSelectionUpdated = !1, this.ui.inputBox.select(this._valueSelection && { start: this._valueSelection[0], end: this._valueSelection[1] })), this.ui.inputBox.placeholder !== (this.placeholder || "") && (this.ui.inputBox.placeholder = this.placeholder || "");
    let r = this.ariaLabel;
    !r && n.inputBox && (r = this.placeholder, this.title && (r = r ? `${r} - ${this.title}` : this.title), r || (r = sq.DEFAULT_ARIA_LABEL)), this.ui.list.ariaLabel !== r && (this.ui.list.ariaLabel = r ?? null), this.ui.inputBox.ariaLabel !== r && (this.ui.inputBox.ariaLabel = r ?? "input"), this.ui.list.matchOnDescription = this.matchOnDescription, this.ui.list.matchOnDetail = this.matchOnDetail, this.ui.list.matchOnLabel = this.matchOnLabel, this.ui.list.matchOnLabelMode = this.matchOnLabelMode, this.ui.list.sortByLabel = this.sortByLabel, this.itemsUpdated && (this.itemsUpdated = !1, this._focusEventBufferer.bufferEvents(() => {
      switch (this.ui.list.setElements(this.items), this.ui.list.shouldLoop = !this.canSelectMany, this.ui.list.filter(this.filterValue(this.ui.inputBox.value)), this._itemActivation) {
        case Bp.NONE:
          this._itemActivation = Bp.FIRST;
          break;
        case Bp.SECOND:
          this.ui.list.focus(Yr.Second), this._itemActivation = Bp.FIRST;
          break;
        case Bp.LAST:
          this.ui.list.focus(Yr.Last), this._itemActivation = Bp.FIRST;
          break;
        default:
          this.trySelectFirst();
          break;
      }
    })), this.ui.container.classList.contains("show-checkboxes") !== !!this.canSelectMany && (this.canSelectMany ? this.ui.list.clearFocus() : this.trySelectFirst()), this.activeItemsUpdated && (this.activeItemsUpdated = !1, this.activeItemsToConfirm = this._activeItems, this.ui.list.setFocusedElements(this.activeItems), this.activeItemsToConfirm === this._activeItems && (this.activeItemsToConfirm = null)), this.selectedItemsUpdated && (this.selectedItemsUpdated = !1, this.selectedItemsToConfirm = this._selectedItems, this.canSelectMany ? this.ui.list.setCheckedElements(this.selectedItems) : this.ui.list.setSelectedElements(this.selectedItems), this.selectedItemsToConfirm === this._selectedItems && (this.selectedItemsToConfirm = null)), this.ui.ok.label = this.okLabel || "", this.ui.customButton.label = this.customLabel || "", this.ui.customButton.element.title = this.customHover || "", n.inputBox || (this.ui.list.domFocus(), this.canSelectMany && this.ui.list.focus(Yr.First)), this.keepScrollPosition && (this.scrollTop = e);
  }
  focus(e) {
    this.ui.list.focus(e), this.canSelectMany && this.ui.list.domFocus();
  }
  accept(e) {
    e && !this._canAcceptInBackground || (this.activeItems[0] && (this._selectedItems = [this.activeItems[0]], this.onDidChangeSelectionEmitter.fire(this.selectedItems)), this.handleAccept(e ?? !1));
  }
};
sq.DEFAULT_ARIA_LABEL = S(1738, "Type to narrow down results.");
let c3 = sq;
class tMt extends P5 {
  constructor() {
    super(...arguments), this._value = "", this.valueSelectionUpdated = !0, this._password = !1, this.onDidValueChangeEmitter = this._register(new he()), this.onDidAcceptEmitter = this._register(new he()), this.type = "inputBox", this.onDidChangeValue = this.onDidValueChangeEmitter.event, this.onDidAccept = this.onDidAcceptEmitter.event;
  }
  get value() {
    return this._value;
  }
  set value(e) {
    this._value = e || "", this.update();
  }
  get valueSelection() {
    const e = this.ui.inputBox.getSelection();
    if (e)
      return [e.start, e.end];
  }
  set valueSelection(e) {
    this._valueSelection = e, this.valueSelectionUpdated = !0, this.update();
  }
  get placeholder() {
    return this._placeholder;
  }
  set placeholder(e) {
    this._placeholder = e, this.update();
  }
  get ariaLabel() {
    return this._ariaLabel;
  }
  set ariaLabel(e) {
    this._ariaLabel = e, this.update();
  }
  get password() {
    return this._password;
  }
  set password(e) {
    this._password = e, this.update();
  }
  get prompt() {
    return this._prompt;
  }
  set prompt(e) {
    this._prompt = e, this.noValidationMessage = e ? S(1740, "{0} (Press 'Enter' to confirm or 'Escape' to cancel)", e) : P5.noPromptMessage, this.update();
  }
  show() {
    this.visible || (this.visibleDisposables.add(this.ui.inputBox.onDidChange((e) => {
      e !== this.value && (this._value = e, this.onDidValueChangeEmitter.fire(e));
    })), this.visibleDisposables.add(this.ui.onDidAccept(() => this.onDidAcceptEmitter.fire())), this.valueSelectionUpdated = !0), super.show();
  }
  accept() {
    this.onDidAcceptEmitter.fire();
  }
  update() {
    if (!this.visible)
      return;
    this.ui.container.classList.remove("hidden-input");
    const e = {
      title: !!this.title || !!this.step || !!this.titleButtons.length,
      description: !!this.description || !!this.step,
      inputBox: !0,
      message: !0,
      progressBar: !0
    };
    this.ui.setVisibilities(e), super.update(), this.ui.inputBox.value !== this.value && (this.ui.inputBox.value = this.value), this.valueSelectionUpdated && (this.valueSelectionUpdated = !1, this.ui.inputBox.select(this._valueSelection && { start: this._valueSelection[0], end: this._valueSelection[1] })), this.ui.inputBox.placeholder !== (this.placeholder || "") && (this.ui.inputBox.placeholder = this.placeholder || ""), this.ui.inputBox.password !== this.password && (this.ui.inputBox.password = this.password);
    let t = this.ariaLabel;
    !t && e.inputBox && (t = this.placeholder ? this.title ? `${this.placeholder} - ${this.title}` : this.placeholder : this.title ? this.title : "input"), this.ui.inputBox.ariaLabel !== t && (this.ui.inputBox.ariaLabel = t || "input");
  }
}
let vue = class extends cA {
  constructor(e, t) {
    super("mouse", void 0, (n) => this.getOverrideOptions(n), e, t);
  }
  getOverrideOptions(e) {
    const t = (eo(e.content) ? e.content.textContent ?? "" : typeof e.content == "string" ? e.content : e.content.value).includes(`
`);
    return {
      persistence: {
        hideOnKeyDown: !1
      },
      appearance: {
        showHoverHint: t,
        skipFadeInAnimation: !0
      }
    };
  }
};
vue = KOt([
  fRe(0, xn),
  fRe(1, od)
], vue);
const gRe = "done", pRe = "active", $te = "infinite", jte = "infinite-long-running", mRe = "discrete", oq = class oq extends ge {
  constructor(e, t) {
    super(), this.progressSignal = this._register(new er()), this.workedVal = 0, this.showDelayedScheduler = this._register(new mr(() => Id(this.element), 0)), this.longRunningScheduler = this._register(new mr(() => this.infiniteLongRunning(), oq.LONG_RUNNING_INFINITE_THRESHOLD)), this.create(e, t);
  }
  create(e, t) {
    this.element = document.createElement("div"), this.element.classList.add("monaco-progress-container"), this.element.setAttribute("role", "progressbar"), this.element.setAttribute("aria-valuemin", "0"), e.appendChild(this.element), this.bit = document.createElement("div"), this.bit.classList.add("progress-bit"), this.bit.style.backgroundColor = (t == null ? void 0 : t.progressBarBackground) || "#0E70C0", this.element.appendChild(this.bit);
  }
  off() {
    this.bit.style.width = "inherit", this.bit.style.opacity = "1", this.element.classList.remove(pRe, $te, jte, mRe), this.workedVal = 0, this.totalWork = void 0, this.longRunningScheduler.cancel(), this.progressSignal.clear();
  }
  /**
   * Stops the progressbar from showing any progress instantly without fading out.
   */
  stop() {
    return this.doDone(!1);
  }
  doDone(e) {
    return this.element.classList.add(gRe), this.element.classList.contains($te) ? (this.bit.style.opacity = "0", e ? setTimeout(() => this.off(), 200) : this.off()) : (this.bit.style.width = "inherit", e ? setTimeout(() => this.off(), 200) : this.off()), this;
  }
  /**
   * Use this mode to indicate progress that has no total number of work units.
   */
  infinite() {
    return this.bit.style.width = "2%", this.bit.style.opacity = "1", this.element.classList.remove(mRe, gRe, jte), this.element.classList.add(pRe, $te), this.longRunningScheduler.schedule(), this;
  }
  infiniteLongRunning() {
    this.element.classList.add(jte);
  }
  getContainer() {
    return this.element;
  }
};
oq.LONG_RUNNING_INFINITE_THRESHOLD = 1e4;
let yue = oq;
const nMt = Ge;
class iMt extends ge {
  constructor(e, t, n) {
    super(), this.parent = e, this.onDidChange = (s) => this.findInput.onDidChange(s), this.container = Fe(this.parent, nMt(".quick-input-box")), this.findInput = this._register(new QBe(this.container, void 0, { label: "", inputBoxStyles: t, toggleStyles: n }));
    const r = this.findInput.inputBox.inputElement;
    r.role = "textbox", r.ariaHasPopup = "menu", r.ariaAutoComplete = "list";
  }
  get onKeyDown() {
    return this.findInput.onKeyDown;
  }
  get value() {
    return this.findInput.getValue();
  }
  set value(e) {
    this.findInput.setValue(e);
  }
  select(e = null) {
    this.findInput.inputBox.select(e);
  }
  getSelection() {
    return this.findInput.inputBox.getSelection();
  }
  isSelectionAtEnd() {
    return this.findInput.inputBox.isSelectionAtEnd();
  }
  get placeholder() {
    return this.findInput.inputBox.inputElement.getAttribute("placeholder") || "";
  }
  set placeholder(e) {
    this.findInput.inputBox.setPlaceHolder(e);
  }
  get password() {
    return this.findInput.inputBox.inputElement.type === "password";
  }
  set password(e) {
    this.findInput.inputBox.inputElement.type = e ? "password" : "text";
  }
  set enabled(e) {
    this.findInput.inputBox.inputElement.toggleAttribute("readonly", !e);
  }
  set toggles(e) {
    this.findInput.setAdditionalToggles(e);
  }
  get ariaLabel() {
    return this.findInput.inputBox.inputElement.getAttribute("aria-label") || "";
  }
  set ariaLabel(e) {
    this.findInput.inputBox.inputElement.setAttribute("aria-label", e);
  }
  hasFocus() {
    return this.findInput.inputBox.hasFocus();
  }
  setAttribute(e, t) {
    this.findInput.inputBox.inputElement.setAttribute(e, t);
  }
  removeAttribute(e) {
    this.findInput.inputBox.inputElement.removeAttribute(e);
  }
  showDecoration(e) {
    e === Rs.Ignore ? this.findInput.clearMessage() : this.findInput.showMessage({ type: e === Rs.Info ? 1 : e === Rs.Warning ? 2 : 3, content: "" });
  }
  stylesForType(e) {
    return this.findInput.inputBox.stylesForType(
      e === Rs.Info ? 1 : e === Rs.Warning ? 2 : 3
      /* MessageType.ERROR */
    );
  }
  setFocus() {
    this.findInput.focus();
  }
  layout() {
    this.findInput.inputBox.layout();
  }
}
const _Re = new _l(() => {
  const i = qT.Collator(void 0, { numeric: !0, sensitivity: "base" }).value;
  return {
    collator: i,
    collatorIsNumeric: i.resolvedOptions().numeric
  };
});
new _l(() => ({
  collator: qT.Collator(void 0, { numeric: !0 }).value
}));
new _l(() => ({
  collator: qT.Collator(void 0, { numeric: !0, sensitivity: "accent" }).value
}));
function rMt(i, e, t = !1) {
  const n = i || "", r = e || "", s = _Re.value.collator.compare(n, r);
  return _Re.value.collatorIsNumeric && s === 0 && n !== r ? n < r ? -1 : 1 : s;
}
function sMt(i, e, t) {
  const n = i.toLowerCase(), r = e.toLowerCase(), s = oMt(i, e, t);
  if (s)
    return s;
  const o = n.endsWith(t), a = r.endsWith(t);
  if (o !== a)
    return o ? -1 : 1;
  const l = rMt(n, r);
  return l !== 0 ? l : n.localeCompare(r);
}
function oMt(i, e, t) {
  const n = i.toLowerCase(), r = e.toLowerCase(), s = n.startsWith(t), o = r.startsWith(t);
  if (s !== o)
    return s ? -1 : 1;
  if (s && o) {
    if (n.length < r.length)
      return -1;
    if (n.length > r.length)
      return 1;
  }
  return 0;
}
var XK = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Cue = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, wue;
const S_ = Ge;
class A9e {
  constructor(e, t, n) {
    this.index = e, this.hasCheckbox = t, this._hidden = !1, this._init = new _l(() => {
      const r = n.label ?? "", s = mx(r).text.trim(), o = n.ariaLabel || [r, this.saneDescription, this.saneDetail].map((a) => k4e(a)).filter((a) => !!a).join(", ");
      return {
        saneLabel: r,
        saneSortLabel: s,
        saneAriaLabel: o
      };
    }), this._saneDescription = n.description, this._saneTooltip = n.tooltip;
  }
  // #region Lazy Getters
  get saneLabel() {
    return this._init.value.saneLabel;
  }
  get saneSortLabel() {
    return this._init.value.saneSortLabel;
  }
  get saneAriaLabel() {
    return this._init.value.saneAriaLabel;
  }
  get element() {
    return this._element;
  }
  set element(e) {
    this._element = e;
  }
  get hidden() {
    return this._hidden;
  }
  set hidden(e) {
    this._hidden = e;
  }
  get saneDescription() {
    return this._saneDescription;
  }
  set saneDescription(e) {
    this._saneDescription = e;
  }
  get saneDetail() {
    return this._saneDetail;
  }
  set saneDetail(e) {
    this._saneDetail = e;
  }
  get saneTooltip() {
    return this._saneTooltip;
  }
  set saneTooltip(e) {
    this._saneTooltip = e;
  }
  get labelHighlights() {
    return this._labelHighlights;
  }
  set labelHighlights(e) {
    this._labelHighlights = e;
  }
  get descriptionHighlights() {
    return this._descriptionHighlights;
  }
  set descriptionHighlights(e) {
    this._descriptionHighlights = e;
  }
  get detailHighlights() {
    return this._detailHighlights;
  }
  set detailHighlights(e) {
    this._detailHighlights = e;
  }
}
class ll extends A9e {
  constructor(e, t, n, r, s, o, a) {
    var l, c, u;
    super(e, n, o), this.childIndex = t, this.fireButtonTriggered = r, this._onChecked = s, this.item = o, this._separator = a, this._checked = !1, this.onChecked = n ? Ze.map(Ze.filter(this._onChecked.event, (d) => d.element === this), (d) => d.checked) : Ze.None, this._saneDetail = o.detail, this._labelHighlights = (l = o.highlights) == null ? void 0 : l.label, this._descriptionHighlights = (c = o.highlights) == null ? void 0 : c.description, this._detailHighlights = (u = o.highlights) == null ? void 0 : u.detail;
  }
  get separator() {
    return this._separator;
  }
  set separator(e) {
    this._separator = e;
  }
  get checked() {
    return this._checked;
  }
  set checked(e) {
    e !== this._checked && (this._checked = e, this._onChecked.fire({ element: this, checked: e }));
  }
  get checkboxDisabled() {
    return !!this.item.disabled;
  }
}
var F_;
(function(i) {
  i[i.NONE = 0] = "NONE", i[i.MOUSE_HOVER = 1] = "MOUSE_HOVER", i[i.ACTIVE_ITEM = 2] = "ACTIVE_ITEM";
})(F_ || (F_ = {}));
class NE extends A9e {
  constructor(e, t, n) {
    super(e, !1, n), this.fireSeparatorButtonTriggered = t, this.separator = n, this.children = new Array(), this.focusInsideSeparator = F_.NONE;
  }
}
class aMt {
  getHeight(e) {
    return e instanceof NE ? 30 : e.saneDetail ? 44 : 22;
  }
  getTemplateId(e) {
    return e instanceof ll ? k$.ID : D$.ID;
  }
}
class lMt {
  getWidgetAriaLabel() {
    return S(1753, "Quick Input");
  }
  getAriaLabel(e) {
    var t;
    return (t = e.separator) != null && t.label ? `${e.saneAriaLabel}, ${e.separator.label}` : e.saneAriaLabel;
  }
  getWidgetRole() {
    return "listbox";
  }
  getRole(e) {
    return e.hasCheckbox ? "checkbox" : "option";
  }
  isChecked(e) {
    if (!(!e.hasCheckbox || !(e instanceof ll)))
      return {
        get value() {
          return e.checked;
        },
        onDidChange: (t) => e.onChecked(() => t())
      };
  }
}
class O9e {
  constructor(e) {
    this.hoverDelegate = e;
  }
  // TODO: only do the common stuff here and have a subclass handle their specific stuff
  renderTemplate(e) {
    const t = /* @__PURE__ */ Object.create(null);
    t.toDisposeElement = new ke(), t.toDisposeTemplate = new ke(), t.entry = Fe(e, S_(".quick-input-list-entry"));
    const n = Fe(t.entry, S_("label.quick-input-list-label"));
    t.outerLabel = n, t.checkbox = t.toDisposeTemplate.add(new er()), t.toDisposeTemplate.add(vo(n, Xe.CLICK, (c) => {
      if (t.checkbox.value && !c.defaultPrevented && t.checkbox.value.enabled) {
        const u = !t.checkbox.value.checked;
        t.checkbox.value.checked = u, t.element.checked = u;
      }
    }));
    const r = Fe(n, S_(".quick-input-list-rows")), s = Fe(r, S_(".quick-input-list-row")), o = Fe(r, S_(".quick-input-list-row"));
    t.label = new a5(s, { supportHighlights: !0, supportDescriptionHighlights: !0, supportIcons: !0, hoverDelegate: this.hoverDelegate }), t.toDisposeTemplate.add(t.label), t.icon = Sq(t.label.element, S_(".quick-input-list-icon"));
    const a = Fe(s, S_(".quick-input-list-entry-keybinding"));
    t.keybinding = new c2(a, Ad), t.toDisposeTemplate.add(t.keybinding);
    const l = Fe(o, S_(".quick-input-list-label-meta"));
    return t.detail = new a5(l, { supportHighlights: !0, supportIcons: !0, hoverDelegate: this.hoverDelegate }), t.toDisposeTemplate.add(t.detail), t.separator = Fe(t.entry, S_(".quick-input-list-separator")), t.actionBar = new qu(t.entry, this.hoverDelegate ? { hoverDelegate: this.hoverDelegate } : void 0), t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"), t.toDisposeTemplate.add(t.actionBar), t;
  }
  disposeTemplate(e) {
    e.toDisposeElement.dispose(), e.toDisposeTemplate.dispose();
  }
  disposeElement(e, t, n) {
    n.toDisposeElement.clear(), n.actionBar.clear();
  }
}
var jL;
let k$ = (jL = class extends O9e {
  constructor(e, t) {
    super(e), this.themeService = t, this._itemsWithSeparatorsFrequency = /* @__PURE__ */ new Map();
  }
  get templateId() {
    return wue.ID;
  }
  ensureCheckbox(e, t) {
    var r;
    if (!e.hasCheckbox) {
      (r = t.checkbox.value) == null || r.domNode.remove(), t.checkbox.clear();
      return;
    }
    let n = t.checkbox.value;
    n ? n.setTitle(e.saneLabel) : (n = new jBe(e.saneLabel, e.checked, { ...Rge, size: 15 }), t.checkbox.value = n, t.outerLabel.prepend(n.domNode)), e.checkboxDisabled ? n.disable() : n.enable(), n.checked = e.checked, t.toDisposeElement.add(e.onChecked((s) => n.checked = s)), t.toDisposeElement.add(n.onChange(() => e.checked = n.checked));
  }
  renderElement(e, t, n) {
    var h;
    const r = e.element;
    n.element = r, r.element = n.entry ?? void 0;
    const s = r.item;
    r.element.classList.toggle("not-pickable", r.item.pickable === !1), this.ensureCheckbox(r, n);
    const { labelHighlights: o, descriptionHighlights: a, detailHighlights: l } = r;
    if (s.iconPath) {
      const g = sT(this.themeService.getColorTheme().type) ? s.iconPath.dark : s.iconPath.light ?? s.iconPath.dark, m = Ht.revive(g);
      n.icon.className = "quick-input-list-icon", n.icon.style.backgroundImage = mb(m);
    } else
      n.icon.style.backgroundImage = "", n.icon.className = s.iconClass ? `quick-input-list-icon ${s.iconClass}` : "";
    let c;
    !r.saneTooltip && r.saneDescription && (c = {
      markdown: {
        value: Ug(r.saneDescription),
        supportThemeIcons: !0
      },
      markdownNotSupportedFallback: r.saneDescription
    });
    const u = {
      matches: o || [],
      // If we have a tooltip, we want that to be shown and not any other hover
      descriptionTitle: c,
      descriptionMatches: a || [],
      labelEscapeNewLines: !0
    };
    if (u.extraClasses = s.iconClasses, u.italic = s.italic, u.strikethrough = s.strikethrough, n.entry.classList.remove("quick-input-list-separator-as-item"), n.label.setLabel(r.saneLabel, r.saneDescription, u), n.keybinding.set(s.keybinding), r.saneDetail) {
      let g;
      r.saneTooltip || (g = {
        markdown: {
          value: Ug(r.saneDetail),
          supportThemeIcons: !0
        },
        markdownNotSupportedFallback: r.saneDetail
      }), n.detail.element.style.display = "", n.detail.setLabel(r.saneDetail, void 0, {
        matches: l,
        title: g,
        labelEscapeNewLines: !0
      });
    } else
      n.detail.element.style.display = "none";
    (h = r.separator) != null && h.label ? (n.separator.textContent = r.separator.label, n.separator.style.display = "", this.addItemWithSeparator(r)) : n.separator.style.display = "none", n.entry.classList.toggle("quick-input-list-separator-border", !!r.separator && r.childIndex !== 0);
    const d = s.buttons;
    d && d.length ? (n.actionBar.push(d.map((g, m) => pR(g, `id-${m}`, () => r.fireButtonTriggered({ button: g, item: r.item }))), { icon: !0, label: !1 }), n.entry.classList.add("has-actions")) : n.entry.classList.remove("has-actions");
  }
  disposeElement(e, t, n) {
    this.removeItemWithSeparator(e.element), super.disposeElement(e, t, n);
  }
  isItemWithSeparatorVisible(e) {
    return this._itemsWithSeparatorsFrequency.has(e);
  }
  addItemWithSeparator(e) {
    this._itemsWithSeparatorsFrequency.set(e, (this._itemsWithSeparatorsFrequency.get(e) || 0) + 1);
  }
  removeItemWithSeparator(e) {
    const t = this._itemsWithSeparatorsFrequency.get(e) || 0;
    t > 1 ? this._itemsWithSeparatorsFrequency.set(e, t - 1) : this._itemsWithSeparatorsFrequency.delete(e);
  }
}, wue = jL, jL.ID = "quickpickitem", jL);
k$ = wue = XK([
  Cue(1, to)
], k$);
const aq = class aq extends O9e {
  constructor() {
    super(...arguments), this._visibleSeparatorsFrequency = /* @__PURE__ */ new Map();
  }
  get templateId() {
    return aq.ID;
  }
  get visibleSeparators() {
    return [...this._visibleSeparatorsFrequency.keys()];
  }
  isSeparatorVisible(e) {
    return this._visibleSeparatorsFrequency.has(e);
  }
  renderElement(e, t, n) {
    const r = e.element;
    n.element = r, r.element = n.entry ?? void 0, r.element.classList.toggle("focus-inside", !!r.focusInsideSeparator);
    const s = r.separator, { labelHighlights: o, descriptionHighlights: a } = r;
    n.icon.style.backgroundImage = "", n.icon.className = "";
    let l;
    !r.saneTooltip && r.saneDescription && (l = {
      markdown: {
        value: Ug(r.saneDescription),
        supportThemeIcons: !0
      },
      markdownNotSupportedFallback: r.saneDescription
    });
    const c = {
      matches: o || [],
      // If we have a tooltip, we want that to be shown and not any other hover
      descriptionTitle: l,
      descriptionMatches: a || [],
      labelEscapeNewLines: !0
    };
    n.entry.classList.add("quick-input-list-separator-as-item"), n.label.setLabel(r.saneLabel, r.saneDescription, c), n.separator.style.display = "none", n.entry.classList.add("quick-input-list-separator-border");
    const u = s.buttons;
    u && u.length ? (n.actionBar.push(u.map((d, h) => pR(d, `id-${h}`, () => r.fireSeparatorButtonTriggered({ button: d, separator: r.separator }))), { icon: !0, label: !1 }), n.entry.classList.add("has-actions")) : n.entry.classList.remove("has-actions"), this.addSeparator(r);
  }
  disposeElement(e, t, n) {
    var r;
    this.removeSeparator(e.element), this.isSeparatorVisible(e.element) || (r = e.element.element) == null || r.classList.remove("focus-inside"), super.disposeElement(e, t, n);
  }
  addSeparator(e) {
    this._visibleSeparatorsFrequency.set(e, (this._visibleSeparatorsFrequency.get(e) || 0) + 1);
  }
  removeSeparator(e) {
    const t = this._visibleSeparatorsFrequency.get(e) || 0;
    t > 1 ? this._visibleSeparatorsFrequency.set(e, t - 1) : this._visibleSeparatorsFrequency.delete(e);
  }
};
aq.ID = "quickpickseparator";
let D$ = aq, F5 = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this.parent = e, this.hoverDelegate = t, this.linkOpenerDelegate = n, this.accessibilityService = o, this._onKeyDown = new he(), this._onLeave = new he(), this.onLeave = this._onLeave.event, this._visibleCountObservable = Qt("VisibleCount", 0), this.onChangedVisibleCount = Ze.fromObservable(this._visibleCountObservable, this._store), this._allVisibleCheckedObservable = Qt("AllVisibleChecked", !1), this.onChangedAllVisibleChecked = Ze.fromObservable(this._allVisibleCheckedObservable, this._store), this._checkedCountObservable = Qt("CheckedCount", 0), this.onChangedCheckedCount = Ze.fromObservable(this._checkedCountObservable, this._store), this._checkedElementsObservable = CF({ equalsFn: ds }, new Array()), this.onChangedCheckedElements = Ze.fromObservable(this._checkedElementsObservable, this._store), this._onButtonTriggered = new he(), this.onButtonTriggered = this._onButtonTriggered.event, this._onSeparatorButtonTriggered = new he(), this.onSeparatorButtonTriggered = this._onSeparatorButtonTriggered.event, this._elementChecked = new he(), this._elementCheckedEventBufferer = new gB(), this._hasCheckboxes = !1, this._inputElements = new Array(), this._elementTree = new Array(), this._itemElements = new Array(), this._elementDisposable = this._register(new ke()), this._matchOnDescription = !1, this._matchOnDetail = !1, this._matchOnLabel = !0, this._matchOnLabelMode = "fuzzy", this._sortByLabel = !0, this._shouldLoop = !0, this._container = Fe(this.parent, S_(".quick-input-list")), this._separatorRenderer = new D$(t), this._itemRenderer = s.createInstance(k$, t), this._tree = this._register(s.createInstance(bz, "QuickInput", this._container, new aMt(), [this._itemRenderer, this._separatorRenderer], {
      filter: {
        filter(a) {
          return a.hidden ? 0 : a instanceof NE ? 2 : 1;
        }
      },
      sorter: {
        compare: (a, l) => {
          if (!this.sortByLabel || !this._lastQueryString)
            return 0;
          const c = this._lastQueryString.toLowerCase();
          return uMt(a, l, c);
        }
      },
      accessibilityProvider: new lMt(),
      setRowLineHeight: !1,
      multipleSelectionSupport: !1,
      hideTwistiesOfChildlessElements: !0,
      renderIndentGuides: ET.None,
      findWidgetEnabled: !1,
      indent: 0,
      horizontalScrolling: !1,
      allowNonCollapsibleParents: !0,
      alwaysConsumeMouseWheel: !0
    })), this._tree.getHTMLElement().id = r, this._registerListeners();
  }
  //#region public getters/setters
  get onDidChangeFocus() {
    return Ze.map(this._tree.onDidChangeFocus, (e) => e.elements.filter((t) => t instanceof ll).map((t) => t.item), this._store);
  }
  get onDidChangeSelection() {
    return Ze.map(this._tree.onDidChangeSelection, (e) => ({
      items: e.elements.filter((t) => t instanceof ll).map((t) => t.item),
      event: e.browserEvent
    }), this._store);
  }
  get displayed() {
    return this._container.style.display !== "none";
  }
  set displayed(e) {
    this._container.style.display = e ? "" : "none";
  }
  get scrollTop() {
    return this._tree.scrollTop;
  }
  set scrollTop(e) {
    this._tree.scrollTop = e;
  }
  get ariaLabel() {
    return this._tree.ariaLabel;
  }
  set ariaLabel(e) {
    this._tree.ariaLabel = e ?? "";
  }
  set enabled(e) {
    this._tree.getHTMLElement().style.pointerEvents = e ? "" : "none";
  }
  get matchOnDescription() {
    return this._matchOnDescription;
  }
  set matchOnDescription(e) {
    this._matchOnDescription = e;
  }
  get matchOnDetail() {
    return this._matchOnDetail;
  }
  set matchOnDetail(e) {
    this._matchOnDetail = e;
  }
  get matchOnLabel() {
    return this._matchOnLabel;
  }
  set matchOnLabel(e) {
    this._matchOnLabel = e;
  }
  get matchOnLabelMode() {
    return this._matchOnLabelMode;
  }
  set matchOnLabelMode(e) {
    this._matchOnLabelMode = e;
  }
  get sortByLabel() {
    return this._sortByLabel;
  }
  set sortByLabel(e) {
    this._sortByLabel = e;
  }
  get shouldLoop() {
    return this._shouldLoop;
  }
  set shouldLoop(e) {
    this._shouldLoop = e;
  }
  //#endregion
  //#region register listeners
  _registerListeners() {
    this._registerOnKeyDown(), this._registerOnContainerClick(), this._registerOnMouseMiddleClick(), this._registerOnTreeModelChanged(), this._registerOnElementChecked(), this._registerOnContextMenu(), this._registerHoverListeners(), this._registerSelectionChangeListener(), this._registerSeparatorActionShowingListeners();
  }
  _registerOnKeyDown() {
    this._register(this._tree.onKeyDown((e) => {
      const t = new wr(e);
      switch (t.keyCode) {
        case 10:
          this.toggleCheckbox();
          break;
      }
      this._onKeyDown.fire(t);
    }));
  }
  _registerOnContainerClick() {
    this._register(Ce(this._container, Xe.CLICK, (e) => {
      (e.x || e.y) && this._onLeave.fire();
    }));
  }
  _registerOnMouseMiddleClick() {
    this._register(Ce(this._container, Xe.AUXCLICK, (e) => {
      e.button === 1 && this._onLeave.fire();
    }));
  }
  _registerOnTreeModelChanged() {
    this._register(this._tree.onDidChangeModel(() => {
      const e = this._itemElements.filter((t) => !t.hidden).length;
      this._visibleCountObservable.set(e, void 0), this._hasCheckboxes && this._updateCheckedObservables();
    }));
  }
  _registerOnElementChecked() {
    this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event, (e, t) => t)((e) => this._updateCheckedObservables()));
  }
  _registerOnContextMenu() {
    this._register(this._tree.onContextMenu((e) => {
      e.element && (e.browserEvent.preventDefault(), this._tree.setSelection([e.element]));
    }));
  }
  _registerHoverListeners() {
    const e = this._register(new $Me(typeof this.hoverDelegate.delay == "function" ? this.hoverDelegate.delay() : this.hoverDelegate.delay));
    this._register(this._tree.onMouseOver(async (t) => {
      var n;
      if (Wxe(t.browserEvent.target)) {
        e.cancel();
        return;
      }
      if (
        // anchors are an exception as called out above so we skip them here
        !(!Wxe(t.browserEvent.relatedTarget) && // check if the mouse is still over the same element
        pa(t.browserEvent.relatedTarget, (n = t.element) == null ? void 0 : n.element))
      )
        try {
          await e.trigger(async () => {
            t.element instanceof ll && this.showHover(t.element);
          });
        } catch (r) {
          if (!Xh(r))
            throw r;
        }
    })), this._register(this._tree.onMouseOut((t) => {
      var n;
      pa(t.browserEvent.relatedTarget, (n = t.element) == null ? void 0 : n.element) || e.cancel();
    }));
  }
  /**
   * Register's focus change and mouse events so that we can track when items inside of a
   * separator's section are focused or hovered so that we can display the separator's actions
   */
  _registerSeparatorActionShowingListeners() {
    this._register(this._tree.onDidChangeFocus((e) => {
      const t = e.elements[0] ? this._tree.getParentElement(e.elements[0]) : null;
      for (const n of this._separatorRenderer.visibleSeparators) {
        const r = n === t;
        !!(n.focusInsideSeparator & F_.ACTIVE_ITEM) !== r && (r ? n.focusInsideSeparator |= F_.ACTIVE_ITEM : n.focusInsideSeparator &= ~F_.ACTIVE_ITEM, this._tree.rerender(n));
      }
    })), this._register(this._tree.onMouseOver((e) => {
      const t = e.element ? this._tree.getParentElement(e.element) : null;
      for (const n of this._separatorRenderer.visibleSeparators) {
        if (n !== t)
          continue;
        !!(n.focusInsideSeparator & F_.MOUSE_HOVER) || (n.focusInsideSeparator |= F_.MOUSE_HOVER, this._tree.rerender(n));
      }
    })), this._register(this._tree.onMouseOut((e) => {
      const t = e.element ? this._tree.getParentElement(e.element) : null;
      for (const n of this._separatorRenderer.visibleSeparators) {
        if (n !== t)
          continue;
        !!(n.focusInsideSeparator & F_.MOUSE_HOVER) && (n.focusInsideSeparator &= ~F_.MOUSE_HOVER, this._tree.rerender(n));
      }
    }));
  }
  _registerSelectionChangeListener() {
    this._register(this._tree.onDidChangeSelection((e) => {
      const t = e.elements.filter((n) => n instanceof ll);
      t.length !== e.elements.length && (e.elements.length === 1 && e.elements[0] instanceof NE && (this._tree.setFocus([e.elements[0].children[0]]), this._tree.reveal(e.elements[0], 0)), this._tree.setSelection(t));
    }));
  }
  //#endregion
  //#region public methods
  setAllVisibleChecked(e) {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      this._itemElements.forEach((t) => {
        !t.hidden && !t.checkboxDisabled && t.item.pickable !== !1 && (t.checked = e);
      });
    });
  }
  setElements(e) {
    this._elementDisposable.clear(), this._lastQueryString = void 0, this._inputElements = e, this._hasCheckboxes = this.parent.classList.contains("show-checkboxes");
    let t;
    this._itemElements = new Array(), this._elementTree = e.reduce((n, r, s) => {
      let o;
      if (r.type === "separator") {
        if (!r.buttons)
          return n;
        t = new NE(s, (a) => this._onSeparatorButtonTriggered.fire(a), r), o = t;
      } else {
        const a = s > 0 ? e[s - 1] : void 0;
        let l;
        a && a.type === "separator" && !a.buttons && (l = a);
        const c = new ll(s, t != null && t.children ? t.children.length : s, this._hasCheckboxes && r.pickable !== !1, (u) => this._onButtonTriggered.fire(u), this._elementChecked, r, l);
        if (this._itemElements.push(c), t)
          return t.children.push(c), n;
        o = c;
      }
      return n.push(o), n;
    }, new Array()), this._setElementsToTree(this._elementTree), this.accessibilityService.isScreenReaderOptimized() && setTimeout(() => {
      const n = this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"), r = n == null ? void 0 : n.parentNode;
      if (n && r) {
        const s = n.nextSibling;
        n.remove(), r.insertBefore(n, s);
      }
    }, 0);
  }
  setFocusedElements(e) {
    const t = e.map((n) => this._itemElements.find((r) => r.item === n)).filter((n) => !!n).filter((n) => !n.hidden);
    if (this._tree.setFocus(t), e.length > 0) {
      const n = this._tree.getFocus()[0];
      n && this._tree.reveal(n);
    }
  }
  getActiveDescendant() {
    return this._tree.getHTMLElement().getAttribute("aria-activedescendant");
  }
  setSelectedElements(e) {
    const t = e.map((n) => this._itemElements.find((r) => r.item === n)).filter((n) => !!n);
    this._tree.setSelection(t);
  }
  getCheckedElements() {
    return this._itemElements.filter((e) => e.checked).map((e) => e.item);
  }
  setCheckedElements(e) {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      const t = /* @__PURE__ */ new Set();
      for (const n of e)
        t.add(n);
      for (const n of this._itemElements)
        n.checked = t.has(n.item);
    });
  }
  focus(e) {
    var t;
    if (this._itemElements.length)
      switch (e === Yr.Second && this._itemElements.length < 2 && (e = Yr.First), e) {
        case Yr.First:
          this._tree.scrollTop = 0, this._tree.focusFirst(void 0, (n) => n.element instanceof ll);
          break;
        case Yr.Second: {
          this._tree.scrollTop = 0;
          let n = !1;
          this._tree.focusFirst(void 0, (r) => r.element instanceof ll ? n ? !0 : (n = !n, !1) : !1);
          break;
        }
        case Yr.Last:
          this._tree.scrollTop = this._tree.scrollHeight, this._tree.focusLast(void 0, (n) => n.element instanceof ll);
          break;
        case Yr.Next: {
          const n = this._tree.getFocus();
          this._tree.focusNext(void 0, this._shouldLoop, void 0, (s) => s.element instanceof ll ? (this._tree.reveal(s.element), !0) : !1);
          const r = this._tree.getFocus();
          n.length && n[0] === r[0] && this._onLeave.fire();
          break;
        }
        case Yr.Previous: {
          const n = this._tree.getFocus();
          this._tree.focusPrevious(void 0, this._shouldLoop, void 0, (s) => {
            if (!(s.element instanceof ll))
              return !1;
            const o = this._tree.getParentElement(s.element);
            return o === null || o.children[0] !== s.element ? this._tree.reveal(s.element) : this._tree.reveal(o), !0;
          });
          const r = this._tree.getFocus();
          n.length && n[0] === r[0] && this._onLeave.fire();
          break;
        }
        case Yr.NextPage:
          this._tree.focusNextPage(void 0, (n) => n.element instanceof ll ? (this._tree.reveal(n.element), !0) : !1);
          break;
        case Yr.PreviousPage:
          this._tree.focusPreviousPage(void 0, (n) => {
            if (!(n.element instanceof ll))
              return !1;
            const r = this._tree.getParentElement(n.element);
            return r === null || r.children[0] !== n.element ? this._tree.reveal(n.element) : this._tree.reveal(r), !0;
          });
          break;
        case Yr.NextSeparator: {
          let n = !1;
          const r = this._tree.getFocus()[0];
          this._tree.focusNext(void 0, !0, void 0, (o) => {
            if (n)
              return !0;
            if (o.element instanceof NE)
              n = !0, this._separatorRenderer.isSeparatorVisible(o.element) ? this._tree.reveal(o.element.children[0]) : this._tree.reveal(o.element, 0);
            else if (o.element instanceof ll) {
              if (o.element.separator)
                return this._itemRenderer.isItemWithSeparatorVisible(o.element) ? this._tree.reveal(o.element) : this._tree.reveal(o.element, 0), !0;
              if (o.element === this._elementTree[0])
                return this._tree.reveal(o.element, 0), !0;
            }
            return !1;
          });
          const s = this._tree.getFocus()[0];
          r === s && (this._tree.scrollTop = this._tree.scrollHeight, this._tree.focusLast(void 0, (o) => o.element instanceof ll));
          break;
        }
        case Yr.PreviousSeparator: {
          let n, r = !!((t = this._tree.getFocus()[0]) != null && t.separator);
          this._tree.focusPrevious(void 0, !0, void 0, (s) => {
            if (s.element instanceof NE)
              r ? n || (this._separatorRenderer.isSeparatorVisible(s.element) ? this._tree.reveal(s.element) : this._tree.reveal(s.element, 0), n = s.element.children[0]) : r = !0;
            else if (s.element instanceof ll && !n) {
              if (s.element.separator)
                this._itemRenderer.isItemWithSeparatorVisible(s.element) ? this._tree.reveal(s.element) : this._tree.reveal(s.element, 0), n = s.element;
              else if (s.element === this._elementTree[0])
                return this._tree.reveal(s.element, 0), !0;
            }
            return !1;
          }), n && this._tree.setFocus([n]);
          break;
        }
      }
  }
  clearFocus() {
    this._tree.setFocus([]);
  }
  domFocus() {
    this._tree.domFocus();
  }
  layout(e) {
    this._tree.getHTMLElement().style.maxHeight = e ? `${// Make sure height aligns with list item heights
    Math.floor(e / 44) * 44 + 6}px` : "", this._tree.layout();
  }
  filter(e) {
    if (this._lastQueryString = e, !(this._sortByLabel || this._matchOnLabel || this._matchOnDescription || this._matchOnDetail))
      return this._tree.layout(), !1;
    const t = e;
    if (e = e.trim(), !e || !(this.matchOnLabel || this.matchOnDescription || this.matchOnDetail))
      this._itemElements.forEach((n) => {
        n.labelHighlights = void 0, n.descriptionHighlights = void 0, n.detailHighlights = void 0, n.hidden = !1;
        const r = n.index && this._inputElements[n.index - 1];
        n.item && (n.separator = r && r.type === "separator" && !r.buttons ? r : void 0);
      });
    else {
      let n;
      this._itemElements.forEach((r) => {
        let s;
        this.matchOnLabelMode === "fuzzy" ? s = this.matchOnLabel ? BF(e, mx(r.saneLabel)) ?? void 0 : void 0 : s = this.matchOnLabel ? cMt(t, mx(r.saneLabel)) ?? void 0 : void 0;
        const o = this.matchOnDescription ? BF(e, mx(r.saneDescription || "")) ?? void 0 : void 0, a = this.matchOnDetail ? BF(e, mx(r.saneDetail || "")) ?? void 0 : void 0;
        if (s || o || a ? (r.labelHighlights = s, r.descriptionHighlights = o, r.detailHighlights = a, r.hidden = !1) : (r.labelHighlights = void 0, r.descriptionHighlights = void 0, r.detailHighlights = void 0, r.hidden = r.item ? !r.item.alwaysShow : !0), r.item ? r.separator = void 0 : r.separator && (r.hidden = !0), !this.sortByLabel) {
          const l = r.index && this._inputElements[r.index - 1] || void 0;
          (l == null ? void 0 : l.type) === "separator" && !l.buttons && (n = l), n && !r.hidden && (r.separator = n, n = void 0);
        }
      });
    }
    return this._setElementsToTree(this._sortByLabel && e ? this._itemElements : this._elementTree), this._tree.layout(), !0;
  }
  toggleCheckbox() {
    this._elementCheckedEventBufferer.bufferEvents(() => {
      const e = this._tree.getFocus().filter((n) => n instanceof ll), t = this._allVisibleChecked(e);
      for (const n of e)
        n.checkboxDisabled || (n.checked = !t);
    });
  }
  style(e) {
    this._tree.style(e);
  }
  toggleHover() {
    const e = this._tree.getFocus()[0];
    if (!(e != null && e.saneTooltip) || !(e instanceof ll))
      return;
    if (this._lastHover && !this._lastHover.isDisposed) {
      this._lastHover.dispose();
      return;
    }
    this.showHover(e);
    const t = new ke();
    t.add(this._tree.onDidChangeFocus((n) => {
      n.elements[0] instanceof ll && this.showHover(n.elements[0]);
    })), this._lastHover && t.add(this._lastHover), this._elementDisposable.add(t);
  }
  //#endregion
  //#region private methods
  _setElementsToTree(e) {
    const t = new Array();
    for (const n of e)
      n instanceof NE ? t.push({
        element: n,
        collapsible: !1,
        collapsed: !1,
        children: n.children.map((r) => ({
          element: r,
          collapsible: !1,
          collapsed: !1
        }))
      }) : t.push({
        element: n,
        collapsible: !1,
        collapsed: !1
      });
    this._tree.setChildren(null, t);
  }
  _allVisibleChecked(e, t = !0) {
    for (let n = 0, r = e.length; n < r; n++) {
      const s = e[n];
      if (!s.hidden && s.item.pickable !== !1)
        if (s.checked)
          t = !0;
        else
          return !1;
    }
    return t;
  }
  _updateCheckedObservables() {
    Fr((e) => {
      this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements, !1), e);
      const t = this._itemElements.filter((n) => n.checked).length;
      this._checkedCountObservable.set(t, e), this._checkedElementsObservable.set(this.getCheckedElements(), e);
    });
  }
  /**
   * Disposes of the hover and shows a new one for the given index if it has a tooltip.
   * @param element The element to show the hover for
   */
  showHover(e) {
    var t, n, r;
    this._lastHover && !this._lastHover.isDisposed && ((n = (t = this.hoverDelegate).onDidHideHover) == null || n.call(t), (r = this._lastHover) == null || r.dispose()), !(!e.element || !e.saneTooltip) && (this._lastHover = this.hoverDelegate.showHover({
      content: e.saneTooltip,
      target: e.element,
      linkHandler: (s) => {
        this.linkOpenerDelegate(s);
      },
      appearance: {
        showPointer: !0
      },
      container: this._container,
      position: {
        hoverPosition: 1
        /* HoverPosition.RIGHT */
      }
    }, !1));
  }
};
XK([
  go
], F5.prototype, "onDidChangeFocus", null);
XK([
  go
], F5.prototype, "onDidChangeSelection", null);
F5 = XK([
  Cue(4, xt),
  Cue(5, Qa)
], F5);
function cMt(i, e) {
  const { text: t, iconOffsets: n } = e;
  if (!n || n.length === 0)
    return bRe(i, t);
  const r = pB(t, " "), s = t.length - r.length, o = bRe(i, r);
  if (o)
    for (const a of o) {
      const l = n[a.start + s] + s;
      a.start += l, a.end += l;
    }
  return o;
}
function bRe(i, e) {
  const t = e.toLowerCase().indexOf(i.toLowerCase());
  return t !== -1 ? [{ start: t, end: t + i.length }] : null;
}
function uMt(i, e, t) {
  const n = i.labelHighlights || [], r = e.labelHighlights || [];
  return n.length && !r.length ? -1 : !n.length && r.length ? 1 : n.length === 0 && r.length === 0 ? 0 : sMt(i.saneSortLabel, e.saneSortLabel, t);
}
function dMt(i, e = {}) {
  Pa.registerCommandAndKeybindingRule({
    weight: 200,
    when: YK,
    metadata: { description: S(1741, "Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.") },
    ...i,
    secondary: hme(i.primary, i.secondary ?? [], e)
  });
}
function Uu(i, e = {}) {
  Pa.registerCommandAndKeybindingRule({
    weight: 200,
    when: Re.and(Re.or(
      // Only things that use Tree widgets
      Re.equals(
        M5,
        "quickPick"
        /* QuickInputType.QuickPick */
      ),
      Re.equals(
        M5,
        "quickTree"
        /* QuickInputType.QuickTree */
      )
    ), YK),
    metadata: { description: S(1742, "Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.") },
    ...i,
    secondary: hme(i.primary, i.secondary ?? [], e)
  });
}
const B5 = Kn ? 256 : 2048;
function hme(i, e, t = {}) {
  return t.withAltMod && e.push(512 + i), t.withCtrlMod && (e.push(B5 + i), t.withAltMod && e.push(512 + B5 + i)), t.withCmdMod && Kn && (e.push(2048 + i), t.withCtrlMod && e.push(2304 + i), t.withAltMod && (e.push(2560 + i), t.withCtrlMod && e.push(2816 + i))), e;
}
function Dh(i, e) {
  return (t) => {
    const n = t.get(tc).currentQuickInput;
    if (n)
      return e && n.quickNavigate ? n.focus(e) : n.focus(i);
  };
}
Uu({ id: "quickInput.pageNext", primary: 12, handler: Dh(Yr.NextPage) }, { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 });
Uu({ id: "quickInput.pagePrevious", primary: 11, handler: Dh(Yr.PreviousPage) }, { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 });
Uu({ id: "quickInput.first", primary: B5 + 14, handler: Dh(Yr.First) }, { withAltMod: !0, withCmdMod: !0 });
Uu({ id: "quickInput.last", primary: B5 + 13, handler: Dh(Yr.Last) }, { withAltMod: !0, withCmdMod: !0 });
Uu({ id: "quickInput.next", primary: 18, handler: Dh(Yr.Next) }, { withCtrlMod: !0 });
Uu({ id: "quickInput.previous", primary: 16, handler: Dh(Yr.Previous) }, { withCtrlMod: !0 });
const vRe = S(1743, "If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."), yRe = S(1744, "If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");
Kn ? (Uu({
  id: "quickInput.nextSeparatorWithQuickAccessFallback",
  primary: 2066,
  handler: Dh(Yr.NextSeparator, Yr.Next),
  metadata: { description: vRe }
}), Uu({
  id: "quickInput.nextSeparator",
  primary: 2578,
  // Since macOS has the cmd key as the primary modifier, we need to add this additional
  // keybinding to capture cmd+ctrl+upArrow
  secondary: [
    2322
    /* KeyCode.DownArrow */
  ],
  handler: Dh(Yr.NextSeparator)
}, { withCtrlMod: !0 }), Uu({
  id: "quickInput.previousSeparatorWithQuickAccessFallback",
  primary: 2064,
  handler: Dh(Yr.PreviousSeparator, Yr.Previous),
  metadata: { description: yRe }
}), Uu({
  id: "quickInput.previousSeparator",
  primary: 2576,
  // Since macOS has the cmd key as the primary modifier, we need to add this additional
  // keybinding to capture cmd+ctrl+upArrow
  secondary: [
    2320
    /* KeyCode.UpArrow */
  ],
  handler: Dh(Yr.PreviousSeparator)
}, { withCtrlMod: !0 })) : (Uu({
  id: "quickInput.nextSeparatorWithQuickAccessFallback",
  primary: 530,
  handler: Dh(Yr.NextSeparator, Yr.Next),
  metadata: { description: vRe }
}), Uu({
  id: "quickInput.nextSeparator",
  primary: 2578,
  handler: Dh(Yr.NextSeparator)
}), Uu({
  id: "quickInput.previousSeparatorWithQuickAccessFallback",
  primary: 528,
  handler: Dh(Yr.PreviousSeparator, Yr.Previous),
  metadata: { description: yRe }
}), Uu({
  id: "quickInput.previousSeparator",
  primary: 2576,
  handler: Dh(Yr.PreviousSeparator)
}));
Pa.registerCommandAndKeybindingRule({
  id: "quickInput.accept",
  primary: 3,
  weight: 200,
  when: Re.and(
    // All other kinds of Quick things handle Accept, except Widget. In other words, Accepting is a detail on the things
    // that extend IQuickInput
    Re.notEquals(
      M5,
      "quickWidget"
      /* QuickInputType.QuickWidget */
    ),
    YK
  ),
  metadata: { description: S(1745, "Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.") },
  handler: (i) => {
    const e = i.get(tc).currentQuickInput;
    e == null || e.accept();
  },
  secondary: hme(3, [], { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 })
});
Uu({
  id: "quickInput.acceptInBackground",
  // If we are in the quick pick but the input box is not focused or our cursor is at the end of the input box
  when: Re.and(YK, Re.equals(
    M5,
    "quickPick"
    /* QuickInputType.QuickPick */
  ), Re.or(lpe.negate(), eMt)),
  primary: 17,
  // Need a little extra weight to ensure this keybinding is preferred over the default cmd+alt+right arrow keybinding
  // https://github.com/microsoft/vscode/blob/1451e4fbbbf074a4355cc537c35b547b80ce1c52/src/vs/workbench/browser/parts/editor/editorActions.ts#L1178-L1195
  weight: 250,
  handler: (i) => {
    const e = i.get(tc).currentQuickInput;
    e == null || e.accept(!0);
  }
}, { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 });
dMt({
  id: "quickInput.hide",
  primary: 9,
  handler: (i) => {
    const e = i.get(tc).currentQuickInput;
    e == null || e.hide();
  }
}, { withAltMod: !0, withCtrlMod: !0, withCmdMod: !0 });
Uu({
  id: "quickInput.toggleHover",
  primary: B5 | 10,
  handler: (i) => {
    i.get(tc).toggleHover();
  }
});
var hMt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, fMt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Sue;
const _P = Ge;
var GL;
let I$ = (GL = class extends ge {
  constructor(e, t, n, r) {
    super(), this._hoverDelegate = e, this._buttonTriggeredEmitter = t, this.onCheckedEvent = n, this._themeService = r, this.templateId = Sue.ID;
  }
  renderTemplate(e) {
    const t = new ke(), n = Fe(e, _P(".quick-input-tree-entry")), r = t.add(new GBe("", !1, { ...Rge, size: 15 }));
    n.appendChild(r.domNode);
    const s = Fe(n, _P("label.quick-input-tree-label")), o = Fe(s, _P(".quick-input-tree-rows")), a = Fe(o, _P(".quick-input-tree-row")), l = Sq(a, _P(".quick-input-tree-icon")), c = t.add(new a5(a, {
      supportHighlights: !0,
      supportDescriptionHighlights: !0,
      supportIcons: !0,
      hoverDelegate: this._hoverDelegate
    })), u = t.add(new qu(n, this._hoverDelegate ? { hoverDelegate: this._hoverDelegate } : void 0));
    return u.domNode.classList.add("quick-input-tree-entry-action-bar"), {
      toDisposeTemplate: t,
      entry: n,
      checkbox: r,
      icon: l,
      label: c,
      actionBar: u,
      toDisposeElement: new ke()
    };
  }
  renderElement(e, t, n, r) {
    const s = n.toDisposeElement, o = e.element;
    if (o.pickable === !1 ? n.checkbox.domNode.style.display = "none" : (n.checkbox.domNode.style.display = "", n.checkbox.checked = o.checked ?? !1, s.add(Ze.filter(this.onCheckedEvent, (d) => d.item === o)((d) => n.checkbox.checked = d.checked)), o.disabled && n.checkbox.disable()), o.iconPath) {
      const d = sT(this._themeService.getColorTheme().type) ? o.iconPath.dark : o.iconPath.light ?? o.iconPath.dark, h = Ht.revive(d);
      n.icon.className = "quick-input-tree-icon", n.icon.style.backgroundImage = mb(h);
    } else
      n.icon.style.backgroundImage = "", n.icon.className = o.iconClass ? `quick-input-tree-icon ${o.iconClass}` : "";
    const { labelHighlights: a, descriptionHighlights: l } = e.filterData || {};
    let c;
    o.description && (c = {
      markdown: {
        value: Ug(o.description),
        supportThemeIcons: !0
      },
      markdownNotSupportedFallback: o.description
    }), n.label.setLabel(o.label, o.description, {
      matches: a,
      descriptionMatches: l,
      extraClasses: o.iconClasses,
      italic: o.italic,
      strikethrough: o.strikethrough,
      labelEscapeNewLines: !0,
      descriptionTitle: c
    });
    const u = o.buttons;
    u && u.length ? (n.actionBar.push(u.map((d, h) => pR(d, `tree-${h}`, () => this._buttonTriggeredEmitter.fire({ item: o, button: d }))), { icon: !0, label: !1 }), n.entry.classList.add("has-actions")) : n.entry.classList.remove("has-actions");
  }
  disposeElement(e, t, n, r) {
    n.toDisposeElement.clear(), n.actionBar.clear();
  }
  disposeTemplate(e) {
    e.toDisposeElement.dispose(), e.toDisposeTemplate.dispose();
  }
}, Sue = GL, GL.ID = "quickInputTreeElement", GL);
I$ = Sue = hMt([
  fMt(3, to)
], I$);
class gMt {
  getHeight(e) {
    return 22;
  }
  getTemplateId(e) {
    return I$.ID;
  }
}
function pMt(i) {
  var s;
  let e = !1, t = !1, n = !1;
  for (const o of i) {
    switch ((s = o.element) == null ? void 0 : s.checked) {
      case "partial":
        n = !0;
        break;
      case !0:
        e = !0;
        break;
      default:
        t = !0;
        break;
    }
    if (e && t && n)
      break;
  }
  return t ? n || e ? "partial" : !1 : n ? "partial" : e;
}
class mMt {
  constructor(e) {
    this.onCheckedEvent = e;
  }
  getWidgetAriaLabel() {
    return S(1755, "Quick Tree");
  }
  getAriaLabel(e) {
    return e.ariaLabel || [e.label, e.description].map((t) => k4e(t)).filter((t) => !!t).join(", ");
  }
  getWidgetRole() {
    return "tree";
  }
  getRole(e) {
    return "checkbox";
  }
  isChecked(e) {
    return {
      get value() {
        return e.checked === !0;
      },
      onDidChange: (t) => Ze.filter(this.onCheckedEvent, (n) => n.item === e)((n) => t())
    };
  }
}
class _Mt {
  constructor() {
    this.filterValue = "", this.matchOnLabel = !0, this.matchOnDescription = !1;
  }
  filter(e, t) {
    if (!this.filterValue || !(this.matchOnLabel || this.matchOnDescription))
      return e.children ? { visibility: 2, data: {} } : { visibility: 1, data: {} };
    const n = this.matchOnLabel ? BF(this.filterValue, mx(e.label)) ?? void 0 : void 0, r = this.matchOnDescription ? BF(this.filterValue, mx(e.description || "")) ?? void 0 : void 0;
    return {
      visibility: t === 1 || n || r ? 1 : e.children ? 2 : 0,
      data: {
        labelHighlights: n,
        descriptionHighlights: r
      }
    };
  }
}
var bMt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, vMt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const yMt = Ge;
let Eue = class extends ge {
  constructor(e, t, n) {
    super(), this.instantiationService = n, this._onDidTriggerButton = this._register(new he()), this._onDidChangeCheckboxState = this._register(new he()), this.onDidChangeCheckboxState = this._onDidChangeCheckboxState.event, this._onDidCheckedLeafItemsChange = this._register(new he()), this._onLeave = new he(), this.onLeave = this._onLeave.event, this._onDidAccept = this._register(new he()), this.onDidAccept = this._onDidAccept.event, this._container = Fe(e, yMt(".quick-input-tree")), this._renderer = this._register(this.instantiationService.createInstance(I$, t, this._onDidTriggerButton, this.onDidChangeCheckboxState)), this._filter = this.instantiationService.createInstance(_Mt), this._tree = this._register(this.instantiationService.createInstance(bz, "QuickInputTree", this._container, new gMt(), [this._renderer], {
      accessibilityProvider: new mMt(this.onDidChangeCheckboxState),
      horizontalScrolling: !1,
      multipleSelectionSupport: !1,
      findWidgetEnabled: !1,
      alwaysConsumeMouseWheel: !0,
      hideTwistiesOfChildlessElements: !0,
      renderIndentGuides: ET.None,
      expandOnDoubleClick: !0,
      expandOnlyOnTwistieClick: !0,
      disableExpandOnSpacebar: !0,
      sorter: {
        compare: (r, s) => {
          if (r.label < s.label)
            return -1;
          if (r.label > s.label)
            return 1;
          if (r.description && s.description) {
            if (r.description < s.description)
              return -1;
            if (r.description > s.description)
              return 1;
          } else {
            if (r.description)
              return -1;
            if (s.description)
              return 1;
          }
          return 0;
        }
      },
      filter: this._filter
    })), this.registerOnOpenListener();
  }
  get tree() {
    return this._tree;
  }
  get displayed() {
    return this._container.style.display !== "none";
  }
  set displayed(e) {
    this._container.style.display = e ? "" : "none";
  }
  getActiveDescendant() {
    return this._tree.getHTMLElement().getAttribute("aria-activedescendant");
  }
  layout(e) {
    this._tree.getHTMLElement().style.maxHeight = e ? `${// Make sure height aligns with list item heights
    Math.floor(e / 44) * 44 + 6}px` : "", this._tree.layout();
  }
  registerOnOpenListener() {
    this._register(this._tree.onDidOpen((e) => {
      const t = e.element;
      if (!t || t.disabled)
        return;
      if (t.pickable === !1) {
        this._tree.setFocus([t]), this._onDidAccept.fire();
        return;
      }
      const n = t.checked !== !0;
      if ((t.checked ?? !1) === n)
        return;
      t.checked = n, this._tree.rerender(t);
      const r = /* @__PURE__ */ new Set(), s = [...this._tree.getNode(t).children];
      for (; s.length; ) {
        const a = s.shift();
        a != null && a.element && !r.has(a.element) && (r.add(a.element), (a.element.checked ?? !1) !== t.checked && (a.element.checked = t.checked, this._tree.rerender(a.element)), s.push(...a.children));
      }
      let o = this._tree.getParentElement(t);
      for (; o; ) {
        const a = [...this._tree.getNode(o).children], l = pMt(a);
        (o.checked ?? !1) !== l && (o.checked = l, this._tree.rerender(o)), o = this._tree.getParentElement(o);
      }
      this._onDidChangeCheckboxState.fire({
        item: t,
        checked: t.checked ?? !1
      }), this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems());
    }));
  }
  getCheckedLeafItems() {
    const e = /* @__PURE__ */ new Set(), t = [...this._tree.getNode().children], n = new Array();
    for (; t.length; ) {
      const r = t.shift();
      !(r != null && r.element) || e.has(r.element) || r.element.checked && (e.add(r.element), t.push(...r.children), r.element.children || n.push(r.element));
    }
    return n;
  }
};
Eue = bMt([
  vMt(2, xt)
], Eue);
var M9e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Sx = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, xue;
const mh = Ge, Gte = "workbench.quickInput.viewState";
var qL;
let Lue = (qL = class extends ge {
  // Max total width of quick input widget
  get currentQuickInput() {
    return this.controller ?? void 0;
  }
  get container() {
    return this._container;
  }
  constructor(e, t, n, r, s) {
    super(), this.options = e, this.layoutService = t, this.instantiationService = n, this.storageService = s, this.enabled = !0, this.onDidAcceptEmitter = this._register(new he()), this.onDidCustomEmitter = this._register(new he()), this.onDidTriggerButtonEmitter = this._register(new he()), this.keyMods = { ctrlCmd: !1, alt: !1 }, this.controller = null, this.onShowEmitter = this._register(new he()), this.onShow = this.onShowEmitter.event, this.onHideEmitter = this._register(new he()), this.onHide = this.onHideEmitter.event, this.inQuickInputContext = YOt.bindTo(r), this.quickInputTypeContext = QOt.bindTo(r), this.endOfQuickInputBoxContext = JOt.bindTo(r), this.idPrefix = e.idPrefix, this._container = e.container, this.styles = e.styles, this._register(Ze.runAndSubscribe(vB, ({ window: o, disposables: a }) => this.registerKeyModsListeners(o, a), { window: fr, disposables: this._store })), this._register(Iit((o) => {
      this.ui && At(this.ui.container) === o && (this.reparentUI(this.layoutService.mainContainer), this.layout(this.layoutService.mainContainerDimension, this.layoutService.mainContainerOffset.quickPickTop));
    })), this.viewState = this.loadViewState();
  }
  registerKeyModsListeners(e, t) {
    const n = (r) => {
      this.keyMods.ctrlCmd = r.ctrlKey || r.metaKey, this.keyMods.alt = r.altKey;
    };
    for (const r of [Xe.KEY_DOWN, Xe.KEY_UP, Xe.MOUSE_DOWN])
      t.add(Ce(e, r, n, !0));
  }
  getUI(e) {
    if (this.ui)
      return e && At(this._container) !== At(this.layoutService.activeContainer) && (this.reparentUI(this.layoutService.activeContainer), this.layout(this.layoutService.activeContainerDimension, this.layoutService.activeContainerOffset.quickPickTop)), this.ui;
    const t = Fe(this._container, mh(".quick-input-widget.show-file-icons"));
    t.tabIndex = -1, t.style.display = "none";
    const n = Zf(t), r = Fe(t, mh(".quick-input-titlebar")), s = this._register(new qu(r, { hoverDelegate: this.options.hoverDelegate }));
    s.domNode.classList.add("quick-input-left-action-bar");
    const o = Fe(r, mh(".quick-input-title")), a = this._register(new qu(r, { hoverDelegate: this.options.hoverDelegate }));
    a.domNode.classList.add("quick-input-right-action-bar");
    const l = Fe(t, mh(".quick-input-header")), c = this._register(new GBe(S(1746, "Toggle all checkboxes"), !1, { ...Rge, size: 15 }));
    Fe(l, c.domNode), this._register(c.onChange(() => {
      const G = c.checked;
      K.setAllVisibleChecked(G === !0);
    })), this._register(Ce(c.domNode, Xe.CLICK, (G) => {
      (G.x || G.y) && g.setFocus();
    }));
    const u = Fe(l, mh(".quick-input-description")), d = Fe(l, mh(".quick-input-and-message")), h = Fe(d, mh(".quick-input-filter")), g = this._register(new iMt(h, this.styles.inputBox, this.styles.toggle));
    g.setAttribute("aria-describedby", `${this.idPrefix}message`);
    const m = Fe(h, mh(".quick-input-visible-count"));
    m.setAttribute("aria-live", "polite"), m.setAttribute("aria-atomic", "true");
    const _ = this._register(new coe(m, { countFormat: S(1747, "{0} Results") }, this.styles.countBadge)), v = Fe(h, mh(".quick-input-count"));
    v.setAttribute("aria-live", "polite");
    const w = this._register(new coe(v, { countFormat: S(1748, "{0} Selected") }, this.styles.countBadge)), E = this._register(new qu(l, { hoverDelegate: this.options.hoverDelegate }));
    E.domNode.classList.add("quick-input-inline-action-bar");
    const L = Fe(l, mh(".quick-input-action")), T = this._register(new ZU(L, this.styles.button));
    T.label = S(1749, "OK"), this._register(T.onDidClick((G) => {
      this.onDidAcceptEmitter.fire();
    }));
    const D = Fe(l, mh(".quick-input-action")), N = this._register(new ZU(D, { ...this.styles.button, supportIcons: !0 }));
    N.label = S(1750, "Custom"), this._register(N.onDidClick((G) => {
      this.onDidCustomEmitter.fire();
    }));
    const R = Fe(d, mh(`#${this.idPrefix}message.quick-input-message`)), M = this._register(new yue(t, this.styles.progressBar));
    M.getContainer().classList.add("quick-input-progress");
    const B = Fe(t, mh(".quick-input-html-widget"));
    B.tabIndex = -1;
    const H = Fe(t, mh(".quick-input-description")), j = this.idPrefix + "list", K = this._register(this.instantiationService.createInstance(F5, t, this.options.hoverDelegate, this.options.linkOpenerDelegate, j));
    g.setAttribute("aria-controls", j), this._register(K.onDidChangeFocus(() => {
      g.hasFocus() && g.setAttribute("aria-activedescendant", K.getActiveDescendant() ?? "");
    })), this._register(K.onChangedAllVisibleChecked((G) => {
      c.checked = G;
    })), this._register(K.onChangedVisibleCount((G) => {
      _.setCount(G);
    })), this._register(K.onChangedCheckedCount((G) => {
      w.setCount(G);
    })), this._register(K.onLeave(() => {
      setTimeout(() => {
        this.controller && (g.setFocus(), this.controller instanceof c3 && this.controller.canSelectMany && K.clearFocus());
      }, 0);
    }));
    const X = this._register(this.instantiationService.createInstance(Eue, t, this.options.hoverDelegate));
    this._register(X.tree.onDidChangeFocus(() => {
      g.hasFocus() && g.setAttribute("aria-activedescendant", X.getActiveDescendant() ?? "");
    })), this._register(X.onLeave(() => {
      setTimeout(() => {
        this.controller && (g.setFocus(), X.tree.setFocus([]));
      }, 0);
    })), this._register(X.onDidAccept(() => {
      this.onDidAcceptEmitter.fire();
    })), this._register(X.tree.onDidChangeContentHeight(() => this.updateLayout()));
    const Y = qf(t);
    return this._register(Y), this._register(Ce(t, Xe.FOCUS, (G) => {
      const Q = this.getUI();
      if (pa(G.relatedTarget, Q.inputContainer)) {
        const oe = Q.inputBox.isSelectionAtEnd();
        this.endOfQuickInputBoxContext.get() !== oe && this.endOfQuickInputBoxContext.set(oe);
      }
      pa(G.relatedTarget, Q.container) || (this.inQuickInputContext.set(!0), this.previousFocusElement = eo(G.relatedTarget) ? G.relatedTarget : void 0);
    }, !0)), this._register(Y.onDidBlur(() => {
      !this.getUI().ignoreFocusOut && !this.options.ignoreFocusOut() && this.hide(Y4.Blur), this.inQuickInputContext.set(!1), this.endOfQuickInputBoxContext.set(!1), this.previousFocusElement = void 0;
    })), this._register(g.onKeyDown((G) => {
      const Q = this.getUI().inputBox.isSelectionAtEnd();
      this.endOfQuickInputBoxContext.get() !== Q && this.endOfQuickInputBoxContext.set(Q), g.removeAttribute("aria-activedescendant");
    })), this._register(Ce(t, Xe.FOCUS, (G) => {
      g.setFocus();
    })), this.dndController = this._register(this.instantiationService.createInstance(Tue, this._container, t, [
      {
        node: r,
        includeChildren: !0
      },
      {
        node: l,
        includeChildren: !1
      }
    ], this.viewState)), this._register(Xt((G) => {
      var oe;
      const Q = (oe = this.dndController) == null ? void 0 : oe.dndViewState.read(G);
      Q && (Q.top !== void 0 && Q.left !== void 0 ? this.viewState = {
        ...this.viewState,
        top: Q.top,
        left: Q.left
      } : this.viewState = void 0, this.updateLayout(), Q.done && this.saveViewState(this.viewState));
    })), this.ui = {
      container: t,
      styleSheet: n,
      leftActionBar: s,
      titleBar: r,
      title: o,
      description1: H,
      description2: u,
      widget: B,
      rightActionBar: a,
      inlineActionBar: E,
      checkAll: c,
      inputContainer: d,
      filterContainer: h,
      inputBox: g,
      visibleCountContainer: m,
      visibleCount: _,
      countContainer: v,
      count: w,
      okContainer: L,
      ok: T,
      message: R,
      customButtonContainer: D,
      customButton: N,
      list: K,
      tree: X,
      progressBar: M,
      onDidAccept: this.onDidAcceptEmitter.event,
      onDidCustom: this.onDidCustomEmitter.event,
      onDidTriggerButton: this.onDidTriggerButtonEmitter.event,
      ignoreFocusOut: !1,
      keyMods: this.keyMods,
      show: (G) => this.show(G),
      hide: () => this.hide(),
      setVisibilities: (G) => this.setVisibilities(G),
      setEnabled: (G) => this.setEnabled(G),
      setContextKey: (G) => this.options.setContextKey(G),
      linkOpenerDelegate: (G) => this.options.linkOpenerDelegate(G)
    }, this.updateStyles(), this.ui;
  }
  reparentUI(e) {
    var t;
    this.ui && (this._container = e, Fe(this._container, this.ui.container), (t = this.dndController) == null || t.reparentUI(this._container));
  }
  pick(e, t = {}, n = $n.None) {
    return new Promise((r, s) => {
      let o = (u) => {
        var d;
        o = r, (d = t.onKeyMods) == null || d.call(t, a.keyMods), r(u);
      };
      if (n.isCancellationRequested) {
        o(void 0);
        return;
      }
      const a = this.createQuickPick({ useSeparators: !0 });
      let l;
      const c = [
        a,
        a.onDidAccept(() => {
          if (a.canSelectMany)
            o(a.selectedItems.slice()), a.hide();
          else {
            const u = a.activeItems[0];
            u && (o(u), a.hide());
          }
        }),
        a.onDidChangeActive((u) => {
          const d = u[0];
          d && t.onDidFocus && t.onDidFocus(d);
        }),
        a.onDidChangeSelection((u) => {
          if (!a.canSelectMany) {
            const d = u[0];
            d && (o(d), a.hide());
          }
        }),
        a.onDidTriggerItemButton((u) => t.onDidTriggerItemButton && t.onDidTriggerItemButton({
          ...u,
          removeItem: () => {
            const d = a.items.indexOf(u.item);
            if (d !== -1) {
              const h = a.items.slice(), g = h.splice(d, 1), m = a.activeItems.filter((v) => v !== g[0]), _ = a.keepScrollPosition;
              a.keepScrollPosition = !0, a.items = h, m && (a.activeItems = m), a.keepScrollPosition = _;
            }
          }
        })),
        a.onDidTriggerSeparatorButton((u) => {
          var d;
          return (d = t.onDidTriggerSeparatorButton) == null ? void 0 : d.call(t, u);
        }),
        a.onDidChangeValue((u) => {
          l && !u && (a.activeItems.length !== 1 || a.activeItems[0] !== l) && (a.activeItems = [l]);
        }),
        n.onCancellationRequested(() => {
          a.hide();
        }),
        a.onDidHide(() => {
          or(c), o(void 0);
        })
      ];
      a.title = t.title, t.value && (a.value = t.value), a.canSelectMany = !!t.canPickMany, a.placeholder = t.placeHolder, a.ignoreFocusOut = !!t.ignoreFocusLost, a.matchOnDescription = !!t.matchOnDescription, a.matchOnDetail = !!t.matchOnDetail, t.sortByLabel !== void 0 && (a.sortByLabel = t.sortByLabel), a.matchOnLabel = t.matchOnLabel === void 0 || t.matchOnLabel, a.quickNavigate = t.quickNavigate, a.hideInput = !!t.hideInput, a.contextKey = t.contextKey, a.busy = !0, Promise.all([e, t.activeItem]).then(([u, d]) => {
        l = d, a.busy = !1, a.items = u, a.canSelectMany && (a.selectedItems = u.filter((h) => h.type !== "separator" && h.picked)), l && (a.activeItems = [l]);
      }), a.show(), Promise.resolve(e).then(void 0, (u) => {
        s(u), a.hide();
      });
    });
  }
  setValidationOnInput(e, t) {
    t && ga(t) ? (e.severity = Rs.Error, e.validationMessage = t) : t && !ga(t) ? (e.severity = t.severity, e.validationMessage = t.content) : (e.severity = Rs.Ignore, e.validationMessage = void 0);
  }
  input(e = {}, t = $n.None) {
    return new Promise((n) => {
      if (t.isCancellationRequested) {
        n(void 0);
        return;
      }
      const r = this.createInputBox(), s = e.validateInput || (() => Promise.resolve(void 0)), o = Ze.debounce(r.onDidChangeValue, (u, d) => d, 100);
      let a = e.value || "", l = Promise.resolve(s(a));
      const c = [
        r,
        o((u) => {
          u !== a && (l = Promise.resolve(s(u)), a = u), l.then((d) => {
            u === a && this.setValidationOnInput(r, d);
          });
        }),
        r.onDidAccept(() => {
          const u = r.value;
          u !== a && (l = Promise.resolve(s(u)), a = u), l.then((d) => {
            !d || !ga(d) && d.severity !== Rs.Error ? (n(u), r.hide()) : u === a && this.setValidationOnInput(r, d);
          });
        }),
        t.onCancellationRequested(() => {
          r.hide();
        }),
        r.onDidHide(() => {
          or(c), n(void 0);
        })
      ];
      r.title = e.title, r.value = e.value || "", r.valueSelection = e.valueSelection, r.prompt = e.prompt, r.placeholder = e.placeHolder, r.password = !!e.password, r.ignoreFocusOut = !!e.ignoreFocusLost, r.show();
    });
  }
  createQuickPick(e = { useSeparators: !1 }) {
    const t = this.getUI(!0);
    return new c3(t);
  }
  createInputBox() {
    const e = this.getUI(!0);
    return new tMt(e);
  }
  show(e) {
    var s;
    const t = this.getUI(!0);
    this.onShowEmitter.fire();
    const n = this.controller;
    this.controller = e, n == null || n.didHide(), this.setEnabled(!0), t.leftActionBar.clear(), t.title.textContent = "", t.description1.textContent = "", t.description2.textContent = "", ma(t.widget), t.rightActionBar.clear(), t.inlineActionBar.clear(), t.checkAll.checked = !1, t.inputBox.placeholder = "", t.inputBox.password = !1, t.inputBox.showDecoration(Rs.Ignore), t.visibleCount.setCount(0), t.count.setCount(0), ma(t.message), t.progressBar.stop(), t.list.setElements([]), t.list.matchOnDescription = !1, t.list.matchOnDetail = !1, t.list.matchOnLabel = !0, t.list.sortByLabel = !0, t.ignoreFocusOut = !1, t.inputBox.toggles = void 0;
    const r = this.options.backKeybindingLabel();
    bue.tooltip = r ? S(1751, "Back ({0})", r) : S(1752, "Back"), t.container.style.display = "", this.updateLayout(), (s = this.dndController) == null || s.layoutContainer(), t.inputBox.setFocus(), this.quickInputTypeContext.set(e.type);
  }
  isVisible() {
    return !!this.ui && this.ui.container.style.display !== "none";
  }
  setVisibilities(e) {
    const t = this.getUI();
    t.title.style.display = e.title ? "" : "none", t.description1.style.display = e.description && (e.inputBox || e.checkAll) ? "" : "none", t.description2.style.display = e.description && !(e.inputBox || e.checkAll) ? "" : "none", t.checkAll.domNode.style.display = e.checkAll ? "" : "none", t.inputContainer.style.display = e.inputBox ? "" : "none", t.filterContainer.style.display = e.inputBox ? "" : "none", t.visibleCountContainer.style.display = e.visibleCount ? "" : "none", t.countContainer.style.display = e.count ? "" : "none", t.okContainer.style.display = e.ok ? "" : "none", t.customButtonContainer.style.display = e.customButton ? "" : "none", t.message.style.display = e.message ? "" : "none", t.progressBar.getContainer().style.display = e.progressBar ? "" : "none", t.list.displayed = !!e.list, t.tree.displayed = !!e.tree, t.container.classList.toggle("show-checkboxes", !!e.checkBox), t.container.classList.toggle("hidden-input", !e.inputBox && !e.description), this.updateLayout();
  }
  setEnabled(e) {
    if (e !== this.enabled) {
      this.enabled = e;
      const t = this.getUI();
      for (const n of t.leftActionBar.viewItems)
        n.action.enabled = e;
      for (const n of t.rightActionBar.viewItems)
        n.action.enabled = e;
      e ? t.checkAll.enable() : t.checkAll.disable(), t.inputBox.enabled = e, t.ok.enabled = e, t.list.enabled = e;
    }
  }
  hide(e) {
    var s;
    const t = this.controller;
    if (!t)
      return;
    t.willHide(e);
    const n = (s = this.ui) == null ? void 0 : s.container, r = n && !NPe(n);
    if (this.controller = null, this.onHideEmitter.fire(), n && (n.style.display = "none"), !r) {
      let o = this.previousFocusElement;
      for (; o && !o.offsetParent; )
        o = o.parentElement ?? void 0;
      o != null && o.offsetParent ? (o.focus(), this.previousFocusElement = void 0) : this.options.returnFocus();
    }
    t.didHide(e);
  }
  toggleHover() {
    this.isVisible() && this.controller instanceof c3 && this.getUI().list.toggleHover();
  }
  layout(e, t) {
    this.dimension = e, this.titleBarOffset = t, this.updateLayout();
  }
  updateLayout() {
    var e, t;
    if (this.ui && this.isVisible()) {
      const n = this.ui.container.style, r = Math.min(this.dimension.width * 0.62, xue.MAX_WIDTH);
      n.width = r + "px", n.top = `${(e = this.viewState) != null && e.top ? Math.round(this.dimension.height * this.viewState.top) : this.titleBarOffset}px`, n.left = `${Math.round(this.dimension.width * (((t = this.viewState) == null ? void 0 : t.left) ?? 0.5) - r / 2)}px`, this.ui.inputBox.layout(), this.ui.list.layout(this.dimension && this.dimension.height * 0.4), this.ui.tree.layout(this.dimension && this.dimension.height * 0.4);
    }
  }
  applyStyles(e) {
    this.styles = e, this.updateStyles();
  }
  updateStyles() {
    if (this.ui) {
      const { quickInputTitleBackground: e, quickInputBackground: t, quickInputForeground: n, widgetBorder: r, widgetShadow: s } = this.styles.widget;
      this.ui.titleBar.style.backgroundColor = e ?? "", this.ui.container.style.backgroundColor = t ?? "", this.ui.container.style.color = n ?? "", this.ui.container.style.border = r ? `1px solid ${r}` : "", this.ui.container.style.boxShadow = s ? `0 0 8px 2px ${s}` : "", this.ui.list.style(this.styles.list), this.ui.tree.tree.style(this.styles.list);
      const o = [];
      this.styles.pickerGroup.pickerGroupBorder && o.push(`.quick-input-list .quick-input-list-entry { border-top-color:  ${this.styles.pickerGroup.pickerGroupBorder}; }`), this.styles.pickerGroup.pickerGroupForeground && o.push(`.quick-input-list .quick-input-list-separator { color:  ${this.styles.pickerGroup.pickerGroupForeground}; }`), this.styles.pickerGroup.pickerGroupForeground && o.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"), (this.styles.keybindingLabel.keybindingLabelBackground || this.styles.keybindingLabel.keybindingLabelBorder || this.styles.keybindingLabel.keybindingLabelBottomBorder || this.styles.keybindingLabel.keybindingLabelShadow || this.styles.keybindingLabel.keybindingLabelForeground) && (o.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"), this.styles.keybindingLabel.keybindingLabelBackground && o.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`), this.styles.keybindingLabel.keybindingLabelBorder && o.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`), this.styles.keybindingLabel.keybindingLabelBottomBorder && o.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`), this.styles.keybindingLabel.keybindingLabelShadow && o.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`), this.styles.keybindingLabel.keybindingLabelForeground && o.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`), o.push("}"));
      const a = o.join(`
`);
      a !== this.ui.styleSheet.textContent && (this.ui.styleSheet.textContent = a);
    }
  }
  loadViewState() {
    try {
      const e = JSON.parse(this.storageService.get(Gte, -1, "{}"));
      if (e.top !== void 0 || e.left !== void 0)
        return e;
    } catch {
    }
  }
  saveViewState(e) {
    this.layoutService.activeContainer === this.layoutService.mainContainer && (e !== void 0 ? this.storageService.store(
      Gte,
      JSON.stringify(e),
      -1,
      1
      /* StorageTarget.MACHINE */
    ) : this.storageService.remove(
      Gte,
      -1
      /* StorageScope.APPLICATION */
    ));
  }
}, xue = qL, qL.MAX_WIDTH = 600, qL);
Lue = xue = M9e([
  Sx(1, Ib),
  Sx(2, xt),
  Sx(3, Jt),
  Sx(4, gu)
], Lue);
let Tue = class extends ge {
  constructor(e, t, n, r, s, o, a) {
    super(), this._container = e, this._quickInputContainer = t, this._quickInputDragAreas = n, this._layoutService = s, this.configurationService = a, this.dndViewState = Qt(this, void 0), this._snapThreshold = 20, this._snapLineHorizontalRatio = 0.25, this._quickInputAlignmentContext = ZOt.bindTo(o);
    const l = Ryt(this.configurationService) === "custom";
    this._controlsOnLeft = l && IJ === 1, this._controlsOnRight = l && (IJ === 3 || IJ === 2), this._registerLayoutListener(), this.registerMouseListeners(), this.dndViewState.set({ ...r, done: !0 }, void 0);
  }
  reparentUI(e) {
    this._container = e;
  }
  layoutContainer(e = this._layoutService.activeContainerDimension) {
    const t = this.dndViewState.get(), n = this._quickInputContainer.getBoundingClientRect();
    if (t != null && t.top && (t != null && t.left)) {
      const r = Math.round(t.left * 100) / 100, s = e.width, o = n.width, a = r * s - o / 2;
      this._layout(t.top * e.height, a);
    }
  }
  _registerLayoutListener() {
    this._register(Ze.filter(this._layoutService.onDidLayoutContainer, (e) => e.container === this._container)((e) => this.layoutContainer(e.dimension)));
  }
  registerMouseListeners() {
    const e = this._quickInputContainer;
    this._register(Hxe(e, (t) => {
      const n = new vl(At(e), t);
      n.detail === 2 && this._quickInputDragAreas.some(({ node: r, includeChildren: s }) => s ? pa(n.target, r) : n.target === r) && this.dndViewState.set({ top: void 0, left: void 0, done: !0 }, void 0);
    })), this._register(TPe(e, (t) => {
      const n = At(this._layoutService.activeContainer), r = new vl(n, t);
      if (!this._quickInputDragAreas.some(({ node: d, includeChildren: h }) => h ? pa(r.target, d) : r.target === d))
        return;
      const s = this._quickInputContainer.getBoundingClientRect(), o = r.browserEvent.clientX - s.left, a = r.browserEvent.clientY - s.top;
      let l = !1;
      const c = Mit(n, (d) => {
        new vl(n, d).preventDefault(), l || (l = !0), this._layout(d.clientY - a, d.clientX - o);
      }), u = Hxe(n, (d) => {
        if (l) {
          const h = this.dndViewState.get();
          this.dndViewState.set({ top: h == null ? void 0 : h.top, left: h == null ? void 0 : h.left, done: !0 }, void 0);
        }
        c.dispose(), u.dispose();
      });
    }));
  }
  _layout(e, t) {
    const n = this._getTopSnapValue(), r = this._getCenterYSnapValue(), s = this._getCenterXSnapValue();
    e = Math.max(0, Math.min(e, this._container.clientHeight - this._quickInputContainer.clientHeight)), e < this._layoutService.activeContainerOffset.top && (this._controlsOnLeft ? t = Math.max(t, 80 / Gne(rr())) : this._controlsOnRight && (t = Math.min(t, this._container.clientWidth - this._quickInputContainer.clientWidth - 140 / Gne(rr()))));
    const o = Math.abs(e - n) < this._snapThreshold;
    e = o ? n : e;
    const a = Math.abs(e - r) < this._snapThreshold;
    e = a ? r : e;
    const l = e / this._container.clientHeight;
    t = Math.max(0, Math.min(t, this._container.clientWidth - this._quickInputContainer.clientWidth));
    const c = Math.abs(t - s) < this._snapThreshold;
    t = c ? s : t;
    const u = this._container.clientWidth, d = this._quickInputContainer.clientWidth, g = (t + d / 2) / u;
    if (this.dndViewState.set({ top: l, left: g, done: !1 }, void 0), c) {
      if (o) {
        this._quickInputAlignmentContext.set("top");
        return;
      } else if (a) {
        this._quickInputAlignmentContext.set("center");
        return;
      }
    }
    this._quickInputAlignmentContext.set(void 0);
  }
  _getTopSnapValue() {
    return this._layoutService.activeContainerOffset.quickPickTop;
  }
  _getCenterYSnapValue() {
    return Math.round(this._container.clientHeight * this._snapLineHorizontalRatio);
  }
  _getCenterXSnapValue() {
    return Math.round(this._container.clientWidth / 2) - Math.round(this._quickInputContainer.clientWidth / 2);
  }
};
Tue = M9e([
  Sx(4, Ib),
  Sx(5, Jt),
  Sx(6, xn)
], Tue);
var CMt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, bP = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let kue = class extends _ut {
  get controller() {
    return this._controller || (this._controller = this._register(this.createController())), this._controller;
  }
  get hasController() {
    return !!this._controller;
  }
  get currentQuickInput() {
    return this.controller.currentQuickInput;
  }
  get quickAccess() {
    return this._quickAccess || (this._quickAccess = this._register(this.instantiationService.createInstance(_ue))), this._quickAccess;
  }
  constructor(e, t, n, r, s) {
    super(n), this.instantiationService = e, this.contextKeyService = t, this.layoutService = r, this.configurationService = s, this._onShow = this._register(new he()), this._onHide = this._register(new he()), this.contexts = /* @__PURE__ */ new Map();
  }
  createController(e = this.layoutService, t) {
    const n = {
      idPrefix: "quickInput_",
      container: e.activeContainer,
      ignoreFocusOut: () => !1,
      backKeybindingLabel: () => {
      },
      setContextKey: (s) => this.setContextKey(s),
      linkOpenerDelegate: (s) => {
        this.instantiationService.invokeFunction((o) => {
          o.get(ad).open(s, { allowCommands: !0, fromUserGesture: !0 });
        });
      },
      returnFocus: () => e.focus(),
      styles: this.computeStyles(),
      hoverDelegate: this._register(this.instantiationService.createInstance(vue))
    }, r = this._register(this.instantiationService.createInstance(Lue, {
      ...n,
      ...t
    }));
    return r.layout(e.activeContainerDimension, e.activeContainerOffset.quickPickTop), this._register(e.onDidLayoutActiveContainer((s) => {
      At(e.activeContainer) === At(r.container) && r.layout(s, e.activeContainerOffset.quickPickTop);
    })), this._register(e.onDidChangeActiveContainer(() => {
      r.isVisible() || r.layout(e.activeContainerDimension, e.activeContainerOffset.quickPickTop);
    })), this._register(r.onShow(() => {
      this.resetContextKeys(), this._onShow.fire();
    })), this._register(r.onHide(() => {
      this.resetContextKeys(), this._onHide.fire();
    })), r;
  }
  setContextKey(e) {
    let t;
    e && (t = this.contexts.get(e), t || (t = new ut(e, !1).bindTo(this.contextKeyService), this.contexts.set(e, t))), !(t && t.get()) && (this.resetContextKeys(), t == null || t.set(!0));
  }
  resetContextKeys() {
    this.contexts.forEach((e) => {
      e.get() && e.reset();
    });
  }
  pick(e, t, n = $n.None) {
    return this.controller.pick(e, t, n);
  }
  input(e = {}, t = $n.None) {
    return this.controller.input(e, t);
  }
  createQuickPick(e = { useSeparators: !1 }) {
    return this.controller.createQuickPick(e);
  }
  createInputBox() {
    return this.controller.createInputBox();
  }
  toggleHover() {
    this.hasController && this.controller.toggleHover();
  }
  updateStyles() {
    this.hasController && this.controller.applyStyles(this.computeStyles());
  }
  computeStyles() {
    return {
      widget: {
        quickInputBackground: je(eee),
        quickInputForeground: je(oct),
        quickInputTitleBackground: je(act),
        widgetBorder: je(Efe),
        widgetShadow: je(e2)
      },
      inputBox: VU,
      toggle: WU,
      countBadge: C5e,
      button: xyt,
      progressBar: Lyt,
      keybindingLabel: y5e,
      list: JT({
        listBackground: eee,
        listFocusBackground: v4,
        listFocusForeground: b4,
        // Look like focused when inactive.
        listInactiveFocusForeground: b4,
        listInactiveSelectionIconForeground: Ife,
        listInactiveFocusBackground: v4,
        listFocusOutline: fs,
        listInactiveFocusOutline: fs,
        treeStickyScrollBackground: eee
      }),
      pickerGroup: {
        pickerGroupBorder: je(lct),
        pickerGroupForeground: je($Fe)
      }
    };
  }
};
kue = CMt([
  bP(0, xt),
  bP(1, Jt),
  bP(2, to),
  bP(3, Ib),
  bP(4, xn)
], kue);
var P9e = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, XE = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Due = class extends kue {
  constructor(e, t, n, r, s, o) {
    super(t, n, r, new Qce(e.getContainerDomNode(), s), o), this.host = void 0;
    const a = H5.get(e);
    if (a) {
      const l = a.widget;
      this.host = {
        _serviceBrand: void 0,
        get mainContainer() {
          return l.getDomNode();
        },
        getContainer() {
          return l.getDomNode();
        },
        whenContainerStylesLoaded() {
        },
        get containers() {
          return [l.getDomNode()];
        },
        get activeContainer() {
          return l.getDomNode();
        },
        get mainContainerDimension() {
          return e.getLayoutInfo();
        },
        get activeContainerDimension() {
          return e.getLayoutInfo();
        },
        get onDidLayoutMainContainer() {
          return e.onDidLayoutChange;
        },
        get onDidLayoutActiveContainer() {
          return e.onDidLayoutChange;
        },
        get onDidLayoutContainer() {
          return Ze.map(e.onDidLayoutChange, (c) => ({ container: l.getDomNode(), dimension: c }));
        },
        get onDidChangeActiveContainer() {
          return Ze.None;
        },
        get onDidAddContainer() {
          return Ze.None;
        },
        get mainContainerOffset() {
          return { top: 0, quickPickTop: 0 };
        },
        get activeContainerOffset() {
          return { top: 0, quickPickTop: 0 };
        },
        focus: () => e.focus()
      };
    } else
      this.host = void 0;
  }
  createController() {
    return super.createController(this.host);
  }
};
Due = P9e([
  XE(1, xt),
  XE(2, Jt),
  XE(3, to),
  XE(4, Ti),
  XE(5, xn)
], Due);
let Iue = class {
  get activeService() {
    const e = this.codeEditorService.getFocusedCodeEditor();
    if (!e)
      throw new Error("Quick input service needs a focused editor to work.");
    let t = this.mapEditorToService.get(e);
    if (!t) {
      const n = t = this.instantiationService.createInstance(Due, e);
      this.mapEditorToService.set(e, t), JL(e.onDidDispose)(() => {
        n.dispose(), this.mapEditorToService.delete(e);
      });
    }
    return t;
  }
  get currentQuickInput() {
    return this.activeService.currentQuickInput;
  }
  get quickAccess() {
    return this.activeService.quickAccess;
  }
  constructor(e, t) {
    this.instantiationService = e, this.codeEditorService = t, this.mapEditorToService = /* @__PURE__ */ new Map();
  }
  pick(e, t, n = $n.None) {
    return this.activeService.pick(e, t, n);
  }
  input(e, t) {
    return this.activeService.input(e, t);
  }
  createQuickPick(e = { useSeparators: !1 }) {
    return this.activeService.createQuickPick(e);
  }
  createInputBox() {
    return this.activeService.createInputBox();
  }
  toggleHover() {
    return this.activeService.toggleHover();
  }
};
Iue = P9e([
  XE(0, xt),
  XE(1, Ti)
], Iue);
const lq = class lq {
  static get(e) {
    return e.getContribution(lq.ID);
  }
  constructor(e) {
    this.editor = e, this.widget = new Nue(this.editor);
  }
  dispose() {
    this.widget.dispose();
  }
};
lq.ID = "editor.controller.quickInput";
let H5 = lq;
const cq = class cq {
  constructor(e) {
    this.codeEditor = e, this.domNode = document.createElement("div"), this.codeEditor.addOverlayWidget(this);
  }
  getId() {
    return cq.ID;
  }
  getDomNode() {
    return this.domNode;
  }
  getPosition() {
    return { preference: { top: 0, left: 0 } };
  }
  dispose() {
    this.codeEditor.removeOverlayWidget(this);
  }
};
cq.ID = "editor.contrib.quickInputWidget";
let Nue = cq;
Si(
  H5.ID,
  H5,
  4
  /* EditorContributionInstantiation.Lazy */
);
var wMt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, qte = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Rue = class extends ge {
  constructor(e, t, n) {
    super(), this._contextKeyService = e, this._layoutService = t, this._configurationService = n, this._accessibilitySupport = 0, this._onDidChangeScreenReaderOptimized = new he(), this._onDidChangeReducedMotion = new he(), this._onDidChangeLinkUnderline = new he(), this._accessibilityModeEnabledContext = QA.bindTo(this._contextKeyService);
    const r = () => this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());
    this._register(this._configurationService.onDidChangeConfiguration((o) => {
      o.affectsConfiguration("editor.accessibilitySupport") && (r(), this._onDidChangeScreenReaderOptimized.fire()), o.affectsConfiguration("workbench.reduceMotion") && (this._configMotionReduced = this._configurationService.getValue("workbench.reduceMotion"), this._onDidChangeReducedMotion.fire());
    })), r(), this._register(this.onDidChangeScreenReaderOptimized(() => r()));
    const s = fr.matchMedia("(prefers-reduced-motion: reduce)");
    this._systemMotionReduced = s.matches, this._configMotionReduced = this._configurationService.getValue("workbench.reduceMotion"), this._linkUnderlinesEnabled = this._configurationService.getValue("accessibility.underlineLinks"), this.initReducedMotionListeners(s), this.initLinkUnderlineListeners();
  }
  initReducedMotionListeners(e) {
    this._register(Ce(e, "change", () => {
      this._systemMotionReduced = e.matches, this._configMotionReduced === "auto" && this._onDidChangeReducedMotion.fire();
    }));
    const t = () => {
      const n = this.isMotionReduced();
      this._layoutService.mainContainer.classList.toggle("reduce-motion", n), this._layoutService.mainContainer.classList.toggle("enable-motion", !n);
    };
    t(), this._register(this.onDidChangeReducedMotion(() => t()));
  }
  initLinkUnderlineListeners() {
    this._register(this._configurationService.onDidChangeConfiguration((t) => {
      if (t.affectsConfiguration("accessibility.underlineLinks")) {
        const n = this._configurationService.getValue("accessibility.underlineLinks");
        this._linkUnderlinesEnabled = n, this._onDidChangeLinkUnderline.fire();
      }
    }));
    const e = () => {
      const t = this._linkUnderlinesEnabled;
      this._layoutService.mainContainer.classList.toggle("underline-links", t);
    };
    e(), this._register(this.onDidChangeLinkUnderlines(() => e()));
  }
  onDidChangeLinkUnderlines(e) {
    return this._onDidChangeLinkUnderline.event(e);
  }
  get onDidChangeScreenReaderOptimized() {
    return this._onDidChangeScreenReaderOptimized.event;
  }
  isScreenReaderOptimized() {
    const e = this._configurationService.getValue("editor.accessibilitySupport");
    return e === "on" || e === "auto" && this._accessibilitySupport === 2;
  }
  get onDidChangeReducedMotion() {
    return this._onDidChangeReducedMotion.event;
  }
  isMotionReduced() {
    const e = this._configMotionReduced;
    return e === "on" || e === "auto" && this._systemMotionReduced;
  }
  getAccessibilitySupport() {
    return this._accessibilitySupport;
  }
};
Rue = wMt([
  qte(0, Jt),
  qte(1, Ib),
  qte(2, xn)
], Rue);
var SMt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, CRe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
}, Aue;
const wRe = "application/vnd.code.resources";
var KL;
let Oue = (KL = class extends ge {
  constructor(e, t) {
    super(), this.layoutService = e, this.logService = t, this.mapTextToType = /* @__PURE__ */ new Map(), this.findText = "", this.resources = [], this.resourcesStateHash = void 0, (XL || RMe) && this.installWebKitWriteTextWorkaround(), this._register(Ze.runAndSubscribe(vB, ({ window: n, disposables: r }) => {
      r.add(Ce(n.document, "copy", () => this.clearResourcesState()));
    }, { window: fr, disposables: this._store }));
  }
  triggerPaste() {
    this.logService.trace("BrowserClipboardService#triggerPaste");
  }
  // In Safari, it has the following note:
  //
  // "The request to write to the clipboard must be triggered during a user gesture.
  // A call to clipboard.write or clipboard.writeText outside the scope of a user
  // gesture(such as "click" or "touch" event handlers) will result in the immediate
  // rejection of the promise returned by the API call."
  // From: https://webkit.org/blog/10855/async-clipboard-api/
  //
  // Since extensions run in a web worker, and handle gestures in an asynchronous way,
  // they are not classified by Safari as "in response to a user gesture" and will reject.
  //
  // This function sets up some handlers to work around that behavior.
  installWebKitWriteTextWorkaround() {
    const e = () => {
      const t = new zT();
      this.webKitPendingClipboardWritePromise && !this.webKitPendingClipboardWritePromise.isSettled && this.webKitPendingClipboardWritePromise.cancel(), this.webKitPendingClipboardWritePromise = t, rr().navigator.clipboard.write([new ClipboardItem({
        "text/plain": t.p
      })]).catch(async (n) => {
        (!(n instanceof Error) || n.name !== "NotAllowedError" || !t.isRejected) && this.logService.error(n);
      });
    };
    this._register(Ze.runAndSubscribe(this.layoutService.onDidAddContainer, ({ container: t, disposables: n }) => {
      n.add(Ce(t, "click", e)), n.add(Ce(t, "keydown", e));
    }, { container: this.layoutService.mainContainer, disposables: this._store }));
  }
  async writeText(e, t) {
    if (this.logService.trace("BrowserClipboardService#writeText called with type:", t, " text.length:", e.length), this.clearResourcesState(), t) {
      this.mapTextToType.set(t, e), this.logService.trace("BrowserClipboardService#writeText");
      return;
    }
    if (this.webKitPendingClipboardWritePromise)
      return this.webKitPendingClipboardWritePromise.complete(e);
    try {
      return this.logService.trace("before navigator.clipboard.writeText"), await rr().navigator.clipboard.writeText(e);
    } catch (n) {
      console.error(n);
    }
    this.fallbackWriteText(e);
  }
  fallbackWriteText(e) {
    this.logService.trace("BrowserClipboardService#fallbackWriteText");
    const t = yB(), n = t.activeElement, r = t.body.appendChild(Ge("textarea", { "aria-hidden": !0 }));
    r.style.height = "1px", r.style.width = "1px", r.style.position = "absolute", r.value = e, r.focus(), r.select(), t.execCommand("copy"), eo(n) && n.focus(), r.remove();
  }
  async readText(e) {
    if (this.logService.trace("BrowserClipboardService#readText called with type:", e), e) {
      const t = this.mapTextToType.get(e) || "";
      return this.logService.trace("BrowserClipboardService#readText text.length:", t.length), t;
    }
    try {
      const t = await rr().navigator.clipboard.readText();
      return this.logService.trace("BrowserClipboardService#readText text.length:", t.length), t;
    } catch (t) {
      console.error(t);
    }
    return "";
  }
  async readFindText() {
    return this.findText;
  }
  async writeFindText(e) {
    this.findText = e;
  }
  async readResources() {
    try {
      const t = await rr().navigator.clipboard.read();
      for (const n of t)
        if (n.types.includes(`web ${wRe}`)) {
          const r = await n.getType(`web ${wRe}`);
          return JSON.parse(await r.text()).map((o) => Ht.from(o));
        }
    } catch {
    }
    const e = await this.computeResourcesStateHash();
    return this.resourcesStateHash !== e && this.clearResourcesState(), this.resources;
  }
  async computeResourcesStateHash() {
    if (this.resources.length === 0)
      return;
    const e = await this.readText();
    return bB(e.substring(0, Aue.MAX_RESOURCE_STATE_SOURCE_LENGTH));
  }
  clearInternalState() {
    this.clearResourcesState();
  }
  clearResourcesState() {
    this.resources = [], this.resourcesStateHash = void 0;
  }
}, Aue = KL, KL.MAX_RESOURCE_STATE_SOURCE_LENGTH = 1e3, KL);
Oue = Aue = SMt([
  CRe(0, Ib),
  CRe(1, $r)
], Oue);
var EMt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, xMt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
const u3 = "data-keybinding-context";
class fme {
  constructor(e, t) {
    this._id = e, this._parent = t, this._value = /* @__PURE__ */ Object.create(null), this._value._contextId = e;
  }
  get value() {
    return { ...this._value };
  }
  setValue(e, t) {
    return this._value[e] !== t ? (this._value[e] = t, !0) : !1;
  }
  removeValue(e) {
    return e in this._value ? (delete this._value[e], !0) : !1;
  }
  getValue(e) {
    const t = this._value[e];
    return typeof t > "u" && this._parent ? this._parent.getValue(e) : t;
  }
}
const uq = class uq extends fme {
  constructor() {
    super(-1, null);
  }
  setValue(e, t) {
    return !1;
  }
  removeValue(e) {
    return !1;
  }
  getValue(e) {
  }
};
uq.INSTANCE = new uq();
let xA = uq;
const $3 = class $3 extends fme {
  constructor(e, t, n) {
    super(e, null), this._configurationService = t, this._values = aR.forConfigKeys(), this._listener = this._configurationService.onDidChangeConfiguration((r) => {
      if (r.source === 7) {
        const s = Array.from(this._values, ([o]) => o);
        this._values.clear(), n.fire(new ERe(s));
      } else {
        const s = [];
        for (const o of r.affectedKeys) {
          const a = `config.${o}`, l = this._values.findSuperstr(a);
          l !== void 0 && (s.push(...gi.map(l, ([c]) => c)), this._values.deleteSuperstr(a)), this._values.has(a) && (s.push(a), this._values.delete(a));
        }
        n.fire(new ERe(s));
      }
    });
  }
  dispose() {
    this._listener.dispose();
  }
  getValue(e) {
    if (e.indexOf($3._keyPrefix) !== 0)
      return super.getValue(e);
    if (this._values.has(e))
      return this._values.get(e);
    const t = e.substr($3._keyPrefix.length), n = this._configurationService.getValue(t);
    let r;
    switch (typeof n) {
      case "number":
      case "boolean":
      case "string":
        r = n;
        break;
      default:
        Array.isArray(n) ? r = JSON.stringify(n) : r = n;
    }
    return this._values.set(e, r), r;
  }
  setValue(e, t) {
    return super.setValue(e, t);
  }
  removeValue(e) {
    return super.removeValue(e);
  }
};
$3._keyPrefix = "config.";
let Mue = $3;
class LMt {
  constructor(e, t, n) {
    this._service = e, this._key = t, this._defaultValue = n, this.reset();
  }
  set(e) {
    this._service.setContext(this._key, e);
  }
  reset() {
    typeof this._defaultValue > "u" ? this._service.removeContext(this._key) : this._service.setContext(this._key, this._defaultValue);
  }
  get() {
    return this._service.getContextKeyValue(this._key);
  }
}
class SRe {
  constructor(e) {
    this.key = e;
  }
  affectsSome(e) {
    return e.has(this.key);
  }
  allKeysContainedIn(e) {
    return this.affectsSome(e);
  }
}
class ERe {
  constructor(e) {
    this.keys = e;
  }
  affectsSome(e) {
    for (const t of this.keys)
      if (e.has(t))
        return !0;
    return !1;
  }
  allKeysContainedIn(e) {
    return this.keys.every((t) => e.has(t));
  }
}
class TMt {
  constructor(e) {
    this.events = e;
  }
  affectsSome(e) {
    for (const t of this.events)
      if (t.affectsSome(e))
        return !0;
    return !1;
  }
  allKeysContainedIn(e) {
    return this.events.every((t) => t.allKeysContainedIn(e));
  }
}
function kMt(i, e) {
  return i.allKeysContainedIn(new Set(Object.keys(e)));
}
class F9e extends ge {
  get onDidChangeContext() {
    return this._onDidChangeContext.event;
  }
  constructor(e) {
    super(), this._onDidChangeContext = this._register(new eT({ merge: (t) => new TMt(t) })), this._isDisposed = !1, this._myContextId = e;
  }
  createKey(e, t) {
    if (this._isDisposed)
      throw new Error("AbstractContextKeyService has been disposed");
    return new LMt(this, e, t);
  }
  bufferChangeEvents(e) {
    this._onDidChangeContext.pause();
    try {
      e();
    } finally {
      this._onDidChangeContext.resume();
    }
  }
  createScoped(e) {
    if (this._isDisposed)
      throw new Error("AbstractContextKeyService has been disposed");
    return new DMt(this, e);
  }
  contextMatchesRules(e) {
    if (this._isDisposed)
      throw new Error("AbstractContextKeyService has been disposed");
    const t = this.getContextValuesContainer(this._myContextId);
    return e ? e.evaluate(t) : !0;
  }
  getContextKeyValue(e) {
    if (!this._isDisposed)
      return this.getContextValuesContainer(this._myContextId).getValue(e);
  }
  setContext(e, t) {
    if (this._isDisposed)
      return;
    const n = this.getContextValuesContainer(this._myContextId);
    n && n.setValue(e, t) && this._onDidChangeContext.fire(new SRe(e));
  }
  removeContext(e) {
    this._isDisposed || this.getContextValuesContainer(this._myContextId).removeValue(e) && this._onDidChangeContext.fire(new SRe(e));
  }
  getContext(e) {
    return this._isDisposed ? xA.INSTANCE : this.getContextValuesContainer(IMt(e));
  }
  dispose() {
    super.dispose(), this._isDisposed = !0;
  }
}
let Pue = class extends F9e {
  constructor(e) {
    super(0), this._contexts = /* @__PURE__ */ new Map(), this._lastContextId = 0, this.inputFocusedContext = lpe.bindTo(this);
    const t = this._register(new Mue(this._myContextId, e, this._onDidChangeContext));
    this._contexts.set(this._myContextId, t), this._register(Ze.runAndSubscribe(vB, ({ window: n, disposables: r }) => {
      const s = r.add(new er());
      r.add(Ce(n, Xe.FOCUS_IN, () => {
        s.value = new ke(), this.updateInputContextKeys(n.document, s.value);
      }, !0));
    }, { window: fr, disposables: this._store }));
  }
  updateInputContextKeys(e, t) {
    function n() {
      return !!e.activeElement && sm(e.activeElement);
    }
    const r = n();
    if (this.inputFocusedContext.set(r), r) {
      const s = t.add(qf(e.activeElement));
      Ze.once(s.onDidBlur)(() => {
        rr().document === e && this.inputFocusedContext.set(n()), s.dispose();
      }, void 0, t);
    }
  }
  getContextValuesContainer(e) {
    return this._isDisposed ? xA.INSTANCE : this._contexts.get(e) || xA.INSTANCE;
  }
  createChildContext(e = this._myContextId) {
    if (this._isDisposed)
      throw new Error("ContextKeyService has been disposed");
    const t = ++this._lastContextId;
    return this._contexts.set(t, new fme(t, this.getContextValuesContainer(e))), t;
  }
  disposeContext(e) {
    this._isDisposed || this._contexts.delete(e);
  }
};
Pue = EMt([
  xMt(0, xn)
], Pue);
class DMt extends F9e {
  constructor(e, t) {
    if (super(e.createChildContext()), this._parentChangeListener = this._register(new er()), this._parent = e, this._updateParentChangeListener(), this._domNode = t, this._domNode.hasAttribute(u3)) {
      let n = "";
      this._domNode.classList && (n = Array.from(this._domNode.classList.values()).join(", ")), console.error(`Element already has context attribute${n ? ": " + n : ""}`);
    }
    this._domNode.setAttribute(u3, String(this._myContextId));
  }
  _updateParentChangeListener() {
    this._parentChangeListener.value = this._parent.onDidChangeContext((e) => {
      const n = this._parent.getContextValuesContainer(this._myContextId).value;
      kMt(e, n) || this._onDidChangeContext.fire(e);
    });
  }
  dispose() {
    this._isDisposed || (this._parent.disposeContext(this._myContextId), this._domNode.removeAttribute(u3), super.dispose());
  }
  getContextValuesContainer(e) {
    return this._isDisposed ? xA.INSTANCE : this._parent.getContextValuesContainer(e);
  }
  createChildContext(e = this._myContextId) {
    if (this._isDisposed)
      throw new Error("ScopedContextKeyService has been disposed");
    return this._parent.createChildContext(e);
  }
  disposeContext(e) {
    this._isDisposed || this._parent.disposeContext(e);
  }
}
function IMt(i) {
  for (; i; ) {
    if (i.hasAttribute(u3)) {
      const e = i.getAttribute(u3);
      return e ? parseInt(e, 10) : NaN;
    }
    i = i.parentElement;
  }
  return 0;
}
function NMt(i, e, t) {
  i.get(Jt).createKey(String(e), RMt(t));
}
function RMt(i) {
  return iFe(i, (e) => {
    if (typeof e == "object" && e.$mid === 1)
      return Ht.revive(e).toString();
    if (e instanceof Ht)
      return e.toString();
  });
}
_i.registerCommand("_setContext", NMt);
_i.registerCommand({
  id: "getContextKeyInfo",
  handler() {
    return [...ut.all()].sort((i, e) => i.key.localeCompare(e.key));
  },
  metadata: {
    description: S(1659, "A command that returns information about context keys"),
    args: []
  }
});
_i.registerCommand("_generateContextKeyInfo", function() {
  const i = [], e = /* @__PURE__ */ new Set();
  for (const t of ut.all())
    e.has(t.key) || (e.add(t.key), i.push(t));
  i.sort((t, n) => t.key.localeCompare(n.key)), console.log(JSON.stringify(i, void 0, 2));
});
let AMt = class {
  constructor(e, t) {
    this.key = e, this.data = t, this.incoming = /* @__PURE__ */ new Map(), this.outgoing = /* @__PURE__ */ new Map();
  }
};
class xRe {
  constructor(e) {
    this._hashFn = e, this._nodes = /* @__PURE__ */ new Map();
  }
  roots() {
    const e = [];
    for (const t of this._nodes.values())
      t.outgoing.size === 0 && e.push(t);
    return e;
  }
  insertEdge(e, t) {
    const n = this.lookupOrInsertNode(e), r = this.lookupOrInsertNode(t);
    n.outgoing.set(r.key, r), r.incoming.set(n.key, n);
  }
  removeNode(e) {
    const t = this._hashFn(e);
    this._nodes.delete(t);
    for (const n of this._nodes.values())
      n.outgoing.delete(t), n.incoming.delete(t);
  }
  lookupOrInsertNode(e) {
    const t = this._hashFn(e);
    let n = this._nodes.get(t);
    return n || (n = new AMt(t, e), this._nodes.set(t, n)), n;
  }
  isEmpty() {
    return this._nodes.size === 0;
  }
  toString() {
    const e = [];
    for (const [t, n] of this._nodes)
      e.push(`${t}
	(-> incoming)[${[...n.incoming.keys()].join(", ")}]
	(outgoing ->)[${[...n.outgoing.keys()].join(",")}]
`);
    return e.join(`
`);
  }
  /**
   * This is brute force and slow and **only** be used
   * to trouble shoot.
   */
  findCycleSlow() {
    for (const [e, t] of this._nodes) {
      const n = /* @__PURE__ */ new Set([e]), r = this._findCycle(t, n);
      if (r)
        return r;
    }
  }
  _findCycle(e, t) {
    for (const [n, r] of e.outgoing) {
      if (t.has(n))
        return [...t, n].join(" -> ");
      t.add(n);
      const s = this._findCycle(r, t);
      if (s)
        return s;
      t.delete(n);
    }
  }
}
const OMt = !1;
class LRe extends Error {
  constructor(e) {
    super("cyclic dependency between services"), this.message = e.findCycleSlow() ?? `UNABLE to detect cycle, dumping graph: 
${e.toString()}`;
  }
}
class N$ {
  constructor(e = new r2(), t = !1, n, r = OMt) {
    this._services = e, this._strict = t, this._parent = n, this._enableTracing = r, this._isDisposed = !1, this._servicesToMaybeDispose = /* @__PURE__ */ new Set(), this._children = /* @__PURE__ */ new Set(), this._activeInstantiations = /* @__PURE__ */ new Set(), this._services.set(xt, this), this._globalGraph = r ? (n == null ? void 0 : n._globalGraph) ?? new xRe((s) => s) : void 0;
  }
  dispose() {
    if (!this._isDisposed) {
      this._isDisposed = !0, or(this._children), this._children.clear();
      for (const e of this._servicesToMaybeDispose)
        UT(e) && e.dispose();
      this._servicesToMaybeDispose.clear();
    }
  }
  _throwIfDisposed() {
    if (this._isDisposed)
      throw new Error("InstantiationService has been disposed");
  }
  createChild(e, t) {
    this._throwIfDisposed();
    const n = this, r = new class extends N$ {
      dispose() {
        n._children.delete(r), super.dispose();
      }
    }(e, this._strict, this, this._enableTracing);
    return this._children.add(r), t == null || t.add(r), r;
  }
  invokeFunction(e, ...t) {
    this._throwIfDisposed();
    const n = d3.traceInvocation(this._enableTracing, e);
    let r = !1;
    try {
      return e({
        get: (o) => {
          if (r)
            throw LV("service accessor is only valid during the invocation of its target method");
          const a = this._getOrCreateServiceInstance(o, n);
          if (!a)
            throw new Error(`[invokeFunction] unknown service '${o}'`);
          return a;
        },
        getIfExists: (o) => {
          if (r)
            throw LV("service accessor is only valid during the invocation of its target method");
          return this._getOrCreateServiceInstance(o, n);
        }
      }, ...t);
    } finally {
      r = !0, n.stop();
    }
  }
  createInstance(e, ...t) {
    this._throwIfDisposed();
    let n, r;
    return e instanceof V_ ? (n = d3.traceCreation(this._enableTracing, e.ctor), r = this._createInstance(e.ctor, e.staticArguments.concat(t), n)) : (n = d3.traceCreation(this._enableTracing, e), r = this._createInstance(e, t, n)), n.stop(), r;
  }
  _createInstance(e, t = [], n) {
    const r = em.getServiceDependencies(e).sort((a, l) => a.index - l.index), s = [];
    for (const a of r) {
      const l = this._getOrCreateServiceInstance(a.id, n);
      l || this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`, !1), s.push(l);
    }
    const o = r.length > 0 ? r[0].index : t.length;
    if (t.length !== o) {
      console.trace(`[createInstance] First service dependency of ${e.name} at position ${o + 1} conflicts with ${t.length} static arguments`);
      const a = o - t.length;
      a > 0 ? t = t.concat(new Array(a)) : t = t.slice(0, o);
    }
    return Reflect.construct(e, t.concat(s));
  }
  _setCreatedServiceInstance(e, t) {
    if (this._services.get(e) instanceof V_)
      this._services.set(e, t);
    else if (this._parent)
      this._parent._setCreatedServiceInstance(e, t);
    else
      throw new Error("illegalState - setting UNKNOWN service instance");
  }
  _getServiceInstanceOrDescriptor(e) {
    const t = this._services.get(e);
    return !t && this._parent ? this._parent._getServiceInstanceOrDescriptor(e) : t;
  }
  _getOrCreateServiceInstance(e, t) {
    this._globalGraph && this._globalGraphImplicitDependency && this._globalGraph.insertEdge(this._globalGraphImplicitDependency, String(e));
    const n = this._getServiceInstanceOrDescriptor(e);
    return n instanceof V_ ? this._safeCreateAndCacheServiceInstance(e, n, t.branch(e, !0)) : (t.branch(e, !1), n);
  }
  _safeCreateAndCacheServiceInstance(e, t, n) {
    if (this._activeInstantiations.has(e))
      throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);
    this._activeInstantiations.add(e);
    try {
      return this._createAndCacheServiceInstance(e, t, n);
    } finally {
      this._activeInstantiations.delete(e);
    }
  }
  _createAndCacheServiceInstance(e, t, n) {
    var l;
    const r = new xRe((c) => c.id.toString());
    let s = 0;
    const o = [{ id: e, desc: t, _trace: n }], a = /* @__PURE__ */ new Set();
    for (; o.length; ) {
      const c = o.pop();
      if (!a.has(String(c.id))) {
        if (a.add(String(c.id)), r.lookupOrInsertNode(c), s++ > 1e3)
          throw new LRe(r);
        for (const u of em.getServiceDependencies(c.desc.ctor)) {
          const d = this._getServiceInstanceOrDescriptor(u.id);
          if (d || this._throwIfStrict(`[createInstance] ${e} depends on ${u.id} which is NOT registered.`, !0), (l = this._globalGraph) == null || l.insertEdge(String(c.id), String(u.id)), d instanceof V_) {
            const h = { id: u.id, desc: d, _trace: c._trace.branch(u.id, !0) };
            r.insertEdge(c, h), o.push(h);
          }
        }
      }
    }
    for (; ; ) {
      const c = r.roots();
      if (c.length === 0) {
        if (!r.isEmpty())
          throw new LRe(r);
        break;
      }
      for (const { data: u } of c) {
        if (this._getServiceInstanceOrDescriptor(u.id) instanceof V_) {
          const h = this._createServiceInstanceWithOwner(u.id, u.desc.ctor, u.desc.staticArguments, u.desc.supportsDelayedInstantiation, u._trace);
          this._setCreatedServiceInstance(u.id, h);
        }
        r.removeNode(u);
      }
    }
    return this._getServiceInstanceOrDescriptor(e);
  }
  _createServiceInstanceWithOwner(e, t, n = [], r, s) {
    if (this._services.get(e) instanceof V_)
      return this._createServiceInstance(e, t, n, r, s, this._servicesToMaybeDispose);
    if (this._parent)
      return this._parent._createServiceInstanceWithOwner(e, t, n, r, s);
    throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`);
  }
  _createServiceInstance(e, t, n = [], r, s, o) {
    if (r) {
      const a = new N$(void 0, this._strict, this, this._enableTracing);
      a._globalGraphImplicitDependency = String(e);
      const l = /* @__PURE__ */ new Map(), c = new ent(() => {
        const u = a._createInstance(t, n, s);
        for (const [d, h] of l) {
          const g = u[d];
          if (typeof g == "function")
            for (const m of h)
              m.disposable = g.apply(u, m.listener);
        }
        return l.clear(), o.add(u), u;
      });
      return new Proxy(/* @__PURE__ */ Object.create(null), {
        get(u, d) {
          if (!c.isInitialized && typeof d == "string" && (d.startsWith("onDid") || d.startsWith("onWill"))) {
            let m = l.get(d);
            return m || (m = new xc(), l.set(d, m)), (v, w, E) => {
              if (c.isInitialized)
                return c.value[d](v, w, E);
              {
                const L = { listener: [v, w, E], disposable: void 0 }, T = m.push(L);
                return Et(() => {
                  var N;
                  T(), (N = L.disposable) == null || N.dispose();
                });
              }
            };
          }
          if (d in u)
            return u[d];
          const h = c.value;
          let g = h[d];
          return typeof g != "function" || (g = g.bind(h), u[d] = g), g;
        },
        set(u, d, h) {
          return c.value[d] = h, !0;
        },
        getPrototypeOf(u) {
          return t.prototype;
        }
      });
    } else {
      const a = this._createInstance(t, n, s);
      return o.add(a), a;
    }
  }
  _throwIfStrict(e, t) {
    if (t && console.warn(e), this._strict)
      throw new Error(e);
  }
}
const Eh = class Eh {
  static traceInvocation(e, t) {
    return e ? new Eh(2, t.name || new Error().stack.split(`
`).slice(3, 4).join(`
`)) : Eh._None;
  }
  static traceCreation(e, t) {
    return e ? new Eh(1, t.name) : Eh._None;
  }
  constructor(e, t) {
    this.type = e, this.name = t, this._start = Date.now(), this._dep = [];
  }
  branch(e, t) {
    const n = new Eh(3, e.toString());
    return this._dep.push([e, t, n]), n;
  }
  stop() {
    const e = Date.now() - this._start;
    Eh._totals += e;
    let t = !1;
    function n(s, o) {
      const a = [], l = new Array(s + 1).join("	");
      for (const [c, u, d] of o._dep)
        if (u && d) {
          t = !0, a.push(`${l}CREATES -> ${c}`);
          const h = n(s + 1, d);
          h && a.push(h);
        } else
          a.push(`${l}uses -> ${c}`);
      return a.join(`
`);
    }
    const r = [
      `${this.type === 1 ? "CREATE" : "CALL"} ${this.name}`,
      `${n(1, this)}`,
      `DONE, took ${e.toFixed(2)}ms (grand total ${Eh._totals.toFixed(2)}ms)`
    ];
    (e > 2 || t) && Eh.all.add(r.join(`
`));
  }
};
Eh.all = /* @__PURE__ */ new Set(), Eh._None = new class extends Eh {
  constructor() {
    super(0, null);
  }
  stop() {
  }
  branch() {
    return this;
  }
}(), Eh._totals = 0;
let d3 = Eh;
const MMt = /* @__PURE__ */ new Set([
  Yt.inMemory,
  Yt.vscodeSourceControl,
  Yt.walkThrough,
  Yt.walkThroughSnippet,
  Yt.vscodeChatCodeBlock,
  Yt.vscodeTerminal
]);
class PMt {
  constructor() {
    this._byResource = new Co(), this._byOwner = /* @__PURE__ */ new Map();
  }
  set(e, t, n) {
    let r = this._byResource.get(e);
    r || (r = /* @__PURE__ */ new Map(), this._byResource.set(e, r)), r.set(t, n);
    let s = this._byOwner.get(t);
    s || (s = new Co(), this._byOwner.set(t, s)), s.set(e, n);
  }
  get(e, t) {
    const n = this._byResource.get(e);
    return n == null ? void 0 : n.get(t);
  }
  delete(e, t) {
    let n = !1, r = !1;
    const s = this._byResource.get(e);
    s && (n = s.delete(t));
    const o = this._byOwner.get(t);
    if (o && (r = o.delete(e)), n !== r)
      throw new Error("illegal state");
    return n && r;
  }
  values(e) {
    var t, n;
    return typeof e == "string" ? ((t = this._byOwner.get(e)) == null ? void 0 : t.values()) ?? gi.empty() : Ht.isUri(e) ? ((n = this._byResource.get(e)) == null ? void 0 : n.values()) ?? gi.empty() : gi.map(gi.concat(...this._byOwner.values()), (r) => r[1]);
  }
}
class FMt {
  constructor(e) {
    this.errors = 0, this.infos = 0, this.warnings = 0, this.unknowns = 0, this._data = new Co(), this._service = e, this._subscription = e.onMarkerChanged(this._update, this);
  }
  dispose() {
    this._subscription.dispose();
  }
  _update(e) {
    for (const t of e) {
      const n = this._data.get(t);
      n && this._substract(n);
      const r = this._resourceStats(t);
      this._add(r), this._data.set(t, r);
    }
  }
  _resourceStats(e) {
    const t = { errors: 0, warnings: 0, infos: 0, unknowns: 0 };
    if (MMt.has(e.scheme))
      return t;
    for (const { severity: n } of this._service.read({ resource: e }))
      n === Os.Error ? t.errors += 1 : n === Os.Warning ? t.warnings += 1 : n === Os.Info ? t.infos += 1 : t.unknowns += 1;
    return t;
  }
  _substract(e) {
    this.errors -= e.errors, this.warnings -= e.warnings, this.infos -= e.infos, this.unknowns -= e.unknowns;
  }
  _add(e) {
    this.errors += e.errors, this.warnings += e.warnings, this.infos += e.infos, this.unknowns += e.unknowns;
  }
}
class ZE {
  constructor() {
    this._onMarkerChanged = new VMe({
      delay: 0,
      merge: ZE._merge
    }), this.onMarkerChanged = this._onMarkerChanged.event, this._data = new PMt(), this._stats = new FMt(this), this._filteredResources = new Co();
  }
  dispose() {
    this._stats.dispose(), this._onMarkerChanged.dispose();
  }
  remove(e, t) {
    for (const n of t || [])
      this.changeOne(e, n, []);
  }
  changeOne(e, t, n) {
    if (fPe(n))
      this._data.delete(t, e) && this._onMarkerChanged.fire([t]);
    else {
      const r = [];
      for (const s of n) {
        const o = ZE._toMarker(e, t, s);
        o && r.push(o);
      }
      this._data.set(t, e, r), this._onMarkerChanged.fire([t]);
    }
  }
  static _toMarker(e, t, n) {
    let { code: r, severity: s, message: o, source: a, startLineNumber: l, startColumn: c, endLineNumber: u, endColumn: d, relatedInformation: h, tags: g, origin: m } = n;
    if (o)
      return l = l > 0 ? l : 1, c = c > 0 ? c : 1, u = u >= l ? u : l, d = d > 0 ? d : c, {
        resource: t,
        owner: e,
        code: r,
        severity: s,
        message: o,
        source: a,
        startLineNumber: l,
        startColumn: c,
        endLineNumber: u,
        endColumn: d,
        relatedInformation: h,
        tags: g,
        origin: m
      };
  }
  changeAll(e, t) {
    const n = [], r = this._data.values(e);
    if (r)
      for (const s of r) {
        const o = gi.first(s);
        o && (n.push(o.resource), this._data.delete(o.resource, e));
      }
    if (kc(t)) {
      const s = new Co();
      for (const { resource: o, marker: a } of t) {
        const l = ZE._toMarker(e, o, a);
        if (!l)
          continue;
        const c = s.get(o);
        c ? c.push(l) : (s.set(o, [l]), n.push(o));
      }
      for (const [o, a] of s)
        this._data.set(o, e, a);
    }
    n.length > 0 && this._onMarkerChanged.fire(n);
  }
  /**
   * Creates an information marker for filtered resources
   */
  _createFilteredMarker(e, t) {
    const n = t.length === 1 ? S(1721, 'Problems are paused because: "{0}"', t[0]) : S(1722, 'Problems are paused because: "{0}" and {1} more', t[0], t.length - 1);
    return {
      owner: "markersFilter",
      resource: e,
      severity: Os.Info,
      message: n,
      startLineNumber: 1,
      startColumn: 1,
      endLineNumber: 1,
      endColumn: 1
    };
  }
  read(e = /* @__PURE__ */ Object.create(null)) {
    let { owner: t, resource: n, severities: r, take: s } = e;
    if ((!s || s < 0) && (s = -1), t && n) {
      const o = e.ignoreResourceFilters ? void 0 : this._filteredResources.get(n);
      if (o != null && o.length)
        return [this._createFilteredMarker(n, o)];
      const a = this._data.get(n, t);
      if (!a)
        return [];
      const l = [];
      for (const c of a) {
        if (s > 0 && l.length === s)
          break;
        const u = e.ignoreResourceFilters ? void 0 : this._filteredResources.get(n);
        u != null && u.length ? l.push(this._createFilteredMarker(n, u)) : ZE._accept(c, r) && l.push(c);
      }
      return l;
    } else {
      const o = !t && !n ? this._data.values() : this._data.values(n ?? t), a = [], l = new wrt();
      for (const c of o)
        for (const u of c) {
          if (l.has(u.resource))
            continue;
          if (s > 0 && a.length === s)
            break;
          const d = e.ignoreResourceFilters ? void 0 : this._filteredResources.get(u.resource);
          d != null && d.length ? (a.push(this._createFilteredMarker(u.resource, d)), l.add(u.resource)) : ZE._accept(u, r) && a.push(u);
        }
      return a;
    }
  }
  static _accept(e, t) {
    return t === void 0 || (t & e.severity) === e.severity;
  }
  // --- event debounce logic
  static _merge(e) {
    const t = new Co();
    for (const n of e)
      for (const r of n)
        t.set(r, !0);
    return Array.from(t.keys());
  }
}
class BMt extends ge {
  get configurationModel() {
    return this._configurationModel;
  }
  constructor(e) {
    super(), this.logService = e, this._configurationModel = Ga.createEmptyModel(e);
  }
  reload() {
    return this.resetConfigurationModel(), this.configurationModel;
  }
  getConfigurationDefaultOverrides() {
    return {};
  }
  resetConfigurationModel() {
    this._configurationModel = Ga.createEmptyModel(this.logService);
    const e = Fs.as(Cm.Configuration).getConfigurationProperties();
    this.updateConfigurationModel(Object.keys(e), e);
  }
  updateConfigurationModel(e, t) {
    const n = this.getConfigurationDefaultOverrides();
    for (const r of e) {
      const s = n[r], o = t[r];
      s !== void 0 ? this._configurationModel.setValue(r, s) : o ? this._configurationModel.setValue(r, W_(o.default)) : this._configurationModel.removeValue(r);
    }
  }
}
class HMt extends ge {
  constructor(e, t = []) {
    super(), this.logger = new Ort([e, ...t]), this._register(e.onDidChangeLogLevel((n) => this.setLevel(n)));
  }
  get onDidChangeLogLevel() {
    return this.logger.onDidChangeLogLevel;
  }
  setLevel(e) {
    this.logger.setLevel(e);
  }
  getLevel() {
    return this.logger.getLevel();
  }
  trace(e, ...t) {
    this.logger.trace(e, ...t);
  }
  debug(e, ...t) {
    this.logger.debug(e, ...t);
  }
  info(e, ...t) {
    this.logger.info(e, ...t);
  }
  warn(e, ...t) {
    this.logger.warn(e, ...t);
  }
  error(e, ...t) {
    this.logger.error(e, ...t);
  }
}
class WMt {
  getParserClass() {
    throw new Error("getParserClass is not implemented in StandaloneTreeSitterLibraryService");
  }
  supportsLanguage(e, t) {
    return !1;
  }
  getLanguage(e, t) {
  }
  /**
   * Return value of null indicates that there are no injection queries for this language.
   * @param languageId
   * @param reader
   */
  getInjectionQueries(e, t) {
    return null;
  }
  /**
   * Return value of null indicates that there are no highlights queries for this language.
   * @param languageId
   * @param reader
   */
  getHighlightingQueries(e, t) {
    return null;
  }
}
var Ab = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Do = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class VMt {
  constructor(e) {
    this.disposed = !1, this.model = e, this._onWillDispose = new he();
  }
  get textEditorModel() {
    return this.model;
  }
  dispose() {
    this.disposed = !0, this._onWillDispose.fire();
  }
}
let Fue = class {
  constructor(e) {
    this.modelService = e;
  }
  createModelReference(e) {
    const t = this.modelService.getModel(e);
    return t ? Promise.resolve(new Wtt(new VMt(t))) : Promise.reject(new Error("Model not found"));
  }
};
Fue = Ab([
  Do(0, xs)
], Fue);
const dq = class dq {
  show() {
    return dq.NULL_PROGRESS_RUNNER;
  }
  async showWhile(e, t) {
    await e;
  }
};
dq.NULL_PROGRESS_RUNNER = {
  done: () => {
  },
  total: () => {
  },
  worked: () => {
  }
};
let Bue = dq;
class UMt {
  withProgress(e, t, n) {
    return t({
      report: () => {
      }
    });
  }
}
class zMt {
  constructor() {
    this.isExtensionDevelopment = !1, this.isBuilt = !1;
  }
}
class $Mt {
  async confirm(e) {
    return {
      confirmed: this.doConfirm(e.message, e.detail),
      checkboxChecked: !1
      // unsupported
    };
  }
  doConfirm(e, t) {
    let n = e;
    return t && (n = n + `

` + t), fr.confirm(n);
  }
  async prompt(e) {
    var r;
    let t;
    if (this.doConfirm(e.message, e.detail)) {
      const s = [...e.buttons ?? []];
      e.cancelButton && typeof e.cancelButton != "string" && typeof e.cancelButton != "boolean" && s.push(e.cancelButton), t = await ((r = s[0]) == null ? void 0 : r.run({ checkboxChecked: !1 }));
    }
    return { result: t };
  }
  async error(e, t) {
    await this.prompt({ type: Rs.Error, message: e, detail: t });
  }
}
const j3 = class j3 {
  info(e) {
    return this.notify({ severity: Rs.Info, message: e });
  }
  warn(e) {
    return this.notify({ severity: Rs.Warning, message: e });
  }
  error(e) {
    return this.notify({ severity: Rs.Error, message: e });
  }
  notify(e) {
    switch (e.severity) {
      case Rs.Error:
        console.error(e.message);
        break;
      case Rs.Warning:
        console.warn(e.message);
        break;
      default:
        console.log(e.message);
        break;
    }
    return j3.NO_OP;
  }
  prompt(e, t, n, r) {
    return j3.NO_OP;
  }
  status(e, t) {
    return { close: () => {
    } };
  }
};
j3.NO_OP = new dht();
let Hue = j3, Wue = class {
  constructor(e) {
    this._onWillExecuteCommand = new he(), this._onDidExecuteCommand = new he(), this.onDidExecuteCommand = this._onDidExecuteCommand.event, this._instantiationService = e;
  }
  executeCommand(e, ...t) {
    const n = _i.getCommand(e);
    if (!n)
      return Promise.reject(new Error(`command '${e}' not found`));
    try {
      this._onWillExecuteCommand.fire({ commandId: e, args: t });
      const r = this._instantiationService.invokeFunction.apply(this._instantiationService, [n.handler, ...t]);
      return this._onDidExecuteCommand.fire({ commandId: e, args: t }), Promise.resolve(r);
    } catch (r) {
      return Promise.reject(r);
    }
  }
};
Wue = Ab([
  Do(0, xt)
], Wue);
let LA = class extends wOt {
  constructor(e, t, n, r, s, o) {
    super(e, t, n, r, s), this._cachedResolver = null, this._dynamicKeybindings = [], this._domNodeListeners = [];
    const a = (g) => {
      const m = new ke();
      m.add(Ce(g, Xe.KEY_DOWN, (_) => {
        const v = new wr(_);
        this._dispatch(v, v.target) && (v.preventDefault(), v.stopPropagation());
      })), m.add(Ce(g, Xe.KEY_UP, (_) => {
        const v = new wr(_);
        this._singleModifierDispatch(v, v.target) && v.preventDefault();
      })), this._domNodeListeners.push(new jMt(g, m));
    }, l = (g) => {
      for (let m = 0; m < this._domNodeListeners.length; m++) {
        const _ = this._domNodeListeners[m];
        _.domNode === g && (this._domNodeListeners.splice(m, 1), _.dispose());
      }
    }, c = (g) => {
      g.getOption(
        70
        /* EditorOption.inDiffEditor */
      ) || a(g.getContainerDomNode());
    }, u = (g) => {
      g.getOption(
        70
        /* EditorOption.inDiffEditor */
      ) || l(g.getContainerDomNode());
    };
    this._register(o.onCodeEditorAdd(c)), this._register(o.onCodeEditorRemove(u)), o.listCodeEditors().forEach(c);
    const d = (g) => {
      a(g.getContainerDomNode());
    }, h = (g) => {
      l(g.getContainerDomNode());
    };
    this._register(o.onDiffEditorAdd(d)), this._register(o.onDiffEditorRemove(h)), o.listDiffEditors().forEach(d);
  }
  addDynamicKeybinding(e, t, n, r) {
    return Vg(_i.registerCommand(e, n), this.addDynamicKeybindings([{
      keybinding: t,
      command: e,
      when: r
    }]));
  }
  addDynamicKeybindings(e) {
    const t = e.map((n) => ({
      keybinding: Zne(n.keybinding, Ad),
      command: n.command ?? null,
      commandArgs: n.commandArgs,
      when: n.when,
      weight1: 1e3,
      weight2: 0,
      extensionId: null,
      isBuiltinExtension: !1
    }));
    return this._dynamicKeybindings = this._dynamicKeybindings.concat(t), this.updateResolver(), Et(() => {
      for (let n = 0; n < this._dynamicKeybindings.length; n++)
        if (this._dynamicKeybindings[n] === t[0]) {
          this._dynamicKeybindings.splice(n, t.length), this.updateResolver();
          return;
        }
    });
  }
  updateResolver() {
    this._cachedResolver = null, this._onDidUpdateKeybindings.fire();
  }
  _getResolver() {
    if (!this._cachedResolver) {
      const e = this._toNormalizedKeybindingItems(Pa.getDefaultKeybindings(), !0), t = this._toNormalizedKeybindingItems(this._dynamicKeybindings, !1);
      this._cachedResolver = new l3(e, t, (n) => this._log(n));
    }
    return this._cachedResolver;
  }
  _documentHasFocus() {
    return fr.document.hasFocus();
  }
  _toNormalizedKeybindingItems(e, t) {
    const n = [];
    let r = 0;
    for (const s of e) {
      const o = s.when || void 0, a = s.keybinding;
      if (!a)
        n[r++] = new rRe(void 0, s.command, s.commandArgs, o, t, null, !1);
      else {
        const l = O5.resolveKeybinding(a, Ad);
        for (const c of l)
          n[r++] = new rRe(c, s.command, s.commandArgs, o, t, null, !1);
      }
    }
    return n;
  }
  resolveKeyboardEvent(e) {
    const t = new $y(e.ctrlKey, e.shiftKey, e.altKey, e.metaKey, e.keyCode);
    return new O5([t], Ad);
  }
};
LA = Ab([
  Do(0, Jt),
  Do(1, jr),
  Do(2, rc),
  Do(3, no),
  Do(4, $r),
  Do(5, Ti)
], LA);
class jMt extends ge {
  constructor(e, t) {
    super(), this.domNode = e, this._register(t);
  }
}
function TRe(i) {
  return i && typeof i == "object" && (!i.overrideIdentifier || typeof i.overrideIdentifier == "string") && (!i.resource || i.resource instanceof Ht);
}
let R$ = class {
  constructor(e) {
    this.logService = e, this._onDidChangeConfiguration = new he(), this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
    const t = new BMt(e);
    this._configuration = new KK(t.reload(), Ga.createEmptyModel(e), Ga.createEmptyModel(e), Ga.createEmptyModel(e), Ga.createEmptyModel(e), Ga.createEmptyModel(e), new Co(), Ga.createEmptyModel(e), new Co(), e), t.dispose();
  }
  getValue(e, t) {
    const n = typeof e == "string" ? e : void 0, r = TRe(e) ? e : TRe(t) ? t : {};
    return this._configuration.getValue(n, r, void 0);
  }
  updateValues(e) {
    const t = { data: this._configuration.toData() }, n = [];
    for (const r of e) {
      const [s, o] = r;
      this.getValue(s) !== o && (this._configuration.updateValue(s, o), n.push(s));
    }
    if (n.length > 0) {
      const r = new bOt({ keys: n, overrides: [] }, t, this._configuration, void 0, this.logService);
      r.source = 8, this._onDidChangeConfiguration.fire(r);
    }
    return Promise.resolve();
  }
  updateValue(e, t, n, r) {
    return this.updateValues([[e, t]]);
  }
  inspect(e, t = {}) {
    return this._configuration.inspect(e, t, void 0);
  }
};
R$ = Ab([
  Do(0, $r)
], R$);
let Vue = class {
  constructor(e, t, n) {
    this.configurationService = e, this.modelService = t, this.languageService = n, this._onDidChangeConfiguration = new he(), this.configurationService.onDidChangeConfiguration((r) => {
      this._onDidChangeConfiguration.fire({ affectedKeys: r.affectedKeys, affectsConfiguration: (s, o) => r.affectsConfiguration(o) });
    });
  }
  getValue(e, t, n) {
    const r = de.isIPosition(t) ? t : null, s = r ? typeof n == "string" ? n : void 0 : typeof t == "string" ? t : void 0, o = e ? this.getLanguage(e, r) : void 0;
    return typeof s > "u" ? this.configurationService.getValue({
      resource: e,
      overrideIdentifier: o
    }) : this.configurationService.getValue(s, {
      resource: e,
      overrideIdentifier: o
    });
  }
  getLanguage(e, t) {
    const n = this.modelService.getModel(e);
    return n ? t ? n.getLanguageIdAtPosition(t.lineNumber, t.column) : n.getLanguageId() : this.languageService.guessLanguageIdByFilepathOrFirstLine(e);
  }
};
Vue = Ab([
  Do(0, xn),
  Do(1, xs),
  Do(2, Gr)
], Vue);
let Uue = class {
  constructor(e) {
    this.configurationService = e;
  }
  getEOL(e, t) {
    const n = this.configurationService.getValue("files.eol", { overrideIdentifier: t, resource: e });
    return n && typeof n == "string" && n !== "auto" ? n : Qu || Kn ? `
` : `\r
`;
  }
};
Uue = Ab([
  Do(0, xn)
], Uue);
class GMt {
  publicLog2() {
  }
}
const G3 = class G3 {
  constructor() {
    const e = Ht.from({ scheme: G3.SCHEME, authority: "model", path: "/" });
    this.workspace = { id: U5e, folders: [new H0t({ uri: e, name: "", index: 0 })] };
  }
  getWorkspace() {
    return this.workspace;
  }
  getWorkspaceFolder(e) {
    return e && e.scheme === G3.SCHEME ? this.workspace.folders[0] : null;
  }
};
G3.SCHEME = "inmemory";
let zue = G3;
function A$(i, e, t) {
  if (!e || !(i instanceof R$))
    return;
  const n = [];
  Object.keys(e).forEach((r) => {
    rCt(r) && n.push([`editor.${r}`, e[r]]), t && sCt(r) && n.push([`diffEditor.${r}`, e[r]]);
  }), n.length > 0 && i.updateValues(n);
}
let $ue = class {
  constructor(e) {
    this._modelService = e;
  }
  hasPreviewHandler() {
    return !1;
  }
  async apply(e, t) {
    const n = Array.isArray(e) ? e : Pge.convert(e), r = /* @__PURE__ */ new Map();
    for (const a of n) {
      if (!(a instanceof N1))
        throw new Error("bad edit - only text edits are supported");
      const l = this._modelService.getModel(a.resource);
      if (!l)
        throw new Error("bad edit - model not found");
      if (typeof a.versionId == "number" && l.getVersionId() !== a.versionId)
        throw new Error("bad state - model changed in the meantime");
      let c = r.get(l);
      c || (c = [], r.set(l, c)), c.push(Xs.replaceMove(z.lift(a.textEdit.range), a.textEdit.text));
    }
    let s = 0, o = 0;
    for (const [a, l] of r)
      a.pushStackElement(), a.pushEditOperations([], l, () => []), a.pushStackElement(), o += 1, s += l.length;
    return {
      ariaSummary: tT(Ple.bulkEditServiceSummary, s, o),
      isApplied: s > 0
    };
  }
};
$ue = Ab([
  Do(0, xs)
], $ue);
class qMt {
  getUriLabel(e, t) {
    return e.scheme === "file" ? e.fsPath : e.path;
  }
  getUriBasenameLabel(e) {
    return Kf(e);
  }
}
let jue = class extends dOt {
  constructor(e, t) {
    super(e), this._codeEditorService = t;
  }
  showContextView(e, t, n) {
    if (!t) {
      const r = this._codeEditorService.getFocusedCodeEditor() || this._codeEditorService.getActiveCodeEditor();
      r && (t = r.getContainerDomNode());
    }
    return super.showContextView(e, t, n);
  }
};
jue = Ab([
  Do(0, Ib),
  Do(1, Ti)
], jue);
class KMt {
  constructor() {
    this._neverEmitter = new he(), this.onDidChangeTrust = this._neverEmitter.event;
  }
  isWorkspaceTrusted() {
    return !0;
  }
}
class YMt extends oue {
  constructor() {
    super();
  }
}
class XMt extends HMt {
  constructor() {
    super(new Art());
  }
}
let Gue = class extends cue {
  constructor(e, t, n, r, s, o) {
    super(e, t, n, r, s, o), this.configure({ blockMouse: !1 });
  }
};
Gue = Ab([
  Do(0, rc),
  Do(1, no),
  Do(2, g0),
  Do(3, Fi),
  Do(4, eg),
  Do(5, Jt)
], Gue);
const ZMt = {
  esmModuleLocation: void 0,
  label: "editorWorkerService"
};
let que = class extends Kce {
  constructor(e, t, n, r, s) {
    super(ZMt, e, t, n, r, s);
  }
};
que = Ab([
  Do(0, xs),
  Do(1, UK),
  Do(2, $r),
  Do(3, Ls),
  Do(4, St)
], que);
class QMt {
  async playSignal(e, t) {
  }
}
ni(
  $r,
  XMt,
  0
  /* InstantiationType.Eager */
);
ni(
  xn,
  R$,
  0
  /* InstantiationType.Eager */
);
ni(
  UK,
  Vue,
  0
  /* InstantiationType.Eager */
);
ni(
  A8e,
  Uue,
  0
  /* InstantiationType.Eager */
);
ni(
  i0,
  zue,
  0
  /* InstantiationType.Eager */
);
ni(
  LT,
  qMt,
  0
  /* InstantiationType.Eager */
);
ni(
  rc,
  GMt,
  0
  /* InstantiationType.Eager */
);
ni(
  XB,
  $Mt,
  0
  /* InstantiationType.Eager */
);
ni(
  Gge,
  zMt,
  0
  /* InstantiationType.Eager */
);
ni(
  no,
  Hue,
  0
  /* InstantiationType.Eager */
);
ni(
  Nb,
  ZE,
  0
  /* InstantiationType.Eager */
);
ni(
  Gr,
  YMt,
  0
  /* InstantiationType.Eager */
);
ni(
  Jh,
  i2t,
  0
  /* InstantiationType.Eager */
);
ni(
  xs,
  pue,
  0
  /* InstantiationType.Eager */
);
ni(
  mfe,
  gue,
  0
  /* InstantiationType.Eager */
);
ni(
  Jt,
  Pue,
  0
  /* InstantiationType.Eager */
);
ni(
  m4e,
  UMt,
  0
  /* InstantiationType.Eager */
);
ni(
  e0,
  Bue,
  0
  /* InstantiationType.Eager */
);
ni(
  gu,
  Syt,
  0
  /* InstantiationType.Eager */
);
ni(
  sd,
  que,
  0
  /* InstantiationType.Eager */
);
ni(
  HB,
  $ue,
  0
  /* InstantiationType.Eager */
);
ni(
  G8e,
  KMt,
  0
  /* InstantiationType.Eager */
);
ni(
  Ic,
  Fue,
  0
  /* InstantiationType.Eager */
);
ni(
  Qa,
  Rue,
  0
  /* InstantiationType.Eager */
);
ni(
  rg,
  Jwt,
  0
  /* InstantiationType.Eager */
);
ni(
  jr,
  Wue,
  0
  /* InstantiationType.Eager */
);
ni(
  Fi,
  LA,
  0
  /* InstantiationType.Eager */
);
ni(
  tc,
  Iue,
  0
  /* InstantiationType.Eager */
);
ni(
  g0,
  jue,
  0
  /* InstantiationType.Eager */
);
ni(
  ad,
  fue,
  0
  /* InstantiationType.Eager */
);
ni(
  _m,
  Oue,
  0
  /* InstantiationType.Eager */
);
ni(
  Qh,
  Gue,
  0
  /* InstantiationType.Eager */
);
ni(
  eg,
  vse,
  0
  /* InstantiationType.Eager */
);
ni(
  h0,
  QMt,
  0
  /* InstantiationType.Eager */
);
ni(
  tge,
  WMt,
  0
  /* InstantiationType.Eager */
);
ni(
  jPe,
  Frt,
  0
  /* InstantiationType.Eager */
);
ni(
  Mpe,
  tLt,
  0
  /* InstantiationType.Eager */
);
var ln;
(function(i) {
  const e = new r2();
  for (const [l, c] of oLe())
    e.set(l, c);
  const t = new N$(e, !0);
  e.set(xt, t);
  function n(l) {
    r || o({});
    const c = e.get(l);
    if (!c)
      throw new Error("Missing service " + l);
    return c instanceof V_ ? t.invokeFunction((u) => u.get(l)) : c;
  }
  i.get = n;
  let r = !1;
  const s = new he();
  function o(l) {
    if (r)
      return t;
    r = !0;
    for (const [u, d] of oLe())
      e.get(u) || e.set(u, d);
    for (const u in l)
      if (l.hasOwnProperty(u)) {
        const d = Vn(u);
        e.get(d) instanceof V_ && e.set(d, l[u]);
      }
    const c = WCt();
    for (const u of c)
      try {
        t.createInstance(u);
      } catch (d) {
        fn(d);
      }
    return s.fire(), t;
  }
  i.initialize = o;
  function a(l) {
    if (r)
      return l();
    const c = new ke(), u = c.add(s.event(() => {
      u.dispose(), c.add(l());
    }));
    return c;
  }
  i.withServices = a;
})(ln || (ln = {}));
var gme = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, Kr = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let JMt = 0, kRe = !1;
function ePt(i) {
  if (!i) {
    if (kRe)
      return;
    kRe = !0;
  }
  Qit(i || fr.document.body);
}
let O$ = class extends uT {
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g) {
    const m = { ...t };
    m.ariaLabel = m.ariaLabel || Ole.editorViewAccessibleLabel, super(e, m, {}, n, r, s, o, c, u, d, h, g), l instanceof LA ? this._standaloneKeybindingService = l : this._standaloneKeybindingService = null, ePt(m.ariaContainerElement), pmt((_, v) => n.createInstance(cA, _, { instantHover: v }, {})), wbt(a);
  }
  addCommand(e, t, n) {
    if (!this._standaloneKeybindingService)
      return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"), null;
    const r = "DYNAMIC_" + ++JMt, s = Re.deserialize(n);
    return this._standaloneKeybindingService.addDynamicKeybinding(r, e, t, s), r;
  }
  createContextKey(e, t) {
    return this._contextKeyService.createKey(e, t);
  }
  addAction(e) {
    if (typeof e.id != "string" || typeof e.label != "string" || typeof e.run != "function")
      throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");
    if (!this._standaloneKeybindingService)
      return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"), ge.None;
    const t = e.id, n = e.label, r = Re.and(Re.equals("editorId", this.getId()), Re.deserialize(e.precondition)), s = e.keybindings, o = Re.and(r, Re.deserialize(e.keybindingContext)), a = e.contextMenuGroupId || null, l = e.contextMenuOrder || 0, c = (g, ...m) => Promise.resolve(e.run(this, ...m)), u = new ke(), d = this.getId() + ":" + t;
    if (u.add(_i.registerCommand(d, c)), a) {
      const g = {
        command: {
          id: d,
          title: n
        },
        when: r,
        group: a,
        order: l
      };
      u.add(Oa.appendMenuItem(wt.EditorContext, g));
    }
    if (Array.isArray(s))
      for (const g of s)
        u.add(this._standaloneKeybindingService.addDynamicKeybinding(d, g, c, o));
    const h = new W3e(d, n, n, void 0, r, (...g) => Promise.resolve(e.run(this, ...g)), this._contextKeyService);
    return this._actions.set(t, h), u.add(Et(() => {
      this._actions.delete(t);
    })), u;
  }
  _triggerCommand(e, t) {
    if (this._codeEditorService instanceof C$)
      try {
        this._codeEditorService.setActiveCodeEditor(this), super._triggerCommand(e, t);
      } finally {
        this._codeEditorService.setActiveCodeEditor(null);
      }
    else
      super._triggerCommand(e, t);
  }
};
O$ = gme([
  Kr(2, xt),
  Kr(3, Ti),
  Kr(4, jr),
  Kr(5, Jt),
  Kr(6, od),
  Kr(7, Fi),
  Kr(8, to),
  Kr(9, no),
  Kr(10, Qa),
  Kr(11, Ls),
  Kr(12, St)
], O$);
let Kue = class extends O$ {
  constructor(e, t, n, r, s, o, a, l, c, u, d, h, g, m, _, v) {
    const w = { ...t };
    A$(d, w, !1);
    const E = c.registerEditorContainer(e);
    typeof w.theme == "string" && c.setTheme(w.theme), typeof w.autoDetectHighContrast < "u" && c.setAutoDetectHighContrast(!!w.autoDetectHighContrast);
    const L = w.model;
    delete w.model, super(e, w, n, r, s, o, a, l, c, u, h, _, v), this._configurationService = d, this._standaloneThemeService = c, this._register(E);
    let T;
    if (typeof L > "u") {
      const D = m.getLanguageIdByMimeType(w.language) || w.language || $h;
      T = B9e(g, m, w.value || "", D, void 0), this._ownsModel = !0;
    } else
      T = L, this._ownsModel = !1;
    if (this._attachModel(T), T) {
      const D = {
        oldModelUrl: null,
        newModelUrl: T.uri
      };
      this._onDidChangeModel.fire(D);
    }
  }
  dispose() {
    super.dispose();
  }
  updateOptions(e) {
    A$(this._configurationService, e, !1), typeof e.theme == "string" && this._standaloneThemeService.setTheme(e.theme), typeof e.autoDetectHighContrast < "u" && this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast), super.updateOptions(e);
  }
  _postDetachModelCleanup(e) {
    super._postDetachModelCleanup(e), e && this._ownsModel && (e.dispose(), this._ownsModel = !1);
  }
};
Kue = gme([
  Kr(2, xt),
  Kr(3, Ti),
  Kr(4, jr),
  Kr(5, Jt),
  Kr(6, od),
  Kr(7, Fi),
  Kr(8, Jh),
  Kr(9, no),
  Kr(10, xn),
  Kr(11, Qa),
  Kr(12, xs),
  Kr(13, Gr),
  Kr(14, Ls),
  Kr(15, St)
], Kue);
let Yue = class extends bb {
  constructor(e, t, n, r, s, o, a, l, c, u, d, h) {
    const g = { ...t };
    A$(l, g, !0);
    const m = o.registerEditorContainer(e);
    typeof g.theme == "string" && o.setTheme(g.theme), typeof g.autoDetectHighContrast < "u" && o.setAutoDetectHighContrast(!!g.autoDetectHighContrast), super(e, g, {}, r, n, s, h, u), this._configurationService = l, this._standaloneThemeService = o, this._register(m);
  }
  dispose() {
    super.dispose();
  }
  updateOptions(e) {
    A$(this._configurationService, e, !0), typeof e.theme == "string" && this._standaloneThemeService.setTheme(e.theme), typeof e.autoDetectHighContrast < "u" && this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast), super.updateOptions(e);
  }
  _createInnerEditor(e, t, n) {
    return e.createInstance(O$, t, n);
  }
  getOriginalEditor() {
    return super.getOriginalEditor();
  }
  getModifiedEditor() {
    return super.getModifiedEditor();
  }
  addCommand(e, t, n) {
    return this.getModifiedEditor().addCommand(e, t, n);
  }
  createContextKey(e, t) {
    return this.getModifiedEditor().createContextKey(e, t);
  }
  addAction(e) {
    return this.getModifiedEditor().addAction(e);
  }
};
Yue = gme([
  Kr(2, xt),
  Kr(3, Jt),
  Kr(4, Ti),
  Kr(5, Jh),
  Kr(6, no),
  Kr(7, xn),
  Kr(8, Qh),
  Kr(9, e0),
  Kr(10, _m),
  Kr(11, h0)
], Yue);
function B9e(i, e, t, n, r) {
  if (t = t || "", !n) {
    const s = t.indexOf(`
`);
    let o = t;
    return s !== -1 && (o = t.substring(0, s)), DRe(i, t, e.createByFilepathOrFirstLine(r || null, o), r);
  }
  return DRe(i, t, e.createById(n), r);
}
function DRe(i, e, t, n) {
  return i.createModel(e, t, n);
}
ie("multiDiffEditor.headerBackground", { dark: "#262626", light: "tab.inactiveBackground", hcDark: "tab.inactiveBackground", hcLight: "tab.inactiveBackground" }, S(139, "The background color of the diff editor's header"));
ie("multiDiffEditor.background", yo, S(140, "The background color of the multi file diff editor"));
ie("multiDiffEditor.border", { dark: "sideBarSectionHeader.border", light: "#cccccc", hcDark: "sideBarSectionHeader.border", hcLight: "#cccccc" }, S(141, "The border color of the multi file diff editor"));
var tPt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, IRe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
class nPt {
  constructor(e, t) {
    this.viewModel = e, this.deltaScrollVertical = t;
  }
  getId() {
    return this.viewModel;
  }
}
let Xue = class extends ge {
  constructor(e, t, n, r, s) {
    super(), this._container = e, this._overflowWidgetsDomNode = t, this._workbenchUIElementFactory = n, this._instantiationService = r, this._viewModel = Qt(this, void 0), this._collapsed = Ie(this, (l) => {
      var c;
      return (c = this._viewModel.read(l)) == null ? void 0 : c.collapsed.read(l);
    }), this._editorContentHeight = Qt(this, 500), this.contentHeight = Ie(this, (l) => (this._collapsed.read(l) ? 0 : this._editorContentHeight.read(l)) + this._outerEditorHeight), this._modifiedContentWidth = Qt(this, 0), this._modifiedWidth = Qt(this, 0), this._originalContentWidth = Qt(this, 0), this._originalWidth = Qt(this, 0), this.maxScroll = Ie(this, (l) => {
      const c = this._modifiedContentWidth.read(l) - this._modifiedWidth.read(l), u = this._originalContentWidth.read(l) - this._originalWidth.read(l);
      return c > u ? { maxScroll: c, width: this._modifiedWidth.read(l) } : { maxScroll: u, width: this._originalWidth.read(l) };
    }), this._elements = Li("div.multiDiffEntry", [
      Li("div.header@header", [
        Li("div.header-content", [
          Li("div.collapse-button@collapseButton"),
          Li("div.file-path", [
            Li("div.title.modified.show-file-icons@primaryPath", []),
            Li("div.status.deleted@status", ["R"]),
            Li("div.title.original.show-file-icons@secondaryPath", [])
          ]),
          Li("div.actions@actions")
        ])
      ]),
      Li("div.editorParent", [
        Li("div.editorContainer@editor")
      ])
    ]), this.editor = this._register(this._instantiationService.createInstance(bb, this._elements.editor, {
      overflowWidgetsDomNode: this._overflowWidgetsDomNode
    }, {})), this.isModifedFocused = Ms(this.editor.getModifiedEditor()).isFocused, this.isOriginalFocused = Ms(this.editor.getOriginalEditor()).isFocused, this.isFocused = Ie(this, (l) => this.isModifedFocused.read(l) || this.isOriginalFocused.read(l)), this._resourceLabel = this._workbenchUIElementFactory.createResourceLabel ? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)) : void 0, this._resourceLabel2 = this._workbenchUIElementFactory.createResourceLabel ? this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)) : void 0, this._dataStore = this._register(new ke()), this._headerHeight = 40, this._lastScrollTop = -1, this._isSettingScrollTop = !1;
    const o = new ZU(this._elements.collapseButton, {});
    this._register(Xt((l) => {
      o.element.className = "", o.icon = this._collapsed.read(l) ? Pe.chevronRight : Pe.chevronDown;
    })), this._register(o.onDidClick(() => {
      var l;
      (l = this._viewModel.get()) == null || l.collapsed.set(!this._collapsed.get(), void 0);
    })), this._register(Xt((l) => {
      this._elements.editor.style.display = this._collapsed.read(l) ? "none" : "block";
    })), this._register(this.editor.getModifiedEditor().onDidLayoutChange((l) => {
      const c = this.editor.getModifiedEditor().getLayoutInfo().contentWidth;
      this._modifiedWidth.set(c, void 0);
    })), this._register(this.editor.getOriginalEditor().onDidLayoutChange((l) => {
      const c = this.editor.getOriginalEditor().getLayoutInfo().contentWidth;
      this._originalWidth.set(c, void 0);
    })), this._register(this.editor.onDidContentSizeChange((l) => {
      VP((c) => {
        this._editorContentHeight.set(l.contentHeight, c), this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(), c), this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(), c);
      });
    })), this._register(this.editor.getOriginalEditor().onDidScrollChange((l) => {
      if (this._isSettingScrollTop || !l.scrollTopChanged || !this._data)
        return;
      const c = l.scrollTop - this._lastScrollTop;
      this._data.deltaScrollVertical(c);
    })), this._register(Xt((l) => {
      var u;
      const c = (u = this._viewModel.read(l)) == null ? void 0 : u.isActive.read(l);
      this._elements.root.classList.toggle("active", c);
    })), this._container.appendChild(this._elements.root), this._outerEditorHeight = this._headerHeight, this._contextKeyService = this._register(s.createScoped(this._elements.actions));
    const a = this._register(this._instantiationService.createChild(new r2([Jt, this._contextKeyService])));
    this._register(a.createInstance(q4, this._elements.actions, wt.MultiDiffEditorFileToolbar, {
      actionRunner: this._register(new D5e(() => {
        var l;
        return (l = this._viewModel.get()) == null ? void 0 : l.modifiedUri;
      })),
      menuOptions: {
        shouldForwardArgs: !0
      },
      toolbarOptions: { primaryGroup: (l) => l.startsWith("navigation") },
      actionViewItemProvider: (l, c) => Oge(a, l, c)
    }));
  }
  setScrollLeft(e) {
    this._modifiedContentWidth.get() - this._modifiedWidth.get() > this._originalContentWidth.get() - this._originalWidth.get() ? this.editor.getModifiedEditor().setScrollLeft(e) : this.editor.getOriginalEditor().setScrollLeft(e);
  }
  setData(e) {
    this._data = e;
    function t(r) {
      return {
        ...r,
        scrollBeyondLastLine: !1,
        hideUnchangedRegions: {
          enabled: !0
        },
        scrollbar: {
          vertical: "hidden",
          horizontal: "hidden",
          handleMouseWheel: !1,
          useShadows: !1
        },
        renderOverviewRuler: !1,
        fixedOverflowWidgets: !0,
        overviewRulerBorder: !1
      };
    }
    if (!e) {
      VP((r) => {
        this._viewModel.set(void 0, r), this.editor.setDiffModel(null, r), this._dataStore.clear();
      });
      return;
    }
    const n = e.viewModel.documentDiffItem;
    if (VP((r) => {
      var c, u;
      (c = this._resourceLabel) == null || c.setUri(e.viewModel.modifiedUri ?? e.viewModel.originalUri, { strikethrough: e.viewModel.modifiedUri === void 0 });
      let s = !1, o = !1, a = !1, l = "";
      e.viewModel.modifiedUri && e.viewModel.originalUri && e.viewModel.modifiedUri.path !== e.viewModel.originalUri.path ? (l = "R", s = !0) : e.viewModel.modifiedUri ? e.viewModel.originalUri || (l = "A", a = !0) : (l = "D", o = !0), this._elements.status.classList.toggle("renamed", s), this._elements.status.classList.toggle("deleted", o), this._elements.status.classList.toggle("added", a), this._elements.status.innerText = l, (u = this._resourceLabel2) == null || u.setUri(s ? e.viewModel.originalUri : void 0, { strikethrough: !0 }), this._dataStore.clear(), this._viewModel.set(e.viewModel, r), this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef, r), this.editor.updateOptions(t(n.options ?? {}));
    }), n.onOptionsDidChange && this._dataStore.add(n.onOptionsDidChange(() => {
      this.editor.updateOptions(t(n.options ?? {}));
    })), e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore, (r) => {
      r || this.setData(void 0);
    }), e.viewModel.documentDiffItem.contextKeys)
      for (const [r, s] of Object.entries(e.viewModel.documentDiffItem.contextKeys))
        this._contextKeyService.createKey(r, s);
  }
  render(e, t, n, r) {
    this._elements.root.style.visibility = "visible", this._elements.root.style.top = `${e.start}px`, this._elements.root.style.height = `${e.length}px`, this._elements.root.style.width = `${t}px`, this._elements.root.style.position = "absolute";
    const s = e.length - this._headerHeight, o = Math.max(0, Math.min(r.start - e.start, s));
    this._elements.header.style.transform = `translateY(${o}px)`, VP((a) => {
      this.editor.layout({
        width: t - 16 - 2,
        height: e.length - this._outerEditorHeight
      });
    });
    try {
      this._isSettingScrollTop = !0, this._lastScrollTop = n, this.editor.getOriginalEditor().setScrollTop(n);
    } finally {
      this._isSettingScrollTop = !1;
    }
    this._elements.header.classList.toggle("shadow", o > 0 || n > 0), this._elements.header.classList.toggle("collapsed", o === s);
  }
  hide() {
    this._elements.root.style.top = "-100000px", this._elements.root.style.visibility = "hidden";
  }
};
Xue = tPt([
  IRe(3, xt),
  IRe(4, Jt)
], Xue);
class iPt {
  constructor(e) {
    this._create = e, this._unused = /* @__PURE__ */ new Set(), this._used = /* @__PURE__ */ new Set(), this._itemData = /* @__PURE__ */ new Map();
  }
  getUnusedObj(e) {
    let t;
    if (this._unused.size === 0)
      t = this._create(e), this._itemData.set(t, e);
    else {
      const n = [...this._unused.values()];
      t = n.find((r) => this._itemData.get(r).getId() === e.getId()) ?? n[0], this._unused.delete(t), this._itemData.set(t, e), t.setData(e);
    }
    return this._used.add(t), {
      object: t,
      dispose: () => {
        this._used.delete(t), this._unused.size > 5 ? t.dispose() : this._unused.add(t);
      }
    };
  }
  dispose() {
    for (const e of this._used)
      e.dispose();
    for (const e of this._unused)
      e.dispose();
    this._used.clear(), this._unused.clear();
  }
}
var rPt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, NRe = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Zue = class extends ge {
  constructor(e, t, n, r, s, o) {
    super(), this._element = e, this._dimension = t, this._viewModel = n, this._workbenchUIElementFactory = r, this._parentContextKeyService = s, this._parentInstantiationService = o, this._scrollableElements = Li("div.scrollContent", [
      Li("div@content", {
        style: {
          overflow: "hidden"
        }
      }),
      Li("div.monaco-editor@overflowWidgetsDomNode", {})
    ]), this._scrollable = this._register(new n2({
      forceIntegerValues: !1,
      scheduleAtNextAnimationFrame: (c) => Ju(At(this._element), c),
      smoothScrollDuration: 100
    })), this._scrollableElement = this._register(new eK(this._scrollableElements.root, {
      vertical: 1,
      horizontal: 1,
      useShadows: !1
    }, this._scrollable)), this._elements = Li("div.monaco-component.multiDiffEditor", {}, [
      Li("div", {}, [this._scrollableElement.getDomNode()]),
      Li("div.placeholder@placeholder", {}, [Li("div")])
    ]), this._sizeObserver = this._register(new l5e(this._element, void 0)), this._objectPool = this._register(new iPt((c) => {
      const u = this._instantiationService.createInstance(Xue, this._scrollableElements.content, this._scrollableElements.overflowWidgetsDomNode, this._workbenchUIElementFactory);
      return u.setData(c), u;
    })), this.scrollTop = ji(this, this._scrollableElement.onScroll, () => (
      /** @description scrollTop */
      this._scrollableElement.getScrollPosition().scrollTop
    )), this.scrollLeft = ji(this, this._scrollableElement.onScroll, () => (
      /** @description scrollLeft */
      this._scrollableElement.getScrollPosition().scrollLeft
    )), this._viewItemsInfo = Ie(this, (c) => {
      const u = this._viewModel.read(c);
      if (!u)
        return { items: [], getItem: (m) => {
          throw new Wt();
        } };
      const d = u.items.read(c), h = /* @__PURE__ */ new Map();
      return { items: d.map((m) => {
        var w;
        const _ = c.store.add(new sPt(m, this._objectPool, this.scrollLeft, (E) => {
          this._scrollableElement.setScrollPosition({ scrollTop: this._scrollableElement.getScrollPosition().scrollTop + E });
        })), v = (w = this._lastDocStates) == null ? void 0 : w[_.getKey()];
        return v && Fr((E) => {
          _.setViewState(v, E);
        }), h.set(m, _), _;
      }), getItem: (m) => h.get(m) };
    }), this._viewItems = this._viewItemsInfo.map(this, (c) => c.items), this._spaceBetweenPx = 0, this._totalHeight = this._viewItems.map(this, (c, u) => c.reduce((d, h) => d + h.contentHeight.read(u) + this._spaceBetweenPx, 0)), this.activeControl = Ie(this, (c) => {
      var h, g;
      const u = (h = this._viewModel.read(c)) == null ? void 0 : h.activeDiffItem.read(c);
      return u ? (g = this._viewItemsInfo.read(c).getItem(u).template.read(c)) == null ? void 0 : g.editor : void 0;
    }), this._contextKeyService = this._register(this._parentContextKeyService.createScoped(this._element)), this._instantiationService = this._register(this._parentInstantiationService.createChild(new r2([Jt, this._contextKeyService]))), this._lastDocStates = {}, this._register(Ql((c, u) => {
      const d = this._viewModel.read(c);
      if (d && d.contextKeys)
        for (const [h, g] of Object.entries(d.contextKeys)) {
          const m = this._contextKeyService.createKey(h, void 0);
          m.set(g), u.add(Et(() => m.reset()));
        }
    }));
    const a = this._parentContextKeyService.createKey(se.multiDiffEditorAllCollapsed.key, !1);
    this._register(Xt((c) => {
      const u = this._viewModel.read(c);
      if (u) {
        const d = u.items.read(c).every((h) => h.collapsed.read(c));
        a.set(d);
      }
    })), this._register(Xt((c) => {
      const u = this._dimension.read(c);
      this._sizeObserver.observe(u);
    }));
    const l = Ie((c) => {
      if (this._viewItems.read(c).length > 0)
        return;
      const d = this._viewModel.read(c);
      return !d || d.isLoading.read(c) ? S(142, "Loading...") : S(143, "No Changed Files");
    });
    this._register(Xt((c) => {
      const u = l.read(c);
      this._elements.placeholder.innerText = u ?? "", this._elements.placeholder.classList.toggle("visible", !!u);
    })), this._scrollableElements.content.style.position = "relative", this._register(Xt((c) => {
      const u = this._sizeObserver.height.read(c);
      this._scrollableElements.root.style.height = `${u}px`;
      const d = this._totalHeight.read(c);
      this._scrollableElements.content.style.height = `${d}px`;
      const h = this._sizeObserver.width.read(c);
      let g = h;
      const m = this._viewItems.read(c), _ = Mfe(m, yl((v) => v.maxScroll.read(c).maxScroll, Hd));
      if (_) {
        const v = _.maxScroll.read(c);
        g = h + v.maxScroll;
      }
      this._scrollableElement.setScrollDimensions({
        width: h,
        height: u,
        scrollHeight: d,
        scrollWidth: g
      });
    })), e.replaceChildren(this._elements.root), this._register(Et(() => {
      e.replaceChildren();
    })), this._register(this._register(Xt((c) => {
      VP((u) => {
        this.render(c);
      });
    })));
  }
  render(e) {
    const t = this.scrollTop.read(e);
    let n = 0, r = 0, s = 0;
    const o = this._sizeObserver.height.read(e), a = Tt.ofStartAndLength(t, o), l = this._sizeObserver.width.read(e);
    for (const c of this._viewItems.read(e)) {
      const u = c.contentHeight.read(e), d = Math.min(u, o), h = Tt.ofStartAndLength(r, d), g = Tt.ofStartAndLength(s, u);
      if (g.isBefore(a))
        n -= u - d, c.hide();
      else if (g.isAfter(a))
        c.hide();
      else {
        const m = Math.max(0, Math.min(a.start - g.start, u - d));
        n -= m;
        const _ = Tt.ofStartAndLength(t + n, o);
        c.render(h, m, l, _);
      }
      r += d + this._spaceBetweenPx, s += u + this._spaceBetweenPx;
    }
    this._scrollableElements.content.style.transform = `translateY(${-(t + n)}px)`;
  }
};
Zue = rPt([
  NRe(4, Jt),
  NRe(5, xt)
], Zue);
class sPt extends ge {
  constructor(e, t, n, r) {
    super(), this.viewModel = e, this._objectPool = t, this._scrollLeft = n, this._deltaScrollVertical = r, this._templateRef = this._register(Yhe(this, void 0)), this.contentHeight = Ie(this, (s) => {
      var o, a;
      return ((a = (o = this._templateRef.read(s)) == null ? void 0 : o.object.contentHeight) == null ? void 0 : a.read(s)) ?? this.viewModel.lastTemplateData.read(s).contentHeight;
    }), this.maxScroll = Ie(this, (s) => {
      var o;
      return ((o = this._templateRef.read(s)) == null ? void 0 : o.object.maxScroll.read(s)) ?? { maxScroll: 0, scrollWidth: 0 };
    }), this.template = Ie(this, (s) => {
      var o;
      return (o = this._templateRef.read(s)) == null ? void 0 : o.object;
    }), this._isHidden = Qt(this, !1), this._isFocused = Ie(this, (s) => {
      var o;
      return ((o = this.template.read(s)) == null ? void 0 : o.isFocused.read(s)) ?? !1;
    }), this.viewModel.setIsFocused(this._isFocused, void 0), this._register(Xt((s) => {
      var a;
      const o = this._scrollLeft.read(s);
      (a = this._templateRef.read(s)) == null || a.object.setScrollLeft(o);
    })), this._register(Xt((s) => {
      const o = this._templateRef.read(s);
      !o || !this._isHidden.read(s) || o.object.isFocused.read(s) || this._clear();
    }));
  }
  dispose() {
    this._clear(), super.dispose();
  }
  toString() {
    var e;
    return `VirtualViewItem(${(e = this.viewModel.documentDiffItem.modified) == null ? void 0 : e.uri.toString()})`;
  }
  getKey() {
    return this.viewModel.getKey();
  }
  setViewState(e, t) {
    var o;
    this.viewModel.collapsed.set(e.collapsed, t), this._updateTemplateData(t);
    const n = this.viewModel.lastTemplateData.get(), r = (o = e.selections) == null ? void 0 : o.map(bt.liftSelection);
    this.viewModel.lastTemplateData.set({
      ...n,
      selections: r
    }, t);
    const s = this._templateRef.get();
    s && r && s.object.editor.setSelections(r);
  }
  _updateTemplateData(e) {
    const t = this._templateRef.get();
    t && this.viewModel.lastTemplateData.set({
      contentHeight: t.object.contentHeight.get(),
      selections: t.object.editor.getSelections() ?? void 0
    }, e);
  }
  _clear() {
    const e = this._templateRef.get();
    e && Fr((t) => {
      this._updateTemplateData(t), e.object.hide(), this._templateRef.set(void 0, t);
    });
  }
  hide() {
    this._isHidden.set(!0, void 0);
  }
  render(e, t, n, r) {
    this._isHidden.set(!1, void 0);
    let s = this._templateRef.get();
    if (!s) {
      s = this._objectPool.getUnusedObj(new nPt(this.viewModel, this._deltaScrollVertical)), this._templateRef.set(s, void 0);
      const o = this.viewModel.lastTemplateData.get().selections;
      o && s.object.editor.setSelections(o);
    }
    s.object.render(e, n, t, r);
  }
}
var oPt = function(i, e, t, n) {
  var r = arguments.length, s = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, o;
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, e, t, n);
  else for (var a = i.length - 1; a >= 0; a--) (o = i[a]) && (s = (r < 3 ? o(s) : r > 3 ? o(e, t, s) : o(e, t)) || s);
  return r > 3 && s && Object.defineProperty(e, t, s), s;
}, aPt = function(i, e) {
  return function(t, n) {
    e(t, n, i);
  };
};
let Que = class extends ge {
  constructor(e, t, n) {
    super(), this._element = e, this._workbenchUIElementFactory = t, this._instantiationService = n, this._dimension = Qt(this, void 0), this._viewModel = Qt(this, void 0), this._widgetImpl = Ie(this, (r) => r.store.add(this._instantiationService.createInstance($v(Zue), this._element, this._dimension, this._viewModel, this._workbenchUIElementFactory))), this._register(GR(this._widgetImpl));
  }
};
Que = oPt([
  aPt(2, xt)
], Que);
function lPt(i, e, t) {
  return ln.initialize(t || {}).createInstance(Kue, i, e);
}
function cPt(i) {
  return ln.get(Ti).onCodeEditorAdd((t) => {
    i(t);
  });
}
function uPt(i) {
  return ln.get(Ti).onDiffEditorAdd((t) => {
    i(t);
  });
}
function dPt() {
  return ln.get(Ti).listCodeEditors();
}
function hPt() {
  return ln.get(Ti).listDiffEditors();
}
function fPt(i, e, t) {
  return ln.initialize(t || {}).createInstance(Yue, i, e);
}
function gPt(i, e) {
  const t = ln.initialize(e || {});
  return new Que(i, {}, t);
}
function pPt(i) {
  if (typeof i.id != "string" || typeof i.run != "function")
    throw new Error("Invalid command descriptor, `id` and `run` are required properties!");
  return _i.registerCommand(i.id, i.run);
}
function mPt(i) {
  if (typeof i.id != "string" || typeof i.label != "string" || typeof i.run != "function")
    throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");
  const e = Re.deserialize(i.precondition), t = (r, ...s) => jo.runEditorCommand(r, s, e, (o, a, l) => Promise.resolve(i.run(a, ...l))), n = new ke();
  if (n.add(_i.registerCommand(i.id, t)), i.contextMenuGroupId) {
    const r = {
      command: {
        id: i.id,
        title: i.label
      },
      when: e,
      group: i.contextMenuGroupId,
      order: i.contextMenuOrder || 0
    };
    n.add(Oa.appendMenuItem(wt.EditorContext, r));
  }
  if (Array.isArray(i.keybindings)) {
    const r = ln.get(Fi);
    if (!(r instanceof LA))
      console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");
    else {
      const s = Re.and(e, Re.deserialize(i.keybindingContext));
      n.add(r.addDynamicKeybindings(i.keybindings.map((o) => ({
        keybinding: o,
        command: i.id,
        when: s
      }))));
    }
  }
  return n;
}
function _Pt(i) {
  return H9e([i]);
}
function H9e(i) {
  const e = ln.get(Fi);
  return e instanceof LA ? e.addDynamicKeybindings(i.map((t) => ({
    keybinding: t.keybinding,
    command: t.command,
    commandArgs: t.commandArgs,
    when: Re.deserialize(t.when)
  }))) : (console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"), ge.None);
}
function bPt(i, e, t) {
  const n = ln.get(Gr), r = n.getLanguageIdByMimeType(e) || e;
  return B9e(ln.get(xs), n, i, r, t);
}
function vPt(i, e) {
  const t = ln.get(Gr), n = t.getLanguageIdByMimeType(e) || e || $h;
  i.setLanguage(t.createById(n));
}
function yPt(i, e, t) {
  i && ln.get(Nb).changeOne(e, i.uri, t);
}
function CPt(i) {
  ln.get(Nb).changeAll(i, []);
}
function wPt(i) {
  return ln.get(Nb).read(i);
}
function SPt(i) {
  return ln.get(Nb).onMarkerChanged(i);
}
function EPt(i) {
  return ln.get(xs).getModel(i);
}
function xPt() {
  return ln.get(xs).getModels();
}
function LPt(i) {
  return ln.get(xs).onModelAdded(i);
}
function TPt(i) {
  return ln.get(xs).onModelRemoved(i);
}
function kPt(i) {
  return ln.get(xs).onModelLanguageChanged((t) => {
    i({
      model: t.model,
      oldLanguage: t.oldLanguageId
    });
  });
}
function DPt(i) {
  return H2t(ln.get(xs), i);
}
function IPt(i, e) {
  const t = ln.get(Gr), n = ln.get(Jh);
  return cme.colorizeElement(n, t, i, e).then(() => {
    n.registerEditorContainer(i);
  });
}
function NPt(i, e, t) {
  const n = ln.get(Gr);
  return ln.get(Jh).registerEditorContainer(fr.document.body), cme.colorize(n, i, e, t);
}
function RPt(i, e, t = 4) {
  return ln.get(Jh).registerEditorContainer(fr.document.body), cme.colorizeModelLine(i, e, t);
}
function APt(i) {
  const e = Ys.get(i);
  return e || {
    getInitialState: () => sA,
    tokenize: (t, n, r) => ege(i, r)
  };
}
function OPt(i, e) {
  Ys.getOrCreate(e);
  const t = APt(e), n = $d(i), r = [];
  let s = t.getInitialState();
  for (let o = 0, a = n.length; o < a; o++) {
    const l = n[o], c = t.tokenize(l, !0, s);
    r[o] = c.tokens, s = c.endState;
  }
  return r;
}
function MPt(i, e) {
  ln.get(Jh).defineTheme(i, e);
}
function PPt(i) {
  ln.get(Jh).setTheme(i);
}
function FPt() {
  Fie.clearAllFontInfos();
}
function BPt(i, e) {
  return _i.registerCommand({ id: i, handler: e });
}
function HPt(i) {
  return ln.get(ad).registerOpener({
    async open(t) {
      return typeof t == "string" && (t = Ht.parse(t)), i.open(t);
    }
  });
}
function WPt(i) {
  return ln.get(Ti).registerCodeEditorOpenHandler(async (t, n, r) => {
    var a;
    if (!n)
      return null;
    const s = (a = t.options) == null ? void 0 : a.selection;
    let o;
    return s && typeof s.endLineNumber == "number" && typeof s.endColumn == "number" ? o = s : s && (o = { lineNumber: s.startLineNumber, column: s.startColumn }), await i.openCodeEditor(n, t.resource, o) ? n : null;
  });
}
function VPt() {
  return {
    // methods
    create: lPt,
    getEditors: dPt,
    getDiffEditors: hPt,
    onDidCreateEditor: cPt,
    onDidCreateDiffEditor: uPt,
    createDiffEditor: fPt,
    addCommand: pPt,
    addEditorAction: mPt,
    addKeybindingRule: _Pt,
    addKeybindingRules: H9e,
    createModel: bPt,
    setModelLanguage: vPt,
    setModelMarkers: yPt,
    getModelMarkers: wPt,
    removeAllMarkers: CPt,
    onDidChangeMarkers: SPt,
    getModels: xPt,
    getModel: EPt,
    onDidCreateModel: LPt,
    onWillDisposeModel: TPt,
    onDidChangeModelLanguage: kPt,
    createWebWorker: DPt,
    colorizeElement: IPt,
    colorize: NPt,
    colorizeModelLine: RPt,
    tokenize: OPt,
    defineTheme: MPt,
    setTheme: PPt,
    remeasureFonts: FPt,
    registerCommand: BPt,
    registerLinkOpener: HPt,
    registerEditorOpener: WPt,
    // enums
    AccessibilitySupport: Yle,
    ContentWidgetPositionPreference: tce,
    CursorChangeReason: nce,
    DefaultEndOfLine: ice,
    EditorAutoIndentStrategy: sce,
    EditorOption: oce,
    EndOfLinePreference: ace,
    EndOfLineSequence: lce,
    MinimapPosition: yce,
    MinimapSectionHeaderStyle: Cce,
    MouseTargetType: wce,
    OverlayWidgetPositionPreference: xce,
    OverviewRulerLane: Lce,
    GlyphMarginLane: cce,
    RenderLineNumbersType: Dce,
    RenderMinimap: Ice,
    ScrollbarVisibility: Rce,
    ScrollType: Nce,
    TextEditorCursorBlinkingStyle: Hce,
    TextEditorCursorStyle: Wce,
    TrackedRangeStickiness: Vce,
    WrappingIndent: Uce,
    InjectedTextCursorStops: hce,
    PositionAffinity: kce,
    ShowLightbulbIconMode: Oce,
    TextDirection: Bce,
    // classes
    ConfigurationChangedEvent: wFe,
    BareFontInfo: Px,
    FontInfo: Pie,
    TextModelResolvedOptions: xW,
    FindMatch: l4,
    ApplyUpdateResult: EF,
    EditorZoom: Of,
    createMultiFileDiffEditor: gPt,
    // vars
    EditorType: DB,
    EditorOptions: wm
  };
}
function UPt(i, e) {
  if (!e || !Array.isArray(e))
    return !1;
  for (const t of e)
    if (!i(t))
      return !1;
  return !0;
}
function qH(i, e) {
  return typeof i == "boolean" ? i : e;
}
function RRe(i, e) {
  return typeof i == "string" ? i : e;
}
function zPt(i) {
  const e = {};
  for (const t of i)
    e[t] = !0;
  return e;
}
function ARe(i, e = !1) {
  e && (i = i.map(function(n) {
    return n.toLowerCase();
  }));
  const t = zPt(i);
  return e ? function(n) {
    return t[n.toLowerCase()] !== void 0 && t.hasOwnProperty(n.toLowerCase());
  } : function(n) {
    return t[n] !== void 0 && t.hasOwnProperty(n);
  };
}
function Jue(i, e, t) {
  e = e.replace(/@@/g, "");
  let n = 0, r;
  do
    r = !1, e = e.replace(/@(\w+)/g, function(o, a) {
      r = !0;
      let l = "";
      if (typeof i[a] == "string")
        l = i[a];
      else if (i[a] && i[a] instanceof RegExp)
        l = i[a].source;
      else
        throw i[a] === void 0 ? as(i, "language definition does not contain attribute '" + a + "', used at: " + e) : as(i, "attribute reference '" + a + "' must be a string, used at: " + e);
      return YE(l) ? "" : "(?:" + l + ")";
    }), n++;
  while (r && n < 5);
  e = e.replace(/\x01/g, "@");
  const s = (i.ignoreCase ? "i" : "") + (i.unicode ? "u" : "");
  if (t && e.match(/\$[sS](\d\d?)/g)) {
    let a = null, l = null;
    return (c) => (l && a === c || (a = c, l = new RegExp($2t(i, e, c), s)), l);
  }
  return new RegExp(e, s);
}
function $Pt(i, e, t, n) {
  if (n < 0)
    return i;
  if (n < e.length)
    return e[n];
  if (n >= 100) {
    n = n - 100;
    const r = t.split(".");
    if (r.unshift(t), n < r.length)
      return r[n];
  }
  return null;
}
function jPt(i, e, t, n) {
  let r = -1, s = t, o = t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);
  o && (o[3] && (r = parseInt(o[3]), o[2] && (r = r + 100)), s = o[4]);
  let a = "~", l = s;
  !s || s.length === 0 ? (a = "!=", l = "") : /^\w*$/.test(l) ? a = "==" : (o = s.match(/^(@|!@|~|!~|==|!=)(.*)$/), o && (a = o[1], l = o[2]));
  let c;
  if ((a === "~" || a === "!~") && /^(\w|\|)*$/.test(l)) {
    const u = ARe(l.split("|"), i.ignoreCase);
    c = function(d) {
      return a === "~" ? u(d) : !u(d);
    };
  } else if (a === "@" || a === "!@") {
    const u = i[l];
    if (!u)
      throw as(i, "the @ match target '" + l + "' is not defined, in rule: " + e);
    if (!UPt(function(h) {
      return typeof h == "string";
    }, u))
      throw as(i, "the @ match target '" + l + "' must be an array of strings, in rule: " + e);
    const d = ARe(u, i.ignoreCase);
    c = function(h) {
      return a === "@" ? d(h) : !d(h);
    };
  } else if (a === "~" || a === "!~")
    if (l.indexOf("$") < 0) {
      const u = Jue(i, "^" + l + "$", !1);
      c = function(d) {
        return a === "~" ? u.test(d) : !u.test(d);
      };
    } else
      c = function(u, d, h, g) {
        return Jue(i, "^" + t1(i, l, d, h, g) + "$", !1).test(u);
      };
  else if (l.indexOf("$") < 0) {
    const u = Wy(i, l);
    c = function(d) {
      return a === "==" ? d === u : d !== u;
    };
  } else {
    const u = Wy(i, l);
    c = function(d, h, g, m, _) {
      const v = t1(i, u, h, g, m);
      return a === "==" ? d === v : d !== v;
    };
  }
  return r === -1 ? {
    name: t,
    value: n,
    test: function(u, d, h, g) {
      return c(u, u, d, h, g);
    }
  } : {
    name: t,
    value: n,
    test: function(u, d, h, g) {
      const m = $Pt(u, d, h, r);
      return c(m || "", u, d, h, g);
    }
  };
}
function ede(i, e, t) {
  if (t) {
    if (typeof t == "string")
      return t;
    if (t.token || t.token === "") {
      if (typeof t.token != "string")
        throw as(i, "a 'token' attribute must be of type string, in rule: " + e);
      {
        const n = { token: t.token };
        if (t.token.indexOf("$") >= 0 && (n.tokenSubst = !0), typeof t.bracket == "string")
          if (t.bracket === "@open")
            n.bracket = 1;
          else if (t.bracket === "@close")
            n.bracket = -1;
          else
            throw as(i, "a 'bracket' attribute must be either '@open' or '@close', in rule: " + e);
        if (t.next) {
          if (typeof t.next != "string")
            throw as(i, "the next state must be a string value in rule: " + e);
          {
            let r = t.next;
            if (!/^(@pop|@push|@popall)$/.test(r) && (r[0] === "@" && (r = r.substr(1)), r.indexOf("$") < 0 && !j2t(i, t1(i, r, "", [], ""))))
              throw as(i, "the next state '" + t.next + "' is not defined in rule: " + e);
            n.next = r;
          }
        }
        return typeof t.goBack == "number" && (n.goBack = t.goBack), typeof t.switchTo == "string" && (n.switchTo = t.switchTo), typeof t.log == "string" && (n.log = t.log), typeof t.nextEmbedded == "string" && (n.nextEmbedded = t.nextEmbedded, i.usesEmbedded = !0), n;
      }
    } else if (Array.isArray(t)) {
      const n = [];
      for (let r = 0, s = t.length; r < s; r++)
        n[r] = ede(i, e, t[r]);
      return { group: n };
    } else if (t.cases) {
      const n = [];
      let r = !1;
      for (const o in t.cases)
        if (t.cases.hasOwnProperty(o)) {
          const a = ede(i, e, t.cases[o]);
          o === "@default" || o === "@" || o === "" ? n.push({ test: void 0, value: a, name: o }) : o === "@eos" ? n.push({ test: function(l, c, u, d) {
            return d;
          }, value: a, name: o }) : n.push(jPt(i, e, o, a)), r || (r = !ga(a) && (a.hasEmbeddedEndInCases || ["@pop", "@popall"].includes(a.nextEmbedded || "")));
        }
      const s = i.defaultToken;
      return {
        hasEmbeddedEndInCases: r,
        test: function(o, a, l, c) {
          for (const u of n)
            if (!u.test || u.test(o, a, l, c))
              return u.value;
          return s;
        }
      };
    } else
      throw as(i, "an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: " + e);
  } else return { token: "" };
}
class GPt {
  constructor(e) {
    this.regex = new RegExp(""), this.action = { token: "" }, this.matchOnlyAtLineStart = !1, this.name = "", this.name = e;
  }
  setRegex(e, t) {
    let n;
    if (typeof t == "string")
      n = t;
    else if (t instanceof RegExp)
      n = t.source;
    else
      throw as(e, "rules must start with a match string or regular expression: " + this.name);
    this.matchOnlyAtLineStart = n.length > 0 && n[0] === "^", this.name = this.name + ": " + n, this.regex = Jue(e, "^(?:" + (this.matchOnlyAtLineStart ? n.substr(1) : n) + ")", !0);
  }
  setAction(e, t) {
    this.action = ede(e, this.name, t);
  }
  resolveRegex(e) {
    return this.regex instanceof RegExp ? this.regex : this.regex(e);
  }
}
function W9e(i, e) {
  if (!e || typeof e != "object")
    throw new Error("Monarch: expecting a language definition object");
  const t = {
    languageId: i,
    includeLF: qH(e.includeLF, !1),
    noThrow: !1,
    // raise exceptions during compilation
    maxStack: 100,
    start: typeof e.start == "string" ? e.start : null,
    ignoreCase: qH(e.ignoreCase, !1),
    unicode: qH(e.unicode, !1),
    tokenPostfix: RRe(e.tokenPostfix, "." + i),
    defaultToken: RRe(e.defaultToken, "source"),
    usesEmbedded: !1,
    // becomes true if we find a nextEmbedded action
    stateNames: {},
    tokenizer: {},
    brackets: []
  }, n = e;
  n.languageId = i, n.includeLF = t.includeLF, n.ignoreCase = t.ignoreCase, n.unicode = t.unicode, n.noThrow = t.noThrow, n.usesEmbedded = t.usesEmbedded, n.stateNames = e.tokenizer, n.defaultToken = t.defaultToken;
  function r(o, a, l) {
    for (const c of l) {
      let u = c.include;
      if (u) {
        if (typeof u != "string")
          throw as(t, "an 'include' attribute must be a string at: " + o);
        if (u[0] === "@" && (u = u.substr(1)), !e.tokenizer[u])
          throw as(t, "include target '" + u + "' is not defined at: " + o);
        r(o + "." + u, a, e.tokenizer[u]);
      } else {
        const d = new GPt(o);
        if (Array.isArray(c) && c.length >= 1 && c.length <= 3)
          if (d.setRegex(n, c[0]), c.length >= 3)
            if (typeof c[1] == "string")
              d.setAction(n, { token: c[1], next: c[2] });
            else if (typeof c[1] == "object") {
              const h = c[1];
              h.next = c[2], d.setAction(n, h);
            } else
              throw as(t, "a next state as the last element of a rule can only be given if the action is either an object or a string, at: " + o);
          else
            d.setAction(n, c[1]);
        else {
          if (!c.regex)
            throw as(t, "a rule must either be an array, or an object with a 'regex' or 'include' field at: " + o);
          c.name && typeof c.name == "string" && (d.name = c.name), c.matchOnlyAtStart && (d.matchOnlyAtLineStart = qH(c.matchOnlyAtLineStart, !1)), d.setRegex(n, c.regex), d.setAction(n, c.action);
        }
        a.push(d);
      }
    }
  }
  if (!e.tokenizer || typeof e.tokenizer != "object")
    throw as(t, "a language definition must define the 'tokenizer' attribute as an object");
  t.tokenizer = [];
  for (const o in e.tokenizer)
    if (e.tokenizer.hasOwnProperty(o)) {
      t.start || (t.start = o);
      const a = e.tokenizer[o];
      t.tokenizer[o] = new Array(), r("tokenizer." + o, t.tokenizer[o], a);
    }
  if (t.usesEmbedded = n.usesEmbedded, e.brackets) {
    if (!Array.isArray(e.brackets))
      throw as(t, "the 'brackets' attribute must be defined as an array");
  } else
    e.brackets = [
      { open: "{", close: "}", token: "delimiter.curly" },
      { open: "[", close: "]", token: "delimiter.square" },
      { open: "(", close: ")", token: "delimiter.parenthesis" },
      { open: "<", close: ">", token: "delimiter.angle" }
    ];
  const s = [];
  for (const o of e.brackets) {
    let a = o;
    if (a && Array.isArray(a) && a.length === 3 && (a = { token: a[2], open: a[0], close: a[1] }), a.open === a.close)
      throw as(t, "open and close brackets in a 'brackets' attribute must be different: " + a.open + `
 hint: use the 'bracket' attribute if matching on equal brackets is required.`);
    if (typeof a.open == "string" && typeof a.token == "string" && typeof a.close == "string")
      s.push({
        token: a.token + t.tokenPostfix,
        open: Wy(t, a.open),
        close: Wy(t, a.close)
      });
    else
      throw as(t, "every element in the 'brackets' array must be a '{open,close,token}' object or array");
  }
  return t.brackets = s, t.noThrow = !0, t;
}
function qPt(i) {
  KR.registerLanguage(i);
}
function KPt() {
  let i = [];
  return i = i.concat(KR.getLanguages()), i;
}
function YPt(i) {
  return ln.get(Gr).languageIdCodec.encodeLanguageId(i);
}
function XPt(i, e) {
  return ln.withServices(() => {
    const n = ln.get(Gr).onDidRequestRichLanguageFeatures((r) => {
      r === i && (n.dispose(), e());
    });
    return n;
  });
}
function ZPt(i, e) {
  return ln.withServices(() => {
    const n = ln.get(Gr).onDidRequestBasicLanguageFeatures((r) => {
      r === i && (n.dispose(), e());
    });
    return n;
  });
}
function QPt(i, e) {
  if (!ln.get(Gr).isRegisteredLanguageId(i))
    throw new Error(`Cannot set configuration for unknown language ${i}`);
  return ln.get(Ls).register(i, e, 100);
}
class JPt {
  constructor(e, t) {
    this._languageId = e, this._actual = t;
  }
  dispose() {
  }
  getInitialState() {
    return this._actual.getInitialState();
  }
  tokenize(e, t, n) {
    if (typeof this._actual.tokenize == "function")
      return W5.adaptTokenize(this._languageId, this._actual, e, n);
    throw new Error("Not supported!");
  }
  tokenizeEncoded(e, t, n) {
    const r = this._actual.tokenizeEncoded(e, n);
    return new rK(r.tokens, r.endState);
  }
}
class W5 {
  constructor(e, t, n, r) {
    this._languageId = e, this._actual = t, this._languageService = n, this._standaloneThemeService = r;
  }
  dispose() {
  }
  getInitialState() {
    return this._actual.getInitialState();
  }
  static _toClassicTokens(e, t) {
    const n = [];
    let r = 0;
    for (let s = 0, o = e.length; s < o; s++) {
      const a = e[s];
      let l = a.startIndex;
      s === 0 ? l = 0 : l < r && (l = r), n[s] = new E4(l, a.scopes, t), r = l;
    }
    return n;
  }
  static adaptTokenize(e, t, n, r) {
    const s = t.tokenize(n, r), o = W5._toClassicTokens(s.tokens, e);
    let a;
    return s.endState.equals(r) ? a = r : a = s.endState, new Pfe(o, a);
  }
  tokenize(e, t, n) {
    return W5.adaptTokenize(this._languageId, this._actual, e, n);
  }
  _toBinaryTokens(e, t) {
    const n = e.encodeLanguageId(this._languageId), r = this._standaloneThemeService.getColorTheme().tokenTheme, s = [];
    let o = 0, a = 0;
    for (let c = 0, u = t.length; c < u; c++) {
      const d = t[c], h = r.match(n, d.scopes) | 1024;
      if (o > 0 && s[o - 1] === h)
        continue;
      let g = d.startIndex;
      c === 0 ? g = 0 : g < a && (g = a), s[o++] = g, s[o++] = h, a = g;
    }
    const l = new Uint32Array(o);
    for (let c = 0; c < o; c++)
      l[c] = s[c];
    return l;
  }
  tokenizeEncoded(e, t, n) {
    const r = this._actual.tokenize(e, n), s = this._toBinaryTokens(this._languageService.languageIdCodec, r.tokens);
    let o;
    return r.endState.equals(n) ? o = n : o = r.endState, new rK(s, o);
  }
}
function eFt(i) {
  return typeof i.getInitialState == "function";
}
function tFt(i) {
  return "tokenizeEncoded" in i;
}
function V9e(i) {
  return i && typeof i.then == "function";
}
function nFt(i) {
  const e = ln.get(Jh);
  if (i) {
    const t = [null];
    for (let n = 1, r = i.length; n < r; n++)
      t[n] = De.fromHex(i[n]);
    e.setColorMapOverride(t);
  } else
    e.setColorMapOverride(null);
}
function U9e(i, e) {
  return tFt(e) ? new JPt(i, e) : new W5(i, e, ln.get(Gr), ln.get(Jh));
}
function pme(i, e) {
  const t = new Ddt(async () => {
    const n = await Promise.resolve(e.create());
    return n ? eFt(n) ? U9e(i, n) : new A5(ln.get(Gr), ln.get(Jh), i, W9e(i, n), ln.get(xn)) : null;
  });
  return Ys.registerFactory(i, t);
}
function iFt(i, e) {
  if (!ln.get(Gr).isRegisteredLanguageId(i))
    throw new Error(`Cannot set tokens provider for unknown language ${i}`);
  return V9e(e) ? pme(i, { create: () => e }) : Ys.register(i, U9e(i, e));
}
function rFt(i, e) {
  const t = (n) => new A5(ln.get(Gr), ln.get(Jh), i, W9e(i, n), ln.get(xn));
  return V9e(e) ? pme(i, { create: () => e }) : Ys.register(i, t(e));
}
function sFt(i, e) {
  return ln.get(St).referenceProvider.register(i, e);
}
function oFt(i, e) {
  return ln.get(St).renameProvider.register(i, e);
}
function aFt(i, e) {
  return ln.get(St).newSymbolNamesProvider.register(i, e);
}
function lFt(i, e) {
  return ln.get(St).signatureHelpProvider.register(i, e);
}
function cFt(i, e) {
  return ln.get(St).hoverProvider.register(i, {
    provideHover: async (n, r, s, o) => {
      const a = n.getWordAtPosition(r);
      return Promise.resolve(e.provideHover(n, r, s, o)).then((l) => {
        if (l)
          return !l.range && a && (l.range = new z(r.lineNumber, a.startColumn, r.lineNumber, a.endColumn)), l.range || (l.range = new z(r.lineNumber, r.column, r.lineNumber, r.column)), l;
      });
    }
  });
}
function uFt(i, e) {
  return ln.get(St).documentSymbolProvider.register(i, e);
}
function dFt(i, e) {
  return ln.get(St).documentHighlightProvider.register(i, e);
}
function hFt(i, e) {
  return ln.get(St).linkedEditingRangeProvider.register(i, e);
}
function fFt(i, e) {
  return ln.get(St).definitionProvider.register(i, e);
}
function gFt(i, e) {
  return ln.get(St).implementationProvider.register(i, e);
}
function pFt(i, e) {
  return ln.get(St).typeDefinitionProvider.register(i, e);
}
function mFt(i, e) {
  return ln.get(St).codeLensProvider.register(i, e);
}
function _Ft(i, e, t) {
  return ln.get(St).codeActionProvider.register(i, {
    providedCodeActionKinds: t == null ? void 0 : t.providedCodeActionKinds,
    documentation: t == null ? void 0 : t.documentation,
    provideCodeActions: (r, s, o, a) => {
      const c = ln.get(Nb).read({ resource: r.uri }).filter((u) => z.areIntersectingOrTouching(u, s));
      return e.provideCodeActions(r, s, { markers: c, only: o.only, trigger: o.trigger }, a);
    },
    resolveCodeAction: e.resolveCodeAction
  });
}
function bFt(i, e) {
  return ln.get(St).documentFormattingEditProvider.register(i, e);
}
function vFt(i, e) {
  return ln.get(St).documentRangeFormattingEditProvider.register(i, e);
}
function yFt(i, e) {
  return ln.get(St).onTypeFormattingEditProvider.register(i, e);
}
function CFt(i, e) {
  return ln.get(St).linkProvider.register(i, e);
}
function wFt(i, e) {
  return ln.get(St).completionProvider.register(i, e);
}
function SFt(i, e) {
  return ln.get(St).colorProvider.register(i, e);
}
function EFt(i, e) {
  return ln.get(St).foldingRangeProvider.register(i, e);
}
function xFt(i, e) {
  return ln.get(St).declarationProvider.register(i, e);
}
function LFt(i, e) {
  return ln.get(St).selectionRangeProvider.register(i, e);
}
function TFt(i, e) {
  return ln.get(St).documentSemanticTokensProvider.register(i, e);
}
function kFt(i, e) {
  return ln.get(St).documentRangeSemanticTokensProvider.register(i, e);
}
function DFt(i, e) {
  return ln.get(St).inlineCompletionsProvider.register(i, e);
}
function IFt(i, e) {
  return ln.get(St).inlayHintsProvider.register(i, e);
}
function NFt() {
  return {
    register: qPt,
    getLanguages: KPt,
    onLanguage: XPt,
    onLanguageEncountered: ZPt,
    getEncodedLanguageId: YPt,
    // provider methods
    setLanguageConfiguration: QPt,
    setColorMap: nFt,
    registerTokensProviderFactory: pme,
    setTokensProvider: iFt,
    setMonarchTokensProvider: rFt,
    registerReferenceProvider: sFt,
    registerRenameProvider: oFt,
    registerNewSymbolNameProvider: aFt,
    registerCompletionItemProvider: wFt,
    registerSignatureHelpProvider: lFt,
    registerHoverProvider: cFt,
    registerDocumentSymbolProvider: uFt,
    registerDocumentHighlightProvider: dFt,
    registerLinkedEditingRangeProvider: hFt,
    registerDefinitionProvider: fFt,
    registerImplementationProvider: gFt,
    registerTypeDefinitionProvider: pFt,
    registerCodeLensProvider: mFt,
    registerCodeActionProvider: _Ft,
    registerDocumentFormattingEditProvider: bFt,
    registerDocumentRangeFormattingEditProvider: vFt,
    registerOnTypeFormattingEditProvider: yFt,
    registerLinkProvider: CFt,
    registerColorProvider: SFt,
    registerFoldingRangeProvider: EFt,
    registerDeclarationProvider: xFt,
    registerSelectionRangeProvider: LFt,
    registerDocumentSemanticTokensProvider: TFt,
    registerDocumentRangeSemanticTokensProvider: kFt,
    registerInlineCompletionsProvider: DFt,
    registerInlayHintsProvider: IFt,
    // enums
    DocumentHighlightKind: rce,
    CompletionItemKind: Qle,
    CompletionItemTag: Jle,
    CompletionItemInsertTextRule: Zle,
    SymbolKind: Pce,
    SymbolTag: Fce,
    IndentAction: dce,
    CompletionTriggerKind: ece,
    SignatureHelpTriggerKind: Mce,
    InlayHintKind: fce,
    InlineCompletionTriggerKind: mce,
    CodeActionTriggerType: Xle,
    NewSymbolNameTag: Sce,
    NewSymbolNameTriggerKind: Ece,
    PartialAcceptTriggerKind: Tce,
    HoverVerbosityAction: uce,
    InlineCompletionEndOfLifeReasonKind: pce,
    InlineCompletionDisplayLocationKind: gce,
    // classes
    FoldingRangeKind: Qy,
    SelectedSuggestionInfo: L3e,
    EditDeltaInfo: P4
  };
}
wm.wrappingIndent.defaultValue = 0;
wm.glyphMargin.defaultValue = !1;
wm.autoIndent.defaultValue = 3;
wm.overviewRulerLanes.defaultValue = 2;
u5.setFormatterSelector((i, e, t) => Promise.resolve(i[0]));
const mu = p9e();
mu.editor = VPt();
mu.languages = NFt();
const mme = mu.CancellationTokenSource, _me = mu.Emitter, bme = mu.KeyCode, vme = mu.KeyMod, yme = mu.Position, Cme = mu.Range, wme = mu.Selection, Sme = mu.SelectionDirection, Eme = mu.MarkerSeverity, xme = mu.MarkerTag, Lme = mu.Uri, Tme = mu.Token, ZB = mu.editor, kme = mu.languages, Kte = globalThis.MonacoEnvironment;
(Kte != null && Kte.globalAPI || typeof globalThis.define == "function" && globalThis.define.amd) && (globalThis.monaco = mu);
typeof globalThis.require < "u" && typeof globalThis.require.config == "function" && globalThis.require.config({
  ignoreDuplicateModules: [
    "vscode-languageserver-types",
    "vscode-languageserver-types/main",
    "vscode-languageserver-textdocument",
    "vscode-languageserver-textdocument/main",
    "vscode-nls",
    "vscode-nls/vscode-nls",
    "jsonc-parser",
    "jsonc-parser/main",
    "vscode-uri",
    "vscode-uri/index",
    "vs/basic-languages/typescript/typescript"
  ]
});
const QB = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  CancellationTokenSource: mme,
  Emitter: _me,
  KeyCode: bme,
  KeyMod: vme,
  MarkerSeverity: Eme,
  MarkerTag: xme,
  Position: yme,
  Range: Cme,
  Selection: wme,
  SelectionDirection: Sme,
  Token: Tme,
  Uri: Lme,
  editor: ZB,
  languages: kme
}, Symbol.toStringTag, { value: "Module" })), RFt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  CancellationTokenSource: mme,
  Emitter: _me,
  KeyCode: bme,
  KeyMod: vme,
  MarkerSeverity: Eme,
  MarkerTag: xme,
  Position: yme,
  Range: Cme,
  Selection: wme,
  SelectionDirection: Sme,
  Token: Tme,
  Uri: Lme,
  editor: ZB,
  languages: kme
}, Symbol.toStringTag, { value: "Module" }));
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
var AFt = Object.defineProperty, OFt = Object.getOwnPropertyDescriptor, MFt = Object.getOwnPropertyNames, PFt = Object.prototype.hasOwnProperty, FFt = (i, e, t, n) => {
  if (e && typeof e == "object" || typeof e == "function")
    for (let r of MFt(e))
      !PFt.call(i, r) && r !== t && AFt(i, r, { get: () => e[r], enumerable: !(n = OFt(e, r)) || n.enumerable });
  return i;
}, BFt = (i, e, t) => (FFt(i, e, "default"), t), aF = {};
BFt(aF, QB);
var z9e = {}, Yte = {}, HFt = class $9e {
  static getOrCreate(e) {
    return Yte[e] || (Yte[e] = new $9e(e)), Yte[e];
  }
  constructor(e) {
    this._languageId = e, this._loadingTriggered = !1, this._lazyLoadPromise = new Promise((t, n) => {
      this._lazyLoadPromiseResolve = t, this._lazyLoadPromiseReject = n;
    });
  }
  load() {
    return this._loadingTriggered || (this._loadingTriggered = !0, z9e[this._languageId].loader().then(
      (e) => this._lazyLoadPromiseResolve(e),
      (e) => this._lazyLoadPromiseReject(e)
    )), this._lazyLoadPromise;
  }
};
function Kt(i) {
  const e = i.id;
  z9e[e] = i, aF.languages.register(i);
  const t = HFt.getOrCreate(e);
  aF.languages.registerTokensProviderFactory(e, {
    create: async () => (await t.load()).language
  }), aF.languages.onLanguageEncountered(e, async () => {
    const n = await t.load();
    aF.languages.setLanguageConfiguration(e, n.conf);
  });
}
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "abap",
  extensions: [".abap"],
  aliases: ["abap", "ABAP"],
  loader: () => import("./abap-Cn3xYS4N.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "apex",
  extensions: [".cls"],
  aliases: ["Apex", "apex"],
  mimetypes: ["text/x-apex-source", "text/x-apex"],
  loader: () => import("./apex-DxOADB8A.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "azcli",
  extensions: [".azcli"],
  aliases: ["Azure CLI", "azcli"],
  loader: () => import("./azcli-7DJeGsrE.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "bat",
  extensions: [".bat", ".cmd"],
  aliases: ["Batch", "bat"],
  loader: () => import("./bat-CSgwqXr4.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "bicep",
  extensions: [".bicep"],
  aliases: ["Bicep"],
  loader: () => import("./bicep-BHme2D76.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "cameligo",
  extensions: [".mligo"],
  aliases: ["Cameligo"],
  loader: () => import("./cameligo-D5RRH3bt.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "clojure",
  extensions: [".clj", ".cljs", ".cljc", ".edn"],
  aliases: ["clojure", "Clojure"],
  loader: () => import("./clojure-4gjm3MAk.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "coffeescript",
  extensions: [".coffee"],
  aliases: ["CoffeeScript", "coffeescript", "coffee"],
  mimetypes: ["text/x-coffeescript", "text/coffeescript"],
  loader: () => import("./coffee-Bw8aYVwY.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "c",
  extensions: [".c", ".h"],
  aliases: ["C", "c"],
  loader: () => import("./cpp-Dr2_lgrd.js")
});
Kt({
  id: "cpp",
  extensions: [".cpp", ".cc", ".cxx", ".hpp", ".hh", ".hxx"],
  aliases: ["C++", "Cpp", "cpp"],
  loader: () => import("./cpp-Dr2_lgrd.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "csharp",
  extensions: [".cs", ".csx", ".cake"],
  aliases: ["C#", "csharp"],
  loader: () => import("./csharp-BNA0dWAO.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "csp",
  extensions: [".csp"],
  aliases: ["CSP", "csp"],
  loader: () => import("./csp-cYjWfdKS.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "css",
  extensions: [".css"],
  aliases: ["CSS", "css"],
  mimetypes: ["text/css"],
  loader: () => import("./css-BccxlXde.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "cypher",
  extensions: [".cypher", ".cyp"],
  aliases: ["Cypher", "OpenCypher"],
  loader: () => import("./cypher-Lt2R8FHs.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "dart",
  extensions: [".dart"],
  aliases: ["Dart", "dart"],
  mimetypes: ["text/x-dart-source", "text/x-dart"],
  loader: () => import("./dart-h2OKTcIi.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "dockerfile",
  extensions: [".dockerfile"],
  filenames: ["Dockerfile"],
  aliases: ["Dockerfile"],
  loader: () => import("./dockerfile-CGyOR7xK.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "ecl",
  extensions: [".ecl"],
  aliases: ["ECL", "Ecl", "ecl"],
  loader: () => import("./ecl-CVOxlMmz.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "elixir",
  extensions: [".ex", ".exs"],
  aliases: ["Elixir", "elixir", "ex"],
  loader: () => import("./elixir-CdKxInYL.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "flow9",
  extensions: [".flow"],
  aliases: ["Flow9", "Flow", "flow9", "flow"],
  loader: () => import("./flow9-DWf1zmoN.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "fsharp",
  extensions: [".fs", ".fsi", ".ml", ".mli", ".fsx", ".fsscript"],
  aliases: ["F#", "FSharp", "fsharp"],
  loader: () => import("./fsharp-Jwl1m3WD.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "freemarker2",
  extensions: [".ftl", ".ftlh", ".ftlx"],
  aliases: ["FreeMarker2", "Apache FreeMarker2"],
  loader: () => import("./freemarker2-C5e2Gwdz.js").then((i) => i.TagAutoInterpolationDollar)
});
Kt({
  id: "freemarker2.tag-angle.interpolation-dollar",
  aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
  loader: () => import("./freemarker2-C5e2Gwdz.js").then((i) => i.TagAngleInterpolationDollar)
});
Kt({
  id: "freemarker2.tag-bracket.interpolation-dollar",
  aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
  loader: () => import("./freemarker2-C5e2Gwdz.js").then((i) => i.TagBracketInterpolationDollar)
});
Kt({
  id: "freemarker2.tag-angle.interpolation-bracket",
  aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
  loader: () => import("./freemarker2-C5e2Gwdz.js").then((i) => i.TagAngleInterpolationBracket)
});
Kt({
  id: "freemarker2.tag-bracket.interpolation-bracket",
  aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
  loader: () => import("./freemarker2-C5e2Gwdz.js").then((i) => i.TagBracketInterpolationBracket)
});
Kt({
  id: "freemarker2.tag-auto.interpolation-dollar",
  aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
  loader: () => import("./freemarker2-C5e2Gwdz.js").then((i) => i.TagAutoInterpolationDollar)
});
Kt({
  id: "freemarker2.tag-auto.interpolation-bracket",
  aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
  loader: () => import("./freemarker2-C5e2Gwdz.js").then((i) => i.TagAutoInterpolationBracket)
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "go",
  extensions: [".go"],
  aliases: ["Go"],
  loader: () => import("./go-C1wl4x6q.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "graphql",
  extensions: [".graphql", ".gql"],
  aliases: ["GraphQL", "graphql", "gql"],
  mimetypes: ["application/graphql"],
  loader: () => import("./graphql-D9jK1rr7.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "handlebars",
  extensions: [".handlebars", ".hbs"],
  aliases: ["Handlebars", "handlebars", "hbs"],
  mimetypes: ["text/x-handlebars-template"],
  loader: () => import("./handlebars-Dqk8GD7y.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "hcl",
  extensions: [".tf", ".tfvars", ".hcl"],
  aliases: ["Terraform", "tf", "HCL", "hcl"],
  loader: () => import("./hcl-CRyQ9vR8.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "html",
  extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm"],
  aliases: ["HTML", "htm", "html", "xhtml"],
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
  loader: () => import("./html-D9ApKOu4.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "ini",
  extensions: [".ini", ".properties", ".gitconfig"],
  filenames: ["config", ".gitattributes", ".gitconfig", ".editorconfig"],
  aliases: ["Ini", "ini"],
  loader: () => import("./ini-DLK8U_rP.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "java",
  extensions: [".java", ".jav"],
  aliases: ["Java", "java"],
  mimetypes: ["text/x-java-source", "text/x-java"],
  loader: () => import("./java-CgscrsQ6.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "javascript",
  extensions: [".js", ".es6", ".jsx", ".mjs", ".cjs"],
  firstLine: "^#!.*\\bnode",
  filenames: ["jakefile"],
  aliases: ["JavaScript", "javascript", "js"],
  mimetypes: ["text/javascript"],
  loader: () => import("./javascript-BbnZai92.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "julia",
  extensions: [".jl"],
  aliases: ["julia", "Julia"],
  loader: () => import("./julia-h8JD9-NK.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "kotlin",
  extensions: [".kt", ".kts"],
  aliases: ["Kotlin", "kotlin"],
  mimetypes: ["text/x-kotlin-source", "text/x-kotlin"],
  loader: () => import("./kotlin-CoBRBjJ4.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "less",
  extensions: [".less"],
  aliases: ["Less", "less"],
  mimetypes: ["text/x-less", "text/less"],
  loader: () => import("./less-DwpfoszR.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "lexon",
  extensions: [".lex"],
  aliases: ["Lexon"],
  loader: () => import("./lexon-jOtzMTWZ.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "lua",
  extensions: [".lua"],
  aliases: ["Lua", "lua"],
  loader: () => import("./lua-mUf2k_up.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "liquid",
  extensions: [".liquid", ".html.liquid"],
  aliases: ["Liquid", "liquid"],
  mimetypes: ["application/liquid"],
  loader: () => import("./liquid-ca8S-2GH.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "m3",
  extensions: [".m3", ".i3", ".mg", ".ig"],
  aliases: ["Modula-3", "Modula3", "modula3", "m3"],
  loader: () => import("./m3-ED5ZqcHn.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "markdown",
  extensions: [".md", ".markdown", ".mdown", ".mkdn", ".mkd", ".mdwn", ".mdtxt", ".mdtext"],
  aliases: ["Markdown", "markdown"],
  loader: () => import("./markdown-D2pK0c45.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "mdx",
  extensions: [".mdx"],
  aliases: ["MDX", "mdx"],
  loader: () => import("./mdx-Cz_BHgm4.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "mips",
  extensions: [".s"],
  aliases: ["MIPS", "MIPS-V"],
  mimetypes: ["text/x-mips", "text/mips", "text/plaintext"],
  loader: () => import("./mips-79MHqeld.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "msdax",
  extensions: [".dax", ".msdax"],
  aliases: ["DAX", "MSDAX"],
  loader: () => import("./msdax-LXQ7sjkr.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "mysql",
  extensions: [],
  aliases: ["MySQL", "mysql"],
  loader: () => import("./mysql-CxD5nCGG.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "objective-c",
  extensions: [".m"],
  aliases: ["Objective-C"],
  loader: () => import("./objective-c-JmOx6tzJ.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "pascal",
  extensions: [".pas", ".p", ".pp"],
  aliases: ["Pascal", "pas"],
  mimetypes: ["text/x-pascal-source", "text/x-pascal"],
  loader: () => import("./pascal-Ds1tRjAc.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "pascaligo",
  extensions: [".ligo"],
  aliases: ["Pascaligo", "ligo"],
  loader: () => import("./pascaligo-Do82du1V.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "perl",
  extensions: [".pl", ".pm"],
  aliases: ["Perl", "pl"],
  loader: () => import("./perl-CWF_aTDf.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "pgsql",
  extensions: [],
  aliases: ["PostgreSQL", "postgres", "pg", "postgre"],
  loader: () => import("./pgsql-DyUItGCz.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "php",
  extensions: [".php", ".php4", ".php5", ".phtml", ".ctp"],
  aliases: ["PHP", "php"],
  mimetypes: ["application/x-php"],
  loader: () => import("./php-Cv7XUgBE.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "pla",
  extensions: [".pla"],
  loader: () => import("./pla-7HbgOgOH.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "postiats",
  extensions: [".dats", ".sats", ".hats"],
  aliases: ["ATS", "ATS/Postiats"],
  loader: () => import("./postiats-DHiIX9YK.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "powerquery",
  extensions: [".pq", ".pqm"],
  aliases: ["PQ", "M", "Power Query", "Power Query M"],
  loader: () => import("./powerquery-Da9GbL50.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "powershell",
  extensions: [".ps1", ".psm1", ".psd1"],
  aliases: ["PowerShell", "powershell", "ps", "ps1"],
  loader: () => import("./powershell-5wTDvte5.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "proto",
  extensions: [".proto"],
  aliases: ["protobuf", "Protocol Buffers"],
  loader: () => import("./protobuf-DbyadcsF.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "pug",
  extensions: [".jade", ".pug"],
  aliases: ["Pug", "Jade", "jade"],
  loader: () => import("./pug-C8d1RLBe.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "python",
  extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"],
  aliases: ["Python", "py"],
  firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
  loader: () => import("./python-0pXkFxvU.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "qsharp",
  extensions: [".qs"],
  aliases: ["Q#", "qsharp"],
  loader: () => import("./qsharp-U_wrfY2c.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "r",
  extensions: [".r", ".rhistory", ".rmd", ".rprofile", ".rt"],
  aliases: ["R", "r"],
  loader: () => import("./r-DgI_4tSq.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "razor",
  extensions: [".cshtml"],
  aliases: ["Razor", "razor"],
  mimetypes: ["text/x-cshtml"],
  loader: () => import("./razor-Cw82fliQ.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "redis",
  extensions: [".redis"],
  aliases: ["redis"],
  loader: () => import("./redis-B3QRouHH.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "redshift",
  extensions: [],
  aliases: ["Redshift", "redshift"],
  loader: () => import("./redshift-ByDyyDnq.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "restructuredtext",
  extensions: [".rst"],
  aliases: ["reStructuredText", "restructuredtext"],
  loader: () => import("./restructuredtext-CZ_86dNj.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "ruby",
  extensions: [".rb", ".rbx", ".rjs", ".gemspec", ".pp"],
  filenames: ["rakefile", "Gemfile"],
  aliases: ["Ruby", "rb"],
  loader: () => import("./ruby-DE3dXeXu.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "rust",
  extensions: [".rs", ".rlib"],
  aliases: ["Rust", "rust"],
  loader: () => import("./rust-CHTvW4oi.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "sb",
  extensions: [".sb"],
  aliases: ["Small Basic", "sb"],
  loader: () => import("./sb-D9Jr2OVT.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "scala",
  extensions: [".scala", ".sc", ".sbt"],
  aliases: ["Scala", "scala", "SBT", "Sbt", "sbt", "Dotty", "dotty"],
  mimetypes: ["text/x-scala-source", "text/x-scala", "text/x-sbt", "text/x-dotty"],
  loader: () => import("./scala-D0vzQQ0O.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "scheme",
  extensions: [".scm", ".ss", ".sch", ".rkt"],
  aliases: ["scheme", "Scheme"],
  loader: () => import("./scheme-DqhSR-hQ.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "scss",
  extensions: [".scss"],
  aliases: ["Sass", "sass", "scss"],
  mimetypes: ["text/x-scss", "text/scss"],
  loader: () => import("./scss-DYCBPqH6.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "shell",
  extensions: [".sh", ".bash"],
  aliases: ["Shell", "sh"],
  loader: () => import("./shell-D94Q2xte.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "sol",
  extensions: [".sol"],
  aliases: ["sol", "solidity", "Solidity"],
  loader: () => import("./solidity-CxF9frIF.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "aes",
  extensions: [".aes"],
  aliases: ["aes", "sophia", "Sophia"],
  loader: () => import("./sophia-C2CWwOT1.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "sparql",
  extensions: [".rq"],
  aliases: ["sparql", "SPARQL"],
  loader: () => import("./sparql-D4QVWKjP.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "sql",
  extensions: [".sql"],
  aliases: ["SQL"],
  loader: () => import("./sql-D8blgAEa.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "st",
  extensions: [".st", ".iecst", ".iecplc", ".lc3lib", ".TcPOU", ".TcDUT", ".TcGVL", ".TcIO"],
  aliases: ["StructuredText", "scl", "stl"],
  loader: () => import("./st-5ntkiTzy.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "swift",
  aliases: ["Swift", "swift"],
  extensions: [".swift"],
  mimetypes: ["text/swift"],
  loader: () => import("./swift-CCSw4Qt5.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "systemverilog",
  extensions: [".sv", ".svh"],
  aliases: ["SV", "sv", "SystemVerilog", "systemverilog"],
  loader: () => import("./systemverilog-CLQGxlCO.js")
});
Kt({
  id: "verilog",
  extensions: [".v", ".vh"],
  aliases: ["V", "v", "Verilog", "verilog"],
  loader: () => import("./systemverilog-CLQGxlCO.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "tcl",
  extensions: [".tcl"],
  aliases: ["tcl", "Tcl", "tcltk", "TclTk", "tcl/tk", "Tcl/Tk"],
  loader: () => import("./tcl-DWhV2DoT.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "twig",
  extensions: [".twig"],
  aliases: ["Twig", "twig"],
  mimetypes: ["text/x-twig"],
  loader: () => import("./twig-DG85z6w9.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "typescript",
  extensions: [".ts", ".tsx", ".cts", ".mts"],
  aliases: ["TypeScript", "ts", "typescript"],
  mimetypes: ["text/typescript"],
  loader: () => import("./typescript-B-nxYo8d.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "typespec",
  extensions: [".tsp"],
  aliases: ["TypeSpec"],
  loader: () => import("./typespec-D0SVndBG.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "vb",
  extensions: [".vb"],
  aliases: ["Visual Basic", "vb"],
  loader: () => import("./vb-CvbmPgok.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "wgsl",
  extensions: [".wgsl"],
  aliases: ["WebGPU Shading Language", "WGSL", "wgsl"],
  loader: () => import("./wgsl-BzOorUri.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "xml",
  extensions: [
    ".xml",
    ".xsd",
    ".dtd",
    ".ascx",
    ".csproj",
    ".config",
    ".props",
    ".targets",
    ".wxi",
    ".wxl",
    ".wxs",
    ".xaml",
    ".svg",
    ".svgz",
    ".opf",
    ".xslt",
    ".xsl"
  ],
  firstLine: "(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",
  aliases: ["XML", "xml"],
  mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
  loader: () => import("./xml-CndwuAvE.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
Kt({
  id: "yaml",
  extensions: [".yaml", ".yml"],
  aliases: ["YAML", "yaml", "YML", "yml"],
  mimetypes: ["application/x-yaml", "text/x-yaml"],
  loader: () => import("./yaml-EzgIpDpO.js")
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
var WFt = Object.defineProperty, VFt = Object.getOwnPropertyDescriptor, UFt = Object.getOwnPropertyNames, zFt = Object.prototype.hasOwnProperty, $Ft = (i, e, t, n) => {
  if (e && typeof e == "object" || typeof e == "function")
    for (let r of UFt(e))
      !zFt.call(i, r) && r !== t && WFt(i, r, { get: () => e[r], enumerable: !(n = VFt(e, r)) || n.enumerable });
  return i;
}, jFt = (i, e, t) => ($Ft(i, e, "default"), t), g2 = {};
jFt(g2, QB);
var Dme = class {
  constructor(e, t, n) {
    this._onDidChange = new g2.Emitter(), this._languageId = e, this.setOptions(t), this.setModeConfiguration(n);
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get languageId() {
    return this._languageId;
  }
  get modeConfiguration() {
    return this._modeConfiguration;
  }
  get diagnosticsOptions() {
    return this.options;
  }
  get options() {
    return this._options;
  }
  setOptions(e) {
    this._options = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(this);
  }
  setDiagnosticsOptions(e) {
    this.setOptions(e);
  }
  setModeConfiguration(e) {
    this._modeConfiguration = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(this);
  }
}, Ime = {
  validate: !0,
  lint: {
    compatibleVendorPrefixes: "ignore",
    vendorPrefix: "warning",
    duplicateProperties: "warning",
    emptyRules: "warning",
    importStatement: "ignore",
    boxModel: "ignore",
    universalSelector: "ignore",
    zeroUnits: "ignore",
    fontFaceProperties: "warning",
    hexColorLength: "error",
    argumentsInColorFunction: "error",
    unknownProperties: "warning",
    ieHack: "ignore",
    unknownVendorSpecificProperties: "ignore",
    propertyIgnoredDueToDisplay: "warning",
    important: "ignore",
    float: "ignore",
    idSelector: "ignore"
  },
  data: { useDefaultDataProvider: !0 },
  format: {
    newlineBetweenSelectors: !0,
    newlineBetweenRules: !0,
    spaceAroundSelectorSeparator: !1,
    braceStyle: "collapse",
    maxPreserveNewLines: void 0,
    preserveNewLines: !0
  }
}, Nme = {
  completionItems: !0,
  hovers: !0,
  documentSymbols: !0,
  definitions: !0,
  references: !0,
  documentHighlights: !0,
  rename: !0,
  colors: !0,
  foldingRanges: !0,
  diagnostics: !0,
  selectionRanges: !0,
  documentFormattingEdits: !0,
  documentRangeFormattingEdits: !0
}, j9e = new Dme(
  "css",
  Ime,
  Nme
), G9e = new Dme(
  "scss",
  Ime,
  Nme
), q9e = new Dme(
  "less",
  Ime,
  Nme
);
g2.languages.css = { cssDefaults: j9e, lessDefaults: q9e, scssDefaults: G9e };
function Rme() {
  return import("./cssMode-CuUs1v0G.js");
}
g2.languages.onLanguage("less", () => {
  Rme().then((i) => i.setupMode(q9e));
});
g2.languages.onLanguage("scss", () => {
  Rme().then((i) => i.setupMode(G9e));
});
g2.languages.onLanguage("css", () => {
  Rme().then((i) => i.setupMode(j9e));
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
var GFt = Object.defineProperty, qFt = Object.getOwnPropertyDescriptor, KFt = Object.getOwnPropertyNames, YFt = Object.prototype.hasOwnProperty, XFt = (i, e, t, n) => {
  if (e && typeof e == "object" || typeof e == "function")
    for (let r of KFt(e))
      !YFt.call(i, r) && r !== t && GFt(i, r, { get: () => e[r], enumerable: !(n = qFt(e, r)) || n.enumerable });
  return i;
}, ZFt = (i, e, t) => (XFt(i, e, "default"), t), ZK = {};
ZFt(ZK, QB);
var QFt = class {
  constructor(e, t, n) {
    this._onDidChange = new ZK.Emitter(), this._languageId = e, this.setOptions(t), this.setModeConfiguration(n);
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get languageId() {
    return this._languageId;
  }
  get options() {
    return this._options;
  }
  get modeConfiguration() {
    return this._modeConfiguration;
  }
  setOptions(e) {
    this._options = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(this);
  }
  setModeConfiguration(e) {
    this._modeConfiguration = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(this);
  }
}, JFt = {
  tabSize: 4,
  insertSpaces: !1,
  wrapLineLength: 120,
  unformatted: 'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',
  contentUnformatted: "pre",
  indentInnerHtml: !1,
  preserveNewLines: !0,
  maxPreserveNewLines: void 0,
  indentHandlebars: !1,
  endWithNewline: !1,
  extraLiners: "head, body, /html",
  wrapAttributes: "auto"
}, QK = {
  format: JFt,
  suggest: {},
  data: { useDefaultDataProvider: !0 }
};
function JK(i) {
  return {
    completionItems: !0,
    hovers: !0,
    documentSymbols: !0,
    links: !0,
    documentHighlights: !0,
    rename: !0,
    colors: !0,
    foldingRanges: !0,
    selectionRanges: !0,
    diagnostics: i === h3,
    // turned off for Razor and Handlebar
    documentFormattingEdits: i === h3,
    // turned off for Razor and Handlebar
    documentRangeFormattingEdits: i === h3
    // turned off for Razor and Handlebar
  };
}
var h3 = "html", ORe = "handlebars", MRe = "razor", K9e = eY(
  h3,
  QK,
  JK(h3)
), e3t = K9e.defaults, Y9e = eY(
  ORe,
  QK,
  JK(ORe)
), t3t = Y9e.defaults, X9e = eY(
  MRe,
  QK,
  JK(MRe)
), n3t = X9e.defaults;
ZK.languages.html = {
  htmlDefaults: e3t,
  razorDefaults: n3t,
  handlebarDefaults: t3t,
  htmlLanguageService: K9e,
  handlebarLanguageService: Y9e,
  razorLanguageService: X9e,
  registerHTMLLanguageService: eY
};
function i3t() {
  return import("./htmlMode-DSL4VqRa.js");
}
function eY(i, e = QK, t = JK(i)) {
  const n = new QFt(i, e, t);
  let r;
  const s = ZK.languages.onLanguage(i, async () => {
    r = (await i3t()).setupMode(n);
  });
  return {
    defaults: n,
    dispose() {
      s.dispose(), r == null || r.dispose(), r = void 0;
    }
  };
}
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
var r3t = Object.defineProperty, s3t = Object.getOwnPropertyDescriptor, o3t = Object.getOwnPropertyNames, a3t = Object.prototype.hasOwnProperty, l3t = (i, e, t, n) => {
  if (e && typeof e == "object" || typeof e == "function")
    for (let r of o3t(e))
      !a3t.call(i, r) && r !== t && r3t(i, r, { get: () => e[r], enumerable: !(n = s3t(e, r)) || n.enumerable });
  return i;
}, c3t = (i, e, t) => (l3t(i, e, "default"), t), JB = {};
c3t(JB, QB);
var u3t = class {
  constructor(e, t, n) {
    this._onDidChange = new JB.Emitter(), this._languageId = e, this.setDiagnosticsOptions(t), this.setModeConfiguration(n);
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get languageId() {
    return this._languageId;
  }
  get modeConfiguration() {
    return this._modeConfiguration;
  }
  get diagnosticsOptions() {
    return this._diagnosticsOptions;
  }
  setDiagnosticsOptions(e) {
    this._diagnosticsOptions = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(this);
  }
  setModeConfiguration(e) {
    this._modeConfiguration = e || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(this);
  }
}, d3t = {
  validate: !0,
  allowComments: !0,
  schemas: [],
  enableSchemaRequest: !1,
  schemaRequest: "warning",
  schemaValidation: "warning",
  comments: "error",
  trailingCommas: "error"
}, h3t = {
  documentFormattingEdits: !0,
  documentRangeFormattingEdits: !0,
  completionItems: !0,
  hovers: !0,
  documentSymbols: !0,
  tokens: !0,
  colors: !0,
  foldingRanges: !0,
  diagnostics: !0,
  selectionRanges: !0
}, Z9e = new u3t(
  "json",
  d3t,
  h3t
), f3t = () => Q9e().then((i) => i.getWorker());
JB.languages.json = { jsonDefaults: Z9e, getWorker: f3t };
function Q9e() {
  return import("./jsonMode-TWFEFvft.js");
}
JB.languages.register({
  id: "json",
  extensions: [".json", ".bowerrc", ".jshintrc", ".jscsrc", ".eslintrc", ".babelrc", ".har"],
  aliases: ["JSON", "json"],
  mimetypes: ["application/json"]
});
JB.languages.onLanguage("json", () => {
  Q9e().then((i) => i.setupMode(Z9e));
});
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
var g3t = Object.defineProperty, p3t = Object.getOwnPropertyDescriptor, m3t = Object.getOwnPropertyNames, _3t = Object.prototype.hasOwnProperty, b3t = (i, e, t, n) => {
  if (e && typeof e == "object" || typeof e == "function")
    for (let r of m3t(e))
      !_3t.call(i, r) && r !== t && g3t(i, r, { get: () => e[r], enumerable: !(n = p3t(e, r)) || n.enumerable });
  return i;
}, v3t = (i, e, t) => (b3t(i, e, "default"), t), y3t = "5.4.5", TA = {};
v3t(TA, QB);
var J9e = /* @__PURE__ */ ((i) => (i[i.None = 0] = "None", i[i.CommonJS = 1] = "CommonJS", i[i.AMD = 2] = "AMD", i[i.UMD = 3] = "UMD", i[i.System = 4] = "System", i[i.ES2015 = 5] = "ES2015", i[i.ESNext = 99] = "ESNext", i))(J9e || {}), e7e = /* @__PURE__ */ ((i) => (i[i.None = 0] = "None", i[i.Preserve = 1] = "Preserve", i[i.React = 2] = "React", i[i.ReactNative = 3] = "ReactNative", i[i.ReactJSX = 4] = "ReactJSX", i[i.ReactJSXDev = 5] = "ReactJSXDev", i))(e7e || {}), t7e = /* @__PURE__ */ ((i) => (i[i.CarriageReturnLineFeed = 0] = "CarriageReturnLineFeed", i[i.LineFeed = 1] = "LineFeed", i))(t7e || {}), n7e = /* @__PURE__ */ ((i) => (i[i.ES3 = 0] = "ES3", i[i.ES5 = 1] = "ES5", i[i.ES2015 = 2] = "ES2015", i[i.ES2016 = 3] = "ES2016", i[i.ES2017 = 4] = "ES2017", i[i.ES2018 = 5] = "ES2018", i[i.ES2019 = 6] = "ES2019", i[i.ES2020 = 7] = "ES2020", i[i.ESNext = 99] = "ESNext", i[i.JSON = 100] = "JSON", i[
  i.Latest = 99
  /* ESNext */
] = "Latest", i))(n7e || {}), i7e = /* @__PURE__ */ ((i) => (i[i.Classic = 1] = "Classic", i[i.NodeJs = 2] = "NodeJs", i))(i7e || {}), r7e = class {
  constructor(i, e, t, n, r) {
    this._onDidChange = new TA.Emitter(), this._onDidExtraLibsChange = new TA.Emitter(), this._extraLibs = /* @__PURE__ */ Object.create(null), this._removedExtraLibs = /* @__PURE__ */ Object.create(null), this._eagerModelSync = !1, this.setCompilerOptions(i), this.setDiagnosticsOptions(e), this.setWorkerOptions(t), this.setInlayHintsOptions(n), this.setModeConfiguration(r), this._onDidExtraLibsChangeTimeout = -1;
  }
  get onDidChange() {
    return this._onDidChange.event;
  }
  get onDidExtraLibsChange() {
    return this._onDidExtraLibsChange.event;
  }
  get modeConfiguration() {
    return this._modeConfiguration;
  }
  get workerOptions() {
    return this._workerOptions;
  }
  get inlayHintsOptions() {
    return this._inlayHintsOptions;
  }
  getExtraLibs() {
    return this._extraLibs;
  }
  addExtraLib(i, e) {
    let t;
    if (typeof e > "u" ? t = `ts:extralib-${Math.random().toString(36).substring(2, 15)}` : t = e, this._extraLibs[t] && this._extraLibs[t].content === i)
      return {
        dispose: () => {
        }
      };
    let n = 1;
    return this._removedExtraLibs[t] && (n = this._removedExtraLibs[t] + 1), this._extraLibs[t] && (n = this._extraLibs[t].version + 1), this._extraLibs[t] = {
      content: i,
      version: n
    }, this._fireOnDidExtraLibsChangeSoon(), {
      dispose: () => {
        let r = this._extraLibs[t];
        r && r.version === n && (delete this._extraLibs[t], this._removedExtraLibs[t] = n, this._fireOnDidExtraLibsChangeSoon());
      }
    };
  }
  setExtraLibs(i) {
    for (const e in this._extraLibs)
      this._removedExtraLibs[e] = this._extraLibs[e].version;
    if (this._extraLibs = /* @__PURE__ */ Object.create(null), i && i.length > 0)
      for (const e of i) {
        const t = e.filePath || `ts:extralib-${Math.random().toString(36).substring(2, 15)}`, n = e.content;
        let r = 1;
        this._removedExtraLibs[t] && (r = this._removedExtraLibs[t] + 1), this._extraLibs[t] = {
          content: n,
          version: r
        };
      }
    this._fireOnDidExtraLibsChangeSoon();
  }
  _fireOnDidExtraLibsChangeSoon() {
    this._onDidExtraLibsChangeTimeout === -1 && (this._onDidExtraLibsChangeTimeout = window.setTimeout(() => {
      this._onDidExtraLibsChangeTimeout = -1, this._onDidExtraLibsChange.fire(void 0);
    }, 0));
  }
  getCompilerOptions() {
    return this._compilerOptions;
  }
  setCompilerOptions(i) {
    this._compilerOptions = i || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
  }
  getDiagnosticsOptions() {
    return this._diagnosticsOptions;
  }
  setDiagnosticsOptions(i) {
    this._diagnosticsOptions = i || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
  }
  setWorkerOptions(i) {
    this._workerOptions = i || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
  }
  setInlayHintsOptions(i) {
    this._inlayHintsOptions = i || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
  }
  setMaximumWorkerIdleTime(i) {
  }
  setEagerModelSync(i) {
    this._eagerModelSync = i;
  }
  getEagerModelSync() {
    return this._eagerModelSync;
  }
  setModeConfiguration(i) {
    this._modeConfiguration = i || /* @__PURE__ */ Object.create(null), this._onDidChange.fire(void 0);
  }
}, C3t = y3t, s7e = {
  completionItems: !0,
  hovers: !0,
  documentSymbols: !0,
  definitions: !0,
  references: !0,
  documentHighlights: !0,
  rename: !0,
  diagnostics: !0,
  documentRangeFormattingEdits: !0,
  signatureHelp: !0,
  onTypeFormattingEdits: !0,
  codeActions: !0,
  inlayHints: !0
}, o7e = new r7e(
  {
    allowNonTsExtensions: !0,
    target: 99
    /* Latest */
  },
  { noSemanticValidation: !1, noSyntaxValidation: !1, onlyVisible: !1 },
  {},
  {},
  s7e
), a7e = new r7e(
  {
    allowNonTsExtensions: !0,
    allowJs: !0,
    target: 99
    /* Latest */
  },
  { noSemanticValidation: !0, noSyntaxValidation: !1, onlyVisible: !1 },
  {},
  {},
  s7e
), w3t = () => tY().then((i) => i.getTypeScriptWorker()), S3t = () => tY().then((i) => i.getJavaScriptWorker());
TA.languages.typescript = {
  ModuleKind: J9e,
  JsxEmit: e7e,
  NewLineKind: t7e,
  ScriptTarget: n7e,
  ModuleResolutionKind: i7e,
  typescriptVersion: C3t,
  typescriptDefaults: o7e,
  javascriptDefaults: a7e,
  getTypeScriptWorker: w3t,
  getJavaScriptWorker: S3t
};
function tY() {
  return import("./tsMode-Bcy98rdn.js");
}
TA.languages.onLanguage("typescript", () => tY().then((i) => i.setupTypeScript(o7e)));
TA.languages.onLanguage("javascript", () => tY().then((i) => i.setupJavaScript(a7e)));
/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Version: 0.54.0(7c2310116c57517348bbd868a21139f32454be22)
 * Released under the MIT license
 * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
 *-----------------------------------------------------------------------------*/
var E3t = Object.defineProperty, x3t = Object.getOwnPropertyDescriptor, L3t = Object.getOwnPropertyNames, T3t = Object.prototype.hasOwnProperty, k3t = (i, e, t, n) => {
  if (e && typeof e == "object" || typeof e == "function")
    for (let r of L3t(e))
      !T3t.call(i, r) && r !== t && E3t(i, r, { get: () => e[r], enumerable: !(n = x3t(e, r)) || n.enumerable });
  return i;
}, D3t = (i, e, t) => (k3t(i, e, "default"), t), l7e = {};
D3t(l7e, RFt);
function I3t(i, e) {
  var n;
  const t = globalThis.MonacoEnvironment;
  if (t != null && t.createTrustedTypesPolicy)
    try {
      return t.createTrustedTypesPolicy(i, e);
    } catch (r) {
      console.error(r);
      return;
    }
  try {
    return (n = globalThis.trustedTypes) == null ? void 0 : n.createPolicy(i, e);
  } catch (r) {
    console.error(r);
    return;
  }
}
var M$;
typeof self == "object" && self.constructor && self.constructor.name === "DedicatedWorkerGlobalScope" && globalThis.workerttPolicy !== void 0 ? M$ = globalThis.workerttPolicy : M$ = I3t("defaultWorkerFactory", {
  createScriptURL: (i) => i
});
function N3t(i) {
  const e = i.label, t = globalThis.MonacoEnvironment;
  if (t) {
    if (typeof t.getWorker == "function")
      return t.getWorker("workerMain.js", e);
    if (typeof t.getWorkerUrl == "function") {
      const n = t.getWorkerUrl("workerMain.js", e);
      return new Worker(
        M$ ? M$.createScriptURL(n) : n,
        { name: e, type: "module" }
      );
    }
  }
  throw new Error(
    "You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker"
  );
}
function R3t(i) {
  const e = Promise.resolve(
    N3t({
      label: i.label ?? "monaco-editor-worker",
      moduleId: i.moduleId
    })
  ).then((t) => (t.postMessage("ignore"), t.postMessage(i.createData), t));
  return l7e.editor.createWebWorker({
    worker: e,
    host: i.host,
    keepIdleModels: i.keepIdleModels
  });
}
var A3t = ZB.createWebWorker;
ZB.createWebWorker = function(i) {
  return i.worker === void 0 ? R3t(i) : A3t(i);
};
const O3t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  CancellationTokenSource: mme,
  Emitter: _me,
  KeyCode: bme,
  KeyMod: vme,
  MarkerSeverity: Eme,
  MarkerTag: xme,
  Position: yme,
  Range: Cme,
  Selection: wme,
  SelectionDirection: Sme,
  Token: Tme,
  Uri: Lme,
  editor: ZB,
  languages: kme
}, Symbol.toStringTag, { value: "Module" }));
She.config({ monaco: O3t });
function M3t({ value: i, onChange: e }) {
  const t = Zn.useCallback((r) => {
    r.focus();
  }, []), n = Zn.useCallback((r) => {
    e(r || "");
  }, [e]);
  return /* @__PURE__ */ hr.jsx(
    ltt,
    {
      height: "100%",
      defaultLanguage: "markdown",
      value: i,
      onChange: n,
      onMount: t,
      theme: "vs-dark",
      options: {
        fontSize: tE.FONT_SIZE,
        fontFamily: 'Consolas, "Courier New", monospace',
        minimap: { enabled: !1 },
        lineNumbers: "on",
        wordWrap: "on",
        automaticLayout: !0,
        tabSize: tE.TAB_SIZE,
        scrollBeyondLastLine: !1,
        padding: { top: tE.PADDING_VERTICAL, bottom: tE.PADDING_VERTICAL },
        scrollbar: {
          vertical: "auto",
          horizontal: "auto",
          verticalScrollbarSize: tE.SCROLLBAR_SIZE,
          horizontalScrollbarSize: tE.SCROLLBAR_SIZE
        },
        // Markdown-specific settings
        quickSuggestions: !1,
        suggestOnTriggerCharacters: !1,
        acceptSuggestionOnEnter: "off",
        lineDecorationsWidth: tE.LINE_DECORATIONS_WIDTH,
        renderLineHighlight: "line",
        folding: !0,
        foldingStrategy: "indentation",
        bracketPairColorization: { enabled: !1 }
      },
      loading: /* @__PURE__ */ hr.jsx("div", { className: "flex items-center justify-center h-full bg-[var(--editor-bg)] text-[var(--editor-text)]", children: /* @__PURE__ */ hr.jsx("span", { className: "text-sm", children: "Loading editor..." }) })
    }
  );
}
function Ey() {
  return Ey = Object.assign ? Object.assign.bind() : function(i) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e];
      for (var n in t) ({}).hasOwnProperty.call(t, n) && (i[n] = t[n]);
    }
    return i;
  }, Ey.apply(null, arguments);
}
const e6 = (
  // Note: overloads in JSDoc can’t yet use different `@template`s.
  /**
   * @type {(
   *   (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
   *   (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
   *   (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
   *   ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
   *   ((test?: Test) => Check)
   * )}
   */
  /**
   * @param {Test} [test]
   * @returns {Check}
   */
  (function(i) {
    if (i == null)
      return H3t;
    if (typeof i == "function")
      return nY(i);
    if (typeof i == "object")
      return Array.isArray(i) ? P3t(i) : (
        // Cast because `ReadonlyArray` goes into the above but `isArray`
        // narrows to `Array`.
        F3t(
          /** @type {Props} */
          i
        )
      );
    if (typeof i == "string")
      return B3t(i);
    throw new Error("Expected function, string, or object as test");
  })
);
function P3t(i) {
  const e = [];
  let t = -1;
  for (; ++t < i.length; )
    e[t] = e6(i[t]);
  return nY(n);
  function n(...r) {
    let s = -1;
    for (; ++s < e.length; )
      if (e[s].apply(this, r)) return !0;
    return !1;
  }
}
function F3t(i) {
  const e = (
    /** @type {Record<string, unknown>} */
    i
  );
  return nY(t);
  function t(n) {
    const r = (
      /** @type {Record<string, unknown>} */
      /** @type {unknown} */
      n
    );
    let s;
    for (s in i)
      if (r[s] !== e[s]) return !1;
    return !0;
  }
}
function B3t(i) {
  return nY(e);
  function e(t) {
    return t && t.type === i;
  }
}
function nY(i) {
  return e;
  function e(t, n, r) {
    return !!(W3t(t) && i.call(
      this,
      t,
      typeof n == "number" ? n : void 0,
      r || void 0
    ));
  }
}
function H3t() {
  return !0;
}
function W3t(i) {
  return i !== null && typeof i == "object" && "type" in i;
}
const c7e = [], V3t = !0, P$ = !1, f3 = "skip";
function u7e(i, e, t, n) {
  let r;
  typeof e == "function" && typeof t != "function" ? (n = t, t = e) : r = e;
  const s = e6(r), o = n ? -1 : 1;
  a(i, void 0, [])();
  function a(l, c, u) {
    const d = (
      /** @type {Record<string, unknown>} */
      l && typeof l == "object" ? l : {}
    );
    if (typeof d.type == "string") {
      const g = (
        // `hast`
        typeof d.tagName == "string" ? d.tagName : (
          // `xast`
          typeof d.name == "string" ? d.name : void 0
        )
      );
      Object.defineProperty(h, "name", {
        value: "node (" + (l.type + (g ? "<" + g + ">" : "")) + ")"
      });
    }
    return h;
    function h() {
      let g = c7e, m, _, v;
      if ((!e || s(l, c, u[u.length - 1] || void 0)) && (g = U3t(t(l, u)), g[0] === P$))
        return g;
      if ("children" in l && l.children) {
        const w = (
          /** @type {UnistParent} */
          l
        );
        if (w.children && g[0] !== f3)
          for (_ = (n ? w.children.length : -1) + o, v = u.concat(w); _ > -1 && _ < w.children.length; ) {
            const E = w.children[_];
            if (m = a(E, _, v)(), m[0] === P$)
              return m;
            _ = typeof m[1] == "number" ? m[1] : _ + o;
          }
      }
      return g;
    }
  }
}
function U3t(i) {
  return Array.isArray(i) ? i : typeof i == "number" ? [V3t, i] : i == null ? c7e : [i];
}
function qd(i, e, t, n) {
  let r, s, o;
  typeof e == "function" && typeof t != "function" ? (s = void 0, o = e, r = t) : (s = e, o = t, r = n), u7e(i, s, a, r);
  function a(l, c) {
    const u = c[c.length - 1], d = u ? u.children.indexOf(l) : void 0;
    return o(l, d, u);
  }
}
function EN(i) {
  return "children" in i ? d7e(i) : "value" in i ? i.value : "";
}
function z3t(i) {
  return i.type === "text" ? i.value : "children" in i ? d7e(i) : "";
}
function d7e(i) {
  let e = -1;
  const t = [];
  for (; ++e < i.children.length; )
    t[e] = z3t(i.children[e]);
  return t.join("");
}
const $3t = {}.hasOwnProperty;
function j3t(i, e, t) {
  const n = e6(e), r = e && typeof e == "object" && "cascade" in e ? (
    /** @type {boolean | null | undefined} */
    e.cascade
  ) : void 0, s = r ?? !0;
  return o(i);
  function o(a, l, c) {
    const u = [];
    if (!n(a, l, c)) return;
    if (G3t(a)) {
      let g = -1;
      for (; ++g < a.children.length; ) {
        const m = o(a.children[g], g, a);
        m && u.push(m);
      }
      if (s && a.children.length > 0 && u.length === 0)
        return;
    }
    const d = {};
    let h;
    for (h in a)
      $3t.call(a, h) && (d[h] = h === "children" ? u : a[h]);
    return d;
  }
}
function G3t(i) {
  return "children" in i && i.children !== void 0;
}
var KH = { exports: {} }, PRe;
function q3t() {
  return PRe || (PRe = 1, (function(i, e) {
    function t(n) {
      let r = [], s;
      for (let o of n.split(",").map((a) => a.trim()))
        if (/^-?\d+$/.test(o))
          r.push(parseInt(o, 10));
        else if (s = o.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)) {
          let [a, l, c, u] = s;
          if (l && u) {
            l = parseInt(l), u = parseInt(u);
            const d = l < u ? 1 : -1;
            (c === "-" || c === ".." || c === "‥") && (u += d);
            for (let h = l; h !== u; h += d) r.push(h);
          }
        }
      return r;
    }
    e.default = t, i.exports = t;
  })(KH, KH.exports)), KH.exports;
}
var K3t = q3t();
const Y3t = /* @__PURE__ */ WA(K3t);
Wr.displayName = "clike";
Wr.aliases = [];
function Wr(i) {
  i.languages.clike = {
    comment: [
      {
        pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
        lookbehind: !0,
        greedy: !0
      },
      {
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    "class-name": {
      pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
      lookbehind: !0,
      inside: {
        punctuation: /[.\\]/
      }
    },
    keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
    boolean: /\b(?:false|true)\b/,
    function: /\b\w+(?=\()/,
    number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
    operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
    punctuation: /[{}[\];(),.:]/
  };
}
Em.displayName = "c";
Em.aliases = [];
function Em(i) {
  i.register(Wr), i.languages.c = i.languages.extend("clike", {
    comment: {
      pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
      greedy: !0
    },
    string: {
      // https://en.cppreference.com/w/c/language/string_literal
      pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
      greedy: !0
    },
    "class-name": {
      pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
      lookbehind: !0
    },
    keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
    function: /\b[a-z_]\w*(?=\s*\()/i,
    number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
    operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
  }), i.languages.insertBefore("c", "string", {
    char: {
      // https://en.cppreference.com/w/c/language/character_constant
      pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
      greedy: !0
    }
  }), i.languages.insertBefore("c", "string", {
    macro: {
      // allow for multiline macro definitions
      // spaces after the # character compile fine with gcc
      pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
      lookbehind: !0,
      greedy: !0,
      alias: "property",
      inside: {
        string: [
          {
            // highlight the path of the include statement as a string
            pattern: /^(#\s*include\s*)<[^>]+>/,
            lookbehind: !0
          },
          i.languages.c.string
        ],
        char: i.languages.c.char,
        comment: i.languages.c.comment,
        "macro-name": [
          {
            pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
            lookbehind: !0
          },
          {
            pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
            lookbehind: !0,
            alias: "function"
          }
        ],
        // highlight macro directives as keywords
        directive: {
          pattern: /^(#\s*)[a-z]+/,
          lookbehind: !0,
          alias: "keyword"
        },
        "directive-hash": /^#/,
        punctuation: /##|\\(?=[\r\n])/,
        expression: {
          pattern: /\S[\s\S]*/,
          inside: i.languages.c
        }
      }
    }
  }), i.languages.insertBefore("c", "function", {
    // highlight predefined macros as constants
    constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
  }), delete i.languages.c.boolean;
}
lk.displayName = "cpp";
lk.aliases = [];
function lk(i) {
  i.register(Em), (function(e) {
    var t = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, n = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(
      /<keyword>/g,
      function() {
        return t.source;
      }
    );
    e.languages.cpp = e.languages.extend("c", {
      "class-name": [
        {
          pattern: RegExp(
            /(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(
              /<keyword>/g,
              function() {
                return t.source;
              }
            )
          ),
          lookbehind: !0
        },
        // This is intended to capture the class name of method implementations like:
        //   void foo::bar() const {}
        // However! The `foo` in the above example could also be a namespace, so we only capture the class name if
        // it starts with an uppercase letter. This approximation should give decent results.
        /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
        // This will capture the class name before destructors like:
        //   Foo::~Foo() {}
        /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
        // This also intends to capture the class name of method implementations but here the class has template
        // parameters, so it can't be a namespace (until C++ adds generic namespaces).
        /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
      ],
      keyword: t,
      number: {
        pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
        greedy: !0
      },
      operator: />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
      boolean: /\b(?:false|true)\b/
    }), e.languages.insertBefore("cpp", "string", {
      module: {
        // https://en.cppreference.com/w/cpp/language/modules
        pattern: RegExp(
          /(\b(?:import|module)\s+)/.source + "(?:" + // header-name
          /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + "|" + // module name or partition or both
          /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(
            /<mod-name>/g,
            function() {
              return n;
            }
          ) + ")"
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          string: /^[<"][\s\S]+/,
          operator: /:/,
          punctuation: /\./
        }
      },
      "raw-string": {
        pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
        alias: "string",
        greedy: !0
      }
    }), e.languages.insertBefore("cpp", "keyword", {
      "generic-function": {
        pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
        inside: {
          function: /^\w+/,
          generic: {
            pattern: /<[\s\S]+/,
            alias: "class-name",
            inside: e.languages.cpp
          }
        }
      }
    }), e.languages.insertBefore("cpp", "operator", {
      "double-colon": {
        pattern: /::/,
        alias: "punctuation"
      }
    }), e.languages.insertBefore("cpp", "class-name", {
      // the base clause is an optional list of parent classes
      // https://en.cppreference.com/w/cpp/language/class
      "base-clause": {
        pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
        lookbehind: !0,
        greedy: !0,
        inside: e.languages.extend("cpp", {})
      }
    }), e.languages.insertBefore(
      "inside",
      "double-colon",
      {
        // All untokenized words that are not namespaces should be class names
        "class-name": /\b[a-z_]\w*\b(?!\s*::)/i
      },
      e.languages.cpp["base-clause"]
    );
  })(i);
}
iY.displayName = "arduino";
iY.aliases = ["ino"];
function iY(i) {
  i.register(lk), i.languages.arduino = i.languages.extend("cpp", {
    keyword: /\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,
    constant: /\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,
    builtin: /\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/
  }), i.languages.ino = i.languages.arduino;
}
t6.displayName = "bash";
t6.aliases = ["sh", "shell"];
function t6(i) {
  (function(e) {
    var t = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", n = {
      pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
      lookbehind: !0,
      alias: "punctuation",
      // this looks reasonably well in all themes
      inside: null
      // see below
    }, r = {
      bash: n,
      environment: {
        pattern: RegExp("\\$" + t),
        alias: "constant"
      },
      variable: [
        // [0]: Arithmetic Environment
        {
          pattern: /\$?\(\([\s\S]+?\)\)/,
          greedy: !0,
          inside: {
            // If there is a $ sign at the beginning highlight $(( and )) as variable
            variable: [
              {
                pattern: /(^\$\(\([\s\S]+)\)\)/,
                lookbehind: !0
              },
              /^\$\(\(/
            ],
            number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
            // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
            operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
            // If there is no $ sign at the beginning highlight (( and )) as punctuation
            punctuation: /\(\(?|\)\)?|,|;/
          }
        },
        // [1]: Command Substitution
        {
          pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
          greedy: !0,
          inside: {
            variable: /^\$\(|^`|\)$|`$/
          }
        },
        // [2]: Brace expansion
        {
          pattern: /\$\{[^}]+\}/,
          greedy: !0,
          inside: {
            operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
            punctuation: /[\[\]]/,
            environment: {
              pattern: RegExp("(\\{)" + t),
              lookbehind: !0,
              alias: "constant"
            }
          }
        },
        /\$(?:\w+|[#?*!@$])/
      ],
      // Escape sequences from echo and printf's manuals, and escaped quotes.
      entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
    };
    e.languages.bash = {
      shebang: {
        pattern: /^#!\s*\/.*/,
        alias: "important"
      },
      comment: {
        pattern: /(^|[^"{\\$])#.*/,
        lookbehind: !0
      },
      "function-name": [
        // a) function foo {
        // b) foo() {
        // c) function foo() {
        // but not “foo {”
        {
          // a) and c)
          pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
          lookbehind: !0,
          alias: "function"
        },
        {
          // b)
          pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
          alias: "function"
        }
      ],
      // Highlight variable names as variables in for and select beginnings.
      "for-or-select": {
        pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
        alias: "variable",
        lookbehind: !0
      },
      // Highlight variable names as variables in the left-hand part
      // of assignments (“=” and “+=”).
      "assign-left": {
        pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
        inside: {
          environment: {
            pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + t),
            lookbehind: !0,
            alias: "constant"
          }
        },
        alias: "variable",
        lookbehind: !0
      },
      // Highlight parameter names as variables
      parameter: {
        pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
        alias: "variable",
        lookbehind: !0
      },
      string: [
        // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
        {
          pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
          lookbehind: !0,
          greedy: !0,
          inside: r
        },
        // Here-document with quotes around the tag
        // → No expansion (so no “inside”).
        {
          pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
          lookbehind: !0,
          greedy: !0,
          inside: {
            bash: n
          }
        },
        // “Normal” string
        {
          // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
          pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
          lookbehind: !0,
          greedy: !0,
          inside: r
        },
        {
          // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
          pattern: /(^|[^$\\])'[^']*'/,
          lookbehind: !0,
          greedy: !0
        },
        {
          // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
          pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
          greedy: !0,
          inside: {
            entity: r.entity
          }
        }
      ],
      environment: {
        pattern: RegExp("\\$?" + t),
        alias: "constant"
      },
      variable: r.variable,
      function: {
        pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
        lookbehind: !0
      },
      keyword: {
        pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
        lookbehind: !0
      },
      // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
      builtin: {
        pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
        lookbehind: !0,
        // Alias added to make those easier to distinguish from strings.
        alias: "class-name"
      },
      boolean: {
        pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
        lookbehind: !0
      },
      "file-descriptor": {
        pattern: /\B&\d\b/,
        alias: "important"
      },
      operator: {
        // Lots of redirections here, but not just that.
        pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
        inside: {
          "file-descriptor": {
            pattern: /^\d/,
            alias: "important"
          }
        }
      },
      punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
      number: {
        pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
        lookbehind: !0
      }
    }, n.inside = e.languages.bash;
    for (var s = [
      "comment",
      "function-name",
      "for-or-select",
      "assign-left",
      "parameter",
      "string",
      "environment",
      "function",
      "keyword",
      "builtin",
      "boolean",
      "file-descriptor",
      "operator",
      "punctuation",
      "number"
    ], o = r.variable[1].inside, a = 0; a < s.length; a++)
      o[s[a]] = e.languages.bash[s[a]];
    e.languages.sh = e.languages.bash, e.languages.shell = e.languages.bash;
  })(i);
}
ck.displayName = "csharp";
ck.aliases = ["cs", "dotnet"];
function ck(i) {
  i.register(Wr), (function(e) {
    function t(J, ae) {
      return J.replace(/<<(\d+)>>/g, function(be, re) {
        return "(?:" + ae[+re] + ")";
      });
    }
    function n(J, ae, be) {
      return RegExp(t(J, ae), "");
    }
    function r(J, ae) {
      for (var be = 0; be < ae; be++)
        J = J.replace(/<<self>>/g, function() {
          return "(?:" + J + ")";
        });
      return J.replace(/<<self>>/g, "[^\\s\\S]");
    }
    var s = {
      // keywords which represent a return or variable type
      type: "bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",
      // keywords which are used to declare a type
      typeDeclaration: "class enum interface record struct",
      // contextual keywords
      // ("var" and "dynamic" are missing because they are used like types)
      contextual: "add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",
      // all other keywords
      other: "abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"
    };
    function o(J) {
      return "\\b(?:" + J.trim().replace(/ /g, "|") + ")\\b";
    }
    var a = o(
      s.typeDeclaration
    ), l = RegExp(
      o(
        s.type + " " + s.typeDeclaration + " " + s.contextual + " " + s.other
      )
    ), c = o(
      s.typeDeclaration + " " + s.contextual + " " + s.other
    ), u = o(
      s.type + " " + s.typeDeclaration + " " + s.other
    ), d = r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2), h = r(/\((?:[^()]|<<self>>)*\)/.source, 2), g = /@?\b[A-Za-z_]\w*\b/.source, m = t(/<<0>>(?:\s*<<1>>)?/.source, [g, d]), _ = t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [
      c,
      m
    ]), v = /\[\s*(?:,\s*)*\]/.source, w = t(
      /<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,
      [_, v]
    ), E = t(
      /[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,
      [d, h, v]
    ), L = t(/\(<<0>>+(?:,<<0>>+)+\)/.source, [E]), T = t(
      /(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,
      [L, _, v]
    ), D = {
      keyword: l,
      punctuation: /[<>()?,.:[\]]/
    }, N = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source, R = /"(?:\\.|[^\\"\r\n])*"/.source, M = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
    e.languages.csharp = e.languages.extend("clike", {
      string: [
        {
          pattern: n(/(^|[^$\\])<<0>>/.source, [M]),
          lookbehind: !0,
          greedy: !0
        },
        {
          pattern: n(/(^|[^@$\\])<<0>>/.source, [R]),
          lookbehind: !0,
          greedy: !0
        }
      ],
      "class-name": [
        {
          // Using static
          // using static System.Math;
          pattern: n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [
            _
          ]),
          lookbehind: !0,
          inside: D
        },
        {
          // Using alias (type)
          // using Project = PC.MyCompany.Project;
          pattern: n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [
            g,
            T
          ]),
          lookbehind: !0,
          inside: D
        },
        {
          // Using alias (alias)
          // using Project = PC.MyCompany.Project;
          pattern: n(/(\busing\s+)<<0>>(?=\s*=)/.source, [g]),
          lookbehind: !0
        },
        {
          // Type declarations
          // class Foo<A, B>
          // interface Foo<out A, B>
          pattern: n(/(\b<<0>>\s+)<<1>>/.source, [
            a,
            m
          ]),
          lookbehind: !0,
          inside: D
        },
        {
          // Single catch exception declaration
          // catch(Foo)
          // (things like catch(Foo e) is covered by variable declaration)
          pattern: n(/(\bcatch\s*\(\s*)<<0>>/.source, [_]),
          lookbehind: !0,
          inside: D
        },
        {
          // Name of the type parameter of generic constraints
          // where Foo : class
          pattern: n(/(\bwhere\s+)<<0>>/.source, [g]),
          lookbehind: !0
        },
        {
          // Casts and checks via as and is.
          // as Foo<A>, is Bar<B>
          // (things like if(a is Foo b) is covered by variable declaration)
          pattern: n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [
            w
          ]),
          lookbehind: !0,
          inside: D
        },
        {
          // Variable, field and parameter declaration
          // (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
          pattern: n(
            /\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,
            [T, u, g]
          ),
          inside: D
        }
      ],
      keyword: l,
      // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
      number: /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,
      operator: />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
      punctuation: /\?\.?|::|[{}[\];(),.:]/
    }), e.languages.insertBefore("csharp", "number", {
      range: {
        pattern: /\.\./,
        alias: "operator"
      }
    }), e.languages.insertBefore("csharp", "punctuation", {
      "named-parameter": {
        pattern: n(/([(,]\s*)<<0>>(?=\s*:)/.source, [g]),
        lookbehind: !0,
        alias: "punctuation"
      }
    }), e.languages.insertBefore("csharp", "class-name", {
      namespace: {
        // namespace Foo.Bar {}
        // using Foo.Bar;
        pattern: n(
          /(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,
          [g]
        ),
        lookbehind: !0,
        inside: {
          punctuation: /\./
        }
      },
      "type-expression": {
        // default(Foo), typeof(Foo<Bar>), sizeof(int)
        pattern: n(
          /(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,
          [h]
        ),
        lookbehind: !0,
        alias: "class-name",
        inside: D
      },
      "return-type": {
        // Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
        // int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
        // int Foo => 0; int Foo { get; set } = 0;
        pattern: n(
          /<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,
          [T, _]
        ),
        inside: D,
        alias: "class-name"
      },
      "constructor-invocation": {
        // new List<Foo<Bar[]>> { }
        pattern: n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [T]),
        lookbehind: !0,
        inside: D,
        alias: "class-name"
      },
      /*'explicit-implementation': {
      // int IFoo<Foo>.Bar => 0; void IFoo<Foo<Foo>>.Foo<T>();
      pattern: replace(/\b<<0>>(?=\.<<1>>)/, className, methodOrPropertyDeclaration),
      inside: classNameInside,
      alias: 'class-name'
      },*/
      "generic-method": {
        // foo<Bar>()
        pattern: n(/<<0>>\s*<<1>>(?=\s*\()/.source, [g, d]),
        inside: {
          function: n(/^<<0>>/.source, [g]),
          generic: {
            pattern: RegExp(d),
            alias: "class-name",
            inside: D
          }
        }
      },
      "type-list": {
        // The list of types inherited or of generic constraints
        // class Foo<F> : Bar, IList<FooBar>
        // where F : Bar, IList<int>
        pattern: n(
          /\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,
          [
            a,
            m,
            g,
            T,
            l.source,
            h,
            /\bnew\s*\(\s*\)/.source
          ]
        ),
        lookbehind: !0,
        inside: {
          "record-arguments": {
            pattern: n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [
              m,
              h
            ]),
            lookbehind: !0,
            greedy: !0,
            inside: e.languages.csharp
          },
          keyword: l,
          "class-name": {
            pattern: RegExp(T),
            greedy: !0,
            inside: D
          },
          punctuation: /[,()]/
        }
      },
      preprocessor: {
        pattern: /(^[\t ]*)#.*/m,
        lookbehind: !0,
        alias: "property",
        inside: {
          // highlight preprocessor directives as keywords
          directive: {
            pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
            lookbehind: !0,
            alias: "keyword"
          }
        }
      }
    });
    var B = R + "|" + N, H = t(
      /\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,
      [B]
    ), j = r(
      t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
        H
      ]),
      2
    ), K = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source, X = t(/<<0>>(?:\s*\(<<1>>*\))?/.source, [
      _,
      j
    ]);
    e.languages.insertBefore("csharp", "class-name", {
      attribute: {
        // Attributes
        // [Foo], [Foo(1), Bar(2, Prop = "foo")], [return: Foo(1), Bar(2)], [assembly: Foo(Bar)]
        pattern: n(
          /((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,
          [K, X]
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          target: {
            pattern: n(/^<<0>>(?=\s*:)/.source, [K]),
            alias: "keyword"
          },
          "attribute-arguments": {
            pattern: n(/\(<<0>>*\)/.source, [j]),
            inside: e.languages.csharp
          },
          "class-name": {
            pattern: RegExp(_),
            inside: {
              punctuation: /\./
            }
          },
          punctuation: /[:,]/
        }
      }
    });
    var Y = /:[^}\r\n]+/.source, G = r(
      t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [
        H
      ]),
      2
    ), Q = t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
      G,
      Y
    ]), oe = r(
      t(
        /[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,
        [B]
      ),
      2
    ), Z = t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
      oe,
      Y
    ]);
    function pe(J, ae) {
      return {
        interpolation: {
          pattern: n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [J]),
          lookbehind: !0,
          inside: {
            "format-string": {
              pattern: n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [
                ae,
                Y
              ]),
              lookbehind: !0,
              inside: {
                punctuation: /^:/
              }
            },
            punctuation: /^\{|\}$/,
            expression: {
              pattern: /[\s\S]+/,
              alias: "language-csharp",
              inside: e.languages.csharp
            }
          }
        },
        string: /[\s\S]+/
      };
    }
    e.languages.insertBefore("csharp", "string", {
      "interpolation-string": [
        {
          pattern: n(
            /(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,
            [Q]
          ),
          lookbehind: !0,
          greedy: !0,
          inside: pe(Q, G)
        },
        {
          pattern: n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [
            Z
          ]),
          lookbehind: !0,
          greedy: !0,
          inside: pe(Z, oe)
        }
      ],
      char: {
        pattern: RegExp(N),
        greedy: !0
      }
    }), e.languages.dotnet = e.languages.cs = e.languages.csharp;
  })(i);
}
Nc.displayName = "markup";
Nc.aliases = ["atom", "html", "mathml", "rss", "ssml", "svg", "xml"];
function Nc(i) {
  i.languages.markup = {
    comment: {
      pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
      greedy: !0
    },
    prolog: {
      pattern: /<\?[\s\S]+?\?>/,
      greedy: !0
    },
    doctype: {
      // https://www.w3.org/TR/xml/#NT-doctypedecl
      pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
      greedy: !0,
      inside: {
        "internal-subset": {
          pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
          lookbehind: !0,
          greedy: !0,
          inside: null
          // see below
        },
        string: {
          pattern: /"[^"]*"|'[^']*'/,
          greedy: !0
        },
        punctuation: /^<!|>$|[[\]]/,
        "doctype-tag": /^DOCTYPE/i,
        name: /[^\s<>'"]+/
      }
    },
    cdata: {
      pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
      greedy: !0
    },
    tag: {
      pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
      greedy: !0,
      inside: {
        tag: {
          pattern: /^<\/?[^\s>\/]+/,
          inside: {
            punctuation: /^<\/?/,
            namespace: /^[^\s>\/:]+:/
          }
        },
        "special-attr": [],
        "attr-value": {
          pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
          inside: {
            punctuation: [
              {
                pattern: /^=/,
                alias: "attr-equals"
              },
              {
                pattern: /^(\s*)["']|["']$/,
                lookbehind: !0
              }
            ]
          }
        },
        punctuation: /\/?>/,
        "attr-name": {
          pattern: /[^\s>\/]+/,
          inside: {
            namespace: /^[^\s>\/:]+:/
          }
        }
      }
    },
    entity: [
      {
        pattern: /&[\da-z]{1,8};/i,
        alias: "named-entity"
      },
      /&#x?[\da-f]{1,8};/i
    ]
  }, i.languages.markup.tag.inside["attr-value"].inside.entity = i.languages.markup.entity, i.languages.markup.doctype.inside["internal-subset"].inside = i.languages.markup, i.hooks.add("wrap", function(e) {
    e.type === "entity" && (e.attributes.title = e.content.value.replace(/&amp;/, "&"));
  }), Object.defineProperty(i.languages.markup.tag, "addInlined", {
    /**
     * Adds an inlined language to markup.
     *
     * An example of an inlined language is CSS with `<style>` tags.
     *
     * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addInlined('style', 'css');
     */
    value: function(t, n) {
      var r = {};
      r["language-" + n] = {
        pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
        lookbehind: !0,
        inside: i.languages[n]
      }, r.cdata = /^<!\[CDATA\[|\]\]>$/i;
      var s = {
        "included-cdata": {
          pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
          inside: r
        }
      };
      s["language-" + n] = {
        pattern: /[\s\S]+/,
        inside: i.languages[n]
      };
      var o = {};
      o[t] = {
        pattern: RegExp(
          /(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(
            /__/g,
            function() {
              return t;
            }
          ),
          "i"
        ),
        lookbehind: !0,
        greedy: !0,
        inside: s
      }, i.languages.insertBefore("markup", "cdata", o);
    }
  }), Object.defineProperty(i.languages.markup.tag, "addAttribute", {
    /**
     * Adds an pattern to highlight languages embedded in HTML attributes.
     *
     * An example of an inlined language is CSS with `style` attributes.
     *
     * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addAttribute('style', 'css');
     */
    value: function(e, t) {
      i.languages.markup.tag.inside["special-attr"].push({
        pattern: RegExp(
          /(^|["'\s])/.source + "(?:" + e + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
          "i"
        ),
        lookbehind: !0,
        inside: {
          "attr-name": /^[^\s=]+/,
          "attr-value": {
            pattern: /=[\s\S]+/,
            inside: {
              value: {
                pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
                lookbehind: !0,
                alias: [t, "language-" + t],
                inside: i.languages[t]
              },
              punctuation: [
                {
                  pattern: /^=/,
                  alias: "attr-equals"
                },
                /"|'/
              ]
            }
          }
        }
      });
    }
  }), i.languages.html = i.languages.markup, i.languages.mathml = i.languages.markup, i.languages.svg = i.languages.markup, i.languages.xml = i.languages.extend("markup", {}), i.languages.ssml = i.languages.xml, i.languages.atom = i.languages.xml, i.languages.rss = i.languages.xml;
}
Rw.displayName = "css";
Rw.aliases = [];
function Rw(i) {
  (function(e) {
    var t = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
    e.languages.css = {
      comment: /\/\*[\s\S]*?\*\//,
      atrule: {
        pattern: RegExp(
          "@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + t.source + ")*?" + /(?:;|(?=\s*\{))/.source
        ),
        inside: {
          rule: /^@[\w-]+/,
          "selector-function-argument": {
            pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
            lookbehind: !0,
            alias: "selector"
          },
          keyword: {
            pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
            lookbehind: !0
          }
          // See rest below
        }
      },
      url: {
        // https://drafts.csswg.org/css-values-3/#urls
        pattern: RegExp(
          "\\burl\\((?:" + t.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)",
          "i"
        ),
        greedy: !0,
        inside: {
          function: /^url/i,
          punctuation: /^\(|\)$/,
          string: {
            pattern: RegExp("^" + t.source + "$"),
            alias: "url"
          }
        }
      },
      selector: {
        pattern: RegExp(
          `(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + t.source + ")*(?=\\s*\\{)"
        ),
        lookbehind: !0
      },
      string: {
        pattern: t,
        greedy: !0
      },
      property: {
        pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
        lookbehind: !0
      },
      important: /!important\b/i,
      function: {
        pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
        lookbehind: !0
      },
      punctuation: /[(){};:,]/
    }, e.languages.css.atrule.inside.rest = e.languages.css;
    var n = e.languages.markup;
    n && (n.tag.addInlined("style", "css"), n.tag.addAttribute("style", "css"));
  })(i);
}
rY.displayName = "diff";
rY.aliases = [];
function rY(i) {
  (function(e) {
    e.languages.diff = {
      coord: [
        // Match all kinds of coord lines (prefixed by "+++", "---" or "***").
        /^(?:\*{3}|-{3}|\+{3}).*$/m,
        // Match "@@ ... @@" coord lines in unified diff.
        /^@@.*@@$/m,
        // Match coord lines in normal diff (starts with a number).
        /^\d.*$/m
      ]
      // deleted, inserted, unchanged, diff
    };
    var t = {
      "deleted-sign": "-",
      "deleted-arrow": "<",
      "inserted-sign": "+",
      "inserted-arrow": ">",
      unchanged: " ",
      diff: "!"
    };
    Object.keys(t).forEach(function(n) {
      var r = t[n], s = [];
      /^\w+$/.test(n) || s.push(/\w+/.exec(n)[0]), n === "diff" && s.push("bold"), e.languages.diff[n] = {
        pattern: RegExp(
          "^(?:[" + r + `].*(?:\r
?|
|(?![\\s\\S])))+`,
          "m"
        ),
        alias: s,
        inside: {
          line: {
            pattern: /(.)(?=[\s\S]).*(?:\r\n?|\n)?/,
            lookbehind: !0
          },
          prefix: {
            pattern: /[\s\S]/,
            alias: /\w+/.exec(n)[0]
          }
        }
      };
    }), Object.defineProperty(e.languages.diff, "PREFIXES", {
      value: t
    });
  })(i);
}
sY.displayName = "go";
sY.aliases = [];
function sY(i) {
  i.register(Wr), i.languages.go = i.languages.extend("clike", {
    string: {
      pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
      lookbehind: !0,
      greedy: !0
    },
    keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
    boolean: /\b(?:_|false|iota|nil|true)\b/,
    number: [
      // binary and octal integers
      /\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
      // hexadecimal integers and floats
      /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
      // decimal integers and floats
      /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
    ],
    operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
    builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
  }), i.languages.insertBefore("go", "string", {
    char: {
      pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
      greedy: !0
    }
  }), delete i.languages.go["class-name"];
}
oY.displayName = "ini";
oY.aliases = [];
function oY(i) {
  i.languages.ini = {
    /**
     * The component mimics the behavior of the Win32 API parser.
     *
     * @see {@link https://github.com/PrismJS/prism/issues/2775#issuecomment-787477723}
     */
    comment: {
      pattern: /(^[ \f\t\v]*)[#;][^\n\r]*/m,
      lookbehind: !0
    },
    section: {
      pattern: /(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,
      lookbehind: !0,
      inside: {
        "section-name": {
          pattern: /(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,
          lookbehind: !0,
          alias: "selector"
        },
        punctuation: /\[|\]/
      }
    },
    key: {
      pattern: /(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,
      lookbehind: !0,
      alias: "attr-name"
    },
    value: {
      pattern: /(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,
      lookbehind: !0,
      alias: "attr-value",
      inside: {
        "inner-value": {
          pattern: /^("|').+(?=\1$)/,
          lookbehind: !0
        }
      }
    },
    punctuation: /=/
  };
}
uk.displayName = "java";
uk.aliases = [];
function uk(i) {
  i.register(Wr), (function(e) {
    var t = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, n = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, r = {
      pattern: RegExp(
        /(^|[^\w.])/.source + n + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source
      ),
      lookbehind: !0,
      inside: {
        namespace: {
          pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
          inside: {
            punctuation: /\./
          }
        },
        punctuation: /\./
      }
    };
    e.languages.java = e.languages.extend("clike", {
      string: {
        pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
        lookbehind: !0,
        greedy: !0
      },
      "class-name": [
        r,
        {
          // variables, parameters, and constructor references
          // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
          pattern: RegExp(
            /(^|[^\w.])/.source + n + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source
          ),
          lookbehind: !0,
          inside: r.inside
        },
        {
          // class names based on keyword
          // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
          pattern: RegExp(
            /(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + n + /[A-Z]\w*\b/.source
          ),
          lookbehind: !0,
          inside: r.inside
        }
      ],
      keyword: t,
      function: [
        e.languages.clike.function,
        {
          pattern: /(::\s*)[a-z_]\w*/,
          lookbehind: !0
        }
      ],
      number: /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
      operator: {
        pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
        lookbehind: !0
      },
      constant: /\b[A-Z][A-Z_\d]+\b/
    }), e.languages.insertBefore("java", "string", {
      "triple-quoted-string": {
        // http://openjdk.java.net/jeps/355#Description
        pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
        greedy: !0,
        alias: "string"
      },
      char: {
        pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
        greedy: !0
      }
    }), e.languages.insertBefore("java", "class-name", {
      annotation: {
        pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
        lookbehind: !0,
        alias: "punctuation"
      },
      generics: {
        pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
        inside: {
          "class-name": r,
          keyword: t,
          punctuation: /[<>(),.:]/,
          operator: /[?&|]/
        }
      },
      import: [
        {
          pattern: RegExp(
            /(\bimport\s+)/.source + n + /(?:[A-Z]\w*|\*)(?=\s*;)/.source
          ),
          lookbehind: !0,
          inside: {
            namespace: r.inside.namespace,
            punctuation: /\./,
            operator: /\*/,
            "class-name": /\w+/
          }
        },
        {
          pattern: RegExp(
            /(\bimport\s+static\s+)/.source + n + /(?:\w+|\*)(?=\s*;)/.source
          ),
          lookbehind: !0,
          alias: "static",
          inside: {
            namespace: r.inside.namespace,
            static: /\b\w+$/,
            punctuation: /\./,
            operator: /\*/,
            "class-name": /\w+/
          }
        }
      ],
      namespace: {
        pattern: RegExp(
          /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(
            /<keyword>/g,
            function() {
              return t.source;
            }
          )
        ),
        lookbehind: !0,
        inside: {
          punctuation: /\./
        }
      }
    });
  })(i);
}
aY.displayName = "regex";
aY.aliases = [];
function aY(i) {
  (function(e) {
    var t = {
      pattern: /\\[\\(){}[\]^$+*?|.]/,
      alias: "escape"
    }, n = /\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/, r = {
      pattern: /\.|\\[wsd]|\\p\{[^{}]+\}/i,
      alias: "class-name"
    }, s = {
      pattern: /\\[wsd]|\\p\{[^{}]+\}/i,
      alias: "class-name"
    }, o = "(?:[^\\\\-]|" + n.source + ")", a = RegExp(o + "-" + o), l = {
      pattern: /(<|')[^<>']+(?=[>']$)/,
      lookbehind: !0,
      alias: "variable"
    };
    e.languages.regex = {
      "char-class": {
        pattern: /((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,
        lookbehind: !0,
        inside: {
          "char-class-negation": {
            pattern: /(^\[)\^/,
            lookbehind: !0,
            alias: "operator"
          },
          "char-class-punctuation": {
            pattern: /^\[|\]$/,
            alias: "punctuation"
          },
          range: {
            pattern: a,
            inside: {
              escape: n,
              "range-punctuation": {
                pattern: /-/,
                alias: "operator"
              }
            }
          },
          "special-escape": t,
          "char-set": s,
          escape: n
        }
      },
      "special-escape": t,
      "char-set": r,
      backreference: [
        {
          // a backreference which is not an octal escape
          pattern: /\\(?![123][0-7]{2})[1-9]/,
          alias: "keyword"
        },
        {
          pattern: /\\k<[^<>']+>/,
          alias: "keyword",
          inside: {
            "group-name": l
          }
        }
      ],
      anchor: {
        pattern: /[$^]|\\[ABbGZz]/,
        alias: "function"
      },
      escape: n,
      group: [
        {
          // https://docs.oracle.com/javase/10/docs/api/java/util/regex/Pattern.html
          // https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference?view=netframework-4.7.2#grouping-constructs
          // (), (?<name>), (?'name'), (?>), (?:), (?=), (?!), (?<=), (?<!), (?is-m), (?i-m:)
          pattern: /\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,
          alias: "punctuation",
          inside: {
            "group-name": l
          }
        },
        {
          pattern: /\)/,
          alias: "punctuation"
        }
      ],
      quantifier: {
        pattern: /(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,
        alias: "number"
      },
      alternation: {
        pattern: /\|/,
        alias: "keyword"
      }
    };
  })(i);
}
_u.displayName = "javascript";
_u.aliases = ["js"];
function _u(i) {
  i.register(Wr), i.languages.javascript = i.languages.extend("clike", {
    "class-name": [
      i.languages.clike["class-name"],
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
        lookbehind: !0
      }
    ],
    keyword: [
      {
        pattern: /((?:^|\})\s*)catch\b/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
        lookbehind: !0
      }
    ],
    // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
    function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
    number: {
      pattern: RegExp(
        /(^|[^\w$])/.source + "(?:" + // constant
        (/NaN|Infinity/.source + "|" + // binary integer
        /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
        /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
        /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
        /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
        /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
      ),
      lookbehind: !0
    },
    operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
  }), i.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, i.languages.insertBefore("javascript", "keyword", {
    regex: {
      pattern: RegExp(
        // lookbehind
        // eslint-disable-next-line regexp/no-dupe-characters-character-class
        /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
        // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
        // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
        // with the only syntax, so we have to define 2 different regex patterns.
        /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
        /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
        /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
      ),
      lookbehind: !0,
      greedy: !0,
      inside: {
        "regex-source": {
          pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
          lookbehind: !0,
          alias: "language-regex",
          inside: i.languages.regex
        },
        "regex-delimiter": /^\/|\/$/,
        "regex-flags": /^[a-z]+$/
      }
    },
    // This must be declared before keyword because we use "function" inside the look-forward
    "function-variable": {
      pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
      alias: "function"
    },
    parameter: [
      {
        pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
        lookbehind: !0,
        inside: i.languages.javascript
      },
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
        lookbehind: !0,
        inside: i.languages.javascript
      },
      {
        pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
        lookbehind: !0,
        inside: i.languages.javascript
      },
      {
        pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
        lookbehind: !0,
        inside: i.languages.javascript
      }
    ],
    constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  }), i.languages.insertBefore("javascript", "string", {
    hashbang: {
      pattern: /^#!.*/,
      greedy: !0,
      alias: "comment"
    },
    "template-string": {
      pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
      greedy: !0,
      inside: {
        "template-punctuation": {
          pattern: /^`|`$/,
          alias: "string"
        },
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
          lookbehind: !0,
          inside: {
            "interpolation-punctuation": {
              pattern: /^\$\{|\}$/,
              alias: "punctuation"
            },
            rest: i.languages.javascript
          }
        },
        string: /[\s\S]+/
      }
    },
    "string-property": {
      pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
      lookbehind: !0,
      greedy: !0,
      alias: "property"
    }
  }), i.languages.insertBefore("javascript", "operator", {
    "literal-property": {
      pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
      lookbehind: !0,
      alias: "property"
    }
  }), i.languages.markup && (i.languages.markup.tag.addInlined("script", "javascript"), i.languages.markup.tag.addAttribute(
    /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
    "javascript"
  )), i.languages.js = i.languages.javascript;
}
p2.displayName = "json";
p2.aliases = ["webmanifest"];
function p2(i) {
  i.languages.json = {
    property: {
      pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
      lookbehind: !0,
      greedy: !0
    },
    string: {
      pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
      lookbehind: !0,
      greedy: !0
    },
    comment: {
      pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
      greedy: !0
    },
    number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
    punctuation: /[{}[\],]/,
    operator: /:/,
    boolean: /\b(?:false|true)\b/,
    null: {
      pattern: /\bnull\b/,
      alias: "keyword"
    }
  }, i.languages.webmanifest = i.languages.json;
}
lY.displayName = "kotlin";
lY.aliases = ["kt", "kts"];
function lY(i) {
  i.register(Wr), (function(e) {
    e.languages.kotlin = e.languages.extend("clike", {
      keyword: {
        // The lookbehind prevents wrong highlighting of e.g. kotlin.properties.get
        pattern: /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,
        lookbehind: !0
      },
      function: [
        {
          pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,
          greedy: !0
        },
        {
          pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,
          lookbehind: !0,
          greedy: !0
        }
      ],
      number: /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,
      operator: /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/
    }), delete e.languages.kotlin["class-name"];
    var t = {
      "interpolation-punctuation": {
        pattern: /^\$\{?|\}$/,
        alias: "punctuation"
      },
      expression: {
        pattern: /[\s\S]+/,
        inside: e.languages.kotlin
      }
    };
    e.languages.insertBefore("kotlin", "string", {
      // https://kotlinlang.org/spec/expressions.html#string-interpolation-expressions
      "string-literal": [
        {
          pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,
          alias: "multiline",
          inside: {
            interpolation: {
              pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i,
              inside: t
            },
            string: /[\s\S]+/
          }
        },
        {
          pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,
          alias: "singleline",
          inside: {
            interpolation: {
              pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,
              lookbehind: !0,
              inside: t
            },
            string: /[\s\S]+/
          }
        }
      ],
      char: {
        // https://kotlinlang.org/spec/expressions.html#character-literals
        pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,
        greedy: !0
      }
    }), delete e.languages.kotlin.string, e.languages.insertBefore("kotlin", "keyword", {
      annotation: {
        pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,
        alias: "builtin"
      }
    }), e.languages.insertBefore("kotlin", "function", {
      label: {
        pattern: /\b\w+@|@\w+\b/,
        alias: "symbol"
      }
    }), e.languages.kt = e.languages.kotlin, e.languages.kts = e.languages.kotlin;
  })(i);
}
cY.displayName = "less";
cY.aliases = [];
function cY(i) {
  i.register(Rw), i.languages.less = i.languages.extend("css", {
    comment: [
      /\/\*[\s\S]*?\*\//,
      {
        pattern: /(^|[^\\])\/\/.*/,
        lookbehind: !0
      }
    ],
    atrule: {
      pattern: /@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,
      inside: {
        punctuation: /[:()]/
      }
    },
    // selectors and mixins are considered the same
    selector: {
      pattern: /(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,
      inside: {
        // mixin parameters
        variable: /@+[\w-]+/
      }
    },
    property: /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,
    operator: /[+\-*\/]/
  }), i.languages.insertBefore("less", "property", {
    variable: [
      // Variable declaration (the colon must be consumed!)
      {
        pattern: /@[\w-]+\s*:/,
        inside: {
          punctuation: /:/
        }
      },
      // Variable usage
      /@@?[\w-]+/
    ],
    "mixin-usage": {
      pattern: /([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,
      lookbehind: !0,
      alias: "function"
    }
  });
}
n6.displayName = "lua";
n6.aliases = [];
function n6(i) {
  i.languages.lua = {
    comment: /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,
    // \z may be used to skip the following space
    string: {
      pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,
      greedy: !0
    },
    number: /\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,
    keyword: /\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,
    function: /(?!\d)\w+(?=\s*(?:[({]))/,
    operator: [
      /[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,
      {
        // Match ".." but don't break "..."
        pattern: /(^|[^.])\.\.(?!\.)/,
        lookbehind: !0
      }
    ],
    punctuation: /[\[\](){},;]|\.+|:+/
  };
}
uY.displayName = "makefile";
uY.aliases = [];
function uY(i) {
  i.languages.makefile = {
    comment: {
      pattern: /(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,
      lookbehind: !0
    },
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    "builtin-target": {
      pattern: /\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,
      alias: "builtin"
    },
    target: {
      pattern: /^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,
      alias: "symbol",
      inside: {
        variable: /\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/
      }
    },
    variable: /\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,
    // Directives
    keyword: /-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,
    function: {
      pattern: /(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,
      lookbehind: !0
    },
    operator: /(?:::|[?:+!])?=|[|@]/,
    punctuation: /[:;(){}]/
  };
}
i6.displayName = "yaml";
i6.aliases = ["yml"];
function i6(i) {
  (function(e) {
    var t = /[*&][^\s[\]{},]+/, n = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, r = "(?:" + n.source + "(?:[ 	]+" + t.source + ")?|" + t.source + "(?:[ 	]+" + n.source + ")?)", s = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(
      /<PLAIN>/g,
      function() {
        return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
      }
    ), o = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
    function a(l, c) {
      c = (c || "").replace(/m/g, "") + "m";
      var u = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
        return r;
      }).replace(/<<value>>/g, function() {
        return l;
      });
      return RegExp(u, c);
    }
    e.languages.yaml = {
      scalar: {
        pattern: RegExp(
          /([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(
            /<<prop>>/g,
            function() {
              return r;
            }
          )
        ),
        lookbehind: !0,
        alias: "string"
      },
      comment: /#.*/,
      key: {
        pattern: RegExp(
          /((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function() {
            return r;
          }).replace(/<<key>>/g, function() {
            return "(?:" + s + "|" + o + ")";
          })
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "atrule"
      },
      directive: {
        pattern: /(^[ \t]*)%.+/m,
        lookbehind: !0,
        alias: "important"
      },
      datetime: {
        pattern: a(
          /\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source
        ),
        lookbehind: !0,
        alias: "number"
      },
      boolean: {
        pattern: a(/false|true/.source, "i"),
        lookbehind: !0,
        alias: "important"
      },
      null: {
        pattern: a(/null|~/.source, "i"),
        lookbehind: !0,
        alias: "important"
      },
      string: {
        pattern: a(o),
        lookbehind: !0,
        greedy: !0
      },
      number: {
        pattern: a(
          /[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,
          "i"
        ),
        lookbehind: !0
      },
      tag: n,
      important: t,
      punctuation: /---|[:[\]{}\-,|>?]|\.\.\./
    }, e.languages.yml = e.languages.yaml;
  })(i);
}
dY.displayName = "markdown";
dY.aliases = ["md"];
function dY(i) {
  i.register(Nc), (function(e) {
    var t = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
    function n(a) {
      return a = a.replace(/<inner>/g, function() {
        return t;
      }), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + a + ")");
    }
    var r = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, s = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(
      /__/g,
      function() {
        return r;
      }
    ), o = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
    e.languages.markdown = e.languages.extend("markup", {}), e.languages.insertBefore("markdown", "prolog", {
      "front-matter-block": {
        pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          punctuation: /^---|---$/,
          "front-matter": {
            pattern: /\S+(?:\s+\S+)*/,
            alias: ["yaml", "language-yaml"],
            inside: e.languages.yaml
          }
        }
      },
      blockquote: {
        // > ...
        pattern: /^>(?:[\t ]*>)*/m,
        alias: "punctuation"
      },
      table: {
        pattern: RegExp(
          "^" + s + o + "(?:" + s + ")*",
          "m"
        ),
        inside: {
          "table-data-rows": {
            pattern: RegExp(
              "^(" + s + o + ")(?:" + s + ")*$"
            ),
            lookbehind: !0,
            inside: {
              "table-data": {
                pattern: RegExp(r),
                inside: e.languages.markdown
              },
              punctuation: /\|/
            }
          },
          "table-line": {
            pattern: RegExp("^(" + s + ")" + o + "$"),
            lookbehind: !0,
            inside: {
              punctuation: /\||:?-{3,}:?/
            }
          },
          "table-header-row": {
            pattern: RegExp("^" + s + "$"),
            inside: {
              "table-header": {
                pattern: RegExp(r),
                alias: "important",
                inside: e.languages.markdown
              },
              punctuation: /\|/
            }
          }
        }
      },
      code: [
        {
          // Prefixed by 4 spaces or 1 tab and preceded by an empty line
          pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
          lookbehind: !0,
          alias: "keyword"
        },
        {
          // ```optional language
          // code block
          // ```
          pattern: /^```[\s\S]*?^```$/m,
          greedy: !0,
          inside: {
            "code-block": {
              pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
              lookbehind: !0
            },
            "code-language": {
              pattern: /^(```).+/,
              lookbehind: !0
            },
            punctuation: /```/
          }
        }
      ],
      title: [
        {
          // title 1
          // =======
          // title 2
          // -------
          pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
          alias: "important",
          inside: {
            punctuation: /==+$|--+$/
          }
        },
        {
          // # title 1
          // ###### title 6
          pattern: /(^\s*)#.+/m,
          lookbehind: !0,
          alias: "important",
          inside: {
            punctuation: /^#+|#+$/
          }
        }
      ],
      hr: {
        // ***
        // ---
        // * * *
        // -----------
        pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
        lookbehind: !0,
        alias: "punctuation"
      },
      list: {
        // * item
        // + item
        // - item
        // 1. item
        pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
        lookbehind: !0,
        alias: "punctuation"
      },
      "url-reference": {
        // [id]: http://example.com "Optional title"
        // [id]: http://example.com 'Optional title'
        // [id]: http://example.com (Optional title)
        // [id]: <http://example.com> "Optional title"
        pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
        inside: {
          variable: {
            pattern: /^(!?\[)[^\]]+/,
            lookbehind: !0
          },
          string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
          punctuation: /^[\[\]!:]|[<>]/
        },
        alias: "url"
      },
      bold: {
        // **strong**
        // __strong__
        // allow one nested instance of italic text using the same delimiter
        pattern: n(
          /\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          content: {
            pattern: /(^..)[\s\S]+(?=..$)/,
            lookbehind: !0,
            inside: {}
            // see below
          },
          punctuation: /\*\*|__/
        }
      },
      italic: {
        // *em*
        // _em_
        // allow one nested instance of bold text using the same delimiter
        pattern: n(
          /\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          content: {
            pattern: /(^.)[\s\S]+(?=.$)/,
            lookbehind: !0,
            inside: {}
            // see below
          },
          punctuation: /[*_]/
        }
      },
      strike: {
        // ~~strike through~~
        // ~strike~
        // eslint-disable-next-line regexp/strict
        pattern: n(/(~~?)(?:(?!~)<inner>)+\2/.source),
        lookbehind: !0,
        greedy: !0,
        inside: {
          content: {
            pattern: /(^~~?)[\s\S]+(?=\1$)/,
            lookbehind: !0,
            inside: {}
            // see below
          },
          punctuation: /~~?/
        }
      },
      "code-snippet": {
        // `code`
        // ``code``
        pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
        lookbehind: !0,
        greedy: !0,
        alias: ["code", "keyword"]
      },
      url: {
        // [example](http://example.com "Optional title")
        // [example][id]
        // [example] [id]
        pattern: n(
          /!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          operator: /^!/,
          content: {
            pattern: /(^\[)[^\]]+(?=\])/,
            lookbehind: !0,
            inside: {}
            // see below
          },
          variable: {
            pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
            lookbehind: !0
          },
          url: {
            pattern: /(^\]\()[^\s)]+/,
            lookbehind: !0
          },
          string: {
            pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
            lookbehind: !0
          }
        }
      }
    }), ["url", "bold", "italic", "strike"].forEach(function(a) {
      ["url", "bold", "italic", "strike", "code-snippet"].forEach(
        function(l) {
          a !== l && (e.languages.markdown[a].inside.content.inside[l] = e.languages.markdown[l]);
        }
      );
    }), e.hooks.add("after-tokenize", function(a) {
      if (a.language !== "markdown" && a.language !== "md")
        return;
      function l(c) {
        if (!(!c || typeof c == "string"))
          for (var u = 0, d = c.length; u < d; u++) {
            var h = c[u];
            if (h.type !== "code") {
              l(h.content);
              continue;
            }
            var g = h.content[1], m = h.content[3];
            if (g && m && g.type === "code-language" && m.type === "code-block" && typeof g.content == "string") {
              var _ = g.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
              _ = (/[a-z][\w-]*/i.exec(_) || [""])[0].toLowerCase();
              var v = "language-" + _;
              m.alias ? typeof m.alias == "string" ? m.alias = [m.alias, v] : m.alias.push(v) : m.alias = [v];
            }
          }
      }
      l(a.tokens);
    }), e.hooks.add("wrap", function(a) {
      if (a.type === "code-block") {
        for (var l = "", c = 0, u = a.classes.length; c < u; c++) {
          var d = a.classes[c], h = /language-(.+)/.exec(d);
          if (h) {
            l = h[1];
            break;
          }
        }
        var g = e.languages[l];
        if (g)
          a.content = e.highlight(a.content.value, g, l);
        else if (l && l !== "none" && e.plugins.autoloader) {
          var m = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
          a.attributes.id = m, e.plugins.autoloader.loadLanguages(l, function() {
            var _ = document.getElementById(m);
            _ && (_.innerHTML = e.highlight(
              _.textContent,
              e.languages[l],
              l
            ));
          });
        }
      }
    }), RegExp(e.languages.markup.tag.pattern.source, "gi"), e.languages.md = e.languages.markdown;
  })(i);
}
hY.displayName = "objectivec";
hY.aliases = ["objc"];
function hY(i) {
  i.register(Em), i.languages.objectivec = i.languages.extend("c", {
    string: {
      pattern: /@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
      greedy: !0
    },
    keyword: /\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,
    operator: /-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/
  }), delete i.languages.objectivec["class-name"], i.languages.objc = i.languages.objectivec;
}
fY.displayName = "perl";
fY.aliases = [];
function fY(i) {
  (function(e) {
    var t = /(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;
    e.languages.perl = {
      comment: [
        {
          // POD
          pattern: /(^\s*)=\w[\s\S]*?=cut.*/m,
          lookbehind: !0,
          greedy: !0
        },
        {
          pattern: /(^|[^\\$])#.*/,
          lookbehind: !0,
          greedy: !0
        }
      ],
      // TODO Could be nice to handle Heredoc too.
      string: [
        {
          pattern: RegExp(
            /\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source + "(?:" + [
              // q/.../
              /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
              // q a...a
              // eslint-disable-next-line regexp/strict
              /([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
              // q(...)
              // q{...}
              // q[...]
              // q<...>
              t
            ].join("|") + ")"
          ),
          greedy: !0
        },
        // "...", `...`
        {
          pattern: /("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,
          greedy: !0
        },
        // '...'
        // FIXME Multi-line single-quoted strings are not supported as they would break variables containing '
        {
          pattern: /'(?:[^'\\\r\n]|\\.)*'/,
          greedy: !0
        }
      ],
      regex: [
        {
          pattern: RegExp(
            /\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source + "(?:" + [
              // m/.../
              /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
              // m a...a
              // eslint-disable-next-line regexp/strict
              /([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
              // m(...)
              // m{...}
              // m[...]
              // m<...>
              t
            ].join("|") + ")" + /[msixpodualngc]*/.source
          ),
          greedy: !0
        },
        // The lookbehinds prevent -s from breaking
        {
          pattern: RegExp(
            /(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source + "(?:" + [
              // s/.../.../
              // eslint-disable-next-line regexp/strict
              /([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,
              // s a...a...a
              // eslint-disable-next-line regexp/strict
              /([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,
              // s(...)(...)
              // s{...}{...}
              // s[...][...]
              // s<...><...>
              // s(...)[...]
              t + /\s*/.source + t
            ].join("|") + ")" + /[msixpodualngcer]*/.source
          ),
          lookbehind: !0,
          greedy: !0
        },
        // /.../
        // The look-ahead tries to prevent two divisions on
        // the same line from being highlighted as regex.
        // This does not support multi-line regex.
        {
          pattern: /\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,
          greedy: !0
        }
      ],
      // FIXME Not sure about the handling of ::, ', and #
      variable: [
        // ${^POSTMATCH}
        /[&*$@%]\{\^[A-Z]+\}/,
        // $^V
        /[&*$@%]\^[A-Z_]/,
        // ${...}
        /[&*$@%]#?(?=\{)/,
        // $foo
        /[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,
        // $1
        /[&*$@%]\d+/,
        // $_, @_, %!
        // The negative lookahead prevents from breaking the %= operator
        /(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/
      ],
      filehandle: {
        // <>, <FOO>, _
        pattern: /<(?![<=])\S*?>|\b_\b/,
        alias: "symbol"
      },
      "v-string": {
        // v1.2, 1.2.3
        pattern: /v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,
        alias: "string"
      },
      function: {
        pattern: /(\bsub[ \t]+)\w+/,
        lookbehind: !0
      },
      keyword: /\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,
      number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,
      operator: /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,
      punctuation: /[{}[\];(),:]/
    };
  })(i);
}
bu.displayName = "markup-templating";
bu.aliases = [];
function bu(i) {
  i.register(Nc), (function(e) {
    function t(n, r) {
      return "___" + n.toUpperCase() + r + "___";
    }
    Object.defineProperties(e.languages["markup-templating"] = {}, {
      buildPlaceholders: {
        /**
         * Tokenize all inline templating expressions matching `placeholderPattern`.
         *
         * If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns
         * `true` will be replaced.
         *
         * @param {object} env The environment of the `before-tokenize` hook.
         * @param {string} language The language id.
         * @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.
         * @param {(match: string) => boolean} [replaceFilter]
         */
        value: function(n, r, s, o) {
          if (n.language === r) {
            var a = n.tokenStack = [];
            n.code = n.code.replace(s, function(l) {
              if (typeof o == "function" && !o(l))
                return l;
              for (var c = a.length, u; n.code.indexOf(u = t(r, c)) !== -1; )
                ++c;
              return a[c] = l, u;
            }), n.grammar = e.languages.markup;
          }
        }
      },
      tokenizePlaceholders: {
        /**
         * Replace placeholders with proper tokens after tokenizing.
         *
         * @param {object} env The environment of the `after-tokenize` hook.
         * @param {string} language The language id.
         */
        value: function(n, r) {
          if (n.language !== r || !n.tokenStack)
            return;
          n.grammar = e.languages[r];
          var s = 0, o = Object.keys(n.tokenStack);
          function a(l) {
            for (var c = 0; c < l.length && !(s >= o.length); c++) {
              var u = l[c];
              if (typeof u == "string" || u.content && typeof u.content == "string") {
                var d = o[s], h = n.tokenStack[d], g = typeof u == "string" ? u : u.content, m = t(r, d), _ = g.indexOf(m);
                if (_ > -1) {
                  ++s;
                  var v = g.substring(0, _), w = new e.Token(
                    r,
                    e.tokenize(h, n.grammar),
                    "language-" + r,
                    h
                  ), E = g.substring(_ + m.length), L = [];
                  v && L.push.apply(L, a([v])), L.push(w), E && L.push.apply(L, a([E])), typeof u == "string" ? l.splice.apply(l, [c, 1].concat(L)) : u.content = L;
                }
              } else u.content && a(u.content);
            }
            return l;
          }
          a(n.tokens);
        }
      }
    });
  })(i);
}
dk.displayName = "php";
dk.aliases = [];
function dk(i) {
  i.register(bu), (function(e) {
    var t = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/, n = [
      {
        pattern: /\b(?:false|true)\b/i,
        alias: "boolean"
      },
      {
        pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
        greedy: !0,
        lookbehind: !0
      },
      {
        pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
        greedy: !0,
        lookbehind: !0
      },
      /\b(?:null)\b/i,
      /\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/
    ], r = /\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i, s = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/, o = /[{}\[\](),:;]/;
    e.languages.php = {
      delimiter: {
        pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
        alias: "important"
      },
      comment: t,
      variable: /\$+(?:\w+\b|(?=\{))/,
      package: {
        pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
        lookbehind: !0,
        inside: {
          punctuation: /\\/
        }
      },
      "class-name-definition": {
        pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
        lookbehind: !0,
        alias: "class-name"
      },
      "function-definition": {
        pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
        lookbehind: !0,
        alias: "function"
      },
      keyword: [
        {
          pattern: /(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
          alias: "type-casting",
          greedy: !0,
          lookbehind: !0
        },
        {
          pattern: /([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
          alias: "type-hint",
          greedy: !0,
          lookbehind: !0
        },
        {
          pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,
          alias: "return-type",
          greedy: !0,
          lookbehind: !0
        },
        {
          pattern: /\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
          alias: "type-declaration",
          greedy: !0
        },
        {
          pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
          alias: "type-declaration",
          greedy: !0,
          lookbehind: !0
        },
        {
          pattern: /\b(?:parent|self|static)(?=\s*::)/i,
          alias: "static-context",
          greedy: !0
        },
        {
          // yield from
          pattern: /(\byield\s+)from\b/i,
          lookbehind: !0
        },
        // `class` is always a keyword unlike other keywords
        /\bclass\b/i,
        {
          // https://www.php.net/manual/en/reserved.keywords.php
          //
          // keywords cannot be preceded by "->"
          // the complex lookbehind means `(?<!(?:->|::)\s*)`
          pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
          lookbehind: !0
        }
      ],
      "argument-name": {
        pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,
        lookbehind: !0
      },
      "class-name": [
        {
          pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
          greedy: !0,
          lookbehind: !0
        },
        {
          pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
          greedy: !0,
          lookbehind: !0
        },
        {
          pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,
          greedy: !0
        },
        {
          pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
          alias: "class-name-fully-qualified",
          greedy: !0,
          lookbehind: !0,
          inside: {
            punctuation: /\\/
          }
        },
        {
          pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
          alias: "class-name-fully-qualified",
          greedy: !0,
          inside: {
            punctuation: /\\/
          }
        },
        {
          pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
          alias: "class-name-fully-qualified",
          greedy: !0,
          lookbehind: !0,
          inside: {
            punctuation: /\\/
          }
        },
        {
          pattern: /\b[a-z_]\w*(?=\s*\$)/i,
          alias: "type-declaration",
          greedy: !0
        },
        {
          pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
          alias: ["class-name-fully-qualified", "type-declaration"],
          greedy: !0,
          inside: {
            punctuation: /\\/
          }
        },
        {
          pattern: /\b[a-z_]\w*(?=\s*::)/i,
          alias: "static-context",
          greedy: !0
        },
        {
          pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
          alias: ["class-name-fully-qualified", "static-context"],
          greedy: !0,
          inside: {
            punctuation: /\\/
          }
        },
        {
          pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
          alias: "type-hint",
          greedy: !0,
          lookbehind: !0
        },
        {
          pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
          alias: ["class-name-fully-qualified", "type-hint"],
          greedy: !0,
          lookbehind: !0,
          inside: {
            punctuation: /\\/
          }
        },
        {
          pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
          alias: "return-type",
          greedy: !0,
          lookbehind: !0
        },
        {
          pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
          alias: ["class-name-fully-qualified", "return-type"],
          greedy: !0,
          lookbehind: !0,
          inside: {
            punctuation: /\\/
          }
        }
      ],
      constant: n,
      function: {
        pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
        lookbehind: !0,
        inside: {
          punctuation: /\\/
        }
      },
      property: {
        pattern: /(->\s*)\w+/,
        lookbehind: !0
      },
      number: r,
      operator: s,
      punctuation: o
    };
    var a = {
      pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
      lookbehind: !0,
      inside: e.languages.php
    }, l = [
      {
        pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
        alias: "nowdoc-string",
        greedy: !0,
        inside: {
          delimiter: {
            pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
            alias: "symbol",
            inside: {
              punctuation: /^<<<'?|[';]$/
            }
          }
        }
      },
      {
        pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
        alias: "heredoc-string",
        greedy: !0,
        inside: {
          delimiter: {
            pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
            alias: "symbol",
            inside: {
              punctuation: /^<<<"?|[";]$/
            }
          },
          interpolation: a
        }
      },
      {
        pattern: /`(?:\\[\s\S]|[^\\`])*`/,
        alias: "backtick-quoted-string",
        greedy: !0
      },
      {
        pattern: /'(?:\\[\s\S]|[^\\'])*'/,
        alias: "single-quoted-string",
        greedy: !0
      },
      {
        pattern: /"(?:\\[\s\S]|[^\\"])*"/,
        alias: "double-quoted-string",
        greedy: !0,
        inside: {
          interpolation: a
        }
      }
    ];
    e.languages.insertBefore("php", "variable", {
      string: l,
      attribute: {
        pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
        greedy: !0,
        inside: {
          "attribute-content": {
            pattern: /^(#\[)[\s\S]+(?=\]$)/,
            lookbehind: !0,
            // inside can appear subset of php
            inside: {
              comment: t,
              string: l,
              "attribute-class-name": [
                {
                  pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
                  alias: "class-name",
                  greedy: !0,
                  lookbehind: !0
                },
                {
                  pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
                  alias: ["class-name", "class-name-fully-qualified"],
                  greedy: !0,
                  lookbehind: !0,
                  inside: {
                    punctuation: /\\/
                  }
                }
              ],
              constant: n,
              number: r,
              operator: s,
              punctuation: o
            }
          },
          delimiter: {
            pattern: /^#\[|\]$/,
            alias: "punctuation"
          }
        }
      }
    }), e.hooks.add("before-tokenize", function(c) {
      if (/<\?/.test(c.code)) {
        var u = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;
        e.languages["markup-templating"].buildPlaceholders(
          c,
          "php",
          u
        );
      }
    }), e.hooks.add("after-tokenize", function(c) {
      e.languages["markup-templating"].tokenizePlaceholders(c, "php");
    });
  })(i);
}
r6.displayName = "python";
r6.aliases = ["py"];
function r6(i) {
  i.languages.python = {
    comment: {
      pattern: /(^|[^\\])#.*/,
      lookbehind: !0,
      greedy: !0
    },
    "string-interpolation": {
      pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
      greedy: !0,
      inside: {
        interpolation: {
          // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
          pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
          lookbehind: !0,
          inside: {
            "format-spec": {
              pattern: /(:)[^:(){}]+(?=\}$)/,
              lookbehind: !0
            },
            "conversion-option": {
              pattern: /![sra](?=[:}]$)/,
              alias: "punctuation"
            },
            rest: null
          }
        },
        string: /[\s\S]+/
      }
    },
    "triple-quoted-string": {
      pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
      greedy: !0,
      alias: "string"
    },
    string: {
      pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
      greedy: !0
    },
    function: {
      pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
      lookbehind: !0
    },
    "class-name": {
      pattern: /(\bclass\s+)\w+/i,
      lookbehind: !0
    },
    decorator: {
      pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
      lookbehind: !0,
      alias: ["annotation", "punctuation"],
      inside: {
        punctuation: /\./
      }
    },
    keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
    builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
    boolean: /\b(?:False|None|True)\b/,
    number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
    operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
    punctuation: /[{}[\];(),.:]/
  }, i.languages.python["string-interpolation"].inside.interpolation.inside.rest = i.languages.python, i.languages.py = i.languages.python;
}
gY.displayName = "r";
gY.aliases = [];
function gY(i) {
  i.languages.r = {
    comment: /#.*/,
    string: {
      pattern: /(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    "percent-operator": {
      // Includes user-defined operators
      // and %%, %*%, %/%, %in%, %o%, %x%
      pattern: /%[^%\s]*%/,
      alias: "operator"
    },
    boolean: /\b(?:FALSE|TRUE)\b/,
    ellipsis: /\.\.(?:\.|\d+)/,
    number: [
      /\b(?:Inf|NaN)\b/,
      /(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/
    ],
    keyword: /\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,
    operator: /->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,
    punctuation: /[(){}\[\],;]/
  };
}
hk.displayName = "ruby";
hk.aliases = ["rb"];
function hk(i) {
  i.register(Wr), (function(e) {
    e.languages.ruby = e.languages.extend("clike", {
      comment: {
        pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
        greedy: !0
      },
      "class-name": {
        pattern: /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
        lookbehind: !0,
        inside: {
          punctuation: /[.\\]/
        }
      },
      keyword: /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,
      operator: /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
      punctuation: /[(){}[\].,;]/
    }), e.languages.insertBefore("ruby", "operator", {
      "double-colon": {
        pattern: /::/,
        alias: "punctuation"
      }
    });
    var t = {
      pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
      lookbehind: !0,
      inside: {
        content: {
          pattern: /^(#\{)[\s\S]+(?=\}$)/,
          lookbehind: !0,
          inside: e.languages.ruby
        },
        delimiter: {
          pattern: /^#\{|\}$/,
          alias: "punctuation"
        }
      }
    };
    delete e.languages.ruby.function;
    var n = "(?:" + [
      /([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
      /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
      /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
      /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
      /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
    ].join("|") + ")", r = /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;
    e.languages.insertBefore("ruby", "keyword", {
      "regex-literal": [
        {
          pattern: RegExp(
            /%r/.source + n + /[egimnosux]{0,6}/.source
          ),
          greedy: !0,
          inside: {
            interpolation: t,
            regex: /[\s\S]+/
          }
        },
        {
          pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
          lookbehind: !0,
          greedy: !0,
          inside: {
            interpolation: t,
            regex: /[\s\S]+/
          }
        }
      ],
      variable: /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
      symbol: [
        {
          pattern: RegExp(/(^|[^:]):/.source + r),
          lookbehind: !0,
          greedy: !0
        },
        {
          pattern: RegExp(
            /([\r\n{(,][ \t]*)/.source + r + /(?=:(?!:))/.source
          ),
          lookbehind: !0,
          greedy: !0
        }
      ],
      "method-definition": {
        pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
        lookbehind: !0,
        inside: {
          function: /\b\w+$/,
          keyword: /^self\b/,
          "class-name": /^\w+/,
          punctuation: /\./
        }
      }
    }), e.languages.insertBefore("ruby", "string", {
      "string-literal": [
        {
          pattern: RegExp(/%[qQiIwWs]?/.source + n),
          greedy: !0,
          inside: {
            interpolation: t,
            string: /[\s\S]+/
          }
        },
        {
          pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
          greedy: !0,
          inside: {
            interpolation: t,
            string: /[\s\S]+/
          }
        },
        {
          pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
          alias: "heredoc-string",
          greedy: !0,
          inside: {
            delimiter: {
              pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
              inside: {
                symbol: /\b\w+/,
                punctuation: /^<<[-~]?/
              }
            },
            interpolation: t,
            string: /[\s\S]+/
          }
        },
        {
          pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
          alias: "heredoc-string",
          greedy: !0,
          inside: {
            delimiter: {
              pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
              inside: {
                symbol: /\b\w+/,
                punctuation: /^<<[-~]?'|'$/
              }
            },
            string: /[\s\S]+/
          }
        }
      ],
      "command-literal": [
        {
          pattern: RegExp(/%x/.source + n),
          greedy: !0,
          inside: {
            interpolation: t,
            command: {
              pattern: /[\s\S]+/,
              alias: "string"
            }
          }
        },
        {
          pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
          greedy: !0,
          inside: {
            interpolation: t,
            command: {
              pattern: /[\s\S]+/,
              alias: "string"
            }
          }
        }
      ]
    }), delete e.languages.ruby.string, e.languages.insertBefore("ruby", "number", {
      builtin: /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
      constant: /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
    }), e.languages.rb = e.languages.ruby;
  })(i);
}
pY.displayName = "rust";
pY.aliases = [];
function pY(i) {
  (function(e) {
    for (var t = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, n = 0; n < 2; n++)
      t = t.replace(/<self>/g, function() {
        return t;
      });
    t = t.replace(/<self>/g, function() {
      return /[^\s\S]/.source;
    }), e.languages.rust = {
      comment: [
        {
          pattern: RegExp(/(^|[^\\])/.source + t),
          lookbehind: !0,
          greedy: !0
        },
        {
          pattern: /(^|[^\\:])\/\/.*/,
          lookbehind: !0,
          greedy: !0
        }
      ],
      string: {
        pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,
        greedy: !0
      },
      char: {
        pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
        greedy: !0
      },
      attribute: {
        pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,
        greedy: !0,
        alias: "attr-name",
        inside: {
          string: null
          // see below
        }
      },
      // Closure params should not be confused with bitwise OR |
      "closure-params": {
        pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          "closure-punctuation": {
            pattern: /^\||\|$/,
            alias: "punctuation"
          },
          rest: null
          // see below
        }
      },
      "lifetime-annotation": {
        pattern: /'\w+/,
        alias: "symbol"
      },
      "fragment-specifier": {
        pattern: /(\$\w+:)[a-z]+/,
        lookbehind: !0,
        alias: "punctuation"
      },
      variable: /\$\w+/,
      "function-definition": {
        pattern: /(\bfn\s+)\w+/,
        lookbehind: !0,
        alias: "function"
      },
      "type-definition": {
        pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
        lookbehind: !0,
        alias: "class-name"
      },
      "module-declaration": [
        {
          pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,
          lookbehind: !0,
          alias: "namespace"
        },
        {
          pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,
          lookbehind: !0,
          alias: "namespace",
          inside: {
            punctuation: /::/
          }
        }
      ],
      keyword: [
        // https://github.com/rust-lang/reference/blob/master/src/keywords.md
        /\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,
        // primitives and str
        // https://doc.rust-lang.org/stable/rust-by-example/primitives.html
        /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/
      ],
      // functions can technically start with an upper-case letter, but this will introduce a lot of false positives
      // and Rust's naming conventions recommend snake_case anyway.
      // https://doc.rust-lang.org/1.0.0/style/style/naming/README.html
      function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,
      macro: {
        pattern: /\b\w+!/,
        alias: "property"
      },
      constant: /\b[A-Z_][A-Z_\d]+\b/,
      "class-name": /\b[A-Z]\w*\b/,
      namespace: {
        pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,
        inside: {
          punctuation: /::/
        }
      },
      // Hex, oct, bin, dec numbers with visual separators and type suffix
      number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,
      boolean: /\b(?:false|true)\b/,
      punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
      operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
    }, e.languages.rust["closure-params"].inside.rest = e.languages.rust, e.languages.rust.attribute.inside.string = e.languages.rust.string;
  })(i);
}
mY.displayName = "sass";
mY.aliases = [];
function mY(i) {
  i.register(Rw), (function(e) {
    e.languages.sass = e.languages.extend("css", {
      // Sass comments don't need to be closed, only indented
      comment: {
        pattern: /^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,
        lookbehind: !0,
        greedy: !0
      }
    }), e.languages.insertBefore("sass", "atrule", {
      // We want to consume the whole line
      "atrule-line": {
        // Includes support for = and + shortcuts
        pattern: /^(?:[ \t]*)[@+=].+/m,
        greedy: !0,
        inside: {
          atrule: /(?:@[\w-]+|[+=])/
        }
      }
    }), delete e.languages.sass.atrule;
    var t = /\$[-\w]+|#\{\$[-\w]+\}/, n = [
      /[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,
      {
        pattern: /(\s)-(?=\s)/,
        lookbehind: !0
      }
    ];
    e.languages.insertBefore("sass", "property", {
      // We want to consume the whole line
      "variable-line": {
        pattern: /^[ \t]*\$.+/m,
        greedy: !0,
        inside: {
          punctuation: /:/,
          variable: t,
          operator: n
        }
      },
      // We want to consume the whole line
      "property-line": {
        pattern: /^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,
        greedy: !0,
        inside: {
          property: [
            /[^:\s]+(?=\s*:)/,
            {
              pattern: /(:)[^:\s]+/,
              lookbehind: !0
            }
          ],
          punctuation: /:/,
          variable: t,
          operator: n,
          important: e.languages.sass.important
        }
      }
    }), delete e.languages.sass.property, delete e.languages.sass.important, e.languages.insertBefore("sass", "punctuation", {
      selector: {
        pattern: /^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,
        lookbehind: !0,
        greedy: !0
      }
    });
  })(i);
}
_Y.displayName = "scss";
_Y.aliases = [];
function _Y(i) {
  i.register(Rw), i.languages.scss = i.languages.extend("css", {
    comment: {
      pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,
      lookbehind: !0
    },
    atrule: {
      pattern: /@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,
      inside: {
        rule: /@[\w-]+/
        // See rest below
      }
    },
    // url, compassified
    url: /(?:[-a-z]+-)?url(?=\()/i,
    // CSS selector regex is not appropriate for Sass
    // since there can be lot more things (var, @ directive, nesting..)
    // a selector must start at the end of a property or after a brace (end of other rules or nesting)
    // it can contain some characters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable
    // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var
    // can "pass" as a selector- e.g: proper#{$erty})
    // this one was hard to do, so please be careful if you edit this one :)
    selector: {
      // Initial look-ahead is used to prevent matching of blank selectors
      pattern: /(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,
      inside: {
        parent: {
          pattern: /&/,
          alias: "important"
        },
        placeholder: /%[-\w]+/,
        variable: /\$[-\w]+|#\{\$[-\w]+\}/
      }
    },
    property: {
      pattern: /(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,
      inside: {
        variable: /\$[-\w]+|#\{\$[-\w]+\}/
      }
    }
  }), i.languages.insertBefore("scss", "atrule", {
    keyword: [
      /@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,
      {
        pattern: /( )(?:from|through)(?= )/,
        lookbehind: !0
      }
    ]
  }), i.languages.insertBefore("scss", "important", {
    // var and interpolated vars
    variable: /\$[-\w]+|#\{\$[-\w]+\}/
  }), i.languages.insertBefore("scss", "function", {
    "module-modifier": {
      pattern: /\b(?:as|hide|show|with)\b/i,
      alias: "keyword"
    },
    placeholder: {
      pattern: /%[-\w]+/,
      alias: "selector"
    },
    statement: {
      pattern: /\B!(?:default|optional)\b/i,
      alias: "keyword"
    },
    boolean: /\b(?:false|true)\b/,
    null: {
      pattern: /\bnull\b/,
      alias: "keyword"
    },
    operator: {
      pattern: /(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,
      lookbehind: !0
    }
  }), i.languages.scss.atrule.inside.rest = i.languages.scss;
}
m2.displayName = "sql";
m2.aliases = [];
function m2(i) {
  i.languages.sql = {
    comment: {
      pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
      lookbehind: !0
    },
    variable: [
      {
        pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
        greedy: !0
      },
      /@[\w.$]+/
    ],
    string: {
      pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
      greedy: !0,
      lookbehind: !0
    },
    identifier: {
      pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,
      greedy: !0,
      lookbehind: !0,
      inside: {
        punctuation: /^`|`$/
      }
    },
    function: /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,
    // Should we highlight user defined functions too?
    keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,
    boolean: /\b(?:FALSE|NULL|TRUE)\b/i,
    number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
    operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
    punctuation: /[;[\]()`,.]/
  };
}
bY.displayName = "swift";
bY.aliases = [];
function bY(i) {
  i.languages.swift = {
    comment: {
      // Nested comments are supported up to 2 levels
      pattern: /(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,
      lookbehind: !0,
      greedy: !0
    },
    "string-literal": [
      // https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html
      {
        pattern: RegExp(
          /(^|[^"#])/.source + "(?:" + // single-line string
          /"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source + "|" + // multi-line string
          /"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source + ")" + /(?!["#])/.source
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          interpolation: {
            pattern: /(\\\()(?:[^()]|\([^()]*\))*(?=\))/,
            lookbehind: !0,
            inside: null
            // see below
          },
          "interpolation-punctuation": {
            pattern: /^\)|\\\($/,
            alias: "punctuation"
          },
          punctuation: /\\(?=[\r\n])/,
          string: /[\s\S]+/
        }
      },
      {
        pattern: RegExp(
          /(^|[^"#])(#+)/.source + "(?:" + // single-line string
          /"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source + "|" + // multi-line string
          /"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source + ")\\2"
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          interpolation: {
            pattern: /(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,
            lookbehind: !0,
            inside: null
            // see below
          },
          "interpolation-punctuation": {
            pattern: /^\)|\\#+\($/,
            alias: "punctuation"
          },
          string: /[\s\S]+/
        }
      }
    ],
    directive: {
      // directives with conditions
      pattern: RegExp(
        /#/.source + "(?:" + (/(?:elseif|if)\b/.source + "(?:[ 	]*" + // This regex is a little complex. It's equivalent to this:
        //   (?:![ \t]*)?(?:\b\w+\b(?:[ \t]*<round>)?|<round>)(?:[ \t]*(?:&&|\|\|))?
        // where <round> is a general parentheses expression.
        /(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source + ")+") + "|" + /(?:else|endif)\b/.source + ")"
      ),
      alias: "property",
      inside: {
        "directive-name": /^#\w+/,
        boolean: /\b(?:false|true)\b/,
        number: /\b\d+(?:\.\d+)*\b/,
        operator: /!|&&|\|\||[<>]=?/,
        punctuation: /[(),]/
      }
    },
    literal: {
      pattern: /#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,
      alias: "constant"
    },
    "other-directive": {
      pattern: /#\w+\b/,
      alias: "property"
    },
    attribute: {
      pattern: /@\w+/,
      alias: "atrule"
    },
    "function-definition": {
      pattern: /(\bfunc\s+)\w+/,
      lookbehind: !0,
      alias: "function"
    },
    label: {
      // https://docs.swift.org/swift-book/LanguageGuide/ControlFlow.html#ID141
      pattern: /\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,
      lookbehind: !0,
      alias: "important"
    },
    keyword: /\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,
    boolean: /\b(?:false|true)\b/,
    nil: {
      pattern: /\bnil\b/,
      alias: "constant"
    },
    "short-argument": /\$\d+\b/,
    omit: {
      pattern: /\b_\b/,
      alias: "keyword"
    },
    number: /\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,
    // A class name must start with an upper-case letter and be either 1 letter long or contain a lower-case letter.
    "class-name": /\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,
    function: /\b[a-z_]\w*(?=\s*\()/i,
    constant: /\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,
    // Operators are generic in Swift. Developers can even create new operators (e.g. +++).
    // https://docs.swift.org/swift-book/ReferenceManual/zzSummaryOfTheGrammar.html#ID481
    // This regex only supports ASCII operators.
    operator: /[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,
    punctuation: /[{}[\]();,.:\\]/
  }, i.languages.swift["string-literal"].forEach(function(e) {
    e.inside.interpolation.inside = i.languages.swift;
  });
}
_2.displayName = "typescript";
_2.aliases = ["ts"];
function _2(i) {
  i.register(_u), (function(e) {
    e.languages.typescript = e.languages.extend("javascript", {
      "class-name": {
        pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
        lookbehind: !0,
        greedy: !0,
        inside: null
        // see below
      },
      builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
    }), e.languages.typescript.keyword.push(
      /\b(?:abstract|declare|is|keyof|readonly|require)\b/,
      // keywords that have to be followed by an identifier
      /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
      // This is for `import type *, {}`
      /\btype\b(?=\s*(?:[\{*]|$))/
    ), delete e.languages.typescript.parameter, delete e.languages.typescript["literal-property"];
    var t = e.languages.extend("typescript", {});
    delete t["class-name"], e.languages.typescript["class-name"].inside = t, e.languages.insertBefore("typescript", "function", {
      decorator: {
        pattern: /@[$\w\xA0-\uFFFF]+/,
        inside: {
          at: {
            pattern: /^@/,
            alias: "operator"
          },
          function: /^[\s\S]+/
        }
      },
      "generic-function": {
        // e.g. foo<T extends "bar" | "baz">( ...
        pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
        greedy: !0,
        inside: {
          function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
          generic: {
            pattern: /<[\s\S]+/,
            // everything after the first <
            alias: "class-name",
            inside: t
          }
        }
      }
    }), e.languages.ts = e.languages.typescript;
  })(i);
}
s6.displayName = "basic";
s6.aliases = [];
function s6(i) {
  i.languages.basic = {
    comment: {
      pattern: /(?:!|REM\b).+/i,
      inside: {
        keyword: /^REM/i
      }
    },
    string: {
      pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,
      greedy: !0
    },
    number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,
    keyword: /\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,
    function: /\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,
    operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,
    punctuation: /[,;:()]/
  };
}
o6.displayName = "vbnet";
o6.aliases = [];
function o6(i) {
  i.register(s6), i.languages.vbnet = i.languages.extend("basic", {
    comment: [
      {
        pattern: /(?:!|REM\b).+/i,
        inside: {
          keyword: /^REM/i
        }
      },
      {
        pattern: /(^|[^\\:])'.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: {
      pattern: /(^|[^"])"(?:""|[^"])*"(?!")/,
      lookbehind: !0,
      greedy: !0
    },
    keyword: /(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,
    punctuation: /[,;:(){}]/
  });
}
let a6 = class {
  /**
   * @constructor
   * @param {Properties} property
   * @param {Normal} normal
   * @param {string} [space]
   */
  constructor(e, t, n) {
    this.property = e, this.normal = t, n && (this.space = n);
  }
};
a6.prototype.property = {};
a6.prototype.normal = {};
a6.prototype.space = null;
function h7e(i, e) {
  const t = {}, n = {};
  let r = -1;
  for (; ++r < i.length; )
    Object.assign(t, i[r].property), Object.assign(n, i[r].normal);
  return new a6(t, n, e);
}
function V5(i) {
  return i.toLowerCase();
}
let ep = class {
  /**
   * @constructor
   * @param {string} property
   * @param {string} attribute
   */
  constructor(e, t) {
    this.property = e, this.attribute = t;
  }
};
ep.prototype.space = null;
ep.prototype.boolean = !1;
ep.prototype.booleanish = !1;
ep.prototype.overloadedBoolean = !1;
ep.prototype.number = !1;
ep.prototype.commaSeparated = !1;
ep.prototype.spaceSeparated = !1;
ep.prototype.commaOrSpaceSeparated = !1;
ep.prototype.mustUseProperty = !1;
ep.prototype.defined = !1;
let X3t = 0;
const ur = fk(), dl = fk(), f7e = fk(), zt = fk(), Fo = fk(), mR = fk(), bf = fk();
function fk() {
  return 2 ** ++X3t;
}
const tde = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  boolean: ur,
  booleanish: dl,
  commaOrSpaceSeparated: bf,
  commaSeparated: mR,
  number: zt,
  overloadedBoolean: f7e,
  spaceSeparated: Fo
}, Symbol.toStringTag, { value: "Module" })), Xte = Object.keys(tde);
let Ame = class extends ep {
  /**
   * @constructor
   * @param {string} property
   * @param {string} attribute
   * @param {number|null} [mask]
   * @param {string} [space]
   */
  constructor(e, t, n, r) {
    let s = -1;
    if (super(e, t), FRe(this, "space", r), typeof n == "number")
      for (; ++s < Xte.length; ) {
        const o = Xte[s];
        FRe(this, Xte[s], (n & tde[o]) === tde[o]);
      }
  }
};
Ame.prototype.defined = !0;
function FRe(i, e, t) {
  t && (i[e] = t);
}
const Z3t = {}.hasOwnProperty;
function b2(i) {
  const e = {}, t = {};
  let n;
  for (n in i.properties)
    if (Z3t.call(i.properties, n)) {
      const r = i.properties[n], s = new Ame(
        n,
        i.transform(i.attributes || {}, n),
        r,
        i.space
      );
      i.mustUseProperty && i.mustUseProperty.includes(n) && (s.mustUseProperty = !0), e[n] = s, t[V5(n)] = n, t[V5(s.attribute)] = n;
    }
  return new a6(e, t, i.space);
}
const g7e = b2({
  space: "xlink",
  transform(i, e) {
    return "xlink:" + e.slice(5).toLowerCase();
  },
  properties: {
    xLinkActuate: null,
    xLinkArcRole: null,
    xLinkHref: null,
    xLinkRole: null,
    xLinkShow: null,
    xLinkTitle: null,
    xLinkType: null
  }
}), p7e = b2({
  space: "xml",
  transform(i, e) {
    return "xml:" + e.slice(3).toLowerCase();
  },
  properties: { xmlLang: null, xmlBase: null, xmlSpace: null }
});
function m7e(i, e) {
  return e in i ? i[e] : e;
}
function _7e(i, e) {
  return m7e(i, e.toLowerCase());
}
const b7e = b2({
  space: "xmlns",
  attributes: { xmlnsxlink: "xmlns:xlink" },
  transform: _7e,
  properties: { xmlns: null, xmlnsXLink: null }
}), v7e = b2({
  transform(i, e) {
    return e === "role" ? e : "aria-" + e.slice(4).toLowerCase();
  },
  properties: {
    ariaActiveDescendant: null,
    ariaAtomic: dl,
    ariaAutoComplete: null,
    ariaBusy: dl,
    ariaChecked: dl,
    ariaColCount: zt,
    ariaColIndex: zt,
    ariaColSpan: zt,
    ariaControls: Fo,
    ariaCurrent: null,
    ariaDescribedBy: Fo,
    ariaDetails: null,
    ariaDisabled: dl,
    ariaDropEffect: Fo,
    ariaErrorMessage: null,
    ariaExpanded: dl,
    ariaFlowTo: Fo,
    ariaGrabbed: dl,
    ariaHasPopup: null,
    ariaHidden: dl,
    ariaInvalid: null,
    ariaKeyShortcuts: null,
    ariaLabel: null,
    ariaLabelledBy: Fo,
    ariaLevel: zt,
    ariaLive: null,
    ariaModal: dl,
    ariaMultiLine: dl,
    ariaMultiSelectable: dl,
    ariaOrientation: null,
    ariaOwns: Fo,
    ariaPlaceholder: null,
    ariaPosInSet: zt,
    ariaPressed: dl,
    ariaReadOnly: dl,
    ariaRelevant: null,
    ariaRequired: dl,
    ariaRoleDescription: Fo,
    ariaRowCount: zt,
    ariaRowIndex: zt,
    ariaRowSpan: zt,
    ariaSelected: dl,
    ariaSetSize: zt,
    ariaSort: null,
    ariaValueMax: zt,
    ariaValueMin: zt,
    ariaValueNow: zt,
    ariaValueText: null,
    role: null
  }
}), Q3t = b2({
  space: "html",
  attributes: {
    acceptcharset: "accept-charset",
    classname: "class",
    htmlfor: "for",
    httpequiv: "http-equiv"
  },
  transform: _7e,
  mustUseProperty: ["checked", "multiple", "muted", "selected"],
  properties: {
    // Standard Properties.
    abbr: null,
    accept: mR,
    acceptCharset: Fo,
    accessKey: Fo,
    action: null,
    allow: null,
    allowFullScreen: ur,
    allowPaymentRequest: ur,
    allowUserMedia: ur,
    alt: null,
    as: null,
    async: ur,
    autoCapitalize: null,
    autoComplete: Fo,
    autoFocus: ur,
    autoPlay: ur,
    blocking: Fo,
    capture: null,
    charSet: null,
    checked: ur,
    cite: null,
    className: Fo,
    cols: zt,
    colSpan: null,
    content: null,
    contentEditable: dl,
    controls: ur,
    controlsList: Fo,
    coords: zt | mR,
    crossOrigin: null,
    data: null,
    dateTime: null,
    decoding: null,
    default: ur,
    defer: ur,
    dir: null,
    dirName: null,
    disabled: ur,
    download: f7e,
    draggable: dl,
    encType: null,
    enterKeyHint: null,
    fetchPriority: null,
    form: null,
    formAction: null,
    formEncType: null,
    formMethod: null,
    formNoValidate: ur,
    formTarget: null,
    headers: Fo,
    height: zt,
    hidden: ur,
    high: zt,
    href: null,
    hrefLang: null,
    htmlFor: Fo,
    httpEquiv: Fo,
    id: null,
    imageSizes: null,
    imageSrcSet: null,
    inert: ur,
    inputMode: null,
    integrity: null,
    is: null,
    isMap: ur,
    itemId: null,
    itemProp: Fo,
    itemRef: Fo,
    itemScope: ur,
    itemType: Fo,
    kind: null,
    label: null,
    lang: null,
    language: null,
    list: null,
    loading: null,
    loop: ur,
    low: zt,
    manifest: null,
    max: null,
    maxLength: zt,
    media: null,
    method: null,
    min: null,
    minLength: zt,
    multiple: ur,
    muted: ur,
    name: null,
    nonce: null,
    noModule: ur,
    noValidate: ur,
    onAbort: null,
    onAfterPrint: null,
    onAuxClick: null,
    onBeforeMatch: null,
    onBeforePrint: null,
    onBeforeToggle: null,
    onBeforeUnload: null,
    onBlur: null,
    onCancel: null,
    onCanPlay: null,
    onCanPlayThrough: null,
    onChange: null,
    onClick: null,
    onClose: null,
    onContextLost: null,
    onContextMenu: null,
    onContextRestored: null,
    onCopy: null,
    onCueChange: null,
    onCut: null,
    onDblClick: null,
    onDrag: null,
    onDragEnd: null,
    onDragEnter: null,
    onDragExit: null,
    onDragLeave: null,
    onDragOver: null,
    onDragStart: null,
    onDrop: null,
    onDurationChange: null,
    onEmptied: null,
    onEnded: null,
    onError: null,
    onFocus: null,
    onFormData: null,
    onHashChange: null,
    onInput: null,
    onInvalid: null,
    onKeyDown: null,
    onKeyPress: null,
    onKeyUp: null,
    onLanguageChange: null,
    onLoad: null,
    onLoadedData: null,
    onLoadedMetadata: null,
    onLoadEnd: null,
    onLoadStart: null,
    onMessage: null,
    onMessageError: null,
    onMouseDown: null,
    onMouseEnter: null,
    onMouseLeave: null,
    onMouseMove: null,
    onMouseOut: null,
    onMouseOver: null,
    onMouseUp: null,
    onOffline: null,
    onOnline: null,
    onPageHide: null,
    onPageShow: null,
    onPaste: null,
    onPause: null,
    onPlay: null,
    onPlaying: null,
    onPopState: null,
    onProgress: null,
    onRateChange: null,
    onRejectionHandled: null,
    onReset: null,
    onResize: null,
    onScroll: null,
    onScrollEnd: null,
    onSecurityPolicyViolation: null,
    onSeeked: null,
    onSeeking: null,
    onSelect: null,
    onSlotChange: null,
    onStalled: null,
    onStorage: null,
    onSubmit: null,
    onSuspend: null,
    onTimeUpdate: null,
    onToggle: null,
    onUnhandledRejection: null,
    onUnload: null,
    onVolumeChange: null,
    onWaiting: null,
    onWheel: null,
    open: ur,
    optimum: zt,
    pattern: null,
    ping: Fo,
    placeholder: null,
    playsInline: ur,
    popover: null,
    popoverTarget: null,
    popoverTargetAction: null,
    poster: null,
    preload: null,
    readOnly: ur,
    referrerPolicy: null,
    rel: Fo,
    required: ur,
    reversed: ur,
    rows: zt,
    rowSpan: zt,
    sandbox: Fo,
    scope: null,
    scoped: ur,
    seamless: ur,
    selected: ur,
    shadowRootClonable: ur,
    shadowRootDelegatesFocus: ur,
    shadowRootMode: null,
    shape: null,
    size: zt,
    sizes: null,
    slot: null,
    span: zt,
    spellCheck: dl,
    src: null,
    srcDoc: null,
    srcLang: null,
    srcSet: null,
    start: zt,
    step: null,
    style: null,
    tabIndex: zt,
    target: null,
    title: null,
    translate: null,
    type: null,
    typeMustMatch: ur,
    useMap: null,
    value: dl,
    width: zt,
    wrap: null,
    writingSuggestions: null,
    // Legacy.
    // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
    align: null,
    // Several. Use CSS `text-align` instead,
    aLink: null,
    // `<body>`. Use CSS `a:active {color}` instead
    archive: Fo,
    // `<object>`. List of URIs to archives
    axis: null,
    // `<td>` and `<th>`. Use `scope` on `<th>`
    background: null,
    // `<body>`. Use CSS `background-image` instead
    bgColor: null,
    // `<body>` and table elements. Use CSS `background-color` instead
    border: zt,
    // `<table>`. Use CSS `border-width` instead,
    borderColor: null,
    // `<table>`. Use CSS `border-color` instead,
    bottomMargin: zt,
    // `<body>`
    cellPadding: null,
    // `<table>`
    cellSpacing: null,
    // `<table>`
    char: null,
    // Several table elements. When `align=char`, sets the character to align on
    charOff: null,
    // Several table elements. When `char`, offsets the alignment
    classId: null,
    // `<object>`
    clear: null,
    // `<br>`. Use CSS `clear` instead
    code: null,
    // `<object>`
    codeBase: null,
    // `<object>`
    codeType: null,
    // `<object>`
    color: null,
    // `<font>` and `<hr>`. Use CSS instead
    compact: ur,
    // Lists. Use CSS to reduce space between items instead
    declare: ur,
    // `<object>`
    event: null,
    // `<script>`
    face: null,
    // `<font>`. Use CSS instead
    frame: null,
    // `<table>`
    frameBorder: null,
    // `<iframe>`. Use CSS `border` instead
    hSpace: zt,
    // `<img>` and `<object>`
    leftMargin: zt,
    // `<body>`
    link: null,
    // `<body>`. Use CSS `a:link {color: *}` instead
    longDesc: null,
    // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
    lowSrc: null,
    // `<img>`. Use a `<picture>`
    marginHeight: zt,
    // `<body>`
    marginWidth: zt,
    // `<body>`
    noResize: ur,
    // `<frame>`
    noHref: ur,
    // `<area>`. Use no href instead of an explicit `nohref`
    noShade: ur,
    // `<hr>`. Use background-color and height instead of borders
    noWrap: ur,
    // `<td>` and `<th>`
    object: null,
    // `<applet>`
    profile: null,
    // `<head>`
    prompt: null,
    // `<isindex>`
    rev: null,
    // `<link>`
    rightMargin: zt,
    // `<body>`
    rules: null,
    // `<table>`
    scheme: null,
    // `<meta>`
    scrolling: dl,
    // `<frame>`. Use overflow in the child context
    standby: null,
    // `<object>`
    summary: null,
    // `<table>`
    text: null,
    // `<body>`. Use CSS `color` instead
    topMargin: zt,
    // `<body>`
    valueType: null,
    // `<param>`
    version: null,
    // `<html>`. Use a doctype.
    vAlign: null,
    // Several. Use CSS `vertical-align` instead
    vLink: null,
    // `<body>`. Use CSS `a:visited {color}` instead
    vSpace: zt,
    // `<img>` and `<object>`
    // Non-standard Properties.
    allowTransparency: null,
    autoCorrect: null,
    autoSave: null,
    disablePictureInPicture: ur,
    disableRemotePlayback: ur,
    prefix: null,
    property: null,
    results: zt,
    security: null,
    unselectable: null
  }
}), J3t = b2({
  space: "svg",
  attributes: {
    accentHeight: "accent-height",
    alignmentBaseline: "alignment-baseline",
    arabicForm: "arabic-form",
    baselineShift: "baseline-shift",
    capHeight: "cap-height",
    className: "class",
    clipPath: "clip-path",
    clipRule: "clip-rule",
    colorInterpolation: "color-interpolation",
    colorInterpolationFilters: "color-interpolation-filters",
    colorProfile: "color-profile",
    colorRendering: "color-rendering",
    crossOrigin: "crossorigin",
    dataType: "datatype",
    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",
    hrefLang: "hreflang",
    horizAdvX: "horiz-adv-x",
    horizOriginX: "horiz-origin-x",
    horizOriginY: "horiz-origin-y",
    imageRendering: "image-rendering",
    letterSpacing: "letter-spacing",
    lightingColor: "lighting-color",
    markerEnd: "marker-end",
    markerMid: "marker-mid",
    markerStart: "marker-start",
    navDown: "nav-down",
    navDownLeft: "nav-down-left",
    navDownRight: "nav-down-right",
    navLeft: "nav-left",
    navNext: "nav-next",
    navPrev: "nav-prev",
    navRight: "nav-right",
    navUp: "nav-up",
    navUpLeft: "nav-up-left",
    navUpRight: "nav-up-right",
    onAbort: "onabort",
    onActivate: "onactivate",
    onAfterPrint: "onafterprint",
    onBeforePrint: "onbeforeprint",
    onBegin: "onbegin",
    onCancel: "oncancel",
    onCanPlay: "oncanplay",
    onCanPlayThrough: "oncanplaythrough",
    onChange: "onchange",
    onClick: "onclick",
    onClose: "onclose",
    onCopy: "oncopy",
    onCueChange: "oncuechange",
    onCut: "oncut",
    onDblClick: "ondblclick",
    onDrag: "ondrag",
    onDragEnd: "ondragend",
    onDragEnter: "ondragenter",
    onDragExit: "ondragexit",
    onDragLeave: "ondragleave",
    onDragOver: "ondragover",
    onDragStart: "ondragstart",
    onDrop: "ondrop",
    onDurationChange: "ondurationchange",
    onEmptied: "onemptied",
    onEnd: "onend",
    onEnded: "onended",
    onError: "onerror",
    onFocus: "onfocus",
    onFocusIn: "onfocusin",
    onFocusOut: "onfocusout",
    onHashChange: "onhashchange",
    onInput: "oninput",
    onInvalid: "oninvalid",
    onKeyDown: "onkeydown",
    onKeyPress: "onkeypress",
    onKeyUp: "onkeyup",
    onLoad: "onload",
    onLoadedData: "onloadeddata",
    onLoadedMetadata: "onloadedmetadata",
    onLoadStart: "onloadstart",
    onMessage: "onmessage",
    onMouseDown: "onmousedown",
    onMouseEnter: "onmouseenter",
    onMouseLeave: "onmouseleave",
    onMouseMove: "onmousemove",
    onMouseOut: "onmouseout",
    onMouseOver: "onmouseover",
    onMouseUp: "onmouseup",
    onMouseWheel: "onmousewheel",
    onOffline: "onoffline",
    onOnline: "ononline",
    onPageHide: "onpagehide",
    onPageShow: "onpageshow",
    onPaste: "onpaste",
    onPause: "onpause",
    onPlay: "onplay",
    onPlaying: "onplaying",
    onPopState: "onpopstate",
    onProgress: "onprogress",
    onRateChange: "onratechange",
    onRepeat: "onrepeat",
    onReset: "onreset",
    onResize: "onresize",
    onScroll: "onscroll",
    onSeeked: "onseeked",
    onSeeking: "onseeking",
    onSelect: "onselect",
    onShow: "onshow",
    onStalled: "onstalled",
    onStorage: "onstorage",
    onSubmit: "onsubmit",
    onSuspend: "onsuspend",
    onTimeUpdate: "ontimeupdate",
    onToggle: "ontoggle",
    onUnload: "onunload",
    onVolumeChange: "onvolumechange",
    onWaiting: "onwaiting",
    onZoom: "onzoom",
    overlinePosition: "overline-position",
    overlineThickness: "overline-thickness",
    paintOrder: "paint-order",
    panose1: "panose-1",
    pointerEvents: "pointer-events",
    referrerPolicy: "referrerpolicy",
    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",
    tabIndex: "tabindex",
    textAnchor: "text-anchor",
    textDecoration: "text-decoration",
    textRendering: "text-rendering",
    transformOrigin: "transform-origin",
    typeOf: "typeof",
    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",
    xHeight: "x-height",
    // These were camelcased in Tiny. Now lowercased in SVG 2
    playbackOrder: "playbackorder",
    timelineBegin: "timelinebegin"
  },
  transform: m7e,
  properties: {
    about: bf,
    accentHeight: zt,
    accumulate: null,
    additive: null,
    alignmentBaseline: null,
    alphabetic: zt,
    amplitude: zt,
    arabicForm: null,
    ascent: zt,
    attributeName: null,
    attributeType: null,
    azimuth: zt,
    bandwidth: null,
    baselineShift: null,
    baseFrequency: null,
    baseProfile: null,
    bbox: null,
    begin: null,
    bias: zt,
    by: null,
    calcMode: null,
    capHeight: zt,
    className: Fo,
    clip: null,
    clipPath: null,
    clipPathUnits: null,
    clipRule: null,
    color: null,
    colorInterpolation: null,
    colorInterpolationFilters: null,
    colorProfile: null,
    colorRendering: null,
    content: null,
    contentScriptType: null,
    contentStyleType: null,
    crossOrigin: null,
    cursor: null,
    cx: null,
    cy: null,
    d: null,
    dataType: null,
    defaultAction: null,
    descent: zt,
    diffuseConstant: zt,
    direction: null,
    display: null,
    dur: null,
    divisor: zt,
    dominantBaseline: null,
    download: ur,
    dx: null,
    dy: null,
    edgeMode: null,
    editable: null,
    elevation: zt,
    enableBackground: null,
    end: null,
    event: null,
    exponent: zt,
    externalResourcesRequired: null,
    fill: null,
    fillOpacity: zt,
    fillRule: null,
    filter: null,
    filterRes: null,
    filterUnits: null,
    floodColor: null,
    floodOpacity: null,
    focusable: null,
    focusHighlight: null,
    fontFamily: null,
    fontSize: null,
    fontSizeAdjust: null,
    fontStretch: null,
    fontStyle: null,
    fontVariant: null,
    fontWeight: null,
    format: null,
    fr: null,
    from: null,
    fx: null,
    fy: null,
    g1: mR,
    g2: mR,
    glyphName: mR,
    glyphOrientationHorizontal: null,
    glyphOrientationVertical: null,
    glyphRef: null,
    gradientTransform: null,
    gradientUnits: null,
    handler: null,
    hanging: zt,
    hatchContentUnits: null,
    hatchUnits: null,
    height: null,
    href: null,
    hrefLang: null,
    horizAdvX: zt,
    horizOriginX: zt,
    horizOriginY: zt,
    id: null,
    ideographic: zt,
    imageRendering: null,
    initialVisibility: null,
    in: null,
    in2: null,
    intercept: zt,
    k: zt,
    k1: zt,
    k2: zt,
    k3: zt,
    k4: zt,
    kernelMatrix: bf,
    kernelUnitLength: null,
    keyPoints: null,
    // SEMI_COLON_SEPARATED
    keySplines: null,
    // SEMI_COLON_SEPARATED
    keyTimes: null,
    // SEMI_COLON_SEPARATED
    kerning: null,
    lang: null,
    lengthAdjust: null,
    letterSpacing: null,
    lightingColor: null,
    limitingConeAngle: zt,
    local: null,
    markerEnd: null,
    markerMid: null,
    markerStart: null,
    markerHeight: null,
    markerUnits: null,
    markerWidth: null,
    mask: null,
    maskContentUnits: null,
    maskUnits: null,
    mathematical: null,
    max: null,
    media: null,
    mediaCharacterEncoding: null,
    mediaContentEncodings: null,
    mediaSize: zt,
    mediaTime: null,
    method: null,
    min: null,
    mode: null,
    name: null,
    navDown: null,
    navDownLeft: null,
    navDownRight: null,
    navLeft: null,
    navNext: null,
    navPrev: null,
    navRight: null,
    navUp: null,
    navUpLeft: null,
    navUpRight: null,
    numOctaves: null,
    observer: null,
    offset: null,
    onAbort: null,
    onActivate: null,
    onAfterPrint: null,
    onBeforePrint: null,
    onBegin: null,
    onCancel: null,
    onCanPlay: null,
    onCanPlayThrough: null,
    onChange: null,
    onClick: null,
    onClose: null,
    onCopy: null,
    onCueChange: null,
    onCut: null,
    onDblClick: null,
    onDrag: null,
    onDragEnd: null,
    onDragEnter: null,
    onDragExit: null,
    onDragLeave: null,
    onDragOver: null,
    onDragStart: null,
    onDrop: null,
    onDurationChange: null,
    onEmptied: null,
    onEnd: null,
    onEnded: null,
    onError: null,
    onFocus: null,
    onFocusIn: null,
    onFocusOut: null,
    onHashChange: null,
    onInput: null,
    onInvalid: null,
    onKeyDown: null,
    onKeyPress: null,
    onKeyUp: null,
    onLoad: null,
    onLoadedData: null,
    onLoadedMetadata: null,
    onLoadStart: null,
    onMessage: null,
    onMouseDown: null,
    onMouseEnter: null,
    onMouseLeave: null,
    onMouseMove: null,
    onMouseOut: null,
    onMouseOver: null,
    onMouseUp: null,
    onMouseWheel: null,
    onOffline: null,
    onOnline: null,
    onPageHide: null,
    onPageShow: null,
    onPaste: null,
    onPause: null,
    onPlay: null,
    onPlaying: null,
    onPopState: null,
    onProgress: null,
    onRateChange: null,
    onRepeat: null,
    onReset: null,
    onResize: null,
    onScroll: null,
    onSeeked: null,
    onSeeking: null,
    onSelect: null,
    onShow: null,
    onStalled: null,
    onStorage: null,
    onSubmit: null,
    onSuspend: null,
    onTimeUpdate: null,
    onToggle: null,
    onUnload: null,
    onVolumeChange: null,
    onWaiting: null,
    onZoom: null,
    opacity: null,
    operator: null,
    order: null,
    orient: null,
    orientation: null,
    origin: null,
    overflow: null,
    overlay: null,
    overlinePosition: zt,
    overlineThickness: zt,
    paintOrder: null,
    panose1: null,
    path: null,
    pathLength: zt,
    patternContentUnits: null,
    patternTransform: null,
    patternUnits: null,
    phase: null,
    ping: Fo,
    pitch: null,
    playbackOrder: null,
    pointerEvents: null,
    points: null,
    pointsAtX: zt,
    pointsAtY: zt,
    pointsAtZ: zt,
    preserveAlpha: null,
    preserveAspectRatio: null,
    primitiveUnits: null,
    propagate: null,
    property: bf,
    r: null,
    radius: null,
    referrerPolicy: null,
    refX: null,
    refY: null,
    rel: bf,
    rev: bf,
    renderingIntent: null,
    repeatCount: null,
    repeatDur: null,
    requiredExtensions: bf,
    requiredFeatures: bf,
    requiredFonts: bf,
    requiredFormats: bf,
    resource: null,
    restart: null,
    result: null,
    rotate: null,
    rx: null,
    ry: null,
    scale: null,
    seed: null,
    shapeRendering: null,
    side: null,
    slope: null,
    snapshotTime: null,
    specularConstant: zt,
    specularExponent: zt,
    spreadMethod: null,
    spacing: null,
    startOffset: null,
    stdDeviation: null,
    stemh: null,
    stemv: null,
    stitchTiles: null,
    stopColor: null,
    stopOpacity: null,
    strikethroughPosition: zt,
    strikethroughThickness: zt,
    string: null,
    stroke: null,
    strokeDashArray: bf,
    strokeDashOffset: null,
    strokeLineCap: null,
    strokeLineJoin: null,
    strokeMiterLimit: zt,
    strokeOpacity: zt,
    strokeWidth: null,
    style: null,
    surfaceScale: zt,
    syncBehavior: null,
    syncBehaviorDefault: null,
    syncMaster: null,
    syncTolerance: null,
    syncToleranceDefault: null,
    systemLanguage: bf,
    tabIndex: zt,
    tableValues: null,
    target: null,
    targetX: zt,
    targetY: zt,
    textAnchor: null,
    textDecoration: null,
    textRendering: null,
    textLength: null,
    timelineBegin: null,
    title: null,
    transformBehavior: null,
    type: null,
    typeOf: bf,
    to: null,
    transform: null,
    transformOrigin: null,
    u1: null,
    u2: null,
    underlinePosition: zt,
    underlineThickness: zt,
    unicode: null,
    unicodeBidi: null,
    unicodeRange: null,
    unitsPerEm: zt,
    values: null,
    vAlphabetic: zt,
    vMathematical: zt,
    vectorEffect: null,
    vHanging: zt,
    vIdeographic: zt,
    version: null,
    vertAdvY: zt,
    vertOriginX: zt,
    vertOriginY: zt,
    viewBox: null,
    viewTarget: null,
    visibility: null,
    width: null,
    widths: null,
    wordSpacing: null,
    writingMode: null,
    x: null,
    x1: null,
    x2: null,
    xChannelSelector: null,
    xHeight: zt,
    y: null,
    y1: null,
    y2: null,
    yChannelSelector: null,
    z: null,
    zoomAndPan: null
  }
}), e4t = /^data[-\w.:]+$/i, BRe = /-[a-z]/g, t4t = /[A-Z]/g;
function n4t(i, e) {
  const t = V5(e);
  let n = e, r = ep;
  if (t in i.normal)
    return i.property[i.normal[t]];
  if (t.length > 4 && t.slice(0, 4) === "data" && e4t.test(e)) {
    if (e.charAt(4) === "-") {
      const s = e.slice(5).replace(BRe, r4t);
      n = "data" + s.charAt(0).toUpperCase() + s.slice(1);
    } else {
      const s = e.slice(4);
      if (!BRe.test(s)) {
        let o = s.replace(t4t, i4t);
        o.charAt(0) !== "-" && (o = "-" + o), e = "data" + o;
      }
    }
    r = Ame;
  }
  return new r(n, e);
}
function i4t(i) {
  return "-" + i.toLowerCase();
}
function r4t(i) {
  return i.charAt(1).toUpperCase();
}
const s4t = h7e([p7e, g7e, b7e, v7e, Q3t], "html");
h7e([p7e, g7e, b7e, v7e, J3t], "svg");
const HRe = /[#.]/g;
function o4t(i, e) {
  const t = i || "", n = {};
  let r = 0, s, o;
  for (; r < t.length; ) {
    HRe.lastIndex = r;
    const a = HRe.exec(t), l = t.slice(r, a ? a.index : t.length);
    l && (s ? s === "#" ? n.id = l : Array.isArray(n.className) ? n.className.push(l) : n.className = [l] : o = l, r += l.length), a && (s = a[0], r++);
  }
  return {
    type: "element",
    // @ts-expect-error: fine.
    tagName: o || e || "div",
    properties: n,
    children: []
  };
}
function U5(i) {
  const e = String(i || "").trim();
  return e ? e.split(/[ \t\n\r\f]+/g) : [];
}
function Ome(i) {
  return i.join(" ").trim();
}
function z5(i) {
  const e = [], t = String(i || "");
  let n = t.indexOf(","), r = 0, s = !1;
  for (; !s; ) {
    n === -1 && (n = t.length, s = !0);
    const o = t.slice(r, n).trim();
    (o || !s) && e.push(o), r = n + 1, n = t.indexOf(",", r);
  }
  return e;
}
function Mme(i, e) {
  const t = e || {};
  return (i[i.length - 1] === "" ? [...i, ""] : i).join(
    (t.padRight ? " " : "") + "," + (t.padLeft === !1 ? "" : " ")
  ).trim();
}
const a4t = /* @__PURE__ */ new Set(["menu", "submit", "reset", "button"]), y7e = {}.hasOwnProperty;
function l4t(i, e, t) {
  return (
    /**
     * @type {{
     *   (): Root
     *   (selector: null | undefined, ...children: Array<HChild>): Root
     *   (selector: string, properties?: HProperties, ...children: Array<HChild>): Element
     *   (selector: string, ...children: Array<HChild>): Element
     * }}
     */
    /**
     * Hyperscript compatible DSL for creating virtual hast trees.
     *
     * @param {string | null} [selector]
     * @param {HProperties | HChild} [properties]
     * @param {Array<HChild>} children
     * @returns {HResult}
     */
    (function(r, s, ...o) {
      let a = -1, l;
      if (r == null)
        l = { type: "root", children: [] }, o.unshift(s);
      else if (l = o4t(r, e), l.tagName = l.tagName.toLowerCase(), c4t(s, l.tagName)) {
        let c;
        for (c in s)
          y7e.call(s, c) && u4t(i, l.properties, c, s[c]);
      } else
        o.unshift(s);
      for (; ++a < o.length; )
        nde(l.children, o[a]);
      return l.type === "element" && l.tagName === "template" && (l.content = { type: "root", children: l.children }, l.children = []), l;
    })
  );
}
function c4t(i, e) {
  return i == null || typeof i != "object" || Array.isArray(i) ? !1 : e === "input" || !i.type || typeof i.type != "string" ? !0 : "children" in i && Array.isArray(i.children) ? !1 : e === "button" ? a4t.has(i.type.toLowerCase()) : !("value" in i);
}
function u4t(i, e, t, n) {
  const r = n4t(i, t);
  let s = -1, o;
  if (n != null) {
    if (typeof n == "number") {
      if (Number.isNaN(n)) return;
      o = n;
    } else typeof n == "boolean" ? o = n : typeof n == "string" ? r.spaceSeparated ? o = U5(n) : r.commaSeparated ? o = z5(n) : r.commaOrSpaceSeparated ? o = U5(z5(n).join(" ")) : o = WRe(r, r.property, n) : Array.isArray(n) ? o = n.concat() : o = r.property === "style" ? d4t(n) : String(n);
    if (Array.isArray(o)) {
      const a = [];
      for (; ++s < o.length; )
        a[s] = WRe(r, r.property, o[s]);
      o = a;
    }
    r.property === "className" && Array.isArray(e.className) && (o = e.className.concat(o)), e[r.property] = o;
  }
}
function nde(i, e) {
  let t = -1;
  if (e != null) if (typeof e == "string" || typeof e == "number")
    i.push({ type: "text", value: String(e) });
  else if (Array.isArray(e))
    for (; ++t < e.length; )
      nde(i, e[t]);
  else if (typeof e == "object" && "type" in e)
    e.type === "root" ? nde(i, e.children) : i.push(e);
  else
    throw new Error("Expected node, nodes, or string, got `" + e + "`");
}
function WRe(i, e, t) {
  if (typeof t == "string") {
    if (i.number && t && !Number.isNaN(Number(t)))
      return Number(t);
    if ((i.boolean || i.overloadedBoolean) && (t === "" || V5(t) === V5(e)))
      return !0;
  }
  return t;
}
function d4t(i) {
  const e = [];
  let t;
  for (t in i)
    y7e.call(i, t) && e.push([t, i[t]].join(": "));
  return e.join("; ");
}
const h4t = l4t(s4t, "div"), f4t = [
  "AElig",
  "AMP",
  "Aacute",
  "Acirc",
  "Agrave",
  "Aring",
  "Atilde",
  "Auml",
  "COPY",
  "Ccedil",
  "ETH",
  "Eacute",
  "Ecirc",
  "Egrave",
  "Euml",
  "GT",
  "Iacute",
  "Icirc",
  "Igrave",
  "Iuml",
  "LT",
  "Ntilde",
  "Oacute",
  "Ocirc",
  "Ograve",
  "Oslash",
  "Otilde",
  "Ouml",
  "QUOT",
  "REG",
  "THORN",
  "Uacute",
  "Ucirc",
  "Ugrave",
  "Uuml",
  "Yacute",
  "aacute",
  "acirc",
  "acute",
  "aelig",
  "agrave",
  "amp",
  "aring",
  "atilde",
  "auml",
  "brvbar",
  "ccedil",
  "cedil",
  "cent",
  "copy",
  "curren",
  "deg",
  "divide",
  "eacute",
  "ecirc",
  "egrave",
  "eth",
  "euml",
  "frac12",
  "frac14",
  "frac34",
  "gt",
  "iacute",
  "icirc",
  "iexcl",
  "igrave",
  "iquest",
  "iuml",
  "laquo",
  "lt",
  "macr",
  "micro",
  "middot",
  "nbsp",
  "not",
  "ntilde",
  "oacute",
  "ocirc",
  "ograve",
  "ordf",
  "ordm",
  "oslash",
  "otilde",
  "ouml",
  "para",
  "plusmn",
  "pound",
  "quot",
  "raquo",
  "reg",
  "sect",
  "shy",
  "sup1",
  "sup2",
  "sup3",
  "szlig",
  "thorn",
  "times",
  "uacute",
  "ucirc",
  "ugrave",
  "uml",
  "uuml",
  "yacute",
  "yen",
  "yuml"
], VRe = {
  0: "�",
  128: "€",
  130: "‚",
  131: "ƒ",
  132: "„",
  133: "…",
  134: "†",
  135: "‡",
  136: "ˆ",
  137: "‰",
  138: "Š",
  139: "‹",
  140: "Œ",
  142: "Ž",
  145: "‘",
  146: "’",
  147: "“",
  148: "”",
  149: "•",
  150: "–",
  151: "—",
  152: "˜",
  153: "™",
  154: "š",
  155: "›",
  156: "œ",
  158: "ž",
  159: "Ÿ"
};
function C7e(i) {
  const e = typeof i == "string" ? i.charCodeAt(0) : i;
  return e >= 48 && e <= 57;
}
function g4t(i) {
  const e = typeof i == "string" ? i.charCodeAt(0) : i;
  return e >= 97 && e <= 102 || e >= 65 && e <= 70 || e >= 48 && e <= 57;
}
function p4t(i) {
  const e = typeof i == "string" ? i.charCodeAt(0) : i;
  return e >= 97 && e <= 122 || e >= 65 && e <= 90;
}
function URe(i) {
  return p4t(i) || C7e(i);
}
const zRe = document.createElement("i");
function $5(i) {
  const e = "&" + i + ";";
  zRe.innerHTML = e;
  const t = zRe.textContent;
  return (
    // @ts-expect-error: TypeScript is wrong that `textContent` on elements can
    // yield `null`.
    t.charCodeAt(t.length - 1) === 59 && i !== "semi" || t === e ? !1 : t
  );
}
const m4t = [
  "",
  /* 1: Non terminated (named) */
  "Named character references must be terminated by a semicolon",
  /* 2: Non terminated (numeric) */
  "Numeric character references must be terminated by a semicolon",
  /* 3: Empty (named) */
  "Named character references cannot be empty",
  /* 4: Empty (numeric) */
  "Numeric character references cannot be empty",
  /* 5: Unknown (named) */
  "Named character references must be known",
  /* 6: Disallowed (numeric) */
  "Numeric character references cannot be disallowed",
  /* 7: Prohibited (numeric) */
  "Numeric character references cannot be outside the permissible Unicode range"
];
function _4t(i, e) {
  const t = {}, n = typeof t.additional == "string" ? t.additional.charCodeAt(0) : t.additional, r = [];
  let s = 0, o = -1, a = "", l, c;
  t.position && ("start" in t.position || "indent" in t.position ? (c = t.position.indent, l = t.position.start) : l = t.position);
  let u = (l ? l.line : 0) || 1, d = (l ? l.column : 0) || 1, h = m(), g;
  for (s--; ++s <= i.length; )
    if (g === 10 && (d = (c ? c[o] : 0) || 1), g = i.charCodeAt(s), g === 38) {
      const w = i.charCodeAt(s + 1);
      if (w === 9 || w === 10 || w === 12 || w === 32 || w === 38 || w === 60 || Number.isNaN(w) || n && w === n) {
        a += String.fromCharCode(g), d++;
        continue;
      }
      const E = s + 1;
      let L = E, T = E, D;
      if (w === 35) {
        T = ++L;
        const X = i.charCodeAt(T);
        X === 88 || X === 120 ? (D = "hexadecimal", T = ++L) : D = "decimal";
      } else
        D = "named";
      let N = "", R = "", M = "";
      const B = D === "named" ? URe : D === "decimal" ? C7e : g4t;
      for (T--; ++T <= i.length; ) {
        const X = i.charCodeAt(T);
        if (!B(X))
          break;
        M += String.fromCharCode(X), D === "named" && f4t.includes(M) && (N = M, R = $5(M));
      }
      let H = i.charCodeAt(T) === 59;
      if (H) {
        T++;
        const X = D === "named" ? $5(M) : !1;
        X && (N = M, R = X);
      }
      let j = 1 + T - E, K = "";
      if (!(!H && t.nonTerminated === !1)) if (!M)
        D !== "named" && _(4, j);
      else if (D === "named") {
        if (H && !R)
          _(5, 1);
        else if (N !== M && (T = L + N.length, j = 1 + T - L, H = !1), !H) {
          const X = N ? 1 : 3;
          if (t.attribute) {
            const Y = i.charCodeAt(T);
            Y === 61 ? (_(X, j), R = "") : URe(Y) ? R = "" : _(X, j);
          } else
            _(X, j);
        }
        K = R;
      } else {
        H || _(2, j);
        let X = Number.parseInt(
          M,
          D === "hexadecimal" ? 16 : 10
        );
        if (b4t(X))
          _(7, j), K = "�";
        else if (X in VRe)
          _(6, j), K = VRe[X];
        else {
          let Y = "";
          v4t(X) && _(6, j), X > 65535 && (X -= 65536, Y += String.fromCharCode(
            X >>> 10 | 55296
          ), X = 56320 | X & 1023), K = Y + String.fromCharCode(X);
        }
      }
      if (K) {
        v(), h = m(), s = T - 1, d += T - E + 1, r.push(K);
        const X = m();
        X.offset++, t.reference && t.reference.call(
          t.referenceContext || void 0,
          K,
          { start: h, end: X },
          i.slice(E - 1, T)
        ), h = X;
      } else
        M = i.slice(E - 1, T), a += M, d += M.length, s = T - 1;
    } else
      g === 10 && (u++, o++, d = 0), Number.isNaN(g) ? v() : (a += String.fromCharCode(g), d++);
  return r.join("");
  function m() {
    return {
      line: u,
      column: d,
      offset: s + ((l ? l.offset : 0) || 0)
    };
  }
  function _(w, E) {
    let L;
    t.warning && (L = m(), L.column += E, L.offset += E, t.warning.call(
      t.warningContext || void 0,
      m4t[w],
      L,
      w
    ));
  }
  function v() {
    a && (r.push(a), t.text && t.text.call(t.textContext || void 0, a, {
      start: h,
      end: m()
    }), a = "");
  }
}
function b4t(i) {
  return i >= 55296 && i <= 57343 || i > 1114111;
}
function v4t(i) {
  return i >= 1 && i <= 8 || i === 11 || i >= 13 && i <= 31 || i >= 127 && i <= 159 || i >= 64976 && i <= 65007 || (i & 65535) === 65535 || (i & 65535) === 65534;
}
var y4t = 0, YH = {}, fc = {
  /**
   * A namespace for utility methods.
   *
   * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
   * change or disappear at any time.
   *
   * @namespace
   * @memberof Prism
   */
  util: {
    /**
     * Returns the name of the type of the given value.
     *
     * @param {any} o
     * @returns {string}
     * @example
     * type(null)      === 'Null'
     * type(undefined) === 'Undefined'
     * type(123)       === 'Number'
     * type('foo')     === 'String'
     * type(true)      === 'Boolean'
     * type([1, 2])    === 'Array'
     * type({})        === 'Object'
     * type(String)    === 'Function'
     * type(/abc+/)    === 'RegExp'
     */
    type: function(i) {
      return Object.prototype.toString.call(i).slice(8, -1);
    },
    /**
     * Returns a unique number for the given object. Later calls will still return the same number.
     *
     * @param {Object} obj
     * @returns {number}
     */
    objId: function(i) {
      return i.__id || Object.defineProperty(i, "__id", { value: ++y4t }), i.__id;
    },
    /**
     * Creates a deep clone of the given object.
     *
     * The main intended use of this function is to clone language definitions.
     *
     * @param {T} o
     * @param {Record<number, any>} [visited]
     * @returns {T}
     * @template T
     */
    clone: function i(e, t) {
      t = t || {};
      var n, r;
      switch (fc.util.type(e)) {
        case "Object":
          if (r = fc.util.objId(e), t[r])
            return t[r];
          n = /** @type {Record<string, any>} */
          {}, t[r] = n;
          for (var s in e)
            e.hasOwnProperty(s) && (n[s] = i(e[s], t));
          return (
            /** @type {any} */
            n
          );
        case "Array":
          return r = fc.util.objId(e), t[r] ? t[r] : (n = [], t[r] = n, e.forEach(
            function(o, a) {
              n[a] = i(o, t);
            }
          ), /** @type {any} */
          n);
        default:
          return e;
      }
    }
  },
  /**
   * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
   *
   * @namespace
   * @memberof Prism
   * @public
   */
  languages: {
    /**
     * The grammar for plain, unformatted text.
     */
    plain: YH,
    plaintext: YH,
    text: YH,
    txt: YH,
    /**
     * Creates a deep copy of the language with the given id and appends the given tokens.
     *
     * If a token in `redef` also appears in the copied language, then the existing token in the copied language
     * will be overwritten at its original position.
     *
     * ## Best practices
     *
     * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
     * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
     * understand the language definition because, normally, the order of tokens matters in Prism grammars.
     *
     * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
     * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
     *
     * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
     * @param {Grammar} redef The new tokens to append.
     * @returns {Grammar} The new language created.
     * @public
     * @example
     * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
     *     // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
     *     // at its original position
     *     'comment': { ... },
     *     // CSS doesn't have a 'color' token, so this token will be appended
     *     'color': /\b(?:red|green|blue)\b/
     * });
     */
    extend: function(i, e) {
      var t = fc.util.clone(fc.languages[i]);
      for (var n in e)
        t[n] = e[n];
      return t;
    },
    /**
     * Inserts tokens _before_ another token in a language definition or any other grammar.
     *
     * ## Usage
     *
     * This helper method makes it easy to modify existing languages. For example, the CSS language definition
     * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
     * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
     * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
     * this:
     *
     * ```js
     * Prism.languages.markup.style = {
     *     // token
     * };
     * ```
     *
     * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
     * before existing tokens. For the CSS example above, you would use it like this:
     *
     * ```js
     * Prism.languages.insertBefore('markup', 'cdata', {
     *     'style': {
     *         // token
     *     }
     * });
     * ```
     *
     * ## Special cases
     *
     * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
     * will be ignored.
     *
     * This behavior can be used to insert tokens after `before`:
     *
     * ```js
     * Prism.languages.insertBefore('markup', 'comment', {
     *     'comment': Prism.languages.markup.comment,
     *     // tokens after 'comment'
     * });
     * ```
     *
     * ## Limitations
     *
     * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
     * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
     * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
     * deleting properties which is necessary to insert at arbitrary positions.
     *
     * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
     * Instead, it will create a new object and replace all references to the target object with the new one. This
     * can be done without temporarily deleting properties, so the iteration order is well-defined.
     *
     * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
     * you hold the target object in a variable, then the value of the variable will not change.
     *
     * ```js
     * var oldMarkup = Prism.languages.markup;
     * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
     *
     * assert(oldMarkup !== Prism.languages.markup);
     * assert(newMarkup === Prism.languages.markup);
     * ```
     *
     * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
     * object to be modified.
     * @param {string} before The key to insert before.
     * @param {Grammar} insert An object containing the key-value pairs to be inserted.
     * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
     * object to be modified.
     *
     * Defaults to `Prism.languages`.
     * @returns {Grammar} The new grammar object.
     * @public
     */
    insertBefore: function(i, e, t, n) {
      n = n || /** @type {any} */
      fc.languages;
      var r = n[i], s = {};
      for (var o in r)
        if (r.hasOwnProperty(o)) {
          if (o == e)
            for (var a in t)
              t.hasOwnProperty(a) && (s[a] = t[a]);
          t.hasOwnProperty(o) || (s[o] = r[o]);
        }
      var l = n[i];
      return n[i] = s, fc.languages.DFS(fc.languages, function(c, u) {
        u === l && c != i && (this[c] = s);
      }), s;
    },
    // Traverse a language definition with Depth First Search
    DFS: function i(e, t, n, r) {
      r = r || {};
      var s = fc.util.objId;
      for (var o in e)
        if (e.hasOwnProperty(o)) {
          t.call(e, o, e[o], n || o);
          var a = e[o], l = fc.util.type(a);
          l === "Object" && !r[s(a)] ? (r[s(a)] = !0, i(a, t, null, r)) : l === "Array" && !r[s(a)] && (r[s(a)] = !0, i(a, t, o, r));
        }
    }
  },
  plugins: {},
  /**
   * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
   * and the language definitions to use, and returns a string with the HTML produced.
   *
   * The following hooks will be run:
   * 1. `before-tokenize`
   * 2. `after-tokenize`
   * 3. `wrap`: On each {@link Token}.
   *
   * @param {string} text A string with the code to be highlighted.
   * @param {Grammar} grammar An object containing the tokens to use.
   *
   * Usually a language definition like `Prism.languages.markup`.
   * @param {string} language The name of the language definition passed to `grammar`.
   * @returns {string} The highlighted HTML.
   * @memberof Prism
   * @public
   * @example
   * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
   */
  highlight: function(i, e, t) {
    var n = {
      code: i,
      grammar: e,
      language: t
    };
    if (fc.hooks.run("before-tokenize", n), !n.grammar)
      throw new Error('The language "' + n.language + '" has no grammar.');
    return n.tokens = fc.tokenize(n.code, n.grammar), fc.hooks.run("after-tokenize", n), g3.stringify(fc.util.encode(n.tokens), n.language);
  },
  /**
   * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
   * and the language definitions to use, and returns an array with the tokenized code.
   *
   * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
   *
   * This method could be useful in other contexts as well, as a very crude parser.
   *
   * @param {string} text A string with the code to be highlighted.
   * @param {Grammar} grammar An object containing the tokens to use.
   *
   * Usually a language definition like `Prism.languages.markup`.
   * @returns {TokenStream} An array of strings and tokens, a token stream.
   * @memberof Prism
   * @public
   * @example
   * let code = `var foo = 0;`;
   * let tokens = Prism.tokenize(code, Prism.languages.javascript);
   * tokens.forEach(token => {
   *     if (token instanceof Prism.Token && token.type === 'number') {
   *         console.log(`Found numeric literal: ${token.content}`);
   *     }
   * });
   */
  tokenize: function(i, e) {
    var t = e.rest;
    if (t) {
      for (var n in t)
        e[n] = t[n];
      delete e.rest;
    }
    var r = new C4t();
    return eV(r, r.head, i), w7e(i, r, e, r.head, 0), S4t(r);
  },
  /**
   * @namespace
   * @memberof Prism
   * @public
   */
  hooks: {
    all: {},
    /**
     * Adds the given callback to the list of callbacks for the given hook.
     *
     * The callback will be invoked when the hook it is registered for is run.
     * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
     *
     * One callback function can be registered to multiple hooks and the same hook multiple times.
     *
     * @param {string} name The name of the hook.
     * @param {HookCallback} callback The callback function which is given environment variables.
     * @public
     */
    add: function(i, e) {
      var t = fc.hooks.all;
      t[i] = t[i] || [], t[i].push(e);
    },
    /**
     * Runs a hook invoking all registered callbacks with the given environment variables.
     *
     * Callbacks will be invoked synchronously and in the order in which they were registered.
     *
     * @param {string} name The name of the hook.
     * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
     * @public
     */
    run: function(i, e) {
      var t = fc.hooks.all[i];
      if (!(!t || !t.length))
        for (var n = 0, r; r = t[n++]; )
          r(e);
    }
  },
  Token: g3
};
function g3(i, e, t, n) {
  this.type = i, this.content = e, this.alias = t, this.length = (n || "").length | 0;
}
function $Re(i, e, t, n) {
  i.lastIndex = e;
  var r = i.exec(t);
  if (r && n && r[1]) {
    var s = r[1].length;
    r.index += s, r[0] = r[0].slice(s);
  }
  return r;
}
function w7e(i, e, t, n, r, s) {
  for (var o in t)
    if (!(!t.hasOwnProperty(o) || !t[o])) {
      var a = t[o];
      a = Array.isArray(a) ? a : [a];
      for (var l = 0; l < a.length; ++l) {
        if (s && s.cause == o + "," + l)
          return;
        var c = a[l], u = c.inside, d = !!c.lookbehind, h = !!c.greedy, g = c.alias;
        if (h && !c.pattern.global) {
          var m = c.pattern.toString().match(/[imsuy]*$/)[0];
          c.pattern = RegExp(c.pattern.source, m + "g");
        }
        for (var _ = c.pattern || c, v = n.next, w = r; v !== e.tail && !(s && w >= s.reach); w += v.value.length, v = v.next) {
          var E = v.value;
          if (e.length > i.length)
            return;
          if (!(E instanceof g3)) {
            var L = 1, T;
            if (h) {
              if (T = $Re(_, w, i, d), !T || T.index >= i.length)
                break;
              var M = T.index, D = T.index + T[0].length, N = w;
              for (N += v.value.length; M >= N; )
                v = v.next, N += v.value.length;
              if (N -= v.value.length, w = N, v.value instanceof g3)
                continue;
              for (var R = v; R !== e.tail && (N < D || typeof R.value == "string"); R = R.next)
                L++, N += R.value.length;
              L--, E = i.slice(w, N), T.index -= w;
            } else if (T = $Re(_, 0, E, d), !T)
              continue;
            var M = T.index, B = T[0], H = E.slice(0, M), j = E.slice(M + B.length), K = w + E.length;
            s && K > s.reach && (s.reach = K);
            var X = v.prev;
            H && (X = eV(e, X, H), w += H.length), w4t(e, X, L);
            var Y = new g3(
              o,
              u ? fc.tokenize(B, u) : B,
              g,
              B
            );
            if (v = eV(e, X, Y), j && eV(e, v, j), L > 1) {
              var G = {
                cause: o + "," + l,
                reach: K
              };
              w7e(
                i,
                e,
                t,
                v.prev,
                w,
                G
              ), s && G.reach > s.reach && (s.reach = G.reach);
            }
          }
        }
      }
    }
}
function C4t() {
  var i = { value: null, prev: null, next: null }, e = { value: null, prev: i, next: null };
  i.next = e, this.head = i, this.tail = e, this.length = 0;
}
function eV(i, e, t) {
  var n = e.next, r = { value: t, prev: e, next: n };
  return e.next = r, n.prev = r, i.length++, r;
}
function w4t(i, e, t) {
  for (var n = e.next, r = 0; r < t && n !== i.tail; r++)
    n = n.next;
  e.next = n, n.prev = e, i.length -= r;
}
function S4t(i) {
  for (var e = [], t = i.head.next; t !== i.tail; )
    e.push(t.value), t = t.next;
  return e;
}
const S7e = fc, v2 = {}.hasOwnProperty;
function E7e() {
}
E7e.prototype = S7e;
const ce = new E7e();
ce.highlight = E4t;
ce.register = x4t;
ce.alias = L4t;
ce.registered = T4t;
ce.listLanguages = k4t;
ce.util.encode = D4t;
ce.Token.stringify = ide;
function E4t(i, e) {
  if (typeof i != "string")
    throw new TypeError("Expected `string` for `value`, got `" + i + "`");
  let t, n;
  if (e && typeof e == "object")
    t = e;
  else {
    if (n = e, typeof n != "string")
      throw new TypeError("Expected `string` for `name`, got `" + n + "`");
    if (v2.call(ce.languages, n))
      t = ce.languages[n];
    else
      throw new Error("Unknown language: `" + n + "` is not registered");
  }
  return {
    type: "root",
    // @ts-expect-error: we hacked Prism to accept and return the things we want.
    children: S7e.highlight.call(ce, i, t, n)
  };
}
function x4t(i) {
  if (typeof i != "function" || !i.displayName)
    throw new Error("Expected `function` for `syntax`, got `" + i + "`");
  v2.call(ce.languages, i.displayName) || i(ce);
}
function L4t(i, e) {
  const t = ce.languages;
  let n = {};
  typeof i == "string" ? e && (n[i] = e) : n = i;
  let r;
  for (r in n)
    if (v2.call(n, r)) {
      const s = n[r], o = typeof s == "string" ? [s] : s;
      let a = -1;
      for (; ++a < o.length; )
        t[o[a]] = t[r];
    }
}
function T4t(i) {
  if (typeof i != "string")
    throw new TypeError(
      "Expected `string` for `aliasOrLanguage`, got `" + i + "`"
    );
  return v2.call(ce.languages, i);
}
function k4t() {
  const i = ce.languages, e = [];
  let t;
  for (t in i)
    v2.call(i, t) && typeof i[t] == "object" && e.push(t);
  return e;
}
function ide(i, e) {
  if (typeof i == "string")
    return { type: "text", value: i };
  if (Array.isArray(i)) {
    const n = [];
    let r = -1;
    for (; ++r < i.length; )
      i[r] !== null && i[r] !== void 0 && i[r] !== "" && n.push(ide(i[r], e));
    return n;
  }
  const t = {
    attributes: {},
    classes: ["token", i.type],
    content: ide(i.content, e),
    language: e,
    tag: "span",
    type: i.type
  };
  return i.alias && t.classes.push(
    ...typeof i.alias == "string" ? [i.alias] : i.alias
  ), ce.hooks.run("wrap", t), h4t(
    t.tag + "." + t.classes.join("."),
    I4t(t.attributes),
    t.content
  );
}
function D4t(i) {
  return i;
}
function I4t(i) {
  let e;
  for (e in i)
    v2.call(i, e) && (i[e] = _4t(i[e]));
  return i;
}
ce.register(Wr);
ce.register(Em);
ce.register(lk);
ce.register(iY);
ce.register(t6);
ce.register(ck);
ce.register(Nc);
ce.register(Rw);
ce.register(rY);
ce.register(sY);
ce.register(oY);
ce.register(uk);
ce.register(aY);
ce.register(_u);
ce.register(p2);
ce.register(lY);
ce.register(cY);
ce.register(n6);
ce.register(uY);
ce.register(i6);
ce.register(dY);
ce.register(hY);
ce.register(fY);
ce.register(bu);
ce.register(dk);
ce.register(r6);
ce.register(gY);
ce.register(hk);
ce.register(pY);
ce.register(mY);
ce.register(_Y);
ce.register(m2);
ce.register(bY);
ce.register(_2);
ce.register(s6);
ce.register(o6);
Pme.displayName = "abap";
Pme.aliases = [];
function Pme(i) {
  i.languages.abap = {
    comment: /^\*.*/m,
    string: /(`|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
    "string-template": {
      pattern: /([|}])(?:\\.|[^\\|{\r\n])*(?=[|{])/,
      lookbehind: !0,
      alias: "string"
    },
    /* End Of Line comments should not interfere with strings when the
    quote character occurs within them. We assume a string being highlighted
    inside an EOL comment is more acceptable than the opposite.
    */
    "eol-comment": {
      pattern: /(^|\s)".*/m,
      lookbehind: !0,
      alias: "comment"
    },
    keyword: {
      pattern: /(\s|\.|^)(?:\*-INPUT|\?TO|ABAP-SOURCE|ABBREVIATED|ABS|ABSTRACT|ACCEPT|ACCEPTING|ACCESSPOLICY|ACCORDING|ACOS|ACTIVATION|ACTUAL|ADD|ADD-CORRESPONDING|ADJACENT|AFTER|ALIAS|ALIASES|ALIGN|ALL|ALLOCATE|ALPHA|ANALYSIS|ANALYZER|AND|ANY|APPEND|APPENDAGE|APPENDING|APPLICATION|ARCHIVE|AREA|ARITHMETIC|AS|ASCENDING|ASIN|ASPECT|ASSERT|ASSIGN|ASSIGNED|ASSIGNING|ASSOCIATION|ASYNCHRONOUS|AT|ATAN|ATTRIBUTES|AUTHORITY|AUTHORITY-CHECK|AVG|BACK|BACKGROUND|BACKUP|BACKWARD|BADI|BASE|BEFORE|BEGIN|BETWEEN|BIG|BINARY|BINDING|BIT|BIT-AND|BIT-NOT|BIT-OR|BIT-XOR|BLACK|BLANK|BLANKS|BLOB|BLOCK|BLOCKS|BLUE|BOUND|BOUNDARIES|BOUNDS|BOXED|BREAK-POINT|BT|BUFFER|BY|BYPASSING|BYTE|BYTE-CA|BYTE-CN|BYTE-CO|BYTE-CS|BYTE-NA|BYTE-NS|BYTE-ORDER|C|CA|CALL|CALLING|CASE|CAST|CASTING|CATCH|CEIL|CENTER|CENTERED|CHAIN|CHAIN-INPUT|CHAIN-REQUEST|CHANGE|CHANGING|CHANNELS|CHAR-TO-HEX|CHARACTER|CHARLEN|CHECK|CHECKBOX|CIRCULAR|CI_|CLASS|CLASS-CODING|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|CLEANUP|CLEAR|CLIENT|CLOB|CLOCK|CLOSE|CN|CNT|CO|COALESCE|CODE|CODING|COLLECT|COLOR|COLUMN|COLUMNS|COL_BACKGROUND|COL_GROUP|COL_HEADING|COL_KEY|COL_NEGATIVE|COL_NORMAL|COL_POSITIVE|COL_TOTAL|COMMENT|COMMENTS|COMMIT|COMMON|COMMUNICATION|COMPARING|COMPONENT|COMPONENTS|COMPRESSION|COMPUTE|CONCAT|CONCATENATE|COND|CONDENSE|CONDITION|CONNECT|CONNECTION|CONSTANTS|CONTEXT|CONTEXTS|CONTINUE|CONTROL|CONTROLS|CONV|CONVERSION|CONVERT|COPIES|COPY|CORRESPONDING|COS|COSH|COUNT|COUNTRY|COVER|CP|CPI|CREATE|CREATING|CRITICAL|CS|CURRENCY|CURRENCY_CONVERSION|CURRENT|CURSOR|CURSOR-SELECTION|CUSTOMER|CUSTOMER-FUNCTION|DANGEROUS|DATA|DATABASE|DATAINFO|DATASET|DATE|DAYLIGHT|DBMAXLEN|DD\/MM\/YY|DD\/MM\/YYYY|DDMMYY|DEALLOCATE|DECIMALS|DECIMAL_SHIFT|DECLARATIONS|DEEP|DEFAULT|DEFERRED|DEFINE|DEFINING|DEFINITION|DELETE|DELETING|DEMAND|DEPARTMENT|DESCENDING|DESCRIBE|DESTINATION|DETAIL|DIALOG|DIRECTORY|DISCONNECT|DISPLAY|DISPLAY-MODE|DISTANCE|DISTINCT|DIV|DIVIDE|DIVIDE-CORRESPONDING|DIVISION|DO|DUMMY|DUPLICATE|DUPLICATES|DURATION|DURING|DYNAMIC|DYNPRO|E|EACH|EDIT|EDITOR-CALL|ELSE|ELSEIF|EMPTY|ENABLED|ENABLING|ENCODING|END|END-ENHANCEMENT-SECTION|END-LINES|END-OF-DEFINITION|END-OF-FILE|END-OF-PAGE|END-OF-SELECTION|ENDAT|ENDCASE|ENDCATCH|ENDCHAIN|ENDCLASS|ENDDO|ENDENHANCEMENT|ENDEXEC|ENDFOR|ENDFORM|ENDFUNCTION|ENDIAN|ENDIF|ENDING|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDON|ENDPROVIDE|ENDSELECT|ENDTRY|ENDWHILE|ENGINEERING|ENHANCEMENT|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|ENHANCEMENTS|ENTRIES|ENTRY|ENVIRONMENT|EQ|EQUAL|EQUIV|ERRORMESSAGE|ERRORS|ESCAPE|ESCAPING|EVENT|EVENTS|EXACT|EXCEPT|EXCEPTION|EXCEPTION-TABLE|EXCEPTIONS|EXCLUDE|EXCLUDING|EXEC|EXECUTE|EXISTS|EXIT|EXIT-COMMAND|EXP|EXPAND|EXPANDING|EXPIRATION|EXPLICIT|EXPONENT|EXPORT|EXPORTING|EXTEND|EXTENDED|EXTENSION|EXTRACT|FAIL|FETCH|FIELD|FIELD-GROUPS|FIELD-SYMBOL|FIELD-SYMBOLS|FIELDS|FILE|FILTER|FILTER-TABLE|FILTERS|FINAL|FIND|FIRST|FIRST-LINE|FIXED-POINT|FKEQ|FKGE|FLOOR|FLUSH|FONT|FOR|FORM|FORMAT|FORWARD|FOUND|FRAC|FRAME|FRAMES|FREE|FRIENDS|FROM|FUNCTION|FUNCTION-POOL|FUNCTIONALITY|FURTHER|GAPS|GE|GENERATE|GET|GIVING|GKEQ|GKGE|GLOBAL|GRANT|GREATER|GREEN|GROUP|GROUPS|GT|HANDLE|HANDLER|HARMLESS|HASHED|HAVING|HDB|HEAD-LINES|HEADER|HEADERS|HEADING|HELP-ID|HELP-REQUEST|HIDE|HIGH|HINT|HOLD|HOTSPOT|I|ICON|ID|IDENTIFICATION|IDENTIFIER|IDS|IF|IGNORE|IGNORING|IMMEDIATELY|IMPLEMENTATION|IMPLEMENTATIONS|IMPLEMENTED|IMPLICIT|IMPORT|IMPORTING|IN|INACTIVE|INCL|INCLUDE|INCLUDES|INCLUDING|INCREMENT|INDEX|INDEX-LINE|INFOTYPES|INHERITING|INIT|INITIAL|INITIALIZATION|INNER|INOUT|INPUT|INSERT|INSTANCES|INTENSIFIED|INTERFACE|INTERFACE-POOL|INTERFACES|INTERNAL|INTERVALS|INTO|INVERSE|INVERTED-DATE|IS|ISO|ITERATOR|ITNO|JOB|JOIN|KEEP|KEEPING|KERNEL|KEY|KEYS|KEYWORDS|KIND|LANGUAGE|LAST|LATE|LAYOUT|LE|LEADING|LEAVE|LEFT|LEFT-JUSTIFIED|LEFTPLUS|LEFTSPACE|LEGACY|LENGTH|LESS|LET|LEVEL|LEVELS|LIKE|LINE|LINE-COUNT|LINE-SELECTION|LINE-SIZE|LINEFEED|LINES|LIST|LIST-PROCESSING|LISTBOX|LITTLE|LLANG|LOAD|LOAD-OF-PROGRAM|LOB|LOCAL|LOCALE|LOCATOR|LOG|LOG-POINT|LOG10|LOGFILE|LOGICAL|LONG|LOOP|LOW|LOWER|LPAD|LPI|LT|M|MAIL|MAIN|MAJOR-ID|MAPPING|MARGIN|MARK|MASK|MATCH|MATCHCODE|MAX|MAXIMUM|MEDIUM|MEMBERS|MEMORY|MESH|MESSAGE|MESSAGE-ID|MESSAGES|MESSAGING|METHOD|METHODS|MIN|MINIMUM|MINOR-ID|MM\/DD\/YY|MM\/DD\/YYYY|MMDDYY|MOD|MODE|MODIF|MODIFIER|MODIFY|MODULE|MOVE|MOVE-CORRESPONDING|MULTIPLY|MULTIPLY-CORRESPONDING|NA|NAME|NAMETAB|NATIVE|NB|NE|NESTED|NESTING|NEW|NEW-LINE|NEW-PAGE|NEW-SECTION|NEXT|NO|NO-DISPLAY|NO-EXTENSION|NO-GAP|NO-GAPS|NO-GROUPING|NO-HEADING|NO-SCROLLING|NO-SIGN|NO-TITLE|NO-TOPOFPAGE|NO-ZERO|NODE|NODES|NON-UNICODE|NON-UNIQUE|NOT|NP|NS|NULL|NUMBER|NUMOFCHAR|O|OBJECT|OBJECTS|OBLIGATORY|OCCURRENCE|OCCURRENCES|OCCURS|OF|OFF|OFFSET|OLE|ON|ONLY|OPEN|OPTION|OPTIONAL|OPTIONS|OR|ORDER|OTHER|OTHERS|OUT|OUTER|OUTPUT|OUTPUT-LENGTH|OVERFLOW|OVERLAY|PACK|PACKAGE|PAD|PADDING|PAGE|PAGES|PARAMETER|PARAMETER-TABLE|PARAMETERS|PART|PARTIALLY|PATTERN|PERCENTAGE|PERFORM|PERFORMING|PERSON|PF|PF-STATUS|PINK|PLACES|POOL|POSITION|POS_HIGH|POS_LOW|PRAGMAS|PRECOMPILED|PREFERRED|PRESERVING|PRIMARY|PRINT|PRINT-CONTROL|PRIORITY|PRIVATE|PROCEDURE|PROCESS|PROGRAM|PROPERTY|PROTECTED|PROVIDE|PUBLIC|PUSHBUTTON|PUT|QUEUE-ONLY|QUICKINFO|RADIOBUTTON|RAISE|RAISING|RANGE|RANGES|RAW|READ|READ-ONLY|READER|RECEIVE|RECEIVED|RECEIVER|RECEIVING|RED|REDEFINITION|REDUCE|REDUCED|REF|REFERENCE|REFRESH|REGEX|REJECT|REMOTE|RENAMING|REPLACE|REPLACEMENT|REPLACING|REPORT|REQUEST|REQUESTED|RESERVE|RESET|RESOLUTION|RESPECTING|RESPONSIBLE|RESULT|RESULTS|RESUMABLE|RESUME|RETRY|RETURN|RETURNCODE|RETURNING|RIGHT|RIGHT-JUSTIFIED|RIGHTPLUS|RIGHTSPACE|RISK|RMC_COMMUNICATION_FAILURE|RMC_INVALID_STATUS|RMC_SYSTEM_FAILURE|ROLE|ROLLBACK|ROUND|ROWS|RTTI|RUN|SAP|SAP-SPOOL|SAVING|SCALE_PRESERVING|SCALE_PRESERVING_SCIENTIFIC|SCAN|SCIENTIFIC|SCIENTIFIC_WITH_LEADING_ZERO|SCREEN|SCROLL|SCROLL-BOUNDARY|SCROLLING|SEARCH|SECONDARY|SECONDS|SECTION|SELECT|SELECT-OPTIONS|SELECTION|SELECTION-SCREEN|SELECTION-SET|SELECTION-SETS|SELECTION-TABLE|SELECTIONS|SELECTOR|SEND|SEPARATE|SEPARATED|SET|SHARED|SHIFT|SHORT|SHORTDUMP-ID|SIGN|SIGN_AS_POSTFIX|SIMPLE|SIN|SINGLE|SINH|SIZE|SKIP|SKIPPING|SMART|SOME|SORT|SORTABLE|SORTED|SOURCE|SPACE|SPECIFIED|SPLIT|SPOOL|SPOTS|SQL|SQLSCRIPT|SQRT|STABLE|STAMP|STANDARD|START-OF-SELECTION|STARTING|STATE|STATEMENT|STATEMENTS|STATIC|STATICS|STATUSINFO|STEP-LOOP|STOP|STRLEN|STRUCTURE|STRUCTURES|STYLE|SUBKEY|SUBMATCHES|SUBMIT|SUBROUTINE|SUBSCREEN|SUBSTRING|SUBTRACT|SUBTRACT-CORRESPONDING|SUFFIX|SUM|SUMMARY|SUMMING|SUPPLIED|SUPPLY|SUPPRESS|SWITCH|SWITCHSTATES|SYMBOL|SYNCPOINTS|SYNTAX|SYNTAX-CHECK|SYNTAX-TRACE|SYSTEM-CALL|SYSTEM-EXCEPTIONS|SYSTEM-EXIT|TAB|TABBED|TABLE|TABLES|TABLEVIEW|TABSTRIP|TAN|TANH|TARGET|TASK|TASKS|TEST|TESTING|TEXT|TEXTPOOL|THEN|THROW|TIME|TIMES|TIMESTAMP|TIMEZONE|TITLE|TITLE-LINES|TITLEBAR|TO|TOKENIZATION|TOKENS|TOP-LINES|TOP-OF-PAGE|TRACE-FILE|TRACE-TABLE|TRAILING|TRANSACTION|TRANSFER|TRANSFORMATION|TRANSLATE|TRANSPORTING|TRMAC|TRUNC|TRUNCATE|TRUNCATION|TRY|TYPE|TYPE-POOL|TYPE-POOLS|TYPES|ULINE|UNASSIGN|UNDER|UNICODE|UNION|UNIQUE|UNIT|UNIT_CONVERSION|UNIX|UNPACK|UNTIL|UNWIND|UP|UPDATE|UPPER|USER|USER-COMMAND|USING|UTF-8|VALID|VALUE|VALUE-REQUEST|VALUES|VARY|VARYING|VERIFICATION-MESSAGE|VERSION|VIA|VIEW|VISIBLE|WAIT|WARNING|WHEN|WHENEVER|WHERE|WHILE|WIDTH|WINDOW|WINDOWS|WITH|WITH-HEADING|WITH-TITLE|WITHOUT|WORD|WORK|WRITE|WRITER|X|XML|XOR|XSD|XSTRLEN|YELLOW|YES|YYMMDD|Z|ZERO|ZONE)(?![\w-])/i,
      lookbehind: !0
    },
    /* Numbers can be only integers. Decimal or Hex appear only as strings */
    number: /\b\d+\b/,
    /* Operators must always be surrounded by whitespace, they cannot be put
    adjacent to operands.
    */
    operator: {
      pattern: /(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/,
      lookbehind: !0
    },
    "string-operator": {
      pattern: /(\s)&&?(?=\s)/,
      lookbehind: !0,
      /* The official editor highlights */
      alias: "keyword"
    },
    "token-operator": [
      {
        /* Special operators used to access structure components, class methods/attributes, etc. */
        pattern: /(\w)(?:->?|=>|[~|{}])(?=\w)/,
        lookbehind: !0,
        alias: "punctuation"
      },
      {
        /* Special tokens used do delimit string templates */
        pattern: /[|{}]/,
        alias: "punctuation"
      }
    ],
    punctuation: /[,.:()]/
  };
}
Fme.displayName = "abnf";
Fme.aliases = [];
function Fme(i) {
  (function(e) {
    var t = "(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)";
    e.languages.abnf = {
      comment: /;.*/,
      string: {
        pattern: /(?:%[is])?"[^"\n\r]*"/,
        greedy: !0,
        inside: {
          punctuation: /^%[is]/
        }
      },
      range: {
        pattern: /%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i,
        alias: "number"
      },
      terminal: {
        pattern: /%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i,
        alias: "number"
      },
      repetition: {
        pattern: /(^|[^\w-])(?:\d*\*\d*|\d+)/,
        lookbehind: !0,
        alias: "operator"
      },
      definition: {
        pattern: /(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m,
        lookbehind: !0,
        alias: "keyword",
        inside: {
          punctuation: /<|>/
        }
      },
      "core-rule": {
        pattern: RegExp(
          "(?:(^|[^<\\w-])" + t + "|<" + t + ">)(?![\\w-])",
          "i"
        ),
        lookbehind: !0,
        alias: ["rule", "constant"],
        inside: {
          punctuation: /<|>/
        }
      },
      rule: {
        pattern: /(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i,
        lookbehind: !0,
        inside: {
          punctuation: /<|>/
        }
      },
      operator: /=\/?|\//,
      punctuation: /[()\[\]]/
    };
  })(i);
}
Bme.displayName = "actionscript";
Bme.aliases = [];
function Bme(i) {
  i.register(_u), i.languages.actionscript = i.languages.extend("javascript", {
    keyword: /\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,
    operator: /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
  }), i.languages.actionscript["class-name"].alias = "function", delete i.languages.actionscript.parameter, delete i.languages.actionscript["literal-property"], i.languages.markup && i.languages.insertBefore("actionscript", "string", {
    xml: {
      pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,
      lookbehind: !0,
      inside: i.languages.markup
    }
  });
}
Hme.displayName = "ada";
Hme.aliases = [];
function Hme(i) {
  i.languages.ada = {
    comment: /--.*/,
    string: /"(?:""|[^"\r\f\n])*"/,
    number: [
      {
        pattern: /\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i
      },
      {
        pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i
      }
    ],
    attribute: {
      pattern: /\b'\w+/,
      alias: "attr-name"
    },
    keyword: /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,
    boolean: /\b(?:false|true)\b/i,
    operator: /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,
    punctuation: /\.\.?|[,;():]/,
    char: /'.'/,
    variable: /\b[a-z](?:\w)*\b/i
  };
}
Wme.displayName = "agda";
Wme.aliases = [];
function Wme(i) {
  (function(e) {
    e.languages.agda = {
      comment: /\{-[\s\S]*?(?:-\}|$)|--.*/,
      string: {
        pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
        greedy: !0
      },
      punctuation: /[(){}⦃⦄.;@]/,
      "class-name": {
        pattern: /((?:data|record) +)\S+/,
        lookbehind: !0
      },
      function: {
        pattern: /(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m,
        lookbehind: !0
      },
      operator: {
        pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/,
        lookbehind: !0
      },
      keyword: /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/
    };
  })(i);
}
Vme.displayName = "al";
Vme.aliases = [];
function Vme(i) {
  i.languages.al = {
    comment: /\/\/.*|\/\*[\s\S]*?\*\//,
    string: {
      pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,
      greedy: !0
    },
    function: {
      pattern: /(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i,
      lookbehind: !0
    },
    keyword: [
      // keywords
      /\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i,
      // objects and metadata that are used like keywords
      /\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i
    ],
    number: /\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|LL?|U(?:LL?)?)?\b/i,
    boolean: /\b(?:false|true)\b/i,
    variable: /\b(?:Curr(?:FieldNo|Page|Report)|x?Rec|RequestOptionsPage)\b/,
    "class-name": /\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i,
    operator: /\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i,
    punctuation: /[()\[\]{}:.;,]/
  };
}
Ume.displayName = "antlr4";
Ume.aliases = ["g4"];
function Ume(i) {
  i.languages.antlr4 = {
    comment: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
    string: {
      pattern: /'(?:\\.|[^\\'\r\n])*'/,
      greedy: !0
    },
    "character-class": {
      pattern: /\[(?:\\.|[^\\\]\r\n])*\]/,
      greedy: !0,
      alias: "regex",
      inside: {
        range: {
          pattern: /([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/,
          lookbehind: !0,
          alias: "punctuation"
        },
        escape: /\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/,
        punctuation: /[\[\]]/
      }
    },
    action: {
      pattern: /\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/,
      greedy: !0,
      inside: {
        content: {
          // this might be C, C++, Python, Java, C#, or any other language ANTLR4 compiles to
          pattern: /(\{)[\s\S]+(?=\})/,
          lookbehind: !0
        },
        punctuation: /[{}]/
      }
    },
    command: {
      pattern: /(->\s*(?!\s))(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,
      lookbehind: !0,
      inside: {
        function: /\b\w+(?=\s*(?:[,(]|$))/,
        punctuation: /[,()]/
      }
    },
    annotation: {
      pattern: /@\w+(?:::\w+)*/,
      alias: "keyword"
    },
    label: {
      pattern: /#[ \t]*\w+/,
      alias: "punctuation"
    },
    keyword: /\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/,
    definition: [
      {
        pattern: /\b[a-z]\w*(?=\s*:)/,
        alias: ["rule", "class-name"]
      },
      {
        pattern: /\b[A-Z]\w*(?=\s*:)/,
        alias: ["token", "constant"]
      }
    ],
    constant: /\b[A-Z][A-Z_]*\b/,
    operator: /\.\.|->|[|~]|[*+?]\??/,
    punctuation: /[;:()=]/
  }, i.languages.g4 = i.languages.antlr4;
}
zme.displayName = "apacheconf";
zme.aliases = [];
function zme(i) {
  i.languages.apacheconf = {
    comment: /#.*/,
    "directive-inline": {
      pattern: /(^[\t ]*)\b(?:AcceptFilter|AcceptPathInfo|AccessFileName|Action|Add(?:Alt|AltByEncoding|AltByType|Charset|DefaultCharset|Description|Encoding|Handler|Icon|IconByEncoding|IconByType|InputFilter|Language|ModuleInfo|OutputFilter|OutputFilterByType|Type)|Alias|AliasMatch|Allow(?:CONNECT|EncodedSlashes|Methods|Override|OverrideList)?|Anonymous(?:_LogEmail|_MustGiveEmail|_NoUserID|_VerifyEmail)?|AsyncRequestWorkerFactor|Auth(?:BasicAuthoritative|BasicFake|BasicProvider|BasicUseDigestAlgorithm|DBDUserPWQuery|DBDUserRealmQuery|DBMGroupFile|DBMType|DBMUserFile|Digest(?:Algorithm|Domain|NonceLifetime|Provider|Qop|ShmemSize)|Form(?:Authoritative|Body|DisableNoStore|FakeBasicAuth|Location|LoginRequiredLocation|LoginSuccessLocation|LogoutLocation|Method|Mimetype|Password|Provider|SitePassphrase|Size|Username)|GroupFile|LDAP(?:AuthorizePrefix|BindAuthoritative|BindDN|BindPassword|CharsetConfig|CompareAsUser|CompareDNOnServer|DereferenceAliases|GroupAttribute|GroupAttributeIsDN|InitialBindAsUser|InitialBindPattern|MaxSubGroupDepth|RemoteUserAttribute|RemoteUserIsDN|SearchAsUser|SubGroupAttribute|SubGroupClass|Url)|Merging|Name|nCache(?:Context|Enable|ProvideFor|SOCache|Timeout)|nzFcgiCheckAuthnProvider|nzFcgiDefineProvider|Type|UserFile|zDBDLoginToReferer|zDBDQuery|zDBDRedirectQuery|zDBMType|zSendForbiddenOnFailure)|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|Cache(?:DefaultExpire|DetailHeader|DirLength|DirLevels|Disable|Enable|File|Header|IgnoreCacheControl|IgnoreHeaders|IgnoreNoLastMod|IgnoreQueryString|IgnoreURLSessionIdentifiers|KeyBaseURL|LastModifiedFactor|Lock|LockMaxAge|LockPath|MaxExpire|MaxFileSize|MinExpire|MinFileSize|NegotiatedDocs|QuickHandler|ReadSize|ReadTime|Root|Socache(?:MaxSize|MaxTime|MinTime|ReadSize|ReadTime)?|StaleOnError|StoreExpired|StoreNoStore|StorePrivate)|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|Deflate(?:BufferSize|CompressionLevel|FilterNote|InflateLimitRequestBody|InflateRatio(?:Burst|Limit)|MemLevel|WindowSize)|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|Heartbeat(?:Address|Listen|MaxServers|Storage)|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|Index(?:HeadInsert|Ignore|IgnoreReset|Options|OrderDefault|StyleSheet)|InputSed|ISAPI(?:AppendLogToErrors|AppendLogToQuery|CacheFile|FakeAsync|LogNotSupported|ReadAheadBuffer)|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAP(?:CacheEntries|CacheTTL|ConnectionPoolTTL|ConnectionTimeout|LibraryDebug|OpCacheEntries|OpCacheTTL|ReferralHopLimit|Referrals|Retries|RetryDelay|SharedCacheFile|SharedCacheSize|Timeout|TrustedClientCert|TrustedGlobalCert|TrustedMode|VerifyServerCert)|Limit(?:InternalRecursion|Request(?:Body|Fields|FieldSize|Line)|XMLRequestBody)|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|Lua(?:Hook(?:AccessChecker|AuthChecker|CheckUserID|Fixups|InsertFilter|Log|MapToStorage|TranslateName|TypeChecker)|Inherit|InputFilter|MapHandler|OutputFilter|PackageCPath|PackagePath|QuickHandler|Root|Scope)|Max(?:ConnectionsPerChild|KeepAliveRequests|MemFree|RangeOverlaps|RangeReversals|Ranges|RequestWorkers|SpareServers|SpareThreads|Threads)|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|Proxy(?:AddHeaders|BadHeader|Block|Domain|ErrorOverride|ExpressDBMFile|ExpressDBMType|ExpressEnable|FtpDirCharset|FtpEscapeWildcards|FtpListOnWildcard|HTML(?:BufSize|CharsetOut|DocType|Enable|Events|Extended|Fixups|Interp|Links|Meta|StripComments|URLMap)|IOBufferSize|MaxForwards|Pass(?:Inherit|InterpolateEnv|Match|Reverse|ReverseCookieDomain|ReverseCookiePath)?|PreserveHost|ReceiveBufferSize|Remote|RemoteMatch|Requests|SCGIInternalRedirect|SCGISendfile|Set|SourceAddress|Status|Timeout|Via)|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIP(?:Header|InternalProxy|InternalProxyList|ProxiesHeader|TrustedProxy|TrustedProxyList)|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|Rewrite(?:Base|Cond|Engine|Map|Options|Rule)|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script(?:Alias|AliasMatch|InterpreterSource|Log|LogBuffer|LogLength|Sock)?|SecureListen|SeeRequestTail|SendBufferSize|Server(?:Admin|Alias|Limit|Name|Path|Root|Signature|Tokens)|Session(?:Cookie(?:Name|Name2|Remove)|Crypto(?:Cipher|Driver|Passphrase|PassphraseFile)|DBD(?:CookieName|CookieName2|CookieRemove|DeleteLabel|InsertLabel|PerUser|SelectLabel|UpdateLabel)|Env|Exclude|Header|Include|MaxAge)?|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSL(?:CACertificateFile|CACertificatePath|CADNRequestFile|CADNRequestPath|CARevocationCheck|CARevocationFile|CARevocationPath|CertificateChainFile|CertificateFile|CertificateKeyFile|CipherSuite|Compression|CryptoDevice|Engine|FIPS|HonorCipherOrder|InsecureRenegotiation|OCSP(?:DefaultResponder|Enable|OverrideResponder|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|UseRequestNonce)|OpenSSLConfCmd|Options|PassPhraseDialog|Protocol|Proxy(?:CACertificateFile|CACertificatePath|CARevocation(?:Check|File|Path)|CheckPeer(?:CN|Expire|Name)|CipherSuite|Engine|MachineCertificate(?:ChainFile|File|Path)|Protocol|Verify|VerifyDepth)|RandomSeed|RenegBufferSize|Require|RequireSSL|Session(?:Cache|CacheTimeout|TicketKeyFile|Tickets)|SRPUnknownUserSeed|SRPVerifierFile|Stapling(?:Cache|ErrorCacheTimeout|FakeTryLater|ForceURL|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|ReturnResponderErrors|StandardCacheTimeout)|StrictSNIVHostCheck|UserName|UseStapling|VerifyClient|VerifyDepth)|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|Virtual(?:DocumentRoot|ScriptAlias)(?:IP)?|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im,
      lookbehind: !0,
      alias: "property"
    },
    "directive-block": {
      pattern: /<\/?\b(?:Auth[nz]ProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|Require(?:All|Any|None)|VirtualHost)\b.*>/i,
      inside: {
        "directive-block": {
          pattern: /^<\/?\w+/,
          inside: {
            punctuation: /^<\/?/
          },
          alias: "tag"
        },
        "directive-block-parameter": {
          pattern: /.*[^>]/,
          inside: {
            punctuation: /:/,
            string: {
              pattern: /("|').*\1/,
              inside: {
                variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/
              }
            }
          },
          alias: "attr-value"
        },
        punctuation: />/
      },
      alias: "tag"
    },
    "directive-flags": {
      pattern: /\[(?:[\w=],?)+\]/,
      alias: "keyword"
    },
    string: {
      pattern: /("|').*\1/,
      inside: {
        variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/
      }
    },
    variable: /[$%]\{?(?:\w\.?[-+:]?)+\}?/,
    regex: /\^?.*\$|\^.*\$?/
  };
}
$me.displayName = "apex";
$me.aliases = [];
function $me(i) {
  i.register(Wr), i.register(m2), (function(e) {
    var t = /\b(?:(?:after|before)(?=\s+[a-z])|abstract|activate|and|any|array|as|asc|autonomous|begin|bigdecimal|blob|boolean|break|bulk|by|byte|case|cast|catch|char|class|collect|commit|const|continue|currency|date|datetime|decimal|default|delete|desc|do|double|else|end|enum|exception|exit|export|extends|final|finally|float|for|from|get(?=\s*[{};])|global|goto|group|having|hint|if|implements|import|in|inner|insert|instanceof|int|integer|interface|into|join|like|limit|list|long|loop|map|merge|new|not|null|nulls|number|object|of|on|or|outer|override|package|parallel|pragma|private|protected|public|retrieve|return|rollback|select|set|short|sObject|sort|static|string|super|switch|synchronized|system|testmethod|then|this|throw|time|transaction|transient|trigger|try|undelete|update|upsert|using|virtual|void|webservice|when|where|while|(?:inherited|with|without)\s+sharing)\b/i, n = /\b(?:(?=[a-z_]\w*\s*[<\[])|(?!<keyword>))[A-Z_]\w*(?:\s*\.\s*[A-Z_]\w*)*\b(?:\s*(?:\[\s*\]|<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>))*/.source.replace(
      /<keyword>/g,
      function() {
        return t.source;
      }
    );
    function r(o) {
      return RegExp(
        o.replace(/<CLASS-NAME>/g, function() {
          return n;
        }),
        "i"
      );
    }
    var s = {
      keyword: t,
      punctuation: /[()\[\]{};,:.<>]/
    };
    e.languages.apex = {
      comment: e.languages.clike.comment,
      string: e.languages.clike.string,
      sql: {
        pattern: /((?:[=,({:]|\breturn)\s*)\[[^\[\]]*\]/i,
        lookbehind: !0,
        greedy: !0,
        alias: "language-sql",
        inside: e.languages.sql
      },
      annotation: {
        pattern: /@\w+\b/,
        alias: "punctuation"
      },
      "class-name": [
        {
          pattern: r(
            /(\b(?:class|enum|extends|implements|instanceof|interface|new|trigger\s+\w+\s+on)\s+)<CLASS-NAME>/.source
          ),
          lookbehind: !0,
          inside: s
        },
        {
          // cast
          pattern: r(
            /(\(\s*)<CLASS-NAME>(?=\s*\)\s*[\w(])/.source
          ),
          lookbehind: !0,
          inside: s
        },
        {
          // variable/parameter declaration and return types
          pattern: r(/<CLASS-NAME>(?=\s*\w+\s*[;=,(){:])/.source),
          inside: s
        }
      ],
      trigger: {
        pattern: /(\btrigger\s+)\w+\b/i,
        lookbehind: !0,
        alias: "class-name"
      },
      keyword: t,
      function: /\b[a-z_]\w*(?=\s*\()/i,
      boolean: /\b(?:false|true)\b/i,
      number: /(?:\B\.\d+|\b\d+(?:\.\d+|L)?)\b/i,
      operator: /[!=](?:==?)?|\?\.?|&&|\|\||--|\+\+|[-+*/^&|]=?|:|<<?=?|>{1,3}=?/,
      punctuation: /[()\[\]{};,.]/
    };
  })(i);
}
jme.displayName = "apl";
jme.aliases = [];
function jme(i) {
  i.languages.apl = {
    comment: /(?:⍝|#[! ]).*$/m,
    string: {
      pattern: /'(?:[^'\r\n]|'')*'/,
      greedy: !0
    },
    number: /¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i,
    statement: /:[A-Z][a-z][A-Za-z]*\b/,
    "system-function": {
      pattern: /⎕[A-Z]+/i,
      alias: "function"
    },
    constant: /[⍬⌾#⎕⍞]/,
    function: /[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,
    "monadic-operator": {
      pattern: /[\\\/⌿⍀¨⍨⌶&∥]/,
      alias: "operator"
    },
    "dyadic-operator": {
      pattern: /[.⍣⍠⍤∘⌸@⌺⍥]/,
      alias: "operator"
    },
    assignment: {
      pattern: /←/,
      alias: "keyword"
    },
    punctuation: /[\[;\]()◇⋄]/,
    dfn: {
      pattern: /[{}⍺⍵⍶⍹∇⍫:]/,
      alias: "builtin"
    }
  };
}
Gme.displayName = "applescript";
Gme.aliases = [];
function Gme(i) {
  i.languages.applescript = {
    comment: [
      // Allow one level of nesting
      /\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,
      /--.+/,
      /#.+/
    ],
    string: /"(?:\\.|[^"\\\r\n])*"/,
    number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?\b/i,
    operator: [
      /[&=≠≤≥*+\-\/÷^]|[<>]=?/,
      /\b(?:(?:begin|end|start)s? with|(?:contains?|(?:does not|doesn't) contain)|(?:is|isn't|is not) (?:contained by|in)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:comes|(?:does not|doesn't) come) (?:after|before)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equal to|equals|is not|isn't)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|as|div|mod|not|or))\b/
    ],
    keyword: /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,
    "class-name": /\b(?:POSIX file|RGB color|alias|application|boolean|centimeters|centimetres|class|constant|cubic centimeters|cubic centimetres|cubic feet|cubic inches|cubic meters|cubic metres|cubic yards|date|degrees Celsius|degrees Fahrenheit|degrees Kelvin|feet|file|gallons|grams|inches|integer|kilograms|kilometers|kilometres|list|liters|litres|meters|metres|miles|number|ounces|pounds|quarts|real|record|reference|script|square feet|square kilometers|square kilometres|square meters|square metres|square miles|square yards|text|yards)\b/,
    punctuation: /[{}():,¬«»《》]/
  };
}
qme.displayName = "aql";
qme.aliases = [];
function qme(i) {
  i.languages.aql = {
    comment: /\/\/.*|\/\*[\s\S]*?\*\//,
    property: {
      pattern: /([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/,
      lookbehind: !0,
      greedy: !0
    },
    string: {
      pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\.)*\1/,
      greedy: !0
    },
    identifier: {
      pattern: /([´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,
      greedy: !0
    },
    variable: /@@?\w+/,
    keyword: [
      {
        pattern: /(\bWITH\s+)COUNT(?=\s+INTO\b)/i,
        lookbehind: !0
      },
      /\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|WITH)\b/i,
      // pseudo keywords get a lookbehind to avoid false positives
      {
        pattern: /(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i,
        lookbehind: !0
      },
      {
        pattern: /(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/,
        lookbehind: !0
      },
      {
        pattern: /\bOPTIONS(?=\s*\{)/i
      }
    ],
    function: /\b(?!\d)\w+(?=\s*\()/,
    boolean: /\b(?:false|true)\b/i,
    range: {
      pattern: /\.\./,
      alias: "operator"
    },
    number: [
      /\b0b[01]+/i,
      /\b0x[0-9a-f]+/i,
      /(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i
    ],
    operator: /\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/,
    punctuation: /::|[?.:,;()[\]{}]/
  };
}
Kme.displayName = "arff";
Kme.aliases = [];
function Kme(i) {
  i.languages.arff = {
    comment: /%.*/,
    string: {
      pattern: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    keyword: /@(?:attribute|data|end|relation)\b/i,
    number: /\b\d+(?:\.\d+)?\b/,
    punctuation: /[{},]/
  };
}
Yme.displayName = "armasm";
Yme.aliases = ["arm-asm"];
function Yme(i) {
  i.languages.armasm = {
    comment: {
      pattern: /;.*/,
      greedy: !0
    },
    string: {
      pattern: /"(?:[^"\r\n]|"")*"/,
      greedy: !0,
      inside: {
        variable: {
          pattern: /((?:^|[^$])(?:\${2})*)\$\w+/,
          lookbehind: !0
        }
      }
    },
    char: {
      pattern: /'(?:[^'\r\n]{0,4}|'')'/,
      greedy: !0
    },
    "version-symbol": {
      pattern: /\|[\w@]+\|/,
      greedy: !0,
      alias: "property"
    },
    boolean: /\b(?:FALSE|TRUE)\b/,
    directive: {
      pattern: /\b(?:ALIAS|ALIGN|AREA|ARM|ASSERT|ATTR|CN|CODE|CODE16|CODE32|COMMON|CP|DATA|DCB|DCD|DCDO|DCDU|DCFD|DCFDU|DCI|DCQ|DCQU|DCW|DCWU|DN|ELIF|ELSE|END|ENDFUNC|ENDIF|ENDP|ENTRY|EQU|EXPORT|EXPORTAS|EXTERN|FIELD|FILL|FN|FUNCTION|GBLA|GBLL|GBLS|GET|GLOBAL|IF|IMPORT|INCBIN|INCLUDE|INFO|KEEP|LCLA|LCLL|LCLS|LTORG|MACRO|MAP|MEND|MEXIT|NOFP|OPT|PRESERVE8|PROC|QN|READONLY|RELOC|REQUIRE|REQUIRE8|RLIST|ROUT|SETA|SETL|SETS|SN|SPACE|SUBT|THUMB|THUMBX|TTL|WEND|WHILE)\b/,
      alias: "property"
    },
    instruction: {
      pattern: /((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/,
      lookbehind: !0,
      alias: "keyword"
    },
    variable: /\$\w+/,
    number: /(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i,
    register: {
      pattern: /\b(?:r\d|lr)\b/,
      alias: "symbol"
    },
    operator: /<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/,
    punctuation: /[()[\],]/
  }, i.languages["arm-asm"] = i.languages.armasm;
}
Xme.displayName = "arturo";
Xme.aliases = ["art"];
function Xme(i) {
  (function(e) {
    var t = function(n, r) {
      return {
        pattern: RegExp(
          /\{!/.source + "(?:" + (r || n) + ")" + /$[\s\S]*\}/.source,
          "m"
        ),
        greedy: !0,
        inside: {
          embedded: {
            pattern: /(^\{!\w+\b)[\s\S]+(?=\}$)/,
            lookbehind: !0,
            alias: "language-" + n,
            inside: e.languages[n]
          },
          string: /[\s\S]+/
        }
      };
    };
    e.languages.arturo = {
      comment: {
        pattern: /;.*/,
        greedy: !0
      },
      character: {
        pattern: /`.`/,
        alias: "char",
        greedy: !0
      },
      number: {
        pattern: /\b\d+(?:\.\d+(?:\.\d+(?:-[\w+-]+)?)?)?\b/
      },
      string: {
        pattern: /"(?:[^"\\\r\n]|\\.)*"/,
        greedy: !0
      },
      regex: {
        pattern: /\{\/.*?\/\}/,
        greedy: !0
      },
      "html-string": t("html"),
      "css-string": t("css"),
      "js-string": t("js"),
      "md-string": t("md"),
      "sql-string": t("sql"),
      "sh-string": t("shell", "sh"),
      multistring: {
        pattern: /».*|\{:[\s\S]*?:\}|\{[\s\S]*?\}|^-{6}$[\s\S]*/m,
        alias: "string",
        greedy: !0
      },
      label: {
        pattern: /\w+\b\??:/,
        alias: "property"
      },
      literal: {
        pattern: /'(?:\w+\b\??:?)/,
        alias: "constant"
      },
      type: {
        pattern: /:(?:\w+\b\??:?)/,
        alias: "class-name"
      },
      color: /#\w+/,
      predicate: {
        pattern: /\b(?:all|and|any|ascii|attr|attribute|attributeLabel|binary|block|char|contains|database|date|dictionary|empty|equal|even|every|exists|false|floating|function|greater|greaterOrEqual|if|in|inline|integer|is|key|label|leap|less|lessOrEqual|literal|logical|lower|nand|negative|nor|not|notEqual|null|numeric|odd|or|path|pathLabel|positive|prefix|prime|regex|same|set|some|sorted|standalone|string|subset|suffix|superset|symbol|symbolLiteral|true|try|type|unless|upper|when|whitespace|word|xnor|xor|zero)\?/,
        alias: "keyword"
      },
      "builtin-function": {
        pattern: /\b(?:abs|acos|acosh|acsec|acsech|actan|actanh|add|after|alert|alias|and|angle|append|arg|args|arity|array|as|asec|asech|asin|asinh|atan|atan2|atanh|attr|attrs|average|before|benchmark|blend|break|call|capitalize|case|ceil|chop|clear|clip|close|color|combine|conj|continue|copy|cos|cosh|crc|csec|csech|ctan|ctanh|cursor|darken|dec|decode|define|delete|desaturate|deviation|dialog|dictionary|difference|digest|digits|div|do|download|drop|dup|e|else|empty|encode|ensure|env|escape|execute|exit|exp|extend|extract|factors|fdiv|filter|first|flatten|floor|fold|from|function|gamma|gcd|get|goto|hash|hypot|if|inc|indent|index|infinity|info|input|insert|inspect|intersection|invert|jaro|join|keys|kurtosis|last|let|levenshtein|lighten|list|ln|log|loop|lower|mail|map|match|max|median|min|mod|module|mul|nand|neg|new|nor|normalize|not|now|null|open|or|outdent|pad|palette|panic|path|pause|permissions|permutate|pi|pop|popup|pow|powerset|powmod|prefix|print|prints|process|product|query|random|range|read|relative|remove|rename|render|repeat|replace|request|return|reverse|round|sample|saturate|script|sec|sech|select|serve|set|shl|shr|shuffle|sin|sinh|size|skewness|slice|sort|spin|split|sqrt|squeeze|stack|strip|sub|suffix|sum|switch|symbols|symlink|sys|take|tan|tanh|terminal|terminate|to|truncate|try|type|unclip|union|unique|unless|until|unzip|upper|values|var|variance|volume|webview|while|with|wordwrap|write|xnor|xor|zip)\b/,
        alias: "keyword"
      },
      sugar: {
        pattern: /->|=>|\||::/,
        alias: "operator"
      },
      punctuation: /[()[\],]/,
      symbol: {
        pattern: /<:|-:|ø|@|#|\+|\||\*|\$|---|-|%|\/|\.\.|\^|~|=|<|>|\\/
      },
      boolean: {
        pattern: /\b(?:false|maybe|true)\b/
      }
    }, e.languages.art = e.languages.arturo;
  })(i);
}
Zme.displayName = "asciidoc";
Zme.aliases = ["adoc"];
function Zme(i) {
  (function(e) {
    var t = {
      pattern: /(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m,
      lookbehind: !0,
      inside: {
        quoted: {
          pattern: /([$`])(?:(?!\1)[^\\]|\\.)*\1/,
          inside: {
            punctuation: /^[$`]|[$`]$/
          }
        },
        interpreted: {
          pattern: /'(?:[^'\\]|\\.)*'/,
          inside: {
            punctuation: /^'|'$/
            // See rest below
          }
        },
        string: /"(?:[^"\\]|\\.)*"/,
        variable: /\w+(?==)/,
        punctuation: /^\[|\]$|,/,
        operator: /=/,
        // The negative look-ahead prevents blank matches
        "attr-value": /(?!^\s+$).+/
      }
    }, n = e.languages.asciidoc = {
      "comment-block": {
        pattern: /^(\/{4,})$[\s\S]*?^\1/m,
        alias: "comment"
      },
      table: {
        pattern: /^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m,
        inside: {
          specifiers: {
            pattern: /(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*](?:[<^>](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/,
            alias: "attr-value"
          },
          punctuation: {
            pattern: /(^|[^\\])[|!]=*/,
            lookbehind: !0
          }
          // See rest below
        }
      },
      "passthrough-block": {
        pattern: /^(\+{4,})$[\s\S]*?^\1$/m,
        inside: {
          punctuation: /^\++|\++$/
          // See rest below
        }
      },
      // Literal blocks and listing blocks
      "literal-block": {
        pattern: /^(-{4,}|\.{4,})$[\s\S]*?^\1$/m,
        inside: {
          punctuation: /^(?:-+|\.+)|(?:-+|\.+)$/
          // See rest below
        }
      },
      // Sidebar blocks, quote blocks, example blocks and open blocks
      "other-block": {
        pattern: /^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m,
        inside: {
          punctuation: /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/
          // See rest below
        }
      },
      // list-punctuation and list-label must appear before indented-block
      "list-punctuation": {
        pattern: /(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,
        lookbehind: !0,
        alias: "punctuation"
      },
      "list-label": {
        pattern: /(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,
        lookbehind: !0,
        alias: "symbol"
      },
      "indented-block": {
        pattern: /((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,
        lookbehind: !0
      },
      comment: /^\/\/.*/m,
      title: {
        pattern: /^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m,
        alias: "important",
        inside: {
          punctuation: /^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/
          // See rest below
        }
      },
      "attribute-entry": {
        pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,
        alias: "tag"
      },
      attributes: t,
      hr: {
        pattern: /^'{3,}$/m,
        alias: "punctuation"
      },
      "page-break": {
        pattern: /^<{3,}$/m,
        alias: "punctuation"
      },
      admonition: {
        pattern: /^(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING):/m,
        alias: "keyword"
      },
      callout: [
        {
          pattern: /(^[ \t]*)<?\d*>/m,
          lookbehind: !0,
          alias: "symbol"
        },
        {
          pattern: /<\d+>/,
          alias: "symbol"
        }
      ],
      macro: {
        pattern: /\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,
        inside: {
          function: /^[a-z\d-]+(?=:)/,
          punctuation: /^::?/,
          attributes: {
            pattern: /(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,
            inside: t.inside
          }
        }
      },
      inline: {
        /*
        The initial look-behind prevents the highlighting of escaped quoted text.
        Quoted text can be multi-line but cannot span an empty line.
        All quoted text can have attributes before [foobar, 'foobar', baz="bar"].
        First, we handle the constrained quotes.
        Those must be bounded by non-word chars and cannot have spaces between the delimiter and the first char.
        They are, in order: _emphasis_, ``double quotes'', `single quotes', `monospace`, 'emphasis', *strong*, +monospace+ and #unquoted#
        Then we handle the unconstrained quotes.
        Those do not have the restrictions of the constrained quotes.
        They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++, ##unquoted##, $$passthrough$$, ~subscript~, ^superscript^, {attribute-reference}, [[anchor]], [[[bibliography anchor]]], <<xref>>, (((indexes))) and ((indexes))
        */
        pattern: /(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,
        lookbehind: !0,
        inside: {
          attributes: t,
          url: {
            pattern: /^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,
            inside: {
              punctuation: /^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/
            }
          },
          "attribute-ref": {
            pattern: /^\{.+\}$/,
            inside: {
              variable: {
                pattern: /(^\{)[a-z\d,+_-]+/,
                lookbehind: !0
              },
              operator: /^[=?!#%@$]|!(?=[:}])/,
              punctuation: /^\{|\}$|::?/
            }
          },
          italic: {
            pattern: /^(['_])[\s\S]+\1$/,
            inside: {
              punctuation: /^(?:''?|__?)|(?:''?|__?)$/
            }
          },
          bold: {
            pattern: /^\*[\s\S]+\*$/,
            inside: {
              punctuation: /^\*\*?|\*\*?$/
            }
          },
          punctuation: /^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/
        }
      },
      replacement: {
        pattern: /\((?:C|R|TM)\)/,
        alias: "builtin"
      },
      entity: /&#?[\da-z]{1,8};/i,
      "line-continuation": {
        pattern: /(^| )\+$/m,
        lookbehind: !0,
        alias: "punctuation"
      }
    };
    function r(s) {
      s = s.split(" ");
      for (var o = {}, a = 0, l = s.length; a < l; a++)
        o[s[a]] = n[s[a]];
      return o;
    }
    t.inside.interpreted.inside.rest = r(
      "macro inline replacement entity"
    ), n["passthrough-block"].inside.rest = r("macro"), n["literal-block"].inside.rest = r("callout"), n.table.inside.rest = r(
      "comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation"
    ), n["other-block"].inside.rest = r(
      "table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation"
    ), n.title.inside.rest = r(
      "macro inline replacement entity"
    ), e.hooks.add("wrap", function(s) {
      s.type === "entity" && (s.attributes.title = s.content.value.replace(/&amp;/, "&"));
    }), e.languages.adoc = e.languages.asciidoc;
  })(i);
}
Qme.displayName = "aspnet";
Qme.aliases = [];
function Qme(i) {
  i.register(ck), i.register(Nc), i.languages.aspnet = i.languages.extend("markup", {
    "page-directive": {
      pattern: /<%\s*@.*%>/,
      alias: "tag",
      inside: {
        "page-directive": {
          pattern: /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,
          alias: "tag"
        },
        rest: i.languages.markup.tag.inside
      }
    },
    directive: {
      pattern: /<%.*%>/,
      alias: "tag",
      inside: {
        directive: {
          pattern: /<%\s*?[$=%#:]{0,2}|%>/,
          alias: "tag"
        },
        rest: i.languages.csharp
      }
    }
  }), i.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/, i.languages.insertBefore(
    "inside",
    "punctuation",
    {
      directive: i.languages.aspnet.directive
    },
    i.languages.aspnet.tag.inside["attr-value"]
  ), i.languages.insertBefore("aspnet", "comment", {
    "asp-comment": {
      pattern: /<%--[\s\S]*?--%>/,
      alias: ["asp", "comment"]
    }
  }), i.languages.insertBefore(
    "aspnet",
    i.languages.javascript ? "script" : "tag",
    {
      "asp-script": {
        pattern: /(<script(?=.*runat=['"]?server\b)[^>]*>)[\s\S]*?(?=<\/script>)/i,
        lookbehind: !0,
        alias: ["asp", "script"],
        inside: i.languages.csharp || {}
      }
    }
  );
}
Jme.displayName = "asm6502";
Jme.aliases = [];
function Jme(i) {
  i.languages.asm6502 = {
    comment: /;.*/,
    directive: {
      pattern: /\.\w+(?= )/,
      alias: "property"
    },
    string: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,
    "op-code": {
      pattern: /\b(?:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA|adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\b/,
      alias: "keyword"
    },
    "hex-number": {
      pattern: /#?\$[\da-f]{1,4}\b/i,
      alias: "number"
    },
    "binary-number": {
      pattern: /#?%[01]+\b/,
      alias: "number"
    },
    "decimal-number": {
      pattern: /#?\b\d+\b/,
      alias: "number"
    },
    register: {
      pattern: /\b[xya]\b/i,
      alias: "variable"
    },
    punctuation: /[(),:]/
  };
}
e_e.displayName = "asmatmel";
e_e.aliases = [];
function e_e(i) {
  i.languages.asmatmel = {
    comment: {
      pattern: /;.*/,
      greedy: !0
    },
    string: {
      pattern: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    constant: /\b(?:PORT[A-Z]|DDR[A-Z]|(?:DD|P)[A-Z](?:\d|[0-2]\d|3[01]))\b/,
    directive: {
      pattern: /\.\w+(?= )/,
      alias: "property"
    },
    "r-register": {
      pattern: /\br(?:\d|[12]\d|3[01])\b/,
      alias: "variable"
    },
    "op-code": {
      pattern: /\b(?:ADC|ADD|ADIW|AND|ANDI|ASR|BCLR|BLD|BRBC|BRBS|BRCC|BRCS|BREAK|BREQ|BRGE|BRHC|BRHS|BRID|BRIE|BRLO|BRLT|BRMI|BRNE|BRPL|BRSH|BRTC|BRTS|BRVC|BRVS|BSET|BST|CALL|CBI|CBR|CLC|CLH|CLI|CLN|CLR|CLS|CLT|CLV|CLZ|COM|CP|CPC|CPI|CPSE|DEC|DES|EICALL|EIJMP|ELPM|EOR|FMUL|FMULS|FMULSU|ICALL|IJMP|IN|INC|JMP|LAC|LAS|LAT|LD|LD[A-Za-z0-9]|LPM|LSL|LSR|MOV|MOVW|MUL|MULS|MULSU|NEG|NOP|OR|ORI|OUT|POP|PUSH|RCALL|RET|RETI|RJMP|ROL|ROR|SBC|SBCI|SBI|SBIC|SBIS|SBIW|SBR|SBRC|SBRS|SEC|SEH|SEI|SEN|SER|SES|SET|SEV|SEZ|SLEEP|SPM|ST|ST[A-Z0-9]|SUB|SUBI|SWAP|TST|WDR|XCH|adc|add|adiw|and|andi|asr|bclr|bld|brbc|brbs|brcc|brcs|break|breq|brge|brhc|brhs|brid|brie|brlo|brlt|brmi|brne|brpl|brsh|brtc|brts|brvc|brvs|bset|bst|call|cbi|cbr|clc|clh|cli|cln|clr|cls|clt|clv|clz|com|cp|cpc|cpi|cpse|dec|des|eicall|eijmp|elpm|eor|fmul|fmuls|fmulsu|icall|ijmp|in|inc|jmp|lac|las|lat|ld|ld[a-z0-9]|lpm|lsl|lsr|mov|movw|mul|muls|mulsu|neg|nop|or|ori|out|pop|push|rcall|ret|reti|rjmp|rol|ror|sbc|sbci|sbi|sbic|sbis|sbiw|sbr|sbrc|sbrs|sec|seh|sei|sen|ser|ses|set|sev|sez|sleep|spm|st|st[a-zA-Z0-9]|sub|subi|swap|tst|wdr|xch)\b/,
      alias: "keyword"
    },
    "hex-number": {
      pattern: /#?\$[\da-f]{2,4}\b/i,
      alias: "number"
    },
    "binary-number": {
      pattern: /#?%[01]+\b/,
      alias: "number"
    },
    "decimal-number": {
      pattern: /#?\b\d+\b/,
      alias: "number"
    },
    register: {
      pattern: /\b[acznvshtixy]\b/i,
      alias: "variable"
    },
    operator: />>=?|<<=?|&[&=]?|\|[\|=]?|[-+*/%^!=<>?]=?/,
    punctuation: /[(),:]/
  };
}
t_e.displayName = "autohotkey";
t_e.aliases = [];
function t_e(i) {
  i.languages.autohotkey = {
    comment: [
      {
        pattern: /(^|\s);.*/,
        lookbehind: !0
      },
      {
        pattern: /(^[\t ]*)\/\*(?:[\r\n](?![ \t]*\*\/)|[^\r\n])*(?:[\r\n][ \t]*\*\/)?/m,
        lookbehind: !0,
        greedy: !0
      }
    ],
    tag: {
      // labels
      pattern: /^([ \t]*)[^\s,`":]+(?=:[ \t]*$)/m,
      lookbehind: !0
    },
    string: /"(?:[^"\n\r]|"")*"/,
    variable: /%\w+%/,
    number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
    operator: /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/,
    boolean: /\b(?:false|true)\b/,
    command: {
      pattern: /\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,
      alias: "selector"
    },
    constant: /\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guicontrol|a_guicontrolevent|a_guievent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel|programfiles)\b/i,
    builtin: /\b(?:abs|acos|asc|asin|atan|ceil|chr|class|comobjactive|comobjarray|comobjconnect|comobjcreate|comobjerror|comobjflags|comobjget|comobjquery|comobjtype|comobjvalue|cos|dllcall|exp|fileexist|Fileopen|floor|format|il_add|il_create|il_destroy|instr|isfunc|islabel|IsObject|ln|log|ltrim|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|numget|numput|onmessage|regexmatch|regexreplace|registercallback|round|rtrim|sb_seticon|sb_setparts|sb_settext|sin|sqrt|strlen|strreplace|strsplit|substr|tan|tv_add|tv_delete|tv_get|tv_getchild|tv_getcount|tv_getnext|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__Call|__Get|__New|__Set)\b/i,
    symbol: /\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,
    directive: {
      pattern: /#[a-z]+\b/i,
      alias: "important"
    },
    keyword: /\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Catch|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|Finally|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|Region|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Throw|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|Try|TryAgain|Type|UnCheck|underline|Unicode|Unlock|Until|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i,
    function: /[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+(?=\()/,
    punctuation: /[{}[\]():,]/
  };
}
n_e.displayName = "autoit";
n_e.aliases = [];
function n_e(i) {
  i.languages.autoit = {
    comment: [
      /;.*/,
      {
        // The multi-line comments delimiters can actually be commented out with ";"
        pattern: /(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:ce|comments-end)/m,
        lookbehind: !0
      }
    ],
    url: {
      pattern: /(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,
      lookbehind: !0
    },
    string: {
      pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,
      greedy: !0,
      inside: {
        variable: /([%$@])\w+\1/
      }
    },
    directive: {
      pattern: /(^[\t ]*)#[\w-]+/m,
      lookbehind: !0,
      alias: "keyword"
    },
    function: /\b\w+(?=\()/,
    // Variables and macros
    variable: /[$@]\w+/,
    keyword: /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,
    number: /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,
    boolean: /\b(?:False|True)\b/i,
    operator: /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Not|Or)\b/i,
    punctuation: /[\[\]().,:]/
  };
}
i_e.displayName = "avisynth";
i_e.aliases = ["avs"];
function i_e(i) {
  (function(e) {
    function t(c, u) {
      return c.replace(/<<(\d+)>>/g, function(d, h) {
        return u[+h];
      });
    }
    function n(c, u, d) {
      return RegExp(t(c, u), d);
    }
    var r = /bool|clip|float|int|string|val/.source, s = [
      // bools
      /is(?:bool|clip|float|int|string)|defined|(?:(?:internal)?function|var)?exists?/.source,
      // control
      /apply|assert|default|eval|import|nop|select|undefined/.source,
      // global
      /opt_(?:allowfloataudio|avipadscanlines|dwchannelmask|enable_(?:b64a|planartopackedrgb|v210|y3_10_10|y3_10_16)|usewaveextensible|vdubplanarhack)|set(?:cachemode|maxcpu|memorymax|planarlegacyalignment|workingdir)/.source,
      // conv
      /hex(?:value)?|value/.source,
      // numeric
      /abs|ceil|continued(?:denominator|numerator)?|exp|floor|fmod|frac|log(?:10)?|max|min|muldiv|pi|pow|rand|round|sign|spline|sqrt/.source,
      // trig
      /a?sinh?|a?cosh?|a?tan[2h]?/.source,
      // bit
      /(?:bit(?:and|not|x?or|[lr]?shift[aslu]?|sh[lr]|sa[lr]|[lr]rotatel?|ro[rl]|te?st|set(?:count)?|cl(?:ea)?r|ch(?:an)?ge?))/.source,
      // runtime
      /average(?:[bgr]|chroma[uv]|luma)|(?:[rgb]|chroma[uv]|luma|rgb|[yuv](?=difference(?:fromprevious|tonext)))difference(?:fromprevious|tonext)?|[yuvrgb]plane(?:median|min|max|minmaxdifference)/.source,
      // script
      /getprocessinfo|logmsg|script(?:dir(?:utf8)?|file(?:utf8)?|name(?:utf8)?)|setlogparams/.source,
      // string
      /chr|(?:fill|find|left|mid|replace|rev|right)str|format|[lu]case|ord|str(?:cmpi?|fromutf8|len|toutf8)|time|trim(?:all|left|right)/.source,
      // version
      /isversionorgreater|version(?:number|string)/.source,
      // helper
      /buildpixeltype|colorspacenametopixeltype/.source,
      // avsplus
      /addautoloaddir|on(?:cpu|cuda)|prefetch|setfiltermtmode/.source
    ].join("|"), o = [
      // content
      /has(?:audio|video)/.source,
      // resolution
      /height|width/.source,
      // framerate
      /frame(?:count|rate)|framerate(?:denominator|numerator)/.source,
      // interlacing
      /getparity|is(?:field|frame)based/.source,
      // color format
      /bitspercomponent|componentsize|hasalpha|is(?:planar(?:rgba?)?|interleaved|rgb(?:24|32|48|64)?|y(?:8|u(?:va?|y2))?|yv(?:12|16|24|411)|420|422|444|packedrgb)|numcomponents|pixeltype/.source,
      // audio
      /audio(?:bits|channels|duration|length(?:[fs]|hi|lo)?|rate)|isaudio(?:float|int)/.source
    ].join("|"), a = [
      // source
      /avi(?:file)?source|directshowsource|image(?:reader|source|sourceanim)|opendmlsource|segmented(?:avisource|directshowsource)|wavsource/.source,
      // color
      /coloryuv|convertbacktoyuy2|convertto(?:RGB(?:24|32|48|64)|(?:planar)?RGBA?|Y8?|YV(?:12|16|24|411)|YUVA?(?:411|420|422|444)|YUY2)|fixluminance|gr[ae]yscale|invert|levels|limiter|mergea?rgb|merge(?:chroma|luma)|rgbadjust|show(?:alpha|blue|green|red)|swapuv|tweak|[uv]toy8?|ytouv/.source,
      // overlay
      /(?:colorkey|reset)mask|layer|mask(?:hs)?|merge|overlay|subtract/.source,
      // geometry
      /addborders|(?:bicubic|bilinear|blackman|gauss|lanczos4|lanczos|point|sinc|spline(?:16|36|64))resize|crop(?:bottom)?|flip(?:horizontal|vertical)|(?:horizontal|vertical)?reduceby2|letterbox|skewrows|turn(?:180|left|right)/.source,
      // pixel
      /blur|fixbrokenchromaupsampling|generalconvolution|(?:spatial|temporal)soften|sharpen/.source,
      // timeline
      /trim|(?:un)?alignedsplice|(?:assume|assumescaled|change|convert)FPS|(?:delete|duplicate)frame|dissolve|fade(?:in|io|out)[02]?|freezeframe|interleave|loop|reverse|select(?:even|odd|(?:range)?every)/.source,
      // interlace
      /assume[bt]ff|assume(?:field|frame)based|bob|complementparity|doubleweave|peculiarblend|pulldown|separate(?:columns|fields|rows)|swapfields|weave(?:columns|rows)?/.source,
      // audio
      /amplify(?:db)?|assumesamplerate|audiodub(?:ex)?|audiotrim|convertaudioto(?:(?:8|16|24|32)bit|float)|converttomono|delayaudio|ensurevbrmp3sync|get(?:left|right)?channel|kill(?:audio|video)|mergechannels|mixaudio|monotostereo|normalize|resampleaudio|ssrc|supereq|timestretch/.source,
      // conditional
      /animate|applyrange|conditional(?:filter|reader|select)|frameevaluate|scriptclip|tcp(?:server|source)|writefile(?:end|if|start)?/.source,
      // export
      /imagewriter/.source,
      // debug
      /blackness|blankclip|colorbars(?:hd)?|compare|dumpfiltergraph|echo|histogram|info|messageclip|preroll|setgraphanalysis|show(?:framenumber|smpte|time)|showfiveversions|stack(?:horizontal|vertical)|subtitle|tone|version/.source
    ].join("|"), l = [s, o, a].join("|");
    e.languages.avisynth = {
      comment: [
        {
          // Matches [* *] nestable block comments, but only supports 1 level of nested comments
          // /\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|<self>)*\*\]/
          pattern: /(^|[^\\])\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|\[\*(?:[^\[*]|\[(?!\*)|\*(?!\]))*\*\])*\*\]/,
          lookbehind: !0,
          greedy: !0
        },
        {
          // Matches /* */ block comments
          pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
          lookbehind: !0,
          greedy: !0
        },
        {
          // Matches # comments
          pattern: /(^|[^\\$])#.*/,
          lookbehind: !0,
          greedy: !0
        }
      ],
      // Handle before strings because optional arguments are surrounded by double quotes
      argument: {
        pattern: n(/\b(?:<<0>>)\s+("?)\w+\1/.source, [r], "i"),
        inside: {
          keyword: /^\w+/
        }
      },
      // Optional argument assignment
      "argument-label": {
        pattern: /([,(][\s\\]*)\w+\s*=(?!=)/,
        lookbehind: !0,
        inside: {
          "argument-name": {
            pattern: /^\w+/,
            alias: "punctuation"
          },
          punctuation: /=$/
        }
      },
      string: [
        {
          // triple double-quoted
          pattern: /"""[\s\S]*?"""/,
          greedy: !0
        },
        {
          // single double-quoted
          pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
          greedy: !0,
          inside: {
            constant: {
              // These *are* case-sensitive!
              pattern: /\b(?:DEFAULT_MT_MODE|(?:MAINSCRIPT|PROGRAM|SCRIPT)DIR|(?:MACHINE|USER)_(?:CLASSIC|PLUS)_PLUGINS)\b/
            }
          }
        }
      ],
      // The special "last" variable that takes the value of the last implicitly returned clip
      variable: /\b(?:last)\b/i,
      boolean: /\b(?:false|no|true|yes)\b/i,
      keyword: /\b(?:catch|else|for|function|global|if|return|try|while|__END__)\b/i,
      constant: /\bMT_(?:MULTI_INSTANCE|NICE_FILTER|SERIALIZED|SPECIAL_MT)\b/,
      // AviSynth's internal functions, filters, and properties
      "builtin-function": {
        pattern: n(/\b(?:<<0>>)\b/.source, [l], "i"),
        alias: "function"
      },
      "type-cast": {
        pattern: n(/\b(?:<<0>>)(?=\s*\()/.source, [r], "i"),
        alias: "keyword"
      },
      // External/user-defined filters
      function: {
        pattern: /\b[a-z_]\w*(?=\s*\()|(\.)[a-z_]\w*\b/i,
        lookbehind: !0
      },
      // Matches a \ as the first or last character on a line
      "line-continuation": {
        pattern: /(^[ \t]*)\\|\\(?=[ \t]*$)/m,
        lookbehind: !0,
        alias: "punctuation"
      },
      number: /\B\$(?:[\da-f]{6}|[\da-f]{8})\b|(?:(?:\b|\B-)\d+(?:\.\d*)?\b|\B\.\d+\b)/i,
      operator: /\+\+?|[!=<>]=?|&&|\|\||[?:*/%-]/,
      punctuation: /[{}\[\]();,.]/
    }, e.languages.avs = e.languages.avisynth;
  })(i);
}
r_e.displayName = "avro-idl";
r_e.aliases = ["avdl"];
function r_e(i) {
  i.languages["avro-idl"] = {
    comment: {
      pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
      greedy: !0
    },
    string: {
      pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,
      lookbehind: !0,
      greedy: !0
    },
    annotation: {
      pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/,
      greedy: !0,
      alias: "function"
    },
    "function-identifier": {
      pattern: /`[^\r\n`]+`(?=\s*\()/,
      greedy: !0,
      alias: "function"
    },
    identifier: {
      pattern: /`[^\r\n`]+`/,
      greedy: !0
    },
    "class-name": {
      pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,
      lookbehind: !0,
      greedy: !0
    },
    keyword: /\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,
    function: /\b[a-z_]\w*(?=\s*\()/i,
    number: [
      {
        pattern: /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,
        lookbehind: !0
      },
      /-?\b(?:Infinity|NaN)\b/
    ],
    operator: /=/,
    punctuation: /[()\[\]{}<>.:,;-]/
  }, i.languages.avdl = i.languages["avro-idl"];
}
s_e.displayName = "awk";
s_e.aliases = ["gawk"];
function s_e(i) {
  i.languages.awk = {
    hashbang: {
      pattern: /^#!.*/,
      greedy: !0,
      alias: "comment"
    },
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    string: {
      pattern: /(^|[^\\])"(?:[^\\"\r\n]|\\.)*"/,
      lookbehind: !0,
      greedy: !0
    },
    regex: {
      pattern: /((?:^|[^\w\s)])\s*)\/(?:[^\/\\\r\n]|\\.)*\//,
      lookbehind: !0,
      greedy: !0
    },
    variable: /\$\w+/,
    keyword: /\b(?:BEGIN|BEGINFILE|END|ENDFILE|break|case|continue|default|delete|do|else|exit|for|function|getline|if|in|next|nextfile|printf?|return|switch|while)\b|@(?:include|load)\b/,
    function: /\b[a-z_]\w*(?=\s*\()/i,
    number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[a-fA-F0-9]+)\b/,
    operator: /--|\+\+|!?~|>&|>>|<<|(?:\*\*|[<>!=+\-*/%^])=?|&&|\|[|&]|[?:]/,
    punctuation: /[()[\]{},;]/
  }, i.languages.gawk = i.languages.awk;
}
o_e.displayName = "batch";
o_e.aliases = [];
function o_e(i) {
  (function(e) {
    var t = /%%?[~:\w]+%?|!\S+!/, n = {
      pattern: /\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,
      alias: "attr-name",
      inside: {
        punctuation: /:/
      }
    }, r = /"(?:[\\"]"|[^"])*"(?!")/, s = /(?:\b|-)\d+\b/;
    e.languages.batch = {
      comment: [
        /^::.*/m,
        {
          pattern: /((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,
          lookbehind: !0
        }
      ],
      label: {
        pattern: /^:.*/m,
        alias: "property"
      },
      command: [
        {
          // FOR command
          pattern: /((?:^|[&(])[ \t]*)for(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* \S+ in \([^)]+\) do/im,
          lookbehind: !0,
          inside: {
            keyword: /\b(?:do|in)\b|^for\b/i,
            string: r,
            parameter: n,
            variable: t,
            number: s,
            punctuation: /[()',]/
          }
        },
        {
          // IF command
          pattern: /((?:^|[&(])[ \t]*)if(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|(?!")(?:(?!==)\S)+)?(?:==| (?:equ|geq|gtr|leq|lss|neq) )(?:"[^"]*"|[^\s"]\S*))/im,
          lookbehind: !0,
          inside: {
            keyword: /\b(?:cmdextversion|defined|errorlevel|exist|not)\b|^if\b/i,
            string: r,
            parameter: n,
            variable: t,
            number: s,
            operator: /\^|==|\b(?:equ|geq|gtr|leq|lss|neq)\b/i
          }
        },
        {
          // ELSE command
          pattern: /((?:^|[&()])[ \t]*)else\b/im,
          lookbehind: !0,
          inside: {
            keyword: /^else\b/i
          }
        },
        {
          // SET command
          pattern: /((?:^|[&(])[ \t]*)set(?: \/[a-z](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,
          lookbehind: !0,
          inside: {
            keyword: /^set\b/i,
            string: r,
            parameter: n,
            variable: [t, /\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],
            number: s,
            operator: /[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,
            punctuation: /[()',]/
          }
        },
        {
          // Other commands
          pattern: /((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/m,
          lookbehind: !0,
          inside: {
            keyword: /^\w+\b/,
            string: r,
            parameter: n,
            label: {
              pattern: /(^\s*):\S+/m,
              lookbehind: !0,
              alias: "property"
            },
            variable: t,
            number: s,
            operator: /\^/
          }
        }
      ],
      operator: /[&@]/,
      punctuation: /[()']/
    };
  })(i);
}
a_e.displayName = "bbcode";
a_e.aliases = ["shortcode"];
function a_e(i) {
  i.languages.bbcode = {
    tag: {
      pattern: /\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,
      inside: {
        tag: {
          pattern: /^\[\/?[^\s=\]]+/,
          inside: {
            punctuation: /^\[\/?/
          }
        },
        "attr-value": {
          pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/,
          inside: {
            punctuation: [
              /^=/,
              {
                pattern: /^(\s*)["']|["']$/,
                lookbehind: !0
              }
            ]
          }
        },
        punctuation: /\]/,
        "attr-name": /[^\s=\]]+/
      }
    }
  }, i.languages.shortcode = i.languages.bbcode;
}
l_e.displayName = "bbj";
l_e.aliases = [];
function l_e(i) {
  (function(e) {
    e.languages.bbj = {
      comment: {
        pattern: /(^|[^\\:])rem\s+.*/i,
        lookbehind: !0,
        greedy: !0
      },
      string: {
        pattern: /(['"])(?:(?!\1|\\).|\\.)*\1/,
        greedy: !0
      },
      number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,
      keyword: /\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i,
      function: /\b\w+(?=\()/,
      boolean: /\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i,
      operator: /<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i,
      punctuation: /[.,;:()]/
    };
  })(i);
}
c_e.displayName = "bicep";
c_e.aliases = [];
function c_e(i) {
  i.languages.bicep = {
    comment: [
      {
        // multiline comments eg /* ASDF */
        pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
        lookbehind: !0,
        greedy: !0
      },
      {
        // singleline comments eg // ASDF
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    property: [
      {
        pattern: /([\r\n][ \t]*)[a-z_]\w*(?=[ \t]*:)/i,
        lookbehind: !0
      },
      {
        pattern: /([\r\n][ \t]*)'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'(?=[ \t]*:)/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: [
      {
        pattern: /'''[^'][\s\S]*?'''/,
        greedy: !0
      },
      {
        pattern: /(^|[^\\'])'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    "interpolated-string": {
      pattern: /(^|[^\\'])'(?:\\.|\$(?:(?!\{)|\{[^{}\r\n]*\})|[^'\\\r\n$])*'/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /\$\{[^{}\r\n]*\}/,
          inside: {
            expression: {
              pattern: /(^\$\{)[\s\S]+(?=\}$)/,
              lookbehind: !0
            },
            punctuation: /^\$\{|\}$/
          }
        },
        string: /[\s\S]+/
      }
    },
    datatype: {
      pattern: /(\b(?:output|param)\b[ \t]+\w+[ \t]+)\w+\b/,
      lookbehind: !0,
      alias: "class-name"
    },
    boolean: /\b(?:false|true)\b/,
    // https://github.com/Azure/bicep/blob/114a3251b4e6e30082a58729f19a8cc4e374ffa6/src/textmate/bicep.tmlanguage#L184
    keyword: /\b(?:existing|for|if|in|module|null|output|param|resource|targetScope|var)\b/,
    decorator: /@\w+\b/,
    function: /\b[a-z_]\w*(?=[ \t]*\()/i,
    number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,
    operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/,
    punctuation: /[{}[\];(),.:]/
  }, i.languages.bicep["interpolated-string"].inside.interpolation.inside.expression.inside = i.languages.bicep;
}
u_e.displayName = "birb";
u_e.aliases = [];
function u_e(i) {
  i.register(Wr), i.languages.birb = i.languages.extend("clike", {
    string: {
      pattern: /r?("|')(?:\\.|(?!\1)[^\\])*\1/,
      greedy: !0
    },
    "class-name": [
      /\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,
      // matches variable and function return types (parameters as well).
      /\b(?:[A-Z]\w*|(?!(?:var|void)\b)[a-z]\w*)(?=\s+\w+\s*[;,=()])/
    ],
    keyword: /\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|new|next|noSeeb|return|static|switch|throw|var|void|while)\b/,
    operator: /\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/,
    variable: /\b[a-z_]\w*\b/
  }), i.languages.insertBefore("birb", "function", {
    metadata: {
      pattern: /<\w+>/,
      greedy: !0,
      alias: "symbol"
    }
  });
}
d_e.displayName = "bison";
d_e.aliases = [];
function d_e(i) {
  i.register(Em), i.languages.bison = i.languages.extend("c", {}), i.languages.insertBefore("bison", "comment", {
    bison: {
      // This should match all the beginning of the file
      // including the prologue(s), the bison declarations and
      // the grammar rules.
      pattern: /^(?:[^%]|%(?!%))*%%[\s\S]*?%%/,
      inside: {
        c: {
          // Allow for one level of nested braces
          pattern: /%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,
          inside: {
            delimiter: {
              pattern: /^%?\{|%?\}$/,
              alias: "punctuation"
            },
            "bison-variable": {
              pattern: /[$@](?:<[^\s>]+>)?[\w$]+/,
              alias: "variable",
              inside: {
                punctuation: /<|>/
              }
            },
            rest: i.languages.c
          }
        },
        comment: i.languages.c.comment,
        string: i.languages.c.string,
        property: /\S+(?=:)/,
        keyword: /%\w+/,
        number: {
          pattern: /(^|[^@])\b(?:0x[\da-f]+|\d+)/i,
          lookbehind: !0
        },
        punctuation: /%[%?]|[|:;\[\]<>]/
      }
    }
  });
}
h_e.displayName = "bnf";
h_e.aliases = ["rbnf"];
function h_e(i) {
  i.languages.bnf = {
    string: {
      pattern: /"[^\r\n"]*"|'[^\r\n']*'/
    },
    definition: {
      pattern: /<[^<>\r\n\t]+>(?=\s*::=)/,
      alias: ["rule", "keyword"],
      inside: {
        punctuation: /^<|>$/
      }
    },
    rule: {
      pattern: /<[^<>\r\n\t]+>/,
      inside: {
        punctuation: /^<|>$/
      }
    },
    operator: /::=|[|()[\]{}*+?]|\.{3}/
  }, i.languages.rbnf = i.languages.bnf;
}
f_e.displayName = "bqn";
f_e.aliases = [];
function f_e(i) {
  i.languages.bqn = {
    shebang: {
      pattern: /^#![ \t]*\/.*/,
      alias: "important",
      greedy: !0
    },
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    "string-literal": {
      pattern: /"(?:[^"]|"")*"/,
      greedy: !0,
      alias: "string"
    },
    "character-literal": {
      pattern: /'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/,
      greedy: !0,
      alias: "char"
    },
    function: /•[\w¯.∞π]+[\w¯.∞π]*/,
    "dot-notation-on-brackets": {
      pattern: /\{(?=.*\}\.)|\}\./,
      alias: "namespace"
    },
    "special-name": {
      pattern: /(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/,
      alias: "keyword"
    },
    "dot-notation-on-name": {
      pattern: /[A-Za-z_][\w¯∞π]*\./,
      alias: "namespace"
    },
    "word-number-scientific": {
      pattern: /\d+(?:\.\d+)?[eE]¯?\d+/,
      alias: "number"
    },
    "word-name": {
      pattern: /[A-Za-z_][\w¯∞π]*/,
      alias: "symbol"
    },
    "word-number": {
      pattern: /[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?/,
      alias: "number"
    },
    "null-literal": {
      pattern: /@/,
      alias: "char"
    },
    "primitive-functions": {
      pattern: /[-+×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!]/,
      alias: "operator"
    },
    "primitive-1-operators": {
      pattern: /[`˜˘¨⁼⌜´˝˙]/,
      alias: "operator"
    },
    "primitive-2-operators": {
      pattern: /[∘⊸⟜○⌾⎉⚇⍟⊘◶⎊]/,
      alias: "operator"
    },
    punctuation: /[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/
  };
}
g_e.displayName = "brainfuck";
g_e.aliases = [];
function g_e(i) {
  i.languages.brainfuck = {
    pointer: {
      pattern: /<|>/,
      alias: "keyword"
    },
    increment: {
      pattern: /\+/,
      alias: "inserted"
    },
    decrement: {
      pattern: /-/,
      alias: "deleted"
    },
    branching: {
      pattern: /\[|\]/,
      alias: "important"
    },
    operator: /[.,]/,
    comment: /\S+/
  };
}
p_e.displayName = "brightscript";
p_e.aliases = [];
function p_e(i) {
  i.languages.brightscript = {
    comment: /(?:\brem|').*/i,
    "directive-statement": {
      pattern: /(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im,
      lookbehind: !0,
      alias: "property",
      inside: {
        "error-message": {
          pattern: /(^#error).+/,
          lookbehind: !0
        },
        directive: {
          pattern: /^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/,
          alias: "keyword"
        },
        expression: {
          pattern: /[\s\S]+/,
          inside: null
          // see below
        }
      }
    },
    property: {
      pattern: /([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/,
      lookbehind: !0,
      greedy: !0
    },
    string: {
      pattern: /"(?:[^"\r\n]|"")*"(?!")/,
      greedy: !0
    },
    "class-name": {
      pattern: /(\bAs[\t ]+)\w+/i,
      lookbehind: !0
    },
    keyword: /\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i,
    boolean: /\b(?:false|true)\b/i,
    function: /\b(?!\d)\w+(?=[\t ]*\()/,
    number: /(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i,
    operator: /--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i,
    punctuation: /[.,;()[\]{}]/,
    constant: /\b(?:LINE_NUM)\b/i
  }, i.languages.brightscript["directive-statement"].inside.expression.inside = i.languages.brightscript;
}
m_e.displayName = "bro";
m_e.aliases = [];
function m_e(i) {
  i.languages.bro = {
    comment: {
      pattern: /(^|[^\\$])#.*/,
      lookbehind: !0,
      inside: {
        italic: /\b(?:FIXME|TODO|XXX)\b/
      }
    },
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    boolean: /\b[TF]\b/,
    function: {
      pattern: /(\b(?:event|function|hook)[ \t]+)\w+(?:::\w+)?/,
      lookbehind: !0
    },
    builtin: /(?:@(?:load(?:-(?:plugin|sigs))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:add_func|create_expire|default|delete_func|encrypt|error_handler|expire_func|group|log|mergeable|optional|persistent|priority|raw_output|read_expire|redef|rotate_interval|rotate_size|synchronized|type_column|write_expire))/,
    constant: {
      pattern: /(\bconst[ \t]+)\w+/i,
      lookbehind: !0
    },
    keyword: /\b(?:add|addr|alarm|any|bool|break|const|continue|count|delete|double|else|enum|event|export|file|for|function|global|hook|if|in|int|interval|local|module|next|of|opaque|pattern|port|print|record|return|schedule|set|string|subnet|table|time|timeout|using|vector|when)\b/,
    operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,
    number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
    punctuation: /[{}[\];(),.:]/
  };
}
__e.displayName = "bsl";
__e.aliases = ["oscript"];
function __e(i) {
  i.languages.bsl = {
    comment: /\/\/.*/,
    string: [
      // Строки
      // Strings
      {
        pattern: /"(?:[^"]|"")*"(?!")/,
        greedy: !0
      },
      // Дата и время
      // Date & time
      {
        pattern: /'(?:[^'\r\n\\]|\\.)*'/
      }
    ],
    keyword: [
      {
        // RU
        pattern: /(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,
        lookbehind: !0
      },
      {
        // EN
        pattern: /\b(?:break|do|each|else|elseif|enddo|endfunction|endif|endprocedure|endtry|except|execute|export|false|for|function|if|in|new|null|procedure|raise|return|then|to|true|try|undefined|val|var|while)\b/i
      }
    ],
    number: {
      pattern: /(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?/i,
      lookbehind: !0
    },
    operator: [
      /[<>+\-*/]=?|[%=]/,
      // RU
      {
        pattern: /(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,
        lookbehind: !0
      },
      // EN
      {
        pattern: /\b(?:and|not|or)\b/i
      }
    ],
    punctuation: /\(\.|\.\)|[()\[\]:;,.]/,
    directive: [
      // Теги препроцессора вида &Клиент, &Сервер, ...
      // Preprocessor tags of the type &Client, &Server, ...
      {
        pattern: /^([ \t]*)&.*/m,
        lookbehind: !0,
        greedy: !0,
        alias: "important"
      },
      // Инструкции препроцессора вида:
      // #Если Сервер Тогда
      // ...
      // #КонецЕсли
      // Preprocessor instructions of the form:
      // #If Server Then
      // ...
      // #EndIf
      {
        pattern: /^([ \t]*)#.*/gm,
        lookbehind: !0,
        greedy: !0,
        alias: "important"
      }
    ]
  }, i.languages.oscript = i.languages.bsl;
}
b_e.displayName = "cfscript";
b_e.aliases = ["cfc"];
function b_e(i) {
  i.register(Wr), i.languages.cfscript = i.languages.extend("clike", {
    comment: [
      {
        pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
        lookbehind: !0,
        inside: {
          annotation: {
            pattern: /(?:^|[^.])@[\w\.]+/,
            alias: "punctuation"
          }
        }
      },
      {
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    keyword: /\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,
    operator: [
      /\+\+|--|&&|\|\||::|=>|[!=]==|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|:/,
      /\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
    ],
    scope: {
      pattern: /\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,
      alias: "global"
    },
    type: {
      pattern: /\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,
      alias: "builtin"
    }
  }), i.languages.insertBefore("cfscript", "keyword", {
    // This must be declared before keyword because we use "function" inside the lookahead
    "function-variable": {
      pattern: /[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
      alias: "function"
    }
  }), delete i.languages.cfscript["class-name"], i.languages.cfc = i.languages.cfscript;
}
v_e.displayName = "chaiscript";
v_e.aliases = [];
function v_e(i) {
  i.register(Wr), i.register(lk), i.languages.chaiscript = i.languages.extend("clike", {
    string: {
      pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/,
      lookbehind: !0,
      greedy: !0
    },
    "class-name": [
      {
        // e.g. class Rectangle { ... }
        pattern: /(\bclass\s+)\w+/,
        lookbehind: !0
      },
      {
        // e.g. attr Rectangle::height, def Rectangle::area() { ... }
        pattern: /(\b(?:attr|def)\s+)\w+(?=\s*::)/,
        lookbehind: !0
      }
    ],
    keyword: /\b(?:attr|auto|break|case|catch|class|continue|def|default|else|finally|for|fun|global|if|return|switch|this|try|var|while)\b/,
    number: [i.languages.cpp.number, /\b(?:Infinity|NaN)\b/],
    operator: />>=?|<<=?|\|\||&&|:[:=]?|--|\+\+|[=!<>+\-*/%|&^]=?|[?~]|`[^`\r\n]{1,4}`/
  }), i.languages.insertBefore("chaiscript", "operator", {
    "parameter-type": {
      // e.g. def foo(int x, Vector y) {...}
      pattern: /([,(]\s*)\w+(?=\s+\w)/,
      lookbehind: !0,
      alias: "class-name"
    }
  }), i.languages.insertBefore("chaiscript", "string", {
    "string-interpolation": {
      pattern: /(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,
          lookbehind: !0,
          inside: {
            "interpolation-expression": {
              pattern: /(^\$\{)[\s\S]+(?=\}$)/,
              lookbehind: !0,
              inside: i.languages.chaiscript
            },
            "interpolation-punctuation": {
              pattern: /^\$\{|\}$/,
              alias: "punctuation"
            }
          }
        },
        string: /[\s\S]+/
      }
    }
  });
}
y_e.displayName = "cil";
y_e.aliases = [];
function y_e(i) {
  i.languages.cil = {
    comment: /\/\/.*/,
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    directive: {
      pattern: /(^|\W)\.[a-z]+(?=\s)/,
      lookbehind: !0,
      alias: "class-name"
    },
    // Actually an assembly reference
    variable: /\[[\w\.]+\]/,
    keyword: /\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|u?int(?:8|16|32|64)?|iant|idispatch|implements|import|initonly|instance|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/,
    function: /\b(?:(?:constrained|no|readonly|tail|unaligned|volatile)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.\d+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.\d+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|castclass|ldvirtftn|beq(?:\.s)?|ckfinite|ldsflda|ldtoken|localloc|mkrefany|rethrow|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/,
    boolean: /\b(?:false|true)\b/,
    number: /\b-?(?:0x[0-9a-f]+|\d+)(?:\.[0-9a-f]+)?\b/i,
    punctuation: /[{}[\];(),:=]|IL_[0-9A-Za-z]+/
  };
}
C_e.displayName = "cilkc";
C_e.aliases = ["cilk-c"];
function C_e(i) {
  i.register(Em), i.languages.cilkc = i.languages.insertBefore("c", "function", {
    "parallel-keyword": {
      pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,
      alias: "keyword"
    }
  }), i.languages["cilk-c"] = i.languages.cilkc;
}
w_e.displayName = "cilkcpp";
w_e.aliases = ["cilk", "cilk-cpp"];
function w_e(i) {
  i.register(lk), i.languages.cilkcpp = i.languages.insertBefore("cpp", "function", {
    "parallel-keyword": {
      pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,
      alias: "keyword"
    }
  }), i.languages["cilk-cpp"] = i.languages.cilkcpp, i.languages.cilk = i.languages.cilkcpp;
}
S_e.displayName = "clojure";
S_e.aliases = [];
function S_e(i) {
  i.languages.clojure = {
    comment: {
      pattern: /;.*/,
      greedy: !0
    },
    string: {
      pattern: /"(?:[^"\\]|\\.)*"/,
      greedy: !0
    },
    char: /\\\w+/,
    symbol: {
      pattern: /(^|[\s()\[\]{},])::?[\w*+!?'<>=/.-]+/,
      lookbehind: !0
    },
    keyword: {
      pattern: /(\()(?:-|->|->>|\.|\.\.|\*|\/|\+|<|<=|=|==|>|>=|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|cond|conj|cons|constantly|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|declare|def|def-|definline|definterface|defmacro|defmethod|defmulti|defn|defn-|defonce|defproject|defprotocol|defrecord|defstruct|deftype|deref|difference|disj|dissoc|distinct|do|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|fn|fnseq|for|frest|gensym|get|get-proxy-class|hash-map|hash-set|identical\?|identity|if|if-let|if-not|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|let|line-seq|list|list\*|load|load-file|locking|long|loop|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|monitor-enter|name|namespace|neg\?|new|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|quote|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|recur|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|set!|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|throw|time|to-array|to-array-2d|tree-seq|true\?|try|union|up|update-proxy|val|vals|var|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[\s)]|$)/,
      lookbehind: !0
    },
    boolean: /\b(?:false|nil|true)\b/,
    number: {
      pattern: /(^|[^\w$@])(?:\d+(?:[/.]\d+)?(?:e[+-]?\d+)?|0x[a-f0-9]+|[1-9]\d?r[a-z0-9]+)[lmn]?(?![\w$@])/i,
      lookbehind: !0
    },
    function: {
      pattern: /((?:^|[^'])\()[\w*+!?'<>=/.-]+(?=[\s)]|$)/,
      lookbehind: !0
    },
    operator: /[#@^`~]/,
    punctuation: /[{}\[\](),]/
  };
}
E_e.displayName = "cmake";
E_e.aliases = [];
function E_e(i) {
  i.languages.cmake = {
    comment: /#.*/,
    string: {
      pattern: /"(?:[^\\"]|\\.)*"/,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /\$\{(?:[^{}$]|\$\{[^{}$]*\})*\}/,
          inside: {
            punctuation: /\$\{|\}/,
            variable: /\w+/
          }
        }
      }
    },
    variable: /\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_NAME|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE))\b/,
    property: /\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/,
    keyword: /\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/,
    boolean: /\b(?:FALSE|OFF|ON|TRUE)\b/,
    namespace: /\b(?:INTERFACE|PRIVATE|PROPERTIES|PUBLIC|SHARED|STATIC|TARGET_OBJECTS)\b/,
    operator: /\b(?:AND|DEFINED|EQUAL|GREATER|LESS|MATCHES|NOT|OR|STREQUAL|STRGREATER|STRLESS|VERSION_EQUAL|VERSION_GREATER|VERSION_LESS)\b/,
    inserted: {
      pattern: /\b\w+::\w+\b/,
      alias: "class-name"
    },
    number: /\b\d+(?:\.\d+)*\b/,
    function: /\b[a-z_]\w*(?=\s*\()\b/i,
    punctuation: /[()>}]|\$[<{]/
  };
}
x_e.displayName = "cobol";
x_e.aliases = [];
function x_e(i) {
  i.languages.cobol = {
    comment: {
      pattern: /\*>.*|(^[ \t]*)\*.*/m,
      lookbehind: !0,
      greedy: !0
    },
    string: {
      pattern: /[xzgn]?(?:"(?:[^\r\n"]|"")*"(?!")|'(?:[^\r\n']|'')*'(?!'))/i,
      greedy: !0
    },
    level: {
      pattern: /(^[ \t]*)\d+\b/m,
      lookbehind: !0,
      greedy: !0,
      alias: "number"
    },
    "class-name": {
      // https://github.com/antlr/grammars-v4/blob/42edd5b687d183b5fa679e858a82297bd27141e7/cobol85/Cobol85.g4#L1015
      pattern: /(\bpic(?:ture)?\s+)(?:(?:[-\w$/,:*+<>]|\.(?!\s|$))(?:\(\d+\))?)+/i,
      lookbehind: !0,
      inside: {
        number: {
          pattern: /(\()\d+/,
          lookbehind: !0
        },
        punctuation: /[()]/
      }
    },
    keyword: {
      pattern: /(^|[^\w-])(?:ABORT|ACCEPT|ACCESS|ADD|ADDRESS|ADVANCING|AFTER|ALIGNED|ALL|ALPHABET|ALPHABETIC|ALPHABETIC-LOWER|ALPHABETIC-UPPER|ALPHANUMERIC|ALPHANUMERIC-EDITED|ALSO|ALTER|ALTERNATE|ANY|ARE|AREA|AREAS|AS|ASCENDING|ASCII|ASSIGN|ASSOCIATED-DATA|ASSOCIATED-DATA-LENGTH|AT|ATTRIBUTE|AUTHOR|AUTO|AUTO-SKIP|BACKGROUND-COLOR|BACKGROUND-COLOUR|BASIS|BEEP|BEFORE|BEGINNING|BELL|BINARY|BIT|BLANK|BLINK|BLOCK|BOTTOM|BOUNDS|BY|BYFUNCTION|BYTITLE|CALL|CANCEL|CAPABLE|CCSVERSION|CD|CF|CH|CHAINING|CHANGED|CHANNEL|CHARACTER|CHARACTERS|CLASS|CLASS-ID|CLOCK-UNITS|CLOSE|CLOSE-DISPOSITION|COBOL|CODE|CODE-SET|COL|COLLATING|COLUMN|COM-REG|COMMA|COMMITMENT|COMMON|COMMUNICATION|COMP|COMP-1|COMP-2|COMP-3|COMP-4|COMP-5|COMPUTATIONAL|COMPUTATIONAL-1|COMPUTATIONAL-2|COMPUTATIONAL-3|COMPUTATIONAL-4|COMPUTATIONAL-5|COMPUTE|CONFIGURATION|CONTAINS|CONTENT|CONTINUE|CONTROL|CONTROL-POINT|CONTROLS|CONVENTION|CONVERTING|COPY|CORR|CORRESPONDING|COUNT|CRUNCH|CURRENCY|CURSOR|DATA|DATA-BASE|DATE|DATE-COMPILED|DATE-WRITTEN|DAY|DAY-OF-WEEK|DBCS|DE|DEBUG-CONTENTS|DEBUG-ITEM|DEBUG-LINE|DEBUG-NAME|DEBUG-SUB-1|DEBUG-SUB-2|DEBUG-SUB-3|DEBUGGING|DECIMAL-POINT|DECLARATIVES|DEFAULT|DEFAULT-DISPLAY|DEFINITION|DELETE|DELIMITED|DELIMITER|DEPENDING|DESCENDING|DESTINATION|DETAIL|DFHRESP|DFHVALUE|DISABLE|DISK|DISPLAY|DISPLAY-1|DIVIDE|DIVISION|DONTCARE|DOUBLE|DOWN|DUPLICATES|DYNAMIC|EBCDIC|EGCS|EGI|ELSE|EMI|EMPTY-CHECK|ENABLE|END|END-ACCEPT|END-ADD|END-CALL|END-COMPUTE|END-DELETE|END-DIVIDE|END-EVALUATE|END-IF|END-MULTIPLY|END-OF-PAGE|END-PERFORM|END-READ|END-RECEIVE|END-RETURN|END-REWRITE|END-SEARCH|END-START|END-STRING|END-SUBTRACT|END-UNSTRING|END-WRITE|ENDING|ENTER|ENTRY|ENTRY-PROCEDURE|ENVIRONMENT|EOL|EOP|EOS|ERASE|ERROR|ESCAPE|ESI|EVALUATE|EVENT|EVERY|EXCEPTION|EXCLUSIVE|EXHIBIT|EXIT|EXPORT|EXTEND|EXTENDED|EXTERNAL|FD|FILE|FILE-CONTROL|FILLER|FINAL|FIRST|FOOTING|FOR|FOREGROUND-COLOR|FOREGROUND-COLOUR|FROM|FULL|FUNCTION|FUNCTION-POINTER|FUNCTIONNAME|GENERATE|GIVING|GLOBAL|GO|GOBACK|GRID|GROUP|HEADING|HIGH-VALUE|HIGH-VALUES|HIGHLIGHT|I-O|I-O-CONTROL|ID|IDENTIFICATION|IF|IMPLICIT|IMPORT|IN|INDEX|INDEXED|INDICATE|INITIAL|INITIALIZE|INITIATE|INPUT|INPUT-OUTPUT|INSPECT|INSTALLATION|INTEGER|INTO|INVALID|INVOKE|IS|JUST|JUSTIFIED|KANJI|KEPT|KEY|KEYBOARD|LABEL|LANGUAGE|LAST|LB|LD|LEADING|LEFT|LEFTLINE|LENGTH|LENGTH-CHECK|LIBACCESS|LIBPARAMETER|LIBRARY|LIMIT|LIMITS|LINAGE|LINAGE-COUNTER|LINE|LINE-COUNTER|LINES|LINKAGE|LIST|LOCAL|LOCAL-STORAGE|LOCK|LONG-DATE|LONG-TIME|LOW-VALUE|LOW-VALUES|LOWER|LOWLIGHT|MEMORY|MERGE|MESSAGE|MMDDYYYY|MODE|MODULES|MORE-LABELS|MOVE|MULTIPLE|MULTIPLY|NAMED|NATIONAL|NATIONAL-EDITED|NATIVE|NEGATIVE|NETWORK|NEXT|NO|NO-ECHO|NULL|NULLS|NUMBER|NUMERIC|NUMERIC-DATE|NUMERIC-EDITED|NUMERIC-TIME|OBJECT-COMPUTER|OCCURS|ODT|OF|OFF|OMITTED|ON|OPEN|OPTIONAL|ORDER|ORDERLY|ORGANIZATION|OTHER|OUTPUT|OVERFLOW|OVERLINE|OWN|PACKED-DECIMAL|PADDING|PAGE|PAGE-COUNTER|PASSWORD|PERFORM|PF|PH|PIC|PICTURE|PLUS|POINTER|PORT|POSITION|POSITIVE|PRINTER|PRINTING|PRIVATE|PROCEDURE|PROCEDURE-POINTER|PROCEDURES|PROCEED|PROCESS|PROGRAM|PROGRAM-ID|PROGRAM-LIBRARY|PROMPT|PURGE|QUEUE|QUOTE|QUOTES|RANDOM|RD|READ|READER|REAL|RECEIVE|RECEIVED|RECORD|RECORDING|RECORDS|RECURSIVE|REDEFINES|REEL|REF|REFERENCE|REFERENCES|RELATIVE|RELEASE|REMAINDER|REMARKS|REMOTE|REMOVAL|REMOVE|RENAMES|REPLACE|REPLACING|REPORT|REPORTING|REPORTS|REQUIRED|RERUN|RESERVE|RESET|RETURN|RETURN-CODE|RETURNING|REVERSE-VIDEO|REVERSED|REWIND|REWRITE|RF|RH|RIGHT|ROUNDED|RUN|SAME|SAVE|SCREEN|SD|SEARCH|SECTION|SECURE|SECURITY|SEGMENT|SEGMENT-LIMIT|SELECT|SEND|SENTENCE|SEPARATE|SEQUENCE|SEQUENTIAL|SET|SHARED|SHAREDBYALL|SHAREDBYRUNUNIT|SHARING|SHIFT-IN|SHIFT-OUT|SHORT-DATE|SIGN|SIZE|SORT|SORT-CONTROL|SORT-CORE-SIZE|SORT-FILE-SIZE|SORT-MERGE|SORT-MESSAGE|SORT-MODE-SIZE|SORT-RETURN|SOURCE|SOURCE-COMPUTER|SPACE|SPACES|SPECIAL-NAMES|STANDARD|STANDARD-1|STANDARD-2|START|STATUS|STOP|STRING|SUB-QUEUE-1|SUB-QUEUE-2|SUB-QUEUE-3|SUBTRACT|SUM|SUPPRESS|SYMBOL|SYMBOLIC|SYNC|SYNCHRONIZED|TABLE|TALLY|TALLYING|TAPE|TASK|TERMINAL|TERMINATE|TEST|TEXT|THEN|THREAD|THREAD-LOCAL|THROUGH|THRU|TIME|TIMER|TIMES|TITLE|TO|TODAYS-DATE|TODAYS-NAME|TOP|TRAILING|TRUNCATED|TYPE|TYPEDEF|UNDERLINE|UNIT|UNSTRING|UNTIL|UP|UPON|USAGE|USE|USING|VALUE|VALUES|VARYING|VIRTUAL|WAIT|WHEN|WHEN-COMPILED|WITH|WORDS|WORKING-STORAGE|WRITE|YEAR|YYYYDDD|YYYYMMDD|ZERO-FILL|ZEROES|ZEROS)(?![\w-])/i,
      lookbehind: !0
    },
    boolean: {
      pattern: /(^|[^\w-])(?:false|true)(?![\w-])/i,
      lookbehind: !0
    },
    number: {
      pattern: /(^|[^\w-])(?:[+-]?(?:(?:\d+(?:[.,]\d+)?|[.,]\d+)(?:e[+-]?\d+)?|zero))(?![\w-])/i,
      lookbehind: !0
    },
    operator: [
      /<>|[<>]=?|[=+*/&]/,
      {
        pattern: /(^|[^\w-])(?:-|and|equal|greater|less|not|or|than)(?![\w-])/i,
        lookbehind: !0
      }
    ],
    punctuation: /[.:,()]/
  };
}
L_e.displayName = "coffeescript";
L_e.aliases = ["coffee"];
function L_e(i) {
  i.register(_u), (function(e) {
    var t = /#(?!\{).+/, n = {
      pattern: /#\{[^}]+\}/,
      alias: "variable"
    };
    e.languages.coffeescript = e.languages.extend("javascript", {
      comment: t,
      string: [
        // Strings are multiline
        {
          pattern: /'(?:\\[\s\S]|[^\\'])*'/,
          greedy: !0
        },
        {
          // Strings are multiline
          pattern: /"(?:\\[\s\S]|[^\\"])*"/,
          greedy: !0,
          inside: {
            interpolation: n
          }
        }
      ],
      keyword: /\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,
      "class-member": {
        pattern: /@(?!\d)\w+/,
        alias: "variable"
      }
    }), e.languages.insertBefore("coffeescript", "comment", {
      "multiline-comment": {
        pattern: /###[\s\S]+?###/,
        alias: "comment"
      },
      // Block regexp can contain comments and interpolation
      "block-regex": {
        pattern: /\/{3}[\s\S]*?\/{3}/,
        alias: "regex",
        inside: {
          comment: t,
          interpolation: n
        }
      }
    }), e.languages.insertBefore("coffeescript", "string", {
      "inline-javascript": {
        pattern: /`(?:\\[\s\S]|[^\\`])*`/,
        inside: {
          delimiter: {
            pattern: /^`|`$/,
            alias: "punctuation"
          },
          script: {
            pattern: /[\s\S]+/,
            alias: "language-javascript",
            inside: e.languages.javascript
          }
        }
      },
      // Block strings
      "multiline-string": [
        {
          pattern: /'''[\s\S]*?'''/,
          greedy: !0,
          alias: "string"
        },
        {
          pattern: /"""[\s\S]*?"""/,
          greedy: !0,
          alias: "string",
          inside: {
            interpolation: n
          }
        }
      ]
    }), e.languages.insertBefore("coffeescript", "keyword", {
      // Object property
      property: /(?!\d)\w+(?=\s*:(?!:))/
    }), delete e.languages.coffeescript["template-string"], e.languages.coffee = e.languages.coffeescript;
  })(i);
}
T_e.displayName = "concurnas";
T_e.aliases = ["conc"];
function T_e(i) {
  i.languages.concurnas = {
    comment: {
      pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/,
      lookbehind: !0,
      greedy: !0
    },
    langext: {
      pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/,
      greedy: !0,
      inside: {
        "class-name": /^\w+/,
        string: {
          pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/,
          lookbehind: !0
        },
        punctuation: /\|\|/
      }
    },
    function: {
      pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,
      lookbehind: !0
    },
    keyword: /\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,
    boolean: /\b(?:false|true)\b/,
    number: /\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,
    punctuation: /[{}[\];(),.:]/,
    operator: /<==|>==|=>|->|<-|<>|&==|&<>|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|[!^~]|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,
    annotation: {
      pattern: /@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,
      alias: "builtin"
    }
  }, i.languages.insertBefore("concurnas", "langext", {
    "regex-literal": {
      pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
          lookbehind: !0,
          inside: i.languages.concurnas
        },
        regex: /[\s\S]+/
      }
    },
    "string-literal": {
      pattern: /(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
          lookbehind: !0,
          inside: i.languages.concurnas
        },
        string: /[\s\S]+/
      }
    }
  }), i.languages.conc = i.languages.concurnas;
}
k_e.displayName = "csp";
k_e.aliases = [];
function k_e(i) {
  (function(e) {
    function t(n) {
      return RegExp(
        /([ \t])/.source + "(?:" + n + ")" + /(?=[\s;]|$)/.source,
        "i"
      );
    }
    e.languages.csp = {
      directive: {
        pattern: /(^|[\s;])(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|prefetch|script|style|worker)-src|disown-opener|form-action|frame-(?:ancestors|options)|input-protection(?:-(?:clip|selectors))?|navigate-to|plugin-types|policy-uri|referrer|reflected-xss|report-(?:to|uri)|require-sri-for|sandbox|(?:script|style)-src-(?:attr|elem)|upgrade-insecure-requests)(?=[\s;]|$)/i,
        lookbehind: !0,
        alias: "property"
      },
      scheme: {
        pattern: t(/[a-z][a-z0-9.+-]*:/.source),
        lookbehind: !0
      },
      none: {
        pattern: t(/'none'/.source),
        lookbehind: !0,
        alias: "keyword"
      },
      nonce: {
        pattern: t(/'nonce-[-+/\w=]+'/.source),
        lookbehind: !0,
        alias: "number"
      },
      hash: {
        pattern: t(/'sha(?:256|384|512)-[-+/\w=]+'/.source),
        lookbehind: !0,
        alias: "number"
      },
      host: {
        pattern: t(
          /[a-z][a-z0-9.+-]*:\/\/[^\s;,']*/.source + "|" + /\*[^\s;,']*/.source + "|" + /[a-z0-9-]+(?:\.[a-z0-9-]+)+(?::[\d*]+)?(?:\/[^\s;,']*)?/.source
        ),
        lookbehind: !0,
        alias: "url",
        inside: {
          important: /\*/
        }
      },
      keyword: [
        {
          pattern: t(/'unsafe-[a-z-]+'/.source),
          lookbehind: !0,
          alias: "unsafe"
        },
        {
          pattern: t(/'[a-z-]+'/.source),
          lookbehind: !0,
          alias: "safe"
        }
      ],
      punctuation: /;/
    };
  })(i);
}
D_e.displayName = "cooklang";
D_e.aliases = [];
function D_e(i) {
  (function(e) {
    var t = /(?:(?!\s)[\d$+<=a-zA-Z\x80-\uFFFF])+/.source, n = /[^{}@#]+/.source, r = /\{[^}#@]*\}/.source, s = n + r, o = /(?:h|hours|hrs|m|min|minutes)/.source, a = {
      pattern: /\{[^{}]*\}/,
      inside: {
        amount: {
          pattern: /([\{|])[^{}|*%]+/,
          lookbehind: !0,
          alias: "number"
        },
        unit: {
          pattern: /(%)[^}]+/,
          lookbehind: !0,
          alias: "symbol"
        },
        "servings-scaler": {
          pattern: /\*/,
          alias: "operator"
        },
        "servings-alternative-separator": {
          pattern: /\|/,
          alias: "operator"
        },
        "unit-separator": {
          pattern: /(?:%|(\*)%)/,
          lookbehind: !0,
          alias: "operator"
        },
        punctuation: /[{}]/
      }
    };
    e.languages.cooklang = {
      comment: {
        // [- comment -]
        // -- comment
        pattern: /\[-[\s\S]*?-\]|--.*/,
        greedy: !0
      },
      meta: {
        // >> key: value
        pattern: />>.*:.*/,
        inside: {
          property: {
            // key:
            pattern: /(>>\s*)[^\s:](?:[^:]*[^\s:])?/,
            lookbehind: !0
          }
        }
      },
      "cookware-group": {
        // #...{...}, #...
        pattern: new RegExp(
          "#(?:" + s + "|" + t + ")"
        ),
        inside: {
          cookware: {
            pattern: new RegExp("(^#)(?:" + n + ")"),
            lookbehind: !0,
            alias: "variable"
          },
          "cookware-keyword": {
            pattern: /^#/,
            alias: "keyword"
          },
          "quantity-group": {
            pattern: new RegExp(/\{[^{}@#]*\}/),
            inside: {
              quantity: {
                pattern: new RegExp(/(^\{)/.source + n),
                lookbehind: !0,
                alias: "number"
              },
              punctuation: /[{}]/
            }
          }
        }
      },
      "ingredient-group": {
        // @...{...}, @...
        pattern: new RegExp(
          "@(?:" + s + "|" + t + ")"
        ),
        inside: {
          ingredient: {
            pattern: new RegExp("(^@)(?:" + n + ")"),
            lookbehind: !0,
            alias: "variable"
          },
          "ingredient-keyword": {
            pattern: /^@/,
            alias: "keyword"
          },
          "amount-group": a
        }
      },
      "timer-group": {
        // ~timer{...}
        // eslint-disable-next-line regexp/sort-alternatives
        pattern: /~(?!\s)[^@#~{}]*\{[^{}]*\}/,
        inside: {
          timer: {
            pattern: /(^~)[^{]+/,
            lookbehind: !0,
            alias: "variable"
          },
          "duration-group": {
            // {...}
            pattern: /\{[^{}]*\}/,
            inside: {
              punctuation: /[{}]/,
              unit: {
                pattern: new RegExp(
                  /(%\s*)/.source + o + /\b/.source
                ),
                lookbehind: !0,
                alias: "symbol"
              },
              operator: /%/,
              duration: {
                pattern: /\d+/,
                alias: "number"
              }
            }
          },
          "timer-keyword": {
            pattern: /^~/,
            alias: "keyword"
          }
        }
      }
    };
  })(i);
}
I_e.displayName = "coq";
I_e.aliases = [];
function I_e(i) {
  (function(e) {
    for (var t = /\(\*(?:[^(*]|\((?!\*)|\*(?!\))|<self>)*\*\)/.source, n = 0; n < 2; n++)
      t = t.replace(/<self>/g, function() {
        return t;
      });
    t = t.replace(/<self>/g, "[]"), e.languages.coq = {
      comment: RegExp(t),
      string: {
        pattern: /"(?:[^"]|"")*"(?!")/,
        greedy: !0
      },
      attribute: [
        {
          pattern: RegExp(
            /#\[(?:[^\[\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|<comment>)*\]/.source.replace(
              /<comment>/g,
              function() {
                return t;
              }
            )
          ),
          greedy: !0,
          alias: "attr-name",
          inside: {
            comment: RegExp(t),
            string: {
              pattern: /"(?:[^"]|"")*"(?!")/,
              greedy: !0
            },
            operator: /=/,
            punctuation: /^#\[|\]$|[,()]/
          }
        },
        {
          pattern: /\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,
          alias: "attr-name"
        }
      ],
      keyword: /\b(?:Abort|About|Add|Admit|Admitted|All|Arguments|As|Assumptions|Axiom|Axioms|Back|BackTo|Backtrace|BinOp|BinOpSpec|BinRel|Bind|Blacklist|Canonical|Case|Cd|Check|Class|Classes|Close|CoFixpoint|CoInductive|Coercion|Coercions|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|Fixpoint|Flags|Focus|From|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|IF|Identity|Immediate|Implicit|Implicits|Import|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|ML|Match|Method|Minimality|Module|Modules|Morphism|Next|NoInline|Notation|Number|OCaml|Obligation|Obligations|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|PropOp|PropUOp|Property|Proposition|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|Require|Reserved|Reset|Resolve|Restart|Rewrite|Right|Ring|Rings|SProp|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|Step|Strategies|Strategy|String|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|UnOp|UnOpSpec|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|Unshelve|Variable|Variables|Variant|Verbose|View|Visibility|Zify|_|apply|as|at|by|cofix|else|end|exists|exists2|fix|for|forall|fun|if|in|let|match|measure|move|removed|return|struct|then|using|wf|where|with)\b/,
      number: /\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,
      punct: {
        pattern: /@\{|\{\||\[=|:>/,
        alias: "punctuation"
      },
      operator: /\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,
      punctuation: /\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/
    };
  })(i);
}
N_e.displayName = "crystal";
N_e.aliases = [];
function N_e(i) {
  i.register(hk), (function(e) {
    e.languages.crystal = e.languages.extend("ruby", {
      keyword: [
        /\b(?:__DIR__|__END_LINE__|__FILE__|__LINE__|abstract|alias|annotation|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|ptr|require|rescue|return|select|self|sizeof|struct|super|then|type|typeof|undef|uninitialized|union|unless|until|when|while|with|yield)\b/,
        {
          pattern: /(\.\s*)(?:is_a|responds_to)\?/,
          lookbehind: !0
        }
      ],
      number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/,
      operator: [/->/, e.languages.ruby.operator],
      punctuation: /[(){}[\].,;\\]/
    }), e.languages.insertBefore("crystal", "string-literal", {
      attribute: {
        pattern: /@\[.*?\]/,
        inside: {
          delimiter: {
            pattern: /^@\[|\]$/,
            alias: "punctuation"
          },
          attribute: {
            pattern: /^(\s*)\w+/,
            lookbehind: !0,
            alias: "class-name"
          },
          args: {
            pattern: /\S(?:[\s\S]*\S)?/,
            inside: e.languages.crystal
          }
        }
      },
      expansion: {
        pattern: /\{(?:\{.*?\}|%.*?%)\}/,
        inside: {
          content: {
            pattern: /^(\{.)[\s\S]+(?=.\}$)/,
            lookbehind: !0,
            inside: e.languages.crystal
          },
          delimiter: {
            pattern: /^\{[\{%]|[\}%]\}$/,
            alias: "operator"
          }
        }
      },
      char: {
        pattern: /'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/,
        greedy: !0
      }
    });
  })(i);
}
R_e.displayName = "css-extras";
R_e.aliases = [];
function R_e(i) {
  i.register(Rw), (function(e) {
    var t = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, n;
    e.languages.css.selector = {
      pattern: e.languages.css.selector.pattern,
      lookbehind: !0,
      inside: n = {
        "pseudo-element": /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
        "pseudo-class": /:[-\w]+/,
        class: /\.[-\w]+/,
        id: /#[-\w]+/,
        attribute: {
          pattern: RegExp(`\\[(?:[^[\\]"']|` + t.source + ")*\\]"),
          greedy: !0,
          inside: {
            punctuation: /^\[|\]$/,
            "case-sensitivity": {
              pattern: /(\s)[si]$/i,
              lookbehind: !0,
              alias: "keyword"
            },
            namespace: {
              pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,
              lookbehind: !0,
              inside: {
                punctuation: /\|$/
              }
            },
            "attr-name": {
              pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,
              lookbehind: !0
            },
            "attr-value": [
              t,
              {
                pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,
                lookbehind: !0
              }
            ],
            operator: /[|~*^$]?=/
          }
        },
        "n-th": [
          {
            pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
            lookbehind: !0,
            inside: {
              number: /[\dn]+/,
              operator: /[+-]/
            }
          },
          {
            pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
            lookbehind: !0
          }
        ],
        combinator: />|\+|~|\|\|/,
        // the `tag` token has been existed and removed.
        // because we can't find a perfect tokenize to match it.
        // if you want to add it, please read https://github.com/PrismJS/prism/pull/2373 first.
        punctuation: /[(),]/
      }
    }, e.languages.css.atrule.inside["selector-function-argument"].inside = n, e.languages.insertBefore("css", "property", {
      variable: {
        pattern: /(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,
        lookbehind: !0
      }
    });
    var r = {
      pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/,
      lookbehind: !0
    }, s = {
      pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
      lookbehind: !0
    };
    e.languages.insertBefore("css", "function", {
      operator: {
        pattern: /(\s)[+\-*\/](?=\s)/,
        lookbehind: !0
      },
      // CAREFUL!
      // Previewers and Inline color use hexcode and color.
      hexcode: {
        pattern: /\B#[\da-f]{3,8}\b/i,
        alias: "color"
      },
      color: [
        {
          pattern: /(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
          lookbehind: !0
        },
        {
          pattern: /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
          inside: {
            unit: r,
            number: s,
            function: /[\w-]+(?=\()/,
            punctuation: /[(),]/
          }
        }
      ],
      // it's important that there is no boundary assertion after the hex digits
      entity: /\\[\da-f]{1,8}/i,
      unit: r,
      number: s
    });
  })(i);
}
A_e.displayName = "csv";
A_e.aliases = [];
function A_e(i) {
  i.languages.csv = {
    value: /[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,
    punctuation: /,/
  };
}
O_e.displayName = "cue";
O_e.aliases = [];
function O_e(i) {
  (function(e) {
    var t = /\\(?:(?!\2)|\2(?:[^()\r\n]|\([^()]*\)))/.source, n = /"""(?:[^\\"]|"(?!""\2)|<esc>)*"""/.source + // eslint-disable-next-line regexp/strict
    "|" + /'''(?:[^\\']|'(?!''\2)|<esc>)*'''/.source + // eslint-disable-next-line regexp/strict
    "|" + /"(?:[^\\\r\n"]|"(?!\2)|<esc>)*"/.source + // eslint-disable-next-line regexp/strict
    "|" + /'(?:[^\\\r\n']|'(?!\2)|<esc>)*'/.source, r = "(?:" + n.replace(/<esc>/g, t) + ")";
    e.languages.cue = {
      comment: {
        pattern: /\/\/.*/,
        greedy: !0
      },
      "string-literal": {
        // eslint-disable-next-line regexp/strict
        pattern: RegExp(
          /(^|[^#"'\\])(#*)/.source + r + /(?!["'])\2/.source
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          // I'm using dirty hack here. We have to know the number hashes at the start of the string somehow,
          // but we can't look back. So instead, we will use a lookahead, go to the end of the string, and
          // capture the hashes at the end of the string.
          escape: {
            pattern: /(?=[\s\S]*["'](#*)$)\\\1(?:U[a-fA-F0-9]{1,8}|u[a-fA-F0-9]{1,4}|x[a-fA-F0-9]{1,2}|\d{2,3}|[^(])/,
            greedy: !0,
            alias: "string"
          },
          interpolation: {
            pattern: /(?=[\s\S]*["'](#*)$)\\\1\([^()]*\)/,
            greedy: !0,
            inside: {
              punctuation: /^\\#*\(|\)$/,
              expression: {
                pattern: /[\s\S]+/,
                inside: null
              }
            }
          },
          string: /[\s\S]+/
        }
      },
      keyword: {
        pattern: /(^|[^\w$])(?:for|if|import|in|let|null|package)(?![\w$])/,
        lookbehind: !0
      },
      boolean: {
        pattern: /(^|[^\w$])(?:false|true)(?![\w$])/,
        lookbehind: !0
      },
      builtin: {
        pattern: /(^|[^\w$])(?:bool|bytes|float|float(?:32|64)|u?int(?:8|16|32|64|128)?|number|rune|string)(?![\w$])/,
        lookbehind: !0
      },
      attribute: {
        pattern: /@[\w$]+(?=\s*\()/,
        alias: "function"
      },
      function: {
        pattern: /(^|[^\w$])[a-z_$][\w$]*(?=\s*\()/i,
        lookbehind: !0
      },
      number: {
        pattern: /(^|[^\w$.])(?:0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*|(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[eE][+-]?\d+(?:_\d+)*)?(?:[KMGTP]i?)?)(?![\w$])/,
        lookbehind: !0
      },
      operator: /\.{3}|_\|_|&&?|\|\|?|[=!]~|[<>=!]=?|[+\-*/?]/,
      punctuation: /[()[\]{},.:]/
    }, e.languages.cue["string-literal"].inside.interpolation.inside.expression.inside = e.languages.cue;
  })(i);
}
M_e.displayName = "cypher";
M_e.aliases = [];
function M_e(i) {
  i.languages.cypher = {
    // https://neo4j.com/docs/cypher-manual/current/syntax/comments/
    comment: /\/\/.*/,
    string: {
      pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/,
      greedy: !0
    },
    "class-name": {
      pattern: /(:\s*)(?:\w+|`(?:[^`\\\r\n])*`)(?=\s*[{):])/,
      lookbehind: !0,
      greedy: !0
    },
    relationship: {
      pattern: /(-\[\s*(?:\w+\s*|`(?:[^`\\\r\n])*`\s*)?:\s*|\|\s*:\s*)(?:\w+|`(?:[^`\\\r\n])*`)/,
      lookbehind: !0,
      greedy: !0,
      alias: "property"
    },
    identifier: {
      pattern: /`(?:[^`\\\r\n])*`/,
      greedy: !0
    },
    variable: /\$\w+/,
    // https://neo4j.com/docs/cypher-manual/current/syntax/reserved/
    keyword: /\b(?:ADD|ALL|AND|AS|ASC|ASCENDING|ASSERT|BY|CALL|CASE|COMMIT|CONSTRAINT|CONTAINS|CREATE|CSV|DELETE|DESC|DESCENDING|DETACH|DISTINCT|DO|DROP|ELSE|END|ENDS|EXISTS|FOR|FOREACH|IN|INDEX|IS|JOIN|KEY|LIMIT|LOAD|MANDATORY|MATCH|MERGE|NODE|NOT|OF|ON|OPTIONAL|OR|ORDER(?=\s+BY)|PERIODIC|REMOVE|REQUIRE|RETURN|SCALAR|SCAN|SET|SKIP|START|STARTS|THEN|UNION|UNIQUE|UNWIND|USING|WHEN|WHERE|WITH|XOR|YIELD)\b/i,
    function: /\b\w+\b(?=\s*\()/,
    boolean: /\b(?:false|null|true)\b/i,
    number: /\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/,
    // https://neo4j.com/docs/cypher-manual/current/syntax/operators/
    operator: /:|<--?|--?>?|<>|=~?|[<>]=?|[+*/%^|]|\.\.\.?/,
    punctuation: /[()[\]{},;.]/
  };
}
P_e.displayName = "d";
P_e.aliases = [];
function P_e(i) {
  i.register(Wr), i.languages.d = i.languages.extend("clike", {
    comment: [
      {
        // Shebang
        pattern: /^\s*#!.+/,
        greedy: !0
      },
      {
        pattern: RegExp(
          /(^|[^\\])/.source + "(?:" + [
            // /+ comment +/
            // Allow one level of nesting
            /\/\+(?:\/\+(?:[^+]|\+(?!\/))*\+\/|(?!\/\+)[\s\S])*?\+\//.source,
            // // comment
            /\/\/.*/.source,
            // /* comment */
            /\/\*[\s\S]*?\*\//.source
          ].join("|") + ")"
        ),
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: [
      {
        pattern: RegExp(
          [
            // r"", x""
            /\b[rx]"(?:\\[\s\S]|[^\\"])*"[cwd]?/.source,
            // q"[]", q"()", q"<>", q"{}"
            /\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/.source,
            // q"IDENT
            // ...
            // IDENT"
            /\bq"((?!\d)\w+)$[\s\S]*?^\1"/.source,
            // q"//", q"||", etc.
            // eslint-disable-next-line regexp/strict
            /\bq"(.)[\s\S]*?\2"/.source,
            // eslint-disable-next-line regexp/strict
            /(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source
          ].join("|"),
          "m"
        ),
        greedy: !0
      },
      {
        pattern: /\bq\{(?:\{[^{}]*\}|[^{}])*\}/,
        greedy: !0,
        alias: "token-string"
      }
    ],
    // In order: $, keywords and special tokens, globally defined symbols
    keyword: /\$|\b(?:__(?:(?:DATE|EOF|FILE|FUNCTION|LINE|MODULE|PRETTY_FUNCTION|TIMESTAMP|TIME|VENDOR|VERSION)__|gshared|parameters|traits|vector)|abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|dstring|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|ptrdiff_t|public|pure|real|ref|return|scope|shared|short|size_t|static|string|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|wstring)\b/,
    number: [
      // The lookbehind and the negative look-ahead try to prevent bad highlighting of the .. operator
      // Hexadecimal numbers must be handled separately to avoid problems with exponent "e"
      /\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]{0,4}/i,
      {
        pattern: /((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}/i,
        lookbehind: !0
      }
    ],
    operator: /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/
  }), i.languages.insertBefore("d", "string", {
    // Characters
    // 'a', '\\', '\n', '\xFF', '\377', '\uFFFF', '\U0010FFFF', '\quot'
    char: /'(?:\\(?:\W|\w+)|[^\\])'/
  }), i.languages.insertBefore("d", "keyword", {
    property: /\B@\w*/
  }), i.languages.insertBefore("d", "function", {
    register: {
      // Iasm registers
      pattern: /\b(?:[ABCD][LHX]|E?(?:BP|DI|SI|SP)|[BS]PL|[ECSDGF]S|CR[0234]|[DS]IL|DR[012367]|E[ABCD]X|X?MM[0-7]|R(?:1[0-5]|[89])[BWD]?|R[ABCD]X|R[BS]P|R[DS]I|TR[3-7]|XMM(?:1[0-5]|[89])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,
      alias: "variable"
    }
  });
}
F_e.displayName = "dart";
F_e.aliases = [];
function F_e(i) {
  i.register(Wr), (function(e) {
    var t = [
      /\b(?:async|sync|yield)\*/,
      /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/
    ], n = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, r = {
      pattern: RegExp(n + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
      lookbehind: !0,
      inside: {
        namespace: {
          pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
          inside: {
            punctuation: /\./
          }
        }
      }
    };
    e.languages.dart = e.languages.extend("clike", {
      "class-name": [
        r,
        {
          // variables and parameters
          // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
          pattern: RegExp(
            n + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source
          ),
          lookbehind: !0,
          inside: r.inside
        }
      ],
      keyword: t,
      operator: /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
    }), e.languages.insertBefore("dart", "string", {
      "string-literal": {
        pattern: /r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,
        greedy: !0,
        inside: {
          interpolation: {
            pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,
            lookbehind: !0,
            inside: {
              punctuation: /^\$\{?|\}$/,
              expression: {
                pattern: /[\s\S]+/,
                inside: e.languages.dart
              }
            }
          },
          string: /[\s\S]+/
        }
      },
      string: void 0
    }), e.languages.insertBefore("dart", "class-name", {
      metadata: {
        pattern: /@\w+/,
        alias: "function"
      }
    }), e.languages.insertBefore("dart", "class-name", {
      generics: {
        pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,
        inside: {
          "class-name": r,
          keyword: t,
          punctuation: /[<>(),.:]/,
          operator: /[?&|]/
        }
      }
    });
  })(i);
}
B_e.displayName = "dataweave";
B_e.aliases = [];
function B_e(i) {
  (function(e) {
    e.languages.dataweave = {
      url: /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,
      property: {
        pattern: /(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/,
        greedy: !0
      },
      string: {
        pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
        greedy: !0
      },
      "mime-type": /\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/,
      date: {
        pattern: /\|[\w:+-]+\|/,
        greedy: !0
      },
      comment: [
        {
          pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
          lookbehind: !0,
          greedy: !0
        },
        {
          pattern: /(^|[^\\:])\/\/.*/,
          lookbehind: !0,
          greedy: !0
        }
      ],
      regex: {
        pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,
        greedy: !0
      },
      keyword: /\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/,
      function: /\b[A-Z_]\w*(?=\s*\()/i,
      number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
      punctuation: /[{}[\];(),.:@]/,
      operator: /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/,
      boolean: /\b(?:false|true)\b/
    };
  })(i);
}
H_e.displayName = "dax";
H_e.aliases = [];
function H_e(i) {
  i.languages.dax = {
    comment: {
      pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/).*)/,
      lookbehind: !0
    },
    "data-field": {
      pattern: /'(?:[^']|'')*'(?!')(?:\[[ \w\xA0-\uFFFF]+\])?|\w+\[[ \w\xA0-\uFFFF]+\]/,
      alias: "symbol"
    },
    measure: {
      pattern: /\[[ \w\xA0-\uFFFF]+\]/,
      alias: "constant"
    },
    string: {
      pattern: /"(?:[^"]|"")*"(?!")/,
      greedy: !0
    },
    function: /\b(?:ABS|ACOS|ACOSH|ACOT|ACOTH|ADDCOLUMNS|ADDMISSINGITEMS|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|AND|APPROXIMATEDISTINCTCOUNT|ASIN|ASINH|ATAN|ATANH|AVERAGE|AVERAGEA|AVERAGEX|BETA\.DIST|BETA\.INV|BLANK|CALCULATE|CALCULATETABLE|CALENDAR|CALENDARAUTO|CEILING|CHISQ\.DIST|CHISQ\.DIST\.RT|CHISQ\.INV|CHISQ\.INV\.RT|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|COALESCE|COMBIN|COMBINA|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONFIDENCE\.NORM|CONFIDENCE\.T|CONTAINS|CONTAINSROW|CONTAINSSTRING|CONTAINSSTRINGEXACT|CONVERT|COS|COSH|COT|COTH|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSFILTER|CROSSJOIN|CURRENCY|CURRENTGROUP|CUSTOMDATA|DATATABLE|DATE|DATEADD|DATEDIFF|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|DATEVALUE|DAY|DEGREES|DETAILROWS|DISTINCT|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|DIVIDE|EARLIER|EARLIEST|EDATE|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|EOMONTH|ERROR|EVEN|EXACT|EXCEPT|EXP|EXPON\.DIST|FACT|FALSE|FILTER|FILTERS|FIND|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|FIXED|FLOOR|FORMAT|GCD|GENERATE|GENERATEALL|GENERATESERIES|GEOMEAN|GEOMEANX|GROUPBY|HASONEFILTER|HASONEVALUE|HOUR|IF|IF\.EAGER|IFERROR|IGNORE|INT|INTERSECT|ISBLANK|ISCROSSFILTERED|ISEMPTY|ISERROR|ISEVEN|ISFILTERED|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISO\.CEILING|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|KEEPFILTERS|KEYWORDMATCH|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|LCM|LEFT|LEN|LN|LOG|LOG10|LOOKUPVALUE|LOWER|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MID|MIN|MINA|MINUTE|MINX|MOD|MONTH|MROUND|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|NONVISUAL|NORM\.DIST|NORM\.INV|NORM\.S\.DIST|NORM\.S\.INV|NOT|NOW|ODD|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|OR|PARALLELPERIOD|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|PERCENTILE\.EXC|PERCENTILE\.INC|PERCENTILEX\.EXC|PERCENTILEX\.INC|PERMUT|PI|POISSON\.DIST|POWER|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|PRODUCT|PRODUCTX|QUARTER|QUOTIENT|RADIANS|RAND|RANDBETWEEN|RANK\.EQ|RANKX|RELATED|RELATEDTABLE|REMOVEFILTERS|REPLACE|REPT|RIGHT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|ROUND|ROUNDDOWN|ROUNDUP|ROW|SAMEPERIODLASTYEAR|SAMPLE|SEARCH|SECOND|SELECTCOLUMNS|SELECTEDMEASURE|SELECTEDMEASUREFORMATSTRING|SELECTEDMEASURENAME|SELECTEDVALUE|SIGN|SIN|SINH|SQRT|SQRTPI|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|STDEV\.P|STDEV\.S|STDEVX\.P|STDEVX\.S|SUBSTITUTE|SUBSTITUTEWITHINDEX|SUM|SUMMARIZE|SUMMARIZECOLUMNS|SUMX|SWITCH|T\.DIST|T\.DIST\.2T|T\.DIST\.RT|T\.INV|T\.INV\.2T|TAN|TANH|TIME|TIMEVALUE|TODAY|TOPN|TOPNPERLEVEL|TOPNSKIP|TOTALMTD|TOTALQTD|TOTALYTD|TREATAS|TRIM|TRUE|TRUNC|UNICHAR|UNICODE|UNION|UPPER|USERELATIONSHIP|USERNAME|USEROBJECTID|USERPRINCIPALNAME|UTCNOW|UTCTODAY|VALUE|VALUES|VAR\.P|VAR\.S|VARX\.P|VARX\.S|WEEKDAY|WEEKNUM|XIRR|XNPV|YEAR|YEARFRAC)(?=\s*\()/i,
    keyword: /\b(?:DEFINE|EVALUATE|MEASURE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i,
    boolean: {
      pattern: /\b(?:FALSE|NULL|TRUE)\b/i,
      alias: "constant"
    },
    number: /\b\d+(?:\.\d*)?|\B\.\d+\b/,
    operator: /:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i,
    punctuation: /[;\[\](){}`,.]/
  };
}
W_e.displayName = "dhall";
W_e.aliases = [];
function W_e(i) {
  i.languages.dhall = {
    // Multi-line comments can be nested. E.g. {- foo {- bar -} -}
    // The multi-line pattern is essentially this:
    //   \{-(?:[^-{]|-(?!\})|\{(?!-)|<SELF>)*-\}
    comment: /--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,
    string: {
      pattern: /"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /\$\{[^{}]*\}/,
          inside: {
            expression: {
              pattern: /(^\$\{)[\s\S]+(?=\}$)/,
              lookbehind: !0,
              alias: "language-dhall",
              inside: null
              // see blow
            },
            punctuation: /\$\{|\}/
          }
        }
      }
    },
    label: {
      pattern: /`[^`]*`/,
      greedy: !0
    },
    url: {
      // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L596
      pattern: /\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,
      greedy: !0
    },
    env: {
      // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L661
      pattern: /\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,
      greedy: !0,
      inside: {
        function: /^env/,
        operator: /^:/,
        variable: /[\s\S]+/
      }
    },
    hash: {
      // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L725
      pattern: /\bsha256:[\da-fA-F]{64}\b/,
      inside: {
        function: /sha256/,
        operator: /:/,
        number: /[\da-fA-F]{64}/
      }
    },
    // https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L359
    keyword: /\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,
    builtin: /\b(?:None|Some)\b/,
    boolean: /\b(?:False|True)\b/,
    number: /\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,
    operator: /\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,
    punctuation: /\.\.|[{}\[\](),./]/,
    // we'll just assume that every capital word left is a type name
    "class-name": /\b[A-Z]\w*\b/
  }, i.languages.dhall.string.inside.interpolation.inside.expression.inside = i.languages.dhall;
}
V_e.displayName = "django";
V_e.aliases = ["jinja2"];
function V_e(i) {
  i.register(bu), (function(e) {
    e.languages.django = {
      comment: /^\{#[\s\S]*?#\}$/,
      tag: {
        pattern: /(^\{%[+-]?\s*)\w+/,
        lookbehind: !0,
        alias: "keyword"
      },
      delimiter: {
        pattern: /^\{[{%][+-]?|[+-]?[}%]\}$/,
        alias: "punctuation"
      },
      string: {
        pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
        greedy: !0
      },
      filter: {
        pattern: /(\|)\w+/,
        lookbehind: !0,
        alias: "function"
      },
      test: {
        pattern: /(\bis\s+(?:not\s+)?)(?!not\b)\w+/,
        lookbehind: !0,
        alias: "function"
      },
      function: /\b[a-z_]\w+(?=\s*\()/i,
      keyword: /\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/,
      operator: /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
      number: /\b\d+(?:\.\d+)?\b/,
      boolean: /[Ff]alse|[Nn]one|[Tt]rue/,
      variable: /\b\w+\b/,
      punctuation: /[{}[\](),.:;]/
    };
    var t = /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g, n = e.languages["markup-templating"];
    e.hooks.add("before-tokenize", function(r) {
      n.buildPlaceholders(r, "django", t);
    }), e.hooks.add("after-tokenize", function(r) {
      n.tokenizePlaceholders(r, "django");
    }), e.languages.jinja2 = e.languages.django, e.hooks.add("before-tokenize", function(r) {
      n.buildPlaceholders(r, "jinja2", t);
    }), e.hooks.add("after-tokenize", function(r) {
      n.tokenizePlaceholders(r, "jinja2");
    });
  })(i);
}
U_e.displayName = "dns-zone-file";
U_e.aliases = ["dns-zone"];
function U_e(i) {
  i.languages["dns-zone-file"] = {
    comment: /;.*/,
    string: {
      pattern: /"(?:\\.|[^"\\\r\n])*"/,
      greedy: !0
    },
    variable: [
      {
        pattern: /(^\$ORIGIN[ \t]+)\S+/m,
        lookbehind: !0
      },
      {
        pattern: /(^|\s)@(?=\s|$)/,
        lookbehind: !0
      }
    ],
    keyword: /^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m,
    class: {
      // https://tools.ietf.org/html/rfc1035#page-13
      pattern: /(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/,
      lookbehind: !0,
      alias: "keyword"
    },
    type: {
      // https://en.wikipedia.org/wiki/List_of_DNS_record_types
      pattern: /(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,
      lookbehind: !0,
      alias: "keyword"
    },
    punctuation: /[()]/
  }, i.languages["dns-zone"] = i.languages["dns-zone-file"];
}
z_e.displayName = "docker";
z_e.aliases = ["dockerfile"];
function z_e(i) {
  (function(e) {
    var t = /\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source, n = /(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(
      /<SP_BS>/g,
      function() {
        return t;
      }
    ), r = /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source, s = /--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(
      /<STR>/g,
      function() {
        return r;
      }
    ), o = {
      pattern: RegExp(r),
      greedy: !0
    }, a = {
      pattern: /(^[ \t]*)#.*/m,
      lookbehind: !0,
      greedy: !0
    };
    function l(c, u) {
      return c = c.replace(/<OPT>/g, function() {
        return s;
      }).replace(/<SP>/g, function() {
        return n;
      }), RegExp(c, u);
    }
    e.languages.docker = {
      instruction: {
        pattern: /(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,
        lookbehind: !0,
        greedy: !0,
        inside: {
          options: {
            pattern: l(
              /(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,
              "i"
            ),
            lookbehind: !0,
            greedy: !0,
            inside: {
              property: {
                pattern: /(^|\s)--[\w-]+/,
                lookbehind: !0
              },
              string: [
                o,
                {
                  pattern: /(=)(?!["'])(?:[^\s\\]|\\.)+/,
                  lookbehind: !0
                }
              ],
              operator: /\\$/m,
              punctuation: /=/
            }
          },
          keyword: [
            {
              // https://docs.docker.com/engine/reference/builder/#healthcheck
              pattern: l(
                /(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,
                "i"
              ),
              lookbehind: !0,
              greedy: !0
            },
            {
              // https://docs.docker.com/engine/reference/builder/#from
              pattern: l(
                /(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,
                "i"
              ),
              lookbehind: !0,
              greedy: !0
            },
            {
              // https://docs.docker.com/engine/reference/builder/#onbuild
              pattern: l(/(^ONBUILD<SP>)\w+/.source, "i"),
              lookbehind: !0,
              greedy: !0
            },
            {
              pattern: /^\w+/,
              greedy: !0
            }
          ],
          comment: a,
          string: o,
          variable: /\$(?:\w+|\{[^{}"'\\]*\})/,
          operator: /\\$/m
        }
      },
      comment: a
    }, e.languages.dockerfile = e.languages.docker;
  })(i);
}
$_e.displayName = "dot";
$_e.aliases = ["gv"];
function $_e(i) {
  (function(e) {
    var t = "(?:" + [
      // an identifier
      /[a-zA-Z_\x80-\uFFFF][\w\x80-\uFFFF]*/.source,
      // a number
      /-?(?:\.\d+|\d+(?:\.\d*)?)/.source,
      // a double-quoted string
      /"[^"\\]*(?:\\[\s\S][^"\\]*)*"/.source,
      // HTML-like string
      /<(?:[^<>]|(?!<!--)<(?:[^<>"']|"[^"]*"|'[^']*')+>|<!--(?:[^-]|-(?!->))*-->)*>/.source
    ].join("|") + ")", n = {
      markup: {
        pattern: /(^<)[\s\S]+(?=>$)/,
        lookbehind: !0,
        alias: ["language-markup", "language-html", "language-xml"],
        inside: e.languages.markup
      }
    };
    function r(s, o) {
      return RegExp(
        s.replace(/<ID>/g, function() {
          return t;
        }),
        o
      );
    }
    e.languages.dot = {
      comment: {
        pattern: /\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m,
        greedy: !0
      },
      "graph-name": {
        pattern: r(
          /(\b(?:digraph|graph|subgraph)[ \t\r\n]+)<ID>/.source,
          "i"
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "class-name",
        inside: n
      },
      "attr-value": {
        pattern: r(/(=[ \t\r\n]*)<ID>/.source),
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      "attr-name": {
        pattern: r(/([\[;, \t\r\n])<ID>(?=[ \t\r\n]*=)/.source),
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      keyword: /\b(?:digraph|edge|graph|node|strict|subgraph)\b/i,
      "compass-point": {
        pattern: /(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/,
        lookbehind: !0,
        alias: "builtin"
      },
      node: {
        pattern: r(/(^|[^-.\w\x80-\uFFFF\\])<ID>/.source),
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      operator: /[=:]|-[->]/,
      punctuation: /[\[\]{};,]/
    }, e.languages.gv = e.languages.dot;
  })(i);
}
j_e.displayName = "ebnf";
j_e.aliases = [];
function j_e(i) {
  i.languages.ebnf = {
    comment: /\(\*[\s\S]*?\*\)/,
    string: {
      pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
      greedy: !0
    },
    special: {
      pattern: /\?[^?\r\n]*\?/,
      greedy: !0,
      alias: "class-name"
    },
    definition: {
      pattern: /^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,
      lookbehind: !0,
      alias: ["rule", "keyword"]
    },
    rule: /\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,
    punctuation: /\([:/]|[:/]\)|[.,;()[\]{}]/,
    operator: /[-=|*/!]/
  };
}
G_e.displayName = "editorconfig";
G_e.aliases = [];
function G_e(i) {
  i.languages.editorconfig = {
    // https://editorconfig-specification.readthedocs.io
    comment: /[;#].*/,
    section: {
      pattern: /(^[ \t]*)\[.+\]/m,
      lookbehind: !0,
      alias: "selector",
      inside: {
        regex: /\\\\[\[\]{},!?.*]/,
        // Escape special characters with '\\'
        operator: /[!?]|\.\.|\*{1,2}/,
        punctuation: /[\[\]{},]/
      }
    },
    key: {
      pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,
      lookbehind: !0,
      alias: "attr-name"
    },
    value: {
      pattern: /=.*/,
      alias: "attr-value",
      inside: {
        punctuation: /^=/
      }
    }
  };
}
q_e.displayName = "eiffel";
q_e.aliases = [];
function q_e(i) {
  i.languages.eiffel = {
    comment: /--.*/,
    string: [
      // Aligned-verbatim-strings
      {
        pattern: /"([^[]*)\[[\s\S]*?\]\1"/,
        greedy: !0
      },
      // Non-aligned-verbatim-strings
      {
        pattern: /"([^{]*)\{[\s\S]*?\}\1"/,
        greedy: !0
      },
      // Single-line string
      {
        pattern: /"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/,
        greedy: !0
      }
    ],
    // normal char | special char | char code
    char: /'(?:%.|[^%'\r\n])+'/,
    keyword: /\b(?:across|agent|alias|all|and|as|assign|attached|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,
    boolean: /\b(?:False|True)\b/i,
    // Convention: class-names are always all upper-case characters
    "class-name": /\b[A-Z][\dA-Z_]*\b/,
    number: [
      // hexa | octal | bin
      /\b0[xcb][\da-f](?:_*[\da-f])*\b/i,
      // Decimal
      /(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i
    ],
    punctuation: /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,
    operator: /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/
  };
}
K_e.displayName = "ejs";
K_e.aliases = ["eta"];
function K_e(i) {
  i.register(_u), i.register(bu), (function(e) {
    e.languages.ejs = {
      delimiter: {
        pattern: /^<%[-_=]?|[-_]?%>$/,
        alias: "punctuation"
      },
      comment: /^#[\s\S]*/,
      "language-javascript": {
        pattern: /[\s\S]+/,
        inside: e.languages.javascript
      }
    }, e.hooks.add("before-tokenize", function(t) {
      var n = /<%(?!%)[\s\S]+?%>/g;
      e.languages["markup-templating"].buildPlaceholders(
        t,
        "ejs",
        n
      );
    }), e.hooks.add("after-tokenize", function(t) {
      e.languages["markup-templating"].tokenizePlaceholders(t, "ejs");
    }), e.languages.eta = e.languages.ejs;
  })(i);
}
Y_e.displayName = "elixir";
Y_e.aliases = [];
function Y_e(i) {
  i.languages.elixir = {
    doc: {
      pattern: /@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/,
      inside: {
        attribute: /^@\w+/,
        string: /['"][\s\S]+/
      }
    },
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    // ~r"""foo""" (multi-line), ~r'''foo''' (multi-line), ~r/foo/, ~r|foo|, ~r"foo", ~r'foo', ~r(foo), ~r[foo], ~r{foo}, ~r<foo>
    regex: {
      pattern: /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,
      greedy: !0
    },
    string: [
      {
        // ~s"""foo""" (multi-line), ~s'''foo''' (multi-line), ~s/foo/, ~s|foo|, ~s"foo", ~s'foo', ~s(foo), ~s[foo], ~s{foo} (with interpolation care), ~s<foo>
        pattern: /~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/,
        greedy: !0,
        inside: {
          // See interpolation below
        }
      },
      {
        pattern: /("""|''')[\s\S]*?\1/,
        greedy: !0,
        inside: {
          // See interpolation below
        }
      },
      {
        // Multi-line strings are allowed
        pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
        greedy: !0,
        inside: {
          // See interpolation below
        }
      }
    ],
    atom: {
      // Look-behind prevents bad highlighting of the :: operator
      pattern: /(^|[^:]):\w+/,
      lookbehind: !0,
      alias: "symbol"
    },
    module: {
      pattern: /\b[A-Z]\w*\b/,
      alias: "class-name"
    },
    // Look-ahead prevents bad highlighting of the :: operator
    "attr-name": /\b\w+\??:(?!:)/,
    argument: {
      // Look-behind prevents bad highlighting of the && operator
      pattern: /(^|[^&])&\d+/,
      lookbehind: !0,
      alias: "variable"
    },
    attribute: {
      pattern: /@\w+/,
      alias: "variable"
    },
    function: /\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/,
    number: /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,
    keyword: /\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/,
    boolean: /\b(?:false|nil|true)\b/,
    operator: [
      /\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,
      {
        // We don't want to match <<
        pattern: /([^<])<(?!<)/,
        lookbehind: !0
      },
      {
        // We don't want to match >>
        pattern: /([^>])>(?!>)/,
        lookbehind: !0
      }
    ],
    punctuation: /<<|>>|[.,%\[\]{}()]/
  }, i.languages.elixir.string.forEach(function(e) {
    e.inside = {
      interpolation: {
        pattern: /#\{[^}]+\}/,
        inside: {
          delimiter: {
            pattern: /^#\{|\}$/,
            alias: "punctuation"
          },
          rest: i.languages.elixir
        }
      }
    };
  });
}
X_e.displayName = "elm";
X_e.aliases = [];
function X_e(i) {
  i.languages.elm = {
    comment: /--.*|\{-[\s\S]*?-\}/,
    char: {
      pattern: /'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}))'/,
      greedy: !0
    },
    string: [
      {
        // Multiline strings are wrapped in triple ". Quotes may appear unescaped.
        pattern: /"""[\s\S]*?"""/,
        greedy: !0
      },
      {
        pattern: /"(?:[^\\"\r\n]|\\.)*"/,
        greedy: !0
      }
    ],
    "import-statement": {
      // The imported or hidden names are not included in this import
      // statement. This is because we want to highlight those exactly like
      // we do for the names in the program.
      pattern: /(^[\t ]*)import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,
      lookbehind: !0,
      inside: {
        keyword: /\b(?:as|exposing|import)\b/
      }
    },
    keyword: /\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/,
    // These are builtin variables only. Constructors are highlighted later as a constant.
    builtin: /\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/,
    // decimal integers and floating point numbers | hexadecimal integers
    number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i,
    // Most of this is needed because of the meaning of a single '.'.
    // If it stands alone freely, it is the function composition.
    // It may also be a separator between a module name and an identifier => no
    // operator. If it comes together with other special characters it is an
    // operator too.
    // Valid operator characters in 0.18: +-/*=.$<>:&|^?%#@~!
    // Ref: https://groups.google.com/forum/#!msg/elm-dev/0AHSnDdkSkQ/E0SVU70JEQAJ
    operator: /\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/,
    // In Elm, nearly everything is a variable, do not highlight these.
    hvariable: /\b(?:[A-Z]\w*\.)*[a-z]\w*\b/,
    constant: /\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/,
    punctuation: /[{}[\]|(),.:]/
  };
}
Z_e.displayName = "etlua";
Z_e.aliases = [];
function Z_e(i) {
  i.register(n6), i.register(bu), (function(e) {
    e.languages.etlua = {
      delimiter: {
        pattern: /^<%[-=]?|-?%>$/,
        alias: "punctuation"
      },
      "language-lua": {
        pattern: /[\s\S]+/,
        inside: e.languages.lua
      }
    }, e.hooks.add("before-tokenize", function(t) {
      var n = /<%[\s\S]+?%>/g;
      e.languages["markup-templating"].buildPlaceholders(
        t,
        "etlua",
        n
      );
    }), e.hooks.add("after-tokenize", function(t) {
      e.languages["markup-templating"].tokenizePlaceholders(t, "etlua");
    });
  })(i);
}
Q_e.displayName = "erb";
Q_e.aliases = [];
function Q_e(i) {
  i.register(bu), i.register(hk), (function(e) {
    e.languages.erb = {
      delimiter: {
        pattern: /^(\s*)<%=?|%>(?=\s*$)/,
        lookbehind: !0,
        alias: "punctuation"
      },
      ruby: {
        pattern: /\s*\S[\s\S]*/,
        alias: "language-ruby",
        inside: e.languages.ruby
      }
    }, e.hooks.add("before-tokenize", function(t) {
      var n = /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/g;
      e.languages["markup-templating"].buildPlaceholders(
        t,
        "erb",
        n
      );
    }), e.hooks.add("after-tokenize", function(t) {
      e.languages["markup-templating"].tokenizePlaceholders(t, "erb");
    });
  })(i);
}
J_e.displayName = "erlang";
J_e.aliases = [];
function J_e(i) {
  i.languages.erlang = {
    comment: /%.+/,
    string: {
      pattern: /"(?:\\.|[^\\"\r\n])*"/,
      greedy: !0
    },
    "quoted-function": {
      pattern: /'(?:\\.|[^\\'\r\n])+'(?=\()/,
      alias: "function"
    },
    "quoted-atom": {
      pattern: /'(?:\\.|[^\\'\r\n])+'/,
      alias: "atom"
    },
    boolean: /\b(?:false|true)\b/,
    keyword: /\b(?:after|begin|case|catch|end|fun|if|of|receive|try|when)\b/,
    number: [
      /\$\\?./,
      /\b\d+#[a-z0-9]+/i,
      /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i
    ],
    function: /\b[a-z][\w@]*(?=\()/,
    variable: {
      // Look-behind is used to prevent wrong highlighting of atoms containing "@"
      pattern: /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,
      lookbehind: !0
    },
    operator: [
      /[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/,
      {
        // We don't want to match <<
        pattern: /(^|[^<])<(?!<)/,
        lookbehind: !0
      },
      {
        // We don't want to match >>
        pattern: /(^|[^>])>(?!>)/,
        lookbehind: !0
      }
    ],
    atom: /\b[a-z][\w@]*/,
    punctuation: /[()[\]{}:;,.#|]|<<|>>/
  };
}
ebe.displayName = "excel-formula";
ebe.aliases = ["xls", "xlsx"];
function ebe(i) {
  i.languages["excel-formula"] = {
    comment: {
      pattern: /(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i,
      lookbehind: !0,
      greedy: !0
    },
    string: {
      pattern: /"(?:[^"]|"")*"(?!")/,
      greedy: !0
    },
    reference: {
      // https://www.ablebits.com/office-addins-blog/2015/12/08/excel-reference-another-sheet-workbook/
      // Sales!B2
      // 'Winter sales'!B2
      // [Sales.xlsx]Jan!B2:B5
      // D:\Reports\[Sales.xlsx]Jan!B2:B5
      // '[Sales.xlsx]Jan sales'!B2:B5
      // 'D:\Reports\[Sales.xlsx]Jan sales'!B2:B5
      pattern: /(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/,
      greedy: !0,
      alias: "string",
      inside: {
        operator: /!$/,
        punctuation: /'/,
        sheet: {
          pattern: /[^[\]]+$/,
          alias: "function"
        },
        file: {
          pattern: /\[[^[\]]+\]$/,
          inside: {
            punctuation: /[[\]]/
          }
        },
        path: /[\s\S]+/
      }
    },
    "function-name": {
      pattern: /\b[A-Z]\w*(?=\()/i,
      alias: "builtin"
    },
    range: {
      pattern: /\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,
      alias: "selector",
      inside: {
        operator: /:/,
        cell: /\$?[A-Z]+\$?\d+/i,
        column: /\$?[A-Z]+/i,
        row: /\$?\d+/
      }
    },
    cell: {
      // Excel is case insensitive, so the string "foo1" could be either a variable or a cell.
      // To combat this, we match cells case insensitive, if the contain at least one "$", and case sensitive otherwise.
      pattern: /\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,
      alias: "selector"
    },
    number: /(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,
    boolean: /\b(?:FALSE|TRUE)\b/i,
    operator: /[-+*/^%=&,]|<[=>]?|>=?/,
    punctuation: /[[\]();{}|]/
  }, i.languages.xlsx = i.languages.xls = i.languages["excel-formula"];
}
tbe.displayName = "fsharp";
tbe.aliases = [];
function tbe(i) {
  i.register(Wr), i.languages.fsharp = i.languages.extend("clike", {
    comment: [
      {
        pattern: /(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/,
        lookbehind: !0,
        greedy: !0
      },
      {
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: {
      pattern: /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?/,
      greedy: !0
    },
    "class-name": {
      pattern: /(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/,
      lookbehind: !0,
      inside: {
        operator: /->|\*/,
        punctuation: /\./
      }
    },
    keyword: /\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|asr|assert|atomic|base|begin|break|checked|class|component|const|constraint|constructor|continue|default|delegate|do|done|downcast|downto|eager|elif|else|end|event|exception|extern|external|false|finally|fixed|for|fun|function|functor|global|if|in|include|inherit|inline|interface|internal|land|lazy|lor|lsl|lsr|lxor|match|member|method|mixin|mod|module|mutable|namespace|new|not|null|object|of|open|or|override|parallel|private|process|protected|public|pure|rec|sealed|select|sig|static|struct|tailcall|then|to|trait|true|try|type|upcast|val|virtual|void|volatile|when|while|with)\b/,
    number: [
      /\b0x[\da-fA-F]+(?:LF|lf|un)?\b/,
      /\b0b[01]+(?:uy|y)?\b/,
      /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i,
      /\b\d+(?:[IlLsy]|UL|u[lsy]?)?\b/
    ],
    operator: /([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|<?\|{1,3}>?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/
  }), i.languages.insertBefore("fsharp", "keyword", {
    preprocessor: {
      pattern: /(^[\t ]*)#.*/m,
      lookbehind: !0,
      alias: "property",
      inside: {
        directive: {
          pattern: /(^#)\b(?:else|endif|if|light|line|nowarn)\b/,
          lookbehind: !0,
          alias: "keyword"
        }
      }
    }
  }), i.languages.insertBefore("fsharp", "punctuation", {
    "computation-expression": {
      pattern: /\b[_a-z]\w*(?=\s*\{)/i,
      alias: "keyword"
    }
  }), i.languages.insertBefore("fsharp", "string", {
    annotation: {
      pattern: /\[<.+?>\]/,
      greedy: !0,
      inside: {
        punctuation: /^\[<|>\]$/,
        "class-name": {
          pattern: /^\w+$|(^|;\s*)[A-Z]\w*(?=\()/,
          lookbehind: !0
        },
        "annotation-content": {
          pattern: /[\s\S]+/,
          inside: i.languages.fsharp
        }
      }
    },
    char: {
      pattern: /'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/,
      greedy: !0
    }
  });
}
nbe.displayName = "factor";
nbe.aliases = [];
function nbe(i) {
  (function(e) {
    var t = {
      function: /\b(?:BUGS?|FIX(?:MES?)?|NOTES?|TODOS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/
    }, n = {
      number: /\\[^\s']|%\w/
    }, r = {
      comment: [
        {
          // ! single-line exclamation point comments with whitespace after/around the !
          pattern: /(^|\s)(?:! .*|!$)/,
          lookbehind: !0,
          inside: t
        },
        {
          // /* comment */, /* comment*/
          pattern: /(^|\s)\/\*\s[\s\S]*?\*\/(?=\s|$)/,
          lookbehind: !0,
          greedy: !0,
          inside: t
        },
        {
          // ![[ comment ]] , ![===[ comment]===]
          pattern: /(^|\s)!\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,
          lookbehind: !0,
          greedy: !0,
          inside: t
        }
      ],
      number: [
        {
          // basic base 10 integers 9, -9
          pattern: /(^|\s)[+-]?\d+(?=\s|$)/,
          lookbehind: !0
        },
        {
          // base prefix integers 0b010 0o70 0xad 0d10 0XAD -0xa9
          pattern: /(^|\s)[+-]?0(?:b[01]+|o[0-7]+|d\d+|x[\dA-F]+)(?=\s|$)/i,
          lookbehind: !0
        },
        {
          // fractional ratios 1/5 -1/5 and the literal float approximations 1/5. -1/5.
          pattern: /(^|\s)[+-]?\d+\/\d+\.?(?=\s|$)/,
          lookbehind: !0
        },
        {
          // positive mixed numbers 23+1/5 +23+1/5
          pattern: /(^|\s)\+?\d+\+\d+\/\d+(?=\s|$)/,
          lookbehind: !0
        },
        {
          // negative mixed numbers -23-1/5
          pattern: /(^|\s)-\d+-\d+\/\d+(?=\s|$)/,
          lookbehind: !0
        },
        {
          // basic decimal floats -0.01 0. .0 .1 -.1 -1. -12.13 +12.13
          // and scientific notation with base 10 exponents 3e4 3e-4 .3e-4
          pattern: /(^|\s)[+-]?(?:\d*\.\d+|\d+\.\d*|\d+)(?:e[+-]?\d+)?(?=\s|$)/i,
          lookbehind: !0
        },
        {
          // NAN literal syntax NAN: 80000deadbeef, NAN: a
          pattern: /(^|\s)NAN:\s+[\da-fA-F]+(?=\s|$)/,
          lookbehind: !0
        },
        {
          /*
          base prefix floats 0x1.0p3 (8.0) 0b1.010p2 (5.0) 0x1.p1 0b1.11111111p11111...
          "The normalized hex form ±0x1.MMMMMMMMMMMMM[pP]±EEEE allows any floating-point number to be specified precisely.
          The values of MMMMMMMMMMMMM and EEEE map directly to the mantissa and exponent fields of the binary IEEE 754 representation."
          <https://docs.factorcode.org/content/article-syntax-floats.html>
          */
          pattern: /(^|\s)[+-]?0(?:b1\.[01]*|o1\.[0-7]*|d1\.\d*|x1\.[\dA-F]*)p\d+(?=\s|$)/i,
          lookbehind: !0
        }
      ],
      // R/ regexp?\/\\/
      regexp: {
        pattern: /(^|\s)R\/\s(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/,
        lookbehind: !0,
        alias: "number",
        inside: {
          variable: /\\\S/,
          keyword: /[+?*\[\]^$(){}.|]/,
          operator: {
            pattern: /(\/)[idmsr]+(?:-[idmsr]+)?/,
            lookbehind: !0
          }
        }
      },
      boolean: {
        pattern: /(^|\s)[tf](?=\s|$)/,
        lookbehind: !0
      },
      // SBUF" asd", URL" ://...", P" /etc/"
      "custom-string": {
        pattern: /(^|\s)[A-Z0-9\-]+"\s(?:\\\S|[^"\\])*"/,
        lookbehind: !0,
        greedy: !0,
        alias: "string",
        inside: {
          number: /\\\S|%\w|\//
        }
      },
      "multiline-string": [
        {
          // STRING: name \n content \n ; -> CONSTANT: name "content" (symbol)
          pattern: /(^|\s)STRING:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*;(?=\s|$)/,
          lookbehind: !0,
          greedy: !0,
          alias: "string",
          inside: {
            number: n.number,
            // trailing semicolon on its own line
            "semicolon-or-setlocal": {
              pattern: /([\r\n][ \t]*);(?=\s|$)/,
              lookbehind: !0,
              alias: "function"
            }
          }
        },
        {
          // HEREDOC: marker \n content \n marker ; -> "content" (immediate)
          pattern: /(^|\s)HEREDOC:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*\S+(?=\s|$)/,
          lookbehind: !0,
          greedy: !0,
          alias: "string",
          inside: n
        },
        {
          // [[ string ]], [==[ string]==]
          pattern: /(^|\s)\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,
          lookbehind: !0,
          greedy: !0,
          alias: "string",
          inside: n
        }
      ],
      "special-using": {
        pattern: /(^|\s)USING:(?:\s\S+)*(?=\s+;(?:\s|$))/,
        lookbehind: !0,
        alias: "function",
        inside: {
          // this is essentially a regex for vocab names, which i don't want to specify
          // but the USING: gets picked up as a vocab name
          string: {
            pattern: /(\s)[^:\s]+/,
            lookbehind: !0
          }
        }
      },
      /* this description of stack effect literal syntax is not complete and not as specific as theoretically possible
      trying to do better is more work and regex-computation-time than it's worth though.
      - we'd like to have the "delimiter" parts of the stack effect [ (, --, and ) ] be a different (less-important or comment-like) colour to the stack effect contents
      - we'd like if nested stack effects were treated as such rather than just appearing flat (with `inside`)
      - we'd like if the following variable name conventions were recognised specifically:
      special row variables = ..a b..
      type and stack effect annotations end with a colon = ( quot: ( a: ( -- ) -- b ) -- x ), ( x: number -- )
      word throws unconditional error = *
      any other word-like variable name = a ? q' etc
      https://docs.factorcode.org/content/article-effects.html
      these are pretty complicated to highlight properly without a real parser, and therefore out of scope
      the old pattern, which may be later useful, was: (^|\s)(?:call|execute|eval)?\((?:\s+[^"\r\n\t ]\S*)*?\s+--(?:\s+[^"\n\t ]\S*)*?\s+\)(?=\s|$)
      */
      // current solution is not great
      "stack-effect-delimiter": [
        {
          // opening parenthesis
          pattern: /(^|\s)(?:call|eval|execute)?\((?=\s)/,
          lookbehind: !0,
          alias: "operator"
        },
        {
          // middle --
          pattern: /(\s)--(?=\s)/,
          lookbehind: !0,
          alias: "operator"
        },
        {
          // closing parenthesis
          pattern: /(\s)\)(?=\s|$)/,
          lookbehind: !0,
          alias: "operator"
        }
      ],
      combinators: {
        pattern: null,
        lookbehind: !0,
        alias: "keyword"
      },
      "kernel-builtin": {
        pattern: null,
        lookbehind: !0,
        alias: "variable"
      },
      "sequences-builtin": {
        pattern: null,
        lookbehind: !0,
        alias: "variable"
      },
      "math-builtin": {
        pattern: null,
        lookbehind: !0,
        alias: "variable"
      },
      "constructor-word": {
        // <array> but not <=>
        pattern: /(^|\s)<(?!=+>|-+>)\S+>(?=\s|$)/,
        lookbehind: !0,
        alias: "keyword"
      },
      "other-builtin-syntax": {
        pattern: null,
        lookbehind: !0,
        alias: "operator"
      },
      /*
      full list of supported word naming conventions: (the convention appears outside of the [brackets])
      set-[x]
      change-[x]
      with-[x]
      new-[x]
      >[string]
      [base]>
      [string]>[number]
      +[symbol]+
      [boolean-word]?
      ?[of]
      [slot-reader]>>
      >>[slot-setter]
      [slot-writer]<<
      ([implementation-detail])
      [mutater]!
      [variant]*
      [prettyprint].
      $[help-markup]
      <constructors>, SYNTAX:, etc are supported by their own patterns.
      `with` and `new` from `kernel` are their own builtins.
      see <https://docs.factorcode.org/content/article-conventions.html>
      */
      "conventionally-named-word": {
        pattern: /(^|\s)(?!")(?:(?:change|new|set|with)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/,
        lookbehind: !0,
        alias: "keyword"
      },
      "colon-syntax": {
        pattern: /(^|\s)(?:[A-Z0-9\-]+#?)?:{1,2}\s+(?:;\S+|(?!;)\S+)(?=\s|$)/,
        lookbehind: !0,
        greedy: !0,
        alias: "function"
      },
      "semicolon-or-setlocal": {
        pattern: /(\s)(?:;|:>)(?=\s|$)/,
        lookbehind: !0,
        alias: "function"
      },
      // do not highlight leading } or trailing X{ at the begin/end of the file as it's invalid syntax
      "curly-brace-literal-delimiter": [
        {
          // opening
          pattern: /(^|\s)[a-z]*\{(?=\s)/i,
          lookbehind: !0,
          alias: "operator"
        },
        {
          // closing
          pattern: /(\s)\}(?=\s|$)/,
          lookbehind: !0,
          alias: "operator"
        }
      ],
      // do not highlight leading ] or trailing [ at the begin/end of the file as it's invalid syntax
      "quotation-delimiter": [
        {
          // opening
          pattern: /(^|\s)\[(?=\s)/,
          lookbehind: !0,
          alias: "operator"
        },
        {
          // closing
          pattern: /(\s)\](?=\s|$)/,
          lookbehind: !0,
          alias: "operator"
        }
      ],
      "normal-word": {
        pattern: /(^|\s)[^"\s]\S*(?=\s|$)/,
        lookbehind: !0
      },
      /*
      basic first-class string "a"
      with escaped double-quote "a\""
      escaped backslash "\\"
      and general escapes since Factor has so many "\N"
      syntax that works in the reference implementation that isn't fully
      supported because it's an implementation detail:
      "string 1""string 2" -> 2 strings (works anyway)
      "string"5 -> string, 5
      "string"[ ] -> string, quotation
      { "a"} -> array<string>
      the rest of those examples all properly recognise the string, but not
      the other object (number, quotation, etc)
      this is fine for a regex-only implementation.
      */
      string: {
        pattern: /"(?:\\\S|[^"\\])*"/,
        greedy: !0,
        inside: n
      }
    }, s = function(c) {
      return (c + "").replace(/([.?*+\^$\[\]\\(){}|\-])/g, "\\$1");
    }, o = function(c) {
      return new RegExp("(^|\\s)(?:" + c.map(s).join("|") + ")(?=\\s|$)");
    }, a = {
      "kernel-builtin": [
        "or",
        "2nipd",
        "4drop",
        "tuck",
        "wrapper",
        "nip",
        "wrapper?",
        "callstack>array",
        "die",
        "dupd",
        "callstack",
        "callstack?",
        "3dup",
        "hashcode",
        "pick",
        "4nip",
        "build",
        ">boolean",
        "nipd",
        "clone",
        "5nip",
        "eq?",
        "?",
        "=",
        "swapd",
        "2over",
        "clear",
        "2dup",
        "get-retainstack",
        "not",
        "tuple?",
        "dup",
        "3nipd",
        "call",
        "-rotd",
        "object",
        "drop",
        "assert=",
        "assert?",
        "-rot",
        "execute",
        "boa",
        "get-callstack",
        "curried?",
        "3drop",
        "pickd",
        "overd",
        "over",
        "roll",
        "3nip",
        "swap",
        "and",
        "2nip",
        "rotd",
        "throw",
        "(clone)",
        "hashcode*",
        "spin",
        "reach",
        "4dup",
        "equal?",
        "get-datastack",
        "assert",
        "2drop",
        "<wrapper>",
        "boolean?",
        "identity-hashcode",
        "identity-tuple?",
        "null",
        "composed?",
        "new",
        "5drop",
        "rot",
        "-roll",
        "xor",
        "identity-tuple",
        "boolean"
      ],
      "other-builtin-syntax": [
        // syntax
        "=======",
        "recursive",
        "flushable",
        ">>",
        "<<<<<<",
        "M\\",
        "B",
        "PRIVATE>",
        "\\",
        "======",
        "final",
        "inline",
        "delimiter",
        "deprecated",
        "<PRIVATE",
        ">>>>>>",
        "<<<<<<<",
        "parse-complex",
        "malformed-complex",
        "read-only",
        ">>>>>>>",
        "call-next-method",
        "<<",
        "foldable",
        // literals
        "$",
        "$[",
        "${"
      ],
      "sequences-builtin": [
        "member-eq?",
        "mismatch",
        "append",
        "assert-sequence=",
        "longer",
        "repetition",
        "clone-like",
        "3sequence",
        "assert-sequence?",
        "last-index-from",
        "reversed",
        "index-from",
        "cut*",
        "pad-tail",
        "join-as",
        "remove-eq!",
        "concat-as",
        "but-last",
        "snip",
        "nths",
        "nth",
        "sequence",
        "longest",
        "slice?",
        "<slice>",
        "remove-nth",
        "tail-slice",
        "empty?",
        "tail*",
        "member?",
        "virtual-sequence?",
        "set-length",
        "drop-prefix",
        "iota",
        "unclip",
        "bounds-error?",
        "unclip-last-slice",
        "non-negative-integer-expected",
        "non-negative-integer-expected?",
        "midpoint@",
        "longer?",
        "?set-nth",
        "?first",
        "rest-slice",
        "prepend-as",
        "prepend",
        "fourth",
        "sift",
        "subseq-start",
        "new-sequence",
        "?last",
        "like",
        "first4",
        "1sequence",
        "reverse",
        "slice",
        "virtual@",
        "repetition?",
        "set-last",
        "index",
        "4sequence",
        "max-length",
        "set-second",
        "immutable-sequence",
        "first2",
        "first3",
        "supremum",
        "unclip-slice",
        "suffix!",
        "insert-nth",
        "tail",
        "3append",
        "short",
        "suffix",
        "concat",
        "flip",
        "immutable?",
        "reverse!",
        "2sequence",
        "sum",
        "delete-all",
        "indices",
        "snip-slice",
        "<iota>",
        "check-slice",
        "sequence?",
        "head",
        "append-as",
        "halves",
        "sequence=",
        "collapse-slice",
        "?second",
        "slice-error?",
        "product",
        "bounds-check?",
        "bounds-check",
        "immutable",
        "virtual-exemplar",
        "harvest",
        "remove",
        "pad-head",
        "last",
        "set-fourth",
        "cartesian-product",
        "remove-eq",
        "shorten",
        "shorter",
        "reversed?",
        "shorter?",
        "shortest",
        "head-slice",
        "pop*",
        "tail-slice*",
        "but-last-slice",
        "iota?",
        "append!",
        "cut-slice",
        "new-resizable",
        "head-slice*",
        "sequence-hashcode",
        "pop",
        "set-nth",
        "?nth",
        "second",
        "join",
        "immutable-sequence?",
        "<reversed>",
        "3append-as",
        "virtual-sequence",
        "subseq?",
        "remove-nth!",
        "length",
        "last-index",
        "lengthen",
        "assert-sequence",
        "copy",
        "move",
        "third",
        "first",
        "tail?",
        "set-first",
        "prefix",
        "bounds-error",
        "<repetition>",
        "exchange",
        "surround",
        "cut",
        "min-length",
        "set-third",
        "push-all",
        "head?",
        "subseq-start-from",
        "delete-slice",
        "rest",
        "sum-lengths",
        "head*",
        "infimum",
        "remove!",
        "glue",
        "slice-error",
        "subseq",
        "push",
        "replace-slice",
        "subseq-as",
        "unclip-last"
      ],
      "math-builtin": [
        "number=",
        "next-power-of-2",
        "?1+",
        "fp-special?",
        "imaginary-part",
        "float>bits",
        "number?",
        "fp-infinity?",
        "bignum?",
        "fp-snan?",
        "denominator",
        "gcd",
        "*",
        "+",
        "fp-bitwise=",
        "-",
        "u>=",
        "/",
        ">=",
        "bitand",
        "power-of-2?",
        "log2-expects-positive",
        "neg?",
        "<",
        "log2",
        ">",
        "integer?",
        "number",
        "bits>double",
        "2/",
        "zero?",
        "bits>float",
        "float?",
        "shift",
        "ratio?",
        "rect>",
        "even?",
        "ratio",
        "fp-sign",
        "bitnot",
        ">fixnum",
        "complex?",
        "/i",
        "integer>fixnum",
        "/f",
        "sgn",
        ">bignum",
        "next-float",
        "u<",
        "u>",
        "mod",
        "recip",
        "rational",
        ">float",
        "2^",
        "integer",
        "fixnum?",
        "neg",
        "fixnum",
        "sq",
        "bignum",
        ">rect",
        "bit?",
        "fp-qnan?",
        "simple-gcd",
        "complex",
        "<fp-nan>",
        "real",
        ">fraction",
        "double>bits",
        "bitor",
        "rem",
        "fp-nan-payload",
        "real-part",
        "log2-expects-positive?",
        "prev-float",
        "align",
        "unordered?",
        "float",
        "fp-nan?",
        "abs",
        "bitxor",
        "integer>fixnum-strict",
        "u<=",
        "odd?",
        "<=",
        "/mod",
        ">integer",
        "real?",
        "rational?",
        "numerator"
      ]
      // that's all for now
    };
    Object.keys(a).forEach(function(c) {
      r[c].pattern = o(a[c]);
    });
    var l = [
      // kernel
      "2bi",
      "while",
      "2tri",
      "bi*",
      "4dip",
      "both?",
      "same?",
      "tri@",
      "curry",
      "prepose",
      "3bi",
      "?if",
      "tri*",
      "2keep",
      "3keep",
      "curried",
      "2keepd",
      "when",
      "2bi*",
      "2tri*",
      "4keep",
      "bi@",
      "keepdd",
      "do",
      "unless*",
      "tri-curry",
      "if*",
      "loop",
      "bi-curry*",
      "when*",
      "2bi@",
      "2tri@",
      "with",
      "2with",
      "either?",
      "bi",
      "until",
      "3dip",
      "3curry",
      "tri-curry*",
      "tri-curry@",
      "bi-curry",
      "keepd",
      "compose",
      "2dip",
      "if",
      "3tri",
      "unless",
      "tuple",
      "keep",
      "2curry",
      "tri",
      "most",
      "while*",
      "dip",
      "composed",
      "bi-curry@",
      // sequences
      "find-last-from",
      "trim-head-slice",
      "map-as",
      "each-from",
      "none?",
      "trim-tail",
      "partition",
      "if-empty",
      "accumulate*",
      "reject!",
      "find-from",
      "accumulate-as",
      "collector-for-as",
      "reject",
      "map",
      "map-sum",
      "accumulate!",
      "2each-from",
      "follow",
      "supremum-by",
      "map!",
      "unless-empty",
      "collector",
      "padding",
      "reduce-index",
      "replicate-as",
      "infimum-by",
      "trim-tail-slice",
      "count",
      "find-index",
      "filter",
      "accumulate*!",
      "reject-as",
      "map-integers",
      "map-find",
      "reduce",
      "selector",
      "interleave",
      "2map",
      "filter-as",
      "binary-reduce",
      "map-index-as",
      "find",
      "produce",
      "filter!",
      "replicate",
      "cartesian-map",
      "cartesian-each",
      "find-index-from",
      "map-find-last",
      "3map-as",
      "3map",
      "find-last",
      "selector-as",
      "2map-as",
      "2map-reduce",
      "accumulate",
      "each",
      "each-index",
      "accumulate*-as",
      "when-empty",
      "all?",
      "collector-as",
      "push-either",
      "new-like",
      "collector-for",
      "2selector",
      "push-if",
      "2all?",
      "map-reduce",
      "3each",
      "any?",
      "trim-slice",
      "2reduce",
      "change-nth",
      "produce-as",
      "2each",
      "trim",
      "trim-head",
      "cartesian-find",
      "map-index",
      // math
      "if-zero",
      "each-integer",
      "unless-zero",
      "(find-integer)",
      "when-zero",
      "find-last-integer",
      "(all-integers?)",
      "times",
      "(each-integer)",
      "find-integer",
      "all-integers?",
      // math.combinators
      "unless-negative",
      "if-positive",
      "when-positive",
      "when-negative",
      "unless-positive",
      "if-negative",
      // combinators
      "case",
      "2cleave",
      "cond>quot",
      "case>quot",
      "3cleave",
      "wrong-values",
      "to-fixed-point",
      "alist>quot",
      "cond",
      "cleave",
      "call-effect",
      "recursive-hashcode",
      "spread",
      "deep-spread>quot",
      // combinators.short-circuit
      "2||",
      "0||",
      "n||",
      "0&&",
      "2&&",
      "3||",
      "1||",
      "1&&",
      "n&&",
      "3&&",
      // combinators.smart
      "smart-unless*",
      "keep-inputs",
      "reduce-outputs",
      "smart-when*",
      "cleave>array",
      "smart-with",
      "smart-apply",
      "smart-if",
      "inputs/outputs",
      "output>sequence-n",
      "map-outputs",
      "map-reduce-outputs",
      "dropping",
      "output>array",
      "smart-map-reduce",
      "smart-2map-reduce",
      "output>array-n",
      "nullary",
      "input<sequence",
      "append-outputs",
      "drop-inputs",
      "inputs",
      "smart-2reduce",
      "drop-outputs",
      "smart-reduce",
      "preserving",
      "smart-when",
      "outputs",
      "append-outputs-as",
      "smart-unless",
      "smart-if*",
      "sum-outputs",
      "input<sequence-unsafe",
      "output>sequence"
      // tafn
    ];
    r.combinators.pattern = o(l), e.languages.factor = r;
  })(i);
}
ibe.displayName = "false";
ibe.aliases = [];
function ibe(i) {
  (function(e) {
    e.languages.false = {
      comment: {
        pattern: /\{[^}]*\}/
      },
      string: {
        pattern: /"[^"]*"/,
        greedy: !0
      },
      "character-code": {
        pattern: /'(?:[^\r]|\r\n?)/,
        alias: "number"
      },
      "assembler-code": {
        pattern: /\d+`/,
        alias: "important"
      },
      number: /\d+/,
      operator: /[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/,
      punctuation: /\[|\]/,
      variable: /[a-z]/,
      "non-standard": {
        pattern: /[()<BDO®]/,
        alias: "bold"
      }
    };
  })(i);
}
rbe.displayName = "firestore-security-rules";
rbe.aliases = [];
function rbe(i) {
  i.register(Wr), i.languages["firestore-security-rules"] = i.languages.extend(
    "clike",
    {
      comment: /\/\/.*/,
      keyword: /\b(?:allow|function|if|match|null|return|rules_version|service)\b/,
      operator: /&&|\|\||[<>!=]=?|[-+*/%]|\b(?:in|is)\b/
    }
  ), delete i.languages["firestore-security-rules"]["class-name"], i.languages.insertBefore("firestore-security-rules", "keyword", {
    path: {
      pattern: /(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        variable: {
          pattern: /\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,
          inside: {
            operator: /=/,
            keyword: /\*\*/,
            punctuation: /[.$(){}]/
          }
        },
        punctuation: /\//
      }
    },
    method: {
      // to make the pattern shorter, the actual method names are omitted
      pattern: /(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,
      lookbehind: !0,
      alias: "builtin",
      inside: {
        punctuation: /,/
      }
    }
  });
}
sbe.displayName = "flow";
sbe.aliases = [];
function sbe(i) {
  i.register(_u), (function(e) {
    e.languages.flow = e.languages.extend("javascript", {}), e.languages.insertBefore("flow", "keyword", {
      type: [
        {
          pattern: /\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,
          alias: "class-name"
        }
      ]
    }), e.languages.flow["function-variable"].pattern = /(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i, delete e.languages.flow.parameter, e.languages.insertBefore("flow", "operator", {
      "flow-punctuation": {
        pattern: /\{\||\|\}/,
        alias: "punctuation"
      }
    }), Array.isArray(e.languages.flow.keyword) || (e.languages.flow.keyword = [e.languages.flow.keyword]), e.languages.flow.keyword.unshift(
      {
        pattern: /(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,
        lookbehind: !0
      }
    );
  })(i);
}
obe.displayName = "fortran";
obe.aliases = [];
function obe(i) {
  i.languages.fortran = {
    "quoted-number": {
      pattern: /[BOZ](['"])[A-F0-9]+\1/i,
      alias: "number"
    },
    string: {
      pattern: /(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/,
      inside: {
        comment: {
          pattern: /(&(?:\r\n?|\n)\s*)!.*/,
          lookbehind: !0
        }
      }
    },
    comment: {
      pattern: /!.*/,
      greedy: !0
    },
    boolean: /\.(?:FALSE|TRUE)\.(?:_\w+)?/i,
    number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,
    keyword: [
      // Types
      /\b(?:CHARACTER|COMPLEX|DOUBLE ?PRECISION|INTEGER|LOGICAL|REAL)\b/i,
      // END statements
      /\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,
      // Statements
      /\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,
      // Others
      /\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEIF|ELSEWHERE|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i
    ],
    operator: [
      /\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i,
      {
        // Use lookbehind to prevent confusion with (/ /)
        pattern: /(^|(?!\().)\/(?!\))/,
        lookbehind: !0
      }
    ],
    punctuation: /\(\/|\/\)|[(),;:&]/
  };
}
abe.displayName = "ftl";
abe.aliases = [];
function abe(i) {
  i.register(bu), (function(e) {
    for (var t = /[^<()"']|\((?:<expr>)*\)|<(?!#--)|<#--(?:[^-]|-(?!->))*-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/.source, n = 0; n < 2; n++)
      t = t.replace(/<expr>/g, function() {
        return t;
      });
    t = t.replace(/<expr>/g, /[^\s\S]/.source);
    var r = {
      comment: /<#--[\s\S]*?-->/,
      string: [
        {
          // raw string
          pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/,
          greedy: !0
        },
        {
          pattern: RegExp(
            /("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:<expr>))*\})*\1/.source.replace(
              /<expr>/g,
              function() {
                return t;
              }
            )
          ),
          greedy: !0,
          inside: {
            interpolation: {
              pattern: RegExp(
                /((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:<expr>))*\}/.source.replace(
                  /<expr>/g,
                  function() {
                    return t;
                  }
                )
              ),
              lookbehind: !0,
              inside: {
                "interpolation-punctuation": {
                  pattern: /^\$\{|\}$/,
                  alias: "punctuation"
                },
                rest: null
              }
            }
          }
        }
      ],
      keyword: /\b(?:as)\b/,
      boolean: /\b(?:false|true)\b/,
      "builtin-function": {
        pattern: /((?:^|[^?])\?\s*)\w+/,
        lookbehind: !0,
        alias: "function"
      },
      function: /\b\w+(?=\s*\()/,
      number: /\b\d+(?:\.\d+)?\b/,
      operator: /\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,
      punctuation: /[,;.:()[\]{}]/
    };
    r.string[1].inside.interpolation.inside.rest = r, e.languages.ftl = {
      "ftl-comment": {
        // the pattern is shortened to be more efficient
        pattern: /^<#--[\s\S]*/,
        alias: "comment"
      },
      "ftl-directive": {
        pattern: /^<[\s\S]+>$/,
        inside: {
          directive: {
            pattern: /(^<\/?)[#@][a-z]\w*/i,
            lookbehind: !0,
            alias: "keyword"
          },
          punctuation: /^<\/?|\/?>$/,
          content: {
            pattern: /\s*\S[\s\S]*/,
            alias: "ftl",
            inside: r
          }
        }
      },
      "ftl-interpolation": {
        pattern: /^\$\{[\s\S]*\}$/,
        inside: {
          punctuation: /^\$\{|\}$/,
          content: {
            pattern: /\s*\S[\s\S]*/,
            alias: "ftl",
            inside: r
          }
        }
      }
    }, e.hooks.add("before-tokenize", function(s) {
      var o = RegExp(
        /<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:<expr>)*?>|\$\{(?:<expr>)*?\}/.source.replace(
          /<expr>/g,
          function() {
            return t;
          }
        ),
        "gi"
      );
      e.languages["markup-templating"].buildPlaceholders(
        s,
        "ftl",
        o
      );
    }), e.hooks.add("after-tokenize", function(s) {
      e.languages["markup-templating"].tokenizePlaceholders(s, "ftl");
    });
  })(i);
}
lbe.displayName = "gml";
lbe.aliases = ["gamemakerlanguage"];
function lbe(i) {
  i.register(Wr), i.languages.gamemakerlanguage = i.languages.gml = i.languages.extend("clike", {
    keyword: /\b(?:break|case|continue|default|do|else|enum|exit|for|globalvar|if|repeat|return|switch|until|var|while)\b/,
    number: /(?:\b0x[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ulf]{0,4}/i,
    operator: /--|\+\+|[-+%/=]=?|!=|\*\*?=?|<[<=>]?|>[=>]?|&&?|\^\^?|\|\|?|~|\b(?:and|at|not|or|with|xor)\b/,
    constant: /\b(?:GM_build_date|GM_version|action_(?:continue|restart|reverse|stop)|all|gamespeed_(?:fps|microseconds)|global|local|noone|other|pi|pointer_(?:invalid|null)|self|timezone_(?:local|utc)|undefined|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|post|pre)|keypress|keyrelease|trigger|(?:left|middle|no|right)_button|(?:left|middle|right)_press|(?:left|middle|right)_release|mouse_(?:enter|leave|wheel_down|wheel_up)|global_(?:left|middle|right)_button|global_(?:left|middle|right)_press|global_(?:left|middle|right)_release|joystick(?:1|2)_(?:button1|button2|button3|button4|button5|button6|button7|button8|down|left|right|up)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|gui|gui_begin|gui_end|step_(?:begin|end|normal))|vk_(?:alt|anykey|backspace|control|delete|down|end|enter|escape|home|insert|left|nokey|pagedown|pageup|pause|printscreen|return|right|shift|space|tab|up|f\d|numpad\d|add|decimal|divide|lalt|lcontrol|lshift|multiply|ralt|rcontrol|rshift|subtract)|achievement_(?:filter_(?:all_players|favorites_only|friends_only)|friends_info|info|leaderboard_info|our_info|pic_loaded|show_(?:achievement|bank|friend_picker|leaderboard|profile|purchase_prompt|ui)|type_challenge|type_score_challenge)|asset_(?:font|object|path|room|script|shader|sound|sprite|tiles|timeline|unknown)|audio_(?:3d|falloff_(?:exponent_distance|exponent_distance_clamped|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|none)|mono|new_system|old_system|stereo)|bm_(?:add|complex|dest_alpha|dest_color|dest_colour|inv_dest_alpha|inv_dest_color|inv_dest_colour|inv_src_alpha|inv_src_color|inv_src_colour|max|normal|one|src_alpha|src_alpha_sat|src_color|src_colour|subtract|zero)|browser_(?:chrome|firefox|ie|ie_mobile|not_a_browser|opera|safari|safari_mobile|tizen|unknown|windows_store)|buffer_(?:bool|f16|f32|f64|fast|fixed|generalerror|grow|invalidtype|network|outofbounds|outofspace|s16|s32|s8|seek_end|seek_relative|seek_start|string|text|u16|u32|u64|u8|vbuffer|wrap)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)|cmpfunc_(?:always|equal|greater|greaterequal|less|lessequal|never|notequal)|cr_(?:appstart|arrow|beam|cross|default|drag|handpoint|hourglass|none|size_all|size_nesw|size_ns|size_nwse|size_we|uparrow)|cull_(?:clockwise|counterclockwise|noculling)|device_(?:emulator|tablet)|device_ios_(?:ipad|ipad_retina|iphone|iphone5|iphone6|iphone6plus|iphone_retina|unknown)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|dll_(?:cdecl|cdel|stdcall)|ds_type_(?:grid|list|map|priority|queue|stack)|ef_(?:cloud|ellipse|explosion|firework|flare|rain|ring|smoke|smokeup|snow|spark|star)|fa_(?:archive|bottom|center|directory|hidden|left|middle|readonly|right|sysfile|top|volumeid)|fb_login_(?:default|fallback_to_webview|forcing_safari|forcing_webview|no_fallback_to_webview|use_system_account)|iap_(?:available|canceled|ev_consume|ev_product|ev_purchase|ev_restore|ev_storeload|failed|purchased|refunded|status_available|status_loading|status_processing|status_restoring|status_unavailable|status_uninitialised|storeload_failed|storeload_ok|unavailable)|leaderboard_type_(?:number|time_mins_secs)|lighttype_(?:dir|point)|matrix_(?:projection|view|world)|mb_(?:any|left|middle|none|right)|network_(?:config_(?:connect_timeout|disable_reliable_udp|enable_reliable_udp|use_non_blocking_socket)|socket_(?:bluetooth|tcp|udp)|type_(?:connect|data|disconnect|non_blocking_connect))|of_challenge_(?:lose|tie|win)|os_(?:android|ios|linux|macosx|ps3|ps4|psvita|unknown|uwp|win32|win8native|windows|winphone|xboxone)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|angle|angle_limits|damping_ratio|frequency|length_1|length_2|lower_angle_limit|max_force|max_length|max_motor_force|max_motor_torque|max_torque|motor_force|motor_speed|motor_torque|reaction_force_x|reaction_force_y|reaction_torque|speed|translation|upper_angle_limit)|phy_particle_data_flag_(?:category|color|colour|position|typeflags|velocity)|phy_particle_flag_(?:colormixing|colourmixing|elastic|powder|spring|tensile|viscous|wall|water|zombie)|phy_particle_group_flag_(?:rigid|solid)|pr_(?:linelist|linestrip|pointlist|trianglefan|trianglelist|trianglestrip)|ps_(?:distr|shape)_(?:diamond|ellipse|gaussian|invgaussian|line|linear|rectangle)|pt_shape_(?:circle|cloud|disk|explosion|flare|line|pixel|ring|smoke|snow|spark|sphere|square|star)|ty_(?:real|string)|gp_(?:face\d|axislh|axislv|axisrh|axisrv|padd|padl|padr|padu|select|shoulderl|shoulderlb|shoulderr|shoulderrb|start|stickl|stickr)|lb_disp_(?:none|numeric|time_ms|time_sec)|lb_sort_(?:ascending|descending|none)|ov_(?:achievements|community|friends|gamegroup|players|settings)|ugc_(?:filetype_(?:community|microtrans)|list_(?:Favorited|Followed|Published|Subscribed|UsedOrPlayed|VotedDown|VotedOn|VotedUp|WillVoteLater)|match_(?:AllGuides|Artwork|Collections|ControllerBindings|IntegratedGuides|Items|Items_Mtx|Items_ReadyToUse|Screenshots|UsableInGame|Videos|WebGuides)|query_(?:AcceptedForGameRankedByAcceptanceDate|CreatedByFriendsRankedByPublicationDate|FavoritedByFriendsRankedByPublicationDate|NotYetRated)|query_RankedBy(?:NumTimesReported|PublicationDate|TextSearch|TotalVotesAsc|Trend|Vote|VotesUp)|result_success|sortorder_CreationOrder(?:Asc|Desc)|sortorder_(?:ForModeration|LastUpdatedDesc|SubscriptionDateDesc|TitleAsc|VoteScoreDesc)|visibility_(?:friends_only|private|public))|vertex_usage_(?:binormal|blendindices|blendweight|color|colour|depth|fog|normal|position|psize|sample|tangent|texcoord|textcoord)|vertex_type_(?:float\d|color|colour|ubyte4)|input_type|layerelementtype_(?:background|instance|oldtilemap|particlesystem|sprite|tile|tilemap|undefined)|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|tile_(?:flip|index_mask|mirror|rotate)|(?:obj|rm|scr|spr)\w+)\b/,
    variable: /\b(?:alarm|application_surface|async_load|background_(?:alpha|blend|color|colour|foreground|height|hspeed|htiled|index|showcolor|showcolour|visible|vspeed|vtiled|width|x|xscale|y|yscale)|bbox_(?:bottom|left|right|top)|browser_(?:height|width)|caption_(?:health|lives|score)|current_(?:day|hour|minute|month|second|time|weekday|year)|cursor_sprite|debug_mode|delta_time|direction|display_aa|error_(?:last|occurred)|event_(?:action|number|object|type)|fps|fps_real|friction|game_(?:display|project|save)_(?:id|name)|gamemaker_(?:pro|registered|version)|gravity|gravity_direction|(?:h|v)speed|health|iap_data|id|image_(?:alpha|angle|blend|depth|index|number|speed|xscale|yscale)|instance_(?:count|id)|keyboard_(?:key|lastchar|lastkey|string)|layer|lives|mask_index|mouse_(?:button|lastbutton|x|y)|object_index|os_(?:browser|device|type|version)|path_(?:endaction|index|orientation|position|positionprevious|scale|speed)|persistent|phy_(?:rotation|(?:col_normal|collision|com|linear_velocity|position|speed)_(?:x|y)|angular_(?:damping|velocity)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|pointer_(?:invalid|null)|room|room_(?:caption|first|height|last|persistent|speed|width)|score|secure_mode|show_(?:health|lives|score)|solid|speed|sprite_(?:height|index|width|xoffset|yoffset)|temp_directory|timeline_(?:index|loop|position|running|speed)|transition_(?:color|kind|steps)|undefined|view_(?:angle|current|enabled|(?:h|v)(?:border|speed)|(?:h|w|x|y)port|(?:h|w|x|y)view|object|surface_id|visible)|visible|webgl_enabled|working_directory|(?:x|y)(?:previous|start)|x|y|argument(?:_relitive|_count|\d)|argument|global|local|other|self)\b/
  });
}
cbe.displayName = "gap";
cbe.aliases = [];
function cbe(i) {
  i.languages.gap = {
    shell: {
      pattern: /^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m,
      greedy: !0,
      inside: {
        gap: {
          pattern: /^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/,
          lookbehind: !0,
          inside: null
          // see below
        },
        punctuation: /^gap>/
      }
    },
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    string: {
      pattern: /(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        continuation: {
          pattern: /([\r\n])>/,
          lookbehind: !0,
          alias: "punctuation"
        }
      }
    },
    keyword: /\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/,
    boolean: /\b(?:false|true)\b/,
    function: /\b[a-z_]\w*(?=\s*\()/i,
    number: {
      pattern: /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,
      lookbehind: !0
    },
    continuation: {
      pattern: /([\r\n])>/,
      lookbehind: !0,
      alias: "punctuation"
    },
    operator: /->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./,
    punctuation: /[()[\]{},;.:]/
  }, i.languages.gap.shell.inside.gap.inside = i.languages.gap;
}
ube.displayName = "gcode";
ube.aliases = [];
function ube(i) {
  i.languages.gcode = {
    comment: /;.*|\B\(.*?\)\B/,
    string: {
      pattern: /"(?:""|[^"])*"/,
      greedy: !0
    },
    keyword: /\b[GM]\d+(?:\.\d+)?\b/,
    property: /\b[A-Z]/,
    checksum: {
      pattern: /(\*)\d+/,
      lookbehind: !0,
      alias: "number"
    },
    // T0:0:0
    punctuation: /[:*]/
  };
}
dbe.displayName = "gdscript";
dbe.aliases = [];
function dbe(i) {
  i.languages.gdscript = {
    comment: /#.*/,
    string: {
      pattern: /@?(?:("|')(?:(?!\1)[^\n\\]|\\[\s\S])*\1(?!"|')|"""(?:[^\\]|\\[\s\S])*?""")/,
      greedy: !0
    },
    "class-name": {
      // class_name Foo, extends Bar, class InnerClass
      // export(int) var baz, export(int, 0) var i
      // as Node
      // const FOO: int = 9, var bar: bool = true
      // func add(reference: Item, amount: int) -> Item:
      pattern: /(^(?:class|class_name|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m,
      lookbehind: !0
    },
    keyword: /\b(?:and|as|assert|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|if|in|is|master|mastersync|match|not|null|onready|or|pass|preload|puppet|puppetsync|remote|remotesync|return|self|setget|signal|static|tool|var|while|yield)\b/,
    function: /\b[a-z_]\w*(?=[ \t]*\()/i,
    variable: /\$\w+/,
    number: [
      /\b0b[01_]+\b|\b0x[\da-fA-F_]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.[\d_]+)(?:e[+-]?[\d_]+)?\b/,
      /\b(?:INF|NAN|PI|TAU)\b/
    ],
    constant: /\b[A-Z][A-Z_\d]*\b/,
    boolean: /\b(?:false|true)\b/,
    operator: /->|:=|&&|\|\||<<|>>|[-+*/%&|!<>=]=?|[~^]/,
    punctuation: /[.:,;()[\]{}]/
  };
}
hbe.displayName = "gedcom";
hbe.aliases = [];
function hbe(i) {
  i.languages.gedcom = {
    "line-value": {
      // Preceded by level, optional pointer, and tag
      pattern: /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m,
      lookbehind: !0,
      inside: {
        pointer: {
          pattern: /^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,
          alias: "variable"
        }
      }
    },
    record: {
      // Preceded by level and optional pointer
      pattern: /(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,
      lookbehind: !0,
      alias: "tag"
    },
    level: {
      pattern: /(^[\t ]*)\d+/m,
      lookbehind: !0,
      alias: "number"
    },
    pointer: {
      pattern: /@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,
      alias: "variable"
    }
  };
}
fbe.displayName = "gettext";
fbe.aliases = ["po"];
function fbe(i) {
  i.languages.gettext = {
    comment: [
      {
        pattern: /# .*/,
        greedy: !0,
        alias: "translator-comment"
      },
      {
        pattern: /#\..*/,
        greedy: !0,
        alias: "extracted-comment"
      },
      {
        pattern: /#:.*/,
        greedy: !0,
        alias: "reference-comment"
      },
      {
        pattern: /#,.*/,
        greedy: !0,
        alias: "flag-comment"
      },
      {
        pattern: /#\|.*/,
        greedy: !0,
        alias: "previously-untranslated-comment"
      },
      {
        pattern: /#.*/,
        greedy: !0
      }
    ],
    string: {
      pattern: /(^|[^\\])"(?:[^"\\]|\\.)*"/,
      lookbehind: !0,
      greedy: !0
    },
    keyword: /^msg(?:ctxt|id|id_plural|str)\b/m,
    number: /\b\d+\b/,
    punctuation: /[\[\]]/
  }, i.languages.po = i.languages.gettext;
}
gbe.displayName = "gherkin";
gbe.aliases = [];
function gbe(i) {
  (function(e) {
    var t = /(?:\r?\n|\r)[ \t]*\|.+\|(?:(?!\|).)*/.source;
    e.languages.gherkin = {
      pystring: {
        pattern: /("""|''')[\s\S]+?\1/,
        alias: "string"
      },
      comment: {
        pattern: /(^[ \t]*)#.*/m,
        lookbehind: !0
      },
      tag: {
        pattern: /(^[ \t]*)@\S*/m,
        lookbehind: !0
      },
      feature: {
        pattern: /((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|Lastnost|Mak|Mogucnost|laH|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|Potrzeba biznesowa|perbogh|poQbogh malja'|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:\r\n]+(?:\r?\n|\r|$))*/,
        lookbehind: !0,
        inside: {
          important: {
            pattern: /(:)[^\r\n]+/,
            lookbehind: !0
          },
          keyword: /[^:\r\n]+:/
        }
      },
      scenario: {
        pattern: /(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram Senaryo|Dyagram senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|EXAMPLZ|Examples|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|Grundlage|Hannergrond|ghantoH|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut chovnatlh|lut|lutmey|Lýsing Atburðarásar|Lýsing Dæma|MISHUN SRSLY|MISHUN|Menggariskan Senario|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan Senaryo|Plan senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo Deskripsyon|Senaryo deskripsyon|Senaryo|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie Uiteensetting|Situasie|Skenario konsep|Skenario|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa hwaer swa|Swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo-ho-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m,
        lookbehind: !0,
        inside: {
          important: {
            pattern: /(:)[^\r\n]*/,
            lookbehind: !0
          },
          keyword: /[^:\r\n]+:/
        }
      },
      "table-body": {
        // Look-behind is used to skip the table head, which has the same format as any table row
        pattern: RegExp("(" + t + ")(?:" + t + ")+"),
        lookbehind: !0,
        inside: {
          outline: {
            pattern: /<[^>]+>/,
            alias: "variable"
          },
          td: {
            pattern: /\s*[^\s|][^|]*/,
            alias: "string"
          },
          punctuation: /\|/
        }
      },
      "table-head": {
        pattern: RegExp(t),
        inside: {
          th: {
            pattern: /\s*[^\s|][^|]*/,
            alias: "variable"
          },
          punctuation: /\|/
        }
      },
      atrule: {
        pattern: /(^[ \t]+)(?:'a|'ach|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cand|Cando|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|DEN|Dato|De|Den youse gotta|Dengan|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|E|En|Entonces|Epi|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kad|Kada|Kadar|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Ma|Majd|Maka|Manawa|Mas|Men|Menawa|Mutta|Nalika|Nalikaning|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Och|Og|Oletetaan|Ond|Onda|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|Quan|Quand|Quando|qaSDI'|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|Un|Und|ugeholl|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadan|Zadani|Zadano|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m,
        lookbehind: !0
      },
      string: {
        pattern: /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,
        inside: {
          outline: {
            pattern: /<[^>]+>/,
            alias: "variable"
          }
        }
      },
      outline: {
        pattern: /<[^>]+>/,
        alias: "variable"
      }
    };
  })(i);
}
pbe.displayName = "git";
pbe.aliases = [];
function pbe(i) {
  i.languages.git = {
    /*
     * A simple one line comment like in a git status command
     * For instance:
     * $ git status
     * # On branch infinite-scroll
     * # Your branch and 'origin/sharedBranches/frontendTeam/infinite-scroll' have diverged,
     * # and have 1 and 2 different commits each, respectively.
     * nothing to commit (working directory clean)
     */
    comment: /^#.*/m,
    /*
     * Regexp to match the changed lines in a git diff output. Check the example below.
     */
    deleted: /^[-–].*/m,
    inserted: /^\+.*/m,
    /*
     * a string (double and simple quote)
     */
    string: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
    /*
     * a git command. It starts with a random prompt finishing by a $, then "git" then some other parameters
     * For instance:
     * $ git add file.txt
     */
    command: {
      pattern: /^.*\$ git .*$/m,
      inside: {
        /*
         * A git command can contain a parameter starting by a single or a double dash followed by a string
         * For instance:
         * $ git diff --cached
         * $ git log -p
         */
        parameter: /\s--?\w+/
      }
    },
    /*
     * Coordinates displayed in a git diff command
     * For instance:
     * $ git diff
     * diff --git file.txt file.txt
     * index 6214953..1d54a52 100644
     * --- file.txt
     * +++ file.txt
     * @@ -1 +1,2 @@
     * -Here's my tetx file
     * +Here's my text file
     * +And this is the second line
     */
    coord: /^@@.*@@$/m,
    /*
     * Match a "commit [SHA1]" line in a git log output.
     * For instance:
     * $ git log
     * commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09
     * Author: lgiraudel
     * Date:   Mon Feb 17 11:18:34 2014 +0100
     *
     *     Add of a new line
     */
    "commit-sha1": /^commit \w{40}$/m
  };
}
mbe.displayName = "glsl";
mbe.aliases = [];
function mbe(i) {
  i.register(Em), i.languages.glsl = i.languages.extend("c", {
    keyword: /\b(?:active|asm|atomic_uint|attribute|[ibdu]?vec[234]|bool|break|buffer|case|cast|centroid|class|coherent|common|const|continue|d?mat[234](?:x[234])?|default|discard|do|double|else|enum|extern|external|false|filter|fixed|flat|float|for|fvec[234]|goto|half|highp|hvec[234]|[iu]?sampler2DMS(?:Array)?|[iu]?sampler2DRect|[iu]?samplerBuffer|[iu]?samplerCube|[iu]?samplerCubeArray|[iu]?sampler[123]D|[iu]?sampler[12]DArray|[iu]?image2DMS(?:Array)?|[iu]?image2DRect|[iu]?imageBuffer|[iu]?imageCube|[iu]?imageCubeArray|[iu]?image[123]D|[iu]?image[12]DArray|if|in|inline|inout|input|int|interface|invariant|layout|long|lowp|mediump|namespace|noinline|noperspective|out|output|partition|patch|precise|precision|public|readonly|resource|restrict|return|sample|sampler[12]DArrayShadow|sampler[12]DShadow|sampler2DRectShadow|sampler3DRect|samplerCubeArrayShadow|samplerCubeShadow|shared|short|sizeof|smooth|static|struct|subroutine|superp|switch|template|this|true|typedef|uint|uniform|union|unsigned|using|varying|void|volatile|while|writeonly)\b/
  });
}
_be.displayName = "gn";
_be.aliases = ["gni"];
function _be(i) {
  i.languages.gn = {
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    "string-literal": {
      pattern: /(^|[^\\"])"(?:[^\r\n"\\]|\\.)*"/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:\{[\s\S]*?\}|[a-zA-Z_]\w*|0x[a-fA-F0-9]{2})/,
          lookbehind: !0,
          inside: {
            number: /^\$0x[\s\S]{2}$/,
            variable: /^\$\w+$/,
            "interpolation-punctuation": {
              pattern: /^\$\{|\}$/,
              alias: "punctuation"
            },
            expression: {
              pattern: /[\s\S]+/,
              inside: null
              // see below
            }
          }
        },
        string: /[\s\S]+/
      }
    },
    keyword: /\b(?:else|if)\b/,
    boolean: /\b(?:false|true)\b/,
    "builtin-function": {
      // a few functions get special highlighting to improve readability
      pattern: /\b(?:assert|defined|foreach|import|pool|print|template|tool|toolchain)(?=\s*\()/i,
      alias: "keyword"
    },
    function: /\b[a-z_]\w*(?=\s*\()/i,
    constant: /\b(?:current_cpu|current_os|current_toolchain|default_toolchain|host_cpu|host_os|root_build_dir|root_gen_dir|root_out_dir|target_cpu|target_gen_dir|target_os|target_out_dir)\b/,
    number: /-?\b\d+\b/,
    operator: /[-+!=<>]=?|&&|\|\|/,
    punctuation: /[(){}[\],.]/
  }, i.languages.gn["string-literal"].inside.interpolation.inside.expression.inside = i.languages.gn, i.languages.gni = i.languages.gn;
}
bbe.displayName = "linker-script";
bbe.aliases = ["ld"];
function bbe(i) {
  i.languages["linker-script"] = {
    comment: {
      pattern: /(^|\s)\/\*[\s\S]*?(?:$|\*\/)/,
      lookbehind: !0,
      greedy: !0
    },
    identifier: {
      pattern: /"[^"\r\n]*"/,
      greedy: !0
    },
    "location-counter": {
      pattern: /\B\.\B/,
      alias: "important"
    },
    section: {
      pattern: /(^|[^\w*])\.\w+\b/,
      lookbehind: !0,
      alias: "keyword"
    },
    function: /\b[A-Z][A-Z_]*(?=\s*\()/,
    number: /\b(?:0[xX][a-fA-F0-9]+|\d+)[KM]?\b/,
    operator: />>=?|<<=?|->|\+\+|--|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?/,
    punctuation: /[(){},;]/
  }, i.languages.ld = i.languages["linker-script"];
}
vbe.displayName = "go-module";
vbe.aliases = ["go-mod"];
function vbe(i) {
  i.languages["go-mod"] = i.languages["go-module"] = {
    comment: {
      pattern: /\/\/.*/,
      greedy: !0
    },
    version: {
      pattern: /(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/,
      lookbehind: !0,
      alias: "number"
    },
    "go-version": {
      pattern: /((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/,
      lookbehind: !0,
      alias: "number"
    },
    keyword: {
      pattern: /^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m,
      lookbehind: !0
    },
    operator: /=>/,
    punctuation: /[()[\],]/
  };
}
ybe.displayName = "gradle";
ybe.aliases = [];
function ybe(i) {
  i.register(Wr), (function(e) {
    var t = {
      pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,
      lookbehind: !0,
      inside: {
        "interpolation-punctuation": {
          pattern: /^\$\{?|\}$/,
          alias: "punctuation"
        },
        expression: {
          pattern: /[\s\S]+/,
          inside: null
        }
      }
    };
    e.languages.gradle = e.languages.extend("clike", {
      string: {
        pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,
        greedy: !0
      },
      keyword: /\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/,
      number: /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,
      operator: {
        pattern: /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,
        lookbehind: !0
      },
      punctuation: /\.+|[{}[\];(),:$]/
    }), e.languages.insertBefore("gradle", "string", {
      shebang: {
        pattern: /#!.+/,
        alias: "comment",
        greedy: !0
      },
      "interpolation-string": {
        pattern: /"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,
        greedy: !0,
        inside: {
          interpolation: t,
          string: /[\s\S]+/
        }
      }
    }), e.languages.insertBefore("gradle", "punctuation", {
      "spock-block": /\b(?:and|cleanup|expect|given|setup|then|when|where):/
    }), e.languages.insertBefore("gradle", "function", {
      annotation: {
        pattern: /(^|[^.])@\w+/,
        lookbehind: !0,
        alias: "punctuation"
      }
    }), t.inside.expression.inside = e.languages.gradle;
  })(i);
}
Cbe.displayName = "graphql";
Cbe.aliases = [];
function Cbe(i) {
  i.languages.graphql = {
    comment: /#.*/,
    description: {
      pattern: /(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,
      greedy: !0,
      alias: "string",
      inside: {
        "language-markdown": {
          pattern: /(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,
          lookbehind: !0,
          inside: i.languages.markdown
        }
      }
    },
    string: {
      pattern: /"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,
      greedy: !0
    },
    number: /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
    boolean: /\b(?:false|true)\b/,
    variable: /\$[a-z_]\w*/i,
    directive: {
      pattern: /@[a-z_]\w*/i,
      alias: "function"
    },
    "attr-name": {
      pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,
      greedy: !0
    },
    "atom-input": {
      pattern: /\b[A-Z]\w*Input\b/,
      alias: "class-name"
    },
    scalar: /\b(?:Boolean|Float|ID|Int|String)\b/,
    constant: /\b[A-Z][A-Z_\d]*\b/,
    "class-name": {
      pattern: /(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,
      lookbehind: !0
    },
    fragment: {
      pattern: /(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,
      lookbehind: !0,
      alias: "function"
    },
    "definition-mutation": {
      pattern: /(\bmutation\s+)[a-zA-Z_]\w*/,
      lookbehind: !0,
      alias: "function"
    },
    "definition-query": {
      pattern: /(\bquery\s+)[a-zA-Z_]\w*/,
      lookbehind: !0,
      alias: "function"
    },
    keyword: /\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,
    operator: /[!=|&]|\.{3}/,
    "property-query": /\w+(?=\s*\()/,
    object: /\w+(?=\s*\{)/,
    punctuation: /[!(){}\[\]:=,]/,
    property: /\w+/
  }, i.hooks.add("after-tokenize", function(t) {
    if (t.language !== "graphql")
      return;
    var n = t.tokens.filter(function(v) {
      return typeof v != "string" && v.type !== "comment" && v.type !== "scalar";
    }), r = 0;
    function s(v) {
      return n[r + v];
    }
    function o(v, w) {
      w = w || 0;
      for (var E = 0; E < v.length; E++) {
        var L = s(E + w);
        if (!L || L.type !== v[E])
          return !1;
      }
      return !0;
    }
    function a(v, w) {
      for (var E = 1, L = r; L < n.length; L++) {
        var T = n[L], D = T.content;
        if (T.type === "punctuation" && typeof D == "string") {
          if (v.test(D))
            E++;
          else if (w.test(D) && (E--, E === 0))
            return L;
        }
      }
      return -1;
    }
    function l(v, w) {
      var E = v.alias;
      E ? Array.isArray(E) || (v.alias = E = [E]) : v.alias = E = [], E.push(w);
    }
    for (; r < n.length; ) {
      var c = n[r++];
      if (c.type === "keyword" && c.content === "mutation") {
        var u = [];
        if (o(["definition-mutation", "punctuation"]) && s(1).content === "(") {
          r += 2;
          var d = a(/^\($/, /^\)$/);
          if (d === -1)
            continue;
          for (; r < d; r++) {
            var h = s(0);
            h.type === "variable" && (l(h, "variable-input"), u.push(h.content));
          }
          r = d + 1;
        }
        if (o(["punctuation", "property-query"]) && s(0).content === "{" && (r++, l(s(0), "property-mutation"), u.length > 0)) {
          var g = a(/^\{$/, /^\}$/);
          if (g === -1)
            continue;
          for (var m = r; m < g; m++) {
            var _ = n[m];
            _.type === "variable" && u.indexOf(_.content) >= 0 && l(_, "variable-input");
          }
        }
      }
    }
  });
}
wbe.displayName = "groovy";
wbe.aliases = [];
function wbe(i) {
  i.register(Wr), (function(e) {
    var t = {
      pattern: /((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,
      lookbehind: !0,
      inside: {
        "interpolation-punctuation": {
          pattern: /^\$\{?|\}$/,
          alias: "punctuation"
        },
        expression: {
          pattern: /[\s\S]+/,
          inside: null
          // see below
        }
      }
    };
    e.languages.groovy = e.languages.extend("clike", {
      string: {
        // https://groovy-lang.org/syntax.html#_dollar_slashy_string
        pattern: /'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,
        greedy: !0
      },
      keyword: /\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,
      number: /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,
      operator: {
        pattern: /(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,
        lookbehind: !0
      },
      punctuation: /\.+|[{}[\];(),:$]/
    }), e.languages.insertBefore("groovy", "string", {
      shebang: {
        pattern: /#!.+/,
        alias: "comment",
        greedy: !0
      },
      "interpolation-string": {
        // TODO: Slash strings (e.g. /foo/) can contain line breaks but this will cause a lot of trouble with
        // simple division (see JS regex), so find a fix maybe?
        pattern: /"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,
        greedy: !0,
        inside: {
          interpolation: t,
          string: /[\s\S]+/
        }
      }
    }), e.languages.insertBefore("groovy", "punctuation", {
      "spock-block": /\b(?:and|cleanup|expect|given|setup|then|when|where):/
    }), e.languages.insertBefore("groovy", "function", {
      annotation: {
        pattern: /(^|[^.])@\w+/,
        lookbehind: !0,
        alias: "punctuation"
      }
    }), t.inside.expression.inside = e.languages.groovy;
  })(i);
}
Sbe.displayName = "textile";
Sbe.aliases = [];
function Sbe(i) {
  i.register(Nc), (function(e) {
    var t = /\([^|()\n]+\)|\[[^\]\n]+\]|\{[^}\n]+\}/.source, n = /\)|\((?![^|()\n]+\))/.source;
    function r(d, h) {
      return RegExp(
        d.replace(/<MOD>/g, function() {
          return "(?:" + t + ")";
        }).replace(/<PAR>/g, function() {
          return "(?:" + n + ")";
        }),
        h || ""
      );
    }
    var s = {
      css: {
        pattern: /\{[^{}]+\}/,
        inside: {
          rest: e.languages.css
        }
      },
      "class-id": {
        pattern: /(\()[^()]+(?=\))/,
        lookbehind: !0,
        alias: "attr-value"
      },
      lang: {
        pattern: /(\[)[^\[\]]+(?=\])/,
        lookbehind: !0,
        alias: "attr-value"
      },
      // Anything else is punctuation (the first pattern is for row/col spans inside tables)
      punctuation: /[\\\/]\d+|\S/
    }, o = e.languages.textile = e.languages.extend("markup", {
      phrase: {
        pattern: /(^|\r|\n)\S[\s\S]*?(?=$|\r?\n\r?\n|\r\r)/,
        lookbehind: !0,
        inside: {
          // h1. Header 1
          "block-tag": {
            pattern: r(/^[a-z]\w*(?:<MOD>|<PAR>|[<>=])*\./.source),
            inside: {
              modifier: {
                pattern: r(
                  /(^[a-z]\w*)(?:<MOD>|<PAR>|[<>=])+(?=\.)/.source
                ),
                lookbehind: !0,
                inside: s
              },
              tag: /^[a-z]\w*/,
              punctuation: /\.$/
            }
          },
          // # List item
          // * List item
          list: {
            pattern: r(/^[*#]+<MOD>*\s+\S.*/.source, "m"),
            inside: {
              modifier: {
                pattern: r(/(^[*#]+)<MOD>+/.source),
                lookbehind: !0,
                inside: s
              },
              punctuation: /^[*#]+/
            }
          },
          // | cell | cell | cell |
          table: {
            // Modifiers can be applied to the row: {color:red}.|1|2|3|
            // or the cell: |{color:red}.1|2|3|
            pattern: r(
              /^(?:(?:<MOD>|<PAR>|[<>=^~])+\.\s*)?(?:\|(?:(?:<MOD>|<PAR>|[<>=^~_]|[\\/]\d+)+\.|(?!(?:<MOD>|<PAR>|[<>=^~_]|[\\/]\d+)+\.))[^|]*)+\|/.source,
              "m"
            ),
            inside: {
              modifier: {
                // Modifiers for rows after the first one are
                // preceded by a pipe and a line feed
                pattern: r(
                  /(^|\|(?:\r?\n|\r)?)(?:<MOD>|<PAR>|[<>=^~_]|[\\/]\d+)+(?=\.)/.source
                ),
                lookbehind: !0,
                inside: s
              },
              punctuation: /\||^\./
            }
          },
          inline: {
            // eslint-disable-next-line regexp/no-super-linear-backtracking
            pattern: r(
              /(^|[^a-zA-Z\d])(\*\*|__|\?\?|[*_%@+\-^~])<MOD>*.+?\2(?![a-zA-Z\d])/.source
            ),
            lookbehind: !0,
            inside: {
              // Note: superscripts and subscripts are not handled specifically
              // *bold*, **bold**
              bold: {
                // eslint-disable-next-line regexp/no-super-linear-backtracking
                pattern: r(/(^(\*\*?)<MOD>*).+?(?=\2)/.source),
                lookbehind: !0
              },
              // _italic_, __italic__
              italic: {
                // eslint-disable-next-line regexp/no-super-linear-backtracking
                pattern: r(/(^(__?)<MOD>*).+?(?=\2)/.source),
                lookbehind: !0
              },
              // ??cite??
              cite: {
                // eslint-disable-next-line regexp/no-super-linear-backtracking
                pattern: r(/(^\?\?<MOD>*).+?(?=\?\?)/.source),
                lookbehind: !0,
                alias: "string"
              },
              // @code@
              code: {
                // eslint-disable-next-line regexp/no-super-linear-backtracking
                pattern: r(/(^@<MOD>*).+?(?=@)/.source),
                lookbehind: !0,
                alias: "keyword"
              },
              // +inserted+
              inserted: {
                // eslint-disable-next-line regexp/no-super-linear-backtracking
                pattern: r(/(^\+<MOD>*).+?(?=\+)/.source),
                lookbehind: !0
              },
              // -deleted-
              deleted: {
                // eslint-disable-next-line regexp/no-super-linear-backtracking
                pattern: r(/(^-<MOD>*).+?(?=-)/.source),
                lookbehind: !0
              },
              // %span%
              span: {
                // eslint-disable-next-line regexp/no-super-linear-backtracking
                pattern: r(/(^%<MOD>*).+?(?=%)/.source),
                lookbehind: !0
              },
              modifier: {
                pattern: r(
                  /(^\*\*|__|\?\?|[*_%@+\-^~])<MOD>+/.source
                ),
                lookbehind: !0,
                inside: s
              },
              punctuation: /[*_%?@+\-^~]+/
            }
          },
          // [alias]http://example.com
          "link-ref": {
            pattern: /^\[[^\]]+\]\S+$/m,
            inside: {
              string: {
                pattern: /(^\[)[^\]]+(?=\])/,
                lookbehind: !0
              },
              url: {
                pattern: /(^\])\S+$/,
                lookbehind: !0
              },
              punctuation: /[\[\]]/
            }
          },
          // "text":http://example.com
          // "text":link-ref
          link: {
            // eslint-disable-next-line regexp/no-super-linear-backtracking
            pattern: r(
              /"<MOD>*[^"]+":.+?(?=[^\w/]?(?:\s|$))/.source
            ),
            inside: {
              text: {
                // eslint-disable-next-line regexp/no-super-linear-backtracking
                pattern: r(/(^"<MOD>*)[^"]+(?=")/.source),
                lookbehind: !0
              },
              modifier: {
                pattern: r(/(^")<MOD>+/.source),
                lookbehind: !0,
                inside: s
              },
              url: {
                pattern: /(:).+/,
                lookbehind: !0
              },
              punctuation: /[":]/
            }
          },
          // !image.jpg!
          // !image.jpg(Title)!:http://example.com
          image: {
            pattern: r(
              /!(?:<MOD>|<PAR>|[<>=])*(?![<>=])[^!\s()]+(?:\([^)]+\))?!(?::.+?(?=[^\w/]?(?:\s|$)))?/.source
            ),
            inside: {
              source: {
                pattern: r(
                  /(^!(?:<MOD>|<PAR>|[<>=])*)(?![<>=])[^!\s()]+(?:\([^)]+\))?(?=!)/.source
                ),
                lookbehind: !0,
                alias: "url"
              },
              modifier: {
                pattern: r(/(^!)(?:<MOD>|<PAR>|[<>=])+/.source),
                lookbehind: !0,
                inside: s
              },
              url: {
                pattern: /(:).+/,
                lookbehind: !0
              },
              punctuation: /[!:]/
            }
          },
          // Footnote[1]
          footnote: {
            pattern: /\b\[\d+\]/,
            alias: "comment",
            inside: {
              punctuation: /\[|\]/
            }
          },
          // CSS(Cascading Style Sheet)
          acronym: {
            pattern: /\b[A-Z\d]+\([^)]+\)/,
            inside: {
              comment: {
                pattern: /(\()[^()]+(?=\))/,
                lookbehind: !0
              },
              punctuation: /[()]/
            }
          },
          // Prism(C)
          mark: {
            pattern: /\b\((?:C|R|TM)\)/,
            alias: "comment",
            inside: {
              punctuation: /[()]/
            }
          }
        }
      }
    }), a = o.phrase.inside, l = {
      inline: a.inline,
      link: a.link,
      image: a.image,
      footnote: a.footnote,
      acronym: a.acronym,
      mark: a.mark
    };
    o.tag.pattern = /<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i;
    var c = a.inline.inside;
    c.bold.inside = l, c.italic.inside = l, c.inserted.inside = l, c.deleted.inside = l, c.span.inside = l;
    var u = a.table.inside;
    u.inline = l.inline, u.link = l.link, u.image = l.image, u.footnote = l.footnote, u.acronym = l.acronym, u.mark = l.mark;
  })(i);
}
Ebe.displayName = "haml";
Ebe.aliases = [];
function Ebe(i) {
  i.register(hk), (function(e) {
    e.languages.haml = {
      // Multiline stuff should appear before the rest
      "multiline-comment": {
        pattern: /((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ].+)*/,
        lookbehind: !0,
        alias: "comment"
      },
      "multiline-code": [
        {
          pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ].*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ].+)/,
          lookbehind: !0,
          inside: e.languages.ruby
        },
        {
          pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ].*\|[\t ]*)*/,
          lookbehind: !0,
          inside: e.languages.ruby
        }
      ],
      // See at the end of the file for known filters
      filter: {
        pattern: /((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/,
        lookbehind: !0,
        inside: {
          "filter-name": {
            pattern: /^:[\w-]+/,
            alias: "symbol"
          }
        }
      },
      markup: {
        pattern: /((?:^|\r?\n|\r)[\t ]*)<.+/,
        lookbehind: !0,
        inside: e.languages.markup
      },
      doctype: {
        pattern: /((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/,
        lookbehind: !0
      },
      tag: {
        // Allows for one nested group of braces
        pattern: /((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^{}])+\}|\[[^\]]+\])*[\/<>]*/,
        lookbehind: !0,
        inside: {
          attributes: [
            {
              // Lookbehind tries to prevent interpolations from breaking it all
              // Allows for one nested group of braces
              pattern: /(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/,
              lookbehind: !0,
              inside: e.languages.ruby
            },
            {
              pattern: /\([^)]+\)/,
              inside: {
                "attr-value": {
                  pattern: /(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/,
                  lookbehind: !0
                },
                "attr-name": /[\w:-]+(?=\s*!?=|\s*[,)])/,
                punctuation: /[=(),]/
              }
            },
            {
              pattern: /\[[^\]]+\]/,
              inside: e.languages.ruby
            }
          ],
          punctuation: /[<>]/
        }
      },
      code: {
        pattern: /((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,
        lookbehind: !0,
        inside: e.languages.ruby
      },
      // Interpolations in plain text
      interpolation: {
        pattern: /#\{[^}]+\}/,
        inside: {
          delimiter: {
            pattern: /^#\{|\}$/,
            alias: "punctuation"
          },
          ruby: {
            pattern: /[\s\S]+/,
            inside: e.languages.ruby
          }
        }
      },
      punctuation: {
        pattern: /((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/,
        lookbehind: !0
      }
    };
    for (var t = "((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ].+|\\s*?(?=\\r?\\n|\\r)))+", n = [
      "css",
      {
        filter: "coffee",
        language: "coffeescript"
      },
      "erb",
      "javascript",
      "less",
      "markdown",
      "ruby",
      "scss",
      "textile"
    ], r = {}, s = 0, o = n.length; s < o; s++) {
      var a = n[s];
      a = typeof a == "string" ? {
        filter: a,
        language: a
      } : a, e.languages[a.language] && (r["filter-" + a.filter] = {
        pattern: RegExp(
          t.replace("{{filter_name}}", function() {
            return a.filter;
          })
        ),
        lookbehind: !0,
        inside: {
          "filter-name": {
            pattern: /^:[\w-]+/,
            alias: "symbol"
          },
          text: {
            pattern: /[\s\S]+/,
            alias: [a.language, "language-" + a.language],
            inside: e.languages[a.language]
          }
        }
      });
    }
    e.languages.insertBefore("haml", "filter", r);
  })(i);
}
xbe.displayName = "handlebars";
xbe.aliases = ["hbs", "mustache"];
function xbe(i) {
  i.register(bu), (function(e) {
    e.languages.handlebars = {
      comment: /\{\{![\s\S]*?\}\}/,
      delimiter: {
        pattern: /^\{\{\{?|\}\}\}?$/,
        alias: "punctuation"
      },
      string: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,
      number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,
      boolean: /\b(?:false|true)\b/,
      block: {
        pattern: /^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,
        lookbehind: !0,
        alias: "keyword"
      },
      brackets: {
        pattern: /\[[^\]]+\]/,
        inside: {
          punctuation: /\[|\]/,
          variable: /[\s\S]+/
        }
      },
      punctuation: /[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,
      variable: /[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/
    }, e.hooks.add("before-tokenize", function(t) {
      var n = /\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g;
      e.languages["markup-templating"].buildPlaceholders(
        t,
        "handlebars",
        n
      );
    }), e.hooks.add("after-tokenize", function(t) {
      e.languages["markup-templating"].tokenizePlaceholders(
        t,
        "handlebars"
      );
    }), e.languages.hbs = e.languages.handlebars, e.languages.mustache = e.languages.handlebars;
  })(i);
}
l6.displayName = "haskell";
l6.aliases = ["hs"];
function l6(i) {
  i.languages.haskell = {
    comment: {
      pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--(?:(?=.)[^-!#$%*+=?&@|~.:<>^\\\/].*|$)|\{-[\s\S]*?-\})/m,
      lookbehind: !0
    },
    char: {
      pattern: /'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|ACK|BEL|BS|CAN|CR|DC1|DC2|DC3|DC4|DEL|DLE|EM|ENQ|EOT|ESC|ETB|ETX|FF|FS|GS|HT|LF|NAK|NUL|RS|SI|SO|SOH|SP|STX|SUB|SYN|US|VT|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,
      alias: "string"
    },
    string: {
      pattern: /"(?:[^\\"]|\\(?:\S|\s+\\))*"/,
      greedy: !0
    },
    keyword: /\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,
    "import-statement": {
      // The imported or hidden names are not included in this import
      // statement. This is because we want to highlight those exactly like
      // we do for the names in the program.
      pattern: /(^[\t ]*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,
      lookbehind: !0,
      inside: {
        keyword: /\b(?:as|hiding|import|qualified)\b/,
        punctuation: /\./
      }
    },
    // These are builtin variables only. Constructors are highlighted later as a constant.
    builtin: /\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,
    // decimal integers and floating point numbers | octal integers | hexadecimal integers
    number: /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,
    operator: [
      {
        // infix operator
        pattern: /`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/,
        greedy: !0
      },
      {
        // function composition
        pattern: /(\s)\.(?=\s)/,
        lookbehind: !0
      },
      // Most of this is needed because of the meaning of a single '.'.
      // If it stands alone freely, it is the function composition.
      // It may also be a separator between a module name and an identifier => no
      // operator. If it comes together with other special characters it is an
      // operator too.
      //
      // This regex means: /[-!#$%*+=?&@|~.:<>^\\\/]+/ without /\./.
      /[-!#$%*+=?&@|~:<>^\\\/][-!#$%*+=?&@|~.:<>^\\\/]*|\.[-!#$%*+=?&@|~.:<>^\\\/]+/
    ],
    // In Haskell, nearly everything is a variable, do not highlight these.
    hvariable: {
      pattern: /\b(?:[A-Z][\w']*\.)*[_a-z][\w']*/,
      inside: {
        punctuation: /\./
      }
    },
    constant: {
      pattern: /\b(?:[A-Z][\w']*\.)*[A-Z][\w']*/,
      inside: {
        punctuation: /\./
      }
    },
    punctuation: /[{}[\];(),.:]/
  }, i.languages.hs = i.languages.haskell;
}
Lbe.displayName = "haxe";
Lbe.aliases = [];
function Lbe(i) {
  i.register(Wr), i.languages.haxe = i.languages.extend("clike", {
    string: {
      // Strings can be multi-line
      pattern: /"(?:[^"\\]|\\[\s\S])*"/,
      greedy: !0
    },
    "class-name": [
      {
        pattern: /(\b(?:abstract|class|enum|extends|implements|interface|new|typedef)\s+)[A-Z_]\w*/,
        lookbehind: !0
      },
      // based on naming convention
      /\b[A-Z]\w*/
    ],
    // The final look-ahead prevents highlighting of keywords if expressions such as "haxe.macro.Expr"
    keyword: /\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|final|for|from|function|if|implements|import|in|inline|interface|macro|new|null|operator|overload|override|package|private|public|return|static|super|switch|throw|to|try|typedef|untyped|using|var|while)(?!\.)\b/,
    function: {
      pattern: /\b[a-z_]\w*(?=\s*(?:<[^<>]*>\s*)?\()/i,
      greedy: !0
    },
    operator: /\.{3}|\+\+|--|&&|\|\||->|=>|(?:<<?|>{1,3}|[-+*/%!=&|^])=?|[?:~]/
  }), i.languages.insertBefore("haxe", "string", {
    "string-interpolation": {
      pattern: /'(?:[^'\\]|\\[\s\S])*'/,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /(^|[^\\])\$(?:\w+|\{[^{}]+\})/,
          lookbehind: !0,
          inside: {
            "interpolation-punctuation": {
              pattern: /^\$\{?|\}$/,
              alias: "punctuation"
            },
            expression: {
              pattern: /[\s\S]+/,
              inside: i.languages.haxe
            }
          }
        },
        string: /[\s\S]+/
      }
    }
  }), i.languages.insertBefore("haxe", "class-name", {
    regex: {
      pattern: /~\/(?:[^\/\\\r\n]|\\.)+\/[a-z]*/,
      greedy: !0,
      inside: {
        "regex-flags": /\b[a-z]+$/,
        "regex-source": {
          pattern: /^(~\/)[\s\S]+(?=\/$)/,
          lookbehind: !0,
          alias: "language-regex",
          inside: i.languages.regex
        },
        "regex-delimiter": /^~\/|\/$/
      }
    }
  }), i.languages.insertBefore("haxe", "keyword", {
    preprocessor: {
      pattern: /#(?:else|elseif|end|if)\b.*/,
      alias: "property"
    },
    metadata: {
      pattern: /@:?[\w.]+/,
      alias: "symbol"
    },
    reification: {
      pattern: /\$(?:\w+|(?=\{))/,
      alias: "important"
    }
  });
}
Tbe.displayName = "hcl";
Tbe.aliases = [];
function Tbe(i) {
  i.languages.hcl = {
    comment: /(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,
    heredoc: {
      pattern: /<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m,
      greedy: !0,
      alias: "string"
    },
    keyword: [
      {
        pattern: /(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,
        inside: {
          type: {
            pattern: /(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,
            lookbehind: !0,
            alias: "variable"
          }
        }
      },
      {
        pattern: /(?:backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i,
        inside: {
          type: {
            pattern: /(backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i,
            lookbehind: !0,
            alias: "variable"
          }
        }
      },
      /[\w-]+(?=\s+\{)/
    ],
    property: [/[-\w\.]+(?=\s*=(?!=))/, /"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/],
    string: {
      pattern: /"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/,
          lookbehind: !0,
          inside: {
            type: {
              pattern: /(\b(?:count|data|local|module|path|self|terraform|var)\b\.)[\w\*]+/i,
              lookbehind: !0,
              alias: "variable"
            },
            keyword: /\b(?:count|data|local|module|path|self|terraform|var)\b/i,
            function: /\w+(?=\()/,
            string: {
              pattern: /"(?:\\[\s\S]|[^\\"])*"/,
              greedy: !0
            },
            number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,
            punctuation: /[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/
          }
        }
      }
    },
    number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,
    boolean: /\b(?:false|true)\b/i,
    punctuation: /[=\[\]{}]/
  };
}
kbe.displayName = "hlsl";
kbe.aliases = [];
function kbe(i) {
  i.register(Em), i.languages.hlsl = i.languages.extend("c", {
    // Regarding keywords and class names:
    // The list of all keywords was split into 'keyword' and 'class-name' tokens based on whether they are capitalized.
    // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-keywords
    // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-reserved-words
    "class-name": [
      i.languages.c["class-name"],
      /\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|RasterizerState|RenderTargetView|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/
    ],
    keyword: [
      // HLSL keyword
      /\b(?:asm|asm_fragment|auto|break|case|catch|cbuffer|centroid|char|class|column_major|compile|compile_fragment|const|const_cast|continue|default|delete|discard|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|fxgroup|goto|groupshared|if|in|inline|inout|interface|line|lineadj|linear|long|matrix|mutable|namespace|new|nointerpolation|noperspective|operator|out|packoffset|pass|pixelfragment|point|precise|private|protected|public|register|reinterpret_cast|return|row_major|sample|sampler|shared|short|signed|sizeof|snorm|stateblock|stateblock_state|static|static_cast|string|struct|switch|tbuffer|technique|technique10|technique11|template|texture|this|throw|triangle|triangleadj|try|typedef|typename|uniform|union|unorm|unsigned|using|vector|vertexfragment|virtual|void|volatile|while)\b/,
      // scalar, vector, and matrix types
      /\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/
    ],
    // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-grammar#floating-point-numbers
    number: /(?:(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/,
    boolean: /\b(?:false|true)\b/
  });
}
Dbe.displayName = "hoon";
Dbe.aliases = [];
function Dbe(i) {
  i.languages.hoon = {
    comment: {
      pattern: /::.*/,
      greedy: !0
    },
    string: {
      pattern: /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/,
      greedy: !0
    },
    constant: /%(?:\.[ny]|[\w-]+)/,
    "class-name": /@(?:[a-z0-9-]*[a-z0-9])?|\*/i,
    function: /(?:\+[-+] {2})?(?:[a-z](?:[a-z0-9-]*[a-z0-9])?)/,
    keyword: /\.[\^\+\*=\?]|![><:\.=\?!]|=[>|:,\.\-\^<+;/~\*\?]|\?[>|:\.\-\^<\+&~=@!]|\|[\$_%:\.\-\^~\*=@\?]|\+[|\$\+\*]|:[_\-\^\+~\*]|%[_:\.\-\^\+~\*=]|\^[|:\.\-\+&~\*=\?]|\$[|_%:<>\-\^&~@=\?]|;[:<\+;\/~\*=]|~[>|\$_%<\+\/&=\?!]|--|==/
  };
}
Ibe.displayName = "hpkp";
Ibe.aliases = [];
function Ibe(i) {
  i.languages.hpkp = {
    directive: {
      pattern: /\b(?:includeSubDomains|max-age|pin-sha256|preload|report-to|report-uri|strict)(?=[\s;=]|$)/i,
      alias: "property"
    },
    operator: /=/,
    punctuation: /;/
  };
}
Nbe.displayName = "hsts";
Nbe.aliases = [];
function Nbe(i) {
  i.languages.hsts = {
    directive: {
      pattern: /\b(?:includeSubDomains|max-age|preload)(?=[\s;=]|$)/i,
      alias: "property"
    },
    operator: /=/,
    punctuation: /;/
  };
}
Rbe.displayName = "uri";
Rbe.aliases = ["url"];
function Rbe(i) {
  i.languages.uri = {
    scheme: {
      pattern: /^[a-z][a-z0-9+.-]*:/im,
      greedy: !0,
      inside: {
        "scheme-delimiter": /:$/
      }
    },
    fragment: {
      pattern: /#[\w\-.~!$&'()*+,;=%:@/?]*/,
      inside: {
        "fragment-delimiter": /^#/
      }
    },
    query: {
      pattern: /\?[\w\-.~!$&'()*+,;=%:@/?]*/,
      inside: {
        "query-delimiter": {
          pattern: /^\?/,
          greedy: !0
        },
        "pair-delimiter": /[&;]/,
        pair: {
          pattern: /^[^=][\s\S]*/,
          inside: {
            key: /^[^=]+/,
            value: {
              pattern: /(^=)[\s\S]+/,
              lookbehind: !0
            }
          }
        }
      }
    },
    authority: {
      pattern: RegExp(
        /^\/\//.source + // [ userinfo "@" ]
        /(?:[\w\-.~!$&'()*+,;=%:]*@)?/.source + // host
        ("(?:" + // IP-literal
        /\[(?:[0-9a-fA-F:.]{2,48}|v[0-9a-fA-F]+\.[\w\-.~!$&'()*+,;=]+)\]/.source + "|" + // IPv4address or registered name
        /[\w\-.~!$&'()*+,;=%]*/.source + ")") + // [ ":" port ]
        /(?::\d*)?/.source,
        "m"
      ),
      inside: {
        "authority-delimiter": /^\/\//,
        "user-info-segment": {
          pattern: /^[\w\-.~!$&'()*+,;=%:]*@/,
          inside: {
            "user-info-delimiter": /@$/,
            "user-info": /^[\w\-.~!$&'()*+,;=%:]+/
          }
        },
        "port-segment": {
          pattern: /:\d*$/,
          inside: {
            "port-delimiter": /^:/,
            port: /^\d+/
          }
        },
        host: {
          pattern: /[\s\S]+/,
          inside: {
            "ip-literal": {
              pattern: /^\[[\s\S]+\]$/,
              inside: {
                "ip-literal-delimiter": /^\[|\]$/,
                "ipv-future": /^v[\s\S]+/,
                "ipv6-address": /^[\s\S]+/
              }
            },
            "ipv4-address": /^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]\d{0,2})$/
          }
        }
      }
    },
    path: {
      pattern: /^[\w\-.~!$&'()*+,;=%:@/]+/m,
      inside: {
        "path-separator": /\//
      }
    }
  }, i.languages.url = i.languages.uri;
}
Abe.displayName = "http";
Abe.aliases = [];
function Abe(i) {
  (function(e) {
    function t(u) {
      return RegExp("(^(?:" + u + "):[ 	]*(?![ 	]))[^]+", "i");
    }
    e.languages.http = {
      "request-line": {
        pattern: /^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,
        inside: {
          // HTTP Method
          method: {
            pattern: /^[A-Z]+\b/,
            alias: "property"
          },
          // Request Target e.g. http://example.com, /path/to/file
          "request-target": {
            pattern: /^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,
            lookbehind: !0,
            alias: "url",
            inside: e.languages.uri
          },
          // HTTP Version
          "http-version": {
            pattern: /^(\s)HTTP\/[\d.]+/,
            lookbehind: !0,
            alias: "property"
          }
        }
      },
      "response-status": {
        pattern: /^HTTP\/[\d.]+ \d+ .+/m,
        inside: {
          // HTTP Version
          "http-version": {
            pattern: /^HTTP\/[\d.]+/,
            alias: "property"
          },
          // Status Code
          "status-code": {
            pattern: /^(\s)\d+(?=\s)/,
            lookbehind: !0,
            alias: "number"
          },
          // Reason Phrase
          "reason-phrase": {
            pattern: /^(\s).+/,
            lookbehind: !0,
            alias: "string"
          }
        }
      },
      header: {
        pattern: /^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,
        inside: {
          "header-value": [
            {
              pattern: t(/Content-Security-Policy/.source),
              lookbehind: !0,
              alias: ["csp", "languages-csp"],
              inside: e.languages.csp
            },
            {
              pattern: t(/Public-Key-Pins(?:-Report-Only)?/.source),
              lookbehind: !0,
              alias: ["hpkp", "languages-hpkp"],
              inside: e.languages.hpkp
            },
            {
              pattern: t(/Strict-Transport-Security/.source),
              lookbehind: !0,
              alias: ["hsts", "languages-hsts"],
              inside: e.languages.hsts
            },
            {
              pattern: t(/[^:]+/.source),
              lookbehind: !0
            }
          ],
          "header-name": {
            pattern: /^[^:]+/,
            alias: "keyword"
          },
          punctuation: /^:/
        }
      }
    };
    var n = e.languages, r = {
      "application/javascript": n.javascript,
      "application/json": n.json || n.javascript,
      "application/xml": n.xml,
      "text/xml": n.xml,
      "text/html": n.html,
      "text/css": n.css,
      "text/plain": n.plain
    }, s = {
      "application/json": !0,
      "application/xml": !0
    };
    function o(u) {
      var d = u.replace(/^[a-z]+\//, ""), h = "\\w+/(?:[\\w.-]+\\+)+" + d + "(?![+\\w.-])";
      return "(?:" + u + "|" + h + ")";
    }
    var a;
    for (var l in r)
      if (r[l]) {
        a = a || {};
        var c = s[l] ? o(l) : l;
        a[l.replace(/\//g, "-")] = {
          pattern: RegExp(
            "(" + /content-type:\s*/.source + c + /(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source + ")" + // This is a little interesting:
            // The HTTP format spec required 1 empty line before the body to make everything unambiguous.
            // However, when writing code by hand (e.g. to display on a website) people can forget about this,
            // so we want to be liberal here. We will allow the empty line to be omitted if the first line of
            // the body does not start with a [\w-] character (as headers do).
            /[^ \t\w-][\s\S]*/.source,
            "i"
          ),
          lookbehind: !0,
          inside: r[l]
        };
      }
    a && e.languages.insertBefore("http", "header", a);
  })(i);
}
Obe.displayName = "ichigojam";
Obe.aliases = [];
function Obe(i) {
  i.languages.ichigojam = {
    comment: /(?:\B'|REM)(?:[^\n\r]*)/i,
    string: {
      pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,
      greedy: !0
    },
    number: /\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,
    keyword: /\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GOTO|GSB|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RIGHT|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i,
    function: /\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i,
    label: /(?:\B@\S+)/,
    operator: /<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i,
    punctuation: /[\[,;:()\]]/
  };
}
Mbe.displayName = "icon";
Mbe.aliases = [];
function Mbe(i) {
  i.languages.icon = {
    comment: /#.*/,
    string: {
      pattern: /(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/,
      greedy: !0
    },
    number: /\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,
    "builtin-keyword": {
      pattern: /&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,
      alias: "variable"
    },
    directive: {
      pattern: /\$\w+/,
      alias: "builtin"
    },
    keyword: /\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,
    function: /\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,
    operator: /[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|<?=?)|>>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,
    punctuation: /[\[\](){},;]/
  };
}
Pbe.displayName = "icu-message-format";
Pbe.aliases = [];
function Pbe(i) {
  (function(e) {
    function t(l, c) {
      return c <= 0 ? /[]/.source : l.replace(/<SELF>/g, function() {
        return t(l, c - 1);
      });
    }
    var n = /'[{}:=,](?:[^']|'')*'(?!')/, r = {
      pattern: /''/,
      greedy: !0,
      alias: "operator"
    }, s = {
      pattern: n,
      greedy: !0,
      inside: {
        escape: r
      }
    }, o = t(
      /\{(?:[^{}']|'(?![{},'])|''|<STR>|<SELF>)*\}/.source.replace(
        /<STR>/g,
        function() {
          return n.source;
        }
      ),
      8
    ), a = {
      pattern: RegExp(o),
      inside: {
        message: {
          pattern: /^(\{)[\s\S]+(?=\}$)/,
          lookbehind: !0,
          inside: null
          // see below
        },
        "message-delimiter": {
          pattern: /./,
          alias: "punctuation"
        }
      }
    };
    e.languages["icu-message-format"] = {
      argument: {
        pattern: RegExp(o),
        greedy: !0,
        inside: {
          content: {
            pattern: /^(\{)[\s\S]+(?=\}$)/,
            lookbehind: !0,
            inside: {
              "argument-name": {
                pattern: /^(\s*)[^{}:=,\s]+/,
                lookbehind: !0
              },
              "choice-style": {
                // https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1ChoiceFormat.html#details
                pattern: /^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/,
                lookbehind: !0,
                inside: {
                  punctuation: /\|/,
                  range: {
                    pattern: /^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/,
                    lookbehind: !0,
                    inside: {
                      operator: /[<#\u2264]/,
                      number: /\S+/
                    }
                  },
                  rest: null
                  // see below
                }
              },
              "plural-style": {
                // https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/PluralFormat.html#:~:text=Patterns%20and%20Their%20Interpretation
                pattern: /^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/,
                lookbehind: !0,
                inside: {
                  offset: /^offset:\s*\d+/,
                  "nested-message": a,
                  selector: {
                    pattern: /=\d+|[^{}:=,\s]+/,
                    inside: {
                      keyword: /^(?:few|many|one|other|two|zero)$/
                    }
                  }
                }
              },
              "select-style": {
                // https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/SelectFormat.html#:~:text=Patterns%20and%20Their%20Interpretation
                pattern: /^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/,
                lookbehind: !0,
                inside: {
                  "nested-message": a,
                  selector: {
                    pattern: /[^{}:=,\s]+/,
                    inside: {
                      keyword: /^other$/
                    }
                  }
                }
              },
              keyword: /\b(?:choice|plural|select|selectordinal)\b/,
              "arg-type": {
                pattern: /\b(?:date|duration|number|ordinal|spellout|time)\b/,
                alias: "keyword"
              },
              "arg-skeleton": {
                pattern: /(,\s*)::[^{}:=,\s]+/,
                lookbehind: !0
              },
              "arg-style": {
                pattern: /(,\s*)(?:currency|full|integer|long|medium|percent|short)(?=\s*$)/,
                lookbehind: !0
              },
              "arg-style-text": {
                pattern: RegExp(
                  /(^\s*,\s*(?=\S))/.source + t(/(?:[^{}']|'[^']*'|\{(?:<SELF>)?\})+/.source, 8) + "$"
                ),
                lookbehind: !0,
                alias: "string"
              },
              punctuation: /,/
            }
          },
          "argument-delimiter": {
            pattern: /./,
            alias: "operator"
          }
        }
      },
      escape: r,
      string: s
    }, a.inside.message.inside = e.languages["icu-message-format"], e.languages["icu-message-format"].argument.inside.content.inside["choice-style"].inside.rest = e.languages["icu-message-format"];
  })(i);
}
Fbe.displayName = "idris";
Fbe.aliases = ["idr"];
function Fbe(i) {
  i.register(l6), i.languages.idris = i.languages.extend("haskell", {
    comment: {
      pattern: /(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m
    },
    keyword: /\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/,
    builtin: void 0
  }), i.languages.insertBefore("idris", "keyword", {
    "import-statement": {
      pattern: /(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m,
      lookbehind: !0,
      inside: {
        punctuation: /\./
      }
    }
  }), i.languages.idr = i.languages.idris;
}
Bbe.displayName = "ignore";
Bbe.aliases = ["gitignore", "hgignore", "npmignore"];
function Bbe(i) {
  (function(e) {
    e.languages.ignore = {
      // https://git-scm.com/docs/gitignore
      comment: /^#.*/m,
      entry: {
        pattern: /\S(?:.*(?:(?:\\ )|\S))?/,
        alias: "string",
        inside: {
          operator: /^!|\*\*?|\?/,
          regex: {
            pattern: /(^|[^\\])\[[^\[\]]*\]/,
            lookbehind: !0
          },
          punctuation: /\//
        }
      }
    }, e.languages.gitignore = e.languages.ignore, e.languages.hgignore = e.languages.ignore, e.languages.npmignore = e.languages.ignore;
  })(i);
}
Hbe.displayName = "inform7";
Hbe.aliases = [];
function Hbe(i) {
  i.languages.inform7 = {
    string: {
      pattern: /"[^"]*"/,
      inside: {
        substitution: {
          pattern: /\[[^\[\]]+\]/,
          inside: {
            delimiter: {
              pattern: /\[|\]/,
              alias: "punctuation"
            }
            // See rest below
          }
        }
      }
    },
    comment: {
      pattern: /\[[^\[\]]+\]/,
      greedy: !0
    },
    title: {
      pattern: /^[ \t]*(?:book|chapter|part(?! of)|section|table|volume)\b.+/im,
      alias: "important"
    },
    number: {
      pattern: /(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:eight|eleven|five|four|nine|one|seven|six|ten|three|twelve|two))\b(?!-)/i,
      lookbehind: !0
    },
    verb: {
      pattern: /(^|[^-])\b(?:answering|applying to|are|asking|attacking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:ing|s)?|consulting|contain(?:ing|s)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:s|ve|ving)|hold(?:ing|s)?|impl(?:ies|y)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:ing|s)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:ing|s)?|setting|showing|singing|sleeping|smelling|squeezing|support(?:ing|s)?|swearing|switching|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:ing|s)?|var(?:ies|y|ying)|waiting|waking|waving|wear(?:ing|s)?)\b(?!-)/i,
      lookbehind: !0,
      alias: "operator"
    },
    keyword: {
      pattern: /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|the story|unless)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,
      lookbehind: !0
    },
    property: {
      pattern: /(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: off| on)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,
      lookbehind: !0,
      alias: "symbol"
    },
    position: {
      pattern: /(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,
      lookbehind: !0,
      alias: "keyword"
    },
    type: {
      pattern: /(^|[^-])\b(?:actions?|activit(?:ies|y)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,
      lookbehind: !0,
      alias: "variable"
    },
    punctuation: /[.,:;(){}]/
  }, i.languages.inform7.string.inside.substitution.inside.rest = i.languages.inform7, i.languages.inform7.string.inside.substitution.inside.rest.text = {
    pattern: /\S(?:\s*\S)*/,
    alias: "comment"
  };
}
Wbe.displayName = "io";
Wbe.aliases = [];
function Wbe(i) {
  i.languages.io = {
    comment: {
      pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*|#.*)/,
      lookbehind: !0,
      greedy: !0
    },
    "triple-quoted-string": {
      pattern: /"""(?:\\[\s\S]|(?!""")[^\\])*"""/,
      greedy: !0,
      alias: "string"
    },
    string: {
      pattern: /"(?:\\.|[^\\\r\n"])*"/,
      greedy: !0
    },
    keyword: /\b(?:activate|activeCoroCount|asString|block|break|call|catch|clone|collectGarbage|compileString|continue|do|doFile|doMessage|doString|else|elseif|exit|for|foreach|forward|getEnvironmentVariable|getSlot|hasSlot|if|ifFalse|ifNil|ifNilEval|ifTrue|isActive|isNil|isResumable|list|message|method|parent|pass|pause|perform|performWithArgList|print|println|proto|raise|raiseResumable|removeSlot|resend|resume|schedulerSleepSeconds|self|sender|setSchedulerSleepSeconds|setSlot|shallowCopy|slotNames|super|system|then|thisBlock|thisContext|try|type|uniqueId|updateSlot|wait|while|write|yield)\b/,
    builtin: /\b(?:Array|AudioDevice|AudioMixer|BigNum|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Random|Regex|SGML|SGMLElement|SGMLParser|SQLite|Sequence|Server|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink)\b/,
    boolean: /\b(?:false|nil|true)\b/,
    number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?/i,
    operator: /[=!*/%+\-^&|]=|>>?=?|<<?=?|:?:?=|\+\+?|--?|\*\*?|\/\/?|%|\|\|?|&&?|\b(?:and|not|or|return)\b|@@?|\?\??|\.\./,
    punctuation: /[{}[\];(),.:]/
  };
}
Vbe.displayName = "j";
Vbe.aliases = [];
function Vbe(i) {
  i.languages.j = {
    comment: {
      pattern: /\bNB\..*/,
      greedy: !0
    },
    string: {
      pattern: /'(?:''|[^'\r\n])*'/,
      greedy: !0
    },
    keyword: /\b(?:(?:CR|LF|adverb|conjunction|def|define|dyad|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,
    verb: {
      // Negative look-ahead prevents bad highlighting
      // of ^: ;. =. =: !. !:
      pattern: /(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,
      alias: "keyword"
    },
    number: /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,
    adverb: {
      pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,
      alias: "builtin"
    },
    operator: /[=a][.:]|_\./,
    conjunction: {
      pattern: /&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,
      alias: "variable"
    },
    punctuation: /[()]/
  };
}
y2.displayName = "javadoclike";
y2.aliases = [];
function y2(i) {
  (function(e) {
    var t = e.languages.javadoclike = {
      parameter: {
        pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,
        lookbehind: !0
      },
      keyword: {
        // keywords are the first word in a line preceded be an `@` or surrounded by curly braces.
        // @word, {@word}
        pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,
        lookbehind: !0
      },
      punctuation: /[{}]/
    };
    function n(s, o) {
      var a = "doc-comment", l = e.languages[s];
      if (l) {
        var c = l[a];
        if (!c) {
          var u = {};
          u[a] = {
            pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,
            lookbehind: !0,
            alias: "comment"
          }, l = e.languages.insertBefore(s, "comment", u), c = l[a];
        }
        if (c instanceof RegExp && (c = l[a] = {
          pattern: c
        }), Array.isArray(c))
          for (var d = 0, h = c.length; d < h; d++)
            c[d] instanceof RegExp && (c[d] = {
              pattern: c[d]
            }), o(c[d]);
        else
          o(c);
      }
    }
    function r(s, o) {
      typeof s == "string" && (s = [s]), s.forEach(function(a) {
        n(a, function(l) {
          l.inside || (l.inside = {}), l.inside.rest = o;
        });
      });
    }
    Object.defineProperty(t, "addSupport", {
      value: r
    }), t.addSupport(["java", "javascript", "php"], t);
  })(i);
}
Ube.displayName = "scala";
Ube.aliases = [];
function Ube(i) {
  i.register(uk), i.languages.scala = i.languages.extend("java", {
    "triple-quoted-string": {
      pattern: /"""[\s\S]*?"""/,
      greedy: !0,
      alias: "string"
    },
    string: {
      pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    keyword: /<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/,
    number: /\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,
    builtin: /\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,
    symbol: /'[^\d\s\\]\w*/
  }), i.languages.insertBefore("scala", "triple-quoted-string", {
    "string-interpolation": {
      pattern: /\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i,
      greedy: !0,
      inside: {
        id: {
          pattern: /^\w+/,
          greedy: !0,
          alias: "function"
        },
        escape: {
          pattern: /\\\$"|\$[$"]/,
          greedy: !0,
          alias: "symbol"
        },
        interpolation: {
          pattern: /\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,
          greedy: !0,
          inside: {
            punctuation: /^\$\{?|\}$/,
            expression: {
              pattern: /[\s\S]+/,
              inside: i.languages.scala
            }
          }
        },
        string: /[\s\S]+/
      }
    }
  }), delete i.languages.scala["class-name"], delete i.languages.scala.function, delete i.languages.scala.constant;
}
zbe.displayName = "javadoc";
zbe.aliases = [];
function zbe(i) {
  i.register(uk), i.register(y2), i.register(Nc), (function(e) {
    var t = /(^(?:[\t ]*(?:\*\s*)*))[^*\s].*$/m, n = /#\s*\w+(?:\s*\([^()]*\))?/.source, r = /(?:\b[a-zA-Z]\w+\s*\.\s*)*\b[A-Z]\w*(?:\s*<mem>)?|<mem>/.source.replace(
      /<mem>/g,
      function() {
        return n;
      }
    );
    e.languages.javadoc = e.languages.extend("javadoclike", {}), e.languages.insertBefore("javadoc", "keyword", {
      reference: {
        pattern: RegExp(
          /(@(?:exception|link|linkplain|see|throws|value)\s+(?:\*\s*)?)/.source + "(?:" + r + ")"
        ),
        lookbehind: !0,
        inside: {
          function: {
            pattern: /(#\s*)\w+(?=\s*\()/,
            lookbehind: !0
          },
          field: {
            pattern: /(#\s*)\w+/,
            lookbehind: !0
          },
          namespace: {
            pattern: /\b(?:[a-z]\w*\s*\.\s*)+/,
            inside: {
              punctuation: /\./
            }
          },
          "class-name": /\b[A-Z]\w*/,
          keyword: e.languages.java.keyword,
          punctuation: /[#()[\],.]/
        }
      },
      "class-name": {
        // @param <T> the first generic type parameter
        pattern: /(@param\s+)<[A-Z]\w*>/,
        lookbehind: !0,
        inside: {
          punctuation: /[.<>]/
        }
      },
      "code-section": [
        {
          pattern: /(\{@code\s+(?!\s))(?:[^\s{}]|\s+(?![\s}])|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+(?=\s*\})/,
          lookbehind: !0,
          inside: {
            code: {
              // there can't be any HTML inside of {@code} tags
              pattern: t,
              lookbehind: !0,
              inside: e.languages.java,
              alias: "language-java"
            }
          }
        },
        {
          pattern: /(<(code|pre|tt)>(?!<code>)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/,
          lookbehind: !0,
          inside: {
            line: {
              pattern: t,
              lookbehind: !0,
              inside: {
                // highlight HTML tags and entities
                tag: e.languages.markup.tag,
                entity: e.languages.markup.entity,
                code: {
                  // everything else is Java code
                  pattern: /.+/,
                  inside: e.languages.java,
                  alias: "language-java"
                }
              }
            }
          }
        }
      ],
      tag: e.languages.markup.tag,
      entity: e.languages.markup.entity
    }), e.languages.javadoclike.addSupport("java", e.languages.javadoc);
  })(i);
}
$be.displayName = "javastacktrace";
$be.aliases = [];
function $be(i) {
  i.languages.javastacktrace = {
    // java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
    // Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
    // Caused by: com.example.myproject.MyProjectServletException
    // Caused by: MidLevelException: LowLevelException
    // Suppressed: Resource$CloseFailException: Resource ID = 0
    summary: {
      pattern: /^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m,
      lookbehind: !0,
      inside: {
        keyword: {
          pattern: /^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,
          lookbehind: !0
        },
        // the current thread if the summary starts with 'Exception in thread'
        string: {
          pattern: /^(\s*)"[^"]*"/,
          lookbehind: !0
        },
        exceptions: {
          pattern: /^(:?\s*)[\w$.]+(?=:|$)/,
          lookbehind: !0,
          inside: {
            "class-name": /[\w$]+$/,
            namespace: /\b[a-z]\w*\b/,
            punctuation: /\./
          }
        },
        message: {
          pattern: /(:\s*)\S.*/,
          lookbehind: !0,
          alias: "string"
        },
        punctuation: /:/
      }
    },
    // at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    // at org.hsqldb.jdbc.Util.throwError(Unknown Source) here could be some notes
    // at java.base/java.lang.Class.forName0(Native Method)
    // at Util.<init>(Unknown Source)
    // at com.foo.loader/foo@9.0/com.foo.Main.run(Main.java:101)
    // at com.foo.loader//com.foo.bar.App.run(App.java:12)
    // at acme@2.1/org.acme.Lib.test(Lib.java:80)
    // at MyClass.mash(MyClass.java:9)
    //
    // More information:
    // https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/StackTraceElement.html#toString()
    //
    // A valid Java module name is defined as:
    //   "A module name consists of one or more Java identifiers (§3.8) separated by "." tokens."
    // https://docs.oracle.com/javase/specs/jls/se9/html/jls-6.html#jls-ModuleName
    //
    // A Java module version is defined by this class:
    // https://docs.oracle.com/javase/9/docs/api/java/lang/module/ModuleDescriptor.Version.html
    // This is the implementation of the `parse` method in JDK13:
    // https://github.com/matcdac/jdk/blob/2305df71d1b7710266ae0956d73927a225132c0f/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java#L1108
    // However, to keep this simple, a version will be matched by the pattern /@[\w$.+-]*/.
    "stack-frame": {
      pattern: /^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:<init>)?\([^()]*\)/m,
      lookbehind: !0,
      inside: {
        keyword: {
          pattern: /^(\s*)at(?= )/,
          lookbehind: !0
        },
        source: [
          // (Main.java:15)
          // (Main.scala:15)
          {
            pattern: /(\()\w+\.\w+:\d+(?=\))/,
            lookbehind: !0,
            inside: {
              file: /^\w+\.\w+/,
              punctuation: /:/,
              "line-number": {
                pattern: /\b\d+\b/,
                alias: "number"
              }
            }
          },
          // (Unknown Source)
          // (Native Method)
          // (...something...)
          {
            pattern: /(\()[^()]*(?=\))/,
            lookbehind: !0,
            inside: {
              keyword: /^(?:Native Method|Unknown Source)$/
            }
          }
        ],
        "class-name": /[\w$]+(?=\.(?:<init>|[\w$]+)\()/,
        function: /(?:<init>|[\w$]+)(?=\()/,
        "class-loader": {
          pattern: /(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/,
          lookbehind: !0,
          alias: "namespace",
          inside: {
            punctuation: /\./
          }
        },
        module: {
          pattern: /([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/,
          lookbehind: !0,
          inside: {
            version: {
              pattern: /(@)[\s\S]+/,
              lookbehind: !0,
              alias: "number"
            },
            punctuation: /[@.]/
          }
        },
        namespace: {
          pattern: /(?:\b[a-z]\w*\.)+/,
          inside: {
            punctuation: /\./
          }
        },
        punctuation: /[()/.]/
      }
    },
    // ... 32 more
    // ... 32 common frames omitted
    more: {
      pattern: /^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m,
      lookbehind: !0,
      inside: {
        punctuation: /\.{3}/,
        number: /\d+/,
        keyword: /\b[a-z]+(?: [a-z]+)*\b/
      }
    }
  };
}
jbe.displayName = "jexl";
jbe.aliases = [];
function jbe(i) {
  i.languages.jexl = {
    string: /(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
    transform: {
      pattern: /(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/,
      alias: "function",
      lookbehind: !0
    },
    function: /[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/,
    number: /\b\d+(?:\.\d+)?\b|\B\.\d+\b/,
    operator: /[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/,
    boolean: /\b(?:false|true)\b/,
    keyword: /\bin\b/,
    punctuation: /[{}[\](),.]/
  };
}
Gbe.displayName = "jolie";
Gbe.aliases = [];
function Gbe(i) {
  i.register(Wr), i.languages.jolie = i.languages.extend("clike", {
    string: {
      pattern: /(^|[^\\])"(?:\\[\s\S]|[^"\\])*"/,
      lookbehind: !0,
      greedy: !0
    },
    "class-name": {
      pattern: /((?:\b(?:as|courier|embed|in|inputPort|outputPort|service)\b|@)[ \t]*)\w+/,
      lookbehind: !0
    },
    keyword: /\b(?:as|cH|comp|concurrent|constants|courier|cset|csets|default|define|else|embed|embedded|execution|exit|extender|for|foreach|forward|from|global|if|import|in|include|init|inputPort|install|instanceof|interface|is_defined|linkIn|linkOut|main|new|nullProcess|outputPort|over|private|provide|public|scope|sequential|service|single|spawn|synchronized|this|throw|throws|type|undef|until|while|with)\b/,
    function: /\b[a-z_]\w*(?=[ \t]*[@(])/i,
    number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i,
    operator: /-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[?\/%^@|]/,
    punctuation: /[()[\]{},;.:]/,
    builtin: /\b(?:Byte|any|bool|char|double|enum|float|int|length|long|ranges|regex|string|undefined|void)\b/
  }), i.languages.insertBefore("jolie", "keyword", {
    aggregates: {
      pattern: /(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,
      lookbehind: !0,
      inside: {
        keyword: /\bwith\b/,
        "class-name": /\w+/,
        punctuation: /,/
      }
    },
    redirects: {
      pattern: /(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,
      lookbehind: !0,
      inside: {
        punctuation: /,/,
        "class-name": /\w+/,
        operator: /=>/
      }
    },
    property: {
      pattern: /\b(?:Aggregates|[Ii]nterfaces|Java|Javascript|Jolie|[Ll]ocation|OneWay|[Pp]rotocol|Redirects|RequestResponse)\b(?=[ \t]*:)/
    }
  });
}
qbe.displayName = "jq";
qbe.aliases = [];
function qbe(i) {
  (function(e) {
    var t = /\\\((?:[^()]|\([^()]*\))*\)/.source, n = RegExp(
      /(^|[^\\])"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(
        /__/g,
        function() {
          return t;
        }
      )
    ), r = {
      interpolation: {
        pattern: RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + t),
        lookbehind: !0,
        inside: {
          content: {
            pattern: /^(\\\()[\s\S]+(?=\)$)/,
            lookbehind: !0,
            inside: null
            // see below
          },
          punctuation: /^\\\(|\)$/
        }
      }
    }, s = e.languages.jq = {
      comment: /#.*/,
      property: {
        pattern: RegExp(n.source + /(?=\s*:(?!:))/.source),
        lookbehind: !0,
        greedy: !0,
        inside: r
      },
      string: {
        pattern: n,
        lookbehind: !0,
        greedy: !0,
        inside: r
      },
      function: {
        pattern: /(\bdef\s+)[a-z_]\w+/i,
        lookbehind: !0
      },
      variable: /\B\$\w+/,
      "property-literal": {
        pattern: /\b[a-z_]\w*(?=\s*:(?!:))/i,
        alias: "property"
      },
      keyword: /\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/,
      boolean: /\b(?:false|true)\b/,
      number: /(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/,
      operator: [
        {
          pattern: /\|=?/,
          alias: "pipe"
        },
        /\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|not|or)\b/
      ],
      "c-style-function": {
        pattern: /\b[a-z_]\w*(?=\s*\()/i,
        alias: "function"
      },
      punctuation: /::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/,
      dot: {
        pattern: /\./,
        alias: "important"
      }
    };
    r.interpolation.inside.content.inside = s;
  })(i);
}
Kbe.displayName = "js-templates";
Kbe.aliases = [];
function Kbe(i) {
  i.register(_u), (function(e) {
    var t = e.languages.javascript["template-string"], n = t.pattern.source, r = t.inside.interpolation, s = r.inside["interpolation-punctuation"], o = r.pattern.source;
    function a(m, _) {
      if (e.languages[m])
        return {
          pattern: RegExp("((?:" + _ + ")\\s*)" + n),
          lookbehind: !0,
          greedy: !0,
          inside: {
            "template-punctuation": {
              pattern: /^`|`$/,
              alias: "string"
            },
            "embedded-code": {
              pattern: /[\s\S]+/,
              alias: m
            }
          }
        };
    }
    e.languages.javascript["template-string"] = [
      // styled-jsx:
      //   css`a { color: #25F; }`
      // styled-components:
      //   styled.h1`color: red;`
      a(
        "css",
        /\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source
      ),
      // html`<p></p>`
      // div.innerHTML = `<p></p>`
      a("html", /\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),
      // svg`<path fill="#fff" d="M55.37 ..."/>`
      a("svg", /\bsvg/.source),
      // md`# h1`, markdown`## h2`
      a("markdown", /\b(?:markdown|md)/.source),
      // gql`...`, graphql`...`, graphql.experimental`...`
      a(
        "graphql",
        /\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source
      ),
      // sql`...`
      a("sql", /\bsql/.source),
      // vanilla template string
      t
    ].filter(Boolean);
    function l(m, _) {
      return "___" + _.toUpperCase() + "_" + m + "___";
    }
    function c(m, _, v) {
      var w = {
        code: m,
        grammar: _,
        language: v
      };
      return e.hooks.run("before-tokenize", w), w.tokens = e.tokenize(w.code, w.grammar), e.hooks.run("after-tokenize", w), w.tokens;
    }
    function u(m) {
      var _ = {};
      _["interpolation-punctuation"] = s;
      var v = e.tokenize(m, _);
      if (v.length === 3) {
        var w = [1, 1];
        w.push.apply(
          w,
          c(v[1], e.languages.javascript, "javascript")
        ), v.splice.apply(v, w);
      }
      return new e.Token(
        "interpolation",
        v,
        r.alias,
        m
      );
    }
    function d(m, _, v) {
      var w = e.tokenize(m, {
        interpolation: {
          pattern: RegExp(o),
          lookbehind: !0
        }
      }), E = 0, L = {}, T = w.map(function(M) {
        if (typeof M == "string")
          return M;
        for (var B = M.content, H; m.indexOf(
          H = l(E++, v)
        ) !== -1; )
          ;
        return L[H] = B, H;
      }).join(""), D = c(T, _, v), N = Object.keys(L);
      E = 0;
      function R(M) {
        for (var B = 0; B < M.length; B++) {
          if (E >= N.length)
            return;
          var H = M[B];
          if (typeof H == "string" || typeof H.content == "string") {
            var j = N[E], K = typeof H == "string" ? H : (
              /** @type {string} */
              H.content
            ), X = K.indexOf(j);
            if (X !== -1) {
              ++E;
              var Y = K.substring(0, X), G = u(
                L[j]
              ), Q = K.substring(X + j.length), oe = [];
              if (Y && oe.push(Y), oe.push(G), Q) {
                var Z = [Q];
                R(Z), oe.push.apply(oe, Z);
              }
              typeof H == "string" ? (M.splice.apply(M, [B, 1].concat(oe)), B += oe.length - 1) : H.content = oe;
            }
          } else {
            var pe = H.content;
            Array.isArray(pe) ? R(pe) : R([pe]);
          }
        }
      }
      return R(D), new e.Token(
        v,
        D,
        "language-" + v,
        m
      );
    }
    var h = {
      javascript: !0,
      js: !0,
      typescript: !0,
      ts: !0,
      jsx: !0,
      tsx: !0
    };
    e.hooks.add("after-tokenize", function(m) {
      if (!(m.language in h))
        return;
      function _(v) {
        for (var w = 0, E = v.length; w < E; w++) {
          var L = v[w];
          if (typeof L != "string") {
            var T = L.content;
            if (!Array.isArray(T)) {
              typeof T != "string" && _([T]);
              continue;
            }
            if (L.type === "template-string") {
              var D = T[1];
              if (T.length === 3 && typeof D != "string" && D.type === "embedded-code") {
                var N = g(D), R = D.alias, M = Array.isArray(R) ? R[0] : R, B = e.languages[M];
                if (!B)
                  continue;
                T[1] = d(N, B, M);
              }
            } else
              _(T);
          }
        }
      }
      _(m.tokens);
    });
    function g(m) {
      return typeof m == "string" ? m : Array.isArray(m) ? m.map(g).join("") : g(m.content);
    }
  })(i);
}
Ybe.displayName = "jsdoc";
Ybe.aliases = [];
function Ybe(i) {
  i.register(y2), i.register(_u), i.register(_2), (function(e) {
    var t = e.languages.javascript, n = /\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source, r = "(@(?:arg|argument|param|property)\\s+(?:" + n + "\\s+)?)";
    e.languages.jsdoc = e.languages.extend("javadoclike", {
      parameter: {
        // @param {string} foo - foo bar
        pattern: RegExp(
          r + /(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source
        ),
        lookbehind: !0,
        inside: {
          punctuation: /\./
        }
      }
    }), e.languages.insertBefore("jsdoc", "keyword", {
      "optional-parameter": {
        // @param {string} [baz.foo="bar"] foo bar
        pattern: RegExp(
          r + /\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source
        ),
        lookbehind: !0,
        inside: {
          parameter: {
            pattern: /(^\[)[$\w\xA0-\uFFFF\.]+/,
            lookbehind: !0,
            inside: {
              punctuation: /\./
            }
          },
          code: {
            pattern: /(=)[\s\S]*(?=\]$)/,
            lookbehind: !0,
            inside: t,
            alias: "language-javascript"
          },
          punctuation: /[=[\]]/
        }
      },
      "class-name": [
        {
          pattern: RegExp(
            /(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(
              /<TYPE>/g,
              function() {
                return n;
              }
            )
          ),
          lookbehind: !0,
          inside: {
            punctuation: /\./
          }
        },
        {
          pattern: RegExp("(@[a-z]+\\s+)" + n),
          lookbehind: !0,
          inside: {
            string: t.string,
            number: t.number,
            boolean: t.boolean,
            keyword: e.languages.typescript.keyword,
            operator: /=>|\.\.\.|[&|?:*]/,
            punctuation: /[.,;=<>{}()[\]]/
          }
        }
      ],
      example: {
        pattern: /(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,
        lookbehind: !0,
        inside: {
          code: {
            pattern: /^([\t ]*(?:\*\s*)?)\S.*$/m,
            lookbehind: !0,
            inside: t,
            alias: "language-javascript"
          }
        }
      }
    }), e.languages.javadoclike.addSupport("javascript", e.languages.jsdoc);
  })(i);
}
Xbe.displayName = "n4js";
Xbe.aliases = ["n4jsd"];
function Xbe(i) {
  i.register(_u), i.languages.n4js = i.languages.extend("javascript", {
    // Keywords from N4JS language spec: https://numberfour.github.io/n4js/spec/N4JSSpec.html
    keyword: /\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/
  }), i.languages.insertBefore("n4js", "constant", {
    // Annotations in N4JS spec: https://numberfour.github.io/n4js/spec/N4JSSpec.html#_annotations
    annotation: {
      pattern: /@+\w+/,
      alias: "operator"
    }
  }), i.languages.n4jsd = i.languages.n4js;
}
Zbe.displayName = "js-extras";
Zbe.aliases = [];
function Zbe(i) {
  i.register(_u), (function(e) {
    e.languages.insertBefore("javascript", "function-variable", {
      "method-variable": {
        pattern: RegExp(
          "(\\.\\s*)" + e.languages.javascript["function-variable"].pattern.source
        ),
        lookbehind: !0,
        alias: ["function-variable", "method", "function", "property-access"]
      }
    }), e.languages.insertBefore("javascript", "function", {
      method: {
        pattern: RegExp(
          "(\\.\\s*)" + e.languages.javascript.function.source
        ),
        lookbehind: !0,
        alias: ["function", "property-access"]
      }
    }), e.languages.insertBefore("javascript", "constant", {
      "known-class-name": [
        {
          // standard built-ins
          // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
          pattern: /\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,
          alias: "class-name"
        },
        {
          // errors
          pattern: /\b(?:[A-Z]\w*)Error\b/,
          alias: "class-name"
        }
      ]
    });
    function t(l, c) {
      return RegExp(
        l.replace(/<ID>/g, function() {
          return /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source;
        }),
        c
      );
    }
    e.languages.insertBefore("javascript", "keyword", {
      imports: {
        // https://tc39.es/ecma262/#sec-imports
        pattern: t(
          /(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source
        ),
        lookbehind: !0,
        inside: e.languages.javascript
      },
      exports: {
        // https://tc39.es/ecma262/#sec-exports
        pattern: t(
          /(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source
        ),
        lookbehind: !0,
        inside: e.languages.javascript
      }
    }), e.languages.javascript.keyword.unshift(
      {
        pattern: /\b(?:as|default|export|from|import)\b/,
        alias: "module"
      },
      {
        pattern: /\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,
        alias: "control-flow"
      },
      {
        pattern: /\bnull\b/,
        alias: ["null", "nil"]
      },
      {
        pattern: /\bundefined\b/,
        alias: "nil"
      }
    ), e.languages.insertBefore("javascript", "operator", {
      spread: {
        pattern: /\.{3}/,
        alias: "operator"
      },
      arrow: {
        pattern: /=>/,
        alias: "operator"
      }
    }), e.languages.insertBefore("javascript", "punctuation", {
      "property-access": {
        pattern: t(/(\.\s*)#?<ID>/.source),
        lookbehind: !0
      },
      "maybe-class-name": {
        pattern: /(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,
        lookbehind: !0
      },
      dom: {
        // this contains only a few commonly used DOM variables
        pattern: /\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,
        alias: "variable"
      },
      console: {
        pattern: /\bconsole(?=\s*\.)/,
        alias: "class-name"
      }
    });
    for (var n = [
      "function",
      "function-variable",
      "method",
      "method-variable",
      "property-access"
    ], r = 0; r < n.length; r++) {
      var s = n[r], o = e.languages.javascript[s];
      e.util.type(o) === "RegExp" && (o = e.languages.javascript[s] = {
        pattern: o
      });
      var a = o.inside || {};
      o.inside = a, a["maybe-class-name"] = /^[A-Z][\s\S]*/;
    }
  })(i);
}
Qbe.displayName = "json5";
Qbe.aliases = [];
function Qbe(i) {
  i.register(p2), (function(e) {
    var t = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;
    e.languages.json5 = e.languages.extend("json", {
      property: [
        {
          pattern: RegExp(t.source + "(?=\\s*:)"),
          greedy: !0
        },
        {
          pattern: /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,
          alias: "unquoted"
        }
      ],
      string: {
        pattern: t,
        greedy: !0
      },
      number: /[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/
    });
  })(i);
}
Jbe.displayName = "jsonp";
Jbe.aliases = [];
function Jbe(i) {
  i.register(p2), i.languages.jsonp = i.languages.extend("json", {
    punctuation: /[{}[\]();,.]/
  }), i.languages.insertBefore("jsonp", "punctuation", {
    function: /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/
  });
}
eve.displayName = "jsstacktrace";
eve.aliases = [];
function eve(i) {
  i.languages.jsstacktrace = {
    "error-message": {
      pattern: /^\S.*/m,
      alias: "string"
    },
    "stack-frame": {
      pattern: /(^[ \t]+)at[ \t].*/m,
      lookbehind: !0,
      inside: {
        "not-my-code": {
          pattern: /^at[ \t]+(?!\s)(?:node\.js|<unknown>|.*(?:node_modules|\(<anonymous>\)|\(<unknown>|<anonymous>$|\(internal\/|\(node\.js)).*/m,
          alias: "comment"
        },
        filename: {
          pattern: /(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,
          lookbehind: !0,
          alias: "url"
        },
        function: {
          pattern: /(\bat\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,
          lookbehind: !0,
          inside: {
            punctuation: /\./
          }
        },
        punctuation: /[()]/,
        keyword: /\b(?:at|new)\b/,
        alias: {
          pattern: /\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,
          alias: "variable"
        },
        "line-number": {
          pattern: /:\d+(?::\d+)?\b/,
          alias: "number",
          inside: {
            punctuation: /:/
          }
        }
      }
    }
  };
}
tve.displayName = "julia";
tve.aliases = [];
function tve(i) {
  i.languages.julia = {
    comment: {
      // support one level of nested comments
      // https://github.com/JuliaLang/julia/pull/6128
      pattern: /(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/,
      lookbehind: !0
    },
    regex: {
      // https://docs.julialang.org/en/v1/manual/strings/#Regular-Expressions-1
      pattern: /r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/,
      greedy: !0
    },
    string: {
      // https://docs.julialang.org/en/v1/manual/strings/#String-Basics-1
      // https://docs.julialang.org/en/v1/manual/strings/#non-standard-string-literals-1
      // https://docs.julialang.org/en/v1/manual/running-external-programs/#Running-External-Programs-1
      pattern: /"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|`(?:[^\\`\r\n]|\\.)*`/,
      greedy: !0
    },
    char: {
      // https://docs.julialang.org/en/v1/manual/strings/#man-characters-1
      pattern: /(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'/,
      lookbehind: !0,
      greedy: !0
    },
    keyword: /\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/,
    boolean: /\b(?:false|true)\b/,
    number: /(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i,
    // https://docs.julialang.org/en/v1/manual/mathematical-operations/
    // https://docs.julialang.org/en/v1/manual/mathematical-operations/#Operator-Precedence-and-Associativity-1
    operator: /&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/,
    punctuation: /::?|[{}[\]();,.?]/,
    // https://docs.julialang.org/en/v1/base/numbers/#Base.im
    constant: /\b(?:(?:Inf|NaN)(?:16|32|64)?|im|pi)\b|[πℯ]/
  };
}
nve.displayName = "keepalived";
nve.aliases = [];
function nve(i) {
  i.languages.keepalived = {
    comment: {
      pattern: /[#!].*/,
      greedy: !0
    },
    string: {
      pattern: /(^|[^\\])(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,
      lookbehind: !0,
      greedy: !0
    },
    // support IPv4, IPv6, subnet mask
    ip: {
      pattern: RegExp(
        /\b(?:(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){5}:(?:[\da-f]{1,4}:)?[\da-f]{1,4}|(?:[\da-f]{1,4}:){4}:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4}|(?:[\da-f]{1,4}:){3}:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4}|(?:[\da-f]{1,4}:){2}:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}<ipv4>|(?:[\da-f]{1,4}:){0,5}:<ipv4>|::(?:[\da-f]{1,4}:){0,5}<ipv4>|[\da-f]{1,4}::(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4}|::(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:)(?:\/\d{1,3})?|<ipv4>(?:\/\d{1,2})?)\b/.source.replace(
          /<ipv4>/g,
          function() {
            return /(?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d))/.source;
          }
        ),
        "i"
      ),
      alias: "number"
    },
    // support *nix / Windows, directory / file
    path: {
      pattern: /(\s)\/(?:[^\/\s]+\/)*[^\/\s]*|\b[a-zA-Z]:\\(?:[^\\\s]+\\)*[^\\\s]*/,
      lookbehind: !0,
      alias: "string"
    },
    variable: /\$\{?\w+\}?/,
    email: {
      pattern: /[\w-]+@[\w-]+(?:\.[\w-]{2,3}){1,2}/,
      alias: "string"
    },
    "conditional-configuration": {
      pattern: /@\^?[\w-]+/,
      alias: "variable"
    },
    operator: /=/,
    property: /\b(?:BFD_CHECK|DNS_CHECK|FILE_CHECK|HTTP_GET|MISC_CHECK|NAME|PING_CHECK|SCRIPTS|SMTP_CHECK|SSL|SSL_GET|TCP_CHECK|UDP_CHECK|accept|advert_int|alpha|auth_pass|auth_type|authentication|bfd_cpu_affinity|bfd_instance|bfd_no_swap|bfd_priority|bfd_process_name|bfd_rlimit_rttime|bfd_rt_priority|bind_if|bind_port|bindto|ca|certificate|check_unicast_src|checker|checker_cpu_affinity|checker_log_all_failures|checker_no_swap|checker_priority|checker_rlimit_rttime|checker_rt_priority|child_wait_time|connect_ip|connect_port|connect_timeout|dbus_service_name|debug|default_interface|delay|delay_before_retry|delay_loop|digest|dont_track_primary|dynamic|dynamic_interfaces|enable_(?:dbus|script_security|sni|snmp_checker|snmp_rfc|snmp_rfcv2|snmp_rfcv3|snmp_vrrp|traps)|end|fall|fast_recovery|file|flag-[123]|fork_delay|full_command|fwmark|garp_group|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|global_defs|global_tracking|gna_interval|group|ha_suspend|hashed|helo_name|higher_prio_send_advert|hoplimit|http_protocol|hysteresis|idle_tx|include|inhibit_on_failure|init_fail|init_file|instance|interface|interfaces|interval|ip_family|ipvs_process_name|keepalived.conf|kernel_rx_buf_size|key|linkbeat_interfaces|linkbeat_use_polling|log_all_failures|log_unknown_vrids|lower_prio_no_advert|lthreshold|lvs_flush|lvs_flush_onstop|lvs_method|lvs_netlink_cmd_rcv_bufs|lvs_netlink_cmd_rcv_bufs_force|lvs_netlink_monitor_rcv_bufs|lvs_netlink_monitor_rcv_bufs_force|lvs_notify_fifo|lvs_notify_fifo_script|lvs_sched|lvs_sync_daemon|max_auto_priority|max_hops|mcast_src_ip|mh-fallback|mh-port|min_auto_priority_delay|min_rx|min_tx|misc_dynamic|misc_path|misc_timeout|multiplier|name|namespace_with_ipsets|native_ipv6|neighbor_ip|net_namespace|net_namespace_ipvs|nftables|nftables_counters|nftables_ifindex|nftables_priority|no_accept|no_checker_emails|no_email_faults|nopreempt|notification_email|notification_email_from|notify|notify_backup|notify_deleted|notify_down|notify_fault|notify_fifo|notify_fifo_script|notify_master|notify_master_rx_lower_pri|notify_priority_changes|notify_stop|notify_up|old_unicast_checksum|omega|ops|param_match|passive|password|path|persistence_engine|persistence_granularity|persistence_timeout|preempt|preempt_delay|priority|process|process_monitor_rcv_bufs|process_monitor_rcv_bufs_force|process_name|process_names|promote_secondaries|protocol|proxy_arp|proxy_arp_pvlan|quorum|quorum_down|quorum_max|quorum_up|random_seed|real_server|regex|regex_max_offset|regex_min_offset|regex_no_match|regex_options|regex_stack|reload_repeat|reload_time_file|require_reply|retry|rise|router_id|rs_init_notifies|script|script_user|sh-fallback|sh-port|shutdown_script|shutdown_script_timeout|skip_check_adv_addr|smtp_alert|smtp_alert_checker|smtp_alert_vrrp|smtp_connect_timeout|smtp_helo_name|smtp_server|snmp_socket|sorry_server|sorry_server_inhibit|sorry_server_lvs_method|source_ip|start|startup_script|startup_script_timeout|state|static_ipaddress|static_routes|static_rules|status_code|step|strict_mode|sync_group_tracking_weight|terminate_delay|timeout|track_bfd|track_file|track_group|track_interface|track_process|track_script|track_src_ip|ttl|type|umask|unicast_peer|unicast_src_ip|unicast_ttl|url|use_ipvlan|use_pid_dir|use_vmac|user|uthreshold|val[123]|version|virtual_ipaddress|virtual_ipaddress_excluded|virtual_router_id|virtual_routes|virtual_rules|virtual_server|virtual_server_group|virtualhost|vmac_xmit_base|vrrp|vrrp_(?:check_unicast_src|cpu_affinity|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|gna_interval|higher_prio_send_advert|instance|ipsets|iptables|lower_prio_no_advert|mcast_group4|mcast_group6|min_garp|netlink_cmd_rcv_bufs|netlink_cmd_rcv_bufs_force|netlink_monitor_rcv_bufs|netlink_monitor_rcv_bufs_force|no_swap|notify_fifo|notify_fifo_script|notify_priority_changes|priority|process_name|rlimit_rttime|rt_priority|rx_bufs_multiplier|rx_bufs_policy|script|skip_check_adv_addr|startup_delay|strict|sync_group|track_process|version)|warmup|weight)\b/,
    constant: /\b(?:A|AAAA|AH|BACKUP|CNAME|DR|MASTER|MX|NAT|NS|PASS|SCTP|SOA|TCP|TUN|TXT|UDP|dh|fo|lblc|lblcr|lc|mh|nq|ovf|rr|sed|sh|wlc|wrr)\b/,
    number: {
      pattern: /(^|[^\w.-])-?\d+(?:\.\d+)?/,
      lookbehind: !0
    },
    boolean: /\b(?:false|no|off|on|true|yes)\b/,
    punctuation: /[\{\}]/
  };
}
ive.displayName = "keyman";
ive.aliases = [];
function ive(i) {
  i.languages.keyman = {
    comment: {
      pattern: /\bc .*/i,
      greedy: !0
    },
    string: {
      pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
      greedy: !0
    },
    "virtual-key": {
      pattern: /\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i,
      greedy: !0,
      alias: "function"
      // alias for styles
    },
    // https://help.keyman.com/developer/language/guide/headers
    "header-keyword": {
      pattern: /&\w+/,
      alias: "bold"
      // alias for styles
    },
    "header-statement": {
      pattern: /\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i,
      alias: "bold"
      // alias for styles
    },
    "rule-keyword": {
      pattern: /\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i,
      alias: "keyword"
    },
    "structural-keyword": {
      pattern: /\b(?:ansi|begin|group|match|newcontext|nomatch|postkeystroke|readonly|unicode|using keys)\b/i,
      alias: "keyword"
    },
    "compile-target": {
      pattern: /\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i,
      alias: "property"
    },
    // U+####, x###, d### characters and numbers
    number: /\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,
    operator: /[+>\\$]|\.\./,
    punctuation: /[()=,]/
  };
}
rve.displayName = "kumir";
rve.aliases = ["kum"];
function rve(i) {
  (function(e) {
    var t = /\s\x00-\x1f\x22-\x2f\x3a-\x3f\x5b-\x5e\x60\x7b-\x7e/.source;
    function n(r, s) {
      return RegExp(r.replace(/<nonId>/g, t), s);
    }
    e.languages.kumir = {
      comment: {
        pattern: /\|.*/
      },
      prolog: {
        pattern: /#.*/,
        greedy: !0
      },
      string: {
        pattern: /"[^\n\r"]*"|'[^\n\r']*'/,
        greedy: !0
      },
      boolean: {
        pattern: n(/(^|[<nonId>])(?:да|нет)(?=[<nonId>]|$)/.source),
        lookbehind: !0
      },
      "operator-word": {
        pattern: n(/(^|[<nonId>])(?:и|или|не)(?=[<nonId>]|$)/.source),
        lookbehind: !0,
        alias: "keyword"
      },
      "system-variable": {
        pattern: n(/(^|[<nonId>])знач(?=[<nonId>]|$)/.source),
        lookbehind: !0,
        alias: "keyword"
      },
      type: [
        {
          pattern: n(
            /(^|[<nonId>])(?:вещ|лит|лог|сим|цел)(?:\x20*таб)?(?=[<nonId>]|$)/.source
          ),
          lookbehind: !0,
          alias: "builtin"
        },
        {
          pattern: n(
            /(^|[<nonId>])(?:компл|сканкод|файл|цвет)(?=[<nonId>]|$)/.source
          ),
          lookbehind: !0,
          alias: "important"
        }
      ],
      /**
       * Should be performed after searching for type names because of "таб".
       * "таб" is a reserved word, but never used without a preceding type name.
       * "НАЗНАЧИТЬ", "Фввод", and "Фвывод" are not reserved words.
       */
      keyword: {
        pattern: n(
          /(^|[<nonId>])(?:алг|арг(?:\x20*рез)?|ввод|ВКЛЮЧИТЬ|вс[её]|выбор|вывод|выход|дано|для|до|дс|если|иначе|исп|использовать|кон(?:(?:\x20+|_)исп)?|кц(?:(?:\x20+|_)при)?|надо|нач|нс|нц|от|пауза|пока|при|раза?|рез|стоп|таб|то|утв|шаг)(?=[<nonId>]|$)/.source
        ),
        lookbehind: !0
      },
      /** Should be performed after searching for reserved words. */
      name: {
        // eslint-disable-next-line regexp/no-super-linear-backtracking
        pattern: n(
          /(^|[<nonId>])[^\d<nonId>][^<nonId>]*(?:\x20+[^<nonId>]+)*(?=[<nonId>]|$)/.source
        ),
        lookbehind: !0
      },
      /** Should be performed after searching for names. */
      number: {
        pattern: n(
          /(^|[<nonId>])(?:\B\$[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?=[<nonId>]|$)/.source,
          "i"
        ),
        lookbehind: !0
      },
      /** Should be performed after searching for words. */
      punctuation: /:=|[(),:;\[\]]/,
      /**
       * Should be performed after searching for
       * - numeric constants (because of "+" and "-");
       * - punctuation marks (because of ":=" and "=").
       */
      "operator-char": {
        pattern: /\*\*?|<[=>]?|>=?|[-+/=]/,
        alias: "operator"
      }
    }, e.languages.kum = e.languages.kumir;
  })(i);
}
sve.displayName = "kusto";
sve.aliases = [];
function sve(i) {
  i.languages.kusto = {
    comment: {
      pattern: /\/\/.*/,
      greedy: !0
    },
    string: {
      pattern: /```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/,
      greedy: !0
    },
    verb: {
      pattern: /(\|\s*)[a-z][\w-]*/i,
      lookbehind: !0,
      alias: "keyword"
    },
    command: {
      pattern: /\.[a-z][a-z\d-]*\b/,
      alias: "keyword"
    },
    "class-name": /\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/,
    keyword: /\b(?:access|alias|and|anti|as|asc|auto|between|by|(?:contains|(?:ends|starts)with|has(?:perfix|suffix)?)(?:_cs)?|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/,
    boolean: /\b(?:false|null|true)\b/,
    function: /\b[a-z_]\w*(?=\s*\()/,
    datetime: [
      {
        // RFC 822 + RFC 850
        pattern: /\b(?:(?:Fri|Friday|Mon|Monday|Sat|Saturday|Sun|Sunday|Thu|Thursday|Tue|Tuesday|Wed|Wednesday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:[A-Z]|(?:[ECMT][DS]|GM|U)T)|[+-]\d{4}))?\b/,
        alias: "number"
      },
      {
        // ISO 8601
        pattern: /[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/,
        alias: "number"
      }
    ],
    number: /\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|[dhms]|microsecond|tick)\b)?|[+-]?\binf\b/,
    operator: /=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./,
    punctuation: /[()\[\]{},;.:]/
  };
}
ove.displayName = "latex";
ove.aliases = ["context", "tex"];
function ove(i) {
  (function(e) {
    var t = /\\(?:[^a-z()[\]]|[a-z*]+)/i, n = {
      "equation-command": {
        pattern: t,
        alias: "regex"
      }
    };
    e.languages.latex = {
      comment: /%.*/,
      // the verbatim environment prints whitespace to the document
      cdata: {
        pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
        lookbehind: !0
      },
      /*
       * equations can be between $$ $$ or $ $ or \( \) or \[ \]
       * (all are multiline)
       */
      equation: [
        {
          pattern: /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,
          inside: n,
          alias: "string"
        },
        {
          pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
          lookbehind: !0,
          inside: n,
          alias: "string"
        }
      ],
      /*
       * arguments which are keywords or references are highlighted
       * as keywords
       */
      keyword: {
        pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
        lookbehind: !0
      },
      url: {
        pattern: /(\\url\{)[^}]+(?=\})/,
        lookbehind: !0
      },
      /*
       * section or chapter headlines are highlighted as bold so that
       * they stand out more
       */
      headline: {
        pattern: /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
        lookbehind: !0,
        alias: "class-name"
      },
      function: {
        pattern: t,
        alias: "selector"
      },
      punctuation: /[[\]{}&]/
    }, e.languages.tex = e.languages.latex, e.languages.context = e.languages.latex;
  })(i);
}
ave.displayName = "latte";
ave.aliases = [];
function ave(i) {
  i.register(Wr), i.register(bu), i.register(dk), (function(e) {
    e.languages.latte = {
      comment: /^\{\*[\s\S]*/,
      "latte-tag": {
        // https://latte.nette.org/en/tags
        pattern: /(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i,
        lookbehind: !0,
        alias: "important"
      },
      delimiter: {
        pattern: /^\{\/?|\}$/,
        alias: "punctuation"
      },
      php: {
        pattern: /\S(?:[\s\S]*\S)?/,
        alias: "language-php",
        inside: e.languages.php
      }
    };
    var t = e.languages.extend("markup", {});
    e.languages.insertBefore(
      "inside",
      "attr-value",
      {
        "n-attr": {
          pattern: /n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,
          inside: {
            "attr-name": {
              pattern: /^[^\s=]+/,
              alias: "important"
            },
            "attr-value": {
              pattern: /=[\s\S]+/,
              inside: {
                punctuation: [
                  /^=/,
                  {
                    pattern: /^(\s*)["']|["']$/,
                    lookbehind: !0
                  }
                ],
                php: {
                  pattern: /\S(?:[\s\S]*\S)?/,
                  inside: e.languages.php
                }
              }
            }
          }
        }
      },
      t.tag
    ), e.hooks.add("before-tokenize", function(n) {
      if (n.language === "latte") {
        var r = /\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g;
        e.languages["markup-templating"].buildPlaceholders(
          n,
          "latte",
          r
        ), n.grammar = t;
      }
    }), e.hooks.add("after-tokenize", function(n) {
      e.languages["markup-templating"].tokenizePlaceholders(n, "latte");
    });
  })(i);
}
c6.displayName = "scheme";
c6.aliases = [];
function c6(i) {
  (function(e) {
    e.languages.scheme = {
      // this supports "normal" single-line comments:
      //   ; comment
      // and (potentially nested) multiline comments:
      //   #| comment #| nested |# still comment |#
      // (only 1 level of nesting is supported)
      comment: /;.*|#;\s*(?:\((?:[^()]|\([^()]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\])|#\|(?:[^#|]|#(?!\|)|\|(?!#)|#\|(?:[^#|]|#(?!\|)|\|(?!#))*\|#)*\|#/,
      string: {
        pattern: /"(?:[^"\\]|\\.)*"/,
        greedy: !0
      },
      symbol: {
        pattern: /'[^()\[\]#'\s]+/,
        greedy: !0
      },
      char: {
        pattern: /#\\(?:[ux][a-fA-F\d]+\b|[-a-zA-Z]+\b|[\uD800-\uDBFF][\uDC00-\uDFFF]|\S)/,
        greedy: !0
      },
      "lambda-parameter": [
        // https://www.cs.cmu.edu/Groups/AI/html/r4rs/r4rs_6.html#SEC30
        {
          pattern: /((?:^|[^'`#])[(\[]lambda\s+)(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)/,
          lookbehind: !0
        },
        {
          pattern: /((?:^|[^'`#])[(\[]lambda\s+[(\[])[^()\[\]']+/,
          lookbehind: !0
        }
      ],
      keyword: {
        pattern: /((?:^|[^'`#])[(\[])(?:begin|case(?:-lambda)?|cond(?:-expand)?|define(?:-library|-macro|-record-type|-syntax|-values)?|defmacro|delay(?:-force)?|do|else|except|export|guard|if|import|include(?:-ci|-library-declarations)?|lambda|let(?:rec)?(?:-syntax|-values|\*)?|let\*-values|only|parameterize|prefix|(?:quasi-?)?quote|rename|set!|syntax-(?:case|rules)|unless|unquote(?:-splicing)?|when)(?=[()\[\]\s]|$)/,
        lookbehind: !0
      },
      builtin: {
        // all functions of the base library of R7RS plus some of built-ins of R5Rs
        pattern: /((?:^|[^'`#])[(\[])(?:abs|and|append|apply|assoc|ass[qv]|binary-port\?|boolean=?\?|bytevector(?:-append|-copy|-copy!|-length|-u8-ref|-u8-set!|\?)?|caar|cadr|call-with-(?:current-continuation|port|values)|call\/cc|car|cdar|cddr|cdr|ceiling|char(?:->integer|-ready\?|\?|<\?|<=\?|=\?|>\?|>=\?)|close-(?:input-port|output-port|port)|complex\?|cons|current-(?:error|input|output)-port|denominator|dynamic-wind|eof-object\??|eq\?|equal\?|eqv\?|error|error-object(?:-irritants|-message|\?)|eval|even\?|exact(?:-integer-sqrt|-integer\?|\?)?|expt|features|file-error\?|floor(?:-quotient|-remainder|\/)?|flush-output-port|for-each|gcd|get-output-(?:bytevector|string)|inexact\??|input-port(?:-open\?|\?)|integer(?:->char|\?)|lcm|length|list(?:->string|->vector|-copy|-ref|-set!|-tail|\?)?|make-(?:bytevector|list|parameter|string|vector)|map|max|member|memq|memv|min|modulo|negative\?|newline|not|null\?|number(?:->string|\?)|numerator|odd\?|open-(?:input|output)-(?:bytevector|string)|or|output-port(?:-open\?|\?)|pair\?|peek-char|peek-u8|port\?|positive\?|procedure\?|quotient|raise|raise-continuable|rational\?|rationalize|read-(?:bytevector|bytevector!|char|error\?|line|string|u8)|real\?|remainder|reverse|round|set-c[ad]r!|square|string(?:->list|->number|->symbol|->utf8|->vector|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?|<\?|<=\?|=\?|>\?|>=\?)?|substring|symbol(?:->string|\?|=\?)|syntax-error|textual-port\?|truncate(?:-quotient|-remainder|\/)?|u8-ready\?|utf8->string|values|vector(?:->list|->string|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?)?|with-exception-handler|write-(?:bytevector|char|string|u8)|zero\?)(?=[()\[\]\s]|$)/,
        lookbehind: !0
      },
      operator: {
        pattern: /((?:^|[^'`#])[(\[])(?:[-+*%/]|[<>]=?|=>?)(?=[()\[\]\s]|$)/,
        lookbehind: !0
      },
      number: {
        // The number pattern from [the R7RS spec](https://small.r7rs.org/attachment/r7rs.pdf).
        //
        // <number>      := <num 2>|<num 8>|<num 10>|<num 16>
        // <num R>       := <prefix R><complex R>
        // <complex R>   := <real R>(?:@<real R>|<imaginary R>)?|<imaginary R>
        // <imaginary R> := [+-](?:<ureal R>|(?:inf|nan)\.0)?i
        // <real R>      := [+-]?<ureal R>|[+-](?:inf|nan)\.0
        // <ureal R>     := <uint R>(?:\/<uint R>)?
        //                | <decimal R>
        //
        // <decimal 10>  := (?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?
        // <uint R>      := <digit R>+
        // <prefix R>    := <radix R>(?:#[ei])?|(?:#[ei])?<radix R>
        // <radix 2>     := #b
        // <radix 8>     := #o
        // <radix 10>    := (?:#d)?
        // <radix 16>    := #x
        // <digit 2>     := [01]
        // <digit 8>     := [0-7]
        // <digit 10>    := \d
        // <digit 16>    := [0-9a-f]
        //
        // The problem with this grammar is that the resulting regex is way to complex, so we simplify by grouping all
        // non-decimal bases together. This results in a decimal (dec) and combined binary, octal, and hexadecimal (box)
        // pattern:
        pattern: RegExp(
          t({
            "<ureal dec>": /\d+(?:\/\d+)|(?:\d+(?:\.\d*)?|\.\d+)(?:[esfdl][+-]?\d+)?/.source,
            "<real dec>": /[+-]?<ureal dec>|[+-](?:inf|nan)\.0/.source,
            "<imaginary dec>": /[+-](?:<ureal dec>|(?:inf|nan)\.0)?i/.source,
            "<complex dec>": /<real dec>(?:@<real dec>|<imaginary dec>)?|<imaginary dec>/.source,
            "<num dec>": /(?:#d(?:#[ei])?|#[ei](?:#d)?)?<complex dec>/.source,
            "<ureal box>": /[0-9a-f]+(?:\/[0-9a-f]+)?/.source,
            "<real box>": /[+-]?<ureal box>|[+-](?:inf|nan)\.0/.source,
            "<imaginary box>": /[+-](?:<ureal box>|(?:inf|nan)\.0)?i/.source,
            "<complex box>": /<real box>(?:@<real box>|<imaginary box>)?|<imaginary box>/.source,
            "<num box>": /#[box](?:#[ei])?|(?:#[ei])?#[box]<complex box>/.source,
            "<number>": /(^|[()\[\]\s])(?:<num dec>|<num box>)(?=[()\[\]\s]|$)/.source
          }),
          "i"
        ),
        lookbehind: !0
      },
      boolean: {
        pattern: /(^|[()\[\]\s])#(?:[ft]|false|true)(?=[()\[\]\s]|$)/,
        lookbehind: !0
      },
      function: {
        pattern: /((?:^|[^'`#])[(\[])(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)(?=[()\[\]\s]|$)/,
        lookbehind: !0
      },
      identifier: {
        pattern: /(^|[()\[\]\s])\|(?:[^\\|]|\\.)*\|(?=[()\[\]\s]|$)/,
        lookbehind: !0,
        greedy: !0
      },
      punctuation: /[()\[\]']/
    };
    function t(n) {
      for (var r in n)
        n[r] = n[r].replace(/<[\w\s]+>/g, function(s) {
          return "(?:" + n[s].trim() + ")";
        });
      return n[r];
    }
  })(i);
}
lve.displayName = "lilypond";
lve.aliases = ["ly"];
function lve(i) {
  i.register(c6), (function(e) {
    for (var t = /\((?:[^();"#\\]|\\[\s\S]|;.*(?!.)|"(?:[^"\\]|\\.)*"|#(?:\{(?:(?!#\})[\s\S])*#\}|[^{])|<expr>)*\)/.source, n = 5, r = 0; r < n; r++)
      t = t.replace(/<expr>/g, function() {
        return t;
      });
    t = t.replace(/<expr>/g, /[^\s\S]/.source);
    var s = e.languages.lilypond = {
      comment: /%(?:(?!\{).*|\{[\s\S]*?%\})/,
      "embedded-scheme": {
        pattern: RegExp(
          /(^|[=\s])#(?:"(?:[^"\\]|\\.)*"|[^\s()"]*(?:[^\s()]|<expr>))/.source.replace(
            /<expr>/g,
            function() {
              return t;
            }
          ),
          "m"
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          scheme: {
            pattern: /^(#)[\s\S]+$/,
            lookbehind: !0,
            alias: "language-scheme",
            inside: {
              "embedded-lilypond": {
                pattern: /#\{[\s\S]*?#\}/,
                greedy: !0,
                inside: {
                  punctuation: /^#\{|#\}$/,
                  lilypond: {
                    pattern: /[\s\S]+/,
                    alias: "language-lilypond",
                    inside: null
                    // see below
                  }
                }
              },
              rest: e.languages.scheme
            }
          },
          punctuation: /#/
        }
      },
      string: {
        pattern: /"(?:[^"\\]|\\.)*"/,
        greedy: !0
      },
      "class-name": {
        pattern: /(\\new\s+)[\w-]+/,
        lookbehind: !0
      },
      keyword: {
        pattern: /\\[a-z][-\w]*/i,
        inside: {
          punctuation: /^\\/
        }
      },
      operator: /[=|]|<<|>>/,
      punctuation: {
        pattern: /(^|[a-z\d])(?:'+|,+|[_^]?-[_^]?(?:[-+^!>._]|(?=\d))|[_^]\.?|[.!])|[{}()[\]<>^~]|\\[()[\]<>\\!]|--|__/,
        lookbehind: !0
      },
      number: /\b\d+(?:\/\d+)?\b/
    };
    s["embedded-scheme"].inside.scheme.inside["embedded-lilypond"].inside.lilypond.inside = s, e.languages.ly = s;
  })(i);
}
cve.displayName = "liquid";
cve.aliases = [];
function cve(i) {
  i.register(bu), i.languages.liquid = {
    comment: {
      pattern: /(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/,
      lookbehind: !0
    },
    delimiter: {
      pattern: /^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/,
      alias: "punctuation"
    },
    string: {
      pattern: /"[^"]*"|'[^']*'/,
      greedy: !0
    },
    keyword: /\b(?:as|assign|break|(?:end)?(?:capture|case|comment|for|form|if|paginate|raw|style|tablerow|unless)|continue|cycle|decrement|echo|else|elsif|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/,
    object: /\b(?:address|all_country_option_tags|article|block|blog|cart|checkout|collection|color|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|fulfillment|generic_file|gift_card|group|handle|image|line_item|link|linklist|localization|location|measurement|media|metafield|model|model_source|order|page|page_description|page_image|page_title|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/,
    function: [
      {
        pattern: /(\|\s*)\w+/,
        lookbehind: !0,
        alias: "filter"
      },
      {
        // array functions
        pattern: /(\.\s*)(?:first|last|size)/,
        lookbehind: !0
      }
    ],
    boolean: /\b(?:false|nil|true)\b/,
    range: {
      pattern: /\.\./,
      alias: "operator"
    },
    // https://github.com/Shopify/liquid/blob/698f5e0d967423e013f6169d9111bd969bd78337/lib/liquid/lexer.rb#L21
    number: /\b\d+(?:\.\d+)?\b/,
    operator: /[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|contains(?=\s)|or)\b/,
    punctuation: /[.,\[\]()]/,
    empty: {
      pattern: /\bempty\b/,
      alias: "keyword"
    }
  }, i.hooks.add("before-tokenize", function(e) {
    var t = /\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g, n = !1;
    i.languages["markup-templating"].buildPlaceholders(
      e,
      "liquid",
      t,
      function(r) {
        var s = /^\{%-?\s*(\w+)/.exec(r);
        if (s) {
          var o = s[1];
          if (o === "raw" && !n)
            return n = !0, !0;
          if (o === "endraw")
            return n = !1, !0;
        }
        return !n;
      }
    );
  }), i.hooks.add("after-tokenize", function(e) {
    i.languages["markup-templating"].tokenizePlaceholders(e, "liquid");
  });
}
uve.displayName = "lisp";
uve.aliases = ["elisp", "emacs", "emacs-lisp"];
function uve(i) {
  (function(e) {
    function t(m) {
      return RegExp(/(\()/.source + "(?:" + m + ")" + /(?=[\s\)])/.source);
    }
    function n(m) {
      return RegExp(
        /([\s([])/.source + "(?:" + m + ")" + /(?=[\s)])/.source
      );
    }
    var r = /(?!\d)[-+*/~!@$%^=<>{}\w]+/.source, s = "&" + r, o = "(\\()", a = "(?=\\))", l = "(?=\\s)", c = /(?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\))*\))*\))*/.source, u = {
      // Three or four semicolons are considered a heading.
      // See https://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html
      heading: {
        pattern: /;;;.*/,
        alias: ["comment", "title"]
      },
      comment: /;.*/,
      string: {
        pattern: /"(?:[^"\\]|\\.)*"/,
        greedy: !0,
        inside: {
          argument: /[-A-Z]+(?=[.,\s])/,
          symbol: RegExp("`" + r + "'")
        }
      },
      "quoted-symbol": {
        pattern: RegExp("#?'" + r),
        alias: ["variable", "symbol"]
      },
      "lisp-property": {
        pattern: RegExp(":" + r),
        alias: "property"
      },
      splice: {
        pattern: RegExp(",@?" + r),
        alias: ["symbol", "variable"]
      },
      keyword: [
        {
          pattern: RegExp(
            o + "(?:and|(?:cl-)?letf|cl-loop|cond|cons|error|if|(?:lexical-)?let\\*?|message|not|null|or|provide|require|setq|unless|use-package|when|while)" + l
          ),
          lookbehind: !0
        },
        {
          pattern: RegExp(
            o + "(?:append|by|collect|concat|do|finally|for|in|return)" + l
          ),
          lookbehind: !0
        }
      ],
      declare: {
        pattern: t(/declare/.source),
        lookbehind: !0,
        alias: "keyword"
      },
      interactive: {
        pattern: t(/interactive/.source),
        lookbehind: !0,
        alias: "keyword"
      },
      boolean: {
        pattern: n(/nil|t/.source),
        lookbehind: !0
      },
      number: {
        pattern: n(/[-+]?\d+(?:\.\d*)?/.source),
        lookbehind: !0
      },
      defvar: {
        pattern: RegExp(o + "def(?:const|custom|group|var)\\s+" + r),
        lookbehind: !0,
        inside: {
          keyword: /^def[a-z]+/,
          variable: RegExp(r)
        }
      },
      defun: {
        pattern: RegExp(
          o + /(?:cl-)?(?:defmacro|defun\*?)\s+/.source + r + /\s+\(/.source + c + /\)/.source
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          keyword: /^(?:cl-)?def\S+/,
          // See below, this property needs to be defined later so that it can
          // reference the language object.
          arguments: null,
          function: {
            pattern: RegExp("(^\\s)" + r),
            lookbehind: !0
          },
          punctuation: /[()]/
        }
      },
      lambda: {
        pattern: RegExp(
          o + "lambda\\s+\\(\\s*(?:&?" + r + "(?:\\s+&?" + r + ")*\\s*)?\\)"
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          keyword: /^lambda/,
          // See below, this property needs to be defined later so that it can
          // reference the language object.
          arguments: null,
          punctuation: /[()]/
        }
      },
      car: {
        pattern: RegExp(o + r),
        lookbehind: !0
      },
      punctuation: [
        // open paren, brackets, and close paren
        /(?:['`,]?\(|[)\[\]])/,
        // cons
        {
          pattern: /(\s)\.(?=\s)/,
          lookbehind: !0
        }
      ]
    }, d = {
      "lisp-marker": RegExp(s),
      varform: {
        pattern: RegExp(
          /\(/.source + r + /\s+(?=\S)/.source + c + /\)/.source
        ),
        inside: u
      },
      argument: {
        pattern: RegExp(/(^|[\s(])/.source + r),
        lookbehind: !0,
        alias: "variable"
      },
      rest: u
    }, h = "\\S+(?:\\s+\\S+)*", g = {
      pattern: RegExp(o + c + a),
      lookbehind: !0,
      inside: {
        "rest-vars": {
          pattern: RegExp("&(?:body|rest)\\s+" + h),
          inside: d
        },
        "other-marker-vars": {
          pattern: RegExp("&(?:aux|optional)\\s+" + h),
          inside: d
        },
        keys: {
          pattern: RegExp("&key\\s+" + h + "(?:\\s+&allow-other-keys)?"),
          inside: d
        },
        argument: {
          pattern: RegExp(r),
          alias: "variable"
        },
        punctuation: /[()]/
      }
    };
    u.lambda.inside.arguments = g, u.defun.inside.arguments = e.util.clone(g), u.defun.inside.arguments.inside.sublist = g, e.languages.lisp = u, e.languages.elisp = u, e.languages.emacs = u, e.languages["emacs-lisp"] = u;
  })(i);
}
dve.displayName = "livescript";
dve.aliases = [];
function dve(i) {
  i.languages.livescript = {
    comment: [
      {
        pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
        lookbehind: !0
      },
      {
        pattern: /(^|[^\\])#.*/,
        lookbehind: !0
      }
    ],
    "interpolated-string": {
      /* Look-behind and look-ahead prevents wrong behavior of the greedy pattern
       * forcing it to match """-quoted string when it would otherwise match "-quoted first. */
      pattern: /(^|[^"])("""|")(?:\\[\s\S]|(?!\2)[^\\])*\2(?!")/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        variable: {
          pattern: /(^|[^\\])#[a-z_](?:-?[a-z]|[\d_])*/m,
          lookbehind: !0
        },
        interpolation: {
          pattern: /(^|[^\\])#\{[^}]+\}/m,
          lookbehind: !0,
          inside: {
            "interpolation-punctuation": {
              pattern: /^#\{|\}$/,
              alias: "variable"
            }
            // See rest below
          }
        },
        string: /[\s\S]+/
      }
    },
    string: [
      {
        pattern: /('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,
        greedy: !0
      },
      {
        pattern: /<\[[\s\S]*?\]>/,
        greedy: !0
      },
      /\\[^\s,;\])}]+/
    ],
    regex: [
      {
        pattern: /\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/,
        greedy: !0,
        inside: {
          comment: {
            pattern: /(^|[^\\])#.*/,
            lookbehind: !0
          }
        }
      },
      {
        pattern: /\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/,
        greedy: !0
      }
    ],
    keyword: {
      pattern: /(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m,
      lookbehind: !0
    },
    "keyword-operator": {
      pattern: /(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?: not|nt)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m,
      lookbehind: !0,
      alias: "operator"
    },
    boolean: {
      pattern: /(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m,
      lookbehind: !0
    },
    argument: {
      // Don't match .&. nor &&
      pattern: /(^|(?!\.&\.)[^&])&(?!&)\d*/m,
      lookbehind: !0,
      alias: "variable"
    },
    number: /\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i,
    identifier: /[a-z_](?:-?[a-z]|[\d_])*/i,
    operator: [
      // Spaced .
      {
        pattern: /( )\.(?= )/,
        lookbehind: !0
      },
      // Full list, in order:
      // .= .~ .. ...
      // .&. .^. .<<. .>>. .>>>.
      // := :: ::=
      // &&
      // || |>
      // < << <<< <<<<
      // <- <-- <-! <--!
      // <~ <~~ <~! <~~!
      // <| <= <?
      // > >> >= >?
      // - -- -> -->
      // + ++
      // @ @@
      // % %%
      // * **
      // ! != !~=
      // !~> !~~>
      // !-> !-->
      // ~ ~> ~~> ~=
      // = ==
      // ^ ^^
      // / ?
      /\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<<?<?|--?!?|~~?!?|[|=?])?|>[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/
    ],
    punctuation: /[(){}\[\]|.,:;`]/
  }, i.languages.livescript["interpolated-string"].inside.interpolation.inside.rest = i.languages.livescript;
}
hve.displayName = "llvm";
hve.aliases = [];
function hve(i) {
  (function(e) {
    e.languages.llvm = {
      comment: /;.*/,
      string: {
        pattern: /"[^"]*"/,
        greedy: !0
      },
      boolean: /\b(?:false|true)\b/,
      variable: /[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i,
      label: /(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i,
      type: {
        pattern: /\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/,
        alias: "class-name"
      },
      keyword: /\b[a-z_][a-z_0-9]*\b/,
      number: /[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/,
      punctuation: /[{}[\];(),.!*=<>]/
    };
  })(i);
}
fve.displayName = "log";
fve.aliases = [];
function fve(i) {
  i.languages.log = {
    string: {
      // Single-quoted strings must not be confused with plain text. E.g. Can't isn't Susan's Chris' toy
      pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,
      greedy: !0
    },
    exception: {
      pattern: /(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,
      lookbehind: !0,
      greedy: !0,
      alias: ["javastacktrace", "language-javastacktrace"],
      inside: i.languages.javastacktrace || {
        keyword: /\bat\b/,
        function: /[a-z_][\w$]*(?=\()/,
        punctuation: /[.:()]/
      }
    },
    level: [
      {
        pattern: /\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,
        alias: ["error", "important"]
      },
      {
        pattern: /\b(?:WARN|WARNING|WRN)\b/,
        alias: ["warning", "important"]
      },
      {
        pattern: /\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,
        alias: ["info", "keyword"]
      },
      {
        pattern: /\b(?:DBG|DEBUG|FINE)\b/,
        alias: ["debug", "keyword"]
      },
      {
        pattern: /\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,
        alias: ["trace", "comment"]
      }
    ],
    property: {
      pattern: /((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,
      lookbehind: !0
    },
    separator: {
      pattern: /(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,
      lookbehind: !0,
      alias: "comment"
    },
    url: /\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,
    email: {
      pattern: /(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,
      lookbehind: !0,
      alias: "url"
    },
    "ip-address": {
      pattern: /\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,
      alias: "constant"
    },
    "mac-address": {
      pattern: /\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,
      alias: "constant"
    },
    domain: {
      pattern: /(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,
      lookbehind: !0,
      alias: "constant"
    },
    uuid: {
      pattern: /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,
      alias: "constant"
    },
    hash: {
      pattern: /\b(?:[a-f0-9]{32}){1,2}\b/i,
      alias: "constant"
    },
    "file-path": {
      pattern: /\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,
      lookbehind: !0,
      greedy: !0,
      alias: "string"
    },
    date: {
      pattern: RegExp(
        /\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source + "|" + /\b\d{1,4}[-/ ](?:\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\d{2,4}T?\b/.source + "|" + /\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\s{1,2}\d{1,2}\b/.source,
        "i"
      ),
      alias: "number"
    },
    time: {
      pattern: /\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,
      alias: "number"
    },
    boolean: /\b(?:false|null|true)\b/i,
    number: {
      pattern: /(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,
      lookbehind: !0
    },
    operator: /[;:?<=>~/@!$%&+\-|^(){}*#]/,
    punctuation: /[\[\].,]/
  };
}
gve.displayName = "lolcode";
gve.aliases = [];
function gve(i) {
  i.languages.lolcode = {
    comment: [/\bOBTW\s[\s\S]*?\sTLDR\b/, /\bBTW.+/],
    string: {
      pattern: /"(?::.|[^":])*"/,
      inside: {
        variable: /:\{[^}]+\}/,
        symbol: [/:\([a-f\d]+\)/i, /:\[[^\]]+\]/, /:[)>o":]/]
      },
      greedy: !0
    },
    number: /(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,
    symbol: {
      pattern: /(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/,
      lookbehind: !0,
      inside: {
        keyword: /A(?=\s)/
      }
    },
    label: {
      pattern: /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,
      lookbehind: !0,
      alias: "string"
    },
    function: {
      pattern: /((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/,
      lookbehind: !0
    },
    keyword: [
      {
        pattern: /(^|\s)(?:AN|FOUND YR|GIMMEH|GTFO|HAI|HAS A|HOW IZ I|I HAS A|I IZ|IF U SAY SO|IM IN YR|IM OUTTA YR|IS NOW(?: A)?|ITZ(?: A)?|IZ|KTHX|KTHXBYE|LIEK(?: A)?|MAEK|MEBBE|MKAY|NERFIN|NO WAI|O HAI IM|O RLY\?|OIC|OMG|OMGWTF|R|SMOOSH|SRS|TIL|UPPIN|VISIBLE|WILE|WTF\?|YA RLY|YR)(?=\s|,|$)/,
        lookbehind: !0
      },
      /'Z(?=\s|,|$)/
    ],
    boolean: {
      pattern: /(^|\s)(?:FAIL|WIN)(?=\s|,|$)/,
      lookbehind: !0
    },
    variable: {
      pattern: /(^|\s)IT(?=\s|,|$)/,
      lookbehind: !0
    },
    operator: {
      pattern: /(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/,
      lookbehind: !0
    },
    punctuation: /\.{3}|…|,|!/
  };
}
pve.displayName = "magma";
pve.aliases = [];
function pve(i) {
  i.languages.magma = {
    output: {
      pattern: /^(>.*(?:\r(?:\n|(?!\n))|\n))(?!>)(?:.+|(?:\r(?:\n|(?!\n))|\n)(?!>).*)(?:(?:\r(?:\n|(?!\n))|\n)(?!>).*)*/m,
      lookbehind: !0,
      greedy: !0
    },
    comment: {
      pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
      greedy: !0
    },
    string: {
      pattern: /(^|[^\\"])"(?:[^\r\n\\"]|\\.)*"/,
      lookbehind: !0,
      greedy: !0
    },
    // http://magma.maths.usyd.edu.au/magma/handbook/text/82
    keyword: /\b(?:_|adj|and|assert|assert2|assert3|assigned|break|by|case|cat|catch|clear|cmpeq|cmpne|continue|declare|default|delete|diff|div|do|elif|else|end|eq|error|eval|exists|exit|for|forall|forward|fprintf|freeze|function|ge|gt|if|iload|import|in|intrinsic|is|join|le|load|local|lt|meet|mod|ne|not|notadj|notin|notsubset|or|print|printf|procedure|quit|random|read|readi|repeat|require|requirege|requirerange|restore|return|save|sdiff|select|subset|then|time|to|try|until|vprint|vprintf|vtime|when|where|while|xor)\b/,
    boolean: /\b(?:false|true)\b/,
    generator: {
      pattern: /\b[a-z_]\w*(?=\s*<)/i,
      alias: "class-name"
    },
    function: /\b[a-z_]\w*(?=\s*\()/i,
    number: {
      pattern: /(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,
      lookbehind: !0
    },
    operator: /->|[-+*/^~!|#=]|:=|\.\./,
    punctuation: /[()[\]{}<>,;.:]/
  };
}
vY.displayName = "mata";
vY.aliases = [];
function vY(i) {
  (function(e) {
    var t = /\b(?:(?:col|row)?vector|matrix|scalar)\b/.source, n = /\bvoid\b|<org>|\b(?:complex|numeric|pointer(?:\s*\([^()]*\))?|real|string|(?:class|struct)\s+\w+|transmorphic)(?:\s*<org>)?/.source.replace(
      /<org>/g,
      t
    );
    e.languages.mata = {
      comment: {
        pattern: /\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//,
        greedy: !0
      },
      string: {
        pattern: /"[^"\r\n]*"|[‘`']".*?"[’`']/,
        greedy: !0
      },
      "class-name": {
        pattern: /(\b(?:class|extends|struct)\s+)\w+(?=\s*(?:\{|\bextends\b))/,
        lookbehind: !0
      },
      type: {
        pattern: RegExp(n),
        alias: "class-name",
        inside: {
          punctuation: /[()]/,
          keyword: /\b(?:class|function|struct|void)\b/
        }
      },
      keyword: /\b(?:break|class|continue|do|else|end|extends|external|final|for|function|goto|if|pragma|private|protected|public|return|static|struct|unset|unused|version|virtual|while)\b/,
      constant: /\bNULL\b/,
      number: {
        pattern: /(^|[^\w.])(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|\d[a-f0-9]*(?:\.[a-f0-9]+)?x[+-]?\d+)i?(?![\w.])/i,
        lookbehind: !0
      },
      missing: {
        pattern: /(^|[^\w.])(?:\.[a-z]?)(?![\w.])/,
        lookbehind: !0,
        alias: "symbol"
      },
      function: /\b[a-z_]\w*(?=\s*\()/i,
      operator: /\.\.|\+\+|--|&&|\|\||:?(?:[!=<>]=|[+\-*/^<>&|:])|[!?=\\#’`']/,
      punctuation: /[()[\]{},;.]/
    };
  })(i);
}
mve.displayName = "matlab";
mve.aliases = [];
function mve(i) {
  i.languages.matlab = {
    comment: [/%\{[\s\S]*?\}%/, /%.+/],
    string: {
      pattern: /\B'(?:''|[^'\r\n])*'/,
      greedy: !0
    },
    // FIXME We could handle imaginary numbers as a whole
    number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,
    keyword: /\b(?:NaN|break|case|catch|continue|else|elseif|end|for|function|if|inf|otherwise|parfor|pause|pi|return|switch|try|while)\b/,
    function: /\b(?!\d)\w+(?=\s*\()/,
    operator: /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,
    punctuation: /\.{3}|[.,;\[\](){}!]/
  };
}
_ve.displayName = "maxscript";
_ve.aliases = [];
function _ve(i) {
  (function(e) {
    var t = /\b(?:about|and|animate|as|at|attributes|by|case|catch|collect|continue|coordsys|do|else|exit|fn|for|from|function|global|if|in|local|macroscript|mapped|max|not|of|off|on|or|parameters|persistent|plugin|rcmenu|return|rollout|set|struct|then|throw|to|tool|try|undo|utility|when|where|while|with)\b/i;
    e.languages.maxscript = {
      comment: {
        pattern: /\/\*[\s\S]*?(?:\*\/|$)|--.*/,
        greedy: !0
      },
      string: {
        pattern: /(^|[^"\\@])(?:"(?:[^"\\]|\\[\s\S])*"|@"[^"]*")/,
        lookbehind: !0,
        greedy: !0
      },
      path: {
        pattern: /\$(?:[\w/\\.*?]|'[^']*')*/,
        greedy: !0,
        alias: "string"
      },
      "function-call": {
        pattern: RegExp(
          "((?:" + // start of line
          (/^/.source + "|" + // operators and other language constructs
          /[;=<>+\-*/^({\[]/.source + "|" + // keywords as part of statements
          /\b(?:and|by|case|catch|collect|do|else|if|in|not|or|return|then|to|try|where|while|with)\b/.source) + ")[ 	]*)(?!" + t.source + ")" + /[a-z_]\w*\b/.source + "(?=[ 	]*(?:" + // variable
          ("(?!" + t.source + ")" + /[a-z_]/.source + "|" + // number
          /\d|-\.?\d/.source + "|" + // other expressions or literals
          /[({'"$@#?]/.source) + "))",
          "im"
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "function"
      },
      "function-definition": {
        pattern: /(\b(?:fn|function)\s+)\w+\b/i,
        lookbehind: !0,
        alias: "function"
      },
      argument: {
        pattern: /\b[a-z_]\w*(?=:)/i,
        alias: "attr-name"
      },
      keyword: t,
      boolean: /\b(?:false|true)\b/,
      time: {
        pattern: /(^|[^\w.])(?:(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?[msft])+|\d+:\d+(?:\.\d*)?)(?![\w.:])/,
        lookbehind: !0,
        alias: "number"
      },
      number: [
        {
          pattern: /(^|[^\w.])(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?|0x[a-fA-F0-9]+)(?![\w.:])/,
          lookbehind: !0
        },
        /\b(?:e|pi)\b/
      ],
      constant: /\b(?:dontcollect|ok|silentValue|undefined|unsupplied)\b/,
      color: {
        pattern: /\b(?:black|blue|brown|gray|green|orange|red|white|yellow)\b/i,
        alias: "constant"
      },
      operator: /[-+*/<>=!]=?|[&^?]|#(?!\()/,
      punctuation: /[()\[\]{}.:,;]|#(?=\()|\\$/m
    };
  })(i);
}
bve.displayName = "mel";
bve.aliases = [];
function bve(i) {
  i.languages.mel = {
    comment: {
      pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
      greedy: !0
    },
    code: {
      pattern: /`(?:\\.|[^\\`])*`/,
      greedy: !0,
      alias: "italic",
      inside: {
        delimiter: {
          pattern: /^`|`$/,
          alias: "punctuation"
        },
        statement: {
          pattern: /[\s\S]+/,
          inside: null
          // see below
        }
      }
    },
    string: {
      pattern: /"(?:\\.|[^\\"\r\n])*"/,
      greedy: !0
    },
    variable: /\$\w+/,
    number: /\b0x[\da-fA-F]+\b|\b\d+(?:\.\d*)?|\B\.\d+/,
    flag: {
      pattern: /-[^\d\W]\w*/,
      alias: "operator"
    },
    keyword: /\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/,
    function: {
      pattern: /((?:^|[{;])[ \t]*)[a-z_]\w*\b(?!\s*(?:\.(?!\.)|[[{=]))|\b[a-z_]\w*(?=[ \t]*\()/im,
      lookbehind: !0,
      greedy: !0
    },
    "tensor-punctuation": {
      pattern: /<<|>>/,
      alias: "punctuation"
    },
    operator: /\+[+=]?|-[-=]?|&&|\|\||[<>]=?|[*\/!=]=?|[%^]/,
    punctuation: /[.,:;?\[\](){}]/
  }, i.languages.mel.code.inside.statement.inside = i.languages.mel;
}
vve.displayName = "mermaid";
vve.aliases = [];
function vve(i) {
  i.languages.mermaid = {
    comment: {
      pattern: /%%.*/,
      greedy: !0
    },
    style: {
      pattern: /^([ \t]*(?:classDef|linkStyle|style)[ \t]+[\w$-]+[ \t]+)\w.*[^\s;]/m,
      lookbehind: !0,
      inside: {
        property: /\b\w[\w-]*(?=[ \t]*:)/,
        operator: /:/,
        punctuation: /,/
      }
    },
    "inter-arrow-label": {
      pattern: /([^<>ox.=-])(?:-[-.]|==)(?![<>ox.=-])[ \t]*(?:"[^"\r\n]*"|[^\s".=-](?:[^\r\n.=-]*[^\s.=-])?)[ \t]*(?:\.+->?|--+[->]|==+[=>])(?![<>ox.=-])/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        arrow: {
          pattern: /(?:\.+->?|--+[->]|==+[=>])$/,
          alias: "operator"
        },
        label: {
          pattern: /^([\s\S]{2}[ \t]*)\S(?:[\s\S]*\S)?/,
          lookbehind: !0,
          alias: "property"
        },
        "arrow-head": {
          pattern: /^\S+/,
          alias: ["arrow", "operator"]
        }
      }
    },
    arrow: [
      // This might look complex but it really isn't.
      // There are many possible arrows (see tests) and it's impossible to fit all of them into one pattern. The
      // problem is that we only have one lookbehind per pattern. However, we cannot disallow too many arrow
      // characters in the one lookbehind because that would create too many false negatives. So we have to split the
      // arrows into different patterns.
      {
        // ER diagram
        pattern: /(^|[^{}|o.-])[|}][|o](?:--|\.\.)[|o][|{](?![{}|o.-])/,
        lookbehind: !0,
        alias: "operator"
      },
      {
        // flow chart
        // (?:==+|--+|-\.*-)
        pattern: /(^|[^<>ox.=-])(?:[<ox](?:==+|--+|-\.*-)[>ox]?|(?:==+|--+|-\.*-)[>ox]|===+|---+|-\.+-)(?![<>ox.=-])/,
        lookbehind: !0,
        alias: "operator"
      },
      {
        // sequence diagram
        pattern: /(^|[^<>()x-])(?:--?(?:>>|[x>)])(?![<>()x])|(?:<<|[x<(])--?(?!-))/,
        lookbehind: !0,
        alias: "operator"
      },
      {
        // class diagram
        pattern: /(^|[^<>|*o.-])(?:[*o]--|--[*o]|<\|?(?:--|\.\.)|(?:--|\.\.)\|?>|--|\.\.)(?![<>|*o.-])/,
        lookbehind: !0,
        alias: "operator"
      }
    ],
    label: {
      pattern: /(^|[^|<])\|(?:[^\r\n"|]|"[^"\r\n]*")+\|/,
      lookbehind: !0,
      greedy: !0,
      alias: "property"
    },
    text: {
      pattern: /(?:[(\[{]+|\b>)(?:[^\r\n"()\[\]{}]|"[^"\r\n]*")+(?:[)\]}]+|>)/,
      alias: "string"
    },
    string: {
      pattern: /"[^"\r\n]*"/,
      greedy: !0
    },
    annotation: {
      pattern: /<<(?:abstract|choice|enumeration|fork|interface|join|service)>>|\[\[(?:choice|fork|join)\]\]/i,
      alias: "important"
    },
    keyword: [
      // This language has both case-sensitive and case-insensitive keywords
      {
        pattern: /(^[ \t]*)(?:action|callback|class|classDef|classDiagram|click|direction|erDiagram|flowchart|gantt|gitGraph|graph|journey|link|linkStyle|pie|requirementDiagram|sequenceDiagram|stateDiagram|stateDiagram-v2|style|subgraph)(?![\w$-])/m,
        lookbehind: !0,
        greedy: !0
      },
      {
        pattern: /(^[ \t]*)(?:activate|alt|and|as|autonumber|deactivate|else|end(?:[ \t]+note)?|loop|opt|par|participant|rect|state|note[ \t]+(?:over|(?:left|right)[ \t]+of))(?![\w$-])/im,
        lookbehind: !0,
        greedy: !0
      }
    ],
    entity: /#[a-z0-9]+;/,
    operator: {
      pattern: /(\w[ \t]*)&(?=[ \t]*\w)|:::|:/,
      lookbehind: !0
    },
    punctuation: /[(){};]/
  };
}
yve.displayName = "metafont";
yve.aliases = [];
function yve(i) {
  i.languages.metafont = {
    // Syntax of METAFONT with the added (public) elements of PlainMETAFONT. Except for internal quantities they are expected to be rarely redefined. Freely inspired by the syntax of Christophe Grandsire for the Crimson Editor.
    comment: {
      pattern: /%.*/,
      greedy: !0
    },
    string: {
      pattern: /"[^\r\n"]*"/,
      greedy: !0
    },
    number: /\d*\.?\d+/,
    boolean: /\b(?:false|true)\b/,
    punctuation: [
      /[,;()]/,
      {
        pattern: /(^|[^{}])(?:\{|\})(?![{}])/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^[])\[(?!\[)/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^\]])\](?!\])/,
        lookbehind: !0
      }
    ],
    constant: [
      {
        pattern: /(^|[^!?])\?\?\?(?![!?])/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^/*\\])(?:\\|\\\\)(?![/*\\])/,
        lookbehind: !0
      },
      /\b(?:_|blankpicture|bp|cc|cm|dd|ditto|down|eps|epsilon|fullcircle|halfcircle|identity|in|infinity|left|mm|nullpen|nullpicture|origin|pc|penrazor|penspeck|pensquare|penstroke|proof|pt|quartercircle|relax|right|smoke|unitpixel|unitsquare|up)\b/
    ],
    quantity: {
      pattern: /\b(?:autorounding|blacker|boundarychar|charcode|chardp|chardx|chardy|charext|charht|charic|charwd|currentwindow|day|designsize|displaying|fillin|fontmaking|granularity|hppp|join_radius|month|o_correction|pausing|pen_(?:bot|lft|rt|top)|pixels_per_inch|proofing|showstopping|smoothing|time|tolerance|tracingcapsules|tracingchoices|tracingcommands|tracingedges|tracingequations|tracingmacros|tracingonline|tracingoutput|tracingpens|tracingrestores|tracingspecs|tracingstats|tracingtitles|turningcheck|vppp|warningcheck|xoffset|year|yoffset)\b/,
      alias: "keyword"
    },
    command: {
      pattern: /\b(?:addto|batchmode|charlist|cull|display|errhelp|errmessage|errorstopmode|everyjob|extensible|fontdimen|headerbyte|inner|interim|let|ligtable|message|newinternal|nonstopmode|numspecial|openwindow|outer|randomseed|save|scrollmode|shipout|show|showdependencies|showstats|showtoken|showvariable|special)\b/,
      alias: "builtin"
    },
    operator: [
      {
        pattern: /(^|[^>=<:|])(?:<|<=|=|=:|\|=:|\|=:>|=:\|>|=:\||\|=:\||\|=:\|>|\|=:\|>>|>|>=|:|:=|<>|::|\|\|:)(?![>=<:|])/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^+-])(?:\+|\+\+|-{1,3}|\+-\+)(?![+-])/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^/*\\])(?:\*|\*\*|\/)(?![/*\\])/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^.])(?:\.{2,3})(?!\.)/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^@#&$])&(?![@#&$])/,
        lookbehind: !0
      },
      /\b(?:and|not|or)\b/
    ],
    macro: {
      pattern: /\b(?:abs|beginchar|bot|byte|capsule_def|ceiling|change_width|clear_pen_memory|clearit|clearpen|clearxy|counterclockwise|cullit|cutdraw|cutoff|decr|define_blacker_pixels|define_corrected_pixels|define_good_x_pixels|define_good_y_pixels|define_horizontal_corrected_pixels|define_pixels|define_whole_blacker_pixels|define_whole_pixels|define_whole_vertical_blacker_pixels|define_whole_vertical_pixels|dir|direction|directionpoint|div|dotprod|downto|draw|drawdot|endchar|erase|fill|filldraw|fix_units|flex|font_coding_scheme|font_extra_space|font_identifier|font_normal_shrink|font_normal_space|font_normal_stretch|font_quad|font_size|font_slant|font_x_height|gfcorners|gobble|gobbled|good\.(?:bot|lft|rt|top|x|y)|grayfont|hide|hround|imagerules|incr|interact|interpath|intersectionpoint|inverse|italcorr|killtext|labelfont|labels|lft|loggingall|lowres_fix|makegrid|makelabel(?:\.(?:bot|lft|rt|top)(?:\.nodot)?)?|max|min|mod|mode_def|mode_setup|nodisplays|notransforms|numtok|openit|penlabels|penpos|pickup|proofoffset|proofrule|proofrulethickness|range|reflectedabout|rotatedabout|rotatedaround|round|rt|savepen|screenchars|screenrule|screenstrokes|shipit|showit|slantfont|softjoin|solve|stop|superellipse|tensepath|thru|titlefont|top|tracingall|tracingnone|undraw|undrawdot|unfill|unfilldraw|upto|vround)\b/,
      alias: "function"
    },
    builtin: /\b(?:ASCII|angle|char|cosd|decimal|directiontime|floor|hex|intersectiontimes|jobname|known|length|makepath|makepen|mexp|mlog|normaldeviate|oct|odd|pencircle|penoffset|point|postcontrol|precontrol|reverse|rotated|sind|sqrt|str|subpath|substring|totalweight|turningnumber|uniformdeviate|unknown|xpart|xxpart|xypart|ypart|yxpart|yypart)\b/,
    keyword: /\b(?:also|at|atleast|begingroup|charexists|contour|controls|curl|cycle|def|delimiters|doublepath|dropping|dump|else|elseif|end|enddef|endfor|endgroup|endinput|exitif|exitunless|expandafter|fi|for|forever|forsuffixes|from|if|input|inwindow|keeping|kern|of|primarydef|quote|readstring|scaled|scantokens|secondarydef|shifted|skipto|slanted|step|tension|tertiarydef|to|transformed|until|vardef|withpen|withweight|xscaled|yscaled|zscaled)\b/,
    type: {
      pattern: /\b(?:boolean|expr|numeric|pair|path|pen|picture|primary|secondary|string|suffix|tertiary|text|transform)\b/,
      alias: "property"
    },
    variable: {
      pattern: /(^|[^@#&$])(?:@#|#@|#|@)(?![@#&$])|\b(?:aspect_ratio|currentpen|currentpicture|currenttransform|d|extra_beginchar|extra_endchar|extra_setup|h|localfont|mag|mode|screen_cols|screen_rows|w|whatever|x|y|z)\b/,
      lookbehind: !0
    }
  };
}
Cve.displayName = "mizar";
Cve.aliases = [];
function Cve(i) {
  i.languages.mizar = {
    comment: /::.+/,
    keyword: /@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|end|environ|equals|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:ies|y)|when|where|with|wrt)\b/,
    parameter: {
      pattern: /\$(?:10|\d)/,
      alias: "variable"
    },
    variable: /\b\w+(?=:)/,
    number: /(?:\b|-)\d+\b/,
    operator: /\.\.\.|->|&|\.?=/,
    punctuation: /\(#|#\)|[,:;\[\](){}]/
  };
}
wve.displayName = "mongodb";
wve.aliases = [];
function wve(i) {
  i.register(_u), (function(e) {
    var t = [
      // query and projection
      "$eq",
      "$gt",
      "$gte",
      "$in",
      "$lt",
      "$lte",
      "$ne",
      "$nin",
      "$and",
      "$not",
      "$nor",
      "$or",
      "$exists",
      "$type",
      "$expr",
      "$jsonSchema",
      "$mod",
      "$regex",
      "$text",
      "$where",
      "$geoIntersects",
      "$geoWithin",
      "$near",
      "$nearSphere",
      "$all",
      "$elemMatch",
      "$size",
      "$bitsAllClear",
      "$bitsAllSet",
      "$bitsAnyClear",
      "$bitsAnySet",
      "$comment",
      "$elemMatch",
      "$meta",
      "$slice",
      // update
      "$currentDate",
      "$inc",
      "$min",
      "$max",
      "$mul",
      "$rename",
      "$set",
      "$setOnInsert",
      "$unset",
      "$addToSet",
      "$pop",
      "$pull",
      "$push",
      "$pullAll",
      "$each",
      "$position",
      "$slice",
      "$sort",
      "$bit",
      // aggregation pipeline stages
      "$addFields",
      "$bucket",
      "$bucketAuto",
      "$collStats",
      "$count",
      "$currentOp",
      "$facet",
      "$geoNear",
      "$graphLookup",
      "$group",
      "$indexStats",
      "$limit",
      "$listLocalSessions",
      "$listSessions",
      "$lookup",
      "$match",
      "$merge",
      "$out",
      "$planCacheStats",
      "$project",
      "$redact",
      "$replaceRoot",
      "$replaceWith",
      "$sample",
      "$set",
      "$skip",
      "$sort",
      "$sortByCount",
      "$unionWith",
      "$unset",
      "$unwind",
      "$setWindowFields",
      // aggregation pipeline operators
      "$abs",
      "$accumulator",
      "$acos",
      "$acosh",
      "$add",
      "$addToSet",
      "$allElementsTrue",
      "$and",
      "$anyElementTrue",
      "$arrayElemAt",
      "$arrayToObject",
      "$asin",
      "$asinh",
      "$atan",
      "$atan2",
      "$atanh",
      "$avg",
      "$binarySize",
      "$bsonSize",
      "$ceil",
      "$cmp",
      "$concat",
      "$concatArrays",
      "$cond",
      "$convert",
      "$cos",
      "$dateFromParts",
      "$dateToParts",
      "$dateFromString",
      "$dateToString",
      "$dayOfMonth",
      "$dayOfWeek",
      "$dayOfYear",
      "$degreesToRadians",
      "$divide",
      "$eq",
      "$exp",
      "$filter",
      "$first",
      "$floor",
      "$function",
      "$gt",
      "$gte",
      "$hour",
      "$ifNull",
      "$in",
      "$indexOfArray",
      "$indexOfBytes",
      "$indexOfCP",
      "$isArray",
      "$isNumber",
      "$isoDayOfWeek",
      "$isoWeek",
      "$isoWeekYear",
      "$last",
      "$last",
      "$let",
      "$literal",
      "$ln",
      "$log",
      "$log10",
      "$lt",
      "$lte",
      "$ltrim",
      "$map",
      "$max",
      "$mergeObjects",
      "$meta",
      "$min",
      "$millisecond",
      "$minute",
      "$mod",
      "$month",
      "$multiply",
      "$ne",
      "$not",
      "$objectToArray",
      "$or",
      "$pow",
      "$push",
      "$radiansToDegrees",
      "$range",
      "$reduce",
      "$regexFind",
      "$regexFindAll",
      "$regexMatch",
      "$replaceOne",
      "$replaceAll",
      "$reverseArray",
      "$round",
      "$rtrim",
      "$second",
      "$setDifference",
      "$setEquals",
      "$setIntersection",
      "$setIsSubset",
      "$setUnion",
      "$size",
      "$sin",
      "$slice",
      "$split",
      "$sqrt",
      "$stdDevPop",
      "$stdDevSamp",
      "$strcasecmp",
      "$strLenBytes",
      "$strLenCP",
      "$substr",
      "$substrBytes",
      "$substrCP",
      "$subtract",
      "$sum",
      "$switch",
      "$tan",
      "$toBool",
      "$toDate",
      "$toDecimal",
      "$toDouble",
      "$toInt",
      "$toLong",
      "$toObjectId",
      "$toString",
      "$toLower",
      "$toUpper",
      "$trim",
      "$trunc",
      "$type",
      "$week",
      "$year",
      "$zip",
      "$count",
      "$dateAdd",
      "$dateDiff",
      "$dateSubtract",
      "$dateTrunc",
      "$getField",
      "$rand",
      "$sampleRate",
      "$setField",
      "$unsetField",
      // aggregation pipeline query modifiers
      "$comment",
      "$explain",
      "$hint",
      "$max",
      "$maxTimeMS",
      "$min",
      "$orderby",
      "$query",
      "$returnKey",
      "$showDiskLoc",
      "$natural"
    ], n = [
      "ObjectId",
      "Code",
      "BinData",
      "DBRef",
      "Timestamp",
      "NumberLong",
      "NumberDecimal",
      "MaxKey",
      "MinKey",
      "RegExp",
      "ISODate",
      "UUID"
    ];
    t = t.map(function(s) {
      return s.replace("$", "\\$");
    });
    var r = "(?:" + t.join("|") + ")\\b";
    e.languages.mongodb = e.languages.extend("javascript", {}), e.languages.insertBefore("mongodb", "string", {
      property: {
        pattern: /(?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)(?=\s*:)/,
        greedy: !0,
        inside: {
          keyword: RegExp(`^(['"])?` + r + "(?:\\1)?$")
        }
      }
    }), e.languages.mongodb.string.inside = {
      url: {
        // url pattern
        pattern: /https?:\/\/[-\w@:%.+~#=]{1,256}\.[a-z0-9()]{1,6}\b[-\w()@:%+.~#?&/=]*/i,
        greedy: !0
      },
      entity: {
        // ipv4
        pattern: /\b(?:(?:[01]?\d\d?|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d\d?|2[0-4]\d|25[0-5])\b/,
        greedy: !0
      }
    }, e.languages.insertBefore("mongodb", "constant", {
      builtin: {
        pattern: RegExp("\\b(?:" + n.join("|") + ")\\b"),
        alias: "keyword"
      }
    });
  })(i);
}
Sve.displayName = "monkey";
Sve.aliases = [];
function Sve(i) {
  i.languages.monkey = {
    comment: {
      pattern: /^#Rem\s[\s\S]*?^#End|'.+/im,
      greedy: !0
    },
    string: {
      pattern: /"[^"\r\n]*"/,
      greedy: !0
    },
    preprocessor: {
      pattern: /(^[ \t]*)#.+/m,
      lookbehind: !0,
      greedy: !0,
      alias: "property"
    },
    function: /\b\w+(?=\()/,
    "type-char": {
      pattern: /\b[?%#$]/,
      alias: "class-name"
    },
    number: {
      pattern: /((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,
      lookbehind: !0
    },
    keyword: /\b(?:Abstract|Array|Bool|Case|Catch|Class|Const|Continue|Default|Eachin|Else|ElseIf|End|EndIf|Exit|Extends|Extern|False|Field|Final|Float|For|Forever|Function|Global|If|Implements|Import|Inline|Int|Interface|Local|Method|Module|New|Next|Null|Object|Private|Property|Public|Repeat|Return|Select|Self|Step|Strict|String|Super|Then|Throw|To|True|Try|Until|Void|Wend|While)\b/i,
    operator: /\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,
    punctuation: /[.,:;()\[\]]/
  };
}
Eve.displayName = "moonscript";
Eve.aliases = ["moon"];
function Eve(i) {
  i.languages.moonscript = {
    comment: /--.*/,
    string: [
      {
        pattern: /'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,
        greedy: !0
      },
      {
        pattern: /"[^"]*"/,
        greedy: !0,
        inside: {
          interpolation: {
            pattern: /#\{[^{}]*\}/,
            inside: {
              moonscript: {
                pattern: /(^#\{)[\s\S]+(?=\})/,
                lookbehind: !0,
                inside: null
                // see beow
              },
              "interpolation-punctuation": {
                pattern: /#\{|\}/,
                alias: "punctuation"
              }
            }
          }
        }
      }
    ],
    "class-name": [
      {
        pattern: /(\b(?:class|extends)[ \t]+)\w+/,
        lookbehind: !0
      },
      // class-like names start with a capital letter
      /\b[A-Z]\w*/
    ],
    keyword: /\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,
    variable: /@@?\w*/,
    property: {
      pattern: /\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,
      lookbehind: !0
    },
    function: {
      pattern: /\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:create|resume|running|status|wrap|yield)|debug\.(?:debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|setfenv|sethook|setlocal|setmetatable|setupvalue|traceback)|dofile|error|getfenv|getmetatable|io\.(?:close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\.(?:concat|insert|maxn|remove|sort)|tonumber|tostring|type|unpack|xpcall)\b/,
      inside: {
        punctuation: /\./
      }
    },
    boolean: /\b(?:false|true)\b/,
    number: /(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,
    operator: /\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,
    punctuation: /[.,()[\]{}\\]/
  }, i.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside = i.languages.moonscript, i.languages.moon = i.languages.moonscript;
}
xve.displayName = "n1ql";
xve.aliases = [];
function xve(i) {
  i.languages.n1ql = {
    comment: {
      pattern: /\/\*[\s\S]*?(?:$|\*\/)|--.*/,
      greedy: !0
    },
    string: {
      pattern: /(["'])(?:\\[\s\S]|(?!\1)[^\\]|\1\1)*\1/,
      greedy: !0
    },
    identifier: {
      pattern: /`(?:\\[\s\S]|[^\\`]|``)*`/,
      greedy: !0
    },
    parameter: /\$[\w.]+/,
    // https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/reservedwords.html#n1ql-reserved-words
    keyword: /\b(?:ADVISE|ALL|ALTER|ANALYZE|AS|ASC|AT|BEGIN|BINARY|BOOLEAN|BREAK|BUCKET|BUILD|BY|CALL|CAST|CLUSTER|COLLATE|COLLECTION|COMMIT|COMMITTED|CONNECT|CONTINUE|CORRELATE|CORRELATED|COVER|CREATE|CURRENT|DATABASE|DATASET|DATASTORE|DECLARE|DECREMENT|DELETE|DERIVED|DESC|DESCRIBE|DISTINCT|DO|DROP|EACH|ELEMENT|EXCEPT|EXCLUDE|EXECUTE|EXPLAIN|FETCH|FILTER|FLATTEN|FLUSH|FOLLOWING|FOR|FORCE|FROM|FTS|FUNCTION|GOLANG|GRANT|GROUP|GROUPS|GSI|HASH|HAVING|IF|IGNORE|ILIKE|INCLUDE|INCREMENT|INDEX|INFER|INLINE|INNER|INSERT|INTERSECT|INTO|IS|ISOLATION|JAVASCRIPT|JOIN|KEY|KEYS|KEYSPACE|KNOWN|LANGUAGE|LAST|LEFT|LET|LETTING|LEVEL|LIMIT|LSM|MAP|MAPPING|MATCHED|MATERIALIZED|MERGE|MINUS|MISSING|NAMESPACE|NEST|NL|NO|NTH_VALUE|NULL|NULLS|NUMBER|OBJECT|OFFSET|ON|OPTION|OPTIONS|ORDER|OTHERS|OUTER|OVER|PARSE|PARTITION|PASSWORD|PATH|POOL|PRECEDING|PREPARE|PRIMARY|PRIVATE|PRIVILEGE|PROBE|PROCEDURE|PUBLIC|RANGE|RAW|REALM|REDUCE|RENAME|RESPECT|RETURN|RETURNING|REVOKE|RIGHT|ROLE|ROLLBACK|ROW|ROWS|SATISFIES|SAVEPOINT|SCHEMA|SCOPE|SELECT|SELF|SEMI|SET|SHOW|SOME|START|STATISTICS|STRING|SYSTEM|TIES|TO|TRAN|TRANSACTION|TRIGGER|TRUNCATE|UNBOUNDED|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNSET|UPDATE|UPSERT|USE|USER|USING|VALIDATE|VALUE|VALUES|VIA|VIEW|WHERE|WHILE|WINDOW|WITH|WORK|XOR)\b/i,
    function: /\b[a-z_]\w*(?=\s*\()/i,
    boolean: /\b(?:FALSE|TRUE)\b/i,
    number: /(?:\b\d+\.|\B\.)\d+e[+\-]?\d+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
    operator: /[-+*\/%]|!=|==?|\|\||<[>=]?|>=?|\b(?:AND|ANY|ARRAY|BETWEEN|CASE|ELSE|END|EVERY|EXISTS|FIRST|IN|LIKE|NOT|OR|THEN|VALUED|WHEN|WITHIN)\b/i,
    punctuation: /[;[\](),.{}:]/
  };
}
Lve.displayName = "nand2tetris-hdl";
Lve.aliases = [];
function Lve(i) {
  i.languages["nand2tetris-hdl"] = {
    comment: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
    keyword: /\b(?:BUILTIN|CHIP|CLOCKED|IN|OUT|PARTS)\b/,
    boolean: /\b(?:false|true)\b/,
    function: /\b[A-Za-z][A-Za-z0-9]*(?=\()/,
    number: /\b\d+\b/,
    operator: /=|\.\./,
    punctuation: /[{}[\];(),:]/
  };
}
Tve.displayName = "naniscript";
Tve.aliases = ["nani"];
function Tve(i) {
  (function(e) {
    var t = /\{[^\r\n\[\]{}]*\}/, n = {
      "quoted-string": {
        pattern: /"(?:[^"\\]|\\.)*"/,
        alias: "operator"
      },
      "command-param-id": {
        pattern: /(\s)\w+:/,
        lookbehind: !0,
        alias: "property"
      },
      "command-param-value": [
        {
          pattern: t,
          alias: "selector"
        },
        {
          pattern: /([\t ])\S+/,
          lookbehind: !0,
          greedy: !0,
          alias: "operator"
        },
        {
          pattern: /\S(?:.*\S)?/,
          alias: "operator"
        }
      ]
    };
    e.languages.naniscript = {
      // ; ...
      comment: {
        pattern: /^([\t ]*);.*/m,
        lookbehind: !0
      },
      // > ...
      // Define is a control line starting with '>' followed by a word, a space and a text.
      define: {
        pattern: /^>.+/m,
        alias: "tag",
        inside: {
          value: {
            pattern: /(^>\w+[\t ]+)(?!\s)[^{}\r\n]+/,
            lookbehind: !0,
            alias: "operator"
          },
          key: {
            pattern: /(^>)\w+/,
            lookbehind: !0
          }
        }
      },
      // # ...
      label: {
        pattern: /^([\t ]*)#[\t ]*\w+[\t ]*$/m,
        lookbehind: !0,
        alias: "regex"
      },
      command: {
        pattern: /^([\t ]*)@\w+(?=[\t ]|$).*/m,
        lookbehind: !0,
        alias: "function",
        inside: {
          "command-name": /^@\w+/,
          expression: {
            pattern: t,
            greedy: !0,
            alias: "selector"
          },
          "command-params": {
            pattern: /\s*\S[\s\S]*/,
            inside: n
          }
        }
      },
      // Generic is any line that doesn't start with operators: ;>#@
      "generic-text": {
        pattern: /(^[ \t]*)[^#@>;\s].*/m,
        lookbehind: !0,
        alias: "punctuation",
        inside: {
          // \{ ... \} ... \[ ... \] ... \"
          "escaped-char": /\\[{}\[\]"]/,
          expression: {
            pattern: t,
            greedy: !0,
            alias: "selector"
          },
          "inline-command": {
            pattern: /\[[\t ]*\w[^\r\n\[\]]*\]/,
            greedy: !0,
            alias: "function",
            inside: {
              "command-params": {
                pattern: /(^\[[\t ]*\w+\b)[\s\S]+(?=\]$)/,
                lookbehind: !0,
                inside: n
              },
              "command-param-name": {
                pattern: /^(\[[\t ]*)\w+/,
                lookbehind: !0,
                alias: "name"
              },
              "start-stop-char": /[\[\]]/
            }
          }
        }
      }
    }, e.languages.nani = e.languages.naniscript, e.hooks.add("after-tokenize", function(o) {
      var a = o.tokens;
      a.forEach(function(l) {
        if (typeof l != "string" && l.type === "generic-text") {
          var c = s(l);
          r(c) || (l.type = "bad-line", l.content = c);
        }
      });
    });
    function r(o) {
      for (var a = "[]{}", l = [], c = 0; c < o.length; c++) {
        var u = o[c], d = a.indexOf(u);
        if (d !== -1) {
          if (d % 2 === 0)
            l.push(d + 1);
          else if (l.pop() !== d)
            return !1;
        }
      }
      return l.length === 0;
    }
    function s(o) {
      return typeof o == "string" ? o : Array.isArray(o) ? o.map(s).join("") : s(o.content);
    }
  })(i);
}
kve.displayName = "nasm";
kve.aliases = [];
function kve(i) {
  i.languages.nasm = {
    comment: /;.*$/m,
    string: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,
    label: {
      pattern: /(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m,
      lookbehind: !0,
      alias: "function"
    },
    keyword: [
      /\[?BITS (?:16|32|64)\]?/,
      {
        pattern: /(^\s*)section\s*[a-z.]+:?/im,
        lookbehind: !0
      },
      /(?:extern|global)[^;\r\n]*/i,
      /(?:CPU|DEFAULT|FLOAT).*$/m
    ],
    register: {
      pattern: /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|di|si|sp)|[cdefgs]s)\b/i,
      alias: "variable"
    },
    number: /(?:\b|(?=\$))(?:0[hx](?:\.[\da-f]+|[\da-f]+(?:\.[\da-f]+)?)(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,
    operator: /[\[\]*+\-\/%<>=&|$!]/
  };
}
Dve.displayName = "neon";
Dve.aliases = [];
function Dve(i) {
  i.languages.neon = {
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    datetime: {
      pattern: /(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,
      lookbehind: !0,
      alias: "number"
    },
    key: {
      pattern: /(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,
      lookbehind: !0,
      alias: "property"
    },
    number: {
      pattern: /(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,
      lookbehind: !0
    },
    boolean: {
      pattern: /(^|[[{(=:,\s])(?:false|no|true|yes)(?=$|[\]}),:=\s])/i,
      lookbehind: !0
    },
    null: {
      pattern: /(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,
      lookbehind: !0,
      alias: "keyword"
    },
    string: {
      pattern: /(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,
      lookbehind: !0,
      greedy: !0
    },
    literal: {
      pattern: /(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,
      lookbehind: !0,
      alias: "string"
    },
    punctuation: /[,:=[\]{}()-]/
  };
}
Ive.displayName = "nevod";
Ive.aliases = [];
function Ive(i) {
  i.languages.nevod = {
    comment: /\/\/.*|(?:\/\*[\s\S]*?(?:\*\/|$))/,
    string: {
      pattern: /(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))!?\*?/,
      greedy: !0,
      inside: {
        "string-attrs": /!$|!\*$|\*$/
      }
    },
    namespace: {
      pattern: /(@namespace\s+)[a-zA-Z0-9\-.]+(?=\s*\{)/,
      lookbehind: !0
    },
    pattern: {
      pattern: /(@pattern\s+)?#?[a-zA-Z0-9\-.]+(?:\s*\(\s*(?:~\s*)?[a-zA-Z0-9\-.]+\s*(?:,\s*(?:~\s*)?[a-zA-Z0-9\-.]*)*\))?(?=\s*=)/,
      lookbehind: !0,
      inside: {
        "pattern-name": {
          pattern: /^#?[a-zA-Z0-9\-.]+/,
          alias: "class-name"
        },
        fields: {
          pattern: /\(.*\)/,
          inside: {
            "field-name": {
              pattern: /[a-zA-Z0-9\-.]+/,
              alias: "variable"
            },
            punctuation: /[,()]/,
            operator: {
              pattern: /~/,
              alias: "field-hidden-mark"
            }
          }
        }
      }
    },
    search: {
      pattern: /(@search\s+|#)[a-zA-Z0-9\-.]+(?:\.\*)?(?=\s*;)/,
      alias: "function",
      lookbehind: !0
    },
    keyword: /@(?:having|inside|namespace|outside|pattern|require|search|where)\b/,
    "standard-pattern": {
      pattern: /\b(?:Alpha|AlphaNum|Any|Blank|End|LineBreak|Num|NumAlpha|Punct|Space|Start|Symbol|Word|WordBreak)\b(?:\([a-zA-Z0-9\-.,\s+]*\))?/,
      inside: {
        "standard-pattern-name": {
          pattern: /^[a-zA-Z0-9\-.]+/,
          alias: "builtin"
        },
        quantifier: {
          pattern: /\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,
          alias: "number"
        },
        "standard-pattern-attr": {
          pattern: /[a-zA-Z0-9\-.]+/,
          alias: "builtin"
        },
        punctuation: /[,()]/
      }
    },
    quantifier: {
      pattern: /\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,
      alias: "number"
    },
    operator: [
      {
        pattern: /=/,
        alias: "pattern-def"
      },
      {
        pattern: /&/,
        alias: "conjunction"
      },
      {
        pattern: /~/,
        alias: "exception"
      },
      {
        pattern: /\?/,
        alias: "optionality"
      },
      {
        pattern: /[[\]]/,
        alias: "repetition"
      },
      {
        pattern: /[{}]/,
        alias: "variation"
      },
      {
        pattern: /[+_]/,
        alias: "sequence"
      },
      {
        pattern: /\.{2,3}/,
        alias: "span"
      }
    ],
    "field-capture": [
      {
        pattern: /([a-zA-Z0-9\-.]+\s*\()\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+(?:\s*,\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+)*(?=\s*\))/,
        lookbehind: !0,
        inside: {
          "field-name": {
            pattern: /[a-zA-Z0-9\-.]+/,
            alias: "variable"
          },
          colon: /:/
        }
      },
      {
        pattern: /[a-zA-Z0-9\-.]+\s*:/,
        inside: {
          "field-name": {
            pattern: /[a-zA-Z0-9\-.]+/,
            alias: "variable"
          },
          colon: /:/
        }
      }
    ],
    punctuation: /[:;,()]/,
    name: /[a-zA-Z0-9\-.]+/
  };
}
Nve.displayName = "nginx";
Nve.aliases = [];
function Nve(i) {
  (function(e) {
    var t = /\$(?:\w[a-z\d]*(?:_[^\x00-\x1F\s"'\\()$]*)?|\{[^}\s"'\\]+\})/i;
    e.languages.nginx = {
      comment: {
        pattern: /(^|[\s{};])#.*/,
        lookbehind: !0,
        greedy: !0
      },
      directive: {
        pattern: /(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          string: {
            pattern: /((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,
            lookbehind: !0,
            greedy: !0,
            inside: {
              escape: {
                pattern: /\\["'\\nrt]/,
                alias: "entity"
              },
              variable: t
            }
          },
          comment: {
            pattern: /(\s)#.*/,
            lookbehind: !0,
            greedy: !0
          },
          keyword: {
            pattern: /^\S+/,
            greedy: !0
          },
          // other patterns
          boolean: {
            pattern: /(\s)(?:off|on)(?!\S)/,
            lookbehind: !0
          },
          number: {
            pattern: /(\s)\d+[a-z]*(?!\S)/i,
            lookbehind: !0
          },
          variable: t
        }
      },
      punctuation: /[{};]/
    };
  })(i);
}
Rve.displayName = "nim";
Rve.aliases = [];
function Rve(i) {
  i.languages.nim = {
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    string: {
      // Double-quoted strings can be prefixed by an identifier (Generalized raw string literals)
      pattern: /(?:\b(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")/,
      greedy: !0
    },
    char: {
      // Character literals are handled specifically to prevent issues with numeric type suffixes
      pattern: /'(?:\\(?:\d+|x[\da-fA-F]{0,2}|.)|[^'])'/,
      greedy: !0
    },
    function: {
      pattern: /(?:(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,
      greedy: !0,
      inside: {
        operator: /\*$/
      }
    },
    // We don't want to highlight operators (and anything really) inside backticks
    identifier: {
      pattern: /`[^`\r\n]+`/,
      greedy: !0,
      inside: {
        punctuation: /`/
      }
    },
    // The negative look ahead prevents wrong highlighting of the .. operator
    number: /\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,
    keyword: /\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,
    operator: {
      // Look behind and look ahead prevent wrong highlighting of punctuations [. .] {. .} (. .)
      // but allow the slice operator .. to take precedence over them
      // One can define his own operators in Nim so all combination of operators might be an operator.
      pattern: /(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|in|is|isnot|mod|not|notin|of|or|shl|shr|xor)\b)/m,
      lookbehind: !0
    },
    punctuation: /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/
  };
}
Ave.displayName = "nix";
Ave.aliases = [];
function Ave(i) {
  i.languages.nix = {
    comment: {
      pattern: /\/\*[\s\S]*?\*\/|#.*/,
      greedy: !0
    },
    string: {
      pattern: /"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,
      greedy: !0,
      inside: {
        interpolation: {
          // The lookbehind ensures the ${} is not preceded by \ or ''
          pattern: /(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/,
          lookbehind: !0,
          inside: null
          // see below
        }
      }
    },
    url: [
      /\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,
      {
        pattern: /([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,
        lookbehind: !0
      }
    ],
    antiquotation: {
      pattern: /\$(?=\{)/,
      alias: "important"
    },
    number: /\b\d+\b/,
    keyword: /\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,
    function: /\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:Tarball|url)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,
    boolean: /\b(?:false|true)\b/,
    operator: /[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,
    punctuation: /[{}()[\].,:;]/
  }, i.languages.nix.string.inside.interpolation.inside = i.languages.nix;
}
Ove.displayName = "nsis";
Ove.aliases = [];
function Ove(i) {
  i.languages.nsis = {
    comment: {
      pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,
      lookbehind: !0,
      greedy: !0
    },
    string: {
      pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    keyword: {
      pattern: /(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|KnownFolderPath|LabelAddress|TempFileName|WinVer)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|RtlLanguage|ShellVarContextAll|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Target|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m,
      lookbehind: !0
    },
    property: /\b(?:ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY|admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user)\b/,
    constant: /\$\{[!\w\.:\^-]+\}|\$\([!\w\.:\^-]+\)/,
    variable: /\$\w[\w\.]*/,
    number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
    operator: /--?|\+\+?|<=?|>=?|==?=?|&&?|\|\|?|[?*\/~^%]/,
    punctuation: /[{}[\];(),.:]/,
    important: {
      pattern: /(^[\t ]*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|if|ifdef|ifmacrodef|ifmacrondef|ifndef|include|insertmacro|macro|macroend|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|warning)\b/im,
      lookbehind: !0
    }
  };
}
Mve.displayName = "ocaml";
Mve.aliases = [];
function Mve(i) {
  i.languages.ocaml = {
    comment: {
      pattern: /\(\*[\s\S]*?\*\)/,
      greedy: !0
    },
    char: {
      pattern: /'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,
      greedy: !0
    },
    string: [
      {
        pattern: /"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,
        greedy: !0
      },
      {
        pattern: /\{([a-z_]*)\|[\s\S]*?\|\1\}/,
        greedy: !0
      }
    ],
    number: [
      // binary and octal
      /\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,
      // hexadecimal
      /\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,
      // decimal
      /\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i
    ],
    directive: {
      pattern: /\B#\w+/,
      alias: "property"
    },
    label: {
      pattern: /\B~\w+/,
      alias: "property"
    },
    "type-variable": {
      pattern: /\B'\w+/,
      alias: "function"
    },
    variant: {
      pattern: /`\w+/,
      alias: "symbol"
    },
    // For the list of keywords and operators,
    // see: http://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sec84
    keyword: /\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,
    boolean: /\b(?:false|true)\b/,
    "operator-like-punctuation": {
      pattern: /\[[<>|]|[>|]\]|\{<|>\}/,
      alias: "punctuation"
    },
    // Custom operators are allowed
    operator: /\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,
    punctuation: /;;|::|[(){}\[\].,:;#]|\b_\b/
  };
}
Pve.displayName = "odin";
Pve.aliases = [];
function Pve(i) {
  (function(e) {
    var t = /\\(?:["'\\abefnrtv]|0[0-7]{2}|U[\dA-Fa-f]{6}|u[\dA-Fa-f]{4}|x[\dA-Fa-f]{2})/;
    e.languages.odin = {
      /**
       * The current implementation supports only 1 level of nesting.
       *
       * @author Michael Schmidt
       * @author edukisto
       */
      comment: [
        {
          pattern: /\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:\*(?!\/)|[^*])*(?:\*\/|$))*(?:\*\/|$)/,
          greedy: !0
        },
        {
          pattern: /#![^\n\r]*/,
          greedy: !0
        },
        {
          pattern: /\/\/[^\n\r]*/,
          greedy: !0
        }
      ],
      /**
       * Should be found before strings because of '"'"- and '`'`-like sequences.
       */
      char: {
        pattern: /'(?:\\(?:.|[0Uux][0-9A-Fa-f]{1,6})|[^\n\r'\\])'/,
        greedy: !0,
        inside: {
          symbol: t
        }
      },
      string: [
        {
          pattern: /`[^`]*`/,
          greedy: !0
        },
        {
          pattern: /"(?:\\.|[^\n\r"\\])*"/,
          greedy: !0,
          inside: {
            symbol: t
          }
        }
      ],
      directive: {
        pattern: /#\w+/,
        alias: "property"
      },
      number: /\b0(?:b[01_]+|d[\d_]+|h_*(?:(?:(?:[\dA-Fa-f]_*){8}){1,2}|(?:[\dA-Fa-f]_*){4})|o[0-7_]+|x[\dA-F_a-f]+|z[\dAB_ab]+)\b|(?:\b\d+(?:\.(?!\.)\d*)?|\B\.\d+)(?:[Ee][+-]?\d*)?[ijk]?(?!\w)/,
      discard: {
        pattern: /\b_\b/,
        alias: "keyword"
      },
      "procedure-definition": {
        pattern: /\b\w+(?=[ \t]*(?::\s*){2}proc\b)/,
        alias: "function"
      },
      keyword: /\b(?:asm|auto_cast|bit_set|break|case|cast|context|continue|defer|distinct|do|dynamic|else|enum|fallthrough|for|foreign|if|import|in|map|matrix|not_in|or_else|or_return|package|proc|return|struct|switch|transmute|typeid|union|using|when|where)\b/,
      /**
       * false, nil, true can be used as procedure names. "_" and keywords can't.
       */
      "procedure-name": {
        pattern: /\b\w+(?=[ \t]*\()/,
        alias: "function"
      },
      boolean: /\b(?:false|nil|true)\b/,
      "constant-parameter-sign": {
        pattern: /\$/,
        alias: "important"
      },
      undefined: {
        pattern: /---/,
        alias: "operator"
      },
      arrow: {
        pattern: /->/,
        alias: "punctuation"
      },
      operator: /\+\+|--|\.\.[<=]?|(?:&~|[-!*+/=~]|[%&<>|]{1,2})=?|[?^]/,
      punctuation: /[(),.:;@\[\]{}]/
    };
  })(i);
}
Fve.displayName = "opencl";
Fve.aliases = [];
function Fve(i) {
  i.register(Em), (function(e) {
    e.languages.opencl = e.languages.extend("c", {
      // Extracted from the official specs (2.0) and http://streamcomputing.eu/downloads/?opencl.lang (opencl-keywords, opencl-types) and http://sourceforge.net/tracker/?func=detail&aid=2957794&group_id=95717&atid=612384 (Words2, partly Words3)
      keyword: /\b(?:(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|__attribute__|auto|(?:bool|u?(?:char|int|long|short)|half|quad)(?:2|3|4|8|16)?|break|case|complex|const|continue|(?:double|float)(?:16(?:x(?:1|2|4|8|16))?|1x(?:1|2|4|8|16)|2(?:x(?:1|2|4|8|16))?|3|4(?:x(?:1|2|4|8|16))?|8(?:x(?:1|2|4|8|16))?)?|default|do|else|enum|extern|for|goto|if|imaginary|inline|packed|pipe|register|restrict|return|signed|sizeof|static|struct|switch|typedef|uniform|union|unsigned|void|volatile|while)\b/,
      // Extracted from http://streamcomputing.eu/downloads/?opencl.lang (opencl-const)
      // Math Constants: https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/mathConstants.html
      // Macros and Limits: https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/macroLimits.html
      number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]{0,4}/i,
      boolean: /\b(?:false|true)\b/,
      "constant-opencl-kernel": {
        pattern: /\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:GLOBAL|LOCAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|(?:MAX|MIN)(?:(?:_10)?_EXP)?|MANT_DIG)|FLT_RADIX|HUGE_VALF?|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|INFINITY|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:2|10)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN|(?:UCHAR|UINT|ULONG|USHRT)_MAX)\b/,
        alias: "constant"
      }
    }), e.languages.insertBefore("opencl", "class-name", {
      // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/scalarDataTypes.html
      // https://www.khronos.org/registry/OpenCL/sdk/2.1/docs/man/xhtml/otherDataTypes.html
      "builtin-type": {
        pattern: /\b(?:_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|cl_(?:image_format|mem_fence_flags)|clk_event_t|event_t|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|intptr_t|ndrange_t|ptrdiff_t|queue_t|reserve_id_t|sampler_t|size_t|uintptr_t)\b/,
        alias: "keyword"
      }
    });
    var t = {
      // Extracted from http://streamcomputing.eu/downloads/?opencl_host.lang (opencl-types and opencl-host)
      "type-opencl-host": {
        pattern: /\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|int|long|short)|double|float)(?:2|3|4|8|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/,
        alias: "keyword"
      },
      "boolean-opencl-host": {
        pattern: /\bCL_(?:FALSE|TRUE)\b/,
        alias: "boolean"
      },
      // Extracted from cl.h (2.0) and http://streamcomputing.eu/downloads/?opencl_host.lang (opencl-const)
      "constant-opencl-host": {
        pattern: /\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BGRA|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|R|RA|READ_(?:ONLY|WRITE)_CACHE|RG|RGB|RGBA|RGBx|RGx|RUNNING|Rx|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:8|16|24|_101010|_101010_2)|UNORM_SHORT_(?:555|565)|VERSION_(?:1_0|1_1|1_2|2_0|2_1)|sBGRA|sRGB|sRGBA|sRGBx)\b/,
        alias: "constant"
      },
      // Extracted from cl.h (2.0) and http://streamcomputing.eu/downloads/?opencl_host.lang (opencl-host)
      "function-opencl-host": {
        pattern: /\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image2D|Image3D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/,
        alias: "function"
      }
    };
    e.languages.insertBefore("c", "keyword", t), e.languages.cpp && (t["type-opencl-host-cpp"] = {
      pattern: /\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|Sampler|UserEvent)\b/,
      alias: "keyword"
    }, e.languages.insertBefore("cpp", "keyword", t));
  })(i);
}
Bve.displayName = "openqasm";
Bve.aliases = ["qasm"];
function Bve(i) {
  i.languages.openqasm = {
    comment: /\/\*[\s\S]*?\*\/|\/\/.*/,
    string: {
      pattern: /"[^"\r\n\t]*"|'[^'\r\n\t]*'/,
      greedy: !0
    },
    keyword: /\b(?:CX|OPENQASM|U|barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while)\b|#pragma\b/,
    "class-name": /\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/,
    function: /\b(?:cos|exp|ln|popcount|rotl|rotr|sin|sqrt|tan)\b(?=\s*\()/,
    constant: /\b(?:euler|pi|tau)\b|π|𝜏|ℇ/,
    number: {
      pattern: /(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|µs|ms|s)?/i,
      lookbehind: !0
    },
    operator: /->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/,
    punctuation: /[(){}\[\];,:.]/
  }, i.languages.qasm = i.languages.openqasm;
}
Hve.displayName = "oz";
Hve.aliases = [];
function Hve(i) {
  i.languages.oz = {
    comment: {
      pattern: /\/\*[\s\S]*?\*\/|%.*/,
      greedy: !0
    },
    string: {
      pattern: /"(?:[^"\\]|\\[\s\S])*"/,
      greedy: !0
    },
    atom: {
      pattern: /'(?:[^'\\]|\\[\s\S])*'/,
      greedy: !0,
      alias: "builtin"
    },
    keyword: /\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,
    function: [
      /\b[a-z][A-Za-z\d]*(?=\()/,
      {
        pattern: /(\{)[A-Z][A-Za-z\d]*\b/,
        lookbehind: !0
      }
    ],
    number: /\b(?:0[bx][\da-f]+|\d+(?:\.\d*)?(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,
    variable: /`(?:[^`\\]|\\.)+`/,
    "attr-name": /\b\w+(?=[ \t]*:(?![:=]))/,
    operator: /:(?:=|::?)|<[-:=]?|=(?:=|<?:?)|>=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,
    punctuation: /[\[\](){}.:;?]/
  };
}
Wve.displayName = "parigp";
Wve.aliases = [];
function Wve(i) {
  i.languages.parigp = {
    comment: /\/\*[\s\S]*?\*\/|\\\\.*/,
    string: {
      pattern: /"(?:[^"\\\r\n]|\\.)*"/,
      greedy: !0
    },
    // PARI/GP does not care about white spaces at all
    // so let's process the keywords to build an appropriate regexp
    // (e.g. "b *r *e *a *k", etc.)
    keyword: (function() {
      var e = [
        "breakpoint",
        "break",
        "dbg_down",
        "dbg_err",
        "dbg_up",
        "dbg_x",
        "forcomposite",
        "fordiv",
        "forell",
        "forpart",
        "forprime",
        "forstep",
        "forsubgroup",
        "forvec",
        "for",
        "iferr",
        "if",
        "local",
        "my",
        "next",
        "return",
        "until",
        "while"
      ];
      return e = e.map(function(t) {
        return t.split("").join(" *");
      }).join("|"), RegExp("\\b(?:" + e + ")\\b");
    })(),
    function: /\b\w(?:[\w ]*\w)?(?= *\()/,
    number: {
      // The lookbehind and the negative lookahead prevent from breaking the .. operator
      pattern: /((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *(?:[+-] *)?\d(?: *\d)*)?/i,
      lookbehind: !0
    },
    operator: /\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?: *>|(?: *<)?(?: *=)?)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/,
    punctuation: /[\[\]{}().,:;|]/
  };
}
Vve.displayName = "parser";
Vve.aliases = [];
function Vve(i) {
  i.register(Nc), (function(e) {
    var t = e.languages.parser = e.languages.extend("markup", {
      keyword: {
        pattern: /(^|[^^])(?:\^(?:case|eval|for|if|switch|throw)\b|@(?:BASE|CLASS|GET(?:_DEFAULT)?|OPTIONS|SET_DEFAULT|USE)\b)/,
        lookbehind: !0
      },
      variable: {
        pattern: /(^|[^^])\B\$(?:\w+|(?=[.{]))(?:(?:\.|::?)\w+)*(?:\.|::?)?/,
        lookbehind: !0,
        inside: {
          punctuation: /\.|:+/
        }
      },
      function: {
        pattern: /(^|[^^])\B[@^]\w+(?:(?:\.|::?)\w+)*(?:\.|::?)?/,
        lookbehind: !0,
        inside: {
          keyword: {
            pattern: /(^@)(?:GET_|SET_)/,
            lookbehind: !0
          },
          punctuation: /\.|:+/
        }
      },
      escape: {
        pattern: /\^(?:[$^;@()\[\]{}"':]|#[a-f\d]*)/i,
        alias: "builtin"
      },
      punctuation: /[\[\](){};]/
    });
    t = e.languages.insertBefore("parser", "keyword", {
      "parser-comment": {
        pattern: /(\s)#.*/,
        lookbehind: !0,
        alias: "comment"
      },
      expression: {
        // Allow for 3 levels of depth
        pattern: /(^|[^^])\((?:[^()]|\((?:[^()]|\((?:[^()])*\))*\))*\)/,
        greedy: !0,
        lookbehind: !0,
        inside: {
          string: {
            pattern: /(^|[^^])(["'])(?:(?!\2)[^^]|\^[\s\S])*\2/,
            lookbehind: !0
          },
          keyword: t.keyword,
          variable: t.variable,
          function: t.function,
          boolean: /\b(?:false|true)\b/,
          number: /\b(?:0x[a-f\d]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?)\b/i,
          escape: t.escape,
          operator: /[~+*\/\\%]|!(?:\|\|?|=)?|&&?|\|\|?|==|<[<=]?|>[>=]?|-[fd]?|\b(?:def|eq|ge|gt|in|is|le|lt|ne)\b/,
          punctuation: t.punctuation
        }
      }
    }), e.languages.insertBefore(
      "inside",
      "punctuation",
      {
        expression: t.expression,
        keyword: t.keyword,
        variable: t.variable,
        function: t.function,
        escape: t.escape,
        "parser-punctuation": {
          pattern: t.punctuation,
          alias: "punctuation"
        }
      },
      t.tag.inside["attr-value"]
    );
  })(i);
}
Uve.displayName = "pascal";
Uve.aliases = ["objectpascal"];
function Uve(i) {
  i.languages.pascal = {
    directive: {
      pattern: /\{\$[\s\S]*?\}/,
      greedy: !0,
      alias: ["marco", "property"]
    },
    comment: {
      pattern: /\(\*[\s\S]*?\*\)|\{[\s\S]*?\}|\/\/.*/,
      greedy: !0
    },
    string: {
      pattern: /(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i,
      greedy: !0
    },
    asm: {
      pattern: /(\basm\b)[\s\S]+?(?=\bend\s*[;[])/i,
      lookbehind: !0,
      greedy: !0,
      inside: null
      // see below
    },
    keyword: [
      {
        // Turbo Pascal
        pattern: /(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,
        lookbehind: !0
      },
      {
        // Free Pascal
        pattern: /(^|[^&])\b(?:dispose|exit|false|new|true)\b/i,
        lookbehind: !0
      },
      {
        // Object Pascal
        pattern: /(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,
        lookbehind: !0
      },
      {
        // Modifiers
        pattern: /(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,
        lookbehind: !0
      }
    ],
    number: [
      // Hexadecimal, octal and binary
      /(?:[&%]\d+|\$[a-f\d]+)/i,
      // Decimal
      /\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i
    ],
    operator: [
      /\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/,
      {
        pattern: /(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,
        lookbehind: !0
      }
    ],
    punctuation: /\(\.|\.\)|[()\[\]:;,.]/
  }, i.languages.pascal.asm.inside = i.languages.extend("pascal", {
    asm: void 0,
    keyword: void 0,
    operator: void 0
  }), i.languages.objectpascal = i.languages.pascal;
}
zve.displayName = "pascaligo";
zve.aliases = [];
function zve(i) {
  (function(e) {
    var t = /\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)/.source, n = /(?:\b\w+(?:<braces>)?|<braces>)/.source.replace(
      /<braces>/g,
      function() {
        return t;
      }
    ), r = e.languages.pascaligo = {
      comment: /\(\*[\s\S]+?\*\)|\/\/.*/,
      string: {
        pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\^[a-z]/i,
        greedy: !0
      },
      "class-name": [
        {
          pattern: RegExp(
            /(\btype\s+\w+\s+is\s+)<type>/.source.replace(
              /<type>/g,
              function() {
                return n;
              }
            ),
            "i"
          ),
          lookbehind: !0,
          inside: null
          // see below
        },
        {
          pattern: RegExp(
            /<type>(?=\s+is\b)/.source.replace(/<type>/g, function() {
              return n;
            }),
            "i"
          ),
          inside: null
          // see below
        },
        {
          pattern: RegExp(
            /(:\s*)<type>/.source.replace(/<type>/g, function() {
              return n;
            })
          ),
          lookbehind: !0,
          inside: null
          // see below
        }
      ],
      keyword: {
        pattern: /(^|[^&])\b(?:begin|block|case|const|else|end|fail|for|from|function|if|is|nil|of|remove|return|skip|then|type|var|while|with)\b/i,
        lookbehind: !0
      },
      boolean: {
        pattern: /(^|[^&])\b(?:False|True)\b/i,
        lookbehind: !0
      },
      builtin: {
        pattern: /(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i,
        lookbehind: !0
      },
      function: /\b\w+(?=\s*\()/,
      number: [
        // Hexadecimal, octal and binary
        /%[01]+|&[0-7]+|\$[a-f\d]+/i,
        // Decimal
        /\b\d+(?:\.\d+)?(?:e[+-]?\d+)?(?:mtz|n)?/i
      ],
      operator: /->|=\/=|\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=|]|\b(?:and|mod|or)\b/,
      punctuation: /\(\.|\.\)|[()\[\]:;,.{}]/
    }, s = [
      "comment",
      "keyword",
      "builtin",
      "operator",
      "punctuation"
    ].reduce(function(o, a) {
      return o[a] = r[a], o;
    }, {});
    r["class-name"].forEach(function(o) {
      o.inside = s;
    });
  })(i);
}
$ve.displayName = "psl";
$ve.aliases = [];
function $ve(i) {
  i.languages.psl = {
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    string: {
      pattern: /"(?:\\.|[^\\"])*"/,
      greedy: !0,
      inside: {
        symbol: /\\[ntrbA-Z"\\]/
      }
    },
    "heredoc-string": {
      pattern: /<<<([a-zA-Z_]\w*)[\r\n](?:.*[\r\n])*?\1\b/,
      alias: "string",
      greedy: !0
    },
    keyword: /\b(?:__multi|__single|case|default|do|else|elsif|exit|export|for|foreach|function|if|last|line|local|next|requires|return|switch|until|while|word)\b/,
    constant: /\b(?:ALARM|CHART_ADD_GRAPH|CHART_DELETE_GRAPH|CHART_DESTROY|CHART_LOAD|CHART_PRINT|EOF|OFFLINE|OK|PSL_PROF_LOG|R_CHECK_HORIZ|R_CHECK_VERT|R_CLICKER|R_COLUMN|R_FRAME|R_ICON|R_LABEL|R_LABEL_CENTER|R_LIST_MULTIPLE|R_LIST_MULTIPLE_ND|R_LIST_SINGLE|R_LIST_SINGLE_ND|R_MENU|R_POPUP|R_POPUP_SCROLLED|R_RADIO_HORIZ|R_RADIO_VERT|R_ROW|R_SCALE_HORIZ|R_SCALE_VERT|R_SEP_HORIZ|R_SEP_VERT|R_SPINNER|R_TEXT_FIELD|R_TEXT_FIELD_LABEL|R_TOGGLE|TRIM_LEADING|TRIM_LEADING_AND_TRAILING|TRIM_REDUNDANT|TRIM_TRAILING|VOID|WARN)\b/,
    boolean: /\b(?:FALSE|False|NO|No|TRUE|True|YES|Yes|false|no|true|yes)\b/,
    variable: /\b(?:PslDebug|errno|exit_status)\b/,
    builtin: {
      pattern: /\b(?:PslExecute|PslFunctionCall|PslFunctionExists|PslSetOptions|_snmp_debug|acos|add_diary|annotate|annotate_get|ascii_to_ebcdic|asctime|asin|atan|atexit|batch_set|blackout|cat|ceil|chan_exists|change_state|close|code_cvt|cond_signal|cond_wait|console_type|convert_base|convert_date|convert_locale_date|cos|cosh|create|date|dcget_text|destroy|destroy_lock|dget_text|difference|dump_hist|ebcdic_to_ascii|encrypt|event_archive|event_catalog_get|event_check|event_query|event_range_manage|event_range_query|event_report|event_schedule|event_trigger|event_trigger2|execute|exists|exp|fabs|file|floor|fmod|fopen|fseek|ftell|full_discovery|get|get_chan_info|get_ranges|get_text|get_vars|getenv|gethostinfo|getpid|getpname|grep|history|history_get_retention|in_transition|index|int|internal|intersection|is_var|isnumber|join|kill|length|lines|lock|lock_info|log|log10|loge|matchline|msg_check|msg_get_format|msg_get_severity|msg_printf|msg_sprintf|ntharg|nthargf|nthline|nthlinef|num_bytes|num_consoles|pconfig|popen|poplines|pow|print|printf|proc_exists|process|random|read|readln|refresh_parameters|remote_check|remote_close|remote_event_query|remote_event_trigger|remote_file_send|remote_open|remove|replace|rindex|sec_check_priv|sec_store_get|sec_store_set|set|set_alarm_ranges|set_locale|share|sin|sinh|sleep|snmp_agent_config|snmp_agent_start|snmp_agent_stop|snmp_close|snmp_config|snmp_get|snmp_get_next|snmp_h_get|snmp_h_get_next|snmp_h_set|snmp_open|snmp_set|snmp_trap_ignore|snmp_trap_listen|snmp_trap_raise_std_trap|snmp_trap_receive|snmp_trap_register_im|snmp_trap_send|snmp_walk|sopen|sort|splitline|sprintf|sqrt|srandom|str_repeat|strcasecmp|subset|substr|system|tail|tan|tanh|text_domain|time|tmpnam|tolower|toupper|trace_psl_process|trim|union|unique|unlock|unset|va_arg|va_start|write)\b/,
      alias: "builtin-function"
    },
    "foreach-variable": {
      pattern: /(\bforeach\s+(?:(?:\w+\b|"(?:\\.|[^\\"])*")\s+){0,2})[_a-zA-Z]\w*(?=\s*\()/,
      lookbehind: !0,
      greedy: !0
    },
    function: /\b[_a-z]\w*\b(?=\s*\()/i,
    number: /\b(?:0x[0-9a-f]+|\d+(?:\.\d+)?)\b/i,
    operator: /--|\+\+|&&=?|\|\|=?|<<=?|>>=?|[=!]~|[-+*/%&|^!=<>]=?|\.|[:?]/,
    punctuation: /[(){}\[\];,]/
  };
}
jve.displayName = "pcaxis";
jve.aliases = ["px"];
function jve(i) {
  i.languages.pcaxis = {
    string: /"[^"]*"/,
    keyword: {
      pattern: /((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        keyword: /^[-A-Z\d]+/,
        language: {
          pattern: /^(\s*)\[[-\w]+\]/,
          lookbehind: !0,
          inside: {
            punctuation: /^\[|\]$/,
            property: /[-\w]+/
          }
        },
        "sub-key": {
          pattern: /^(\s*)\S[\s\S]*/,
          lookbehind: !0,
          inside: {
            parameter: {
              pattern: /"[^"]*"/,
              alias: "property"
            },
            punctuation: /^\(|\)$|,/
          }
        }
      }
    },
    operator: /=/,
    tlist: {
      pattern: /TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,
      greedy: !0,
      inside: {
        function: /^TLIST/,
        property: {
          pattern: /^(\s*\(\s*)\w+/,
          lookbehind: !0
        },
        string: /"[^"]*"/,
        punctuation: /[(),]/,
        operator: /-/
      }
    },
    punctuation: /[;,]/,
    number: {
      pattern: /(^|\s)\d+(?:\.\d+)?(?!\S)/,
      lookbehind: !0
    },
    boolean: /NO|YES/
  }, i.languages.px = i.languages.pcaxis;
}
Gve.displayName = "peoplecode";
Gve.aliases = ["pcode"];
function Gve(i) {
  i.languages.peoplecode = {
    comment: RegExp(
      [
        // C-style multiline comments
        /\/\*[\s\S]*?\*\//.source,
        // REM comments
        /\bREM[^;]*;/.source,
        // Nested <* *> comments
        /<\*(?:[^<*]|\*(?!>)|<(?!\*)|<\*(?:(?!\*>)[\s\S])*\*>)*\*>/.source,
        // /+ +/ comments
        /\/\+[\s\S]*?\+\//.source
      ].join("|")
    ),
    string: {
      pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,
      greedy: !0
    },
    variable: /%\w+/,
    "function-definition": {
      pattern: /((?:^|[^\w-])(?:function|method)\s+)\w+/i,
      lookbehind: !0,
      alias: "function"
    },
    "class-name": {
      pattern: /((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i,
      lookbehind: !0,
      inside: {
        punctuation: /:/
      }
    },
    keyword: /\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|if|implements|import|instance|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i,
    "operator-keyword": {
      pattern: /\b(?:and|not|or)\b/i,
      alias: "operator"
    },
    function: /[_a-z]\w*(?=\s*\()/i,
    boolean: /\b(?:false|true)\b/i,
    number: /\b\d+(?:\.\d+)?\b/,
    operator: /<>|[<>]=?|!=|\*\*|[-+*/|=@]/,
    punctuation: /[:.;,()[\]]/
  }, i.languages.pcode = i.languages.peoplecode;
}
qve.displayName = "phpdoc";
qve.aliases = [];
function qve(i) {
  i.register(y2), i.register(dk), (function(e) {
    var t = /(?:\b[a-zA-Z]\w*|[|\\[\]])+/.source;
    e.languages.phpdoc = e.languages.extend("javadoclike", {
      parameter: {
        pattern: RegExp(
          "(@(?:global|param|property(?:-read|-write)?|var)\\s+(?:" + t + "\\s+)?)\\$\\w+"
        ),
        lookbehind: !0
      }
    }), e.languages.insertBefore("phpdoc", "keyword", {
      "class-name": [
        {
          pattern: RegExp(
            "(@(?:global|package|param|property(?:-read|-write)?|return|subpackage|throws|var)\\s+)" + t
          ),
          lookbehind: !0,
          inside: {
            keyword: /\b(?:array|bool|boolean|callback|double|false|float|int|integer|mixed|null|object|resource|self|string|true|void)\b/,
            punctuation: /[|\\[\]()]/
          }
        }
      ]
    }), e.languages.javadoclike.addSupport("php", e.languages.phpdoc);
  })(i);
}
Kve.displayName = "php-extras";
Kve.aliases = [];
function Kve(i) {
  i.register(dk), i.languages.insertBefore("php", "variable", {
    this: {
      pattern: /\$this\b/,
      alias: "keyword"
    },
    global: /\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,
    scope: {
      pattern: /\b[\w\\]+::/,
      inside: {
        keyword: /\b(?:parent|self|static)\b/,
        punctuation: /::|\\/
      }
    }
  });
}
Yve.displayName = "plant-uml";
Yve.aliases = ["plantuml"];
function Yve(i) {
  (function(e) {
    var t = /\$\w+|%[a-z]+%/, n = /\[[^[\]]*\]/.source, r = /(?:[drlu]|do|down|le|left|ri|right|up)/.source, s = "(?:-+" + r + "-+|\\.+" + r + "\\.+|-+(?:" + n + "-*)?|" + n + "-+|\\.+(?:" + n + "\\.*)?|" + n + "\\.+)", o = /(?:<{1,2}|\/{1,2}|\\{1,2}|<\||[#*^+}xo])/.source, a = /(?:>{1,2}|\/{1,2}|\\{1,2}|\|>|[#*^+{xo])/.source, l = /[[?]?[ox]?/.source, c = /[ox]?[\]?]?/.source, u = l + "(?:" + s + a + "|" + o + s + "(?:" + a + ")?)" + c;
    e.languages["plant-uml"] = {
      comment: {
        pattern: /(^[ \t]*)(?:'.*|\/'[\s\S]*?'\/)/m,
        lookbehind: !0,
        greedy: !0
      },
      preprocessor: {
        pattern: /(^[ \t]*)!.*/m,
        lookbehind: !0,
        greedy: !0,
        alias: "property",
        inside: {
          variable: t
        }
      },
      delimiter: {
        pattern: /(^[ \t]*)@(?:end|start)uml\b/m,
        lookbehind: !0,
        greedy: !0,
        alias: "punctuation"
      },
      arrow: {
        pattern: RegExp(
          /(^|[^-.<>?|\\[\]ox])/.source + u + /(?![-.<>?|\\\]ox])/.source
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "operator",
        inside: {
          expression: {
            pattern: /(\[)[^[\]]+(?=\])/,
            lookbehind: !0,
            inside: null
            // see below
          },
          punctuation: /\[(?=$|\])|^\]/
        }
      },
      string: {
        pattern: /"[^"]*"/,
        greedy: !0
      },
      text: {
        pattern: /(\[[ \t]*[\r\n]+(?![\r\n]))[^\]]*(?=\])/,
        lookbehind: !0,
        greedy: !0,
        alias: "string"
      },
      keyword: [
        {
          pattern: /^([ \t]*)(?:abstract\s+class|end\s+(?:box|fork|group|merge|note|ref|split|title)|(?:fork|split)(?:\s+again)?|activate|actor|agent|alt|annotation|artifact|autoactivate|autonumber|backward|binary|boundary|box|break|caption|card|case|circle|class|clock|cloud|collections|component|concise|control|create|critical|database|deactivate|destroy|detach|diamond|else|elseif|end|end[hr]note|endif|endswitch|endwhile|entity|enum|file|folder|footer|frame|group|[hr]?note|header|hexagon|hide|if|interface|label|legend|loop|map|namespace|network|newpage|node|nwdiag|object|opt|package|page|par|participant|person|queue|rectangle|ref|remove|repeat|restore|return|robust|scale|set|show|skinparam|stack|start|state|stop|storage|switch|title|together|usecase|usecase\/|while)(?=\s|$)/m,
          lookbehind: !0,
          greedy: !0
        },
        /\b(?:elseif|equals|not|while)(?=\s*\()/,
        /\b(?:as|is|then)\b/
      ],
      divider: {
        pattern: /^==.+==$/m,
        greedy: !0,
        alias: "important"
      },
      time: {
        pattern: /@(?:\d+(?:[:/]\d+){2}|[+-]?\d+|:[a-z]\w*(?:[+-]\d+)?)\b/i,
        greedy: !0,
        alias: "number"
      },
      color: {
        pattern: /#(?:[a-z_]+|[a-fA-F0-9]+)\b/,
        alias: "symbol"
      },
      variable: t,
      punctuation: /[:,;()[\]{}]|\.{3}/
    }, e.languages["plant-uml"].arrow.inside.expression.inside = e.languages["plant-uml"], e.languages.plantuml = e.languages["plant-uml"];
  })(i);
}
Xve.displayName = "plsql";
Xve.aliases = [];
function Xve(i) {
  i.register(m2), i.languages.plsql = i.languages.extend("sql", {
    comment: {
      pattern: /\/\*[\s\S]*?\*\/|--.*/,
      greedy: !0
    },
    // https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-reserved-words-keywords.html
    keyword: /\b(?:A|ACCESSIBLE|ADD|AGENT|AGGREGATE|ALL|ALTER|AND|ANY|ARRAY|AS|ASC|AT|ATTRIBUTE|AUTHID|AVG|BEGIN|BETWEEN|BFILE_BASE|BINARY|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BULK|BY|BYTE|C|CALL|CALLING|CASCADE|CASE|CHAR|CHARACTER|CHARSET|CHARSETFORM|CHARSETID|CHAR_BASE|CHECK|CLOB_BASE|CLONE|CLOSE|CLUSTER|CLUSTERS|COLAUTH|COLLECT|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPILED|COMPRESS|CONNECT|CONSTANT|CONSTRUCTOR|CONTEXT|CONTINUE|CONVERT|COUNT|CRASH|CREATE|CREDENTIAL|CURRENT|CURSOR|CUSTOMDATUM|DANGLING|DATA|DATE|DATE_BASE|DAY|DECLARE|DEFAULT|DEFINE|DELETE|DESC|DETERMINISTIC|DIRECTORY|DISTINCT|DOUBLE|DROP|DURATION|ELEMENT|ELSE|ELSIF|EMPTY|END|ESCAPE|EXCEPT|EXCEPTION|EXCEPTIONS|EXCLUSIVE|EXECUTE|EXISTS|EXIT|EXTERNAL|FETCH|FINAL|FIRST|FIXED|FLOAT|FOR|FORALL|FORCE|FROM|FUNCTION|GENERAL|GOTO|GRANT|GROUP|HASH|HAVING|HEAP|HIDDEN|HOUR|IDENTIFIED|IF|IMMEDIATE|IMMUTABLE|IN|INCLUDING|INDEX|INDEXES|INDICATOR|INDICES|INFINITE|INSERT|INSTANTIABLE|INT|INTERFACE|INTERSECT|INTERVAL|INTO|INVALIDATE|IS|ISOLATION|JAVA|LANGUAGE|LARGE|LEADING|LENGTH|LEVEL|LIBRARY|LIKE|LIKE2|LIKE4|LIKEC|LIMIT|LIMITED|LOCAL|LOCK|LONG|LOOP|MAP|MAX|MAXLEN|MEMBER|MERGE|MIN|MINUS|MINUTE|MOD|MODE|MODIFY|MONTH|MULTISET|MUTABLE|NAME|NAN|NATIONAL|NATIVE|NCHAR|NEW|NOCOMPRESS|NOCOPY|NOT|NOWAIT|NULL|NUMBER_BASE|OBJECT|OCICOLL|OCIDATE|OCIDATETIME|OCIDURATION|OCIINTERVAL|OCILOBLOCATOR|OCINUMBER|OCIRAW|OCIREF|OCIREFCURSOR|OCIROWID|OCISTRING|OCITYPE|OF|OLD|ON|ONLY|OPAQUE|OPEN|OPERATOR|OPTION|OR|ORACLE|ORADATA|ORDER|ORGANIZATION|ORLANY|ORLVARY|OTHERS|OUT|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETER|PARAMETERS|PARENT|PARTITION|PASCAL|PERSISTABLE|PIPE|PIPELINED|PLUGGABLE|POLYMORPHIC|PRAGMA|PRECISION|PRIOR|PRIVATE|PROCEDURE|PUBLIC|RAISE|RANGE|RAW|READ|RECORD|REF|REFERENCE|RELIES_ON|REM|REMAINDER|RENAME|RESOURCE|RESULT|RESULT_CACHE|RETURN|RETURNING|REVERSE|REVOKE|ROLLBACK|ROW|SAMPLE|SAVE|SAVEPOINT|SB1|SB2|SB4|SECOND|SEGMENT|SELECT|SELF|SEPARATE|SEQUENCE|SERIALIZABLE|SET|SHARE|SHORT|SIZE|SIZE_T|SOME|SPARSE|SQL|SQLCODE|SQLDATA|SQLNAME|SQLSTATE|STANDARD|START|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUM|SYNONYM|TABAUTH|TABLE|TDO|THE|THEN|TIME|TIMESTAMP|TIMEZONE_ABBR|TIMEZONE_HOUR|TIMEZONE_MINUTE|TIMEZONE_REGION|TO|TRAILING|TRANSACTION|TRANSACTIONAL|TRUSTED|TYPE|UB1|UB2|UB4|UNDER|UNION|UNIQUE|UNPLUG|UNSIGNED|UNTRUSTED|UPDATE|USE|USING|VALIST|VALUE|VALUES|VARIABLE|VARIANCE|VARRAY|VARYING|VIEW|VIEWS|VOID|WHEN|WHERE|WHILE|WITH|WORK|WRAPPED|WRITE|YEAR|ZONE)\b/i,
    // https://docs.oracle.com/en/database/oracle/oracle-database/21/lnpls/plsql-language-fundamentals.html#GUID-96A42F7C-7A71-4B90-8255-CA9C8BD9722E
    operator: /:=?|=>|[<>^~!]=|\.\.|\|\||\*\*|[-+*/%<>=@]/
  }), i.languages.insertBefore("plsql", "operator", {
    label: {
      pattern: /<<\s*\w+\s*>>/,
      alias: "symbol"
    }
  });
}
Zve.displayName = "powerquery";
Zve.aliases = ["mscript", "pq"];
function Zve(i) {
  i.languages.powerquery = {
    comment: {
      pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,
      lookbehind: !0,
      greedy: !0
    },
    "quoted-identifier": {
      pattern: /#"(?:[^"\r\n]|"")*"(?!")/,
      greedy: !0
    },
    string: {
      pattern: /(?:#!)?"(?:[^"\r\n]|"")*"(?!")/,
      greedy: !0
    },
    constant: [
      /\bDay\.(?:Friday|Monday|Saturday|Sunday|Thursday|Tuesday|Wednesday)\b/,
      /\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,
      /\bOccurrence\.(?:All|First|Last)\b/,
      /\bOrder\.(?:Ascending|Descending)\b/,
      /\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,
      /\bMissingField\.(?:Error|Ignore|UseNull)\b/,
      /\bQuoteStyle\.(?:Csv|None)\b/,
      /\bJoinKind\.(?:FullOuter|Inner|LeftAnti|LeftOuter|RightAnti|RightOuter)\b/,
      /\bGroupKind\.(?:Global|Local)\b/,
      /\bExtraValues\.(?:Error|Ignore|List)\b/,
      /\bJoinAlgorithm\.(?:Dynamic|LeftHash|LeftIndex|PairwiseHash|RightHash|RightIndex|SortMerge)\b/,
      /\bJoinSide\.(?:Left|Right)\b/,
      /\bPrecision\.(?:Decimal|Double)\b/,
      /\bRelativePosition\.From(?:End|Start)\b/,
      /\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf16|Utf8|Windows)\b/,
      /\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Function|Int16|Int32|Int64|Int8|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,
      /\bnull\b/
    ],
    boolean: /\b(?:false|true)\b/,
    keyword: /\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,
    function: {
      pattern: /(^|[^#\w.])[a-z_][\w.]*(?=\s*\()/i,
      lookbehind: !0
    },
    "data-type": {
      pattern: /\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time)\b/,
      alias: "class-name"
    },
    number: {
      pattern: /\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,
      lookbehind: !0
    },
    operator: /[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,
    punctuation: /[,;\[\](){}]/
  }, i.languages.pq = i.languages.powerquery, i.languages.mscript = i.languages.powerquery;
}
Qve.displayName = "powershell";
Qve.aliases = [];
function Qve(i) {
  (function(e) {
    var t = e.languages.powershell = {
      comment: [
        {
          pattern: /(^|[^`])<#[\s\S]*?#>/,
          lookbehind: !0
        },
        {
          pattern: /(^|[^`])#.*/,
          lookbehind: !0
        }
      ],
      string: [
        {
          pattern: /"(?:`[\s\S]|[^`"])*"/,
          greedy: !0,
          inside: null
          // see below
        },
        {
          pattern: /'(?:[^']|'')*'/,
          greedy: !0
        }
      ],
      // Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
      // Supports two levels of nested brackets (e.g. `[OutputType([System.Collections.Generic.List[int]])]`)
      namespace: /\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,
      boolean: /\$(?:false|true)\b/i,
      variable: /\$\w+\b/,
      // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example
      // Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" }
      // Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" }
      function: [
        /\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,
        /\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i
      ],
      // per http://technet.microsoft.com/en-us/library/hh847744.aspx
      keyword: /\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,
      operator: {
        pattern: /(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,
        lookbehind: !0
      },
      punctuation: /[|{}[\];(),.]/
    };
    t.string[0].inside = {
      function: {
        // Allow for one level of nesting
        pattern: /(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,
        lookbehind: !0,
        inside: t
      },
      boolean: t.boolean,
      variable: t.variable
    };
  })(i);
}
Jve.displayName = "processing";
Jve.aliases = [];
function Jve(i) {
  i.register(Wr), i.languages.processing = i.languages.extend("clike", {
    keyword: /\b(?:break|case|catch|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,
    // Spaces are allowed between function name and parenthesis
    function: /\b\w+(?=\s*\()/,
    operator: /<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/
  }), i.languages.insertBefore("processing", "number", {
    // Special case: XML is a type
    constant: /\b(?!XML\b)[A-Z][A-Z\d_]+\b/,
    type: {
      pattern: /\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,
      alias: "class-name"
    }
  });
}
eye.displayName = "prolog";
eye.aliases = [];
function eye(i) {
  i.languages.prolog = {
    // Syntax depends on the implementation
    comment: {
      pattern: /\/\*[\s\S]*?\*\/|%.*/,
      greedy: !0
    },
    // Depending on the implementation, strings may allow escaped newlines and quote-escape
    string: {
      pattern: /(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1(?!\1)/,
      greedy: !0
    },
    builtin: /\b(?:fx|fy|xf[xy]?|yfx?)\b/,
    // FIXME: Should we list all null-ary predicates (not followed by a parenthesis) like halt, trace, etc.?
    function: /\b[a-z]\w*(?:(?=\()|\/\d+)/,
    number: /\b\d+(?:\.\d*)?/,
    // Custom operators are allowed
    operator: /[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,
    punctuation: /[(){}\[\],]/
  };
}
tye.displayName = "promql";
tye.aliases = [];
function tye(i) {
  (function(e) {
    var t = [
      "sum",
      "min",
      "max",
      "avg",
      "group",
      "stddev",
      "stdvar",
      "count",
      "count_values",
      "bottomk",
      "topk",
      "quantile"
    ], n = [
      "on",
      "ignoring",
      "group_right",
      "group_left",
      "by",
      "without"
    ], r = ["offset"], s = t.concat(n, r);
    e.languages.promql = {
      comment: {
        pattern: /(^[ \t]*)#.*/m,
        lookbehind: !0
      },
      "vector-match": {
        // Match the comma-separated label lists inside vector matching:
        pattern: new RegExp(
          "((?:" + n.join("|") + ")\\s*)\\([^)]*\\)"
        ),
        lookbehind: !0,
        inside: {
          "label-key": {
            pattern: /\b[^,]+\b/,
            alias: "attr-name"
          },
          punctuation: /[(),]/
        }
      },
      "context-labels": {
        pattern: /\{[^{}]*\}/,
        inside: {
          "label-key": {
            pattern: /\b[a-z_]\w*(?=\s*(?:=|![=~]))/,
            alias: "attr-name"
          },
          "label-value": {
            pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
            greedy: !0,
            alias: "attr-value"
          },
          punctuation: /\{|\}|=~?|![=~]|,/
        }
      },
      "context-range": [
        {
          pattern: /\[[\w\s:]+\]/,
          // [1m]
          inside: {
            punctuation: /\[|\]|:/,
            "range-duration": {
              pattern: /\b(?:\d+(?:[smhdwy]|ms))+\b/i,
              alias: "number"
            }
          }
        },
        {
          pattern: /(\boffset\s+)\w+/,
          // offset 1m
          lookbehind: !0,
          inside: {
            "range-duration": {
              pattern: /\b(?:\d+(?:[smhdwy]|ms))+\b/i,
              alias: "number"
            }
          }
        }
      ],
      keyword: new RegExp("\\b(?:" + s.join("|") + ")\\b", "i"),
      function: /\b[a-z_]\w*(?=\s*\()/i,
      number: /[-+]?(?:(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[-+]?\d+)?\b|\b(?:0x[0-9a-f]+|nan|inf)\b)/i,
      operator: /[\^*/%+-]|==|!=|<=|<|>=|>|\b(?:and|or|unless)\b/i,
      punctuation: /[{};()`,.[\]]/
    };
  })(i);
}
nye.displayName = "properties";
nye.aliases = [];
function nye(i) {
  i.languages.properties = {
    comment: /^[ \t]*[#!].*$/m,
    value: {
      pattern: /(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,
      lookbehind: !0,
      alias: "attr-value"
    },
    key: {
      pattern: /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,
      alias: "attr-name"
    },
    punctuation: /[=:]/
  };
}
iye.displayName = "protobuf";
iye.aliases = [];
function iye(i) {
  i.register(Wr), (function(e) {
    var t = /\b(?:bool|bytes|double|s?fixed(?:32|64)|float|[su]?int(?:32|64)|string)\b/;
    e.languages.protobuf = e.languages.extend("clike", {
      "class-name": [
        {
          pattern: /(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,
          lookbehind: !0
        },
        {
          pattern: /(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,
          lookbehind: !0
        }
      ],
      keyword: /\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,
      function: /\b[a-z_]\w*(?=\s*\()/i
    }), e.languages.insertBefore("protobuf", "operator", {
      map: {
        pattern: /\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,
        alias: "class-name",
        inside: {
          punctuation: /[<>.,]/,
          builtin: t
        }
      },
      builtin: t,
      "positional-class-name": {
        pattern: /(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,
        alias: "class-name",
        inside: {
          punctuation: /\./
        }
      },
      annotation: {
        pattern: /(\[\s*)[a-z_]\w*(?=\s*=)/i,
        lookbehind: !0
      }
    });
  })(i);
}
rye.displayName = "stylus";
rye.aliases = [];
function rye(i) {
  (function(e) {
    var t = {
      pattern: /(\b\d+)(?:%|[a-z]+)/,
      lookbehind: !0
    }, n = {
      pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
      lookbehind: !0
    }, r = {
      comment: {
        pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,
        lookbehind: !0
      },
      url: {
        pattern: /\burl\((["']?).*?\1\)/i,
        greedy: !0
      },
      string: {
        pattern: /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,
        greedy: !0
      },
      interpolation: null,
      // See below
      func: null,
      // See below
      important: /\B!(?:important|optional)\b/i,
      keyword: {
        pattern: /(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,
        lookbehind: !0
      },
      hexcode: /#[\da-f]{3,6}/i,
      color: [
        /\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,
        {
          pattern: /\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
          inside: {
            unit: t,
            number: n,
            function: /[\w-]+(?=\()/,
            punctuation: /[(),]/
          }
        }
      ],
      entity: /\\[\da-f]{1,8}/i,
      unit: t,
      boolean: /\b(?:false|true)\b/,
      operator: [
        // We want non-word chars around "-" because it is
        // accepted in property names.
        /~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/
      ],
      number: n,
      punctuation: /[{}()\[\];:,]/
    };
    r.interpolation = {
      pattern: /\{[^\r\n}:]+\}/,
      alias: "variable",
      inside: {
        delimiter: {
          pattern: /^\{|\}$/,
          alias: "punctuation"
        },
        rest: r
      }
    }, r.func = {
      pattern: /[\w-]+\([^)]*\).*/,
      inside: {
        function: /^[^(]+/,
        rest: r
      }
    }, e.languages.stylus = {
      "atrule-declaration": {
        pattern: /(^[ \t]*)@.+/m,
        lookbehind: !0,
        inside: {
          atrule: /^@[\w-]+/,
          rest: r
        }
      },
      "variable-declaration": {
        pattern: /(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,
        lookbehind: !0,
        inside: {
          variable: /^\S+/,
          rest: r
        }
      },
      statement: {
        pattern: /(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,
        lookbehind: !0,
        inside: {
          keyword: /^\S+/,
          rest: r
        }
      },
      // A property/value pair cannot end with a comma or a brace
      // It cannot have indented content unless it ended with a semicolon
      "property-declaration": {
        pattern: /((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,
        lookbehind: !0,
        inside: {
          property: {
            pattern: /^[^\s:]+/,
            inside: {
              interpolation: r.interpolation
            }
          },
          rest: r
        }
      },
      // A selector can contain parentheses only as part of a pseudo-element
      // It can span multiple lines.
      // It must end with a comma or an accolade or have indented content.
      selector: {
        pattern: /(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,
        lookbehind: !0,
        inside: {
          interpolation: r.interpolation,
          comment: r.comment,
          punctuation: /[{},]/
        }
      },
      func: r.func,
      string: r.string,
      comment: {
        pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,
        lookbehind: !0,
        greedy: !0
      },
      interpolation: r.interpolation,
      punctuation: /[{}()\[\];:.]/
    };
  })(i);
}
sye.displayName = "twig";
sye.aliases = [];
function sye(i) {
  i.register(bu), i.languages.twig = {
    comment: /^\{#[\s\S]*?#\}$/,
    "tag-name": {
      pattern: /(^\{%-?\s*)\w+/,
      lookbehind: !0,
      alias: "keyword"
    },
    delimiter: {
      pattern: /^\{[{%]-?|-?[%}]\}$/,
      alias: "punctuation"
    },
    string: {
      pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
      inside: {
        punctuation: /^['"]|['"]$/
      }
    },
    keyword: /\b(?:even|if|odd)\b/,
    boolean: /\b(?:false|null|true)\b/,
    number: /\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,
    operator: [
      {
        pattern: /(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,
        lookbehind: !0
      },
      /[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/
    ],
    punctuation: /[()\[\]{}:.,]/
  }, i.hooks.add("before-tokenize", function(e) {
    if (e.language === "twig") {
      var t = /\{(?:#[\s\S]*?#|%[\s\S]*?%|\{[\s\S]*?\})\}/g;
      i.languages["markup-templating"].buildPlaceholders(e, "twig", t);
    }
  }), i.hooks.add("after-tokenize", function(e) {
    i.languages["markup-templating"].tokenizePlaceholders(e, "twig");
  });
}
oye.displayName = "pug";
oye.aliases = [];
function oye(i) {
  i.register(_u), i.register(Nc), (function(e) {
    e.languages.pug = {
      // Multiline stuff should appear before the rest
      // This handles both single-line and multi-line comments
      comment: {
        pattern: /(^([\t ]*))\/\/.*(?:(?:\r?\n|\r)\2[\t ].+)*/m,
        lookbehind: !0
      },
      // All the tag-related part is in lookbehind
      // so that it can be highlighted by the "tag" pattern
      "multiline-script": {
        pattern: /(^([\t ]*)script\b.*\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,
        lookbehind: !0,
        inside: e.languages.javascript
      },
      // See at the end of the file for known filters
      filter: {
        pattern: /(^([\t ]*)):.+(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,
        lookbehind: !0,
        inside: {
          "filter-name": {
            pattern: /^:[\w-]+/,
            alias: "variable"
          },
          text: /\S[\s\S]*/
        }
      },
      "multiline-plain-text": {
        pattern: /(^([\t ]*)[\w\-#.]+\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,
        lookbehind: !0
      },
      markup: {
        pattern: /(^[\t ]*)<.+/m,
        lookbehind: !0,
        inside: e.languages.markup
      },
      doctype: {
        pattern: /((?:^|\n)[\t ]*)doctype(?: .+)?/,
        lookbehind: !0
      },
      // This handle all conditional and loop keywords
      "flow-control": {
        pattern: /(^[\t ]*)(?:case|default|each|else|if|unless|when|while)\b(?: .+)?/m,
        lookbehind: !0,
        inside: {
          each: {
            pattern: /^each .+? in\b/,
            inside: {
              keyword: /\b(?:each|in)\b/,
              punctuation: /,/
            }
          },
          branch: {
            pattern: /^(?:case|default|else|if|unless|when|while)\b/,
            alias: "keyword"
          },
          rest: e.languages.javascript
        }
      },
      keyword: {
        pattern: /(^[\t ]*)(?:append|block|extends|include|prepend)\b.+/m,
        lookbehind: !0
      },
      mixin: [
        // Declaration
        {
          pattern: /(^[\t ]*)mixin .+/m,
          lookbehind: !0,
          inside: {
            keyword: /^mixin/,
            function: /\w+(?=\s*\(|\s*$)/,
            punctuation: /[(),.]/
          }
        },
        // Usage
        {
          pattern: /(^[\t ]*)\+.+/m,
          lookbehind: !0,
          inside: {
            name: {
              pattern: /^\+\w+/,
              alias: "function"
            },
            rest: e.languages.javascript
          }
        }
      ],
      script: {
        pattern: /(^[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*[\t ]).+/m,
        lookbehind: !0,
        inside: e.languages.javascript
      },
      "plain-text": {
        pattern: /(^[\t ]*(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?[\t ]).+/m,
        lookbehind: !0
      },
      tag: {
        pattern: /(^[\t ]*)(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?:?/m,
        lookbehind: !0,
        inside: {
          attributes: [
            {
              pattern: /&[^(]+\([^)]+\)/,
              inside: e.languages.javascript
            },
            {
              pattern: /\([^)]+\)/,
              inside: {
                "attr-value": {
                  pattern: /(=\s*(?!\s))(?:\{[^}]*\}|[^,)\r\n]+)/,
                  lookbehind: !0,
                  inside: e.languages.javascript
                },
                "attr-name": /[\w-]+(?=\s*!?=|\s*[,)])/,
                punctuation: /[!=(),]+/
              }
            }
          ],
          punctuation: /:/,
          "attr-id": /#[\w\-]+/,
          "attr-class": /\.[\w\-]+/
        }
      },
      code: [
        {
          pattern: /(^[\t ]*(?:-|!?=)).+/m,
          lookbehind: !0,
          inside: e.languages.javascript
        }
      ],
      punctuation: /[.\-!=|]+/
    };
    for (var t = /(^([\t ]*)):<filter_name>(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/.source, n = [
      {
        filter: "atpl",
        language: "twig"
      },
      {
        filter: "coffee",
        language: "coffeescript"
      },
      "ejs",
      "handlebars",
      "less",
      "livescript",
      "markdown",
      {
        filter: "sass",
        language: "scss"
      },
      "stylus"
    ], r = {}, s = 0, o = n.length; s < o; s++) {
      var a = n[s];
      a = typeof a == "string" ? {
        filter: a,
        language: a
      } : a, e.languages[a.language] && (r["filter-" + a.filter] = {
        pattern: RegExp(
          t.replace("<filter_name>", function() {
            return a.filter;
          }),
          "m"
        ),
        lookbehind: !0,
        inside: {
          "filter-name": {
            pattern: /^:[\w-]+/,
            alias: "variable"
          },
          text: {
            pattern: /\S[\s\S]*/,
            alias: [a.language, "language-" + a.language],
            inside: e.languages[a.language]
          }
        }
      });
    }
    e.languages.insertBefore("pug", "filter", r);
  })(i);
}
aye.displayName = "puppet";
aye.aliases = [];
function aye(i) {
  (function(e) {
    e.languages.puppet = {
      heredoc: [
        // Matches the content of a quoted heredoc string (subject to interpolation)
        {
          pattern: /(@\("([^"\r\n\/):]+)"(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*(?:\|[ \t]*)?(?:-[ \t]*)?\2/,
          lookbehind: !0,
          alias: "string",
          inside: {
            // Matches the end tag
            punctuation: /(?=\S).*\S(?= *$)/
            // See interpolation below
          }
        },
        // Matches the content of an unquoted heredoc string (no interpolation)
        {
          pattern: /(@\(([^"\r\n\/):]+)(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*(?:\|[ \t]*)?(?:-[ \t]*)?\2/,
          lookbehind: !0,
          greedy: !0,
          alias: "string",
          inside: {
            // Matches the end tag
            punctuation: /(?=\S).*\S(?= *$)/
          }
        },
        // Matches the start tag of heredoc strings
        {
          pattern: /@\("?(?:[^"\r\n\/):]+)"?(?:\/[nrts$uL]*)?\)/,
          alias: "string",
          inside: {
            punctuation: {
              pattern: /(\().+?(?=\))/,
              lookbehind: !0
            }
          }
        }
      ],
      "multiline-comment": {
        pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
        lookbehind: !0,
        greedy: !0,
        alias: "comment"
      },
      regex: {
        // Must be prefixed with the keyword "node" or a non-word char
        pattern: /((?:\bnode\s+|[~=\(\[\{,]\s*|[=+]>\s*|^\s*))\/(?:[^\/\\]|\\[\s\S])+\/(?:[imx]+\b|\B)/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          // Extended regexes must have the x flag. They can contain single-line comments.
          "extended-regex": {
            pattern: /^\/(?:[^\/\\]|\\[\s\S])+\/[im]*x[im]*$/,
            inside: {
              comment: /#.*/
            }
          }
        }
      },
      comment: {
        pattern: /(^|[^\\])#.*/,
        lookbehind: !0,
        greedy: !0
      },
      string: {
        // Allow for one nested level of double quotes inside interpolation
        pattern: /(["'])(?:\$\{(?:[^'"}]|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}|\$(?!\{)|(?!\1)[^\\$]|\\[\s\S])*\1/,
        greedy: !0,
        inside: {
          "double-quoted": {
            pattern: /^"[\s\S]*"$/,
            inside: {
              // See interpolation below
            }
          }
        }
      },
      variable: {
        pattern: /\$(?:::)?\w+(?:::\w+)*/,
        inside: {
          punctuation: /::/
        }
      },
      "attr-name": /(?:\b\w+|\*)(?=\s*=>)/,
      function: [
        {
          pattern: /(\.)(?!\d)\w+/,
          lookbehind: !0
        },
        /\b(?:contain|debug|err|fail|include|info|notice|realize|require|tag|warning)\b|\b(?!\d)\w+(?=\()/
      ],
      number: /\b(?:0x[a-f\d]+|\d+(?:\.\d+)?(?:e-?\d+)?)\b/i,
      boolean: /\b(?:false|true)\b/,
      // Includes words reserved for future use
      keyword: /\b(?:application|attr|case|class|consumes|default|define|else|elsif|function|if|import|inherits|node|private|produces|type|undef|unless)\b/,
      datatype: {
        pattern: /\b(?:Any|Array|Boolean|Callable|Catalogentry|Class|Collection|Data|Default|Enum|Float|Hash|Integer|NotUndef|Numeric|Optional|Pattern|Regexp|Resource|Runtime|Scalar|String|Struct|Tuple|Type|Undef|Variant)\b/,
        alias: "symbol"
      },
      operator: /=[=~>]?|![=~]?|<(?:<\|?|[=~|-])?|>[>=]?|->?|~>|\|>?>?|[*\/%+?]|\b(?:and|in|or)\b/,
      punctuation: /[\[\]{}().,;]|:+/
    };
    var t = [
      {
        // Allow for one nested level of braces inside interpolation
        pattern: /(^|[^\\])\$\{(?:[^'"{}]|\{[^}]*\}|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}/,
        lookbehind: !0,
        inside: {
          "short-variable": {
            // Negative look-ahead prevent wrong highlighting of functions
            pattern: /(^\$\{)(?!\w+\()(?:::)?\w+(?:::\w+)*/,
            lookbehind: !0,
            alias: "variable",
            inside: {
              punctuation: /::/
            }
          },
          delimiter: {
            pattern: /^\$/,
            alias: "variable"
          },
          rest: e.languages.puppet
        }
      },
      {
        pattern: /(^|[^\\])\$(?:::)?\w+(?:::\w+)*/,
        lookbehind: !0,
        alias: "variable",
        inside: {
          punctuation: /::/
        }
      }
    ];
    e.languages.puppet.heredoc[0].inside.interpolation = t, e.languages.puppet.string.inside["double-quoted"].inside.interpolation = t;
  })(i);
}
lye.displayName = "pure";
lye.aliases = [];
function lye(i) {
  (function(e) {
    e.languages.pure = {
      comment: [
        {
          pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
          lookbehind: !0
        },
        {
          pattern: /(^|[^\\:])\/\/.*/,
          lookbehind: !0
        },
        /#!.+/
      ],
      "inline-lang": {
        pattern: /%<[\s\S]+?%>/,
        greedy: !0,
        inside: {
          lang: {
            pattern: /(^%< *)-\*-.+?-\*-/,
            lookbehind: !0,
            alias: "comment"
          },
          delimiter: {
            pattern: /^%<.*|%>$/,
            alias: "punctuation"
          }
        }
      },
      string: {
        pattern: /"(?:\\.|[^"\\\r\n])*"/,
        greedy: !0
      },
      number: {
        // The look-behind prevents wrong highlighting of the .. operator
        pattern: /((?:\.\.)?)(?:\b(?:inf|nan)\b|\b0x[\da-f]+|(?:\b(?:0b)?\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?L?)/i,
        lookbehind: !0
      },
      keyword: /\b(?:NULL|ans|break|bt|case|catch|cd|clear|const|def|del|dump|else|end|exit|extern|false|force|help|if|infix[lr]?|interface|let|ls|mem|namespace|nonfix|of|otherwise|outfix|override|postfix|prefix|private|public|pwd|quit|run|save|show|stats|then|throw|trace|true|type|underride|using|when|with)\b/,
      function: /\b(?:abs|add_(?:addr|constdef|(?:fundef|interface|macdef|typedef)(?:_at)?|vardef)|all|any|applp?|arity|bigintp?|blob(?:_crc|_size|p)?|boolp?|byte_c?string(?:_pointer)?|byte_(?:matrix|pointer)|calloc|cat|catmap|ceil|char[ps]?|check_ptrtag|chr|clear_sentry|clearsym|closurep?|cmatrixp?|cols?|colcat(?:map)?|colmap|colrev|colvector(?:p|seq)?|complex(?:_float_(?:matrix|pointer)|_matrix(?:_view)?|_pointer|p)?|conj|cookedp?|cst|cstring(?:_(?:dup|list|vector))?|curry3?|cyclen?|del_(?:constdef|fundef|interface|macdef|typedef|vardef)|delete|diag(?:mat)?|dim|dmatrixp?|do|double(?:_matrix(?:_view)?|_pointer|p)?|dowith3?|drop|dropwhile|eval(?:cmd)?|exactp|filter|fix|fixity|flip|float(?:_matrix|_pointer)|floor|fold[lr]1?|frac|free|funp?|functionp?|gcd|get(?:_(?:byte|constdef|double|float|fundef|int(?:64)?|interface(?:_typedef)?|long|macdef|pointer|ptrtag|sentry|short|string|typedef|vardef))?|globsym|hash|head|id|im|imatrixp?|index|inexactp|infp|init|insert|int(?:_matrix(?:_view)?|_pointer|p)?|int64_(?:matrix|pointer)|integerp?|iteraten?|iterwhile|join|keys?|lambdap?|last(?:err(?:pos)?)?|lcd|list[2p]?|listmap|make_ptrtag|malloc|map|matcat|matrixp?|max|member|min|nanp|nargs|nmatrixp?|null|numberp?|ord|pack(?:ed)?|pointer(?:_cast|_tag|_type|p)?|pow|pred|ptrtag|put(?:_(?:byte|double|float|int(?:64)?|long|pointer|short|string))?|rationalp?|re|realp?|realloc|recordp?|redim|reduce(?:_with)?|refp?|repeatn?|reverse|rlistp?|round|rows?|rowcat(?:map)?|rowmap|rowrev|rowvector(?:p|seq)?|same|scan[lr]1?|sentry|sgn|short_(?:matrix|pointer)|slice|smatrixp?|sort|split|str|strcat|stream|stride|string(?:_(?:dup|list|vector)|p)?|subdiag(?:mat)?|submat|subseq2?|substr|succ|supdiag(?:mat)?|symbolp?|tail|take|takewhile|thunkp?|transpose|trunc|tuplep?|typep|ubyte|uint(?:64)?|ulong|uncurry3?|unref|unzip3?|update|ushort|vals?|varp?|vector(?:p|seq)?|void|zip3?|zipwith3?)\b/,
      special: {
        pattern: /\b__[a-z]+__\b/i,
        alias: "builtin"
      },
      // Any combination of operator chars can be an operator
      // eslint-disable-next-line no-misleading-character-class
      operator: /(?:[!"#$%&'*+,\-.\/:<=>?@\\^`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]|\b_+\b)+|\b(?:and|div|mod|not|or)\b/,
      // FIXME: How can we prevent | and , to be highlighted as operator when they are used alone?
      punctuation: /[(){}\[\];,|]/
    };
    var t = [
      "c",
      {
        lang: "c++",
        alias: "cpp"
      },
      "fortran"
    ], n = /%< *-\*- *<lang>\d* *-\*-[\s\S]+?%>/.source;
    t.forEach(function(r) {
      var s = r;
      if (typeof r != "string" && (s = r.alias, r = r.lang), e.languages[s]) {
        var o = {};
        o["inline-lang-" + s] = {
          pattern: RegExp(
            n.replace(
              "<lang>",
              r.replace(/([.+*?\/\\(){}\[\]])/g, "\\$1")
            ),
            "i"
          ),
          inside: e.util.clone(e.languages.pure["inline-lang"].inside)
        }, o["inline-lang-" + s].inside.rest = e.util.clone(
          e.languages[s]
        ), e.languages.insertBefore("pure", "inline-lang", o);
      }
    }), e.languages.c && (e.languages.pure["inline-lang"].inside.rest = e.util.clone(
      e.languages.c
    ));
  })(i);
}
cye.displayName = "purebasic";
cye.aliases = ["pbfasm"];
function cye(i) {
  i.register(Wr), i.languages.purebasic = i.languages.extend("clike", {
    comment: /;.*/,
    keyword: /\b(?:align|and|as|break|calldebugger|case|compilercase|compilerdefault|compilerelse|compilerelseif|compilerendif|compilerendselect|compilererror|compilerif|compilerselect|continue|data|datasection|debug|debuglevel|declare|declarec|declarecdll|declaredll|declaremodule|default|define|dim|disableasm|disabledebugger|disableexplicit|else|elseif|enableasm|enabledebugger|enableexplicit|end|enddatasection|enddeclaremodule|endenumeration|endif|endimport|endinterface|endmacro|endmodule|endprocedure|endselect|endstructure|endstructureunion|endwith|enumeration|extends|fakereturn|for|foreach|forever|global|gosub|goto|if|import|importc|includebinary|includefile|includepath|interface|macro|module|newlist|newmap|next|not|or|procedure|procedurec|procedurecdll|proceduredll|procedurereturn|protected|prototype|prototypec|read|redim|repeat|restore|return|runtime|select|shared|static|step|structure|structureunion|swap|threaded|to|until|wend|while|with|xincludefile|xor)\b/i,
    function: /\b\w+(?:\.\w+)?\s*(?=\()/,
    number: /(?:\$[\da-f]+|\b-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)\b/i,
    operator: /(?:@\*?|\?|\*)\w+\$?|-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*/@]/
  }), i.languages.insertBefore("purebasic", "keyword", {
    tag: /#\w+\$?/,
    asm: {
      pattern: /(^[\t ]*)!.*/m,
      lookbehind: !0,
      alias: "tag",
      inside: {
        comment: /;.*/,
        string: {
          pattern: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,
          greedy: !0
        },
        // Anonymous label references, i.e.: jmp @b
        "label-reference-anonymous": {
          pattern: /(!\s*j[a-z]+\s+)@[fb]/i,
          lookbehind: !0,
          alias: "fasm-label"
        },
        // Named label reference, i.e.: jne label1
        "label-reference-addressed": {
          pattern: /(!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i,
          lookbehind: !0,
          alias: "fasm-label"
        },
        keyword: [
          /\b(?:extern|global)\b[^;\r\n]*/i,
          /\b(?:CPU|DEFAULT|FLOAT)\b.*/
        ],
        function: {
          pattern: /^([\t ]*!\s*)[\da-z]+(?=\s|$)/im,
          lookbehind: !0
        },
        "function-inline": {
          pattern: /(:\s*)[\da-z]+(?=\s)/i,
          lookbehind: !0,
          alias: "function"
        },
        label: {
          pattern: /^([\t ]*!\s*)[A-Za-z._?$@][\w.?$@~#]*(?=:)/m,
          lookbehind: !0,
          alias: "fasm-label"
        },
        register: /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|di|si|sp)|[cdefgs]s|mm\d+)\b/i,
        number: /(?:\b|-|(?=\$))(?:0[hx](?:[\da-f]*\.)?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,
        operator: /[\[\]*+\-/%<>=&|$!,.:]/
      }
    }
  }), delete i.languages.purebasic["class-name"], delete i.languages.purebasic.boolean, i.languages.pbfasm = i.languages.purebasic;
}
uye.displayName = "purescript";
uye.aliases = ["purs"];
function uye(i) {
  i.register(l6), i.languages.purescript = i.languages.extend("haskell", {
    keyword: /\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b|∀/,
    "import-statement": {
      // The imported or hidden names are not included in this import
      // statement. This is because we want to highlight those exactly like
      // we do for the names in the program.
      pattern: /(^[\t ]*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,
      lookbehind: !0,
      inside: {
        keyword: /\b(?:as|hiding|import)\b/,
        punctuation: /\./
      }
    },
    // These are builtin functions only. Constructors are highlighted later as a constant.
    builtin: /\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/,
    operator: [
      // Infix operators
      i.languages.haskell.operator[0],
      // ASCII operators
      i.languages.haskell.operator[2],
      // All UTF16 Unicode operator symbols
      // This regex is equivalent to /(?=[\x80-\uFFFF])[\p{gc=Math_Symbol}\p{gc=Currency_Symbol}\p{Modifier_Symbol}\p{Other_Symbol}]/u
      // See https://github.com/PrismJS/prism/issues/3006 for more details.
      /[\xa2-\xa6\xa8\xa9\xac\xae-\xb1\xb4\xb8\xd7\xf7\u02c2-\u02c5\u02d2-\u02df\u02e5-\u02eb\u02ed\u02ef-\u02ff\u0375\u0384\u0385\u03f6\u0482\u058d-\u058f\u0606-\u0608\u060b\u060e\u060f\u06de\u06e9\u06fd\u06fe\u07f6\u07fe\u07ff\u09f2\u09f3\u09fa\u09fb\u0af1\u0b70\u0bf3-\u0bfa\u0c7f\u0d4f\u0d79\u0e3f\u0f01-\u0f03\u0f13\u0f15-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcc\u0fce\u0fcf\u0fd5-\u0fd8\u109e\u109f\u1390-\u1399\u166d\u17db\u1940\u19de-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u1fbd\u1fbf-\u1fc1\u1fcd-\u1fcf\u1fdd-\u1fdf\u1fed-\u1fef\u1ffd\u1ffe\u2044\u2052\u207a-\u207c\u208a-\u208c\u20a0-\u20bf\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211e-\u2123\u2125\u2127\u2129\u212e\u213a\u213b\u2140-\u2144\u214a-\u214d\u214f\u218a\u218b\u2190-\u2307\u230c-\u2328\u232b-\u2426\u2440-\u244a\u249c-\u24e9\u2500-\u2767\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb\u29fe-\u2b73\u2b76-\u2b95\u2b97-\u2bff\u2ce5-\u2cea\u2e50\u2e51\u2e80-\u2e99\u2e9b-\u2ef3\u2f00-\u2fd5\u2ff0-\u2ffb\u3004\u3012\u3013\u3020\u3036\u3037\u303e\u303f\u309b\u309c\u3190\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3247\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua700-\ua716\ua720\ua721\ua789\ua78a\ua828-\ua82b\ua836-\ua839\uaa77-\uaa79\uab5b\uab6a\uab6b\ufb29\ufbb2-\ufbc1\ufdfc\ufdfd\ufe62\ufe64-\ufe66\ufe69\uff04\uff0b\uff1c-\uff1e\uff3e\uff40\uff5c\uff5e\uffe0-\uffe6\uffe8-\uffee\ufffc\ufffd]/
    ]
  }), i.languages.purs = i.languages.purescript;
}
dye.displayName = "qsharp";
dye.aliases = ["qs"];
function dye(i) {
  i.register(Wr), (function(e) {
    function t(g, m) {
      return g.replace(/<<(\d+)>>/g, function(_, v) {
        return "(?:" + m[+v] + ")";
      });
    }
    function n(g, m, _) {
      return RegExp(t(g, m), "");
    }
    function r(g, m) {
      for (var _ = 0; _ < m; _++)
        g = g.replace(/<<self>>/g, function() {
          return "(?:" + g + ")";
        });
      return g.replace(/<<self>>/g, "[^\\s\\S]");
    }
    var s = {
      // keywords which represent a return or variable type
      type: "Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero",
      // all other keywords
      other: "Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within"
    };
    function o(g) {
      return "\\b(?:" + g.trim().replace(/ /g, "|") + ")\\b";
    }
    var a = RegExp(
      o(s.type + " " + s.other)
    ), l = /\b[A-Za-z_]\w*\b/.source, c = t(/<<0>>(?:\s*\.\s*<<0>>)*/.source, [l]), u = {
      keyword: a,
      punctuation: /[<>()?,.:[\]]/
    }, d = /"(?:\\.|[^\\"])*"/.source;
    e.languages.qsharp = e.languages.extend("clike", {
      comment: /\/\/.*/,
      string: [
        {
          pattern: n(/(^|[^$\\])<<0>>/.source, [d]),
          lookbehind: !0,
          greedy: !0
        }
      ],
      "class-name": [
        {
          // open Microsoft.Quantum.Canon;
          // open Microsoft.Quantum.Canon as CN;
          pattern: n(/(\b(?:as|open)\s+)<<0>>(?=\s*(?:;|as\b))/.source, [
            c
          ]),
          lookbehind: !0,
          inside: u
        },
        {
          // namespace Quantum.App1;
          pattern: n(/(\bnamespace\s+)<<0>>(?=\s*\{)/.source, [c]),
          lookbehind: !0,
          inside: u
        }
      ],
      keyword: a,
      number: /(?:\b0(?:x[\da-f]+|b[01]+|o[0-7]+)|(?:\B\.\d+|\b\d+(?:\.\d*)?)(?:e[-+]?\d+)?)l?\b/i,
      operator: /\band=|\bor=|\band\b|\bnot\b|\bor\b|<[-=]|[-=]>|>>>=?|<<<=?|\^\^\^=?|\|\|\|=?|&&&=?|w\/=?|~~~|[*\/+\-^=!%]=?/,
      punctuation: /::|[{}[\];(),.:]/
    }), e.languages.insertBefore("qsharp", "number", {
      range: {
        pattern: /\.\./,
        alias: "operator"
      }
    });
    var h = r(
      t(/\{(?:[^"{}]|<<0>>|<<self>>)*\}/.source, [d]),
      2
    );
    e.languages.insertBefore("qsharp", "string", {
      "interpolation-string": {
        pattern: n(/\$"(?:\\.|<<0>>|[^\\"{])*"/.source, [h]),
        greedy: !0,
        inside: {
          interpolation: {
            pattern: n(/((?:^|[^\\])(?:\\\\)*)<<0>>/.source, [
              h
            ]),
            lookbehind: !0,
            inside: {
              punctuation: /^\{|\}$/,
              expression: {
                pattern: /[\s\S]+/,
                alias: "language-qsharp",
                inside: e.languages.qsharp
              }
            }
          },
          string: /[\s\S]+/
        }
      }
    });
  })(i), i.languages.qs = i.languages.qsharp;
}
hye.displayName = "q";
hye.aliases = [];
function hye(i) {
  i.languages.q = {
    string: /"(?:\\.|[^"\\\r\n])*"/,
    comment: [
      // From http://code.kx.com/wiki/Reference/Slash:
      // When / is following a space (or a right parenthesis, bracket, or brace), it is ignored with the rest of the line.
      {
        pattern: /([\t )\]}])\/.*/,
        lookbehind: !0,
        greedy: !0
      },
      // From http://code.kx.com/wiki/Reference/Slash:
      // A line which has / as its first character and contains at least one other non-whitespace character is a whole-line comment and is ignored entirely.
      // A / on a line by itself begins a multiline comment which is terminated by the next \ on a line by itself.
      // If a / is not matched by a \, the multiline comment is unterminated and continues to end of file.
      // The / and \ must be the first char on the line, but may be followed by any amount of whitespace.
      {
        pattern: /(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r(?!\n)))*?(?:\\(?=[\t ]*(?:\r?\n|\r))|$)|\S.*)/,
        lookbehind: !0,
        greedy: !0
      },
      // From http://code.kx.com/wiki/Reference/Slash:
      // A \ on a line by itself with no preceding matching / will comment to end of file.
      {
        pattern: /^\\[\t ]*(?:\r?\n|\r)[\s\S]+/m,
        greedy: !0
      },
      {
        pattern: /^#!.+/m,
        greedy: !0
      }
    ],
    symbol: /`(?::\S+|[\w.]*)/,
    datetime: {
      pattern: /0N[mdzuvt]|0W[dtz]|\d{4}\.\d\d(?:m|\.\d\d(?:T(?:\d\d(?::\d\d(?::\d\d(?:[.:]\d\d\d)?)?)?)?)?[dz]?)|\d\d:\d\d(?::\d\d(?:[.:]\d\d\d)?)?[uvt]?/,
      alias: "number"
    },
    // The negative look-ahead prevents bad highlighting
    // of verbs 0: and 1:
    number: /\b(?![01]:)(?:0N[hje]?|0W[hj]?|0[wn]|0x[\da-fA-F]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?[hjfeb]?)/,
    keyword: /\\\w+\b|\b(?:abs|acos|aj0?|all|and|any|asc|asin|asof|atan|attr|avgs?|binr?|by|ceiling|cols|cor|cos|count|cov|cross|csv|cut|delete|deltas|desc|dev|differ|distinct|div|do|dsave|ej|enlist|eval|except|exec|exit|exp|fby|fills|first|fkeys|flip|floor|from|get|getenv|group|gtime|hclose|hcount|hdel|hopen|hsym|iasc|identity|idesc|if|ij|in|insert|inter|inv|keys?|last|like|list|ljf?|load|log|lower|lsq|ltime|ltrim|mavg|maxs?|mcount|md5|mdev|med|meta|mins?|mmax|mmin|mmu|mod|msum|neg|next|not|null|or|over|parse|peach|pj|plist|prds?|prev|prior|rand|rank|ratios|raze|read0|read1|reciprocal|reval|reverse|rload|rotate|rsave|rtrim|save|scan|scov|sdev|select|set|setenv|show|signum|sin|sqrt|ssr?|string|sublist|sums?|sv|svar|system|tables|tan|til|trim|txf|type|uj|ungroup|union|update|upper|upsert|value|var|views?|vs|wavg|where|while|within|wj1?|wsum|ww|xasc|xbar|xcols?|xdesc|xexp|xgroup|xkey|xlog|xprev|xrank)\b/,
    adverb: {
      pattern: /['\/\\]:?|\beach\b/,
      alias: "function"
    },
    verb: {
      pattern: /(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?~=|$&#@^]):?|\b_\b:?/,
      alias: "operator"
    },
    punctuation: /[(){}\[\];.]/
  };
}
fye.displayName = "qml";
fye.aliases = [];
function fye(i) {
  i.register(_u), (function(e) {
    for (var t = /"(?:\\.|[^\\"\r\n])*"|'(?:\\.|[^\\'\r\n])*'/.source, n = /\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\//.source, r = /(?:[^\\()[\]{}"'/]|<string>|\/(?![*/])|<comment>|\(<expr>*\)|\[<expr>*\]|\{<expr>*\}|\\[\s\S])/.source.replace(/<string>/g, function() {
      return t;
    }).replace(/<comment>/g, function() {
      return n;
    }), s = 0; s < 2; s++)
      r = r.replace(/<expr>/g, function() {
        return r;
      });
    r = r.replace(/<expr>/g, "[^\\s\\S]"), e.languages.qml = {
      comment: {
        pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
        greedy: !0
      },
      "javascript-function": {
        pattern: RegExp(
          /((?:^|;)[ \t]*)function\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*\(<js>*\)\s*\{<js>*\}/.source.replace(
            /<js>/g,
            function() {
              return r;
            }
          ),
          "m"
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "language-javascript",
        inside: e.languages.javascript
      },
      "class-name": {
        pattern: /((?:^|[:;])[ \t]*)(?!\d)\w+(?=[ \t]*\{|[ \t]+on\b)/m,
        lookbehind: !0
      },
      property: [
        {
          pattern: /((?:^|[;{])[ \t]*)(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,
          lookbehind: !0
        },
        {
          pattern: /((?:^|[;{])[ \t]*)property[ \t]+(?!\d)\w+(?:\.\w+)*[ \t]+(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,
          lookbehind: !0,
          inside: {
            keyword: /^property/,
            property: /\w+(?:\.\w+)*/
          }
        }
      ],
      "javascript-expression": {
        pattern: RegExp(
          /(:[ \t]*)(?![\s;}[])(?:(?!$|[;}])<js>)+/.source.replace(
            /<js>/g,
            function() {
              return r;
            }
          ),
          "m"
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "language-javascript",
        inside: e.languages.javascript
      },
      string: {
        pattern: /"(?:\\.|[^\\"\r\n])*"/,
        greedy: !0
      },
      keyword: /\b(?:as|import|on)\b/,
      punctuation: /[{}[\]:;,]/
    };
  })(i);
}
gye.displayName = "qore";
gye.aliases = [];
function gye(i) {
  i.register(Wr), i.languages.qore = i.languages.extend("clike", {
    comment: {
      pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/|#).*)/,
      lookbehind: !0
    },
    // Overridden to allow unescaped multi-line strings
    string: {
      pattern: /("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,
      greedy: !0
    },
    keyword: /\b(?:abstract|any|assert|binary|bool|boolean|break|byte|case|catch|char|class|code|const|continue|data|default|do|double|else|enum|extends|final|finally|float|for|goto|hash|if|implements|import|inherits|instanceof|int|interface|long|my|native|new|nothing|null|object|our|own|private|reference|rethrow|return|short|soft(?:bool|date|float|int|list|number|string)|static|strictfp|string|sub|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/,
    boolean: /\b(?:false|true)\b/i,
    function: /\$?\b(?!\d)\w+(?=\()/,
    number: /\b(?:0b[01]+|0x(?:[\da-f]*\.)?[\da-fp\-]+|(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?[df]|(?:\d+(?:\.\d+)?|\.\d+))\b/i,
    operator: {
      pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|[!=](?:==?|~)?|>>?=?|<(?:=>?|<=?)?|&[&=]?|\|[|=]?|[*\/%^]=?|[~?])/,
      lookbehind: !0
    },
    variable: /\$(?!\d)\w+\b/
  });
}
pye.displayName = "racket";
pye.aliases = ["rkt"];
function pye(i) {
  i.register(c6), i.languages.racket = i.languages.extend("scheme", {
    "lambda-parameter": {
      // the racket lambda syntax is a lot more complex, so we won't even attempt to capture it.
      // this will just prevent false positives of the `function` pattern
      pattern: /([(\[]lambda\s+[(\[])[^()\[\]'\s]+/,
      lookbehind: !0
    }
  }), i.languages.insertBefore("racket", "string", {
    lang: {
      pattern: /^#lang.+/m,
      greedy: !0,
      alias: "keyword"
    }
  }), i.languages.rkt = i.languages.racket;
}
mye.displayName = "cshtml";
mye.aliases = ["razor"];
function mye(i) {
  i.register(ck), i.register(Nc), (function(e) {
    var t = /\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\//.source, n = /@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source + "|" + /'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source;
    function r(E, L) {
      for (var T = 0; T < L; T++)
        E = E.replace(/<self>/g, function() {
          return "(?:" + E + ")";
        });
      return E.replace(/<self>/g, "[^\\s\\S]").replace(/<str>/g, "(?:" + n + ")").replace(/<comment>/g, "(?:" + t + ")");
    }
    var s = r(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source, 2), o = r(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source, 1), a = r(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source, 2), l = r(/<(?:[^<>'"@/]|<comment>|<self>)*>/.source, 1), c = /@/.source + /(?:await\b\s*)?/.source + "(?:" + /(?!await\b)\w+\b/.source + "|" + s + ")(?:" + /[?!]?\.\w+\b/.source + "|(?:" + l + ")?" + s + "|" + o + ")*" + /(?![?!\.(\[]|<(?!\/))/.source, u = /@(?![\w()])/.source + "|" + c, d = "(?:" + /"[^"@]*"|'[^'@]*'|[^\s'"@>=]+(?=[\s>])/.source + `|["'][^"'@]*(?:(?:` + u + `)[^"'@]*)+["'])`, h = /(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*<tagAttrValue>|(?=[\s/>])))+)?/.source.replace(
      /<tagAttrValue>/,
      d
    ), g = /(?!\d)[^\s>\/=$<%]+/.source + h + /\s*\/?>/.source, m = /\B@?/.source + "(?:" + /<([a-zA-Z][\w:]*)/.source + h + /\s*>/.source + "(?:" + (/[^<]/.source + "|" + // all tags that are not the start tag
    // eslint-disable-next-line regexp/strict
    /<\/?(?!\1\b)/.source + g + "|" + // nested start tag
    r(
      // eslint-disable-next-line regexp/strict
      /<\1/.source + h + /\s*>/.source + "(?:" + (/[^<]/.source + "|" + // all tags that are not the start tag
      // eslint-disable-next-line regexp/strict
      /<\/?(?!\1\b)/.source + g + "|<self>") + ")*" + // eslint-disable-next-line regexp/strict
      /<\/\1\s*>/.source,
      2
    )) + ")*" + // eslint-disable-next-line regexp/strict
    /<\/\1\s*>/.source + "|" + /</.source + g + ")";
    e.languages.cshtml = e.languages.extend("markup", {});
    var _ = e.languages.insertBefore(
      "csharp",
      "string",
      {
        html: {
          pattern: RegExp(m),
          greedy: !0,
          inside: e.languages.cshtml
        }
      },
      {
        csharp: e.languages.extend("csharp", {})
      }
    ), v = {
      pattern: /\S[\s\S]*/,
      alias: "language-csharp",
      inside: _
    }, w = {
      pattern: RegExp(/(^|[^@])/.source + c),
      lookbehind: !0,
      greedy: !0,
      alias: "variable",
      inside: {
        keyword: /^@/,
        csharp: v
      }
    };
    e.languages.cshtml.tag.pattern = RegExp(/<\/?/.source + g), e.languages.cshtml.tag.inside["attr-value"].pattern = RegExp(
      /=\s*/.source + d
    ), e.languages.insertBefore(
      "inside",
      "punctuation",
      {
        value: w
      },
      e.languages.cshtml.tag.inside["attr-value"]
    ), e.languages.insertBefore("cshtml", "prolog", {
      "razor-comment": {
        pattern: /@\*[\s\S]*?\*@/,
        greedy: !0,
        alias: "comment"
      },
      block: {
        pattern: RegExp(
          /(^|[^@])@/.source + "(?:" + [
            // @{ ... }
            a,
            // @code{ ... }
            /(?:code|functions)\s*/.source + a,
            // @for (...) { ... }
            /(?:for|foreach|lock|switch|using|while)\s*/.source + s + /\s*/.source + a,
            // @do { ... } while (...);
            /do\s*/.source + a + /\s*while\s*/.source + s + /(?:\s*;)?/.source,
            // @try { ... } catch (...) { ... } finally { ... }
            /try\s*/.source + a + /\s*catch\s*/.source + s + /\s*/.source + a + /\s*finally\s*/.source + a,
            // @if (...) {...} else if (...) {...} else {...}
            /if\s*/.source + s + /\s*/.source + a + "(?:" + /\s*else/.source + "(?:" + /\s+if\s*/.source + s + ")?" + /\s*/.source + a + ")*",
            // @helper Ident(params) { ... }
            /helper\s+\w+\s*/.source + s + /\s*/.source + a
          ].join("|") + ")"
        ),
        lookbehind: !0,
        greedy: !0,
        inside: {
          keyword: /^@\w*/,
          csharp: v
        }
      },
      directive: {
        pattern: /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m,
        lookbehind: !0,
        greedy: !0,
        inside: {
          keyword: /^@\w+/,
          csharp: v
        }
      },
      value: w,
      "delegate-operator": {
        pattern: /(^|[^@])@(?=<)/,
        lookbehind: !0,
        alias: "operator"
      }
    }), e.languages.razor = e.languages.cshtml;
  })(i);
}
yY.displayName = "jsx";
yY.aliases = [];
function yY(i) {
  i.register(_u), i.register(Nc), (function(e) {
    var t = e.util.clone(e.languages.javascript), n = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source, r = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source, s = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
    function o(c, u) {
      return c = c.replace(/<S>/g, function() {
        return n;
      }).replace(/<BRACES>/g, function() {
        return r;
      }).replace(/<SPREAD>/g, function() {
        return s;
      }), RegExp(c, u);
    }
    s = o(s).source, e.languages.jsx = e.languages.extend("markup", t), e.languages.jsx.tag.pattern = o(
      /<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
    ), e.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/, e.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/, e.languages.jsx.tag.inside.tag.inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/, e.languages.jsx.tag.inside.comment = t.comment, e.languages.insertBefore(
      "inside",
      "attr-name",
      {
        spread: {
          pattern: o(/<SPREAD>/.source),
          inside: e.languages.jsx
        }
      },
      e.languages.jsx.tag
    ), e.languages.insertBefore(
      "inside",
      "special-attr",
      {
        script: {
          // Allow for two levels of nesting
          pattern: o(/=<BRACES>/.source),
          alias: "language-javascript",
          inside: {
            "script-punctuation": {
              pattern: /^=(?=\{)/,
              alias: "punctuation"
            },
            rest: e.languages.jsx
          }
        }
      },
      e.languages.jsx.tag
    );
    var a = function(c) {
      return c ? typeof c == "string" ? c : typeof c.content == "string" ? c.content : c.content.map(a).join("") : "";
    }, l = function(c) {
      for (var u = [], d = 0; d < c.length; d++) {
        var h = c[d], g = !1;
        if (typeof h != "string" && (h.type === "tag" && h.content[0] && h.content[0].type === "tag" ? h.content[0].content[0].content === "</" ? u.length > 0 && u[u.length - 1].tagName === a(h.content[0].content[1]) && u.pop() : h.content[h.content.length - 1].content === "/>" || u.push({
          tagName: a(h.content[0].content[1]),
          openedBraces: 0
        }) : u.length > 0 && h.type === "punctuation" && h.content === "{" ? u[u.length - 1].openedBraces++ : u.length > 0 && u[u.length - 1].openedBraces > 0 && h.type === "punctuation" && h.content === "}" ? u[u.length - 1].openedBraces-- : g = !0), (g || typeof h == "string") && u.length > 0 && u[u.length - 1].openedBraces === 0) {
          var m = a(h);
          d < c.length - 1 && (typeof c[d + 1] == "string" || c[d + 1].type === "plain-text") && (m += a(c[d + 1]), c.splice(d + 1, 1)), d > 0 && (typeof c[d - 1] == "string" || c[d - 1].type === "plain-text") && (m = a(c[d - 1]) + m, c.splice(d - 1, 1), d--), c[d] = new e.Token(
            "plain-text",
            m,
            null,
            m
          );
        }
        h.content && typeof h.content != "string" && l(h.content);
      }
    };
    e.hooks.add("after-tokenize", function(c) {
      c.language !== "jsx" && c.language !== "tsx" || l(c.tokens);
    });
  })(i);
}
_ye.displayName = "tsx";
_ye.aliases = [];
function _ye(i) {
  i.register(yY), i.register(_2), (function(e) {
    var t = e.util.clone(e.languages.typescript);
    e.languages.tsx = e.languages.extend("jsx", t), delete e.languages.tsx.parameter, delete e.languages.tsx["literal-property"];
    var n = e.languages.tsx.tag;
    n.pattern = RegExp(
      /(^|[^\w$]|(?=<\/))/.source + "(?:" + n.pattern.source + ")",
      n.pattern.flags
    ), n.lookbehind = !0;
  })(i);
}
bye.displayName = "reason";
bye.aliases = [];
function bye(i) {
  i.register(Wr), i.languages.reason = i.languages.extend("clike", {
    string: {
      pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
      greedy: !0
    },
    // 'class-name' must be matched *after* 'constructor' defined below
    "class-name": /\b[A-Z]\w*/,
    keyword: /\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,
    operator: /\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/
  }), i.languages.insertBefore("reason", "class-name", {
    char: {
      pattern: /'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,
      greedy: !0
    },
    // Negative look-ahead prevents from matching things like String.capitalize
    constructor: /\b[A-Z]\w*\b(?!\s*\.)/,
    label: {
      pattern: /\b[a-z]\w*(?=::)/,
      alias: "symbol"
    }
  }), delete i.languages.reason.function;
}
vye.displayName = "rego";
vye.aliases = [];
function vye(i) {
  i.languages.rego = {
    comment: /#.*/,
    property: {
      pattern: /(^|[^\\.])(?:"(?:\\.|[^\\"\r\n])*"|`[^`]*`|\b[a-z_]\w*\b)(?=\s*:(?!=))/i,
      lookbehind: !0,
      greedy: !0
    },
    string: {
      pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"|`[^`]*`/,
      lookbehind: !0,
      greedy: !0
    },
    keyword: /\b(?:as|default|else|import|not|null|package|set(?=\s*\()|some|with)\b/,
    boolean: /\b(?:false|true)\b/,
    function: {
      pattern: /\b[a-z_]\w*\b(?:\s*\.\s*\b[a-z_]\w*\b)*(?=\s*\()/i,
      inside: {
        namespace: /\b\w+\b(?=\s*\.)/,
        punctuation: /\./
      }
    },
    number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
    operator: /[-+*/%|&]|[<>:=]=?|!=|\b_\b/,
    punctuation: /[,;.\[\]{}()]/
  };
}
yye.displayName = "renpy";
yye.aliases = ["rpy"];
function yye(i) {
  i.languages.renpy = {
    comment: {
      pattern: /(^|[^\\])#.+/,
      lookbehind: !0
    },
    string: {
      pattern: /("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\])*\2|(?:^#?(?:(?:[0-9a-fA-F]){3}|[0-9a-fA-F]{6})$)/m,
      greedy: !0
    },
    function: /\b[a-z_]\w*(?=\()/i,
    property: /\b(?:Update|UpdateVersion|action|activate_sound|adv_nvl_transition|after_load_transition|align|alpha|alt|anchor|antialias|area|auto|background|bar_invert|bar_resizing|bar_vertical|black_color|bold|bottom_bar|bottom_gutter|bottom_margin|bottom_padding|box_reverse|box_wrap|can_update|caret|child|color|crop|default_afm_enable|default_afm_time|default_fullscreen|default_text_cps|developer|directory_name|drag_handle|drag_joined|drag_name|drag_raise|draggable|dragged|drop_shadow|drop_shadow_color|droppable|dropped|easein|easeout|edgescroll|end_game_transition|end_splash_transition|enter_replay_transition|enter_sound|enter_transition|enter_yesno_transition|executable_name|exit_replay_transition|exit_sound|exit_transition|exit_yesno_transition|fadein|fadeout|first_indent|first_spacing|fit_first|focus|focus_mask|font|foreground|game_main_transition|get_installed_packages|google_play_key|google_play_salt|ground|has_music|has_sound|has_voice|height|help|hinting|hover|hover_background|hover_color|hover_sound|hovered|hyperlink_functions|idle|idle_color|image_style|include_update|insensitive|insensitive_background|insensitive_color|inside|intra_transition|italic|justify|kerning|keyboard_focus|language|layer_clipping|layers|layout|left_bar|left_gutter|left_margin|left_padding|length|line_leading|line_overlap_split|line_spacing|linear|main_game_transition|main_menu_music|maximum|min_width|minimum|minwidth|modal|mouse|mousewheel|name|narrator_menu|newline_indent|nvl_adv_transition|offset|order_reverse|outlines|overlay_functions|pos|position|prefix|radius|range|rest_indent|right_bar|right_gutter|right_margin|right_padding|rotate|rotate_pad|ruby_style|sample_sound|save_directory|say_attribute_transition|screen_height|screen_width|scrollbars|selected_hover|selected_hover_color|selected_idle|selected_idle_color|selected_insensitive|show_side_image|show_two_window|side_spacing|side_xpos|side_ypos|size|size_group|slow_cps|slow_cps_multiplier|spacing|strikethrough|subpixel|text_align|text_style|text_xpos|text_y_fudge|text_ypos|thumb|thumb_offset|thumb_shadow|thumbnail_height|thumbnail_width|time|top_bar|top_gutter|top_margin|top_padding|translations|underline|unscrollable|update|value|version|version_name|version_tuple|vertical|width|window_hide_transition|window_icon|window_left_padding|window_show_transition|window_title|windows_icon|xadjustment|xalign|xanchor|xanchoraround|xaround|xcenter|xfill|xinitial|xmargin|xmaximum|xminimum|xoffset|xofsset|xpadding|xpos|xsize|xzoom|yadjustment|yalign|yanchor|yanchoraround|yaround|ycenter|yfill|yinitial|ymargin|ymaximum|yminimum|yoffset|ypadding|ypos|ysize|ysizexysize|yzoom|zoom|zorder)\b/,
    tag: /\b(?:bar|block|button|buttoscreenn|drag|draggroup|fixed|frame|grid|[hv]box|hotbar|hotspot|image|imagebutton|imagemap|input|key|label|menu|mm_menu_frame|mousearea|nvl|parallel|screen|self|side|tag|text|textbutton|timer|vbar|viewport|window)\b|\$/,
    keyword: /\b(?:None|add|adjustment|alignaround|allow|angle|animation|around|as|assert|behind|box_layout|break|build|cache|call|center|changed|child_size|choice|circles|class|clear|clicked|clipping|clockwise|config|contains|continue|corner1|corner2|counterclockwise|def|default|define|del|delay|disabled|disabled_text|dissolve|elif|else|event|except|exclude|exec|expression|fade|finally|for|from|function|global|gm_root|has|hide|id|if|import|in|init|is|jump|knot|lambda|left|less_rounded|mm_root|movie|music|null|on|onlayer|pass|pause|persistent|play|print|python|queue|raise|random|renpy|repeat|return|right|rounded_window|scene|scope|set|show|slow|slow_abortable|slow_done|sound|stop|store|style|style_group|substitute|suffix|theme|transform|transform_anchor|transpose|try|ui|unhovered|updater|use|voice|while|widget|widget_hover|widget_selected|widget_text|yield)\b/,
    boolean: /\b(?:[Ff]alse|[Tt]rue)\b/,
    number: /(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?)|\B\.\d+)(?:e[+-]?\d+)?j?/i,
    operator: /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:and|at|not|or|with)\b/,
    punctuation: /[{}[\];(),.:]/
  }, i.languages.rpy = i.languages.renpy;
}
Cye.displayName = "rescript";
Cye.aliases = ["res"];
function Cye(i) {
  i.languages.rescript = {
    comment: {
      pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
      greedy: !0
    },
    char: {
      pattern: /'(?:[^\r\n\\]|\\(?:.|\w+))'/,
      greedy: !0
    },
    string: {
      pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
      greedy: !0
    },
    "class-name": /\b[A-Z]\w*|@[a-z.]*|#[A-Za-z]\w*|#\d/,
    function: {
      pattern: /[a-zA-Z]\w*(?=\()|(\.)[a-z]\w*/,
      lookbehind: !0
    },
    number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
    boolean: /\b(?:false|true)\b/,
    "attr-value": /[A-Za-z]\w*(?==)/,
    constant: {
      pattern: /(\btype\s+)[a-z]\w*/,
      lookbehind: !0
    },
    tag: {
      pattern: /(<)[a-z]\w*|(?:<\/)[a-z]\w*/,
      lookbehind: !0,
      inside: {
        operator: /<|>|\//
      }
    },
    keyword: /\b(?:and|as|assert|begin|bool|class|constraint|do|done|downto|else|end|exception|external|float|for|fun|function|if|in|include|inherit|initializer|int|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|string|switch|then|to|try|type|when|while|with)\b/,
    operator: /\.{3}|:[:=]?|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/,
    punctuation: /[(){}[\],;.]/
  }, i.languages.insertBefore("rescript", "string", {
    "template-string": {
      pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
      greedy: !0,
      inside: {
        "template-punctuation": {
          pattern: /^`|`$/,
          alias: "string"
        },
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
          lookbehind: !0,
          inside: {
            "interpolation-punctuation": {
              pattern: /^\$\{|\}$/,
              alias: "tag"
            },
            rest: i.languages.rescript
          }
        },
        string: /[\s\S]+/
      }
    }
  }), i.languages.res = i.languages.rescript;
}
wye.displayName = "rest";
wye.aliases = [];
function wye(i) {
  i.languages.rest = {
    table: [
      {
        pattern: /(^[\t ]*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1[+|].+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/m,
        lookbehind: !0,
        inside: {
          punctuation: /\||(?:\+[=-]+)+\+/
        }
      },
      {
        pattern: /(^[\t ]*)=+ [ =]*=(?:(?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1=+ [ =]*=(?=(?:\r?\n|\r){2}|\s*$)/m,
        lookbehind: !0,
        inside: {
          punctuation: /[=-]+/
        }
      }
    ],
    // Directive-like patterns
    "substitution-def": {
      pattern: /(^[\t ]*\.\. )\|(?:[^|\s](?:[^|]*[^|\s])?)\| [^:]+::/m,
      lookbehind: !0,
      inside: {
        substitution: {
          pattern: /^\|(?:[^|\s]|[^|\s][^|]*[^|\s])\|/,
          alias: "attr-value",
          inside: {
            punctuation: /^\||\|$/
          }
        },
        directive: {
          pattern: /( )(?! )[^:]+::/,
          lookbehind: !0,
          alias: "function",
          inside: {
            punctuation: /::$/
          }
        }
      }
    },
    "link-target": [
      {
        pattern: /(^[\t ]*\.\. )\[[^\]]+\]/m,
        lookbehind: !0,
        alias: "string",
        inside: {
          punctuation: /^\[|\]$/
        }
      },
      {
        pattern: /(^[\t ]*\.\. )_(?:`[^`]+`|(?:[^:\\]|\\.)+):/m,
        lookbehind: !0,
        alias: "string",
        inside: {
          punctuation: /^_|:$/
        }
      }
    ],
    directive: {
      pattern: /(^[\t ]*\.\. )[^:]+::/m,
      lookbehind: !0,
      alias: "function",
      inside: {
        punctuation: /::$/
      }
    },
    comment: {
      // The two alternatives try to prevent highlighting of blank comments
      pattern: /(^[\t ]*\.\.)(?:(?: .+)?(?:(?:\r?\n|\r).+)+| .+)(?=(?:\r?\n|\r){2}|$)/m,
      lookbehind: !0
    },
    title: [
      // Overlined and underlined
      {
        pattern: /^(([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+)(?:\r?\n|\r).+(?:\r?\n|\r)\1$/m,
        inside: {
          punctuation: /^[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,
          important: /.+/
        }
      },
      // Underlined only
      {
        pattern: /(^|(?:\r?\n|\r){2}).+(?:\r?\n|\r)([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+(?=\r?\n|\r|$)/,
        lookbehind: !0,
        inside: {
          punctuation: /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,
          important: /.+/
        }
      }
    ],
    hr: {
      pattern: /((?:\r?\n|\r){2})([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2{3,}(?=(?:\r?\n|\r){2})/,
      lookbehind: !0,
      alias: "punctuation"
    },
    field: {
      pattern: /(^[\t ]*):[^:\r\n]+:(?= )/m,
      lookbehind: !0,
      alias: "attr-name"
    },
    "command-line-option": {
      pattern: /(^[\t ]*)(?:[+-][a-z\d]|(?:--|\/)[a-z\d-]+)(?:[ =](?:[a-z][\w-]*|<[^<>]+>))?(?:, (?:[+-][a-z\d]|(?:--|\/)[a-z\d-]+)(?:[ =](?:[a-z][\w-]*|<[^<>]+>))?)*(?=(?:\r?\n|\r)? {2,}\S)/im,
      lookbehind: !0,
      alias: "symbol"
    },
    "literal-block": {
      pattern: /::(?:\r?\n|\r){2}([ \t]+)(?![ \t]).+(?:(?:\r?\n|\r)\1.+)*/,
      inside: {
        "literal-block-punctuation": {
          pattern: /^::/,
          alias: "punctuation"
        }
      }
    },
    "quoted-literal-block": {
      pattern: /::(?:\r?\n|\r){2}([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]).*(?:(?:\r?\n|\r)\1.*)*/,
      inside: {
        "literal-block-punctuation": {
          pattern: /^(?:::|([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\1*)/m,
          alias: "punctuation"
        }
      }
    },
    "list-bullet": {
      pattern: /(^[\t ]*)(?:[*+\-•‣⁃]|\(?(?:\d+|[a-z]|[ivxdclm]+)\)|(?:\d+|[a-z]|[ivxdclm]+)\.)(?= )/im,
      lookbehind: !0,
      alias: "punctuation"
    },
    "doctest-block": {
      pattern: /(^[\t ]*)>>> .+(?:(?:\r?\n|\r).+)*/m,
      lookbehind: !0,
      inside: {
        punctuation: /^>>>/
      }
    },
    inline: [
      {
        pattern: /(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s)(?:(?!\2).)*\S\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m,
        lookbehind: !0,
        inside: {
          bold: {
            pattern: /(^\*\*).+(?=\*\*$)/,
            lookbehind: !0
          },
          italic: {
            pattern: /(^\*).+(?=\*$)/,
            lookbehind: !0
          },
          "inline-literal": {
            pattern: /(^``).+(?=``$)/,
            lookbehind: !0,
            alias: "symbol"
          },
          role: {
            pattern: /^:[^:]+:|:[^:]+:$/,
            alias: "function",
            inside: {
              punctuation: /^:|:$/
            }
          },
          "interpreted-text": {
            pattern: /(^`).+(?=`$)/,
            lookbehind: !0,
            alias: "attr-value"
          },
          substitution: {
            pattern: /(^\|).+(?=\|$)/,
            lookbehind: !0,
            alias: "attr-value"
          },
          punctuation: /\*\*?|``?|\|/
        }
      }
    ],
    link: [
      {
        pattern: /\[[^\[\]]+\]_(?=[\s\-.,:;!?\\\/'")\]}]|$)/,
        alias: "string",
        inside: {
          punctuation: /^\[|\]_$/
        }
      },
      {
        pattern: /(?:\b[a-z\d]+(?:[_.:+][a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,
        alias: "string",
        inside: {
          punctuation: /^_?`|`$|`?_?_$/
        }
      }
    ],
    // Line block start,
    // quote attribution,
    // explicit markup start,
    // and anonymous hyperlink target shortcut (__)
    punctuation: {
      pattern: /(^[\t ]*)(?:\|(?= |$)|(?:---?|—|\.\.|__)(?= )|\.\.$)/m,
      lookbehind: !0
    }
  };
}
Sye.displayName = "rip";
Sye.aliases = [];
function Sye(i) {
  i.languages.rip = {
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    char: {
      pattern: /\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,
      greedy: !0
    },
    string: {
      pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    regex: {
      pattern: /(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,
      lookbehind: !0,
      greedy: !0
    },
    keyword: /(?:=>|->)|\b(?:case|catch|class|else|exit|finally|if|raise|return|switch|try)\b/,
    builtin: /@|\bSystem\b/,
    boolean: /\b(?:false|true)\b/,
    date: /\b\d{4}-\d{2}-\d{2}\b/,
    time: /\b\d{2}:\d{2}:\d{2}\b/,
    datetime: /\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,
    symbol: /:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,
    number: /[+-]?\b(?:\d+\.\d+|\d+)\b/,
    punctuation: /(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,
    reference: /[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/
  };
}
Eye.displayName = "roboconf";
Eye.aliases = [];
function Eye(i) {
  i.languages.roboconf = {
    comment: /#.*/,
    keyword: {
      pattern: /(^|\s)(?:(?:external|import)\b|(?:facet|instance of)(?=[ \t]+[\w-]+[ \t]*\{))/,
      lookbehind: !0
    },
    component: {
      pattern: /[\w-]+(?=[ \t]*\{)/,
      alias: "variable"
    },
    property: /[\w.-]+(?=[ \t]*:)/,
    value: {
      pattern: /(=[ \t]*(?![ \t]))[^,;]+/,
      lookbehind: !0,
      alias: "attr-value"
    },
    optional: {
      pattern: /\(optional\)/,
      alias: "builtin"
    },
    wildcard: {
      pattern: /(\.)\*/,
      lookbehind: !0,
      alias: "operator"
    },
    punctuation: /[{},.;:=]/
  };
}
xye.displayName = "robotframework";
xye.aliases = ["robot"];
function xye(i) {
  (function(e) {
    var t = {
      pattern: /(^[ \t]*| {2}|\t)#.*/m,
      lookbehind: !0,
      greedy: !0
    }, n = {
      pattern: /((?:^|[^\\])(?:\\{2})*)[$@&%]\{(?:[^{}\r\n]|\{[^{}\r\n]*\})*\}/,
      lookbehind: !0,
      inside: {
        punctuation: /^[$@&%]\{|\}$/
      }
    };
    function r(l, c) {
      var u = {};
      u["section-header"] = {
        pattern: /^ ?\*{3}.+?\*{3}/,
        alias: "keyword"
      };
      for (var d in c)
        u[d] = c[d];
      return u.tag = {
        pattern: /([\r\n](?: {2}|\t)[ \t]*)\[[-\w]+\]/,
        lookbehind: !0,
        inside: {
          punctuation: /\[|\]/
        }
      }, u.variable = n, u.comment = t, {
        pattern: RegExp(
          /^ ?\*{3}[ \t]*<name>[ \t]*\*{3}(?:.|[\r\n](?!\*{3}))*/.source.replace(
            /<name>/g,
            function() {
              return l;
            }
          ),
          "im"
        ),
        alias: "section",
        inside: u
      };
    }
    var s = {
      pattern: /(\[Documentation\](?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,
      lookbehind: !0,
      alias: "string"
    }, o = {
      pattern: /([\r\n] ?)(?!#)(?:\S(?:[ \t]\S)*)+/,
      lookbehind: !0,
      alias: "function",
      inside: {
        variable: n
      }
    }, a = {
      pattern: /([\r\n](?: {2}|\t)[ \t]*)(?!\[|\.{3}|#)(?:\S(?:[ \t]\S)*)+/,
      lookbehind: !0,
      inside: {
        variable: n
      }
    };
    e.languages.robotframework = {
      settings: r("Settings", {
        documentation: {
          pattern: /([\r\n] ?Documentation(?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,
          lookbehind: !0,
          alias: "string"
        },
        property: {
          pattern: /([\r\n] ?)(?!\.{3}|#)(?:\S(?:[ \t]\S)*)+/,
          lookbehind: !0
        }
      }),
      variables: r("Variables"),
      "test-cases": r("Test Cases", {
        "test-name": o,
        documentation: s,
        property: a
      }),
      keywords: r("Keywords", {
        "keyword-name": o,
        documentation: s,
        property: a
      }),
      tasks: r("Tasks", {
        "task-name": o,
        documentation: s,
        property: a
      }),
      comment: t
    }, e.languages.robot = e.languages.robotframework;
  })(i);
}
Lye.displayName = "sas";
Lye.aliases = [];
function Lye(i) {
  (function(e) {
    var t = /(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))/.source, n = /\b(?:\d[\da-f]*x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i, r = {
      pattern: RegExp(t + "[bx]"),
      alias: "number"
    }, s = {
      pattern: /&[a-z_]\w*/i
    }, o = {
      pattern: /((?:^|\s|=|\())%(?:ABORT|BY|CMS|COPY|DISPLAY|DO|ELSE|END|EVAL|GLOBAL|GO|GOTO|IF|INC|INCLUDE|INDEX|INPUT|KTRIM|LENGTH|LET|LIST|LOCAL|PUT|QKTRIM|QSCAN|QSUBSTR|QSYSFUNC|QUPCASE|RETURN|RUN|SCAN|SUBSTR|SUPERQ|SYMDEL|SYMEXIST|SYMGLOBL|SYMLOCAL|SYSCALL|SYSEVALF|SYSEXEC|SYSFUNC|SYSGET|SYSRPUT|THEN|TO|TSO|UNQUOTE|UNTIL|UPCASE|WHILE|WINDOW)\b/i,
      lookbehind: !0,
      alias: "keyword"
    }, a = {
      pattern: /(^|\s)(?:proc\s+\w+|data(?!=)|quit|run)\b/i,
      alias: "keyword",
      lookbehind: !0
    }, l = [
      /\/\*[\s\S]*?\*\//,
      {
        pattern: /(^[ \t]*|;\s*)\*[^;]*;/m,
        lookbehind: !0
      }
    ], c = {
      pattern: RegExp(t),
      greedy: !0
    }, u = /[$%@.(){}\[\];,\\]/, d = {
      pattern: /%?\b\w+(?=\()/,
      alias: "keyword"
    }, h = {
      function: d,
      "arg-value": {
        pattern: /(=\s*)[A-Z\.]+/i,
        lookbehind: !0
      },
      operator: /=/,
      "macro-variable": s,
      arg: {
        pattern: /[A-Z]+/i,
        alias: "keyword"
      },
      number: n,
      "numeric-constant": r,
      punctuation: u,
      string: c
    }, g = {
      pattern: /\b(?:format|put)\b=?[\w'$.]+/i,
      inside: {
        keyword: /^(?:format|put)(?==)/i,
        equals: /=/,
        format: {
          pattern: /(?:\w|\$\d)+\.\d?/,
          alias: "number"
        }
      }
    }, m = {
      pattern: /\b(?:format|put)\s+[\w']+(?:\s+[$.\w]+)+(?=;)/i,
      inside: {
        keyword: /^(?:format|put)/i,
        format: {
          pattern: /[\w$]+\.\d?/,
          alias: "number"
        }
      }
    }, _ = {
      pattern: /((?:^|\s)=?)(?:catname|checkpoint execute_always|dm|endsas|filename|footnote|%include|libname|%list|lock|missing|options|page|resetline|%run|sasfile|skip|sysecho|title\d?)\b/i,
      lookbehind: !0,
      alias: "keyword"
    }, v = {
      pattern: /(^|\s)(?:submit(?:\s+(?:load|norun|parseonly))?|endsubmit)\b/i,
      lookbehind: !0,
      alias: "keyword"
    }, w = /aStore|accessControl|aggregation|audio|autotune|bayesianNetClassifier|bioMedImage|boolRule|builtins|cardinality|cdm|clustering|conditionalRandomFields|configuration|copula|countreg|dataDiscovery|dataPreprocess|dataSciencePilot|dataStep|decisionTree|deduplication|deepLearn|deepNeural|deepRnn|ds2|ecm|entityRes|espCluster|explainModel|factmac|fastKnn|fcmpact|fedSql|freqTab|gVarCluster|gam|gleam|graphSemiSupLearn|hiddenMarkovModel|hyperGroup|ica|image|iml|kernalPca|langModel|ldaTopic|loadStreams|mbc|mixed|mlTools|modelPublishing|network|neuralNet|nmf|nonParametricBayes|nonlinear|optNetwork|optimization|panel|pca|percentile|phreg|pls|qkb|qlim|quantreg|recommend|regression|reinforcementLearn|robustPca|ruleMining|sampling|sandwich|sccasl|search(?:Analytics)?|sentimentAnalysis|sequence|session(?:Prop)?|severity|simSystem|simple|smartData|sparkEmbeddedProcess|sparseML|spatialreg|spc|stabilityMonitoring|svDataDescription|svm|table|text(?:Filters|Frequency|Mining|Parse|Rule(?:Develop|Score)|Topic|Util)|timeData|transpose|tsInfo|tsReconcile|uniTimeSeries|varReduce/.source, E = {
      pattern: RegExp(
        /(^|\s)(?:action\s+)?(?:<act>)\.[a-z]+\b[^;]+/.source.replace(
          /<act>/g,
          function() {
            return w;
          }
        ),
        "i"
      ),
      lookbehind: !0,
      inside: {
        keyword: RegExp(
          /(?:<act>)\.[a-z]+\b/.source.replace(/<act>/g, function() {
            return w;
          }),
          "i"
        ),
        action: {
          pattern: /(?:action)/i,
          alias: "keyword"
        },
        comment: l,
        function: d,
        "arg-value": h["arg-value"],
        operator: h.operator,
        argument: h.arg,
        number: n,
        "numeric-constant": r,
        punctuation: u,
        string: c
      }
    }, L = {
      pattern: /((?:^|\s)=?)(?:after|analysis|and|array|barchart|barwidth|begingraph|by|call|cas|cbarline|cfill|class(?:lev)?|close|column|computed?|contains|continue|data(?==)|define|delete|describe|document|do\s+over|do|dol|drop|dul|else|end(?:comp|source)?|entryTitle|eval(?:uate)?|exec(?:ute)?|exit|file(?:name)?|fill(?:attrs)?|flist|fnc|function(?:list)?|global|goto|group(?:by)?|headline|headskip|histogram|if|infile|keep|keylabel|keyword|label|layout|leave|legendlabel|length|libname|loadactionset|merge|midpoints|_?null_|name|noobs|nowd|ods|options|or|otherwise|out(?:put)?|over(?:lay)?|plot|print|put|raise|ranexp|rannor|rbreak|retain|return|select|session|sessref|set|source|statgraph|sum|summarize|table|temp|terminate|then\s+do|then|title\d?|to|var|when|where|xaxisopts|y2axisopts|yaxisopts)\b/i,
      lookbehind: !0
    };
    e.languages.sas = {
      datalines: {
        pattern: /^([ \t]*)(?:cards|(?:data)?lines);[\s\S]+?^[ \t]*;/im,
        lookbehind: !0,
        alias: "string",
        inside: {
          keyword: {
            pattern: /^(?:cards|(?:data)?lines)/i
          },
          punctuation: /;/
        }
      },
      "proc-sql": {
        pattern: /(^proc\s+(?:fed)?sql(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|data|quit|run);|(?![\s\S]))/im,
        lookbehind: !0,
        inside: {
          sql: {
            pattern: RegExp(
              /^[ \t]*(?:select|alter\s+table|(?:create|describe|drop)\s+(?:index|table(?:\s+constraints)?|view)|create\s+unique\s+index|insert\s+into|update)(?:<str>|[^;"'])+;/.source.replace(
                /<str>/g,
                function() {
                  return t;
                }
              ),
              "im"
            ),
            alias: "language-sql",
            inside: e.languages.sql
          },
          "global-statements": _,
          "sql-statements": {
            pattern: /(^|\s)(?:disconnect\s+from|begin|commit|exec(?:ute)?|reset|rollback|validate)\b/i,
            lookbehind: !0,
            alias: "keyword"
          },
          number: n,
          "numeric-constant": r,
          punctuation: u,
          string: c
        }
      },
      "proc-groovy": {
        pattern: /(^proc\s+groovy(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|data|quit|run);|(?![\s\S]))/im,
        lookbehind: !0,
        inside: {
          comment: l,
          groovy: {
            pattern: RegExp(
              /(^[ \t]*submit(?:\s+(?:load|norun|parseonly))?)(?:<str>|[^"'])+?(?=endsubmit;)/.source.replace(
                /<str>/g,
                function() {
                  return t;
                }
              ),
              "im"
            ),
            lookbehind: !0,
            alias: "language-groovy",
            inside: e.languages.groovy
          },
          keyword: L,
          "submit-statement": v,
          "global-statements": _,
          number: n,
          "numeric-constant": r,
          punctuation: u,
          string: c
        }
      },
      "proc-lua": {
        pattern: /(^proc\s+lua(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|data|quit|run);|(?![\s\S]))/im,
        lookbehind: !0,
        inside: {
          comment: l,
          lua: {
            pattern: RegExp(
              /(^[ \t]*submit(?:\s+(?:load|norun|parseonly))?)(?:<str>|[^"'])+?(?=endsubmit;)/.source.replace(
                /<str>/g,
                function() {
                  return t;
                }
              ),
              "im"
            ),
            lookbehind: !0,
            alias: "language-lua",
            inside: e.languages.lua
          },
          keyword: L,
          "submit-statement": v,
          "global-statements": _,
          number: n,
          "numeric-constant": r,
          punctuation: u,
          string: c
        }
      },
      "proc-cas": {
        pattern: /(^proc\s+cas(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|data);|(?![\s\S]))/im,
        lookbehind: !0,
        inside: {
          comment: l,
          "statement-var": {
            pattern: /((?:^|\s)=?)saveresult\s[^;]+/im,
            lookbehind: !0,
            inside: {
              statement: {
                pattern: /^saveresult\s+\S+/i,
                inside: {
                  keyword: /^(?:saveresult)/i
                }
              },
              rest: h
            }
          },
          "cas-actions": E,
          statement: {
            pattern: /((?:^|\s)=?)(?:default|(?:un)?set|on|output|upload)[^;]+/im,
            lookbehind: !0,
            inside: h
          },
          step: a,
          keyword: L,
          function: d,
          format: g,
          altformat: m,
          "global-statements": _,
          number: n,
          "numeric-constant": r,
          punctuation: u,
          string: c
        }
      },
      "proc-args": {
        pattern: RegExp(
          /(^proc\s+\w+\s+)(?!\s)(?:[^;"']|<str>)+;/.source.replace(
            /<str>/g,
            function() {
              return t;
            }
          ),
          "im"
        ),
        lookbehind: !0,
        inside: h
      },
      /*Special keywords within macros*/
      "macro-keyword": o,
      "macro-variable": s,
      "macro-string-functions": {
        pattern: /((?:^|\s|=))%(?:BQUOTE|NRBQUOTE|NRQUOTE|NRSTR|QUOTE|STR)\(.*?(?:[^%]\))/i,
        lookbehind: !0,
        inside: {
          function: {
            pattern: /%(?:BQUOTE|NRBQUOTE|NRQUOTE|NRSTR|QUOTE|STR)/i,
            alias: "keyword"
          },
          "macro-keyword": o,
          "macro-variable": s,
          "escaped-char": {
            pattern: /%['"()<>=¬^~;,#]/
          },
          punctuation: u
        }
      },
      "macro-declaration": {
        pattern: /^%macro[^;]+(?=;)/im,
        inside: {
          keyword: /%macro/i
        }
      },
      "macro-end": {
        pattern: /^%mend[^;]+(?=;)/im,
        inside: {
          keyword: /%mend/i
        }
      },
      /*%_zscore(headcir, _lhc, _mhc, _shc, headcz, headcpct, _Fheadcz); */
      macro: {
        pattern: /%_\w+(?=\()/,
        alias: "keyword"
      },
      input: {
        pattern: /\binput\s[-\w\s/*.$&]+;/i,
        inside: {
          input: {
            alias: "keyword",
            pattern: /^input/i
          },
          comment: l,
          number: n,
          "numeric-constant": r
        }
      },
      "options-args": {
        pattern: /(^options)[-'"|/\\<>*+=:()\w\s]*(?=;)/im,
        lookbehind: !0,
        inside: h
      },
      "cas-actions": E,
      comment: l,
      function: d,
      format: g,
      altformat: m,
      "numeric-constant": r,
      datetime: {
        // '1jan2013'd, '9:25:19pm't, '18jan2003:9:27:05am'dt
        pattern: RegExp(t + "(?:dt?|t)"),
        alias: "number"
      },
      string: c,
      step: a,
      keyword: L,
      // In SAS Studio syntax highlighting, these operators are styled like keywords
      "operator-keyword": {
        pattern: /\b(?:eq|ge|gt|in|le|lt|ne|not)\b/i,
        alias: "operator"
      },
      // Decimal (1.2e23), hexadecimal (0c1x)
      number: n,
      operator: /\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?/,
      punctuation: u
    };
  })(i);
}
Tye.displayName = "shell-session";
Tye.aliases = ["sh-session", "shellsession"];
function Tye(i) {
  i.register(t6), (function(e) {
    var t = [
      // normal string
      /"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/.source,
      /'[^']*'/.source,
      /\$'(?:[^'\\]|\\[\s\S])*'/.source,
      // here doc
      // 2 capturing groups
      /<<-?\s*(["']?)(\w+)\1\s[\s\S]*?[\r\n]\2/.source
    ].join("|");
    e.languages["shell-session"] = {
      command: {
        pattern: RegExp(
          // user info
          /^/.source + "(?:" + // <user> ":" ( <path> )?
          (/[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+(?::[^\0-\x1F$#%*?"<>:;|]+)?/.source + "|" + // <path>
          // Since the path pattern is quite general, we will require it to start with a special character to
          // prevent false positives.
          /[/~.][^\0-\x1F$#%*?"<>@:;|]*/.source) + ")?" + // shell symbol
          /[$#%](?=\s)/.source + // bash command
          /(?:[^\\\r\n \t'"<$]|[ \t](?:(?!#)|#.*$)|\\(?:[^\r]|\r\n?)|\$(?!')|<(?!<)|<<str>>)+/.source.replace(
            /<<str>>/g,
            function() {
              return t;
            }
          ),
          "m"
        ),
        greedy: !0,
        inside: {
          info: {
            // foo@bar:~/files$ exit
            // foo@bar$ exit
            // ~/files$ exit
            pattern: /^[^#$%]+/,
            alias: "punctuation",
            inside: {
              user: /^[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+/,
              punctuation: /:/,
              path: /[\s\S]+/
            }
          },
          bash: {
            pattern: /(^[$#%]\s*)\S[\s\S]*/,
            lookbehind: !0,
            alias: "language-bash",
            inside: e.languages.bash
          },
          "shell-symbol": {
            pattern: /^[$#%]/,
            alias: "important"
          }
        }
      },
      output: /.(?:.*(?:[\r\n]|.$))*/
    }, e.languages["sh-session"] = e.languages.shellsession = e.languages["shell-session"];
  })(i);
}
kye.displayName = "smali";
kye.aliases = [];
function kye(i) {
  i.languages.smali = {
    comment: /#.*/,
    string: {
      pattern: /"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\(?:.|u[\da-fA-F]{4}))'/,
      greedy: !0
    },
    "class-name": {
      pattern: /(^|[^L])L(?:(?:\w+|`[^`\r\n]*`)\/)*(?:[\w$]+|`[^`\r\n]*`)(?=\s*;)/,
      lookbehind: !0,
      inside: {
        "class-name": {
          pattern: /(^L|\/)(?:[\w$]+|`[^`\r\n]*`)$/,
          lookbehind: !0
        },
        namespace: {
          pattern: /^(L)(?:(?:\w+|`[^`\r\n]*`)\/)+/,
          lookbehind: !0,
          inside: {
            punctuation: /\//
          }
        },
        builtin: /^L/
      }
    },
    builtin: [
      {
        // Reference: https://github.com/JesusFreke/smali/wiki/TypesMethodsAndFields#types
        pattern: /([();\[])[BCDFIJSVZ]+/,
        lookbehind: !0
      },
      {
        // e.g. .field mWifiOnUid:I
        pattern: /([\w$>]:)[BCDFIJSVZ]/,
        lookbehind: !0
      }
    ],
    keyword: [
      {
        pattern: /(\.end\s+)[\w-]+/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^\w.-])\.(?!\d)[\w-]+/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^\w.-])(?:abstract|annotation|bridge|constructor|enum|final|interface|private|protected|public|runtime|static|synthetic|system|transient)(?![\w.-])/,
        lookbehind: !0
      }
    ],
    function: {
      pattern: /(^|[^\w.-])(?:\w+|<[\w$-]+>)(?=\()/,
      lookbehind: !0
    },
    field: {
      pattern: /[\w$]+(?=:)/,
      alias: "variable"
    },
    register: {
      pattern: /(^|[^\w.-])[vp]\d(?![\w.-])/,
      lookbehind: !0,
      alias: "variable"
    },
    boolean: {
      pattern: /(^|[^\w.-])(?:false|true)(?![\w.-])/,
      lookbehind: !0
    },
    number: {
      pattern: /(^|[^/\w.-])-?(?:NAN|INFINITY|0x(?:[\dA-F]+(?:\.[\dA-F]*)?|\.[\dA-F]+)(?:p[+-]?[\dA-F]+)?|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)[dflst]?(?![\w.-])/i,
      lookbehind: !0
    },
    label: {
      pattern: /(:)\w+/,
      lookbehind: !0,
      alias: "property"
    },
    operator: /->|\.\.|[\[=]/,
    punctuation: /[{}(),;:]/
  };
}
Dye.displayName = "smalltalk";
Dye.aliases = [];
function Dye(i) {
  i.languages.smalltalk = {
    comment: {
      pattern: /"(?:""|[^"])*"/,
      greedy: !0
    },
    char: {
      pattern: /\$./,
      greedy: !0
    },
    string: {
      pattern: /'(?:''|[^'])*'/,
      greedy: !0
    },
    symbol: /#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,
    "block-arguments": {
      pattern: /(\[\s*):[^\[|]*\|/,
      lookbehind: !0,
      inside: {
        variable: /:[\da-z]+/i,
        punctuation: /\|/
      }
    },
    "temporary-variables": {
      pattern: /\|[^|]+\|/,
      inside: {
        variable: /[\da-z]+/i,
        punctuation: /\|/
      }
    },
    keyword: /\b(?:new|nil|self|super)\b/,
    boolean: /\b(?:false|true)\b/,
    number: [
      /\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/,
      /\b\d+(?:\.\d+)?(?:e-?\d+)?/
    ],
    operator: /[<=]=?|:=|~[~=]|\/\/?|\\\\|>[>=]?|[!^+\-*&|,@]/,
    punctuation: /[.;:?\[\](){}]/
  };
}
Iye.displayName = "smarty";
Iye.aliases = [];
function Iye(i) {
  i.register(bu), (function(e) {
    e.languages.smarty = {
      comment: {
        pattern: /^\{\*[\s\S]*?\*\}/,
        greedy: !0
      },
      "embedded-php": {
        pattern: /^\{php\}[\s\S]*?\{\/php\}/,
        greedy: !0,
        inside: {
          smarty: {
            pattern: /^\{php\}|\{\/php\}$/,
            inside: null
            // see below
          },
          php: {
            pattern: /[\s\S]+/,
            alias: "language-php",
            inside: e.languages.php
          }
        }
      },
      string: [
        {
          pattern: /"(?:\\.|[^"\\\r\n])*"/,
          greedy: !0,
          inside: {
            interpolation: {
              pattern: /\{[^{}]*\}|`[^`]*`/,
              inside: {
                "interpolation-punctuation": {
                  pattern: /^[{`]|[`}]$/,
                  alias: "punctuation"
                },
                expression: {
                  pattern: /[\s\S]+/,
                  inside: null
                  // see below
                }
              }
            },
            variable: /\$\w+/
          }
        },
        {
          pattern: /'(?:\\.|[^'\\\r\n])*'/,
          greedy: !0
        }
      ],
      keyword: {
        pattern: /(^\{\/?)[a-z_]\w*\b(?!\()/i,
        lookbehind: !0,
        greedy: !0
      },
      delimiter: {
        pattern: /^\{\/?|\}$/,
        greedy: !0,
        alias: "punctuation"
      },
      number: /\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,
      variable: [
        /\$(?!\d)\w+/,
        /#(?!\d)\w+#/,
        {
          pattern: /(\.|->|\w\s*=)(?!\d)\w+\b(?!\()/,
          lookbehind: !0
        },
        {
          pattern: /(\[)(?!\d)\w+(?=\])/,
          lookbehind: !0
        }
      ],
      function: {
        pattern: /(\|\s*)@?[a-z_]\w*|\b[a-z_]\w*(?=\()/i,
        lookbehind: !0
      },
      "attr-name": /\b[a-z_]\w*(?=\s*=)/i,
      boolean: /\b(?:false|no|off|on|true|yes)\b/,
      punctuation: /[\[\](){}.,:`]|->/,
      operator: [
        /[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,
        /\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,
        /\b(?:and|eq|gt?e|gt|lt?e|lt|mod|neq?|not|or)\b/
      ]
    }, e.languages.smarty["embedded-php"].inside.smarty.inside = e.languages.smarty, e.languages.smarty.string[0].inside.interpolation.inside.expression.inside = e.languages.smarty;
    var t = /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/, n = RegExp(
      // comments
      /\{\*[\s\S]*?\*\}/.source + "|" + // php tags
      /\{php\}[\s\S]*?\{\/php\}/.source + "|" + // smarty blocks
      /\{(?:[^{}"']|<str>|\{(?:[^{}"']|<str>|\{(?:[^{}"']|<str>)*\})*\})*\}/.source.replace(
        /<str>/g,
        function() {
          return t.source;
        }
      ),
      "g"
    );
    e.hooks.add("before-tokenize", function(r) {
      var s = "{literal}", o = "{/literal}", a = !1;
      e.languages["markup-templating"].buildPlaceholders(
        r,
        "smarty",
        n,
        function(l) {
          return l === o && (a = !1), a ? !1 : (l === s && (a = !0), !0);
        }
      );
    }), e.hooks.add("after-tokenize", function(r) {
      e.languages["markup-templating"].tokenizePlaceholders(r, "smarty");
    });
  })(i);
}
Nye.displayName = "sml";
Nye.aliases = ["smlnj"];
function Nye(i) {
  (function(e) {
    var t = /\b(?:abstype|and|andalso|as|case|datatype|do|else|end|eqtype|exception|fn|fun|functor|handle|if|in|include|infix|infixr|let|local|nonfix|of|op|open|orelse|raise|rec|sharing|sig|signature|struct|structure|then|type|val|where|while|with|withtype)\b/i;
    e.languages.sml = {
      // allow one level of nesting
      comment: /\(\*(?:[^*(]|\*(?!\))|\((?!\*)|\(\*(?:[^*(]|\*(?!\))|\((?!\*))*\*\))*\*\)/,
      string: {
        pattern: /#?"(?:[^"\\]|\\.)*"/,
        greedy: !0
      },
      "class-name": [
        {
          // This is only an approximation since the real grammar is context-free
          //
          // Why the main loop so complex?
          // The main loop is approximately the same as /(?:\s*(?:[*,]|->)\s*<TERMINAL>)*/ which is, obviously, a lot
          // simpler. The difference is that if a comma is the last iteration of the loop, then the terminal must be
          // followed by a long identifier.
          pattern: RegExp(
            /((?:^|[^:]):\s*)<TERMINAL>(?:\s*(?:(?:\*|->)\s*<TERMINAL>|,\s*<TERMINAL>(?:(?=<NOT-LAST>)|(?!<NOT-LAST>)\s+<LONG-ID>)))*/.source.replace(/<NOT-LAST>/g, function() {
              return /\s*(?:[*,]|->)/.source;
            }).replace(/<TERMINAL>/g, function() {
              return /(?:'[\w']*|<LONG-ID>|\((?:[^()]|\([^()]*\))*\)|\{(?:[^{}]|\{[^{}]*\})*\})(?:\s+<LONG-ID>)*/.source;
            }).replace(/<LONG-ID>/g, function() {
              return /(?!<KEYWORD>)[a-z\d_][\w'.]*/.source;
            }).replace(/<KEYWORD>/g, function() {
              return t.source;
            }),
            "i"
          ),
          lookbehind: !0,
          greedy: !0,
          inside: null
          // see below
        },
        {
          pattern: /((?:^|[^\w'])(?:datatype|exception|functor|signature|structure|type)\s+)[a-z_][\w'.]*/i,
          lookbehind: !0
        }
      ],
      function: {
        pattern: /((?:^|[^\w'])fun\s+)[a-z_][\w'.]*/i,
        lookbehind: !0
      },
      keyword: t,
      variable: {
        pattern: /(^|[^\w'])'[\w']*/,
        lookbehind: !0
      },
      number: /~?\b(?:\d+(?:\.\d+)?(?:e~?\d+)?|0x[\da-f]+)\b/i,
      word: {
        pattern: /\b0w(?:\d+|x[\da-f]+)\b/i,
        alias: "constant"
      },
      boolean: /\b(?:false|true)\b/i,
      operator: /\.\.\.|:[>=:]|=>?|->|[<>]=?|[!+\-*/^#|@~]/,
      punctuation: /[(){}\[\].:,;]/
    }, e.languages.sml["class-name"][0].inside = e.languages.sml, e.languages.smlnj = e.languages.sml;
  })(i);
}
Rye.displayName = "solidity";
Rye.aliases = ["sol"];
function Rye(i) {
  i.register(Wr), i.languages.solidity = i.languages.extend("clike", {
    "class-name": {
      pattern: /(\b(?:contract|enum|interface|library|new|struct|using)\s+)(?!\d)[\w$]+/,
      lookbehind: !0
    },
    keyword: /\b(?:_|anonymous|as|assembly|assert|break|calldata|case|constant|constructor|continue|contract|default|delete|do|else|emit|enum|event|external|for|from|function|if|import|indexed|inherited|interface|internal|is|let|library|mapping|memory|modifier|new|payable|pragma|private|public|pure|require|returns?|revert|selfdestruct|solidity|storage|struct|suicide|switch|this|throw|using|var|view|while)\b/,
    operator: /=>|->|:=|=:|\*\*|\+\+|--|\|\||&&|<<=?|>>=?|[-+*/%^&|<>!=]=?|[~?]/
  }), i.languages.insertBefore("solidity", "keyword", {
    builtin: /\b(?:address|bool|byte|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?|string|bytes(?:[1-9]|[12]\d|3[0-2])?)\b/
  }), i.languages.insertBefore("solidity", "number", {
    version: {
      pattern: /([<>]=?|\^)\d+\.\d+\.\d+\b/,
      lookbehind: !0,
      alias: "number"
    }
  }), i.languages.sol = i.languages.solidity;
}
Aye.displayName = "solution-file";
Aye.aliases = ["sln"];
function Aye(i) {
  (function(e) {
    var t = {
      // https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
      pattern: /\{[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}\}/i,
      alias: "constant",
      inside: {
        punctuation: /[{}]/
      }
    };
    e.languages["solution-file"] = {
      comment: {
        pattern: /#.*/,
        greedy: !0
      },
      string: {
        pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
        greedy: !0,
        inside: {
          guid: t
        }
      },
      object: {
        // Foo
        //   Bar("abs") = 9
        //   EndBar
        //   Prop = TRUE
        // EndFoo
        pattern: /^([ \t]*)(?:([A-Z]\w*)\b(?=.*(?:\r\n?|\n)(?:\1[ \t].*(?:\r\n?|\n))*\1End\2(?=[ \t]*$))|End[A-Z]\w*(?=[ \t]*$))/m,
        lookbehind: !0,
        greedy: !0,
        alias: "keyword"
      },
      property: {
        pattern: /^([ \t]*)(?!\s)[^\r\n"#=()]*[^\s"#=()](?=\s*=)/m,
        lookbehind: !0,
        inside: {
          guid: t
        }
      },
      guid: t,
      number: /\b\d+(?:\.\d+)*\b/,
      boolean: /\b(?:FALSE|TRUE)\b/,
      operator: /=/,
      punctuation: /[(),]/
    }, e.languages.sln = e.languages["solution-file"];
  })(i);
}
Oye.displayName = "soy";
Oye.aliases = [];
function Oye(i) {
  i.register(bu), (function(e) {
    var t = /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, n = /\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-F]+\b/;
    e.languages.soy = {
      comment: [
        /\/\*[\s\S]*?\*\//,
        {
          pattern: /(\s)\/\/.*/,
          lookbehind: !0,
          greedy: !0
        }
      ],
      "command-arg": {
        pattern: /(\{+\/?\s*(?:alias|call|delcall|delpackage|deltemplate|namespace|template)\s+)\.?[\w.]+/,
        lookbehind: !0,
        alias: "string",
        inside: {
          punctuation: /\./
        }
      },
      parameter: {
        pattern: /(\{+\/?\s*@?param\??\s+)\.?[\w.]+/,
        lookbehind: !0,
        alias: "variable"
      },
      keyword: [
        {
          pattern: /(\{+\/?[^\S\r\n]*)(?:\\[nrt]|alias|call|case|css|default|delcall|delpackage|deltemplate|else(?:if)?|fallbackmsg|for(?:each)?|if(?:empty)?|lb|let|literal|msg|namespace|nil|@?param\??|rb|sp|switch|template|xid)/,
          lookbehind: !0
        },
        /\b(?:any|as|attributes|bool|css|float|html|in|int|js|list|map|null|number|string|uri)\b/
      ],
      delimiter: {
        pattern: /^\{+\/?|\/?\}+$/,
        alias: "punctuation"
      },
      property: /\w+(?==)/,
      variable: {
        pattern: /\$[^\W\d]\w*(?:\??(?:\.\w+|\[[^\]]+\]))*/,
        inside: {
          string: {
            pattern: t,
            greedy: !0
          },
          number: n,
          punctuation: /[\[\].?]/
        }
      },
      string: {
        pattern: t,
        greedy: !0
      },
      function: [
        /\w+(?=\()/,
        {
          pattern: /(\|[^\S\r\n]*)\w+/,
          lookbehind: !0
        }
      ],
      boolean: /\b(?:false|true)\b/,
      number: n,
      operator: /\?:?|<=?|>=?|==?|!=|[+*/%-]|\b(?:and|not|or)\b/,
      punctuation: /[{}()\[\]|.,:]/
    }, e.hooks.add("before-tokenize", function(r) {
      var s = /\{\{.+?\}\}|\{.+?\}|\s\/\/.*|\/\*[\s\S]*?\*\//g, o = "{literal}", a = "{/literal}", l = !1;
      e.languages["markup-templating"].buildPlaceholders(
        r,
        "soy",
        s,
        function(c) {
          return c === a && (l = !1), l ? !1 : (c === o && (l = !0), !0);
        }
      );
    }), e.hooks.add("after-tokenize", function(r) {
      e.languages["markup-templating"].tokenizePlaceholders(r, "soy");
    });
  })(i);
}
CY.displayName = "turtle";
CY.aliases = ["trig"];
function CY(i) {
  i.languages.turtle = {
    comment: {
      pattern: /#.*/,
      greedy: !0
    },
    "multiline-string": {
      pattern: /"""(?:(?:""?)?(?:[^"\\]|\\.))*"""|'''(?:(?:''?)?(?:[^'\\]|\\.))*'''/,
      greedy: !0,
      alias: "string",
      inside: {
        comment: /#.*/
      }
    },
    string: {
      pattern: /"(?:[^\\"\r\n]|\\.)*"|'(?:[^\\'\r\n]|\\.)*'/,
      greedy: !0
    },
    url: {
      pattern: /<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-fA-F]{4}|U[\da-fA-F]{8}))*>/,
      greedy: !0,
      inside: {
        punctuation: /[<>]/
      }
    },
    function: {
      pattern: /(?:(?![-.\d\xB7])[-.\w\xB7\xC0-\uFFFD]+)?:(?:(?![-.])(?:[-.:\w\xC0-\uFFFD]|%[\da-f]{2}|\\.)+)?/i,
      inside: {
        "local-name": {
          pattern: /([^:]*:)[\s\S]+/,
          lookbehind: !0
        },
        prefix: {
          pattern: /[\s\S]+/,
          inside: {
            punctuation: /:/
          }
        }
      }
    },
    number: /[+-]?\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,
    punctuation: /[{}.,;()[\]]|\^\^/,
    boolean: /\b(?:false|true)\b/,
    keyword: [/(?:\ba|@prefix|@base)\b|=/, /\b(?:base|graph|prefix)\b/i],
    tag: {
      pattern: /@[a-z]+(?:-[a-z\d]+)*/i,
      inside: {
        punctuation: /@/
      }
    }
  }, i.languages.trig = i.languages.turtle;
}
Mye.displayName = "sparql";
Mye.aliases = ["rq"];
function Mye(i) {
  i.register(CY), i.languages.sparql = i.languages.extend("turtle", {
    boolean: /\b(?:false|true)\b/i,
    variable: {
      pattern: /[?$]\w+/,
      greedy: !0
    }
  }), i.languages.insertBefore("sparql", "punctuation", {
    keyword: [
      /\b(?:A|ADD|ALL|AS|ASC|ASK|BNODE|BY|CLEAR|CONSTRUCT|COPY|CREATE|DATA|DEFAULT|DELETE|DESC|DESCRIBE|DISTINCT|DROP|EXISTS|FILTER|FROM|GROUP|HAVING|INSERT|INTO|LIMIT|LOAD|MINUS|MOVE|NAMED|NOT|NOW|OFFSET|OPTIONAL|ORDER|RAND|REDUCED|SELECT|SEPARATOR|SERVICE|SILENT|STRUUID|UNION|USING|UUID|VALUES|WHERE)\b/i,
      /\b(?:ABS|AVG|BIND|BOUND|CEIL|COALESCE|CONCAT|CONTAINS|COUNT|DATATYPE|DAY|ENCODE_FOR_URI|FLOOR|GROUP_CONCAT|HOURS|IF|IRI|isBLANK|isIRI|isLITERAL|isNUMERIC|isURI|LANG|LANGMATCHES|LCASE|MAX|MD5|MIN|MINUTES|MONTH|REGEX|REPLACE|ROUND|sameTerm|SAMPLE|SECONDS|SHA1|SHA256|SHA384|SHA512|STR|STRAFTER|STRBEFORE|STRDT|STRENDS|STRLANG|STRLEN|STRSTARTS|SUBSTR|SUM|TIMEZONE|TZ|UCASE|URI|YEAR)\b(?=\s*\()/i,
      /\b(?:BASE|GRAPH|PREFIX)\b/i
    ]
  }), i.languages.rq = i.languages.sparql;
}
Pye.displayName = "splunk-spl";
Pye.aliases = [];
function Pye(i) {
  i.languages["splunk-spl"] = {
    comment: /`comment\("(?:\\.|[^\\"])*"\)`/,
    string: {
      pattern: /"(?:\\.|[^\\"])*"/,
      greedy: !0
    },
    // https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/ListOfSearchCommands
    keyword: /\b(?:abstract|accum|addcoltotals|addinfo|addtotals|analyzefields|anomalies|anomalousvalue|anomalydetection|append|appendcols|appendcsv|appendlookup|appendpipe|arules|associate|audit|autoregress|bin|bucket|bucketdir|chart|cluster|cofilter|collect|concurrency|contingency|convert|correlate|datamodel|dbinspect|dedup|delete|delta|diff|erex|eval|eventcount|eventstats|extract|fieldformat|fields|fieldsummary|filldown|fillnull|findtypes|folderize|foreach|format|from|gauge|gentimes|geom|geomfilter|geostats|head|highlight|history|iconify|input|inputcsv|inputlookup|iplocation|join|kmeans|kv|kvform|loadjob|localize|localop|lookup|makecontinuous|makemv|makeresults|map|mcollect|metadata|metasearch|meventcollect|mstats|multikv|multisearch|mvcombine|mvexpand|nomv|outlier|outputcsv|outputlookup|outputtext|overlap|pivot|predict|rangemap|rare|regex|relevancy|reltime|rename|replace|rest|return|reverse|rex|rtorder|run|savedsearch|script|scrub|search|searchtxn|selfjoin|sendemail|set|setfields|sichart|sirare|sistats|sitimechart|sitop|sort|spath|stats|strcat|streamstats|table|tags|tail|timechart|timewrap|top|transaction|transpose|trendline|tscollect|tstats|typeahead|typelearner|typer|union|uniq|untable|where|x11|xmlkv|xmlunescape|xpath|xyseries)\b/i,
    "operator-word": {
      pattern: /\b(?:and|as|by|not|or|xor)\b/i,
      alias: "operator"
    },
    function: /\b\w+(?=\s*\()/,
    property: /\b\w+(?=\s*=(?!=))/,
    date: {
      // MM/DD/YYYY(:HH:MM:SS)?
      pattern: /\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/,
      alias: "number"
    },
    number: /\b\d+(?:\.\d+)?\b/,
    boolean: /\b(?:f|false|t|true)\b/i,
    operator: /[<>=]=?|[-+*/%|]/,
    punctuation: /[()[\],]/
  };
}
Fye.displayName = "sqf";
Fye.aliases = [];
function Fye(i) {
  i.register(Wr), i.languages.sqf = i.languages.extend("clike", {
    string: {
      pattern: /"(?:(?:"")?[^"])*"(?!")|'(?:[^'])*'/,
      greedy: !0
    },
    keyword: /\b(?:breakOut|breakTo|call|case|catch|default|do|echo|else|execFSM|execVM|exitWith|for|forEach|forEachMember|forEachMemberAgent|forEachMemberTeam|from|goto|if|nil|preprocessFile|preprocessFileLineNumbers|private|scopeName|spawn|step|switch|then|throw|to|try|while|with)\b/i,
    boolean: /\b(?:false|true)\b/i,
    function: /\b(?:abs|accTime|acos|action|actionIDs|actionKeys|actionKeysImages|actionKeysNames|actionKeysNamesArray|actionName|actionParams|activateAddons|activatedAddons|activateKey|add3DENConnection|add3DENEventHandler|add3DENLayer|addAction|addBackpack|addBackpackCargo|addBackpackCargoGlobal|addBackpackGlobal|addCamShake|addCuratorAddons|addCuratorCameraArea|addCuratorEditableObjects|addCuratorEditingArea|addCuratorPoints|addEditorObject|addEventHandler|addForce|addForceGeneratorRTD|addGoggles|addGroupIcon|addHandgunItem|addHeadgear|addItem|addItemCargo|addItemCargoGlobal|addItemPool|addItemToBackpack|addItemToUniform|addItemToVest|addLiveStats|addMagazine|addMagazineAmmoCargo|addMagazineCargo|addMagazineCargoGlobal|addMagazineGlobal|addMagazinePool|addMagazines|addMagazineTurret|addMenu|addMenuItem|addMissionEventHandler|addMPEventHandler|addMusicEventHandler|addOwnedMine|addPlayerScores|addPrimaryWeaponItem|addPublicVariableEventHandler|addRating|addResources|addScore|addScoreSide|addSecondaryWeaponItem|addSwitchableUnit|addTeamMember|addToRemainsCollector|addTorque|addUniform|addVehicle|addVest|addWaypoint|addWeapon|addWeaponCargo|addWeaponCargoGlobal|addWeaponGlobal|addWeaponItem|addWeaponPool|addWeaponTurret|admin|agent|agents|AGLToASL|aimedAtTarget|aimPos|airDensityCurveRTD|airDensityRTD|airplaneThrottle|airportSide|AISFinishHeal|alive|all3DENEntities|allAirports|allControls|allCurators|allCutLayers|allDead|allDeadMen|allDisplays|allGroups|allMapMarkers|allMines|allMissionObjects|allow3DMode|allowCrewInImmobile|allowCuratorLogicIgnoreAreas|allowDamage|allowDammage|allowFileOperations|allowFleeing|allowGetIn|allowSprint|allPlayers|allSimpleObjects|allSites|allTurrets|allUnits|allUnitsUAV|allVariables|ammo|ammoOnPylon|animate|animateBay|animateDoor|animatePylon|animateSource|animationNames|animationPhase|animationSourcePhase|animationState|append|apply|armoryPoints|arrayIntersect|asin|ASLToAGL|ASLToATL|assert|assignAsCargo|assignAsCargoIndex|assignAsCommander|assignAsDriver|assignAsGunner|assignAsTurret|assignCurator|assignedCargo|assignedCommander|assignedDriver|assignedGunner|assignedItems|assignedTarget|assignedTeam|assignedVehicle|assignedVehicleRole|assignItem|assignTeam|assignToAirport|atan|atan2|atg|ATLToASL|attachedObject|attachedObjects|attachedTo|attachObject|attachTo|attackEnabled|backpack|backpackCargo|backpackContainer|backpackItems|backpackMagazines|backpackSpaceFor|behaviour|benchmark|binocular|blufor|boundingBox|boundingBoxReal|boundingCenter|briefingName|buildingExit|buildingPos|buldozer_EnableRoadDiag|buldozer_IsEnabledRoadDiag|buldozer_LoadNewRoads|buldozer_reloadOperMap|buttonAction|buttonSetAction|cadetMode|callExtension|camCommand|camCommit|camCommitPrepared|camCommitted|camConstuctionSetParams|camCreate|camDestroy|cameraEffect|cameraEffectEnableHUD|cameraInterest|cameraOn|cameraView|campaignConfigFile|camPreload|camPreloaded|camPrepareBank|camPrepareDir|camPrepareDive|camPrepareFocus|camPrepareFov|camPrepareFovRange|camPreparePos|camPrepareRelPos|camPrepareTarget|camSetBank|camSetDir|camSetDive|camSetFocus|camSetFov|camSetFovRange|camSetPos|camSetRelPos|camSetTarget|camTarget|camUseNVG|canAdd|canAddItemToBackpack|canAddItemToUniform|canAddItemToVest|cancelSimpleTaskDestination|canFire|canMove|canSlingLoad|canStand|canSuspend|canTriggerDynamicSimulation|canUnloadInCombat|canVehicleCargo|captive|captiveNum|cbChecked|cbSetChecked|ceil|channelEnabled|cheatsEnabled|checkAIFeature|checkVisibility|civilian|className|clear3DENAttribute|clear3DENInventory|clearAllItemsFromBackpack|clearBackpackCargo|clearBackpackCargoGlobal|clearForcesRTD|clearGroupIcons|clearItemCargo|clearItemCargoGlobal|clearItemPool|clearMagazineCargo|clearMagazineCargoGlobal|clearMagazinePool|clearOverlay|clearRadio|clearVehicleInit|clearWeaponCargo|clearWeaponCargoGlobal|clearWeaponPool|clientOwner|closeDialog|closeDisplay|closeOverlay|collapseObjectTree|collect3DENHistory|collectiveRTD|combatMode|commandArtilleryFire|commandChat|commander|commandFire|commandFollow|commandFSM|commandGetOut|commandingMenu|commandMove|commandRadio|commandStop|commandSuppressiveFire|commandTarget|commandWatch|comment|commitOverlay|compile|compileFinal|completedFSM|composeText|configClasses|configFile|configHierarchy|configName|configNull|configProperties|configSourceAddonList|configSourceMod|configSourceModList|confirmSensorTarget|connectTerminalToUAV|controlNull|controlsGroupCtrl|copyFromClipboard|copyToClipboard|copyWaypoints|cos|count|countEnemy|countFriendly|countSide|countType|countUnknown|create3DENComposition|create3DENEntity|createAgent|createCenter|createDialog|createDiaryLink|createDiaryRecord|createDiarySubject|createDisplay|createGearDialog|createGroup|createGuardedPoint|createLocation|createMarker|createMarkerLocal|createMenu|createMine|createMissionDisplay|createMPCampaignDisplay|createSimpleObject|createSimpleTask|createSite|createSoundSource|createTask|createTeam|createTrigger|createUnit|createVehicle|createVehicleCrew|createVehicleLocal|crew|ctAddHeader|ctAddRow|ctClear|ctCurSel|ctData|ctFindHeaderRows|ctFindRowHeader|ctHeaderControls|ctHeaderCount|ctRemoveHeaders|ctRemoveRows|ctrlActivate|ctrlAddEventHandler|ctrlAngle|ctrlAutoScrollDelay|ctrlAutoScrollRewind|ctrlAutoScrollSpeed|ctrlChecked|ctrlClassName|ctrlCommit|ctrlCommitted|ctrlCreate|ctrlDelete|ctrlEnable|ctrlEnabled|ctrlFade|ctrlHTMLLoaded|ctrlIDC|ctrlIDD|ctrlMapAnimAdd|ctrlMapAnimClear|ctrlMapAnimCommit|ctrlMapAnimDone|ctrlMapCursor|ctrlMapMouseOver|ctrlMapScale|ctrlMapScreenToWorld|ctrlMapWorldToScreen|ctrlModel|ctrlModelDirAndUp|ctrlModelScale|ctrlParent|ctrlParentControlsGroup|ctrlPosition|ctrlRemoveAllEventHandlers|ctrlRemoveEventHandler|ctrlScale|ctrlSetActiveColor|ctrlSetAngle|ctrlSetAutoScrollDelay|ctrlSetAutoScrollRewind|ctrlSetAutoScrollSpeed|ctrlSetBackgroundColor|ctrlSetChecked|ctrlSetDisabledColor|ctrlSetEventHandler|ctrlSetFade|ctrlSetFocus|ctrlSetFont|ctrlSetFontH1|ctrlSetFontH1B|ctrlSetFontH2|ctrlSetFontH2B|ctrlSetFontH3|ctrlSetFontH3B|ctrlSetFontH4|ctrlSetFontH4B|ctrlSetFontH5|ctrlSetFontH5B|ctrlSetFontH6|ctrlSetFontH6B|ctrlSetFontHeight|ctrlSetFontHeightH1|ctrlSetFontHeightH2|ctrlSetFontHeightH3|ctrlSetFontHeightH4|ctrlSetFontHeightH5|ctrlSetFontHeightH6|ctrlSetFontHeightSecondary|ctrlSetFontP|ctrlSetFontPB|ctrlSetFontSecondary|ctrlSetForegroundColor|ctrlSetModel|ctrlSetModelDirAndUp|ctrlSetModelScale|ctrlSetPixelPrecision|ctrlSetPosition|ctrlSetScale|ctrlSetStructuredText|ctrlSetText|ctrlSetTextColor|ctrlSetTextColorSecondary|ctrlSetTextSecondary|ctrlSetTooltip|ctrlSetTooltipColorBox|ctrlSetTooltipColorShade|ctrlSetTooltipColorText|ctrlShow|ctrlShown|ctrlText|ctrlTextHeight|ctrlTextSecondary|ctrlTextWidth|ctrlType|ctrlVisible|ctRowControls|ctRowCount|ctSetCurSel|ctSetData|ctSetHeaderTemplate|ctSetRowTemplate|ctSetValue|ctValue|curatorAddons|curatorCamera|curatorCameraArea|curatorCameraAreaCeiling|curatorCoef|curatorEditableObjects|curatorEditingArea|curatorEditingAreaType|curatorMouseOver|curatorPoints|curatorRegisteredObjects|curatorSelected|curatorWaypointCost|current3DENOperation|currentChannel|currentCommand|currentMagazine|currentMagazineDetail|currentMagazineDetailTurret|currentMagazineTurret|currentMuzzle|currentNamespace|currentTask|currentTasks|currentThrowable|currentVisionMode|currentWaypoint|currentWeapon|currentWeaponMode|currentWeaponTurret|currentZeroing|cursorObject|cursorTarget|customChat|customRadio|cutFadeOut|cutObj|cutRsc|cutText|damage|date|dateToNumber|daytime|deActivateKey|debriefingText|debugFSM|debugLog|deg|delete3DENEntities|deleteAt|deleteCenter|deleteCollection|deleteEditorObject|deleteGroup|deleteGroupWhenEmpty|deleteIdentity|deleteLocation|deleteMarker|deleteMarkerLocal|deleteRange|deleteResources|deleteSite|deleteStatus|deleteTeam|deleteVehicle|deleteVehicleCrew|deleteWaypoint|detach|detectedMines|diag_activeMissionFSMs|diag_activeScripts|diag_activeSQFScripts|diag_activeSQSScripts|diag_captureFrame|diag_captureFrameToFile|diag_captureSlowFrame|diag_codePerformance|diag_drawMode|diag_dynamicSimulationEnd|diag_enable|diag_enabled|diag_fps|diag_fpsMin|diag_frameNo|diag_lightNewLoad|diag_list|diag_log|diag_logSlowFrame|diag_mergeConfigFile|diag_recordTurretLimits|diag_setLightNew|diag_tickTime|diag_toggle|dialog|diarySubjectExists|didJIP|didJIPOwner|difficulty|difficultyEnabled|difficultyEnabledRTD|difficultyOption|direction|directSay|disableAI|disableCollisionWith|disableConversation|disableDebriefingStats|disableMapIndicators|disableNVGEquipment|disableRemoteSensors|disableSerialization|disableTIEquipment|disableUAVConnectability|disableUserInput|displayAddEventHandler|displayCtrl|displayNull|displayParent|displayRemoveAllEventHandlers|displayRemoveEventHandler|displaySetEventHandler|dissolveTeam|distance|distance2D|distanceSqr|distributionRegion|do3DENAction|doArtilleryFire|doFire|doFollow|doFSM|doGetOut|doMove|doorPhase|doStop|doSuppressiveFire|doTarget|doWatch|drawArrow|drawEllipse|drawIcon|drawIcon3D|drawLine|drawLine3D|drawLink|drawLocation|drawPolygon|drawRectangle|drawTriangle|driver|drop|dynamicSimulationDistance|dynamicSimulationDistanceCoef|dynamicSimulationEnabled|dynamicSimulationSystemEnabled|east|edit3DENMissionAttributes|editObject|editorSetEventHandler|effectiveCommander|emptyPositions|enableAI|enableAIFeature|enableAimPrecision|enableAttack|enableAudioFeature|enableAutoStartUpRTD|enableAutoTrimRTD|enableCamShake|enableCaustics|enableChannel|enableCollisionWith|enableCopilot|enableDebriefingStats|enableDiagLegend|enableDynamicSimulation|enableDynamicSimulationSystem|enableEndDialog|enableEngineArtillery|enableEnvironment|enableFatigue|enableGunLights|enableInfoPanelComponent|enableIRLasers|enableMimics|enablePersonTurret|enableRadio|enableReload|enableRopeAttach|enableSatNormalOnDetail|enableSaving|enableSentences|enableSimulation|enableSimulationGlobal|enableStamina|enableStressDamage|enableTeamSwitch|enableTraffic|enableUAVConnectability|enableUAVWaypoints|enableVehicleCargo|enableVehicleSensor|enableWeaponDisassembly|endl|endLoadingScreen|endMission|engineOn|enginesIsOnRTD|enginesPowerRTD|enginesRpmRTD|enginesTorqueRTD|entities|environmentEnabled|estimatedEndServerTime|estimatedTimeLeft|evalObjectArgument|everyBackpack|everyContainer|exec|execEditorScript|exp|expectedDestination|exportJIPMessages|eyeDirection|eyePos|face|faction|fadeMusic|fadeRadio|fadeSound|fadeSpeech|failMission|fillWeaponsFromPool|find|findCover|findDisplay|findEditorObject|findEmptyPosition|findEmptyPositionReady|findIf|findNearestEnemy|finishMissionInit|finite|fire|fireAtTarget|firstBackpack|flag|flagAnimationPhase|flagOwner|flagSide|flagTexture|fleeing|floor|flyInHeight|flyInHeightASL|fog|fogForecast|fogParams|forceAddUniform|forceAtPositionRTD|forcedMap|forceEnd|forceFlagTexture|forceFollowRoad|forceGeneratorRTD|forceMap|forceRespawn|forceSpeed|forceWalk|forceWeaponFire|forceWeatherChange|forgetTarget|format|formation|formationDirection|formationLeader|formationMembers|formationPosition|formationTask|formatText|formLeader|freeLook|fromEditor|fuel|fullCrew|gearIDCAmmoCount|gearSlotAmmoCount|gearSlotData|get3DENActionState|get3DENAttribute|get3DENCamera|get3DENConnections|get3DENEntity|get3DENEntityID|get3DENGrid|get3DENIconsVisible|get3DENLayerEntities|get3DENLinesVisible|get3DENMissionAttribute|get3DENMouseOver|get3DENSelected|getAimingCoef|getAllEnvSoundControllers|getAllHitPointsDamage|getAllOwnedMines|getAllSoundControllers|getAmmoCargo|getAnimAimPrecision|getAnimSpeedCoef|getArray|getArtilleryAmmo|getArtilleryComputerSettings|getArtilleryETA|getAssignedCuratorLogic|getAssignedCuratorUnit|getBackpackCargo|getBleedingRemaining|getBurningValue|getCameraViewDirection|getCargoIndex|getCenterOfMass|getClientState|getClientStateNumber|getCompatiblePylonMagazines|getConnectedUAV|getContainerMaxLoad|getCursorObjectParams|getCustomAimCoef|getDammage|getDescription|getDir|getDirVisual|getDLCAssetsUsage|getDLCAssetsUsageByName|getDLCs|getDLCUsageTime|getEditorCamera|getEditorMode|getEditorObjectScope|getElevationOffset|getEngineTargetRpmRTD|getEnvSoundController|getFatigue|getFieldManualStartPage|getForcedFlagTexture|getFriend|getFSMVariable|getFuelCargo|getGroupIcon|getGroupIconParams|getGroupIcons|getHideFrom|getHit|getHitIndex|getHitPointDamage|getItemCargo|getMagazineCargo|getMarkerColor|getMarkerPos|getMarkerSize|getMarkerType|getMass|getMissionConfig|getMissionConfigValue|getMissionDLCs|getMissionLayerEntities|getMissionLayers|getModelInfo|getMousePosition|getMusicPlayedTime|getNumber|getObjectArgument|getObjectChildren|getObjectDLC|getObjectMaterials|getObjectProxy|getObjectTextures|getObjectType|getObjectViewDistance|getOxygenRemaining|getPersonUsedDLCs|getPilotCameraDirection|getPilotCameraPosition|getPilotCameraRotation|getPilotCameraTarget|getPlateNumber|getPlayerChannel|getPlayerScores|getPlayerUID|getPlayerUIDOld|getPos|getPosASL|getPosASLVisual|getPosASLW|getPosATL|getPosATLVisual|getPosVisual|getPosWorld|getPylonMagazines|getRelDir|getRelPos|getRemoteSensorsDisabled|getRepairCargo|getResolution|getRotorBrakeRTD|getShadowDistance|getShotParents|getSlingLoad|getSoundController|getSoundControllerResult|getSpeed|getStamina|getStatValue|getSuppression|getTerrainGrid|getTerrainHeightASL|getText|getTotalDLCUsageTime|getTrimOffsetRTD|getUnitLoadout|getUnitTrait|getUserMFDText|getUserMFDValue|getVariable|getVehicleCargo|getWeaponCargo|getWeaponSway|getWingsOrientationRTD|getWingsPositionRTD|getWPPos|glanceAt|globalChat|globalRadio|goggles|group|groupChat|groupFromNetId|groupIconSelectable|groupIconsVisible|groupId|groupOwner|groupRadio|groupSelectedUnits|groupSelectUnit|grpNull|gunner|gusts|halt|handgunItems|handgunMagazine|handgunWeapon|handsHit|hasInterface|hasPilotCamera|hasWeapon|hcAllGroups|hcGroupParams|hcLeader|hcRemoveAllGroups|hcRemoveGroup|hcSelected|hcSelectGroup|hcSetGroup|hcShowBar|hcShownBar|headgear|hideBody|hideObject|hideObjectGlobal|hideSelection|hint|hintC|hintCadet|hintSilent|hmd|hostMission|htmlLoad|HUDMovementLevels|humidity|image|importAllGroups|importance|in|inArea|inAreaArray|incapacitatedState|independent|inflame|inflamed|infoPanel|infoPanelComponentEnabled|infoPanelComponents|infoPanels|inGameUISetEventHandler|inheritsFrom|initAmbientLife|inPolygon|inputAction|inRangeOfArtillery|insertEditorObject|intersect|is3DEN|is3DENMultiplayer|isAbleToBreathe|isAgent|isAimPrecisionEnabled|isArray|isAutoHoverOn|isAutonomous|isAutoStartUpEnabledRTD|isAutotest|isAutoTrimOnRTD|isBleeding|isBurning|isClass|isCollisionLightOn|isCopilotEnabled|isDamageAllowed|isDedicated|isDLCAvailable|isEngineOn|isEqualTo|isEqualType|isEqualTypeAll|isEqualTypeAny|isEqualTypeArray|isEqualTypeParams|isFilePatchingEnabled|isFlashlightOn|isFlatEmpty|isForcedWalk|isFormationLeader|isGroupDeletedWhenEmpty|isHidden|isInRemainsCollector|isInstructorFigureEnabled|isIRLaserOn|isKeyActive|isKindOf|isLaserOn|isLightOn|isLocalized|isManualFire|isMarkedForCollection|isMultiplayer|isMultiplayerSolo|isNil|isNull|isNumber|isObjectHidden|isObjectRTD|isOnRoad|isPipEnabled|isPlayer|isRealTime|isRemoteExecuted|isRemoteExecutedJIP|isServer|isShowing3DIcons|isSimpleObject|isSprintAllowed|isStaminaEnabled|isSteamMission|isStreamFriendlyUIEnabled|isStressDamageEnabled|isText|isTouchingGround|isTurnedOut|isTutHintsEnabled|isUAVConnectable|isUAVConnected|isUIContext|isUniformAllowed|isVehicleCargo|isVehicleRadarOn|isVehicleSensorEnabled|isWalking|isWeaponDeployed|isWeaponRested|itemCargo|items|itemsWithMagazines|join|joinAs|joinAsSilent|joinSilent|joinString|kbAddDatabase|kbAddDatabaseTargets|kbAddTopic|kbHasTopic|kbReact|kbRemoveTopic|kbTell|kbWasSaid|keyImage|keyName|knowsAbout|land|landAt|landResult|language|laserTarget|lbAdd|lbClear|lbColor|lbColorRight|lbCurSel|lbData|lbDelete|lbIsSelected|lbPicture|lbPictureRight|lbSelection|lbSetColor|lbSetColorRight|lbSetCurSel|lbSetData|lbSetPicture|lbSetPictureColor|lbSetPictureColorDisabled|lbSetPictureColorSelected|lbSetPictureRight|lbSetPictureRightColor|lbSetPictureRightColorDisabled|lbSetPictureRightColorSelected|lbSetSelectColor|lbSetSelectColorRight|lbSetSelected|lbSetText|lbSetTextRight|lbSetTooltip|lbSetValue|lbSize|lbSort|lbSortByValue|lbText|lbTextRight|lbValue|leader|leaderboardDeInit|leaderboardGetRows|leaderboardInit|leaderboardRequestRowsFriends|leaderboardRequestRowsGlobal|leaderboardRequestRowsGlobalAroundUser|leaderboardsRequestUploadScore|leaderboardsRequestUploadScoreKeepBest|leaderboardState|leaveVehicle|libraryCredits|libraryDisclaimers|lifeState|lightAttachObject|lightDetachObject|lightIsOn|lightnings|limitSpeed|linearConversion|lineBreak|lineIntersects|lineIntersectsObjs|lineIntersectsSurfaces|lineIntersectsWith|linkItem|list|listObjects|listRemoteTargets|listVehicleSensors|ln|lnbAddArray|lnbAddColumn|lnbAddRow|lnbClear|lnbColor|lnbColorRight|lnbCurSelRow|lnbData|lnbDeleteColumn|lnbDeleteRow|lnbGetColumnsPosition|lnbPicture|lnbPictureRight|lnbSetColor|lnbSetColorRight|lnbSetColumnsPos|lnbSetCurSelRow|lnbSetData|lnbSetPicture|lnbSetPictureColor|lnbSetPictureColorRight|lnbSetPictureColorSelected|lnbSetPictureColorSelectedRight|lnbSetPictureRight|lnbSetText|lnbSetTextRight|lnbSetValue|lnbSize|lnbSort|lnbSortByValue|lnbText|lnbTextRight|lnbValue|load|loadAbs|loadBackpack|loadFile|loadGame|loadIdentity|loadMagazine|loadOverlay|loadStatus|loadUniform|loadVest|local|localize|locationNull|locationPosition|lock|lockCameraTo|lockCargo|lockDriver|locked|lockedCargo|lockedDriver|lockedTurret|lockIdentity|lockTurret|lockWP|log|logEntities|logNetwork|logNetworkTerminate|lookAt|lookAtPos|magazineCargo|magazines|magazinesAllTurrets|magazinesAmmo|magazinesAmmoCargo|magazinesAmmoFull|magazinesDetail|magazinesDetailBackpack|magazinesDetailUniform|magazinesDetailVest|magazinesTurret|magazineTurretAmmo|mapAnimAdd|mapAnimClear|mapAnimCommit|mapAnimDone|mapCenterOnCamera|mapGridPosition|markAsFinishedOnSteam|markerAlpha|markerBrush|markerColor|markerDir|markerPos|markerShape|markerSize|markerText|markerType|max|members|menuAction|menuAdd|menuChecked|menuClear|menuCollapse|menuData|menuDelete|menuEnable|menuEnabled|menuExpand|menuHover|menuPicture|menuSetAction|menuSetCheck|menuSetData|menuSetPicture|menuSetValue|menuShortcut|menuShortcutText|menuSize|menuSort|menuText|menuURL|menuValue|min|mineActive|mineDetectedBy|missionConfigFile|missionDifficulty|missionName|missionNamespace|missionStart|missionVersion|modelToWorld|modelToWorldVisual|modelToWorldVisualWorld|modelToWorldWorld|modParams|moonIntensity|moonPhase|morale|move|move3DENCamera|moveInAny|moveInCargo|moveInCommander|moveInDriver|moveInGunner|moveInTurret|moveObjectToEnd|moveOut|moveTime|moveTo|moveToCompleted|moveToFailed|musicVolume|name|nameSound|nearEntities|nearestBuilding|nearestLocation|nearestLocations|nearestLocationWithDubbing|nearestObject|nearestObjects|nearestTerrainObjects|nearObjects|nearObjectsReady|nearRoads|nearSupplies|nearTargets|needReload|netId|netObjNull|newOverlay|nextMenuItemIndex|nextWeatherChange|nMenuItems|numberOfEnginesRTD|numberToDate|objectCurators|objectFromNetId|objectParent|objNull|objStatus|onBriefingGear|onBriefingGroup|onBriefingNotes|onBriefingPlan|onBriefingTeamSwitch|onCommandModeChanged|onDoubleClick|onEachFrame|onGroupIconClick|onGroupIconOverEnter|onGroupIconOverLeave|onHCGroupSelectionChanged|onMapSingleClick|onPlayerConnected|onPlayerDisconnected|onPreloadFinished|onPreloadStarted|onShowNewObject|onTeamSwitch|openCuratorInterface|openDLCPage|openDSInterface|openMap|openSteamApp|openYoutubeVideo|opfor|orderGetIn|overcast|overcastForecast|owner|param|params|parseNumber|parseSimpleArray|parseText|parsingNamespace|particlesQuality|pi|pickWeaponPool|pitch|pixelGrid|pixelGridBase|pixelGridNoUIScale|pixelH|pixelW|playableSlotsNumber|playableUnits|playAction|playActionNow|player|playerRespawnTime|playerSide|playersNumber|playGesture|playMission|playMove|playMoveNow|playMusic|playScriptedMission|playSound|playSound3D|position|positionCameraToWorld|posScreenToWorld|posWorldToScreen|ppEffectAdjust|ppEffectCommit|ppEffectCommitted|ppEffectCreate|ppEffectDestroy|ppEffectEnable|ppEffectEnabled|ppEffectForceInNVG|precision|preloadCamera|preloadObject|preloadSound|preloadTitleObj|preloadTitleRsc|primaryWeapon|primaryWeaponItems|primaryWeaponMagazine|priority|processDiaryLink|processInitCommands|productVersion|profileName|profileNamespace|profileNameSteam|progressLoadingScreen|progressPosition|progressSetPosition|publicVariable|publicVariableClient|publicVariableServer|pushBack|pushBackUnique|putWeaponPool|queryItemsPool|queryMagazinePool|queryWeaponPool|rad|radioChannelAdd|radioChannelCreate|radioChannelRemove|radioChannelSetCallSign|radioChannelSetLabel|radioVolume|rain|rainbow|random|rank|rankId|rating|rectangular|registeredTasks|registerTask|reload|reloadEnabled|remoteControl|remoteExec|remoteExecCall|remoteExecutedOwner|remove3DENConnection|remove3DENEventHandler|remove3DENLayer|removeAction|removeAll3DENEventHandlers|removeAllActions|removeAllAssignedItems|removeAllContainers|removeAllCuratorAddons|removeAllCuratorCameraAreas|removeAllCuratorEditingAreas|removeAllEventHandlers|removeAllHandgunItems|removeAllItems|removeAllItemsWithMagazines|removeAllMissionEventHandlers|removeAllMPEventHandlers|removeAllMusicEventHandlers|removeAllOwnedMines|removeAllPrimaryWeaponItems|removeAllWeapons|removeBackpack|removeBackpackGlobal|removeCuratorAddons|removeCuratorCameraArea|removeCuratorEditableObjects|removeCuratorEditingArea|removeDrawIcon|removeDrawLinks|removeEventHandler|removeFromRemainsCollector|removeGoggles|removeGroupIcon|removeHandgunItem|removeHeadgear|removeItem|removeItemFromBackpack|removeItemFromUniform|removeItemFromVest|removeItems|removeMagazine|removeMagazineGlobal|removeMagazines|removeMagazinesTurret|removeMagazineTurret|removeMenuItem|removeMissionEventHandler|removeMPEventHandler|removeMusicEventHandler|removeOwnedMine|removePrimaryWeaponItem|removeSecondaryWeaponItem|removeSimpleTask|removeSwitchableUnit|removeTeamMember|removeUniform|removeVest|removeWeapon|removeWeaponAttachmentCargo|removeWeaponCargo|removeWeaponGlobal|removeWeaponTurret|reportRemoteTarget|requiredVersion|resetCamShake|resetSubgroupDirection|resistance|resize|resources|respawnVehicle|restartEditorCamera|reveal|revealMine|reverse|reversedMouseY|roadAt|roadsConnectedTo|roleDescription|ropeAttachedObjects|ropeAttachedTo|ropeAttachEnabled|ropeAttachTo|ropeCreate|ropeCut|ropeDestroy|ropeDetach|ropeEndPosition|ropeLength|ropes|ropeUnwind|ropeUnwound|rotorsForcesRTD|rotorsRpmRTD|round|runInitScript|safeZoneH|safeZoneW|safeZoneWAbs|safeZoneX|safeZoneXAbs|safeZoneY|save3DENInventory|saveGame|saveIdentity|saveJoysticks|saveOverlay|saveProfileNamespace|saveStatus|saveVar|savingEnabled|say|say2D|say3D|score|scoreSide|screenshot|screenToWorld|scriptDone|scriptName|scriptNull|scudState|secondaryWeapon|secondaryWeaponItems|secondaryWeaponMagazine|select|selectBestPlaces|selectDiarySubject|selectedEditorObjects|selectEditorObject|selectionNames|selectionPosition|selectLeader|selectMax|selectMin|selectNoPlayer|selectPlayer|selectRandom|selectRandomWeighted|selectWeapon|selectWeaponTurret|sendAUMessage|sendSimpleCommand|sendTask|sendTaskResult|sendUDPMessage|serverCommand|serverCommandAvailable|serverCommandExecutable|serverName|serverTime|set|set3DENAttribute|set3DENAttributes|set3DENGrid|set3DENIconsVisible|set3DENLayer|set3DENLinesVisible|set3DENLogicType|set3DENMissionAttribute|set3DENMissionAttributes|set3DENModelsVisible|set3DENObjectType|set3DENSelected|setAccTime|setActualCollectiveRTD|setAirplaneThrottle|setAirportSide|setAmmo|setAmmoCargo|setAmmoOnPylon|setAnimSpeedCoef|setAperture|setApertureNew|setArmoryPoints|setAttributes|setAutonomous|setBehaviour|setBleedingRemaining|setBrakesRTD|setCameraInterest|setCamShakeDefParams|setCamShakeParams|setCamUseTI|setCaptive|setCenterOfMass|setCollisionLight|setCombatMode|setCompassOscillation|setConvoySeparation|setCuratorCameraAreaCeiling|setCuratorCoef|setCuratorEditingAreaType|setCuratorWaypointCost|setCurrentChannel|setCurrentTask|setCurrentWaypoint|setCustomAimCoef|setCustomWeightRTD|setDamage|setDammage|setDate|setDebriefingText|setDefaultCamera|setDestination|setDetailMapBlendPars|setDir|setDirection|setDrawIcon|setDriveOnPath|setDropInterval|setDynamicSimulationDistance|setDynamicSimulationDistanceCoef|setEditorMode|setEditorObjectScope|setEffectCondition|setEngineRpmRTD|setFace|setFaceAnimation|setFatigue|setFeatureType|setFlagAnimationPhase|setFlagOwner|setFlagSide|setFlagTexture|setFog|setForceGeneratorRTD|setFormation|setFormationTask|setFormDir|setFriend|setFromEditor|setFSMVariable|setFuel|setFuelCargo|setGroupIcon|setGroupIconParams|setGroupIconsSelectable|setGroupIconsVisible|setGroupId|setGroupIdGlobal|setGroupOwner|setGusts|setHideBehind|setHit|setHitIndex|setHitPointDamage|setHorizonParallaxCoef|setHUDMovementLevels|setIdentity|setImportance|setInfoPanel|setLeader|setLightAmbient|setLightAttenuation|setLightBrightness|setLightColor|setLightDayLight|setLightFlareMaxDistance|setLightFlareSize|setLightIntensity|setLightnings|setLightUseFlare|setLocalWindParams|setMagazineTurretAmmo|setMarkerAlpha|setMarkerAlphaLocal|setMarkerBrush|setMarkerBrushLocal|setMarkerColor|setMarkerColorLocal|setMarkerDir|setMarkerDirLocal|setMarkerPos|setMarkerPosLocal|setMarkerShape|setMarkerShapeLocal|setMarkerSize|setMarkerSizeLocal|setMarkerText|setMarkerTextLocal|setMarkerType|setMarkerTypeLocal|setMass|setMimic|setMousePosition|setMusicEffect|setMusicEventHandler|setName|setNameSound|setObjectArguments|setObjectMaterial|setObjectMaterialGlobal|setObjectProxy|setObjectTexture|setObjectTextureGlobal|setObjectViewDistance|setOvercast|setOwner|setOxygenRemaining|setParticleCircle|setParticleClass|setParticleFire|setParticleParams|setParticleRandom|setPilotCameraDirection|setPilotCameraRotation|setPilotCameraTarget|setPilotLight|setPiPEffect|setPitch|setPlateNumber|setPlayable|setPlayerRespawnTime|setPos|setPosASL|setPosASL2|setPosASLW|setPosATL|setPosition|setPosWorld|setPylonLoadOut|setPylonsPriority|setRadioMsg|setRain|setRainbow|setRandomLip|setRank|setRectangular|setRepairCargo|setRotorBrakeRTD|setShadowDistance|setShotParents|setSide|setSimpleTaskAlwaysVisible|setSimpleTaskCustomData|setSimpleTaskDescription|setSimpleTaskDestination|setSimpleTaskTarget|setSimpleTaskType|setSimulWeatherLayers|setSize|setSkill|setSlingLoad|setSoundEffect|setSpeaker|setSpeech|setSpeedMode|setStamina|setStaminaScheme|setStatValue|setSuppression|setSystemOfUnits|setTargetAge|setTaskMarkerOffset|setTaskResult|setTaskState|setTerrainGrid|setText|setTimeMultiplier|setTitleEffect|setToneMapping|setToneMappingParams|setTrafficDensity|setTrafficDistance|setTrafficGap|setTrafficSpeed|setTriggerActivation|setTriggerArea|setTriggerStatements|setTriggerText|setTriggerTimeout|setTriggerType|setType|setUnconscious|setUnitAbility|setUnitLoadout|setUnitPos|setUnitPosWeak|setUnitRank|setUnitRecoilCoefficient|setUnitTrait|setUnloadInCombat|setUserActionText|setUserMFDText|setUserMFDValue|setVariable|setVectorDir|setVectorDirAndUp|setVectorUp|setVehicleAmmo|setVehicleAmmoDef|setVehicleArmor|setVehicleCargo|setVehicleId|setVehicleInit|setVehicleLock|setVehiclePosition|setVehicleRadar|setVehicleReceiveRemoteTargets|setVehicleReportOwnPosition|setVehicleReportRemoteTargets|setVehicleTIPars|setVehicleVarName|setVelocity|setVelocityModelSpace|setVelocityTransformation|setViewDistance|setVisibleIfTreeCollapsed|setWantedRpmRTD|setWaves|setWaypointBehaviour|setWaypointCombatMode|setWaypointCompletionRadius|setWaypointDescription|setWaypointForceBehaviour|setWaypointFormation|setWaypointHousePosition|setWaypointLoiterRadius|setWaypointLoiterType|setWaypointName|setWaypointPosition|setWaypointScript|setWaypointSpeed|setWaypointStatements|setWaypointTimeout|setWaypointType|setWaypointVisible|setWeaponReloadingTime|setWind|setWindDir|setWindForce|setWindStr|setWingForceScaleRTD|setWPPos|show3DIcons|showChat|showCinemaBorder|showCommandingMenu|showCompass|showCuratorCompass|showGPS|showHUD|showLegend|showMap|shownArtilleryComputer|shownChat|shownCompass|shownCuratorCompass|showNewEditorObject|shownGPS|shownHUD|shownMap|shownPad|shownRadio|shownScoretable|shownUAVFeed|shownWarrant|shownWatch|showPad|showRadio|showScoretable|showSubtitles|showUAVFeed|showWarrant|showWatch|showWaypoint|showWaypoints|side|sideAmbientLife|sideChat|sideEmpty|sideEnemy|sideFriendly|sideLogic|sideRadio|sideUnknown|simpleTasks|simulationEnabled|simulCloudDensity|simulCloudOcclusion|simulInClouds|simulWeatherSync|sin|size|sizeOf|skill|skillFinal|skipTime|sleep|sliderPosition|sliderRange|sliderSetPosition|sliderSetRange|sliderSetSpeed|sliderSpeed|slingLoadAssistantShown|soldierMagazines|someAmmo|sort|soundVolume|speaker|speed|speedMode|splitString|sqrt|squadParams|stance|startLoadingScreen|stop|stopEngineRTD|stopped|str|sunOrMoon|supportInfo|suppressFor|surfaceIsWater|surfaceNormal|surfaceType|swimInDepth|switchableUnits|switchAction|switchCamera|switchGesture|switchLight|switchMove|synchronizedObjects|synchronizedTriggers|synchronizedWaypoints|synchronizeObjectsAdd|synchronizeObjectsRemove|synchronizeTrigger|synchronizeWaypoint|systemChat|systemOfUnits|tan|targetKnowledge|targets|targetsAggregate|targetsQuery|taskAlwaysVisible|taskChildren|taskCompleted|taskCustomData|taskDescription|taskDestination|taskHint|taskMarkerOffset|taskNull|taskParent|taskResult|taskState|taskType|teamMember|teamMemberNull|teamName|teams|teamSwitch|teamSwitchEnabled|teamType|terminate|terrainIntersect|terrainIntersectASL|terrainIntersectAtASL|text|textLog|textLogFormat|tg|time|timeMultiplier|titleCut|titleFadeOut|titleObj|titleRsc|titleText|toArray|toFixed|toLower|toString|toUpper|triggerActivated|triggerActivation|triggerArea|triggerAttachedVehicle|triggerAttachObject|triggerAttachVehicle|triggerDynamicSimulation|triggerStatements|triggerText|triggerTimeout|triggerTimeoutCurrent|triggerType|turretLocal|turretOwner|turretUnit|tvAdd|tvClear|tvCollapse|tvCollapseAll|tvCount|tvCurSel|tvData|tvDelete|tvExpand|tvExpandAll|tvPicture|tvPictureRight|tvSetColor|tvSetCurSel|tvSetData|tvSetPicture|tvSetPictureColor|tvSetPictureColorDisabled|tvSetPictureColorSelected|tvSetPictureRight|tvSetPictureRightColor|tvSetPictureRightColorDisabled|tvSetPictureRightColorSelected|tvSetSelectColor|tvSetText|tvSetTooltip|tvSetValue|tvSort|tvSortByValue|tvText|tvTooltip|tvValue|type|typeName|typeOf|UAVControl|uiNamespace|uiSleep|unassignCurator|unassignItem|unassignTeam|unassignVehicle|underwater|uniform|uniformContainer|uniformItems|uniformMagazines|unitAddons|unitAimPosition|unitAimPositionVisual|unitBackpack|unitIsUAV|unitPos|unitReady|unitRecoilCoefficient|units|unitsBelowHeight|unlinkItem|unlockAchievement|unregisterTask|updateDrawIcon|updateMenuItem|updateObjectTree|useAIOperMapObstructionTest|useAISteeringComponent|useAudioTimeForMoves|userInputDisabled|vectorAdd|vectorCos|vectorCrossProduct|vectorDiff|vectorDir|vectorDirVisual|vectorDistance|vectorDistanceSqr|vectorDotProduct|vectorFromTo|vectorMagnitude|vectorMagnitudeSqr|vectorModelToWorld|vectorModelToWorldVisual|vectorMultiply|vectorNormalized|vectorUp|vectorUpVisual|vectorWorldToModel|vectorWorldToModelVisual|vehicle|vehicleCargoEnabled|vehicleChat|vehicleRadio|vehicleReceiveRemoteTargets|vehicleReportOwnPosition|vehicleReportRemoteTargets|vehicles|vehicleVarName|velocity|velocityModelSpace|verifySignature|vest|vestContainer|vestItems|vestMagazines|viewDistance|visibleCompass|visibleGPS|visibleMap|visiblePosition|visiblePositionASL|visibleScoretable|visibleWatch|waitUntil|waves|waypointAttachedObject|waypointAttachedVehicle|waypointAttachObject|waypointAttachVehicle|waypointBehaviour|waypointCombatMode|waypointCompletionRadius|waypointDescription|waypointForceBehaviour|waypointFormation|waypointHousePosition|waypointLoiterRadius|waypointLoiterType|waypointName|waypointPosition|waypoints|waypointScript|waypointsEnabledUAV|waypointShow|waypointSpeed|waypointStatements|waypointTimeout|waypointTimeoutCurrent|waypointType|waypointVisible|weaponAccessories|weaponAccessoriesCargo|weaponCargo|weaponDirection|weaponInertia|weaponLowered|weapons|weaponsItems|weaponsItemsCargo|weaponState|weaponsTurret|weightRTD|west|WFSideText|wind|windDir|windRTD|windStr|wingsForcesRTD|worldName|worldSize|worldToModel|worldToModelVisual|worldToScreen)\b/i,
    number: /(?:\$|\b0x)[\da-f]+\b|(?:\B\.\d+|\b\d+(?:\.\d+)?)(?:e[+-]?\d+)?\b/i,
    operator: /##|>>|&&|\|\||[!=<>]=?|[-+*/%#^]|\b(?:and|mod|not|or)\b/i,
    "magic-variable": {
      pattern: /\b(?:this|thisList|thisTrigger|_exception|_fnc_scriptName|_fnc_scriptNameParent|_forEachIndex|_this|_thisEventHandler|_thisFSM|_thisScript|_x)\b/i,
      alias: "keyword"
    },
    constant: /\bDIK(?:_[a-z\d]+)+\b/i
  }), i.languages.insertBefore("sqf", "string", {
    macro: {
      pattern: /(^[ \t]*)#[a-z](?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,
      lookbehind: !0,
      greedy: !0,
      alias: "property",
      inside: {
        directive: {
          pattern: /#[a-z]+\b/i,
          alias: "keyword"
        },
        comment: i.languages.sqf.comment
      }
    }
  }), delete i.languages.sqf["class-name"];
}
Bye.displayName = "squirrel";
Bye.aliases = [];
function Bye(i) {
  i.register(Wr), i.languages.squirrel = i.languages.extend("clike", {
    comment: [
      i.languages.clike.comment[0],
      {
        pattern: /(^|[^\\:])(?:\/\/|#).*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: {
      pattern: /(^|[^\\"'@])(?:@"(?:[^"]|"")*"(?!")|"(?:[^\\\r\n"]|\\.)*")/,
      lookbehind: !0,
      greedy: !0
    },
    "class-name": {
      pattern: /(\b(?:class|enum|extends|instanceof)\s+)\w+(?:\.\w+)*/,
      lookbehind: !0,
      inside: {
        punctuation: /\./
      }
    },
    keyword: /\b(?:__FILE__|__LINE__|base|break|case|catch|class|clone|const|constructor|continue|default|delete|else|enum|extends|for|foreach|function|if|in|instanceof|local|null|resume|return|static|switch|this|throw|try|typeof|while|yield)\b/,
    number: /\b(?:0x[0-9a-fA-F]+|\d+(?:\.(?:\d+|[eE][+-]?\d+))?)\b/,
    operator: /\+\+|--|<=>|<[-<]|>>>?|&&?|\|\|?|[-+*/%!=<>]=?|[~^]|::?/,
    punctuation: /[(){}\[\],;.]/
  }), i.languages.insertBefore("squirrel", "string", {
    char: {
      pattern: /(^|[^\\"'])'(?:[^\\']|\\(?:[xuU][0-9a-fA-F]{0,8}|[\s\S]))'/,
      lookbehind: !0,
      greedy: !0
    }
  }), i.languages.insertBefore("squirrel", "operator", {
    "attribute-punctuation": {
      pattern: /<\/|\/>/,
      alias: "important"
    },
    lambda: {
      pattern: /@(?=\()/,
      alias: "operator"
    }
  });
}
Hye.displayName = "stan";
Hye.aliases = [];
function Hye(i) {
  (function(e) {
    var t = /\b(?:algebra_solver|algebra_solver_newton|integrate_1d|integrate_ode|integrate_ode_bdf|integrate_ode_rk45|map_rect|ode_(?:adams|bdf|ckrk|rk45)(?:_tol)?|ode_adjoint_tol_ctl|reduce_sum|reduce_sum_static)\b/;
    e.languages.stan = {
      comment: /\/\/.*|\/\*[\s\S]*?\*\/|#(?!include).*/,
      string: {
        // String literals can contain spaces and any printable ASCII characters except for " and \
        // https://mc-stan.org/docs/2_24/reference-manual/print-statements-section.html#string-literals
        pattern: /"[\x20\x21\x23-\x5B\x5D-\x7E]*"/,
        greedy: !0
      },
      directive: {
        pattern: /^([ \t]*)#include\b.*/m,
        lookbehind: !0,
        alias: "property"
      },
      "function-arg": {
        pattern: RegExp(
          "(" + t.source + /\s*\(\s*/.source + ")" + /[a-zA-Z]\w*/.source
        ),
        lookbehind: !0,
        alias: "function"
      },
      constraint: {
        pattern: /(\b(?:int|matrix|real|row_vector|vector)\s*)<[^<>]*>/,
        lookbehind: !0,
        inside: {
          expression: {
            pattern: /(=\s*)\S(?:\S|\s+(?!\s))*?(?=\s*(?:>$|,\s*\w+\s*=))/,
            lookbehind: !0,
            inside: null
            // see below
          },
          property: /\b[a-z]\w*(?=\s*=)/i,
          operator: /=/,
          punctuation: /^<|>$|,/
        }
      },
      keyword: [
        {
          pattern: /\bdata(?=\s*\{)|\b(?:functions|generated|model|parameters|quantities|transformed)\b/,
          alias: "program-block"
        },
        /\b(?:array|break|cholesky_factor_corr|cholesky_factor_cov|complex|continue|corr_matrix|cov_matrix|data|else|for|if|in|increment_log_prob|int|matrix|ordered|positive_ordered|print|real|reject|return|row_vector|simplex|target|unit_vector|vector|void|while)\b/,
        // these are functions that are known to take another function as their first argument.
        t
      ],
      function: /\b[a-z]\w*(?=\s*\()/i,
      number: /(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:E[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
      boolean: /\b(?:false|true)\b/,
      operator: /<-|\.[*/]=?|\|\|?|&&|[!=<>+\-*/]=?|['^%~?:]/,
      punctuation: /[()\[\]{},;]/
    }, e.languages.stan.constraint.inside.expression.inside = e.languages.stan;
  })(i);
}
Wye.displayName = "stata";
Wye.aliases = [];
function Wye(i) {
  i.register(uk), i.register(vY), i.register(r6), i.languages.stata = {
    comment: [
      {
        pattern: /(^[ \t]*)\*.*/m,
        lookbehind: !0,
        greedy: !0
      },
      {
        pattern: /(^|\s)\/\/.*|\/\*[\s\S]*?\*\//,
        lookbehind: !0,
        greedy: !0
      }
    ],
    "string-literal": {
      pattern: /"[^"\r\n]*"|[‘`']".*?"[’`']/,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /\$\{[^{}]*\}|[‘`']\w[^’`'\r\n]*[’`']/,
          inside: {
            punctuation: /^\$\{|\}$/,
            expression: {
              pattern: /[\s\S]+/,
              inside: null
              // see below
            }
          }
        },
        string: /[\s\S]+/
      }
    },
    mata: {
      pattern: /(^[ \t]*mata[ \t]*:)[\s\S]+?(?=^end\b)/m,
      lookbehind: !0,
      greedy: !0,
      alias: "language-mata",
      inside: i.languages.mata
    },
    java: {
      pattern: /(^[ \t]*java[ \t]*:)[\s\S]+?(?=^end\b)/m,
      lookbehind: !0,
      greedy: !0,
      alias: "language-java",
      inside: i.languages.java
    },
    python: {
      pattern: /(^[ \t]*python[ \t]*:)[\s\S]+?(?=^end\b)/m,
      lookbehind: !0,
      greedy: !0,
      alias: "language-python",
      inside: i.languages.python
    },
    command: {
      pattern: /(^[ \t]*(?:\.[ \t]+)?(?:(?:bayes|bootstrap|by|bysort|capture|collect|fmm|fp|frame|jackknife|mfp|mi|nestreg|noisily|permute|quietly|rolling|simulate|statsby|stepwise|svy|version|xi)\b[^:\r\n]*:[ \t]*|(?:capture|noisily|quietly|version)[ \t]+)?)[a-zA-Z]\w*/m,
      lookbehind: !0,
      greedy: !0,
      alias: "keyword"
    },
    variable: /\$\w+|[‘`']\w[^’`'\r\n]*[’`']/,
    keyword: /\b(?:bayes|bootstrap|by|bysort|capture|clear|collect|fmm|fp|frame|if|in|jackknife|mi[ \t]+estimate|mfp|nestreg|noisily|of|permute|quietly|rolling|simulate|sort|statsby|stepwise|svy|varlist|version|xi)\b/,
    boolean: /\b(?:off|on)\b/,
    number: /\b\d+(?:\.\d+)?\b|\B\.\d+/,
    function: /\b[a-z_]\w*(?=\()/i,
    operator: /\+\+|--|##?|[<>!=~]=?|[+\-*^&|/]/,
    punctuation: /[(){}[\],:]/
  }, i.languages.stata["string-literal"].inside.interpolation.inside.expression.inside = i.languages.stata;
}
Vye.displayName = "iecst";
Vye.aliases = [];
function Vye(i) {
  i.languages.iecst = {
    comment: [
      {
        pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/,
        lookbehind: !0,
        greedy: !0
      },
      {
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    keyword: [
      /\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:ACCESS|CONFIG|EXTERNAL|GLOBAL|INPUT|IN_OUT|OUTPUT|TEMP)|VAR|METHOD|PROPERTY)\b/i,
      /\b(?:AT|BY|(?:END_)?(?:CASE|FOR|IF|REPEAT|WHILE)|CONSTANT|CONTINUE|DO|ELSE|ELSIF|EXIT|EXTENDS|FROM|GET|GOTO|IMPLEMENTS|JMP|NON_RETAIN|OF|PRIVATE|PROTECTED|PUBLIC|RETAIN|RETURN|SET|TASK|THEN|TO|UNTIL|USING|WITH|__CATCH|__ENDTRY|__FINALLY|__TRY)\b/
    ],
    "class-name": /\b(?:ANY|ARRAY|BOOL|BYTE|U?(?:D|L|S)?INT|(?:D|L)?WORD|DATE(?:_AND_TIME)?|DT|L?REAL|POINTER|STRING|TIME(?:_OF_DAY)?|TOD)\b/,
    address: {
      pattern: /%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/,
      alias: "symbol"
    },
    number: /\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:D|DT|T|TOD)#[\d_shmd:]*|\b[A-Z]*#[\d.,_]*|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
    boolean: /\b(?:FALSE|NULL|TRUE)\b/,
    operator: /S?R?:?=>?|&&?|\*\*?|<[=>]?|>=?|[-:^/+#]|\b(?:AND|EQ|EXPT|GE|GT|LE|LT|MOD|NE|NOT|OR|XOR)\b/,
    function: /\b[a-z_]\w*(?=\s*\()/i,
    punctuation: /[()[\].,;]/
  };
}
Uye.displayName = "supercollider";
Uye.aliases = ["sclang"];
function Uye(i) {
  i.languages.supercollider = {
    comment: {
      pattern: /\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//,
      greedy: !0
    },
    string: {
      pattern: /(^|[^\\])"(?:[^"\\]|\\[\s\S])*"/,
      lookbehind: !0,
      greedy: !0
    },
    char: {
      pattern: /\$(?:[^\\\r\n]|\\.)/,
      greedy: !0
    },
    symbol: {
      pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'|\\\w+/,
      lookbehind: !0,
      greedy: !0
    },
    keyword: /\b(?:_|arg|classvar|const|nil|var|while)\b/,
    boolean: /\b(?:false|true)\b/,
    label: {
      pattern: /\b[a-z_]\w*(?=\s*:)/,
      alias: "property"
    },
    number: /\b(?:inf|pi|0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(?:pi)?|\d+r[0-9a-zA-Z]+(?:\.[0-9a-zA-Z]+)?|\d+[sb]{1,4}\d*)\b/,
    "class-name": /\b[A-Z]\w*\b/,
    operator: /\.{2,3}|#(?![[{])|&&|[!=]==?|\+>>|\+{1,3}|-[->]|=>|>>|\?\?|@\|?@|\|(?:@|[!=]=)?\||!\?|<[!=>]|\*{1,2}|<{2,3}\*?|[-!%&/<>?@|=`]/,
    punctuation: /[{}()[\].:,;]|#[[{]/
  }, i.languages.sclang = i.languages.supercollider;
}
zye.displayName = "systemd";
zye.aliases = [];
function zye(i) {
  (function(e) {
    var t = {
      pattern: /^[;#].*/m,
      greedy: !0
    }, n = /"(?:[^\r\n"\\]|\\(?:[^\r]|\r\n?))*"(?!\S)/.source;
    e.languages.systemd = {
      comment: t,
      section: {
        pattern: /^\[[^\n\r\[\]]*\](?=[ \t]*$)/m,
        greedy: !0,
        inside: {
          punctuation: /^\[|\]$/,
          "section-name": {
            pattern: /[\s\S]+/,
            alias: "selector"
          }
        }
      },
      key: {
        pattern: /^[^\s=]+(?=[ \t]*=)/m,
        greedy: !0,
        alias: "attr-name"
      },
      value: {
        // This pattern is quite complex because of two properties:
        //  1) Quotes (strings) must be preceded by a space. Since we can't use lookbehinds, we have to "resolve"
        //     the lookbehind. You will see this in the main loop where spaces are handled separately.
        //  2) Line continuations.
        //     After line continuations, empty lines and comments are ignored so we have to consume them.
        pattern: RegExp(
          /(=[ \t]*(?!\s))/.source + // the value either starts with quotes or not
          "(?:" + n + `|(?=[^"\r
]))(?:` + (/[^\s\\]/.source + // handle spaces separately because of quotes
          '|[ 	]+(?:(?![ 	"])|' + n + ")|" + /\\[\r\n]+(?:[#;].*[\r\n]+)*(?![#;])/.source) + ")*"
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "attr-value",
        inside: {
          comment: t,
          quoted: {
            pattern: RegExp(/(^|\s)/.source + n),
            lookbehind: !0,
            greedy: !0
          },
          punctuation: /\\$/m,
          boolean: {
            pattern: /^(?:false|no|off|on|true|yes)$/,
            greedy: !0
          }
        }
      },
      punctuation: /=/
    };
  })(i);
}
u6.displayName = "t4-templating";
u6.aliases = [];
function u6(i) {
  (function(e) {
    function t(r, s, o) {
      return {
        pattern: RegExp("<#" + r + "[\\s\\S]*?#>"),
        alias: "block",
        inside: {
          delimiter: {
            pattern: RegExp("^<#" + r + "|#>$"),
            alias: "important"
          },
          content: {
            pattern: /[\s\S]+/,
            inside: s,
            alias: o
          }
        }
      };
    }
    function n(r) {
      var s = e.languages[r], o = "language-" + r;
      return {
        block: {
          pattern: /<#[\s\S]+?#>/,
          inside: {
            directive: t("@", {
              "attr-value": {
                pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/,
                inside: {
                  punctuation: /^=|^["']|["']$/
                }
              },
              keyword: /\b\w+(?=\s)/,
              "attr-name": /\b\w+/
            }),
            expression: t("=", s, o),
            "class-feature": t("\\+", s, o),
            standard: t("", s, o)
          }
        }
      };
    }
    e.languages["t4-templating"] = Object.defineProperty({}, "createT4", {
      value: n
    });
  })(i);
}
$ye.displayName = "t4-cs";
$ye.aliases = ["t4"];
function $ye(i) {
  i.register(ck), i.register(u6), i.languages.t4 = i.languages["t4-cs"] = i.languages["t4-templating"].createT4("csharp");
}
jye.displayName = "t4-vb";
jye.aliases = [];
function jye(i) {
  i.register(u6), i.register(o6), i.languages["t4-vb"] = i.languages["t4-templating"].createT4("vbnet");
}
Gye.displayName = "tap";
Gye.aliases = [];
function Gye(i) {
  i.register(i6), i.languages.tap = {
    fail: /not ok[^#{\n\r]*/,
    pass: /ok[^#{\n\r]*/,
    pragma: /pragma [+-][a-z]+/,
    bailout: /bail out!.*/i,
    version: /TAP version \d+/i,
    plan: /\b\d+\.\.\d+(?: +#.*)?/,
    subtest: {
      pattern: /# Subtest(?:: .*)?/,
      greedy: !0
    },
    punctuation: /[{}]/,
    directive: /#.*/,
    yamlish: {
      pattern: /(^[ \t]*)---[\s\S]*?[\r\n][ \t]*\.\.\.$/m,
      lookbehind: !0,
      inside: i.languages.yaml,
      alias: "language-yaml"
    }
  };
}
qye.displayName = "tcl";
qye.aliases = [];
function qye(i) {
  i.languages.tcl = {
    comment: {
      pattern: /(^|[^\\])#.*/,
      lookbehind: !0
    },
    string: {
      pattern: /"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,
      greedy: !0
    },
    variable: [
      {
        pattern: /(\$)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/,
        lookbehind: !0
      },
      {
        pattern: /(\$)\{[^}]+\}/,
        lookbehind: !0
      },
      {
        pattern: /(^[\t ]*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/m,
        lookbehind: !0
      }
    ],
    function: {
      pattern: /(^[\t ]*proc[ \t]+)\S+/m,
      lookbehind: !0
    },
    builtin: [
      {
        pattern: /(^[\t ]*)(?:break|class|continue|error|eval|exit|for|foreach|if|proc|return|switch|while)\b/m,
        lookbehind: !0
      },
      /\b(?:else|elseif)\b/
    ],
    scope: {
      pattern: /(^[\t ]*)(?:global|upvar|variable)\b/m,
      lookbehind: !0,
      alias: "constant"
    },
    keyword: {
      pattern: /(^[\t ]*|\[)(?:Safe_Base|Tcl|after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|scan|seek|set|socket|source|split|string|subst|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|test|vars|wordBreak(?:After|Before))|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait)\b/m,
      lookbehind: !0
    },
    operator: /!=?|\*\*?|==|&&?|\|\|?|<[=<]?|>[=>]?|[-+~\/%?^]|\b(?:eq|in|ne|ni)\b/,
    punctuation: /[{}()\[\]]/
  };
}
Kye.displayName = "tt2";
Kye.aliases = [];
function Kye(i) {
  i.register(Wr), i.register(bu), (function(e) {
    e.languages.tt2 = e.languages.extend("clike", {
      comment: /#.*|\[%#[\s\S]*?%\]/,
      keyword: /\b(?:BLOCK|CALL|CASE|CATCH|CLEAR|DEBUG|DEFAULT|ELSE|ELSIF|END|FILTER|FINAL|FOREACH|GET|IF|IN|INCLUDE|INSERT|LAST|MACRO|META|NEXT|PERL|PROCESS|RAWPERL|RETURN|SET|STOP|SWITCH|TAGS|THROW|TRY|UNLESS|USE|WHILE|WRAPPER)\b/,
      punctuation: /[[\]{},()]/
    }), e.languages.insertBefore("tt2", "number", {
      operator: /=[>=]?|!=?|<=?|>=?|&&|\|\|?|\b(?:and|not|or)\b/,
      variable: {
        pattern: /\b[a-z]\w*(?:\s*\.\s*(?:\d+|\$?[a-z]\w*))*\b/i
      }
    }), e.languages.insertBefore("tt2", "keyword", {
      delimiter: {
        pattern: /^(?:\[%|%%)-?|-?%\]$/,
        alias: "punctuation"
      }
    }), e.languages.insertBefore("tt2", "string", {
      "single-quoted-string": {
        pattern: /'[^\\']*(?:\\[\s\S][^\\']*)*'/,
        greedy: !0,
        alias: "string"
      },
      "double-quoted-string": {
        pattern: /"[^\\"]*(?:\\[\s\S][^\\"]*)*"/,
        greedy: !0,
        alias: "string",
        inside: {
          variable: {
            pattern: /\$(?:[a-z]\w*(?:\.(?:\d+|\$?[a-z]\w*))*)/i
          }
        }
      }
    }), delete e.languages.tt2.string, e.hooks.add("before-tokenize", function(t) {
      var n = /\[%[\s\S]+?%\]/g;
      e.languages["markup-templating"].buildPlaceholders(
        t,
        "tt2",
        n
      );
    }), e.hooks.add("after-tokenize", function(t) {
      e.languages["markup-templating"].tokenizePlaceholders(t, "tt2");
    });
  })(i);
}
Yye.displayName = "toml";
Yye.aliases = [];
function Yye(i) {
  (function(e) {
    var t = /(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;
    function n(r) {
      return r.replace(/__/g, function() {
        return t;
      });
    }
    e.languages.toml = {
      comment: {
        pattern: /#.*/,
        greedy: !0
      },
      table: {
        pattern: RegExp(
          n(
            /(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source
          ),
          "m"
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "class-name"
      },
      key: {
        pattern: RegExp(
          n(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),
          "m"
        ),
        lookbehind: !0,
        greedy: !0,
        alias: "property"
      },
      string: {
        pattern: /"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,
        greedy: !0
      },
      date: [
        {
          // Offset Date-Time, Local Date-Time, Local Date
          pattern: /\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,
          alias: "number"
        },
        {
          // Local Time
          pattern: /\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,
          alias: "number"
        }
      ],
      number: /(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,
      boolean: /\b(?:false|true)\b/,
      punctuation: /[.,=[\]{}]/
    };
  })(i);
}
Xye.displayName = "tremor";
Xye.aliases = ["trickle", "troy"];
function Xye(i) {
  (function(e) {
    e.languages.tremor = {
      comment: {
        pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
        lookbehind: !0
      },
      "interpolated-string": null,
      // see below
      extractor: {
        pattern: /\b[a-z_]\w*\|(?:[^\r\n\\|]|\\(?:\r\n|[\s\S]))*\|/i,
        greedy: !0,
        inside: {
          regex: {
            pattern: /(^re)\|[\s\S]+/,
            lookbehind: !0
          },
          function: /^\w+/,
          value: /\|[\s\S]+/
        }
      },
      identifier: {
        pattern: /`[^`]*`/,
        greedy: !0
      },
      function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())\b/,
      keyword: /\b(?:args|as|by|case|config|connect|connector|const|copy|create|default|define|deploy|drop|each|emit|end|erase|event|flow|fn|for|from|group|having|insert|into|intrinsic|let|links|match|merge|mod|move|of|operator|patch|pipeline|recur|script|select|set|sliding|state|stream|to|tumbling|update|use|when|where|window|with)\b/,
      boolean: /\b(?:false|null|true)\b/i,
      number: /\b(?:0b[01_]*|0x[0-9a-fA-F_]*|\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee][+-]?[\d_]+)?)\b/,
      "pattern-punctuation": {
        pattern: /%(?=[({[])/,
        alias: "punctuation"
      },
      operator: /[-+*\/%~!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?>?=?|(?:absent|and|not|or|present|xor)\b/,
      punctuation: /::|[;\[\]()\{\},.:]/
    };
    var t = /#\{(?:[^"{}]|\{[^{}]*\}|"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*")*\}/.source;
    e.languages.tremor["interpolated-string"] = {
      pattern: RegExp(
        /(^|[^\\])/.source + '(?:"""(?:' + /[^"\\#]|\\[\s\S]|"(?!"")|#(?!\{)/.source + "|" + t + ')*"""|"(?:' + /[^"\\\r\n#]|\\(?:\r\n|[\s\S])|#(?!\{)/.source + "|" + t + ')*")'
      ),
      lookbehind: !0,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: RegExp(t),
          inside: {
            punctuation: /^#\{|\}$/,
            expression: {
              pattern: /[\s\S]+/,
              inside: e.languages.tremor
            }
          }
        },
        string: /[\s\S]+/
      }
    }, e.languages.troy = e.languages.tremor, e.languages.trickle = e.languages.tremor;
  })(i);
}
Zye.displayName = "typoscript";
Zye.aliases = ["tsconfig"];
function Zye(i) {
  (function(e) {
    var t = /\b(?:ACT|ACTIFSUB|CARRAY|CASE|CLEARGIF|COA|COA_INT|CONSTANTS|CONTENT|CUR|EDITPANEL|EFFECT|EXT|FILE|FLUIDTEMPLATE|FORM|FRAME|FRAMESET|GIFBUILDER|GMENU|GMENU_FOLDOUT|GMENU_LAYERS|GP|HMENU|HRULER|HTML|IENV|IFSUB|IMAGE|IMGMENU|IMGMENUITEM|IMGTEXT|IMG_RESOURCE|INCLUDE_TYPOSCRIPT|JSMENU|JSMENUITEM|LLL|LOAD_REGISTER|NO|PAGE|RECORDS|RESTORE_REGISTER|TEMPLATE|TEXT|TMENU|TMENUITEM|TMENU_LAYERS|USER|USER_INT|_GIFBUILDER|global|globalString|globalVar)\b/;
    e.languages.typoscript = {
      comment: [
        {
          // multiline comments /* */
          pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
          lookbehind: !0
        },
        {
          // double-slash comments - ignored when backslashes or colon is found in front
          // also ignored whenever directly after an equal-sign, because it would probably be an url without protocol
          pattern: /(^|[^\\:= \t]|(?:^|[^= \t])[ \t]+)\/\/.*/,
          lookbehind: !0,
          greedy: !0
        },
        {
          // hash comments - ignored when leading quote is found for hex colors in strings
          pattern: /(^|[^"'])#.*/,
          lookbehind: !0,
          greedy: !0
        }
      ],
      function: [
        {
          // old include style
          pattern: /<INCLUDE_TYPOSCRIPT:\s*source\s*=\s*(?:"[^"\r\n]*"|'[^'\r\n]*')\s*>/,
          inside: {
            string: {
              pattern: /"[^"\r\n]*"|'[^'\r\n]*'/,
              inside: {
                keyword: t
              }
            },
            keyword: {
              pattern: /INCLUDE_TYPOSCRIPT/
            }
          }
        },
        {
          // new include style
          pattern: /@import\s*(?:"[^"\r\n]*"|'[^'\r\n]*')/,
          inside: {
            string: /"[^"\r\n]*"|'[^'\r\n]*'/
          }
        }
      ],
      string: {
        pattern: /^([^=]*=[< ]?)(?:(?!\]\n).)*/,
        lookbehind: !0,
        inside: {
          function: /\{\$.*\}/,
          // constants include
          keyword: t,
          number: /^\d+$/,
          punctuation: /[,|:]/
        }
      },
      keyword: t,
      number: {
        // special highlighting for indexes of arrays in tags
        pattern: /\b\d+\s*[.{=]/,
        inside: {
          operator: /[.{=]/
        }
      },
      tag: {
        pattern: /\.?[-\w\\]+\.?/,
        inside: {
          punctuation: /\./
        }
      },
      punctuation: /[{}[\];(),.:|]/,
      operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/
    }, e.languages.tsconfig = e.languages.typoscript;
  })(i);
}
Qye.displayName = "unrealscript";
Qye.aliases = ["uc", "uscript"];
function Qye(i) {
  i.languages.unrealscript = {
    comment: /\/\/.*|\/\*[\s\S]*?\*\//,
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    category: {
      pattern: /(\b(?:(?:autoexpand|hide|show)categories|var)\s*\()[^()]+(?=\))/,
      lookbehind: !0,
      greedy: !0,
      alias: "property"
    },
    metadata: {
      pattern: /(\w\s*)<\s*\w+\s*=[^<>|=\r\n]+(?:\|\s*\w+\s*=[^<>|=\r\n]+)*>/,
      lookbehind: !0,
      greedy: !0,
      inside: {
        property: /\b\w+(?=\s*=)/,
        operator: /=/,
        punctuation: /[<>|]/
      }
    },
    macro: {
      pattern: /`\w+/,
      alias: "property"
    },
    "class-name": {
      pattern: /(\b(?:class|enum|extends|interface|state(?:\(\))?|struct|within)\s+)\w+/,
      lookbehind: !0
    },
    keyword: /\b(?:abstract|actor|array|auto|autoexpandcategories|bool|break|byte|case|class|classgroup|client|coerce|collapsecategories|config|const|continue|default|defaultproperties|delegate|dependson|deprecated|do|dontcollapsecategories|editconst|editinlinenew|else|enum|event|exec|export|extends|final|float|for|forcescriptorder|foreach|function|goto|guid|hidecategories|hidedropdown|if|ignores|implements|inherits|input|int|interface|iterator|latent|local|material|name|native|nativereplication|noexport|nontransient|noteditinlinenew|notplaceable|operator|optional|out|pawn|perobjectconfig|perobjectlocalized|placeable|postoperator|preoperator|private|protected|reliable|replication|return|server|showcategories|simulated|singular|state|static|string|struct|structdefault|structdefaultproperties|switch|texture|transient|travel|unreliable|until|var|vector|while|within)\b/,
    function: /\b[a-z_]\w*(?=\s*\()/i,
    boolean: /\b(?:false|true)\b/,
    number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
    // https://docs.unrealengine.com/udk/Three/UnrealScriptExpressions.html
    operator: />>|<<|--|\+\+|\*\*|[-+*/~!=<>$@]=?|&&?|\|\|?|\^\^?|[?:%]|\b(?:ClockwiseFrom|Cross|Dot)\b/,
    punctuation: /[()[\]{};,.]/
  }, i.languages.uc = i.languages.uscript = i.languages.unrealscript;
}
Jye.displayName = "uorazor";
Jye.aliases = [];
function Jye(i) {
  i.languages.uorazor = {
    "comment-hash": {
      pattern: /#.*/,
      alias: "comment",
      greedy: !0
    },
    "comment-slash": {
      pattern: /\/\/.*/,
      alias: "comment",
      greedy: !0
    },
    string: {
      pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
      inside: {
        punctuation: /^['"]|['"]$/
      },
      greedy: !0
    },
    "source-layers": {
      pattern: /\b(?:arms|backpack|blue|bracelet|cancel|clear|cloak|criminal|earrings|enemy|facialhair|friend|friendly|gloves|gray|grey|ground|hair|head|innerlegs|innertorso|innocent|lefthand|middletorso|murderer|neck|nonfriendly|onehandedsecondary|outerlegs|outertorso|pants|red|righthand|ring|self|shirt|shoes|talisman|waist)\b/i,
      alias: "function"
    },
    "source-commands": {
      pattern: /\b(?:alliance|attack|cast|clearall|clearignore|clearjournal|clearlist|clearsysmsg|createlist|createtimer|dclick|dclicktype|dclickvar|dress|dressconfig|drop|droprelloc|emote|getlabel|guild|gumpclose|gumpresponse|hotkey|ignore|lasttarget|lift|lifttype|menu|menuresponse|msg|org|organize|organizer|overhead|pause|poplist|potion|promptresponse|pushlist|removelist|removetimer|rename|restock|say|scav|scavenger|script|setability|setlasttarget|setskill|settimer|setvar|sysmsg|target|targetloc|targetrelloc|targettype|undress|unignore|unsetvar|useobject|useonce|useskill|usetype|virtue|wait|waitforgump|waitformenu|waitforprompt|waitforstat|waitforsysmsg|waitfortarget|walk|wfsysmsg|wft|whisper|yell)\b/,
      alias: "function"
    },
    "tag-name": {
      pattern: /(^\{%-?\s*)\w+/,
      lookbehind: !0,
      alias: "keyword"
    },
    delimiter: {
      pattern: /^\{[{%]-?|-?[%}]\}$/,
      alias: "punctuation"
    },
    function: /\b(?:atlist|close|closest|count|counter|counttype|dead|dex|diffhits|diffmana|diffstam|diffweight|find|findbuff|finddebuff|findlayer|findtype|findtypelist|followers|gumpexists|hidden|hits|hp|hue|human|humanoid|ingump|inlist|insysmessage|insysmsg|int|invul|lhandempty|list|listexists|mana|maxhits|maxhp|maxmana|maxstam|maxweight|monster|mounted|name|next|noto|paralyzed|poisoned|position|prev|previous|queued|rand|random|rhandempty|skill|stam|str|targetexists|timer|timerexists|varexist|warmode|weight)\b/,
    keyword: /\b(?:and|as|break|continue|else|elseif|endfor|endif|endwhile|for|if|loop|not|or|replay|stop|while)\b/,
    boolean: /\b(?:false|null|true)\b/,
    number: /\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,
    operator: [
      {
        pattern: /(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,
        lookbehind: !0
      },
      /[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/
    ],
    punctuation: /[()\[\]{}:.,]/
  };
}
e0e.displayName = "v";
e0e.aliases = [];
function e0e(i) {
  i.register(Wr), (function(e) {
    var t = {
      pattern: /[\s\S]+/,
      inside: null
    };
    e.languages.v = e.languages.extend("clike", {
      string: {
        pattern: /r?(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
        alias: "quoted-string",
        greedy: !0,
        inside: {
          interpolation: {
            pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:\{[^{}]*\}|\w+(?:\.\w+(?:\([^\(\)]*\))?|\[[^\[\]]+\])*)/,
            lookbehind: !0,
            inside: {
              "interpolation-variable": {
                pattern: /^\$\w[\s\S]*$/,
                alias: "variable"
              },
              "interpolation-punctuation": {
                pattern: /^\$\{|\}$/,
                alias: "punctuation"
              },
              "interpolation-expression": t
            }
          }
        }
      },
      "class-name": {
        pattern: /(\b(?:enum|interface|struct|type)\s+)(?:C\.)?\w+/,
        lookbehind: !0
      },
      keyword: /(?:\b(?:__global|as|asm|assert|atomic|break|chan|const|continue|defer|else|embed|enum|fn|for|go(?:to)?|if|import|in|interface|is|lock|match|module|mut|none|or|pub|return|rlock|select|shared|sizeof|static|struct|type(?:of)?|union|unsafe)|\$(?:else|for|if)|#(?:flag|include))\b/,
      number: /\b(?:0x[a-f\d]+(?:_[a-f\d]+)*|0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?)\b/i,
      operator: /~|\?|[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\.?/,
      builtin: /\b(?:any(?:_float|_int)?|bool|byte(?:ptr)?|charptr|f(?:32|64)|i(?:8|16|64|128|nt)|rune|size_t|string|u(?:16|32|64|128)|voidptr)\b/
    }), t.inside = e.languages.v, e.languages.insertBefore("v", "string", {
      char: {
        pattern: /`(?:\\`|\\?[^`]{1,2})`/,
        // using {1,2} instead of `u` flag for compatibility
        alias: "rune"
      }
    }), e.languages.insertBefore("v", "operator", {
      attribute: {
        pattern: /(^[\t ]*)\[(?:deprecated|direct_array_access|flag|inline|live|ref_only|typedef|unsafe_fn|windows_stdcall)\]/m,
        lookbehind: !0,
        alias: "annotation",
        inside: {
          punctuation: /[\[\]]/,
          keyword: /\w+/
        }
      },
      generic: {
        pattern: /<\w+>(?=\s*[\)\{])/,
        inside: {
          punctuation: /[<>]/,
          "class-name": /\w+/
        }
      }
    }), e.languages.insertBefore("v", "function", {
      "generic-function": {
        // e.g. foo<T>( ...
        pattern: /\b\w+\s*<\w+>(?=\()/,
        inside: {
          function: /^\w+/,
          generic: {
            pattern: /<\w+>/,
            inside: e.languages.v.generic.inside
          }
        }
      }
    });
  })(i);
}
t0e.displayName = "vala";
t0e.aliases = [];
function t0e(i) {
  i.register(Wr), i.languages.vala = i.languages.extend("clike", {
    // Classes copied from prism-csharp
    "class-name": [
      {
        // (Foo bar, Bar baz)
        pattern: /\b[A-Z]\w*(?:\.\w+)*\b(?=(?:\?\s+|\*?\s+\*?)\w)/,
        inside: {
          punctuation: /\./
        }
      },
      {
        // [Foo]
        pattern: /(\[)[A-Z]\w*(?:\.\w+)*\b/,
        lookbehind: !0,
        inside: {
          punctuation: /\./
        }
      },
      {
        // class Foo : Bar
        pattern: /(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/,
        lookbehind: !0,
        inside: {
          punctuation: /\./
        }
      },
      {
        // class Foo
        pattern: /((?:\b(?:class|enum|interface|new|struct)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/,
        lookbehind: !0,
        inside: {
          punctuation: /\./
        }
      }
    ],
    keyword: /\b(?:abstract|as|assert|async|base|bool|break|case|catch|char|class|const|construct|continue|default|delegate|delete|do|double|dynamic|else|ensures|enum|errordomain|extern|finally|float|for|foreach|get|if|in|inline|int|int16|int32|int64|int8|interface|internal|is|lock|long|namespace|new|null|out|override|owned|params|private|protected|public|ref|requires|return|set|short|signal|sizeof|size_t|ssize_t|static|string|struct|switch|this|throw|throws|try|typeof|uchar|uint|uint16|uint32|uint64|uint8|ulong|unichar|unowned|ushort|using|value|var|virtual|void|volatile|weak|while|yield)\b/i,
    function: /\b\w+(?=\s*\()/,
    number: /(?:\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?:f|u?l?)?/i,
    operator: /\+\+|--|&&|\|\||<<=?|>>=?|=>|->|~|[+\-*\/%&^|=!<>]=?|\?\??|\.\.\./,
    punctuation: /[{}[\];(),.:]/,
    constant: /\b[A-Z0-9_]+\b/
  }), i.languages.insertBefore("vala", "string", {
    "raw-string": {
      pattern: /"""[\s\S]*?"""/,
      greedy: !0,
      alias: "string"
    },
    "template-string": {
      pattern: /@"[\s\S]*?"/,
      greedy: !0,
      inside: {
        interpolation: {
          pattern: /\$(?:\([^)]*\)|[a-zA-Z]\w*)/,
          inside: {
            delimiter: {
              pattern: /^\$\(?|\)$/,
              alias: "punctuation"
            },
            rest: i.languages.vala
          }
        },
        string: /[\s\S]+/
      }
    }
  }), i.languages.insertBefore("vala", "keyword", {
    regex: {
      pattern: /\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[imsx]{0,4}(?=\s*(?:$|[\r\n,.;})\]]))/,
      greedy: !0,
      inside: {
        "regex-source": {
          pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
          lookbehind: !0,
          alias: "language-regex",
          inside: i.languages.regex
        },
        "regex-delimiter": /^\//,
        "regex-flags": /^[a-z]+$/
      }
    }
  });
}
n0e.displayName = "velocity";
n0e.aliases = [];
function n0e(i) {
  i.register(Nc), (function(e) {
    e.languages.velocity = e.languages.extend("markup", {});
    var t = {
      variable: {
        pattern: /(^|[^\\](?:\\\\)*)\$!?(?:[a-z][\w-]*(?:\([^)]*\))?(?:\.[a-z][\w-]*(?:\([^)]*\))?|\[[^\]]+\])*|\{[^}]+\})/i,
        lookbehind: !0,
        inside: {}
        // See below
      },
      string: {
        pattern: /"[^"]*"|'[^']*'/,
        greedy: !0
      },
      number: /\b\d+\b/,
      boolean: /\b(?:false|true)\b/,
      operator: /[=!<>]=?|[+*/%-]|&&|\|\||\.\.|\b(?:eq|g[et]|l[et]|n(?:e|ot))\b/,
      punctuation: /[(){}[\]:,.]/
    };
    t.variable.inside = {
      string: t.string,
      function: {
        pattern: /([^\w-])[a-z][\w-]*(?=\()/,
        lookbehind: !0
      },
      number: t.number,
      boolean: t.boolean,
      punctuation: t.punctuation
    }, e.languages.insertBefore("velocity", "comment", {
      unparsed: {
        pattern: /(^|[^\\])#\[\[[\s\S]*?\]\]#/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          punctuation: /^#\[\[|\]\]#$/
        }
      },
      "velocity-comment": [
        {
          pattern: /(^|[^\\])#\*[\s\S]*?\*#/,
          lookbehind: !0,
          greedy: !0,
          alias: "comment"
        },
        {
          pattern: /(^|[^\\])##.*/,
          lookbehind: !0,
          greedy: !0,
          alias: "comment"
        }
      ],
      directive: {
        pattern: /(^|[^\\](?:\\\\)*)#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})(?:\s*\((?:[^()]|\([^()]*\))*\))?/i,
        lookbehind: !0,
        inside: {
          keyword: {
            pattern: /^#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})|\bin\b/,
            inside: {
              punctuation: /[{}]/
            }
          },
          rest: t
        }
      },
      variable: t.variable
    }), e.languages.velocity.tag.inside["attr-value"].inside.rest = e.languages.velocity;
  })(i);
}
i0e.displayName = "verilog";
i0e.aliases = [];
function i0e(i) {
  i.languages.verilog = {
    comment: {
      pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
      greedy: !0
    },
    string: {
      pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
      greedy: !0
    },
    "kernel-function": {
      // support for any kernel function (ex: $display())
      pattern: /\B\$\w+\b/,
      alias: "property"
    },
    // support for user defined constants (ex: `define)
    constant: /\B`\w+\b/,
    function: /\b\w+(?=\()/,
    // support for verilog and system verilog keywords
    keyword: /\b(?:alias|and|assert|assign|assume|automatic|before|begin|bind|bins|binsof|bit|break|buf|bufif0|bufif1|byte|case|casex|casez|cell|chandle|class|clocking|cmos|config|const|constraint|context|continue|cover|covergroup|coverpoint|cross|deassign|default|defparam|design|disable|dist|do|edge|else|end|endcase|endclass|endclocking|endconfig|endfunction|endgenerate|endgroup|endinterface|endmodule|endpackage|endprimitive|endprogram|endproperty|endsequence|endspecify|endtable|endtask|enum|event|expect|export|extends|extern|final|first_match|for|force|foreach|forever|fork|forkjoin|function|generate|genvar|highz0|highz1|if|iff|ifnone|ignore_bins|illegal_bins|import|incdir|include|initial|inout|input|inside|instance|int|integer|interface|intersect|join|join_any|join_none|large|liblist|library|local|localparam|logic|longint|macromodule|matches|medium|modport|module|nand|negedge|new|nmos|nor|noshowcancelled|not|notif0|notif1|null|or|output|package|packed|parameter|pmos|posedge|primitive|priority|program|property|protected|pull0|pull1|pulldown|pullup|pulsestyle_ondetect|pulsestyle_onevent|pure|rand|randc|randcase|randsequence|rcmos|real|realtime|ref|reg|release|repeat|return|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|sequence|shortint|shortreal|showcancelled|signed|small|solve|specify|specparam|static|string|strong0|strong1|struct|super|supply0|supply1|table|tagged|task|this|throughout|time|timeprecision|timeunit|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|type|typedef|union|unique|unsigned|use|uwire|var|vectored|virtual|void|wait|wait_order|wand|weak0|weak1|while|wildcard|wire|with|within|wor|xnor|xor)\b/,
    // bold highlighting for all verilog and system verilog logic blocks
    important: /\b(?:always|always_comb|always_ff|always_latch)\b(?: *@)?/,
    // support for time ticks, vectors, and real numbers
    number: /\B##?\d+|(?:\b\d+)?'[odbh] ?[\da-fzx_?]+|\b(?:\d*[._])?\d+(?:e[-+]?\d+)?/i,
    operator: /[-+{}^~%*\/?=!<>&|]+/,
    punctuation: /[[\];(),.:]/
  };
}
r0e.displayName = "vhdl";
r0e.aliases = [];
function r0e(i) {
  i.languages.vhdl = {
    comment: /--.+/,
    // support for all logic vectors
    "vhdl-vectors": {
      pattern: /\b[oxb]"[\da-f_]+"|"[01uxzwlh-]+"/i,
      alias: "number"
    },
    // support for operator overloading included
    "quoted-function": {
      pattern: /"\S+?"(?=\()/,
      alias: "function"
    },
    string: /"(?:[^\\"\r\n]|\\(?:\r\n|[\s\S]))*"/,
    attribute: {
      pattern: /\b'\w+/,
      alias: "attr-name"
    },
    // support for predefined attributes included
    keyword: /\b(?:access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|private|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|view|wait|when|while|with)\b/i,
    boolean: /\b(?:false|true)\b/i,
    function: /\w+(?=\()/,
    // decimal, based, physical, and exponential numbers supported
    number: /'[01uxzwlh-]'|\b(?:\d+#[\da-f_.]+#|\d[\d_.]*)(?:e[-+]?\d+)?/i,
    operator: /[<>]=?|:=|[-+*/&=]|\b(?:abs|and|mod|nand|nor|not|or|rem|rol|ror|sla|sll|sra|srl|xnor|xor)\b/i,
    punctuation: /[{}[\];(),.:]/
  };
}
s0e.displayName = "vim";
s0e.aliases = [];
function s0e(i) {
  i.languages.vim = {
    string: /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\r\n]|'')*'/,
    comment: /".*/,
    function: /\b\w+(?=\()/,
    keyword: /\b(?:N|Next|P|Print|X|XMLent|XMLns|ab|abbreviate|abc|abclear|abo|aboveleft|al|all|ar|arga|argadd|argd|argdelete|argdo|arge|argedit|argg|argglobal|argl|arglocal|args|argu|argument|as|ascii|b|bN|bNext|ba|bad|badd|ball|bd|bdelete|be|bel|belowright|bf|bfirst|bl|blast|bm|bmodified|bn|bnext|bo|botright|bp|bprevious|br|brea|break|breaka|breakadd|breakd|breakdel|breakl|breaklist|brewind|bro|browse|bufdo|buffer|buffers|bun|bunload|bw|bwipeout|c|cN|cNext|cNfcNfile|ca|cabbrev|cabc|cabclear|cad|caddb|caddbuffer|caddexpr|caddf|caddfile|cal|call|cat|catch|cb|cbuffer|cc|ccl|cclose|cd|ce|center|cex|cexpr|cf|cfile|cfir|cfirst|cg|cgetb|cgetbuffer|cgete|cgetexpr|cgetfile|change|changes|chd|chdir|che|checkpath|checkt|checktime|cl|cla|clast|clist|clo|close|cmapc|cmapclear|cn|cnew|cnewer|cnext|cnf|cnfile|cnorea|cnoreabbrev|co|col|colder|colo|colorscheme|comc|comclear|comp|compiler|con|conf|confirm|continue|cope|copen|copy|cp|cpf|cpfile|cprevious|cq|cquit|cr|crewind|cu|cuna|cunabbrev|cunmap|cw|cwindow|d|debugg|debuggreedy|delc|delcommand|delete|delf|delfunction|delm|delmarks|di|diffg|diffget|diffoff|diffpatch|diffpu|diffput|diffsplit|diffthis|diffu|diffupdate|dig|digraphs|display|dj|djump|dl|dlist|dr|drop|ds|dsearch|dsp|dsplit|e|earlier|echoe|echoerr|echom|echomsg|echon|edit|el|else|elsei|elseif|em|emenu|en|endf|endfo|endfor|endfun|endfunction|endif|endt|endtry|endw|endwhile|ene|enew|ex|exi|exit|exu|exusage|f|file|files|filetype|fin|fina|finally|find|fini|finish|fir|first|fix|fixdel|fo|fold|foldc|foldclose|foldd|folddoc|folddoclosed|folddoopen|foldo|foldopen|for|fu|fun|function|go|goto|gr|grep|grepa|grepadd|h|ha|hardcopy|help|helpf|helpfind|helpg|helpgrep|helpt|helptags|hid|hide|his|history|ia|iabbrev|iabc|iabclear|if|ij|ijump|il|ilist|imapc|imapclear|in|inorea|inoreabbrev|isearch|isp|isplit|iu|iuna|iunabbrev|iunmap|j|join|ju|jumps|k|kee|keepalt|keepj|keepjumps|keepmarks|l|lN|lNext|lNf|lNfile|la|lad|laddb|laddbuffer|laddexpr|laddf|laddfile|lan|language|last|later|lb|lbuffer|lc|lcd|lch|lchdir|lcl|lclose|left|lefta|leftabove|let|lex|lexpr|lf|lfile|lfir|lfirst|lg|lgetb|lgetbuffer|lgete|lgetexpr|lgetfile|lgr|lgrep|lgrepa|lgrepadd|lh|lhelpgrep|list|ll|lla|llast|lli|llist|lm|lmak|lmake|lmap|lmapc|lmapclear|ln|lne|lnew|lnewer|lnext|lnf|lnfile|lnoremap|lo|loadview|loc|lockmarks|lockv|lockvar|lol|lolder|lop|lopen|lp|lpf|lpfile|lprevious|lr|lrewind|ls|lt|ltag|lu|lunmap|lv|lvimgrep|lvimgrepa|lvimgrepadd|lw|lwindow|m|ma|mak|make|mark|marks|mat|match|menut|menutranslate|mk|mkexrc|mks|mksession|mksp|mkspell|mkv|mkvie|mkview|mkvimrc|mod|mode|move|mz|mzf|mzfile|mzscheme|n|nbkey|new|next|nmapc|nmapclear|noh|nohlsearch|norea|noreabbrev|nu|number|nun|nunmap|o|omapc|omapclear|on|only|open|opt|options|ou|ounmap|p|pc|pclose|pe|ped|pedit|perl|perld|perldo|po|pop|popu|popup|pp|ppop|pre|preserve|prev|previous|print|prof|profd|profdel|profile|promptf|promptfind|promptr|promptrepl|ps|psearch|ptN|ptNext|pta|ptag|ptf|ptfirst|ptj|ptjump|ptl|ptlast|ptn|ptnext|ptp|ptprevious|ptr|ptrewind|pts|ptselect|pu|put|pw|pwd|py|pyf|pyfile|python|q|qa|qall|quit|quita|quitall|r|read|rec|recover|red|redi|redir|redo|redr|redraw|redraws|redrawstatus|reg|registers|res|resize|ret|retab|retu|return|rew|rewind|ri|right|rightb|rightbelow|ru|rub|ruby|rubyd|rubydo|rubyf|rubyfile|runtime|rv|rviminfo|sN|sNext|sa|sal|sall|san|sandbox|sargument|sav|saveas|sb|sbN|sbNext|sba|sball|sbf|sbfirst|sbl|sblast|sbm|sbmodified|sbn|sbnext|sbp|sbprevious|sbr|sbrewind|sbuffer|scrip|scripte|scriptencoding|scriptnames|se|set|setf|setfiletype|setg|setglobal|setl|setlocal|sf|sfind|sfir|sfirst|sh|shell|sign|sil|silent|sim|simalt|sl|sla|slast|sleep|sm|smagic|smap|smapc|smapclear|sme|smenu|sn|snext|sni|sniff|sno|snomagic|snor|snoremap|snoreme|snoremenu|so|sor|sort|source|sp|spe|spelld|spelldump|spellgood|spelli|spellinfo|spellr|spellrepall|spellu|spellundo|spellw|spellwrong|split|spr|sprevious|sre|srewind|st|sta|stag|star|startg|startgreplace|startinsert|startr|startreplace|stj|stjump|stop|stopi|stopinsert|sts|stselect|sun|sunhide|sunm|sunmap|sus|suspend|sv|sview|syncbind|t|tN|tNext|ta|tab|tabN|tabNext|tabc|tabclose|tabd|tabdo|tabe|tabedit|tabf|tabfind|tabfir|tabfirst|tabl|tablast|tabm|tabmove|tabn|tabnew|tabnext|tabo|tabonly|tabp|tabprevious|tabr|tabrewind|tabs|tag|tags|tc|tcl|tcld|tcldo|tclf|tclfile|te|tearoff|tf|tfirst|th|throw|tj|tjump|tl|tlast|tm|tmenu|tn|tnext|to|topleft|tp|tprevious|tr|trewind|try|ts|tselect|tu|tunmenu|u|una|unabbreviate|undo|undoj|undojoin|undol|undolist|unh|unhide|unlet|unlo|unlockvar|unm|unmap|up|update|ve|verb|verbose|version|vert|vertical|vi|vie|view|vim|vimgrep|vimgrepa|vimgrepadd|visual|viu|viusage|vmapc|vmapclear|vne|vnew|vs|vsplit|vu|vunmap|w|wN|wNext|wa|wall|wh|while|win|winc|wincmd|windo|winp|winpos|winsize|wn|wnext|wp|wprevious|wq|wqa|wqall|write|ws|wsverb|wv|wviminfo|x|xa|xall|xit|xm|xmap|xmapc|xmapclear|xme|xmenu|xn|xnoremap|xnoreme|xnoremenu|xu|xunmap|y|yank)\b/,
    builtin: /\b(?:acd|ai|akm|aleph|allowrevins|altkeymap|ambiwidth|ambw|anti|antialias|arab|arabic|arabicshape|ari|arshape|autochdir|autocmd|autoindent|autoread|autowrite|autowriteall|aw|awa|background|backspace|backup|backupcopy|backupdir|backupext|backupskip|balloondelay|ballooneval|balloonexpr|bdir|bdlay|beval|bex|bexpr|bg|bh|bin|binary|biosk|bioskey|bk|bkc|bomb|breakat|brk|browsedir|bs|bsdir|bsk|bt|bufhidden|buflisted|buftype|casemap|ccv|cdpath|cedit|cfu|ch|charconvert|ci|cin|cindent|cink|cinkeys|cino|cinoptions|cinw|cinwords|clipboard|cmdheight|cmdwinheight|cmp|cms|columns|com|comments|commentstring|compatible|complete|completefunc|completeopt|consk|conskey|copyindent|cot|cpo|cpoptions|cpt|cscopepathcomp|cscopeprg|cscopequickfix|cscopetag|cscopetagorder|cscopeverbose|cspc|csprg|csqf|cst|csto|csverb|cuc|cul|cursorcolumn|cursorline|cwh|debug|deco|def|define|delcombine|dex|dg|dict|dictionary|diff|diffexpr|diffopt|digraph|dip|dir|directory|dy|ea|ead|eadirection|eb|ed|edcompatible|ef|efm|ei|ek|enc|encoding|endofline|eol|ep|equalalways|equalprg|errorbells|errorfile|errorformat|esckeys|et|eventignore|expandtab|exrc|fcl|fcs|fdc|fde|fdi|fdl|fdls|fdm|fdn|fdo|fdt|fen|fenc|fencs|fex|ff|ffs|fileencoding|fileencodings|fileformat|fileformats|fillchars|fk|fkmap|flp|fml|fmr|foldcolumn|foldenable|foldexpr|foldignore|foldlevel|foldlevelstart|foldmarker|foldmethod|foldminlines|foldnestmax|foldtext|formatexpr|formatlistpat|formatoptions|formatprg|fp|fs|fsync|ft|gcr|gd|gdefault|gfm|gfn|gfs|gfw|ghr|gp|grepformat|grepprg|gtl|gtt|guicursor|guifont|guifontset|guifontwide|guiheadroom|guioptions|guipty|guitablabel|guitabtooltip|helpfile|helpheight|helplang|hf|hh|hi|hidden|highlight|hk|hkmap|hkmapp|hkp|hl|hlg|hls|hlsearch|ic|icon|iconstring|ignorecase|im|imactivatekey|imak|imc|imcmdline|imd|imdisable|imi|iminsert|ims|imsearch|inc|include|includeexpr|incsearch|inde|indentexpr|indentkeys|indk|inex|inf|infercase|insertmode|invacd|invai|invakm|invallowrevins|invaltkeymap|invanti|invantialias|invar|invarab|invarabic|invarabicshape|invari|invarshape|invautochdir|invautoindent|invautoread|invautowrite|invautowriteall|invaw|invawa|invbackup|invballooneval|invbeval|invbin|invbinary|invbiosk|invbioskey|invbk|invbl|invbomb|invbuflisted|invcf|invci|invcin|invcindent|invcompatible|invconfirm|invconsk|invconskey|invcopyindent|invcp|invcscopetag|invcscopeverbose|invcst|invcsverb|invcuc|invcul|invcursorcolumn|invcursorline|invdeco|invdelcombine|invdg|invdiff|invdigraph|invdisable|invea|inveb|inved|invedcompatible|invek|invendofline|inveol|invequalalways|inverrorbells|invesckeys|invet|invex|invexpandtab|invexrc|invfen|invfk|invfkmap|invfoldenable|invgd|invgdefault|invguipty|invhid|invhidden|invhk|invhkmap|invhkmapp|invhkp|invhls|invhlsearch|invic|invicon|invignorecase|invim|invimc|invimcmdline|invimd|invincsearch|invinf|invinfercase|invinsertmode|invis|invjoinspaces|invjs|invlazyredraw|invlbr|invlinebreak|invlisp|invlist|invloadplugins|invlpl|invlz|invma|invmacatsui|invmagic|invmh|invml|invmod|invmodeline|invmodifiable|invmodified|invmore|invmousef|invmousefocus|invmousehide|invnu|invnumber|invodev|invopendevice|invpaste|invpi|invpreserveindent|invpreviewwindow|invprompt|invpvw|invreadonly|invremap|invrestorescreen|invrevins|invri|invrightleft|invrightleftcmd|invrl|invrlc|invro|invrs|invru|invruler|invsb|invsc|invscb|invscrollbind|invscs|invsecure|invsft|invshellslash|invshelltemp|invshiftround|invshortname|invshowcmd|invshowfulltag|invshowmatch|invshowmode|invsi|invsm|invsmartcase|invsmartindent|invsmarttab|invsmd|invsn|invsol|invspell|invsplitbelow|invsplitright|invspr|invsr|invssl|invsta|invstartofline|invstmp|invswapfile|invswf|invta|invtagbsearch|invtagrelative|invtagstack|invtbi|invtbidi|invtbs|invtermbidi|invterse|invtextauto|invtextmode|invtf|invtgst|invtildeop|invtimeout|invtitle|invto|invtop|invtr|invttimeout|invttybuiltin|invttyfast|invtx|invvb|invvisualbell|invwa|invwarn|invwb|invweirdinvert|invwfh|invwfw|invwildmenu|invwinfixheight|invwinfixwidth|invwiv|invwmnu|invwrap|invwrapscan|invwrite|invwriteany|invwritebackup|invws|isf|isfname|isi|isident|isk|iskeyword|isprint|joinspaces|js|key|keymap|keymodel|keywordprg|km|kmp|kp|langmap|langmenu|laststatus|lazyredraw|lbr|lcs|linebreak|lines|linespace|lisp|lispwords|listchars|loadplugins|lpl|lsp|lz|macatsui|magic|makeef|makeprg|matchpairs|matchtime|maxcombine|maxfuncdepth|maxmapdepth|maxmem|maxmempattern|maxmemtot|mco|mef|menuitems|mfd|mh|mis|mkspellmem|ml|mls|mm|mmd|mmp|mmt|modeline|modelines|modifiable|modified|more|mouse|mousef|mousefocus|mousehide|mousem|mousemodel|mouses|mouseshape|mouset|mousetime|mp|mps|msm|mzq|mzquantum|nf|noacd|noai|noakm|noallowrevins|noaltkeymap|noanti|noantialias|noar|noarab|noarabic|noarabicshape|noari|noarshape|noautochdir|noautoindent|noautoread|noautowrite|noautowriteall|noaw|noawa|nobackup|noballooneval|nobeval|nobin|nobinary|nobiosk|nobioskey|nobk|nobl|nobomb|nobuflisted|nocf|noci|nocin|nocindent|nocompatible|noconfirm|noconsk|noconskey|nocopyindent|nocp|nocscopetag|nocscopeverbose|nocst|nocsverb|nocuc|nocul|nocursorcolumn|nocursorline|nodeco|nodelcombine|nodg|nodiff|nodigraph|nodisable|noea|noeb|noed|noedcompatible|noek|noendofline|noeol|noequalalways|noerrorbells|noesckeys|noet|noex|noexpandtab|noexrc|nofen|nofk|nofkmap|nofoldenable|nogd|nogdefault|noguipty|nohid|nohidden|nohk|nohkmap|nohkmapp|nohkp|nohls|noic|noicon|noignorecase|noim|noimc|noimcmdline|noimd|noincsearch|noinf|noinfercase|noinsertmode|nois|nojoinspaces|nojs|nolazyredraw|nolbr|nolinebreak|nolisp|nolist|noloadplugins|nolpl|nolz|noma|nomacatsui|nomagic|nomh|noml|nomod|nomodeline|nomodifiable|nomodified|nomore|nomousef|nomousefocus|nomousehide|nonu|nonumber|noodev|noopendevice|nopaste|nopi|nopreserveindent|nopreviewwindow|noprompt|nopvw|noreadonly|noremap|norestorescreen|norevins|nori|norightleft|norightleftcmd|norl|norlc|noro|nors|noru|noruler|nosb|nosc|noscb|noscrollbind|noscs|nosecure|nosft|noshellslash|noshelltemp|noshiftround|noshortname|noshowcmd|noshowfulltag|noshowmatch|noshowmode|nosi|nosm|nosmartcase|nosmartindent|nosmarttab|nosmd|nosn|nosol|nospell|nosplitbelow|nosplitright|nospr|nosr|nossl|nosta|nostartofline|nostmp|noswapfile|noswf|nota|notagbsearch|notagrelative|notagstack|notbi|notbidi|notbs|notermbidi|noterse|notextauto|notextmode|notf|notgst|notildeop|notimeout|notitle|noto|notop|notr|nottimeout|nottybuiltin|nottyfast|notx|novb|novisualbell|nowa|nowarn|nowb|noweirdinvert|nowfh|nowfw|nowildmenu|nowinfixheight|nowinfixwidth|nowiv|nowmnu|nowrap|nowrapscan|nowrite|nowriteany|nowritebackup|nows|nrformats|numberwidth|nuw|odev|oft|ofu|omnifunc|opendevice|operatorfunc|opfunc|osfiletype|pa|para|paragraphs|paste|pastetoggle|patchexpr|patchmode|path|pdev|penc|pex|pexpr|pfn|ph|pheader|pi|pm|pmbcs|pmbfn|popt|preserveindent|previewheight|previewwindow|printdevice|printencoding|printexpr|printfont|printheader|printmbcharset|printmbfont|printoptions|prompt|pt|pumheight|pvh|pvw|qe|quoteescape|readonly|remap|report|restorescreen|revins|rightleft|rightleftcmd|rl|rlc|ro|rs|rtp|ruf|ruler|rulerformat|runtimepath|sbo|sc|scb|scr|scroll|scrollbind|scrolljump|scrolloff|scrollopt|scs|sect|sections|secure|sel|selection|selectmode|sessionoptions|sft|shcf|shellcmdflag|shellpipe|shellquote|shellredir|shellslash|shelltemp|shelltype|shellxquote|shiftround|shiftwidth|shm|shortmess|shortname|showbreak|showcmd|showfulltag|showmatch|showmode|showtabline|shq|si|sidescroll|sidescrolloff|siso|sj|slm|smartcase|smartindent|smarttab|smc|smd|softtabstop|sol|spc|spell|spellcapcheck|spellfile|spelllang|spellsuggest|spf|spl|splitbelow|splitright|sps|sr|srr|ss|ssl|ssop|stal|startofline|statusline|stl|stmp|su|sua|suffixes|suffixesadd|sw|swapfile|swapsync|swb|swf|switchbuf|sws|sxq|syn|synmaxcol|syntax|t_AB|t_AF|t_AL|t_CS|t_CV|t_Ce|t_Co|t_Cs|t_DL|t_EI|t_F1|t_F2|t_F3|t_F4|t_F5|t_F6|t_F7|t_F8|t_F9|t_IE|t_IS|t_K1|t_K3|t_K4|t_K5|t_K6|t_K7|t_K8|t_K9|t_KA|t_KB|t_KC|t_KD|t_KE|t_KF|t_KG|t_KH|t_KI|t_KJ|t_KK|t_KL|t_RI|t_RV|t_SI|t_Sb|t_Sf|t_WP|t_WS|t_ZH|t_ZR|t_al|t_bc|t_cd|t_ce|t_cl|t_cm|t_cs|t_da|t_db|t_dl|t_fs|t_k1|t_k2|t_k3|t_k4|t_k5|t_k6|t_k7|t_k8|t_k9|t_kB|t_kD|t_kI|t_kN|t_kP|t_kb|t_kd|t_ke|t_kh|t_kl|t_kr|t_ks|t_ku|t_le|t_mb|t_md|t_me|t_mr|t_ms|t_nd|t_op|t_se|t_so|t_sr|t_te|t_ti|t_ts|t_ue|t_us|t_ut|t_vb|t_ve|t_vi|t_vs|t_xs|tabline|tabpagemax|tabstop|tagbsearch|taglength|tagrelative|tagstack|tal|tb|tbi|tbidi|tbis|tbs|tenc|term|termbidi|termencoding|terse|textauto|textmode|textwidth|tgst|thesaurus|tildeop|timeout|timeoutlen|title|titlelen|titleold|titlestring|toolbar|toolbariconsize|top|tpm|tsl|tsr|ttimeout|ttimeoutlen|ttm|tty|ttybuiltin|ttyfast|ttym|ttymouse|ttyscroll|ttytype|tw|tx|uc|ul|undolevels|updatecount|updatetime|ut|vb|vbs|vdir|verbosefile|vfile|viewdir|viewoptions|viminfo|virtualedit|visualbell|vop|wak|warn|wb|wc|wcm|wd|weirdinvert|wfh|wfw|whichwrap|wi|wig|wildchar|wildcharm|wildignore|wildmenu|wildmode|wildoptions|wim|winaltkeys|window|winfixheight|winfixwidth|winheight|winminheight|winminwidth|winwidth|wiv|wiw|wm|wmh|wmnu|wmw|wop|wrap|wrapmargin|wrapscan|writeany|writebackup|writedelay|ww)\b/,
    number: /\b(?:0x[\da-f]+|\d+(?:\.\d+)?)\b/i,
    operator: /\|\||&&|[-+.]=?|[=!](?:[=~][#?]?)?|[<>]=?[#?]?|[*\/%?]|\b(?:is(?:not)?)\b/,
    punctuation: /[{}[\](),;:]/
  };
}
o0e.displayName = "visual-basic";
o0e.aliases = ["vb", "vba"];
function o0e(i) {
  i.languages["visual-basic"] = {
    comment: {
      pattern: /(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,
      inside: {
        keyword: /^REM/i
      }
    },
    directive: {
      pattern: /#(?:Const|Else|ElseIf|End|ExternalChecksum|ExternalSource|If|Region)(?:\b_[ \t]*(?:\r\n?|\n)|.)+/i,
      alias: "property",
      greedy: !0
    },
    string: {
      pattern: /\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,
      greedy: !0
    },
    date: {
      pattern: /#[ \t]*(?:\d+([/-])\d+\1\d+(?:[ \t]+(?:\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?))?|\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?)[ \t]*#/i,
      alias: "number"
    },
    number: /(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:[FRD]|U?[ILS])?/i,
    boolean: /\b(?:False|Nothing|True)\b/i,
    keyword: /\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Until|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Xor)\b/i,
    operator: /[+\-*/\\^<=>&#@$%!]|\b_(?=[ \t]*[\r\n])/,
    punctuation: /[{}().,:?]/
  }, i.languages.vb = i.languages["visual-basic"], i.languages.vba = i.languages["visual-basic"];
}
a0e.displayName = "warpscript";
a0e.aliases = [];
function a0e(i) {
  i.languages.warpscript = {
    comment: /#.*|\/\/.*|\/\*[\s\S]*?\*\//,
    string: {
      pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'|<'(?:[^\\']|'(?!>)|\\.)*'>/,
      greedy: !0
    },
    variable: /\$\S+/,
    macro: {
      pattern: /@\S+/,
      alias: "property"
    },
    // WarpScript doesn't have any keywords, these are all functions under the control category
    // https://www.warp10.io/tags/control
    keyword: /\b(?:BREAK|CHECKMACRO|CONTINUE|CUDF|DEFINED|DEFINEDMACRO|EVAL|FAIL|FOR|FOREACH|FORSTEP|IFT|IFTE|MSGFAIL|NRETURN|RETHROW|RETURN|SWITCH|TRY|UDF|UNTIL|WHILE)\b/,
    number: /[+-]?\b(?:NaN|Infinity|\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?|0x[\da-fA-F]+|0b[01]+)\b/,
    boolean: /\b(?:F|T|false|true)\b/,
    punctuation: /<%|%>|[{}[\]()]/,
    // Some operators from the "operators" category
    // https://www.warp10.io/tags/operators
    operator: /==|&&?|\|\|?|\*\*?|>>>?|<<|[<>!~]=?|[-/%^]|\+!?|\b(?:AND|NOT|OR)\b/
  };
}
l0e.displayName = "wasm";
l0e.aliases = [];
function l0e(i) {
  i.languages.wasm = {
    comment: [
      /\(;[\s\S]*?;\)/,
      {
        pattern: /;;.*/,
        greedy: !0
      }
    ],
    string: {
      pattern: /"(?:\\[\s\S]|[^"\\])*"/,
      greedy: !0
    },
    keyword: [
      {
        pattern: /\b(?:align|offset)=/,
        inside: {
          operator: /=/
        }
      },
      {
        pattern: /\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,
        inside: {
          punctuation: /\./
        }
      },
      /\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/
    ],
    variable: /\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,
    number: /[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,
    punctuation: /[()]/
  };
}
c0e.displayName = "web-idl";
c0e.aliases = ["webidl"];
function c0e(i) {
  (function(e) {
    var t = /(?:\B-|\b_|\b)[A-Za-z][\w-]*(?![\w-])/.source, n = "(?:" + /\b(?:unsigned\s+)?long\s+long(?![\w-])/.source + "|" + /\b(?:unrestricted|unsigned)\s+[a-z]+(?![\w-])/.source + "|" + /(?!(?:unrestricted|unsigned)\b)/.source + t + /(?:\s*<(?:[^<>]|<[^<>]*>)*>)?/.source + ")" + /(?:\s*\?)?/.source, r = {};
    e.languages["web-idl"] = {
      comment: {
        pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
        greedy: !0
      },
      string: {
        pattern: /"[^"]*"/,
        greedy: !0
      },
      namespace: {
        pattern: RegExp(/(\bnamespace\s+)/.source + t),
        lookbehind: !0
      },
      "class-name": [
        {
          pattern: /(^|[^\w-])(?:iterable|maplike|setlike)\s*<(?:[^<>]|<[^<>]*>)*>/,
          lookbehind: !0,
          inside: r
        },
        {
          pattern: RegExp(
            /(\b(?:attribute|const|deleter|getter|optional|setter)\s+)/.source + n
          ),
          lookbehind: !0,
          inside: r
        },
        {
          // callback return type
          pattern: RegExp(
            "(" + /\bcallback\s+/.source + t + /\s*=\s*/.source + ")" + n
          ),
          lookbehind: !0,
          inside: r
        },
        {
          // typedef
          pattern: RegExp(/(\btypedef\b\s*)/.source + n),
          lookbehind: !0,
          inside: r
        },
        {
          pattern: RegExp(
            /(\b(?:callback|dictionary|enum|interface(?:\s+mixin)?)\s+)(?!(?:interface|mixin)\b)/.source + t
          ),
          lookbehind: !0
        },
        {
          // inheritance
          pattern: RegExp(/(:\s*)/.source + t),
          lookbehind: !0
        },
        // includes and implements
        RegExp(t + /(?=\s+(?:implements|includes)\b)/.source),
        {
          pattern: RegExp(/(\b(?:implements|includes)\s+)/.source + t),
          lookbehind: !0
        },
        {
          // function return type, parameter types, and dictionary members
          pattern: RegExp(
            n + "(?=" + /\s*(?:\.{3}\s*)?/.source + t + /\s*[(),;=]/.source + ")"
          ),
          inside: r
        }
      ],
      builtin: /\b(?:ArrayBuffer|BigInt64Array|BigUint64Array|ByteString|DOMString|DataView|Float32Array|Float64Array|FrozenArray|Int16Array|Int32Array|Int8Array|ObservableArray|Promise|USVString|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray)\b/,
      keyword: [
        /\b(?:async|attribute|callback|const|constructor|deleter|dictionary|enum|getter|implements|includes|inherit|interface|mixin|namespace|null|optional|or|partial|readonly|required|setter|static|stringifier|typedef|unrestricted)\b/,
        // type keywords
        /\b(?:any|bigint|boolean|byte|double|float|iterable|long|maplike|object|octet|record|sequence|setlike|short|symbol|undefined|unsigned|void)\b/
      ],
      boolean: /\b(?:false|true)\b/,
      number: {
        pattern: /(^|[^\w-])-?(?:0x[0-9a-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|NaN|Infinity)(?![\w-])/i,
        lookbehind: !0
      },
      operator: /\.{3}|[=:?<>-]/,
      punctuation: /[(){}[\].,;]/
    };
    for (var s in e.languages["web-idl"])
      s !== "class-name" && (r[s] = e.languages["web-idl"][s]);
    e.languages.webidl = e.languages["web-idl"];
  })(i);
}
u0e.displayName = "wgsl";
u0e.aliases = [];
function u0e(i) {
  i.languages.wgsl = {
    comment: {
      pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
      greedy: !0
    },
    "builtin-attribute": {
      pattern: /(@)builtin\(.*?\)/,
      lookbehind: !0,
      inside: {
        attribute: {
          pattern: /^builtin/,
          alias: "attr-name"
        },
        punctuation: /[(),]/,
        "built-in-values": {
          pattern: /\b(?:frag_depth|front_facing|global_invocation_id|instance_index|local_invocation_id|local_invocation_index|num_workgroups|position|sample_index|sample_mask|vertex_index|workgroup_id)\b/,
          alias: "attr-value"
        }
      }
    },
    attributes: {
      pattern: /(@)(?:align|binding|compute|const|fragment|group|id|interpolate|invariant|location|size|vertex|workgroup_size)/i,
      lookbehind: !0,
      alias: "attr-name"
    },
    functions: {
      pattern: /\b(fn\s+)[_a-zA-Z]\w*(?=[(<])/,
      lookbehind: !0,
      alias: "function"
    },
    keyword: /\b(?:bitcast|break|case|const|continue|continuing|default|discard|else|enable|fallthrough|fn|for|function|if|let|loop|private|return|storage|struct|switch|type|uniform|var|while|workgroup)\b/,
    builtin: /\b(?:abs|acos|acosh|all|any|array|asin|asinh|atan|atan2|atanh|atomic|atomicAdd|atomicAnd|atomicCompareExchangeWeak|atomicExchange|atomicLoad|atomicMax|atomicMin|atomicOr|atomicStore|atomicSub|atomicXor|bool|ceil|clamp|cos|cosh|countLeadingZeros|countOneBits|countTrailingZeros|cross|degrees|determinant|distance|dot|dpdx|dpdxCoarse|dpdxFine|dpdy|dpdyCoarse|dpdyFine|exp|exp2|extractBits|f32|f64|faceForward|firstLeadingBit|floor|fma|fract|frexp|fwidth|fwidthCoarse|fwidthFine|i32|i64|insertBits|inverseSqrt|ldexp|length|log|log2|mat[2-4]x[2-4]|max|min|mix|modf|normalize|override|pack2x16float|pack2x16snorm|pack2x16unorm|pack4x8snorm|pack4x8unorm|pow|ptr|quantizeToF16|radians|reflect|refract|reverseBits|round|sampler|sampler_comparison|select|shiftLeft|shiftRight|sign|sin|sinh|smoothstep|sqrt|staticAssert|step|storageBarrier|tan|tanh|textureDimensions|textureGather|textureGatherCompare|textureLoad|textureNumLayers|textureNumLevels|textureNumSamples|textureSample|textureSampleBias|textureSampleCompare|textureSampleCompareLevel|textureSampleGrad|textureSampleLevel|textureStore|texture_1d|texture_2d|texture_2d_array|texture_3d|texture_cube|texture_cube_array|texture_depth_2d|texture_depth_2d_array|texture_depth_cube|texture_depth_cube_array|texture_depth_multisampled_2d|texture_multisampled_2d|texture_storage_1d|texture_storage_2d|texture_storage_2d_array|texture_storage_3d|transpose|trunc|u32|u64|unpack2x16float|unpack2x16snorm|unpack2x16unorm|unpack4x8snorm|unpack4x8unorm|vec[2-4]|workgroupBarrier)\b/,
    "function-calls": {
      pattern: /\b[_a-z]\w*(?=\()/i,
      alias: "function"
    },
    "class-name": /\b(?:[A-Z][A-Za-z0-9]*)\b/,
    "bool-literal": {
      pattern: /\b(?:false|true)\b/,
      alias: "boolean"
    },
    "hex-int-literal": {
      pattern: /\b0[xX][0-9a-fA-F]+[iu]?\b(?![.pP])/,
      alias: "number"
    },
    "hex-float-literal": {
      pattern: /\b0[xX][0-9a-fA-F]*(?:\.[0-9a-fA-F]*)?(?:[pP][+-]?\d+[fh]?)?/,
      alias: "number"
    },
    "decimal-float-literal": [
      {
        pattern: /\d*\.\d+(?:[eE](?:\+|-)?\d+)?[fh]?/,
        alias: "number"
      },
      {
        pattern: /\d+\.\d*(?:[eE](?:\+|-)?\d+)?[fh]?/,
        alias: "number"
      },
      {
        pattern: /\d+[eE](?:\+|-)?\d+[fh]?/,
        alias: "number"
      },
      {
        pattern: /\b\d+[fh]\b/,
        alias: "number"
      }
    ],
    "int-literal": {
      pattern: /\b\d+[iu]?\b/,
      alias: "number"
    },
    operator: [
      {
        pattern: /(?:\^|~|\|(?!\|)|\|\||&&|<<|>>|!)(?!=)/
      },
      {
        pattern: /&(?![&=])/
      },
      {
        pattern: /(?:\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/
      },
      {
        pattern: /(^|[^<>=!])=(?![=>])/,
        lookbehind: !0
      },
      {
        pattern: /(?:==|!=|<=|\+\+|--|(^|[^=])>=)/,
        lookbehind: !0
      },
      {
        pattern: /(?:(?:[+%]|(?:\*(?!\w)))(?!=))|(?:-(?!>))|(?:\/(?!\/))/
      },
      {
        pattern: /->/
      }
    ],
    punctuation: /[@(){}[\],;<>:.]/
  };
}
d0e.displayName = "wiki";
d0e.aliases = [];
function d0e(i) {
  i.register(Nc), i.languages.wiki = i.languages.extend("markup", {
    "block-comment": {
      pattern: /(^|[^\\])\/\*[\s\S]*?\*\//,
      lookbehind: !0,
      alias: "comment"
    },
    heading: {
      pattern: /^(=+)[^=\r\n].*?\1/m,
      inside: {
        punctuation: /^=+|=+$/,
        important: /.+/
      }
    },
    emphasis: {
      // TODO Multi-line
      pattern: /('{2,5}).+?\1/,
      inside: {
        "bold-italic": {
          pattern: /(''''').+?(?=\1)/,
          lookbehind: !0,
          alias: ["bold", "italic"]
        },
        bold: {
          pattern: /(''')[^'](?:.*?[^'])?(?=\1)/,
          lookbehind: !0
        },
        italic: {
          pattern: /('')[^'](?:.*?[^'])?(?=\1)/,
          lookbehind: !0
        },
        punctuation: /^''+|''+$/
      }
    },
    hr: {
      pattern: /^-{4,}/m,
      alias: "punctuation"
    },
    url: [
      /ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b|(?:PMID|RFC) +\d+/i,
      /\[\[.+?\]\]|\[.+?\]/
    ],
    variable: [
      /__[A-Z]+__/,
      // FIXME Nested structures should be handled
      // {{formatnum:{{#expr:{{{3}}}}}}}
      /\{{3}.+?\}{3}/,
      /\{\{.+?\}\}/
    ],
    symbol: [/^#redirect/im, /~{3,5}/],
    // Handle table attrs:
    // {|
    // ! style="text-align:left;"| Item
    // |}
    "table-tag": {
      pattern: /((?:^|[|!])[|!])[^|\r\n]+\|(?!\|)/m,
      lookbehind: !0,
      inside: {
        "table-bar": {
          pattern: /\|$/,
          alias: "punctuation"
        },
        rest: i.languages.markup.tag.inside
      }
    },
    punctuation: /^(?:\{\||\|\}|\|-|[*#:;!|])|\|\||!!/m
  }), i.languages.insertBefore("wiki", "tag", {
    // Prevent highlighting inside <nowiki>, <source> and <pre> tags
    nowiki: {
      pattern: /<(nowiki|pre|source)\b[^>]*>[\s\S]*?<\/\1>/i,
      inside: {
        tag: {
          pattern: /<(?:nowiki|pre|source)\b[^>]*>|<\/(?:nowiki|pre|source)>/i,
          inside: i.languages.markup.tag.inside
        }
      }
    }
  });
}
h0e.displayName = "wolfram";
h0e.aliases = ["mathematica", "nb", "wl"];
function h0e(i) {
  i.languages.wolfram = {
    comment: (
      // Allow one level of nesting - note: regex taken from applescipt
      /\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/
    ),
    string: {
      pattern: /"(?:\\.|[^"\\\r\n])*"/,
      greedy: !0
    },
    keyword: /\b(?:Abs|AbsArg|Accuracy|Block|Do|For|Function|If|Manipulate|Module|Nest|NestList|None|Return|Switch|Table|Which|While)\b/,
    context: {
      pattern: /\b\w+`+\w*/,
      alias: "class-name"
    },
    blank: {
      pattern: /\b\w+_\b/,
      alias: "regex"
    },
    "global-variable": {
      pattern: /\$\w+/,
      alias: "variable"
    },
    boolean: /\b(?:False|True)\b/,
    number: /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,
    operator: /\/\.|;|=\.|\^=|\^:=|:=|<<|>>|<\||\|>|:>|\|->|->|<-|@@@|@@|@|\/@|=!=|===|==|=|\+|-|\[\/-+%=\]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
    punctuation: /[{}[\];(),.:]/
  }, i.languages.mathematica = i.languages.wolfram, i.languages.wl = i.languages.wolfram, i.languages.nb = i.languages.wolfram;
}
f0e.displayName = "wren";
f0e.aliases = [];
function f0e(i) {
  i.languages.wren = {
    // Multiline comments in Wren can have nested multiline comments
    // Comments: // and /* */
    comment: [
      {
        // support 3 levels of nesting
        // regex: \/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\/
        pattern: /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*))*\*\/)*\*\/)*\*\//,
        greedy: !0
      },
      {
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    // Triple quoted strings are multiline but cannot have interpolation (raw strings)
    // Based on prism-python.js
    "triple-quoted-string": {
      pattern: /"""[\s\S]*?"""/,
      greedy: !0,
      alias: "string"
    },
    // see below
    "string-literal": null,
    // #!/usr/bin/env wren on the first line
    hashbang: {
      pattern: /^#!\/.+/,
      greedy: !0,
      alias: "comment"
    },
    // Attributes are special keywords to add meta data to classes
    attribute: {
      // #! attributes are stored in class properties
      // #!myvar = true
      // #attributes are not stored and dismissed at compilation
      pattern: /#!?[ \t\u3000]*\w+/,
      alias: "keyword"
    },
    "class-name": [
      {
        // class definition
        // class Meta {}
        pattern: /(\bclass\s+)\w+/,
        lookbehind: !0
      },
      // A class must always start with an uppercase.
      // File.read
      /\b[A-Z][a-z\d_]*\b/
    ],
    // A constant can be a variable, class, property or method. Just named in all uppercase letters
    constant: /\b[A-Z][A-Z\d_]*\b/,
    null: {
      pattern: /\bnull\b/,
      alias: "keyword"
    },
    keyword: /\b(?:as|break|class|construct|continue|else|for|foreign|if|import|in|is|return|static|super|this|var|while)\b/,
    boolean: /\b(?:false|true)\b/,
    number: /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,
    // Functions can be Class.method()
    function: /\b[a-z_]\w*(?=\s*[({])/i,
    operator: /<<|>>|[=!<>]=?|&&|\|\||[-+*/%~^&|?:]|\.{2,3}/,
    punctuation: /[\[\](){}.,;]/
  }, i.languages.wren["string-literal"] = {
    // A single quote string is multiline and can have interpolation (similar to JS backticks ``)
    pattern: /(^|[^\\"])"(?:[^\\"%]|\\[\s\S]|%(?!\()|%\((?:[^()]|\((?:[^()]|\([^)]*\))*\))*\))*"/,
    lookbehind: !0,
    greedy: !0,
    inside: {
      interpolation: {
        // "%(interpolation)"
        pattern: /((?:^|[^\\])(?:\\{2})*)%\((?:[^()]|\((?:[^()]|\([^)]*\))*\))*\)/,
        lookbehind: !0,
        inside: {
          expression: {
            pattern: /^(%\()[\s\S]+(?=\)$)/,
            lookbehind: !0,
            inside: i.languages.wren
          },
          "interpolation-punctuation": {
            pattern: /^%\(|\)$/,
            alias: "punctuation"
          }
        }
      },
      string: /[\s\S]+/
    }
  };
}
g0e.displayName = "xeora";
g0e.aliases = ["xeoracube"];
function g0e(i) {
  i.register(Nc), (function(e) {
    e.languages.xeora = e.languages.extend("markup", {
      constant: {
        pattern: /\$(?:DomainContents|PageRenderDuration)\$/,
        inside: {
          punctuation: {
            pattern: /\$/
          }
        }
      },
      variable: {
        pattern: /\$@?(?:#+|[-+*~=^])?[\w.]+\$/,
        inside: {
          punctuation: {
            pattern: /[$.]/
          },
          operator: {
            pattern: /#+|[-+*~=^@]/
          }
        }
      },
      "function-inline": {
        pattern: /\$F:[-\w.]+\?[-\w.]+(?:,(?:(?:@[-#]*\w+\.[\w+.]\.*)*\|)*(?:(?:[\w+]|[-#*.~^]+[\w+]|=\S)(?:[^$=]|=+[^=])*=*|(?:@[-#]*\w+\.[\w+.]\.*)+(?:(?:[\w+]|[-#*~^][-#*.~^]*[\w+]|=\S)(?:[^$=]|=+[^=])*=*)?)?)?\$/,
        inside: {
          variable: {
            pattern: /(?:[,|])@?(?:#+|[-+*~=^])?[\w.]+/,
            inside: {
              punctuation: {
                pattern: /[,.|]/
              },
              operator: {
                pattern: /#+|[-+*~=^@]/
              }
            }
          },
          punctuation: {
            pattern: /\$\w:|[$:?.,|]/
          }
        },
        alias: "function"
      },
      "function-block": {
        pattern: /\$XF:\{[-\w.]+\?[-\w.]+(?:,(?:(?:@[-#]*\w+\.[\w+.]\.*)*\|)*(?:(?:[\w+]|[-#*.~^]+[\w+]|=\S)(?:[^$=]|=+[^=])*=*|(?:@[-#]*\w+\.[\w+.]\.*)+(?:(?:[\w+]|[-#*~^][-#*.~^]*[\w+]|=\S)(?:[^$=]|=+[^=])*=*)?)?)?\}:XF\$/,
        inside: {
          punctuation: {
            pattern: /[$:{}?.,|]/
          }
        },
        alias: "function"
      },
      "directive-inline": {
        pattern: /\$\w(?:#\d+\+?)?(?:\[[-\w.]+\])?:[-\/\w.]+\$/,
        inside: {
          punctuation: {
            pattern: /\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,
            inside: {
              tag: {
                pattern: /#\d/
              }
            }
          }
        },
        alias: "function"
      },
      "directive-block-open": {
        pattern: /\$\w+:\{|\$\w(?:#\d+\+?)?(?:\[[-\w.]+\])?:[-\w.]+:\{(?:![A-Z]+)?/,
        inside: {
          punctuation: {
            pattern: /\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,
            inside: {
              tag: {
                pattern: /#\d/
              }
            }
          },
          attribute: {
            pattern: /![A-Z]+$/,
            inside: {
              punctuation: {
                pattern: /!/
              }
            },
            alias: "keyword"
          }
        },
        alias: "function"
      },
      "directive-block-separator": {
        pattern: /\}:[-\w.]+:\{/,
        inside: {
          punctuation: {
            pattern: /[:{}]/
          }
        },
        alias: "function"
      },
      "directive-block-close": {
        pattern: /\}:[-\w.]+\$/,
        inside: {
          punctuation: {
            pattern: /[:{}$]/
          }
        },
        alias: "function"
      }
    }), e.languages.insertBefore(
      "inside",
      "punctuation",
      {
        variable: e.languages.xeora["function-inline"].inside.variable
      },
      e.languages.xeora["function-block"]
    ), e.languages.xeoracube = e.languages.xeora;
  })(i);
}
p0e.displayName = "xml-doc";
p0e.aliases = [];
function p0e(i) {
  i.register(Nc), (function(e) {
    function t(o, a) {
      e.languages[o] && e.languages.insertBefore(o, "comment", {
        "doc-comment": a
      });
    }
    var n = e.languages.markup.tag, r = {
      pattern: /\/\/\/.*/,
      greedy: !0,
      alias: "comment",
      inside: {
        tag: n
      }
    }, s = {
      pattern: /'''.*/,
      greedy: !0,
      alias: "comment",
      inside: {
        tag: n
      }
    };
    t("csharp", r), t("fsharp", r), t("vbnet", s);
  })(i);
}
m0e.displayName = "xojo";
m0e.aliases = [];
function m0e(i) {
  i.languages.xojo = {
    comment: {
      pattern: /(?:'|\/\/|Rem\b).+/i,
      greedy: !0
    },
    string: {
      pattern: /"(?:""|[^"])*"/,
      greedy: !0
    },
    number: [/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, /&[bchou][a-z\d]+/i],
    directive: {
      pattern: /#(?:Else|ElseIf|Endif|If|Pragma)\b/i,
      alias: "property"
    },
    keyword: /\b(?:AddHandler|App|Array|As(?:signs)?|Auto|Boolean|Break|By(?:Ref|Val)|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:8|16|32|64|eger|erface)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|RemoveHandler|Return|Select(?:or)?|Self|Set|Shared|Short|Single|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:8|16|32|64|eger)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,
    operator: /<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|WeakAddressOf|Xor)\b/i,
    punctuation: /[.,;:()]/
  };
}
_0e.displayName = "xquery";
_0e.aliases = [];
function _0e(i) {
  i.register(Nc), (function(e) {
    e.languages.xquery = e.languages.extend("markup", {
      "xquery-comment": {
        pattern: /\(:[\s\S]*?:\)/,
        greedy: !0,
        alias: "comment"
      },
      string: {
        pattern: /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
        greedy: !0
      },
      extension: {
        pattern: /\(#.+?#\)/,
        alias: "symbol"
      },
      variable: /\$[-\w:]+/,
      axis: {
        pattern: /(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,
        lookbehind: !0,
        alias: "operator"
      },
      "keyword-operator": {
        pattern: /(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,
        lookbehind: !0,
        alias: "operator"
      },
      keyword: {
        pattern: /(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,
        lookbehind: !0
      },
      function: /[\w-]+(?::[\w-]+)*(?=\s*\()/,
      "xquery-element": {
        pattern: /(element\s+)[\w-]+(?::[\w-]+)*/,
        lookbehind: !0,
        alias: "tag"
      },
      "xquery-attribute": {
        pattern: /(attribute\s+)[\w-]+(?::[\w-]+)*/,
        lookbehind: !0,
        alias: "attr-name"
      },
      builtin: {
        pattern: /(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:ENTITIES|ENTITY|ID|IDREFS?|NCName|NMTOKENS?|NOTATION|Name|QName|anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|int|integer|language|long|negativeInteger|nonNegativeInteger|nonPositiveInteger|normalizedString|positiveInteger|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,
        lookbehind: !0
      },
      number: /\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,
      operator: [
        /[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,
        {
          pattern: /(\s)-(?=\s)/,
          lookbehind: !0
        }
      ],
      punctuation: /[[\](){},;:/]/
    }), e.languages.xquery.tag.pattern = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/, e.languages.xquery.tag.inside["attr-value"].pattern = /=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+)/, e.languages.xquery.tag.inside["attr-value"].inside.punctuation = /^="|"$/, e.languages.xquery.tag.inside["attr-value"].inside.expression = {
      // Allow for two levels of nesting
      pattern: /\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}/,
      inside: e.languages.xquery,
      alias: "language-xquery"
    };
    var t = function(r) {
      return typeof r == "string" ? r : typeof r.content == "string" ? r.content : r.content.map(t).join("");
    }, n = function(r) {
      for (var s = [], o = 0; o < r.length; o++) {
        var a = r[o], l = !1;
        if (typeof a != "string" && (a.type === "tag" && a.content[0] && a.content[0].type === "tag" ? a.content[0].content[0].content === "</" ? s.length > 0 && s[s.length - 1].tagName === t(a.content[0].content[1]) && s.pop() : a.content[a.content.length - 1].content === "/>" || s.push({
          tagName: t(a.content[0].content[1]),
          openedBraces: 0
        }) : s.length > 0 && a.type === "punctuation" && a.content === "{" && // Ignore `{{`
        (!r[o + 1] || r[o + 1].type !== "punctuation" || r[o + 1].content !== "{") && (!r[o - 1] || r[o - 1].type !== "plain-text" || r[o - 1].content !== "{") ? s[s.length - 1].openedBraces++ : s.length > 0 && s[s.length - 1].openedBraces > 0 && a.type === "punctuation" && a.content === "}" ? s[s.length - 1].openedBraces-- : a.type !== "comment" && (l = !0)), (l || typeof a == "string") && s.length > 0 && s[s.length - 1].openedBraces === 0) {
          var c = t(a);
          o < r.length - 1 && (typeof r[o + 1] == "string" || r[o + 1].type === "plain-text") && (c += t(r[o + 1]), r.splice(o + 1, 1)), o > 0 && (typeof r[o - 1] == "string" || r[o - 1].type === "plain-text") && (c = t(r[o - 1]) + c, r.splice(o - 1, 1), o--), /^\s+$/.test(c) ? r[o] = c : r[o] = new e.Token(
            "plain-text",
            c,
            null,
            c
          );
        }
        a.content && typeof a.content != "string" && n(a.content);
      }
    };
    e.hooks.add("after-tokenize", function(r) {
      r.language === "xquery" && n(r.tokens);
    });
  })(i);
}
b0e.displayName = "yang";
b0e.aliases = [];
function b0e(i) {
  i.languages.yang = {
    // https://tools.ietf.org/html/rfc6020#page-34
    // http://www.yang-central.org/twiki/bin/view/Main/YangExamples
    comment: /\/\*[\s\S]*?\*\/|\/\/.*/,
    string: {
      pattern: /"(?:[^\\"]|\\.)*"|'[^']*'/,
      greedy: !0
    },
    keyword: {
      pattern: /(^|[{};\r\n][ \t]*)[a-z_][\w.-]*/i,
      lookbehind: !0
    },
    namespace: {
      pattern: /(\s)[a-z_][\w.-]*(?=:)/i,
      lookbehind: !0
    },
    boolean: /\b(?:false|true)\b/,
    operator: /\+/,
    punctuation: /[{};:]/
  };
}
v0e.displayName = "zig";
v0e.aliases = [];
function v0e(i) {
  (function(e) {
    function t(c) {
      return function() {
        return c;
      };
    }
    var n = /\b(?:align|allowzero|and|anyframe|anytype|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|nosuspend|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/, r = "\\b(?!" + n.source + ")(?!\\d)\\w+\\b", s = /align\s*\((?:[^()]|\([^()]*\))*\)/.source, o = /(?:\?|\bpromise->|(?:\[[^[\]]*\]|\*(?!\*)|\*\*)(?:\s*<ALIGN>|\s*const\b|\s*volatile\b|\s*allowzero\b)*)/.source.replace(
      /<ALIGN>/g,
      t(s)
    ), a = /(?:\bpromise\b|(?:\berror\.)?<ID>(?:\.<ID>)*(?!\s+<ID>))/.source.replace(
      /<ID>/g,
      t(r)
    ), l = "(?!\\s)(?:!?\\s*(?:" + o + "\\s*)*" + a + ")+";
    e.languages.zig = {
      comment: [
        {
          pattern: /\/\/[/!].*/,
          alias: "doc-comment"
        },
        /\/{2}.*/
      ],
      string: [
        {
          // "string" and c"string"
          pattern: /(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,
          lookbehind: !0,
          greedy: !0
        },
        {
          // multiline strings and c-strings
          pattern: /([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,
          lookbehind: !0,
          greedy: !0
        }
      ],
      char: {
        // characters 'a', '\n', '\xFF', '\u{10FFFF}'
        pattern: /(^|[^\\])'(?:[^'\\\r\n]|[\uD800-\uDFFF]{2}|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,
        lookbehind: !0,
        greedy: !0
      },
      builtin: /\B@(?!\d)\w+(?=\s*\()/,
      label: {
        pattern: /(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,
        lookbehind: !0
      },
      "class-name": [
        // const Foo = struct {};
        /\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,
        {
          // const x: i32 = 9;
          // var x: Bar;
          // fn foo(x: bool, y: f32) void {}
          pattern: RegExp(
            /(:\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?[=;,)])|<TYPE>(?=\s*(?:<ALIGN>\s*)?\{)/.source.replace(/<TYPE>/g, t(l)).replace(/<ALIGN>/g, t(s))
          ),
          lookbehind: !0,
          inside: null
          // see below
        },
        {
          // extern fn foo(x: f64) f64; (optional alignment)
          pattern: RegExp(
            /(\)\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?;)/.source.replace(/<TYPE>/g, t(l)).replace(/<ALIGN>/g, t(s))
          ),
          lookbehind: !0,
          inside: null
          // see below
        }
      ],
      "builtin-type": {
        pattern: /\b(?:anyerror|bool|c_u?(?:int|long|longlong|short)|c_longdouble|c_void|comptime_(?:float|int)|f(?:16|32|64|128)|[iu](?:8|16|32|64|128|size)|noreturn|type|void)\b/,
        alias: "keyword"
      },
      keyword: n,
      function: /\b(?!\d)\w+(?=\s*\()/,
      number: /\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+(?:\.[a-fA-F\d]*)?(?:[pP][+-]?[a-fA-F\d]+)?|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)\b/,
      boolean: /\b(?:false|true)\b/,
      operator: /\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,
      punctuation: /[.:,;(){}[\]]/
    }, e.languages.zig["class-name"].forEach(function(c) {
      c.inside === null && (c.inside = e.languages.zig);
    });
  })(i);
}
ce.register(Nc);
ce.register(Rw);
ce.register(Wr);
ce.register(aY);
ce.register(_u);
ce.register(Pme);
ce.register(Fme);
ce.register(Bme);
ce.register(Hme);
ce.register(Wme);
ce.register(Vme);
ce.register(Ume);
ce.register(zme);
ce.register(m2);
ce.register($me);
ce.register(jme);
ce.register(Gme);
ce.register(qme);
ce.register(Em);
ce.register(lk);
ce.register(iY);
ce.register(Kme);
ce.register(Yme);
ce.register(t6);
ce.register(i6);
ce.register(dY);
ce.register(Xme);
ce.register(Zme);
ce.register(ck);
ce.register(Qme);
ce.register(Jme);
ce.register(e_e);
ce.register(t_e);
ce.register(n_e);
ce.register(i_e);
ce.register(r_e);
ce.register(s_e);
ce.register(s6);
ce.register(o_e);
ce.register(a_e);
ce.register(l_e);
ce.register(c_e);
ce.register(u_e);
ce.register(d_e);
ce.register(h_e);
ce.register(f_e);
ce.register(g_e);
ce.register(p_e);
ce.register(m_e);
ce.register(__e);
ce.register(b_e);
ce.register(v_e);
ce.register(y_e);
ce.register(C_e);
ce.register(w_e);
ce.register(S_e);
ce.register(E_e);
ce.register(x_e);
ce.register(L_e);
ce.register(T_e);
ce.register(k_e);
ce.register(D_e);
ce.register(I_e);
ce.register(hk);
ce.register(N_e);
ce.register(R_e);
ce.register(A_e);
ce.register(O_e);
ce.register(M_e);
ce.register(P_e);
ce.register(F_e);
ce.register(B_e);
ce.register(H_e);
ce.register(W_e);
ce.register(rY);
ce.register(bu);
ce.register(V_e);
ce.register(U_e);
ce.register(z_e);
ce.register($_e);
ce.register(j_e);
ce.register(G_e);
ce.register(q_e);
ce.register(K_e);
ce.register(Y_e);
ce.register(X_e);
ce.register(n6);
ce.register(Z_e);
ce.register(Q_e);
ce.register(J_e);
ce.register(ebe);
ce.register(tbe);
ce.register(nbe);
ce.register(ibe);
ce.register(rbe);
ce.register(sbe);
ce.register(obe);
ce.register(abe);
ce.register(lbe);
ce.register(cbe);
ce.register(ube);
ce.register(dbe);
ce.register(hbe);
ce.register(fbe);
ce.register(gbe);
ce.register(pbe);
ce.register(mbe);
ce.register(_be);
ce.register(bbe);
ce.register(sY);
ce.register(vbe);
ce.register(ybe);
ce.register(Cbe);
ce.register(wbe);
ce.register(cY);
ce.register(_Y);
ce.register(Sbe);
ce.register(Ebe);
ce.register(xbe);
ce.register(l6);
ce.register(Lbe);
ce.register(Tbe);
ce.register(kbe);
ce.register(Dbe);
ce.register(Ibe);
ce.register(Nbe);
ce.register(p2);
ce.register(Rbe);
ce.register(Abe);
ce.register(Obe);
ce.register(Mbe);
ce.register(Pbe);
ce.register(Fbe);
ce.register(Bbe);
ce.register(Hbe);
ce.register(oY);
ce.register(Wbe);
ce.register(Vbe);
ce.register(uk);
ce.register(dk);
ce.register(y2);
ce.register(Ube);
ce.register(zbe);
ce.register($be);
ce.register(jbe);
ce.register(Gbe);
ce.register(qbe);
ce.register(Kbe);
ce.register(_2);
ce.register(Ybe);
ce.register(Xbe);
ce.register(Zbe);
ce.register(Qbe);
ce.register(Jbe);
ce.register(eve);
ce.register(tve);
ce.register(nve);
ce.register(ive);
ce.register(lY);
ce.register(rve);
ce.register(sve);
ce.register(ove);
ce.register(ave);
ce.register(c6);
ce.register(lve);
ce.register(cve);
ce.register(uve);
ce.register(dve);
ce.register(hve);
ce.register(fve);
ce.register(gve);
ce.register(pve);
ce.register(uY);
ce.register(vY);
ce.register(mve);
ce.register(_ve);
ce.register(bve);
ce.register(vve);
ce.register(yve);
ce.register(Cve);
ce.register(wve);
ce.register(Sve);
ce.register(Eve);
ce.register(xve);
ce.register(Lve);
ce.register(Tve);
ce.register(kve);
ce.register(Dve);
ce.register(Ive);
ce.register(Nve);
ce.register(Rve);
ce.register(Ave);
ce.register(Ove);
ce.register(hY);
ce.register(Mve);
ce.register(Pve);
ce.register(Fve);
ce.register(Bve);
ce.register(Hve);
ce.register(Wve);
ce.register(Vve);
ce.register(Uve);
ce.register(zve);
ce.register($ve);
ce.register(jve);
ce.register(Gve);
ce.register(fY);
ce.register(qve);
ce.register(Kve);
ce.register(Yve);
ce.register(Xve);
ce.register(Zve);
ce.register(Qve);
ce.register(Jve);
ce.register(eye);
ce.register(tye);
ce.register(nye);
ce.register(iye);
ce.register(rye);
ce.register(sye);
ce.register(oye);
ce.register(aye);
ce.register(lye);
ce.register(cye);
ce.register(uye);
ce.register(r6);
ce.register(dye);
ce.register(hye);
ce.register(fye);
ce.register(gye);
ce.register(gY);
ce.register(pye);
ce.register(mye);
ce.register(yY);
ce.register(_ye);
ce.register(bye);
ce.register(vye);
ce.register(yye);
ce.register(Cye);
ce.register(wye);
ce.register(Sye);
ce.register(Eye);
ce.register(xye);
ce.register(pY);
ce.register(Lye);
ce.register(mY);
ce.register(Tye);
ce.register(kye);
ce.register(Dye);
ce.register(Iye);
ce.register(Nye);
ce.register(Rye);
ce.register(Aye);
ce.register(Oye);
ce.register(CY);
ce.register(Mye);
ce.register(Pye);
ce.register(Fye);
ce.register(Bye);
ce.register(Hye);
ce.register(Wye);
ce.register(Vye);
ce.register(Uye);
ce.register(bY);
ce.register(zye);
ce.register(u6);
ce.register($ye);
ce.register(o6);
ce.register(jye);
ce.register(Gye);
ce.register(qye);
ce.register(Kye);
ce.register(Yye);
ce.register(Xye);
ce.register(Zye);
ce.register(Qye);
ce.register(Jye);
ce.register(e0e);
ce.register(t0e);
ce.register(n0e);
ce.register(i0e);
ce.register(r0e);
ce.register(s0e);
ce.register(o0e);
ce.register(a0e);
ce.register(l0e);
ce.register(c0e);
ce.register(u0e);
ce.register(d0e);
ce.register(h0e);
ce.register(f0e);
ce.register(g0e);
ce.register(p0e);
ce.register(m0e);
ce.register(_0e);
ce.register(b0e);
ce.register(v0e);
function rde() {
  rde = function(r, s) {
    return new t(r, void 0, s);
  };
  var i = RegExp.prototype, e = /* @__PURE__ */ new WeakMap();
  function t(r, s, o) {
    var a = new RegExp(r, s);
    return e.set(a, o || e.get(r)), F$(a, t.prototype);
  }
  function n(r, s) {
    var o = e.get(s);
    return Object.keys(o).reduce(function(a, l) {
      var c = o[l];
      if (typeof c == "number") a[l] = r[c];
      else {
        for (var u = 0; r[c[u]] === void 0 && u + 1 < c.length; ) u++;
        a[l] = r[c[u]];
      }
      return a;
    }, /* @__PURE__ */ Object.create(null));
  }
  return (function(r, s) {
    if (typeof s != "function" && s !== null) throw new TypeError("Super expression must either be null or a function");
    r.prototype = Object.create(s && s.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), s && F$(r, s);
  })(t, RegExp), t.prototype.exec = function(r) {
    var s = i.exec.call(this, r);
    if (s) {
      s.groups = n(s, this);
      var o = s.indices;
      o && (o.groups = n(o, this));
    }
    return s;
  }, t.prototype[Symbol.replace] = function(r, s) {
    if (typeof s == "string") {
      var o = e.get(this);
      return i[Symbol.replace].call(this, r, s.replace(/\$<([^>]+)>/g, function(l, c) {
        var u = o[c];
        return "$" + (Array.isArray(u) ? u.join("$") : u);
      }));
    }
    if (typeof s == "function") {
      var a = this;
      return i[Symbol.replace].call(this, r, function() {
        var l = arguments;
        return typeof l[l.length - 1] != "object" && (l = [].slice.call(l)).push(n(l, a)), s.apply(this, l);
      });
    }
    return i[Symbol.replace].call(this, r, s);
  }, rde.apply(this, arguments);
}
function F$(i, e) {
  return F$ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, n) {
    return t.__proto__ = n, t;
  }, F$(i, e);
}
function jRe(i, e) {
  (e == null || e > i.length) && (e = i.length);
  for (var t = 0, n = new Array(e); t < e; t++) n[t] = i[t];
  return n;
}
function Zte(i, e) {
  var t = typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
  if (t) return (t = t.call(i)).next.bind(t);
  if (Array.isArray(i) || (t = (function(r, s) {
    if (r) {
      if (typeof r == "string") return jRe(r, s);
      var o = Object.prototype.toString.call(r).slice(8, -1);
      return o === "Object" && r.constructor && (o = r.constructor.name), o === "Map" || o === "Set" ? Array.from(r) : o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o) ? jRe(r, s) : void 0;
    }
  })(i)) || e) {
    t && (i = t);
    var n = 0;
    return function() {
      return n >= i.length ? { done: !0 } : { done: !1, value: i[n++] };
    };
  }
  throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var N4t = function(i) {
  return function(e) {
    return e === void 0 && (e = {}), (function(n, r) {
      if (r && !n.registered(r)) throw new Error('The default language "' + r + '" is not registered with refractor.');
    })(i, e.defaultLanguage), function(n) {
      qd(n, "element", t);
    };
    function t(n, r, s) {
      var o, a;
      if (s && s.tagName === "pre" && n.tagName === "code") {
        var l = (n == null || (o = n.data) == null ? void 0 : o.meta) || (n == null || (a = n.properties) == null ? void 0 : a.metastring) || "";
        n.properties.className ? typeof n.properties.className == "boolean" ? n.properties.className = [] : Array.isArray(n.properties.className) || (n.properties.className = [n.properties.className]) : n.properties.className = [];
        var c, u, d = (function(D) {
          for (var N, R = Zte(D.properties.className); !(N = R()).done; ) {
            var M = N.value;
            if (M.slice(0, 9) === "language-") return M.slice(9).toLowerCase();
          }
          return null;
        })(n);
        if (!d && e.defaultLanguage && n.properties.className.push("language-" + (d = e.defaultLanguage)), n.properties.className.push("code-highlight"), d) try {
          var h, g;
          g = (h = d) != null && h.includes("diff-") ? d.split("-")[1] : d, c = i.highlight(EN(n), g), s.properties.className = (s.properties.className || []).concat("language-" + g);
        } catch (D) {
          if (!e.ignoreMissing || !/Unknown language/.test(D.message)) throw D;
          c = n;
        }
        else c = n;
        c.children = (u = 1, function D(N) {
          return N.reduce(function(R, M) {
            if (M.type === "text") {
              var B = M.value, H = (B.match(/\n/g) || "").length;
              if (H === 0) M.position = { start: { line: u, column: 1 }, end: { line: u, column: 1 } }, R.push(M);
              else for (var j, K = B.split(`
`), X = Zte(K.entries()); !(j = X()).done; ) {
                var Y = j.value, G = Y[0], Q = Y[1];
                R.push({ type: "text", value: G === K.length - 1 ? Q : Q + `
`, position: { start: { line: u + G, column: 1 }, end: { line: u + G, column: 1 } } });
              }
              return u += H, R;
            }
            if (Object.prototype.hasOwnProperty.call(M, "children")) {
              var oe = u;
              return M.children = D(M.children), R.push(M), M.position = { start: { line: oe, column: 1 }, end: { line: u, column: 1 } }, R;
            }
            return R.push(M), R;
          }, []);
        })(c.children), c.position = c.children.length > 0 ? { start: { line: c.children[0].position.start.line, column: 0 }, end: { line: c.children[c.children.length - 1].position.end.line, column: 0 } } : { start: { line: 0, column: 0 }, end: { line: 0, column: 0 } };
        for (var m, _ = (function(D) {
          var N = /{([\d,-]+)}/, R = D.split(",").map(function(H) {
            return H.trim();
          }).join();
          if (N.test(R)) {
            var M = N.exec(R)[1], B = Y3t(M);
            return function(H) {
              return B.includes(H + 1);
            };
          }
          return function() {
            return !1;
          };
        })(l), v = (function(D) {
          var N = /* @__PURE__ */ rde(/showLineNumbers=(\d+)/i, { lines: 1 });
          if (N.test(D)) {
            var R = N.exec(D);
            return Number(R.groups.lines);
          }
          return 1;
        })(l), w = (function(D) {
          for (var N = new Array(D), R = 0; R < D; R++) N[R] = { type: "element", tagName: "span", properties: { className: [] }, children: [] };
          return N;
        })(c.position.end.line), E = ["showlinenumbers=false", 'showlinenumbers="false"', "showlinenumbers={false}"], L = function() {
          var D, N, R = m.value, M = R[0], B = R[1];
          B.properties.className = ["code-line"];
          var H = j3t(c, function(j) {
            return j.position.start.line <= M + 1 && j.position.end.line >= M + 1;
          });
          B.children = H.children, !l.toLowerCase().includes("showLineNumbers".toLowerCase()) && !e.showLineNumbers || E.some(function(j) {
            return l.toLowerCase().includes(j);
          }) || (B.properties.line = [(M + v).toString()], B.properties.className.push("line-number")), _(M) && B.properties.className.push("highlight-line"), (d === "diff" || (D = d) != null && D.includes("diff-")) && EN(B).substring(0, 1) === "-" ? B.properties.className.push("deleted") : (d === "diff" || (N = d) != null && N.includes("diff-")) && EN(B).substring(0, 1) === "+" && B.properties.className.push("inserted");
        }, T = Zte(w.entries()); !(m = T()).done; ) L();
        w.length > 0 && EN(w[w.length - 1]).trim() === "" && w.pop(), n.children = w;
      }
    }
  };
}, R4t = N4t(ce);
class d6 {
  /**
   * @param {SchemaType['property']} property
   *   Property.
   * @param {SchemaType['normal']} normal
   *   Normal.
   * @param {Space | undefined} [space]
   *   Space.
   * @returns
   *   Schema.
   */
  constructor(e, t, n) {
    this.normal = t, this.property = e, n && (this.space = n);
  }
}
d6.prototype.normal = {};
d6.prototype.property = {};
d6.prototype.space = void 0;
function x7e(i, e) {
  const t = {}, n = {};
  for (const r of i)
    Object.assign(t, r.property), Object.assign(n, r.normal);
  return new d6(t, n, e);
}
function j5(i) {
  return i.toLowerCase();
}
class ef {
  /**
   * @param {string} property
   *   Property.
   * @param {string} attribute
   *   Attribute.
   * @returns
   *   Info.
   */
  constructor(e, t) {
    this.attribute = t, this.property = e;
  }
}
ef.prototype.attribute = "";
ef.prototype.booleanish = !1;
ef.prototype.boolean = !1;
ef.prototype.commaOrSpaceSeparated = !1;
ef.prototype.commaSeparated = !1;
ef.prototype.defined = !1;
ef.prototype.mustUseProperty = !1;
ef.prototype.number = !1;
ef.prototype.overloadedBoolean = !1;
ef.prototype.property = "";
ef.prototype.spaceSeparated = !1;
ef.prototype.space = void 0;
let A4t = 0;
const pr = gk(), hl = gk(), sde = gk(), $t = gk(), Bo = gk(), _R = gk(), vf = gk();
function gk() {
  return 2 ** ++A4t;
}
const ode = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  boolean: pr,
  booleanish: hl,
  commaOrSpaceSeparated: vf,
  commaSeparated: _R,
  number: $t,
  overloadedBoolean: sde,
  spaceSeparated: Bo
}, Symbol.toStringTag, { value: "Module" })), Qte = (
  /** @type {ReadonlyArray<keyof typeof types>} */
  Object.keys(ode)
);
class y0e extends ef {
  /**
   * @constructor
   * @param {string} property
   *   Property.
   * @param {string} attribute
   *   Attribute.
   * @param {number | null | undefined} [mask]
   *   Mask.
   * @param {Space | undefined} [space]
   *   Space.
   * @returns
   *   Info.
   */
  constructor(e, t, n, r) {
    let s = -1;
    if (super(e, t), GRe(this, "space", r), typeof n == "number")
      for (; ++s < Qte.length; ) {
        const o = Qte[s];
        GRe(this, Qte[s], (n & ode[o]) === ode[o]);
      }
  }
}
y0e.prototype.defined = !0;
function GRe(i, e, t) {
  t && (i[e] = t);
}
function C2(i) {
  const e = {}, t = {};
  for (const [n, r] of Object.entries(i.properties)) {
    const s = new y0e(
      n,
      i.transform(i.attributes || {}, n),
      r,
      i.space
    );
    i.mustUseProperty && i.mustUseProperty.includes(n) && (s.mustUseProperty = !0), e[n] = s, t[j5(n)] = n, t[j5(s.attribute)] = n;
  }
  return new d6(e, t, i.space);
}
const L7e = C2({
  properties: {
    ariaActiveDescendant: null,
    ariaAtomic: hl,
    ariaAutoComplete: null,
    ariaBusy: hl,
    ariaChecked: hl,
    ariaColCount: $t,
    ariaColIndex: $t,
    ariaColSpan: $t,
    ariaControls: Bo,
    ariaCurrent: null,
    ariaDescribedBy: Bo,
    ariaDetails: null,
    ariaDisabled: hl,
    ariaDropEffect: Bo,
    ariaErrorMessage: null,
    ariaExpanded: hl,
    ariaFlowTo: Bo,
    ariaGrabbed: hl,
    ariaHasPopup: null,
    ariaHidden: hl,
    ariaInvalid: null,
    ariaKeyShortcuts: null,
    ariaLabel: null,
    ariaLabelledBy: Bo,
    ariaLevel: $t,
    ariaLive: null,
    ariaModal: hl,
    ariaMultiLine: hl,
    ariaMultiSelectable: hl,
    ariaOrientation: null,
    ariaOwns: Bo,
    ariaPlaceholder: null,
    ariaPosInSet: $t,
    ariaPressed: hl,
    ariaReadOnly: hl,
    ariaRelevant: null,
    ariaRequired: hl,
    ariaRoleDescription: Bo,
    ariaRowCount: $t,
    ariaRowIndex: $t,
    ariaRowSpan: $t,
    ariaSelected: hl,
    ariaSetSize: $t,
    ariaSort: null,
    ariaValueMax: $t,
    ariaValueMin: $t,
    ariaValueNow: $t,
    ariaValueText: null,
    role: null
  },
  transform(i, e) {
    return e === "role" ? e : "aria-" + e.slice(4).toLowerCase();
  }
});
function T7e(i, e) {
  return e in i ? i[e] : e;
}
function k7e(i, e) {
  return T7e(i, e.toLowerCase());
}
const O4t = C2({
  attributes: {
    acceptcharset: "accept-charset",
    classname: "class",
    htmlfor: "for",
    httpequiv: "http-equiv"
  },
  mustUseProperty: ["checked", "multiple", "muted", "selected"],
  properties: {
    // Standard Properties.
    abbr: null,
    accept: _R,
    acceptCharset: Bo,
    accessKey: Bo,
    action: null,
    allow: null,
    allowFullScreen: pr,
    allowPaymentRequest: pr,
    allowUserMedia: pr,
    alt: null,
    as: null,
    async: pr,
    autoCapitalize: null,
    autoComplete: Bo,
    autoFocus: pr,
    autoPlay: pr,
    blocking: Bo,
    capture: null,
    charSet: null,
    checked: pr,
    cite: null,
    className: Bo,
    cols: $t,
    colSpan: null,
    content: null,
    contentEditable: hl,
    controls: pr,
    controlsList: Bo,
    coords: $t | _R,
    crossOrigin: null,
    data: null,
    dateTime: null,
    decoding: null,
    default: pr,
    defer: pr,
    dir: null,
    dirName: null,
    disabled: pr,
    download: sde,
    draggable: hl,
    encType: null,
    enterKeyHint: null,
    fetchPriority: null,
    form: null,
    formAction: null,
    formEncType: null,
    formMethod: null,
    formNoValidate: pr,
    formTarget: null,
    headers: Bo,
    height: $t,
    hidden: sde,
    high: $t,
    href: null,
    hrefLang: null,
    htmlFor: Bo,
    httpEquiv: Bo,
    id: null,
    imageSizes: null,
    imageSrcSet: null,
    inert: pr,
    inputMode: null,
    integrity: null,
    is: null,
    isMap: pr,
    itemId: null,
    itemProp: Bo,
    itemRef: Bo,
    itemScope: pr,
    itemType: Bo,
    kind: null,
    label: null,
    lang: null,
    language: null,
    list: null,
    loading: null,
    loop: pr,
    low: $t,
    manifest: null,
    max: null,
    maxLength: $t,
    media: null,
    method: null,
    min: null,
    minLength: $t,
    multiple: pr,
    muted: pr,
    name: null,
    nonce: null,
    noModule: pr,
    noValidate: pr,
    onAbort: null,
    onAfterPrint: null,
    onAuxClick: null,
    onBeforeMatch: null,
    onBeforePrint: null,
    onBeforeToggle: null,
    onBeforeUnload: null,
    onBlur: null,
    onCancel: null,
    onCanPlay: null,
    onCanPlayThrough: null,
    onChange: null,
    onClick: null,
    onClose: null,
    onContextLost: null,
    onContextMenu: null,
    onContextRestored: null,
    onCopy: null,
    onCueChange: null,
    onCut: null,
    onDblClick: null,
    onDrag: null,
    onDragEnd: null,
    onDragEnter: null,
    onDragExit: null,
    onDragLeave: null,
    onDragOver: null,
    onDragStart: null,
    onDrop: null,
    onDurationChange: null,
    onEmptied: null,
    onEnded: null,
    onError: null,
    onFocus: null,
    onFormData: null,
    onHashChange: null,
    onInput: null,
    onInvalid: null,
    onKeyDown: null,
    onKeyPress: null,
    onKeyUp: null,
    onLanguageChange: null,
    onLoad: null,
    onLoadedData: null,
    onLoadedMetadata: null,
    onLoadEnd: null,
    onLoadStart: null,
    onMessage: null,
    onMessageError: null,
    onMouseDown: null,
    onMouseEnter: null,
    onMouseLeave: null,
    onMouseMove: null,
    onMouseOut: null,
    onMouseOver: null,
    onMouseUp: null,
    onOffline: null,
    onOnline: null,
    onPageHide: null,
    onPageShow: null,
    onPaste: null,
    onPause: null,
    onPlay: null,
    onPlaying: null,
    onPopState: null,
    onProgress: null,
    onRateChange: null,
    onRejectionHandled: null,
    onReset: null,
    onResize: null,
    onScroll: null,
    onScrollEnd: null,
    onSecurityPolicyViolation: null,
    onSeeked: null,
    onSeeking: null,
    onSelect: null,
    onSlotChange: null,
    onStalled: null,
    onStorage: null,
    onSubmit: null,
    onSuspend: null,
    onTimeUpdate: null,
    onToggle: null,
    onUnhandledRejection: null,
    onUnload: null,
    onVolumeChange: null,
    onWaiting: null,
    onWheel: null,
    open: pr,
    optimum: $t,
    pattern: null,
    ping: Bo,
    placeholder: null,
    playsInline: pr,
    popover: null,
    popoverTarget: null,
    popoverTargetAction: null,
    poster: null,
    preload: null,
    readOnly: pr,
    referrerPolicy: null,
    rel: Bo,
    required: pr,
    reversed: pr,
    rows: $t,
    rowSpan: $t,
    sandbox: Bo,
    scope: null,
    scoped: pr,
    seamless: pr,
    selected: pr,
    shadowRootClonable: pr,
    shadowRootDelegatesFocus: pr,
    shadowRootMode: null,
    shape: null,
    size: $t,
    sizes: null,
    slot: null,
    span: $t,
    spellCheck: hl,
    src: null,
    srcDoc: null,
    srcLang: null,
    srcSet: null,
    start: $t,
    step: null,
    style: null,
    tabIndex: $t,
    target: null,
    title: null,
    translate: null,
    type: null,
    typeMustMatch: pr,
    useMap: null,
    value: hl,
    width: $t,
    wrap: null,
    writingSuggestions: null,
    // Legacy.
    // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
    align: null,
    // Several. Use CSS `text-align` instead,
    aLink: null,
    // `<body>`. Use CSS `a:active {color}` instead
    archive: Bo,
    // `<object>`. List of URIs to archives
    axis: null,
    // `<td>` and `<th>`. Use `scope` on `<th>`
    background: null,
    // `<body>`. Use CSS `background-image` instead
    bgColor: null,
    // `<body>` and table elements. Use CSS `background-color` instead
    border: $t,
    // `<table>`. Use CSS `border-width` instead,
    borderColor: null,
    // `<table>`. Use CSS `border-color` instead,
    bottomMargin: $t,
    // `<body>`
    cellPadding: null,
    // `<table>`
    cellSpacing: null,
    // `<table>`
    char: null,
    // Several table elements. When `align=char`, sets the character to align on
    charOff: null,
    // Several table elements. When `char`, offsets the alignment
    classId: null,
    // `<object>`
    clear: null,
    // `<br>`. Use CSS `clear` instead
    code: null,
    // `<object>`
    codeBase: null,
    // `<object>`
    codeType: null,
    // `<object>`
    color: null,
    // `<font>` and `<hr>`. Use CSS instead
    compact: pr,
    // Lists. Use CSS to reduce space between items instead
    declare: pr,
    // `<object>`
    event: null,
    // `<script>`
    face: null,
    // `<font>`. Use CSS instead
    frame: null,
    // `<table>`
    frameBorder: null,
    // `<iframe>`. Use CSS `border` instead
    hSpace: $t,
    // `<img>` and `<object>`
    leftMargin: $t,
    // `<body>`
    link: null,
    // `<body>`. Use CSS `a:link {color: *}` instead
    longDesc: null,
    // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
    lowSrc: null,
    // `<img>`. Use a `<picture>`
    marginHeight: $t,
    // `<body>`
    marginWidth: $t,
    // `<body>`
    noResize: pr,
    // `<frame>`
    noHref: pr,
    // `<area>`. Use no href instead of an explicit `nohref`
    noShade: pr,
    // `<hr>`. Use background-color and height instead of borders
    noWrap: pr,
    // `<td>` and `<th>`
    object: null,
    // `<applet>`
    profile: null,
    // `<head>`
    prompt: null,
    // `<isindex>`
    rev: null,
    // `<link>`
    rightMargin: $t,
    // `<body>`
    rules: null,
    // `<table>`
    scheme: null,
    // `<meta>`
    scrolling: hl,
    // `<frame>`. Use overflow in the child context
    standby: null,
    // `<object>`
    summary: null,
    // `<table>`
    text: null,
    // `<body>`. Use CSS `color` instead
    topMargin: $t,
    // `<body>`
    valueType: null,
    // `<param>`
    version: null,
    // `<html>`. Use a doctype.
    vAlign: null,
    // Several. Use CSS `vertical-align` instead
    vLink: null,
    // `<body>`. Use CSS `a:visited {color}` instead
    vSpace: $t,
    // `<img>` and `<object>`
    // Non-standard Properties.
    allowTransparency: null,
    autoCorrect: null,
    autoSave: null,
    disablePictureInPicture: pr,
    disableRemotePlayback: pr,
    prefix: null,
    property: null,
    results: $t,
    security: null,
    unselectable: null
  },
  space: "html",
  transform: k7e
}), M4t = C2({
  attributes: {
    accentHeight: "accent-height",
    alignmentBaseline: "alignment-baseline",
    arabicForm: "arabic-form",
    baselineShift: "baseline-shift",
    capHeight: "cap-height",
    className: "class",
    clipPath: "clip-path",
    clipRule: "clip-rule",
    colorInterpolation: "color-interpolation",
    colorInterpolationFilters: "color-interpolation-filters",
    colorProfile: "color-profile",
    colorRendering: "color-rendering",
    crossOrigin: "crossorigin",
    dataType: "datatype",
    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",
    hrefLang: "hreflang",
    horizAdvX: "horiz-adv-x",
    horizOriginX: "horiz-origin-x",
    horizOriginY: "horiz-origin-y",
    imageRendering: "image-rendering",
    letterSpacing: "letter-spacing",
    lightingColor: "lighting-color",
    markerEnd: "marker-end",
    markerMid: "marker-mid",
    markerStart: "marker-start",
    navDown: "nav-down",
    navDownLeft: "nav-down-left",
    navDownRight: "nav-down-right",
    navLeft: "nav-left",
    navNext: "nav-next",
    navPrev: "nav-prev",
    navRight: "nav-right",
    navUp: "nav-up",
    navUpLeft: "nav-up-left",
    navUpRight: "nav-up-right",
    onAbort: "onabort",
    onActivate: "onactivate",
    onAfterPrint: "onafterprint",
    onBeforePrint: "onbeforeprint",
    onBegin: "onbegin",
    onCancel: "oncancel",
    onCanPlay: "oncanplay",
    onCanPlayThrough: "oncanplaythrough",
    onChange: "onchange",
    onClick: "onclick",
    onClose: "onclose",
    onCopy: "oncopy",
    onCueChange: "oncuechange",
    onCut: "oncut",
    onDblClick: "ondblclick",
    onDrag: "ondrag",
    onDragEnd: "ondragend",
    onDragEnter: "ondragenter",
    onDragExit: "ondragexit",
    onDragLeave: "ondragleave",
    onDragOver: "ondragover",
    onDragStart: "ondragstart",
    onDrop: "ondrop",
    onDurationChange: "ondurationchange",
    onEmptied: "onemptied",
    onEnd: "onend",
    onEnded: "onended",
    onError: "onerror",
    onFocus: "onfocus",
    onFocusIn: "onfocusin",
    onFocusOut: "onfocusout",
    onHashChange: "onhashchange",
    onInput: "oninput",
    onInvalid: "oninvalid",
    onKeyDown: "onkeydown",
    onKeyPress: "onkeypress",
    onKeyUp: "onkeyup",
    onLoad: "onload",
    onLoadedData: "onloadeddata",
    onLoadedMetadata: "onloadedmetadata",
    onLoadStart: "onloadstart",
    onMessage: "onmessage",
    onMouseDown: "onmousedown",
    onMouseEnter: "onmouseenter",
    onMouseLeave: "onmouseleave",
    onMouseMove: "onmousemove",
    onMouseOut: "onmouseout",
    onMouseOver: "onmouseover",
    onMouseUp: "onmouseup",
    onMouseWheel: "onmousewheel",
    onOffline: "onoffline",
    onOnline: "ononline",
    onPageHide: "onpagehide",
    onPageShow: "onpageshow",
    onPaste: "onpaste",
    onPause: "onpause",
    onPlay: "onplay",
    onPlaying: "onplaying",
    onPopState: "onpopstate",
    onProgress: "onprogress",
    onRateChange: "onratechange",
    onRepeat: "onrepeat",
    onReset: "onreset",
    onResize: "onresize",
    onScroll: "onscroll",
    onSeeked: "onseeked",
    onSeeking: "onseeking",
    onSelect: "onselect",
    onShow: "onshow",
    onStalled: "onstalled",
    onStorage: "onstorage",
    onSubmit: "onsubmit",
    onSuspend: "onsuspend",
    onTimeUpdate: "ontimeupdate",
    onToggle: "ontoggle",
    onUnload: "onunload",
    onVolumeChange: "onvolumechange",
    onWaiting: "onwaiting",
    onZoom: "onzoom",
    overlinePosition: "overline-position",
    overlineThickness: "overline-thickness",
    paintOrder: "paint-order",
    panose1: "panose-1",
    pointerEvents: "pointer-events",
    referrerPolicy: "referrerpolicy",
    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",
    tabIndex: "tabindex",
    textAnchor: "text-anchor",
    textDecoration: "text-decoration",
    textRendering: "text-rendering",
    transformOrigin: "transform-origin",
    typeOf: "typeof",
    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",
    xHeight: "x-height",
    // These were camelcased in Tiny. Now lowercased in SVG 2
    playbackOrder: "playbackorder",
    timelineBegin: "timelinebegin"
  },
  properties: {
    about: vf,
    accentHeight: $t,
    accumulate: null,
    additive: null,
    alignmentBaseline: null,
    alphabetic: $t,
    amplitude: $t,
    arabicForm: null,
    ascent: $t,
    attributeName: null,
    attributeType: null,
    azimuth: $t,
    bandwidth: null,
    baselineShift: null,
    baseFrequency: null,
    baseProfile: null,
    bbox: null,
    begin: null,
    bias: $t,
    by: null,
    calcMode: null,
    capHeight: $t,
    className: Bo,
    clip: null,
    clipPath: null,
    clipPathUnits: null,
    clipRule: null,
    color: null,
    colorInterpolation: null,
    colorInterpolationFilters: null,
    colorProfile: null,
    colorRendering: null,
    content: null,
    contentScriptType: null,
    contentStyleType: null,
    crossOrigin: null,
    cursor: null,
    cx: null,
    cy: null,
    d: null,
    dataType: null,
    defaultAction: null,
    descent: $t,
    diffuseConstant: $t,
    direction: null,
    display: null,
    dur: null,
    divisor: $t,
    dominantBaseline: null,
    download: pr,
    dx: null,
    dy: null,
    edgeMode: null,
    editable: null,
    elevation: $t,
    enableBackground: null,
    end: null,
    event: null,
    exponent: $t,
    externalResourcesRequired: null,
    fill: null,
    fillOpacity: $t,
    fillRule: null,
    filter: null,
    filterRes: null,
    filterUnits: null,
    floodColor: null,
    floodOpacity: null,
    focusable: null,
    focusHighlight: null,
    fontFamily: null,
    fontSize: null,
    fontSizeAdjust: null,
    fontStretch: null,
    fontStyle: null,
    fontVariant: null,
    fontWeight: null,
    format: null,
    fr: null,
    from: null,
    fx: null,
    fy: null,
    g1: _R,
    g2: _R,
    glyphName: _R,
    glyphOrientationHorizontal: null,
    glyphOrientationVertical: null,
    glyphRef: null,
    gradientTransform: null,
    gradientUnits: null,
    handler: null,
    hanging: $t,
    hatchContentUnits: null,
    hatchUnits: null,
    height: null,
    href: null,
    hrefLang: null,
    horizAdvX: $t,
    horizOriginX: $t,
    horizOriginY: $t,
    id: null,
    ideographic: $t,
    imageRendering: null,
    initialVisibility: null,
    in: null,
    in2: null,
    intercept: $t,
    k: $t,
    k1: $t,
    k2: $t,
    k3: $t,
    k4: $t,
    kernelMatrix: vf,
    kernelUnitLength: null,
    keyPoints: null,
    // SEMI_COLON_SEPARATED
    keySplines: null,
    // SEMI_COLON_SEPARATED
    keyTimes: null,
    // SEMI_COLON_SEPARATED
    kerning: null,
    lang: null,
    lengthAdjust: null,
    letterSpacing: null,
    lightingColor: null,
    limitingConeAngle: $t,
    local: null,
    markerEnd: null,
    markerMid: null,
    markerStart: null,
    markerHeight: null,
    markerUnits: null,
    markerWidth: null,
    mask: null,
    maskContentUnits: null,
    maskUnits: null,
    mathematical: null,
    max: null,
    media: null,
    mediaCharacterEncoding: null,
    mediaContentEncodings: null,
    mediaSize: $t,
    mediaTime: null,
    method: null,
    min: null,
    mode: null,
    name: null,
    navDown: null,
    navDownLeft: null,
    navDownRight: null,
    navLeft: null,
    navNext: null,
    navPrev: null,
    navRight: null,
    navUp: null,
    navUpLeft: null,
    navUpRight: null,
    numOctaves: null,
    observer: null,
    offset: null,
    onAbort: null,
    onActivate: null,
    onAfterPrint: null,
    onBeforePrint: null,
    onBegin: null,
    onCancel: null,
    onCanPlay: null,
    onCanPlayThrough: null,
    onChange: null,
    onClick: null,
    onClose: null,
    onCopy: null,
    onCueChange: null,
    onCut: null,
    onDblClick: null,
    onDrag: null,
    onDragEnd: null,
    onDragEnter: null,
    onDragExit: null,
    onDragLeave: null,
    onDragOver: null,
    onDragStart: null,
    onDrop: null,
    onDurationChange: null,
    onEmptied: null,
    onEnd: null,
    onEnded: null,
    onError: null,
    onFocus: null,
    onFocusIn: null,
    onFocusOut: null,
    onHashChange: null,
    onInput: null,
    onInvalid: null,
    onKeyDown: null,
    onKeyPress: null,
    onKeyUp: null,
    onLoad: null,
    onLoadedData: null,
    onLoadedMetadata: null,
    onLoadStart: null,
    onMessage: null,
    onMouseDown: null,
    onMouseEnter: null,
    onMouseLeave: null,
    onMouseMove: null,
    onMouseOut: null,
    onMouseOver: null,
    onMouseUp: null,
    onMouseWheel: null,
    onOffline: null,
    onOnline: null,
    onPageHide: null,
    onPageShow: null,
    onPaste: null,
    onPause: null,
    onPlay: null,
    onPlaying: null,
    onPopState: null,
    onProgress: null,
    onRateChange: null,
    onRepeat: null,
    onReset: null,
    onResize: null,
    onScroll: null,
    onSeeked: null,
    onSeeking: null,
    onSelect: null,
    onShow: null,
    onStalled: null,
    onStorage: null,
    onSubmit: null,
    onSuspend: null,
    onTimeUpdate: null,
    onToggle: null,
    onUnload: null,
    onVolumeChange: null,
    onWaiting: null,
    onZoom: null,
    opacity: null,
    operator: null,
    order: null,
    orient: null,
    orientation: null,
    origin: null,
    overflow: null,
    overlay: null,
    overlinePosition: $t,
    overlineThickness: $t,
    paintOrder: null,
    panose1: null,
    path: null,
    pathLength: $t,
    patternContentUnits: null,
    patternTransform: null,
    patternUnits: null,
    phase: null,
    ping: Bo,
    pitch: null,
    playbackOrder: null,
    pointerEvents: null,
    points: null,
    pointsAtX: $t,
    pointsAtY: $t,
    pointsAtZ: $t,
    preserveAlpha: null,
    preserveAspectRatio: null,
    primitiveUnits: null,
    propagate: null,
    property: vf,
    r: null,
    radius: null,
    referrerPolicy: null,
    refX: null,
    refY: null,
    rel: vf,
    rev: vf,
    renderingIntent: null,
    repeatCount: null,
    repeatDur: null,
    requiredExtensions: vf,
    requiredFeatures: vf,
    requiredFonts: vf,
    requiredFormats: vf,
    resource: null,
    restart: null,
    result: null,
    rotate: null,
    rx: null,
    ry: null,
    scale: null,
    seed: null,
    shapeRendering: null,
    side: null,
    slope: null,
    snapshotTime: null,
    specularConstant: $t,
    specularExponent: $t,
    spreadMethod: null,
    spacing: null,
    startOffset: null,
    stdDeviation: null,
    stemh: null,
    stemv: null,
    stitchTiles: null,
    stopColor: null,
    stopOpacity: null,
    strikethroughPosition: $t,
    strikethroughThickness: $t,
    string: null,
    stroke: null,
    strokeDashArray: vf,
    strokeDashOffset: null,
    strokeLineCap: null,
    strokeLineJoin: null,
    strokeMiterLimit: $t,
    strokeOpacity: $t,
    strokeWidth: null,
    style: null,
    surfaceScale: $t,
    syncBehavior: null,
    syncBehaviorDefault: null,
    syncMaster: null,
    syncTolerance: null,
    syncToleranceDefault: null,
    systemLanguage: vf,
    tabIndex: $t,
    tableValues: null,
    target: null,
    targetX: $t,
    targetY: $t,
    textAnchor: null,
    textDecoration: null,
    textRendering: null,
    textLength: null,
    timelineBegin: null,
    title: null,
    transformBehavior: null,
    type: null,
    typeOf: vf,
    to: null,
    transform: null,
    transformOrigin: null,
    u1: null,
    u2: null,
    underlinePosition: $t,
    underlineThickness: $t,
    unicode: null,
    unicodeBidi: null,
    unicodeRange: null,
    unitsPerEm: $t,
    values: null,
    vAlphabetic: $t,
    vMathematical: $t,
    vectorEffect: null,
    vHanging: $t,
    vIdeographic: $t,
    version: null,
    vertAdvY: $t,
    vertOriginX: $t,
    vertOriginY: $t,
    viewBox: null,
    viewTarget: null,
    visibility: null,
    width: null,
    widths: null,
    wordSpacing: null,
    writingMode: null,
    x: null,
    x1: null,
    x2: null,
    xChannelSelector: null,
    xHeight: $t,
    y: null,
    y1: null,
    y2: null,
    yChannelSelector: null,
    z: null,
    zoomAndPan: null
  },
  space: "svg",
  transform: T7e
}), D7e = C2({
  properties: {
    xLinkActuate: null,
    xLinkArcRole: null,
    xLinkHref: null,
    xLinkRole: null,
    xLinkShow: null,
    xLinkTitle: null,
    xLinkType: null
  },
  space: "xlink",
  transform(i, e) {
    return "xlink:" + e.slice(5).toLowerCase();
  }
}), I7e = C2({
  attributes: { xmlnsxlink: "xmlns:xlink" },
  properties: { xmlnsXLink: null, xmlns: null },
  space: "xmlns",
  transform: k7e
}), N7e = C2({
  properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
  space: "xml",
  transform(i, e) {
    return "xml:" + e.slice(3).toLowerCase();
  }
}), P4t = {
  classId: "classID",
  dataType: "datatype",
  itemId: "itemID",
  strokeDashArray: "strokeDasharray",
  strokeDashOffset: "strokeDashoffset",
  strokeLineCap: "strokeLinecap",
  strokeLineJoin: "strokeLinejoin",
  strokeMiterLimit: "strokeMiterlimit",
  typeOf: "typeof",
  xLinkActuate: "xlinkActuate",
  xLinkArcRole: "xlinkArcrole",
  xLinkHref: "xlinkHref",
  xLinkRole: "xlinkRole",
  xLinkShow: "xlinkShow",
  xLinkTitle: "xlinkTitle",
  xLinkType: "xlinkType",
  xmlnsXLink: "xmlnsXlink"
}, F4t = /[A-Z]/g, qRe = /-[a-z]/g, B4t = /^data[-\w.:]+$/i;
function h6(i, e) {
  const t = j5(e);
  let n = e, r = ef;
  if (t in i.normal)
    return i.property[i.normal[t]];
  if (t.length > 4 && t.slice(0, 4) === "data" && B4t.test(e)) {
    if (e.charAt(4) === "-") {
      const s = e.slice(5).replace(qRe, W4t);
      n = "data" + s.charAt(0).toUpperCase() + s.slice(1);
    } else {
      const s = e.slice(4);
      if (!qRe.test(s)) {
        let o = s.replace(F4t, H4t);
        o.charAt(0) !== "-" && (o = "-" + o), e = "data" + o;
      }
    }
    r = y0e;
  }
  return new r(n, e);
}
function H4t(i) {
  return "-" + i.toLowerCase();
}
function W4t(i) {
  return i.charAt(1).toUpperCase();
}
const w2 = x7e([L7e, O4t, D7e, I7e, N7e], "html"), _0 = x7e([L7e, M4t, D7e, I7e, N7e], "svg");
var tV = {}, ade = {};
function V4t(i, e) {
  for (var t = e, n = 0; n < i.length; n++) {
    var r = n === i.length - 1, s = i.charAt(n), o = t[s] || (t[s] = { chars: {} });
    r && (o.self = i), t = o.chars;
  }
}
function KRe(i) {
  if (i.length === 0)
    return tV;
  for (var e = {}, t = 0, n = i; t < n.length; t++) {
    var r = n[t];
    V4t(r, e);
  }
  return e;
}
function U4t(i) {
  if (i.length === 0)
    return ade;
  for (var e = {}, t = 0, n = i; t < n.length; t++) {
    var r = n[t];
    e[r] = !0;
  }
  return e;
}
var XH = {}, YRe = {
  type: "String",
  optional: !0
};
function z4t(i) {
  var e = {
    type: "NoArgument",
    optional: !1
  };
  function t(o) {
    if (e.type && e.type !== o && e.type !== "NoArgument")
      throw new Error('Conflicting pseudo-class argument type: "'.concat(e.type, '" vs "').concat(o, '".'));
    e.type = o;
  }
  for (var n = 0, r = i; n < r.length; n++) {
    var s = r[n];
    s === "NoArgument" && (e.optional = !0), s === "Formula" && t("Formula"), s === "FormulaOfSelector" && (t("Formula"), e.ofSelector = !0), s === "String" && t("String"), s === "Selector" && t("Selector");
  }
  return e;
}
function $4t(i) {
  for (var e = {}, t = 0, n = Object.keys(i); t < n.length; t++) {
    var r = n[t], s = i[r];
    if (s)
      for (var o = 0, a = s; o < a.length; o++) {
        var l = a[o];
        (e[l] || (e[l] = [])).push(r);
      }
  }
  return e;
}
function XRe(i) {
  for (var e = $4t(i), t = {}, n = 0, r = Object.keys(e); n < r.length; n++) {
    var s = r[n], o = e[s];
    o && (t[s] = z4t(o));
  }
  return t;
}
var kA = function() {
  return kA = Object.assign || function(i) {
    for (var e, t = 1, n = arguments.length; t < n; t++) {
      e = arguments[t];
      for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
    }
    return i;
  }, kA.apply(this, arguments);
}, j4t = {}, lde = { wildcard: !0 };
function G4t(i) {
  return i ? typeof i == "boolean" ? lde : i : j4t;
}
function q4t(i, e) {
  return function(t, n) {
    return e(i(t), i(n));
  };
}
function K4t(i) {
  return function(e, t) {
    var n = i(e, t);
    if (!n)
      throw new Error("Syntax definition cannot be null or undefined.");
    return n;
  };
}
function ZRe(i, e) {
  return function(t, n) {
    return n === !0 ? i : e(t === !0 ? i : t, n);
  };
}
function FI(i) {
  return function(e, t) {
    if (!t || !e)
      return t;
    if (typeof t != "object" || t === null)
      throw new Error("Unexpected syntax definition extension type: ".concat(t, "."));
    for (var n = kA({}, e), r = 0, s = Object.entries(t); r < s.length; r++) {
      var o = s[r], a = o[0], l = o[1];
      if (a !== "latest") {
        var c = i[a];
        n[a] = c(e[a], l);
      }
    }
    return n;
  };
}
function __(i, e) {
  return e !== void 0 ? e : i;
}
function ZH(i, e) {
  return e ? i ? i.concat(e) : e : i;
}
function QRe(i, e) {
  if (!e)
    return i;
  if (!i)
    return e;
  for (var t = kA({}, i), n = 0, r = Object.entries(e); n < r.length; n++) {
    var s = r[n], o = s[0], a = s[1];
    if (!a) {
      delete t[o];
      continue;
    }
    var l = i[o];
    if (!l) {
      t[o] = a;
      continue;
    }
    t[o] = l.concat(a);
  }
  return t;
}
var Kx = K4t(FI({
  baseSyntax: __,
  modules: ZH,
  tag: ZRe(lde, FI({
    wildcard: __
  })),
  ids: __,
  classNames: __,
  nestingSelector: __,
  namespace: ZRe(lde, FI({
    wildcard: __
  })),
  combinators: ZH,
  attributes: FI({
    operators: ZH,
    caseSensitivityModifiers: ZH,
    unknownCaseSensitivityModifiers: __
  }),
  pseudoClasses: FI({
    unknown: __,
    definitions: QRe
  }),
  pseudoElements: FI({
    unknown: __,
    notation: __,
    definitions: q4t(function(i) {
      return Array.isArray(i) ? { NoArgument: i } : i;
    }, QRe)
  })
})), R7e = {
  tag: {},
  ids: !0,
  classNames: !0,
  combinators: [],
  pseudoElements: {
    unknown: "reject",
    notation: "singleColon",
    definitions: ["first-letter", "first-line"]
  },
  pseudoClasses: {
    unknown: "reject",
    definitions: {
      NoArgument: ["link", "visited", "active"]
    }
  }
}, A7e = Kx(R7e, {
  tag: { wildcard: !0 },
  combinators: [">", "+"],
  attributes: {
    unknownCaseSensitivityModifiers: "reject",
    operators: ["=", "~=", "|="]
  },
  pseudoElements: {
    definitions: ["before", "after"]
  },
  pseudoClasses: {
    unknown: "reject",
    definitions: {
      NoArgument: ["hover", "focus", "first-child"],
      String: ["lang"]
    }
  }
}), cde = Kx(A7e, {
  namespace: {
    wildcard: !0
  },
  combinators: ["~"],
  attributes: {
    operators: ["^=", "$=", "*="]
  },
  pseudoElements: {
    notation: "both"
  },
  pseudoClasses: {
    definitions: {
      NoArgument: [
        "root",
        "last-child",
        "first-of-type",
        "last-of-type",
        "only-child",
        "only-of-type",
        "empty",
        "target",
        "enabled",
        "disabled",
        "checked",
        "indeterminate"
      ],
      Formula: ["nth-child", "nth-last-child", "nth-of-type", "nth-last-of-type"],
      Selector: ["not"]
    }
  }
}), O7e = Kx(cde, {
  combinators: ["||"],
  attributes: {
    caseSensitivityModifiers: ["i", "I", "s", "S"]
  },
  pseudoClasses: {
    definitions: {
      NoArgument: [
        "any-link",
        "local-link",
        "target-within",
        "scope",
        "current",
        "past",
        "future",
        "focus-within",
        "focus-visible",
        "read-write",
        "read-only",
        "placeholder-shown",
        "default",
        "valid",
        "invalid",
        "in-range",
        "out-of-range",
        "required",
        "optional",
        "blank",
        "user-invalid",
        "playing",
        "paused",
        "autofill",
        "modal",
        "fullscreen",
        "picture-in-picture",
        "defined",
        "loading",
        "popover-open"
      ],
      Formula: ["nth-col", "nth-last-col"],
      String: ["dir"],
      FormulaOfSelector: ["nth-child", "nth-last-child"],
      Selector: ["current", "is", "where", "has", "state"]
    }
  },
  pseudoElements: {
    definitions: {
      NoArgument: ["marker"]
    }
  }
}), B$ = {
  "css-position-1": {
    latest: !1,
    pseudoClasses: {
      definitions: {
        NoArgument: ["static", "relative", "absolute"]
      }
    }
  },
  "css-position-2": {
    latest: !1,
    pseudoClasses: {
      definitions: {
        NoArgument: ["static", "relative", "absolute", "fixed"]
      }
    }
  },
  "css-position-3": {
    latest: !1,
    pseudoClasses: {
      definitions: {
        NoArgument: ["sticky", "fixed", "absolute", "relative", "static"]
      }
    }
  },
  "css-position-4": {
    latest: !0,
    pseudoClasses: {
      definitions: {
        NoArgument: ["sticky", "fixed", "absolute", "relative", "static", "initial"]
      }
    }
  },
  "css-scoping-1": {
    latest: !0,
    pseudoClasses: {
      definitions: {
        NoArgument: ["host", "host-context"],
        Selector: ["host", "host-context"]
      }
    },
    pseudoElements: {
      definitions: {
        Selector: ["slotted"]
      }
    }
  },
  "css-pseudo-4": {
    latest: !0,
    pseudoElements: {
      definitions: {
        NoArgument: [
          "marker",
          "selection",
          "target-text",
          "search-text",
          "spelling-error",
          "grammar-error",
          "backdrop",
          "file-selector-button",
          "prefix",
          "postfix",
          "placeholder",
          "details-content"
        ],
        String: ["highlight"]
      }
    }
  },
  "css-shadow-parts-1": {
    latest: !0,
    pseudoElements: {
      definitions: {
        String: ["part"]
      }
    }
  },
  "css-nesting-1": {
    latest: !0,
    nestingSelector: !0
  }
}, M7e = kA(kA({}, O7e), { modules: Object.entries(B$).filter(function(i) {
  var e = i[1].latest;
  return e;
}).map(function(i) {
  var e = i[0];
  return e;
}) }), Y4t = Kx(M7e, {
  pseudoElements: {
    unknown: "accept"
  },
  pseudoClasses: {
    unknown: "accept"
  },
  attributes: {
    unknownCaseSensitivityModifiers: "accept"
  }
}), ude = {
  css1: R7e,
  css2: A7e,
  css3: cde,
  "selectors-3": cde,
  "selectors-4": O7e,
  latest: M7e,
  progressive: Y4t
};
function X4t() {
  for (var i = {
    pseudoClasses: {},
    pseudoElements: {}
  }, e = ["css1", "css2", "css3", "selectors-3", "selectors-4"], t = 0, n = e; t < n.length; t++) {
    var r = n[t], s = ude[r];
    if (s.pseudoClasses && typeof s.pseudoClasses == "object") {
      var o = s.pseudoClasses.definitions;
      if (o)
        for (var a = 0, l = Object.entries(o); a < l.length; a++)
          for (var c = l[a], u = c[1], d = 0, h = u; d < h.length; d++) {
            var g = h[d];
            i.pseudoClasses[g] || (i.pseudoClasses[g] = []), i.pseudoClasses[g].includes(r) || i.pseudoClasses[g].push(r);
          }
    }
    if (s.pseudoElements && typeof s.pseudoElements == "object") {
      var o = s.pseudoElements.definitions;
      if (o)
        if (Array.isArray(o))
          for (var m = 0, _ = o; m < _.length; m++) {
            var v = _[m];
            i.pseudoElements[v] || (i.pseudoElements[v] = []), i.pseudoElements[v].includes(r) || i.pseudoElements[v].push(r);
          }
        else
          for (var w = 0, E = Object.values(o); w < E.length; w++)
            for (var u = E[w], L = 0, T = u; L < T.length; L++) {
              var D = T[L];
              i.pseudoElements[D] || (i.pseudoElements[D] = []), i.pseudoElements[D].includes(r) || i.pseudoElements[D].push(r);
            }
    }
  }
  for (var N = 0, R = Object.entries(B$); N < R.length; N++) {
    var M = R[N], B = M[0], H = M[1];
    if (H.pseudoClasses && typeof H.pseudoClasses == "object") {
      var o = H.pseudoClasses.definitions;
      if (o)
        for (var j = 0, K = Object.values(o); j < K.length; j++)
          for (var u = K[j], X = 0, Y = u; X < Y.length; X++) {
            var G = Y[X];
            i.pseudoClasses[G] || (i.pseudoClasses[G] = []), i.pseudoClasses[G].includes(B) || i.pseudoClasses[G].push(B);
          }
    }
    if (H.pseudoElements && typeof H.pseudoElements == "object") {
      var o = H.pseudoElements.definitions;
      if (o)
        if (Array.isArray(o))
          for (var Q = 0, oe = o; Q < oe.length; Q++) {
            var Z = oe[Q];
            i.pseudoElements[Z] || (i.pseudoElements[Z] = []), i.pseudoElements[Z].includes(B) || i.pseudoElements[Z].push(B);
          }
        else
          for (var pe = 0, J = Object.values(o); pe < J.length; pe++)
            for (var u = J[pe], ae = 0, be = u; ae < be.length; ae++) {
              var re = be[ae];
              i.pseudoElements[re] || (i.pseudoElements[re] = []), i.pseudoElements[re].includes(B) || i.pseudoElements[re].push(B);
            }
    }
  }
  return i;
}
var JRe = X4t();
function vP(i) {
  return i >= "a" && i <= "z" || i >= "A" && i <= "Z" || i === "-" || i === "_" || i === "\\" || i >= " ";
}
function eAe(i) {
  return i >= "a" && i <= "z" || i >= "A" && i <= "Z" || i >= "0" && i <= "9" || i === "-" || i === "_" || i >= " ";
}
function yP(i) {
  return i >= "a" && i <= "f" || i >= "A" && i <= "F" || i >= "0" && i <= "9";
}
var Z4t = {
  " ": !0,
  "	": !0,
  "\n": !0,
  "\r": !0,
  "\f": !0
}, Q4t = {
  '"': !0,
  "'": !0
}, Jte = {
  0: !0,
  1: !0,
  2: !0,
  3: !0,
  4: !0,
  5: !0,
  6: !0,
  7: !0,
  8: !0,
  9: !0
}, J4t = 6, ene = "css-selector-parser parse error: ";
function e5t(i) {
  i === void 0 && (i = {});
  var e = i.syntax, t = e === void 0 ? "latest" : e, n = i.substitutes, r = i.strict, s = r === void 0 ? !0 : r, o = i.modules, a = typeof t == "object" ? t : ude[t];
  if (a.baseSyntax && (a = Kx(ude[a.baseSyntax], a)), a.modules && a.modules.length > 0)
    for (var l = 0, c = a.modules; l < c.length; l++) {
      var u = c[l], d = B$[u];
      d && (a = Kx(d, a));
    }
  if (o && o.length > 0)
    for (var h = 0, g = o; h < g.length; h++) {
      var m = g[h], d = B$[m];
      d && (a = Kx(d, a));
    }
  var _ = a.tag ? [!0, !!G4t(a.tag).wildcard] : [!1, !1], v = _[0], w = _[1], E = !!a.ids, L = !!a.classNames, T = !!a.nestingSelector, D = !!a.namespace, N = a.namespace && (a.namespace === !0 || a.namespace.wildcard === !0);
  if (D && !v)
    throw new Error("".concat(ene, "Namespaces cannot be enabled while tags are disabled."));
  var R = !!n, M = a.combinators ? KRe(a.combinators) : tV, B = a.attributes ? [
    !0,
    a.attributes.operators ? KRe(a.attributes.operators) : tV,
    a.attributes.caseSensitivityModifiers ? U4t(a.attributes.caseSensitivityModifiers) : ade,
    a.attributes.unknownCaseSensitivityModifiers === "accept"
  ] : [!1, tV, ade, !1], H = B[0], j = B[1], K = B[2], X = B[3], Y = X || Object.keys(K).length > 0, G = a.pseudoClasses ? [
    !0,
    a.pseudoClasses.definitions ? XRe(a.pseudoClasses.definitions) : XH,
    a.pseudoClasses.unknown === "accept"
  ] : [!1, XH, !1], Q = G[0], oe = G[1], Z = G[2], pe = a.pseudoElements ? [
    !0,
    a.pseudoElements.notation === "singleColon" || a.pseudoElements.notation === "both",
    !a.pseudoElements.notation || a.pseudoElements.notation === "doubleColon" || a.pseudoElements.notation === "both",
    a.pseudoElements.definitions ? XRe(Array.isArray(a.pseudoElements.definitions) ? { NoArgument: a.pseudoElements.definitions } : a.pseudoElements.definitions) : XH,
    a.pseudoElements.unknown === "accept"
  ] : [!1, !1, !1, XH, !1], J = pe[0], ae = pe[1], be = pe[2], re = pe[3], ze = pe[4], Ve = "", st = Ve.length, ot = 0, et = "", at = function(lt) {
    return et === lt;
  }, en = function() {
    return at("*") || vP(et);
  }, sn = function(lt) {
    ot = lt, et = Ve.charAt(ot);
  }, Vt = function() {
    ot++, et = Ve.charAt(ot);
  }, Bi = function() {
    var lt = et;
    return ot++, et = Ve.charAt(ot), lt;
  };
  function pi(lt) {
    var Bt = Math.min(st - 1, ot), Mn = new Error("".concat(ene).concat(lt, " Pos: ").concat(Bt, "."));
    throw Mn.position = Bt, Mn.name = "ParserError", Mn;
  }
  function tn(lt, Bt) {
    if (!lt)
      return pi(Bt);
  }
  var Vr = function() {
    tn(ot < st, "Unexpected end of input.");
  }, tr = function() {
    return ot >= st;
  }, qr = function(lt) {
    tn(ot < st, 'Expected "'.concat(lt, '" but end of input reached.')), tn(et === lt, 'Expected "'.concat(lt, '" but "').concat(et, '" found.')), ot++, et = Ve.charAt(ot);
  };
  function Bs(lt) {
    var Bt = Ts(lt, ot);
    if (Bt)
      return ot += Bt.length, et = Ve.charAt(ot), Bt;
  }
  function Ts(lt, Bt) {
    var Mn = Ve.charAt(Bt), gn = lt[Mn];
    if (gn) {
      var yi = Ts(gn.chars, Bt + 1);
      if (yi)
        return yi;
      if (gn.self)
        return gn.self;
    }
  }
  function ts() {
    for (var lt = Bi(), Bt = 1; yP(et) && Bt < J4t; )
      lt += Bi(), Bt++;
    return Hs(), String.fromCharCode(parseInt(lt, 16));
  }
  function io(lt) {
    var Bt = "";
    for (qr(lt); ot < st; ) {
      if (at(lt))
        return Vt(), Bt;
      at("\\") ? (Vt(), at(lt) ? (Bt += lt, Vt()) : et === `
` || et === "\f" ? Vt() : et === "\r" ? (Vt(), at(`
`) && Vt()) : yP(et) ? Bt += ts() : (Bt += et, Vt())) : (Bt += et, Vt());
    }
    return Bt;
  }
  function nr() {
    if (!vP(et))
      return null;
    for (var lt = ""; at("-"); )
      lt += et, Vt();
    for (lt === "-" && !eAe(et) && !at("\\") && pi("Identifiers cannot consist of a single hyphen."), s && lt.length >= 2 && pi("Identifiers cannot start with two hyphens with strict mode on."), Jte[et] && pi("Identifiers cannot start with hyphens followed by digits."); ot < st; )
      if (eAe(et))
        lt += Bi();
      else if (at("\\"))
        Vt(), Vr(), yP(et) ? lt += ts() : lt += Bi();
      else
        break;
    return lt;
  }
  function _s() {
    for (var lt = ""; ot < st && !at(")"); )
      if (at("\\")) {
        if (Vt(), tr() && !s)
          return (lt + "\\").trim();
        Vr(), yP(et) ? lt += ts() : lt += Bi();
      } else
        lt += Bi();
    return lt.trim();
  }
  function Hs() {
    if (et === " " || et === "	" || et === "\f" || et === `
`) {
      Vt();
      return;
    }
    et === "\r" && Vt(), et === `
` && Vt();
  }
  function He() {
    for (; Z4t[et]; )
      Vt();
  }
  function yt(lt) {
    lt === void 0 && (lt = !1), He();
    for (var Bt = [li(lt)]; at(","); )
      Vt(), He(), Bt.push(li(lt));
    return {
      type: "Selector",
      rules: Bt
    };
  }
  function Ln() {
    qr("["), He();
    var lt;
    if (at("|")) {
      tn(D, "Namespaces are not enabled."), Vt();
      var Bt = nr();
      tn(Bt, "Expected attribute name."), lt = {
        type: "Attribute",
        name: Bt,
        namespace: { type: "NoNamespace" }
      };
    } else if (at("*")) {
      tn(D, "Namespaces are not enabled."), tn(N, "Wildcard namespace is not enabled."), Vt(), qr("|");
      var Mn = nr();
      tn(Mn, "Expected attribute name."), lt = {
        type: "Attribute",
        name: Mn,
        namespace: { type: "WildcardNamespace" }
      };
    } else {
      var gn = nr();
      if (tn(gn, "Expected attribute name."), lt = {
        type: "Attribute",
        name: gn
      }, at("|")) {
        var yi = ot;
        if (Vt(), vP(et)) {
          tn(D, "Namespaces are not enabled.");
          var Ni = nr();
          tn(Ni, "Expected attribute name."), lt = {
            type: "Attribute",
            name: Ni,
            namespace: { type: "NamespaceName", name: gn }
          };
        } else
          sn(yi);
      }
    }
    if (tn(lt.name, "Expected attribute name."), He(), tr() && !s)
      return lt;
    if (at("]"))
      Vt();
    else {
      if (lt.operator = Bs(j), tn(lt.operator, "Expected a valid attribute selector operator."), He(), Vr(), Q4t[et])
        lt.value = {
          type: "String",
          value: io(et)
        };
      else if (R && at("$")) {
        Vt();
        var qi = nr();
        tn(qi, "Expected substitute name."), lt.value = {
          type: "Substitution",
          name: qi
        };
      } else {
        var Ur = nr();
        tn(Ur, "Expected attribute value."), lt.value = {
          type: "String",
          value: Ur
        };
      }
      if (He(), tr() && !s)
        return lt;
      if (!at("]")) {
        var Ws = nr();
        if (tn(Ws, "Expected end of attribute selector."), lt.caseSensitivityModifier = Ws, tn(Y, "Attribute case sensitivity modifiers are not enabled."), tn(X || K[lt.caseSensitivityModifier], "Unknown attribute case sensitivity modifier."), He(), tr() && !s)
          return lt;
      }
      qr("]");
    }
    return lt;
  }
  function oi() {
    for (var lt = ""; Jte[et]; )
      lt += Bi();
    return tn(lt !== "", "Formula parse error."), parseInt(lt);
  }
  var vi = function() {
    return at("-") || at("+") || Jte[et];
  };
  function Dt() {
    if (at("e") || at("o")) {
      var lt = nr();
      if (lt === "even")
        return He(), [2, 0];
      if (lt === "odd")
        return He(), [2, 1];
    }
    var Bt = null, Mn = 1;
    if (at("-") && (Vt(), Mn = -1), vi() && (at("+") && Vt(), Bt = oi(), !at("\\") && !at("n")))
      return [0, Bt * Mn];
    Bt === null && (Bt = 1), Bt *= Mn;
    var gn;
    if (at("\\") ? (Vt(), yP(et) ? gn = ts() : gn = Bi()) : gn = Bi(), tn(gn === "n", 'Formula parse error: expected "n".'), He(), at("+") || at("-")) {
      var yi = at("+") ? 1 : -1;
      return Vt(), He(), [Bt, yi * oi()];
    } else
      return [Bt, 0];
  }
  function cn(lt, Bt, Mn) {
    var gn;
    if (at("(")) {
      if (Vt(), He(), R && at("$")) {
        Vt();
        var yi = nr();
        tn(yi, "Expected substitute name."), gn = {
          type: "Substitution",
          name: yi
        };
      } else if (Mn.type === "String")
        gn = {
          type: "String",
          value: _s()
        }, tn(gn.value, "Expected ".concat(Bt, " argument value."));
      else if (Mn.type === "Selector")
        gn = yt(!0);
      else if (Mn.type === "Formula") {
        var Ni = Dt(), qi = Ni[0], Ur = Ni[1];
        if (gn = {
          type: "Formula",
          a: qi,
          b: Ur
        }, Mn.ofSelector && (He(), at("o") || at("\\"))) {
          var Ws = nr();
          tn(Ws === "of", "Formula of selector parse error."), He(), gn = {
            type: "FormulaOfSelector",
            a: qi,
            b: Ur,
            selector: li()
          };
        }
      } else
        return pi("Invalid ".concat(Bt, " signature."));
      if (He(), tr() && !s)
        return gn;
      qr(")");
    } else
      tn(Mn.optional, "Argument is required for ".concat(Bt, ' "').concat(lt, '".'));
    return gn;
  }
  function En() {
    if (at("*"))
      return tn(w, "Wildcard tag name is not enabled."), Vt(), { type: "WildcardTag" };
    if (vP(et)) {
      tn(v, "Tag names are not enabled.");
      var lt = nr();
      return tn(lt, "Expected tag name."), {
        type: "TagName",
        name: lt
      };
    } else
      return pi("Expected tag name.");
  }
  function ii() {
    if (at("*")) {
      var lt = ot;
      if (Vt(), !at("|") || (Vt(), !en()))
        return sn(lt), En();
      tn(D, "Namespaces are not enabled."), tn(N, "Wildcard namespace is not enabled.");
      var Bt = En();
      return Bt.namespace = { type: "WildcardNamespace" }, Bt;
    } else if (at("|")) {
      tn(D, "Namespaces are not enabled."), Vt();
      var Bt = En();
      return Bt.namespace = { type: "NoNamespace" }, Bt;
    } else if (vP(et)) {
      var Mn = nr();
      if (tn(Mn, "Expected tag name."), !at("|"))
        return tn(v, "Tag names are not enabled."), {
          type: "TagName",
          name: Mn
        };
      var lt = ot;
      if (Vt(), !en())
        return sn(lt), {
          type: "TagName",
          name: Mn
        };
      tn(D, "Namespaces are not enabled.");
      var Bt = En();
      return Bt.namespace = { type: "NamespaceName", name: Mn }, Bt;
    } else
      return pi("Expected tag name.");
  }
  function li(lt) {
    var Bt, Mn;
    lt === void 0 && (lt = !1);
    var gn = { type: "Rule", items: [] };
    if (lt) {
      var yi = Bs(M);
      yi && (gn.combinator = yi, He());
    }
    for (; ot < st; )
      if (en())
        tn(gn.items.length === 0, "Unexpected tag/namespace start."), gn.items.push(ii());
      else if (at("|")) {
        var Ni = ot;
        if (Vt(), en())
          tn(gn.items.length === 0, "Unexpected tag/namespace start."), sn(Ni), gn.items.push(ii());
        else {
          sn(Ni);
          break;
        }
      } else if (at(".")) {
        tn(L, "Class names are not enabled."), Vt();
        var qi = nr();
        tn(qi, "Expected class name."), gn.items.push({ type: "ClassName", name: qi });
      } else if (at("#")) {
        tn(E, "IDs are not enabled."), Vt();
        var Ur = nr();
        tn(Ur, "Expected ID name."), gn.items.push({ type: "Id", name: Ur });
      } else if (at("&"))
        tn(T, "Nesting selector is not enabled."), Vt(), gn.items.push({ type: "NestingSelector" });
      else if (at("["))
        tn(H, "Attributes are not enabled."), gn.items.push(Ln());
      else if (at(":")) {
        var Ws = !1, El = !1;
        Vt(), at(":") && (tn(J, "Pseudo elements are not enabled."), tn(be, "Pseudo elements double colon notation is not enabled."), Ws = !0, Vt());
        var Ri = nr();
        if (tn(Ws || Ri, "Expected pseudo-class name."), tn(!Ws || Ri, "Expected pseudo-element name."), tn(Ri, "Expected pseudo-class name."), !(!Ws || ze || Object.prototype.hasOwnProperty.call(re, Ri))) {
          var So = JRe.pseudoElements[Ri], va = 'Unknown pseudo-element "'.concat(Ri, '"');
          So && So.length > 0 && (va += ". It is defined in: ".concat(So.join(", "))), pi(va + ".");
        }
        if (El = J && (Ws || !Ws && ae && Object.prototype.hasOwnProperty.call(re, Ri)), El) {
          var xl = (Bt = re[Ri]) !== null && Bt !== void 0 ? Bt : ze && YRe, ya = {
            type: "PseudoElement",
            name: Ri
          }, ro = cn(Ri, "pseudo-element", xl);
          ro && (tn(ro.type !== "Formula" && ro.type !== "FormulaOfSelector", "Pseudo-elements cannot have formula argument."), ya.argument = ro), gn.items.push(ya);
        } else {
          tn(Q, "Pseudo-classes are not enabled.");
          var xl = (Mn = oe[Ri]) !== null && Mn !== void 0 ? Mn : Z && YRe;
          if (!xl) {
            var So = JRe.pseudoClasses[Ri], va = 'Unknown pseudo-class: "'.concat(Ri, '"');
            So && So.length > 0 && (va += ". It is defined in: ".concat(So.join(", "))), pi(va + ".");
          }
          var ro = cn(Ri, "pseudo-class", xl), Eo = {
            type: "PseudoClass",
            name: Ri
          };
          ro && (Eo.argument = ro), gn.items.push(Eo);
        }
      } else
        break;
    if (gn.items.length === 0)
      return tr() ? pi("Expected rule but end of input reached.") : pi('Expected rule but "'.concat(et, '" found.'));
    if (He(), !tr() && !at(",") && !at(")")) {
      var yi = Bs(M);
      He(), gn.nestedRule = li(), gn.nestedRule.combinator = yi;
    }
    return gn;
  }
  return function(lt) {
    if (typeof lt != "string")
      throw new Error("".concat(ene, "Expected string input."));
    return Ve = lt, st = Ve.length, ot = 0, et = Ve.charAt(0), yt();
  };
}
const t5t = e5t({ syntax: "selectors-4" });
function n5t(i) {
  if (typeof i != "string")
    throw new TypeError("Expected `string` as selector, not `" + i + "`");
  return t5t(i);
}
const P7e = "֑-߿יִ-﷽ﹰ-ﻼ", F7e = "A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-", i5t = new RegExp("^[^" + F7e + "]*[" + P7e + "]"), r5t = new RegExp("^[^" + P7e + "]*[" + F7e + "]");
function s5t(i) {
  const e = String(i || "");
  return i5t.test(e) ? "rtl" : r5t.test(e) ? "ltr" : "neutral";
}
function o5t(i, e) {
  const t = i.schema, n = i.language, r = i.direction, s = i.editableOrEditingHost;
  let o;
  if (e.type === "element") {
    const c = e.properties.xmlLang || e.properties.lang, u = e.properties.type || "text", d = tAe(e);
    c != null && (i.language = String(c)), t && t.space === "html" ? (e.properties.contentEditable === "true" && (i.editableOrEditingHost = !0), e.tagName === "svg" && (i.schema = _0), d === "rtl" ? o = d : /* Explicit `[dir=ltr]`. */ d === "ltr" || // HTML with an invalid or no `[dir]`.
    d !== "auto" && e.tagName === "html" || // `input[type=tel]` with an invalid or no `[dir]`.
    d !== "auto" && e.tagName === "input" && u === "tel" ? o = "ltr" : (d === "auto" || e.tagName === "bdi") && (e.tagName === "textarea" ? o = tne(EN(e)) : e.tagName === "input" && (u === "email" || u === "search" || u === "tel" || u === "text") ? o = e.properties.value ? tne(String(e.properties.value)) : "ltr" : qd(e, l)), o && (i.direction = o)) : i.editableOrEditingHost && (i.editableOrEditingHost = !1);
  }
  return a;
  function a() {
    i.schema = t, i.language = n, i.direction = r, i.editableOrEditingHost = s;
  }
  function l(c) {
    if (c.type === "text")
      return o = tne(c.value), o ? P$ : void 0;
    if (c !== e && c.type === "element" && (c.tagName === "bdi" || c.tagName === "script" || c.tagName === "style" || c.tagName === "textare" || tAe(c)))
      return f3;
  }
}
function tne(i) {
  const e = s5t(i);
  return e === "neutral" ? void 0 : e;
}
function tAe(i) {
  const e = i.type === "element" && typeof i.properties.dir == "string" ? i.properties.dir.toLowerCase() : void 0;
  return e === "auto" || e === "ltr" || e === "rtl" ? e : void 0;
}
function a5t(i, e, t) {
  const n = h6(t, i.name), r = e.properties[n.property];
  let s = l5t(r, n);
  if (!i.value)
    return s !== void 0;
  i.value.type;
  let o = i.value.value;
  if (i.caseSensitivityModifier === "i" && (o = o.toLowerCase(), s && (s = s.toLowerCase())), s !== void 0)
    switch (i.operator) {
      // Exact.
      case "=":
        return o === s;
      // Ends.
      case "$=":
        return o === s.slice(-o.length);
      // Contains.
      case "*=":
        return s.includes(o);
      // Begins.
      case "^=":
        return o === s.slice(0, o.length);
      // Exact or prefix.
      case "|=":
        return o === s || o === s.slice(0, o.length) && s.charAt(o.length) === "-";
      // Space-separated list.
      case "~=":
        return (
          // For all other values (including comma-separated lists), return whether this
          // is an exact match.
          o === s || // If this is a space-separated list, and the query is contained in it, return
          // true.
          U5(s).includes(o)
        );
    }
  return !1;
}
function l5t(i, e) {
  if (i != null) if (typeof i == "boolean") {
    if (i)
      return e.attribute;
  } else if (Array.isArray(i)) {
    if (i.length > 0)
      return (e.commaSeparated ? Mme : Ome)(i);
  } else
    return String(i);
}
const c5t = [];
function u5t(i, e) {
  return /** @type {Readonly<Array<string>>} */ (e.properties.className || c5t).includes(i.name);
}
function d5t(i, e) {
  return e.properties.id === i.name;
}
function h5t(i, e) {
  return i.name === e.tagName;
}
function f5t(i, e) {
  return function(t, n) {
    let r = nAe(t, "tag");
    const s = nAe(
      n ?? "*",
      "range"
    ), o = [];
    let a = -1;
    for (; ++a < s.length; ) {
      const l = s[a].toLowerCase();
      if (!e && l === "*") continue;
      let c = -1;
      const u = [];
      for (; ++c < r.length; )
        if (i(r[c].toLowerCase(), l)) {
          if (!e)
            return (
              /** @type {IsFilter extends true ? Tags : Tag|undefined} */
              r[c]
            );
          o.push(r[c]);
        } else
          u.push(r[c]);
      r = u;
    }
    return (
      /** @type {IsFilter extends true ? Tags : Tag|undefined} */
      e ? o : void 0
    );
  };
}
const g5t = f5t(function(i, e) {
  const t = i.split("-"), n = e.split("-");
  let r = 0, s = 0;
  if (n[s] !== "*" && t[r] !== n[s])
    return !1;
  for (r++, s++; s < n.length; ) {
    if (n[s] === "*") {
      s++;
      continue;
    }
    if (!t[r]) return !1;
    if (t[r] === n[s]) {
      r++, s++;
      continue;
    }
    if (t[r].length === 1) return !1;
    r++;
  }
  return !0;
}, !0);
function nAe(i, e) {
  const t = i && typeof i == "string" ? [i] : i;
  if (!t || typeof t != "object" || !("length" in t))
    throw new Error(
      "Invalid " + e + " `" + t + "`, expected non-empty string"
    );
  return t;
}
const p5t = {}.hasOwnProperty;
function RT(i, e) {
  const t = i.type === "element" && p5t.call(i.properties, e) && i.properties[e];
  return t != null && t !== !1;
}
const m5t = /[ \t\n\f\r]/g;
function B7e(i) {
  return typeof i == "object" ? i.type === "text" ? iAe(i.value) : !1 : iAe(i);
}
function iAe(i) {
  return i.replace(m5t, "") === "";
}
const _5t = /* @__PURE__ */ new Set([9, 10, 12, 13, 32]), rAe = 48, b5t = 57;
function v5t(i) {
  if (i = i.trim().toLowerCase(), i === "even")
    return [2, 0];
  if (i === "odd")
    return [2, 1];
  let e = 0, t = 0, n = s(), r = o();
  if (e < i.length && i.charAt(e) === "n" && (e++, t = n * (r ?? 1), a(), e < i.length ? (n = s(), a(), r = o()) : n = r = 0), r === null || e < i.length)
    throw new Error(`n-th rule couldn't be parsed ('${i}')`);
  return [t, n * r];
  function s() {
    return i.charAt(e) === "-" ? (e++, -1) : (i.charAt(e) === "+" && e++, 1);
  }
  function o() {
    const l = e;
    let c = 0;
    for (; e < i.length && i.charCodeAt(e) >= rAe && i.charCodeAt(e) <= b5t; )
      c = c * 10 + (i.charCodeAt(e) - rAe), e++;
    return e === l ? null : c;
  }
  function a() {
    for (; e < i.length && _5t.has(i.charCodeAt(e)); )
      e++;
  }
}
var nne, sAe;
function y5t() {
  return sAe || (sAe = 1, nne = {
    trueFunc: function() {
      return !0;
    },
    falseFunc: function() {
      return !1;
    }
  }), nne;
}
var C5t = y5t();
const oAe = /* @__PURE__ */ WA(C5t);
function w5t(i) {
  const e = i[0], t = i[1] - 1;
  if (t < 0 && e <= 0)
    return oAe.falseFunc;
  if (e === -1)
    return (s) => s <= t;
  if (e === 0)
    return (s) => s === t;
  if (e === 1)
    return t < 0 ? oAe.trueFunc : (s) => s >= t;
  const n = Math.abs(e), r = (t % n + n) % n;
  return e > 1 ? (s) => s >= t && s % n === r : (s) => s <= t && s % n === r;
}
function aAe(i) {
  return w5t(v5t(i));
}
const lAe = {}.hasOwnProperty;
function C0e(i, e) {
  const t = e || {};
  function n(r, ...s) {
    let o = n.invalid;
    const a = n.handlers;
    if (r && lAe.call(r, i)) {
      const l = String(r[i]);
      o = lAe.call(a, l) ? a[l] : n.unknown;
    }
    if (o)
      return o.call(this, r, ...s);
  }
  return n.handlers = t.handlers || {}, n.invalid = t.invalid, n.unknown = t.unknown, n;
}
const S5t = aAe.default || aAe, E5t = C0e("name", {
  handlers: {
    "any-link": x5t,
    blank: L5t,
    checked: T5t,
    dir: k5t,
    disabled: H7e,
    empty: D5t,
    enabled: I5t,
    "first-child": N5t,
    "first-of-type": R5t,
    has: A5t,
    is: W7e,
    lang: M5t,
    "last-child": P5t,
    "last-of-type": F5t,
    not: B5t,
    "nth-child": H5t,
    "nth-last-child": W5t,
    "nth-last-of-type": V5t,
    "nth-of-type": U5t,
    "only-child": z5t,
    "only-of-type": $5t,
    optional: j5t,
    "read-only": G5t,
    "read-write": V7e,
    required: U7e,
    root: q5t,
    scope: K5t
  },
  invalid: O5t,
  unknown: Y5t
});
function x5t(i, e) {
  return (e.tagName === "a" || e.tagName === "area" || e.tagName === "link") && RT(e, "href");
}
function Ob(i, e) {
  if (i.shallow)
    throw new Error("Cannot use `:" + e.name + "` without parent");
}
function L5t(i, e) {
  return !z7e(e, t);
  function t(n) {
    return n.type === "element" || n.type === "text" && !B7e(n);
  }
}
function T5t(i, e) {
  return e.tagName === "input" || e.tagName === "menuitem" ? !!((e.properties.type === "checkbox" || e.properties.type === "radio") && RT(e, "checked")) : e.tagName === "option" ? RT(e, "selected") : !1;
}
function k5t(i, e, t, n, r) {
  return i.argument, i.argument.type, r.direction === i.argument.value;
}
function H7e(i, e) {
  return (e.tagName === "button" || e.tagName === "input" || e.tagName === "select" || e.tagName === "textarea" || e.tagName === "optgroup" || e.tagName === "option" || e.tagName === "menuitem" || e.tagName === "fieldset") && RT(e, "disabled");
}
function D5t(i, e) {
  return !z7e(e, t);
  function t(n) {
    return n.type === "element" || n.type === "text";
  }
}
function I5t(i, e) {
  return !H7e(i, e);
}
function N5t(i, e, t, n, r) {
  return Ob(r, i), r.elementIndex === 0;
}
function R5t(i, e, t, n, r) {
  return Ob(r, i), r.typeIndex === 0;
}
function wY(i) {
  let e = i._cachedFn;
  if (!e) {
    const t = i.argument;
    if (t.type !== "Formula")
      throw new Error(
        "Expected `nth` formula, such as `even` or `2n+1` (`of` is not yet supported)"
      );
    e = S5t(t.a + "n+" + t.b), i._cachedFn = e;
  }
  return e;
}
function A5t(i, e, t, n, r) {
  i.argument, i.argument.type;
  const s = {
    ...r,
    // Not found yet.
    found: !1,
    // One result is enough.
    one: !0,
    results: [],
    rootQuery: i.argument,
    scopeElements: [e],
    // Do walk deep.
    shallow: !1
  };
  return w0e(s, { type: "root", children: e.children }), s.results.length > 0;
}
function O5t() {
}
function W7e(i, e, t, n, r) {
  i.argument, i.argument.type;
  const s = {
    ...r,
    // Not found yet.
    found: !1,
    // One result is enough.
    one: !0,
    results: [],
    rootQuery: i.argument,
    scopeElements: [e],
    // Do walk deep.
    shallow: !1
  };
  return w0e(s, e), s.results[0] === e;
}
function M5t(i, e, t, n, r) {
  return i.argument, i.argument.type, r.language !== "" && r.language !== void 0 && g5t(r.language, z5(i.argument.value)).length > 0;
}
function P5t(i, e, t, n, r) {
  return Ob(r, i), !!(r.elementCount && r.elementIndex === r.elementCount - 1);
}
function F5t(i, e, t, n, r) {
  return Ob(r, i), typeof r.typeIndex == "number" && typeof r.typeCount == "number" && r.typeIndex === r.typeCount - 1;
}
function B5t(i, e, t, n, r) {
  return !W7e(i, e, t, n, r);
}
function H5t(i, e, t, n, r) {
  const s = wY(i);
  return Ob(r, i), typeof r.elementIndex == "number" && s(r.elementIndex);
}
function W5t(i, e, t, n, r) {
  const s = wY(i);
  return Ob(r, i), !!(typeof r.elementCount == "number" && typeof r.elementIndex == "number" && s(r.elementCount - r.elementIndex - 1));
}
function V5t(i, e, t, n, r) {
  const s = wY(i);
  return Ob(r, i), typeof r.typeCount == "number" && typeof r.typeIndex == "number" && s(r.typeCount - 1 - r.typeIndex);
}
function U5t(i, e, t, n, r) {
  const s = wY(i);
  return Ob(r, i), typeof r.typeIndex == "number" && s(r.typeIndex);
}
function z5t(i, e, t, n, r) {
  return Ob(r, i), r.elementCount === 1;
}
function $5t(i, e, t, n, r) {
  return Ob(r, i), r.typeCount === 1;
}
function j5t(i, e) {
  return !U7e(i, e);
}
function G5t(i, e, t, n, r) {
  return !V7e(i, e, t, n, r);
}
function V7e(i, e, t, n, r) {
  return e.tagName === "input" || e.tagName === "textarea" ? !RT(e, "readOnly") && !RT(e, "disabled") : !!r.editableOrEditingHost;
}
function U7e(i, e) {
  return (e.tagName === "input" || e.tagName === "textarea" || e.tagName === "select") && RT(e, "required");
}
function q5t(i, e, t, n, r) {
  return !!((!n || n.type === "root") && r.schema && (r.schema.space === "html" || r.schema.space === "svg") && (e.tagName === "html" || e.tagName === "svg"));
}
function K5t(i, e, t, n, r) {
  return r.scopeElements.includes(e);
}
function z7e(i, e) {
  const t = i.children;
  let n = -1;
  for (; ++n < t.length; )
    if (e(t[n])) return !0;
  return !1;
}
function Y5t(i) {
  const e = (
    /** @type {AstPseudoClass} */
    i
  );
  throw new Error("Unknown pseudo-selector `" + e.name + "`");
}
function X5t(i, e, t, n, r) {
  for (const s of i.items)
    if (s.type === "Attribute") {
      if (!a5t(s, e, r.schema)) return !1;
    } else if (s.type === "Id") {
      if (!d5t(s, e)) return !1;
    } else if (s.type === "ClassName") {
      if (!u5t(s, e)) return !1;
    } else if (s.type === "PseudoClass") {
      if (!E5t(s, e, t, n, r)) return !1;
    } else {
      if (s.type === "PseudoElement")
        throw new Error("Invalid selector: `::" + s.name + "`");
      if (s.type === "TagName" && !h5t(s, e))
        return !1;
    }
  return !0;
}
const Z5t = [];
function w0e(i, e) {
  e && $7e(i, [], e, void 0, void 0, e);
}
function ine(i, e, t) {
  const n = i[e];
  n ? n.push(t) : i[e] = [t];
}
function Q5t(i, e, t, n) {
  const r = nV(e.descendant, e.directChild);
  let s, o = -1;
  const a = { count: 0, types: /* @__PURE__ */ new Map() }, l = { count: 0, types: /* @__PURE__ */ new Map() };
  for (; ++o < t.children.length; )
    cAe(a, t.children[o]);
  for (o = -1; ++o < t.children.length; ) {
    const c = t.children[o], u = c.type === "element" ? c.tagName.toUpperCase() : void 0;
    if (i.elementIndex = l.count, i.typeIndex = u && l.types.get(u) || 0, i.elementCount = a.count, i.typeCount = u ? a.types.get(u) : 0, "children" in c) {
      const d = nV(r, s), h = $7e(
        i,
        d,
        t.children[o],
        o,
        t,
        n
      );
      s = nV(h.generalSibling, h.adjacentSibling);
    }
    if (i.one && i.found)
      break;
    cAe(l, t.children[o]);
  }
}
function J5t(i, e, t, n, r) {
  const s = {
    adjacentSibling: void 0,
    descendant: void 0,
    directChild: void 0,
    generalSibling: void 0
  };
  let o = -1;
  for (; ++o < e.length; ) {
    const a = e[o];
    if (i.one && i.found)
      break;
    if (i.shallow && a.nestedRule)
      throw new Error("Expected selector without nesting");
    if (X5t(a, t, n, r, i)) {
      const l = a.nestedRule;
      if (l) {
        const c = l.combinator === "+" ? "adjacentSibling" : l.combinator === "~" ? "generalSibling" : l.combinator === ">" ? "directChild" : "descendant";
        ine(s, c, l);
      } else
        i.found = !0, i.results.includes(t) || i.results.push(t);
    }
    a.combinator === void 0 ? ine(s, "descendant", a) : a.combinator === "~" && ine(s, "generalSibling", a);
  }
  return s;
}
function nV(i, e) {
  return i && e && i.length > 0 && e.length > 0 ? [...i, ...e] : i && i.length > 0 ? i : e && e.length > 0 ? e : Z5t;
}
function cAe(i, e) {
  if (e.type === "element") {
    const t = e.tagName.toUpperCase(), n = (i.types.get(t) || 0) + 1;
    i.count++, i.types.set(t, n);
  }
}
function $7e(i, e, t, n, r, s) {
  let o = {
    adjacentSibling: void 0,
    descendant: void 0,
    directChild: void 0,
    generalSibling: void 0
  };
  const a = o5t(i, t);
  if (t.type === "element") {
    let l = i.rootQuery.rules;
    r && r !== s && (l = i.rootQuery.rules.filter(
      (c) => c.combinator === void 0 || c.combinator === ">" && r === s
    )), o = J5t(
      i,
      // Try the root rules for this element too.
      nV(e, l),
      t,
      n,
      r
    );
  }
  return "children" in t && !i.shallow && !(i.one && i.found) && Q5t(i, o, t, s), a(), o;
}
function eBt(i, e, t) {
  const n = tBt(i, e);
  return w0e(n, e || void 0), n.results;
}
function tBt(i, e, t) {
  return {
    direction: "ltr",
    editableOrEditingHost: !1,
    elementCount: void 0,
    elementIndex: void 0,
    found: !1,
    language: void 0,
    one: !1,
    // State of the query.
    results: [],
    rootQuery: n5t(i),
    schema: w2,
    scopeElements: e ? e.type === "root" ? e.children : [e] : [],
    shallow: !1,
    typeIndex: void 0,
    typeCount: void 0
  };
}
const j7e = (i = [], e = "") => (i.forEach((t) => {
  t.type === "text" ? e += t.value : t.type === "element" && t.children && Array.isArray(t.children) && (e += j7e(t.children));
}), e), nBt = (i) => {
  const { selector: e, rewrite: t } = i || {};
  return (n) => {
    if (!(!t || typeof t != "function")) {
      if (e && typeof e == "string") {
        const r = eBt(e, n);
        r && r.length > 0 && qd(n, r, (s, o, a) => {
          t(s, o, a);
        });
        return;
      }
      qd(n, (r, s, o) => {
        t(r, s, o);
      });
    }
  };
}, iBt = (i = "") => (i.match(/([^?=&]+)(=([^&]*))/g) || []).reduce((e, t) => (e[t.slice(0, t.indexOf("="))] = t.slice(t.indexOf("=") + 1), e), {}), rBt = (i = [], e) => {
  let t = e;
  for (; t > -1; ) {
    if (t--, !i[t])
      return;
    if (i[t] && i[t].value && i[t].value.replace(/(\n|\s)/g, "") !== "" || i[t].type !== "text")
      return !/^rehype:/.test(i[t].value) || i[t].type !== "comment" ? void 0 : i[t];
  }
}, G7e = (i = [], e, t, n) => {
  let r = e;
  for (; r < i.length; )
    if (r++, t) {
      const s = i[r];
      if (s && s.value && s.value.replace(/(\n|\s)/g, "") !== "" || i[r] && i[r].type === "element")
        return s.tagName === t ? s : void 0;
    } else {
      const s = i[r];
      if (!s || s.type === "element" || s.type === "text" && s.value.replace(/(\n|\s)/g, "") !== "")
        return;
      if (s.type && /^(comment|raw)$/ig.test(s.type))
        return s.value && !/^rehype:/.test(s.value.replace(/^(\s+)?<!--(.*?)-->/, "$2") || "") ? void 0 : n ? G7e(i, r, "pre", n) ? void 0 : (s.value = (s.value || "").replace(/^(\n|\s)+/, ""), s) : (s.value = (s.value || "").replace(/^(\n|\s)+/, ""), s);
    }
}, uAe = ({ value: i = "" }) => {
  const e = iBt(i.replace(/^<!--(.*?)-->/, "$1").replace(/^rehype:/, ""));
  return Object.keys(e).forEach((t) => {
    e[t] === "true" && (e[t] = !0), e[t] === "false" && (e[t] = !1), typeof e[t] == "string" && !/^0/.test(e[t]) && !isNaN(+e[t]) && (e[t] = +e[t]);
  }), e;
}, dAe = (i, e, t) => t === "string" ? { ...i, "data-config": JSON.stringify({ ...e, rehyp: !0 }) } : t === "attr" ? { ...i, ...e } : { ...i, "data-config": { ...e, rehyp: !0 } }, sBt = (i = {}) => {
  const { properties: e = "data", codeBlockParames: t = !0 } = i;
  return (n) => {
    qd(n, "element", (r, s, o) => {
      if (t && r.tagName === "pre" && r && Array.isArray(r.children) && o && Array.isArray(o.children) && o.children.length > 1) {
        const a = r.children[0];
        if (a && a.tagName === "code" && typeof s == "number") {
          const l = rBt(o.children, s);
          if (l) {
            const c = uAe(l);
            Object.keys(c).length > 0 && (r.properties = { ...r.properties, "data-type": "rehyp" }, a.properties = dAe(a.properties, c, e));
          }
        }
      }
      if (/^(em|strong|b|a|i|p|pre|kbd|blockquote|h(1|2|3|4|5|6)|code|table|img|del|ul|ol)$/.test(r.tagName) && o && Array.isArray(o.children) && typeof s == "number") {
        const a = G7e(o.children, s, "", t);
        if (a) {
          const l = uAe(a);
          Object.keys(l).length > 0 && (r.properties = dAe(r.properties, l, e));
        }
      }
    });
  };
}, q7e = -1, SY = 0, p3 = 1, H$ = 2, S0e = 3, E0e = 4, x0e = 5, L0e = 6, K7e = 7, Y7e = 8, hAe = typeof self == "object" ? self : globalThis, oBt = (i, e) => {
  const t = (r, s) => (i.set(s, r), r), n = (r) => {
    if (i.has(r))
      return i.get(r);
    const [s, o] = e[r];
    switch (s) {
      case SY:
      case q7e:
        return t(o, r);
      case p3: {
        const a = t([], r);
        for (const l of o)
          a.push(n(l));
        return a;
      }
      case H$: {
        const a = t({}, r);
        for (const [l, c] of o)
          a[n(l)] = n(c);
        return a;
      }
      case S0e:
        return t(new Date(o), r);
      case E0e: {
        const { source: a, flags: l } = o;
        return t(new RegExp(a, l), r);
      }
      case x0e: {
        const a = t(/* @__PURE__ */ new Map(), r);
        for (const [l, c] of o)
          a.set(n(l), n(c));
        return a;
      }
      case L0e: {
        const a = t(/* @__PURE__ */ new Set(), r);
        for (const l of o)
          a.add(n(l));
        return a;
      }
      case K7e: {
        const { name: a, message: l } = o;
        return t(new hAe[a](l), r);
      }
      case Y7e:
        return t(BigInt(o), r);
      case "BigInt":
        return t(Object(BigInt(o)), r);
      case "ArrayBuffer":
        return t(new Uint8Array(o).buffer, o);
      case "DataView": {
        const { buffer: a } = new Uint8Array(o);
        return t(new DataView(a), o);
      }
    }
    return t(new hAe[s](o), r);
  };
  return n;
}, fAe = (i) => oBt(/* @__PURE__ */ new Map(), i)(0), BI = "", { toString: aBt } = {}, { keys: lBt } = Object, CP = (i) => {
  const e = typeof i;
  if (e !== "object" || !i)
    return [SY, e];
  const t = aBt.call(i).slice(8, -1);
  switch (t) {
    case "Array":
      return [p3, BI];
    case "Object":
      return [H$, BI];
    case "Date":
      return [S0e, BI];
    case "RegExp":
      return [E0e, BI];
    case "Map":
      return [x0e, BI];
    case "Set":
      return [L0e, BI];
    case "DataView":
      return [p3, t];
  }
  return t.includes("Array") ? [p3, t] : t.includes("Error") ? [K7e, t] : [H$, t];
}, QH = ([i, e]) => i === SY && (e === "function" || e === "symbol"), cBt = (i, e, t, n) => {
  const r = (o, a) => {
    const l = n.push(o) - 1;
    return t.set(a, l), l;
  }, s = (o) => {
    if (t.has(o))
      return t.get(o);
    let [a, l] = CP(o);
    switch (a) {
      case SY: {
        let u = o;
        switch (l) {
          case "bigint":
            a = Y7e, u = o.toString();
            break;
          case "function":
          case "symbol":
            if (i)
              throw new TypeError("unable to serialize " + l);
            u = null;
            break;
          case "undefined":
            return r([q7e], o);
        }
        return r([a, u], o);
      }
      case p3: {
        if (l) {
          let h = o;
          return l === "DataView" ? h = new Uint8Array(o.buffer) : l === "ArrayBuffer" && (h = new Uint8Array(o)), r([l, [...h]], o);
        }
        const u = [], d = r([a, u], o);
        for (const h of o)
          u.push(s(h));
        return d;
      }
      case H$: {
        if (l)
          switch (l) {
            case "BigInt":
              return r([l, o.toString()], o);
            case "Boolean":
            case "Number":
            case "String":
              return r([l, o.valueOf()], o);
          }
        if (e && "toJSON" in o)
          return s(o.toJSON());
        const u = [], d = r([a, u], o);
        for (const h of lBt(o))
          (i || !QH(CP(o[h]))) && u.push([s(h), s(o[h])]);
        return d;
      }
      case S0e:
        return r([a, o.toISOString()], o);
      case E0e: {
        const { source: u, flags: d } = o;
        return r([a, { source: u, flags: d }], o);
      }
      case x0e: {
        const u = [], d = r([a, u], o);
        for (const [h, g] of o)
          (i || !(QH(CP(h)) || QH(CP(g)))) && u.push([s(h), s(g)]);
        return d;
      }
      case L0e: {
        const u = [], d = r([a, u], o);
        for (const h of o)
          (i || !QH(CP(h))) && u.push(s(h));
        return d;
      }
    }
    const { message: c } = o;
    return r([a, { name: l, message: c }], o);
  };
  return s;
}, gAe = (i, { json: e, lossy: t } = {}) => {
  const n = [];
  return cBt(!(e || t), !!e, /* @__PURE__ */ new Map(), n)(i), n;
}, AT = typeof structuredClone == "function" ? (
  /* c8 ignore start */
  (i, e) => e && ("json" in e || "lossy" in e) ? fAe(gAe(i, e)) : structuredClone(i)
) : (i, e) => fAe(gAe(i, e)), pAe = /[#.]/g;
function uBt(i, e) {
  const t = i || "", n = {};
  let r = 0, s, o;
  for (; r < t.length; ) {
    pAe.lastIndex = r;
    const a = pAe.exec(t), l = t.slice(r, a ? a.index : t.length);
    l && (s ? s === "#" ? n.id = l : Array.isArray(n.className) ? n.className.push(l) : n.className = [l] : o = l, r += l.length), a && (s = a[0], r++);
  }
  return {
    type: "element",
    // @ts-expect-error: tag name is parsed.
    tagName: o || e || "div",
    properties: n,
    children: []
  };
}
function X7e(i, e, t) {
  const n = t ? gBt(t) : void 0;
  function r(s, o, ...a) {
    let l;
    if (s == null) {
      l = { type: "root", children: [] };
      const c = (
        /** @type {Child} */
        o
      );
      a.unshift(c);
    } else {
      l = uBt(s, e);
      const c = l.tagName.toLowerCase(), u = n ? n.get(c) : void 0;
      if (l.tagName = u || c, dBt(o))
        a.unshift(o);
      else
        for (const [d, h] of Object.entries(o))
          hBt(i, l.properties, d, h);
    }
    for (const c of a)
      dde(l.children, c);
    return l.type === "element" && l.tagName === "template" && (l.content = { type: "root", children: l.children }, l.children = []), l;
  }
  return r;
}
function dBt(i) {
  if (i === null || typeof i != "object" || Array.isArray(i))
    return !0;
  if (typeof i.type != "string") return !1;
  const e = (
    /** @type {Record<string, unknown>} */
    i
  ), t = Object.keys(i);
  for (const n of t) {
    const r = e[n];
    if (r && typeof r == "object") {
      if (!Array.isArray(r)) return !0;
      const s = (
        /** @type {ReadonlyArray<unknown>} */
        r
      );
      for (const o of s)
        if (typeof o != "number" && typeof o != "string")
          return !0;
    }
  }
  return !!("children" in i && Array.isArray(i.children));
}
function hBt(i, e, t, n) {
  const r = h6(i, t);
  let s;
  if (n != null) {
    if (typeof n == "number") {
      if (Number.isNaN(n)) return;
      s = n;
    } else typeof n == "boolean" ? s = n : typeof n == "string" ? r.spaceSeparated ? s = U5(n) : r.commaSeparated ? s = z5(n) : r.commaOrSpaceSeparated ? s = U5(z5(n).join(" ")) : s = mAe(r, r.property, n) : Array.isArray(n) ? s = [...n] : s = r.property === "style" ? fBt(n) : String(n);
    if (Array.isArray(s)) {
      const o = [];
      for (const a of s)
        o.push(
          /** @type {number | string} */
          mAe(r, r.property, a)
        );
      s = o;
    }
    r.property === "className" && Array.isArray(e.className) && (s = e.className.concat(
      /** @type {Array<number | string> | number | string} */
      s
    )), e[r.property] = s;
  }
}
function dde(i, e) {
  if (e != null) if (typeof e == "number" || typeof e == "string")
    i.push({ type: "text", value: String(e) });
  else if (Array.isArray(e))
    for (const t of e)
      dde(i, t);
  else if (typeof e == "object" && "type" in e)
    e.type === "root" ? dde(i, e.children) : i.push(e);
  else
    throw new Error("Expected node, nodes, or string, got `" + e + "`");
}
function mAe(i, e, t) {
  if (typeof t == "string") {
    if (i.number && t && !Number.isNaN(Number(t)))
      return Number(t);
    if ((i.boolean || i.overloadedBoolean) && (t === "" || j5(t) === j5(e)))
      return !0;
  }
  return t;
}
function fBt(i) {
  const e = [];
  for (const [t, n] of Object.entries(i))
    e.push([t, n].join(": "));
  return e.join("; ");
}
function gBt(i) {
  const e = /* @__PURE__ */ new Map();
  for (const t of i)
    e.set(t.toLowerCase(), t);
  return e;
}
const pBt = [
  "altGlyph",
  "altGlyphDef",
  "altGlyphItem",
  "animateColor",
  "animateMotion",
  "animateTransform",
  "clipPath",
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feDistantLight",
  "feDropShadow",
  "feFlood",
  "feFuncA",
  "feFuncB",
  "feFuncG",
  "feFuncR",
  "feGaussianBlur",
  "feImage",
  "feMerge",
  "feMergeNode",
  "feMorphology",
  "feOffset",
  "fePointLight",
  "feSpecularLighting",
  "feSpotLight",
  "feTile",
  "feTurbulence",
  "foreignObject",
  "glyphRef",
  "linearGradient",
  "radialGradient",
  "solidColor",
  "textArea",
  "textPath"
], mBt = X7e(w2, "div"), _Bt = X7e(_0, "g", pBt);
function bBt(i) {
  const e = String(i), t = [];
  return { toOffset: r, toPoint: n };
  function n(s) {
    if (typeof s == "number" && s > -1 && s <= e.length) {
      let o = 0;
      for (; ; ) {
        let a = t[o];
        if (a === void 0) {
          const l = _Ae(e, t[o - 1]);
          a = l === -1 ? e.length + 1 : l + 1, t[o] = a;
        }
        if (a > s)
          return {
            line: o + 1,
            column: s - (o > 0 ? t[o - 1] : 0) + 1,
            offset: s
          };
        o++;
      }
    }
  }
  function r(s) {
    if (s && typeof s.line == "number" && typeof s.column == "number" && !Number.isNaN(s.line) && !Number.isNaN(s.column)) {
      for (; t.length < s.line; ) {
        const a = t[t.length - 1], l = _Ae(e, a), c = l === -1 ? e.length + 1 : l + 1;
        if (a === c) break;
        t.push(c);
      }
      const o = (s.line > 1 ? t[s.line - 2] : 0) + s.column - 1;
      if (o < t[s.line - 1]) return o;
    }
  }
}
function _Ae(i, e) {
  const t = i.indexOf("\r", e), n = i.indexOf(`
`, e);
  return n === -1 ? t : t === -1 || t + 1 === n ? n : t < n ? t : n;
}
const Ex = {
  html: "http://www.w3.org/1999/xhtml",
  mathml: "http://www.w3.org/1998/Math/MathML",
  svg: "http://www.w3.org/2000/svg",
  xlink: "http://www.w3.org/1999/xlink",
  xml: "http://www.w3.org/XML/1998/namespace",
  xmlns: "http://www.w3.org/2000/xmlns/"
}, Z7e = {}.hasOwnProperty, vBt = Object.prototype;
function yBt(i, e) {
  const t = e || {};
  return T0e(
    {
      file: t.file || void 0,
      location: !1,
      schema: t.space === "svg" ? _0 : w2,
      verbose: t.verbose || !1
    },
    i
  );
}
function T0e(i, e) {
  let t;
  switch (e.nodeName) {
    case "#comment": {
      const n = (
        /** @type {DefaultTreeAdapterMap['commentNode']} */
        e
      );
      return t = { type: "comment", value: n.data }, iV(i, n, t), t;
    }
    case "#document":
    case "#document-fragment": {
      const n = (
        /** @type {DefaultTreeAdapterMap['document'] | DefaultTreeAdapterMap['documentFragment']} */
        e
      ), r = "mode" in n ? n.mode === "quirks" || n.mode === "limited-quirks" : !1;
      if (t = {
        type: "root",
        children: Q7e(i, e.childNodes),
        data: { quirksMode: r }
      }, i.file && i.location) {
        const s = String(i.file), o = bBt(s), a = o.toPoint(0), l = o.toPoint(s.length);
        t.position = { start: a, end: l };
      }
      return t;
    }
    case "#documentType": {
      const n = (
        /** @type {DefaultTreeAdapterMap['documentType']} */
        e
      );
      return t = { type: "doctype" }, iV(i, n, t), t;
    }
    case "#text": {
      const n = (
        /** @type {DefaultTreeAdapterMap['textNode']} */
        e
      );
      return t = { type: "text", value: n.value }, iV(i, n, t), t;
    }
    // Element.
    default:
      return t = CBt(
        i,
        /** @type {DefaultTreeAdapterMap['element']} */
        e
      ), t;
  }
}
function Q7e(i, e) {
  let t = -1;
  const n = [];
  for (; ++t < e.length; ) {
    const r = (
      /** @type {RootContent} */
      T0e(i, e[t])
    );
    n.push(r);
  }
  return n;
}
function CBt(i, e) {
  const t = i.schema;
  i.schema = e.namespaceURI === Ex.svg ? _0 : w2;
  let n = -1;
  const r = {};
  for (; ++n < e.attrs.length; ) {
    const a = e.attrs[n], l = (a.prefix ? a.prefix + ":" : "") + a.name;
    Z7e.call(vBt, l) || (r[l] = a.value);
  }
  const o = (i.schema.space === "svg" ? _Bt : mBt)(e.tagName, r, Q7e(i, e.childNodes));
  if (iV(i, e, o), o.tagName === "template") {
    const a = (
      /** @type {DefaultTreeAdapterMap['template']} */
      e
    ), l = a.sourceCodeLocation, c = l && l.startTag && xN(l.startTag), u = l && l.endTag && xN(l.endTag), d = (
      /** @type {Root} */
      T0e(i, a.content)
    );
    c && u && i.file && (d.position = { start: c.end, end: u.start }), o.content = d;
  }
  return i.schema = t, o;
}
function iV(i, e, t) {
  if ("sourceCodeLocation" in e && e.sourceCodeLocation && i.file) {
    const n = wBt(i, t, e.sourceCodeLocation);
    n && (i.location = !0, t.position = n);
  }
}
function wBt(i, e, t) {
  const n = xN(t);
  if (e.type === "element") {
    const r = e.children[e.children.length - 1];
    if (n && !t.endTag && r && r.position && r.position.end && (n.end = Object.assign({}, r.position.end)), i.verbose) {
      const s = {};
      let o;
      if (t.attrs)
        for (o in t.attrs)
          Z7e.call(t.attrs, o) && (s[h6(i.schema, o).property] = xN(
            t.attrs[o]
          ));
      t.startTag;
      const a = xN(t.startTag), l = t.endTag ? xN(t.endTag) : void 0, c = { opening: a };
      l && (c.closing = l), c.properties = s, e.data = { position: c };
    }
  }
  return n;
}
function xN(i) {
  const e = bAe({
    line: i.startLine,
    column: i.startCol,
    offset: i.startOffset
  }), t = bAe({
    line: i.endLine,
    column: i.endCol,
    offset: i.endOffset
  });
  return e || t ? { start: e, end: t } : void 0;
}
function bAe(i) {
  return i.line && i.column ? i : void 0;
}
const SBt = {}, EBt = {}.hasOwnProperty, J7e = C0e("type", { handlers: { root: LBt, element: NBt, text: DBt, comment: IBt, doctype: kBt } });
function xBt(i, e) {
  const n = (e || SBt).space;
  return J7e(i, n === "svg" ? _0 : w2);
}
function LBt(i, e) {
  const t = {
    nodeName: "#document",
    // @ts-expect-error: `parse5` uses enums, which are actually strings.
    mode: (i.data || {}).quirksMode ? "quirks" : "no-quirks",
    childNodes: []
  };
  return t.childNodes = k0e(i.children, t, e), S2(i, t), t;
}
function TBt(i, e) {
  const t = { nodeName: "#document-fragment", childNodes: [] };
  return t.childNodes = k0e(i.children, t, e), S2(i, t), t;
}
function kBt(i) {
  const e = {
    nodeName: "#documentType",
    name: "html",
    publicId: "",
    systemId: "",
    parentNode: null
  };
  return S2(i, e), e;
}
function DBt(i) {
  const e = {
    nodeName: "#text",
    value: i.value,
    parentNode: null
  };
  return S2(i, e), e;
}
function IBt(i) {
  const e = {
    nodeName: "#comment",
    data: i.value,
    parentNode: null
  };
  return S2(i, e), e;
}
function NBt(i, e) {
  const t = e;
  let n = t;
  i.type === "element" && i.tagName.toLowerCase() === "svg" && t.space === "html" && (n = _0);
  const r = [];
  let s;
  if (i.properties) {
    for (s in i.properties)
      if (s !== "children" && EBt.call(i.properties, s)) {
        const l = RBt(
          n,
          s,
          i.properties[s]
        );
        l && r.push(l);
      }
  }
  const o = n.space, a = {
    nodeName: i.tagName,
    tagName: i.tagName,
    attrs: r,
    // @ts-expect-error: `parse5` types are wrong.
    namespaceURI: Ex[o],
    childNodes: [],
    parentNode: null
  };
  return a.childNodes = k0e(i.children, a, n), S2(i, a), i.tagName === "template" && i.content && (a.content = TBt(i.content, n)), a;
}
function RBt(i, e, t) {
  const n = h6(i, e);
  if (t === !1 || t === null || t === void 0 || typeof t == "number" && Number.isNaN(t) || !t && n.boolean)
    return;
  Array.isArray(t) && (t = n.commaSeparated ? Mme(t) : Ome(t));
  const r = {
    name: n.attribute,
    value: t === !0 ? "" : String(t)
  };
  if (n.space && n.space !== "html" && n.space !== "svg") {
    const s = r.name.indexOf(":");
    s < 0 ? r.prefix = "" : (r.name = r.name.slice(s + 1), r.prefix = n.attribute.slice(0, s)), r.namespace = Ex[n.space];
  }
  return r;
}
function k0e(i, e, t) {
  let n = -1;
  const r = [];
  if (i)
    for (; ++n < i.length; ) {
      const s = J7e(i[n], t);
      s.parentNode = e, r.push(s);
    }
  return r;
}
function S2(i, e) {
  const t = i.position;
  t && t.start && t.end && (t.start.offset, t.end.offset, e.sourceCodeLocation = {
    startLine: t.start.line,
    startCol: t.start.column,
    startOffset: t.start.offset,
    endLine: t.end.line,
    endCol: t.end.column,
    endOffset: t.end.offset
  });
}
const ABt = [
  "area",
  "base",
  "basefont",
  "bgsound",
  "br",
  "col",
  "command",
  "embed",
  "frame",
  "hr",
  "image",
  "img",
  "input",
  "keygen",
  "link",
  "meta",
  "param",
  "source",
  "track",
  "wbr"
], OBt = /* @__PURE__ */ new Set([
  65534,
  65535,
  131070,
  131071,
  196606,
  196607,
  262142,
  262143,
  327678,
  327679,
  393214,
  393215,
  458750,
  458751,
  524286,
  524287,
  589822,
  589823,
  655358,
  655359,
  720894,
  720895,
  786430,
  786431,
  851966,
  851967,
  917502,
  917503,
  983038,
  983039,
  1048574,
  1048575,
  1114110,
  1114111
]), Xo = "�";
var _e;
(function(i) {
  i[i.EOF = -1] = "EOF", i[i.NULL = 0] = "NULL", i[i.TABULATION = 9] = "TABULATION", i[i.CARRIAGE_RETURN = 13] = "CARRIAGE_RETURN", i[i.LINE_FEED = 10] = "LINE_FEED", i[i.FORM_FEED = 12] = "FORM_FEED", i[i.SPACE = 32] = "SPACE", i[i.EXCLAMATION_MARK = 33] = "EXCLAMATION_MARK", i[i.QUOTATION_MARK = 34] = "QUOTATION_MARK", i[i.AMPERSAND = 38] = "AMPERSAND", i[i.APOSTROPHE = 39] = "APOSTROPHE", i[i.HYPHEN_MINUS = 45] = "HYPHEN_MINUS", i[i.SOLIDUS = 47] = "SOLIDUS", i[i.DIGIT_0 = 48] = "DIGIT_0", i[i.DIGIT_9 = 57] = "DIGIT_9", i[i.SEMICOLON = 59] = "SEMICOLON", i[i.LESS_THAN_SIGN = 60] = "LESS_THAN_SIGN", i[i.EQUALS_SIGN = 61] = "EQUALS_SIGN", i[i.GREATER_THAN_SIGN = 62] = "GREATER_THAN_SIGN", i[i.QUESTION_MARK = 63] = "QUESTION_MARK", i[i.LATIN_CAPITAL_A = 65] = "LATIN_CAPITAL_A", i[i.LATIN_CAPITAL_Z = 90] = "LATIN_CAPITAL_Z", i[i.RIGHT_SQUARE_BRACKET = 93] = "RIGHT_SQUARE_BRACKET", i[i.GRAVE_ACCENT = 96] = "GRAVE_ACCENT", i[i.LATIN_SMALL_A = 97] = "LATIN_SMALL_A", i[i.LATIN_SMALL_Z = 122] = "LATIN_SMALL_Z";
})(_e || (_e = {}));
const _h = {
  DASH_DASH: "--",
  CDATA_START: "[CDATA[",
  DOCTYPE: "doctype",
  SCRIPT: "script",
  PUBLIC: "public",
  SYSTEM: "system"
};
function eHe(i) {
  return i >= 55296 && i <= 57343;
}
function MBt(i) {
  return i >= 56320 && i <= 57343;
}
function PBt(i, e) {
  return (i - 55296) * 1024 + 9216 + e;
}
function tHe(i) {
  return i !== 32 && i !== 10 && i !== 13 && i !== 9 && i !== 12 && i >= 1 && i <= 31 || i >= 127 && i <= 159;
}
function nHe(i) {
  return i >= 64976 && i <= 65007 || OBt.has(i);
}
var ht;
(function(i) {
  i.controlCharacterInInputStream = "control-character-in-input-stream", i.noncharacterInInputStream = "noncharacter-in-input-stream", i.surrogateInInputStream = "surrogate-in-input-stream", i.nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus", i.endTagWithAttributes = "end-tag-with-attributes", i.endTagWithTrailingSolidus = "end-tag-with-trailing-solidus", i.unexpectedSolidusInTag = "unexpected-solidus-in-tag", i.unexpectedNullCharacter = "unexpected-null-character", i.unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name", i.invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name", i.unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name", i.missingEndTagName = "missing-end-tag-name", i.unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name", i.unknownNamedCharacterReference = "unknown-named-character-reference", i.missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference", i.unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier", i.unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value", i.eofBeforeTagName = "eof-before-tag-name", i.eofInTag = "eof-in-tag", i.missingAttributeValue = "missing-attribute-value", i.missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes", i.missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword", i.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers", i.missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword", i.missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier", i.missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier", i.missingDoctypePublicIdentifier = "missing-doctype-public-identifier", i.missingDoctypeSystemIdentifier = "missing-doctype-system-identifier", i.abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier", i.abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier", i.cdataInHtmlContent = "cdata-in-html-content", i.incorrectlyOpenedComment = "incorrectly-opened-comment", i.eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text", i.eofInDoctype = "eof-in-doctype", i.nestedComment = "nested-comment", i.abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment", i.eofInComment = "eof-in-comment", i.incorrectlyClosedComment = "incorrectly-closed-comment", i.eofInCdata = "eof-in-cdata", i.absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference", i.nullCharacterReference = "null-character-reference", i.surrogateCharacterReference = "surrogate-character-reference", i.characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range", i.controlCharacterReference = "control-character-reference", i.noncharacterCharacterReference = "noncharacter-character-reference", i.missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name", i.missingDoctypeName = "missing-doctype-name", i.invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name", i.duplicateAttribute = "duplicate-attribute", i.nonConformingDoctype = "non-conforming-doctype", i.missingDoctype = "missing-doctype", i.misplacedDoctype = "misplaced-doctype", i.endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element", i.closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements", i.disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head", i.openElementsLeftAfterEof = "open-elements-left-after-eof", i.abandonedHeadElementChild = "abandoned-head-element-child", i.misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element", i.nestedNoscriptInHead = "nested-noscript-in-head", i.eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text";
})(ht || (ht = {}));
const FBt = 65536;
class BBt {
  constructor(e) {
    this.handler = e, this.html = "", this.pos = -1, this.lastGapPos = -2, this.gapStack = [], this.skipNextNewLine = !1, this.lastChunkWritten = !1, this.endOfChunkHit = !1, this.bufferWaterline = FBt, this.isEol = !1, this.lineStartPos = 0, this.droppedBufferSize = 0, this.line = 1, this.lastErrOffset = -1;
  }
  /** The column on the current line. If we just saw a gap (eg. a surrogate pair), return the index before. */
  get col() {
    return this.pos - this.lineStartPos + +(this.lastGapPos !== this.pos);
  }
  get offset() {
    return this.droppedBufferSize + this.pos;
  }
  getError(e, t) {
    const { line: n, col: r, offset: s } = this, o = r + t, a = s + t;
    return {
      code: e,
      startLine: n,
      endLine: n,
      startCol: o,
      endCol: o,
      startOffset: a,
      endOffset: a
    };
  }
  _err(e) {
    this.handler.onParseError && this.lastErrOffset !== this.offset && (this.lastErrOffset = this.offset, this.handler.onParseError(this.getError(e, 0)));
  }
  _addGap() {
    this.gapStack.push(this.lastGapPos), this.lastGapPos = this.pos;
  }
  _processSurrogate(e) {
    if (this.pos !== this.html.length - 1) {
      const t = this.html.charCodeAt(this.pos + 1);
      if (MBt(t))
        return this.pos++, this._addGap(), PBt(e, t);
    } else if (!this.lastChunkWritten)
      return this.endOfChunkHit = !0, _e.EOF;
    return this._err(ht.surrogateInInputStream), e;
  }
  willDropParsedChunk() {
    return this.pos > this.bufferWaterline;
  }
  dropParsedChunk() {
    this.willDropParsedChunk() && (this.html = this.html.substring(this.pos), this.lineStartPos -= this.pos, this.droppedBufferSize += this.pos, this.pos = 0, this.lastGapPos = -2, this.gapStack.length = 0);
  }
  write(e, t) {
    this.html.length > 0 ? this.html += e : this.html = e, this.endOfChunkHit = !1, this.lastChunkWritten = t;
  }
  insertHtmlAtCurrentPos(e) {
    this.html = this.html.substring(0, this.pos + 1) + e + this.html.substring(this.pos + 1), this.endOfChunkHit = !1;
  }
  startsWith(e, t) {
    if (this.pos + e.length > this.html.length)
      return this.endOfChunkHit = !this.lastChunkWritten, !1;
    if (t)
      return this.html.startsWith(e, this.pos);
    for (let n = 0; n < e.length; n++)
      if ((this.html.charCodeAt(this.pos + n) | 32) !== e.charCodeAt(n))
        return !1;
    return !0;
  }
  peek(e) {
    const t = this.pos + e;
    if (t >= this.html.length)
      return this.endOfChunkHit = !this.lastChunkWritten, _e.EOF;
    const n = this.html.charCodeAt(t);
    return n === _e.CARRIAGE_RETURN ? _e.LINE_FEED : n;
  }
  advance() {
    if (this.pos++, this.isEol && (this.isEol = !1, this.line++, this.lineStartPos = this.pos), this.pos >= this.html.length)
      return this.endOfChunkHit = !this.lastChunkWritten, _e.EOF;
    let e = this.html.charCodeAt(this.pos);
    return e === _e.CARRIAGE_RETURN ? (this.isEol = !0, this.skipNextNewLine = !0, _e.LINE_FEED) : e === _e.LINE_FEED && (this.isEol = !0, this.skipNextNewLine) ? (this.line--, this.skipNextNewLine = !1, this._addGap(), this.advance()) : (this.skipNextNewLine = !1, eHe(e) && (e = this._processSurrogate(e)), this.handler.onParseError === null || e > 31 && e < 127 || e === _e.LINE_FEED || e === _e.CARRIAGE_RETURN || e > 159 && e < 64976 || this._checkForProblematicCharacters(e), e);
  }
  _checkForProblematicCharacters(e) {
    tHe(e) ? this._err(ht.controlCharacterInInputStream) : nHe(e) && this._err(ht.noncharacterInInputStream);
  }
  retreat(e) {
    for (this.pos -= e; this.pos < this.lastGapPos; )
      this.lastGapPos = this.gapStack.pop(), this.pos--;
    this.isEol = !1;
  }
}
var Dr;
(function(i) {
  i[i.CHARACTER = 0] = "CHARACTER", i[i.NULL_CHARACTER = 1] = "NULL_CHARACTER", i[i.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", i[i.START_TAG = 3] = "START_TAG", i[i.END_TAG = 4] = "END_TAG", i[i.COMMENT = 5] = "COMMENT", i[i.DOCTYPE = 6] = "DOCTYPE", i[i.EOF = 7] = "EOF", i[i.HIBERNATION = 8] = "HIBERNATION";
})(Dr || (Dr = {}));
function iHe(i, e) {
  for (let t = i.attrs.length - 1; t >= 0; t--)
    if (i.attrs[t].name === e)
      return i.attrs[t].value;
  return null;
}
const HBt = /* @__PURE__ */ new Uint16Array(
  // prettier-ignore
  /* @__PURE__ */ 'ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((i) => i.charCodeAt(0))
), WBt = /* @__PURE__ */ new Map([
  [0, 65533],
  // C1 Unicode control character reference replacements
  [128, 8364],
  [130, 8218],
  [131, 402],
  [132, 8222],
  [133, 8230],
  [134, 8224],
  [135, 8225],
  [136, 710],
  [137, 8240],
  [138, 352],
  [139, 8249],
  [140, 338],
  [142, 381],
  [145, 8216],
  [146, 8217],
  [147, 8220],
  [148, 8221],
  [149, 8226],
  [150, 8211],
  [151, 8212],
  [152, 732],
  [153, 8482],
  [154, 353],
  [155, 8250],
  [156, 339],
  [158, 382],
  [159, 376]
]);
function VBt(i) {
  var e;
  return i >= 55296 && i <= 57343 || i > 1114111 ? 65533 : (e = WBt.get(i)) !== null && e !== void 0 ? e : i;
}
var Sc;
(function(i) {
  i[i.NUM = 35] = "NUM", i[i.SEMI = 59] = "SEMI", i[i.EQUALS = 61] = "EQUALS", i[i.ZERO = 48] = "ZERO", i[i.NINE = 57] = "NINE", i[i.LOWER_A = 97] = "LOWER_A", i[i.LOWER_F = 102] = "LOWER_F", i[i.LOWER_X = 120] = "LOWER_X", i[i.LOWER_Z = 122] = "LOWER_Z", i[i.UPPER_A = 65] = "UPPER_A", i[i.UPPER_F = 70] = "UPPER_F", i[i.UPPER_Z = 90] = "UPPER_Z";
})(Sc || (Sc = {}));
const UBt = 32;
var C1;
(function(i) {
  i[i.VALUE_LENGTH = 49152] = "VALUE_LENGTH", i[i.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", i[i.JUMP_TABLE = 127] = "JUMP_TABLE";
})(C1 || (C1 = {}));
function hde(i) {
  return i >= Sc.ZERO && i <= Sc.NINE;
}
function zBt(i) {
  return i >= Sc.UPPER_A && i <= Sc.UPPER_F || i >= Sc.LOWER_A && i <= Sc.LOWER_F;
}
function $Bt(i) {
  return i >= Sc.UPPER_A && i <= Sc.UPPER_Z || i >= Sc.LOWER_A && i <= Sc.LOWER_Z || hde(i);
}
function jBt(i) {
  return i === Sc.EQUALS || $Bt(i);
}
var gc;
(function(i) {
  i[i.EntityStart = 0] = "EntityStart", i[i.NumericStart = 1] = "NumericStart", i[i.NumericDecimal = 2] = "NumericDecimal", i[i.NumericHex = 3] = "NumericHex", i[i.NamedEntity = 4] = "NamedEntity";
})(gc || (gc = {}));
var gy;
(function(i) {
  i[i.Legacy = 0] = "Legacy", i[i.Strict = 1] = "Strict", i[i.Attribute = 2] = "Attribute";
})(gy || (gy = {}));
class GBt {
  constructor(e, t, n) {
    this.decodeTree = e, this.emitCodePoint = t, this.errors = n, this.state = gc.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = gy.Strict;
  }
  /** Resets the instance to make it reusable. */
  startEntity(e) {
    this.decodeMode = e, this.state = gc.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
  }
  /**
   * Write an entity to the decoder. This can be called multiple times with partial entities.
   * If the entity is incomplete, the decoder will return -1.
   *
   * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
   * entity is incomplete, and resume when the next string is written.
   *
   * @param input The string containing the entity (or a continuation of the entity).
   * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  write(e, t) {
    switch (this.state) {
      case gc.EntityStart:
        return e.charCodeAt(t) === Sc.NUM ? (this.state = gc.NumericStart, this.consumed += 1, this.stateNumericStart(e, t + 1)) : (this.state = gc.NamedEntity, this.stateNamedEntity(e, t));
      case gc.NumericStart:
        return this.stateNumericStart(e, t);
      case gc.NumericDecimal:
        return this.stateNumericDecimal(e, t);
      case gc.NumericHex:
        return this.stateNumericHex(e, t);
      case gc.NamedEntity:
        return this.stateNamedEntity(e, t);
    }
  }
  /**
   * Switches between the numeric decimal and hexadecimal states.
   *
   * Equivalent to the `Numeric character reference state` in the HTML spec.
   *
   * @param input The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericStart(e, t) {
    return t >= e.length ? -1 : (e.charCodeAt(t) | UBt) === Sc.LOWER_X ? (this.state = gc.NumericHex, this.consumed += 1, this.stateNumericHex(e, t + 1)) : (this.state = gc.NumericDecimal, this.stateNumericDecimal(e, t));
  }
  addToNumericResult(e, t, n, r) {
    if (t !== n) {
      const s = n - t;
      this.result = this.result * Math.pow(r, s) + Number.parseInt(e.substr(t, s), r), this.consumed += s;
    }
  }
  /**
   * Parses a hexadecimal numeric entity.
   *
   * Equivalent to the `Hexademical character reference state` in the HTML spec.
   *
   * @param input The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericHex(e, t) {
    const n = t;
    for (; t < e.length; ) {
      const r = e.charCodeAt(t);
      if (hde(r) || zBt(r))
        t += 1;
      else
        return this.addToNumericResult(e, n, t, 16), this.emitNumericEntity(r, 3);
    }
    return this.addToNumericResult(e, n, t, 16), -1;
  }
  /**
   * Parses a decimal numeric entity.
   *
   * Equivalent to the `Decimal character reference state` in the HTML spec.
   *
   * @param input The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericDecimal(e, t) {
    const n = t;
    for (; t < e.length; ) {
      const r = e.charCodeAt(t);
      if (hde(r))
        t += 1;
      else
        return this.addToNumericResult(e, n, t, 10), this.emitNumericEntity(r, 2);
    }
    return this.addToNumericResult(e, n, t, 10), -1;
  }
  /**
   * Validate and emit a numeric entity.
   *
   * Implements the logic from the `Hexademical character reference start
   * state` and `Numeric character reference end state` in the HTML spec.
   *
   * @param lastCp The last code point of the entity. Used to see if the
   *               entity was terminated with a semicolon.
   * @param expectedLength The minimum number of characters that should be
   *                       consumed. Used to validate that at least one digit
   *                       was consumed.
   * @returns The number of characters that were consumed.
   */
  emitNumericEntity(e, t) {
    var n;
    if (this.consumed <= t)
      return (n = this.errors) === null || n === void 0 || n.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
    if (e === Sc.SEMI)
      this.consumed += 1;
    else if (this.decodeMode === gy.Strict)
      return 0;
    return this.emitCodePoint(VBt(this.result), this.consumed), this.errors && (e !== Sc.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
  }
  /**
   * Parses a named entity.
   *
   * Equivalent to the `Named character reference state` in the HTML spec.
   *
   * @param input The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNamedEntity(e, t) {
    const { decodeTree: n } = this;
    let r = n[this.treeIndex], s = (r & C1.VALUE_LENGTH) >> 14;
    for (; t < e.length; t++, this.excess++) {
      const o = e.charCodeAt(t);
      if (this.treeIndex = qBt(n, r, this.treeIndex + Math.max(1, s), o), this.treeIndex < 0)
        return this.result === 0 || // If we are parsing an attribute
        this.decodeMode === gy.Attribute && // We shouldn't have consumed any characters after the entity,
        (s === 0 || // And there should be no invalid characters.
        jBt(o)) ? 0 : this.emitNotTerminatedNamedEntity();
      if (r = n[this.treeIndex], s = (r & C1.VALUE_LENGTH) >> 14, s !== 0) {
        if (o === Sc.SEMI)
          return this.emitNamedEntityData(this.treeIndex, s, this.consumed + this.excess);
        this.decodeMode !== gy.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
      }
    }
    return -1;
  }
  /**
   * Emit a named entity that was not terminated with a semicolon.
   *
   * @returns The number of characters consumed.
   */
  emitNotTerminatedNamedEntity() {
    var e;
    const { result: t, decodeTree: n } = this, r = (n[t] & C1.VALUE_LENGTH) >> 14;
    return this.emitNamedEntityData(t, r, this.consumed), (e = this.errors) === null || e === void 0 || e.missingSemicolonAfterCharacterReference(), this.consumed;
  }
  /**
   * Emit a named entity.
   *
   * @param result The index of the entity in the decode tree.
   * @param valueLength The number of bytes in the entity.
   * @param consumed The number of characters consumed.
   *
   * @returns The number of characters consumed.
   */
  emitNamedEntityData(e, t, n) {
    const { decodeTree: r } = this;
    return this.emitCodePoint(t === 1 ? r[e] & ~C1.VALUE_LENGTH : r[e + 1], n), t === 3 && this.emitCodePoint(r[e + 2], n), n;
  }
  /**
   * Signal to the parser that the end of the input was reached.
   *
   * Remaining data will be emitted and relevant errors will be produced.
   *
   * @returns The number of characters consumed.
   */
  end() {
    var e;
    switch (this.state) {
      case gc.NamedEntity:
        return this.result !== 0 && (this.decodeMode !== gy.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
      // Otherwise, emit a numeric entity if we have one.
      case gc.NumericDecimal:
        return this.emitNumericEntity(0, 2);
      case gc.NumericHex:
        return this.emitNumericEntity(0, 3);
      case gc.NumericStart:
        return (e = this.errors) === null || e === void 0 || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
      case gc.EntityStart:
        return 0;
    }
  }
}
function qBt(i, e, t, n) {
  const r = (e & C1.BRANCH_LENGTH) >> 7, s = e & C1.JUMP_TABLE;
  if (r === 0)
    return s !== 0 && n === s ? t : -1;
  if (s) {
    const l = n - s;
    return l < 0 || l >= r ? -1 : i[t + l] - 1;
  }
  let o = t, a = o + r - 1;
  for (; o <= a; ) {
    const l = o + a >>> 1, c = i[l];
    if (c < n)
      o = l + 1;
    else if (c > n)
      a = l - 1;
    else
      return i[l + r];
  }
  return -1;
}
var Rt;
(function(i) {
  i.HTML = "http://www.w3.org/1999/xhtml", i.MATHML = "http://www.w3.org/1998/Math/MathML", i.SVG = "http://www.w3.org/2000/svg", i.XLINK = "http://www.w3.org/1999/xlink", i.XML = "http://www.w3.org/XML/1998/namespace", i.XMLNS = "http://www.w3.org/2000/xmlns/";
})(Rt || (Rt = {}));
var Yx;
(function(i) {
  i.TYPE = "type", i.ACTION = "action", i.ENCODING = "encoding", i.PROMPT = "prompt", i.NAME = "name", i.COLOR = "color", i.FACE = "face", i.SIZE = "size";
})(Yx || (Yx = {}));
var Bg;
(function(i) {
  i.NO_QUIRKS = "no-quirks", i.QUIRKS = "quirks", i.LIMITED_QUIRKS = "limited-quirks";
})(Bg || (Bg = {}));
var Ye;
(function(i) {
  i.A = "a", i.ADDRESS = "address", i.ANNOTATION_XML = "annotation-xml", i.APPLET = "applet", i.AREA = "area", i.ARTICLE = "article", i.ASIDE = "aside", i.B = "b", i.BASE = "base", i.BASEFONT = "basefont", i.BGSOUND = "bgsound", i.BIG = "big", i.BLOCKQUOTE = "blockquote", i.BODY = "body", i.BR = "br", i.BUTTON = "button", i.CAPTION = "caption", i.CENTER = "center", i.CODE = "code", i.COL = "col", i.COLGROUP = "colgroup", i.DD = "dd", i.DESC = "desc", i.DETAILS = "details", i.DIALOG = "dialog", i.DIR = "dir", i.DIV = "div", i.DL = "dl", i.DT = "dt", i.EM = "em", i.EMBED = "embed", i.FIELDSET = "fieldset", i.FIGCAPTION = "figcaption", i.FIGURE = "figure", i.FONT = "font", i.FOOTER = "footer", i.FOREIGN_OBJECT = "foreignObject", i.FORM = "form", i.FRAME = "frame", i.FRAMESET = "frameset", i.H1 = "h1", i.H2 = "h2", i.H3 = "h3", i.H4 = "h4", i.H5 = "h5", i.H6 = "h6", i.HEAD = "head", i.HEADER = "header", i.HGROUP = "hgroup", i.HR = "hr", i.HTML = "html", i.I = "i", i.IMG = "img", i.IMAGE = "image", i.INPUT = "input", i.IFRAME = "iframe", i.KEYGEN = "keygen", i.LABEL = "label", i.LI = "li", i.LINK = "link", i.LISTING = "listing", i.MAIN = "main", i.MALIGNMARK = "malignmark", i.MARQUEE = "marquee", i.MATH = "math", i.MENU = "menu", i.META = "meta", i.MGLYPH = "mglyph", i.MI = "mi", i.MO = "mo", i.MN = "mn", i.MS = "ms", i.MTEXT = "mtext", i.NAV = "nav", i.NOBR = "nobr", i.NOFRAMES = "noframes", i.NOEMBED = "noembed", i.NOSCRIPT = "noscript", i.OBJECT = "object", i.OL = "ol", i.OPTGROUP = "optgroup", i.OPTION = "option", i.P = "p", i.PARAM = "param", i.PLAINTEXT = "plaintext", i.PRE = "pre", i.RB = "rb", i.RP = "rp", i.RT = "rt", i.RTC = "rtc", i.RUBY = "ruby", i.S = "s", i.SCRIPT = "script", i.SEARCH = "search", i.SECTION = "section", i.SELECT = "select", i.SOURCE = "source", i.SMALL = "small", i.SPAN = "span", i.STRIKE = "strike", i.STRONG = "strong", i.STYLE = "style", i.SUB = "sub", i.SUMMARY = "summary", i.SUP = "sup", i.TABLE = "table", i.TBODY = "tbody", i.TEMPLATE = "template", i.TEXTAREA = "textarea", i.TFOOT = "tfoot", i.TD = "td", i.TH = "th", i.THEAD = "thead", i.TITLE = "title", i.TR = "tr", i.TRACK = "track", i.TT = "tt", i.U = "u", i.UL = "ul", i.SVG = "svg", i.VAR = "var", i.WBR = "wbr", i.XMP = "xmp";
})(Ye || (Ye = {}));
var P;
(function(i) {
  i[i.UNKNOWN = 0] = "UNKNOWN", i[i.A = 1] = "A", i[i.ADDRESS = 2] = "ADDRESS", i[i.ANNOTATION_XML = 3] = "ANNOTATION_XML", i[i.APPLET = 4] = "APPLET", i[i.AREA = 5] = "AREA", i[i.ARTICLE = 6] = "ARTICLE", i[i.ASIDE = 7] = "ASIDE", i[i.B = 8] = "B", i[i.BASE = 9] = "BASE", i[i.BASEFONT = 10] = "BASEFONT", i[i.BGSOUND = 11] = "BGSOUND", i[i.BIG = 12] = "BIG", i[i.BLOCKQUOTE = 13] = "BLOCKQUOTE", i[i.BODY = 14] = "BODY", i[i.BR = 15] = "BR", i[i.BUTTON = 16] = "BUTTON", i[i.CAPTION = 17] = "CAPTION", i[i.CENTER = 18] = "CENTER", i[i.CODE = 19] = "CODE", i[i.COL = 20] = "COL", i[i.COLGROUP = 21] = "COLGROUP", i[i.DD = 22] = "DD", i[i.DESC = 23] = "DESC", i[i.DETAILS = 24] = "DETAILS", i[i.DIALOG = 25] = "DIALOG", i[i.DIR = 26] = "DIR", i[i.DIV = 27] = "DIV", i[i.DL = 28] = "DL", i[i.DT = 29] = "DT", i[i.EM = 30] = "EM", i[i.EMBED = 31] = "EMBED", i[i.FIELDSET = 32] = "FIELDSET", i[i.FIGCAPTION = 33] = "FIGCAPTION", i[i.FIGURE = 34] = "FIGURE", i[i.FONT = 35] = "FONT", i[i.FOOTER = 36] = "FOOTER", i[i.FOREIGN_OBJECT = 37] = "FOREIGN_OBJECT", i[i.FORM = 38] = "FORM", i[i.FRAME = 39] = "FRAME", i[i.FRAMESET = 40] = "FRAMESET", i[i.H1 = 41] = "H1", i[i.H2 = 42] = "H2", i[i.H3 = 43] = "H3", i[i.H4 = 44] = "H4", i[i.H5 = 45] = "H5", i[i.H6 = 46] = "H6", i[i.HEAD = 47] = "HEAD", i[i.HEADER = 48] = "HEADER", i[i.HGROUP = 49] = "HGROUP", i[i.HR = 50] = "HR", i[i.HTML = 51] = "HTML", i[i.I = 52] = "I", i[i.IMG = 53] = "IMG", i[i.IMAGE = 54] = "IMAGE", i[i.INPUT = 55] = "INPUT", i[i.IFRAME = 56] = "IFRAME", i[i.KEYGEN = 57] = "KEYGEN", i[i.LABEL = 58] = "LABEL", i[i.LI = 59] = "LI", i[i.LINK = 60] = "LINK", i[i.LISTING = 61] = "LISTING", i[i.MAIN = 62] = "MAIN", i[i.MALIGNMARK = 63] = "MALIGNMARK", i[i.MARQUEE = 64] = "MARQUEE", i[i.MATH = 65] = "MATH", i[i.MENU = 66] = "MENU", i[i.META = 67] = "META", i[i.MGLYPH = 68] = "MGLYPH", i[i.MI = 69] = "MI", i[i.MO = 70] = "MO", i[i.MN = 71] = "MN", i[i.MS = 72] = "MS", i[i.MTEXT = 73] = "MTEXT", i[i.NAV = 74] = "NAV", i[i.NOBR = 75] = "NOBR", i[i.NOFRAMES = 76] = "NOFRAMES", i[i.NOEMBED = 77] = "NOEMBED", i[i.NOSCRIPT = 78] = "NOSCRIPT", i[i.OBJECT = 79] = "OBJECT", i[i.OL = 80] = "OL", i[i.OPTGROUP = 81] = "OPTGROUP", i[i.OPTION = 82] = "OPTION", i[i.P = 83] = "P", i[i.PARAM = 84] = "PARAM", i[i.PLAINTEXT = 85] = "PLAINTEXT", i[i.PRE = 86] = "PRE", i[i.RB = 87] = "RB", i[i.RP = 88] = "RP", i[i.RT = 89] = "RT", i[i.RTC = 90] = "RTC", i[i.RUBY = 91] = "RUBY", i[i.S = 92] = "S", i[i.SCRIPT = 93] = "SCRIPT", i[i.SEARCH = 94] = "SEARCH", i[i.SECTION = 95] = "SECTION", i[i.SELECT = 96] = "SELECT", i[i.SOURCE = 97] = "SOURCE", i[i.SMALL = 98] = "SMALL", i[i.SPAN = 99] = "SPAN", i[i.STRIKE = 100] = "STRIKE", i[i.STRONG = 101] = "STRONG", i[i.STYLE = 102] = "STYLE", i[i.SUB = 103] = "SUB", i[i.SUMMARY = 104] = "SUMMARY", i[i.SUP = 105] = "SUP", i[i.TABLE = 106] = "TABLE", i[i.TBODY = 107] = "TBODY", i[i.TEMPLATE = 108] = "TEMPLATE", i[i.TEXTAREA = 109] = "TEXTAREA", i[i.TFOOT = 110] = "TFOOT", i[i.TD = 111] = "TD", i[i.TH = 112] = "TH", i[i.THEAD = 113] = "THEAD", i[i.TITLE = 114] = "TITLE", i[i.TR = 115] = "TR", i[i.TRACK = 116] = "TRACK", i[i.TT = 117] = "TT", i[i.U = 118] = "U", i[i.UL = 119] = "UL", i[i.SVG = 120] = "SVG", i[i.VAR = 121] = "VAR", i[i.WBR = 122] = "WBR", i[i.XMP = 123] = "XMP";
})(P || (P = {}));
const KBt = /* @__PURE__ */ new Map([
  [Ye.A, P.A],
  [Ye.ADDRESS, P.ADDRESS],
  [Ye.ANNOTATION_XML, P.ANNOTATION_XML],
  [Ye.APPLET, P.APPLET],
  [Ye.AREA, P.AREA],
  [Ye.ARTICLE, P.ARTICLE],
  [Ye.ASIDE, P.ASIDE],
  [Ye.B, P.B],
  [Ye.BASE, P.BASE],
  [Ye.BASEFONT, P.BASEFONT],
  [Ye.BGSOUND, P.BGSOUND],
  [Ye.BIG, P.BIG],
  [Ye.BLOCKQUOTE, P.BLOCKQUOTE],
  [Ye.BODY, P.BODY],
  [Ye.BR, P.BR],
  [Ye.BUTTON, P.BUTTON],
  [Ye.CAPTION, P.CAPTION],
  [Ye.CENTER, P.CENTER],
  [Ye.CODE, P.CODE],
  [Ye.COL, P.COL],
  [Ye.COLGROUP, P.COLGROUP],
  [Ye.DD, P.DD],
  [Ye.DESC, P.DESC],
  [Ye.DETAILS, P.DETAILS],
  [Ye.DIALOG, P.DIALOG],
  [Ye.DIR, P.DIR],
  [Ye.DIV, P.DIV],
  [Ye.DL, P.DL],
  [Ye.DT, P.DT],
  [Ye.EM, P.EM],
  [Ye.EMBED, P.EMBED],
  [Ye.FIELDSET, P.FIELDSET],
  [Ye.FIGCAPTION, P.FIGCAPTION],
  [Ye.FIGURE, P.FIGURE],
  [Ye.FONT, P.FONT],
  [Ye.FOOTER, P.FOOTER],
  [Ye.FOREIGN_OBJECT, P.FOREIGN_OBJECT],
  [Ye.FORM, P.FORM],
  [Ye.FRAME, P.FRAME],
  [Ye.FRAMESET, P.FRAMESET],
  [Ye.H1, P.H1],
  [Ye.H2, P.H2],
  [Ye.H3, P.H3],
  [Ye.H4, P.H4],
  [Ye.H5, P.H5],
  [Ye.H6, P.H6],
  [Ye.HEAD, P.HEAD],
  [Ye.HEADER, P.HEADER],
  [Ye.HGROUP, P.HGROUP],
  [Ye.HR, P.HR],
  [Ye.HTML, P.HTML],
  [Ye.I, P.I],
  [Ye.IMG, P.IMG],
  [Ye.IMAGE, P.IMAGE],
  [Ye.INPUT, P.INPUT],
  [Ye.IFRAME, P.IFRAME],
  [Ye.KEYGEN, P.KEYGEN],
  [Ye.LABEL, P.LABEL],
  [Ye.LI, P.LI],
  [Ye.LINK, P.LINK],
  [Ye.LISTING, P.LISTING],
  [Ye.MAIN, P.MAIN],
  [Ye.MALIGNMARK, P.MALIGNMARK],
  [Ye.MARQUEE, P.MARQUEE],
  [Ye.MATH, P.MATH],
  [Ye.MENU, P.MENU],
  [Ye.META, P.META],
  [Ye.MGLYPH, P.MGLYPH],
  [Ye.MI, P.MI],
  [Ye.MO, P.MO],
  [Ye.MN, P.MN],
  [Ye.MS, P.MS],
  [Ye.MTEXT, P.MTEXT],
  [Ye.NAV, P.NAV],
  [Ye.NOBR, P.NOBR],
  [Ye.NOFRAMES, P.NOFRAMES],
  [Ye.NOEMBED, P.NOEMBED],
  [Ye.NOSCRIPT, P.NOSCRIPT],
  [Ye.OBJECT, P.OBJECT],
  [Ye.OL, P.OL],
  [Ye.OPTGROUP, P.OPTGROUP],
  [Ye.OPTION, P.OPTION],
  [Ye.P, P.P],
  [Ye.PARAM, P.PARAM],
  [Ye.PLAINTEXT, P.PLAINTEXT],
  [Ye.PRE, P.PRE],
  [Ye.RB, P.RB],
  [Ye.RP, P.RP],
  [Ye.RT, P.RT],
  [Ye.RTC, P.RTC],
  [Ye.RUBY, P.RUBY],
  [Ye.S, P.S],
  [Ye.SCRIPT, P.SCRIPT],
  [Ye.SEARCH, P.SEARCH],
  [Ye.SECTION, P.SECTION],
  [Ye.SELECT, P.SELECT],
  [Ye.SOURCE, P.SOURCE],
  [Ye.SMALL, P.SMALL],
  [Ye.SPAN, P.SPAN],
  [Ye.STRIKE, P.STRIKE],
  [Ye.STRONG, P.STRONG],
  [Ye.STYLE, P.STYLE],
  [Ye.SUB, P.SUB],
  [Ye.SUMMARY, P.SUMMARY],
  [Ye.SUP, P.SUP],
  [Ye.TABLE, P.TABLE],
  [Ye.TBODY, P.TBODY],
  [Ye.TEMPLATE, P.TEMPLATE],
  [Ye.TEXTAREA, P.TEXTAREA],
  [Ye.TFOOT, P.TFOOT],
  [Ye.TD, P.TD],
  [Ye.TH, P.TH],
  [Ye.THEAD, P.THEAD],
  [Ye.TITLE, P.TITLE],
  [Ye.TR, P.TR],
  [Ye.TRACK, P.TRACK],
  [Ye.TT, P.TT],
  [Ye.U, P.U],
  [Ye.UL, P.UL],
  [Ye.SVG, P.SVG],
  [Ye.VAR, P.VAR],
  [Ye.WBR, P.WBR],
  [Ye.XMP, P.XMP]
]);
function E2(i) {
  var e;
  return (e = KBt.get(i)) !== null && e !== void 0 ? e : P.UNKNOWN;
}
const Ft = P, YBt = {
  [Rt.HTML]: /* @__PURE__ */ new Set([
    Ft.ADDRESS,
    Ft.APPLET,
    Ft.AREA,
    Ft.ARTICLE,
    Ft.ASIDE,
    Ft.BASE,
    Ft.BASEFONT,
    Ft.BGSOUND,
    Ft.BLOCKQUOTE,
    Ft.BODY,
    Ft.BR,
    Ft.BUTTON,
    Ft.CAPTION,
    Ft.CENTER,
    Ft.COL,
    Ft.COLGROUP,
    Ft.DD,
    Ft.DETAILS,
    Ft.DIR,
    Ft.DIV,
    Ft.DL,
    Ft.DT,
    Ft.EMBED,
    Ft.FIELDSET,
    Ft.FIGCAPTION,
    Ft.FIGURE,
    Ft.FOOTER,
    Ft.FORM,
    Ft.FRAME,
    Ft.FRAMESET,
    Ft.H1,
    Ft.H2,
    Ft.H3,
    Ft.H4,
    Ft.H5,
    Ft.H6,
    Ft.HEAD,
    Ft.HEADER,
    Ft.HGROUP,
    Ft.HR,
    Ft.HTML,
    Ft.IFRAME,
    Ft.IMG,
    Ft.INPUT,
    Ft.LI,
    Ft.LINK,
    Ft.LISTING,
    Ft.MAIN,
    Ft.MARQUEE,
    Ft.MENU,
    Ft.META,
    Ft.NAV,
    Ft.NOEMBED,
    Ft.NOFRAMES,
    Ft.NOSCRIPT,
    Ft.OBJECT,
    Ft.OL,
    Ft.P,
    Ft.PARAM,
    Ft.PLAINTEXT,
    Ft.PRE,
    Ft.SCRIPT,
    Ft.SECTION,
    Ft.SELECT,
    Ft.SOURCE,
    Ft.STYLE,
    Ft.SUMMARY,
    Ft.TABLE,
    Ft.TBODY,
    Ft.TD,
    Ft.TEMPLATE,
    Ft.TEXTAREA,
    Ft.TFOOT,
    Ft.TH,
    Ft.THEAD,
    Ft.TITLE,
    Ft.TR,
    Ft.TRACK,
    Ft.UL,
    Ft.WBR,
    Ft.XMP
  ]),
  [Rt.MATHML]: /* @__PURE__ */ new Set([Ft.MI, Ft.MO, Ft.MN, Ft.MS, Ft.MTEXT, Ft.ANNOTATION_XML]),
  [Rt.SVG]: /* @__PURE__ */ new Set([Ft.TITLE, Ft.FOREIGN_OBJECT, Ft.DESC]),
  [Rt.XLINK]: /* @__PURE__ */ new Set(),
  [Rt.XML]: /* @__PURE__ */ new Set(),
  [Rt.XMLNS]: /* @__PURE__ */ new Set()
}, fde = /* @__PURE__ */ new Set([Ft.H1, Ft.H2, Ft.H3, Ft.H4, Ft.H5, Ft.H6]);
Ye.STYLE, Ye.SCRIPT, Ye.XMP, Ye.IFRAME, Ye.NOEMBED, Ye.NOFRAMES, Ye.PLAINTEXT;
var ye;
(function(i) {
  i[i.DATA = 0] = "DATA", i[i.RCDATA = 1] = "RCDATA", i[i.RAWTEXT = 2] = "RAWTEXT", i[i.SCRIPT_DATA = 3] = "SCRIPT_DATA", i[i.PLAINTEXT = 4] = "PLAINTEXT", i[i.TAG_OPEN = 5] = "TAG_OPEN", i[i.END_TAG_OPEN = 6] = "END_TAG_OPEN", i[i.TAG_NAME = 7] = "TAG_NAME", i[i.RCDATA_LESS_THAN_SIGN = 8] = "RCDATA_LESS_THAN_SIGN", i[i.RCDATA_END_TAG_OPEN = 9] = "RCDATA_END_TAG_OPEN", i[i.RCDATA_END_TAG_NAME = 10] = "RCDATA_END_TAG_NAME", i[i.RAWTEXT_LESS_THAN_SIGN = 11] = "RAWTEXT_LESS_THAN_SIGN", i[i.RAWTEXT_END_TAG_OPEN = 12] = "RAWTEXT_END_TAG_OPEN", i[i.RAWTEXT_END_TAG_NAME = 13] = "RAWTEXT_END_TAG_NAME", i[i.SCRIPT_DATA_LESS_THAN_SIGN = 14] = "SCRIPT_DATA_LESS_THAN_SIGN", i[i.SCRIPT_DATA_END_TAG_OPEN = 15] = "SCRIPT_DATA_END_TAG_OPEN", i[i.SCRIPT_DATA_END_TAG_NAME = 16] = "SCRIPT_DATA_END_TAG_NAME", i[i.SCRIPT_DATA_ESCAPE_START = 17] = "SCRIPT_DATA_ESCAPE_START", i[i.SCRIPT_DATA_ESCAPE_START_DASH = 18] = "SCRIPT_DATA_ESCAPE_START_DASH", i[i.SCRIPT_DATA_ESCAPED = 19] = "SCRIPT_DATA_ESCAPED", i[i.SCRIPT_DATA_ESCAPED_DASH = 20] = "SCRIPT_DATA_ESCAPED_DASH", i[i.SCRIPT_DATA_ESCAPED_DASH_DASH = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH", i[i.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN", i[i.SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN", i[i.SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME", i[i.SCRIPT_DATA_DOUBLE_ESCAPE_START = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START", i[i.SCRIPT_DATA_DOUBLE_ESCAPED = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED", i[i.SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH", i[i.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH", i[i.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN", i[i.SCRIPT_DATA_DOUBLE_ESCAPE_END = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END", i[i.BEFORE_ATTRIBUTE_NAME = 31] = "BEFORE_ATTRIBUTE_NAME", i[i.ATTRIBUTE_NAME = 32] = "ATTRIBUTE_NAME", i[i.AFTER_ATTRIBUTE_NAME = 33] = "AFTER_ATTRIBUTE_NAME", i[i.BEFORE_ATTRIBUTE_VALUE = 34] = "BEFORE_ATTRIBUTE_VALUE", i[i.ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED", i[i.ATTRIBUTE_VALUE_SINGLE_QUOTED = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED", i[i.ATTRIBUTE_VALUE_UNQUOTED = 37] = "ATTRIBUTE_VALUE_UNQUOTED", i[i.AFTER_ATTRIBUTE_VALUE_QUOTED = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED", i[i.SELF_CLOSING_START_TAG = 39] = "SELF_CLOSING_START_TAG", i[i.BOGUS_COMMENT = 40] = "BOGUS_COMMENT", i[i.MARKUP_DECLARATION_OPEN = 41] = "MARKUP_DECLARATION_OPEN", i[i.COMMENT_START = 42] = "COMMENT_START", i[i.COMMENT_START_DASH = 43] = "COMMENT_START_DASH", i[i.COMMENT = 44] = "COMMENT", i[i.COMMENT_LESS_THAN_SIGN = 45] = "COMMENT_LESS_THAN_SIGN", i[i.COMMENT_LESS_THAN_SIGN_BANG = 46] = "COMMENT_LESS_THAN_SIGN_BANG", i[i.COMMENT_LESS_THAN_SIGN_BANG_DASH = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH", i[i.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH", i[i.COMMENT_END_DASH = 49] = "COMMENT_END_DASH", i[i.COMMENT_END = 50] = "COMMENT_END", i[i.COMMENT_END_BANG = 51] = "COMMENT_END_BANG", i[i.DOCTYPE = 52] = "DOCTYPE", i[i.BEFORE_DOCTYPE_NAME = 53] = "BEFORE_DOCTYPE_NAME", i[i.DOCTYPE_NAME = 54] = "DOCTYPE_NAME", i[i.AFTER_DOCTYPE_NAME = 55] = "AFTER_DOCTYPE_NAME", i[i.AFTER_DOCTYPE_PUBLIC_KEYWORD = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD", i[i.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER", i[i.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED", i[i.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED", i[i.AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER", i[i.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS", i[i.AFTER_DOCTYPE_SYSTEM_KEYWORD = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD", i[i.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER", i[i.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED", i[i.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED", i[i.AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER", i[i.BOGUS_DOCTYPE = 67] = "BOGUS_DOCTYPE", i[i.CDATA_SECTION = 68] = "CDATA_SECTION", i[i.CDATA_SECTION_BRACKET = 69] = "CDATA_SECTION_BRACKET", i[i.CDATA_SECTION_END = 70] = "CDATA_SECTION_END", i[i.CHARACTER_REFERENCE = 71] = "CHARACTER_REFERENCE", i[i.AMBIGUOUS_AMPERSAND = 72] = "AMBIGUOUS_AMPERSAND";
})(ye || (ye = {}));
const qa = {
  DATA: ye.DATA,
  RCDATA: ye.RCDATA,
  RAWTEXT: ye.RAWTEXT,
  SCRIPT_DATA: ye.SCRIPT_DATA,
  PLAINTEXT: ye.PLAINTEXT,
  CDATA_SECTION: ye.CDATA_SECTION
};
function XBt(i) {
  return i >= _e.DIGIT_0 && i <= _e.DIGIT_9;
}
function lF(i) {
  return i >= _e.LATIN_CAPITAL_A && i <= _e.LATIN_CAPITAL_Z;
}
function ZBt(i) {
  return i >= _e.LATIN_SMALL_A && i <= _e.LATIN_SMALL_Z;
}
function PC(i) {
  return ZBt(i) || lF(i);
}
function vAe(i) {
  return PC(i) || XBt(i);
}
function JH(i) {
  return i + 32;
}
function rHe(i) {
  return i === _e.SPACE || i === _e.LINE_FEED || i === _e.TABULATION || i === _e.FORM_FEED;
}
function yAe(i) {
  return rHe(i) || i === _e.SOLIDUS || i === _e.GREATER_THAN_SIGN;
}
function QBt(i) {
  return i === _e.NULL ? ht.nullCharacterReference : i > 1114111 ? ht.characterReferenceOutsideUnicodeRange : eHe(i) ? ht.surrogateCharacterReference : nHe(i) ? ht.noncharacterCharacterReference : tHe(i) || i === _e.CARRIAGE_RETURN ? ht.controlCharacterReference : null;
}
class JBt {
  constructor(e, t) {
    this.options = e, this.handler = t, this.paused = !1, this.inLoop = !1, this.inForeignNode = !1, this.lastStartTagName = "", this.active = !1, this.state = ye.DATA, this.returnState = ye.DATA, this.entityStartPos = 0, this.consumedAfterSnapshot = -1, this.currentCharacterToken = null, this.currentToken = null, this.currentAttr = { name: "", value: "" }, this.preprocessor = new BBt(t), this.currentLocation = this.getCurrentLocation(-1), this.entityDecoder = new GBt(HBt, (n, r) => {
      this.preprocessor.pos = this.entityStartPos + r - 1, this._flushCodePointConsumedAsCharacterReference(n);
    }, t.onParseError ? {
      missingSemicolonAfterCharacterReference: () => {
        this._err(ht.missingSemicolonAfterCharacterReference, 1);
      },
      absenceOfDigitsInNumericCharacterReference: (n) => {
        this._err(ht.absenceOfDigitsInNumericCharacterReference, this.entityStartPos - this.preprocessor.pos + n);
      },
      validateNumericCharacterReference: (n) => {
        const r = QBt(n);
        r && this._err(r, 1);
      }
    } : void 0);
  }
  //Errors
  _err(e, t = 0) {
    var n, r;
    (r = (n = this.handler).onParseError) === null || r === void 0 || r.call(n, this.preprocessor.getError(e, t));
  }
  // NOTE: `offset` may never run across line boundaries.
  getCurrentLocation(e) {
    return this.options.sourceCodeLocationInfo ? {
      startLine: this.preprocessor.line,
      startCol: this.preprocessor.col - e,
      startOffset: this.preprocessor.offset - e,
      endLine: -1,
      endCol: -1,
      endOffset: -1
    } : null;
  }
  _runParsingLoop() {
    if (!this.inLoop) {
      for (this.inLoop = !0; this.active && !this.paused; ) {
        this.consumedAfterSnapshot = 0;
        const e = this._consume();
        this._ensureHibernation() || this._callState(e);
      }
      this.inLoop = !1;
    }
  }
  //API
  pause() {
    this.paused = !0;
  }
  resume(e) {
    if (!this.paused)
      throw new Error("Parser was already resumed");
    this.paused = !1, !this.inLoop && (this._runParsingLoop(), this.paused || e == null || e());
  }
  write(e, t, n) {
    this.active = !0, this.preprocessor.write(e, t), this._runParsingLoop(), this.paused || n == null || n();
  }
  insertHtmlAtCurrentPos(e) {
    this.active = !0, this.preprocessor.insertHtmlAtCurrentPos(e), this._runParsingLoop();
  }
  //Hibernation
  _ensureHibernation() {
    return this.preprocessor.endOfChunkHit ? (this.preprocessor.retreat(this.consumedAfterSnapshot), this.consumedAfterSnapshot = 0, this.active = !1, !0) : !1;
  }
  //Consumption
  _consume() {
    return this.consumedAfterSnapshot++, this.preprocessor.advance();
  }
  _advanceBy(e) {
    this.consumedAfterSnapshot += e;
    for (let t = 0; t < e; t++)
      this.preprocessor.advance();
  }
  _consumeSequenceIfMatch(e, t) {
    return this.preprocessor.startsWith(e, t) ? (this._advanceBy(e.length - 1), !0) : !1;
  }
  //Token creation
  _createStartTagToken() {
    this.currentToken = {
      type: Dr.START_TAG,
      tagName: "",
      tagID: P.UNKNOWN,
      selfClosing: !1,
      ackSelfClosing: !1,
      attrs: [],
      location: this.getCurrentLocation(1)
    };
  }
  _createEndTagToken() {
    this.currentToken = {
      type: Dr.END_TAG,
      tagName: "",
      tagID: P.UNKNOWN,
      selfClosing: !1,
      ackSelfClosing: !1,
      attrs: [],
      location: this.getCurrentLocation(2)
    };
  }
  _createCommentToken(e) {
    this.currentToken = {
      type: Dr.COMMENT,
      data: "",
      location: this.getCurrentLocation(e)
    };
  }
  _createDoctypeToken(e) {
    this.currentToken = {
      type: Dr.DOCTYPE,
      name: e,
      forceQuirks: !1,
      publicId: null,
      systemId: null,
      location: this.currentLocation
    };
  }
  _createCharacterToken(e, t) {
    this.currentCharacterToken = {
      type: e,
      chars: t,
      location: this.currentLocation
    };
  }
  //Tag attributes
  _createAttr(e) {
    this.currentAttr = {
      name: e,
      value: ""
    }, this.currentLocation = this.getCurrentLocation(0);
  }
  _leaveAttrName() {
    var e, t;
    const n = this.currentToken;
    if (iHe(n, this.currentAttr.name) === null) {
      if (n.attrs.push(this.currentAttr), n.location && this.currentLocation) {
        const r = (e = (t = n.location).attrs) !== null && e !== void 0 ? e : t.attrs = /* @__PURE__ */ Object.create(null);
        r[this.currentAttr.name] = this.currentLocation, this._leaveAttrValue();
      }
    } else
      this._err(ht.duplicateAttribute);
  }
  _leaveAttrValue() {
    this.currentLocation && (this.currentLocation.endLine = this.preprocessor.line, this.currentLocation.endCol = this.preprocessor.col, this.currentLocation.endOffset = this.preprocessor.offset);
  }
  //Token emission
  prepareToken(e) {
    this._emitCurrentCharacterToken(e.location), this.currentToken = null, e.location && (e.location.endLine = this.preprocessor.line, e.location.endCol = this.preprocessor.col + 1, e.location.endOffset = this.preprocessor.offset + 1), this.currentLocation = this.getCurrentLocation(-1);
  }
  emitCurrentTagToken() {
    const e = this.currentToken;
    this.prepareToken(e), e.tagID = E2(e.tagName), e.type === Dr.START_TAG ? (this.lastStartTagName = e.tagName, this.handler.onStartTag(e)) : (e.attrs.length > 0 && this._err(ht.endTagWithAttributes), e.selfClosing && this._err(ht.endTagWithTrailingSolidus), this.handler.onEndTag(e)), this.preprocessor.dropParsedChunk();
  }
  emitCurrentComment(e) {
    this.prepareToken(e), this.handler.onComment(e), this.preprocessor.dropParsedChunk();
  }
  emitCurrentDoctype(e) {
    this.prepareToken(e), this.handler.onDoctype(e), this.preprocessor.dropParsedChunk();
  }
  _emitCurrentCharacterToken(e) {
    if (this.currentCharacterToken) {
      switch (e && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = e.startLine, this.currentCharacterToken.location.endCol = e.startCol, this.currentCharacterToken.location.endOffset = e.startOffset), this.currentCharacterToken.type) {
        case Dr.CHARACTER: {
          this.handler.onCharacter(this.currentCharacterToken);
          break;
        }
        case Dr.NULL_CHARACTER: {
          this.handler.onNullCharacter(this.currentCharacterToken);
          break;
        }
        case Dr.WHITESPACE_CHARACTER: {
          this.handler.onWhitespaceCharacter(this.currentCharacterToken);
          break;
        }
      }
      this.currentCharacterToken = null;
    }
  }
  _emitEOFToken() {
    const e = this.getCurrentLocation(0);
    e && (e.endLine = e.startLine, e.endCol = e.startCol, e.endOffset = e.startOffset), this._emitCurrentCharacterToken(e), this.handler.onEof({ type: Dr.EOF, location: e }), this.active = !1;
  }
  //Characters emission
  //OPTIMIZATION: The specification uses only one type of character token (one token per character).
  //This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters.
  //If we have a sequence of characters that belong to the same group, the parser can process it
  //as a single solid character token.
  //So, there are 3 types of character tokens in parse5:
  //1)TokenType.NULL_CHARACTER - \u0000-character sequences (e.g. '\u0000\u0000\u0000')
  //2)TokenType.WHITESPACE_CHARACTER - any whitespace/new-line character sequences (e.g. '\n  \r\t   \f')
  //3)TokenType.CHARACTER - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^')
  _appendCharToCurrentCharacterToken(e, t) {
    if (this.currentCharacterToken)
      if (this.currentCharacterToken.type === e) {
        this.currentCharacterToken.chars += t;
        return;
      } else
        this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk();
    this._createCharacterToken(e, t);
  }
  _emitCodePoint(e) {
    const t = rHe(e) ? Dr.WHITESPACE_CHARACTER : e === _e.NULL ? Dr.NULL_CHARACTER : Dr.CHARACTER;
    this._appendCharToCurrentCharacterToken(t, String.fromCodePoint(e));
  }
  //NOTE: used when we emit characters explicitly.
  //This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.
  _emitChars(e) {
    this._appendCharToCurrentCharacterToken(Dr.CHARACTER, e);
  }
  // Character reference helpers
  _startCharacterReference() {
    this.returnState = this.state, this.state = ye.CHARACTER_REFERENCE, this.entityStartPos = this.preprocessor.pos, this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute() ? gy.Attribute : gy.Legacy);
  }
  _isCharacterReferenceInAttribute() {
    return this.returnState === ye.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === ye.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === ye.ATTRIBUTE_VALUE_UNQUOTED;
  }
  _flushCodePointConsumedAsCharacterReference(e) {
    this._isCharacterReferenceInAttribute() ? this.currentAttr.value += String.fromCodePoint(e) : this._emitCodePoint(e);
  }
  // Calling states this way turns out to be much faster than any other approach.
  _callState(e) {
    switch (this.state) {
      case ye.DATA: {
        this._stateData(e);
        break;
      }
      case ye.RCDATA: {
        this._stateRcdata(e);
        break;
      }
      case ye.RAWTEXT: {
        this._stateRawtext(e);
        break;
      }
      case ye.SCRIPT_DATA: {
        this._stateScriptData(e);
        break;
      }
      case ye.PLAINTEXT: {
        this._statePlaintext(e);
        break;
      }
      case ye.TAG_OPEN: {
        this._stateTagOpen(e);
        break;
      }
      case ye.END_TAG_OPEN: {
        this._stateEndTagOpen(e);
        break;
      }
      case ye.TAG_NAME: {
        this._stateTagName(e);
        break;
      }
      case ye.RCDATA_LESS_THAN_SIGN: {
        this._stateRcdataLessThanSign(e);
        break;
      }
      case ye.RCDATA_END_TAG_OPEN: {
        this._stateRcdataEndTagOpen(e);
        break;
      }
      case ye.RCDATA_END_TAG_NAME: {
        this._stateRcdataEndTagName(e);
        break;
      }
      case ye.RAWTEXT_LESS_THAN_SIGN: {
        this._stateRawtextLessThanSign(e);
        break;
      }
      case ye.RAWTEXT_END_TAG_OPEN: {
        this._stateRawtextEndTagOpen(e);
        break;
      }
      case ye.RAWTEXT_END_TAG_NAME: {
        this._stateRawtextEndTagName(e);
        break;
      }
      case ye.SCRIPT_DATA_LESS_THAN_SIGN: {
        this._stateScriptDataLessThanSign(e);
        break;
      }
      case ye.SCRIPT_DATA_END_TAG_OPEN: {
        this._stateScriptDataEndTagOpen(e);
        break;
      }
      case ye.SCRIPT_DATA_END_TAG_NAME: {
        this._stateScriptDataEndTagName(e);
        break;
      }
      case ye.SCRIPT_DATA_ESCAPE_START: {
        this._stateScriptDataEscapeStart(e);
        break;
      }
      case ye.SCRIPT_DATA_ESCAPE_START_DASH: {
        this._stateScriptDataEscapeStartDash(e);
        break;
      }
      case ye.SCRIPT_DATA_ESCAPED: {
        this._stateScriptDataEscaped(e);
        break;
      }
      case ye.SCRIPT_DATA_ESCAPED_DASH: {
        this._stateScriptDataEscapedDash(e);
        break;
      }
      case ye.SCRIPT_DATA_ESCAPED_DASH_DASH: {
        this._stateScriptDataEscapedDashDash(e);
        break;
      }
      case ye.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {
        this._stateScriptDataEscapedLessThanSign(e);
        break;
      }
      case ye.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: {
        this._stateScriptDataEscapedEndTagOpen(e);
        break;
      }
      case ye.SCRIPT_DATA_ESCAPED_END_TAG_NAME: {
        this._stateScriptDataEscapedEndTagName(e);
        break;
      }
      case ye.SCRIPT_DATA_DOUBLE_ESCAPE_START: {
        this._stateScriptDataDoubleEscapeStart(e);
        break;
      }
      case ye.SCRIPT_DATA_DOUBLE_ESCAPED: {
        this._stateScriptDataDoubleEscaped(e);
        break;
      }
      case ye.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {
        this._stateScriptDataDoubleEscapedDash(e);
        break;
      }
      case ye.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {
        this._stateScriptDataDoubleEscapedDashDash(e);
        break;
      }
      case ye.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {
        this._stateScriptDataDoubleEscapedLessThanSign(e);
        break;
      }
      case ye.SCRIPT_DATA_DOUBLE_ESCAPE_END: {
        this._stateScriptDataDoubleEscapeEnd(e);
        break;
      }
      case ye.BEFORE_ATTRIBUTE_NAME: {
        this._stateBeforeAttributeName(e);
        break;
      }
      case ye.ATTRIBUTE_NAME: {
        this._stateAttributeName(e);
        break;
      }
      case ye.AFTER_ATTRIBUTE_NAME: {
        this._stateAfterAttributeName(e);
        break;
      }
      case ye.BEFORE_ATTRIBUTE_VALUE: {
        this._stateBeforeAttributeValue(e);
        break;
      }
      case ye.ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
        this._stateAttributeValueDoubleQuoted(e);
        break;
      }
      case ye.ATTRIBUTE_VALUE_SINGLE_QUOTED: {
        this._stateAttributeValueSingleQuoted(e);
        break;
      }
      case ye.ATTRIBUTE_VALUE_UNQUOTED: {
        this._stateAttributeValueUnquoted(e);
        break;
      }
      case ye.AFTER_ATTRIBUTE_VALUE_QUOTED: {
        this._stateAfterAttributeValueQuoted(e);
        break;
      }
      case ye.SELF_CLOSING_START_TAG: {
        this._stateSelfClosingStartTag(e);
        break;
      }
      case ye.BOGUS_COMMENT: {
        this._stateBogusComment(e);
        break;
      }
      case ye.MARKUP_DECLARATION_OPEN: {
        this._stateMarkupDeclarationOpen(e);
        break;
      }
      case ye.COMMENT_START: {
        this._stateCommentStart(e);
        break;
      }
      case ye.COMMENT_START_DASH: {
        this._stateCommentStartDash(e);
        break;
      }
      case ye.COMMENT: {
        this._stateComment(e);
        break;
      }
      case ye.COMMENT_LESS_THAN_SIGN: {
        this._stateCommentLessThanSign(e);
        break;
      }
      case ye.COMMENT_LESS_THAN_SIGN_BANG: {
        this._stateCommentLessThanSignBang(e);
        break;
      }
      case ye.COMMENT_LESS_THAN_SIGN_BANG_DASH: {
        this._stateCommentLessThanSignBangDash(e);
        break;
      }
      case ye.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: {
        this._stateCommentLessThanSignBangDashDash(e);
        break;
      }
      case ye.COMMENT_END_DASH: {
        this._stateCommentEndDash(e);
        break;
      }
      case ye.COMMENT_END: {
        this._stateCommentEnd(e);
        break;
      }
      case ye.COMMENT_END_BANG: {
        this._stateCommentEndBang(e);
        break;
      }
      case ye.DOCTYPE: {
        this._stateDoctype(e);
        break;
      }
      case ye.BEFORE_DOCTYPE_NAME: {
        this._stateBeforeDoctypeName(e);
        break;
      }
      case ye.DOCTYPE_NAME: {
        this._stateDoctypeName(e);
        break;
      }
      case ye.AFTER_DOCTYPE_NAME: {
        this._stateAfterDoctypeName(e);
        break;
      }
      case ye.AFTER_DOCTYPE_PUBLIC_KEYWORD: {
        this._stateAfterDoctypePublicKeyword(e);
        break;
      }
      case ye.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {
        this._stateBeforeDoctypePublicIdentifier(e);
        break;
      }
      case ye.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {
        this._stateDoctypePublicIdentifierDoubleQuoted(e);
        break;
      }
      case ye.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: {
        this._stateDoctypePublicIdentifierSingleQuoted(e);
        break;
      }
      case ye.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {
        this._stateAfterDoctypePublicIdentifier(e);
        break;
      }
      case ye.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {
        this._stateBetweenDoctypePublicAndSystemIdentifiers(e);
        break;
      }
      case ye.AFTER_DOCTYPE_SYSTEM_KEYWORD: {
        this._stateAfterDoctypeSystemKeyword(e);
        break;
      }
      case ye.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {
        this._stateBeforeDoctypeSystemIdentifier(e);
        break;
      }
      case ye.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {
        this._stateDoctypeSystemIdentifierDoubleQuoted(e);
        break;
      }
      case ye.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {
        this._stateDoctypeSystemIdentifierSingleQuoted(e);
        break;
      }
      case ye.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: {
        this._stateAfterDoctypeSystemIdentifier(e);
        break;
      }
      case ye.BOGUS_DOCTYPE: {
        this._stateBogusDoctype(e);
        break;
      }
      case ye.CDATA_SECTION: {
        this._stateCdataSection(e);
        break;
      }
      case ye.CDATA_SECTION_BRACKET: {
        this._stateCdataSectionBracket(e);
        break;
      }
      case ye.CDATA_SECTION_END: {
        this._stateCdataSectionEnd(e);
        break;
      }
      case ye.CHARACTER_REFERENCE: {
        this._stateCharacterReference();
        break;
      }
      case ye.AMBIGUOUS_AMPERSAND: {
        this._stateAmbiguousAmpersand(e);
        break;
      }
      default:
        throw new Error("Unknown state");
    }
  }
  // State machine
  // Data state
  //------------------------------------------------------------------
  _stateData(e) {
    switch (e) {
      case _e.LESS_THAN_SIGN: {
        this.state = ye.TAG_OPEN;
        break;
      }
      case _e.AMPERSAND: {
        this._startCharacterReference();
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this._emitCodePoint(e);
        break;
      }
      case _e.EOF: {
        this._emitEOFToken();
        break;
      }
      default:
        this._emitCodePoint(e);
    }
  }
  //  RCDATA state
  //------------------------------------------------------------------
  _stateRcdata(e) {
    switch (e) {
      case _e.AMPERSAND: {
        this._startCharacterReference();
        break;
      }
      case _e.LESS_THAN_SIGN: {
        this.state = ye.RCDATA_LESS_THAN_SIGN;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._emitEOFToken();
        break;
      }
      default:
        this._emitCodePoint(e);
    }
  }
  // RAWTEXT state
  //------------------------------------------------------------------
  _stateRawtext(e) {
    switch (e) {
      case _e.LESS_THAN_SIGN: {
        this.state = ye.RAWTEXT_LESS_THAN_SIGN;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._emitEOFToken();
        break;
      }
      default:
        this._emitCodePoint(e);
    }
  }
  // Script data state
  //------------------------------------------------------------------
  _stateScriptData(e) {
    switch (e) {
      case _e.LESS_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA_LESS_THAN_SIGN;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._emitEOFToken();
        break;
      }
      default:
        this._emitCodePoint(e);
    }
  }
  // PLAINTEXT state
  //------------------------------------------------------------------
  _statePlaintext(e) {
    switch (e) {
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._emitEOFToken();
        break;
      }
      default:
        this._emitCodePoint(e);
    }
  }
  // Tag open state
  //------------------------------------------------------------------
  _stateTagOpen(e) {
    if (PC(e))
      this._createStartTagToken(), this.state = ye.TAG_NAME, this._stateTagName(e);
    else
      switch (e) {
        case _e.EXCLAMATION_MARK: {
          this.state = ye.MARKUP_DECLARATION_OPEN;
          break;
        }
        case _e.SOLIDUS: {
          this.state = ye.END_TAG_OPEN;
          break;
        }
        case _e.QUESTION_MARK: {
          this._err(ht.unexpectedQuestionMarkInsteadOfTagName), this._createCommentToken(1), this.state = ye.BOGUS_COMMENT, this._stateBogusComment(e);
          break;
        }
        case _e.EOF: {
          this._err(ht.eofBeforeTagName), this._emitChars("<"), this._emitEOFToken();
          break;
        }
        default:
          this._err(ht.invalidFirstCharacterOfTagName), this._emitChars("<"), this.state = ye.DATA, this._stateData(e);
      }
  }
  // End tag open state
  //------------------------------------------------------------------
  _stateEndTagOpen(e) {
    if (PC(e))
      this._createEndTagToken(), this.state = ye.TAG_NAME, this._stateTagName(e);
    else
      switch (e) {
        case _e.GREATER_THAN_SIGN: {
          this._err(ht.missingEndTagName), this.state = ye.DATA;
          break;
        }
        case _e.EOF: {
          this._err(ht.eofBeforeTagName), this._emitChars("</"), this._emitEOFToken();
          break;
        }
        default:
          this._err(ht.invalidFirstCharacterOfTagName), this._createCommentToken(2), this.state = ye.BOGUS_COMMENT, this._stateBogusComment(e);
      }
  }
  // Tag name state
  //------------------------------------------------------------------
  _stateTagName(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED: {
        this.state = ye.BEFORE_ATTRIBUTE_NAME;
        break;
      }
      case _e.SOLIDUS: {
        this.state = ye.SELF_CLOSING_START_TAG;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.DATA, this.emitCurrentTagToken();
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), t.tagName += Xo;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInTag), this._emitEOFToken();
        break;
      }
      default:
        t.tagName += String.fromCodePoint(lF(e) ? JH(e) : e);
    }
  }
  // RCDATA less-than sign state
  //------------------------------------------------------------------
  _stateRcdataLessThanSign(e) {
    e === _e.SOLIDUS ? this.state = ye.RCDATA_END_TAG_OPEN : (this._emitChars("<"), this.state = ye.RCDATA, this._stateRcdata(e));
  }
  // RCDATA end tag open state
  //------------------------------------------------------------------
  _stateRcdataEndTagOpen(e) {
    PC(e) ? (this.state = ye.RCDATA_END_TAG_NAME, this._stateRcdataEndTagName(e)) : (this._emitChars("</"), this.state = ye.RCDATA, this._stateRcdata(e));
  }
  handleSpecialEndTag(e) {
    if (!this.preprocessor.startsWith(this.lastStartTagName, !1))
      return !this._ensureHibernation();
    this._createEndTagToken();
    const t = this.currentToken;
    switch (t.tagName = this.lastStartTagName, this.preprocessor.peek(this.lastStartTagName.length)) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        return this._advanceBy(this.lastStartTagName.length), this.state = ye.BEFORE_ATTRIBUTE_NAME, !1;
      case _e.SOLIDUS:
        return this._advanceBy(this.lastStartTagName.length), this.state = ye.SELF_CLOSING_START_TAG, !1;
      case _e.GREATER_THAN_SIGN:
        return this._advanceBy(this.lastStartTagName.length), this.emitCurrentTagToken(), this.state = ye.DATA, !1;
      default:
        return !this._ensureHibernation();
    }
  }
  // RCDATA end tag name state
  //------------------------------------------------------------------
  _stateRcdataEndTagName(e) {
    this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = ye.RCDATA, this._stateRcdata(e));
  }
  // RAWTEXT less-than sign state
  //------------------------------------------------------------------
  _stateRawtextLessThanSign(e) {
    e === _e.SOLIDUS ? this.state = ye.RAWTEXT_END_TAG_OPEN : (this._emitChars("<"), this.state = ye.RAWTEXT, this._stateRawtext(e));
  }
  // RAWTEXT end tag open state
  //------------------------------------------------------------------
  _stateRawtextEndTagOpen(e) {
    PC(e) ? (this.state = ye.RAWTEXT_END_TAG_NAME, this._stateRawtextEndTagName(e)) : (this._emitChars("</"), this.state = ye.RAWTEXT, this._stateRawtext(e));
  }
  // RAWTEXT end tag name state
  //------------------------------------------------------------------
  _stateRawtextEndTagName(e) {
    this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = ye.RAWTEXT, this._stateRawtext(e));
  }
  // Script data less-than sign state
  //------------------------------------------------------------------
  _stateScriptDataLessThanSign(e) {
    switch (e) {
      case _e.SOLIDUS: {
        this.state = ye.SCRIPT_DATA_END_TAG_OPEN;
        break;
      }
      case _e.EXCLAMATION_MARK: {
        this.state = ye.SCRIPT_DATA_ESCAPE_START, this._emitChars("<!");
        break;
      }
      default:
        this._emitChars("<"), this.state = ye.SCRIPT_DATA, this._stateScriptData(e);
    }
  }
  // Script data end tag open state
  //------------------------------------------------------------------
  _stateScriptDataEndTagOpen(e) {
    PC(e) ? (this.state = ye.SCRIPT_DATA_END_TAG_NAME, this._stateScriptDataEndTagName(e)) : (this._emitChars("</"), this.state = ye.SCRIPT_DATA, this._stateScriptData(e));
  }
  // Script data end tag name state
  //------------------------------------------------------------------
  _stateScriptDataEndTagName(e) {
    this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = ye.SCRIPT_DATA, this._stateScriptData(e));
  }
  // Script data escape start state
  //------------------------------------------------------------------
  _stateScriptDataEscapeStart(e) {
    e === _e.HYPHEN_MINUS ? (this.state = ye.SCRIPT_DATA_ESCAPE_START_DASH, this._emitChars("-")) : (this.state = ye.SCRIPT_DATA, this._stateScriptData(e));
  }
  // Script data escape start dash state
  //------------------------------------------------------------------
  _stateScriptDataEscapeStartDash(e) {
    e === _e.HYPHEN_MINUS ? (this.state = ye.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-")) : (this.state = ye.SCRIPT_DATA, this._stateScriptData(e));
  }
  // Script data escaped state
  //------------------------------------------------------------------
  _stateScriptDataEscaped(e) {
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this.state = ye.SCRIPT_DATA_ESCAPED_DASH, this._emitChars("-");
        break;
      }
      case _e.LESS_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
        break;
      }
      default:
        this._emitCodePoint(e);
    }
  }
  // Script data escaped dash state
  //------------------------------------------------------------------
  _stateScriptDataEscapedDash(e) {
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this.state = ye.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-");
        break;
      }
      case _e.LESS_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this.state = ye.SCRIPT_DATA_ESCAPED, this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
        break;
      }
      default:
        this.state = ye.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e);
    }
  }
  // Script data escaped dash dash state
  //------------------------------------------------------------------
  _stateScriptDataEscapedDashDash(e) {
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this._emitChars("-");
        break;
      }
      case _e.LESS_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA, this._emitChars(">");
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this.state = ye.SCRIPT_DATA_ESCAPED, this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
        break;
      }
      default:
        this.state = ye.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e);
    }
  }
  // Script data escaped less-than sign state
  //------------------------------------------------------------------
  _stateScriptDataEscapedLessThanSign(e) {
    e === _e.SOLIDUS ? this.state = ye.SCRIPT_DATA_ESCAPED_END_TAG_OPEN : PC(e) ? (this._emitChars("<"), this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPE_START, this._stateScriptDataDoubleEscapeStart(e)) : (this._emitChars("<"), this.state = ye.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e));
  }
  // Script data escaped end tag open state
  //------------------------------------------------------------------
  _stateScriptDataEscapedEndTagOpen(e) {
    PC(e) ? (this.state = ye.SCRIPT_DATA_ESCAPED_END_TAG_NAME, this._stateScriptDataEscapedEndTagName(e)) : (this._emitChars("</"), this.state = ye.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e));
  }
  // Script data escaped end tag name state
  //------------------------------------------------------------------
  _stateScriptDataEscapedEndTagName(e) {
    this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = ye.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e));
  }
  // Script data double escape start state
  //------------------------------------------------------------------
  _stateScriptDataDoubleEscapeStart(e) {
    if (this.preprocessor.startsWith(_h.SCRIPT, !1) && yAe(this.preprocessor.peek(_h.SCRIPT.length))) {
      this._emitCodePoint(e);
      for (let t = 0; t < _h.SCRIPT.length; t++)
        this._emitCodePoint(this._consume());
      this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED;
    } else this._ensureHibernation() || (this.state = ye.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e));
  }
  // Script data double escaped state
  //------------------------------------------------------------------
  _stateScriptDataDoubleEscaped(e) {
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED_DASH, this._emitChars("-");
        break;
      }
      case _e.LESS_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
        break;
      }
      default:
        this._emitCodePoint(e);
    }
  }
  // Script data double escaped dash state
  //------------------------------------------------------------------
  _stateScriptDataDoubleEscapedDash(e) {
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH, this._emitChars("-");
        break;
      }
      case _e.LESS_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
        break;
      }
      default:
        this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e);
    }
  }
  // Script data double escaped dash dash state
  //------------------------------------------------------------------
  _stateScriptDataDoubleEscapedDashDash(e) {
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this._emitChars("-");
        break;
      }
      case _e.LESS_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.SCRIPT_DATA, this._emitChars(">");
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(Xo);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
        break;
      }
      default:
        this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e);
    }
  }
  // Script data double escaped less-than sign state
  //------------------------------------------------------------------
  _stateScriptDataDoubleEscapedLessThanSign(e) {
    e === _e.SOLIDUS ? (this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPE_END, this._emitChars("/")) : (this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e));
  }
  // Script data double escape end state
  //------------------------------------------------------------------
  _stateScriptDataDoubleEscapeEnd(e) {
    if (this.preprocessor.startsWith(_h.SCRIPT, !1) && yAe(this.preprocessor.peek(_h.SCRIPT.length))) {
      this._emitCodePoint(e);
      for (let t = 0; t < _h.SCRIPT.length; t++)
        this._emitCodePoint(this._consume());
      this.state = ye.SCRIPT_DATA_ESCAPED;
    } else this._ensureHibernation() || (this.state = ye.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e));
  }
  // Before attribute name state
  //------------------------------------------------------------------
  _stateBeforeAttributeName(e) {
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        break;
      case _e.SOLIDUS:
      case _e.GREATER_THAN_SIGN:
      case _e.EOF: {
        this.state = ye.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e);
        break;
      }
      case _e.EQUALS_SIGN: {
        this._err(ht.unexpectedEqualsSignBeforeAttributeName), this._createAttr("="), this.state = ye.ATTRIBUTE_NAME;
        break;
      }
      default:
        this._createAttr(""), this.state = ye.ATTRIBUTE_NAME, this._stateAttributeName(e);
    }
  }
  // Attribute name state
  //------------------------------------------------------------------
  _stateAttributeName(e) {
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
      case _e.SOLIDUS:
      case _e.GREATER_THAN_SIGN:
      case _e.EOF: {
        this._leaveAttrName(), this.state = ye.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e);
        break;
      }
      case _e.EQUALS_SIGN: {
        this._leaveAttrName(), this.state = ye.BEFORE_ATTRIBUTE_VALUE;
        break;
      }
      case _e.QUOTATION_MARK:
      case _e.APOSTROPHE:
      case _e.LESS_THAN_SIGN: {
        this._err(ht.unexpectedCharacterInAttributeName), this.currentAttr.name += String.fromCodePoint(e);
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this.currentAttr.name += Xo;
        break;
      }
      default:
        this.currentAttr.name += String.fromCodePoint(lF(e) ? JH(e) : e);
    }
  }
  // After attribute name state
  //------------------------------------------------------------------
  _stateAfterAttributeName(e) {
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        break;
      case _e.SOLIDUS: {
        this.state = ye.SELF_CLOSING_START_TAG;
        break;
      }
      case _e.EQUALS_SIGN: {
        this.state = ye.BEFORE_ATTRIBUTE_VALUE;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.DATA, this.emitCurrentTagToken();
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInTag), this._emitEOFToken();
        break;
      }
      default:
        this._createAttr(""), this.state = ye.ATTRIBUTE_NAME, this._stateAttributeName(e);
    }
  }
  // Before attribute value state
  //------------------------------------------------------------------
  _stateBeforeAttributeValue(e) {
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        break;
      case _e.QUOTATION_MARK: {
        this.state = ye.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
        break;
      }
      case _e.APOSTROPHE: {
        this.state = ye.ATTRIBUTE_VALUE_SINGLE_QUOTED;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.missingAttributeValue), this.state = ye.DATA, this.emitCurrentTagToken();
        break;
      }
      default:
        this.state = ye.ATTRIBUTE_VALUE_UNQUOTED, this._stateAttributeValueUnquoted(e);
    }
  }
  // Attribute value (double-quoted) state
  //------------------------------------------------------------------
  _stateAttributeValueDoubleQuoted(e) {
    switch (e) {
      case _e.QUOTATION_MARK: {
        this.state = ye.AFTER_ATTRIBUTE_VALUE_QUOTED;
        break;
      }
      case _e.AMPERSAND: {
        this._startCharacterReference();
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this.currentAttr.value += Xo;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInTag), this._emitEOFToken();
        break;
      }
      default:
        this.currentAttr.value += String.fromCodePoint(e);
    }
  }
  // Attribute value (single-quoted) state
  //------------------------------------------------------------------
  _stateAttributeValueSingleQuoted(e) {
    switch (e) {
      case _e.APOSTROPHE: {
        this.state = ye.AFTER_ATTRIBUTE_VALUE_QUOTED;
        break;
      }
      case _e.AMPERSAND: {
        this._startCharacterReference();
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this.currentAttr.value += Xo;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInTag), this._emitEOFToken();
        break;
      }
      default:
        this.currentAttr.value += String.fromCodePoint(e);
    }
  }
  // Attribute value (unquoted) state
  //------------------------------------------------------------------
  _stateAttributeValueUnquoted(e) {
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED: {
        this._leaveAttrValue(), this.state = ye.BEFORE_ATTRIBUTE_NAME;
        break;
      }
      case _e.AMPERSAND: {
        this._startCharacterReference();
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._leaveAttrValue(), this.state = ye.DATA, this.emitCurrentTagToken();
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), this.currentAttr.value += Xo;
        break;
      }
      case _e.QUOTATION_MARK:
      case _e.APOSTROPHE:
      case _e.LESS_THAN_SIGN:
      case _e.EQUALS_SIGN:
      case _e.GRAVE_ACCENT: {
        this._err(ht.unexpectedCharacterInUnquotedAttributeValue), this.currentAttr.value += String.fromCodePoint(e);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInTag), this._emitEOFToken();
        break;
      }
      default:
        this.currentAttr.value += String.fromCodePoint(e);
    }
  }
  // After attribute value (quoted) state
  //------------------------------------------------------------------
  _stateAfterAttributeValueQuoted(e) {
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED: {
        this._leaveAttrValue(), this.state = ye.BEFORE_ATTRIBUTE_NAME;
        break;
      }
      case _e.SOLIDUS: {
        this._leaveAttrValue(), this.state = ye.SELF_CLOSING_START_TAG;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._leaveAttrValue(), this.state = ye.DATA, this.emitCurrentTagToken();
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInTag), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.missingWhitespaceBetweenAttributes), this.state = ye.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e);
    }
  }
  // Self-closing start tag state
  //------------------------------------------------------------------
  _stateSelfClosingStartTag(e) {
    switch (e) {
      case _e.GREATER_THAN_SIGN: {
        const t = this.currentToken;
        t.selfClosing = !0, this.state = ye.DATA, this.emitCurrentTagToken();
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInTag), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.unexpectedSolidusInTag), this.state = ye.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e);
    }
  }
  // Bogus comment state
  //------------------------------------------------------------------
  _stateBogusComment(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.DATA, this.emitCurrentComment(t);
        break;
      }
      case _e.EOF: {
        this.emitCurrentComment(t), this._emitEOFToken();
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), t.data += Xo;
        break;
      }
      default:
        t.data += String.fromCodePoint(e);
    }
  }
  // Markup declaration open state
  //------------------------------------------------------------------
  _stateMarkupDeclarationOpen(e) {
    this._consumeSequenceIfMatch(_h.DASH_DASH, !0) ? (this._createCommentToken(_h.DASH_DASH.length + 1), this.state = ye.COMMENT_START) : this._consumeSequenceIfMatch(_h.DOCTYPE, !1) ? (this.currentLocation = this.getCurrentLocation(_h.DOCTYPE.length + 1), this.state = ye.DOCTYPE) : this._consumeSequenceIfMatch(_h.CDATA_START, !0) ? this.inForeignNode ? this.state = ye.CDATA_SECTION : (this._err(ht.cdataInHtmlContent), this._createCommentToken(_h.CDATA_START.length + 1), this.currentToken.data = "[CDATA[", this.state = ye.BOGUS_COMMENT) : this._ensureHibernation() || (this._err(ht.incorrectlyOpenedComment), this._createCommentToken(2), this.state = ye.BOGUS_COMMENT, this._stateBogusComment(e));
  }
  // Comment start state
  //------------------------------------------------------------------
  _stateCommentStart(e) {
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this.state = ye.COMMENT_START_DASH;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.abruptClosingOfEmptyComment), this.state = ye.DATA;
        const t = this.currentToken;
        this.emitCurrentComment(t);
        break;
      }
      default:
        this.state = ye.COMMENT, this._stateComment(e);
    }
  }
  // Comment start dash state
  //------------------------------------------------------------------
  _stateCommentStartDash(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this.state = ye.COMMENT_END;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.abruptClosingOfEmptyComment), this.state = ye.DATA, this.emitCurrentComment(t);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
        break;
      }
      default:
        t.data += "-", this.state = ye.COMMENT, this._stateComment(e);
    }
  }
  // Comment state
  //------------------------------------------------------------------
  _stateComment(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this.state = ye.COMMENT_END_DASH;
        break;
      }
      case _e.LESS_THAN_SIGN: {
        t.data += "<", this.state = ye.COMMENT_LESS_THAN_SIGN;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), t.data += Xo;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
        break;
      }
      default:
        t.data += String.fromCodePoint(e);
    }
  }
  // Comment less-than sign state
  //------------------------------------------------------------------
  _stateCommentLessThanSign(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.EXCLAMATION_MARK: {
        t.data += "!", this.state = ye.COMMENT_LESS_THAN_SIGN_BANG;
        break;
      }
      case _e.LESS_THAN_SIGN: {
        t.data += "<";
        break;
      }
      default:
        this.state = ye.COMMENT, this._stateComment(e);
    }
  }
  // Comment less-than sign bang state
  //------------------------------------------------------------------
  _stateCommentLessThanSignBang(e) {
    e === _e.HYPHEN_MINUS ? this.state = ye.COMMENT_LESS_THAN_SIGN_BANG_DASH : (this.state = ye.COMMENT, this._stateComment(e));
  }
  // Comment less-than sign bang dash state
  //------------------------------------------------------------------
  _stateCommentLessThanSignBangDash(e) {
    e === _e.HYPHEN_MINUS ? this.state = ye.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH : (this.state = ye.COMMENT_END_DASH, this._stateCommentEndDash(e));
  }
  // Comment less-than sign bang dash dash state
  //------------------------------------------------------------------
  _stateCommentLessThanSignBangDashDash(e) {
    e !== _e.GREATER_THAN_SIGN && e !== _e.EOF && this._err(ht.nestedComment), this.state = ye.COMMENT_END, this._stateCommentEnd(e);
  }
  // Comment end dash state
  //------------------------------------------------------------------
  _stateCommentEndDash(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.HYPHEN_MINUS: {
        this.state = ye.COMMENT_END;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
        break;
      }
      default:
        t.data += "-", this.state = ye.COMMENT, this._stateComment(e);
    }
  }
  // Comment end state
  //------------------------------------------------------------------
  _stateCommentEnd(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.DATA, this.emitCurrentComment(t);
        break;
      }
      case _e.EXCLAMATION_MARK: {
        this.state = ye.COMMENT_END_BANG;
        break;
      }
      case _e.HYPHEN_MINUS: {
        t.data += "-";
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
        break;
      }
      default:
        t.data += "--", this.state = ye.COMMENT, this._stateComment(e);
    }
  }
  // Comment end bang state
  //------------------------------------------------------------------
  _stateCommentEndBang(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.HYPHEN_MINUS: {
        t.data += "--!", this.state = ye.COMMENT_END_DASH;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.incorrectlyClosedComment), this.state = ye.DATA, this.emitCurrentComment(t);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
        break;
      }
      default:
        t.data += "--!", this.state = ye.COMMENT, this._stateComment(e);
    }
  }
  // DOCTYPE state
  //------------------------------------------------------------------
  _stateDoctype(e) {
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED: {
        this.state = ye.BEFORE_DOCTYPE_NAME;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), this._createDoctypeToken(null);
        const t = this.currentToken;
        t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.missingWhitespaceBeforeDoctypeName), this.state = ye.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e);
    }
  }
  // Before DOCTYPE name state
  //------------------------------------------------------------------
  _stateBeforeDoctypeName(e) {
    if (lF(e))
      this._createDoctypeToken(String.fromCharCode(JH(e))), this.state = ye.DOCTYPE_NAME;
    else
      switch (e) {
        case _e.SPACE:
        case _e.LINE_FEED:
        case _e.TABULATION:
        case _e.FORM_FEED:
          break;
        case _e.NULL: {
          this._err(ht.unexpectedNullCharacter), this._createDoctypeToken(Xo), this.state = ye.DOCTYPE_NAME;
          break;
        }
        case _e.GREATER_THAN_SIGN: {
          this._err(ht.missingDoctypeName), this._createDoctypeToken(null);
          const t = this.currentToken;
          t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = ye.DATA;
          break;
        }
        case _e.EOF: {
          this._err(ht.eofInDoctype), this._createDoctypeToken(null);
          const t = this.currentToken;
          t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
          break;
        }
        default:
          this._createDoctypeToken(String.fromCodePoint(e)), this.state = ye.DOCTYPE_NAME;
      }
  }
  // DOCTYPE name state
  //------------------------------------------------------------------
  _stateDoctypeName(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED: {
        this.state = ye.AFTER_DOCTYPE_NAME;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.DATA, this.emitCurrentDoctype(t);
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), t.name += Xo;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        t.name += String.fromCodePoint(lF(e) ? JH(e) : e);
    }
  }
  // After DOCTYPE name state
  //------------------------------------------------------------------
  _stateAfterDoctypeName(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        break;
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.DATA, this.emitCurrentDoctype(t);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._consumeSequenceIfMatch(_h.PUBLIC, !1) ? this.state = ye.AFTER_DOCTYPE_PUBLIC_KEYWORD : this._consumeSequenceIfMatch(_h.SYSTEM, !1) ? this.state = ye.AFTER_DOCTYPE_SYSTEM_KEYWORD : this._ensureHibernation() || (this._err(ht.invalidCharacterSequenceAfterDoctypeName), t.forceQuirks = !0, this.state = ye.BOGUS_DOCTYPE, this._stateBogusDoctype(e));
    }
  }
  // After DOCTYPE public keyword state
  //------------------------------------------------------------------
  _stateAfterDoctypePublicKeyword(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED: {
        this.state = ye.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
        break;
      }
      case _e.QUOTATION_MARK: {
        this._err(ht.missingWhitespaceAfterDoctypePublicKeyword), t.publicId = "", this.state = ye.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
        break;
      }
      case _e.APOSTROPHE: {
        this._err(ht.missingWhitespaceAfterDoctypePublicKeyword), t.publicId = "", this.state = ye.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.missingDoctypePublicIdentifier), t.forceQuirks = !0, this.state = ye.DATA, this.emitCurrentDoctype(t);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.missingQuoteBeforeDoctypePublicIdentifier), t.forceQuirks = !0, this.state = ye.BOGUS_DOCTYPE, this._stateBogusDoctype(e);
    }
  }
  // Before DOCTYPE public identifier state
  //------------------------------------------------------------------
  _stateBeforeDoctypePublicIdentifier(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        break;
      case _e.QUOTATION_MARK: {
        t.publicId = "", this.state = ye.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
        break;
      }
      case _e.APOSTROPHE: {
        t.publicId = "", this.state = ye.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.missingDoctypePublicIdentifier), t.forceQuirks = !0, this.state = ye.DATA, this.emitCurrentDoctype(t);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.missingQuoteBeforeDoctypePublicIdentifier), t.forceQuirks = !0, this.state = ye.BOGUS_DOCTYPE, this._stateBogusDoctype(e);
    }
  }
  // DOCTYPE public identifier (double-quoted) state
  //------------------------------------------------------------------
  _stateDoctypePublicIdentifierDoubleQuoted(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.QUOTATION_MARK: {
        this.state = ye.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), t.publicId += Xo;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.abruptDoctypePublicIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = ye.DATA;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        t.publicId += String.fromCodePoint(e);
    }
  }
  // DOCTYPE public identifier (single-quoted) state
  //------------------------------------------------------------------
  _stateDoctypePublicIdentifierSingleQuoted(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.APOSTROPHE: {
        this.state = ye.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), t.publicId += Xo;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.abruptDoctypePublicIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = ye.DATA;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        t.publicId += String.fromCodePoint(e);
    }
  }
  // After DOCTYPE public identifier state
  //------------------------------------------------------------------
  _stateAfterDoctypePublicIdentifier(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED: {
        this.state = ye.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.DATA, this.emitCurrentDoctype(t);
        break;
      }
      case _e.QUOTATION_MARK: {
        this._err(ht.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t.systemId = "", this.state = ye.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
        break;
      }
      case _e.APOSTROPHE: {
        this._err(ht.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t.systemId = "", this.state = ye.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = ye.BOGUS_DOCTYPE, this._stateBogusDoctype(e);
    }
  }
  // Between DOCTYPE public and system identifiers state
  //------------------------------------------------------------------
  _stateBetweenDoctypePublicAndSystemIdentifiers(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        break;
      case _e.GREATER_THAN_SIGN: {
        this.emitCurrentDoctype(t), this.state = ye.DATA;
        break;
      }
      case _e.QUOTATION_MARK: {
        t.systemId = "", this.state = ye.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
        break;
      }
      case _e.APOSTROPHE: {
        t.systemId = "", this.state = ye.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = ye.BOGUS_DOCTYPE, this._stateBogusDoctype(e);
    }
  }
  // After DOCTYPE system keyword state
  //------------------------------------------------------------------
  _stateAfterDoctypeSystemKeyword(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED: {
        this.state = ye.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
        break;
      }
      case _e.QUOTATION_MARK: {
        this._err(ht.missingWhitespaceAfterDoctypeSystemKeyword), t.systemId = "", this.state = ye.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
        break;
      }
      case _e.APOSTROPHE: {
        this._err(ht.missingWhitespaceAfterDoctypeSystemKeyword), t.systemId = "", this.state = ye.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.missingDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = ye.DATA, this.emitCurrentDoctype(t);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = ye.BOGUS_DOCTYPE, this._stateBogusDoctype(e);
    }
  }
  // Before DOCTYPE system identifier state
  //------------------------------------------------------------------
  _stateBeforeDoctypeSystemIdentifier(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        break;
      case _e.QUOTATION_MARK: {
        t.systemId = "", this.state = ye.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
        break;
      }
      case _e.APOSTROPHE: {
        t.systemId = "", this.state = ye.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.missingDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = ye.DATA, this.emitCurrentDoctype(t);
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = ye.BOGUS_DOCTYPE, this._stateBogusDoctype(e);
    }
  }
  // DOCTYPE system identifier (double-quoted) state
  //------------------------------------------------------------------
  _stateDoctypeSystemIdentifierDoubleQuoted(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.QUOTATION_MARK: {
        this.state = ye.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), t.systemId += Xo;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.abruptDoctypeSystemIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = ye.DATA;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        t.systemId += String.fromCodePoint(e);
    }
  }
  // DOCTYPE system identifier (single-quoted) state
  //------------------------------------------------------------------
  _stateDoctypeSystemIdentifierSingleQuoted(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.APOSTROPHE: {
        this.state = ye.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter), t.systemId += Xo;
        break;
      }
      case _e.GREATER_THAN_SIGN: {
        this._err(ht.abruptDoctypeSystemIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = ye.DATA;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        t.systemId += String.fromCodePoint(e);
    }
  }
  // After DOCTYPE system identifier state
  //------------------------------------------------------------------
  _stateAfterDoctypeSystemIdentifier(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.SPACE:
      case _e.LINE_FEED:
      case _e.TABULATION:
      case _e.FORM_FEED:
        break;
      case _e.GREATER_THAN_SIGN: {
        this.emitCurrentDoctype(t), this.state = ye.DATA;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
      default:
        this._err(ht.unexpectedCharacterAfterDoctypeSystemIdentifier), this.state = ye.BOGUS_DOCTYPE, this._stateBogusDoctype(e);
    }
  }
  // Bogus DOCTYPE state
  //------------------------------------------------------------------
  _stateBogusDoctype(e) {
    const t = this.currentToken;
    switch (e) {
      case _e.GREATER_THAN_SIGN: {
        this.emitCurrentDoctype(t), this.state = ye.DATA;
        break;
      }
      case _e.NULL: {
        this._err(ht.unexpectedNullCharacter);
        break;
      }
      case _e.EOF: {
        this.emitCurrentDoctype(t), this._emitEOFToken();
        break;
      }
    }
  }
  // CDATA section state
  //------------------------------------------------------------------
  _stateCdataSection(e) {
    switch (e) {
      case _e.RIGHT_SQUARE_BRACKET: {
        this.state = ye.CDATA_SECTION_BRACKET;
        break;
      }
      case _e.EOF: {
        this._err(ht.eofInCdata), this._emitEOFToken();
        break;
      }
      default:
        this._emitCodePoint(e);
    }
  }
  // CDATA section bracket state
  //------------------------------------------------------------------
  _stateCdataSectionBracket(e) {
    e === _e.RIGHT_SQUARE_BRACKET ? this.state = ye.CDATA_SECTION_END : (this._emitChars("]"), this.state = ye.CDATA_SECTION, this._stateCdataSection(e));
  }
  // CDATA section end state
  //------------------------------------------------------------------
  _stateCdataSectionEnd(e) {
    switch (e) {
      case _e.GREATER_THAN_SIGN: {
        this.state = ye.DATA;
        break;
      }
      case _e.RIGHT_SQUARE_BRACKET: {
        this._emitChars("]");
        break;
      }
      default:
        this._emitChars("]]"), this.state = ye.CDATA_SECTION, this._stateCdataSection(e);
    }
  }
  // Character reference state
  //------------------------------------------------------------------
  _stateCharacterReference() {
    let e = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
    if (e < 0)
      if (this.preprocessor.lastChunkWritten)
        e = this.entityDecoder.end();
      else {
        this.active = !1, this.preprocessor.pos = this.preprocessor.html.length - 1, this.consumedAfterSnapshot = 0, this.preprocessor.endOfChunkHit = !0;
        return;
      }
    e === 0 ? (this.preprocessor.pos = this.entityStartPos, this._flushCodePointConsumedAsCharacterReference(_e.AMPERSAND), this.state = !this._isCharacterReferenceInAttribute() && vAe(this.preprocessor.peek(1)) ? ye.AMBIGUOUS_AMPERSAND : this.returnState) : this.state = this.returnState;
  }
  // Ambiguos ampersand state
  //------------------------------------------------------------------
  _stateAmbiguousAmpersand(e) {
    vAe(e) ? this._flushCodePointConsumedAsCharacterReference(e) : (e === _e.SEMICOLON && this._err(ht.unknownNamedCharacterReference), this.state = this.returnState, this._callState(e));
  }
}
const sHe = /* @__PURE__ */ new Set([P.DD, P.DT, P.LI, P.OPTGROUP, P.OPTION, P.P, P.RB, P.RP, P.RT, P.RTC]), CAe = /* @__PURE__ */ new Set([
  ...sHe,
  P.CAPTION,
  P.COLGROUP,
  P.TBODY,
  P.TD,
  P.TFOOT,
  P.TH,
  P.THEAD,
  P.TR
]), W$ = /* @__PURE__ */ new Set([
  P.APPLET,
  P.CAPTION,
  P.HTML,
  P.MARQUEE,
  P.OBJECT,
  P.TABLE,
  P.TD,
  P.TEMPLATE,
  P.TH
]), e6t = /* @__PURE__ */ new Set([...W$, P.OL, P.UL]), t6t = /* @__PURE__ */ new Set([...W$, P.BUTTON]), wAe = /* @__PURE__ */ new Set([P.ANNOTATION_XML, P.MI, P.MN, P.MO, P.MS, P.MTEXT]), SAe = /* @__PURE__ */ new Set([P.DESC, P.FOREIGN_OBJECT, P.TITLE]), n6t = /* @__PURE__ */ new Set([P.TR, P.TEMPLATE, P.HTML]), i6t = /* @__PURE__ */ new Set([P.TBODY, P.TFOOT, P.THEAD, P.TEMPLATE, P.HTML]), r6t = /* @__PURE__ */ new Set([P.TABLE, P.TEMPLATE, P.HTML]), s6t = /* @__PURE__ */ new Set([P.TD, P.TH]);
class o6t {
  get currentTmplContentOrNode() {
    return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
  }
  constructor(e, t, n) {
    this.treeAdapter = t, this.handler = n, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = P.UNKNOWN, this.current = e;
  }
  //Index of element
  _indexOf(e) {
    return this.items.lastIndexOf(e, this.stackTop);
  }
  //Update current element
  _isInTemplate() {
    return this.currentTagId === P.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === Rt.HTML;
  }
  _updateCurrentElement() {
    this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop];
  }
  //Mutations
  push(e, t) {
    this.stackTop++, this.items[this.stackTop] = e, this.current = e, this.tagIDs[this.stackTop] = t, this.currentTagId = t, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(e, t, !0);
  }
  pop() {
    const e = this.current;
    this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !0);
  }
  replace(e, t) {
    const n = this._indexOf(e);
    this.items[n] = t, n === this.stackTop && (this.current = t);
  }
  insertAfter(e, t, n) {
    const r = this._indexOf(e) + 1;
    this.items.splice(r, 0, t), this.tagIDs.splice(r, 0, n), this.stackTop++, r === this.stackTop && this._updateCurrentElement(), this.current && this.currentTagId !== void 0 && this.handler.onItemPush(this.current, this.currentTagId, r === this.stackTop);
  }
  popUntilTagNamePopped(e) {
    let t = this.stackTop + 1;
    do
      t = this.tagIDs.lastIndexOf(e, t - 1);
    while (t > 0 && this.treeAdapter.getNamespaceURI(this.items[t]) !== Rt.HTML);
    this.shortenToLength(Math.max(t, 0));
  }
  shortenToLength(e) {
    for (; this.stackTop >= e; ) {
      const t = this.current;
      this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(t, this.stackTop < e);
    }
  }
  popUntilElementPopped(e) {
    const t = this._indexOf(e);
    this.shortenToLength(Math.max(t, 0));
  }
  popUntilPopped(e, t) {
    const n = this._indexOfTagNames(e, t);
    this.shortenToLength(Math.max(n, 0));
  }
  popUntilNumberedHeaderPopped() {
    this.popUntilPopped(fde, Rt.HTML);
  }
  popUntilTableCellPopped() {
    this.popUntilPopped(s6t, Rt.HTML);
  }
  popAllUpToHtmlElement() {
    this.tmplCount = 0, this.shortenToLength(1);
  }
  _indexOfTagNames(e, t) {
    for (let n = this.stackTop; n >= 0; n--)
      if (e.has(this.tagIDs[n]) && this.treeAdapter.getNamespaceURI(this.items[n]) === t)
        return n;
    return -1;
  }
  clearBackTo(e, t) {
    const n = this._indexOfTagNames(e, t);
    this.shortenToLength(n + 1);
  }
  clearBackToTableContext() {
    this.clearBackTo(r6t, Rt.HTML);
  }
  clearBackToTableBodyContext() {
    this.clearBackTo(i6t, Rt.HTML);
  }
  clearBackToTableRowContext() {
    this.clearBackTo(n6t, Rt.HTML);
  }
  remove(e) {
    const t = this._indexOf(e);
    t >= 0 && (t === this.stackTop ? this.pop() : (this.items.splice(t, 1), this.tagIDs.splice(t, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !1)));
  }
  //Search
  tryPeekProperlyNestedBodyElement() {
    return this.stackTop >= 1 && this.tagIDs[1] === P.BODY ? this.items[1] : null;
  }
  contains(e) {
    return this._indexOf(e) > -1;
  }
  getCommonAncestor(e) {
    const t = this._indexOf(e) - 1;
    return t >= 0 ? this.items[t] : null;
  }
  isRootHtmlElementCurrent() {
    return this.stackTop === 0 && this.tagIDs[0] === P.HTML;
  }
  //Element in scope
  hasInDynamicScope(e, t) {
    for (let n = this.stackTop; n >= 0; n--) {
      const r = this.tagIDs[n];
      switch (this.treeAdapter.getNamespaceURI(this.items[n])) {
        case Rt.HTML: {
          if (r === e)
            return !0;
          if (t.has(r))
            return !1;
          break;
        }
        case Rt.SVG: {
          if (SAe.has(r))
            return !1;
          break;
        }
        case Rt.MATHML: {
          if (wAe.has(r))
            return !1;
          break;
        }
      }
    }
    return !0;
  }
  hasInScope(e) {
    return this.hasInDynamicScope(e, W$);
  }
  hasInListItemScope(e) {
    return this.hasInDynamicScope(e, e6t);
  }
  hasInButtonScope(e) {
    return this.hasInDynamicScope(e, t6t);
  }
  hasNumberedHeaderInScope() {
    for (let e = this.stackTop; e >= 0; e--) {
      const t = this.tagIDs[e];
      switch (this.treeAdapter.getNamespaceURI(this.items[e])) {
        case Rt.HTML: {
          if (fde.has(t))
            return !0;
          if (W$.has(t))
            return !1;
          break;
        }
        case Rt.SVG: {
          if (SAe.has(t))
            return !1;
          break;
        }
        case Rt.MATHML: {
          if (wAe.has(t))
            return !1;
          break;
        }
      }
    }
    return !0;
  }
  hasInTableScope(e) {
    for (let t = this.stackTop; t >= 0; t--)
      if (this.treeAdapter.getNamespaceURI(this.items[t]) === Rt.HTML)
        switch (this.tagIDs[t]) {
          case e:
            return !0;
          case P.TABLE:
          case P.HTML:
            return !1;
        }
    return !0;
  }
  hasTableBodyContextInTableScope() {
    for (let e = this.stackTop; e >= 0; e--)
      if (this.treeAdapter.getNamespaceURI(this.items[e]) === Rt.HTML)
        switch (this.tagIDs[e]) {
          case P.TBODY:
          case P.THEAD:
          case P.TFOOT:
            return !0;
          case P.TABLE:
          case P.HTML:
            return !1;
        }
    return !0;
  }
  hasInSelectScope(e) {
    for (let t = this.stackTop; t >= 0; t--)
      if (this.treeAdapter.getNamespaceURI(this.items[t]) === Rt.HTML)
        switch (this.tagIDs[t]) {
          case e:
            return !0;
          case P.OPTION:
          case P.OPTGROUP:
            break;
          default:
            return !1;
        }
    return !0;
  }
  //Implied end tags
  generateImpliedEndTags() {
    for (; this.currentTagId !== void 0 && sHe.has(this.currentTagId); )
      this.pop();
  }
  generateImpliedEndTagsThoroughly() {
    for (; this.currentTagId !== void 0 && CAe.has(this.currentTagId); )
      this.pop();
  }
  generateImpliedEndTagsWithExclusion(e) {
    for (; this.currentTagId !== void 0 && this.currentTagId !== e && CAe.has(this.currentTagId); )
      this.pop();
  }
}
const rne = 3;
var j_;
(function(i) {
  i[i.Marker = 0] = "Marker", i[i.Element = 1] = "Element";
})(j_ || (j_ = {}));
const EAe = { type: j_.Marker };
class a6t {
  constructor(e) {
    this.treeAdapter = e, this.entries = [], this.bookmark = null;
  }
  //Noah Ark's condition
  //OPTIMIZATION: at first we try to find possible candidates for exclusion using
  //lightweight heuristics without thorough attributes check.
  _getNoahArkConditionCandidates(e, t) {
    const n = [], r = t.length, s = this.treeAdapter.getTagName(e), o = this.treeAdapter.getNamespaceURI(e);
    for (let a = 0; a < this.entries.length; a++) {
      const l = this.entries[a];
      if (l.type === j_.Marker)
        break;
      const { element: c } = l;
      if (this.treeAdapter.getTagName(c) === s && this.treeAdapter.getNamespaceURI(c) === o) {
        const u = this.treeAdapter.getAttrList(c);
        u.length === r && n.push({ idx: a, attrs: u });
      }
    }
    return n;
  }
  _ensureNoahArkCondition(e) {
    if (this.entries.length < rne)
      return;
    const t = this.treeAdapter.getAttrList(e), n = this._getNoahArkConditionCandidates(e, t);
    if (n.length < rne)
      return;
    const r = new Map(t.map((o) => [o.name, o.value]));
    let s = 0;
    for (let o = 0; o < n.length; o++) {
      const a = n[o];
      a.attrs.every((l) => r.get(l.name) === l.value) && (s += 1, s >= rne && this.entries.splice(a.idx, 1));
    }
  }
  //Mutations
  insertMarker() {
    this.entries.unshift(EAe);
  }
  pushElement(e, t) {
    this._ensureNoahArkCondition(e), this.entries.unshift({
      type: j_.Element,
      element: e,
      token: t
    });
  }
  insertElementAfterBookmark(e, t) {
    const n = this.entries.indexOf(this.bookmark);
    this.entries.splice(n, 0, {
      type: j_.Element,
      element: e,
      token: t
    });
  }
  removeEntry(e) {
    const t = this.entries.indexOf(e);
    t !== -1 && this.entries.splice(t, 1);
  }
  /**
   * Clears the list of formatting elements up to the last marker.
   *
   * @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker
   */
  clearToLastMarker() {
    const e = this.entries.indexOf(EAe);
    e === -1 ? this.entries.length = 0 : this.entries.splice(0, e + 1);
  }
  //Search
  getElementEntryInScopeWithTagName(e) {
    const t = this.entries.find((n) => n.type === j_.Marker || this.treeAdapter.getTagName(n.element) === e);
    return t && t.type === j_.Element ? t : null;
  }
  getElementEntry(e) {
    return this.entries.find((t) => t.type === j_.Element && t.element === e);
  }
}
const FC = {
  //Node construction
  createDocument() {
    return {
      nodeName: "#document",
      mode: Bg.NO_QUIRKS,
      childNodes: []
    };
  },
  createDocumentFragment() {
    return {
      nodeName: "#document-fragment",
      childNodes: []
    };
  },
  createElement(i, e, t) {
    return {
      nodeName: i,
      tagName: i,
      attrs: t,
      namespaceURI: e,
      childNodes: [],
      parentNode: null
    };
  },
  createCommentNode(i) {
    return {
      nodeName: "#comment",
      data: i,
      parentNode: null
    };
  },
  createTextNode(i) {
    return {
      nodeName: "#text",
      value: i,
      parentNode: null
    };
  },
  //Tree mutation
  appendChild(i, e) {
    i.childNodes.push(e), e.parentNode = i;
  },
  insertBefore(i, e, t) {
    const n = i.childNodes.indexOf(t);
    i.childNodes.splice(n, 0, e), e.parentNode = i;
  },
  setTemplateContent(i, e) {
    i.content = e;
  },
  getTemplateContent(i) {
    return i.content;
  },
  setDocumentType(i, e, t, n) {
    const r = i.childNodes.find((s) => s.nodeName === "#documentType");
    if (r)
      r.name = e, r.publicId = t, r.systemId = n;
    else {
      const s = {
        nodeName: "#documentType",
        name: e,
        publicId: t,
        systemId: n,
        parentNode: null
      };
      FC.appendChild(i, s);
    }
  },
  setDocumentMode(i, e) {
    i.mode = e;
  },
  getDocumentMode(i) {
    return i.mode;
  },
  detachNode(i) {
    if (i.parentNode) {
      const e = i.parentNode.childNodes.indexOf(i);
      i.parentNode.childNodes.splice(e, 1), i.parentNode = null;
    }
  },
  insertText(i, e) {
    if (i.childNodes.length > 0) {
      const t = i.childNodes[i.childNodes.length - 1];
      if (FC.isTextNode(t)) {
        t.value += e;
        return;
      }
    }
    FC.appendChild(i, FC.createTextNode(e));
  },
  insertTextBefore(i, e, t) {
    const n = i.childNodes[i.childNodes.indexOf(t) - 1];
    n && FC.isTextNode(n) ? n.value += e : FC.insertBefore(i, FC.createTextNode(e), t);
  },
  adoptAttributes(i, e) {
    const t = new Set(i.attrs.map((n) => n.name));
    for (let n = 0; n < e.length; n++)
      t.has(e[n].name) || i.attrs.push(e[n]);
  },
  //Tree traversing
  getFirstChild(i) {
    return i.childNodes[0];
  },
  getChildNodes(i) {
    return i.childNodes;
  },
  getParentNode(i) {
    return i.parentNode;
  },
  getAttrList(i) {
    return i.attrs;
  },
  //Node data
  getTagName(i) {
    return i.tagName;
  },
  getNamespaceURI(i) {
    return i.namespaceURI;
  },
  getTextNodeContent(i) {
    return i.value;
  },
  getCommentNodeContent(i) {
    return i.data;
  },
  getDocumentTypeNodeName(i) {
    return i.name;
  },
  getDocumentTypeNodePublicId(i) {
    return i.publicId;
  },
  getDocumentTypeNodeSystemId(i) {
    return i.systemId;
  },
  //Node types
  isTextNode(i) {
    return i.nodeName === "#text";
  },
  isCommentNode(i) {
    return i.nodeName === "#comment";
  },
  isDocumentTypeNode(i) {
    return i.nodeName === "#documentType";
  },
  isElementNode(i) {
    return Object.prototype.hasOwnProperty.call(i, "tagName");
  },
  // Source code location
  setNodeSourceCodeLocation(i, e) {
    i.sourceCodeLocation = e;
  },
  getNodeSourceCodeLocation(i) {
    return i.sourceCodeLocation;
  },
  updateNodeSourceCodeLocation(i, e) {
    i.sourceCodeLocation = { ...i.sourceCodeLocation, ...e };
  }
}, oHe = "html", l6t = "about:legacy-compat", c6t = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd", aHe = [
  "+//silmaril//dtd html pro v0r11 19970101//",
  "-//as//dtd html 3.0 aswedit + extensions//",
  "-//advasoft ltd//dtd html 3.0 aswedit + extensions//",
  "-//ietf//dtd html 2.0 level 1//",
  "-//ietf//dtd html 2.0 level 2//",
  "-//ietf//dtd html 2.0 strict level 1//",
  "-//ietf//dtd html 2.0 strict level 2//",
  "-//ietf//dtd html 2.0 strict//",
  "-//ietf//dtd html 2.0//",
  "-//ietf//dtd html 2.1e//",
  "-//ietf//dtd html 3.0//",
  "-//ietf//dtd html 3.2 final//",
  "-//ietf//dtd html 3.2//",
  "-//ietf//dtd html 3//",
  "-//ietf//dtd html level 0//",
  "-//ietf//dtd html level 1//",
  "-//ietf//dtd html level 2//",
  "-//ietf//dtd html level 3//",
  "-//ietf//dtd html strict level 0//",
  "-//ietf//dtd html strict level 1//",
  "-//ietf//dtd html strict level 2//",
  "-//ietf//dtd html strict level 3//",
  "-//ietf//dtd html strict//",
  "-//ietf//dtd html//",
  "-//metrius//dtd metrius presentational//",
  "-//microsoft//dtd internet explorer 2.0 html strict//",
  "-//microsoft//dtd internet explorer 2.0 html//",
  "-//microsoft//dtd internet explorer 2.0 tables//",
  "-//microsoft//dtd internet explorer 3.0 html strict//",
  "-//microsoft//dtd internet explorer 3.0 html//",
  "-//microsoft//dtd internet explorer 3.0 tables//",
  "-//netscape comm. corp.//dtd html//",
  "-//netscape comm. corp.//dtd strict html//",
  "-//o'reilly and associates//dtd html 2.0//",
  "-//o'reilly and associates//dtd html extended 1.0//",
  "-//o'reilly and associates//dtd html extended relaxed 1.0//",
  "-//sq//dtd html 2.0 hotmetal + extensions//",
  "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//",
  "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//",
  "-//spyglass//dtd html 2.0 extended//",
  "-//sun microsystems corp.//dtd hotjava html//",
  "-//sun microsystems corp.//dtd hotjava strict html//",
  "-//w3c//dtd html 3 1995-03-24//",
  "-//w3c//dtd html 3.2 draft//",
  "-//w3c//dtd html 3.2 final//",
  "-//w3c//dtd html 3.2//",
  "-//w3c//dtd html 3.2s draft//",
  "-//w3c//dtd html 4.0 frameset//",
  "-//w3c//dtd html 4.0 transitional//",
  "-//w3c//dtd html experimental 19960712//",
  "-//w3c//dtd html experimental 970421//",
  "-//w3c//dtd w3 html//",
  "-//w3o//dtd w3 html 3.0//",
  "-//webtechs//dtd mozilla html 2.0//",
  "-//webtechs//dtd mozilla html//"
], u6t = [
  ...aHe,
  "-//w3c//dtd html 4.01 frameset//",
  "-//w3c//dtd html 4.01 transitional//"
], d6t = /* @__PURE__ */ new Set([
  "-//w3o//dtd w3 html strict 3.0//en//",
  "-/w3c/dtd html 4.0 transitional/en",
  "html"
]), lHe = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"], h6t = [
  ...lHe,
  "-//w3c//dtd html 4.01 frameset//",
  "-//w3c//dtd html 4.01 transitional//"
];
function xAe(i, e) {
  return e.some((t) => i.startsWith(t));
}
function f6t(i) {
  return i.name === oHe && i.publicId === null && (i.systemId === null || i.systemId === l6t);
}
function g6t(i) {
  if (i.name !== oHe)
    return Bg.QUIRKS;
  const { systemId: e } = i;
  if (e && e.toLowerCase() === c6t)
    return Bg.QUIRKS;
  let { publicId: t } = i;
  if (t !== null) {
    if (t = t.toLowerCase(), d6t.has(t))
      return Bg.QUIRKS;
    let n = e === null ? u6t : aHe;
    if (xAe(t, n))
      return Bg.QUIRKS;
    if (n = e === null ? lHe : h6t, xAe(t, n))
      return Bg.LIMITED_QUIRKS;
  }
  return Bg.NO_QUIRKS;
}
const LAe = {
  TEXT_HTML: "text/html",
  APPLICATION_XML: "application/xhtml+xml"
}, p6t = "definitionurl", m6t = "definitionURL", _6t = new Map([
  "attributeName",
  "attributeType",
  "baseFrequency",
  "baseProfile",
  "calcMode",
  "clipPathUnits",
  "diffuseConstant",
  "edgeMode",
  "filterUnits",
  "glyphRef",
  "gradientTransform",
  "gradientUnits",
  "kernelMatrix",
  "kernelUnitLength",
  "keyPoints",
  "keySplines",
  "keyTimes",
  "lengthAdjust",
  "limitingConeAngle",
  "markerHeight",
  "markerUnits",
  "markerWidth",
  "maskContentUnits",
  "maskUnits",
  "numOctaves",
  "pathLength",
  "patternContentUnits",
  "patternTransform",
  "patternUnits",
  "pointsAtX",
  "pointsAtY",
  "pointsAtZ",
  "preserveAlpha",
  "preserveAspectRatio",
  "primitiveUnits",
  "refX",
  "refY",
  "repeatCount",
  "repeatDur",
  "requiredExtensions",
  "requiredFeatures",
  "specularConstant",
  "specularExponent",
  "spreadMethod",
  "startOffset",
  "stdDeviation",
  "stitchTiles",
  "surfaceScale",
  "systemLanguage",
  "tableValues",
  "targetX",
  "targetY",
  "textLength",
  "viewBox",
  "viewTarget",
  "xChannelSelector",
  "yChannelSelector",
  "zoomAndPan"
].map((i) => [i.toLowerCase(), i])), b6t = /* @__PURE__ */ new Map([
  ["xlink:actuate", { prefix: "xlink", name: "actuate", namespace: Rt.XLINK }],
  ["xlink:arcrole", { prefix: "xlink", name: "arcrole", namespace: Rt.XLINK }],
  ["xlink:href", { prefix: "xlink", name: "href", namespace: Rt.XLINK }],
  ["xlink:role", { prefix: "xlink", name: "role", namespace: Rt.XLINK }],
  ["xlink:show", { prefix: "xlink", name: "show", namespace: Rt.XLINK }],
  ["xlink:title", { prefix: "xlink", name: "title", namespace: Rt.XLINK }],
  ["xlink:type", { prefix: "xlink", name: "type", namespace: Rt.XLINK }],
  ["xml:lang", { prefix: "xml", name: "lang", namespace: Rt.XML }],
  ["xml:space", { prefix: "xml", name: "space", namespace: Rt.XML }],
  ["xmlns", { prefix: "", name: "xmlns", namespace: Rt.XMLNS }],
  ["xmlns:xlink", { prefix: "xmlns", name: "xlink", namespace: Rt.XMLNS }]
]), v6t = new Map([
  "altGlyph",
  "altGlyphDef",
  "altGlyphItem",
  "animateColor",
  "animateMotion",
  "animateTransform",
  "clipPath",
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feDistantLight",
  "feFlood",
  "feFuncA",
  "feFuncB",
  "feFuncG",
  "feFuncR",
  "feGaussianBlur",
  "feImage",
  "feMerge",
  "feMergeNode",
  "feMorphology",
  "feOffset",
  "fePointLight",
  "feSpecularLighting",
  "feSpotLight",
  "feTile",
  "feTurbulence",
  "foreignObject",
  "glyphRef",
  "linearGradient",
  "radialGradient",
  "textPath"
].map((i) => [i.toLowerCase(), i])), y6t = /* @__PURE__ */ new Set([
  P.B,
  P.BIG,
  P.BLOCKQUOTE,
  P.BODY,
  P.BR,
  P.CENTER,
  P.CODE,
  P.DD,
  P.DIV,
  P.DL,
  P.DT,
  P.EM,
  P.EMBED,
  P.H1,
  P.H2,
  P.H3,
  P.H4,
  P.H5,
  P.H6,
  P.HEAD,
  P.HR,
  P.I,
  P.IMG,
  P.LI,
  P.LISTING,
  P.MENU,
  P.META,
  P.NOBR,
  P.OL,
  P.P,
  P.PRE,
  P.RUBY,
  P.S,
  P.SMALL,
  P.SPAN,
  P.STRONG,
  P.STRIKE,
  P.SUB,
  P.SUP,
  P.TABLE,
  P.TT,
  P.U,
  P.UL,
  P.VAR
]);
function C6t(i) {
  const e = i.tagID;
  return e === P.FONT && i.attrs.some(({ name: n }) => n === Yx.COLOR || n === Yx.SIZE || n === Yx.FACE) || y6t.has(e);
}
function cHe(i) {
  for (let e = 0; e < i.attrs.length; e++)
    if (i.attrs[e].name === p6t) {
      i.attrs[e].name = m6t;
      break;
    }
}
function uHe(i) {
  for (let e = 0; e < i.attrs.length; e++) {
    const t = _6t.get(i.attrs[e].name);
    t != null && (i.attrs[e].name = t);
  }
}
function D0e(i) {
  for (let e = 0; e < i.attrs.length; e++) {
    const t = b6t.get(i.attrs[e].name);
    t && (i.attrs[e].prefix = t.prefix, i.attrs[e].name = t.name, i.attrs[e].namespace = t.namespace);
  }
}
function w6t(i) {
  const e = v6t.get(i.tagName);
  e != null && (i.tagName = e, i.tagID = E2(i.tagName));
}
function S6t(i, e) {
  return e === Rt.MATHML && (i === P.MI || i === P.MO || i === P.MN || i === P.MS || i === P.MTEXT);
}
function E6t(i, e, t) {
  if (e === Rt.MATHML && i === P.ANNOTATION_XML) {
    for (let n = 0; n < t.length; n++)
      if (t[n].name === Yx.ENCODING) {
        const r = t[n].value.toLowerCase();
        return r === LAe.TEXT_HTML || r === LAe.APPLICATION_XML;
      }
  }
  return e === Rt.SVG && (i === P.FOREIGN_OBJECT || i === P.DESC || i === P.TITLE);
}
function x6t(i, e, t, n) {
  return (!n || n === Rt.HTML) && E6t(i, e, t) || (!n || n === Rt.MATHML) && S6t(i, e);
}
const L6t = "hidden", T6t = 8, k6t = 3;
var Se;
(function(i) {
  i[i.INITIAL = 0] = "INITIAL", i[i.BEFORE_HTML = 1] = "BEFORE_HTML", i[i.BEFORE_HEAD = 2] = "BEFORE_HEAD", i[i.IN_HEAD = 3] = "IN_HEAD", i[i.IN_HEAD_NO_SCRIPT = 4] = "IN_HEAD_NO_SCRIPT", i[i.AFTER_HEAD = 5] = "AFTER_HEAD", i[i.IN_BODY = 6] = "IN_BODY", i[i.TEXT = 7] = "TEXT", i[i.IN_TABLE = 8] = "IN_TABLE", i[i.IN_TABLE_TEXT = 9] = "IN_TABLE_TEXT", i[i.IN_CAPTION = 10] = "IN_CAPTION", i[i.IN_COLUMN_GROUP = 11] = "IN_COLUMN_GROUP", i[i.IN_TABLE_BODY = 12] = "IN_TABLE_BODY", i[i.IN_ROW = 13] = "IN_ROW", i[i.IN_CELL = 14] = "IN_CELL", i[i.IN_SELECT = 15] = "IN_SELECT", i[i.IN_SELECT_IN_TABLE = 16] = "IN_SELECT_IN_TABLE", i[i.IN_TEMPLATE = 17] = "IN_TEMPLATE", i[i.AFTER_BODY = 18] = "AFTER_BODY", i[i.IN_FRAMESET = 19] = "IN_FRAMESET", i[i.AFTER_FRAMESET = 20] = "AFTER_FRAMESET", i[i.AFTER_AFTER_BODY = 21] = "AFTER_AFTER_BODY", i[i.AFTER_AFTER_FRAMESET = 22] = "AFTER_AFTER_FRAMESET";
})(Se || (Se = {}));
const D6t = {
  startLine: -1,
  startCol: -1,
  startOffset: -1,
  endLine: -1,
  endCol: -1,
  endOffset: -1
}, dHe = /* @__PURE__ */ new Set([P.TABLE, P.TBODY, P.TFOOT, P.THEAD, P.TR]), TAe = {
  scriptingEnabled: !0,
  sourceCodeLocationInfo: !1,
  treeAdapter: FC,
  onParseError: null
};
class kAe {
  constructor(e, t, n = null, r = null) {
    this.fragmentContext = n, this.scriptHandler = r, this.currentToken = null, this.stopped = !1, this.insertionMode = Se.INITIAL, this.originalInsertionMode = Se.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = !1, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = !1, this.framesetOk = !0, this.skipNextNewLine = !1, this.fosterParentingEnabled = !1, this.options = {
      ...TAe,
      ...e
    }, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = !0), this.document = t ?? this.treeAdapter.createDocument(), this.tokenizer = new JBt(this.options, this), this.activeFormattingElements = new a6t(this.treeAdapter), this.fragmentContextID = n ? E2(this.treeAdapter.getTagName(n)) : P.UNKNOWN, this._setContextModes(n ?? this.document, this.fragmentContextID), this.openElements = new o6t(this.document, this.treeAdapter, this);
  }
  // API
  static parse(e, t) {
    const n = new this(t);
    return n.tokenizer.write(e, !0), n.document;
  }
  static getFragmentParser(e, t) {
    const n = {
      ...TAe,
      ...t
    };
    e ?? (e = n.treeAdapter.createElement(Ye.TEMPLATE, Rt.HTML, []));
    const r = n.treeAdapter.createElement("documentmock", Rt.HTML, []), s = new this(n, r, e);
    return s.fragmentContextID === P.TEMPLATE && s.tmplInsertionModeStack.unshift(Se.IN_TEMPLATE), s._initTokenizerForFragmentParsing(), s._insertFakeRootElement(), s._resetInsertionMode(), s._findFormInFragmentContext(), s;
  }
  getFragment() {
    const e = this.treeAdapter.getFirstChild(this.document), t = this.treeAdapter.createDocumentFragment();
    return this._adoptNodes(e, t), t;
  }
  //Errors
  /** @internal */
  _err(e, t, n) {
    var r;
    if (!this.onParseError)
      return;
    const s = (r = e.location) !== null && r !== void 0 ? r : D6t, o = {
      code: t,
      startLine: s.startLine,
      startCol: s.startCol,
      startOffset: s.startOffset,
      endLine: n ? s.startLine : s.endLine,
      endCol: n ? s.startCol : s.endCol,
      endOffset: n ? s.startOffset : s.endOffset
    };
    this.onParseError(o);
  }
  //Stack events
  /** @internal */
  onItemPush(e, t, n) {
    var r, s;
    (s = (r = this.treeAdapter).onItemPush) === null || s === void 0 || s.call(r, e), n && this.openElements.stackTop > 0 && this._setContextModes(e, t);
  }
  /** @internal */
  onItemPop(e, t) {
    var n, r;
    if (this.options.sourceCodeLocationInfo && this._setEndLocation(e, this.currentToken), (r = (n = this.treeAdapter).onItemPop) === null || r === void 0 || r.call(n, e, this.openElements.current), t) {
      let s, o;
      this.openElements.stackTop === 0 && this.fragmentContext ? (s = this.fragmentContext, o = this.fragmentContextID) : { current: s, currentTagId: o } = this.openElements, this._setContextModes(s, o);
    }
  }
  _setContextModes(e, t) {
    const n = e === this.document || e && this.treeAdapter.getNamespaceURI(e) === Rt.HTML;
    this.currentNotInHTML = !n, this.tokenizer.inForeignNode = !n && e !== void 0 && t !== void 0 && !this._isIntegrationPoint(t, e);
  }
  /** @protected */
  _switchToTextParsing(e, t) {
    this._insertElement(e, Rt.HTML), this.tokenizer.state = t, this.originalInsertionMode = this.insertionMode, this.insertionMode = Se.TEXT;
  }
  switchToPlaintextParsing() {
    this.insertionMode = Se.TEXT, this.originalInsertionMode = Se.IN_BODY, this.tokenizer.state = qa.PLAINTEXT;
  }
  //Fragment parsing
  /** @protected */
  _getAdjustedCurrentElement() {
    return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current;
  }
  /** @protected */
  _findFormInFragmentContext() {
    let e = this.fragmentContext;
    for (; e; ) {
      if (this.treeAdapter.getTagName(e) === Ye.FORM) {
        this.formElement = e;
        break;
      }
      e = this.treeAdapter.getParentNode(e);
    }
  }
  _initTokenizerForFragmentParsing() {
    if (!(!this.fragmentContext || this.treeAdapter.getNamespaceURI(this.fragmentContext) !== Rt.HTML))
      switch (this.fragmentContextID) {
        case P.TITLE:
        case P.TEXTAREA: {
          this.tokenizer.state = qa.RCDATA;
          break;
        }
        case P.STYLE:
        case P.XMP:
        case P.IFRAME:
        case P.NOEMBED:
        case P.NOFRAMES:
        case P.NOSCRIPT: {
          this.tokenizer.state = qa.RAWTEXT;
          break;
        }
        case P.SCRIPT: {
          this.tokenizer.state = qa.SCRIPT_DATA;
          break;
        }
        case P.PLAINTEXT: {
          this.tokenizer.state = qa.PLAINTEXT;
          break;
        }
      }
  }
  //Tree mutation
  /** @protected */
  _setDocumentType(e) {
    const t = e.name || "", n = e.publicId || "", r = e.systemId || "";
    if (this.treeAdapter.setDocumentType(this.document, t, n, r), e.location) {
      const o = this.treeAdapter.getChildNodes(this.document).find((a) => this.treeAdapter.isDocumentTypeNode(a));
      o && this.treeAdapter.setNodeSourceCodeLocation(o, e.location);
    }
  }
  /** @protected */
  _attachElementToTree(e, t) {
    if (this.options.sourceCodeLocationInfo) {
      const n = t && {
        ...t,
        startTag: t
      };
      this.treeAdapter.setNodeSourceCodeLocation(e, n);
    }
    if (this._shouldFosterParentOnInsertion())
      this._fosterParentElement(e);
    else {
      const n = this.openElements.currentTmplContentOrNode;
      this.treeAdapter.appendChild(n ?? this.document, e);
    }
  }
  /**
   * For self-closing tags. Add an element to the tree, but skip adding it
   * to the stack.
   */
  /** @protected */
  _appendElement(e, t) {
    const n = this.treeAdapter.createElement(e.tagName, t, e.attrs);
    this._attachElementToTree(n, e.location);
  }
  /** @protected */
  _insertElement(e, t) {
    const n = this.treeAdapter.createElement(e.tagName, t, e.attrs);
    this._attachElementToTree(n, e.location), this.openElements.push(n, e.tagID);
  }
  /** @protected */
  _insertFakeElement(e, t) {
    const n = this.treeAdapter.createElement(e, Rt.HTML, []);
    this._attachElementToTree(n, null), this.openElements.push(n, t);
  }
  /** @protected */
  _insertTemplate(e) {
    const t = this.treeAdapter.createElement(e.tagName, Rt.HTML, e.attrs), n = this.treeAdapter.createDocumentFragment();
    this.treeAdapter.setTemplateContent(t, n), this._attachElementToTree(t, e.location), this.openElements.push(t, e.tagID), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(n, null);
  }
  /** @protected */
  _insertFakeRootElement() {
    const e = this.treeAdapter.createElement(Ye.HTML, Rt.HTML, []);
    this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(e, null), this.treeAdapter.appendChild(this.openElements.current, e), this.openElements.push(e, P.HTML);
  }
  /** @protected */
  _appendCommentNode(e, t) {
    const n = this.treeAdapter.createCommentNode(e.data);
    this.treeAdapter.appendChild(t, n), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(n, e.location);
  }
  /** @protected */
  _insertCharacters(e) {
    let t, n;
    if (this._shouldFosterParentOnInsertion() ? ({ parent: t, beforeElement: n } = this._findFosterParentingLocation(), n ? this.treeAdapter.insertTextBefore(t, e.chars, n) : this.treeAdapter.insertText(t, e.chars)) : (t = this.openElements.currentTmplContentOrNode, this.treeAdapter.insertText(t, e.chars)), !e.location)
      return;
    const r = this.treeAdapter.getChildNodes(t), s = n ? r.lastIndexOf(n) : r.length, o = r[s - 1];
    if (this.treeAdapter.getNodeSourceCodeLocation(o)) {
      const { endLine: l, endCol: c, endOffset: u } = e.location;
      this.treeAdapter.updateNodeSourceCodeLocation(o, { endLine: l, endCol: c, endOffset: u });
    } else this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(o, e.location);
  }
  /** @protected */
  _adoptNodes(e, t) {
    for (let n = this.treeAdapter.getFirstChild(e); n; n = this.treeAdapter.getFirstChild(e))
      this.treeAdapter.detachNode(n), this.treeAdapter.appendChild(t, n);
  }
  /** @protected */
  _setEndLocation(e, t) {
    if (this.treeAdapter.getNodeSourceCodeLocation(e) && t.location) {
      const n = t.location, r = this.treeAdapter.getTagName(e), s = (
        // NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing
        // tag and for cases like <td> <p> </td> - 'p' closes without a closing tag.
        t.type === Dr.END_TAG && r === t.tagName ? {
          endTag: { ...n },
          endLine: n.endLine,
          endCol: n.endCol,
          endOffset: n.endOffset
        } : {
          endLine: n.startLine,
          endCol: n.startCol,
          endOffset: n.startOffset
        }
      );
      this.treeAdapter.updateNodeSourceCodeLocation(e, s);
    }
  }
  //Token processing
  shouldProcessStartTagTokenInForeignContent(e) {
    if (!this.currentNotInHTML)
      return !1;
    let t, n;
    return this.openElements.stackTop === 0 && this.fragmentContext ? (t = this.fragmentContext, n = this.fragmentContextID) : { current: t, currentTagId: n } = this.openElements, e.tagID === P.SVG && this.treeAdapter.getTagName(t) === Ye.ANNOTATION_XML && this.treeAdapter.getNamespaceURI(t) === Rt.MATHML ? !1 : (
      // Check that `current` is not an integration point for HTML or MathML elements.
      this.tokenizer.inForeignNode || // If it _is_ an integration point, then we might have to check that it is not an HTML
      // integration point.
      (e.tagID === P.MGLYPH || e.tagID === P.MALIGNMARK) && n !== void 0 && !this._isIntegrationPoint(n, t, Rt.HTML)
    );
  }
  /** @protected */
  _processToken(e) {
    switch (e.type) {
      case Dr.CHARACTER: {
        this.onCharacter(e);
        break;
      }
      case Dr.NULL_CHARACTER: {
        this.onNullCharacter(e);
        break;
      }
      case Dr.COMMENT: {
        this.onComment(e);
        break;
      }
      case Dr.DOCTYPE: {
        this.onDoctype(e);
        break;
      }
      case Dr.START_TAG: {
        this._processStartTag(e);
        break;
      }
      case Dr.END_TAG: {
        this.onEndTag(e);
        break;
      }
      case Dr.EOF: {
        this.onEof(e);
        break;
      }
      case Dr.WHITESPACE_CHARACTER: {
        this.onWhitespaceCharacter(e);
        break;
      }
    }
  }
  //Integration points
  /** @protected */
  _isIntegrationPoint(e, t, n) {
    const r = this.treeAdapter.getNamespaceURI(t), s = this.treeAdapter.getAttrList(t);
    return x6t(e, r, s, n);
  }
  //Active formatting elements reconstruction
  /** @protected */
  _reconstructActiveFormattingElements() {
    const e = this.activeFormattingElements.entries.length;
    if (e) {
      const t = this.activeFormattingElements.entries.findIndex((r) => r.type === j_.Marker || this.openElements.contains(r.element)), n = t === -1 ? e - 1 : t - 1;
      for (let r = n; r >= 0; r--) {
        const s = this.activeFormattingElements.entries[r];
        this._insertElement(s.token, this.treeAdapter.getNamespaceURI(s.element)), s.element = this.openElements.current;
      }
    }
  }
  //Close elements
  /** @protected */
  _closeTableCell() {
    this.openElements.generateImpliedEndTags(), this.openElements.popUntilTableCellPopped(), this.activeFormattingElements.clearToLastMarker(), this.insertionMode = Se.IN_ROW;
  }
  /** @protected */
  _closePElement() {
    this.openElements.generateImpliedEndTagsWithExclusion(P.P), this.openElements.popUntilTagNamePopped(P.P);
  }
  //Insertion modes
  /** @protected */
  _resetInsertionMode() {
    for (let e = this.openElements.stackTop; e >= 0; e--)
      switch (e === 0 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[e]) {
        case P.TR: {
          this.insertionMode = Se.IN_ROW;
          return;
        }
        case P.TBODY:
        case P.THEAD:
        case P.TFOOT: {
          this.insertionMode = Se.IN_TABLE_BODY;
          return;
        }
        case P.CAPTION: {
          this.insertionMode = Se.IN_CAPTION;
          return;
        }
        case P.COLGROUP: {
          this.insertionMode = Se.IN_COLUMN_GROUP;
          return;
        }
        case P.TABLE: {
          this.insertionMode = Se.IN_TABLE;
          return;
        }
        case P.BODY: {
          this.insertionMode = Se.IN_BODY;
          return;
        }
        case P.FRAMESET: {
          this.insertionMode = Se.IN_FRAMESET;
          return;
        }
        case P.SELECT: {
          this._resetInsertionModeForSelect(e);
          return;
        }
        case P.TEMPLATE: {
          this.insertionMode = this.tmplInsertionModeStack[0];
          return;
        }
        case P.HTML: {
          this.insertionMode = this.headElement ? Se.AFTER_HEAD : Se.BEFORE_HEAD;
          return;
        }
        case P.TD:
        case P.TH: {
          if (e > 0) {
            this.insertionMode = Se.IN_CELL;
            return;
          }
          break;
        }
        case P.HEAD: {
          if (e > 0) {
            this.insertionMode = Se.IN_HEAD;
            return;
          }
          break;
        }
      }
    this.insertionMode = Se.IN_BODY;
  }
  /** @protected */
  _resetInsertionModeForSelect(e) {
    if (e > 0)
      for (let t = e - 1; t > 0; t--) {
        const n = this.openElements.tagIDs[t];
        if (n === P.TEMPLATE)
          break;
        if (n === P.TABLE) {
          this.insertionMode = Se.IN_SELECT_IN_TABLE;
          return;
        }
      }
    this.insertionMode = Se.IN_SELECT;
  }
  //Foster parenting
  /** @protected */
  _isElementCausesFosterParenting(e) {
    return dHe.has(e);
  }
  /** @protected */
  _shouldFosterParentOnInsertion() {
    return this.fosterParentingEnabled && this.openElements.currentTagId !== void 0 && this._isElementCausesFosterParenting(this.openElements.currentTagId);
  }
  /** @protected */
  _findFosterParentingLocation() {
    for (let e = this.openElements.stackTop; e >= 0; e--) {
      const t = this.openElements.items[e];
      switch (this.openElements.tagIDs[e]) {
        case P.TEMPLATE: {
          if (this.treeAdapter.getNamespaceURI(t) === Rt.HTML)
            return { parent: this.treeAdapter.getTemplateContent(t), beforeElement: null };
          break;
        }
        case P.TABLE: {
          const n = this.treeAdapter.getParentNode(t);
          return n ? { parent: n, beforeElement: t } : { parent: this.openElements.items[e - 1], beforeElement: null };
        }
      }
    }
    return { parent: this.openElements.items[0], beforeElement: null };
  }
  /** @protected */
  _fosterParentElement(e) {
    const t = this._findFosterParentingLocation();
    t.beforeElement ? this.treeAdapter.insertBefore(t.parent, e, t.beforeElement) : this.treeAdapter.appendChild(t.parent, e);
  }
  //Special elements
  /** @protected */
  _isSpecialElement(e, t) {
    const n = this.treeAdapter.getNamespaceURI(e);
    return YBt[n].has(t);
  }
  /** @internal */
  onCharacter(e) {
    if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode) {
      s9t(this, e);
      return;
    }
    switch (this.insertionMode) {
      case Se.INITIAL: {
        wP(this, e);
        break;
      }
      case Se.BEFORE_HTML: {
        m3(this, e);
        break;
      }
      case Se.BEFORE_HEAD: {
        _3(this, e);
        break;
      }
      case Se.IN_HEAD: {
        b3(this, e);
        break;
      }
      case Se.IN_HEAD_NO_SCRIPT: {
        v3(this, e);
        break;
      }
      case Se.AFTER_HEAD: {
        y3(this, e);
        break;
      }
      case Se.IN_BODY:
      case Se.IN_CAPTION:
      case Se.IN_CELL:
      case Se.IN_TEMPLATE: {
        fHe(this, e);
        break;
      }
      case Se.TEXT:
      case Se.IN_SELECT:
      case Se.IN_SELECT_IN_TABLE: {
        this._insertCharacters(e);
        break;
      }
      case Se.IN_TABLE:
      case Se.IN_TABLE_BODY:
      case Se.IN_ROW: {
        sne(this, e);
        break;
      }
      case Se.IN_TABLE_TEXT: {
        vHe(this, e);
        break;
      }
      case Se.IN_COLUMN_GROUP: {
        V$(this, e);
        break;
      }
      case Se.AFTER_BODY: {
        U$(this, e);
        break;
      }
      case Se.AFTER_AFTER_BODY: {
        rV(this, e);
        break;
      }
    }
  }
  /** @internal */
  onNullCharacter(e) {
    if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode) {
      r9t(this, e);
      return;
    }
    switch (this.insertionMode) {
      case Se.INITIAL: {
        wP(this, e);
        break;
      }
      case Se.BEFORE_HTML: {
        m3(this, e);
        break;
      }
      case Se.BEFORE_HEAD: {
        _3(this, e);
        break;
      }
      case Se.IN_HEAD: {
        b3(this, e);
        break;
      }
      case Se.IN_HEAD_NO_SCRIPT: {
        v3(this, e);
        break;
      }
      case Se.AFTER_HEAD: {
        y3(this, e);
        break;
      }
      case Se.TEXT: {
        this._insertCharacters(e);
        break;
      }
      case Se.IN_TABLE:
      case Se.IN_TABLE_BODY:
      case Se.IN_ROW: {
        sne(this, e);
        break;
      }
      case Se.IN_COLUMN_GROUP: {
        V$(this, e);
        break;
      }
      case Se.AFTER_BODY: {
        U$(this, e);
        break;
      }
      case Se.AFTER_AFTER_BODY: {
        rV(this, e);
        break;
      }
    }
  }
  /** @internal */
  onComment(e) {
    if (this.skipNextNewLine = !1, this.currentNotInHTML) {
      gde(this, e);
      return;
    }
    switch (this.insertionMode) {
      case Se.INITIAL:
      case Se.BEFORE_HTML:
      case Se.BEFORE_HEAD:
      case Se.IN_HEAD:
      case Se.IN_HEAD_NO_SCRIPT:
      case Se.AFTER_HEAD:
      case Se.IN_BODY:
      case Se.IN_TABLE:
      case Se.IN_CAPTION:
      case Se.IN_COLUMN_GROUP:
      case Se.IN_TABLE_BODY:
      case Se.IN_ROW:
      case Se.IN_CELL:
      case Se.IN_SELECT:
      case Se.IN_SELECT_IN_TABLE:
      case Se.IN_TEMPLATE:
      case Se.IN_FRAMESET:
      case Se.AFTER_FRAMESET: {
        gde(this, e);
        break;
      }
      case Se.IN_TABLE_TEXT: {
        SP(this, e);
        break;
      }
      case Se.AFTER_BODY: {
        P6t(this, e);
        break;
      }
      case Se.AFTER_AFTER_BODY:
      case Se.AFTER_AFTER_FRAMESET: {
        F6t(this, e);
        break;
      }
    }
  }
  /** @internal */
  onDoctype(e) {
    switch (this.skipNextNewLine = !1, this.insertionMode) {
      case Se.INITIAL: {
        B6t(this, e);
        break;
      }
      case Se.BEFORE_HEAD:
      case Se.IN_HEAD:
      case Se.IN_HEAD_NO_SCRIPT:
      case Se.AFTER_HEAD: {
        this._err(e, ht.misplacedDoctype);
        break;
      }
      case Se.IN_TABLE_TEXT: {
        SP(this, e);
        break;
      }
    }
  }
  /** @internal */
  onStartTag(e) {
    this.skipNextNewLine = !1, this.currentToken = e, this._processStartTag(e), e.selfClosing && !e.ackSelfClosing && this._err(e, ht.nonVoidHtmlElementStartTagWithTrailingSolidus);
  }
  /**
   * Processes a given start tag.
   *
   * `onStartTag` checks if a self-closing tag was recognized. When a token
   * is moved inbetween multiple insertion modes, this check for self-closing
   * could lead to false positives. To avoid this, `_processStartTag` is used
   * for nested calls.
   *
   * @param token The token to process.
   * @protected
   */
  _processStartTag(e) {
    this.shouldProcessStartTagTokenInForeignContent(e) ? o9t(this, e) : this._startTagOutsideForeignContent(e);
  }
  /** @protected */
  _startTagOutsideForeignContent(e) {
    switch (this.insertionMode) {
      case Se.INITIAL: {
        wP(this, e);
        break;
      }
      case Se.BEFORE_HTML: {
        H6t(this, e);
        break;
      }
      case Se.BEFORE_HEAD: {
        V6t(this, e);
        break;
      }
      case Se.IN_HEAD: {
        xm(this, e);
        break;
      }
      case Se.IN_HEAD_NO_SCRIPT: {
        $6t(this, e);
        break;
      }
      case Se.AFTER_HEAD: {
        G6t(this, e);
        break;
      }
      case Se.IN_BODY: {
        ld(this, e);
        break;
      }
      case Se.IN_TABLE: {
        DA(this, e);
        break;
      }
      case Se.IN_TABLE_TEXT: {
        SP(this, e);
        break;
      }
      case Se.IN_CAPTION: {
        U8t(this, e);
        break;
      }
      case Se.IN_COLUMN_GROUP: {
        R0e(this, e);
        break;
      }
      case Se.IN_TABLE_BODY: {
        LY(this, e);
        break;
      }
      case Se.IN_ROW: {
        TY(this, e);
        break;
      }
      case Se.IN_CELL: {
        j8t(this, e);
        break;
      }
      case Se.IN_SELECT: {
        wHe(this, e);
        break;
      }
      case Se.IN_SELECT_IN_TABLE: {
        q8t(this, e);
        break;
      }
      case Se.IN_TEMPLATE: {
        Y8t(this, e);
        break;
      }
      case Se.AFTER_BODY: {
        Z8t(this, e);
        break;
      }
      case Se.IN_FRAMESET: {
        Q8t(this, e);
        break;
      }
      case Se.AFTER_FRAMESET: {
        e9t(this, e);
        break;
      }
      case Se.AFTER_AFTER_BODY: {
        n9t(this, e);
        break;
      }
      case Se.AFTER_AFTER_FRAMESET: {
        i9t(this, e);
        break;
      }
    }
  }
  /** @internal */
  onEndTag(e) {
    this.skipNextNewLine = !1, this.currentToken = e, this.currentNotInHTML ? a9t(this, e) : this._endTagOutsideForeignContent(e);
  }
  /** @protected */
  _endTagOutsideForeignContent(e) {
    switch (this.insertionMode) {
      case Se.INITIAL: {
        wP(this, e);
        break;
      }
      case Se.BEFORE_HTML: {
        W6t(this, e);
        break;
      }
      case Se.BEFORE_HEAD: {
        U6t(this, e);
        break;
      }
      case Se.IN_HEAD: {
        z6t(this, e);
        break;
      }
      case Se.IN_HEAD_NO_SCRIPT: {
        j6t(this, e);
        break;
      }
      case Se.AFTER_HEAD: {
        q6t(this, e);
        break;
      }
      case Se.IN_BODY: {
        xY(this, e);
        break;
      }
      case Se.TEXT: {
        R8t(this, e);
        break;
      }
      case Se.IN_TABLE: {
        G5(this, e);
        break;
      }
      case Se.IN_TABLE_TEXT: {
        SP(this, e);
        break;
      }
      case Se.IN_CAPTION: {
        z8t(this, e);
        break;
      }
      case Se.IN_COLUMN_GROUP: {
        $8t(this, e);
        break;
      }
      case Se.IN_TABLE_BODY: {
        pde(this, e);
        break;
      }
      case Se.IN_ROW: {
        CHe(this, e);
        break;
      }
      case Se.IN_CELL: {
        G8t(this, e);
        break;
      }
      case Se.IN_SELECT: {
        SHe(this, e);
        break;
      }
      case Se.IN_SELECT_IN_TABLE: {
        K8t(this, e);
        break;
      }
      case Se.IN_TEMPLATE: {
        X8t(this, e);
        break;
      }
      case Se.AFTER_BODY: {
        xHe(this, e);
        break;
      }
      case Se.IN_FRAMESET: {
        J8t(this, e);
        break;
      }
      case Se.AFTER_FRAMESET: {
        t9t(this, e);
        break;
      }
      case Se.AFTER_AFTER_BODY: {
        rV(this, e);
        break;
      }
    }
  }
  /** @internal */
  onEof(e) {
    switch (this.insertionMode) {
      case Se.INITIAL: {
        wP(this, e);
        break;
      }
      case Se.BEFORE_HTML: {
        m3(this, e);
        break;
      }
      case Se.BEFORE_HEAD: {
        _3(this, e);
        break;
      }
      case Se.IN_HEAD: {
        b3(this, e);
        break;
      }
      case Se.IN_HEAD_NO_SCRIPT: {
        v3(this, e);
        break;
      }
      case Se.AFTER_HEAD: {
        y3(this, e);
        break;
      }
      case Se.IN_BODY:
      case Se.IN_TABLE:
      case Se.IN_CAPTION:
      case Se.IN_COLUMN_GROUP:
      case Se.IN_TABLE_BODY:
      case Se.IN_ROW:
      case Se.IN_CELL:
      case Se.IN_SELECT:
      case Se.IN_SELECT_IN_TABLE: {
        _He(this, e);
        break;
      }
      case Se.TEXT: {
        A8t(this, e);
        break;
      }
      case Se.IN_TABLE_TEXT: {
        SP(this, e);
        break;
      }
      case Se.IN_TEMPLATE: {
        EHe(this, e);
        break;
      }
      case Se.AFTER_BODY:
      case Se.IN_FRAMESET:
      case Se.AFTER_FRAMESET:
      case Se.AFTER_AFTER_BODY:
      case Se.AFTER_AFTER_FRAMESET: {
        N0e(this, e);
        break;
      }
    }
  }
  /** @internal */
  onWhitespaceCharacter(e) {
    if (this.skipNextNewLine && (this.skipNextNewLine = !1, e.chars.charCodeAt(0) === _e.LINE_FEED)) {
      if (e.chars.length === 1)
        return;
      e.chars = e.chars.substr(1);
    }
    if (this.tokenizer.inForeignNode) {
      this._insertCharacters(e);
      return;
    }
    switch (this.insertionMode) {
      case Se.IN_HEAD:
      case Se.IN_HEAD_NO_SCRIPT:
      case Se.AFTER_HEAD:
      case Se.TEXT:
      case Se.IN_COLUMN_GROUP:
      case Se.IN_SELECT:
      case Se.IN_SELECT_IN_TABLE:
      case Se.IN_FRAMESET:
      case Se.AFTER_FRAMESET: {
        this._insertCharacters(e);
        break;
      }
      case Se.IN_BODY:
      case Se.IN_CAPTION:
      case Se.IN_CELL:
      case Se.IN_TEMPLATE:
      case Se.AFTER_BODY:
      case Se.AFTER_AFTER_BODY:
      case Se.AFTER_AFTER_FRAMESET: {
        hHe(this, e);
        break;
      }
      case Se.IN_TABLE:
      case Se.IN_TABLE_BODY:
      case Se.IN_ROW: {
        sne(this, e);
        break;
      }
      case Se.IN_TABLE_TEXT: {
        bHe(this, e);
        break;
      }
    }
  }
}
function I6t(i, e) {
  let t = i.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);
  return t ? i.openElements.contains(t.element) ? i.openElements.hasInScope(e.tagID) || (t = null) : (i.activeFormattingElements.removeEntry(t), t = null) : mHe(i, e), t;
}
function N6t(i, e) {
  let t = null, n = i.openElements.stackTop;
  for (; n >= 0; n--) {
    const r = i.openElements.items[n];
    if (r === e.element)
      break;
    i._isSpecialElement(r, i.openElements.tagIDs[n]) && (t = r);
  }
  return t || (i.openElements.shortenToLength(Math.max(n, 0)), i.activeFormattingElements.removeEntry(e)), t;
}
function R6t(i, e, t) {
  let n = e, r = i.openElements.getCommonAncestor(e);
  for (let s = 0, o = r; o !== t; s++, o = r) {
    r = i.openElements.getCommonAncestor(o);
    const a = i.activeFormattingElements.getElementEntry(o), l = a && s >= k6t;
    !a || l ? (l && i.activeFormattingElements.removeEntry(a), i.openElements.remove(o)) : (o = A6t(i, a), n === e && (i.activeFormattingElements.bookmark = a), i.treeAdapter.detachNode(n), i.treeAdapter.appendChild(o, n), n = o);
  }
  return n;
}
function A6t(i, e) {
  const t = i.treeAdapter.getNamespaceURI(e.element), n = i.treeAdapter.createElement(e.token.tagName, t, e.token.attrs);
  return i.openElements.replace(e.element, n), e.element = n, n;
}
function O6t(i, e, t) {
  const n = i.treeAdapter.getTagName(e), r = E2(n);
  if (i._isElementCausesFosterParenting(r))
    i._fosterParentElement(t);
  else {
    const s = i.treeAdapter.getNamespaceURI(e);
    r === P.TEMPLATE && s === Rt.HTML && (e = i.treeAdapter.getTemplateContent(e)), i.treeAdapter.appendChild(e, t);
  }
}
function M6t(i, e, t) {
  const n = i.treeAdapter.getNamespaceURI(t.element), { token: r } = t, s = i.treeAdapter.createElement(r.tagName, n, r.attrs);
  i._adoptNodes(e, s), i.treeAdapter.appendChild(e, s), i.activeFormattingElements.insertElementAfterBookmark(s, r), i.activeFormattingElements.removeEntry(t), i.openElements.remove(t.element), i.openElements.insertAfter(e, s, r.tagID);
}
function I0e(i, e) {
  for (let t = 0; t < T6t; t++) {
    const n = I6t(i, e);
    if (!n)
      break;
    const r = N6t(i, n);
    if (!r)
      break;
    i.activeFormattingElements.bookmark = n;
    const s = R6t(i, r, n.element), o = i.openElements.getCommonAncestor(n.element);
    i.treeAdapter.detachNode(s), o && O6t(i, o, s), M6t(i, r, n);
  }
}
function gde(i, e) {
  i._appendCommentNode(e, i.openElements.currentTmplContentOrNode);
}
function P6t(i, e) {
  i._appendCommentNode(e, i.openElements.items[0]);
}
function F6t(i, e) {
  i._appendCommentNode(e, i.document);
}
function N0e(i, e) {
  if (i.stopped = !0, e.location) {
    const t = i.fragmentContext ? 0 : 2;
    for (let n = i.openElements.stackTop; n >= t; n--)
      i._setEndLocation(i.openElements.items[n], e);
    if (!i.fragmentContext && i.openElements.stackTop >= 0) {
      const n = i.openElements.items[0], r = i.treeAdapter.getNodeSourceCodeLocation(n);
      if (r && !r.endTag && (i._setEndLocation(n, e), i.openElements.stackTop >= 1)) {
        const s = i.openElements.items[1], o = i.treeAdapter.getNodeSourceCodeLocation(s);
        o && !o.endTag && i._setEndLocation(s, e);
      }
    }
  }
}
function B6t(i, e) {
  i._setDocumentType(e);
  const t = e.forceQuirks ? Bg.QUIRKS : g6t(e);
  f6t(e) || i._err(e, ht.nonConformingDoctype), i.treeAdapter.setDocumentMode(i.document, t), i.insertionMode = Se.BEFORE_HTML;
}
function wP(i, e) {
  i._err(e, ht.missingDoctype, !0), i.treeAdapter.setDocumentMode(i.document, Bg.QUIRKS), i.insertionMode = Se.BEFORE_HTML, i._processToken(e);
}
function H6t(i, e) {
  e.tagID === P.HTML ? (i._insertElement(e, Rt.HTML), i.insertionMode = Se.BEFORE_HEAD) : m3(i, e);
}
function W6t(i, e) {
  const t = e.tagID;
  (t === P.HTML || t === P.HEAD || t === P.BODY || t === P.BR) && m3(i, e);
}
function m3(i, e) {
  i._insertFakeRootElement(), i.insertionMode = Se.BEFORE_HEAD, i._processToken(e);
}
function V6t(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.HEAD: {
      i._insertElement(e, Rt.HTML), i.headElement = i.openElements.current, i.insertionMode = Se.IN_HEAD;
      break;
    }
    default:
      _3(i, e);
  }
}
function U6t(i, e) {
  const t = e.tagID;
  t === P.HEAD || t === P.BODY || t === P.HTML || t === P.BR ? _3(i, e) : i._err(e, ht.endTagWithoutMatchingOpenElement);
}
function _3(i, e) {
  i._insertFakeElement(Ye.HEAD, P.HEAD), i.headElement = i.openElements.current, i.insertionMode = Se.IN_HEAD, i._processToken(e);
}
function xm(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.BASE:
    case P.BASEFONT:
    case P.BGSOUND:
    case P.LINK:
    case P.META: {
      i._appendElement(e, Rt.HTML), e.ackSelfClosing = !0;
      break;
    }
    case P.TITLE: {
      i._switchToTextParsing(e, qa.RCDATA);
      break;
    }
    case P.NOSCRIPT: {
      i.options.scriptingEnabled ? i._switchToTextParsing(e, qa.RAWTEXT) : (i._insertElement(e, Rt.HTML), i.insertionMode = Se.IN_HEAD_NO_SCRIPT);
      break;
    }
    case P.NOFRAMES:
    case P.STYLE: {
      i._switchToTextParsing(e, qa.RAWTEXT);
      break;
    }
    case P.SCRIPT: {
      i._switchToTextParsing(e, qa.SCRIPT_DATA);
      break;
    }
    case P.TEMPLATE: {
      i._insertTemplate(e), i.activeFormattingElements.insertMarker(), i.framesetOk = !1, i.insertionMode = Se.IN_TEMPLATE, i.tmplInsertionModeStack.unshift(Se.IN_TEMPLATE);
      break;
    }
    case P.HEAD: {
      i._err(e, ht.misplacedStartTagForHeadElement);
      break;
    }
    default:
      b3(i, e);
  }
}
function z6t(i, e) {
  switch (e.tagID) {
    case P.HEAD: {
      i.openElements.pop(), i.insertionMode = Se.AFTER_HEAD;
      break;
    }
    case P.BODY:
    case P.BR:
    case P.HTML: {
      b3(i, e);
      break;
    }
    case P.TEMPLATE: {
      pk(i, e);
      break;
    }
    default:
      i._err(e, ht.endTagWithoutMatchingOpenElement);
  }
}
function pk(i, e) {
  i.openElements.tmplCount > 0 ? (i.openElements.generateImpliedEndTagsThoroughly(), i.openElements.currentTagId !== P.TEMPLATE && i._err(e, ht.closingOfElementWithOpenChildElements), i.openElements.popUntilTagNamePopped(P.TEMPLATE), i.activeFormattingElements.clearToLastMarker(), i.tmplInsertionModeStack.shift(), i._resetInsertionMode()) : i._err(e, ht.endTagWithoutMatchingOpenElement);
}
function b3(i, e) {
  i.openElements.pop(), i.insertionMode = Se.AFTER_HEAD, i._processToken(e);
}
function $6t(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.BASEFONT:
    case P.BGSOUND:
    case P.HEAD:
    case P.LINK:
    case P.META:
    case P.NOFRAMES:
    case P.STYLE: {
      xm(i, e);
      break;
    }
    case P.NOSCRIPT: {
      i._err(e, ht.nestedNoscriptInHead);
      break;
    }
    default:
      v3(i, e);
  }
}
function j6t(i, e) {
  switch (e.tagID) {
    case P.NOSCRIPT: {
      i.openElements.pop(), i.insertionMode = Se.IN_HEAD;
      break;
    }
    case P.BR: {
      v3(i, e);
      break;
    }
    default:
      i._err(e, ht.endTagWithoutMatchingOpenElement);
  }
}
function v3(i, e) {
  const t = e.type === Dr.EOF ? ht.openElementsLeftAfterEof : ht.disallowedContentInNoscriptInHead;
  i._err(e, t), i.openElements.pop(), i.insertionMode = Se.IN_HEAD, i._processToken(e);
}
function G6t(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.BODY: {
      i._insertElement(e, Rt.HTML), i.framesetOk = !1, i.insertionMode = Se.IN_BODY;
      break;
    }
    case P.FRAMESET: {
      i._insertElement(e, Rt.HTML), i.insertionMode = Se.IN_FRAMESET;
      break;
    }
    case P.BASE:
    case P.BASEFONT:
    case P.BGSOUND:
    case P.LINK:
    case P.META:
    case P.NOFRAMES:
    case P.SCRIPT:
    case P.STYLE:
    case P.TEMPLATE:
    case P.TITLE: {
      i._err(e, ht.abandonedHeadElementChild), i.openElements.push(i.headElement, P.HEAD), xm(i, e), i.openElements.remove(i.headElement);
      break;
    }
    case P.HEAD: {
      i._err(e, ht.misplacedStartTagForHeadElement);
      break;
    }
    default:
      y3(i, e);
  }
}
function q6t(i, e) {
  switch (e.tagID) {
    case P.BODY:
    case P.HTML:
    case P.BR: {
      y3(i, e);
      break;
    }
    case P.TEMPLATE: {
      pk(i, e);
      break;
    }
    default:
      i._err(e, ht.endTagWithoutMatchingOpenElement);
  }
}
function y3(i, e) {
  i._insertFakeElement(Ye.BODY, P.BODY), i.insertionMode = Se.IN_BODY, EY(i, e);
}
function EY(i, e) {
  switch (e.type) {
    case Dr.CHARACTER: {
      fHe(i, e);
      break;
    }
    case Dr.WHITESPACE_CHARACTER: {
      hHe(i, e);
      break;
    }
    case Dr.COMMENT: {
      gde(i, e);
      break;
    }
    case Dr.START_TAG: {
      ld(i, e);
      break;
    }
    case Dr.END_TAG: {
      xY(i, e);
      break;
    }
    case Dr.EOF: {
      _He(i, e);
      break;
    }
  }
}
function hHe(i, e) {
  i._reconstructActiveFormattingElements(), i._insertCharacters(e);
}
function fHe(i, e) {
  i._reconstructActiveFormattingElements(), i._insertCharacters(e), i.framesetOk = !1;
}
function K6t(i, e) {
  i.openElements.tmplCount === 0 && i.treeAdapter.adoptAttributes(i.openElements.items[0], e.attrs);
}
function Y6t(i, e) {
  const t = i.openElements.tryPeekProperlyNestedBodyElement();
  t && i.openElements.tmplCount === 0 && (i.framesetOk = !1, i.treeAdapter.adoptAttributes(t, e.attrs));
}
function X6t(i, e) {
  const t = i.openElements.tryPeekProperlyNestedBodyElement();
  i.framesetOk && t && (i.treeAdapter.detachNode(t), i.openElements.popAllUpToHtmlElement(), i._insertElement(e, Rt.HTML), i.insertionMode = Se.IN_FRAMESET);
}
function Z6t(i, e) {
  i.openElements.hasInButtonScope(P.P) && i._closePElement(), i._insertElement(e, Rt.HTML);
}
function Q6t(i, e) {
  i.openElements.hasInButtonScope(P.P) && i._closePElement(), i.openElements.currentTagId !== void 0 && fde.has(i.openElements.currentTagId) && i.openElements.pop(), i._insertElement(e, Rt.HTML);
}
function J6t(i, e) {
  i.openElements.hasInButtonScope(P.P) && i._closePElement(), i._insertElement(e, Rt.HTML), i.skipNextNewLine = !0, i.framesetOk = !1;
}
function e8t(i, e) {
  const t = i.openElements.tmplCount > 0;
  (!i.formElement || t) && (i.openElements.hasInButtonScope(P.P) && i._closePElement(), i._insertElement(e, Rt.HTML), t || (i.formElement = i.openElements.current));
}
function t8t(i, e) {
  i.framesetOk = !1;
  const t = e.tagID;
  for (let n = i.openElements.stackTop; n >= 0; n--) {
    const r = i.openElements.tagIDs[n];
    if (t === P.LI && r === P.LI || (t === P.DD || t === P.DT) && (r === P.DD || r === P.DT)) {
      i.openElements.generateImpliedEndTagsWithExclusion(r), i.openElements.popUntilTagNamePopped(r);
      break;
    }
    if (r !== P.ADDRESS && r !== P.DIV && r !== P.P && i._isSpecialElement(i.openElements.items[n], r))
      break;
  }
  i.openElements.hasInButtonScope(P.P) && i._closePElement(), i._insertElement(e, Rt.HTML);
}
function n8t(i, e) {
  i.openElements.hasInButtonScope(P.P) && i._closePElement(), i._insertElement(e, Rt.HTML), i.tokenizer.state = qa.PLAINTEXT;
}
function i8t(i, e) {
  i.openElements.hasInScope(P.BUTTON) && (i.openElements.generateImpliedEndTags(), i.openElements.popUntilTagNamePopped(P.BUTTON)), i._reconstructActiveFormattingElements(), i._insertElement(e, Rt.HTML), i.framesetOk = !1;
}
function r8t(i, e) {
  const t = i.activeFormattingElements.getElementEntryInScopeWithTagName(Ye.A);
  t && (I0e(i, e), i.openElements.remove(t.element), i.activeFormattingElements.removeEntry(t)), i._reconstructActiveFormattingElements(), i._insertElement(e, Rt.HTML), i.activeFormattingElements.pushElement(i.openElements.current, e);
}
function s8t(i, e) {
  i._reconstructActiveFormattingElements(), i._insertElement(e, Rt.HTML), i.activeFormattingElements.pushElement(i.openElements.current, e);
}
function o8t(i, e) {
  i._reconstructActiveFormattingElements(), i.openElements.hasInScope(P.NOBR) && (I0e(i, e), i._reconstructActiveFormattingElements()), i._insertElement(e, Rt.HTML), i.activeFormattingElements.pushElement(i.openElements.current, e);
}
function a8t(i, e) {
  i._reconstructActiveFormattingElements(), i._insertElement(e, Rt.HTML), i.activeFormattingElements.insertMarker(), i.framesetOk = !1;
}
function l8t(i, e) {
  i.treeAdapter.getDocumentMode(i.document) !== Bg.QUIRKS && i.openElements.hasInButtonScope(P.P) && i._closePElement(), i._insertElement(e, Rt.HTML), i.framesetOk = !1, i.insertionMode = Se.IN_TABLE;
}
function gHe(i, e) {
  i._reconstructActiveFormattingElements(), i._appendElement(e, Rt.HTML), i.framesetOk = !1, e.ackSelfClosing = !0;
}
function pHe(i) {
  const e = iHe(i, Yx.TYPE);
  return e != null && e.toLowerCase() === L6t;
}
function c8t(i, e) {
  i._reconstructActiveFormattingElements(), i._appendElement(e, Rt.HTML), pHe(e) || (i.framesetOk = !1), e.ackSelfClosing = !0;
}
function u8t(i, e) {
  i._appendElement(e, Rt.HTML), e.ackSelfClosing = !0;
}
function d8t(i, e) {
  i.openElements.hasInButtonScope(P.P) && i._closePElement(), i._appendElement(e, Rt.HTML), i.framesetOk = !1, e.ackSelfClosing = !0;
}
function h8t(i, e) {
  e.tagName = Ye.IMG, e.tagID = P.IMG, gHe(i, e);
}
function f8t(i, e) {
  i._insertElement(e, Rt.HTML), i.skipNextNewLine = !0, i.tokenizer.state = qa.RCDATA, i.originalInsertionMode = i.insertionMode, i.framesetOk = !1, i.insertionMode = Se.TEXT;
}
function g8t(i, e) {
  i.openElements.hasInButtonScope(P.P) && i._closePElement(), i._reconstructActiveFormattingElements(), i.framesetOk = !1, i._switchToTextParsing(e, qa.RAWTEXT);
}
function p8t(i, e) {
  i.framesetOk = !1, i._switchToTextParsing(e, qa.RAWTEXT);
}
function DAe(i, e) {
  i._switchToTextParsing(e, qa.RAWTEXT);
}
function m8t(i, e) {
  i._reconstructActiveFormattingElements(), i._insertElement(e, Rt.HTML), i.framesetOk = !1, i.insertionMode = i.insertionMode === Se.IN_TABLE || i.insertionMode === Se.IN_CAPTION || i.insertionMode === Se.IN_TABLE_BODY || i.insertionMode === Se.IN_ROW || i.insertionMode === Se.IN_CELL ? Se.IN_SELECT_IN_TABLE : Se.IN_SELECT;
}
function _8t(i, e) {
  i.openElements.currentTagId === P.OPTION && i.openElements.pop(), i._reconstructActiveFormattingElements(), i._insertElement(e, Rt.HTML);
}
function b8t(i, e) {
  i.openElements.hasInScope(P.RUBY) && i.openElements.generateImpliedEndTags(), i._insertElement(e, Rt.HTML);
}
function v8t(i, e) {
  i.openElements.hasInScope(P.RUBY) && i.openElements.generateImpliedEndTagsWithExclusion(P.RTC), i._insertElement(e, Rt.HTML);
}
function y8t(i, e) {
  i._reconstructActiveFormattingElements(), cHe(e), D0e(e), e.selfClosing ? i._appendElement(e, Rt.MATHML) : i._insertElement(e, Rt.MATHML), e.ackSelfClosing = !0;
}
function C8t(i, e) {
  i._reconstructActiveFormattingElements(), uHe(e), D0e(e), e.selfClosing ? i._appendElement(e, Rt.SVG) : i._insertElement(e, Rt.SVG), e.ackSelfClosing = !0;
}
function IAe(i, e) {
  i._reconstructActiveFormattingElements(), i._insertElement(e, Rt.HTML);
}
function ld(i, e) {
  switch (e.tagID) {
    case P.I:
    case P.S:
    case P.B:
    case P.U:
    case P.EM:
    case P.TT:
    case P.BIG:
    case P.CODE:
    case P.FONT:
    case P.SMALL:
    case P.STRIKE:
    case P.STRONG: {
      s8t(i, e);
      break;
    }
    case P.A: {
      r8t(i, e);
      break;
    }
    case P.H1:
    case P.H2:
    case P.H3:
    case P.H4:
    case P.H5:
    case P.H6: {
      Q6t(i, e);
      break;
    }
    case P.P:
    case P.DL:
    case P.OL:
    case P.UL:
    case P.DIV:
    case P.DIR:
    case P.NAV:
    case P.MAIN:
    case P.MENU:
    case P.ASIDE:
    case P.CENTER:
    case P.FIGURE:
    case P.FOOTER:
    case P.HEADER:
    case P.HGROUP:
    case P.DIALOG:
    case P.DETAILS:
    case P.ADDRESS:
    case P.ARTICLE:
    case P.SEARCH:
    case P.SECTION:
    case P.SUMMARY:
    case P.FIELDSET:
    case P.BLOCKQUOTE:
    case P.FIGCAPTION: {
      Z6t(i, e);
      break;
    }
    case P.LI:
    case P.DD:
    case P.DT: {
      t8t(i, e);
      break;
    }
    case P.BR:
    case P.IMG:
    case P.WBR:
    case P.AREA:
    case P.EMBED:
    case P.KEYGEN: {
      gHe(i, e);
      break;
    }
    case P.HR: {
      d8t(i, e);
      break;
    }
    case P.RB:
    case P.RTC: {
      b8t(i, e);
      break;
    }
    case P.RT:
    case P.RP: {
      v8t(i, e);
      break;
    }
    case P.PRE:
    case P.LISTING: {
      J6t(i, e);
      break;
    }
    case P.XMP: {
      g8t(i, e);
      break;
    }
    case P.SVG: {
      C8t(i, e);
      break;
    }
    case P.HTML: {
      K6t(i, e);
      break;
    }
    case P.BASE:
    case P.LINK:
    case P.META:
    case P.STYLE:
    case P.TITLE:
    case P.SCRIPT:
    case P.BGSOUND:
    case P.BASEFONT:
    case P.TEMPLATE: {
      xm(i, e);
      break;
    }
    case P.BODY: {
      Y6t(i, e);
      break;
    }
    case P.FORM: {
      e8t(i, e);
      break;
    }
    case P.NOBR: {
      o8t(i, e);
      break;
    }
    case P.MATH: {
      y8t(i, e);
      break;
    }
    case P.TABLE: {
      l8t(i, e);
      break;
    }
    case P.INPUT: {
      c8t(i, e);
      break;
    }
    case P.PARAM:
    case P.TRACK:
    case P.SOURCE: {
      u8t(i, e);
      break;
    }
    case P.IMAGE: {
      h8t(i, e);
      break;
    }
    case P.BUTTON: {
      i8t(i, e);
      break;
    }
    case P.APPLET:
    case P.OBJECT:
    case P.MARQUEE: {
      a8t(i, e);
      break;
    }
    case P.IFRAME: {
      p8t(i, e);
      break;
    }
    case P.SELECT: {
      m8t(i, e);
      break;
    }
    case P.OPTION:
    case P.OPTGROUP: {
      _8t(i, e);
      break;
    }
    case P.NOEMBED:
    case P.NOFRAMES: {
      DAe(i, e);
      break;
    }
    case P.FRAMESET: {
      X6t(i, e);
      break;
    }
    case P.TEXTAREA: {
      f8t(i, e);
      break;
    }
    case P.NOSCRIPT: {
      i.options.scriptingEnabled ? DAe(i, e) : IAe(i, e);
      break;
    }
    case P.PLAINTEXT: {
      n8t(i, e);
      break;
    }
    case P.COL:
    case P.TH:
    case P.TD:
    case P.TR:
    case P.HEAD:
    case P.FRAME:
    case P.TBODY:
    case P.TFOOT:
    case P.THEAD:
    case P.CAPTION:
    case P.COLGROUP:
      break;
    default:
      IAe(i, e);
  }
}
function w8t(i, e) {
  if (i.openElements.hasInScope(P.BODY) && (i.insertionMode = Se.AFTER_BODY, i.options.sourceCodeLocationInfo)) {
    const t = i.openElements.tryPeekProperlyNestedBodyElement();
    t && i._setEndLocation(t, e);
  }
}
function S8t(i, e) {
  i.openElements.hasInScope(P.BODY) && (i.insertionMode = Se.AFTER_BODY, xHe(i, e));
}
function E8t(i, e) {
  const t = e.tagID;
  i.openElements.hasInScope(t) && (i.openElements.generateImpliedEndTags(), i.openElements.popUntilTagNamePopped(t));
}
function x8t(i) {
  const e = i.openElements.tmplCount > 0, { formElement: t } = i;
  e || (i.formElement = null), (t || e) && i.openElements.hasInScope(P.FORM) && (i.openElements.generateImpliedEndTags(), e ? i.openElements.popUntilTagNamePopped(P.FORM) : t && i.openElements.remove(t));
}
function L8t(i) {
  i.openElements.hasInButtonScope(P.P) || i._insertFakeElement(Ye.P, P.P), i._closePElement();
}
function T8t(i) {
  i.openElements.hasInListItemScope(P.LI) && (i.openElements.generateImpliedEndTagsWithExclusion(P.LI), i.openElements.popUntilTagNamePopped(P.LI));
}
function k8t(i, e) {
  const t = e.tagID;
  i.openElements.hasInScope(t) && (i.openElements.generateImpliedEndTagsWithExclusion(t), i.openElements.popUntilTagNamePopped(t));
}
function D8t(i) {
  i.openElements.hasNumberedHeaderInScope() && (i.openElements.generateImpliedEndTags(), i.openElements.popUntilNumberedHeaderPopped());
}
function I8t(i, e) {
  const t = e.tagID;
  i.openElements.hasInScope(t) && (i.openElements.generateImpliedEndTags(), i.openElements.popUntilTagNamePopped(t), i.activeFormattingElements.clearToLastMarker());
}
function N8t(i) {
  i._reconstructActiveFormattingElements(), i._insertFakeElement(Ye.BR, P.BR), i.openElements.pop(), i.framesetOk = !1;
}
function mHe(i, e) {
  const t = e.tagName, n = e.tagID;
  for (let r = i.openElements.stackTop; r > 0; r--) {
    const s = i.openElements.items[r], o = i.openElements.tagIDs[r];
    if (n === o && (n !== P.UNKNOWN || i.treeAdapter.getTagName(s) === t)) {
      i.openElements.generateImpliedEndTagsWithExclusion(n), i.openElements.stackTop >= r && i.openElements.shortenToLength(r);
      break;
    }
    if (i._isSpecialElement(s, o))
      break;
  }
}
function xY(i, e) {
  switch (e.tagID) {
    case P.A:
    case P.B:
    case P.I:
    case P.S:
    case P.U:
    case P.EM:
    case P.TT:
    case P.BIG:
    case P.CODE:
    case P.FONT:
    case P.NOBR:
    case P.SMALL:
    case P.STRIKE:
    case P.STRONG: {
      I0e(i, e);
      break;
    }
    case P.P: {
      L8t(i);
      break;
    }
    case P.DL:
    case P.UL:
    case P.OL:
    case P.DIR:
    case P.DIV:
    case P.NAV:
    case P.PRE:
    case P.MAIN:
    case P.MENU:
    case P.ASIDE:
    case P.BUTTON:
    case P.CENTER:
    case P.FIGURE:
    case P.FOOTER:
    case P.HEADER:
    case P.HGROUP:
    case P.DIALOG:
    case P.ADDRESS:
    case P.ARTICLE:
    case P.DETAILS:
    case P.SEARCH:
    case P.SECTION:
    case P.SUMMARY:
    case P.LISTING:
    case P.FIELDSET:
    case P.BLOCKQUOTE:
    case P.FIGCAPTION: {
      E8t(i, e);
      break;
    }
    case P.LI: {
      T8t(i);
      break;
    }
    case P.DD:
    case P.DT: {
      k8t(i, e);
      break;
    }
    case P.H1:
    case P.H2:
    case P.H3:
    case P.H4:
    case P.H5:
    case P.H6: {
      D8t(i);
      break;
    }
    case P.BR: {
      N8t(i);
      break;
    }
    case P.BODY: {
      w8t(i, e);
      break;
    }
    case P.HTML: {
      S8t(i, e);
      break;
    }
    case P.FORM: {
      x8t(i);
      break;
    }
    case P.APPLET:
    case P.OBJECT:
    case P.MARQUEE: {
      I8t(i, e);
      break;
    }
    case P.TEMPLATE: {
      pk(i, e);
      break;
    }
    default:
      mHe(i, e);
  }
}
function _He(i, e) {
  i.tmplInsertionModeStack.length > 0 ? EHe(i, e) : N0e(i, e);
}
function R8t(i, e) {
  var t;
  e.tagID === P.SCRIPT && ((t = i.scriptHandler) === null || t === void 0 || t.call(i, i.openElements.current)), i.openElements.pop(), i.insertionMode = i.originalInsertionMode;
}
function A8t(i, e) {
  i._err(e, ht.eofInElementThatCanContainOnlyText), i.openElements.pop(), i.insertionMode = i.originalInsertionMode, i.onEof(e);
}
function sne(i, e) {
  if (i.openElements.currentTagId !== void 0 && dHe.has(i.openElements.currentTagId))
    switch (i.pendingCharacterTokens.length = 0, i.hasNonWhitespacePendingCharacterToken = !1, i.originalInsertionMode = i.insertionMode, i.insertionMode = Se.IN_TABLE_TEXT, e.type) {
      case Dr.CHARACTER: {
        vHe(i, e);
        break;
      }
      case Dr.WHITESPACE_CHARACTER: {
        bHe(i, e);
        break;
      }
    }
  else
    f6(i, e);
}
function O8t(i, e) {
  i.openElements.clearBackToTableContext(), i.activeFormattingElements.insertMarker(), i._insertElement(e, Rt.HTML), i.insertionMode = Se.IN_CAPTION;
}
function M8t(i, e) {
  i.openElements.clearBackToTableContext(), i._insertElement(e, Rt.HTML), i.insertionMode = Se.IN_COLUMN_GROUP;
}
function P8t(i, e) {
  i.openElements.clearBackToTableContext(), i._insertFakeElement(Ye.COLGROUP, P.COLGROUP), i.insertionMode = Se.IN_COLUMN_GROUP, R0e(i, e);
}
function F8t(i, e) {
  i.openElements.clearBackToTableContext(), i._insertElement(e, Rt.HTML), i.insertionMode = Se.IN_TABLE_BODY;
}
function B8t(i, e) {
  i.openElements.clearBackToTableContext(), i._insertFakeElement(Ye.TBODY, P.TBODY), i.insertionMode = Se.IN_TABLE_BODY, LY(i, e);
}
function H8t(i, e) {
  i.openElements.hasInTableScope(P.TABLE) && (i.openElements.popUntilTagNamePopped(P.TABLE), i._resetInsertionMode(), i._processStartTag(e));
}
function W8t(i, e) {
  pHe(e) ? i._appendElement(e, Rt.HTML) : f6(i, e), e.ackSelfClosing = !0;
}
function V8t(i, e) {
  !i.formElement && i.openElements.tmplCount === 0 && (i._insertElement(e, Rt.HTML), i.formElement = i.openElements.current, i.openElements.pop());
}
function DA(i, e) {
  switch (e.tagID) {
    case P.TD:
    case P.TH:
    case P.TR: {
      B8t(i, e);
      break;
    }
    case P.STYLE:
    case P.SCRIPT:
    case P.TEMPLATE: {
      xm(i, e);
      break;
    }
    case P.COL: {
      P8t(i, e);
      break;
    }
    case P.FORM: {
      V8t(i, e);
      break;
    }
    case P.TABLE: {
      H8t(i, e);
      break;
    }
    case P.TBODY:
    case P.TFOOT:
    case P.THEAD: {
      F8t(i, e);
      break;
    }
    case P.INPUT: {
      W8t(i, e);
      break;
    }
    case P.CAPTION: {
      O8t(i, e);
      break;
    }
    case P.COLGROUP: {
      M8t(i, e);
      break;
    }
    default:
      f6(i, e);
  }
}
function G5(i, e) {
  switch (e.tagID) {
    case P.TABLE: {
      i.openElements.hasInTableScope(P.TABLE) && (i.openElements.popUntilTagNamePopped(P.TABLE), i._resetInsertionMode());
      break;
    }
    case P.TEMPLATE: {
      pk(i, e);
      break;
    }
    case P.BODY:
    case P.CAPTION:
    case P.COL:
    case P.COLGROUP:
    case P.HTML:
    case P.TBODY:
    case P.TD:
    case P.TFOOT:
    case P.TH:
    case P.THEAD:
    case P.TR:
      break;
    default:
      f6(i, e);
  }
}
function f6(i, e) {
  const t = i.fosterParentingEnabled;
  i.fosterParentingEnabled = !0, EY(i, e), i.fosterParentingEnabled = t;
}
function bHe(i, e) {
  i.pendingCharacterTokens.push(e);
}
function vHe(i, e) {
  i.pendingCharacterTokens.push(e), i.hasNonWhitespacePendingCharacterToken = !0;
}
function SP(i, e) {
  let t = 0;
  if (i.hasNonWhitespacePendingCharacterToken)
    for (; t < i.pendingCharacterTokens.length; t++)
      f6(i, i.pendingCharacterTokens[t]);
  else
    for (; t < i.pendingCharacterTokens.length; t++)
      i._insertCharacters(i.pendingCharacterTokens[t]);
  i.insertionMode = i.originalInsertionMode, i._processToken(e);
}
const yHe = /* @__PURE__ */ new Set([P.CAPTION, P.COL, P.COLGROUP, P.TBODY, P.TD, P.TFOOT, P.TH, P.THEAD, P.TR]);
function U8t(i, e) {
  const t = e.tagID;
  yHe.has(t) ? i.openElements.hasInTableScope(P.CAPTION) && (i.openElements.generateImpliedEndTags(), i.openElements.popUntilTagNamePopped(P.CAPTION), i.activeFormattingElements.clearToLastMarker(), i.insertionMode = Se.IN_TABLE, DA(i, e)) : ld(i, e);
}
function z8t(i, e) {
  const t = e.tagID;
  switch (t) {
    case P.CAPTION:
    case P.TABLE: {
      i.openElements.hasInTableScope(P.CAPTION) && (i.openElements.generateImpliedEndTags(), i.openElements.popUntilTagNamePopped(P.CAPTION), i.activeFormattingElements.clearToLastMarker(), i.insertionMode = Se.IN_TABLE, t === P.TABLE && G5(i, e));
      break;
    }
    case P.BODY:
    case P.COL:
    case P.COLGROUP:
    case P.HTML:
    case P.TBODY:
    case P.TD:
    case P.TFOOT:
    case P.TH:
    case P.THEAD:
    case P.TR:
      break;
    default:
      xY(i, e);
  }
}
function R0e(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.COL: {
      i._appendElement(e, Rt.HTML), e.ackSelfClosing = !0;
      break;
    }
    case P.TEMPLATE: {
      xm(i, e);
      break;
    }
    default:
      V$(i, e);
  }
}
function $8t(i, e) {
  switch (e.tagID) {
    case P.COLGROUP: {
      i.openElements.currentTagId === P.COLGROUP && (i.openElements.pop(), i.insertionMode = Se.IN_TABLE);
      break;
    }
    case P.TEMPLATE: {
      pk(i, e);
      break;
    }
    case P.COL:
      break;
    default:
      V$(i, e);
  }
}
function V$(i, e) {
  i.openElements.currentTagId === P.COLGROUP && (i.openElements.pop(), i.insertionMode = Se.IN_TABLE, i._processToken(e));
}
function LY(i, e) {
  switch (e.tagID) {
    case P.TR: {
      i.openElements.clearBackToTableBodyContext(), i._insertElement(e, Rt.HTML), i.insertionMode = Se.IN_ROW;
      break;
    }
    case P.TH:
    case P.TD: {
      i.openElements.clearBackToTableBodyContext(), i._insertFakeElement(Ye.TR, P.TR), i.insertionMode = Se.IN_ROW, TY(i, e);
      break;
    }
    case P.CAPTION:
    case P.COL:
    case P.COLGROUP:
    case P.TBODY:
    case P.TFOOT:
    case P.THEAD: {
      i.openElements.hasTableBodyContextInTableScope() && (i.openElements.clearBackToTableBodyContext(), i.openElements.pop(), i.insertionMode = Se.IN_TABLE, DA(i, e));
      break;
    }
    default:
      DA(i, e);
  }
}
function pde(i, e) {
  const t = e.tagID;
  switch (e.tagID) {
    case P.TBODY:
    case P.TFOOT:
    case P.THEAD: {
      i.openElements.hasInTableScope(t) && (i.openElements.clearBackToTableBodyContext(), i.openElements.pop(), i.insertionMode = Se.IN_TABLE);
      break;
    }
    case P.TABLE: {
      i.openElements.hasTableBodyContextInTableScope() && (i.openElements.clearBackToTableBodyContext(), i.openElements.pop(), i.insertionMode = Se.IN_TABLE, G5(i, e));
      break;
    }
    case P.BODY:
    case P.CAPTION:
    case P.COL:
    case P.COLGROUP:
    case P.HTML:
    case P.TD:
    case P.TH:
    case P.TR:
      break;
    default:
      G5(i, e);
  }
}
function TY(i, e) {
  switch (e.tagID) {
    case P.TH:
    case P.TD: {
      i.openElements.clearBackToTableRowContext(), i._insertElement(e, Rt.HTML), i.insertionMode = Se.IN_CELL, i.activeFormattingElements.insertMarker();
      break;
    }
    case P.CAPTION:
    case P.COL:
    case P.COLGROUP:
    case P.TBODY:
    case P.TFOOT:
    case P.THEAD:
    case P.TR: {
      i.openElements.hasInTableScope(P.TR) && (i.openElements.clearBackToTableRowContext(), i.openElements.pop(), i.insertionMode = Se.IN_TABLE_BODY, LY(i, e));
      break;
    }
    default:
      DA(i, e);
  }
}
function CHe(i, e) {
  switch (e.tagID) {
    case P.TR: {
      i.openElements.hasInTableScope(P.TR) && (i.openElements.clearBackToTableRowContext(), i.openElements.pop(), i.insertionMode = Se.IN_TABLE_BODY);
      break;
    }
    case P.TABLE: {
      i.openElements.hasInTableScope(P.TR) && (i.openElements.clearBackToTableRowContext(), i.openElements.pop(), i.insertionMode = Se.IN_TABLE_BODY, pde(i, e));
      break;
    }
    case P.TBODY:
    case P.TFOOT:
    case P.THEAD: {
      (i.openElements.hasInTableScope(e.tagID) || i.openElements.hasInTableScope(P.TR)) && (i.openElements.clearBackToTableRowContext(), i.openElements.pop(), i.insertionMode = Se.IN_TABLE_BODY, pde(i, e));
      break;
    }
    case P.BODY:
    case P.CAPTION:
    case P.COL:
    case P.COLGROUP:
    case P.HTML:
    case P.TD:
    case P.TH:
      break;
    default:
      G5(i, e);
  }
}
function j8t(i, e) {
  const t = e.tagID;
  yHe.has(t) ? (i.openElements.hasInTableScope(P.TD) || i.openElements.hasInTableScope(P.TH)) && (i._closeTableCell(), TY(i, e)) : ld(i, e);
}
function G8t(i, e) {
  const t = e.tagID;
  switch (t) {
    case P.TD:
    case P.TH: {
      i.openElements.hasInTableScope(t) && (i.openElements.generateImpliedEndTags(), i.openElements.popUntilTagNamePopped(t), i.activeFormattingElements.clearToLastMarker(), i.insertionMode = Se.IN_ROW);
      break;
    }
    case P.TABLE:
    case P.TBODY:
    case P.TFOOT:
    case P.THEAD:
    case P.TR: {
      i.openElements.hasInTableScope(t) && (i._closeTableCell(), CHe(i, e));
      break;
    }
    case P.BODY:
    case P.CAPTION:
    case P.COL:
    case P.COLGROUP:
    case P.HTML:
      break;
    default:
      xY(i, e);
  }
}
function wHe(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.OPTION: {
      i.openElements.currentTagId === P.OPTION && i.openElements.pop(), i._insertElement(e, Rt.HTML);
      break;
    }
    case P.OPTGROUP: {
      i.openElements.currentTagId === P.OPTION && i.openElements.pop(), i.openElements.currentTagId === P.OPTGROUP && i.openElements.pop(), i._insertElement(e, Rt.HTML);
      break;
    }
    case P.HR: {
      i.openElements.currentTagId === P.OPTION && i.openElements.pop(), i.openElements.currentTagId === P.OPTGROUP && i.openElements.pop(), i._appendElement(e, Rt.HTML), e.ackSelfClosing = !0;
      break;
    }
    case P.INPUT:
    case P.KEYGEN:
    case P.TEXTAREA:
    case P.SELECT: {
      i.openElements.hasInSelectScope(P.SELECT) && (i.openElements.popUntilTagNamePopped(P.SELECT), i._resetInsertionMode(), e.tagID !== P.SELECT && i._processStartTag(e));
      break;
    }
    case P.SCRIPT:
    case P.TEMPLATE: {
      xm(i, e);
      break;
    }
  }
}
function SHe(i, e) {
  switch (e.tagID) {
    case P.OPTGROUP: {
      i.openElements.stackTop > 0 && i.openElements.currentTagId === P.OPTION && i.openElements.tagIDs[i.openElements.stackTop - 1] === P.OPTGROUP && i.openElements.pop(), i.openElements.currentTagId === P.OPTGROUP && i.openElements.pop();
      break;
    }
    case P.OPTION: {
      i.openElements.currentTagId === P.OPTION && i.openElements.pop();
      break;
    }
    case P.SELECT: {
      i.openElements.hasInSelectScope(P.SELECT) && (i.openElements.popUntilTagNamePopped(P.SELECT), i._resetInsertionMode());
      break;
    }
    case P.TEMPLATE: {
      pk(i, e);
      break;
    }
  }
}
function q8t(i, e) {
  const t = e.tagID;
  t === P.CAPTION || t === P.TABLE || t === P.TBODY || t === P.TFOOT || t === P.THEAD || t === P.TR || t === P.TD || t === P.TH ? (i.openElements.popUntilTagNamePopped(P.SELECT), i._resetInsertionMode(), i._processStartTag(e)) : wHe(i, e);
}
function K8t(i, e) {
  const t = e.tagID;
  t === P.CAPTION || t === P.TABLE || t === P.TBODY || t === P.TFOOT || t === P.THEAD || t === P.TR || t === P.TD || t === P.TH ? i.openElements.hasInTableScope(t) && (i.openElements.popUntilTagNamePopped(P.SELECT), i._resetInsertionMode(), i.onEndTag(e)) : SHe(i, e);
}
function Y8t(i, e) {
  switch (e.tagID) {
    // First, handle tags that can start without a mode change
    case P.BASE:
    case P.BASEFONT:
    case P.BGSOUND:
    case P.LINK:
    case P.META:
    case P.NOFRAMES:
    case P.SCRIPT:
    case P.STYLE:
    case P.TEMPLATE:
    case P.TITLE: {
      xm(i, e);
      break;
    }
    // Re-process the token in the appropriate mode
    case P.CAPTION:
    case P.COLGROUP:
    case P.TBODY:
    case P.TFOOT:
    case P.THEAD: {
      i.tmplInsertionModeStack[0] = Se.IN_TABLE, i.insertionMode = Se.IN_TABLE, DA(i, e);
      break;
    }
    case P.COL: {
      i.tmplInsertionModeStack[0] = Se.IN_COLUMN_GROUP, i.insertionMode = Se.IN_COLUMN_GROUP, R0e(i, e);
      break;
    }
    case P.TR: {
      i.tmplInsertionModeStack[0] = Se.IN_TABLE_BODY, i.insertionMode = Se.IN_TABLE_BODY, LY(i, e);
      break;
    }
    case P.TD:
    case P.TH: {
      i.tmplInsertionModeStack[0] = Se.IN_ROW, i.insertionMode = Se.IN_ROW, TY(i, e);
      break;
    }
    default:
      i.tmplInsertionModeStack[0] = Se.IN_BODY, i.insertionMode = Se.IN_BODY, ld(i, e);
  }
}
function X8t(i, e) {
  e.tagID === P.TEMPLATE && pk(i, e);
}
function EHe(i, e) {
  i.openElements.tmplCount > 0 ? (i.openElements.popUntilTagNamePopped(P.TEMPLATE), i.activeFormattingElements.clearToLastMarker(), i.tmplInsertionModeStack.shift(), i._resetInsertionMode(), i.onEof(e)) : N0e(i, e);
}
function Z8t(i, e) {
  e.tagID === P.HTML ? ld(i, e) : U$(i, e);
}
function xHe(i, e) {
  var t;
  if (e.tagID === P.HTML) {
    if (i.fragmentContext || (i.insertionMode = Se.AFTER_AFTER_BODY), i.options.sourceCodeLocationInfo && i.openElements.tagIDs[0] === P.HTML) {
      i._setEndLocation(i.openElements.items[0], e);
      const n = i.openElements.items[1];
      n && !(!((t = i.treeAdapter.getNodeSourceCodeLocation(n)) === null || t === void 0) && t.endTag) && i._setEndLocation(n, e);
    }
  } else
    U$(i, e);
}
function U$(i, e) {
  i.insertionMode = Se.IN_BODY, EY(i, e);
}
function Q8t(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.FRAMESET: {
      i._insertElement(e, Rt.HTML);
      break;
    }
    case P.FRAME: {
      i._appendElement(e, Rt.HTML), e.ackSelfClosing = !0;
      break;
    }
    case P.NOFRAMES: {
      xm(i, e);
      break;
    }
  }
}
function J8t(i, e) {
  e.tagID === P.FRAMESET && !i.openElements.isRootHtmlElementCurrent() && (i.openElements.pop(), !i.fragmentContext && i.openElements.currentTagId !== P.FRAMESET && (i.insertionMode = Se.AFTER_FRAMESET));
}
function e9t(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.NOFRAMES: {
      xm(i, e);
      break;
    }
  }
}
function t9t(i, e) {
  e.tagID === P.HTML && (i.insertionMode = Se.AFTER_AFTER_FRAMESET);
}
function n9t(i, e) {
  e.tagID === P.HTML ? ld(i, e) : rV(i, e);
}
function rV(i, e) {
  i.insertionMode = Se.IN_BODY, EY(i, e);
}
function i9t(i, e) {
  switch (e.tagID) {
    case P.HTML: {
      ld(i, e);
      break;
    }
    case P.NOFRAMES: {
      xm(i, e);
      break;
    }
  }
}
function r9t(i, e) {
  e.chars = Xo, i._insertCharacters(e);
}
function s9t(i, e) {
  i._insertCharacters(e), i.framesetOk = !1;
}
function LHe(i) {
  for (; i.treeAdapter.getNamespaceURI(i.openElements.current) !== Rt.HTML && i.openElements.currentTagId !== void 0 && !i._isIntegrationPoint(i.openElements.currentTagId, i.openElements.current); )
    i.openElements.pop();
}
function o9t(i, e) {
  if (C6t(e))
    LHe(i), i._startTagOutsideForeignContent(e);
  else {
    const t = i._getAdjustedCurrentElement(), n = i.treeAdapter.getNamespaceURI(t);
    n === Rt.MATHML ? cHe(e) : n === Rt.SVG && (w6t(e), uHe(e)), D0e(e), e.selfClosing ? i._appendElement(e, n) : i._insertElement(e, n), e.ackSelfClosing = !0;
  }
}
function a9t(i, e) {
  if (e.tagID === P.P || e.tagID === P.BR) {
    LHe(i), i._endTagOutsideForeignContent(e);
    return;
  }
  for (let t = i.openElements.stackTop; t > 0; t--) {
    const n = i.openElements.items[t];
    if (i.treeAdapter.getNamespaceURI(n) === Rt.HTML) {
      i._endTagOutsideForeignContent(e);
      break;
    }
    const r = i.treeAdapter.getTagName(n);
    if (r.toLowerCase() === e.tagName) {
      e.tagName = r, i.openElements.shortenToLength(t);
      break;
    }
  }
}
Ye.AREA, Ye.BASE, Ye.BASEFONT, Ye.BGSOUND, Ye.BR, Ye.COL, Ye.EMBED, Ye.FRAME, Ye.HR, Ye.IMG, Ye.INPUT, Ye.KEYGEN, Ye.LINK, Ye.META, Ye.PARAM, Ye.SOURCE, Ye.TRACK, Ye.WBR;
const kY = THe("end"), Mb = THe("start");
function THe(i) {
  return e;
  function e(t) {
    const n = t && t.position && t.position[i] || {};
    if (typeof n.line == "number" && n.line > 0 && typeof n.column == "number" && n.column > 0)
      return {
        line: n.line,
        column: n.column,
        offset: typeof n.offset == "number" && n.offset > -1 ? n.offset : void 0
      };
  }
}
function l9t(i) {
  const e = Mb(i), t = kY(i);
  if (e && t)
    return { start: e, end: t };
}
const c9t = /<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi, u9t = /* @__PURE__ */ new Set([
  "mdxFlowExpression",
  "mdxJsxFlowElement",
  "mdxJsxTextElement",
  "mdxTextExpression",
  "mdxjsEsm"
]), NAe = { sourceCodeLocationInfo: !0, scriptingEnabled: !1 };
function kHe(i, e) {
  const t = y9t(i), n = C0e("type", {
    handlers: { root: d9t, element: h9t, text: f9t, comment: IHe, doctype: g9t, raw: m9t },
    unknown: _9t
  }), r = {
    parser: t ? new kAe(NAe) : kAe.getFragmentParser(void 0, NAe),
    handle(a) {
      n(a, r);
    },
    stitches: !1,
    options: e || {}
  };
  n(i, r), x2(r, Mb());
  const s = t ? r.parser.document : r.parser.getFragment(), o = yBt(s, {
    // To do: support `space`?
    file: r.options.file
  });
  return r.stitches && qd(o, "comment", function(a, l, c) {
    const u = (
      /** @type {Stitch} */
      /** @type {unknown} */
      a
    );
    if (u.value.stitch && c && l !== void 0) {
      const d = c.children;
      return d[l] = u.value.stitch, l;
    }
  }), o.type === "root" && o.children.length === 1 && o.children[0].type === i.type ? o.children[0] : o;
}
function DHe(i, e) {
  let t = -1;
  if (i)
    for (; ++t < i.length; )
      e.handle(i[t]);
}
function d9t(i, e) {
  DHe(i.children, e);
}
function h9t(i, e) {
  b9t(i, e), DHe(i.children, e), v9t(i, e);
}
function f9t(i, e) {
  e.parser.tokenizer.state > 4 && (e.parser.tokenizer.state = 0);
  const t = {
    type: Dr.CHARACTER,
    chars: i.value,
    location: g6(i)
  };
  x2(e, Mb(i)), e.parser.currentToken = t, e.parser._processToken(e.parser.currentToken);
}
function g9t(i, e) {
  const t = {
    type: Dr.DOCTYPE,
    name: "html",
    forceQuirks: !1,
    publicId: "",
    systemId: "",
    location: g6(i)
  };
  x2(e, Mb(i)), e.parser.currentToken = t, e.parser._processToken(e.parser.currentToken);
}
function p9t(i, e) {
  e.stitches = !0;
  const t = C9t(i);
  if ("children" in i && "children" in t) {
    const n = (
      /** @type {Root} */
      kHe({ type: "root", children: i.children }, e.options)
    );
    t.children = n.children;
  }
  IHe({ type: "comment", value: { stitch: t } }, e);
}
function IHe(i, e) {
  const t = i.value, n = {
    type: Dr.COMMENT,
    data: t,
    location: g6(i)
  };
  x2(e, Mb(i)), e.parser.currentToken = n, e.parser._processToken(e.parser.currentToken);
}
function m9t(i, e) {
  if (e.parser.tokenizer.preprocessor.html = "", e.parser.tokenizer.preprocessor.pos = -1, e.parser.tokenizer.preprocessor.lastGapPos = -2, e.parser.tokenizer.preprocessor.gapStack = [], e.parser.tokenizer.preprocessor.skipNextNewLine = !1, e.parser.tokenizer.preprocessor.lastChunkWritten = !1, e.parser.tokenizer.preprocessor.endOfChunkHit = !1, e.parser.tokenizer.preprocessor.isEol = !1, NHe(e, Mb(i)), e.parser.tokenizer.write(
    e.options.tagfilter ? i.value.replace(c9t, "&lt;$1$2") : i.value,
    !1
  ), e.parser.tokenizer._runParsingLoop(), e.parser.tokenizer.state === 72 || // @ts-expect-error: removed.
  e.parser.tokenizer.state === 78) {
    e.parser.tokenizer.preprocessor.lastChunkWritten = !0;
    const t = e.parser.tokenizer._consume();
    e.parser.tokenizer._callState(t);
  }
}
function _9t(i, e) {
  const t = (
    /** @type {Nodes} */
    i
  );
  if (e.options.passThrough && e.options.passThrough.includes(t.type))
    p9t(t, e);
  else {
    let n = "";
    throw u9t.has(t.type) && (n = ". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"), new Error("Cannot compile `" + t.type + "` node" + n);
  }
}
function x2(i, e) {
  NHe(i, e);
  const t = i.parser.tokenizer.currentCharacterToken;
  t && t.location && (t.location.endLine = i.parser.tokenizer.preprocessor.line, t.location.endCol = i.parser.tokenizer.preprocessor.col + 1, t.location.endOffset = i.parser.tokenizer.preprocessor.offset + 1, i.parser.currentToken = t, i.parser._processToken(i.parser.currentToken)), i.parser.tokenizer.paused = !1, i.parser.tokenizer.inLoop = !1, i.parser.tokenizer.active = !1, i.parser.tokenizer.returnState = qa.DATA, i.parser.tokenizer.charRefCode = -1, i.parser.tokenizer.consumedAfterSnapshot = -1, i.parser.tokenizer.currentLocation = null, i.parser.tokenizer.currentCharacterToken = null, i.parser.tokenizer.currentToken = null, i.parser.tokenizer.currentAttr = { name: "", value: "" };
}
function NHe(i, e) {
  if (e && e.offset !== void 0) {
    const t = {
      startLine: e.line,
      startCol: e.column,
      startOffset: e.offset,
      endLine: -1,
      endCol: -1,
      endOffset: -1
    };
    i.parser.tokenizer.preprocessor.lineStartPos = -e.column + 1, i.parser.tokenizer.preprocessor.droppedBufferSize = e.offset, i.parser.tokenizer.preprocessor.line = e.line, i.parser.tokenizer.currentLocation = t;
  }
}
function b9t(i, e) {
  const t = i.tagName.toLowerCase();
  if (e.parser.tokenizer.state === qa.PLAINTEXT) return;
  x2(e, Mb(i));
  const n = e.parser.openElements.current;
  let r = "namespaceURI" in n ? n.namespaceURI : Ex.html;
  r === Ex.html && t === "svg" && (r = Ex.svg);
  const s = xBt(
    // Shallow clone to not delve into `children`: we only need the attributes.
    { ...i, children: [] },
    { space: r === Ex.svg ? "svg" : "html" }
  ), o = {
    type: Dr.START_TAG,
    tagName: t,
    tagID: E2(t),
    // We always send start and end tags.
    selfClosing: !1,
    ackSelfClosing: !1,
    // Always element.
    /* c8 ignore next */
    attrs: "attrs" in s ? s.attrs : [],
    location: g6(i)
  };
  e.parser.currentToken = o, e.parser._processToken(e.parser.currentToken), e.parser.tokenizer.lastStartTagName = t;
}
function v9t(i, e) {
  const t = i.tagName.toLowerCase();
  if (!e.parser.tokenizer.inForeignNode && ABt.includes(t) || e.parser.tokenizer.state === qa.PLAINTEXT) return;
  x2(e, kY(i));
  const n = {
    type: Dr.END_TAG,
    tagName: t,
    tagID: E2(t),
    selfClosing: !1,
    ackSelfClosing: !1,
    attrs: [],
    location: g6(i)
  };
  e.parser.currentToken = n, e.parser._processToken(e.parser.currentToken), // Current element is closed.
  t === e.parser.tokenizer.lastStartTagName && // `<textarea>` and `<title>`
  (e.parser.tokenizer.state === qa.RCDATA || // `<iframe>`, `<noembed>`, `<noframes>`, `<style>`, `<xmp>`
  e.parser.tokenizer.state === qa.RAWTEXT || // `<script>`
  e.parser.tokenizer.state === qa.SCRIPT_DATA) && (e.parser.tokenizer.state = qa.DATA);
}
function y9t(i) {
  const e = i.type === "root" ? i.children[0] : i;
  return !!(e && (e.type === "doctype" || e.type === "element" && e.tagName.toLowerCase() === "html"));
}
function g6(i) {
  const e = Mb(i) || {
    line: void 0,
    column: void 0,
    offset: void 0
  }, t = kY(i) || {
    line: void 0,
    column: void 0,
    offset: void 0
  };
  return {
    startLine: e.line,
    startCol: e.column,
    startOffset: e.offset,
    endLine: t.line,
    endCol: t.column,
    endOffset: t.offset
  };
}
function C9t(i) {
  return "children" in i ? AT({ ...i, children: [] }) : AT(i);
}
function RHe(i) {
  return function(e, t) {
    return (
      /** @type {Root} */
      kHe(e, { ...i, file: t })
    );
  };
}
function w9t(i, e) {
  if (i == null) return {};
  var t = {};
  for (var n in i) if ({}.hasOwnProperty.call(i, n)) {
    if (e.indexOf(n) !== -1) continue;
    t[n] = i[n];
  }
  return t;
}
const S9t = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, E9t = /^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, x9t = {};
function RAe(i, e) {
  return (x9t.jsx ? E9t : S9t).test(i);
}
var HI = {}, one, AAe;
function L9t() {
  if (AAe) return one;
  AAe = 1;
  var i = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, e = /\n/g, t = /^\s*/, n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, r = /^:\s*/, s = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, o = /^[;\s]*/, a = /^\s+|\s+$/g, l = `
`, c = "/", u = "*", d = "", h = "comment", g = "declaration";
  function m(v, w) {
    if (typeof v != "string")
      throw new TypeError("First argument must be a string");
    if (!v) return [];
    w = w || {};
    var E = 1, L = 1;
    function T(Y) {
      var G = Y.match(e);
      G && (E += G.length);
      var Q = Y.lastIndexOf(l);
      L = ~Q ? Y.length - Q : L + Y.length;
    }
    function D() {
      var Y = { line: E, column: L };
      return function(G) {
        return G.position = new N(Y), B(), G;
      };
    }
    function N(Y) {
      this.start = Y, this.end = { line: E, column: L }, this.source = w.source;
    }
    N.prototype.content = v;
    function R(Y) {
      var G = new Error(
        w.source + ":" + E + ":" + L + ": " + Y
      );
      if (G.reason = Y, G.filename = w.source, G.line = E, G.column = L, G.source = v, !w.silent) throw G;
    }
    function M(Y) {
      var G = Y.exec(v);
      if (G) {
        var Q = G[0];
        return T(Q), v = v.slice(Q.length), G;
      }
    }
    function B() {
      M(t);
    }
    function H(Y) {
      var G;
      for (Y = Y || []; G = j(); )
        G !== !1 && Y.push(G);
      return Y;
    }
    function j() {
      var Y = D();
      if (!(c != v.charAt(0) || u != v.charAt(1))) {
        for (var G = 2; d != v.charAt(G) && (u != v.charAt(G) || c != v.charAt(G + 1)); )
          ++G;
        if (G += 2, d === v.charAt(G - 1))
          return R("End of comment missing");
        var Q = v.slice(2, G - 2);
        return L += 2, T(Q), v = v.slice(G), L += 2, Y({
          type: h,
          comment: Q
        });
      }
    }
    function K() {
      var Y = D(), G = M(n);
      if (G) {
        if (j(), !M(r)) return R("property missing ':'");
        var Q = M(s), oe = Y({
          type: g,
          property: _(G[0].replace(i, d)),
          value: Q ? _(Q[0].replace(i, d)) : d
        });
        return M(o), oe;
      }
    }
    function X() {
      var Y = [];
      H(Y);
      for (var G; G = K(); )
        G !== !1 && (Y.push(G), H(Y));
      return Y;
    }
    return B(), X();
  }
  function _(v) {
    return v ? v.replace(a, d) : d;
  }
  return one = m, one;
}
var OAe;
function T9t() {
  if (OAe) return HI;
  OAe = 1;
  var i = HI && HI.__importDefault || function(n) {
    return n && n.__esModule ? n : { default: n };
  };
  Object.defineProperty(HI, "__esModule", { value: !0 }), HI.default = t;
  const e = i(L9t());
  function t(n, r) {
    let s = null;
    if (!n || typeof n != "string")
      return s;
    const o = (0, e.default)(n), a = typeof r == "function";
    return o.forEach((l) => {
      if (l.type !== "declaration")
        return;
      const { property: c, value: u } = l;
      a ? r(c, u, l) : u && (s = s || {}, s[c] = u);
    }), s;
  }
  return HI;
}
var EP = {}, MAe;
function k9t() {
  if (MAe) return EP;
  MAe = 1, Object.defineProperty(EP, "__esModule", { value: !0 }), EP.camelCase = void 0;
  var i = /^--[a-zA-Z0-9_-]+$/, e = /-([a-z])/g, t = /^[^-]+$/, n = /^-(webkit|moz|ms|o|khtml)-/, r = /^-(ms)-/, s = function(c) {
    return !c || t.test(c) || i.test(c);
  }, o = function(c, u) {
    return u.toUpperCase();
  }, a = function(c, u) {
    return "".concat(u, "-");
  }, l = function(c, u) {
    return u === void 0 && (u = {}), s(c) ? c : (c = c.toLowerCase(), u.reactCompat ? c = c.replace(r, a) : c = c.replace(n, a), c.replace(e, o));
  };
  return EP.camelCase = l, EP;
}
var xP, PAe;
function D9t() {
  if (PAe) return xP;
  PAe = 1;
  var i = xP && xP.__importDefault || function(r) {
    return r && r.__esModule ? r : { default: r };
  }, e = i(T9t()), t = k9t();
  function n(r, s) {
    var o = {};
    return !r || typeof r != "string" || (0, e.default)(r, function(a, l) {
      a && l && (o[(0, t.camelCase)(a, s)] = l);
    }), o;
  }
  return n.default = n, xP = n, xP;
}
var I9t = D9t();
const N9t = /* @__PURE__ */ WA(I9t);
function C3(i) {
  return !i || typeof i != "object" ? "" : "position" in i || "type" in i ? FAe(i.position) : "start" in i || "end" in i ? FAe(i) : "line" in i || "column" in i ? mde(i) : "";
}
function mde(i) {
  return BAe(i && i.line) + ":" + BAe(i && i.column);
}
function FAe(i) {
  return mde(i && i.start) + "-" + mde(i && i.end);
}
function BAe(i) {
  return i && typeof i == "number" ? i : 1;
}
class cd extends Error {
  /**
   * Create a message for `reason`.
   *
   * > 🪦 **Note**: also has obsolete signatures.
   *
   * @overload
   * @param {string} reason
   * @param {Options | null | undefined} [options]
   * @returns
   *
   * @overload
   * @param {string} reason
   * @param {Node | NodeLike | null | undefined} parent
   * @param {string | null | undefined} [origin]
   * @returns
   *
   * @overload
   * @param {string} reason
   * @param {Point | Position | null | undefined} place
   * @param {string | null | undefined} [origin]
   * @returns
   *
   * @overload
   * @param {string} reason
   * @param {string | null | undefined} [origin]
   * @returns
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {Node | NodeLike | null | undefined} parent
   * @param {string | null | undefined} [origin]
   * @returns
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {Point | Position | null | undefined} place
   * @param {string | null | undefined} [origin]
   * @returns
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {string | null | undefined} [origin]
   * @returns
   *
   * @param {Error | VFileMessage | string} causeOrReason
   *   Reason for message, should use markdown.
   * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
   *   Configuration (optional).
   * @param {string | null | undefined} [origin]
   *   Place in code where the message originates (example:
   *   `'my-package:my-rule'` or `'my-rule'`).
   * @returns
   *   Instance of `VFileMessage`.
   */
  // eslint-disable-next-line complexity
  constructor(e, t, n) {
    super(), typeof t == "string" && (n = t, t = void 0);
    let r = "", s = {}, o = !1;
    if (t && ("line" in t && "column" in t ? s = { place: t } : "start" in t && "end" in t ? s = { place: t } : "type" in t ? s = {
      ancestors: [t],
      place: t.position
    } : s = { ...t }), typeof e == "string" ? r = e : !s.cause && e && (o = !0, r = e.message, s.cause = e), !s.ruleId && !s.source && typeof n == "string") {
      const l = n.indexOf(":");
      l === -1 ? s.ruleId = n : (s.source = n.slice(0, l), s.ruleId = n.slice(l + 1));
    }
    if (!s.place && s.ancestors && s.ancestors) {
      const l = s.ancestors[s.ancestors.length - 1];
      l && (s.place = l.position);
    }
    const a = s.place && "start" in s.place ? s.place.start : s.place;
    this.ancestors = s.ancestors || void 0, this.cause = s.cause || void 0, this.column = a ? a.column : void 0, this.fatal = void 0, this.file = "", this.message = r, this.line = a ? a.line : void 0, this.name = C3(s.place) || "1:1", this.place = s.place || void 0, this.reason = this.message, this.ruleId = s.ruleId || void 0, this.source = s.source || void 0, this.stack = o && s.cause && typeof s.cause.stack == "string" ? s.cause.stack : "", this.actual = void 0, this.expected = void 0, this.note = void 0, this.url = void 0;
  }
}
cd.prototype.file = "";
cd.prototype.name = "";
cd.prototype.reason = "";
cd.prototype.message = "";
cd.prototype.stack = "";
cd.prototype.column = void 0;
cd.prototype.line = void 0;
cd.prototype.ancestors = void 0;
cd.prototype.cause = void 0;
cd.prototype.fatal = void 0;
cd.prototype.place = void 0;
cd.prototype.ruleId = void 0;
cd.prototype.source = void 0;
const A0e = {}.hasOwnProperty, R9t = /* @__PURE__ */ new Map(), A9t = /[A-Z]/g, O9t = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]), M9t = /* @__PURE__ */ new Set(["td", "th"]), AHe = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
function P9t(i, e) {
  if (!e || e.Fragment === void 0)
    throw new TypeError("Expected `Fragment` in options");
  const t = e.filePath || void 0;
  let n;
  if (e.development) {
    if (typeof e.jsxDEV != "function")
      throw new TypeError(
        "Expected `jsxDEV` in options when `development: true`"
      );
    n = $9t(t, e.jsxDEV);
  } else {
    if (typeof e.jsx != "function")
      throw new TypeError("Expected `jsx` in production options");
    if (typeof e.jsxs != "function")
      throw new TypeError("Expected `jsxs` in production options");
    n = z9t(t, e.jsx, e.jsxs);
  }
  const r = {
    Fragment: e.Fragment,
    ancestors: [],
    components: e.components || {},
    create: n,
    elementAttributeNameCase: e.elementAttributeNameCase || "react",
    evaluater: e.createEvaluater ? e.createEvaluater() : void 0,
    filePath: t,
    ignoreInvalidStyle: e.ignoreInvalidStyle || !1,
    passKeys: e.passKeys !== !1,
    passNode: e.passNode || !1,
    schema: e.space === "svg" ? _0 : w2,
    stylePropertyNameCase: e.stylePropertyNameCase || "dom",
    tableCellAlignToStyle: e.tableCellAlignToStyle !== !1
  }, s = OHe(r, i, void 0);
  return s && typeof s != "string" ? s : r.create(
    i,
    r.Fragment,
    { children: s || void 0 },
    void 0
  );
}
function OHe(i, e, t) {
  if (e.type === "element")
    return F9t(i, e, t);
  if (e.type === "mdxFlowExpression" || e.type === "mdxTextExpression")
    return B9t(i, e);
  if (e.type === "mdxJsxFlowElement" || e.type === "mdxJsxTextElement")
    return W9t(i, e, t);
  if (e.type === "mdxjsEsm")
    return H9t(i, e);
  if (e.type === "root")
    return V9t(i, e, t);
  if (e.type === "text")
    return U9t(i, e);
}
function F9t(i, e, t) {
  const n = i.schema;
  let r = n;
  e.tagName.toLowerCase() === "svg" && n.space === "html" && (r = _0, i.schema = r), i.ancestors.push(e);
  const s = PHe(i, e.tagName, !1), o = j9t(i, e);
  let a = M0e(i, e);
  return O9t.has(e.tagName) && (a = a.filter(function(l) {
    return typeof l == "string" ? !B7e(l) : !0;
  })), MHe(i, o, s, e), O0e(o, a), i.ancestors.pop(), i.schema = n, i.create(e, s, o, t);
}
function B9t(i, e) {
  if (e.data && e.data.estree && i.evaluater) {
    const n = e.data.estree.body[0];
    return n.type, /** @type {Child | undefined} */
    i.evaluater.evaluateExpression(n.expression);
  }
  q5(i, e.position);
}
function H9t(i, e) {
  if (e.data && e.data.estree && i.evaluater)
    return (
      /** @type {Child | undefined} */
      i.evaluater.evaluateProgram(e.data.estree)
    );
  q5(i, e.position);
}
function W9t(i, e, t) {
  const n = i.schema;
  let r = n;
  e.name === "svg" && n.space === "html" && (r = _0, i.schema = r), i.ancestors.push(e);
  const s = e.name === null ? i.Fragment : PHe(i, e.name, !0), o = G9t(i, e), a = M0e(i, e);
  return MHe(i, o, s, e), O0e(o, a), i.ancestors.pop(), i.schema = n, i.create(e, s, o, t);
}
function V9t(i, e, t) {
  const n = {};
  return O0e(n, M0e(i, e)), i.create(e, i.Fragment, n, t);
}
function U9t(i, e) {
  return e.value;
}
function MHe(i, e, t, n) {
  typeof t != "string" && t !== i.Fragment && i.passNode && (e.node = n);
}
function O0e(i, e) {
  if (e.length > 0) {
    const t = e.length > 1 ? e : e[0];
    t && (i.children = t);
  }
}
function z9t(i, e, t) {
  return n;
  function n(r, s, o, a) {
    const c = Array.isArray(o.children) ? t : e;
    return a ? c(s, o, a) : c(s, o);
  }
}
function $9t(i, e) {
  return t;
  function t(n, r, s, o) {
    const a = Array.isArray(s.children), l = Mb(n);
    return e(
      r,
      s,
      o,
      a,
      {
        columnNumber: l ? l.column - 1 : void 0,
        fileName: i,
        lineNumber: l ? l.line : void 0
      },
      void 0
    );
  }
}
function j9t(i, e) {
  const t = {};
  let n, r;
  for (r in e.properties)
    if (r !== "children" && A0e.call(e.properties, r)) {
      const s = q9t(i, r, e.properties[r]);
      if (s) {
        const [o, a] = s;
        i.tableCellAlignToStyle && o === "align" && typeof a == "string" && M9t.has(e.tagName) ? n = a : t[o] = a;
      }
    }
  if (n) {
    const s = (
      /** @type {Style} */
      t.style || (t.style = {})
    );
    s[i.stylePropertyNameCase === "css" ? "text-align" : "textAlign"] = n;
  }
  return t;
}
function G9t(i, e) {
  const t = {};
  for (const n of e.attributes)
    if (n.type === "mdxJsxExpressionAttribute")
      if (n.data && n.data.estree && i.evaluater) {
        const s = n.data.estree.body[0];
        s.type;
        const o = s.expression;
        o.type;
        const a = o.properties[0];
        a.type, Object.assign(
          t,
          i.evaluater.evaluateExpression(a.argument)
        );
      } else
        q5(i, e.position);
    else {
      const r = n.name;
      let s;
      if (n.value && typeof n.value == "object")
        if (n.value.data && n.value.data.estree && i.evaluater) {
          const a = n.value.data.estree.body[0];
          a.type, s = i.evaluater.evaluateExpression(a.expression);
        } else
          q5(i, e.position);
      else
        s = n.value === null ? !0 : n.value;
      t[r] = /** @type {Props[keyof Props]} */
      s;
    }
  return t;
}
function M0e(i, e) {
  const t = [];
  let n = -1;
  const r = i.passKeys ? /* @__PURE__ */ new Map() : R9t;
  for (; ++n < e.children.length; ) {
    const s = e.children[n];
    let o;
    if (i.passKeys) {
      const l = s.type === "element" ? s.tagName : s.type === "mdxJsxFlowElement" || s.type === "mdxJsxTextElement" ? s.name : void 0;
      if (l) {
        const c = r.get(l) || 0;
        o = l + "-" + c, r.set(l, c + 1);
      }
    }
    const a = OHe(i, s, o);
    a !== void 0 && t.push(a);
  }
  return t;
}
function q9t(i, e, t) {
  const n = h6(i.schema, e);
  if (!(t == null || typeof t == "number" && Number.isNaN(t))) {
    if (Array.isArray(t) && (t = n.commaSeparated ? Mme(t) : Ome(t)), n.property === "style") {
      let r = typeof t == "object" ? t : K9t(i, String(t));
      return i.stylePropertyNameCase === "css" && (r = Y9t(r)), ["style", r];
    }
    return [
      i.elementAttributeNameCase === "react" && n.space ? P4t[n.property] || n.property : n.attribute,
      t
    ];
  }
}
function K9t(i, e) {
  try {
    return N9t(e, { reactCompat: !0 });
  } catch (t) {
    if (i.ignoreInvalidStyle)
      return {};
    const n = (
      /** @type {Error} */
      t
    ), r = new cd("Cannot parse `style` attribute", {
      ancestors: i.ancestors,
      cause: n,
      ruleId: "style",
      source: "hast-util-to-jsx-runtime"
    });
    throw r.file = i.filePath || void 0, r.url = AHe + "#cannot-parse-style-attribute", r;
  }
}
function PHe(i, e, t) {
  let n;
  if (!t)
    n = { type: "Literal", value: e };
  else if (e.includes(".")) {
    const r = e.split(".");
    let s = -1, o;
    for (; ++s < r.length; ) {
      const a = RAe(r[s]) ? { type: "Identifier", name: r[s] } : { type: "Literal", value: r[s] };
      o = o ? {
        type: "MemberExpression",
        object: o,
        property: a,
        computed: !!(s && a.type === "Literal"),
        optional: !1
      } : a;
    }
    n = o;
  } else
    n = RAe(e) && !/^[a-z]/.test(e) ? { type: "Identifier", name: e } : { type: "Literal", value: e };
  if (n.type === "Literal") {
    const r = (
      /** @type {string | number} */
      n.value
    );
    return A0e.call(i.components, r) ? i.components[r] : r;
  }
  if (i.evaluater)
    return i.evaluater.evaluateExpression(n);
  q5(i);
}
function q5(i, e) {
  const t = new cd(
    "Cannot handle MDX estrees without `createEvaluater`",
    {
      ancestors: i.ancestors,
      place: e,
      ruleId: "mdx-estree",
      source: "hast-util-to-jsx-runtime"
    }
  );
  throw t.file = i.filePath || void 0, t.url = AHe + "#cannot-handle-mdx-estrees-without-createevaluater", t;
}
function Y9t(i) {
  const e = {};
  let t;
  for (t in i)
    A0e.call(i, t) && (e[X9t(t)] = i[t]);
  return e;
}
function X9t(i) {
  let e = i.replace(A9t, Z9t);
  return e.slice(0, 3) === "ms-" && (e = "-" + e), e;
}
function Z9t(i) {
  return "-" + i.toLowerCase();
}
const ane = {
  action: ["form"],
  cite: ["blockquote", "del", "ins", "q"],
  data: ["object"],
  formAction: ["button", "input"],
  href: ["a", "area", "base", "link"],
  icon: ["menuitem"],
  itemId: null,
  manifest: ["html"],
  ping: ["a", "area"],
  poster: ["video"],
  src: [
    "audio",
    "embed",
    "iframe",
    "img",
    "input",
    "script",
    "source",
    "track",
    "video"
  ]
}, Q9t = {};
function P0e(i, e) {
  const t = Q9t, n = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, r = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
  return FHe(i, n, r);
}
function FHe(i, e, t) {
  if (J9t(i)) {
    if ("value" in i)
      return i.type === "html" && !t ? "" : i.value;
    if (e && "alt" in i && i.alt)
      return i.alt;
    if ("children" in i)
      return HAe(i.children, e, t);
  }
  return Array.isArray(i) ? HAe(i, e, t) : "";
}
function HAe(i, e, t) {
  const n = [];
  let r = -1;
  for (; ++r < i.length; )
    n[r] = FHe(i[r], e, t);
  return n.join("");
}
function J9t(i) {
  return !!(i && typeof i == "object");
}
function Uf(i, e, t, n) {
  const r = i.length;
  let s = 0, o;
  if (e < 0 ? e = -e > r ? 0 : r + e : e = e > r ? r : e, t = t > 0 ? t : 0, n.length < 1e4)
    o = Array.from(n), o.unshift(e, t), i.splice(...o);
  else
    for (t && i.splice(e, t); s < n.length; )
      o = n.slice(s, s + 1e4), o.unshift(e, 0), i.splice(...o), s += 1e4, e += 1e4;
}
function Hg(i, e) {
  return i.length > 0 ? (Uf(i, i.length, 0, e), i) : e;
}
const WAe = {}.hasOwnProperty;
function BHe(i) {
  const e = {};
  let t = -1;
  for (; ++t < i.length; )
    e7t(e, i[t]);
  return e;
}
function e7t(i, e) {
  let t;
  for (t in e) {
    const r = (WAe.call(i, t) ? i[t] : void 0) || (i[t] = {}), s = e[t];
    let o;
    if (s)
      for (o in s) {
        WAe.call(r, o) || (r[o] = []);
        const a = s[o];
        t7t(
          // @ts-expect-error Looks like a list.
          r[o],
          Array.isArray(a) ? a : a ? [a] : []
        );
      }
  }
}
function t7t(i, e) {
  let t = -1;
  const n = [];
  for (; ++t < e.length; )
    (e[t].add === "after" ? i : n).push(e[t]);
  Uf(i, 0, 0, n);
}
function HHe(i, e) {
  const t = Number.parseInt(i, e);
  return (
    // C0 except for HT, LF, FF, CR, space.
    t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of C0, and C1 controls.
    t > 126 && t < 160 || // Lone high surrogates and low surrogates.
    t > 55295 && t < 57344 || // Noncharacters.
    t > 64975 && t < 65008 || /* eslint-disable no-bitwise */
    (t & 65535) === 65535 || (t & 65535) === 65534 || /* eslint-enable no-bitwise */
    // Out of range
    t > 1114111 ? "�" : String.fromCodePoint(t)
  );
}
function cm(i) {
  return i.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
}
const Rd = Aw(/[A-Za-z]/), Gu = Aw(/[\dA-Za-z]/), n7t = Aw(/[#-'*+\--9=?A-Z^-~]/);
function z$(i) {
  return (
    // Special whitespace codes (which have negative values), C0 and Control
    // character DEL
    i !== null && (i < 32 || i === 127)
  );
}
const _de = Aw(/\d/), i7t = Aw(/[\dA-Fa-f]/), r7t = Aw(/[!-/:-@[-`{-~]/);
function wi(i) {
  return i !== null && i < -2;
}
function Io(i) {
  return i !== null && (i < 0 || i === 32);
}
function Pr(i) {
  return i === -2 || i === -1 || i === 32;
}
const DY = Aw(new RegExp("\\p{P}|\\p{S}", "u")), OT = Aw(/\s/);
function Aw(i) {
  return e;
  function e(t) {
    return t !== null && t > -1 && i.test(String.fromCharCode(t));
  }
}
function L2(i) {
  const e = [];
  let t = -1, n = 0, r = 0;
  for (; ++t < i.length; ) {
    const s = i.charCodeAt(t);
    let o = "";
    if (s === 37 && Gu(i.charCodeAt(t + 1)) && Gu(i.charCodeAt(t + 2)))
      r = 2;
    else if (s < 128)
      /[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s)) || (o = String.fromCharCode(s));
    else if (s > 55295 && s < 57344) {
      const a = i.charCodeAt(t + 1);
      s < 56320 && a > 56319 && a < 57344 ? (o = String.fromCharCode(s, a), r = 1) : o = "�";
    } else
      o = String.fromCharCode(s);
    o && (e.push(i.slice(n, t), encodeURIComponent(o)), n = t + r + 1, o = ""), r && (t += r, r = 0);
  }
  return e.join("") + i.slice(n);
}
function us(i, e, t, n) {
  const r = n ? n - 1 : Number.POSITIVE_INFINITY;
  let s = 0;
  return o;
  function o(l) {
    return Pr(l) ? (i.enter(t), a(l)) : e(l);
  }
  function a(l) {
    return Pr(l) && s++ < r ? (i.consume(l), a) : (i.exit(t), e(l));
  }
}
const s7t = {
  tokenize: o7t
};
function o7t(i) {
  const e = i.attempt(this.parser.constructs.contentInitial, n, r);
  let t;
  return e;
  function n(a) {
    if (a === null) {
      i.consume(a);
      return;
    }
    return i.enter("lineEnding"), i.consume(a), i.exit("lineEnding"), us(i, e, "linePrefix");
  }
  function r(a) {
    return i.enter("paragraph"), s(a);
  }
  function s(a) {
    const l = i.enter("chunkText", {
      contentType: "text",
      previous: t
    });
    return t && (t.next = l), t = l, o(a);
  }
  function o(a) {
    if (a === null) {
      i.exit("chunkText"), i.exit("paragraph"), i.consume(a);
      return;
    }
    return wi(a) ? (i.consume(a), i.exit("chunkText"), s) : (i.consume(a), o);
  }
}
const a7t = {
  tokenize: l7t
}, VAe = {
  tokenize: c7t
};
function l7t(i) {
  const e = this, t = [];
  let n = 0, r, s, o;
  return a;
  function a(L) {
    if (n < t.length) {
      const T = t[n];
      return e.containerState = T[1], i.attempt(T[0].continuation, l, c)(L);
    }
    return c(L);
  }
  function l(L) {
    if (n++, e.containerState._closeFlow) {
      e.containerState._closeFlow = void 0, r && E();
      const T = e.events.length;
      let D = T, N;
      for (; D--; )
        if (e.events[D][0] === "exit" && e.events[D][1].type === "chunkFlow") {
          N = e.events[D][1].end;
          break;
        }
      w(n);
      let R = T;
      for (; R < e.events.length; )
        e.events[R][1].end = {
          ...N
        }, R++;
      return Uf(e.events, D + 1, 0, e.events.slice(T)), e.events.length = R, c(L);
    }
    return a(L);
  }
  function c(L) {
    if (n === t.length) {
      if (!r)
        return h(L);
      if (r.currentConstruct && r.currentConstruct.concrete)
        return m(L);
      e.interrupt = !!(r.currentConstruct && !r._gfmTableDynamicInterruptHack);
    }
    return e.containerState = {}, i.check(VAe, u, d)(L);
  }
  function u(L) {
    return r && E(), w(n), h(L);
  }
  function d(L) {
    return e.parser.lazy[e.now().line] = n !== t.length, o = e.now().offset, m(L);
  }
  function h(L) {
    return e.containerState = {}, i.attempt(VAe, g, m)(L);
  }
  function g(L) {
    return n++, t.push([e.currentConstruct, e.containerState]), h(L);
  }
  function m(L) {
    if (L === null) {
      r && E(), w(0), i.consume(L);
      return;
    }
    return r = r || e.parser.flow(e.now()), i.enter("chunkFlow", {
      _tokenizer: r,
      contentType: "flow",
      previous: s
    }), _(L);
  }
  function _(L) {
    if (L === null) {
      v(i.exit("chunkFlow"), !0), w(0), i.consume(L);
      return;
    }
    return wi(L) ? (i.consume(L), v(i.exit("chunkFlow")), n = 0, e.interrupt = void 0, a) : (i.consume(L), _);
  }
  function v(L, T) {
    const D = e.sliceStream(L);
    if (T && D.push(null), L.previous = s, s && (s.next = L), s = L, r.defineSkip(L.start), r.write(D), e.parser.lazy[L.start.line]) {
      let N = r.events.length;
      for (; N--; )
        if (
          // The token starts before the line ending…
          r.events[N][1].start.offset < o && // …and either is not ended yet…
          (!r.events[N][1].end || // …or ends after it.
          r.events[N][1].end.offset > o)
        )
          return;
      const R = e.events.length;
      let M = R, B, H;
      for (; M--; )
        if (e.events[M][0] === "exit" && e.events[M][1].type === "chunkFlow") {
          if (B) {
            H = e.events[M][1].end;
            break;
          }
          B = !0;
        }
      for (w(n), N = R; N < e.events.length; )
        e.events[N][1].end = {
          ...H
        }, N++;
      Uf(e.events, M + 1, 0, e.events.slice(R)), e.events.length = N;
    }
  }
  function w(L) {
    let T = t.length;
    for (; T-- > L; ) {
      const D = t[T];
      e.containerState = D[1], D[0].exit.call(e, i);
    }
    t.length = L;
  }
  function E() {
    r.write([null]), s = void 0, r = void 0, e.containerState._closeFlow = void 0;
  }
}
function c7t(i, e, t) {
  return us(i, i.attempt(this.parser.constructs.document, e, t), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
}
function IA(i) {
  if (i === null || Io(i) || OT(i))
    return 1;
  if (DY(i))
    return 2;
}
function IY(i, e, t) {
  const n = [];
  let r = -1;
  for (; ++r < i.length; ) {
    const s = i[r].resolveAll;
    s && !n.includes(s) && (e = s(e, t), n.push(s));
  }
  return e;
}
const bde = {
  name: "attention",
  resolveAll: u7t,
  tokenize: d7t
};
function u7t(i, e) {
  let t = -1, n, r, s, o, a, l, c, u;
  for (; ++t < i.length; )
    if (i[t][0] === "enter" && i[t][1].type === "attentionSequence" && i[t][1]._close) {
      for (n = t; n--; )
        if (i[n][0] === "exit" && i[n][1].type === "attentionSequence" && i[n][1]._open && // If the markers are the same:
        e.sliceSerialize(i[n][1]).charCodeAt(0) === e.sliceSerialize(i[t][1]).charCodeAt(0)) {
          if ((i[n][1]._close || i[t][1]._open) && (i[t][1].end.offset - i[t][1].start.offset) % 3 && !((i[n][1].end.offset - i[n][1].start.offset + i[t][1].end.offset - i[t][1].start.offset) % 3))
            continue;
          l = i[n][1].end.offset - i[n][1].start.offset > 1 && i[t][1].end.offset - i[t][1].start.offset > 1 ? 2 : 1;
          const d = {
            ...i[n][1].end
          }, h = {
            ...i[t][1].start
          };
          UAe(d, -l), UAe(h, l), o = {
            type: l > 1 ? "strongSequence" : "emphasisSequence",
            start: d,
            end: {
              ...i[n][1].end
            }
          }, a = {
            type: l > 1 ? "strongSequence" : "emphasisSequence",
            start: {
              ...i[t][1].start
            },
            end: h
          }, s = {
            type: l > 1 ? "strongText" : "emphasisText",
            start: {
              ...i[n][1].end
            },
            end: {
              ...i[t][1].start
            }
          }, r = {
            type: l > 1 ? "strong" : "emphasis",
            start: {
              ...o.start
            },
            end: {
              ...a.end
            }
          }, i[n][1].end = {
            ...o.start
          }, i[t][1].start = {
            ...a.end
          }, c = [], i[n][1].end.offset - i[n][1].start.offset && (c = Hg(c, [["enter", i[n][1], e], ["exit", i[n][1], e]])), c = Hg(c, [["enter", r, e], ["enter", o, e], ["exit", o, e], ["enter", s, e]]), c = Hg(c, IY(e.parser.constructs.insideSpan.null, i.slice(n + 1, t), e)), c = Hg(c, [["exit", s, e], ["enter", a, e], ["exit", a, e], ["exit", r, e]]), i[t][1].end.offset - i[t][1].start.offset ? (u = 2, c = Hg(c, [["enter", i[t][1], e], ["exit", i[t][1], e]])) : u = 0, Uf(i, n - 1, t - n + 3, c), t = n + c.length - u - 2;
          break;
        }
    }
  for (t = -1; ++t < i.length; )
    i[t][1].type === "attentionSequence" && (i[t][1].type = "data");
  return i;
}
function d7t(i, e) {
  const t = this.parser.constructs.attentionMarkers.null, n = this.previous, r = IA(n);
  let s;
  return o;
  function o(l) {
    return s = l, i.enter("attentionSequence"), a(l);
  }
  function a(l) {
    if (l === s)
      return i.consume(l), a;
    const c = i.exit("attentionSequence"), u = IA(l), d = !u || u === 2 && r || t.includes(l), h = !r || r === 2 && u || t.includes(n);
    return c._open = !!(s === 42 ? d : d && (r || !h)), c._close = !!(s === 42 ? h : h && (u || !d)), e(l);
  }
}
function UAe(i, e) {
  i.column += e, i.offset += e, i._bufferIndex += e;
}
const h7t = {
  name: "autolink",
  tokenize: f7t
};
function f7t(i, e, t) {
  let n = 0;
  return r;
  function r(g) {
    return i.enter("autolink"), i.enter("autolinkMarker"), i.consume(g), i.exit("autolinkMarker"), i.enter("autolinkProtocol"), s;
  }
  function s(g) {
    return Rd(g) ? (i.consume(g), o) : g === 64 ? t(g) : c(g);
  }
  function o(g) {
    return g === 43 || g === 45 || g === 46 || Gu(g) ? (n = 1, a(g)) : c(g);
  }
  function a(g) {
    return g === 58 ? (i.consume(g), n = 0, l) : (g === 43 || g === 45 || g === 46 || Gu(g)) && n++ < 32 ? (i.consume(g), a) : (n = 0, c(g));
  }
  function l(g) {
    return g === 62 ? (i.exit("autolinkProtocol"), i.enter("autolinkMarker"), i.consume(g), i.exit("autolinkMarker"), i.exit("autolink"), e) : g === null || g === 32 || g === 60 || z$(g) ? t(g) : (i.consume(g), l);
  }
  function c(g) {
    return g === 64 ? (i.consume(g), u) : n7t(g) ? (i.consume(g), c) : t(g);
  }
  function u(g) {
    return Gu(g) ? d(g) : t(g);
  }
  function d(g) {
    return g === 46 ? (i.consume(g), n = 0, u) : g === 62 ? (i.exit("autolinkProtocol").type = "autolinkEmail", i.enter("autolinkMarker"), i.consume(g), i.exit("autolinkMarker"), i.exit("autolink"), e) : h(g);
  }
  function h(g) {
    if ((g === 45 || Gu(g)) && n++ < 63) {
      const m = g === 45 ? h : d;
      return i.consume(g), m;
    }
    return t(g);
  }
}
const p6 = {
  partial: !0,
  tokenize: g7t
};
function g7t(i, e, t) {
  return n;
  function n(s) {
    return Pr(s) ? us(i, r, "linePrefix")(s) : r(s);
  }
  function r(s) {
    return s === null || wi(s) ? e(s) : t(s);
  }
}
const WHe = {
  continuation: {
    tokenize: m7t
  },
  exit: _7t,
  name: "blockQuote",
  tokenize: p7t
};
function p7t(i, e, t) {
  const n = this;
  return r;
  function r(o) {
    if (o === 62) {
      const a = n.containerState;
      return a.open || (i.enter("blockQuote", {
        _container: !0
      }), a.open = !0), i.enter("blockQuotePrefix"), i.enter("blockQuoteMarker"), i.consume(o), i.exit("blockQuoteMarker"), s;
    }
    return t(o);
  }
  function s(o) {
    return Pr(o) ? (i.enter("blockQuotePrefixWhitespace"), i.consume(o), i.exit("blockQuotePrefixWhitespace"), i.exit("blockQuotePrefix"), e) : (i.exit("blockQuotePrefix"), e(o));
  }
}
function m7t(i, e, t) {
  const n = this;
  return r;
  function r(o) {
    return Pr(o) ? us(i, s, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(o) : s(o);
  }
  function s(o) {
    return i.attempt(WHe, e, t)(o);
  }
}
function _7t(i) {
  i.exit("blockQuote");
}
const VHe = {
  name: "characterEscape",
  tokenize: b7t
};
function b7t(i, e, t) {
  return n;
  function n(s) {
    return i.enter("characterEscape"), i.enter("escapeMarker"), i.consume(s), i.exit("escapeMarker"), r;
  }
  function r(s) {
    return r7t(s) ? (i.enter("characterEscapeValue"), i.consume(s), i.exit("characterEscapeValue"), i.exit("characterEscape"), e) : t(s);
  }
}
const UHe = {
  name: "characterReference",
  tokenize: v7t
};
function v7t(i, e, t) {
  const n = this;
  let r = 0, s, o;
  return a;
  function a(d) {
    return i.enter("characterReference"), i.enter("characterReferenceMarker"), i.consume(d), i.exit("characterReferenceMarker"), l;
  }
  function l(d) {
    return d === 35 ? (i.enter("characterReferenceMarkerNumeric"), i.consume(d), i.exit("characterReferenceMarkerNumeric"), c) : (i.enter("characterReferenceValue"), s = 31, o = Gu, u(d));
  }
  function c(d) {
    return d === 88 || d === 120 ? (i.enter("characterReferenceMarkerHexadecimal"), i.consume(d), i.exit("characterReferenceMarkerHexadecimal"), i.enter("characterReferenceValue"), s = 6, o = i7t, u) : (i.enter("characterReferenceValue"), s = 7, o = _de, u(d));
  }
  function u(d) {
    if (d === 59 && r) {
      const h = i.exit("characterReferenceValue");
      return o === Gu && !$5(n.sliceSerialize(h)) ? t(d) : (i.enter("characterReferenceMarker"), i.consume(d), i.exit("characterReferenceMarker"), i.exit("characterReference"), e);
    }
    return o(d) && r++ < s ? (i.consume(d), u) : t(d);
  }
}
const zAe = {
  partial: !0,
  tokenize: C7t
}, $Ae = {
  concrete: !0,
  name: "codeFenced",
  tokenize: y7t
};
function y7t(i, e, t) {
  const n = this, r = {
    partial: !0,
    tokenize: D
  };
  let s = 0, o = 0, a;
  return l;
  function l(N) {
    return c(N);
  }
  function c(N) {
    const R = n.events[n.events.length - 1];
    return s = R && R[1].type === "linePrefix" ? R[2].sliceSerialize(R[1], !0).length : 0, a = N, i.enter("codeFenced"), i.enter("codeFencedFence"), i.enter("codeFencedFenceSequence"), u(N);
  }
  function u(N) {
    return N === a ? (o++, i.consume(N), u) : o < 3 ? t(N) : (i.exit("codeFencedFenceSequence"), Pr(N) ? us(i, d, "whitespace")(N) : d(N));
  }
  function d(N) {
    return N === null || wi(N) ? (i.exit("codeFencedFence"), n.interrupt ? e(N) : i.check(zAe, _, T)(N)) : (i.enter("codeFencedFenceInfo"), i.enter("chunkString", {
      contentType: "string"
    }), h(N));
  }
  function h(N) {
    return N === null || wi(N) ? (i.exit("chunkString"), i.exit("codeFencedFenceInfo"), d(N)) : Pr(N) ? (i.exit("chunkString"), i.exit("codeFencedFenceInfo"), us(i, g, "whitespace")(N)) : N === 96 && N === a ? t(N) : (i.consume(N), h);
  }
  function g(N) {
    return N === null || wi(N) ? d(N) : (i.enter("codeFencedFenceMeta"), i.enter("chunkString", {
      contentType: "string"
    }), m(N));
  }
  function m(N) {
    return N === null || wi(N) ? (i.exit("chunkString"), i.exit("codeFencedFenceMeta"), d(N)) : N === 96 && N === a ? t(N) : (i.consume(N), m);
  }
  function _(N) {
    return i.attempt(r, T, v)(N);
  }
  function v(N) {
    return i.enter("lineEnding"), i.consume(N), i.exit("lineEnding"), w;
  }
  function w(N) {
    return s > 0 && Pr(N) ? us(i, E, "linePrefix", s + 1)(N) : E(N);
  }
  function E(N) {
    return N === null || wi(N) ? i.check(zAe, _, T)(N) : (i.enter("codeFlowValue"), L(N));
  }
  function L(N) {
    return N === null || wi(N) ? (i.exit("codeFlowValue"), E(N)) : (i.consume(N), L);
  }
  function T(N) {
    return i.exit("codeFenced"), e(N);
  }
  function D(N, R, M) {
    let B = 0;
    return H;
    function H(G) {
      return N.enter("lineEnding"), N.consume(G), N.exit("lineEnding"), j;
    }
    function j(G) {
      return N.enter("codeFencedFence"), Pr(G) ? us(N, K, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(G) : K(G);
    }
    function K(G) {
      return G === a ? (N.enter("codeFencedFenceSequence"), X(G)) : M(G);
    }
    function X(G) {
      return G === a ? (B++, N.consume(G), X) : B >= o ? (N.exit("codeFencedFenceSequence"), Pr(G) ? us(N, Y, "whitespace")(G) : Y(G)) : M(G);
    }
    function Y(G) {
      return G === null || wi(G) ? (N.exit("codeFencedFence"), R(G)) : M(G);
    }
  }
}
function C7t(i, e, t) {
  const n = this;
  return r;
  function r(o) {
    return o === null ? t(o) : (i.enter("lineEnding"), i.consume(o), i.exit("lineEnding"), s);
  }
  function s(o) {
    return n.parser.lazy[n.now().line] ? t(o) : e(o);
  }
}
const lne = {
  name: "codeIndented",
  tokenize: S7t
}, w7t = {
  partial: !0,
  tokenize: E7t
};
function S7t(i, e, t) {
  const n = this;
  return r;
  function r(c) {
    return i.enter("codeIndented"), us(i, s, "linePrefix", 5)(c);
  }
  function s(c) {
    const u = n.events[n.events.length - 1];
    return u && u[1].type === "linePrefix" && u[2].sliceSerialize(u[1], !0).length >= 4 ? o(c) : t(c);
  }
  function o(c) {
    return c === null ? l(c) : wi(c) ? i.attempt(w7t, o, l)(c) : (i.enter("codeFlowValue"), a(c));
  }
  function a(c) {
    return c === null || wi(c) ? (i.exit("codeFlowValue"), o(c)) : (i.consume(c), a);
  }
  function l(c) {
    return i.exit("codeIndented"), e(c);
  }
}
function E7t(i, e, t) {
  const n = this;
  return r;
  function r(o) {
    return n.parser.lazy[n.now().line] ? t(o) : wi(o) ? (i.enter("lineEnding"), i.consume(o), i.exit("lineEnding"), r) : us(i, s, "linePrefix", 5)(o);
  }
  function s(o) {
    const a = n.events[n.events.length - 1];
    return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? e(o) : wi(o) ? r(o) : t(o);
  }
}
const x7t = {
  name: "codeText",
  previous: T7t,
  resolve: L7t,
  tokenize: k7t
};
function L7t(i) {
  let e = i.length - 4, t = 3, n, r;
  if ((i[t][1].type === "lineEnding" || i[t][1].type === "space") && (i[e][1].type === "lineEnding" || i[e][1].type === "space")) {
    for (n = t; ++n < e; )
      if (i[n][1].type === "codeTextData") {
        i[t][1].type = "codeTextPadding", i[e][1].type = "codeTextPadding", t += 2, e -= 2;
        break;
      }
  }
  for (n = t - 1, e++; ++n <= e; )
    r === void 0 ? n !== e && i[n][1].type !== "lineEnding" && (r = n) : (n === e || i[n][1].type === "lineEnding") && (i[r][1].type = "codeTextData", n !== r + 2 && (i[r][1].end = i[n - 1][1].end, i.splice(r + 2, n - r - 2), e -= n - r - 2, n = r + 2), r = void 0);
  return i;
}
function T7t(i) {
  return i !== 96 || this.events[this.events.length - 1][1].type === "characterEscape";
}
function k7t(i, e, t) {
  let n = 0, r, s;
  return o;
  function o(d) {
    return i.enter("codeText"), i.enter("codeTextSequence"), a(d);
  }
  function a(d) {
    return d === 96 ? (i.consume(d), n++, a) : (i.exit("codeTextSequence"), l(d));
  }
  function l(d) {
    return d === null ? t(d) : d === 32 ? (i.enter("space"), i.consume(d), i.exit("space"), l) : d === 96 ? (s = i.enter("codeTextSequence"), r = 0, u(d)) : wi(d) ? (i.enter("lineEnding"), i.consume(d), i.exit("lineEnding"), l) : (i.enter("codeTextData"), c(d));
  }
  function c(d) {
    return d === null || d === 32 || d === 96 || wi(d) ? (i.exit("codeTextData"), l(d)) : (i.consume(d), c);
  }
  function u(d) {
    return d === 96 ? (i.consume(d), r++, u) : r === n ? (i.exit("codeTextSequence"), i.exit("codeText"), e(d)) : (s.type = "codeTextData", c(d));
  }
}
class D7t {
  /**
   * @param {ReadonlyArray<T> | null | undefined} [initial]
   *   Initial items (optional).
   * @returns
   *   Splice buffer.
   */
  constructor(e) {
    this.left = e ? [...e] : [], this.right = [];
  }
  /**
   * Array access;
   * does not move the cursor.
   *
   * @param {number} index
   *   Index.
   * @return {T}
   *   Item.
   */
  get(e) {
    if (e < 0 || e >= this.left.length + this.right.length)
      throw new RangeError("Cannot access index `" + e + "` in a splice buffer of size `" + (this.left.length + this.right.length) + "`");
    return e < this.left.length ? this.left[e] : this.right[this.right.length - e + this.left.length - 1];
  }
  /**
   * The length of the splice buffer, one greater than the largest index in the
   * array.
   */
  get length() {
    return this.left.length + this.right.length;
  }
  /**
   * Remove and return `list[0]`;
   * moves the cursor to `0`.
   *
   * @returns {T | undefined}
   *   Item, optional.
   */
  shift() {
    return this.setCursor(0), this.right.pop();
  }
  /**
   * Slice the buffer to get an array;
   * does not move the cursor.
   *
   * @param {number} start
   *   Start.
   * @param {number | null | undefined} [end]
   *   End (optional).
   * @returns {Array<T>}
   *   Array of items.
   */
  slice(e, t) {
    const n = t ?? Number.POSITIVE_INFINITY;
    return n < this.left.length ? this.left.slice(e, n) : e > this.left.length ? this.right.slice(this.right.length - n + this.left.length, this.right.length - e + this.left.length).reverse() : this.left.slice(e).concat(this.right.slice(this.right.length - n + this.left.length).reverse());
  }
  /**
   * Mimics the behavior of Array.prototype.splice() except for the change of
   * interface necessary to avoid segfaults when patching in very large arrays.
   *
   * This operation moves cursor is moved to `start` and results in the cursor
   * placed after any inserted items.
   *
   * @param {number} start
   *   Start;
   *   zero-based index at which to start changing the array;
   *   negative numbers count backwards from the end of the array and values
   *   that are out-of bounds are clamped to the appropriate end of the array.
   * @param {number | null | undefined} [deleteCount=0]
   *   Delete count (default: `0`);
   *   maximum number of elements to delete, starting from start.
   * @param {Array<T> | null | undefined} [items=[]]
   *   Items to include in place of the deleted items (default: `[]`).
   * @return {Array<T>}
   *   Any removed items.
   */
  splice(e, t, n) {
    const r = t || 0;
    this.setCursor(Math.trunc(e));
    const s = this.right.splice(this.right.length - r, Number.POSITIVE_INFINITY);
    return n && LP(this.left, n), s.reverse();
  }
  /**
   * Remove and return the highest-numbered item in the array, so
   * `list[list.length - 1]`;
   * Moves the cursor to `length`.
   *
   * @returns {T | undefined}
   *   Item, optional.
   */
  pop() {
    return this.setCursor(Number.POSITIVE_INFINITY), this.left.pop();
  }
  /**
   * Inserts a single item to the high-numbered side of the array;
   * moves the cursor to `length`.
   *
   * @param {T} item
   *   Item.
   * @returns {undefined}
   *   Nothing.
   */
  push(e) {
    this.setCursor(Number.POSITIVE_INFINITY), this.left.push(e);
  }
  /**
   * Inserts many items to the high-numbered side of the array.
   * Moves the cursor to `length`.
   *
   * @param {Array<T>} items
   *   Items.
   * @returns {undefined}
   *   Nothing.
   */
  pushMany(e) {
    this.setCursor(Number.POSITIVE_INFINITY), LP(this.left, e);
  }
  /**
   * Inserts a single item to the low-numbered side of the array;
   * Moves the cursor to `0`.
   *
   * @param {T} item
   *   Item.
   * @returns {undefined}
   *   Nothing.
   */
  unshift(e) {
    this.setCursor(0), this.right.push(e);
  }
  /**
   * Inserts many items to the low-numbered side of the array;
   * moves the cursor to `0`.
   *
   * @param {Array<T>} items
   *   Items.
   * @returns {undefined}
   *   Nothing.
   */
  unshiftMany(e) {
    this.setCursor(0), LP(this.right, e.reverse());
  }
  /**
   * Move the cursor to a specific position in the array. Requires
   * time proportional to the distance moved.
   *
   * If `n < 0`, the cursor will end up at the beginning.
   * If `n > length`, the cursor will end up at the end.
   *
   * @param {number} n
   *   Position.
   * @return {undefined}
   *   Nothing.
   */
  setCursor(e) {
    if (!(e === this.left.length || e > this.left.length && this.right.length === 0 || e < 0 && this.left.length === 0))
      if (e < this.left.length) {
        const t = this.left.splice(e, Number.POSITIVE_INFINITY);
        LP(this.right, t.reverse());
      } else {
        const t = this.right.splice(this.left.length + this.right.length - e, Number.POSITIVE_INFINITY);
        LP(this.left, t.reverse());
      }
  }
}
function LP(i, e) {
  let t = 0;
  if (e.length < 1e4)
    i.push(...e);
  else
    for (; t < e.length; )
      i.push(...e.slice(t, t + 1e4)), t += 1e4;
}
function zHe(i) {
  const e = {};
  let t = -1, n, r, s, o, a, l, c;
  const u = new D7t(i);
  for (; ++t < u.length; ) {
    for (; t in e; )
      t = e[t];
    if (n = u.get(t), t && n[1].type === "chunkFlow" && u.get(t - 1)[1].type === "listItemPrefix" && (l = n[1]._tokenizer.events, s = 0, s < l.length && l[s][1].type === "lineEndingBlank" && (s += 2), s < l.length && l[s][1].type === "content"))
      for (; ++s < l.length && l[s][1].type !== "content"; )
        l[s][1].type === "chunkText" && (l[s][1]._isInFirstContentOfListItem = !0, s++);
    if (n[0] === "enter")
      n[1].contentType && (Object.assign(e, I7t(u, t)), t = e[t], c = !0);
    else if (n[1]._container) {
      for (s = t, r = void 0; s--; )
        if (o = u.get(s), o[1].type === "lineEnding" || o[1].type === "lineEndingBlank")
          o[0] === "enter" && (r && (u.get(r)[1].type = "lineEndingBlank"), o[1].type = "lineEnding", r = s);
        else if (!(o[1].type === "linePrefix" || o[1].type === "listItemIndent")) break;
      r && (n[1].end = {
        ...u.get(r)[1].start
      }, a = u.slice(r, t), a.unshift(n), u.splice(r, t - r + 1, a));
    }
  }
  return Uf(i, 0, Number.POSITIVE_INFINITY, u.slice(0)), !c;
}
function I7t(i, e) {
  const t = i.get(e)[1], n = i.get(e)[2];
  let r = e - 1;
  const s = [];
  let o = t._tokenizer;
  o || (o = n.parser[t.contentType](t.start), t._contentTypeTextTrailing && (o._contentTypeTextTrailing = !0));
  const a = o.events, l = [], c = {};
  let u, d, h = -1, g = t, m = 0, _ = 0;
  const v = [_];
  for (; g; ) {
    for (; i.get(++r)[1] !== g; )
      ;
    s.push(r), g._tokenizer || (u = n.sliceStream(g), g.next || u.push(null), d && o.defineSkip(g.start), g._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = !0), o.write(u), g._isInFirstContentOfListItem && (o._gfmTasklistFirstContentOfListItem = void 0)), d = g, g = g.next;
  }
  for (g = t; ++h < a.length; )
    // Find a void token that includes a break.
    a[h][0] === "exit" && a[h - 1][0] === "enter" && a[h][1].type === a[h - 1][1].type && a[h][1].start.line !== a[h][1].end.line && (_ = h + 1, v.push(_), g._tokenizer = void 0, g.previous = void 0, g = g.next);
  for (o.events = [], g ? (g._tokenizer = void 0, g.previous = void 0) : v.pop(), h = v.length; h--; ) {
    const w = a.slice(v[h], v[h + 1]), E = s.pop();
    l.push([E, E + w.length - 1]), i.splice(E, 2, w);
  }
  for (l.reverse(), h = -1; ++h < l.length; )
    c[m + l[h][0]] = m + l[h][1], m += l[h][1] - l[h][0] - 1;
  return c;
}
const N7t = {
  resolve: A7t,
  tokenize: O7t
}, R7t = {
  partial: !0,
  tokenize: M7t
};
function A7t(i) {
  return zHe(i), i;
}
function O7t(i, e) {
  let t;
  return n;
  function n(a) {
    return i.enter("content"), t = i.enter("chunkContent", {
      contentType: "content"
    }), r(a);
  }
  function r(a) {
    return a === null ? s(a) : wi(a) ? i.check(R7t, o, s)(a) : (i.consume(a), r);
  }
  function s(a) {
    return i.exit("chunkContent"), i.exit("content"), e(a);
  }
  function o(a) {
    return i.consume(a), i.exit("chunkContent"), t.next = i.enter("chunkContent", {
      contentType: "content",
      previous: t
    }), t = t.next, r;
  }
}
function M7t(i, e, t) {
  const n = this;
  return r;
  function r(o) {
    return i.exit("chunkContent"), i.enter("lineEnding"), i.consume(o), i.exit("lineEnding"), us(i, s, "linePrefix");
  }
  function s(o) {
    if (o === null || wi(o))
      return t(o);
    const a = n.events[n.events.length - 1];
    return !n.parser.constructs.disable.null.includes("codeIndented") && a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? e(o) : i.interrupt(n.parser.constructs.flow, t, e)(o);
  }
}
function $He(i, e, t, n, r, s, o, a, l) {
  const c = l || Number.POSITIVE_INFINITY;
  let u = 0;
  return d;
  function d(w) {
    return w === 60 ? (i.enter(n), i.enter(r), i.enter(s), i.consume(w), i.exit(s), h) : w === null || w === 32 || w === 41 || z$(w) ? t(w) : (i.enter(n), i.enter(o), i.enter(a), i.enter("chunkString", {
      contentType: "string"
    }), _(w));
  }
  function h(w) {
    return w === 62 ? (i.enter(s), i.consume(w), i.exit(s), i.exit(r), i.exit(n), e) : (i.enter(a), i.enter("chunkString", {
      contentType: "string"
    }), g(w));
  }
  function g(w) {
    return w === 62 ? (i.exit("chunkString"), i.exit(a), h(w)) : w === null || w === 60 || wi(w) ? t(w) : (i.consume(w), w === 92 ? m : g);
  }
  function m(w) {
    return w === 60 || w === 62 || w === 92 ? (i.consume(w), g) : g(w);
  }
  function _(w) {
    return !u && (w === null || w === 41 || Io(w)) ? (i.exit("chunkString"), i.exit(a), i.exit(o), i.exit(n), e(w)) : u < c && w === 40 ? (i.consume(w), u++, _) : w === 41 ? (i.consume(w), u--, _) : w === null || w === 32 || w === 40 || z$(w) ? t(w) : (i.consume(w), w === 92 ? v : _);
  }
  function v(w) {
    return w === 40 || w === 41 || w === 92 ? (i.consume(w), _) : _(w);
  }
}
function jHe(i, e, t, n, r, s) {
  const o = this;
  let a = 0, l;
  return c;
  function c(g) {
    return i.enter(n), i.enter(r), i.consume(g), i.exit(r), i.enter(s), u;
  }
  function u(g) {
    return a > 999 || g === null || g === 91 || g === 93 && !l || // To do: remove in the future once we’ve switched from
    // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
    // which doesn’t need this.
    // Hidden footnotes hook.
    /* c8 ignore next 3 */
    g === 94 && !a && "_hiddenFootnoteSupport" in o.parser.constructs ? t(g) : g === 93 ? (i.exit(s), i.enter(r), i.consume(g), i.exit(r), i.exit(n), e) : wi(g) ? (i.enter("lineEnding"), i.consume(g), i.exit("lineEnding"), u) : (i.enter("chunkString", {
      contentType: "string"
    }), d(g));
  }
  function d(g) {
    return g === null || g === 91 || g === 93 || wi(g) || a++ > 999 ? (i.exit("chunkString"), u(g)) : (i.consume(g), l || (l = !Pr(g)), g === 92 ? h : d);
  }
  function h(g) {
    return g === 91 || g === 92 || g === 93 ? (i.consume(g), a++, d) : d(g);
  }
}
function GHe(i, e, t, n, r, s) {
  let o;
  return a;
  function a(h) {
    return h === 34 || h === 39 || h === 40 ? (i.enter(n), i.enter(r), i.consume(h), i.exit(r), o = h === 40 ? 41 : h, l) : t(h);
  }
  function l(h) {
    return h === o ? (i.enter(r), i.consume(h), i.exit(r), i.exit(n), e) : (i.enter(s), c(h));
  }
  function c(h) {
    return h === o ? (i.exit(s), l(o)) : h === null ? t(h) : wi(h) ? (i.enter("lineEnding"), i.consume(h), i.exit("lineEnding"), us(i, c, "linePrefix")) : (i.enter("chunkString", {
      contentType: "string"
    }), u(h));
  }
  function u(h) {
    return h === o || h === null || wi(h) ? (i.exit("chunkString"), c(h)) : (i.consume(h), h === 92 ? d : u);
  }
  function d(h) {
    return h === o || h === 92 ? (i.consume(h), u) : u(h);
  }
}
function w3(i, e) {
  let t;
  return n;
  function n(r) {
    return wi(r) ? (i.enter("lineEnding"), i.consume(r), i.exit("lineEnding"), t = !0, n) : Pr(r) ? us(i, n, t ? "linePrefix" : "lineSuffix")(r) : e(r);
  }
}
const P7t = {
  name: "definition",
  tokenize: B7t
}, F7t = {
  partial: !0,
  tokenize: H7t
};
function B7t(i, e, t) {
  const n = this;
  let r;
  return s;
  function s(g) {
    return i.enter("definition"), o(g);
  }
  function o(g) {
    return jHe.call(
      n,
      i,
      a,
      // Note: we don’t need to reset the way `markdown-rs` does.
      t,
      "definitionLabel",
      "definitionLabelMarker",
      "definitionLabelString"
    )(g);
  }
  function a(g) {
    return r = cm(n.sliceSerialize(n.events[n.events.length - 1][1]).slice(1, -1)), g === 58 ? (i.enter("definitionMarker"), i.consume(g), i.exit("definitionMarker"), l) : t(g);
  }
  function l(g) {
    return Io(g) ? w3(i, c)(g) : c(g);
  }
  function c(g) {
    return $He(
      i,
      u,
      // Note: we don’t need to reset the way `markdown-rs` does.
      t,
      "definitionDestination",
      "definitionDestinationLiteral",
      "definitionDestinationLiteralMarker",
      "definitionDestinationRaw",
      "definitionDestinationString"
    )(g);
  }
  function u(g) {
    return i.attempt(F7t, d, d)(g);
  }
  function d(g) {
    return Pr(g) ? us(i, h, "whitespace")(g) : h(g);
  }
  function h(g) {
    return g === null || wi(g) ? (i.exit("definition"), n.parser.defined.push(r), e(g)) : t(g);
  }
}
function H7t(i, e, t) {
  return n;
  function n(a) {
    return Io(a) ? w3(i, r)(a) : t(a);
  }
  function r(a) {
    return GHe(i, s, t, "definitionTitle", "definitionTitleMarker", "definitionTitleString")(a);
  }
  function s(a) {
    return Pr(a) ? us(i, o, "whitespace")(a) : o(a);
  }
  function o(a) {
    return a === null || wi(a) ? e(a) : t(a);
  }
}
const W7t = {
  name: "hardBreakEscape",
  tokenize: V7t
};
function V7t(i, e, t) {
  return n;
  function n(s) {
    return i.enter("hardBreakEscape"), i.consume(s), r;
  }
  function r(s) {
    return wi(s) ? (i.exit("hardBreakEscape"), e(s)) : t(s);
  }
}
const U7t = {
  name: "headingAtx",
  resolve: z7t,
  tokenize: $7t
};
function z7t(i, e) {
  let t = i.length - 2, n = 3, r, s;
  return i[n][1].type === "whitespace" && (n += 2), t - 2 > n && i[t][1].type === "whitespace" && (t -= 2), i[t][1].type === "atxHeadingSequence" && (n === t - 1 || t - 4 > n && i[t - 2][1].type === "whitespace") && (t -= n + 1 === t ? 2 : 4), t > n && (r = {
    type: "atxHeadingText",
    start: i[n][1].start,
    end: i[t][1].end
  }, s = {
    type: "chunkText",
    start: i[n][1].start,
    end: i[t][1].end,
    contentType: "text"
  }, Uf(i, n, t - n + 1, [["enter", r, e], ["enter", s, e], ["exit", s, e], ["exit", r, e]])), i;
}
function $7t(i, e, t) {
  let n = 0;
  return r;
  function r(u) {
    return i.enter("atxHeading"), s(u);
  }
  function s(u) {
    return i.enter("atxHeadingSequence"), o(u);
  }
  function o(u) {
    return u === 35 && n++ < 6 ? (i.consume(u), o) : u === null || Io(u) ? (i.exit("atxHeadingSequence"), a(u)) : t(u);
  }
  function a(u) {
    return u === 35 ? (i.enter("atxHeadingSequence"), l(u)) : u === null || wi(u) ? (i.exit("atxHeading"), e(u)) : Pr(u) ? us(i, a, "whitespace")(u) : (i.enter("atxHeadingText"), c(u));
  }
  function l(u) {
    return u === 35 ? (i.consume(u), l) : (i.exit("atxHeadingSequence"), a(u));
  }
  function c(u) {
    return u === null || u === 35 || Io(u) ? (i.exit("atxHeadingText"), a(u)) : (i.consume(u), c);
  }
}
const j7t = [
  "address",
  "article",
  "aside",
  "base",
  "basefont",
  "blockquote",
  "body",
  "caption",
  "center",
  "col",
  "colgroup",
  "dd",
  "details",
  "dialog",
  "dir",
  "div",
  "dl",
  "dt",
  "fieldset",
  "figcaption",
  "figure",
  "footer",
  "form",
  "frame",
  "frameset",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "head",
  "header",
  "hr",
  "html",
  "iframe",
  "legend",
  "li",
  "link",
  "main",
  "menu",
  "menuitem",
  "nav",
  "noframes",
  "ol",
  "optgroup",
  "option",
  "p",
  "param",
  "search",
  "section",
  "summary",
  "table",
  "tbody",
  "td",
  "tfoot",
  "th",
  "thead",
  "title",
  "tr",
  "track",
  "ul"
], jAe = ["pre", "script", "style", "textarea"], G7t = {
  concrete: !0,
  name: "htmlFlow",
  resolveTo: Y7t,
  tokenize: X7t
}, q7t = {
  partial: !0,
  tokenize: Q7t
}, K7t = {
  partial: !0,
  tokenize: Z7t
};
function Y7t(i) {
  let e = i.length;
  for (; e-- && !(i[e][0] === "enter" && i[e][1].type === "htmlFlow"); )
    ;
  return e > 1 && i[e - 2][1].type === "linePrefix" && (i[e][1].start = i[e - 2][1].start, i[e + 1][1].start = i[e - 2][1].start, i.splice(e - 2, 2)), i;
}
function X7t(i, e, t) {
  const n = this;
  let r, s, o, a, l;
  return c;
  function c(re) {
    return u(re);
  }
  function u(re) {
    return i.enter("htmlFlow"), i.enter("htmlFlowData"), i.consume(re), d;
  }
  function d(re) {
    return re === 33 ? (i.consume(re), h) : re === 47 ? (i.consume(re), s = !0, _) : re === 63 ? (i.consume(re), r = 3, n.interrupt ? e : J) : Rd(re) ? (i.consume(re), o = String.fromCharCode(re), v) : t(re);
  }
  function h(re) {
    return re === 45 ? (i.consume(re), r = 2, g) : re === 91 ? (i.consume(re), r = 5, a = 0, m) : Rd(re) ? (i.consume(re), r = 4, n.interrupt ? e : J) : t(re);
  }
  function g(re) {
    return re === 45 ? (i.consume(re), n.interrupt ? e : J) : t(re);
  }
  function m(re) {
    const ze = "CDATA[";
    return re === ze.charCodeAt(a++) ? (i.consume(re), a === ze.length ? n.interrupt ? e : K : m) : t(re);
  }
  function _(re) {
    return Rd(re) ? (i.consume(re), o = String.fromCharCode(re), v) : t(re);
  }
  function v(re) {
    if (re === null || re === 47 || re === 62 || Io(re)) {
      const ze = re === 47, Ve = o.toLowerCase();
      return !ze && !s && jAe.includes(Ve) ? (r = 1, n.interrupt ? e(re) : K(re)) : j7t.includes(o.toLowerCase()) ? (r = 6, ze ? (i.consume(re), w) : n.interrupt ? e(re) : K(re)) : (r = 7, n.interrupt && !n.parser.lazy[n.now().line] ? t(re) : s ? E(re) : L(re));
    }
    return re === 45 || Gu(re) ? (i.consume(re), o += String.fromCharCode(re), v) : t(re);
  }
  function w(re) {
    return re === 62 ? (i.consume(re), n.interrupt ? e : K) : t(re);
  }
  function E(re) {
    return Pr(re) ? (i.consume(re), E) : H(re);
  }
  function L(re) {
    return re === 47 ? (i.consume(re), H) : re === 58 || re === 95 || Rd(re) ? (i.consume(re), T) : Pr(re) ? (i.consume(re), L) : H(re);
  }
  function T(re) {
    return re === 45 || re === 46 || re === 58 || re === 95 || Gu(re) ? (i.consume(re), T) : D(re);
  }
  function D(re) {
    return re === 61 ? (i.consume(re), N) : Pr(re) ? (i.consume(re), D) : L(re);
  }
  function N(re) {
    return re === null || re === 60 || re === 61 || re === 62 || re === 96 ? t(re) : re === 34 || re === 39 ? (i.consume(re), l = re, R) : Pr(re) ? (i.consume(re), N) : M(re);
  }
  function R(re) {
    return re === l ? (i.consume(re), l = null, B) : re === null || wi(re) ? t(re) : (i.consume(re), R);
  }
  function M(re) {
    return re === null || re === 34 || re === 39 || re === 47 || re === 60 || re === 61 || re === 62 || re === 96 || Io(re) ? D(re) : (i.consume(re), M);
  }
  function B(re) {
    return re === 47 || re === 62 || Pr(re) ? L(re) : t(re);
  }
  function H(re) {
    return re === 62 ? (i.consume(re), j) : t(re);
  }
  function j(re) {
    return re === null || wi(re) ? K(re) : Pr(re) ? (i.consume(re), j) : t(re);
  }
  function K(re) {
    return re === 45 && r === 2 ? (i.consume(re), Q) : re === 60 && r === 1 ? (i.consume(re), oe) : re === 62 && r === 4 ? (i.consume(re), ae) : re === 63 && r === 3 ? (i.consume(re), J) : re === 93 && r === 5 ? (i.consume(re), pe) : wi(re) && (r === 6 || r === 7) ? (i.exit("htmlFlowData"), i.check(q7t, be, X)(re)) : re === null || wi(re) ? (i.exit("htmlFlowData"), X(re)) : (i.consume(re), K);
  }
  function X(re) {
    return i.check(K7t, Y, be)(re);
  }
  function Y(re) {
    return i.enter("lineEnding"), i.consume(re), i.exit("lineEnding"), G;
  }
  function G(re) {
    return re === null || wi(re) ? X(re) : (i.enter("htmlFlowData"), K(re));
  }
  function Q(re) {
    return re === 45 ? (i.consume(re), J) : K(re);
  }
  function oe(re) {
    return re === 47 ? (i.consume(re), o = "", Z) : K(re);
  }
  function Z(re) {
    if (re === 62) {
      const ze = o.toLowerCase();
      return jAe.includes(ze) ? (i.consume(re), ae) : K(re);
    }
    return Rd(re) && o.length < 8 ? (i.consume(re), o += String.fromCharCode(re), Z) : K(re);
  }
  function pe(re) {
    return re === 93 ? (i.consume(re), J) : K(re);
  }
  function J(re) {
    return re === 62 ? (i.consume(re), ae) : re === 45 && r === 2 ? (i.consume(re), J) : K(re);
  }
  function ae(re) {
    return re === null || wi(re) ? (i.exit("htmlFlowData"), be(re)) : (i.consume(re), ae);
  }
  function be(re) {
    return i.exit("htmlFlow"), e(re);
  }
}
function Z7t(i, e, t) {
  const n = this;
  return r;
  function r(o) {
    return wi(o) ? (i.enter("lineEnding"), i.consume(o), i.exit("lineEnding"), s) : t(o);
  }
  function s(o) {
    return n.parser.lazy[n.now().line] ? t(o) : e(o);
  }
}
function Q7t(i, e, t) {
  return n;
  function n(r) {
    return i.enter("lineEnding"), i.consume(r), i.exit("lineEnding"), i.attempt(p6, e, t);
  }
}
const J7t = {
  name: "htmlText",
  tokenize: eHt
};
function eHt(i, e, t) {
  const n = this;
  let r, s, o;
  return a;
  function a(J) {
    return i.enter("htmlText"), i.enter("htmlTextData"), i.consume(J), l;
  }
  function l(J) {
    return J === 33 ? (i.consume(J), c) : J === 47 ? (i.consume(J), D) : J === 63 ? (i.consume(J), L) : Rd(J) ? (i.consume(J), M) : t(J);
  }
  function c(J) {
    return J === 45 ? (i.consume(J), u) : J === 91 ? (i.consume(J), s = 0, m) : Rd(J) ? (i.consume(J), E) : t(J);
  }
  function u(J) {
    return J === 45 ? (i.consume(J), g) : t(J);
  }
  function d(J) {
    return J === null ? t(J) : J === 45 ? (i.consume(J), h) : wi(J) ? (o = d, oe(J)) : (i.consume(J), d);
  }
  function h(J) {
    return J === 45 ? (i.consume(J), g) : d(J);
  }
  function g(J) {
    return J === 62 ? Q(J) : J === 45 ? h(J) : d(J);
  }
  function m(J) {
    const ae = "CDATA[";
    return J === ae.charCodeAt(s++) ? (i.consume(J), s === ae.length ? _ : m) : t(J);
  }
  function _(J) {
    return J === null ? t(J) : J === 93 ? (i.consume(J), v) : wi(J) ? (o = _, oe(J)) : (i.consume(J), _);
  }
  function v(J) {
    return J === 93 ? (i.consume(J), w) : _(J);
  }
  function w(J) {
    return J === 62 ? Q(J) : J === 93 ? (i.consume(J), w) : _(J);
  }
  function E(J) {
    return J === null || J === 62 ? Q(J) : wi(J) ? (o = E, oe(J)) : (i.consume(J), E);
  }
  function L(J) {
    return J === null ? t(J) : J === 63 ? (i.consume(J), T) : wi(J) ? (o = L, oe(J)) : (i.consume(J), L);
  }
  function T(J) {
    return J === 62 ? Q(J) : L(J);
  }
  function D(J) {
    return Rd(J) ? (i.consume(J), N) : t(J);
  }
  function N(J) {
    return J === 45 || Gu(J) ? (i.consume(J), N) : R(J);
  }
  function R(J) {
    return wi(J) ? (o = R, oe(J)) : Pr(J) ? (i.consume(J), R) : Q(J);
  }
  function M(J) {
    return J === 45 || Gu(J) ? (i.consume(J), M) : J === 47 || J === 62 || Io(J) ? B(J) : t(J);
  }
  function B(J) {
    return J === 47 ? (i.consume(J), Q) : J === 58 || J === 95 || Rd(J) ? (i.consume(J), H) : wi(J) ? (o = B, oe(J)) : Pr(J) ? (i.consume(J), B) : Q(J);
  }
  function H(J) {
    return J === 45 || J === 46 || J === 58 || J === 95 || Gu(J) ? (i.consume(J), H) : j(J);
  }
  function j(J) {
    return J === 61 ? (i.consume(J), K) : wi(J) ? (o = j, oe(J)) : Pr(J) ? (i.consume(J), j) : B(J);
  }
  function K(J) {
    return J === null || J === 60 || J === 61 || J === 62 || J === 96 ? t(J) : J === 34 || J === 39 ? (i.consume(J), r = J, X) : wi(J) ? (o = K, oe(J)) : Pr(J) ? (i.consume(J), K) : (i.consume(J), Y);
  }
  function X(J) {
    return J === r ? (i.consume(J), r = void 0, G) : J === null ? t(J) : wi(J) ? (o = X, oe(J)) : (i.consume(J), X);
  }
  function Y(J) {
    return J === null || J === 34 || J === 39 || J === 60 || J === 61 || J === 96 ? t(J) : J === 47 || J === 62 || Io(J) ? B(J) : (i.consume(J), Y);
  }
  function G(J) {
    return J === 47 || J === 62 || Io(J) ? B(J) : t(J);
  }
  function Q(J) {
    return J === 62 ? (i.consume(J), i.exit("htmlTextData"), i.exit("htmlText"), e) : t(J);
  }
  function oe(J) {
    return i.exit("htmlTextData"), i.enter("lineEnding"), i.consume(J), i.exit("lineEnding"), Z;
  }
  function Z(J) {
    return Pr(J) ? us(i, pe, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(J) : pe(J);
  }
  function pe(J) {
    return i.enter("htmlTextData"), o(J);
  }
}
const F0e = {
  name: "labelEnd",
  resolveAll: rHt,
  resolveTo: sHt,
  tokenize: oHt
}, tHt = {
  tokenize: aHt
}, nHt = {
  tokenize: lHt
}, iHt = {
  tokenize: cHt
};
function rHt(i) {
  let e = -1;
  const t = [];
  for (; ++e < i.length; ) {
    const n = i[e][1];
    if (t.push(i[e]), n.type === "labelImage" || n.type === "labelLink" || n.type === "labelEnd") {
      const r = n.type === "labelImage" ? 4 : 2;
      n.type = "data", e += r;
    }
  }
  return i.length !== t.length && Uf(i, 0, i.length, t), i;
}
function sHt(i, e) {
  let t = i.length, n = 0, r, s, o, a;
  for (; t--; )
    if (r = i[t][1], s) {
      if (r.type === "link" || r.type === "labelLink" && r._inactive)
        break;
      i[t][0] === "enter" && r.type === "labelLink" && (r._inactive = !0);
    } else if (o) {
      if (i[t][0] === "enter" && (r.type === "labelImage" || r.type === "labelLink") && !r._balanced && (s = t, r.type !== "labelLink")) {
        n = 2;
        break;
      }
    } else r.type === "labelEnd" && (o = t);
  const l = {
    type: i[s][1].type === "labelLink" ? "link" : "image",
    start: {
      ...i[s][1].start
    },
    end: {
      ...i[i.length - 1][1].end
    }
  }, c = {
    type: "label",
    start: {
      ...i[s][1].start
    },
    end: {
      ...i[o][1].end
    }
  }, u = {
    type: "labelText",
    start: {
      ...i[s + n + 2][1].end
    },
    end: {
      ...i[o - 2][1].start
    }
  };
  return a = [["enter", l, e], ["enter", c, e]], a = Hg(a, i.slice(s + 1, s + n + 3)), a = Hg(a, [["enter", u, e]]), a = Hg(a, IY(e.parser.constructs.insideSpan.null, i.slice(s + n + 4, o - 3), e)), a = Hg(a, [["exit", u, e], i[o - 2], i[o - 1], ["exit", c, e]]), a = Hg(a, i.slice(o + 1)), a = Hg(a, [["exit", l, e]]), Uf(i, s, i.length, a), i;
}
function oHt(i, e, t) {
  const n = this;
  let r = n.events.length, s, o;
  for (; r--; )
    if ((n.events[r][1].type === "labelImage" || n.events[r][1].type === "labelLink") && !n.events[r][1]._balanced) {
      s = n.events[r][1];
      break;
    }
  return a;
  function a(h) {
    return s ? s._inactive ? d(h) : (o = n.parser.defined.includes(cm(n.sliceSerialize({
      start: s.end,
      end: n.now()
    }))), i.enter("labelEnd"), i.enter("labelMarker"), i.consume(h), i.exit("labelMarker"), i.exit("labelEnd"), l) : t(h);
  }
  function l(h) {
    return h === 40 ? i.attempt(tHt, u, o ? u : d)(h) : h === 91 ? i.attempt(nHt, u, o ? c : d)(h) : o ? u(h) : d(h);
  }
  function c(h) {
    return i.attempt(iHt, u, d)(h);
  }
  function u(h) {
    return e(h);
  }
  function d(h) {
    return s._balanced = !0, t(h);
  }
}
function aHt(i, e, t) {
  return n;
  function n(d) {
    return i.enter("resource"), i.enter("resourceMarker"), i.consume(d), i.exit("resourceMarker"), r;
  }
  function r(d) {
    return Io(d) ? w3(i, s)(d) : s(d);
  }
  function s(d) {
    return d === 41 ? u(d) : $He(i, o, a, "resourceDestination", "resourceDestinationLiteral", "resourceDestinationLiteralMarker", "resourceDestinationRaw", "resourceDestinationString", 32)(d);
  }
  function o(d) {
    return Io(d) ? w3(i, l)(d) : u(d);
  }
  function a(d) {
    return t(d);
  }
  function l(d) {
    return d === 34 || d === 39 || d === 40 ? GHe(i, c, t, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(d) : u(d);
  }
  function c(d) {
    return Io(d) ? w3(i, u)(d) : u(d);
  }
  function u(d) {
    return d === 41 ? (i.enter("resourceMarker"), i.consume(d), i.exit("resourceMarker"), i.exit("resource"), e) : t(d);
  }
}
function lHt(i, e, t) {
  const n = this;
  return r;
  function r(a) {
    return jHe.call(n, i, s, o, "reference", "referenceMarker", "referenceString")(a);
  }
  function s(a) {
    return n.parser.defined.includes(cm(n.sliceSerialize(n.events[n.events.length - 1][1]).slice(1, -1))) ? e(a) : t(a);
  }
  function o(a) {
    return t(a);
  }
}
function cHt(i, e, t) {
  return n;
  function n(s) {
    return i.enter("reference"), i.enter("referenceMarker"), i.consume(s), i.exit("referenceMarker"), r;
  }
  function r(s) {
    return s === 93 ? (i.enter("referenceMarker"), i.consume(s), i.exit("referenceMarker"), i.exit("reference"), e) : t(s);
  }
}
const uHt = {
  name: "labelStartImage",
  resolveAll: F0e.resolveAll,
  tokenize: dHt
};
function dHt(i, e, t) {
  const n = this;
  return r;
  function r(a) {
    return i.enter("labelImage"), i.enter("labelImageMarker"), i.consume(a), i.exit("labelImageMarker"), s;
  }
  function s(a) {
    return a === 91 ? (i.enter("labelMarker"), i.consume(a), i.exit("labelMarker"), i.exit("labelImage"), o) : t(a);
  }
  function o(a) {
    return a === 94 && "_hiddenFootnoteSupport" in n.parser.constructs ? t(a) : e(a);
  }
}
const hHt = {
  name: "labelStartLink",
  resolveAll: F0e.resolveAll,
  tokenize: fHt
};
function fHt(i, e, t) {
  const n = this;
  return r;
  function r(o) {
    return i.enter("labelLink"), i.enter("labelMarker"), i.consume(o), i.exit("labelMarker"), i.exit("labelLink"), s;
  }
  function s(o) {
    return o === 94 && "_hiddenFootnoteSupport" in n.parser.constructs ? t(o) : e(o);
  }
}
const cne = {
  name: "lineEnding",
  tokenize: gHt
};
function gHt(i, e) {
  return t;
  function t(n) {
    return i.enter("lineEnding"), i.consume(n), i.exit("lineEnding"), us(i, e, "linePrefix");
  }
}
const sV = {
  name: "thematicBreak",
  tokenize: pHt
};
function pHt(i, e, t) {
  let n = 0, r;
  return s;
  function s(c) {
    return i.enter("thematicBreak"), o(c);
  }
  function o(c) {
    return r = c, a(c);
  }
  function a(c) {
    return c === r ? (i.enter("thematicBreakSequence"), l(c)) : n >= 3 && (c === null || wi(c)) ? (i.exit("thematicBreak"), e(c)) : t(c);
  }
  function l(c) {
    return c === r ? (i.consume(c), n++, l) : (i.exit("thematicBreakSequence"), Pr(c) ? us(i, a, "whitespace")(c) : a(c));
  }
}
const yh = {
  continuation: {
    tokenize: vHt
  },
  exit: CHt,
  name: "list",
  tokenize: bHt
}, mHt = {
  partial: !0,
  tokenize: wHt
}, _Ht = {
  partial: !0,
  tokenize: yHt
};
function bHt(i, e, t) {
  const n = this, r = n.events[n.events.length - 1];
  let s = r && r[1].type === "linePrefix" ? r[2].sliceSerialize(r[1], !0).length : 0, o = 0;
  return a;
  function a(g) {
    const m = n.containerState.type || (g === 42 || g === 43 || g === 45 ? "listUnordered" : "listOrdered");
    if (m === "listUnordered" ? !n.containerState.marker || g === n.containerState.marker : _de(g)) {
      if (n.containerState.type || (n.containerState.type = m, i.enter(m, {
        _container: !0
      })), m === "listUnordered")
        return i.enter("listItemPrefix"), g === 42 || g === 45 ? i.check(sV, t, c)(g) : c(g);
      if (!n.interrupt || g === 49)
        return i.enter("listItemPrefix"), i.enter("listItemValue"), l(g);
    }
    return t(g);
  }
  function l(g) {
    return _de(g) && ++o < 10 ? (i.consume(g), l) : (!n.interrupt || o < 2) && (n.containerState.marker ? g === n.containerState.marker : g === 41 || g === 46) ? (i.exit("listItemValue"), c(g)) : t(g);
  }
  function c(g) {
    return i.enter("listItemMarker"), i.consume(g), i.exit("listItemMarker"), n.containerState.marker = n.containerState.marker || g, i.check(
      p6,
      // Can’t be empty when interrupting.
      n.interrupt ? t : u,
      i.attempt(mHt, h, d)
    );
  }
  function u(g) {
    return n.containerState.initialBlankLine = !0, s++, h(g);
  }
  function d(g) {
    return Pr(g) ? (i.enter("listItemPrefixWhitespace"), i.consume(g), i.exit("listItemPrefixWhitespace"), h) : t(g);
  }
  function h(g) {
    return n.containerState.size = s + n.sliceSerialize(i.exit("listItemPrefix"), !0).length, e(g);
  }
}
function vHt(i, e, t) {
  const n = this;
  return n.containerState._closeFlow = void 0, i.check(p6, r, s);
  function r(a) {
    return n.containerState.furtherBlankLines = n.containerState.furtherBlankLines || n.containerState.initialBlankLine, us(i, e, "listItemIndent", n.containerState.size + 1)(a);
  }
  function s(a) {
    return n.containerState.furtherBlankLines || !Pr(a) ? (n.containerState.furtherBlankLines = void 0, n.containerState.initialBlankLine = void 0, o(a)) : (n.containerState.furtherBlankLines = void 0, n.containerState.initialBlankLine = void 0, i.attempt(_Ht, e, o)(a));
  }
  function o(a) {
    return n.containerState._closeFlow = !0, n.interrupt = void 0, us(i, i.attempt(yh, e, t), "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(a);
  }
}
function yHt(i, e, t) {
  const n = this;
  return us(i, r, "listItemIndent", n.containerState.size + 1);
  function r(s) {
    const o = n.events[n.events.length - 1];
    return o && o[1].type === "listItemIndent" && o[2].sliceSerialize(o[1], !0).length === n.containerState.size ? e(s) : t(s);
  }
}
function CHt(i) {
  i.exit(this.containerState.type);
}
function wHt(i, e, t) {
  const n = this;
  return us(i, r, "listItemPrefixWhitespace", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 5);
  function r(s) {
    const o = n.events[n.events.length - 1];
    return !Pr(s) && o && o[1].type === "listItemPrefixWhitespace" ? e(s) : t(s);
  }
}
const GAe = {
  name: "setextUnderline",
  resolveTo: SHt,
  tokenize: EHt
};
function SHt(i, e) {
  let t = i.length, n, r, s;
  for (; t--; )
    if (i[t][0] === "enter") {
      if (i[t][1].type === "content") {
        n = t;
        break;
      }
      i[t][1].type === "paragraph" && (r = t);
    } else
      i[t][1].type === "content" && i.splice(t, 1), !s && i[t][1].type === "definition" && (s = t);
  const o = {
    type: "setextHeading",
    start: {
      ...i[n][1].start
    },
    end: {
      ...i[i.length - 1][1].end
    }
  };
  return i[r][1].type = "setextHeadingText", s ? (i.splice(r, 0, ["enter", o, e]), i.splice(s + 1, 0, ["exit", i[n][1], e]), i[n][1].end = {
    ...i[s][1].end
  }) : i[n][1] = o, i.push(["exit", o, e]), i;
}
function EHt(i, e, t) {
  const n = this;
  let r;
  return s;
  function s(c) {
    let u = n.events.length, d;
    for (; u--; )
      if (n.events[u][1].type !== "lineEnding" && n.events[u][1].type !== "linePrefix" && n.events[u][1].type !== "content") {
        d = n.events[u][1].type === "paragraph";
        break;
      }
    return !n.parser.lazy[n.now().line] && (n.interrupt || d) ? (i.enter("setextHeadingLine"), r = c, o(c)) : t(c);
  }
  function o(c) {
    return i.enter("setextHeadingLineSequence"), a(c);
  }
  function a(c) {
    return c === r ? (i.consume(c), a) : (i.exit("setextHeadingLineSequence"), Pr(c) ? us(i, l, "lineSuffix")(c) : l(c));
  }
  function l(c) {
    return c === null || wi(c) ? (i.exit("setextHeadingLine"), e(c)) : t(c);
  }
}
const xHt = {
  tokenize: LHt
};
function LHt(i) {
  const e = this, t = i.attempt(
    // Try to parse a blank line.
    p6,
    n,
    // Try to parse initial flow (essentially, only code).
    i.attempt(this.parser.constructs.flowInitial, r, us(i, i.attempt(this.parser.constructs.flow, r, i.attempt(N7t, r)), "linePrefix"))
  );
  return t;
  function n(s) {
    if (s === null) {
      i.consume(s);
      return;
    }
    return i.enter("lineEndingBlank"), i.consume(s), i.exit("lineEndingBlank"), e.currentConstruct = void 0, t;
  }
  function r(s) {
    if (s === null) {
      i.consume(s);
      return;
    }
    return i.enter("lineEnding"), i.consume(s), i.exit("lineEnding"), e.currentConstruct = void 0, t;
  }
}
const THt = {
  resolveAll: KHe()
}, kHt = qHe("string"), DHt = qHe("text");
function qHe(i) {
  return {
    resolveAll: KHe(i === "text" ? IHt : void 0),
    tokenize: e
  };
  function e(t) {
    const n = this, r = this.parser.constructs[i], s = t.attempt(r, o, a);
    return o;
    function o(u) {
      return c(u) ? s(u) : a(u);
    }
    function a(u) {
      if (u === null) {
        t.consume(u);
        return;
      }
      return t.enter("data"), t.consume(u), l;
    }
    function l(u) {
      return c(u) ? (t.exit("data"), s(u)) : (t.consume(u), l);
    }
    function c(u) {
      if (u === null)
        return !0;
      const d = r[u];
      let h = -1;
      if (d)
        for (; ++h < d.length; ) {
          const g = d[h];
          if (!g.previous || g.previous.call(n, n.previous))
            return !0;
        }
      return !1;
    }
  }
}
function KHe(i) {
  return e;
  function e(t, n) {
    let r = -1, s;
    for (; ++r <= t.length; )
      s === void 0 ? t[r] && t[r][1].type === "data" && (s = r, r++) : (!t[r] || t[r][1].type !== "data") && (r !== s + 2 && (t[s][1].end = t[r - 1][1].end, t.splice(s + 2, r - s - 2), r = s + 2), s = void 0);
    return i ? i(t, n) : t;
  }
}
function IHt(i, e) {
  let t = 0;
  for (; ++t <= i.length; )
    if ((t === i.length || i[t][1].type === "lineEnding") && i[t - 1][1].type === "data") {
      const n = i[t - 1][1], r = e.sliceStream(n);
      let s = r.length, o = -1, a = 0, l;
      for (; s--; ) {
        const c = r[s];
        if (typeof c == "string") {
          for (o = c.length; c.charCodeAt(o - 1) === 32; )
            a++, o--;
          if (o) break;
          o = -1;
        } else if (c === -2)
          l = !0, a++;
        else if (c !== -1) {
          s++;
          break;
        }
      }
      if (e._contentTypeTextTrailing && t === i.length && (a = 0), a) {
        const c = {
          type: t === i.length || l || a < 2 ? "lineSuffix" : "hardBreakTrailing",
          start: {
            _bufferIndex: s ? o : n.start._bufferIndex + o,
            _index: n.start._index + s,
            line: n.end.line,
            column: n.end.column - a,
            offset: n.end.offset - a
          },
          end: {
            ...n.end
          }
        };
        n.end = {
          ...c.start
        }, n.start.offset === n.end.offset ? Object.assign(n, c) : (i.splice(t, 0, ["enter", c, e], ["exit", c, e]), t += 2);
      }
      t++;
    }
  return i;
}
const NHt = {
  42: yh,
  43: yh,
  45: yh,
  48: yh,
  49: yh,
  50: yh,
  51: yh,
  52: yh,
  53: yh,
  54: yh,
  55: yh,
  56: yh,
  57: yh,
  62: WHe
}, RHt = {
  91: P7t
}, AHt = {
  [-2]: lne,
  [-1]: lne,
  32: lne
}, OHt = {
  35: U7t,
  42: sV,
  45: [GAe, sV],
  60: G7t,
  61: GAe,
  95: sV,
  96: $Ae,
  126: $Ae
}, MHt = {
  38: UHe,
  92: VHe
}, PHt = {
  [-5]: cne,
  [-4]: cne,
  [-3]: cne,
  33: uHt,
  38: UHe,
  42: bde,
  60: [h7t, J7t],
  91: hHt,
  92: [W7t, VHe],
  93: F0e,
  95: bde,
  96: x7t
}, FHt = {
  null: [bde, THt]
}, BHt = {
  null: [42, 95]
}, HHt = {
  null: []
}, WHt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  attentionMarkers: BHt,
  contentInitial: RHt,
  disable: HHt,
  document: NHt,
  flow: OHt,
  flowInitial: AHt,
  insideSpan: FHt,
  string: MHt,
  text: PHt
}, Symbol.toStringTag, { value: "Module" }));
function VHt(i, e, t) {
  let n = {
    _bufferIndex: -1,
    _index: 0,
    line: t && t.line || 1,
    column: t && t.column || 1,
    offset: t && t.offset || 0
  };
  const r = {}, s = [];
  let o = [], a = [];
  const l = {
    attempt: R(D),
    check: R(N),
    consume: E,
    enter: L,
    exit: T,
    interrupt: R(N, {
      interrupt: !0
    })
  }, c = {
    code: null,
    containerState: {},
    defineSkip: _,
    events: [],
    now: m,
    parser: i,
    previous: null,
    sliceSerialize: h,
    sliceStream: g,
    write: d
  };
  let u = e.tokenize.call(c, l);
  return e.resolveAll && s.push(e), c;
  function d(j) {
    return o = Hg(o, j), v(), o[o.length - 1] !== null ? [] : (M(e, 0), c.events = IY(s, c.events, c), c.events);
  }
  function h(j, K) {
    return zHt(g(j), K);
  }
  function g(j) {
    return UHt(o, j);
  }
  function m() {
    const {
      _bufferIndex: j,
      _index: K,
      line: X,
      column: Y,
      offset: G
    } = n;
    return {
      _bufferIndex: j,
      _index: K,
      line: X,
      column: Y,
      offset: G
    };
  }
  function _(j) {
    r[j.line] = j.column, H();
  }
  function v() {
    let j;
    for (; n._index < o.length; ) {
      const K = o[n._index];
      if (typeof K == "string")
        for (j = n._index, n._bufferIndex < 0 && (n._bufferIndex = 0); n._index === j && n._bufferIndex < K.length; )
          w(K.charCodeAt(n._bufferIndex));
      else
        w(K);
    }
  }
  function w(j) {
    u = u(j);
  }
  function E(j) {
    wi(j) ? (n.line++, n.column = 1, n.offset += j === -3 ? 2 : 1, H()) : j !== -1 && (n.column++, n.offset++), n._bufferIndex < 0 ? n._index++ : (n._bufferIndex++, n._bufferIndex === // Points w/ non-negative `_bufferIndex` reference
    // strings.
    /** @type {string} */
    o[n._index].length && (n._bufferIndex = -1, n._index++)), c.previous = j;
  }
  function L(j, K) {
    const X = K || {};
    return X.type = j, X.start = m(), c.events.push(["enter", X, c]), a.push(X), X;
  }
  function T(j) {
    const K = a.pop();
    return K.end = m(), c.events.push(["exit", K, c]), K;
  }
  function D(j, K) {
    M(j, K.from);
  }
  function N(j, K) {
    K.restore();
  }
  function R(j, K) {
    return X;
    function X(Y, G, Q) {
      let oe, Z, pe, J;
      return Array.isArray(Y) ? (
        /* c8 ignore next 1 */
        be(Y)
      ) : "tokenize" in Y ? (
        // Looks like a construct.
        be([
          /** @type {Construct} */
          Y
        ])
      ) : ae(Y);
      function ae(st) {
        return ot;
        function ot(et) {
          const at = et !== null && st[et], en = et !== null && st.null, sn = [
            // To do: add more extension tests.
            /* c8 ignore next 2 */
            ...Array.isArray(at) ? at : at ? [at] : [],
            ...Array.isArray(en) ? en : en ? [en] : []
          ];
          return be(sn)(et);
        }
      }
      function be(st) {
        return oe = st, Z = 0, st.length === 0 ? Q : re(st[Z]);
      }
      function re(st) {
        return ot;
        function ot(et) {
          return J = B(), pe = st, st.partial || (c.currentConstruct = st), st.name && c.parser.constructs.disable.null.includes(st.name) ? Ve() : st.tokenize.call(
            // If we do have fields, create an object w/ `context` as its
            // prototype.
            // This allows a “live binding”, which is needed for `interrupt`.
            K ? Object.assign(Object.create(c), K) : c,
            l,
            ze,
            Ve
          )(et);
        }
      }
      function ze(st) {
        return j(pe, J), G;
      }
      function Ve(st) {
        return J.restore(), ++Z < oe.length ? re(oe[Z]) : Q;
      }
    }
  }
  function M(j, K) {
    j.resolveAll && !s.includes(j) && s.push(j), j.resolve && Uf(c.events, K, c.events.length - K, j.resolve(c.events.slice(K), c)), j.resolveTo && (c.events = j.resolveTo(c.events, c));
  }
  function B() {
    const j = m(), K = c.previous, X = c.currentConstruct, Y = c.events.length, G = Array.from(a);
    return {
      from: Y,
      restore: Q
    };
    function Q() {
      n = j, c.previous = K, c.currentConstruct = X, c.events.length = Y, a = G, H();
    }
  }
  function H() {
    n.line in r && n.column < 2 && (n.column = r[n.line], n.offset += r[n.line] - 1);
  }
}
function UHt(i, e) {
  const t = e.start._index, n = e.start._bufferIndex, r = e.end._index, s = e.end._bufferIndex;
  let o;
  if (t === r)
    o = [i[t].slice(n, s)];
  else {
    if (o = i.slice(t, r), n > -1) {
      const a = o[0];
      typeof a == "string" ? o[0] = a.slice(n) : o.shift();
    }
    s > 0 && o.push(i[r].slice(0, s));
  }
  return o;
}
function zHt(i, e) {
  let t = -1;
  const n = [];
  let r;
  for (; ++t < i.length; ) {
    const s = i[t];
    let o;
    if (typeof s == "string")
      o = s;
    else switch (s) {
      case -5: {
        o = "\r";
        break;
      }
      case -4: {
        o = `
`;
        break;
      }
      case -3: {
        o = `\r
`;
        break;
      }
      case -2: {
        o = e ? " " : "	";
        break;
      }
      case -1: {
        if (!e && r) continue;
        o = " ";
        break;
      }
      default:
        o = String.fromCharCode(s);
    }
    r = s === -2, n.push(o);
  }
  return n.join("");
}
function $Ht(i) {
  const n = {
    constructs: (
      /** @type {FullNormalizedExtension} */
      BHe([WHt, ...(i || {}).extensions || []])
    ),
    content: r(s7t),
    defined: [],
    document: r(a7t),
    flow: r(xHt),
    lazy: {},
    string: r(kHt),
    text: r(DHt)
  };
  return n;
  function r(s) {
    return o;
    function o(a) {
      return VHt(n, s, a);
    }
  }
}
function jHt(i) {
  for (; !zHe(i); )
    ;
  return i;
}
const qAe = /[\0\t\n\r]/g;
function GHt() {
  let i = 1, e = "", t = !0, n;
  return r;
  function r(s, o, a) {
    const l = [];
    let c, u, d, h, g;
    for (s = e + (typeof s == "string" ? s.toString() : new TextDecoder(o || void 0).decode(s)), d = 0, e = "", t && (s.charCodeAt(0) === 65279 && d++, t = void 0); d < s.length; ) {
      if (qAe.lastIndex = d, c = qAe.exec(s), h = c && c.index !== void 0 ? c.index : s.length, g = s.charCodeAt(h), !c) {
        e = s.slice(d);
        break;
      }
      if (g === 10 && d === h && n)
        l.push(-3), n = void 0;
      else
        switch (n && (l.push(-5), n = void 0), d < h && (l.push(s.slice(d, h)), i += h - d), g) {
          case 0: {
            l.push(65533), i++;
            break;
          }
          case 9: {
            for (u = Math.ceil(i / 4) * 4, l.push(-2); i++ < u; ) l.push(-1);
            break;
          }
          case 10: {
            l.push(-4), i = 1;
            break;
          }
          default:
            n = !0, i = 1;
        }
      d = h + 1;
    }
    return a && (n && l.push(-5), e && l.push(e), l.push(null)), l;
  }
}
const qHt = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
function KHt(i) {
  return i.replace(qHt, YHt);
}
function YHt(i, e, t) {
  if (e)
    return e;
  if (t.charCodeAt(0) === 35) {
    const r = t.charCodeAt(1), s = r === 120 || r === 88;
    return HHe(t.slice(s ? 2 : 1), s ? 16 : 10);
  }
  return $5(t) || i;
}
const YHe = {}.hasOwnProperty;
function XHt(i, e, t) {
  return typeof e != "string" && (t = e, e = void 0), ZHt(t)(jHt($Ht(t).document().write(GHt()(i, e, !0))));
}
function ZHt(i) {
  const e = {
    transforms: [],
    canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"],
    enter: {
      autolink: s(Bs),
      autolinkProtocol: B,
      autolinkEmail: B,
      atxHeading: s(tn),
      blockQuote: s(en),
      characterEscape: B,
      characterReference: B,
      codeFenced: s(sn),
      codeFencedFenceInfo: o,
      codeFencedFenceMeta: o,
      codeIndented: s(sn, o),
      codeText: s(Vt, o),
      codeTextData: B,
      data: B,
      codeFlowValue: B,
      definition: s(Bi),
      definitionDestinationString: o,
      definitionLabelString: o,
      definitionTitleString: o,
      emphasis: s(pi),
      hardBreakEscape: s(Vr),
      hardBreakTrailing: s(Vr),
      htmlFlow: s(tr, o),
      htmlFlowData: B,
      htmlText: s(tr, o),
      htmlTextData: B,
      image: s(qr),
      label: o,
      link: s(Bs),
      listItem: s(ts),
      listItemValue: h,
      listOrdered: s(Ts, d),
      listUnordered: s(Ts),
      paragraph: s(io),
      reference: re,
      referenceString: o,
      resourceDestinationString: o,
      resourceTitleString: o,
      setextHeading: s(tn),
      strong: s(nr),
      thematicBreak: s(Hs)
    },
    exit: {
      atxHeading: l(),
      atxHeadingSequence: D,
      autolink: l(),
      autolinkEmail: at,
      autolinkProtocol: et,
      blockQuote: l(),
      characterEscapeValue: H,
      characterReferenceMarkerHexadecimal: Ve,
      characterReferenceMarkerNumeric: Ve,
      characterReferenceValue: st,
      characterReference: ot,
      codeFenced: l(v),
      codeFencedFence: _,
      codeFencedFenceInfo: g,
      codeFencedFenceMeta: m,
      codeFlowValue: H,
      codeIndented: l(w),
      codeText: l(G),
      codeTextData: H,
      data: H,
      definition: l(),
      definitionDestinationString: T,
      definitionLabelString: E,
      definitionTitleString: L,
      emphasis: l(),
      hardBreakEscape: l(K),
      hardBreakTrailing: l(K),
      htmlFlow: l(X),
      htmlFlowData: H,
      htmlText: l(Y),
      htmlTextData: H,
      image: l(oe),
      label: pe,
      labelText: Z,
      lineEnding: j,
      link: l(Q),
      listItem: l(),
      listOrdered: l(),
      listUnordered: l(),
      paragraph: l(),
      referenceString: ze,
      resourceDestinationString: J,
      resourceTitleString: ae,
      resource: be,
      setextHeading: l(M),
      setextHeadingLineSequence: R,
      setextHeadingText: N,
      strong: l(),
      thematicBreak: l()
    }
  };
  XHe(e, (i || {}).mdastExtensions || []);
  const t = {};
  return n;
  function n(He) {
    let yt = {
      type: "root",
      children: []
    };
    const Ln = {
      stack: [yt],
      tokenStack: [],
      config: e,
      enter: a,
      exit: c,
      buffer: o,
      resume: u,
      data: t
    }, oi = [];
    let vi = -1;
    for (; ++vi < He.length; )
      if (He[vi][1].type === "listOrdered" || He[vi][1].type === "listUnordered")
        if (He[vi][0] === "enter")
          oi.push(vi);
        else {
          const Dt = oi.pop();
          vi = r(He, Dt, vi);
        }
    for (vi = -1; ++vi < He.length; ) {
      const Dt = e[He[vi][0]];
      YHe.call(Dt, He[vi][1].type) && Dt[He[vi][1].type].call(Object.assign({
        sliceSerialize: He[vi][2].sliceSerialize
      }, Ln), He[vi][1]);
    }
    if (Ln.tokenStack.length > 0) {
      const Dt = Ln.tokenStack[Ln.tokenStack.length - 1];
      (Dt[1] || KAe).call(Ln, void 0, Dt[0]);
    }
    for (yt.position = {
      start: DC(He.length > 0 ? He[0][1].start : {
        line: 1,
        column: 1,
        offset: 0
      }),
      end: DC(He.length > 0 ? He[He.length - 2][1].end : {
        line: 1,
        column: 1,
        offset: 0
      })
    }, vi = -1; ++vi < e.transforms.length; )
      yt = e.transforms[vi](yt) || yt;
    return yt;
  }
  function r(He, yt, Ln) {
    let oi = yt - 1, vi = -1, Dt = !1, cn, En, ii, li;
    for (; ++oi <= Ln; ) {
      const lt = He[oi];
      switch (lt[1].type) {
        case "listUnordered":
        case "listOrdered":
        case "blockQuote": {
          lt[0] === "enter" ? vi++ : vi--, li = void 0;
          break;
        }
        case "lineEndingBlank": {
          lt[0] === "enter" && (cn && !li && !vi && !ii && (ii = oi), li = void 0);
          break;
        }
        case "linePrefix":
        case "listItemValue":
        case "listItemMarker":
        case "listItemPrefix":
        case "listItemPrefixWhitespace":
          break;
        default:
          li = void 0;
      }
      if (!vi && lt[0] === "enter" && lt[1].type === "listItemPrefix" || vi === -1 && lt[0] === "exit" && (lt[1].type === "listUnordered" || lt[1].type === "listOrdered")) {
        if (cn) {
          let Bt = oi;
          for (En = void 0; Bt--; ) {
            const Mn = He[Bt];
            if (Mn[1].type === "lineEnding" || Mn[1].type === "lineEndingBlank") {
              if (Mn[0] === "exit") continue;
              En && (He[En][1].type = "lineEndingBlank", Dt = !0), Mn[1].type = "lineEnding", En = Bt;
            } else if (!(Mn[1].type === "linePrefix" || Mn[1].type === "blockQuotePrefix" || Mn[1].type === "blockQuotePrefixWhitespace" || Mn[1].type === "blockQuoteMarker" || Mn[1].type === "listItemIndent")) break;
          }
          ii && (!En || ii < En) && (cn._spread = !0), cn.end = Object.assign({}, En ? He[En][1].start : lt[1].end), He.splice(En || oi, 0, ["exit", cn, lt[2]]), oi++, Ln++;
        }
        if (lt[1].type === "listItemPrefix") {
          const Bt = {
            type: "listItem",
            _spread: !1,
            start: Object.assign({}, lt[1].start),
            // @ts-expect-error: we’ll add `end` in a second.
            end: void 0
          };
          cn = Bt, He.splice(oi, 0, ["enter", Bt, lt[2]]), oi++, Ln++, ii = void 0, li = !0;
        }
      }
    }
    return He[yt][1]._spread = Dt, Ln;
  }
  function s(He, yt) {
    return Ln;
    function Ln(oi) {
      a.call(this, He(oi), oi), yt && yt.call(this, oi);
    }
  }
  function o() {
    this.stack.push({
      type: "fragment",
      children: []
    });
  }
  function a(He, yt, Ln) {
    this.stack[this.stack.length - 1].children.push(He), this.stack.push(He), this.tokenStack.push([yt, Ln || void 0]), He.position = {
      start: DC(yt.start),
      // @ts-expect-error: `end` will be patched later.
      end: void 0
    };
  }
  function l(He) {
    return yt;
    function yt(Ln) {
      He && He.call(this, Ln), c.call(this, Ln);
    }
  }
  function c(He, yt) {
    const Ln = this.stack.pop(), oi = this.tokenStack.pop();
    if (oi)
      oi[0].type !== He.type && (yt ? yt.call(this, He, oi[0]) : (oi[1] || KAe).call(this, He, oi[0]));
    else throw new Error("Cannot close `" + He.type + "` (" + C3({
      start: He.start,
      end: He.end
    }) + "): it’s not open");
    Ln.position.end = DC(He.end);
  }
  function u() {
    return P0e(this.stack.pop());
  }
  function d() {
    this.data.expectingFirstListItemValue = !0;
  }
  function h(He) {
    if (this.data.expectingFirstListItemValue) {
      const yt = this.stack[this.stack.length - 2];
      yt.start = Number.parseInt(this.sliceSerialize(He), 10), this.data.expectingFirstListItemValue = void 0;
    }
  }
  function g() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.lang = He;
  }
  function m() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.meta = He;
  }
  function _() {
    this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
  }
  function v() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.value = He.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
  }
  function w() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.value = He.replace(/(\r?\n|\r)$/g, "");
  }
  function E(He) {
    const yt = this.resume(), Ln = this.stack[this.stack.length - 1];
    Ln.label = yt, Ln.identifier = cm(this.sliceSerialize(He)).toLowerCase();
  }
  function L() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.title = He;
  }
  function T() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.url = He;
  }
  function D(He) {
    const yt = this.stack[this.stack.length - 1];
    if (!yt.depth) {
      const Ln = this.sliceSerialize(He).length;
      yt.depth = Ln;
    }
  }
  function N() {
    this.data.setextHeadingSlurpLineEnding = !0;
  }
  function R(He) {
    const yt = this.stack[this.stack.length - 1];
    yt.depth = this.sliceSerialize(He).codePointAt(0) === 61 ? 1 : 2;
  }
  function M() {
    this.data.setextHeadingSlurpLineEnding = void 0;
  }
  function B(He) {
    const Ln = this.stack[this.stack.length - 1].children;
    let oi = Ln[Ln.length - 1];
    (!oi || oi.type !== "text") && (oi = _s(), oi.position = {
      start: DC(He.start),
      // @ts-expect-error: we’ll add `end` later.
      end: void 0
    }, Ln.push(oi)), this.stack.push(oi);
  }
  function H(He) {
    const yt = this.stack.pop();
    yt.value += this.sliceSerialize(He), yt.position.end = DC(He.end);
  }
  function j(He) {
    const yt = this.stack[this.stack.length - 1];
    if (this.data.atHardBreak) {
      const Ln = yt.children[yt.children.length - 1];
      Ln.position.end = DC(He.end), this.data.atHardBreak = void 0;
      return;
    }
    !this.data.setextHeadingSlurpLineEnding && e.canContainEols.includes(yt.type) && (B.call(this, He), H.call(this, He));
  }
  function K() {
    this.data.atHardBreak = !0;
  }
  function X() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.value = He;
  }
  function Y() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.value = He;
  }
  function G() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.value = He;
  }
  function Q() {
    const He = this.stack[this.stack.length - 1];
    if (this.data.inReference) {
      const yt = this.data.referenceType || "shortcut";
      He.type += "Reference", He.referenceType = yt, delete He.url, delete He.title;
    } else
      delete He.identifier, delete He.label;
    this.data.referenceType = void 0;
  }
  function oe() {
    const He = this.stack[this.stack.length - 1];
    if (this.data.inReference) {
      const yt = this.data.referenceType || "shortcut";
      He.type += "Reference", He.referenceType = yt, delete He.url, delete He.title;
    } else
      delete He.identifier, delete He.label;
    this.data.referenceType = void 0;
  }
  function Z(He) {
    const yt = this.sliceSerialize(He), Ln = this.stack[this.stack.length - 2];
    Ln.label = KHt(yt), Ln.identifier = cm(yt).toLowerCase();
  }
  function pe() {
    const He = this.stack[this.stack.length - 1], yt = this.resume(), Ln = this.stack[this.stack.length - 1];
    if (this.data.inReference = !0, Ln.type === "link") {
      const oi = He.children;
      Ln.children = oi;
    } else
      Ln.alt = yt;
  }
  function J() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.url = He;
  }
  function ae() {
    const He = this.resume(), yt = this.stack[this.stack.length - 1];
    yt.title = He;
  }
  function be() {
    this.data.inReference = void 0;
  }
  function re() {
    this.data.referenceType = "collapsed";
  }
  function ze(He) {
    const yt = this.resume(), Ln = this.stack[this.stack.length - 1];
    Ln.label = yt, Ln.identifier = cm(this.sliceSerialize(He)).toLowerCase(), this.data.referenceType = "full";
  }
  function Ve(He) {
    this.data.characterReferenceType = He.type;
  }
  function st(He) {
    const yt = this.sliceSerialize(He), Ln = this.data.characterReferenceType;
    let oi;
    Ln ? (oi = HHe(yt, Ln === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : oi = $5(yt);
    const vi = this.stack[this.stack.length - 1];
    vi.value += oi;
  }
  function ot(He) {
    const yt = this.stack.pop();
    yt.position.end = DC(He.end);
  }
  function et(He) {
    H.call(this, He);
    const yt = this.stack[this.stack.length - 1];
    yt.url = this.sliceSerialize(He);
  }
  function at(He) {
    H.call(this, He);
    const yt = this.stack[this.stack.length - 1];
    yt.url = "mailto:" + this.sliceSerialize(He);
  }
  function en() {
    return {
      type: "blockquote",
      children: []
    };
  }
  function sn() {
    return {
      type: "code",
      lang: null,
      meta: null,
      value: ""
    };
  }
  function Vt() {
    return {
      type: "inlineCode",
      value: ""
    };
  }
  function Bi() {
    return {
      type: "definition",
      identifier: "",
      label: null,
      title: null,
      url: ""
    };
  }
  function pi() {
    return {
      type: "emphasis",
      children: []
    };
  }
  function tn() {
    return {
      type: "heading",
      // @ts-expect-error `depth` will be set later.
      depth: 0,
      children: []
    };
  }
  function Vr() {
    return {
      type: "break"
    };
  }
  function tr() {
    return {
      type: "html",
      value: ""
    };
  }
  function qr() {
    return {
      type: "image",
      title: null,
      url: "",
      alt: null
    };
  }
  function Bs() {
    return {
      type: "link",
      title: null,
      url: "",
      children: []
    };
  }
  function Ts(He) {
    return {
      type: "list",
      ordered: He.type === "listOrdered",
      start: null,
      spread: He._spread,
      children: []
    };
  }
  function ts(He) {
    return {
      type: "listItem",
      spread: He._spread,
      checked: null,
      children: []
    };
  }
  function io() {
    return {
      type: "paragraph",
      children: []
    };
  }
  function nr() {
    return {
      type: "strong",
      children: []
    };
  }
  function _s() {
    return {
      type: "text",
      value: ""
    };
  }
  function Hs() {
    return {
      type: "thematicBreak"
    };
  }
}
function DC(i) {
  return {
    line: i.line,
    column: i.column,
    offset: i.offset
  };
}
function XHe(i, e) {
  let t = -1;
  for (; ++t < e.length; ) {
    const n = e[t];
    Array.isArray(n) ? XHe(i, n) : QHt(i, n);
  }
}
function QHt(i, e) {
  let t;
  for (t in e)
    if (YHe.call(e, t))
      switch (t) {
        case "canContainEols": {
          const n = e[t];
          n && i[t].push(...n);
          break;
        }
        case "transforms": {
          const n = e[t];
          n && i[t].push(...n);
          break;
        }
        case "enter":
        case "exit": {
          const n = e[t];
          n && Object.assign(i[t], n);
          break;
        }
      }
}
function KAe(i, e) {
  throw i ? new Error("Cannot close `" + i.type + "` (" + C3({
    start: i.start,
    end: i.end
  }) + "): a different token (`" + e.type + "`, " + C3({
    start: e.start,
    end: e.end
  }) + ") is open") : new Error("Cannot close document, a token (`" + e.type + "`, " + C3({
    start: e.start,
    end: e.end
  }) + ") is still open");
}
function JHt(i) {
  const e = this;
  e.parser = t;
  function t(n) {
    return XHt(n, {
      ...e.data("settings"),
      ...i,
      // Note: these options are not in the readme.
      // The goal is for them to be set by plugins on `data` instead of being
      // passed by users.
      extensions: e.data("micromarkExtensions") || [],
      mdastExtensions: e.data("fromMarkdownExtensions") || []
    });
  }
}
function eWt(i, e) {
  const t = {
    type: "element",
    tagName: "blockquote",
    properties: {},
    children: i.wrap(i.all(e), !0)
  };
  return i.patch(e, t), i.applyData(e, t);
}
function tWt(i, e) {
  const t = { type: "element", tagName: "br", properties: {}, children: [] };
  return i.patch(e, t), [i.applyData(e, t), { type: "text", value: `
` }];
}
function nWt(i, e) {
  const t = e.value ? e.value + `
` : "", n = {}, r = e.lang ? e.lang.split(/\s+/) : [];
  r.length > 0 && (n.className = ["language-" + r[0]]);
  let s = {
    type: "element",
    tagName: "code",
    properties: n,
    children: [{ type: "text", value: t }]
  };
  return e.meta && (s.data = { meta: e.meta }), i.patch(e, s), s = i.applyData(e, s), s = { type: "element", tagName: "pre", properties: {}, children: [s] }, i.patch(e, s), s;
}
function iWt(i, e) {
  const t = {
    type: "element",
    tagName: "del",
    properties: {},
    children: i.all(e)
  };
  return i.patch(e, t), i.applyData(e, t);
}
function rWt(i, e) {
  const t = {
    type: "element",
    tagName: "em",
    properties: {},
    children: i.all(e)
  };
  return i.patch(e, t), i.applyData(e, t);
}
function sWt(i, e) {
  const t = typeof i.options.clobberPrefix == "string" ? i.options.clobberPrefix : "user-content-", n = String(e.identifier).toUpperCase(), r = L2(n.toLowerCase()), s = i.footnoteOrder.indexOf(n);
  let o, a = i.footnoteCounts.get(n);
  a === void 0 ? (a = 0, i.footnoteOrder.push(n), o = i.footnoteOrder.length) : o = s + 1, a += 1, i.footnoteCounts.set(n, a);
  const l = {
    type: "element",
    tagName: "a",
    properties: {
      href: "#" + t + "fn-" + r,
      id: t + "fnref-" + r + (a > 1 ? "-" + a : ""),
      dataFootnoteRef: !0,
      ariaDescribedBy: ["footnote-label"]
    },
    children: [{ type: "text", value: String(o) }]
  };
  i.patch(e, l);
  const c = {
    type: "element",
    tagName: "sup",
    properties: {},
    children: [l]
  };
  return i.patch(e, c), i.applyData(e, c);
}
function oWt(i, e) {
  const t = {
    type: "element",
    tagName: "h" + e.depth,
    properties: {},
    children: i.all(e)
  };
  return i.patch(e, t), i.applyData(e, t);
}
function aWt(i, e) {
  if (i.options.allowDangerousHtml) {
    const t = { type: "raw", value: e.value };
    return i.patch(e, t), i.applyData(e, t);
  }
}
function ZHe(i, e) {
  const t = e.referenceType;
  let n = "]";
  if (t === "collapsed" ? n += "[]" : t === "full" && (n += "[" + (e.label || e.identifier) + "]"), e.type === "imageReference")
    return [{ type: "text", value: "![" + e.alt + n }];
  const r = i.all(e), s = r[0];
  s && s.type === "text" ? s.value = "[" + s.value : r.unshift({ type: "text", value: "[" });
  const o = r[r.length - 1];
  return o && o.type === "text" ? o.value += n : r.push({ type: "text", value: n }), r;
}
function lWt(i, e) {
  const t = String(e.identifier).toUpperCase(), n = i.definitionById.get(t);
  if (!n)
    return ZHe(i, e);
  const r = { src: L2(n.url || ""), alt: e.alt };
  n.title !== null && n.title !== void 0 && (r.title = n.title);
  const s = { type: "element", tagName: "img", properties: r, children: [] };
  return i.patch(e, s), i.applyData(e, s);
}
function cWt(i, e) {
  const t = { src: L2(e.url) };
  e.alt !== null && e.alt !== void 0 && (t.alt = e.alt), e.title !== null && e.title !== void 0 && (t.title = e.title);
  const n = { type: "element", tagName: "img", properties: t, children: [] };
  return i.patch(e, n), i.applyData(e, n);
}
function uWt(i, e) {
  const t = { type: "text", value: e.value.replace(/\r?\n|\r/g, " ") };
  i.patch(e, t);
  const n = {
    type: "element",
    tagName: "code",
    properties: {},
    children: [t]
  };
  return i.patch(e, n), i.applyData(e, n);
}
function dWt(i, e) {
  const t = String(e.identifier).toUpperCase(), n = i.definitionById.get(t);
  if (!n)
    return ZHe(i, e);
  const r = { href: L2(n.url || "") };
  n.title !== null && n.title !== void 0 && (r.title = n.title);
  const s = {
    type: "element",
    tagName: "a",
    properties: r,
    children: i.all(e)
  };
  return i.patch(e, s), i.applyData(e, s);
}
function hWt(i, e) {
  const t = { href: L2(e.url) };
  e.title !== null && e.title !== void 0 && (t.title = e.title);
  const n = {
    type: "element",
    tagName: "a",
    properties: t,
    children: i.all(e)
  };
  return i.patch(e, n), i.applyData(e, n);
}
function fWt(i, e, t) {
  const n = i.all(e), r = t ? gWt(t) : QHe(e), s = {}, o = [];
  if (typeof e.checked == "boolean") {
    const u = n[0];
    let d;
    u && u.type === "element" && u.tagName === "p" ? d = u : (d = { type: "element", tagName: "p", properties: {}, children: [] }, n.unshift(d)), d.children.length > 0 && d.children.unshift({ type: "text", value: " " }), d.children.unshift({
      type: "element",
      tagName: "input",
      properties: { type: "checkbox", checked: e.checked, disabled: !0 },
      children: []
    }), s.className = ["task-list-item"];
  }
  let a = -1;
  for (; ++a < n.length; ) {
    const u = n[a];
    (r || a !== 0 || u.type !== "element" || u.tagName !== "p") && o.push({ type: "text", value: `
` }), u.type === "element" && u.tagName === "p" && !r ? o.push(...u.children) : o.push(u);
  }
  const l = n[n.length - 1];
  l && (r || l.type !== "element" || l.tagName !== "p") && o.push({ type: "text", value: `
` });
  const c = { type: "element", tagName: "li", properties: s, children: o };
  return i.patch(e, c), i.applyData(e, c);
}
function gWt(i) {
  let e = !1;
  if (i.type === "list") {
    e = i.spread || !1;
    const t = i.children;
    let n = -1;
    for (; !e && ++n < t.length; )
      e = QHe(t[n]);
  }
  return e;
}
function QHe(i) {
  const e = i.spread;
  return e ?? i.children.length > 1;
}
function pWt(i, e) {
  const t = {}, n = i.all(e);
  let r = -1;
  for (typeof e.start == "number" && e.start !== 1 && (t.start = e.start); ++r < n.length; ) {
    const o = n[r];
    if (o.type === "element" && o.tagName === "li" && o.properties && Array.isArray(o.properties.className) && o.properties.className.includes("task-list-item")) {
      t.className = ["contains-task-list"];
      break;
    }
  }
  const s = {
    type: "element",
    tagName: e.ordered ? "ol" : "ul",
    properties: t,
    children: i.wrap(n, !0)
  };
  return i.patch(e, s), i.applyData(e, s);
}
function mWt(i, e) {
  const t = {
    type: "element",
    tagName: "p",
    properties: {},
    children: i.all(e)
  };
  return i.patch(e, t), i.applyData(e, t);
}
function _Wt(i, e) {
  const t = { type: "root", children: i.wrap(i.all(e)) };
  return i.patch(e, t), i.applyData(e, t);
}
function bWt(i, e) {
  const t = {
    type: "element",
    tagName: "strong",
    properties: {},
    children: i.all(e)
  };
  return i.patch(e, t), i.applyData(e, t);
}
function vWt(i, e) {
  const t = i.all(e), n = t.shift(), r = [];
  if (n) {
    const o = {
      type: "element",
      tagName: "thead",
      properties: {},
      children: i.wrap([n], !0)
    };
    i.patch(e.children[0], o), r.push(o);
  }
  if (t.length > 0) {
    const o = {
      type: "element",
      tagName: "tbody",
      properties: {},
      children: i.wrap(t, !0)
    }, a = Mb(e.children[1]), l = kY(e.children[e.children.length - 1]);
    a && l && (o.position = { start: a, end: l }), r.push(o);
  }
  const s = {
    type: "element",
    tagName: "table",
    properties: {},
    children: i.wrap(r, !0)
  };
  return i.patch(e, s), i.applyData(e, s);
}
function yWt(i, e, t) {
  const n = t ? t.children : void 0, s = (n ? n.indexOf(e) : 1) === 0 ? "th" : "td", o = t && t.type === "table" ? t.align : void 0, a = o ? o.length : e.children.length;
  let l = -1;
  const c = [];
  for (; ++l < a; ) {
    const d = e.children[l], h = {}, g = o ? o[l] : void 0;
    g && (h.align = g);
    let m = { type: "element", tagName: s, properties: h, children: [] };
    d && (m.children = i.all(d), i.patch(d, m), m = i.applyData(d, m)), c.push(m);
  }
  const u = {
    type: "element",
    tagName: "tr",
    properties: {},
    children: i.wrap(c, !0)
  };
  return i.patch(e, u), i.applyData(e, u);
}
function CWt(i, e) {
  const t = {
    type: "element",
    tagName: "td",
    // Assume body cell.
    properties: {},
    children: i.all(e)
  };
  return i.patch(e, t), i.applyData(e, t);
}
const YAe = 9, XAe = 32;
function wWt(i) {
  const e = String(i), t = /\r?\n|\r/g;
  let n = t.exec(e), r = 0;
  const s = [];
  for (; n; )
    s.push(
      ZAe(e.slice(r, n.index), r > 0, !0),
      n[0]
    ), r = n.index + n[0].length, n = t.exec(e);
  return s.push(ZAe(e.slice(r), r > 0, !1)), s.join("");
}
function ZAe(i, e, t) {
  let n = 0, r = i.length;
  if (e) {
    let s = i.codePointAt(n);
    for (; s === YAe || s === XAe; )
      n++, s = i.codePointAt(n);
  }
  if (t) {
    let s = i.codePointAt(r - 1);
    for (; s === YAe || s === XAe; )
      r--, s = i.codePointAt(r - 1);
  }
  return r > n ? i.slice(n, r) : "";
}
function SWt(i, e) {
  const t = { type: "text", value: wWt(String(e.value)) };
  return i.patch(e, t), i.applyData(e, t);
}
function EWt(i, e) {
  const t = {
    type: "element",
    tagName: "hr",
    properties: {},
    children: []
  };
  return i.patch(e, t), i.applyData(e, t);
}
const xWt = {
  blockquote: eWt,
  break: tWt,
  code: nWt,
  delete: iWt,
  emphasis: rWt,
  footnoteReference: sWt,
  heading: oWt,
  html: aWt,
  imageReference: lWt,
  image: cWt,
  inlineCode: uWt,
  linkReference: dWt,
  link: hWt,
  listItem: fWt,
  list: pWt,
  paragraph: mWt,
  // @ts-expect-error: root is different, but hard to type.
  root: _Wt,
  strong: bWt,
  table: vWt,
  tableCell: CWt,
  tableRow: yWt,
  text: SWt,
  thematicBreak: EWt,
  toml: eW,
  yaml: eW,
  definition: eW,
  footnoteDefinition: eW
};
function eW() {
}
function LWt(i, e) {
  const t = [{ type: "text", value: "↩" }];
  return e > 1 && t.push({
    type: "element",
    tagName: "sup",
    properties: {},
    children: [{ type: "text", value: String(e) }]
  }), t;
}
function TWt(i, e) {
  return "Back to reference " + (i + 1) + (e > 1 ? "-" + e : "");
}
function kWt(i) {
  const e = typeof i.options.clobberPrefix == "string" ? i.options.clobberPrefix : "user-content-", t = i.options.footnoteBackContent || LWt, n = i.options.footnoteBackLabel || TWt, r = i.options.footnoteLabel || "Footnotes", s = i.options.footnoteLabelTagName || "h2", o = i.options.footnoteLabelProperties || {
    className: ["sr-only"]
  }, a = [];
  let l = -1;
  for (; ++l < i.footnoteOrder.length; ) {
    const c = i.footnoteById.get(
      i.footnoteOrder[l]
    );
    if (!c)
      continue;
    const u = i.all(c), d = String(c.identifier).toUpperCase(), h = L2(d.toLowerCase());
    let g = 0;
    const m = [], _ = i.footnoteCounts.get(d);
    for (; _ !== void 0 && ++g <= _; ) {
      m.length > 0 && m.push({ type: "text", value: " " });
      let E = typeof t == "string" ? t : t(l, g);
      typeof E == "string" && (E = { type: "text", value: E }), m.push({
        type: "element",
        tagName: "a",
        properties: {
          href: "#" + e + "fnref-" + h + (g > 1 ? "-" + g : ""),
          dataFootnoteBackref: "",
          ariaLabel: typeof n == "string" ? n : n(l, g),
          className: ["data-footnote-backref"]
        },
        children: Array.isArray(E) ? E : [E]
      });
    }
    const v = u[u.length - 1];
    if (v && v.type === "element" && v.tagName === "p") {
      const E = v.children[v.children.length - 1];
      E && E.type === "text" ? E.value += " " : v.children.push({ type: "text", value: " " }), v.children.push(...m);
    } else
      u.push(...m);
    const w = {
      type: "element",
      tagName: "li",
      properties: { id: e + "fn-" + h },
      children: i.wrap(u, !0)
    };
    i.patch(c, w), a.push(w);
  }
  if (a.length !== 0)
    return {
      type: "element",
      tagName: "section",
      properties: { dataFootnotes: !0, className: ["footnotes"] },
      children: [
        {
          type: "element",
          tagName: s,
          properties: {
            ...AT(o),
            id: "footnote-label"
          },
          children: [{ type: "text", value: r }]
        },
        { type: "text", value: `
` },
        {
          type: "element",
          tagName: "ol",
          properties: {},
          children: i.wrap(a, !0)
        },
        { type: "text", value: `
` }
      ]
    };
}
const vde = {}.hasOwnProperty, DWt = {};
function IWt(i, e) {
  const t = e || DWt, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), o = { ...xWt, ...t.handlers }, a = {
    all: c,
    applyData: RWt,
    definitionById: n,
    footnoteById: r,
    footnoteCounts: s,
    footnoteOrder: [],
    handlers: o,
    one: l,
    options: t,
    patch: NWt,
    wrap: OWt
  };
  return qd(i, function(u) {
    if (u.type === "definition" || u.type === "footnoteDefinition") {
      const d = u.type === "definition" ? n : r, h = String(u.identifier).toUpperCase();
      d.has(h) || d.set(h, u);
    }
  }), a;
  function l(u, d) {
    const h = u.type, g = a.handlers[h];
    if (vde.call(a.handlers, h) && g)
      return g(a, u, d);
    if (a.options.passThrough && a.options.passThrough.includes(h)) {
      if ("children" in u) {
        const { children: _, ...v } = u, w = AT(v);
        return w.children = a.all(u), w;
      }
      return AT(u);
    }
    return (a.options.unknownHandler || AWt)(a, u, d);
  }
  function c(u) {
    const d = [];
    if ("children" in u) {
      const h = u.children;
      let g = -1;
      for (; ++g < h.length; ) {
        const m = a.one(h[g], u);
        if (m) {
          if (g && h[g - 1].type === "break" && (!Array.isArray(m) && m.type === "text" && (m.value = QAe(m.value)), !Array.isArray(m) && m.type === "element")) {
            const _ = m.children[0];
            _ && _.type === "text" && (_.value = QAe(_.value));
          }
          Array.isArray(m) ? d.push(...m) : d.push(m);
        }
      }
    }
    return d;
  }
}
function NWt(i, e) {
  i.position && (e.position = l9t(i));
}
function RWt(i, e) {
  let t = e;
  if (i && i.data) {
    const n = i.data.hName, r = i.data.hChildren, s = i.data.hProperties;
    if (typeof n == "string")
      if (t.type === "element")
        t.tagName = n;
      else {
        const o = "children" in t ? t.children : [t];
        t = { type: "element", tagName: n, properties: {}, children: o };
      }
    t.type === "element" && s && Object.assign(t.properties, AT(s)), "children" in t && t.children && r !== null && r !== void 0 && (t.children = r);
  }
  return t;
}
function AWt(i, e) {
  const t = e.data || {}, n = "value" in e && !(vde.call(t, "hProperties") || vde.call(t, "hChildren")) ? { type: "text", value: e.value } : {
    type: "element",
    tagName: "div",
    properties: {},
    children: i.all(e)
  };
  return i.patch(e, n), i.applyData(e, n);
}
function OWt(i, e) {
  const t = [];
  let n = -1;
  for (e && t.push({ type: "text", value: `
` }); ++n < i.length; )
    n && t.push({ type: "text", value: `
` }), t.push(i[n]);
  return e && i.length > 0 && t.push({ type: "text", value: `
` }), t;
}
function QAe(i) {
  let e = 0, t = i.charCodeAt(e);
  for (; t === 9 || t === 32; )
    e++, t = i.charCodeAt(e);
  return i.slice(e);
}
function JAe(i, e) {
  const t = IWt(i, e), n = t.one(i, void 0), r = kWt(t), s = Array.isArray(n) ? { type: "root", children: n } : n || { type: "root", children: [] };
  return r && s.children.push({ type: "text", value: `
` }, r), s;
}
function MWt(i, e) {
  return i && "run" in i ? async function(t, n) {
    const r = (
      /** @type {HastRoot} */
      JAe(t, { file: n, ...e })
    );
    await i.run(r, n);
  } : function(t, n) {
    return (
      /** @type {HastRoot} */
      JAe(t, { file: n, ...i || e })
    );
  };
}
function e2e(i) {
  if (i)
    throw i;
}
var une, t2e;
function PWt() {
  if (t2e) return une;
  t2e = 1;
  var i = Object.prototype.hasOwnProperty, e = Object.prototype.toString, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = function(c) {
    return typeof Array.isArray == "function" ? Array.isArray(c) : e.call(c) === "[object Array]";
  }, s = function(c) {
    if (!c || e.call(c) !== "[object Object]")
      return !1;
    var u = i.call(c, "constructor"), d = c.constructor && c.constructor.prototype && i.call(c.constructor.prototype, "isPrototypeOf");
    if (c.constructor && !u && !d)
      return !1;
    var h;
    for (h in c)
      ;
    return typeof h > "u" || i.call(c, h);
  }, o = function(c, u) {
    t && u.name === "__proto__" ? t(c, u.name, {
      enumerable: !0,
      configurable: !0,
      value: u.newValue,
      writable: !0
    }) : c[u.name] = u.newValue;
  }, a = function(c, u) {
    if (u === "__proto__")
      if (i.call(c, u)) {
        if (n)
          return n(c, u).value;
      } else return;
    return c[u];
  };
  return une = function l() {
    var c, u, d, h, g, m, _ = arguments[0], v = 1, w = arguments.length, E = !1;
    for (typeof _ == "boolean" && (E = _, _ = arguments[1] || {}, v = 2), (_ == null || typeof _ != "object" && typeof _ != "function") && (_ = {}); v < w; ++v)
      if (c = arguments[v], c != null)
        for (u in c)
          d = a(_, u), h = a(c, u), _ !== h && (E && h && (s(h) || (g = r(h))) ? (g ? (g = !1, m = d && r(d) ? d : []) : m = d && s(d) ? d : {}, o(_, { name: u, newValue: l(E, m, h) })) : typeof h < "u" && o(_, { name: u, newValue: h }));
    return _;
  }, une;
}
var FWt = PWt();
const dne = /* @__PURE__ */ WA(FWt);
function yde(i) {
  if (typeof i != "object" || i === null)
    return !1;
  const e = Object.getPrototypeOf(i);
  return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Symbol.toStringTag in i) && !(Symbol.iterator in i);
}
function BWt() {
  const i = [], e = { run: t, use: n };
  return e;
  function t(...r) {
    let s = -1;
    const o = r.pop();
    if (typeof o != "function")
      throw new TypeError("Expected function as last argument, not " + o);
    a(null, ...r);
    function a(l, ...c) {
      const u = i[++s];
      let d = -1;
      if (l) {
        o(l);
        return;
      }
      for (; ++d < r.length; )
        (c[d] === null || c[d] === void 0) && (c[d] = r[d]);
      r = c, u ? HWt(u, a)(...c) : o(null, ...c);
    }
  }
  function n(r) {
    if (typeof r != "function")
      throw new TypeError(
        "Expected `middelware` to be a function, not " + r
      );
    return i.push(r), e;
  }
}
function HWt(i, e) {
  let t;
  return n;
  function n(...o) {
    const a = i.length > o.length;
    let l;
    a && o.push(r);
    try {
      l = i.apply(this, o);
    } catch (c) {
      const u = (
        /** @type {Error} */
        c
      );
      if (a && t)
        throw u;
      return r(u);
    }
    a || (l && l.then && typeof l.then == "function" ? l.then(s, r) : l instanceof Error ? r(l) : s(l));
  }
  function r(o, ...a) {
    t || (t = !0, e(o, ...a));
  }
  function s(o) {
    r(null, o);
  }
}
const k_ = { basename: WWt, dirname: VWt, extname: UWt, join: zWt, sep: "/" };
function WWt(i, e) {
  if (e !== void 0 && typeof e != "string")
    throw new TypeError('"ext" argument must be a string');
  m6(i);
  let t = 0, n = -1, r = i.length, s;
  if (e === void 0 || e.length === 0 || e.length > i.length) {
    for (; r--; )
      if (i.codePointAt(r) === 47) {
        if (s) {
          t = r + 1;
          break;
        }
      } else n < 0 && (s = !0, n = r + 1);
    return n < 0 ? "" : i.slice(t, n);
  }
  if (e === i)
    return "";
  let o = -1, a = e.length - 1;
  for (; r--; )
    if (i.codePointAt(r) === 47) {
      if (s) {
        t = r + 1;
        break;
      }
    } else
      o < 0 && (s = !0, o = r + 1), a > -1 && (i.codePointAt(r) === e.codePointAt(a--) ? a < 0 && (n = r) : (a = -1, n = o));
  return t === n ? n = o : n < 0 && (n = i.length), i.slice(t, n);
}
function VWt(i) {
  if (m6(i), i.length === 0)
    return ".";
  let e = -1, t = i.length, n;
  for (; --t; )
    if (i.codePointAt(t) === 47) {
      if (n) {
        e = t;
        break;
      }
    } else n || (n = !0);
  return e < 0 ? i.codePointAt(0) === 47 ? "/" : "." : e === 1 && i.codePointAt(0) === 47 ? "//" : i.slice(0, e);
}
function UWt(i) {
  m6(i);
  let e = i.length, t = -1, n = 0, r = -1, s = 0, o;
  for (; e--; ) {
    const a = i.codePointAt(e);
    if (a === 47) {
      if (o) {
        n = e + 1;
        break;
      }
      continue;
    }
    t < 0 && (o = !0, t = e + 1), a === 46 ? r < 0 ? r = e : s !== 1 && (s = 1) : r > -1 && (s = -1);
  }
  return r < 0 || t < 0 || // We saw a non-dot character immediately before the dot.
  s === 0 || // The (right-most) trimmed path component is exactly `..`.
  s === 1 && r === t - 1 && r === n + 1 ? "" : i.slice(r, t);
}
function zWt(...i) {
  let e = -1, t;
  for (; ++e < i.length; )
    m6(i[e]), i[e] && (t = t === void 0 ? i[e] : t + "/" + i[e]);
  return t === void 0 ? "." : $Wt(t);
}
function $Wt(i) {
  m6(i);
  const e = i.codePointAt(0) === 47;
  let t = jWt(i, !e);
  return t.length === 0 && !e && (t = "."), t.length > 0 && i.codePointAt(i.length - 1) === 47 && (t += "/"), e ? "/" + t : t;
}
function jWt(i, e) {
  let t = "", n = 0, r = -1, s = 0, o = -1, a, l;
  for (; ++o <= i.length; ) {
    if (o < i.length)
      a = i.codePointAt(o);
    else {
      if (a === 47)
        break;
      a = 47;
    }
    if (a === 47) {
      if (!(r === o - 1 || s === 1)) if (r !== o - 1 && s === 2) {
        if (t.length < 2 || n !== 2 || t.codePointAt(t.length - 1) !== 46 || t.codePointAt(t.length - 2) !== 46) {
          if (t.length > 2) {
            if (l = t.lastIndexOf("/"), l !== t.length - 1) {
              l < 0 ? (t = "", n = 0) : (t = t.slice(0, l), n = t.length - 1 - t.lastIndexOf("/")), r = o, s = 0;
              continue;
            }
          } else if (t.length > 0) {
            t = "", n = 0, r = o, s = 0;
            continue;
          }
        }
        e && (t = t.length > 0 ? t + "/.." : "..", n = 2);
      } else
        t.length > 0 ? t += "/" + i.slice(r + 1, o) : t = i.slice(r + 1, o), n = o - r - 1;
      r = o, s = 0;
    } else a === 46 && s > -1 ? s++ : s = -1;
  }
  return t;
}
function m6(i) {
  if (typeof i != "string")
    throw new TypeError(
      "Path must be a string. Received " + JSON.stringify(i)
    );
}
const GWt = { cwd: qWt };
function qWt() {
  return "/";
}
function Cde(i) {
  return !!(i !== null && typeof i == "object" && "href" in i && i.href && "protocol" in i && i.protocol && // @ts-expect-error: indexing is fine.
  i.auth === void 0);
}
function KWt(i) {
  if (typeof i == "string")
    i = new URL(i);
  else if (!Cde(i)) {
    const e = new TypeError(
      'The "path" argument must be of type string or an instance of URL. Received `' + i + "`"
    );
    throw e.code = "ERR_INVALID_ARG_TYPE", e;
  }
  if (i.protocol !== "file:") {
    const e = new TypeError("The URL must be of scheme file");
    throw e.code = "ERR_INVALID_URL_SCHEME", e;
  }
  return YWt(i);
}
function YWt(i) {
  if (i.hostname !== "") {
    const n = new TypeError(
      'File URL host must be "localhost" or empty on darwin'
    );
    throw n.code = "ERR_INVALID_FILE_URL_HOST", n;
  }
  const e = i.pathname;
  let t = -1;
  for (; ++t < e.length; )
    if (e.codePointAt(t) === 37 && e.codePointAt(t + 1) === 50) {
      const n = e.codePointAt(t + 2);
      if (n === 70 || n === 102) {
        const r = new TypeError(
          "File URL path must not include encoded / characters"
        );
        throw r.code = "ERR_INVALID_FILE_URL_PATH", r;
      }
    }
  return decodeURIComponent(e);
}
const hne = (
  /** @type {const} */
  [
    "history",
    "path",
    "basename",
    "stem",
    "extname",
    "dirname"
  ]
);
class JHe {
  /**
   * Create a new virtual file.
   *
   * `options` is treated as:
   *
   * *   `string` or `Uint8Array` — `{value: options}`
   * *   `URL` — `{path: options}`
   * *   `VFile` — shallow copies its data over to the new file
   * *   `object` — all fields are shallow copied over to the new file
   *
   * Path related fields are set in the following order (least specific to
   * most specific): `history`, `path`, `basename`, `stem`, `extname`,
   * `dirname`.
   *
   * You cannot set `dirname` or `extname` without setting either `history`,
   * `path`, `basename`, or `stem` too.
   *
   * @param {Compatible | null | undefined} [value]
   *   File value.
   * @returns
   *   New instance.
   */
  constructor(e) {
    let t;
    e ? Cde(e) ? t = { path: e } : typeof e == "string" || XWt(e) ? t = { value: e } : t = e : t = {}, this.cwd = "cwd" in t ? "" : GWt.cwd(), this.data = {}, this.history = [], this.messages = [], this.value, this.map, this.result, this.stored;
    let n = -1;
    for (; ++n < hne.length; ) {
      const s = hne[n];
      s in t && t[s] !== void 0 && t[s] !== null && (this[s] = s === "history" ? [...t[s]] : t[s]);
    }
    let r;
    for (r in t)
      hne.includes(r) || (this[r] = t[r]);
  }
  /**
   * Get the basename (including extname) (example: `'index.min.js'`).
   *
   * @returns {string | undefined}
   *   Basename.
   */
  get basename() {
    return typeof this.path == "string" ? k_.basename(this.path) : void 0;
  }
  /**
   * Set basename (including extname) (`'index.min.js'`).
   *
   * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
   * on windows).
   * Cannot be nullified (use `file.path = file.dirname` instead).
   *
   * @param {string} basename
   *   Basename.
   * @returns {undefined}
   *   Nothing.
   */
  set basename(e) {
    gne(e, "basename"), fne(e, "basename"), this.path = k_.join(this.dirname || "", e);
  }
  /**
   * Get the parent path (example: `'~'`).
   *
   * @returns {string | undefined}
   *   Dirname.
   */
  get dirname() {
    return typeof this.path == "string" ? k_.dirname(this.path) : void 0;
  }
  /**
   * Set the parent path (example: `'~'`).
   *
   * Cannot be set if there’s no `path` yet.
   *
   * @param {string | undefined} dirname
   *   Dirname.
   * @returns {undefined}
   *   Nothing.
   */
  set dirname(e) {
    n2e(this.basename, "dirname"), this.path = k_.join(e || "", this.basename);
  }
  /**
   * Get the extname (including dot) (example: `'.js'`).
   *
   * @returns {string | undefined}
   *   Extname.
   */
  get extname() {
    return typeof this.path == "string" ? k_.extname(this.path) : void 0;
  }
  /**
   * Set the extname (including dot) (example: `'.js'`).
   *
   * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
   * on windows).
   * Cannot be set if there’s no `path` yet.
   *
   * @param {string | undefined} extname
   *   Extname.
   * @returns {undefined}
   *   Nothing.
   */
  set extname(e) {
    if (fne(e, "extname"), n2e(this.dirname, "extname"), e) {
      if (e.codePointAt(0) !== 46)
        throw new Error("`extname` must start with `.`");
      if (e.includes(".", 1))
        throw new Error("`extname` cannot contain multiple dots");
    }
    this.path = k_.join(this.dirname, this.stem + (e || ""));
  }
  /**
   * Get the full path (example: `'~/index.min.js'`).
   *
   * @returns {string}
   *   Path.
   */
  get path() {
    return this.history[this.history.length - 1];
  }
  /**
   * Set the full path (example: `'~/index.min.js'`).
   *
   * Cannot be nullified.
   * You can set a file URL (a `URL` object with a `file:` protocol) which will
   * be turned into a path with `url.fileURLToPath`.
   *
   * @param {URL | string} path
   *   Path.
   * @returns {undefined}
   *   Nothing.
   */
  set path(e) {
    Cde(e) && (e = KWt(e)), gne(e, "path"), this.path !== e && this.history.push(e);
  }
  /**
   * Get the stem (basename w/o extname) (example: `'index.min'`).
   *
   * @returns {string | undefined}
   *   Stem.
   */
  get stem() {
    return typeof this.path == "string" ? k_.basename(this.path, this.extname) : void 0;
  }
  /**
   * Set the stem (basename w/o extname) (example: `'index.min'`).
   *
   * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
   * on windows).
   * Cannot be nullified (use `file.path = file.dirname` instead).
   *
   * @param {string} stem
   *   Stem.
   * @returns {undefined}
   *   Nothing.
   */
  set stem(e) {
    gne(e, "stem"), fne(e, "stem"), this.path = k_.join(this.dirname || "", e + (this.extname || ""));
  }
  // Normal prototypal methods.
  /**
   * Create a fatal message for `reason` associated with the file.
   *
   * The `fatal` field of the message is set to `true` (error; file not usable)
   * and the `file` field is set to the current file path.
   * The message is added to the `messages` field on `file`.
   *
   * > 🪦 **Note**: also has obsolete signatures.
   *
   * @overload
   * @param {string} reason
   * @param {MessageOptions | null | undefined} [options]
   * @returns {never}
   *
   * @overload
   * @param {string} reason
   * @param {Node | NodeLike | null | undefined} parent
   * @param {string | null | undefined} [origin]
   * @returns {never}
   *
   * @overload
   * @param {string} reason
   * @param {Point | Position | null | undefined} place
   * @param {string | null | undefined} [origin]
   * @returns {never}
   *
   * @overload
   * @param {string} reason
   * @param {string | null | undefined} [origin]
   * @returns {never}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {Node | NodeLike | null | undefined} parent
   * @param {string | null | undefined} [origin]
   * @returns {never}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {Point | Position | null | undefined} place
   * @param {string | null | undefined} [origin]
   * @returns {never}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {string | null | undefined} [origin]
   * @returns {never}
   *
   * @param {Error | VFileMessage | string} causeOrReason
   *   Reason for message, should use markdown.
   * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
   *   Configuration (optional).
   * @param {string | null | undefined} [origin]
   *   Place in code where the message originates (example:
   *   `'my-package:my-rule'` or `'my-rule'`).
   * @returns {never}
   *   Never.
   * @throws {VFileMessage}
   *   Message.
   */
  fail(e, t, n) {
    const r = this.message(e, t, n);
    throw r.fatal = !0, r;
  }
  /**
   * Create an info message for `reason` associated with the file.
   *
   * The `fatal` field of the message is set to `undefined` (info; change
   * likely not needed) and the `file` field is set to the current file path.
   * The message is added to the `messages` field on `file`.
   *
   * > 🪦 **Note**: also has obsolete signatures.
   *
   * @overload
   * @param {string} reason
   * @param {MessageOptions | null | undefined} [options]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {string} reason
   * @param {Node | NodeLike | null | undefined} parent
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {string} reason
   * @param {Point | Position | null | undefined} place
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {string} reason
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {Node | NodeLike | null | undefined} parent
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {Point | Position | null | undefined} place
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @param {Error | VFileMessage | string} causeOrReason
   *   Reason for message, should use markdown.
   * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
   *   Configuration (optional).
   * @param {string | null | undefined} [origin]
   *   Place in code where the message originates (example:
   *   `'my-package:my-rule'` or `'my-rule'`).
   * @returns {VFileMessage}
   *   Message.
   */
  info(e, t, n) {
    const r = this.message(e, t, n);
    return r.fatal = void 0, r;
  }
  /**
   * Create a message for `reason` associated with the file.
   *
   * The `fatal` field of the message is set to `false` (warning; change may be
   * needed) and the `file` field is set to the current file path.
   * The message is added to the `messages` field on `file`.
   *
   * > 🪦 **Note**: also has obsolete signatures.
   *
   * @overload
   * @param {string} reason
   * @param {MessageOptions | null | undefined} [options]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {string} reason
   * @param {Node | NodeLike | null | undefined} parent
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {string} reason
   * @param {Point | Position | null | undefined} place
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {string} reason
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {Node | NodeLike | null | undefined} parent
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {Point | Position | null | undefined} place
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @overload
   * @param {Error | VFileMessage} cause
   * @param {string | null | undefined} [origin]
   * @returns {VFileMessage}
   *
   * @param {Error | VFileMessage | string} causeOrReason
   *   Reason for message, should use markdown.
   * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
   *   Configuration (optional).
   * @param {string | null | undefined} [origin]
   *   Place in code where the message originates (example:
   *   `'my-package:my-rule'` or `'my-rule'`).
   * @returns {VFileMessage}
   *   Message.
   */
  message(e, t, n) {
    const r = new cd(
      // @ts-expect-error: the overloads are fine.
      e,
      t,
      n
    );
    return this.path && (r.name = this.path + ":" + r.name, r.file = this.path), r.fatal = !1, this.messages.push(r), r;
  }
  /**
   * Serialize the file.
   *
   * > **Note**: which encodings are supported depends on the engine.
   * > For info on Node.js, see:
   * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
   *
   * @param {string | null | undefined} [encoding='utf8']
   *   Character encoding to understand `value` as when it’s a `Uint8Array`
   *   (default: `'utf-8'`).
   * @returns {string}
   *   Serialized file.
   */
  toString(e) {
    return this.value === void 0 ? "" : typeof this.value == "string" ? this.value : new TextDecoder(e || void 0).decode(this.value);
  }
}
function fne(i, e) {
  if (i && i.includes(k_.sep))
    throw new Error(
      "`" + e + "` cannot be a path: did not expect `" + k_.sep + "`"
    );
}
function gne(i, e) {
  if (!i)
    throw new Error("`" + e + "` cannot be empty");
}
function n2e(i, e) {
  if (!i)
    throw new Error("Setting `" + e + "` requires `path` to be set too");
}
function XWt(i) {
  return !!(i && typeof i == "object" && "byteLength" in i && "byteOffset" in i);
}
const ZWt = (
  /**
   * @type {new <Parameters extends Array<unknown>, Result>(property: string | symbol) => (...parameters: Parameters) => Result}
   */
  /** @type {unknown} */
  /**
   * @this {Function}
   * @param {string | symbol} property
   * @returns {(...parameters: Array<unknown>) => unknown}
   */
  (function(i) {
    const n = (
      /** @type {Record<string | symbol, Function>} */
      // Prototypes do exist.
      // type-coverage:ignore-next-line
      this.constructor.prototype
    ), r = n[i], s = function() {
      return r.apply(s, arguments);
    };
    return Object.setPrototypeOf(s, n), s;
  })
), QWt = {}.hasOwnProperty;
class B0e extends ZWt {
  /**
   * Create a processor.
   */
  constructor() {
    super("copy"), this.Compiler = void 0, this.Parser = void 0, this.attachers = [], this.compiler = void 0, this.freezeIndex = -1, this.frozen = void 0, this.namespace = {}, this.parser = void 0, this.transformers = BWt();
  }
  /**
   * Copy a processor.
   *
   * @deprecated
   *   This is a private internal method and should not be used.
   * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
   *   New *unfrozen* processor ({@linkcode Processor}) that is
   *   configured to work the same as its ancestor.
   *   When the descendant processor is configured in the future it does not
   *   affect the ancestral processor.
   */
  copy() {
    const e = (
      /** @type {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} */
      new B0e()
    );
    let t = -1;
    for (; ++t < this.attachers.length; ) {
      const n = this.attachers[t];
      e.use(...n);
    }
    return e.data(dne(!0, {}, this.namespace)), e;
  }
  /**
   * Configure the processor with info available to all plugins.
   * Information is stored in an object.
   *
   * Typically, options can be given to a specific plugin, but sometimes it
   * makes sense to have information shared with several plugins.
   * For example, a list of HTML elements that are self-closing, which is
   * needed during all phases.
   *
   * > **Note**: setting information cannot occur on *frozen* processors.
   * > Call the processor first to create a new unfrozen processor.
   *
   * > **Note**: to register custom data in TypeScript, augment the
   * > {@linkcode Data} interface.
   *
   * @example
   *   This example show how to get and set info:
   *
   *   ```js
   *   import {unified} from 'unified'
   *
   *   const processor = unified().data('alpha', 'bravo')
   *
   *   processor.data('alpha') // => 'bravo'
   *
   *   processor.data() // => {alpha: 'bravo'}
   *
   *   processor.data({charlie: 'delta'})
   *
   *   processor.data() // => {charlie: 'delta'}
   *   ```
   *
   * @template {keyof Data} Key
   *
   * @overload
   * @returns {Data}
   *
   * @overload
   * @param {Data} dataset
   * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
   *
   * @overload
   * @param {Key} key
   * @returns {Data[Key]}
   *
   * @overload
   * @param {Key} key
   * @param {Data[Key]} value
   * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
   *
   * @param {Data | Key} [key]
   *   Key to get or set, or entire dataset to set, or nothing to get the
   *   entire dataset (optional).
   * @param {Data[Key]} [value]
   *   Value to set (optional).
   * @returns {unknown}
   *   The current processor when setting, the value at `key` when getting, or
   *   the entire dataset when getting without key.
   */
  data(e, t) {
    return typeof e == "string" ? arguments.length === 2 ? (_ne("data", this.frozen), this.namespace[e] = t, this) : QWt.call(this.namespace, e) && this.namespace[e] || void 0 : e ? (_ne("data", this.frozen), this.namespace = e, this) : this.namespace;
  }
  /**
   * Freeze a processor.
   *
   * Frozen processors are meant to be extended and not to be configured
   * directly.
   *
   * When a processor is frozen it cannot be unfrozen.
   * New processors working the same way can be created by calling the
   * processor.
   *
   * It’s possible to freeze processors explicitly by calling `.freeze()`.
   * Processors freeze automatically when `.parse()`, `.run()`, `.runSync()`,
   * `.stringify()`, `.process()`, or `.processSync()` are called.
   *
   * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
   *   The current processor.
   */
  freeze() {
    if (this.frozen)
      return this;
    const e = (
      /** @type {Processor} */
      /** @type {unknown} */
      this
    );
    for (; ++this.freezeIndex < this.attachers.length; ) {
      const [t, ...n] = this.attachers[this.freezeIndex];
      if (n[0] === !1)
        continue;
      n[0] === !0 && (n[0] = void 0);
      const r = t.call(e, ...n);
      typeof r == "function" && this.transformers.use(r);
    }
    return this.frozen = !0, this.freezeIndex = Number.POSITIVE_INFINITY, this;
  }
  /**
   * Parse text to a syntax tree.
   *
   * > **Note**: `parse` freezes the processor if not already *frozen*.
   *
   * > **Note**: `parse` performs the parse phase, not the run phase or other
   * > phases.
   *
   * @param {Compatible | undefined} [file]
   *   file to parse (optional); typically `string` or `VFile`; any value
   *   accepted as `x` in `new VFile(x)`.
   * @returns {ParseTree extends undefined ? Node : ParseTree}
   *   Syntax tree representing `file`.
   */
  parse(e) {
    this.freeze();
    const t = tW(e), n = this.parser || this.Parser;
    return pne("parse", n), n(String(t), t);
  }
  /**
   * Process the given file as configured on the processor.
   *
   * > **Note**: `process` freezes the processor if not already *frozen*.
   *
   * > **Note**: `process` performs the parse, run, and stringify phases.
   *
   * @overload
   * @param {Compatible | undefined} file
   * @param {ProcessCallback<VFileWithOutput<CompileResult>>} done
   * @returns {undefined}
   *
   * @overload
   * @param {Compatible | undefined} [file]
   * @returns {Promise<VFileWithOutput<CompileResult>>}
   *
   * @param {Compatible | undefined} [file]
   *   File (optional); typically `string` or `VFile`]; any value accepted as
   *   `x` in `new VFile(x)`.
   * @param {ProcessCallback<VFileWithOutput<CompileResult>> | undefined} [done]
   *   Callback (optional).
   * @returns {Promise<VFile> | undefined}
   *   Nothing if `done` is given.
   *   Otherwise a promise, rejected with a fatal error or resolved with the
   *   processed file.
   *
   *   The parsed, transformed, and compiled value is available at
   *   `file.value` (see note).
   *
   *   > **Note**: unified typically compiles by serializing: most
   *   > compilers return `string` (or `Uint8Array`).
   *   > Some compilers, such as the one configured with
   *   > [`rehype-react`][rehype-react], return other values (in this case, a
   *   > React tree).
   *   > If you’re using a compiler that doesn’t serialize, expect different
   *   > result values.
   *   >
   *   > To register custom results in TypeScript, add them to
   *   > {@linkcode CompileResultMap}.
   *
   *   [rehype-react]: https://github.com/rehypejs/rehype-react
   */
  process(e, t) {
    const n = this;
    return this.freeze(), pne("process", this.parser || this.Parser), mne("process", this.compiler || this.Compiler), t ? r(void 0, t) : new Promise(r);
    function r(s, o) {
      const a = tW(e), l = (
        /** @type {HeadTree extends undefined ? Node : HeadTree} */
        /** @type {unknown} */
        n.parse(a)
      );
      n.run(l, a, function(u, d, h) {
        if (u || !d || !h)
          return c(u);
        const g = (
          /** @type {CompileTree extends undefined ? Node : CompileTree} */
          /** @type {unknown} */
          d
        ), m = n.stringify(g, h);
        tVt(m) ? h.value = m : h.result = m, c(
          u,
          /** @type {VFileWithOutput<CompileResult>} */
          h
        );
      });
      function c(u, d) {
        u || !d ? o(u) : s ? s(d) : t(void 0, d);
      }
    }
  }
  /**
   * Process the given file as configured on the processor.
   *
   * An error is thrown if asynchronous transforms are configured.
   *
   * > **Note**: `processSync` freezes the processor if not already *frozen*.
   *
   * > **Note**: `processSync` performs the parse, run, and stringify phases.
   *
   * @param {Compatible | undefined} [file]
   *   File (optional); typically `string` or `VFile`; any value accepted as
   *   `x` in `new VFile(x)`.
   * @returns {VFileWithOutput<CompileResult>}
   *   The processed file.
   *
   *   The parsed, transformed, and compiled value is available at
   *   `file.value` (see note).
   *
   *   > **Note**: unified typically compiles by serializing: most
   *   > compilers return `string` (or `Uint8Array`).
   *   > Some compilers, such as the one configured with
   *   > [`rehype-react`][rehype-react], return other values (in this case, a
   *   > React tree).
   *   > If you’re using a compiler that doesn’t serialize, expect different
   *   > result values.
   *   >
   *   > To register custom results in TypeScript, add them to
   *   > {@linkcode CompileResultMap}.
   *
   *   [rehype-react]: https://github.com/rehypejs/rehype-react
   */
  processSync(e) {
    let t = !1, n;
    return this.freeze(), pne("processSync", this.parser || this.Parser), mne("processSync", this.compiler || this.Compiler), this.process(e, r), r2e("processSync", "process", t), n;
    function r(s, o) {
      t = !0, e2e(s), n = o;
    }
  }
  /**
   * Run *transformers* on a syntax tree.
   *
   * > **Note**: `run` freezes the processor if not already *frozen*.
   *
   * > **Note**: `run` performs the run phase, not other phases.
   *
   * @overload
   * @param {HeadTree extends undefined ? Node : HeadTree} tree
   * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done
   * @returns {undefined}
   *
   * @overload
   * @param {HeadTree extends undefined ? Node : HeadTree} tree
   * @param {Compatible | undefined} file
   * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done
   * @returns {undefined}
   *
   * @overload
   * @param {HeadTree extends undefined ? Node : HeadTree} tree
   * @param {Compatible | undefined} [file]
   * @returns {Promise<TailTree extends undefined ? Node : TailTree>}
   *
   * @param {HeadTree extends undefined ? Node : HeadTree} tree
   *   Tree to transform and inspect.
   * @param {(
   *   RunCallback<TailTree extends undefined ? Node : TailTree> |
   *   Compatible
   * )} [file]
   *   File associated with `node` (optional); any value accepted as `x` in
   *   `new VFile(x)`.
   * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} [done]
   *   Callback (optional).
   * @returns {Promise<TailTree extends undefined ? Node : TailTree> | undefined}
   *   Nothing if `done` is given.
   *   Otherwise, a promise rejected with a fatal error or resolved with the
   *   transformed tree.
   */
  run(e, t, n) {
    i2e(e), this.freeze();
    const r = this.transformers;
    return !n && typeof t == "function" && (n = t, t = void 0), n ? s(void 0, n) : new Promise(s);
    function s(o, a) {
      const l = tW(t);
      r.run(e, l, c);
      function c(u, d, h) {
        const g = (
          /** @type {TailTree extends undefined ? Node : TailTree} */
          d || e
        );
        u ? a(u) : o ? o(g) : n(void 0, g, h);
      }
    }
  }
  /**
   * Run *transformers* on a syntax tree.
   *
   * An error is thrown if asynchronous transforms are configured.
   *
   * > **Note**: `runSync` freezes the processor if not already *frozen*.
   *
   * > **Note**: `runSync` performs the run phase, not other phases.
   *
   * @param {HeadTree extends undefined ? Node : HeadTree} tree
   *   Tree to transform and inspect.
   * @param {Compatible | undefined} [file]
   *   File associated with `node` (optional); any value accepted as `x` in
   *   `new VFile(x)`.
   * @returns {TailTree extends undefined ? Node : TailTree}
   *   Transformed tree.
   */
  runSync(e, t) {
    let n = !1, r;
    return this.run(e, t, s), r2e("runSync", "run", n), r;
    function s(o, a) {
      e2e(o), r = a, n = !0;
    }
  }
  /**
   * Compile a syntax tree.
   *
   * > **Note**: `stringify` freezes the processor if not already *frozen*.
   *
   * > **Note**: `stringify` performs the stringify phase, not the run phase
   * > or other phases.
   *
   * @param {CompileTree extends undefined ? Node : CompileTree} tree
   *   Tree to compile.
   * @param {Compatible | undefined} [file]
   *   File associated with `node` (optional); any value accepted as `x` in
   *   `new VFile(x)`.
   * @returns {CompileResult extends undefined ? Value : CompileResult}
   *   Textual representation of the tree (see note).
   *
   *   > **Note**: unified typically compiles by serializing: most compilers
   *   > return `string` (or `Uint8Array`).
   *   > Some compilers, such as the one configured with
   *   > [`rehype-react`][rehype-react], return other values (in this case, a
   *   > React tree).
   *   > If you’re using a compiler that doesn’t serialize, expect different
   *   > result values.
   *   >
   *   > To register custom results in TypeScript, add them to
   *   > {@linkcode CompileResultMap}.
   *
   *   [rehype-react]: https://github.com/rehypejs/rehype-react
   */
  stringify(e, t) {
    this.freeze();
    const n = tW(t), r = this.compiler || this.Compiler;
    return mne("stringify", r), i2e(e), r(e, n);
  }
  /**
   * Configure the processor to use a plugin, a list of usable values, or a
   * preset.
   *
   * If the processor is already using a plugin, the previous plugin
   * configuration is changed based on the options that are passed in.
   * In other words, the plugin is not added a second time.
   *
   * > **Note**: `use` cannot be called on *frozen* processors.
   * > Call the processor first to create a new unfrozen processor.
   *
   * @example
   *   There are many ways to pass plugins to `.use()`.
   *   This example gives an overview:
   *
   *   ```js
   *   import {unified} from 'unified'
   *
   *   unified()
   *     // Plugin with options:
   *     .use(pluginA, {x: true, y: true})
   *     // Passing the same plugin again merges configuration (to `{x: true, y: false, z: true}`):
   *     .use(pluginA, {y: false, z: true})
   *     // Plugins:
   *     .use([pluginB, pluginC])
   *     // Two plugins, the second with options:
   *     .use([pluginD, [pluginE, {}]])
   *     // Preset with plugins and settings:
   *     .use({plugins: [pluginF, [pluginG, {}]], settings: {position: false}})
   *     // Settings only:
   *     .use({settings: {position: false}})
   *   ```
   *
   * @template {Array<unknown>} [Parameters=[]]
   * @template {Node | string | undefined} [Input=undefined]
   * @template [Output=Input]
   *
   * @overload
   * @param {Preset | null | undefined} [preset]
   * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
   *
   * @overload
   * @param {PluggableList} list
   * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
   *
   * @overload
   * @param {Plugin<Parameters, Input, Output>} plugin
   * @param {...(Parameters | [boolean])} parameters
   * @returns {UsePlugin<ParseTree, HeadTree, TailTree, CompileTree, CompileResult, Input, Output>}
   *
   * @param {PluggableList | Plugin | Preset | null | undefined} value
   *   Usable value.
   * @param {...unknown} parameters
   *   Parameters, when a plugin is given as a usable value.
   * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}
   *   Current processor.
   */
  use(e, ...t) {
    const n = this.attachers, r = this.namespace;
    if (_ne("use", this.frozen), e != null) if (typeof e == "function")
      l(e, t);
    else if (typeof e == "object")
      Array.isArray(e) ? a(e) : o(e);
    else
      throw new TypeError("Expected usable value, not `" + e + "`");
    return this;
    function s(c) {
      if (typeof c == "function")
        l(c, []);
      else if (typeof c == "object")
        if (Array.isArray(c)) {
          const [u, ...d] = (
            /** @type {PluginTuple<Array<unknown>>} */
            c
          );
          l(u, d);
        } else
          o(c);
      else
        throw new TypeError("Expected usable value, not `" + c + "`");
    }
    function o(c) {
      if (!("plugins" in c) && !("settings" in c))
        throw new Error(
          "Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither"
        );
      a(c.plugins), c.settings && (r.settings = dne(!0, r.settings, c.settings));
    }
    function a(c) {
      let u = -1;
      if (c != null) if (Array.isArray(c))
        for (; ++u < c.length; ) {
          const d = c[u];
          s(d);
        }
      else
        throw new TypeError("Expected a list of plugins, not `" + c + "`");
    }
    function l(c, u) {
      let d = -1, h = -1;
      for (; ++d < n.length; )
        if (n[d][0] === c) {
          h = d;
          break;
        }
      if (h === -1)
        n.push([c, ...u]);
      else if (u.length > 0) {
        let [g, ...m] = u;
        const _ = n[h][1];
        yde(_) && yde(g) && (g = dne(!0, _, g)), n[h] = [c, g, ...m];
      }
    }
  }
}
const JWt = new B0e().freeze();
function pne(i, e) {
  if (typeof e != "function")
    throw new TypeError("Cannot `" + i + "` without `parser`");
}
function mne(i, e) {
  if (typeof e != "function")
    throw new TypeError("Cannot `" + i + "` without `compiler`");
}
function _ne(i, e) {
  if (e)
    throw new Error(
      "Cannot call `" + i + "` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`."
    );
}
function i2e(i) {
  if (!yde(i) || typeof i.type != "string")
    throw new TypeError("Expected node, got `" + i + "`");
}
function r2e(i, e, t) {
  if (!t)
    throw new Error(
      "`" + i + "` finished async. Use `" + e + "` instead"
    );
}
function tW(i) {
  return eVt(i) ? i : new JHe(i);
}
function eVt(i) {
  return !!(i && typeof i == "object" && "message" in i && "messages" in i);
}
function tVt(i) {
  return typeof i == "string" || nVt(i);
}
function nVt(i) {
  return !!(i && typeof i == "object" && "byteLength" in i && "byteOffset" in i);
}
const iVt = "https://github.com/remarkjs/react-markdown/blob/main/changelog.md", s2e = [], o2e = { allowDangerousHtml: !0 }, rVt = /^(https?|ircs?|mailto|xmpp)$/i, sVt = [
  { from: "astPlugins", id: "remove-buggy-html-in-markdown-parser" },
  { from: "allowDangerousHtml", id: "remove-buggy-html-in-markdown-parser" },
  {
    from: "allowNode",
    id: "replace-allownode-allowedtypes-and-disallowedtypes",
    to: "allowElement"
  },
  {
    from: "allowedTypes",
    id: "replace-allownode-allowedtypes-and-disallowedtypes",
    to: "allowedElements"
  },
  {
    from: "disallowedTypes",
    id: "replace-allownode-allowedtypes-and-disallowedtypes",
    to: "disallowedElements"
  },
  { from: "escapeHtml", id: "remove-buggy-html-in-markdown-parser" },
  { from: "includeElementIndex", id: "#remove-includeelementindex" },
  {
    from: "includeNodeIndex",
    id: "change-includenodeindex-to-includeelementindex"
  },
  { from: "linkTarget", id: "remove-linktarget" },
  { from: "plugins", id: "change-plugins-to-remarkplugins", to: "remarkPlugins" },
  { from: "rawSourcePos", id: "#remove-rawsourcepos" },
  { from: "renderers", id: "change-renderers-to-components", to: "components" },
  { from: "source", id: "change-source-to-children", to: "children" },
  { from: "sourcePos", id: "#remove-sourcepos" },
  { from: "transformImageUri", id: "#add-urltransform", to: "urlTransform" },
  { from: "transformLinkUri", id: "#add-urltransform", to: "urlTransform" }
];
function oVt(i) {
  const e = i.allowedElements, t = i.allowElement, n = i.children || "", r = i.className, s = i.components, o = i.disallowedElements, a = i.rehypePlugins || s2e, l = i.remarkPlugins || s2e, c = i.remarkRehypeOptions ? { ...i.remarkRehypeOptions, ...o2e } : o2e, u = i.skipHtml, d = i.unwrapDisallowed, h = i.urlTransform || aVt, g = JWt().use(JHt).use(l).use(MWt, c).use(a), m = new JHe();
  typeof n == "string" && (m.value = n);
  for (const E of sVt)
    Object.hasOwn(i, E.from) && ("" + E.from + (E.to ? "use `" + E.to + "` instead" : "remove it") + iVt + E.id, void 0);
  const _ = g.parse(m);
  let v = g.runSync(_, m);
  return r && (v = {
    type: "element",
    tagName: "div",
    properties: { className: r },
    // Assume no doctypes.
    children: (
      /** @type {Array<ElementContent>} */
      v.type === "root" ? v.children : [v]
    )
  }), qd(v, w), P9t(v, {
    Fragment: hr.Fragment,
    // @ts-expect-error
    // React components are allowed to return numbers,
    // but not according to the types in hast-util-to-jsx-runtime
    components: s,
    ignoreInvalidStyle: !0,
    jsx: hr.jsx,
    jsxs: hr.jsxs,
    passKeys: !0,
    passNode: !0
  });
  function w(E, L, T) {
    if (E.type === "raw" && T && typeof L == "number")
      return u ? T.children.splice(L, 1) : T.children[L] = { type: "text", value: E.value }, L;
    if (E.type === "element") {
      let D;
      for (D in ane)
        if (Object.hasOwn(ane, D) && Object.hasOwn(E.properties, D)) {
          const N = E.properties[D], R = ane[D];
          (R === null || R.includes(E.tagName)) && (E.properties[D] = h(String(N || ""), D, E));
        }
    }
    if (E.type === "element") {
      let D = e ? !e.includes(E.tagName) : o ? o.includes(E.tagName) : !1;
      if (!D && t && typeof L == "number" && (D = !t(E, L, T)), D && T && typeof L == "number")
        return d && E.children ? T.children.splice(L, 1, ...E.children) : T.children.splice(L, 1), L;
    }
  }
}
function aVt(i) {
  const e = i.indexOf(":"), t = i.indexOf("?"), n = i.indexOf("#"), r = i.indexOf("/");
  return (
    // If there is no protocol, it’s relative.
    e === -1 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
    r !== -1 && e > r || t !== -1 && e > t || n !== -1 && e > n || // It is a protocol, it should be allowed.
    rVt.test(i.slice(0, e)) ? i : ""
  );
}
function a2e(i, e) {
  const t = String(i);
  if (typeof e != "string")
    throw new TypeError("Expected character");
  let n = 0, r = t.indexOf(e);
  for (; r !== -1; )
    n++, r = t.indexOf(e, r + e.length);
  return n;
}
function lVt(i) {
  if (typeof i != "string")
    throw new TypeError("Expected a string");
  return i.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
}
function cVt(i, e, t) {
  const r = e6((t || {}).ignore || []), s = uVt(e);
  let o = -1;
  for (; ++o < s.length; )
    u7e(i, "text", a);
  function a(c, u) {
    let d = -1, h;
    for (; ++d < u.length; ) {
      const g = u[d], m = h ? h.children : void 0;
      if (r(
        g,
        m ? m.indexOf(g) : void 0,
        h
      ))
        return;
      h = g;
    }
    if (h)
      return l(c, u);
  }
  function l(c, u) {
    const d = u[u.length - 1], h = s[o][0], g = s[o][1];
    let m = 0;
    const v = d.children.indexOf(c);
    let w = !1, E = [];
    h.lastIndex = 0;
    let L = h.exec(c.value);
    for (; L; ) {
      const T = L.index, D = {
        index: L.index,
        input: L.input,
        stack: [...u, c]
      };
      let N = g(...L, D);
      if (typeof N == "string" && (N = N.length > 0 ? { type: "text", value: N } : void 0), N === !1 ? h.lastIndex = T + 1 : (m !== T && E.push({
        type: "text",
        value: c.value.slice(m, T)
      }), Array.isArray(N) ? E.push(...N) : N && E.push(N), m = T + L[0].length, w = !0), !h.global)
        break;
      L = h.exec(c.value);
    }
    return w ? (m < c.value.length && E.push({ type: "text", value: c.value.slice(m) }), d.children.splice(v, 1, ...E)) : E = [c], v + E.length;
  }
}
function uVt(i) {
  const e = [];
  if (!Array.isArray(i))
    throw new TypeError("Expected find and replace tuple or list of tuples");
  const t = !i[0] || Array.isArray(i[0]) ? i : [i];
  let n = -1;
  for (; ++n < t.length; ) {
    const r = t[n];
    e.push([dVt(r[0]), hVt(r[1])]);
  }
  return e;
}
function dVt(i) {
  return typeof i == "string" ? new RegExp(lVt(i), "g") : i;
}
function hVt(i) {
  return typeof i == "function" ? i : function() {
    return i;
  };
}
const bne = "phrasing", vne = ["autolink", "link", "image", "label"];
function fVt() {
  return {
    transforms: [yVt],
    enter: {
      literalAutolink: pVt,
      literalAutolinkEmail: yne,
      literalAutolinkHttp: yne,
      literalAutolinkWww: yne
    },
    exit: {
      literalAutolink: vVt,
      literalAutolinkEmail: bVt,
      literalAutolinkHttp: mVt,
      literalAutolinkWww: _Vt
    }
  };
}
function gVt() {
  return {
    unsafe: [
      {
        character: "@",
        before: "[+\\-.\\w]",
        after: "[\\-.\\w]",
        inConstruct: bne,
        notInConstruct: vne
      },
      {
        character: ".",
        before: "[Ww]",
        after: "[\\-.\\w]",
        inConstruct: bne,
        notInConstruct: vne
      },
      {
        character: ":",
        before: "[ps]",
        after: "\\/",
        inConstruct: bne,
        notInConstruct: vne
      }
    ]
  };
}
function pVt(i) {
  this.enter({ type: "link", title: null, url: "", children: [] }, i);
}
function yne(i) {
  this.config.enter.autolinkProtocol.call(this, i);
}
function mVt(i) {
  this.config.exit.autolinkProtocol.call(this, i);
}
function _Vt(i) {
  this.config.exit.data.call(this, i);
  const e = this.stack[this.stack.length - 1];
  e.type, e.url = "http://" + this.sliceSerialize(i);
}
function bVt(i) {
  this.config.exit.autolinkEmail.call(this, i);
}
function vVt(i) {
  this.exit(i);
}
function yVt(i) {
  cVt(
    i,
    [
      [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, CVt],
      [new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)", "gu"), wVt]
    ],
    { ignore: ["link", "linkReference"] }
  );
}
function CVt(i, e, t, n, r) {
  let s = "";
  if (!eWe(r) || (/^w/i.test(e) && (t = e + t, e = "", s = "http://"), !SVt(t)))
    return !1;
  const o = EVt(t + n);
  if (!o[0]) return !1;
  const a = {
    type: "link",
    title: null,
    url: s + e + o[0],
    children: [{ type: "text", value: e + o[0] }]
  };
  return o[1] ? [a, { type: "text", value: o[1] }] : a;
}
function wVt(i, e, t, n) {
  return (
    // Not an expected previous character.
    !eWe(n, !0) || // Label ends in not allowed character.
    /[-\d_]$/.test(t) ? !1 : {
      type: "link",
      title: null,
      url: "mailto:" + e + "@" + t,
      children: [{ type: "text", value: e + "@" + t }]
    }
  );
}
function SVt(i) {
  const e = i.split(".");
  return !(e.length < 2 || e[e.length - 1] && (/_/.test(e[e.length - 1]) || !/[a-zA-Z\d]/.test(e[e.length - 1])) || e[e.length - 2] && (/_/.test(e[e.length - 2]) || !/[a-zA-Z\d]/.test(e[e.length - 2])));
}
function EVt(i) {
  const e = /[!"&'),.:;<>?\]}]+$/.exec(i);
  if (!e)
    return [i, void 0];
  i = i.slice(0, e.index);
  let t = e[0], n = t.indexOf(")");
  const r = a2e(i, "(");
  let s = a2e(i, ")");
  for (; n !== -1 && r > s; )
    i += t.slice(0, n + 1), t = t.slice(n + 1), n = t.indexOf(")"), s++;
  return [i, t];
}
function eWe(i, e) {
  const t = i.input.charCodeAt(i.index - 1);
  return (i.index === 0 || OT(t) || DY(t)) && // If it’s an email, the previous character should not be a slash.
  (!e || t !== 47);
}
tWe.peek = AVt;
function xVt() {
  this.buffer();
}
function LVt(i) {
  this.enter({ type: "footnoteReference", identifier: "", label: "" }, i);
}
function TVt() {
  this.buffer();
}
function kVt(i) {
  this.enter(
    { type: "footnoteDefinition", identifier: "", label: "", children: [] },
    i
  );
}
function DVt(i) {
  const e = this.resume(), t = this.stack[this.stack.length - 1];
  t.type, t.identifier = cm(
    this.sliceSerialize(i)
  ).toLowerCase(), t.label = e;
}
function IVt(i) {
  this.exit(i);
}
function NVt(i) {
  const e = this.resume(), t = this.stack[this.stack.length - 1];
  t.type, t.identifier = cm(
    this.sliceSerialize(i)
  ).toLowerCase(), t.label = e;
}
function RVt(i) {
  this.exit(i);
}
function AVt() {
  return "[";
}
function tWe(i, e, t, n) {
  const r = t.createTracker(n);
  let s = r.move("[^");
  const o = t.enter("footnoteReference"), a = t.enter("reference");
  return s += r.move(
    t.safe(t.associationId(i), { after: "]", before: s })
  ), a(), o(), s += r.move("]"), s;
}
function OVt() {
  return {
    enter: {
      gfmFootnoteCallString: xVt,
      gfmFootnoteCall: LVt,
      gfmFootnoteDefinitionLabelString: TVt,
      gfmFootnoteDefinition: kVt
    },
    exit: {
      gfmFootnoteCallString: DVt,
      gfmFootnoteCall: IVt,
      gfmFootnoteDefinitionLabelString: NVt,
      gfmFootnoteDefinition: RVt
    }
  };
}
function MVt(i) {
  let e = !1;
  return i && i.firstLineBlank && (e = !0), {
    handlers: { footnoteDefinition: t, footnoteReference: tWe },
    // This is on by default already.
    unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
  };
  function t(n, r, s, o) {
    const a = s.createTracker(o);
    let l = a.move("[^");
    const c = s.enter("footnoteDefinition"), u = s.enter("label");
    return l += a.move(
      s.safe(s.associationId(n), { before: l, after: "]" })
    ), u(), l += a.move("]:"), n.children && n.children.length > 0 && (a.shift(4), l += a.move(
      (e ? `
` : " ") + s.indentLines(
        s.containerFlow(n, a.current()),
        e ? nWe : PVt
      )
    )), c(), l;
  }
}
function PVt(i, e, t) {
  return e === 0 ? i : nWe(i, e, t);
}
function nWe(i, e, t) {
  return (t ? "" : "    ") + i;
}
const FVt = [
  "autolink",
  "destinationLiteral",
  "destinationRaw",
  "reference",
  "titleQuote",
  "titleApostrophe"
];
iWe.peek = UVt;
function BVt() {
  return {
    canContainEols: ["delete"],
    enter: { strikethrough: WVt },
    exit: { strikethrough: VVt }
  };
}
function HVt() {
  return {
    unsafe: [
      {
        character: "~",
        inConstruct: "phrasing",
        notInConstruct: FVt
      }
    ],
    handlers: { delete: iWe }
  };
}
function WVt(i) {
  this.enter({ type: "delete", children: [] }, i);
}
function VVt(i) {
  this.exit(i);
}
function iWe(i, e, t, n) {
  const r = t.createTracker(n), s = t.enter("strikethrough");
  let o = r.move("~~");
  return o += t.containerPhrasing(i, {
    ...r.current(),
    before: o,
    after: "~"
  }), o += r.move("~~"), s(), o;
}
function UVt() {
  return "~";
}
function zVt(i) {
  return i.length;
}
function $Vt(i, e) {
  const t = e || {}, n = (t.align || []).concat(), r = t.stringLength || zVt, s = [], o = [], a = [], l = [];
  let c = 0, u = -1;
  for (; ++u < i.length; ) {
    const _ = [], v = [];
    let w = -1;
    for (i[u].length > c && (c = i[u].length); ++w < i[u].length; ) {
      const E = jVt(i[u][w]);
      if (t.alignDelimiters !== !1) {
        const L = r(E);
        v[w] = L, (l[w] === void 0 || L > l[w]) && (l[w] = L);
      }
      _.push(E);
    }
    o[u] = _, a[u] = v;
  }
  let d = -1;
  if (typeof n == "object" && "length" in n)
    for (; ++d < c; )
      s[d] = l2e(n[d]);
  else {
    const _ = l2e(n);
    for (; ++d < c; )
      s[d] = _;
  }
  d = -1;
  const h = [], g = [];
  for (; ++d < c; ) {
    const _ = s[d];
    let v = "", w = "";
    _ === 99 ? (v = ":", w = ":") : _ === 108 ? v = ":" : _ === 114 && (w = ":");
    let E = t.alignDelimiters === !1 ? 1 : Math.max(
      1,
      l[d] - v.length - w.length
    );
    const L = v + "-".repeat(E) + w;
    t.alignDelimiters !== !1 && (E = v.length + E + w.length, E > l[d] && (l[d] = E), g[d] = E), h[d] = L;
  }
  o.splice(1, 0, h), a.splice(1, 0, g), u = -1;
  const m = [];
  for (; ++u < o.length; ) {
    const _ = o[u], v = a[u];
    d = -1;
    const w = [];
    for (; ++d < c; ) {
      const E = _[d] || "";
      let L = "", T = "";
      if (t.alignDelimiters !== !1) {
        const D = l[d] - (v[d] || 0), N = s[d];
        N === 114 ? L = " ".repeat(D) : N === 99 ? D % 2 ? (L = " ".repeat(D / 2 + 0.5), T = " ".repeat(D / 2 - 0.5)) : (L = " ".repeat(D / 2), T = L) : T = " ".repeat(D);
      }
      t.delimiterStart !== !1 && !d && w.push("|"), t.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
      // empty: there will be a closing space.
      !(t.alignDelimiters === !1 && E === "") && (t.delimiterStart !== !1 || d) && w.push(" "), t.alignDelimiters !== !1 && w.push(L), w.push(E), t.alignDelimiters !== !1 && w.push(T), t.padding !== !1 && w.push(" "), (t.delimiterEnd !== !1 || d !== c - 1) && w.push("|");
    }
    m.push(
      t.delimiterEnd === !1 ? w.join("").replace(/ +$/, "") : w.join("")
    );
  }
  return m.join(`
`);
}
function jVt(i) {
  return i == null ? "" : String(i);
}
function l2e(i) {
  const e = typeof i == "string" ? i.codePointAt(0) : 0;
  return e === 67 || e === 99 ? 99 : e === 76 || e === 108 ? 108 : e === 82 || e === 114 ? 114 : 0;
}
function GVt(i, e, t, n) {
  const r = t.enter("blockquote"), s = t.createTracker(n);
  s.move("> "), s.shift(2);
  const o = t.indentLines(
    t.containerFlow(i, s.current()),
    qVt
  );
  return r(), o;
}
function qVt(i, e, t) {
  return ">" + (t ? "" : " ") + i;
}
function KVt(i, e) {
  return c2e(i, e.inConstruct, !0) && !c2e(i, e.notInConstruct, !1);
}
function c2e(i, e, t) {
  if (typeof e == "string" && (e = [e]), !e || e.length === 0)
    return t;
  let n = -1;
  for (; ++n < e.length; )
    if (i.includes(e[n]))
      return !0;
  return !1;
}
function u2e(i, e, t, n) {
  let r = -1;
  for (; ++r < t.unsafe.length; )
    if (t.unsafe[r].character === `
` && KVt(t.stack, t.unsafe[r]))
      return /[ \t]/.test(n.before) ? "" : " ";
  return `\\
`;
}
function YVt(i, e) {
  const t = String(i);
  let n = t.indexOf(e), r = n, s = 0, o = 0;
  if (typeof e != "string")
    throw new TypeError("Expected substring");
  for (; n !== -1; )
    n === r ? ++s > o && (o = s) : s = 1, r = n + e.length, n = t.indexOf(e, r);
  return o;
}
function XVt(i, e) {
  return !!(e.options.fences === !1 && i.value && // If there’s no info…
  !i.lang && // And there’s a non-whitespace character…
  /[^ \r\n]/.test(i.value) && // And the value doesn’t start or end in a blank…
  !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(i.value));
}
function ZVt(i) {
  const e = i.options.fence || "`";
  if (e !== "`" && e !== "~")
    throw new Error(
      "Cannot serialize code with `" + e + "` for `options.fence`, expected `` ` `` or `~`"
    );
  return e;
}
function QVt(i, e, t, n) {
  const r = ZVt(t), s = i.value || "", o = r === "`" ? "GraveAccent" : "Tilde";
  if (XVt(i, t)) {
    const d = t.enter("codeIndented"), h = t.indentLines(s, JVt);
    return d(), h;
  }
  const a = t.createTracker(n), l = r.repeat(Math.max(YVt(s, r) + 1, 3)), c = t.enter("codeFenced");
  let u = a.move(l);
  if (i.lang) {
    const d = t.enter(`codeFencedLang${o}`);
    u += a.move(
      t.safe(i.lang, {
        before: u,
        after: " ",
        encode: ["`"],
        ...a.current()
      })
    ), d();
  }
  if (i.lang && i.meta) {
    const d = t.enter(`codeFencedMeta${o}`);
    u += a.move(" "), u += a.move(
      t.safe(i.meta, {
        before: u,
        after: `
`,
        encode: ["`"],
        ...a.current()
      })
    ), d();
  }
  return u += a.move(`
`), s && (u += a.move(s + `
`)), u += a.move(l), c(), u;
}
function JVt(i, e, t) {
  return (t ? "" : "    ") + i;
}
function H0e(i) {
  const e = i.options.quote || '"';
  if (e !== '"' && e !== "'")
    throw new Error(
      "Cannot serialize title with `" + e + "` for `options.quote`, expected `\"`, or `'`"
    );
  return e;
}
function eUt(i, e, t, n) {
  const r = H0e(t), s = r === '"' ? "Quote" : "Apostrophe", o = t.enter("definition");
  let a = t.enter("label");
  const l = t.createTracker(n);
  let c = l.move("[");
  return c += l.move(
    t.safe(t.associationId(i), {
      before: c,
      after: "]",
      ...l.current()
    })
  ), c += l.move("]: "), a(), // If there’s no url, or…
  !i.url || // If there are control characters or whitespace.
  /[\0- \u007F]/.test(i.url) ? (a = t.enter("destinationLiteral"), c += l.move("<"), c += l.move(
    t.safe(i.url, { before: c, after: ">", ...l.current() })
  ), c += l.move(">")) : (a = t.enter("destinationRaw"), c += l.move(
    t.safe(i.url, {
      before: c,
      after: i.title ? " " : `
`,
      ...l.current()
    })
  )), a(), i.title && (a = t.enter(`title${s}`), c += l.move(" " + r), c += l.move(
    t.safe(i.title, {
      before: c,
      after: r,
      ...l.current()
    })
  ), c += l.move(r), a()), o(), c;
}
function tUt(i) {
  const e = i.options.emphasis || "*";
  if (e !== "*" && e !== "_")
    throw new Error(
      "Cannot serialize emphasis with `" + e + "` for `options.emphasis`, expected `*`, or `_`"
    );
  return e;
}
function K5(i) {
  return "&#x" + i.toString(16).toUpperCase() + ";";
}
function $$(i, e, t) {
  const n = IA(i), r = IA(e);
  return n === void 0 ? r === void 0 ? (
    // Letter inside:
    // we have to encode *both* letters for `_` as it is looser.
    // it already forms for `*` (and GFMs `~`).
    t === "_" ? { inside: !0, outside: !0 } : { inside: !1, outside: !1 }
  ) : r === 1 ? (
    // Whitespace inside: encode both (letter, whitespace).
    { inside: !0, outside: !0 }
  ) : (
    // Punctuation inside: encode outer (letter)
    { inside: !1, outside: !0 }
  ) : n === 1 ? r === void 0 ? (
    // Letter inside: already forms.
    { inside: !1, outside: !1 }
  ) : r === 1 ? (
    // Whitespace inside: encode both (whitespace).
    { inside: !0, outside: !0 }
  ) : (
    // Punctuation inside: already forms.
    { inside: !1, outside: !1 }
  ) : r === void 0 ? (
    // Letter inside: already forms.
    { inside: !1, outside: !1 }
  ) : r === 1 ? (
    // Whitespace inside: encode inner (whitespace).
    { inside: !0, outside: !1 }
  ) : (
    // Punctuation inside: already forms.
    { inside: !1, outside: !1 }
  );
}
rWe.peek = nUt;
function rWe(i, e, t, n) {
  const r = tUt(t), s = t.enter("emphasis"), o = t.createTracker(n), a = o.move(r);
  let l = o.move(
    t.containerPhrasing(i, {
      after: r,
      before: a,
      ...o.current()
    })
  );
  const c = l.charCodeAt(0), u = $$(
    n.before.charCodeAt(n.before.length - 1),
    c,
    r
  );
  u.inside && (l = K5(c) + l.slice(1));
  const d = l.charCodeAt(l.length - 1), h = $$(n.after.charCodeAt(0), d, r);
  h.inside && (l = l.slice(0, -1) + K5(d));
  const g = o.move(r);
  return s(), t.attentionEncodeSurroundingInfo = {
    after: h.outside,
    before: u.outside
  }, a + l + g;
}
function nUt(i, e, t) {
  return t.options.emphasis || "*";
}
function iUt(i, e) {
  let t = !1;
  return qd(i, function(n) {
    if ("value" in n && /\r?\n|\r/.test(n.value) || n.type === "break")
      return t = !0, P$;
  }), !!((!i.depth || i.depth < 3) && P0e(i) && (e.options.setext || t));
}
function rUt(i, e, t, n) {
  const r = Math.max(Math.min(6, i.depth || 1), 1), s = t.createTracker(n);
  if (iUt(i, t)) {
    const u = t.enter("headingSetext"), d = t.enter("phrasing"), h = t.containerPhrasing(i, {
      ...s.current(),
      before: `
`,
      after: `
`
    });
    return d(), u(), h + `
` + (r === 1 ? "=" : "-").repeat(
      // The whole size…
      h.length - // Minus the position of the character after the last EOL (or
      // 0 if there is none)…
      (Math.max(h.lastIndexOf("\r"), h.lastIndexOf(`
`)) + 1)
    );
  }
  const o = "#".repeat(r), a = t.enter("headingAtx"), l = t.enter("phrasing");
  s.move(o + " ");
  let c = t.containerPhrasing(i, {
    before: "# ",
    after: `
`,
    ...s.current()
  });
  return /^[\t ]/.test(c) && (c = K5(c.charCodeAt(0)) + c.slice(1)), c = c ? o + " " + c : o, t.options.closeAtx && (c += " " + o), l(), a(), c;
}
sWe.peek = sUt;
function sWe(i) {
  return i.value || "";
}
function sUt() {
  return "<";
}
oWe.peek = oUt;
function oWe(i, e, t, n) {
  const r = H0e(t), s = r === '"' ? "Quote" : "Apostrophe", o = t.enter("image");
  let a = t.enter("label");
  const l = t.createTracker(n);
  let c = l.move("![");
  return c += l.move(
    t.safe(i.alt, { before: c, after: "]", ...l.current() })
  ), c += l.move("]("), a(), // If there’s no url but there is a title…
  !i.url && i.title || // If there are control characters or whitespace.
  /[\0- \u007F]/.test(i.url) ? (a = t.enter("destinationLiteral"), c += l.move("<"), c += l.move(
    t.safe(i.url, { before: c, after: ">", ...l.current() })
  ), c += l.move(">")) : (a = t.enter("destinationRaw"), c += l.move(
    t.safe(i.url, {
      before: c,
      after: i.title ? " " : ")",
      ...l.current()
    })
  )), a(), i.title && (a = t.enter(`title${s}`), c += l.move(" " + r), c += l.move(
    t.safe(i.title, {
      before: c,
      after: r,
      ...l.current()
    })
  ), c += l.move(r), a()), c += l.move(")"), o(), c;
}
function oUt() {
  return "!";
}
aWe.peek = aUt;
function aWe(i, e, t, n) {
  const r = i.referenceType, s = t.enter("imageReference");
  let o = t.enter("label");
  const a = t.createTracker(n);
  let l = a.move("![");
  const c = t.safe(i.alt, {
    before: l,
    after: "]",
    ...a.current()
  });
  l += a.move(c + "]["), o();
  const u = t.stack;
  t.stack = [], o = t.enter("reference");
  const d = t.safe(t.associationId(i), {
    before: l,
    after: "]",
    ...a.current()
  });
  return o(), t.stack = u, s(), r === "full" || !c || c !== d ? l += a.move(d + "]") : r === "shortcut" ? l = l.slice(0, -1) : l += a.move("]"), l;
}
function aUt() {
  return "!";
}
lWe.peek = lUt;
function lWe(i, e, t) {
  let n = i.value || "", r = "`", s = -1;
  for (; new RegExp("(^|[^`])" + r + "([^`]|$)").test(n); )
    r += "`";
  for (/[^ \r\n]/.test(n) && (/^[ \r\n]/.test(n) && /[ \r\n]$/.test(n) || /^`|`$/.test(n)) && (n = " " + n + " "); ++s < t.unsafe.length; ) {
    const o = t.unsafe[s], a = t.compilePattern(o);
    let l;
    if (o.atBreak)
      for (; l = a.exec(n); ) {
        let c = l.index;
        n.charCodeAt(c) === 10 && n.charCodeAt(c - 1) === 13 && c--, n = n.slice(0, c) + " " + n.slice(l.index + 1);
      }
  }
  return r + n + r;
}
function lUt() {
  return "`";
}
function cWe(i, e) {
  const t = P0e(i);
  return !!(!e.options.resourceLink && // If there’s a url…
  i.url && // And there’s a no title…
  !i.title && // And the content of `node` is a single text node…
  i.children && i.children.length === 1 && i.children[0].type === "text" && // And if the url is the same as the content…
  (t === i.url || "mailto:" + t === i.url) && // And that starts w/ a protocol…
  /^[a-z][a-z+.-]+:/i.test(i.url) && // And that doesn’t contain ASCII control codes (character escapes and
  // references don’t work), space, or angle brackets…
  !/[\0- <>\u007F]/.test(i.url));
}
uWe.peek = cUt;
function uWe(i, e, t, n) {
  const r = H0e(t), s = r === '"' ? "Quote" : "Apostrophe", o = t.createTracker(n);
  let a, l;
  if (cWe(i, t)) {
    const u = t.stack;
    t.stack = [], a = t.enter("autolink");
    let d = o.move("<");
    return d += o.move(
      t.containerPhrasing(i, {
        before: d,
        after: ">",
        ...o.current()
      })
    ), d += o.move(">"), a(), t.stack = u, d;
  }
  a = t.enter("link"), l = t.enter("label");
  let c = o.move("[");
  return c += o.move(
    t.containerPhrasing(i, {
      before: c,
      after: "](",
      ...o.current()
    })
  ), c += o.move("]("), l(), // If there’s no url but there is a title…
  !i.url && i.title || // If there are control characters or whitespace.
  /[\0- \u007F]/.test(i.url) ? (l = t.enter("destinationLiteral"), c += o.move("<"), c += o.move(
    t.safe(i.url, { before: c, after: ">", ...o.current() })
  ), c += o.move(">")) : (l = t.enter("destinationRaw"), c += o.move(
    t.safe(i.url, {
      before: c,
      after: i.title ? " " : ")",
      ...o.current()
    })
  )), l(), i.title && (l = t.enter(`title${s}`), c += o.move(" " + r), c += o.move(
    t.safe(i.title, {
      before: c,
      after: r,
      ...o.current()
    })
  ), c += o.move(r), l()), c += o.move(")"), a(), c;
}
function cUt(i, e, t) {
  return cWe(i, t) ? "<" : "[";
}
dWe.peek = uUt;
function dWe(i, e, t, n) {
  const r = i.referenceType, s = t.enter("linkReference");
  let o = t.enter("label");
  const a = t.createTracker(n);
  let l = a.move("[");
  const c = t.containerPhrasing(i, {
    before: l,
    after: "]",
    ...a.current()
  });
  l += a.move(c + "]["), o();
  const u = t.stack;
  t.stack = [], o = t.enter("reference");
  const d = t.safe(t.associationId(i), {
    before: l,
    after: "]",
    ...a.current()
  });
  return o(), t.stack = u, s(), r === "full" || !c || c !== d ? l += a.move(d + "]") : r === "shortcut" ? l = l.slice(0, -1) : l += a.move("]"), l;
}
function uUt() {
  return "[";
}
function W0e(i) {
  const e = i.options.bullet || "*";
  if (e !== "*" && e !== "+" && e !== "-")
    throw new Error(
      "Cannot serialize items with `" + e + "` for `options.bullet`, expected `*`, `+`, or `-`"
    );
  return e;
}
function dUt(i) {
  const e = W0e(i), t = i.options.bulletOther;
  if (!t)
    return e === "*" ? "-" : "*";
  if (t !== "*" && t !== "+" && t !== "-")
    throw new Error(
      "Cannot serialize items with `" + t + "` for `options.bulletOther`, expected `*`, `+`, or `-`"
    );
  if (t === e)
    throw new Error(
      "Expected `bullet` (`" + e + "`) and `bulletOther` (`" + t + "`) to be different"
    );
  return t;
}
function hUt(i) {
  const e = i.options.bulletOrdered || ".";
  if (e !== "." && e !== ")")
    throw new Error(
      "Cannot serialize items with `" + e + "` for `options.bulletOrdered`, expected `.` or `)`"
    );
  return e;
}
function hWe(i) {
  const e = i.options.rule || "*";
  if (e !== "*" && e !== "-" && e !== "_")
    throw new Error(
      "Cannot serialize rules with `" + e + "` for `options.rule`, expected `*`, `-`, or `_`"
    );
  return e;
}
function fUt(i, e, t, n) {
  const r = t.enter("list"), s = t.bulletCurrent;
  let o = i.ordered ? hUt(t) : W0e(t);
  const a = i.ordered ? o === "." ? ")" : "." : dUt(t);
  let l = e && t.bulletLastUsed ? o === t.bulletLastUsed : !1;
  if (!i.ordered) {
    const u = i.children ? i.children[0] : void 0;
    if (
      // Bullet could be used as a thematic break marker:
      (o === "*" || o === "-") && // Empty first list item:
      u && (!u.children || !u.children[0]) && // Directly in two other list items:
      t.stack[t.stack.length - 1] === "list" && t.stack[t.stack.length - 2] === "listItem" && t.stack[t.stack.length - 3] === "list" && t.stack[t.stack.length - 4] === "listItem" && // That are each the first child.
      t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (l = !0), hWe(t) === o && u
    ) {
      let d = -1;
      for (; ++d < i.children.length; ) {
        const h = i.children[d];
        if (h && h.type === "listItem" && h.children && h.children[0] && h.children[0].type === "thematicBreak") {
          l = !0;
          break;
        }
      }
    }
  }
  l && (o = a), t.bulletCurrent = o;
  const c = t.containerFlow(i, n);
  return t.bulletLastUsed = o, t.bulletCurrent = s, r(), c;
}
function gUt(i) {
  const e = i.options.listItemIndent || "one";
  if (e !== "tab" && e !== "one" && e !== "mixed")
    throw new Error(
      "Cannot serialize items with `" + e + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`"
    );
  return e;
}
function pUt(i, e, t, n) {
  const r = gUt(t);
  let s = t.bulletCurrent || W0e(t);
  e && e.type === "list" && e.ordered && (s = (typeof e.start == "number" && e.start > -1 ? e.start : 1) + (t.options.incrementListMarker === !1 ? 0 : e.children.indexOf(i)) + s);
  let o = s.length + 1;
  (r === "tab" || r === "mixed" && (e && e.type === "list" && e.spread || i.spread)) && (o = Math.ceil(o / 4) * 4);
  const a = t.createTracker(n);
  a.move(s + " ".repeat(o - s.length)), a.shift(o);
  const l = t.enter("listItem"), c = t.indentLines(
    t.containerFlow(i, a.current()),
    u
  );
  return l(), c;
  function u(d, h, g) {
    return h ? (g ? "" : " ".repeat(o)) + d : (g ? s : s + " ".repeat(o - s.length)) + d;
  }
}
function mUt(i, e, t, n) {
  const r = t.enter("paragraph"), s = t.enter("phrasing"), o = t.containerPhrasing(i, n);
  return s(), r(), o;
}
const _Ut = (
  /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
  e6([
    "break",
    "delete",
    "emphasis",
    // To do: next major: removed since footnotes were added to GFM.
    "footnote",
    "footnoteReference",
    "image",
    "imageReference",
    "inlineCode",
    // Enabled by `mdast-util-math`:
    "inlineMath",
    "link",
    "linkReference",
    // Enabled by `mdast-util-mdx`:
    "mdxJsxTextElement",
    // Enabled by `mdast-util-mdx`:
    "mdxTextExpression",
    "strong",
    "text",
    // Enabled by `mdast-util-directive`:
    "textDirective"
  ])
);
function bUt(i, e, t, n) {
  return (i.children.some(function(o) {
    return _Ut(o);
  }) ? t.containerPhrasing : t.containerFlow).call(t, i, n);
}
function vUt(i) {
  const e = i.options.strong || "*";
  if (e !== "*" && e !== "_")
    throw new Error(
      "Cannot serialize strong with `" + e + "` for `options.strong`, expected `*`, or `_`"
    );
  return e;
}
fWe.peek = yUt;
function fWe(i, e, t, n) {
  const r = vUt(t), s = t.enter("strong"), o = t.createTracker(n), a = o.move(r + r);
  let l = o.move(
    t.containerPhrasing(i, {
      after: r,
      before: a,
      ...o.current()
    })
  );
  const c = l.charCodeAt(0), u = $$(
    n.before.charCodeAt(n.before.length - 1),
    c,
    r
  );
  u.inside && (l = K5(c) + l.slice(1));
  const d = l.charCodeAt(l.length - 1), h = $$(n.after.charCodeAt(0), d, r);
  h.inside && (l = l.slice(0, -1) + K5(d));
  const g = o.move(r + r);
  return s(), t.attentionEncodeSurroundingInfo = {
    after: h.outside,
    before: u.outside
  }, a + l + g;
}
function yUt(i, e, t) {
  return t.options.strong || "*";
}
function CUt(i, e, t, n) {
  return t.safe(i.value, n);
}
function wUt(i) {
  const e = i.options.ruleRepetition || 3;
  if (e < 3)
    throw new Error(
      "Cannot serialize rules with repetition `" + e + "` for `options.ruleRepetition`, expected `3` or more"
    );
  return e;
}
function SUt(i, e, t) {
  const n = (hWe(t) + (t.options.ruleSpaces ? " " : "")).repeat(wUt(t));
  return t.options.ruleSpaces ? n.slice(0, -1) : n;
}
const gWe = {
  blockquote: GVt,
  break: u2e,
  code: QVt,
  definition: eUt,
  emphasis: rWe,
  hardBreak: u2e,
  heading: rUt,
  html: sWe,
  image: oWe,
  imageReference: aWe,
  inlineCode: lWe,
  link: uWe,
  linkReference: dWe,
  list: fUt,
  listItem: pUt,
  paragraph: mUt,
  root: bUt,
  strong: fWe,
  text: CUt,
  thematicBreak: SUt
};
function EUt() {
  return {
    enter: {
      table: xUt,
      tableData: d2e,
      tableHeader: d2e,
      tableRow: TUt
    },
    exit: {
      codeText: kUt,
      table: LUt,
      tableData: Cne,
      tableHeader: Cne,
      tableRow: Cne
    }
  };
}
function xUt(i) {
  const e = i._align;
  this.enter(
    {
      type: "table",
      align: e.map(function(t) {
        return t === "none" ? null : t;
      }),
      children: []
    },
    i
  ), this.data.inTable = !0;
}
function LUt(i) {
  this.exit(i), this.data.inTable = void 0;
}
function TUt(i) {
  this.enter({ type: "tableRow", children: [] }, i);
}
function Cne(i) {
  this.exit(i);
}
function d2e(i) {
  this.enter({ type: "tableCell", children: [] }, i);
}
function kUt(i) {
  let e = this.resume();
  this.data.inTable && (e = e.replace(/\\([\\|])/g, DUt));
  const t = this.stack[this.stack.length - 1];
  t.type, t.value = e, this.exit(i);
}
function DUt(i, e) {
  return e === "|" ? e : i;
}
function IUt(i) {
  const e = i || {}, t = e.tableCellPadding, n = e.tablePipeAlign, r = e.stringLength, s = t ? " " : "|";
  return {
    unsafe: [
      { character: "\r", inConstruct: "tableCell" },
      { character: `
`, inConstruct: "tableCell" },
      // A pipe, when followed by a tab or space (padding), or a dash or colon
      // (unpadded delimiter row), could result in a table.
      { atBreak: !0, character: "|", after: "[	 :-]" },
      // A pipe in a cell must be encoded.
      { character: "|", inConstruct: "tableCell" },
      // A colon must be followed by a dash, in which case it could start a
      // delimiter row.
      { atBreak: !0, character: ":", after: "-" },
      // A delimiter row can also start with a dash, when followed by more
      // dashes, a colon, or a pipe.
      // This is a stricter version than the built in check for lists, thematic
      // breaks, and setex heading underlines though:
      // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>
      { atBreak: !0, character: "-", after: "[:|-]" }
    ],
    handlers: {
      inlineCode: h,
      table: o,
      tableCell: l,
      tableRow: a
    }
  };
  function o(g, m, _, v) {
    return c(u(g, _, v), g.align);
  }
  function a(g, m, _, v) {
    const w = d(g, _, v), E = c([w]);
    return E.slice(0, E.indexOf(`
`));
  }
  function l(g, m, _, v) {
    const w = _.enter("tableCell"), E = _.enter("phrasing"), L = _.containerPhrasing(g, {
      ...v,
      before: s,
      after: s
    });
    return E(), w(), L;
  }
  function c(g, m) {
    return $Vt(g, {
      align: m,
      // @ts-expect-error: `markdown-table` types should support `null`.
      alignDelimiters: n,
      // @ts-expect-error: `markdown-table` types should support `null`.
      padding: t,
      // @ts-expect-error: `markdown-table` types should support `null`.
      stringLength: r
    });
  }
  function u(g, m, _) {
    const v = g.children;
    let w = -1;
    const E = [], L = m.enter("table");
    for (; ++w < v.length; )
      E[w] = d(v[w], m, _);
    return L(), E;
  }
  function d(g, m, _) {
    const v = g.children;
    let w = -1;
    const E = [], L = m.enter("tableRow");
    for (; ++w < v.length; )
      E[w] = l(v[w], g, m, _);
    return L(), E;
  }
  function h(g, m, _) {
    let v = gWe.inlineCode(g, m, _);
    return _.stack.includes("tableCell") && (v = v.replace(/\|/g, "\\$&")), v;
  }
}
function NUt() {
  return {
    exit: {
      taskListCheckValueChecked: h2e,
      taskListCheckValueUnchecked: h2e,
      paragraph: AUt
    }
  };
}
function RUt() {
  return {
    unsafe: [{ atBreak: !0, character: "-", after: "[:|-]" }],
    handlers: { listItem: OUt }
  };
}
function h2e(i) {
  const e = this.stack[this.stack.length - 2];
  e.type, e.checked = i.type === "taskListCheckValueChecked";
}
function AUt(i) {
  const e = this.stack[this.stack.length - 2];
  if (e && e.type === "listItem" && typeof e.checked == "boolean") {
    const t = this.stack[this.stack.length - 1];
    t.type;
    const n = t.children[0];
    if (n && n.type === "text") {
      const r = e.children;
      let s = -1, o;
      for (; ++s < r.length; ) {
        const a = r[s];
        if (a.type === "paragraph") {
          o = a;
          break;
        }
      }
      o === t && (n.value = n.value.slice(1), n.value.length === 0 ? t.children.shift() : t.position && n.position && typeof n.position.start.offset == "number" && (n.position.start.column++, n.position.start.offset++, t.position.start = Object.assign({}, n.position.start)));
    }
  }
  this.exit(i);
}
function OUt(i, e, t, n) {
  const r = i.children[0], s = typeof i.checked == "boolean" && r && r.type === "paragraph", o = "[" + (i.checked ? "x" : " ") + "] ", a = t.createTracker(n);
  s && a.move(o);
  let l = gWe.listItem(i, e, t, {
    ...n,
    ...a.current()
  });
  return s && (l = l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, c)), l;
  function c(u) {
    return u + o;
  }
}
function MUt() {
  return [
    fVt(),
    OVt(),
    BVt(),
    EUt(),
    NUt()
  ];
}
function PUt(i) {
  return {
    extensions: [
      gVt(),
      MVt(i),
      HVt(),
      IUt(i),
      RUt()
    ]
  };
}
const FUt = {
  tokenize: zUt,
  partial: !0
}, pWe = {
  tokenize: $Ut,
  partial: !0
}, mWe = {
  tokenize: jUt,
  partial: !0
}, _We = {
  tokenize: GUt,
  partial: !0
}, BUt = {
  tokenize: qUt,
  partial: !0
}, bWe = {
  name: "wwwAutolink",
  tokenize: VUt,
  previous: yWe
}, vWe = {
  name: "protocolAutolink",
  tokenize: UUt,
  previous: CWe
}, b0 = {
  name: "emailAutolink",
  tokenize: WUt,
  previous: wWe
}, Pb = {};
function HUt() {
  return {
    text: Pb
  };
}
let _E = 48;
for (; _E < 123; )
  Pb[_E] = b0, _E++, _E === 58 ? _E = 65 : _E === 91 && (_E = 97);
Pb[43] = b0;
Pb[45] = b0;
Pb[46] = b0;
Pb[95] = b0;
Pb[72] = [b0, vWe];
Pb[104] = [b0, vWe];
Pb[87] = [b0, bWe];
Pb[119] = [b0, bWe];
function WUt(i, e, t) {
  const n = this;
  let r, s;
  return o;
  function o(d) {
    return !wde(d) || !wWe.call(n, n.previous) || V0e(n.events) ? t(d) : (i.enter("literalAutolink"), i.enter("literalAutolinkEmail"), a(d));
  }
  function a(d) {
    return wde(d) ? (i.consume(d), a) : d === 64 ? (i.consume(d), l) : t(d);
  }
  function l(d) {
    return d === 46 ? i.check(BUt, u, c)(d) : d === 45 || d === 95 || Gu(d) ? (s = !0, i.consume(d), l) : u(d);
  }
  function c(d) {
    return i.consume(d), r = !0, l;
  }
  function u(d) {
    return s && r && Rd(n.previous) ? (i.exit("literalAutolinkEmail"), i.exit("literalAutolink"), e(d)) : t(d);
  }
}
function VUt(i, e, t) {
  const n = this;
  return r;
  function r(o) {
    return o !== 87 && o !== 119 || !yWe.call(n, n.previous) || V0e(n.events) ? t(o) : (i.enter("literalAutolink"), i.enter("literalAutolinkWww"), i.check(FUt, i.attempt(pWe, i.attempt(mWe, s), t), t)(o));
  }
  function s(o) {
    return i.exit("literalAutolinkWww"), i.exit("literalAutolink"), e(o);
  }
}
function UUt(i, e, t) {
  const n = this;
  let r = "", s = !1;
  return o;
  function o(d) {
    return (d === 72 || d === 104) && CWe.call(n, n.previous) && !V0e(n.events) ? (i.enter("literalAutolink"), i.enter("literalAutolinkHttp"), r += String.fromCodePoint(d), i.consume(d), a) : t(d);
  }
  function a(d) {
    if (Rd(d) && r.length < 5)
      return r += String.fromCodePoint(d), i.consume(d), a;
    if (d === 58) {
      const h = r.toLowerCase();
      if (h === "http" || h === "https")
        return i.consume(d), l;
    }
    return t(d);
  }
  function l(d) {
    return d === 47 ? (i.consume(d), s ? c : (s = !0, l)) : t(d);
  }
  function c(d) {
    return d === null || z$(d) || Io(d) || OT(d) || DY(d) ? t(d) : i.attempt(pWe, i.attempt(mWe, u), t)(d);
  }
  function u(d) {
    return i.exit("literalAutolinkHttp"), i.exit("literalAutolink"), e(d);
  }
}
function zUt(i, e, t) {
  let n = 0;
  return r;
  function r(o) {
    return (o === 87 || o === 119) && n < 3 ? (n++, i.consume(o), r) : o === 46 && n === 3 ? (i.consume(o), s) : t(o);
  }
  function s(o) {
    return o === null ? t(o) : e(o);
  }
}
function $Ut(i, e, t) {
  let n, r, s;
  return o;
  function o(c) {
    return c === 46 || c === 95 ? i.check(_We, l, a)(c) : c === null || Io(c) || OT(c) || c !== 45 && DY(c) ? l(c) : (s = !0, i.consume(c), o);
  }
  function a(c) {
    return c === 95 ? n = !0 : (r = n, n = void 0), i.consume(c), o;
  }
  function l(c) {
    return r || n || !s ? t(c) : e(c);
  }
}
function jUt(i, e) {
  let t = 0, n = 0;
  return r;
  function r(o) {
    return o === 40 ? (t++, i.consume(o), r) : o === 41 && n < t ? s(o) : o === 33 || o === 34 || o === 38 || o === 39 || o === 41 || o === 42 || o === 44 || o === 46 || o === 58 || o === 59 || o === 60 || o === 63 || o === 93 || o === 95 || o === 126 ? i.check(_We, e, s)(o) : o === null || Io(o) || OT(o) ? e(o) : (i.consume(o), r);
  }
  function s(o) {
    return o === 41 && n++, i.consume(o), r;
  }
}
function GUt(i, e, t) {
  return n;
  function n(a) {
    return a === 33 || a === 34 || a === 39 || a === 41 || a === 42 || a === 44 || a === 46 || a === 58 || a === 59 || a === 63 || a === 95 || a === 126 ? (i.consume(a), n) : a === 38 ? (i.consume(a), s) : a === 93 ? (i.consume(a), r) : (
      // `<` is an end.
      a === 60 || // So is whitespace.
      a === null || Io(a) || OT(a) ? e(a) : t(a)
    );
  }
  function r(a) {
    return a === null || a === 40 || a === 91 || Io(a) || OT(a) ? e(a) : n(a);
  }
  function s(a) {
    return Rd(a) ? o(a) : t(a);
  }
  function o(a) {
    return a === 59 ? (i.consume(a), n) : Rd(a) ? (i.consume(a), o) : t(a);
  }
}
function qUt(i, e, t) {
  return n;
  function n(s) {
    return i.consume(s), r;
  }
  function r(s) {
    return Gu(s) ? t(s) : e(s);
  }
}
function yWe(i) {
  return i === null || i === 40 || i === 42 || i === 95 || i === 91 || i === 93 || i === 126 || Io(i);
}
function CWe(i) {
  return !Rd(i);
}
function wWe(i) {
  return !(i === 47 || wde(i));
}
function wde(i) {
  return i === 43 || i === 45 || i === 46 || i === 95 || Gu(i);
}
function V0e(i) {
  let e = i.length, t = !1;
  for (; e--; ) {
    const n = i[e][1];
    if ((n.type === "labelLink" || n.type === "labelImage") && !n._balanced) {
      t = !0;
      break;
    }
    if (n._gfmAutolinkLiteralWalkedInto) {
      t = !1;
      break;
    }
  }
  return i.length > 0 && !t && (i[i.length - 1][1]._gfmAutolinkLiteralWalkedInto = !0), t;
}
const KUt = {
  tokenize: nzt,
  partial: !0
};
function YUt() {
  return {
    document: {
      91: {
        name: "gfmFootnoteDefinition",
        tokenize: JUt,
        continuation: {
          tokenize: ezt
        },
        exit: tzt
      }
    },
    text: {
      91: {
        name: "gfmFootnoteCall",
        tokenize: QUt
      },
      93: {
        name: "gfmPotentialFootnoteCall",
        add: "after",
        tokenize: XUt,
        resolveTo: ZUt
      }
    }
  };
}
function XUt(i, e, t) {
  const n = this;
  let r = n.events.length;
  const s = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
  let o;
  for (; r--; ) {
    const l = n.events[r][1];
    if (l.type === "labelImage") {
      o = l;
      break;
    }
    if (l.type === "gfmFootnoteCall" || l.type === "labelLink" || l.type === "label" || l.type === "image" || l.type === "link")
      break;
  }
  return a;
  function a(l) {
    if (!o || !o._balanced)
      return t(l);
    const c = cm(n.sliceSerialize({
      start: o.end,
      end: n.now()
    }));
    return c.codePointAt(0) !== 94 || !s.includes(c.slice(1)) ? t(l) : (i.enter("gfmFootnoteCallLabelMarker"), i.consume(l), i.exit("gfmFootnoteCallLabelMarker"), e(l));
  }
}
function ZUt(i, e) {
  let t = i.length;
  for (; t--; )
    if (i[t][1].type === "labelImage" && i[t][0] === "enter") {
      i[t][1];
      break;
    }
  i[t + 1][1].type = "data", i[t + 3][1].type = "gfmFootnoteCallLabelMarker";
  const n = {
    type: "gfmFootnoteCall",
    start: Object.assign({}, i[t + 3][1].start),
    end: Object.assign({}, i[i.length - 1][1].end)
  }, r = {
    type: "gfmFootnoteCallMarker",
    start: Object.assign({}, i[t + 3][1].end),
    end: Object.assign({}, i[t + 3][1].end)
  };
  r.end.column++, r.end.offset++, r.end._bufferIndex++;
  const s = {
    type: "gfmFootnoteCallString",
    start: Object.assign({}, r.end),
    end: Object.assign({}, i[i.length - 1][1].start)
  }, o = {
    type: "chunkString",
    contentType: "string",
    start: Object.assign({}, s.start),
    end: Object.assign({}, s.end)
  }, a = [
    // Take the `labelImageMarker` (now `data`, the `!`)
    i[t + 1],
    i[t + 2],
    ["enter", n, e],
    // The `[`
    i[t + 3],
    i[t + 4],
    // The `^`.
    ["enter", r, e],
    ["exit", r, e],
    // Everything in between.
    ["enter", s, e],
    ["enter", o, e],
    ["exit", o, e],
    ["exit", s, e],
    // The ending (`]`, properly parsed and labelled).
    i[i.length - 2],
    i[i.length - 1],
    ["exit", n, e]
  ];
  return i.splice(t, i.length - t + 1, ...a), i;
}
function QUt(i, e, t) {
  const n = this, r = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
  let s = 0, o;
  return a;
  function a(d) {
    return i.enter("gfmFootnoteCall"), i.enter("gfmFootnoteCallLabelMarker"), i.consume(d), i.exit("gfmFootnoteCallLabelMarker"), l;
  }
  function l(d) {
    return d !== 94 ? t(d) : (i.enter("gfmFootnoteCallMarker"), i.consume(d), i.exit("gfmFootnoteCallMarker"), i.enter("gfmFootnoteCallString"), i.enter("chunkString").contentType = "string", c);
  }
  function c(d) {
    if (
      // Too long.
      s > 999 || // Closing brace with nothing.
      d === 93 && !o || // Space or tab is not supported by GFM for some reason.
      // `\n` and `[` not being supported makes sense.
      d === null || d === 91 || Io(d)
    )
      return t(d);
    if (d === 93) {
      i.exit("chunkString");
      const h = i.exit("gfmFootnoteCallString");
      return r.includes(cm(n.sliceSerialize(h))) ? (i.enter("gfmFootnoteCallLabelMarker"), i.consume(d), i.exit("gfmFootnoteCallLabelMarker"), i.exit("gfmFootnoteCall"), e) : t(d);
    }
    return Io(d) || (o = !0), s++, i.consume(d), d === 92 ? u : c;
  }
  function u(d) {
    return d === 91 || d === 92 || d === 93 ? (i.consume(d), s++, c) : c(d);
  }
}
function JUt(i, e, t) {
  const n = this, r = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
  let s, o = 0, a;
  return l;
  function l(m) {
    return i.enter("gfmFootnoteDefinition")._container = !0, i.enter("gfmFootnoteDefinitionLabel"), i.enter("gfmFootnoteDefinitionLabelMarker"), i.consume(m), i.exit("gfmFootnoteDefinitionLabelMarker"), c;
  }
  function c(m) {
    return m === 94 ? (i.enter("gfmFootnoteDefinitionMarker"), i.consume(m), i.exit("gfmFootnoteDefinitionMarker"), i.enter("gfmFootnoteDefinitionLabelString"), i.enter("chunkString").contentType = "string", u) : t(m);
  }
  function u(m) {
    if (
      // Too long.
      o > 999 || // Closing brace with nothing.
      m === 93 && !a || // Space or tab is not supported by GFM for some reason.
      // `\n` and `[` not being supported makes sense.
      m === null || m === 91 || Io(m)
    )
      return t(m);
    if (m === 93) {
      i.exit("chunkString");
      const _ = i.exit("gfmFootnoteDefinitionLabelString");
      return s = cm(n.sliceSerialize(_)), i.enter("gfmFootnoteDefinitionLabelMarker"), i.consume(m), i.exit("gfmFootnoteDefinitionLabelMarker"), i.exit("gfmFootnoteDefinitionLabel"), h;
    }
    return Io(m) || (a = !0), o++, i.consume(m), m === 92 ? d : u;
  }
  function d(m) {
    return m === 91 || m === 92 || m === 93 ? (i.consume(m), o++, u) : u(m);
  }
  function h(m) {
    return m === 58 ? (i.enter("definitionMarker"), i.consume(m), i.exit("definitionMarker"), r.includes(s) || r.push(s), us(i, g, "gfmFootnoteDefinitionWhitespace")) : t(m);
  }
  function g(m) {
    return e(m);
  }
}
function ezt(i, e, t) {
  return i.check(p6, e, i.attempt(KUt, e, t));
}
function tzt(i) {
  i.exit("gfmFootnoteDefinition");
}
function nzt(i, e, t) {
  const n = this;
  return us(i, r, "gfmFootnoteDefinitionIndent", 5);
  function r(s) {
    const o = n.events[n.events.length - 1];
    return o && o[1].type === "gfmFootnoteDefinitionIndent" && o[2].sliceSerialize(o[1], !0).length === 4 ? e(s) : t(s);
  }
}
function izt(i) {
  let t = (i || {}).singleTilde;
  const n = {
    name: "strikethrough",
    tokenize: s,
    resolveAll: r
  };
  return t == null && (t = !0), {
    text: {
      126: n
    },
    insideSpan: {
      null: [n]
    },
    attentionMarkers: {
      null: [126]
    }
  };
  function r(o, a) {
    let l = -1;
    for (; ++l < o.length; )
      if (o[l][0] === "enter" && o[l][1].type === "strikethroughSequenceTemporary" && o[l][1]._close) {
        let c = l;
        for (; c--; )
          if (o[c][0] === "exit" && o[c][1].type === "strikethroughSequenceTemporary" && o[c][1]._open && // If the sizes are the same:
          o[l][1].end.offset - o[l][1].start.offset === o[c][1].end.offset - o[c][1].start.offset) {
            o[l][1].type = "strikethroughSequence", o[c][1].type = "strikethroughSequence";
            const u = {
              type: "strikethrough",
              start: Object.assign({}, o[c][1].start),
              end: Object.assign({}, o[l][1].end)
            }, d = {
              type: "strikethroughText",
              start: Object.assign({}, o[c][1].end),
              end: Object.assign({}, o[l][1].start)
            }, h = [["enter", u, a], ["enter", o[c][1], a], ["exit", o[c][1], a], ["enter", d, a]], g = a.parser.constructs.insideSpan.null;
            g && Uf(h, h.length, 0, IY(g, o.slice(c + 1, l), a)), Uf(h, h.length, 0, [["exit", d, a], ["enter", o[l][1], a], ["exit", o[l][1], a], ["exit", u, a]]), Uf(o, c - 1, l - c + 3, h), l = c + h.length - 2;
            break;
          }
      }
    for (l = -1; ++l < o.length; )
      o[l][1].type === "strikethroughSequenceTemporary" && (o[l][1].type = "data");
    return o;
  }
  function s(o, a, l) {
    const c = this.previous, u = this.events;
    let d = 0;
    return h;
    function h(m) {
      return c === 126 && u[u.length - 1][1].type !== "characterEscape" ? l(m) : (o.enter("strikethroughSequenceTemporary"), g(m));
    }
    function g(m) {
      const _ = IA(c);
      if (m === 126)
        return d > 1 ? l(m) : (o.consume(m), d++, g);
      if (d < 2 && !t) return l(m);
      const v = o.exit("strikethroughSequenceTemporary"), w = IA(m);
      return v._open = !w || w === 2 && !!_, v._close = !_ || _ === 2 && !!w, a(m);
    }
  }
}
class rzt {
  /**
   * Create a new edit map.
   */
  constructor() {
    this.map = [];
  }
  /**
   * Create an edit: a remove and/or add at a certain place.
   *
   * @param {number} index
   * @param {number} remove
   * @param {Array<Event>} add
   * @returns {undefined}
   */
  add(e, t, n) {
    szt(this, e, t, n);
  }
  // To do: add this when moving to `micromark`.
  // /**
  //  * Create an edit: but insert `add` before existing additions.
  //  *
  //  * @param {number} index
  //  * @param {number} remove
  //  * @param {Array<Event>} add
  //  * @returns {undefined}
  //  */
  // addBefore(index, remove, add) {
  //   addImplementation(this, index, remove, add, true)
  // }
  /**
   * Done, change the events.
   *
   * @param {Array<Event>} events
   * @returns {undefined}
   */
  consume(e) {
    if (this.map.sort(function(s, o) {
      return s[0] - o[0];
    }), this.map.length === 0)
      return;
    let t = this.map.length;
    const n = [];
    for (; t > 0; )
      t -= 1, n.push(e.slice(this.map[t][0] + this.map[t][1]), this.map[t][2]), e.length = this.map[t][0];
    n.push(e.slice()), e.length = 0;
    let r = n.pop();
    for (; r; ) {
      for (const s of r)
        e.push(s);
      r = n.pop();
    }
    this.map.length = 0;
  }
}
function szt(i, e, t, n) {
  let r = 0;
  if (!(t === 0 && n.length === 0)) {
    for (; r < i.map.length; ) {
      if (i.map[r][0] === e) {
        i.map[r][1] += t, i.map[r][2].push(...n);
        return;
      }
      r += 1;
    }
    i.map.push([e, t, n]);
  }
}
function ozt(i, e) {
  let t = !1;
  const n = [];
  for (; e < i.length; ) {
    const r = i[e];
    if (t) {
      if (r[0] === "enter")
        r[1].type === "tableContent" && n.push(i[e + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
      else if (r[1].type === "tableContent") {
        if (i[e - 1][1].type === "tableDelimiterMarker") {
          const s = n.length - 1;
          n[s] = n[s] === "left" ? "center" : "right";
        }
      } else if (r[1].type === "tableDelimiterRow")
        break;
    } else r[0] === "enter" && r[1].type === "tableDelimiterRow" && (t = !0);
    e += 1;
  }
  return n;
}
function azt() {
  return {
    flow: {
      null: {
        name: "table",
        tokenize: lzt,
        resolveAll: czt
      }
    }
  };
}
function lzt(i, e, t) {
  const n = this;
  let r = 0, s = 0, o;
  return a;
  function a(H) {
    let j = n.events.length - 1;
    for (; j > -1; ) {
      const Y = n.events[j][1].type;
      if (Y === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
      Y === "linePrefix") j--;
      else break;
    }
    const K = j > -1 ? n.events[j][1].type : null, X = K === "tableHead" || K === "tableRow" ? N : l;
    return X === N && n.parser.lazy[n.now().line] ? t(H) : X(H);
  }
  function l(H) {
    return i.enter("tableHead"), i.enter("tableRow"), c(H);
  }
  function c(H) {
    return H === 124 || (o = !0, s += 1), u(H);
  }
  function u(H) {
    return H === null ? t(H) : wi(H) ? s > 1 ? (s = 0, n.interrupt = !0, i.exit("tableRow"), i.enter("lineEnding"), i.consume(H), i.exit("lineEnding"), g) : t(H) : Pr(H) ? us(i, u, "whitespace")(H) : (s += 1, o && (o = !1, r += 1), H === 124 ? (i.enter("tableCellDivider"), i.consume(H), i.exit("tableCellDivider"), o = !0, u) : (i.enter("data"), d(H)));
  }
  function d(H) {
    return H === null || H === 124 || Io(H) ? (i.exit("data"), u(H)) : (i.consume(H), H === 92 ? h : d);
  }
  function h(H) {
    return H === 92 || H === 124 ? (i.consume(H), d) : d(H);
  }
  function g(H) {
    return n.interrupt = !1, n.parser.lazy[n.now().line] ? t(H) : (i.enter("tableDelimiterRow"), o = !1, Pr(H) ? us(i, m, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(H) : m(H));
  }
  function m(H) {
    return H === 45 || H === 58 ? v(H) : H === 124 ? (o = !0, i.enter("tableCellDivider"), i.consume(H), i.exit("tableCellDivider"), _) : D(H);
  }
  function _(H) {
    return Pr(H) ? us(i, v, "whitespace")(H) : v(H);
  }
  function v(H) {
    return H === 58 ? (s += 1, o = !0, i.enter("tableDelimiterMarker"), i.consume(H), i.exit("tableDelimiterMarker"), w) : H === 45 ? (s += 1, w(H)) : H === null || wi(H) ? T(H) : D(H);
  }
  function w(H) {
    return H === 45 ? (i.enter("tableDelimiterFiller"), E(H)) : D(H);
  }
  function E(H) {
    return H === 45 ? (i.consume(H), E) : H === 58 ? (o = !0, i.exit("tableDelimiterFiller"), i.enter("tableDelimiterMarker"), i.consume(H), i.exit("tableDelimiterMarker"), L) : (i.exit("tableDelimiterFiller"), L(H));
  }
  function L(H) {
    return Pr(H) ? us(i, T, "whitespace")(H) : T(H);
  }
  function T(H) {
    return H === 124 ? m(H) : H === null || wi(H) ? !o || r !== s ? D(H) : (i.exit("tableDelimiterRow"), i.exit("tableHead"), e(H)) : D(H);
  }
  function D(H) {
    return t(H);
  }
  function N(H) {
    return i.enter("tableRow"), R(H);
  }
  function R(H) {
    return H === 124 ? (i.enter("tableCellDivider"), i.consume(H), i.exit("tableCellDivider"), R) : H === null || wi(H) ? (i.exit("tableRow"), e(H)) : Pr(H) ? us(i, R, "whitespace")(H) : (i.enter("data"), M(H));
  }
  function M(H) {
    return H === null || H === 124 || Io(H) ? (i.exit("data"), R(H)) : (i.consume(H), H === 92 ? B : M);
  }
  function B(H) {
    return H === 92 || H === 124 ? (i.consume(H), M) : M(H);
  }
}
function czt(i, e) {
  let t = -1, n = !0, r = 0, s = [0, 0, 0, 0], o = [0, 0, 0, 0], a = !1, l = 0, c, u, d;
  const h = new rzt();
  for (; ++t < i.length; ) {
    const g = i[t], m = g[1];
    g[0] === "enter" ? m.type === "tableHead" ? (a = !1, l !== 0 && (f2e(h, e, l, c, u), u = void 0, l = 0), c = {
      type: "table",
      start: Object.assign({}, m.start),
      // Note: correct end is set later.
      end: Object.assign({}, m.end)
    }, h.add(t, 0, [["enter", c, e]])) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (n = !0, d = void 0, s = [0, 0, 0, 0], o = [0, t + 1, 0, 0], a && (a = !1, u = {
      type: "tableBody",
      start: Object.assign({}, m.start),
      // Note: correct end is set later.
      end: Object.assign({}, m.end)
    }, h.add(t, 0, [["enter", u, e]])), r = m.type === "tableDelimiterRow" ? 2 : u ? 3 : 1) : r && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") ? (n = !1, o[2] === 0 && (s[1] !== 0 && (o[0] = o[1], d = nW(h, e, s, r, void 0, d), s = [0, 0, 0, 0]), o[2] = t)) : m.type === "tableCellDivider" && (n ? n = !1 : (s[1] !== 0 && (o[0] = o[1], d = nW(h, e, s, r, void 0, d)), s = o, o = [s[1], t, 0, 0])) : m.type === "tableHead" ? (a = !0, l = t) : m.type === "tableRow" || m.type === "tableDelimiterRow" ? (l = t, s[1] !== 0 ? (o[0] = o[1], d = nW(h, e, s, r, t, d)) : o[1] !== 0 && (d = nW(h, e, o, r, t, d)), r = 0) : r && (m.type === "data" || m.type === "tableDelimiterMarker" || m.type === "tableDelimiterFiller") && (o[3] = t);
  }
  for (l !== 0 && f2e(h, e, l, c, u), h.consume(e.events), t = -1; ++t < e.events.length; ) {
    const g = e.events[t];
    g[0] === "enter" && g[1].type === "table" && (g[1]._align = ozt(e.events, t));
  }
  return i;
}
function nW(i, e, t, n, r, s) {
  const o = n === 1 ? "tableHeader" : n === 2 ? "tableDelimiter" : "tableData", a = "tableContent";
  t[0] !== 0 && (s.end = Object.assign({}, XI(e.events, t[0])), i.add(t[0], 0, [["exit", s, e]]));
  const l = XI(e.events, t[1]);
  if (s = {
    type: o,
    start: Object.assign({}, l),
    // Note: correct end is set later.
    end: Object.assign({}, l)
  }, i.add(t[1], 0, [["enter", s, e]]), t[2] !== 0) {
    const c = XI(e.events, t[2]), u = XI(e.events, t[3]), d = {
      type: a,
      start: Object.assign({}, c),
      end: Object.assign({}, u)
    };
    if (i.add(t[2], 0, [["enter", d, e]]), n !== 2) {
      const h = e.events[t[2]], g = e.events[t[3]];
      if (h[1].end = Object.assign({}, g[1].end), h[1].type = "chunkText", h[1].contentType = "text", t[3] > t[2] + 1) {
        const m = t[2] + 1, _ = t[3] - t[2] - 1;
        i.add(m, _, []);
      }
    }
    i.add(t[3] + 1, 0, [["exit", d, e]]);
  }
  return r !== void 0 && (s.end = Object.assign({}, XI(e.events, r)), i.add(r, 0, [["exit", s, e]]), s = void 0), s;
}
function f2e(i, e, t, n, r) {
  const s = [], o = XI(e.events, t);
  r && (r.end = Object.assign({}, o), s.push(["exit", r, e])), n.end = Object.assign({}, o), s.push(["exit", n, e]), i.add(t + 1, 0, s);
}
function XI(i, e) {
  const t = i[e], n = t[0] === "enter" ? "start" : "end";
  return t[1][n];
}
const uzt = {
  name: "tasklistCheck",
  tokenize: hzt
};
function dzt() {
  return {
    text: {
      91: uzt
    }
  };
}
function hzt(i, e, t) {
  const n = this;
  return r;
  function r(l) {
    return (
      // Exit if there’s stuff before.
      n.previous !== null || // Exit if not in the first content that is the first child of a list
      // item.
      !n._gfmTasklistFirstContentOfListItem ? t(l) : (i.enter("taskListCheck"), i.enter("taskListCheckMarker"), i.consume(l), i.exit("taskListCheckMarker"), s)
    );
  }
  function s(l) {
    return Io(l) ? (i.enter("taskListCheckValueUnchecked"), i.consume(l), i.exit("taskListCheckValueUnchecked"), o) : l === 88 || l === 120 ? (i.enter("taskListCheckValueChecked"), i.consume(l), i.exit("taskListCheckValueChecked"), o) : t(l);
  }
  function o(l) {
    return l === 93 ? (i.enter("taskListCheckMarker"), i.consume(l), i.exit("taskListCheckMarker"), i.exit("taskListCheck"), a) : t(l);
  }
  function a(l) {
    return wi(l) ? e(l) : Pr(l) ? i.check({
      tokenize: fzt
    }, e, t)(l) : t(l);
  }
}
function fzt(i, e, t) {
  return us(i, n, "whitespace");
  function n(r) {
    return r === null ? t(r) : e(r);
  }
}
function gzt(i) {
  return BHe([
    HUt(),
    YUt(),
    izt(i),
    azt(),
    dzt()
  ]);
}
const pzt = {};
function mzt(i) {
  const e = (
    /** @type {Processor<Root>} */
    this
  ), t = i || pzt, n = e.data(), r = n.micromarkExtensions || (n.micromarkExtensions = []), s = n.fromMarkdownExtensions || (n.fromMarkdownExtensions = []), o = n.toMarkdownExtensions || (n.toMarkdownExtensions = []);
  r.push(gzt(t)), s.push(MUt()), o.push(PUt(t));
}
const _zt = /^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i, bzt = /^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i, vzt = ({ legacyTitle: i = !1, tagName: e = "div" } = {}) => (t) => {
  qd(t, "blockquote", (n, r, s) => {
    let o = "", a = "", l = !0, c = n.children.map((u) => {
      if (l && u.type === "paragraph") {
        const d = u.children[0], h = d.type === "text" ? d.value : "", g = i ? bzt : _zt, m = h.match(g);
        if (m && (l = !1, o = m[1].toLocaleLowerCase(), a = i && m[2] || o.toLocaleUpperCase(), h.includes(`
`) && (u.children[0] = {
          type: "text",
          value: h.replace(g, "").replace(/^\n+/, "")
        }), !h.includes(`
`))) {
          const _ = [];
          u.children.forEach((v, w) => {
            w != 0 && (w == 1 && v.type === "break" || _.push(v));
          }), u.children = [..._];
        }
      }
      return u;
    });
    o && (n.data = {
      hName: e,
      hProperties: {
        class: `markdown-alert markdown-alert-${o}`,
        dir: "auto"
      }
    }, c.unshift({
      type: "paragraph",
      children: [
        yzt(o),
        {
          type: "text",
          value: a.replace(/^\//, "")
        }
      ],
      data: {
        hProperties: {
          class: "markdown-alert-title",
          dir: "auto"
        }
      }
    })), n.children = [...c];
  });
};
function yzt(i) {
  let e = Czt[i] ?? "";
  return {
    type: "emphasis",
    data: {
      hName: "svg",
      hProperties: {
        class: "octicon",
        viewBox: "0 0 16 16",
        width: "16",
        height: "16",
        ariaHidden: "true"
      }
    },
    children: [
      {
        type: "emphasis",
        data: {
          hName: "path",
          hProperties: {
            d: e
          }
        },
        children: []
      }
    ]
  };
}
const Czt = {
  note: "M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",
  tip: "M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",
  important: "M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",
  warning: "M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",
  caution: "M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"
};
function wzt(i, e) {
  if (typeof document > "u") return;
  const t = document.createElement("textarea");
  t.value = i, t.setAttribute("readonly", ""), t.style = {
    position: "absolute",
    left: "-9999px"
  }, document.body.appendChild(t);
  const n = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : !1;
  t.select();
  let r = !1;
  try {
    r = !!document.execCommand("copy");
  } catch {
    r = !1;
  }
  document.body.removeChild(t), n && document.getSelection && (document.getSelection().removeAllRanges(), document.getSelection().addRange(n)), e && e(r);
}
function SWe(i) {
  if (!i) return null;
  var e = i;
  return e.dataset.code && e.classList.contains("copied") ? e : e.parentElement ? SWe(e.parentElement) : null;
}
function Szt(i) {
  var e = (t) => {
    var n = SWe(t.target);
    n && (n.classList.add("active"), wzt(n.dataset.code, function() {
      setTimeout(() => {
        n.classList.remove("active");
      }, 2e3);
    }));
  };
  Zn.useEffect(() => {
    var t, n;
    return (t = i.current) == null || t.removeEventListener("click", e, !1), (n = i.current) == null || n.addEventListener("click", e, !1), () => {
      var r;
      (r = i.current) == null || r.removeEventListener("click", e, !1);
    };
  }, [i]);
}
var Ezt = ["prefixCls", "className", "source", "style", "disableCopy", "skipHtml", "onScroll", "onMouseOver", "pluginsFilter", "rehypeRewrite", "wrapperElement", "warpperElement", "urlTransform"], xzt = (i) => i;
const Lzt = /* @__PURE__ */ nb.forwardRef((i, e) => {
  var {
    prefixCls: t = "wmde-markdown wmde-markdown-color",
    className: n,
    source: r,
    style: s,
    disableCopy: o = !1,
    skipHtml: a = !0,
    onScroll: l,
    onMouseOver: c,
    pluginsFilter: u,
    wrapperElement: d = {},
    warpperElement: h = {},
    urlTransform: g
  } = i, m = w9t(i, Ezt), _ = nb.useRef(null);
  Zn.useImperativeHandle(e, () => Ey({}, i, {
    mdp: _
  }), [_, i]);
  var v = (t || "") + " " + (n || "");
  Szt(_);
  var w = [...m.rehypePlugins || []], E = {
    allowElement: (D, N, R) => m.allowElement ? m.allowElement(D, N, R) : /^[A-Za-z0-9]+$/.test(D.tagName)
  };
  a || w.push(RHe);
  var L = [vzt, ...m.remarkPlugins || [], mzt], T = Ey({}, h, d);
  return /* @__PURE__ */ hr.jsx("div", Ey({
    ref: _,
    onScroll: l,
    onMouseOver: c
  }, T, {
    className: v,
    style: s,
    children: /* @__PURE__ */ hr.jsx(oVt, Ey({}, E, m, {
      skipHtml: !a,
      urlTransform: g || xzt,
      rehypePlugins: u ? u("rehype", w) : w,
      remarkPlugins: u ? u("remark", L) : L,
      children: r || ""
    }))
  }));
});
var Tzt = function(e) {
  return (t) => {
    qd(t, (n) => {
      n.type === "element" && n.tagName === "code" && n.data && n.data.meta && (n.properties = Ey({}, n.properties, {
        "data-meta": String(n.data.meta)
      }));
    });
  };
}, kzt = function(e) {
  return (t) => {
    qd(t, (n) => {
      if (n.type === "element" && n.tagName === "code" && n.properties && n.properties.dataMeta) {
        n.data || (n.data = {});
        var r = n.properties.dataMeta;
        typeof r == "string" && (n.data.meta = r), delete n.properties.dataMeta;
      }
    });
  };
};
const Dzt = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g, Izt = Object.hasOwnProperty;
class Nzt {
  /**
   * Create a new slug class.
   */
  constructor() {
    this.occurrences, this.reset();
  }
  /**
   * Generate a unique slug.
  *
  * Tracks previously generated slugs: repeated calls with the same value
  * will result in different slugs.
  * Use the `slug` function to get same slugs.
   *
   * @param  {string} value
   *   String of text to slugify
   * @param  {boolean} [maintainCase=false]
   *   Keep the current case, otherwise make all lowercase
   * @return {string}
   *   A unique slug string
   */
  slug(e, t) {
    const n = this;
    let r = Rzt(e, t === !0);
    const s = r;
    for (; Izt.call(n.occurrences, r); )
      n.occurrences[s]++, r = s + "-" + n.occurrences[s];
    return n.occurrences[r] = 0, r;
  }
  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset() {
    this.occurrences = /* @__PURE__ */ Object.create(null);
  }
}
function Rzt(i, e) {
  return typeof i != "string" ? "" : (e || (i = i.toLowerCase()), i.replace(Dzt, "").replace(/ /g, "-"));
}
function EWe(i) {
  const e = i.type === "element" ? i.tagName.toLowerCase() : "", t = e.length === 2 && e.charCodeAt(0) === 104 ? e.charCodeAt(1) : 0;
  return t > 48 && t < 55 ? t - 48 : void 0;
}
const Azt = {}, g2e = new Nzt();
function Ozt(i) {
  const t = (i || Azt).prefix || "";
  return function(n) {
    g2e.reset(), qd(n, "element", function(r) {
      EWe(r) && !r.properties.id && (r.properties.id = t + g2e.slug(EN(r)));
    });
  };
}
const xWe = (
  // Note: overloads in JSDoc can’t yet use different `@template`s.
  /**
   * @type {(
   *   (<Condition extends TestFunction>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & Predicate<Condition, Element>) &
   *   (<Condition extends string>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & {tagName: Condition}) &
   *   ((test?: null | undefined) => (element?: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element) &
   *   ((test?: Test) => Check)
   * )}
   */
  /**
   * @param {Test | null | undefined} [test]
   * @returns {Check}
   */
  (function(i) {
    if (i == null)
      return Fzt;
    if (typeof i == "string")
      return Pzt(i);
    if (typeof i == "object")
      return Mzt(i);
    if (typeof i == "function")
      return U0e(i);
    throw new Error("Expected function, string, or array as `test`");
  })
);
function Mzt(i) {
  const e = [];
  let t = -1;
  for (; ++t < i.length; )
    e[t] = xWe(i[t]);
  return U0e(n);
  function n(...r) {
    let s = -1;
    for (; ++s < e.length; )
      if (e[s].apply(this, r)) return !0;
    return !1;
  }
}
function Pzt(i) {
  return U0e(e);
  function e(t) {
    return t.tagName === i;
  }
}
function U0e(i) {
  return e;
  function e(t, n, r) {
    return !!(Bzt(t) && i.call(
      this,
      t,
      typeof n == "number" ? n : void 0,
      r || void 0
    ));
  }
}
function Fzt(i) {
  return !!(i && typeof i == "object" && "type" in i && i.type === "element" && "tagName" in i && typeof i.tagName == "string");
}
function Bzt(i) {
  return i !== null && typeof i == "object" && "type" in i && "tagName" in i;
}
const p2e = {
  type: "element",
  tagName: "span",
  properties: { className: ["icon", "icon-link"] },
  children: []
}, Hzt = {};
function Wzt(i) {
  const e = i || Hzt;
  let t = e.properties;
  const n = e.headingProperties, r = e.behavior || "prepend", s = e.content, o = e.group, a = xWe(e.test);
  let l;
  return r === "after" || r === "before" ? l = u : r === "wrap" ? l = d : (l = c, t || (t = { ariaHidden: "true", tabIndex: -1 })), function(h) {
    qd(h, "element", function(g, m, _) {
      if (EWe(g) && g.properties.id && a(g, m, _))
        return Object.assign(g.properties, iW(n, g)), l(g, m, _);
    });
  };
  function c(h) {
    const g = m2e(s || p2e, h);
    return h.children[r === "prepend" ? "unshift" : "push"](
      wne(h, iW(t, h), g)
    ), [f3];
  }
  function u(h, g, m) {
    if (typeof g != "number" || !m) return;
    const _ = m2e(s || p2e, h), v = wne(h, iW(t, h), _);
    let w = r === "before" ? [v, h] : [h, v];
    if (o) {
      const E = LWe(o, h);
      E && !Array.isArray(E) && E.type === "element" && (E.children = w, w = [E]);
    }
    return m.children.splice(g, 1, ...w), [f3, g + w.length];
  }
  function d(h) {
    let g = h.children, m = [];
    return typeof s == "function" ? (g = [], m = s(h)) : s && (m = z0e(s)), h.children = [
      wne(
        h,
        iW(t, h),
        Array.isArray(m) ? [...g, ...m] : [...g, m]
      )
    ], [f3];
  }
}
function z0e(i) {
  return (
    /** @type {Cloneable<T>} */
    AT(i)
  );
}
function wne(i, e, t) {
  return {
    type: "element",
    tagName: "a",
    properties: { ...e, href: "#" + i.properties.id },
    children: t
  };
}
function m2e(i, e) {
  const t = LWe(i, e);
  return Array.isArray(t) ? t : [t];
}
function LWe(i, e) {
  return typeof i == "function" ? i(e) : z0e(i);
}
function iW(i, e) {
  return typeof i == "function" ? i(e) : i ? z0e(i) : {};
}
const Vzt = (i = {}) => {
  const { openDelimiter: e = "rehype:ignore:start", closeDelimiter: t = "rehype:ignore:end" } = i;
  return (n) => {
    qd(n, (r, s, o) => {
      if (r.type === "element" || r.type === "root") {
        let a = !1;
        r.children = r.children.filter((l) => {
          if (l.type === "raw" || l.type === "comment") {
            let c = (l.value || "").trim();
            if (c = c.replace(/^<!--(.*?)-->/, "$1"), c === e)
              return a = !0, !1;
            if (c === t)
              return a = !1, !1;
          }
          return !a;
        });
      }
    });
  };
};
var Uzt = {
  type: "element",
  tagName: "svg",
  properties: {
    className: "octicon octicon-link",
    viewBox: "0 0 16 16",
    version: "1.1",
    width: "16",
    height: "16",
    ariaHidden: "true"
  },
  children: [{
    type: "element",
    tagName: "path",
    children: [],
    properties: {
      fillRule: "evenodd",
      d: "M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"
    }
  }]
};
function zzt(i) {
  return i === void 0 && (i = ""), {
    type: "element",
    tagName: "div",
    properties: {
      class: "copied",
      "data-code": i
    },
    children: [{
      type: "element",
      tagName: "svg",
      properties: {
        className: "octicon-copy",
        ariaHidden: "true",
        viewBox: "0 0 16 16",
        fill: "currentColor",
        height: 12,
        width: 12
      },
      children: [{
        type: "element",
        tagName: "path",
        properties: {
          fillRule: "evenodd",
          d: "M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"
        },
        children: []
      }, {
        type: "element",
        tagName: "path",
        properties: {
          fillRule: "evenodd",
          d: "M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"
        },
        children: []
      }]
    }, {
      type: "element",
      tagName: "svg",
      properties: {
        className: "octicon-check",
        ariaHidden: "true",
        viewBox: "0 0 16 16",
        fill: "currentColor",
        height: 12,
        width: 12
      },
      children: [{
        type: "element",
        tagName: "path",
        properties: {
          fillRule: "evenodd",
          d: "M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"
        },
        children: []
      }]
    }]
  };
}
var $zt = (i, e) => (t, n, r) => {
  if (t.type === "element" && r && r.type === "root" && /h(1|2|3|4|5|6)/.test(t.tagName)) {
    var s = t.children && t.children[0];
    s && s.properties && s.properties.ariaHidden === "true" && (s.properties = Ey({
      class: "anchor"
    }, s.properties), s.children = [Uzt]);
  }
  if (t.type === "element" && t.tagName === "pre" && !i) {
    var o = j7e(t.children);
    t.children.push(zzt(o));
  }
  e && e(t, n === null ? void 0 : n, r === null ? void 0 : r);
}, jzt = [Ozt, Wzt, Vzt];
const Gzt = /* @__PURE__ */ nb.forwardRef((i, e) => {
  var t, n = [Tzt, RHe, kzt, ...jzt, [nBt, {
    rewrite: $zt((t = i.disableCopy) != null ? t : !1, i.rehypeRewrite)
  }], [sBt, {
    properties: "attr"
  }], ...i.rehypePlugins || [], [R4t, {
    ignoreMissing: !0
  }]];
  return /* @__PURE__ */ hr.jsx(Lzt, Ey({}, i, {
    rehypePlugins: n,
    ref: e
  }));
});
var _2e = {
  name: "mermaid",
  version: "11.12.2",
  description: "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",
  type: "module",
  module: "./dist/mermaid.core.mjs",
  types: "./dist/mermaid.d.ts",
  exports: {
    ".": {
      types: "./dist/mermaid.d.ts",
      import: "./dist/mermaid.core.mjs",
      default: "./dist/mermaid.core.mjs"
    },
    "./*": "./*"
  },
  keywords: [
    "diagram",
    "markdown",
    "flowchart",
    "sequence diagram",
    "gantt",
    "class diagram",
    "git graph",
    "mindmap",
    "packet diagram",
    "c4 diagram",
    "er diagram",
    "pie chart",
    "pie diagram",
    "quadrant chart",
    "requirement diagram",
    "graph"
  ],
  scripts: {
    clean: "rimraf dist",
    dev: "pnpm -w dev",
    "docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup",
    "docs:build": "rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts",
    "docs:verify": "pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify",
    "docs:pre:vitepress": "pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts",
    "docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing",
    "docs:dev": 'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',
    "docs:dev:docker": 'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',
    "docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
    "docs:spellcheck": 'cspell "src/docs/**/*.md"',
    "docs:release-version": "tsx scripts/update-release-version.mts",
    "docs:verify-version": "tsx scripts/update-release-version.mts --verify",
    "types:build-config": "tsx scripts/create-types-from-json-schema.mts",
    "types:verify-config": "tsx scripts/create-types-from-json-schema.mts --verify",
    checkCircle: "npx madge --circular ./src",
    prepublishOnly: "pnpm docs:verify-version"
  },
  repository: {
    type: "git",
    url: "https://github.com/mermaid-js/mermaid"
  },
  author: "Knut Sveidqvist",
  license: "MIT",
  standard: {
    ignore: [
      "**/parser/*.js",
      "dist/**/*.js",
      "cypress/**/*.js"
    ],
    globals: [
      "page"
    ]
  },
  dependencies: {
    "@braintree/sanitize-url": "^7.1.1",
    "@iconify/utils": "^3.0.1",
    "@mermaid-js/parser": "workspace:^",
    "@types/d3": "^7.4.3",
    cytoscape: "^3.29.3",
    "cytoscape-cose-bilkent": "^4.1.0",
    "cytoscape-fcose": "^2.2.0",
    d3: "^7.9.0",
    "d3-sankey": "^0.12.3",
    "dagre-d3-es": "7.0.13",
    dayjs: "^1.11.18",
    dompurify: "^3.2.5",
    katex: "^0.16.22",
    khroma: "^2.1.0",
    "lodash-es": "^4.17.21",
    marked: "^16.2.1",
    roughjs: "^4.6.6",
    stylis: "^4.3.6",
    "ts-dedent": "^2.2.0",
    uuid: "^11.1.0"
  },
  devDependencies: {
    "@adobe/jsonschema2md": "^8.0.5",
    "@iconify/types": "^2.0.0",
    "@types/cytoscape": "^3.21.9",
    "@types/cytoscape-fcose": "^2.2.4",
    "@types/d3-sankey": "^0.12.4",
    "@types/d3-scale": "^4.0.9",
    "@types/d3-scale-chromatic": "^3.1.0",
    "@types/d3-selection": "^3.0.11",
    "@types/d3-shape": "^3.1.7",
    "@types/jsdom": "^21.1.7",
    "@types/katex": "^0.16.7",
    "@types/lodash-es": "^4.17.12",
    "@types/micromatch": "^4.0.9",
    "@types/stylis": "^4.2.7",
    "@types/uuid": "^10.0.0",
    ajv: "^8.17.1",
    canvas: "^3.1.2",
    chokidar: "3.6.0",
    concurrently: "^9.1.2",
    "csstree-validator": "^4.0.1",
    globby: "^14.1.0",
    jison: "^0.4.18",
    "js-base64": "^3.7.8",
    jsdom: "^26.1.0",
    "json-schema-to-typescript": "^15.0.4",
    micromatch: "^4.0.8",
    "path-browserify": "^1.0.1",
    prettier: "^3.5.3",
    remark: "^15.0.1",
    "remark-frontmatter": "^5.0.0",
    "remark-gfm": "^4.0.1",
    rimraf: "^6.0.1",
    "start-server-and-test": "^2.0.13",
    "type-fest": "^4.35.0",
    typedoc: "^0.28.12",
    "typedoc-plugin-markdown": "^4.8.1",
    typescript: "~5.7.3",
    "unist-util-flatmap": "^1.0.0",
    "unist-util-visit": "^5.0.0",
    vitepress: "^1.6.4",
    "vitepress-plugin-search": "1.0.4-alpha.22"
  },
  files: [
    "dist/",
    "README.md"
  ],
  publishConfig: {
    access: "public"
  }
}, oV = { exports: {} }, qzt = oV.exports, b2e;
function Kzt() {
  return b2e || (b2e = 1, (function(i, e) {
    (function(t, n) {
      i.exports = n();
    })(qzt, (function() {
      var t = 1e3, n = 6e4, r = 36e5, s = "millisecond", o = "second", a = "minute", l = "hour", c = "day", u = "week", d = "month", h = "quarter", g = "year", m = "date", _ = "Invalid Date", v = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, w = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, E = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(Y) {
        var G = ["th", "st", "nd", "rd"], Q = Y % 100;
        return "[" + Y + (G[(Q - 20) % 10] || G[Q] || G[0]) + "]";
      } }, L = function(Y, G, Q) {
        var oe = String(Y);
        return !oe || oe.length >= G ? Y : "" + Array(G + 1 - oe.length).join(Q) + Y;
      }, T = { s: L, z: function(Y) {
        var G = -Y.utcOffset(), Q = Math.abs(G), oe = Math.floor(Q / 60), Z = Q % 60;
        return (G <= 0 ? "+" : "-") + L(oe, 2, "0") + ":" + L(Z, 2, "0");
      }, m: function Y(G, Q) {
        if (G.date() < Q.date()) return -Y(Q, G);
        var oe = 12 * (Q.year() - G.year()) + (Q.month() - G.month()), Z = G.clone().add(oe, d), pe = Q - Z < 0, J = G.clone().add(oe + (pe ? -1 : 1), d);
        return +(-(oe + (Q - Z) / (pe ? Z - J : J - Z)) || 0);
      }, a: function(Y) {
        return Y < 0 ? Math.ceil(Y) || 0 : Math.floor(Y);
      }, p: function(Y) {
        return { M: d, y: g, w: u, d: c, D: m, h: l, m: a, s: o, ms: s, Q: h }[Y] || String(Y || "").toLowerCase().replace(/s$/, "");
      }, u: function(Y) {
        return Y === void 0;
      } }, D = "en", N = {};
      N[D] = E;
      var R = "$isDayjsObject", M = function(Y) {
        return Y instanceof K || !(!Y || !Y[R]);
      }, B = function Y(G, Q, oe) {
        var Z;
        if (!G) return D;
        if (typeof G == "string") {
          var pe = G.toLowerCase();
          N[pe] && (Z = pe), Q && (N[pe] = Q, Z = pe);
          var J = G.split("-");
          if (!Z && J.length > 1) return Y(J[0]);
        } else {
          var ae = G.name;
          N[ae] = G, Z = ae;
        }
        return !oe && Z && (D = Z), Z || !oe && D;
      }, H = function(Y, G) {
        if (M(Y)) return Y.clone();
        var Q = typeof G == "object" ? G : {};
        return Q.date = Y, Q.args = arguments, new K(Q);
      }, j = T;
      j.l = B, j.i = M, j.w = function(Y, G) {
        return H(Y, { locale: G.$L, utc: G.$u, x: G.$x, $offset: G.$offset });
      };
      var K = (function() {
        function Y(Q) {
          this.$L = B(Q.locale, null, !0), this.parse(Q), this.$x = this.$x || Q.x || {}, this[R] = !0;
        }
        var G = Y.prototype;
        return G.parse = function(Q) {
          this.$d = (function(oe) {
            var Z = oe.date, pe = oe.utc;
            if (Z === null) return /* @__PURE__ */ new Date(NaN);
            if (j.u(Z)) return /* @__PURE__ */ new Date();
            if (Z instanceof Date) return new Date(Z);
            if (typeof Z == "string" && !/Z$/i.test(Z)) {
              var J = Z.match(v);
              if (J) {
                var ae = J[2] - 1 || 0, be = (J[7] || "0").substring(0, 3);
                return pe ? new Date(Date.UTC(J[1], ae, J[3] || 1, J[4] || 0, J[5] || 0, J[6] || 0, be)) : new Date(J[1], ae, J[3] || 1, J[4] || 0, J[5] || 0, J[6] || 0, be);
              }
            }
            return new Date(Z);
          })(Q), this.init();
        }, G.init = function() {
          var Q = this.$d;
          this.$y = Q.getFullYear(), this.$M = Q.getMonth(), this.$D = Q.getDate(), this.$W = Q.getDay(), this.$H = Q.getHours(), this.$m = Q.getMinutes(), this.$s = Q.getSeconds(), this.$ms = Q.getMilliseconds();
        }, G.$utils = function() {
          return j;
        }, G.isValid = function() {
          return this.$d.toString() !== _;
        }, G.isSame = function(Q, oe) {
          var Z = H(Q);
          return this.startOf(oe) <= Z && Z <= this.endOf(oe);
        }, G.isAfter = function(Q, oe) {
          return H(Q) < this.startOf(oe);
        }, G.isBefore = function(Q, oe) {
          return this.endOf(oe) < H(Q);
        }, G.$g = function(Q, oe, Z) {
          return j.u(Q) ? this[oe] : this.set(Z, Q);
        }, G.unix = function() {
          return Math.floor(this.valueOf() / 1e3);
        }, G.valueOf = function() {
          return this.$d.getTime();
        }, G.startOf = function(Q, oe) {
          var Z = this, pe = !!j.u(oe) || oe, J = j.p(Q), ae = function(at, en) {
            var sn = j.w(Z.$u ? Date.UTC(Z.$y, en, at) : new Date(Z.$y, en, at), Z);
            return pe ? sn : sn.endOf(c);
          }, be = function(at, en) {
            return j.w(Z.toDate()[at].apply(Z.toDate("s"), (pe ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(en)), Z);
          }, re = this.$W, ze = this.$M, Ve = this.$D, st = "set" + (this.$u ? "UTC" : "");
          switch (J) {
            case g:
              return pe ? ae(1, 0) : ae(31, 11);
            case d:
              return pe ? ae(1, ze) : ae(0, ze + 1);
            case u:
              var ot = this.$locale().weekStart || 0, et = (re < ot ? re + 7 : re) - ot;
              return ae(pe ? Ve - et : Ve + (6 - et), ze);
            case c:
            case m:
              return be(st + "Hours", 0);
            case l:
              return be(st + "Minutes", 1);
            case a:
              return be(st + "Seconds", 2);
            case o:
              return be(st + "Milliseconds", 3);
            default:
              return this.clone();
          }
        }, G.endOf = function(Q) {
          return this.startOf(Q, !1);
        }, G.$set = function(Q, oe) {
          var Z, pe = j.p(Q), J = "set" + (this.$u ? "UTC" : ""), ae = (Z = {}, Z[c] = J + "Date", Z[m] = J + "Date", Z[d] = J + "Month", Z[g] = J + "FullYear", Z[l] = J + "Hours", Z[a] = J + "Minutes", Z[o] = J + "Seconds", Z[s] = J + "Milliseconds", Z)[pe], be = pe === c ? this.$D + (oe - this.$W) : oe;
          if (pe === d || pe === g) {
            var re = this.clone().set(m, 1);
            re.$d[ae](be), re.init(), this.$d = re.set(m, Math.min(this.$D, re.daysInMonth())).$d;
          } else ae && this.$d[ae](be);
          return this.init(), this;
        }, G.set = function(Q, oe) {
          return this.clone().$set(Q, oe);
        }, G.get = function(Q) {
          return this[j.p(Q)]();
        }, G.add = function(Q, oe) {
          var Z, pe = this;
          Q = Number(Q);
          var J = j.p(oe), ae = function(ze) {
            var Ve = H(pe);
            return j.w(Ve.date(Ve.date() + Math.round(ze * Q)), pe);
          };
          if (J === d) return this.set(d, this.$M + Q);
          if (J === g) return this.set(g, this.$y + Q);
          if (J === c) return ae(1);
          if (J === u) return ae(7);
          var be = (Z = {}, Z[a] = n, Z[l] = r, Z[o] = t, Z)[J] || 1, re = this.$d.getTime() + Q * be;
          return j.w(re, this);
        }, G.subtract = function(Q, oe) {
          return this.add(-1 * Q, oe);
        }, G.format = function(Q) {
          var oe = this, Z = this.$locale();
          if (!this.isValid()) return Z.invalidDate || _;
          var pe = Q || "YYYY-MM-DDTHH:mm:ssZ", J = j.z(this), ae = this.$H, be = this.$m, re = this.$M, ze = Z.weekdays, Ve = Z.months, st = Z.meridiem, ot = function(en, sn, Vt, Bi) {
            return en && (en[sn] || en(oe, pe)) || Vt[sn].slice(0, Bi);
          }, et = function(en) {
            return j.s(ae % 12 || 12, en, "0");
          }, at = st || function(en, sn, Vt) {
            var Bi = en < 12 ? "AM" : "PM";
            return Vt ? Bi.toLowerCase() : Bi;
          };
          return pe.replace(w, (function(en, sn) {
            return sn || (function(Vt) {
              switch (Vt) {
                case "YY":
                  return String(oe.$y).slice(-2);
                case "YYYY":
                  return j.s(oe.$y, 4, "0");
                case "M":
                  return re + 1;
                case "MM":
                  return j.s(re + 1, 2, "0");
                case "MMM":
                  return ot(Z.monthsShort, re, Ve, 3);
                case "MMMM":
                  return ot(Ve, re);
                case "D":
                  return oe.$D;
                case "DD":
                  return j.s(oe.$D, 2, "0");
                case "d":
                  return String(oe.$W);
                case "dd":
                  return ot(Z.weekdaysMin, oe.$W, ze, 2);
                case "ddd":
                  return ot(Z.weekdaysShort, oe.$W, ze, 3);
                case "dddd":
                  return ze[oe.$W];
                case "H":
                  return String(ae);
                case "HH":
                  return j.s(ae, 2, "0");
                case "h":
                  return et(1);
                case "hh":
                  return et(2);
                case "a":
                  return at(ae, be, !0);
                case "A":
                  return at(ae, be, !1);
                case "m":
                  return String(be);
                case "mm":
                  return j.s(be, 2, "0");
                case "s":
                  return String(oe.$s);
                case "ss":
                  return j.s(oe.$s, 2, "0");
                case "SSS":
                  return j.s(oe.$ms, 3, "0");
                case "Z":
                  return J;
              }
              return null;
            })(en) || J.replace(":", "");
          }));
        }, G.utcOffset = function() {
          return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
        }, G.diff = function(Q, oe, Z) {
          var pe, J = this, ae = j.p(oe), be = H(Q), re = (be.utcOffset() - this.utcOffset()) * n, ze = this - be, Ve = function() {
            return j.m(J, be);
          };
          switch (ae) {
            case g:
              pe = Ve() / 12;
              break;
            case d:
              pe = Ve();
              break;
            case h:
              pe = Ve() / 3;
              break;
            case u:
              pe = (ze - re) / 6048e5;
              break;
            case c:
              pe = (ze - re) / 864e5;
              break;
            case l:
              pe = ze / r;
              break;
            case a:
              pe = ze / n;
              break;
            case o:
              pe = ze / t;
              break;
            default:
              pe = ze;
          }
          return Z ? pe : j.a(pe);
        }, G.daysInMonth = function() {
          return this.endOf(d).$D;
        }, G.$locale = function() {
          return N[this.$L];
        }, G.locale = function(Q, oe) {
          if (!Q) return this.$L;
          var Z = this.clone(), pe = B(Q, oe, !0);
          return pe && (Z.$L = pe), Z;
        }, G.clone = function() {
          return j.w(this.$d, this);
        }, G.toDate = function() {
          return new Date(this.valueOf());
        }, G.toJSON = function() {
          return this.isValid() ? this.toISOString() : null;
        }, G.toISOString = function() {
          return this.$d.toISOString();
        }, G.toString = function() {
          return this.$d.toUTCString();
        }, Y;
      })(), X = K.prototype;
      return H.prototype = X, [["$ms", s], ["$s", o], ["$m", a], ["$H", l], ["$W", c], ["$M", d], ["$y", g], ["$D", m]].forEach((function(Y) {
        X[Y[1]] = function(G) {
          return this.$g(G, Y[0], Y[1]);
        };
      })), H.extend = function(Y, G) {
        return Y.$i || (Y(G, K, H), Y.$i = !0), H;
      }, H.locale = B, H.isDayjs = M, H.unix = function(Y) {
        return H(1e3 * Y);
      }, H.en = N[D], H.Ls = N, H.p = {}, H;
    }));
  })(oV)), oV.exports;
}
var Yzt = Kzt();
const Xzt = /* @__PURE__ */ WA(Yzt);
var TWe = Object.defineProperty, $ = (i, e) => TWe(i, "name", { value: e, configurable: !0 }), Zzt = (i, e) => {
  for (var t in e)
    TWe(i, t, { get: e[t], enumerable: !0 });
}, Vv = {
  trace: 0,
  debug: 1,
  info: 2,
  warn: 3,
  error: 4,
  fatal: 5
}, Ct = {
  trace: /* @__PURE__ */ $((...i) => {
  }, "trace"),
  debug: /* @__PURE__ */ $((...i) => {
  }, "debug"),
  info: /* @__PURE__ */ $((...i) => {
  }, "info"),
  warn: /* @__PURE__ */ $((...i) => {
  }, "warn"),
  error: /* @__PURE__ */ $((...i) => {
  }, "error"),
  fatal: /* @__PURE__ */ $((...i) => {
  }, "fatal")
}, $0e = /* @__PURE__ */ $(function(i = "fatal") {
  let e = Vv.fatal;
  typeof i == "string" ? i.toLowerCase() in Vv && (e = Vv[i]) : typeof i == "number" && (e = i), Ct.trace = () => {
  }, Ct.debug = () => {
  }, Ct.info = () => {
  }, Ct.warn = () => {
  }, Ct.error = () => {
  }, Ct.fatal = () => {
  }, e <= Vv.fatal && (Ct.fatal = console.error ? console.error.bind(console, Eg("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", Eg("FATAL"))), e <= Vv.error && (Ct.error = console.error ? console.error.bind(console, Eg("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", Eg("ERROR"))), e <= Vv.warn && (Ct.warn = console.warn ? console.warn.bind(console, Eg("WARN"), "color: orange") : console.log.bind(console, "\x1B[33m", Eg("WARN"))), e <= Vv.info && (Ct.info = console.info ? console.info.bind(console, Eg("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", Eg("INFO"))), e <= Vv.debug && (Ct.debug = console.debug ? console.debug.bind(console, Eg("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", Eg("DEBUG"))), e <= Vv.trace && (Ct.trace = console.debug ? console.debug.bind(console, Eg("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", Eg("TRACE")));
}, "setLogLevel"), Eg = /* @__PURE__ */ $((i) => `%c${Xzt().format("ss.SSS")} : ${i} : `, "format");
const aV = {
  /* CLAMP */
  min: {
    r: 0,
    g: 0,
    b: 0,
    s: 0,
    l: 0,
    a: 0
  },
  max: {
    r: 255,
    g: 255,
    b: 255,
    h: 360,
    s: 100,
    l: 100,
    a: 1
  },
  clamp: {
    r: (i) => i >= 255 ? 255 : i < 0 ? 0 : i,
    g: (i) => i >= 255 ? 255 : i < 0 ? 0 : i,
    b: (i) => i >= 255 ? 255 : i < 0 ? 0 : i,
    h: (i) => i % 360,
    s: (i) => i >= 100 ? 100 : i < 0 ? 0 : i,
    l: (i) => i >= 100 ? 100 : i < 0 ? 0 : i,
    a: (i) => i >= 1 ? 1 : i < 0 ? 0 : i
  },
  /* CONVERSION */
  //SOURCE: https://planetcalc.com/7779
  toLinear: (i) => {
    const e = i / 255;
    return i > 0.03928 ? Math.pow((e + 0.055) / 1.055, 2.4) : e / 12.92;
  },
  //SOURCE: https://gist.github.com/mjackson/5311256
  hue2rgb: (i, e, t) => (t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? i + (e - i) * 6 * t : t < 1 / 2 ? e : t < 2 / 3 ? i + (e - i) * (2 / 3 - t) * 6 : i),
  hsl2rgb: ({ h: i, s: e, l: t }, n) => {
    if (!e)
      return t * 2.55;
    i /= 360, e /= 100, t /= 100;
    const r = t < 0.5 ? t * (1 + e) : t + e - t * e, s = 2 * t - r;
    switch (n) {
      case "r":
        return aV.hue2rgb(s, r, i + 1 / 3) * 255;
      case "g":
        return aV.hue2rgb(s, r, i) * 255;
      case "b":
        return aV.hue2rgb(s, r, i - 1 / 3) * 255;
    }
  },
  rgb2hsl: ({ r: i, g: e, b: t }, n) => {
    i /= 255, e /= 255, t /= 255;
    const r = Math.max(i, e, t), s = Math.min(i, e, t), o = (r + s) / 2;
    if (n === "l")
      return o * 100;
    if (r === s)
      return 0;
    const a = r - s, l = o > 0.5 ? a / (2 - r - s) : a / (r + s);
    if (n === "s")
      return l * 100;
    switch (r) {
      case i:
        return ((e - t) / a + (e < t ? 6 : 0)) * 60;
      case e:
        return ((t - i) / a + 2) * 60;
      case t:
        return ((i - e) / a + 4) * 60;
      default:
        return -1;
    }
  }
}, Qzt = {
  /* API */
  clamp: (i, e, t) => e > t ? Math.min(e, Math.max(t, i)) : Math.min(t, Math.max(e, i)),
  round: (i) => Math.round(i * 1e10) / 1e10
}, Jzt = {
  /* API */
  dec2hex: (i) => {
    const e = Math.round(i).toString(16);
    return e.length > 1 ? e : `0${e}`;
  }
}, Ui = {
  channel: aV,
  lang: Qzt,
  unit: Jzt
}, BC = {};
for (let i = 0; i <= 255; i++)
  BC[i] = Ui.unit.dec2hex(i);
const Bu = {
  ALL: 0,
  RGB: 1,
  HSL: 2
};
class e$t {
  constructor() {
    this.type = Bu.ALL;
  }
  /* API */
  get() {
    return this.type;
  }
  set(e) {
    if (this.type && this.type !== e)
      throw new Error("Cannot change both RGB and HSL channels at the same time");
    this.type = e;
  }
  reset() {
    this.type = Bu.ALL;
  }
  is(e) {
    return this.type === e;
  }
}
class t$t {
  /* CONSTRUCTOR */
  constructor(e, t) {
    this.color = t, this.changed = !1, this.data = e, this.type = new e$t();
  }
  /* API */
  set(e, t) {
    return this.color = t, this.changed = !1, this.data = e, this.type.type = Bu.ALL, this;
  }
  /* HELPERS */
  _ensureHSL() {
    const e = this.data, { h: t, s: n, l: r } = e;
    t === void 0 && (e.h = Ui.channel.rgb2hsl(e, "h")), n === void 0 && (e.s = Ui.channel.rgb2hsl(e, "s")), r === void 0 && (e.l = Ui.channel.rgb2hsl(e, "l"));
  }
  _ensureRGB() {
    const e = this.data, { r: t, g: n, b: r } = e;
    t === void 0 && (e.r = Ui.channel.hsl2rgb(e, "r")), n === void 0 && (e.g = Ui.channel.hsl2rgb(e, "g")), r === void 0 && (e.b = Ui.channel.hsl2rgb(e, "b"));
  }
  /* GETTERS */
  get r() {
    const e = this.data, t = e.r;
    return !this.type.is(Bu.HSL) && t !== void 0 ? t : (this._ensureHSL(), Ui.channel.hsl2rgb(e, "r"));
  }
  get g() {
    const e = this.data, t = e.g;
    return !this.type.is(Bu.HSL) && t !== void 0 ? t : (this._ensureHSL(), Ui.channel.hsl2rgb(e, "g"));
  }
  get b() {
    const e = this.data, t = e.b;
    return !this.type.is(Bu.HSL) && t !== void 0 ? t : (this._ensureHSL(), Ui.channel.hsl2rgb(e, "b"));
  }
  get h() {
    const e = this.data, t = e.h;
    return !this.type.is(Bu.RGB) && t !== void 0 ? t : (this._ensureRGB(), Ui.channel.rgb2hsl(e, "h"));
  }
  get s() {
    const e = this.data, t = e.s;
    return !this.type.is(Bu.RGB) && t !== void 0 ? t : (this._ensureRGB(), Ui.channel.rgb2hsl(e, "s"));
  }
  get l() {
    const e = this.data, t = e.l;
    return !this.type.is(Bu.RGB) && t !== void 0 ? t : (this._ensureRGB(), Ui.channel.rgb2hsl(e, "l"));
  }
  get a() {
    return this.data.a;
  }
  /* SETTERS */
  set r(e) {
    this.type.set(Bu.RGB), this.changed = !0, this.data.r = e;
  }
  set g(e) {
    this.type.set(Bu.RGB), this.changed = !0, this.data.g = e;
  }
  set b(e) {
    this.type.set(Bu.RGB), this.changed = !0, this.data.b = e;
  }
  set h(e) {
    this.type.set(Bu.HSL), this.changed = !0, this.data.h = e;
  }
  set s(e) {
    this.type.set(Bu.HSL), this.changed = !0, this.data.s = e;
  }
  set l(e) {
    this.type.set(Bu.HSL), this.changed = !0, this.data.l = e;
  }
  set a(e) {
    this.changed = !0, this.data.a = e;
  }
}
const NY = new t$t({ r: 0, g: 0, b: 0, a: 0 }, "transparent"), bR = {
  /* VARIABLES */
  re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,
  /* API */
  parse: (i) => {
    if (i.charCodeAt(0) !== 35)
      return;
    const e = i.match(bR.re);
    if (!e)
      return;
    const t = e[1], n = parseInt(t, 16), r = t.length, s = r % 4 === 0, o = r > 4, a = o ? 1 : 17, l = o ? 8 : 4, c = s ? 0 : -1, u = o ? 255 : 15;
    return NY.set({
      r: (n >> l * (c + 3) & u) * a,
      g: (n >> l * (c + 2) & u) * a,
      b: (n >> l * (c + 1) & u) * a,
      a: s ? (n & u) * a / 255 : 1
    }, i);
  },
  stringify: (i) => {
    const { r: e, g: t, b: n, a: r } = i;
    return r < 1 ? `#${BC[Math.round(e)]}${BC[Math.round(t)]}${BC[Math.round(n)]}${BC[Math.round(r * 255)]}` : `#${BC[Math.round(e)]}${BC[Math.round(t)]}${BC[Math.round(n)]}`;
  }
}, xx = {
  /* VARIABLES */
  re: /^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,
  hueRe: /^(.+?)(deg|grad|rad|turn)$/i,
  /* HELPERS */
  _hue2deg: (i) => {
    const e = i.match(xx.hueRe);
    if (e) {
      const [, t, n] = e;
      switch (n) {
        case "grad":
          return Ui.channel.clamp.h(parseFloat(t) * 0.9);
        case "rad":
          return Ui.channel.clamp.h(parseFloat(t) * 180 / Math.PI);
        case "turn":
          return Ui.channel.clamp.h(parseFloat(t) * 360);
      }
    }
    return Ui.channel.clamp.h(parseFloat(i));
  },
  /* API */
  parse: (i) => {
    const e = i.charCodeAt(0);
    if (e !== 104 && e !== 72)
      return;
    const t = i.match(xx.re);
    if (!t)
      return;
    const [, n, r, s, o, a] = t;
    return NY.set({
      h: xx._hue2deg(n),
      s: Ui.channel.clamp.s(parseFloat(r)),
      l: Ui.channel.clamp.l(parseFloat(s)),
      a: o ? Ui.channel.clamp.a(a ? parseFloat(o) / 100 : parseFloat(o)) : 1
    }, i);
  },
  stringify: (i) => {
    const { h: e, s: t, l: n, a: r } = i;
    return r < 1 ? `hsla(${Ui.lang.round(e)}, ${Ui.lang.round(t)}%, ${Ui.lang.round(n)}%, ${r})` : `hsl(${Ui.lang.round(e)}, ${Ui.lang.round(t)}%, ${Ui.lang.round(n)}%)`;
  }
}, S3 = {
  /* VARIABLES */
  colors: {
    aliceblue: "#f0f8ff",
    antiquewhite: "#faebd7",
    aqua: "#00ffff",
    aquamarine: "#7fffd4",
    azure: "#f0ffff",
    beige: "#f5f5dc",
    bisque: "#ffe4c4",
    black: "#000000",
    blanchedalmond: "#ffebcd",
    blue: "#0000ff",
    blueviolet: "#8a2be2",
    brown: "#a52a2a",
    burlywood: "#deb887",
    cadetblue: "#5f9ea0",
    chartreuse: "#7fff00",
    chocolate: "#d2691e",
    coral: "#ff7f50",
    cornflowerblue: "#6495ed",
    cornsilk: "#fff8dc",
    crimson: "#dc143c",
    cyanaqua: "#00ffff",
    darkblue: "#00008b",
    darkcyan: "#008b8b",
    darkgoldenrod: "#b8860b",
    darkgray: "#a9a9a9",
    darkgreen: "#006400",
    darkgrey: "#a9a9a9",
    darkkhaki: "#bdb76b",
    darkmagenta: "#8b008b",
    darkolivegreen: "#556b2f",
    darkorange: "#ff8c00",
    darkorchid: "#9932cc",
    darkred: "#8b0000",
    darksalmon: "#e9967a",
    darkseagreen: "#8fbc8f",
    darkslateblue: "#483d8b",
    darkslategray: "#2f4f4f",
    darkslategrey: "#2f4f4f",
    darkturquoise: "#00ced1",
    darkviolet: "#9400d3",
    deeppink: "#ff1493",
    deepskyblue: "#00bfff",
    dimgray: "#696969",
    dimgrey: "#696969",
    dodgerblue: "#1e90ff",
    firebrick: "#b22222",
    floralwhite: "#fffaf0",
    forestgreen: "#228b22",
    fuchsia: "#ff00ff",
    gainsboro: "#dcdcdc",
    ghostwhite: "#f8f8ff",
    gold: "#ffd700",
    goldenrod: "#daa520",
    gray: "#808080",
    green: "#008000",
    greenyellow: "#adff2f",
    grey: "#808080",
    honeydew: "#f0fff0",
    hotpink: "#ff69b4",
    indianred: "#cd5c5c",
    indigo: "#4b0082",
    ivory: "#fffff0",
    khaki: "#f0e68c",
    lavender: "#e6e6fa",
    lavenderblush: "#fff0f5",
    lawngreen: "#7cfc00",
    lemonchiffon: "#fffacd",
    lightblue: "#add8e6",
    lightcoral: "#f08080",
    lightcyan: "#e0ffff",
    lightgoldenrodyellow: "#fafad2",
    lightgray: "#d3d3d3",
    lightgreen: "#90ee90",
    lightgrey: "#d3d3d3",
    lightpink: "#ffb6c1",
    lightsalmon: "#ffa07a",
    lightseagreen: "#20b2aa",
    lightskyblue: "#87cefa",
    lightslategray: "#778899",
    lightslategrey: "#778899",
    lightsteelblue: "#b0c4de",
    lightyellow: "#ffffe0",
    lime: "#00ff00",
    limegreen: "#32cd32",
    linen: "#faf0e6",
    magenta: "#ff00ff",
    maroon: "#800000",
    mediumaquamarine: "#66cdaa",
    mediumblue: "#0000cd",
    mediumorchid: "#ba55d3",
    mediumpurple: "#9370db",
    mediumseagreen: "#3cb371",
    mediumslateblue: "#7b68ee",
    mediumspringgreen: "#00fa9a",
    mediumturquoise: "#48d1cc",
    mediumvioletred: "#c71585",
    midnightblue: "#191970",
    mintcream: "#f5fffa",
    mistyrose: "#ffe4e1",
    moccasin: "#ffe4b5",
    navajowhite: "#ffdead",
    navy: "#000080",
    oldlace: "#fdf5e6",
    olive: "#808000",
    olivedrab: "#6b8e23",
    orange: "#ffa500",
    orangered: "#ff4500",
    orchid: "#da70d6",
    palegoldenrod: "#eee8aa",
    palegreen: "#98fb98",
    paleturquoise: "#afeeee",
    palevioletred: "#db7093",
    papayawhip: "#ffefd5",
    peachpuff: "#ffdab9",
    peru: "#cd853f",
    pink: "#ffc0cb",
    plum: "#dda0dd",
    powderblue: "#b0e0e6",
    purple: "#800080",
    rebeccapurple: "#663399",
    red: "#ff0000",
    rosybrown: "#bc8f8f",
    royalblue: "#4169e1",
    saddlebrown: "#8b4513",
    salmon: "#fa8072",
    sandybrown: "#f4a460",
    seagreen: "#2e8b57",
    seashell: "#fff5ee",
    sienna: "#a0522d",
    silver: "#c0c0c0",
    skyblue: "#87ceeb",
    slateblue: "#6a5acd",
    slategray: "#708090",
    slategrey: "#708090",
    snow: "#fffafa",
    springgreen: "#00ff7f",
    tan: "#d2b48c",
    teal: "#008080",
    thistle: "#d8bfd8",
    transparent: "#00000000",
    turquoise: "#40e0d0",
    violet: "#ee82ee",
    wheat: "#f5deb3",
    white: "#ffffff",
    whitesmoke: "#f5f5f5",
    yellow: "#ffff00",
    yellowgreen: "#9acd32"
  },
  /* API */
  parse: (i) => {
    i = i.toLowerCase();
    const e = S3.colors[i];
    if (e)
      return bR.parse(e);
  },
  stringify: (i) => {
    const e = bR.stringify(i);
    for (const t in S3.colors)
      if (S3.colors[t] === e)
        return t;
  }
}, cF = {
  /* VARIABLES */
  re: /^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,
  /* API */
  parse: (i) => {
    const e = i.charCodeAt(0);
    if (e !== 114 && e !== 82)
      return;
    const t = i.match(cF.re);
    if (!t)
      return;
    const [, n, r, s, o, a, l, c, u] = t;
    return NY.set({
      r: Ui.channel.clamp.r(r ? parseFloat(n) * 2.55 : parseFloat(n)),
      g: Ui.channel.clamp.g(o ? parseFloat(s) * 2.55 : parseFloat(s)),
      b: Ui.channel.clamp.b(l ? parseFloat(a) * 2.55 : parseFloat(a)),
      a: c ? Ui.channel.clamp.a(u ? parseFloat(c) / 100 : parseFloat(c)) : 1
    }, i);
  },
  stringify: (i) => {
    const { r: e, g: t, b: n, a: r } = i;
    return r < 1 ? `rgba(${Ui.lang.round(e)}, ${Ui.lang.round(t)}, ${Ui.lang.round(n)}, ${Ui.lang.round(r)})` : `rgb(${Ui.lang.round(e)}, ${Ui.lang.round(t)}, ${Ui.lang.round(n)})`;
  }
}, Eb = {
  /* VARIABLES */
  format: {
    keyword: S3,
    hex: bR,
    rgb: cF,
    rgba: cF,
    hsl: xx,
    hsla: xx
  },
  /* API */
  parse: (i) => {
    if (typeof i != "string")
      return i;
    const e = bR.parse(i) || cF.parse(i) || xx.parse(i) || S3.parse(i);
    if (e)
      return e;
    throw new Error(`Unsupported color format: "${i}"`);
  },
  stringify: (i) => !i.changed && i.color ? i.color : i.type.is(Bu.HSL) || i.data.r === void 0 ? xx.stringify(i) : i.a < 1 || !Number.isInteger(i.r) || !Number.isInteger(i.g) || !Number.isInteger(i.b) ? cF.stringify(i) : bR.stringify(i)
}, kWe = (i, e) => {
  const t = Eb.parse(i);
  for (const n in e)
    t[n] = Ui.channel.clamp[n](e[n]);
  return Eb.stringify(t);
}, E3 = (i, e, t = 0, n = 1) => {
  if (typeof i != "number")
    return kWe(i, { a: e });
  const r = NY.set({
    r: Ui.channel.clamp.r(i),
    g: Ui.channel.clamp.g(e),
    b: Ui.channel.clamp.b(t),
    a: Ui.channel.clamp.a(n)
  });
  return Eb.stringify(r);
}, n$t = (i) => {
  const { r: e, g: t, b: n } = Eb.parse(i), r = 0.2126 * Ui.channel.toLinear(e) + 0.7152 * Ui.channel.toLinear(t) + 0.0722 * Ui.channel.toLinear(n);
  return Ui.lang.round(r);
}, i$t = (i) => n$t(i) >= 0.5, _6 = (i) => !i$t(i), DWe = (i, e, t) => {
  const n = Eb.parse(i), r = n[e], s = Ui.channel.clamp[e](r + t);
  return r !== s && (n[e] = s), Eb.stringify(n);
}, Hn = (i, e) => DWe(i, "l", e), di = (i, e) => DWe(i, "l", -e), Ue = (i, e) => {
  const t = Eb.parse(i), n = {};
  for (const r in e)
    e[r] && (n[r] = t[r] + e[r]);
  return kWe(i, n);
}, r$t = (i, e, t = 50) => {
  const { r: n, g: r, b: s, a: o } = Eb.parse(i), { r: a, g: l, b: c, a: u } = Eb.parse(e), d = t / 100, h = d * 2 - 1, g = o - u, _ = ((h * g === -1 ? h : (h + g) / (1 + h * g)) + 1) / 2, v = 1 - _, w = n * _ + a * v, E = r * _ + l * v, L = s * _ + c * v, T = o * d + u * (1 - d);
  return E3(w, E, L, T);
}, an = (i, e = 100) => {
  const t = Eb.parse(i);
  return t.r = 255 - t.r, t.g = 255 - t.g, t.b = 255 - t.b, r$t(t, i, e);
};
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
const {
  entries: IWe,
  setPrototypeOf: v2e,
  isFrozen: s$t,
  getPrototypeOf: o$t,
  getOwnPropertyDescriptor: a$t
} = Object;
let {
  freeze: Kd,
  seal: Yg,
  create: Sde
} = Object, {
  apply: Ede,
  construct: xde
} = typeof Reflect < "u" && Reflect;
Kd || (Kd = function(e) {
  return e;
});
Yg || (Yg = function(e) {
  return e;
});
Ede || (Ede = function(e, t) {
  for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
    r[s - 2] = arguments[s];
  return e.apply(t, r);
});
xde || (xde = function(e) {
  for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
    n[r - 1] = arguments[r];
  return new e(...n);
});
const rW = Yd(Array.prototype.forEach), l$t = Yd(Array.prototype.lastIndexOf), y2e = Yd(Array.prototype.pop), TP = Yd(Array.prototype.push), c$t = Yd(Array.prototype.splice), lV = Yd(String.prototype.toLowerCase), Sne = Yd(String.prototype.toString), Ene = Yd(String.prototype.match), kP = Yd(String.prototype.replace), u$t = Yd(String.prototype.indexOf), d$t = Yd(String.prototype.trim), Op = Yd(Object.prototype.hasOwnProperty), Ed = Yd(RegExp.prototype.test), DP = h$t(TypeError);
function Yd(i) {
  return function(e) {
    e instanceof RegExp && (e.lastIndex = 0);
    for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
      n[r - 1] = arguments[r];
    return Ede(i, e, n);
  };
}
function h$t(i) {
  return function() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
      t[n] = arguments[n];
    return xde(i, t);
  };
}
function kr(i, e) {
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lV;
  v2e && v2e(i, null);
  let n = e.length;
  for (; n--; ) {
    let r = e[n];
    if (typeof r == "string") {
      const s = t(r);
      s !== r && (s$t(e) || (e[n] = s), r = s);
    }
    i[r] = !0;
  }
  return i;
}
function f$t(i) {
  for (let e = 0; e < i.length; e++)
    Op(i, e) || (i[e] = null);
  return i;
}
function E_(i) {
  const e = Sde(null);
  for (const [t, n] of IWe(i))
    Op(i, t) && (Array.isArray(n) ? e[t] = f$t(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = E_(n) : e[t] = n);
  return e;
}
function IP(i, e) {
  for (; i !== null; ) {
    const n = a$t(i, e);
    if (n) {
      if (n.get)
        return Yd(n.get);
      if (typeof n.value == "function")
        return Yd(n.value);
    }
    i = o$t(i);
  }
  function t() {
    return null;
  }
  return t;
}
const C2e = Kd(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), xne = Kd(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Lne = Kd(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), g$t = Kd(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Tne = Kd(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), p$t = Kd(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), w2e = Kd(["#text"]), S2e = Kd(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), kne = Kd(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), E2e = Kd(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), sW = Kd(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), m$t = Yg(/\{\{[\w\W]*|[\w\W]*\}\}/gm), _$t = Yg(/<%[\w\W]*|[\w\W]*%>/gm), b$t = Yg(/\$\{[\w\W]*/gm), v$t = Yg(/^data-[\-\w.\u00B7-\uFFFF]+$/), y$t = Yg(/^aria-[\-\w]+$/), NWe = Yg(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), C$t = Yg(/^(?:\w+script|data):/i), w$t = Yg(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), RWe = Yg(/^html$/i), S$t = Yg(/^[a-z][.\w]*(-[.\w]+)+$/i);
var x2e = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  ARIA_ATTR: y$t,
  ATTR_WHITESPACE: w$t,
  CUSTOM_ELEMENT: S$t,
  DATA_ATTR: v$t,
  DOCTYPE_NAME: RWe,
  ERB_EXPR: _$t,
  IS_ALLOWED_URI: NWe,
  IS_SCRIPT_OR_DATA: C$t,
  MUSTACHE_EXPR: m$t,
  TMPLIT_EXPR: b$t
});
const NP = {
  element: 1,
  text: 3,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9
}, E$t = function() {
  return typeof window > "u" ? null : window;
}, x$t = function(e, t) {
  if (typeof e != "object" || typeof e.createPolicy != "function")
    return null;
  let n = null;
  const r = "data-tt-policy-suffix";
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
  const s = "dompurify" + (n ? "#" + n : "");
  try {
    return e.createPolicy(s, {
      createHTML(o) {
        return o;
      },
      createScriptURL(o) {
        return o;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + s + " could not be created."), null;
  }
}, L2e = function() {
  return {
    afterSanitizeAttributes: [],
    afterSanitizeElements: [],
    afterSanitizeShadowDOM: [],
    beforeSanitizeAttributes: [],
    beforeSanitizeElements: [],
    beforeSanitizeShadowDOM: [],
    uponSanitizeAttribute: [],
    uponSanitizeElement: [],
    uponSanitizeShadowNode: []
  };
};
function AWe() {
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : E$t();
  const e = (ve) => AWe(ve);
  if (e.version = "3.3.1", e.removed = [], !i || !i.document || i.document.nodeType !== NP.document || !i.Element)
    return e.isSupported = !1, e;
  let {
    document: t
  } = i;
  const n = t, r = n.currentScript, {
    DocumentFragment: s,
    HTMLTemplateElement: o,
    Node: a,
    Element: l,
    NodeFilter: c,
    NamedNodeMap: u = i.NamedNodeMap || i.MozNamedAttrMap,
    HTMLFormElement: d,
    DOMParser: h,
    trustedTypes: g
  } = i, m = l.prototype, _ = IP(m, "cloneNode"), v = IP(m, "remove"), w = IP(m, "nextSibling"), E = IP(m, "childNodes"), L = IP(m, "parentNode");
  if (typeof o == "function") {
    const ve = t.createElement("template");
    ve.content && ve.content.ownerDocument && (t = ve.content.ownerDocument);
  }
  let T, D = "";
  const {
    implementation: N,
    createNodeIterator: R,
    createDocumentFragment: M,
    getElementsByTagName: B
  } = t, {
    importNode: H
  } = n;
  let j = L2e();
  e.isSupported = typeof IWe == "function" && typeof L == "function" && N && N.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: K,
    ERB_EXPR: X,
    TMPLIT_EXPR: Y,
    DATA_ATTR: G,
    ARIA_ATTR: Q,
    IS_SCRIPT_OR_DATA: oe,
    ATTR_WHITESPACE: Z,
    CUSTOM_ELEMENT: pe
  } = x2e;
  let {
    IS_ALLOWED_URI: J
  } = x2e, ae = null;
  const be = kr({}, [...C2e, ...xne, ...Lne, ...Tne, ...w2e]);
  let re = null;
  const ze = kr({}, [...S2e, ...kne, ...E2e, ...sW]);
  let Ve = Object.seal(Sde(null, {
    tagNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    attributeNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    allowCustomizedBuiltInElements: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: !1
    }
  })), st = null, ot = null;
  const et = Object.seal(Sde(null, {
    tagCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    attributeCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    }
  }));
  let at = !0, en = !0, sn = !1, Vt = !0, Bi = !1, pi = !0, tn = !1, Vr = !1, tr = !1, qr = !1, Bs = !1, Ts = !1, ts = !0, io = !1;
  const nr = "user-content-";
  let _s = !0, Hs = !1, He = {}, yt = null;
  const Ln = kr({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
  let oi = null;
  const vi = kr({}, ["audio", "video", "img", "source", "image", "track"]);
  let Dt = null;
  const cn = kr({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), En = "http://www.w3.org/1998/Math/MathML", ii = "http://www.w3.org/2000/svg", li = "http://www.w3.org/1999/xhtml";
  let lt = li, Bt = !1, Mn = null;
  const gn = kr({}, [En, ii, li], Sne);
  let yi = kr({}, ["mi", "mo", "mn", "ms", "mtext"]), Ni = kr({}, ["annotation-xml"]);
  const qi = kr({}, ["title", "style", "font", "a", "script"]);
  let Ur = null;
  const Ws = ["application/xhtml+xml", "text/html"], El = "text/html";
  let Ri = null, So = null;
  const va = t.createElement("form"), xl = function(fe) {
    return fe instanceof RegExp || fe instanceof Function;
  }, ya = function() {
    let fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(So && So === fe)) {
      if ((!fe || typeof fe != "object") && (fe = {}), fe = E_(fe), Ur = // eslint-disable-next-line unicorn/prefer-includes
      Ws.indexOf(fe.PARSER_MEDIA_TYPE) === -1 ? El : fe.PARSER_MEDIA_TYPE, Ri = Ur === "application/xhtml+xml" ? Sne : lV, ae = Op(fe, "ALLOWED_TAGS") ? kr({}, fe.ALLOWED_TAGS, Ri) : be, re = Op(fe, "ALLOWED_ATTR") ? kr({}, fe.ALLOWED_ATTR, Ri) : ze, Mn = Op(fe, "ALLOWED_NAMESPACES") ? kr({}, fe.ALLOWED_NAMESPACES, Sne) : gn, Dt = Op(fe, "ADD_URI_SAFE_ATTR") ? kr(E_(cn), fe.ADD_URI_SAFE_ATTR, Ri) : cn, oi = Op(fe, "ADD_DATA_URI_TAGS") ? kr(E_(vi), fe.ADD_DATA_URI_TAGS, Ri) : vi, yt = Op(fe, "FORBID_CONTENTS") ? kr({}, fe.FORBID_CONTENTS, Ri) : Ln, st = Op(fe, "FORBID_TAGS") ? kr({}, fe.FORBID_TAGS, Ri) : E_({}), ot = Op(fe, "FORBID_ATTR") ? kr({}, fe.FORBID_ATTR, Ri) : E_({}), He = Op(fe, "USE_PROFILES") ? fe.USE_PROFILES : !1, at = fe.ALLOW_ARIA_ATTR !== !1, en = fe.ALLOW_DATA_ATTR !== !1, sn = fe.ALLOW_UNKNOWN_PROTOCOLS || !1, Vt = fe.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Bi = fe.SAFE_FOR_TEMPLATES || !1, pi = fe.SAFE_FOR_XML !== !1, tn = fe.WHOLE_DOCUMENT || !1, qr = fe.RETURN_DOM || !1, Bs = fe.RETURN_DOM_FRAGMENT || !1, Ts = fe.RETURN_TRUSTED_TYPE || !1, tr = fe.FORCE_BODY || !1, ts = fe.SANITIZE_DOM !== !1, io = fe.SANITIZE_NAMED_PROPS || !1, _s = fe.KEEP_CONTENT !== !1, Hs = fe.IN_PLACE || !1, J = fe.ALLOWED_URI_REGEXP || NWe, lt = fe.NAMESPACE || li, yi = fe.MATHML_TEXT_INTEGRATION_POINTS || yi, Ni = fe.HTML_INTEGRATION_POINTS || Ni, Ve = fe.CUSTOM_ELEMENT_HANDLING || {}, fe.CUSTOM_ELEMENT_HANDLING && xl(fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (Ve.tagNameCheck = fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck), fe.CUSTOM_ELEMENT_HANDLING && xl(fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (Ve.attributeNameCheck = fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), fe.CUSTOM_ELEMENT_HANDLING && typeof fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (Ve.allowCustomizedBuiltInElements = fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Bi && (en = !1), Bs && (qr = !0), He && (ae = kr({}, w2e), re = [], He.html === !0 && (kr(ae, C2e), kr(re, S2e)), He.svg === !0 && (kr(ae, xne), kr(re, kne), kr(re, sW)), He.svgFilters === !0 && (kr(ae, Lne), kr(re, kne), kr(re, sW)), He.mathMl === !0 && (kr(ae, Tne), kr(re, E2e), kr(re, sW))), fe.ADD_TAGS && (typeof fe.ADD_TAGS == "function" ? et.tagCheck = fe.ADD_TAGS : (ae === be && (ae = E_(ae)), kr(ae, fe.ADD_TAGS, Ri))), fe.ADD_ATTR && (typeof fe.ADD_ATTR == "function" ? et.attributeCheck = fe.ADD_ATTR : (re === ze && (re = E_(re)), kr(re, fe.ADD_ATTR, Ri))), fe.ADD_URI_SAFE_ATTR && kr(Dt, fe.ADD_URI_SAFE_ATTR, Ri), fe.FORBID_CONTENTS && (yt === Ln && (yt = E_(yt)), kr(yt, fe.FORBID_CONTENTS, Ri)), fe.ADD_FORBID_CONTENTS && (yt === Ln && (yt = E_(yt)), kr(yt, fe.ADD_FORBID_CONTENTS, Ri)), _s && (ae["#text"] = !0), tn && kr(ae, ["html", "head", "body"]), ae.table && (kr(ae, ["tbody"]), delete st.tbody), fe.TRUSTED_TYPES_POLICY) {
        if (typeof fe.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw DP('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof fe.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw DP('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        T = fe.TRUSTED_TYPES_POLICY, D = T.createHTML("");
      } else
        T === void 0 && (T = x$t(g, r)), T !== null && typeof D == "string" && (D = T.createHTML(""));
      Kd && Kd(fe), So = fe;
    }
  }, ro = kr({}, [...xne, ...Lne, ...g$t]), Eo = kr({}, [...Tne, ...p$t]), po = function(fe) {
    let Be = L(fe);
    (!Be || !Be.tagName) && (Be = {
      namespaceURI: lt,
      tagName: "template"
    });
    const Lt = lV(fe.tagName), ci = lV(Be.tagName);
    return Mn[fe.namespaceURI] ? fe.namespaceURI === ii ? Be.namespaceURI === li ? Lt === "svg" : Be.namespaceURI === En ? Lt === "svg" && (ci === "annotation-xml" || yi[ci]) : !!ro[Lt] : fe.namespaceURI === En ? Be.namespaceURI === li ? Lt === "math" : Be.namespaceURI === ii ? Lt === "math" && Ni[ci] : !!Eo[Lt] : fe.namespaceURI === li ? Be.namespaceURI === ii && !Ni[ci] || Be.namespaceURI === En && !yi[ci] ? !1 : !Eo[Lt] && (qi[Lt] || !ro[Lt]) : !!(Ur === "application/xhtml+xml" && Mn[fe.namespaceURI]) : !1;
  }, bs = function(fe) {
    TP(e.removed, {
      element: fe
    });
    try {
      L(fe).removeChild(fe);
    } catch {
      v(fe);
    }
  }, na = function(fe, Be) {
    try {
      TP(e.removed, {
        attribute: Be.getAttributeNode(fe),
        from: Be
      });
    } catch {
      TP(e.removed, {
        attribute: null,
        from: Be
      });
    }
    if (Be.removeAttribute(fe), fe === "is")
      if (qr || Bs)
        try {
          bs(Be);
        } catch {
        }
      else
        try {
          Be.setAttribute(fe, "");
        } catch {
        }
  }, sc = function(fe) {
    let Be = null, Lt = null;
    if (tr)
      fe = "<remove></remove>" + fe;
    else {
      const qn = Ene(fe, /^[\r\n\t ]+/);
      Lt = qn && qn[0];
    }
    Ur === "application/xhtml+xml" && lt === li && (fe = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + fe + "</body></html>");
    const ci = T ? T.createHTML(fe) : fe;
    if (lt === li)
      try {
        Be = new h().parseFromString(ci, Ur);
      } catch {
      }
    if (!Be || !Be.documentElement) {
      Be = N.createDocument(lt, "template", null);
      try {
        Be.documentElement.innerHTML = Bt ? D : ci;
      } catch {
      }
    }
    const kn = Be.body || Be.documentElement;
    return fe && Lt && kn.insertBefore(t.createTextNode(Lt), kn.childNodes[0] || null), lt === li ? B.call(Be, tn ? "html" : "body")[0] : tn ? Be.documentElement : kn;
  }, Rc = function(fe) {
    return R.call(
      fe.ownerDocument || fe,
      fe,
      // eslint-disable-next-line no-bitwise
      c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
      null
    );
  }, xe = function(fe) {
    return fe instanceof d && (typeof fe.nodeName != "string" || typeof fe.textContent != "string" || typeof fe.removeChild != "function" || !(fe.attributes instanceof u) || typeof fe.removeAttribute != "function" || typeof fe.setAttribute != "function" || typeof fe.namespaceURI != "string" || typeof fe.insertBefore != "function" || typeof fe.hasChildNodes != "function");
  }, mt = function(fe) {
    return typeof a == "function" && fe instanceof a;
  };
  function jt(ve, fe, Be) {
    rW(ve, (Lt) => {
      Lt.call(e, fe, Be, So);
    });
  }
  const nn = function(fe) {
    let Be = null;
    if (jt(j.beforeSanitizeElements, fe, null), xe(fe))
      return bs(fe), !0;
    const Lt = Ri(fe.nodeName);
    if (jt(j.uponSanitizeElement, fe, {
      tagName: Lt,
      allowedTags: ae
    }), pi && fe.hasChildNodes() && !mt(fe.firstElementChild) && Ed(/<[/\w!]/g, fe.innerHTML) && Ed(/<[/\w!]/g, fe.textContent) || fe.nodeType === NP.progressingInstruction || pi && fe.nodeType === NP.comment && Ed(/<[/\w]/g, fe.data))
      return bs(fe), !0;
    if (!(et.tagCheck instanceof Function && et.tagCheck(Lt)) && (!ae[Lt] || st[Lt])) {
      if (!st[Lt] && fi(Lt) && (Ve.tagNameCheck instanceof RegExp && Ed(Ve.tagNameCheck, Lt) || Ve.tagNameCheck instanceof Function && Ve.tagNameCheck(Lt)))
        return !1;
      if (_s && !yt[Lt]) {
        const ci = L(fe) || fe.parentNode, kn = E(fe) || fe.childNodes;
        if (kn && ci) {
          const qn = kn.length;
          for (let bn = qn - 1; bn >= 0; --bn) {
            const mo = _(kn[bn], !0);
            mo.__removalCount = (fe.__removalCount || 0) + 1, ci.insertBefore(mo, w(fe));
          }
        }
      }
      return bs(fe), !0;
    }
    return fe instanceof l && !po(fe) || (Lt === "noscript" || Lt === "noembed" || Lt === "noframes") && Ed(/<\/no(script|embed|frames)/i, fe.innerHTML) ? (bs(fe), !0) : (Bi && fe.nodeType === NP.text && (Be = fe.textContent, rW([K, X, Y], (ci) => {
      Be = kP(Be, ci, " ");
    }), fe.textContent !== Be && (TP(e.removed, {
      element: fe.cloneNode()
    }), fe.textContent = Be)), jt(j.afterSanitizeElements, fe, null), !1);
  }, Wi = function(fe, Be, Lt) {
    if (ts && (Be === "id" || Be === "name") && (Lt in t || Lt in va))
      return !1;
    if (!(en && !ot[Be] && Ed(G, Be))) {
      if (!(at && Ed(Q, Be))) {
        if (!(et.attributeCheck instanceof Function && et.attributeCheck(Be, fe))) {
          if (!re[Be] || ot[Be]) {
            if (
              // First condition does a very basic check if a) it's basically a valid custom element tagname AND
              // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
              // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
              !(fi(fe) && (Ve.tagNameCheck instanceof RegExp && Ed(Ve.tagNameCheck, fe) || Ve.tagNameCheck instanceof Function && Ve.tagNameCheck(fe)) && (Ve.attributeNameCheck instanceof RegExp && Ed(Ve.attributeNameCheck, Be) || Ve.attributeNameCheck instanceof Function && Ve.attributeNameCheck(Be, fe)) || // Alternative, second condition checks if it's an `is`-attribute, AND
              // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
              Be === "is" && Ve.allowCustomizedBuiltInElements && (Ve.tagNameCheck instanceof RegExp && Ed(Ve.tagNameCheck, Lt) || Ve.tagNameCheck instanceof Function && Ve.tagNameCheck(Lt)))
            ) return !1;
          } else if (!Dt[Be]) {
            if (!Ed(J, kP(Lt, Z, ""))) {
              if (!((Be === "src" || Be === "xlink:href" || Be === "href") && fe !== "script" && u$t(Lt, "data:") === 0 && oi[fe])) {
                if (!(sn && !Ed(oe, kP(Lt, Z, "")))) {
                  if (Lt)
                    return !1;
                }
              }
            }
          }
        }
      }
    }
    return !0;
  }, fi = function(fe) {
    return fe !== "annotation-xml" && Ene(fe, pe);
  }, Ki = function(fe) {
    jt(j.beforeSanitizeAttributes, fe, null);
    const {
      attributes: Be
    } = fe;
    if (!Be || xe(fe))
      return;
    const Lt = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: re,
      forceKeepAttr: void 0
    };
    let ci = Be.length;
    for (; ci--; ) {
      const kn = Be[ci], {
        name: qn,
        namespaceURI: bn,
        value: mo
      } = kn, ns = Ri(qn), tf = mo;
      let vs = qn === "value" ? tf : d$t(tf);
      if (Lt.attrName = ns, Lt.attrValue = vs, Lt.keepAttr = !0, Lt.forceKeepAttr = void 0, jt(j.uponSanitizeAttribute, fe, Lt), vs = Lt.attrValue, io && (ns === "id" || ns === "name") && (na(qn, fe), vs = nr + vs), pi && Ed(/((--!?|])>)|<\/(style|title|textarea)/i, vs)) {
        na(qn, fe);
        continue;
      }
      if (ns === "attributename" && Ene(vs, "href")) {
        na(qn, fe);
        continue;
      }
      if (Lt.forceKeepAttr)
        continue;
      if (!Lt.keepAttr) {
        na(qn, fe);
        continue;
      }
      if (!Vt && Ed(/\/>/i, vs)) {
        na(qn, fe);
        continue;
      }
      Bi && rW([K, X, Y], (Ll) => {
        vs = kP(vs, Ll, " ");
      });
      const nf = Ri(fe.nodeName);
      if (!Wi(nf, ns, vs)) {
        na(qn, fe);
        continue;
      }
      if (T && typeof g == "object" && typeof g.getAttributeType == "function" && !bn)
        switch (g.getAttributeType(nf, ns)) {
          case "TrustedHTML": {
            vs = T.createHTML(vs);
            break;
          }
          case "TrustedScriptURL": {
            vs = T.createScriptURL(vs);
            break;
          }
        }
      if (vs !== tf)
        try {
          bn ? fe.setAttributeNS(bn, qn, vs) : fe.setAttribute(qn, vs), xe(fe) ? bs(fe) : y2e(e.removed);
        } catch {
          na(qn, fe);
        }
    }
    jt(j.afterSanitizeAttributes, fe, null);
  }, Nt = function ve(fe) {
    let Be = null;
    const Lt = Rc(fe);
    for (jt(j.beforeSanitizeShadowDOM, fe, null); Be = Lt.nextNode(); )
      jt(j.uponSanitizeShadowNode, Be, null), nn(Be), Ki(Be), Be.content instanceof s && ve(Be.content);
    jt(j.afterSanitizeShadowDOM, fe, null);
  };
  return e.sanitize = function(ve) {
    let fe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Be = null, Lt = null, ci = null, kn = null;
    if (Bt = !ve, Bt && (ve = "<!-->"), typeof ve != "string" && !mt(ve))
      if (typeof ve.toString == "function") {
        if (ve = ve.toString(), typeof ve != "string")
          throw DP("dirty is not a string, aborting");
      } else
        throw DP("toString is not a function");
    if (!e.isSupported)
      return ve;
    if (Vr || ya(fe), e.removed = [], typeof ve == "string" && (Hs = !1), Hs) {
      if (ve.nodeName) {
        const mo = Ri(ve.nodeName);
        if (!ae[mo] || st[mo])
          throw DP("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (ve instanceof a)
      Be = sc("<!---->"), Lt = Be.ownerDocument.importNode(ve, !0), Lt.nodeType === NP.element && Lt.nodeName === "BODY" || Lt.nodeName === "HTML" ? Be = Lt : Be.appendChild(Lt);
    else {
      if (!qr && !Bi && !tn && // eslint-disable-next-line unicorn/prefer-includes
      ve.indexOf("<") === -1)
        return T && Ts ? T.createHTML(ve) : ve;
      if (Be = sc(ve), !Be)
        return qr ? null : Ts ? D : "";
    }
    Be && tr && bs(Be.firstChild);
    const qn = Rc(Hs ? ve : Be);
    for (; ci = qn.nextNode(); )
      nn(ci), Ki(ci), ci.content instanceof s && Nt(ci.content);
    if (Hs)
      return ve;
    if (qr) {
      if (Bs)
        for (kn = M.call(Be.ownerDocument); Be.firstChild; )
          kn.appendChild(Be.firstChild);
      else
        kn = Be;
      return (re.shadowroot || re.shadowrootmode) && (kn = H.call(n, kn, !0)), kn;
    }
    let bn = tn ? Be.outerHTML : Be.innerHTML;
    return tn && ae["!doctype"] && Be.ownerDocument && Be.ownerDocument.doctype && Be.ownerDocument.doctype.name && Ed(RWe, Be.ownerDocument.doctype.name) && (bn = "<!DOCTYPE " + Be.ownerDocument.doctype.name + `>
` + bn), Bi && rW([K, X, Y], (mo) => {
      bn = kP(bn, mo, " ");
    }), T && Ts ? T.createHTML(bn) : bn;
  }, e.setConfig = function() {
    let ve = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    ya(ve), Vr = !0;
  }, e.clearConfig = function() {
    So = null, Vr = !1;
  }, e.isValidAttribute = function(ve, fe, Be) {
    So || ya({});
    const Lt = Ri(ve), ci = Ri(fe);
    return Wi(Lt, ci, Be);
  }, e.addHook = function(ve, fe) {
    typeof fe == "function" && TP(j[ve], fe);
  }, e.removeHook = function(ve, fe) {
    if (fe !== void 0) {
      const Be = l$t(j[ve], fe);
      return Be === -1 ? void 0 : c$t(j[ve], Be, 1)[0];
    }
    return y2e(j[ve]);
  }, e.removeHooks = function(ve) {
    j[ve] = [];
  }, e.removeAllHooks = function() {
    j = L2e();
  }, e;
}
var NA = AWe(), OWe = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s, x3 = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi, L$t = /\s*%%.*\n/gm, MR, MWe = (MR = class extends Error {
  constructor(e) {
    super(e), this.name = "UnknownDiagramError";
  }
}, $(MR, "UnknownDiagramError"), MR), MT = {}, j0e = /* @__PURE__ */ $(function(i, e) {
  i = i.replace(OWe, "").replace(x3, "").replace(L$t, `
`);
  for (const [t, { detector: n }] of Object.entries(MT))
    if (n(i, e))
      return t;
  throw new MWe(
    `No diagram type detected matching given configuration for text: ${i}`
  );
}, "detectType"), Lde = /* @__PURE__ */ $((...i) => {
  for (const { id: e, detector: t, loader: n } of i)
    PWe(e, t, n);
}, "registerLazyLoadedDiagrams"), PWe = /* @__PURE__ */ $((i, e, t) => {
  MT[i] && Ct.warn(`Detector with key ${i} already exists. Overwriting.`), MT[i] = { detector: e, loader: t }, Ct.debug(`Detector with key ${i} added${t ? " with loader" : ""}`);
}, "addDetector"), T$t = /* @__PURE__ */ $((i) => MT[i].loader, "getDiagramLoader"), Tde = /* @__PURE__ */ $((i, e, { depth: t = 2, clobber: n = !1 } = {}) => {
  const r = { depth: t, clobber: n };
  return Array.isArray(e) && !Array.isArray(i) ? (e.forEach((s) => Tde(i, s, r)), i) : Array.isArray(e) && Array.isArray(i) ? (e.forEach((s) => {
    i.includes(s) || i.push(s);
  }), i) : i === void 0 || t <= 0 ? i != null && typeof i == "object" && typeof e == "object" ? Object.assign(i, e) : e : (e !== void 0 && typeof i == "object" && typeof e == "object" && Object.keys(e).forEach((s) => {
    typeof e[s] == "object" && (i[s] === void 0 || typeof i[s] == "object") ? (i[s] === void 0 && (i[s] = Array.isArray(e[s]) ? [] : {}), i[s] = Tde(i[s], e[s], { depth: t - 1, clobber: n })) : (n || typeof i[s] != "object" && typeof e[s] != "object") && (i[s] = e[s]);
  }), i);
}, "assignWithDepth"), Xl = Tde, RY = "#ffffff", AY = "#f2f2f2", Pd = /* @__PURE__ */ $((i, e) => e ? Ue(i, { s: -40, l: 10 }) : Ue(i, { s: -40, l: -10 }), "mkBorder"), PR, k$t = (PR = class {
  constructor() {
    this.background = "#f4f4f4", this.primaryColor = "#fff4dd", this.noteBkgColor = "#fff5ad", this.noteTextColor = "#333", this.THEME_COLOR_LIMIT = 12, this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px";
  }
  updateColors() {
    var t, n, r, s, o, a, l, c, u, d, h, g, m, _, v, w, E, L, T, D, N;
    if (this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333"), this.secondaryColor = this.secondaryColor || Ue(this.primaryColor, { h: -120 }), this.tertiaryColor = this.tertiaryColor || Ue(this.primaryColor, { h: 180, l: 5 }), this.primaryBorderColor = this.primaryBorderColor || Pd(this.primaryColor, this.darkMode), this.secondaryBorderColor = this.secondaryBorderColor || Pd(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = this.tertiaryBorderColor || Pd(this.tertiaryColor, this.darkMode), this.noteBorderColor = this.noteBorderColor || Pd(this.noteBkgColor, this.darkMode), this.noteBkgColor = this.noteBkgColor || "#fff5ad", this.noteTextColor = this.noteTextColor || "#333", this.secondaryTextColor = this.secondaryTextColor || an(this.secondaryColor), this.tertiaryTextColor = this.tertiaryTextColor || an(this.tertiaryColor), this.lineColor = this.lineColor || an(this.background), this.arrowheadColor = this.arrowheadColor || an(this.background), this.textColor = this.textColor || this.primaryTextColor, this.border2 = this.border2 || this.tertiaryBorderColor, this.nodeBkg = this.nodeBkg || this.primaryColor, this.mainBkg = this.mainBkg || this.primaryColor, this.nodeBorder = this.nodeBorder || this.primaryBorderColor, this.clusterBkg = this.clusterBkg || this.tertiaryColor, this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor, this.defaultLinkColor = this.defaultLinkColor || this.lineColor, this.titleColor = this.titleColor || this.tertiaryTextColor, this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? di(this.secondaryColor, 30) : this.secondaryColor), this.nodeTextColor = this.nodeTextColor || this.primaryTextColor, this.actorBorder = this.actorBorder || this.primaryBorderColor, this.actorBkg = this.actorBkg || this.mainBkg, this.actorTextColor = this.actorTextColor || this.primaryTextColor, this.actorLineColor = this.actorLineColor || this.actorBorder, this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg, this.signalColor = this.signalColor || this.textColor, this.signalTextColor = this.signalTextColor || this.textColor, this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder, this.labelTextColor = this.labelTextColor || this.actorTextColor, this.loopTextColor = this.loopTextColor || this.actorTextColor, this.activationBorderColor = this.activationBorderColor || di(this.secondaryColor, 10), this.activationBkgColor = this.activationBkgColor || this.secondaryColor, this.sequenceNumberColor = this.sequenceNumberColor || an(this.lineColor), this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor, this.altSectionBkgColor = this.altSectionBkgColor || "white", this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor, this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor, this.excludeBkgColor = this.excludeBkgColor || "#eeeeee", this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor, this.taskBkgColor = this.taskBkgColor || this.primaryColor, this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor, this.activeTaskBkgColor = this.activeTaskBkgColor || Hn(this.primaryColor, 23), this.gridColor = this.gridColor || "lightgrey", this.doneTaskBkgColor = this.doneTaskBkgColor || "lightgrey", this.doneTaskBorderColor = this.doneTaskBorderColor || "grey", this.critBorderColor = this.critBorderColor || "#ff8888", this.critBkgColor = this.critBkgColor || "red", this.todayLineColor = this.todayLineColor || "red", this.vertLineColor = this.vertLineColor || "navy", this.taskTextColor = this.taskTextColor || this.textColor, this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor, this.taskTextLightColor = this.taskTextLightColor || this.textColor, this.taskTextColor = this.taskTextColor || this.primaryTextColor, this.taskTextDarkColor = this.taskTextDarkColor || this.textColor, this.taskTextClickableColor = this.taskTextClickableColor || "#003163", this.personBorder = this.personBorder || this.primaryBorderColor, this.personBkg = this.personBkg || this.mainBkg, this.darkMode ? (this.rowOdd = this.rowOdd || di(this.mainBkg, 5) || "#ffffff", this.rowEven = this.rowEven || di(this.mainBkg, 10)) : (this.rowOdd = this.rowOdd || Hn(this.mainBkg, 75) || "#ffffff", this.rowEven = this.rowEven || Hn(this.mainBkg, 5)), this.transitionColor = this.transitionColor || this.lineColor, this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || this.tertiaryColor, this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.compositeBorder = this.compositeBorder || this.nodeBorder, this.innerEndBackground = this.nodeBorder, this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.transitionColor = this.transitionColor || this.lineColor, this.specialStateColor = this.lineColor, this.cScale0 = this.cScale0 || this.primaryColor, this.cScale1 = this.cScale1 || this.secondaryColor, this.cScale2 = this.cScale2 || this.tertiaryColor, this.cScale3 = this.cScale3 || Ue(this.primaryColor, { h: 30 }), this.cScale4 = this.cScale4 || Ue(this.primaryColor, { h: 60 }), this.cScale5 = this.cScale5 || Ue(this.primaryColor, { h: 90 }), this.cScale6 = this.cScale6 || Ue(this.primaryColor, { h: 120 }), this.cScale7 = this.cScale7 || Ue(this.primaryColor, { h: 150 }), this.cScale8 = this.cScale8 || Ue(this.primaryColor, { h: 210, l: 150 }), this.cScale9 = this.cScale9 || Ue(this.primaryColor, { h: 270 }), this.cScale10 = this.cScale10 || Ue(this.primaryColor, { h: 300 }), this.cScale11 = this.cScale11 || Ue(this.primaryColor, { h: 330 }), this.darkMode)
      for (let R = 0; R < this.THEME_COLOR_LIMIT; R++)
        this["cScale" + R] = di(this["cScale" + R], 75);
    else
      for (let R = 0; R < this.THEME_COLOR_LIMIT; R++)
        this["cScale" + R] = di(this["cScale" + R], 25);
    for (let R = 0; R < this.THEME_COLOR_LIMIT; R++)
      this["cScaleInv" + R] = this["cScaleInv" + R] || an(this["cScale" + R]);
    for (let R = 0; R < this.THEME_COLOR_LIMIT; R++)
      this.darkMode ? this["cScalePeer" + R] = this["cScalePeer" + R] || Hn(this["cScale" + R], 10) : this["cScalePeer" + R] = this["cScalePeer" + R] || di(this["cScale" + R], 10);
    this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor;
    for (let R = 0; R < this.THEME_COLOR_LIMIT; R++)
      this["cScaleLabel" + R] = this["cScaleLabel" + R] || this.scaleLabelColor;
    const e = this.darkMode ? -4 : -1;
    for (let R = 0; R < 5; R++)
      this["surface" + R] = this["surface" + R] || Ue(this.mainBkg, { h: 180, s: -15, l: e * (5 + R * 3) }), this["surfacePeer" + R] = this["surfacePeer" + R] || Ue(this.mainBkg, { h: 180, s: -15, l: e * (8 + R * 3) });
    this.classText = this.classText || this.textColor, this.fillType0 = this.fillType0 || this.primaryColor, this.fillType1 = this.fillType1 || this.secondaryColor, this.fillType2 = this.fillType2 || Ue(this.primaryColor, { h: 64 }), this.fillType3 = this.fillType3 || Ue(this.secondaryColor, { h: 64 }), this.fillType4 = this.fillType4 || Ue(this.primaryColor, { h: -64 }), this.fillType5 = this.fillType5 || Ue(this.secondaryColor, { h: -64 }), this.fillType6 = this.fillType6 || Ue(this.primaryColor, { h: 128 }), this.fillType7 = this.fillType7 || Ue(this.secondaryColor, { h: 128 }), this.pie1 = this.pie1 || this.primaryColor, this.pie2 = this.pie2 || this.secondaryColor, this.pie3 = this.pie3 || this.tertiaryColor, this.pie4 = this.pie4 || Ue(this.primaryColor, { l: -10 }), this.pie5 = this.pie5 || Ue(this.secondaryColor, { l: -10 }), this.pie6 = this.pie6 || Ue(this.tertiaryColor, { l: -10 }), this.pie7 = this.pie7 || Ue(this.primaryColor, { h: 60, l: -10 }), this.pie8 = this.pie8 || Ue(this.primaryColor, { h: -60, l: -10 }), this.pie9 = this.pie9 || Ue(this.primaryColor, { h: 120, l: 0 }), this.pie10 = this.pie10 || Ue(this.primaryColor, { h: 60, l: -20 }), this.pie11 = this.pie11 || Ue(this.primaryColor, { h: -60, l: -20 }), this.pie12 = this.pie12 || Ue(this.primaryColor, { h: 120, l: -10 }), this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.radar = {
      axisColor: ((t = this.radar) == null ? void 0 : t.axisColor) || this.lineColor,
      axisStrokeWidth: ((n = this.radar) == null ? void 0 : n.axisStrokeWidth) || 2,
      axisLabelFontSize: ((r = this.radar) == null ? void 0 : r.axisLabelFontSize) || 12,
      curveOpacity: ((s = this.radar) == null ? void 0 : s.curveOpacity) || 0.5,
      curveStrokeWidth: ((o = this.radar) == null ? void 0 : o.curveStrokeWidth) || 2,
      graticuleColor: ((a = this.radar) == null ? void 0 : a.graticuleColor) || "#DEDEDE",
      graticuleStrokeWidth: ((l = this.radar) == null ? void 0 : l.graticuleStrokeWidth) || 1,
      graticuleOpacity: ((c = this.radar) == null ? void 0 : c.graticuleOpacity) || 0.3,
      legendBoxSize: ((u = this.radar) == null ? void 0 : u.legendBoxSize) || 12,
      legendFontSize: ((d = this.radar) == null ? void 0 : d.legendFontSize) || 12
    }, this.archEdgeColor = this.archEdgeColor || "#777", this.archEdgeArrowColor = this.archEdgeArrowColor || "#777", this.archEdgeWidth = this.archEdgeWidth || "3", this.archGroupBorderColor = this.archGroupBorderColor || "#000", this.archGroupBorderWidth = this.archGroupBorderWidth || "2px", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || Ue(this.primaryColor, { r: 5, g: 5, b: 5 }), this.quadrant3Fill = this.quadrant3Fill || Ue(this.primaryColor, { r: 10, g: 10, b: 10 }), this.quadrant4Fill = this.quadrant4Fill || Ue(this.primaryColor, { r: 15, g: 15, b: 15 }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || Ue(this.primaryTextColor, { r: -5, g: -5, b: -5 }), this.quadrant3TextFill = this.quadrant3TextFill || Ue(this.primaryTextColor, { r: -10, g: -10, b: -10 }), this.quadrant4TextFill = this.quadrant4TextFill || Ue(this.primaryTextColor, { r: -15, g: -15, b: -15 }), this.quadrantPointFill = this.quadrantPointFill || _6(this.quadrant1Fill) ? Hn(this.quadrant1Fill) : di(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.xyChart = {
      backgroundColor: ((h = this.xyChart) == null ? void 0 : h.backgroundColor) || this.background,
      titleColor: ((g = this.xyChart) == null ? void 0 : g.titleColor) || this.primaryTextColor,
      xAxisTitleColor: ((m = this.xyChart) == null ? void 0 : m.xAxisTitleColor) || this.primaryTextColor,
      xAxisLabelColor: ((_ = this.xyChart) == null ? void 0 : _.xAxisLabelColor) || this.primaryTextColor,
      xAxisTickColor: ((v = this.xyChart) == null ? void 0 : v.xAxisTickColor) || this.primaryTextColor,
      xAxisLineColor: ((w = this.xyChart) == null ? void 0 : w.xAxisLineColor) || this.primaryTextColor,
      yAxisTitleColor: ((E = this.xyChart) == null ? void 0 : E.yAxisTitleColor) || this.primaryTextColor,
      yAxisLabelColor: ((L = this.xyChart) == null ? void 0 : L.yAxisLabelColor) || this.primaryTextColor,
      yAxisTickColor: ((T = this.xyChart) == null ? void 0 : T.yAxisTickColor) || this.primaryTextColor,
      yAxisLineColor: ((D = this.xyChart) == null ? void 0 : D.yAxisLineColor) || this.primaryTextColor,
      plotColorPalette: ((N = this.xyChart) == null ? void 0 : N.plotColorPalette) || "#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"
    }, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? di(this.secondaryColor, 30) : this.secondaryColor), this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = this.git0 || this.primaryColor, this.git1 = this.git1 || this.secondaryColor, this.git2 = this.git2 || this.tertiaryColor, this.git3 = this.git3 || Ue(this.primaryColor, { h: -30 }), this.git4 = this.git4 || Ue(this.primaryColor, { h: -60 }), this.git5 = this.git5 || Ue(this.primaryColor, { h: -90 }), this.git6 = this.git6 || Ue(this.primaryColor, { h: 60 }), this.git7 = this.git7 || Ue(this.primaryColor, { h: 120 }), this.darkMode ? (this.git0 = Hn(this.git0, 25), this.git1 = Hn(this.git1, 25), this.git2 = Hn(this.git2, 25), this.git3 = Hn(this.git3, 25), this.git4 = Hn(this.git4, 25), this.git5 = Hn(this.git5, 25), this.git6 = Hn(this.git6, 25), this.git7 = Hn(this.git7, 25)) : (this.git0 = di(this.git0, 25), this.git1 = di(this.git1, 25), this.git2 = di(this.git2, 25), this.git3 = di(this.git3, 25), this.git4 = di(this.git4, 25), this.git5 = di(this.git5, 25), this.git6 = di(this.git6, 25), this.git7 = di(this.git7, 25)), this.gitInv0 = this.gitInv0 || an(this.git0), this.gitInv1 = this.gitInv1 || an(this.git1), this.gitInv2 = this.gitInv2 || an(this.git2), this.gitInv3 = this.gitInv3 || an(this.git3), this.gitInv4 = this.gitInv4 || an(this.git4), this.gitInv5 = this.gitInv5 || an(this.git5), this.gitInv6 = this.gitInv6 || an(this.git6), this.gitInv7 = this.gitInv7 || an(this.git7), this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor), this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor, this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor, this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor, this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor, this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor, this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor, this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor, this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || RY, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || AY;
  }
  calculate(e) {
    if (typeof e != "object") {
      this.updateColors();
      return;
    }
    const t = Object.keys(e);
    t.forEach((n) => {
      this[n] = e[n];
    }), this.updateColors(), t.forEach((n) => {
      this[n] = e[n];
    });
  }
}, $(PR, "Theme"), PR), D$t = /* @__PURE__ */ $((i) => {
  const e = new k$t();
  return e.calculate(i), e;
}, "getThemeVariables"), FR, I$t = (FR = class {
  constructor() {
    this.background = "#333", this.primaryColor = "#1f2020", this.secondaryColor = Hn(this.primaryColor, 16), this.tertiaryColor = Ue(this.primaryColor, { h: -160 }), this.primaryBorderColor = an(this.background), this.secondaryBorderColor = Pd(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = Pd(this.tertiaryColor, this.darkMode), this.primaryTextColor = an(this.primaryColor), this.secondaryTextColor = an(this.secondaryColor), this.tertiaryTextColor = an(this.tertiaryColor), this.lineColor = an(this.background), this.textColor = an(this.background), this.mainBkg = "#1f2020", this.secondBkg = "calculated", this.mainContrastColor = "lightgrey", this.darkTextColor = Hn(an("#323D47"), 10), this.lineColor = "calculated", this.border1 = "#ccc", this.border2 = E3(255, 255, 255, 0.25), this.arrowheadColor = "calculated", this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px", this.labelBackground = "#181818", this.textColor = "#ccc", this.THEME_COLOR_LIMIT = 12, this.nodeBkg = "calculated", this.nodeBorder = "calculated", this.clusterBkg = "calculated", this.clusterBorder = "calculated", this.defaultLinkColor = "calculated", this.titleColor = "#F9FFFE", this.edgeLabelBackground = "calculated", this.actorBorder = "calculated", this.actorBkg = "calculated", this.actorTextColor = "calculated", this.actorLineColor = "calculated", this.signalColor = "calculated", this.signalTextColor = "calculated", this.labelBoxBkgColor = "calculated", this.labelBoxBorderColor = "calculated", this.labelTextColor = "calculated", this.loopTextColor = "calculated", this.noteBorderColor = "calculated", this.noteBkgColor = "#fff5ad", this.noteTextColor = "calculated", this.activationBorderColor = "calculated", this.activationBkgColor = "calculated", this.sequenceNumberColor = "black", this.sectionBkgColor = di("#EAE8D9", 30), this.altSectionBkgColor = "calculated", this.sectionBkgColor2 = "#EAE8D9", this.excludeBkgColor = di(this.sectionBkgColor, 10), this.taskBorderColor = E3(255, 255, 255, 70), this.taskBkgColor = "calculated", this.taskTextColor = "calculated", this.taskTextLightColor = "calculated", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = E3(255, 255, 255, 50), this.activeTaskBkgColor = "#81B1DB", this.gridColor = "calculated", this.doneTaskBkgColor = "calculated", this.doneTaskBorderColor = "grey", this.critBorderColor = "#E83737", this.critBkgColor = "#E83737", this.taskTextDarkColor = "calculated", this.todayLineColor = "#DB5757", this.vertLineColor = "#00BFFF", this.personBorder = this.primaryBorderColor, this.personBkg = this.mainBkg, this.archEdgeColor = "calculated", this.archEdgeArrowColor = "calculated", this.archEdgeWidth = "3", this.archGroupBorderColor = this.primaryBorderColor, this.archGroupBorderWidth = "2px", this.rowOdd = this.rowOdd || Hn(this.mainBkg, 5) || "#ffffff", this.rowEven = this.rowEven || di(this.mainBkg, 10), this.labelColor = "calculated", this.errorBkgColor = "#a44141", this.errorTextColor = "#ddd";
  }
  updateColors() {
    var e, t, n, r, s, o, a, l, c, u, d, h, g, m, _, v, w, E, L, T, D;
    this.secondBkg = Hn(this.mainBkg, 16), this.lineColor = this.mainContrastColor, this.arrowheadColor = this.mainContrastColor, this.nodeBkg = this.mainBkg, this.nodeBorder = this.border1, this.clusterBkg = this.secondBkg, this.clusterBorder = this.border2, this.defaultLinkColor = this.lineColor, this.edgeLabelBackground = Hn(this.labelBackground, 25), this.actorBorder = this.border1, this.actorBkg = this.mainBkg, this.actorTextColor = this.mainContrastColor, this.actorLineColor = this.actorBorder, this.signalColor = this.mainContrastColor, this.signalTextColor = this.mainContrastColor, this.labelBoxBkgColor = this.actorBkg, this.labelBoxBorderColor = this.actorBorder, this.labelTextColor = this.mainContrastColor, this.loopTextColor = this.mainContrastColor, this.noteBorderColor = this.secondaryBorderColor, this.noteBkgColor = this.secondBkg, this.noteTextColor = this.secondaryTextColor, this.activationBorderColor = this.border1, this.activationBkgColor = this.secondBkg, this.altSectionBkgColor = this.background, this.taskBkgColor = Hn(this.mainBkg, 23), this.taskTextColor = this.darkTextColor, this.taskTextLightColor = this.mainContrastColor, this.taskTextOutsideColor = this.taskTextLightColor, this.gridColor = this.mainContrastColor, this.doneTaskBkgColor = this.mainContrastColor, this.taskTextDarkColor = this.darkTextColor, this.archEdgeColor = this.lineColor, this.archEdgeArrowColor = this.lineColor, this.transitionColor = this.transitionColor || this.lineColor, this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || "#555", this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.compositeBorder = this.compositeBorder || this.nodeBorder, this.innerEndBackground = this.primaryBorderColor, this.specialStateColor = "#f4f4f4", this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.fillType0 = this.primaryColor, this.fillType1 = this.secondaryColor, this.fillType2 = Ue(this.primaryColor, { h: 64 }), this.fillType3 = Ue(this.secondaryColor, { h: 64 }), this.fillType4 = Ue(this.primaryColor, { h: -64 }), this.fillType5 = Ue(this.secondaryColor, { h: -64 }), this.fillType6 = Ue(this.primaryColor, { h: 128 }), this.fillType7 = Ue(this.secondaryColor, { h: 128 }), this.cScale1 = this.cScale1 || "#0b0000", this.cScale2 = this.cScale2 || "#4d1037", this.cScale3 = this.cScale3 || "#3f5258", this.cScale4 = this.cScale4 || "#4f2f1b", this.cScale5 = this.cScale5 || "#6e0a0a", this.cScale6 = this.cScale6 || "#3b0048", this.cScale7 = this.cScale7 || "#995a01", this.cScale8 = this.cScale8 || "#154706", this.cScale9 = this.cScale9 || "#161722", this.cScale10 = this.cScale10 || "#00296f", this.cScale11 = this.cScale11 || "#01629c", this.cScale12 = this.cScale12 || "#010029", this.cScale0 = this.cScale0 || this.primaryColor, this.cScale1 = this.cScale1 || this.secondaryColor, this.cScale2 = this.cScale2 || this.tertiaryColor, this.cScale3 = this.cScale3 || Ue(this.primaryColor, { h: 30 }), this.cScale4 = this.cScale4 || Ue(this.primaryColor, { h: 60 }), this.cScale5 = this.cScale5 || Ue(this.primaryColor, { h: 90 }), this.cScale6 = this.cScale6 || Ue(this.primaryColor, { h: 120 }), this.cScale7 = this.cScale7 || Ue(this.primaryColor, { h: 150 }), this.cScale8 = this.cScale8 || Ue(this.primaryColor, { h: 210 }), this.cScale9 = this.cScale9 || Ue(this.primaryColor, { h: 270 }), this.cScale10 = this.cScale10 || Ue(this.primaryColor, { h: 300 }), this.cScale11 = this.cScale11 || Ue(this.primaryColor, { h: 330 });
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScaleInv" + N] = this["cScaleInv" + N] || an(this["cScale" + N]);
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScalePeer" + N] = this["cScalePeer" + N] || Hn(this["cScale" + N], 10);
    for (let N = 0; N < 5; N++)
      this["surface" + N] = this["surface" + N] || Ue(this.mainBkg, { h: 30, s: -30, l: -(-10 + N * 4) }), this["surfacePeer" + N] = this["surfacePeer" + N] || Ue(this.mainBkg, { h: 30, s: -30, l: -(-7 + N * 4) });
    this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor);
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScaleLabel" + N] = this["cScaleLabel" + N] || this.scaleLabelColor;
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["pie" + N] = this["cScale" + N];
    this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || Ue(this.primaryColor, { r: 5, g: 5, b: 5 }), this.quadrant3Fill = this.quadrant3Fill || Ue(this.primaryColor, { r: 10, g: 10, b: 10 }), this.quadrant4Fill = this.quadrant4Fill || Ue(this.primaryColor, { r: 15, g: 15, b: 15 }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || Ue(this.primaryTextColor, { r: -5, g: -5, b: -5 }), this.quadrant3TextFill = this.quadrant3TextFill || Ue(this.primaryTextColor, { r: -10, g: -10, b: -10 }), this.quadrant4TextFill = this.quadrant4TextFill || Ue(this.primaryTextColor, { r: -15, g: -15, b: -15 }), this.quadrantPointFill = this.quadrantPointFill || _6(this.quadrant1Fill) ? Hn(this.quadrant1Fill) : di(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.xyChart = {
      backgroundColor: ((e = this.xyChart) == null ? void 0 : e.backgroundColor) || this.background,
      titleColor: ((t = this.xyChart) == null ? void 0 : t.titleColor) || this.primaryTextColor,
      xAxisTitleColor: ((n = this.xyChart) == null ? void 0 : n.xAxisTitleColor) || this.primaryTextColor,
      xAxisLabelColor: ((r = this.xyChart) == null ? void 0 : r.xAxisLabelColor) || this.primaryTextColor,
      xAxisTickColor: ((s = this.xyChart) == null ? void 0 : s.xAxisTickColor) || this.primaryTextColor,
      xAxisLineColor: ((o = this.xyChart) == null ? void 0 : o.xAxisLineColor) || this.primaryTextColor,
      yAxisTitleColor: ((a = this.xyChart) == null ? void 0 : a.yAxisTitleColor) || this.primaryTextColor,
      yAxisLabelColor: ((l = this.xyChart) == null ? void 0 : l.yAxisLabelColor) || this.primaryTextColor,
      yAxisTickColor: ((c = this.xyChart) == null ? void 0 : c.yAxisTickColor) || this.primaryTextColor,
      yAxisLineColor: ((u = this.xyChart) == null ? void 0 : u.yAxisLineColor) || this.primaryTextColor,
      plotColorPalette: ((d = this.xyChart) == null ? void 0 : d.plotColorPalette) || "#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"
    }, this.packet = {
      startByteColor: this.primaryTextColor,
      endByteColor: this.primaryTextColor,
      labelColor: this.primaryTextColor,
      titleColor: this.primaryTextColor,
      blockStrokeColor: this.primaryTextColor,
      blockFillColor: this.background
    }, this.radar = {
      axisColor: ((h = this.radar) == null ? void 0 : h.axisColor) || this.lineColor,
      axisStrokeWidth: ((g = this.radar) == null ? void 0 : g.axisStrokeWidth) || 2,
      axisLabelFontSize: ((m = this.radar) == null ? void 0 : m.axisLabelFontSize) || 12,
      curveOpacity: ((_ = this.radar) == null ? void 0 : _.curveOpacity) || 0.5,
      curveStrokeWidth: ((v = this.radar) == null ? void 0 : v.curveStrokeWidth) || 2,
      graticuleColor: ((w = this.radar) == null ? void 0 : w.graticuleColor) || "#DEDEDE",
      graticuleStrokeWidth: ((E = this.radar) == null ? void 0 : E.graticuleStrokeWidth) || 1,
      graticuleOpacity: ((L = this.radar) == null ? void 0 : L.graticuleOpacity) || 0.3,
      legendBoxSize: ((T = this.radar) == null ? void 0 : T.legendBoxSize) || 12,
      legendFontSize: ((D = this.radar) == null ? void 0 : D.legendFontSize) || 12
    }, this.classText = this.primaryTextColor, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? di(this.secondaryColor, 30) : this.secondaryColor), this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = Hn(this.secondaryColor, 20), this.git1 = Hn(this.pie2 || this.secondaryColor, 20), this.git2 = Hn(this.pie3 || this.tertiaryColor, 20), this.git3 = Hn(this.pie4 || Ue(this.primaryColor, { h: -30 }), 20), this.git4 = Hn(this.pie5 || Ue(this.primaryColor, { h: -60 }), 20), this.git5 = Hn(this.pie6 || Ue(this.primaryColor, { h: -90 }), 10), this.git6 = Hn(this.pie7 || Ue(this.primaryColor, { h: 60 }), 10), this.git7 = Hn(this.pie8 || Ue(this.primaryColor, { h: 120 }), 20), this.gitInv0 = this.gitInv0 || an(this.git0), this.gitInv1 = this.gitInv1 || an(this.git1), this.gitInv2 = this.gitInv2 || an(this.git2), this.gitInv3 = this.gitInv3 || an(this.git3), this.gitInv4 = this.gitInv4 || an(this.git4), this.gitInv5 = this.gitInv5 || an(this.git5), this.gitInv6 = this.gitInv6 || an(this.git6), this.gitInv7 = this.gitInv7 || an(this.git7), this.gitBranchLabel0 = this.gitBranchLabel0 || an(this.labelTextColor), this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor, this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor, this.gitBranchLabel3 = this.gitBranchLabel3 || an(this.labelTextColor), this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor, this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor, this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor, this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || Hn(this.background, 12), this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || Hn(this.background, 2), this.nodeBorder = this.nodeBorder || "#999";
  }
  calculate(e) {
    if (typeof e != "object") {
      this.updateColors();
      return;
    }
    const t = Object.keys(e);
    t.forEach((n) => {
      this[n] = e[n];
    }), this.updateColors(), t.forEach((n) => {
      this[n] = e[n];
    });
  }
}, $(FR, "Theme"), FR), N$t = /* @__PURE__ */ $((i) => {
  const e = new I$t();
  return e.calculate(i), e;
}, "getThemeVariables"), BR, R$t = (BR = class {
  constructor() {
    this.background = "#f4f4f4", this.primaryColor = "#ECECFF", this.secondaryColor = Ue(this.primaryColor, { h: 120 }), this.secondaryColor = "#ffffde", this.tertiaryColor = Ue(this.primaryColor, { h: -160 }), this.primaryBorderColor = Pd(this.primaryColor, this.darkMode), this.secondaryBorderColor = Pd(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = Pd(this.tertiaryColor, this.darkMode), this.primaryTextColor = an(this.primaryColor), this.secondaryTextColor = an(this.secondaryColor), this.tertiaryTextColor = an(this.tertiaryColor), this.lineColor = an(this.background), this.textColor = an(this.background), this.background = "white", this.mainBkg = "#ECECFF", this.secondBkg = "#ffffde", this.lineColor = "#333333", this.border1 = "#9370DB", this.border2 = "#aaaa33", this.arrowheadColor = "#333333", this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px", this.labelBackground = "rgba(232,232,232, 0.8)", this.textColor = "#333", this.THEME_COLOR_LIMIT = 12, this.nodeBkg = "calculated", this.nodeBorder = "calculated", this.clusterBkg = "calculated", this.clusterBorder = "calculated", this.defaultLinkColor = "calculated", this.titleColor = "calculated", this.edgeLabelBackground = "calculated", this.actorBorder = "calculated", this.actorBkg = "calculated", this.actorTextColor = "black", this.actorLineColor = "calculated", this.signalColor = "calculated", this.signalTextColor = "calculated", this.labelBoxBkgColor = "calculated", this.labelBoxBorderColor = "calculated", this.labelTextColor = "calculated", this.loopTextColor = "calculated", this.noteBorderColor = "calculated", this.noteBkgColor = "#fff5ad", this.noteTextColor = "calculated", this.activationBorderColor = "#666", this.activationBkgColor = "#f4f4f4", this.sequenceNumberColor = "white", this.sectionBkgColor = "calculated", this.altSectionBkgColor = "calculated", this.sectionBkgColor2 = "calculated", this.excludeBkgColor = "#eeeeee", this.taskBorderColor = "calculated", this.taskBkgColor = "calculated", this.taskTextLightColor = "calculated", this.taskTextColor = this.taskTextLightColor, this.taskTextDarkColor = "calculated", this.taskTextOutsideColor = this.taskTextDarkColor, this.taskTextClickableColor = "calculated", this.activeTaskBorderColor = "calculated", this.activeTaskBkgColor = "calculated", this.gridColor = "calculated", this.doneTaskBkgColor = "calculated", this.doneTaskBorderColor = "calculated", this.critBorderColor = "calculated", this.critBkgColor = "calculated", this.todayLineColor = "calculated", this.vertLineColor = "calculated", this.sectionBkgColor = E3(102, 102, 255, 0.49), this.altSectionBkgColor = "white", this.sectionBkgColor2 = "#fff400", this.taskBorderColor = "#534fbc", this.taskBkgColor = "#8a90dd", this.taskTextLightColor = "white", this.taskTextColor = "calculated", this.taskTextDarkColor = "black", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = "#534fbc", this.activeTaskBkgColor = "#bfc7ff", this.gridColor = "lightgrey", this.doneTaskBkgColor = "lightgrey", this.doneTaskBorderColor = "grey", this.critBorderColor = "#ff8888", this.critBkgColor = "red", this.todayLineColor = "red", this.vertLineColor = "navy", this.personBorder = this.primaryBorderColor, this.personBkg = this.mainBkg, this.archEdgeColor = "calculated", this.archEdgeArrowColor = "calculated", this.archEdgeWidth = "3", this.archGroupBorderColor = this.primaryBorderColor, this.archGroupBorderWidth = "2px", this.rowOdd = "calculated", this.rowEven = "calculated", this.labelColor = "black", this.errorBkgColor = "#552222", this.errorTextColor = "#552222", this.updateColors();
  }
  updateColors() {
    var e, t, n, r, s, o, a, l, c, u, d, h, g, m, _, v, w, E, L, T, D;
    this.cScale0 = this.cScale0 || this.primaryColor, this.cScale1 = this.cScale1 || this.secondaryColor, this.cScale2 = this.cScale2 || this.tertiaryColor, this.cScale3 = this.cScale3 || Ue(this.primaryColor, { h: 30 }), this.cScale4 = this.cScale4 || Ue(this.primaryColor, { h: 60 }), this.cScale5 = this.cScale5 || Ue(this.primaryColor, { h: 90 }), this.cScale6 = this.cScale6 || Ue(this.primaryColor, { h: 120 }), this.cScale7 = this.cScale7 || Ue(this.primaryColor, { h: 150 }), this.cScale8 = this.cScale8 || Ue(this.primaryColor, { h: 210 }), this.cScale9 = this.cScale9 || Ue(this.primaryColor, { h: 270 }), this.cScale10 = this.cScale10 || Ue(this.primaryColor, { h: 300 }), this.cScale11 = this.cScale11 || Ue(this.primaryColor, { h: 330 }), this.cScalePeer1 = this.cScalePeer1 || di(this.secondaryColor, 45), this.cScalePeer2 = this.cScalePeer2 || di(this.tertiaryColor, 40);
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScale" + N] = di(this["cScale" + N], 10), this["cScalePeer" + N] = this["cScalePeer" + N] || di(this["cScale" + N], 25);
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScaleInv" + N] = this["cScaleInv" + N] || Ue(this["cScale" + N], { h: 180 });
    for (let N = 0; N < 5; N++)
      this["surface" + N] = this["surface" + N] || Ue(this.mainBkg, { h: 30, l: -(5 + N * 5) }), this["surfacePeer" + N] = this["surfacePeer" + N] || Ue(this.mainBkg, { h: 30, l: -(7 + N * 5) });
    if (this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor, this.labelTextColor !== "calculated") {
      this.cScaleLabel0 = this.cScaleLabel0 || an(this.labelTextColor), this.cScaleLabel3 = this.cScaleLabel3 || an(this.labelTextColor);
      for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
        this["cScaleLabel" + N] = this["cScaleLabel" + N] || this.labelTextColor;
    }
    this.nodeBkg = this.mainBkg, this.nodeBorder = this.border1, this.clusterBkg = this.secondBkg, this.clusterBorder = this.border2, this.defaultLinkColor = this.lineColor, this.titleColor = this.textColor, this.edgeLabelBackground = this.labelBackground, this.actorBorder = Hn(this.border1, 23), this.actorBkg = this.mainBkg, this.labelBoxBkgColor = this.actorBkg, this.signalColor = this.textColor, this.signalTextColor = this.textColor, this.labelBoxBorderColor = this.actorBorder, this.labelTextColor = this.actorTextColor, this.loopTextColor = this.actorTextColor, this.noteBorderColor = this.border2, this.noteTextColor = this.actorTextColor, this.actorLineColor = this.actorBorder, this.taskTextColor = this.taskTextLightColor, this.taskTextOutsideColor = this.taskTextDarkColor, this.archEdgeColor = this.lineColor, this.archEdgeArrowColor = this.lineColor, this.rowOdd = this.rowOdd || Hn(this.primaryColor, 75) || "#ffffff", this.rowEven = this.rowEven || Hn(this.primaryColor, 1), this.transitionColor = this.transitionColor || this.lineColor, this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || "#f0f0f0", this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.compositeBorder = this.compositeBorder || this.nodeBorder, this.innerEndBackground = this.nodeBorder, this.specialStateColor = this.lineColor, this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.transitionColor = this.transitionColor || this.lineColor, this.classText = this.primaryTextColor, this.fillType0 = this.primaryColor, this.fillType1 = this.secondaryColor, this.fillType2 = Ue(this.primaryColor, { h: 64 }), this.fillType3 = Ue(this.secondaryColor, { h: 64 }), this.fillType4 = Ue(this.primaryColor, { h: -64 }), this.fillType5 = Ue(this.secondaryColor, { h: -64 }), this.fillType6 = Ue(this.primaryColor, { h: 128 }), this.fillType7 = Ue(this.secondaryColor, { h: 128 }), this.pie1 = this.pie1 || this.primaryColor, this.pie2 = this.pie2 || this.secondaryColor, this.pie3 = this.pie3 || Ue(this.tertiaryColor, { l: -40 }), this.pie4 = this.pie4 || Ue(this.primaryColor, { l: -10 }), this.pie5 = this.pie5 || Ue(this.secondaryColor, { l: -30 }), this.pie6 = this.pie6 || Ue(this.tertiaryColor, { l: -20 }), this.pie7 = this.pie7 || Ue(this.primaryColor, { h: 60, l: -20 }), this.pie8 = this.pie8 || Ue(this.primaryColor, { h: -60, l: -40 }), this.pie9 = this.pie9 || Ue(this.primaryColor, { h: 120, l: -40 }), this.pie10 = this.pie10 || Ue(this.primaryColor, { h: 60, l: -40 }), this.pie11 = this.pie11 || Ue(this.primaryColor, { h: -90, l: -40 }), this.pie12 = this.pie12 || Ue(this.primaryColor, { h: 120, l: -30 }), this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || Ue(this.primaryColor, { r: 5, g: 5, b: 5 }), this.quadrant3Fill = this.quadrant3Fill || Ue(this.primaryColor, { r: 10, g: 10, b: 10 }), this.quadrant4Fill = this.quadrant4Fill || Ue(this.primaryColor, { r: 15, g: 15, b: 15 }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || Ue(this.primaryTextColor, { r: -5, g: -5, b: -5 }), this.quadrant3TextFill = this.quadrant3TextFill || Ue(this.primaryTextColor, { r: -10, g: -10, b: -10 }), this.quadrant4TextFill = this.quadrant4TextFill || Ue(this.primaryTextColor, { r: -15, g: -15, b: -15 }), this.quadrantPointFill = this.quadrantPointFill || _6(this.quadrant1Fill) ? Hn(this.quadrant1Fill) : di(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.radar = {
      axisColor: ((e = this.radar) == null ? void 0 : e.axisColor) || this.lineColor,
      axisStrokeWidth: ((t = this.radar) == null ? void 0 : t.axisStrokeWidth) || 2,
      axisLabelFontSize: ((n = this.radar) == null ? void 0 : n.axisLabelFontSize) || 12,
      curveOpacity: ((r = this.radar) == null ? void 0 : r.curveOpacity) || 0.5,
      curveStrokeWidth: ((s = this.radar) == null ? void 0 : s.curveStrokeWidth) || 2,
      graticuleColor: ((o = this.radar) == null ? void 0 : o.graticuleColor) || "#DEDEDE",
      graticuleStrokeWidth: ((a = this.radar) == null ? void 0 : a.graticuleStrokeWidth) || 1,
      graticuleOpacity: ((l = this.radar) == null ? void 0 : l.graticuleOpacity) || 0.3,
      legendBoxSize: ((c = this.radar) == null ? void 0 : c.legendBoxSize) || 12,
      legendFontSize: ((u = this.radar) == null ? void 0 : u.legendFontSize) || 12
    }, this.xyChart = {
      backgroundColor: ((d = this.xyChart) == null ? void 0 : d.backgroundColor) || this.background,
      titleColor: ((h = this.xyChart) == null ? void 0 : h.titleColor) || this.primaryTextColor,
      xAxisTitleColor: ((g = this.xyChart) == null ? void 0 : g.xAxisTitleColor) || this.primaryTextColor,
      xAxisLabelColor: ((m = this.xyChart) == null ? void 0 : m.xAxisLabelColor) || this.primaryTextColor,
      xAxisTickColor: ((_ = this.xyChart) == null ? void 0 : _.xAxisTickColor) || this.primaryTextColor,
      xAxisLineColor: ((v = this.xyChart) == null ? void 0 : v.xAxisLineColor) || this.primaryTextColor,
      yAxisTitleColor: ((w = this.xyChart) == null ? void 0 : w.yAxisTitleColor) || this.primaryTextColor,
      yAxisLabelColor: ((E = this.xyChart) == null ? void 0 : E.yAxisLabelColor) || this.primaryTextColor,
      yAxisTickColor: ((L = this.xyChart) == null ? void 0 : L.yAxisTickColor) || this.primaryTextColor,
      yAxisLineColor: ((T = this.xyChart) == null ? void 0 : T.yAxisLineColor) || this.primaryTextColor,
      plotColorPalette: ((D = this.xyChart) == null ? void 0 : D.plotColorPalette) || "#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"
    }, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || this.labelBackground, this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = this.git0 || this.primaryColor, this.git1 = this.git1 || this.secondaryColor, this.git2 = this.git2 || this.tertiaryColor, this.git3 = this.git3 || Ue(this.primaryColor, { h: -30 }), this.git4 = this.git4 || Ue(this.primaryColor, { h: -60 }), this.git5 = this.git5 || Ue(this.primaryColor, { h: -90 }), this.git6 = this.git6 || Ue(this.primaryColor, { h: 60 }), this.git7 = this.git7 || Ue(this.primaryColor, { h: 120 }), this.darkMode ? (this.git0 = Hn(this.git0, 25), this.git1 = Hn(this.git1, 25), this.git2 = Hn(this.git2, 25), this.git3 = Hn(this.git3, 25), this.git4 = Hn(this.git4, 25), this.git5 = Hn(this.git5, 25), this.git6 = Hn(this.git6, 25), this.git7 = Hn(this.git7, 25)) : (this.git0 = di(this.git0, 25), this.git1 = di(this.git1, 25), this.git2 = di(this.git2, 25), this.git3 = di(this.git3, 25), this.git4 = di(this.git4, 25), this.git5 = di(this.git5, 25), this.git6 = di(this.git6, 25), this.git7 = di(this.git7, 25)), this.gitInv0 = this.gitInv0 || di(an(this.git0), 25), this.gitInv1 = this.gitInv1 || an(this.git1), this.gitInv2 = this.gitInv2 || an(this.git2), this.gitInv3 = this.gitInv3 || an(this.git3), this.gitInv4 = this.gitInv4 || an(this.git4), this.gitInv5 = this.gitInv5 || an(this.git5), this.gitInv6 = this.gitInv6 || an(this.git6), this.gitInv7 = this.gitInv7 || an(this.git7), this.gitBranchLabel0 = this.gitBranchLabel0 || an(this.labelTextColor), this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor, this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor, this.gitBranchLabel3 = this.gitBranchLabel3 || an(this.labelTextColor), this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor, this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor, this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor, this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || RY, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || AY;
  }
  calculate(e) {
    if (Object.keys(this).forEach((n) => {
      this[n] === "calculated" && (this[n] = void 0);
    }), typeof e != "object") {
      this.updateColors();
      return;
    }
    const t = Object.keys(e);
    t.forEach((n) => {
      this[n] = e[n];
    }), this.updateColors(), t.forEach((n) => {
      this[n] = e[n];
    });
  }
}, $(BR, "Theme"), BR), A$t = /* @__PURE__ */ $((i) => {
  const e = new R$t();
  return e.calculate(i), e;
}, "getThemeVariables"), HR, O$t = (HR = class {
  constructor() {
    this.background = "#f4f4f4", this.primaryColor = "#cde498", this.secondaryColor = "#cdffb2", this.background = "white", this.mainBkg = "#cde498", this.secondBkg = "#cdffb2", this.lineColor = "green", this.border1 = "#13540c", this.border2 = "#6eaa49", this.arrowheadColor = "green", this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px", this.tertiaryColor = Hn("#cde498", 10), this.primaryBorderColor = Pd(this.primaryColor, this.darkMode), this.secondaryBorderColor = Pd(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = Pd(this.tertiaryColor, this.darkMode), this.primaryTextColor = an(this.primaryColor), this.secondaryTextColor = an(this.secondaryColor), this.tertiaryTextColor = an(this.primaryColor), this.lineColor = an(this.background), this.textColor = an(this.background), this.THEME_COLOR_LIMIT = 12, this.nodeBkg = "calculated", this.nodeBorder = "calculated", this.clusterBkg = "calculated", this.clusterBorder = "calculated", this.defaultLinkColor = "calculated", this.titleColor = "#333", this.edgeLabelBackground = "#e8e8e8", this.actorBorder = "calculated", this.actorBkg = "calculated", this.actorTextColor = "black", this.actorLineColor = "calculated", this.signalColor = "#333", this.signalTextColor = "#333", this.labelBoxBkgColor = "calculated", this.labelBoxBorderColor = "#326932", this.labelTextColor = "calculated", this.loopTextColor = "calculated", this.noteBorderColor = "calculated", this.noteBkgColor = "#fff5ad", this.noteTextColor = "calculated", this.activationBorderColor = "#666", this.activationBkgColor = "#f4f4f4", this.sequenceNumberColor = "white", this.sectionBkgColor = "#6eaa49", this.altSectionBkgColor = "white", this.sectionBkgColor2 = "#6eaa49", this.excludeBkgColor = "#eeeeee", this.taskBorderColor = "calculated", this.taskBkgColor = "#487e3a", this.taskTextLightColor = "white", this.taskTextColor = "calculated", this.taskTextDarkColor = "black", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = "calculated", this.activeTaskBkgColor = "calculated", this.gridColor = "lightgrey", this.doneTaskBkgColor = "lightgrey", this.doneTaskBorderColor = "grey", this.critBorderColor = "#ff8888", this.critBkgColor = "red", this.todayLineColor = "red", this.vertLineColor = "#00BFFF", this.personBorder = this.primaryBorderColor, this.personBkg = this.mainBkg, this.archEdgeColor = "calculated", this.archEdgeArrowColor = "calculated", this.archEdgeWidth = "3", this.archGroupBorderColor = this.primaryBorderColor, this.archGroupBorderWidth = "2px", this.labelColor = "black", this.errorBkgColor = "#552222", this.errorTextColor = "#552222";
  }
  updateColors() {
    var e, t, n, r, s, o, a, l, c, u, d, h, g, m, _, v, w, E, L, T, D;
    this.actorBorder = di(this.mainBkg, 20), this.actorBkg = this.mainBkg, this.labelBoxBkgColor = this.actorBkg, this.labelTextColor = this.actorTextColor, this.loopTextColor = this.actorTextColor, this.noteBorderColor = this.border2, this.noteTextColor = this.actorTextColor, this.actorLineColor = this.actorBorder, this.cScale0 = this.cScale0 || this.primaryColor, this.cScale1 = this.cScale1 || this.secondaryColor, this.cScale2 = this.cScale2 || this.tertiaryColor, this.cScale3 = this.cScale3 || Ue(this.primaryColor, { h: 30 }), this.cScale4 = this.cScale4 || Ue(this.primaryColor, { h: 60 }), this.cScale5 = this.cScale5 || Ue(this.primaryColor, { h: 90 }), this.cScale6 = this.cScale6 || Ue(this.primaryColor, { h: 120 }), this.cScale7 = this.cScale7 || Ue(this.primaryColor, { h: 150 }), this.cScale8 = this.cScale8 || Ue(this.primaryColor, { h: 210 }), this.cScale9 = this.cScale9 || Ue(this.primaryColor, { h: 270 }), this.cScale10 = this.cScale10 || Ue(this.primaryColor, { h: 300 }), this.cScale11 = this.cScale11 || Ue(this.primaryColor, { h: 330 }), this.cScalePeer1 = this.cScalePeer1 || di(this.secondaryColor, 45), this.cScalePeer2 = this.cScalePeer2 || di(this.tertiaryColor, 40);
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScale" + N] = di(this["cScale" + N], 10), this["cScalePeer" + N] = this["cScalePeer" + N] || di(this["cScale" + N], 25);
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScaleInv" + N] = this["cScaleInv" + N] || Ue(this["cScale" + N], { h: 180 });
    this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor;
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScaleLabel" + N] = this["cScaleLabel" + N] || this.scaleLabelColor;
    for (let N = 0; N < 5; N++)
      this["surface" + N] = this["surface" + N] || Ue(this.mainBkg, { h: 30, s: -30, l: -(5 + N * 5) }), this["surfacePeer" + N] = this["surfacePeer" + N] || Ue(this.mainBkg, { h: 30, s: -30, l: -(8 + N * 5) });
    this.nodeBkg = this.mainBkg, this.nodeBorder = this.border1, this.clusterBkg = this.secondBkg, this.clusterBorder = this.border2, this.defaultLinkColor = this.lineColor, this.taskBorderColor = this.border1, this.taskTextColor = this.taskTextLightColor, this.taskTextOutsideColor = this.taskTextDarkColor, this.activeTaskBorderColor = this.taskBorderColor, this.activeTaskBkgColor = this.mainBkg, this.archEdgeColor = this.lineColor, this.archEdgeArrowColor = this.lineColor, this.rowOdd = this.rowOdd || Hn(this.mainBkg, 75) || "#ffffff", this.rowEven = this.rowEven || Hn(this.mainBkg, 20), this.transitionColor = this.transitionColor || this.lineColor, this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || "#f0f0f0", this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.compositeBorder = this.compositeBorder || this.nodeBorder, this.innerEndBackground = this.primaryBorderColor, this.specialStateColor = this.lineColor, this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.transitionColor = this.transitionColor || this.lineColor, this.classText = this.primaryTextColor, this.fillType0 = this.primaryColor, this.fillType1 = this.secondaryColor, this.fillType2 = Ue(this.primaryColor, { h: 64 }), this.fillType3 = Ue(this.secondaryColor, { h: 64 }), this.fillType4 = Ue(this.primaryColor, { h: -64 }), this.fillType5 = Ue(this.secondaryColor, { h: -64 }), this.fillType6 = Ue(this.primaryColor, { h: 128 }), this.fillType7 = Ue(this.secondaryColor, { h: 128 }), this.pie1 = this.pie1 || this.primaryColor, this.pie2 = this.pie2 || this.secondaryColor, this.pie3 = this.pie3 || this.tertiaryColor, this.pie4 = this.pie4 || Ue(this.primaryColor, { l: -30 }), this.pie5 = this.pie5 || Ue(this.secondaryColor, { l: -30 }), this.pie6 = this.pie6 || Ue(this.tertiaryColor, { h: 40, l: -40 }), this.pie7 = this.pie7 || Ue(this.primaryColor, { h: 60, l: -10 }), this.pie8 = this.pie8 || Ue(this.primaryColor, { h: -60, l: -10 }), this.pie9 = this.pie9 || Ue(this.primaryColor, { h: 120, l: 0 }), this.pie10 = this.pie10 || Ue(this.primaryColor, { h: 60, l: -50 }), this.pie11 = this.pie11 || Ue(this.primaryColor, { h: -60, l: -50 }), this.pie12 = this.pie12 || Ue(this.primaryColor, { h: 120, l: -50 }), this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || Ue(this.primaryColor, { r: 5, g: 5, b: 5 }), this.quadrant3Fill = this.quadrant3Fill || Ue(this.primaryColor, { r: 10, g: 10, b: 10 }), this.quadrant4Fill = this.quadrant4Fill || Ue(this.primaryColor, { r: 15, g: 15, b: 15 }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || Ue(this.primaryTextColor, { r: -5, g: -5, b: -5 }), this.quadrant3TextFill = this.quadrant3TextFill || Ue(this.primaryTextColor, { r: -10, g: -10, b: -10 }), this.quadrant4TextFill = this.quadrant4TextFill || Ue(this.primaryTextColor, { r: -15, g: -15, b: -15 }), this.quadrantPointFill = this.quadrantPointFill || _6(this.quadrant1Fill) ? Hn(this.quadrant1Fill) : di(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.packet = {
      startByteColor: this.primaryTextColor,
      endByteColor: this.primaryTextColor,
      labelColor: this.primaryTextColor,
      titleColor: this.primaryTextColor,
      blockStrokeColor: this.primaryTextColor,
      blockFillColor: this.mainBkg
    }, this.radar = {
      axisColor: ((e = this.radar) == null ? void 0 : e.axisColor) || this.lineColor,
      axisStrokeWidth: ((t = this.radar) == null ? void 0 : t.axisStrokeWidth) || 2,
      axisLabelFontSize: ((n = this.radar) == null ? void 0 : n.axisLabelFontSize) || 12,
      curveOpacity: ((r = this.radar) == null ? void 0 : r.curveOpacity) || 0.5,
      curveStrokeWidth: ((s = this.radar) == null ? void 0 : s.curveStrokeWidth) || 2,
      graticuleColor: ((o = this.radar) == null ? void 0 : o.graticuleColor) || "#DEDEDE",
      graticuleStrokeWidth: ((a = this.radar) == null ? void 0 : a.graticuleStrokeWidth) || 1,
      graticuleOpacity: ((l = this.radar) == null ? void 0 : l.graticuleOpacity) || 0.3,
      legendBoxSize: ((c = this.radar) == null ? void 0 : c.legendBoxSize) || 12,
      legendFontSize: ((u = this.radar) == null ? void 0 : u.legendFontSize) || 12
    }, this.xyChart = {
      backgroundColor: ((d = this.xyChart) == null ? void 0 : d.backgroundColor) || this.background,
      titleColor: ((h = this.xyChart) == null ? void 0 : h.titleColor) || this.primaryTextColor,
      xAxisTitleColor: ((g = this.xyChart) == null ? void 0 : g.xAxisTitleColor) || this.primaryTextColor,
      xAxisLabelColor: ((m = this.xyChart) == null ? void 0 : m.xAxisLabelColor) || this.primaryTextColor,
      xAxisTickColor: ((_ = this.xyChart) == null ? void 0 : _.xAxisTickColor) || this.primaryTextColor,
      xAxisLineColor: ((v = this.xyChart) == null ? void 0 : v.xAxisLineColor) || this.primaryTextColor,
      yAxisTitleColor: ((w = this.xyChart) == null ? void 0 : w.yAxisTitleColor) || this.primaryTextColor,
      yAxisLabelColor: ((E = this.xyChart) == null ? void 0 : E.yAxisLabelColor) || this.primaryTextColor,
      yAxisTickColor: ((L = this.xyChart) == null ? void 0 : L.yAxisTickColor) || this.primaryTextColor,
      yAxisLineColor: ((T = this.xyChart) == null ? void 0 : T.yAxisLineColor) || this.primaryTextColor,
      plotColorPalette: ((D = this.xyChart) == null ? void 0 : D.plotColorPalette) || "#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"
    }, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground, this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = this.git0 || this.primaryColor, this.git1 = this.git1 || this.secondaryColor, this.git2 = this.git2 || this.tertiaryColor, this.git3 = this.git3 || Ue(this.primaryColor, { h: -30 }), this.git4 = this.git4 || Ue(this.primaryColor, { h: -60 }), this.git5 = this.git5 || Ue(this.primaryColor, { h: -90 }), this.git6 = this.git6 || Ue(this.primaryColor, { h: 60 }), this.git7 = this.git7 || Ue(this.primaryColor, { h: 120 }), this.darkMode ? (this.git0 = Hn(this.git0, 25), this.git1 = Hn(this.git1, 25), this.git2 = Hn(this.git2, 25), this.git3 = Hn(this.git3, 25), this.git4 = Hn(this.git4, 25), this.git5 = Hn(this.git5, 25), this.git6 = Hn(this.git6, 25), this.git7 = Hn(this.git7, 25)) : (this.git0 = di(this.git0, 25), this.git1 = di(this.git1, 25), this.git2 = di(this.git2, 25), this.git3 = di(this.git3, 25), this.git4 = di(this.git4, 25), this.git5 = di(this.git5, 25), this.git6 = di(this.git6, 25), this.git7 = di(this.git7, 25)), this.gitInv0 = this.gitInv0 || an(this.git0), this.gitInv1 = this.gitInv1 || an(this.git1), this.gitInv2 = this.gitInv2 || an(this.git2), this.gitInv3 = this.gitInv3 || an(this.git3), this.gitInv4 = this.gitInv4 || an(this.git4), this.gitInv5 = this.gitInv5 || an(this.git5), this.gitInv6 = this.gitInv6 || an(this.git6), this.gitInv7 = this.gitInv7 || an(this.git7), this.gitBranchLabel0 = this.gitBranchLabel0 || an(this.labelTextColor), this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor, this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor, this.gitBranchLabel3 = this.gitBranchLabel3 || an(this.labelTextColor), this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor, this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor, this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor, this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || RY, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || AY;
  }
  calculate(e) {
    if (typeof e != "object") {
      this.updateColors();
      return;
    }
    const t = Object.keys(e);
    t.forEach((n) => {
      this[n] = e[n];
    }), this.updateColors(), t.forEach((n) => {
      this[n] = e[n];
    });
  }
}, $(HR, "Theme"), HR), M$t = /* @__PURE__ */ $((i) => {
  const e = new O$t();
  return e.calculate(i), e;
}, "getThemeVariables"), WR, P$t = (WR = class {
  constructor() {
    this.primaryColor = "#eee", this.contrast = "#707070", this.secondaryColor = Hn(this.contrast, 55), this.background = "#ffffff", this.tertiaryColor = Ue(this.primaryColor, { h: -160 }), this.primaryBorderColor = Pd(this.primaryColor, this.darkMode), this.secondaryBorderColor = Pd(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = Pd(this.tertiaryColor, this.darkMode), this.primaryTextColor = an(this.primaryColor), this.secondaryTextColor = an(this.secondaryColor), this.tertiaryTextColor = an(this.tertiaryColor), this.lineColor = an(this.background), this.textColor = an(this.background), this.mainBkg = "#eee", this.secondBkg = "calculated", this.lineColor = "#666", this.border1 = "#999", this.border2 = "calculated", this.note = "#ffa", this.text = "#333", this.critical = "#d42", this.done = "#bbb", this.arrowheadColor = "#333333", this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px", this.THEME_COLOR_LIMIT = 12, this.nodeBkg = "calculated", this.nodeBorder = "calculated", this.clusterBkg = "calculated", this.clusterBorder = "calculated", this.defaultLinkColor = "calculated", this.titleColor = "calculated", this.edgeLabelBackground = "white", this.actorBorder = "calculated", this.actorBkg = "calculated", this.actorTextColor = "calculated", this.actorLineColor = this.actorBorder, this.signalColor = "calculated", this.signalTextColor = "calculated", this.labelBoxBkgColor = "calculated", this.labelBoxBorderColor = "calculated", this.labelTextColor = "calculated", this.loopTextColor = "calculated", this.noteBorderColor = "calculated", this.noteBkgColor = "calculated", this.noteTextColor = "calculated", this.activationBorderColor = "#666", this.activationBkgColor = "#f4f4f4", this.sequenceNumberColor = "white", this.sectionBkgColor = "calculated", this.altSectionBkgColor = "white", this.sectionBkgColor2 = "calculated", this.excludeBkgColor = "#eeeeee", this.taskBorderColor = "calculated", this.taskBkgColor = "calculated", this.taskTextLightColor = "white", this.taskTextColor = "calculated", this.taskTextDarkColor = "calculated", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = "calculated", this.activeTaskBkgColor = "calculated", this.gridColor = "calculated", this.doneTaskBkgColor = "calculated", this.doneTaskBorderColor = "calculated", this.critBkgColor = "calculated", this.critBorderColor = "calculated", this.todayLineColor = "calculated", this.vertLineColor = "calculated", this.personBorder = this.primaryBorderColor, this.personBkg = this.mainBkg, this.archEdgeColor = "calculated", this.archEdgeArrowColor = "calculated", this.archEdgeWidth = "3", this.archGroupBorderColor = this.primaryBorderColor, this.archGroupBorderWidth = "2px", this.rowOdd = this.rowOdd || Hn(this.mainBkg, 75) || "#ffffff", this.rowEven = this.rowEven || "#f4f4f4", this.labelColor = "black", this.errorBkgColor = "#552222", this.errorTextColor = "#552222";
  }
  updateColors() {
    var e, t, n, r, s, o, a, l, c, u, d, h, g, m, _, v, w, E, L, T, D;
    this.secondBkg = Hn(this.contrast, 55), this.border2 = this.contrast, this.actorBorder = Hn(this.border1, 23), this.actorBkg = this.mainBkg, this.actorTextColor = this.text, this.actorLineColor = this.actorBorder, this.signalColor = this.text, this.signalTextColor = this.text, this.labelBoxBkgColor = this.actorBkg, this.labelBoxBorderColor = this.actorBorder, this.labelTextColor = this.text, this.loopTextColor = this.text, this.noteBorderColor = "#999", this.noteBkgColor = "#666", this.noteTextColor = "#fff", this.cScale0 = this.cScale0 || "#555", this.cScale1 = this.cScale1 || "#F4F4F4", this.cScale2 = this.cScale2 || "#555", this.cScale3 = this.cScale3 || "#BBB", this.cScale4 = this.cScale4 || "#777", this.cScale5 = this.cScale5 || "#999", this.cScale6 = this.cScale6 || "#DDD", this.cScale7 = this.cScale7 || "#FFF", this.cScale8 = this.cScale8 || "#DDD", this.cScale9 = this.cScale9 || "#BBB", this.cScale10 = this.cScale10 || "#999", this.cScale11 = this.cScale11 || "#777";
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScaleInv" + N] = this["cScaleInv" + N] || an(this["cScale" + N]);
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this.darkMode ? this["cScalePeer" + N] = this["cScalePeer" + N] || Hn(this["cScale" + N], 10) : this["cScalePeer" + N] = this["cScalePeer" + N] || di(this["cScale" + N], 10);
    this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor), this.cScaleLabel0 = this.cScaleLabel0 || this.cScale1, this.cScaleLabel2 = this.cScaleLabel2 || this.cScale1;
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["cScaleLabel" + N] = this["cScaleLabel" + N] || this.scaleLabelColor;
    for (let N = 0; N < 5; N++)
      this["surface" + N] = this["surface" + N] || Ue(this.mainBkg, { l: -(5 + N * 5) }), this["surfacePeer" + N] = this["surfacePeer" + N] || Ue(this.mainBkg, { l: -(8 + N * 5) });
    this.nodeBkg = this.mainBkg, this.nodeBorder = this.border1, this.clusterBkg = this.secondBkg, this.clusterBorder = this.border2, this.defaultLinkColor = this.lineColor, this.titleColor = this.text, this.sectionBkgColor = Hn(this.contrast, 30), this.sectionBkgColor2 = Hn(this.contrast, 30), this.taskBorderColor = di(this.contrast, 10), this.taskBkgColor = this.contrast, this.taskTextColor = this.taskTextLightColor, this.taskTextDarkColor = this.text, this.taskTextOutsideColor = this.taskTextDarkColor, this.activeTaskBorderColor = this.taskBorderColor, this.activeTaskBkgColor = this.mainBkg, this.gridColor = Hn(this.border1, 30), this.doneTaskBkgColor = this.done, this.doneTaskBorderColor = this.lineColor, this.critBkgColor = this.critical, this.critBorderColor = di(this.critBkgColor, 10), this.todayLineColor = this.critBkgColor, this.vertLineColor = this.critBkgColor, this.archEdgeColor = this.lineColor, this.archEdgeArrowColor = this.lineColor, this.transitionColor = this.transitionColor || "#000", this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || "#f4f4f4", this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.stateBorder = this.stateBorder || "#000", this.innerEndBackground = this.primaryBorderColor, this.specialStateColor = "#222", this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.classText = this.primaryTextColor, this.fillType0 = this.primaryColor, this.fillType1 = this.secondaryColor, this.fillType2 = Ue(this.primaryColor, { h: 64 }), this.fillType3 = Ue(this.secondaryColor, { h: 64 }), this.fillType4 = Ue(this.primaryColor, { h: -64 }), this.fillType5 = Ue(this.secondaryColor, { h: -64 }), this.fillType6 = Ue(this.primaryColor, { h: 128 }), this.fillType7 = Ue(this.secondaryColor, { h: 128 });
    for (let N = 0; N < this.THEME_COLOR_LIMIT; N++)
      this["pie" + N] = this["cScale" + N];
    this.pie12 = this.pie0, this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || Ue(this.primaryColor, { r: 5, g: 5, b: 5 }), this.quadrant3Fill = this.quadrant3Fill || Ue(this.primaryColor, { r: 10, g: 10, b: 10 }), this.quadrant4Fill = this.quadrant4Fill || Ue(this.primaryColor, { r: 15, g: 15, b: 15 }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || Ue(this.primaryTextColor, { r: -5, g: -5, b: -5 }), this.quadrant3TextFill = this.quadrant3TextFill || Ue(this.primaryTextColor, { r: -10, g: -10, b: -10 }), this.quadrant4TextFill = this.quadrant4TextFill || Ue(this.primaryTextColor, { r: -15, g: -15, b: -15 }), this.quadrantPointFill = this.quadrantPointFill || _6(this.quadrant1Fill) ? Hn(this.quadrant1Fill) : di(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.xyChart = {
      backgroundColor: ((e = this.xyChart) == null ? void 0 : e.backgroundColor) || this.background,
      titleColor: ((t = this.xyChart) == null ? void 0 : t.titleColor) || this.primaryTextColor,
      xAxisTitleColor: ((n = this.xyChart) == null ? void 0 : n.xAxisTitleColor) || this.primaryTextColor,
      xAxisLabelColor: ((r = this.xyChart) == null ? void 0 : r.xAxisLabelColor) || this.primaryTextColor,
      xAxisTickColor: ((s = this.xyChart) == null ? void 0 : s.xAxisTickColor) || this.primaryTextColor,
      xAxisLineColor: ((o = this.xyChart) == null ? void 0 : o.xAxisLineColor) || this.primaryTextColor,
      yAxisTitleColor: ((a = this.xyChart) == null ? void 0 : a.yAxisTitleColor) || this.primaryTextColor,
      yAxisLabelColor: ((l = this.xyChart) == null ? void 0 : l.yAxisLabelColor) || this.primaryTextColor,
      yAxisTickColor: ((c = this.xyChart) == null ? void 0 : c.yAxisTickColor) || this.primaryTextColor,
      yAxisLineColor: ((u = this.xyChart) == null ? void 0 : u.yAxisLineColor) || this.primaryTextColor,
      plotColorPalette: ((d = this.xyChart) == null ? void 0 : d.plotColorPalette) || "#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"
    }, this.radar = {
      axisColor: ((h = this.radar) == null ? void 0 : h.axisColor) || this.lineColor,
      axisStrokeWidth: ((g = this.radar) == null ? void 0 : g.axisStrokeWidth) || 2,
      axisLabelFontSize: ((m = this.radar) == null ? void 0 : m.axisLabelFontSize) || 12,
      curveOpacity: ((_ = this.radar) == null ? void 0 : _.curveOpacity) || 0.5,
      curveStrokeWidth: ((v = this.radar) == null ? void 0 : v.curveStrokeWidth) || 2,
      graticuleColor: ((w = this.radar) == null ? void 0 : w.graticuleColor) || "#DEDEDE",
      graticuleStrokeWidth: ((E = this.radar) == null ? void 0 : E.graticuleStrokeWidth) || 1,
      graticuleOpacity: ((L = this.radar) == null ? void 0 : L.graticuleOpacity) || 0.3,
      legendBoxSize: ((T = this.radar) == null ? void 0 : T.legendBoxSize) || 12,
      legendFontSize: ((D = this.radar) == null ? void 0 : D.legendFontSize) || 12
    }, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground, this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = di(this.pie1, 25) || this.primaryColor, this.git1 = this.pie2 || this.secondaryColor, this.git2 = this.pie3 || this.tertiaryColor, this.git3 = this.pie4 || Ue(this.primaryColor, { h: -30 }), this.git4 = this.pie5 || Ue(this.primaryColor, { h: -60 }), this.git5 = this.pie6 || Ue(this.primaryColor, { h: -90 }), this.git6 = this.pie7 || Ue(this.primaryColor, { h: 60 }), this.git7 = this.pie8 || Ue(this.primaryColor, { h: 120 }), this.gitInv0 = this.gitInv0 || an(this.git0), this.gitInv1 = this.gitInv1 || an(this.git1), this.gitInv2 = this.gitInv2 || an(this.git2), this.gitInv3 = this.gitInv3 || an(this.git3), this.gitInv4 = this.gitInv4 || an(this.git4), this.gitInv5 = this.gitInv5 || an(this.git5), this.gitInv6 = this.gitInv6 || an(this.git6), this.gitInv7 = this.gitInv7 || an(this.git7), this.branchLabelColor = this.branchLabelColor || this.labelTextColor, this.gitBranchLabel0 = this.branchLabelColor, this.gitBranchLabel1 = "white", this.gitBranchLabel2 = this.branchLabelColor, this.gitBranchLabel3 = "white", this.gitBranchLabel4 = this.branchLabelColor, this.gitBranchLabel5 = this.branchLabelColor, this.gitBranchLabel6 = this.branchLabelColor, this.gitBranchLabel7 = this.branchLabelColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || RY, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || AY;
  }
  calculate(e) {
    if (typeof e != "object") {
      this.updateColors();
      return;
    }
    const t = Object.keys(e);
    t.forEach((n) => {
      this[n] = e[n];
    }), this.updateColors(), t.forEach((n) => {
      this[n] = e[n];
    });
  }
}, $(WR, "Theme"), WR), F$t = /* @__PURE__ */ $((i) => {
  const e = new P$t();
  return e.calculate(i), e;
}, "getThemeVariables"), Vy = {
  base: {
    getThemeVariables: D$t
  },
  dark: {
    getThemeVariables: N$t
  },
  default: {
    getThemeVariables: A$t
  },
  forest: {
    getThemeVariables: M$t
  },
  neutral: {
    getThemeVariables: F$t
  }
}, b_ = {
  flowchart: {
    useMaxWidth: !0,
    titleTopMargin: 25,
    subGraphTitleMargin: {
      top: 0,
      bottom: 0
    },
    diagramPadding: 8,
    htmlLabels: !0,
    nodeSpacing: 50,
    rankSpacing: 50,
    curve: "basis",
    padding: 15,
    defaultRenderer: "dagre-wrapper",
    wrappingWidth: 200,
    inheritDir: !1
  },
  sequence: {
    useMaxWidth: !0,
    hideUnusedParticipants: !1,
    activationWidth: 10,
    diagramMarginX: 50,
    diagramMarginY: 10,
    actorMargin: 50,
    width: 150,
    height: 65,
    boxMargin: 10,
    boxTextMargin: 5,
    noteMargin: 10,
    messageMargin: 35,
    messageAlign: "center",
    mirrorActors: !0,
    forceMenus: !1,
    bottomMarginAdj: 1,
    rightAngles: !1,
    showSequenceNumbers: !1,
    actorFontSize: 14,
    actorFontFamily: '"Open Sans", sans-serif',
    actorFontWeight: 400,
    noteFontSize: 14,
    noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
    noteFontWeight: 400,
    noteAlign: "center",
    messageFontSize: 16,
    messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
    messageFontWeight: 400,
    wrap: !1,
    wrapPadding: 10,
    labelBoxWidth: 50,
    labelBoxHeight: 20
  },
  gantt: {
    useMaxWidth: !0,
    titleTopMargin: 25,
    barHeight: 20,
    barGap: 4,
    topPadding: 50,
    rightPadding: 75,
    leftPadding: 75,
    gridLineStartPadding: 35,
    fontSize: 11,
    sectionFontSize: 11,
    numberSectionStyles: 4,
    axisFormat: "%Y-%m-%d",
    topAxis: !1,
    displayMode: "",
    weekday: "sunday"
  },
  journey: {
    useMaxWidth: !0,
    diagramMarginX: 50,
    diagramMarginY: 10,
    leftMargin: 150,
    maxLabelWidth: 360,
    width: 150,
    height: 50,
    boxMargin: 10,
    boxTextMargin: 5,
    noteMargin: 10,
    messageMargin: 35,
    messageAlign: "center",
    bottomMarginAdj: 1,
    rightAngles: !1,
    taskFontSize: 14,
    taskFontFamily: '"Open Sans", sans-serif',
    taskMargin: 50,
    activationWidth: 10,
    textPlacement: "fo",
    actorColours: [
      "#8FBC8F",
      "#7CFC00",
      "#00FFFF",
      "#20B2AA",
      "#B0E0E6",
      "#FFFFE0"
    ],
    sectionFills: [
      "#191970",
      "#8B008B",
      "#4B0082",
      "#2F4F4F",
      "#800000",
      "#8B4513",
      "#00008B"
    ],
    sectionColours: [
      "#fff"
    ],
    titleColor: "",
    titleFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
    titleFontSize: "4ex"
  },
  class: {
    useMaxWidth: !0,
    titleTopMargin: 25,
    arrowMarkerAbsolute: !1,
    dividerMargin: 10,
    padding: 5,
    textHeight: 10,
    defaultRenderer: "dagre-wrapper",
    htmlLabels: !1,
    hideEmptyMembersBox: !1
  },
  state: {
    useMaxWidth: !0,
    titleTopMargin: 25,
    dividerMargin: 10,
    sizeUnit: 5,
    padding: 8,
    textHeight: 10,
    titleShift: -15,
    noteMargin: 10,
    forkWidth: 70,
    forkHeight: 7,
    miniPadding: 2,
    fontSizeFactor: 5.02,
    fontSize: 24,
    labelHeight: 16,
    edgeLengthFactor: "20",
    compositTitleSize: 35,
    radius: 5,
    defaultRenderer: "dagre-wrapper"
  },
  er: {
    useMaxWidth: !0,
    titleTopMargin: 25,
    diagramPadding: 20,
    layoutDirection: "TB",
    minEntityWidth: 100,
    minEntityHeight: 75,
    entityPadding: 15,
    nodeSpacing: 140,
    rankSpacing: 80,
    stroke: "gray",
    fill: "honeydew",
    fontSize: 12
  },
  pie: {
    useMaxWidth: !0,
    textPosition: 0.75
  },
  quadrantChart: {
    useMaxWidth: !0,
    chartWidth: 500,
    chartHeight: 500,
    titleFontSize: 20,
    titlePadding: 10,
    quadrantPadding: 5,
    xAxisLabelPadding: 5,
    yAxisLabelPadding: 5,
    xAxisLabelFontSize: 16,
    yAxisLabelFontSize: 16,
    quadrantLabelFontSize: 16,
    quadrantTextTopPadding: 5,
    pointTextPadding: 5,
    pointLabelFontSize: 12,
    pointRadius: 5,
    xAxisPosition: "top",
    yAxisPosition: "left",
    quadrantInternalBorderStrokeWidth: 1,
    quadrantExternalBorderStrokeWidth: 2
  },
  xyChart: {
    useMaxWidth: !0,
    width: 700,
    height: 500,
    titleFontSize: 20,
    titlePadding: 10,
    showDataLabel: !1,
    showTitle: !0,
    xAxis: {
      $ref: "#/$defs/XYChartAxisConfig",
      showLabel: !0,
      labelFontSize: 14,
      labelPadding: 5,
      showTitle: !0,
      titleFontSize: 16,
      titlePadding: 5,
      showTick: !0,
      tickLength: 5,
      tickWidth: 2,
      showAxisLine: !0,
      axisLineWidth: 2
    },
    yAxis: {
      $ref: "#/$defs/XYChartAxisConfig",
      showLabel: !0,
      labelFontSize: 14,
      labelPadding: 5,
      showTitle: !0,
      titleFontSize: 16,
      titlePadding: 5,
      showTick: !0,
      tickLength: 5,
      tickWidth: 2,
      showAxisLine: !0,
      axisLineWidth: 2
    },
    chartOrientation: "vertical",
    plotReservedSpacePercent: 50
  },
  requirement: {
    useMaxWidth: !0,
    rect_fill: "#f9f9f9",
    text_color: "#333",
    rect_border_size: "0.5px",
    rect_border_color: "#bbb",
    rect_min_width: 200,
    rect_min_height: 200,
    fontSize: 14,
    rect_padding: 10,
    line_height: 20
  },
  mindmap: {
    useMaxWidth: !0,
    padding: 10,
    maxNodeWidth: 200,
    layoutAlgorithm: "cose-bilkent"
  },
  kanban: {
    useMaxWidth: !0,
    padding: 8,
    sectionWidth: 200,
    ticketBaseUrl: ""
  },
  timeline: {
    useMaxWidth: !0,
    diagramMarginX: 50,
    diagramMarginY: 10,
    leftMargin: 150,
    width: 150,
    height: 50,
    boxMargin: 10,
    boxTextMargin: 5,
    noteMargin: 10,
    messageMargin: 35,
    messageAlign: "center",
    bottomMarginAdj: 1,
    rightAngles: !1,
    taskFontSize: 14,
    taskFontFamily: '"Open Sans", sans-serif',
    taskMargin: 50,
    activationWidth: 10,
    textPlacement: "fo",
    actorColours: [
      "#8FBC8F",
      "#7CFC00",
      "#00FFFF",
      "#20B2AA",
      "#B0E0E6",
      "#FFFFE0"
    ],
    sectionFills: [
      "#191970",
      "#8B008B",
      "#4B0082",
      "#2F4F4F",
      "#800000",
      "#8B4513",
      "#00008B"
    ],
    sectionColours: [
      "#fff"
    ],
    disableMulticolor: !1
  },
  gitGraph: {
    useMaxWidth: !0,
    titleTopMargin: 25,
    diagramPadding: 8,
    nodeLabel: {
      width: 75,
      height: 100,
      x: -25,
      y: 0
    },
    mainBranchName: "main",
    mainBranchOrder: 0,
    showCommitLabel: !0,
    showBranches: !0,
    rotateCommitLabel: !0,
    parallelCommits: !1,
    arrowMarkerAbsolute: !1
  },
  c4: {
    useMaxWidth: !0,
    diagramMarginX: 50,
    diagramMarginY: 10,
    c4ShapeMargin: 50,
    c4ShapePadding: 20,
    width: 216,
    height: 60,
    boxMargin: 10,
    c4ShapeInRow: 4,
    nextLinePaddingX: 0,
    c4BoundaryInRow: 2,
    personFontSize: 14,
    personFontFamily: '"Open Sans", sans-serif',
    personFontWeight: "normal",
    external_personFontSize: 14,
    external_personFontFamily: '"Open Sans", sans-serif',
    external_personFontWeight: "normal",
    systemFontSize: 14,
    systemFontFamily: '"Open Sans", sans-serif',
    systemFontWeight: "normal",
    external_systemFontSize: 14,
    external_systemFontFamily: '"Open Sans", sans-serif',
    external_systemFontWeight: "normal",
    system_dbFontSize: 14,
    system_dbFontFamily: '"Open Sans", sans-serif',
    system_dbFontWeight: "normal",
    external_system_dbFontSize: 14,
    external_system_dbFontFamily: '"Open Sans", sans-serif',
    external_system_dbFontWeight: "normal",
    system_queueFontSize: 14,
    system_queueFontFamily: '"Open Sans", sans-serif',
    system_queueFontWeight: "normal",
    external_system_queueFontSize: 14,
    external_system_queueFontFamily: '"Open Sans", sans-serif',
    external_system_queueFontWeight: "normal",
    boundaryFontSize: 14,
    boundaryFontFamily: '"Open Sans", sans-serif',
    boundaryFontWeight: "normal",
    messageFontSize: 12,
    messageFontFamily: '"Open Sans", sans-serif',
    messageFontWeight: "normal",
    containerFontSize: 14,
    containerFontFamily: '"Open Sans", sans-serif',
    containerFontWeight: "normal",
    external_containerFontSize: 14,
    external_containerFontFamily: '"Open Sans", sans-serif',
    external_containerFontWeight: "normal",
    container_dbFontSize: 14,
    container_dbFontFamily: '"Open Sans", sans-serif',
    container_dbFontWeight: "normal",
    external_container_dbFontSize: 14,
    external_container_dbFontFamily: '"Open Sans", sans-serif',
    external_container_dbFontWeight: "normal",
    container_queueFontSize: 14,
    container_queueFontFamily: '"Open Sans", sans-serif',
    container_queueFontWeight: "normal",
    external_container_queueFontSize: 14,
    external_container_queueFontFamily: '"Open Sans", sans-serif',
    external_container_queueFontWeight: "normal",
    componentFontSize: 14,
    componentFontFamily: '"Open Sans", sans-serif',
    componentFontWeight: "normal",
    external_componentFontSize: 14,
    external_componentFontFamily: '"Open Sans", sans-serif',
    external_componentFontWeight: "normal",
    component_dbFontSize: 14,
    component_dbFontFamily: '"Open Sans", sans-serif',
    component_dbFontWeight: "normal",
    external_component_dbFontSize: 14,
    external_component_dbFontFamily: '"Open Sans", sans-serif',
    external_component_dbFontWeight: "normal",
    component_queueFontSize: 14,
    component_queueFontFamily: '"Open Sans", sans-serif',
    component_queueFontWeight: "normal",
    external_component_queueFontSize: 14,
    external_component_queueFontFamily: '"Open Sans", sans-serif',
    external_component_queueFontWeight: "normal",
    wrap: !0,
    wrapPadding: 10,
    person_bg_color: "#08427B",
    person_border_color: "#073B6F",
    external_person_bg_color: "#686868",
    external_person_border_color: "#8A8A8A",
    system_bg_color: "#1168BD",
    system_border_color: "#3C7FC0",
    system_db_bg_color: "#1168BD",
    system_db_border_color: "#3C7FC0",
    system_queue_bg_color: "#1168BD",
    system_queue_border_color: "#3C7FC0",
    external_system_bg_color: "#999999",
    external_system_border_color: "#8A8A8A",
    external_system_db_bg_color: "#999999",
    external_system_db_border_color: "#8A8A8A",
    external_system_queue_bg_color: "#999999",
    external_system_queue_border_color: "#8A8A8A",
    container_bg_color: "#438DD5",
    container_border_color: "#3C7FC0",
    container_db_bg_color: "#438DD5",
    container_db_border_color: "#3C7FC0",
    container_queue_bg_color: "#438DD5",
    container_queue_border_color: "#3C7FC0",
    external_container_bg_color: "#B3B3B3",
    external_container_border_color: "#A6A6A6",
    external_container_db_bg_color: "#B3B3B3",
    external_container_db_border_color: "#A6A6A6",
    external_container_queue_bg_color: "#B3B3B3",
    external_container_queue_border_color: "#A6A6A6",
    component_bg_color: "#85BBF0",
    component_border_color: "#78A8D8",
    component_db_bg_color: "#85BBF0",
    component_db_border_color: "#78A8D8",
    component_queue_bg_color: "#85BBF0",
    component_queue_border_color: "#78A8D8",
    external_component_bg_color: "#CCCCCC",
    external_component_border_color: "#BFBFBF",
    external_component_db_bg_color: "#CCCCCC",
    external_component_db_border_color: "#BFBFBF",
    external_component_queue_bg_color: "#CCCCCC",
    external_component_queue_border_color: "#BFBFBF"
  },
  sankey: {
    useMaxWidth: !0,
    width: 600,
    height: 400,
    linkColor: "gradient",
    nodeAlignment: "justify",
    showValues: !0,
    prefix: "",
    suffix: ""
  },
  block: {
    useMaxWidth: !0,
    padding: 8
  },
  packet: {
    useMaxWidth: !0,
    rowHeight: 32,
    bitWidth: 32,
    bitsPerRow: 32,
    showBits: !0,
    paddingX: 5,
    paddingY: 5
  },
  architecture: {
    useMaxWidth: !0,
    padding: 40,
    iconSize: 80,
    fontSize: 16
  },
  radar: {
    useMaxWidth: !0,
    width: 600,
    height: 600,
    marginTop: 50,
    marginRight: 50,
    marginBottom: 50,
    marginLeft: 50,
    axisScaleFactor: 1,
    axisLabelFactor: 1.05,
    curveTension: 0.17
  },
  theme: "default",
  look: "classic",
  handDrawnSeed: 0,
  layout: "dagre",
  maxTextSize: 5e4,
  maxEdges: 500,
  darkMode: !1,
  fontFamily: '"trebuchet ms", verdana, arial, sans-serif;',
  logLevel: 5,
  securityLevel: "strict",
  startOnLoad: !0,
  arrowMarkerAbsolute: !1,
  secure: [
    "secure",
    "securityLevel",
    "startOnLoad",
    "maxTextSize",
    "suppressErrorRendering",
    "maxEdges"
  ],
  legacyMathML: !1,
  forceLegacyMathML: !1,
  deterministicIds: !1,
  fontSize: 16,
  markdownAutoWrap: !0,
  suppressErrorRendering: !1
}, FWe = {
  ...b_,
  // Set, even though they're `undefined` so that `configKeys` finds these keys
  // TODO: Should we replace these with `null` so that they can go in the JSON Schema?
  deterministicIDSeed: void 0,
  elk: {
    // mergeEdges is needed here to be considered
    mergeEdges: !1,
    nodePlacementStrategy: "BRANDES_KOEPF",
    forceNodeModelOrder: !1,
    considerModelOrder: "NODES_AND_EDGES"
  },
  themeCSS: void 0,
  // add non-JSON default config values
  themeVariables: Vy.default.getThemeVariables(),
  sequence: {
    ...b_.sequence,
    messageFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.messageFontFamily,
        fontSize: this.messageFontSize,
        fontWeight: this.messageFontWeight
      };
    }, "messageFont"),
    noteFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.noteFontFamily,
        fontSize: this.noteFontSize,
        fontWeight: this.noteFontWeight
      };
    }, "noteFont"),
    actorFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.actorFontFamily,
        fontSize: this.actorFontSize,
        fontWeight: this.actorFontWeight
      };
    }, "actorFont")
  },
  class: {
    hideEmptyMembersBox: !1
  },
  gantt: {
    ...b_.gantt,
    tickInterval: void 0,
    useWidth: void 0
    // can probably be removed since `configKeys` already includes this
  },
  c4: {
    ...b_.c4,
    useWidth: void 0,
    personFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.personFontFamily,
        fontSize: this.personFontSize,
        fontWeight: this.personFontWeight
      };
    }, "personFont"),
    flowchart: {
      ...b_.flowchart,
      inheritDir: !1
      // default to legacy behavior
    },
    external_personFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_personFontFamily,
        fontSize: this.external_personFontSize,
        fontWeight: this.external_personFontWeight
      };
    }, "external_personFont"),
    systemFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.systemFontFamily,
        fontSize: this.systemFontSize,
        fontWeight: this.systemFontWeight
      };
    }, "systemFont"),
    external_systemFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_systemFontFamily,
        fontSize: this.external_systemFontSize,
        fontWeight: this.external_systemFontWeight
      };
    }, "external_systemFont"),
    system_dbFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.system_dbFontFamily,
        fontSize: this.system_dbFontSize,
        fontWeight: this.system_dbFontWeight
      };
    }, "system_dbFont"),
    external_system_dbFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_system_dbFontFamily,
        fontSize: this.external_system_dbFontSize,
        fontWeight: this.external_system_dbFontWeight
      };
    }, "external_system_dbFont"),
    system_queueFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.system_queueFontFamily,
        fontSize: this.system_queueFontSize,
        fontWeight: this.system_queueFontWeight
      };
    }, "system_queueFont"),
    external_system_queueFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_system_queueFontFamily,
        fontSize: this.external_system_queueFontSize,
        fontWeight: this.external_system_queueFontWeight
      };
    }, "external_system_queueFont"),
    containerFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.containerFontFamily,
        fontSize: this.containerFontSize,
        fontWeight: this.containerFontWeight
      };
    }, "containerFont"),
    external_containerFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_containerFontFamily,
        fontSize: this.external_containerFontSize,
        fontWeight: this.external_containerFontWeight
      };
    }, "external_containerFont"),
    container_dbFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.container_dbFontFamily,
        fontSize: this.container_dbFontSize,
        fontWeight: this.container_dbFontWeight
      };
    }, "container_dbFont"),
    external_container_dbFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_container_dbFontFamily,
        fontSize: this.external_container_dbFontSize,
        fontWeight: this.external_container_dbFontWeight
      };
    }, "external_container_dbFont"),
    container_queueFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.container_queueFontFamily,
        fontSize: this.container_queueFontSize,
        fontWeight: this.container_queueFontWeight
      };
    }, "container_queueFont"),
    external_container_queueFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_container_queueFontFamily,
        fontSize: this.external_container_queueFontSize,
        fontWeight: this.external_container_queueFontWeight
      };
    }, "external_container_queueFont"),
    componentFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.componentFontFamily,
        fontSize: this.componentFontSize,
        fontWeight: this.componentFontWeight
      };
    }, "componentFont"),
    external_componentFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_componentFontFamily,
        fontSize: this.external_componentFontSize,
        fontWeight: this.external_componentFontWeight
      };
    }, "external_componentFont"),
    component_dbFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.component_dbFontFamily,
        fontSize: this.component_dbFontSize,
        fontWeight: this.component_dbFontWeight
      };
    }, "component_dbFont"),
    external_component_dbFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_component_dbFontFamily,
        fontSize: this.external_component_dbFontSize,
        fontWeight: this.external_component_dbFontWeight
      };
    }, "external_component_dbFont"),
    component_queueFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.component_queueFontFamily,
        fontSize: this.component_queueFontSize,
        fontWeight: this.component_queueFontWeight
      };
    }, "component_queueFont"),
    external_component_queueFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.external_component_queueFontFamily,
        fontSize: this.external_component_queueFontSize,
        fontWeight: this.external_component_queueFontWeight
      };
    }, "external_component_queueFont"),
    boundaryFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.boundaryFontFamily,
        fontSize: this.boundaryFontSize,
        fontWeight: this.boundaryFontWeight
      };
    }, "boundaryFont"),
    messageFont: /* @__PURE__ */ $(function() {
      return {
        fontFamily: this.messageFontFamily,
        fontSize: this.messageFontSize,
        fontWeight: this.messageFontWeight
      };
    }, "messageFont")
  },
  pie: {
    ...b_.pie,
    useWidth: 984
  },
  xyChart: {
    ...b_.xyChart,
    useWidth: void 0
  },
  requirement: {
    ...b_.requirement,
    useWidth: void 0
  },
  packet: {
    ...b_.packet
  },
  radar: {
    ...b_.radar
  },
  treemap: {
    useMaxWidth: !0,
    padding: 10,
    diagramPadding: 8,
    showValues: !0,
    nodeWidth: 100,
    nodeHeight: 40,
    borderWidth: 1,
    valueFontSize: 12,
    labelFontSize: 14,
    valueFormat: ","
  }
}, BWe = /* @__PURE__ */ $((i, e = "") => Object.keys(i).reduce((t, n) => Array.isArray(i[n]) ? t : typeof i[n] == "object" && i[n] !== null ? [...t, e + n, ...BWe(i[n], "")] : [...t, e + n], []), "keyify"), B$t = new Set(BWe(FWe, "")), HWe = FWe, j$ = /* @__PURE__ */ $((i) => {
  if (Ct.debug("sanitizeDirective called with", i), !(typeof i != "object" || i == null)) {
    if (Array.isArray(i)) {
      i.forEach((e) => j$(e));
      return;
    }
    for (const e of Object.keys(i)) {
      if (Ct.debug("Checking key", e), e.startsWith("__") || e.includes("proto") || e.includes("constr") || !B$t.has(e) || i[e] == null) {
        Ct.debug("sanitize deleting key: ", e), delete i[e];
        continue;
      }
      if (typeof i[e] == "object") {
        Ct.debug("sanitizing object", e), j$(i[e]);
        continue;
      }
      const t = ["themeCSS", "fontFamily", "altFontFamily"];
      for (const n of t)
        e.includes(n) && (Ct.debug("sanitizing css option", e), i[e] = H$t(i[e]));
    }
    if (i.themeVariables)
      for (const e of Object.keys(i.themeVariables)) {
        const t = i.themeVariables[e];
        t != null && t.match && !t.match(/^[\d "#%(),.;A-Za-z]+$/) && (i.themeVariables[e] = "");
      }
    Ct.debug("After sanitization", i);
  }
}, "sanitizeDirective"), H$t = /* @__PURE__ */ $((i) => {
  let e = 0, t = 0;
  for (const n of i) {
    if (e < t)
      return "{ /* ERROR: Unbalanced CSS */ }";
    n === "{" ? e++ : n === "}" && t++;
  }
  return e !== t ? "{ /* ERROR: Unbalanced CSS */ }" : i;
}, "sanitizeCss"), RA = Object.freeze(HWe), Rh = Xl({}, RA), G$, PT = [], L3 = Xl({}, RA), OY = /* @__PURE__ */ $((i, e) => {
  let t = Xl({}, i), n = {};
  for (const r of e)
    UWe(r), n = Xl(n, r);
  if (t = Xl(t, n), n.theme && n.theme in Vy) {
    const r = Xl({}, G$), s = Xl(
      r.themeVariables || {},
      n.themeVariables
    );
    t.theme && t.theme in Vy && (t.themeVariables = Vy[t.theme].getThemeVariables(s));
  }
  return L3 = t, zWe(L3), L3;
}, "updateCurrentConfig"), W$t = /* @__PURE__ */ $((i) => (Rh = Xl({}, RA), Rh = Xl(Rh, i), i.theme && Vy[i.theme] && (Rh.themeVariables = Vy[i.theme].getThemeVariables(i.themeVariables)), OY(Rh, PT), Rh), "setSiteConfig"), V$t = /* @__PURE__ */ $((i) => {
  G$ = Xl({}, i);
}, "saveConfigFromInitialize"), U$t = /* @__PURE__ */ $((i) => (Rh = Xl(Rh, i), OY(Rh, PT), Rh), "updateSiteConfig"), WWe = /* @__PURE__ */ $(() => Xl({}, Rh), "getSiteConfig"), VWe = /* @__PURE__ */ $((i) => (zWe(i), Xl(L3, i), Ku()), "setConfig"), Ku = /* @__PURE__ */ $(() => Xl({}, L3), "getConfig"), UWe = /* @__PURE__ */ $((i) => {
  i && (["secure", ...Rh.secure ?? []].forEach((e) => {
    Object.hasOwn(i, e) && (Ct.debug(`Denied attempt to modify a secure key ${e}`, i[e]), delete i[e]);
  }), Object.keys(i).forEach((e) => {
    e.startsWith("__") && delete i[e];
  }), Object.keys(i).forEach((e) => {
    typeof i[e] == "string" && (i[e].includes("<") || i[e].includes(">") || i[e].includes("url(data:")) && delete i[e], typeof i[e] == "object" && UWe(i[e]);
  }));
}, "sanitize"), z$t = /* @__PURE__ */ $((i) => {
  var e;
  j$(i), i.fontFamily && !((e = i.themeVariables) != null && e.fontFamily) && (i.themeVariables = {
    ...i.themeVariables,
    fontFamily: i.fontFamily
  }), PT.push(i), OY(Rh, PT);
}, "addDirective"), q$ = /* @__PURE__ */ $((i = Rh) => {
  PT = [], OY(i, PT);
}, "reset"), $$t = {
  LAZY_LOAD_DEPRECATED: "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."
}, T2e = {}, j$t = /* @__PURE__ */ $((i) => {
  T2e[i] || (Ct.warn($$t[i]), T2e[i] = !0);
}, "issueWarning"), zWe = /* @__PURE__ */ $((i) => {
  i && (i.lazyLoadedDiagrams || i.loadExternalDiagramsAtStartup) && j$t("LAZY_LOAD_DEPRECATED");
}, "checkConfig"), Jln = /* @__PURE__ */ $(() => {
  let i = {};
  G$ && (i = Xl(i, G$));
  for (const e of PT)
    i = Xl(i, e);
  return i;
}, "getUserDefinedConfig"), b6 = /<br\s*\/?>/gi, G$t = /* @__PURE__ */ $((i) => i ? GWe(i).replace(/\\n/g, "#br#").split("#br#") : [""], "getRows"), q$t = /* @__PURE__ */ (() => {
  let i = !1;
  return () => {
    i || ($We(), i = !0);
  };
})();
function $We() {
  const i = "data-temp-href-target";
  NA.addHook("beforeSanitizeAttributes", (e) => {
    e.tagName === "A" && e.hasAttribute("target") && e.setAttribute(i, e.getAttribute("target") ?? "");
  }), NA.addHook("afterSanitizeAttributes", (e) => {
    e.tagName === "A" && e.hasAttribute(i) && (e.setAttribute("target", e.getAttribute(i) ?? ""), e.removeAttribute(i), e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener"));
  });
}
$($We, "setupDompurifyHooks");
var jWe = /* @__PURE__ */ $((i) => (q$t(), NA.sanitize(i)), "removeScript"), k2e = /* @__PURE__ */ $((i, e) => {
  var t;
  if (((t = e.flowchart) == null ? void 0 : t.htmlLabels) !== !1) {
    const n = e.securityLevel;
    n === "antiscript" || n === "strict" ? i = jWe(i) : n !== "loose" && (i = GWe(i), i = i.replace(/</g, "&lt;").replace(/>/g, "&gt;"), i = i.replace(/=/g, "&equals;"), i = Z$t(i));
  }
  return i;
}, "sanitizeMore"), Xg = /* @__PURE__ */ $((i, e) => i && (e.dompurifyConfig ? i = NA.sanitize(k2e(i, e), e.dompurifyConfig).toString() : i = NA.sanitize(k2e(i, e), {
  FORBID_TAGS: ["style"]
}).toString(), i), "sanitizeText"), K$t = /* @__PURE__ */ $((i, e) => typeof i == "string" ? Xg(i, e) : i.flat().map((t) => Xg(t, e)), "sanitizeTextOrArray"), Y$t = /* @__PURE__ */ $((i) => b6.test(i), "hasBreaks"), X$t = /* @__PURE__ */ $((i) => i.split(b6), "splitBreaks"), Z$t = /* @__PURE__ */ $((i) => i.replace(/#br#/g, "<br/>"), "placeholderToBreak"), GWe = /* @__PURE__ */ $((i) => i.replace(b6, "#br#"), "breakToPlaceholder"), Q$t = /* @__PURE__ */ $((i) => {
  let e = "";
  return i && (e = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, e = CSS.escape(e)), e;
}, "getUrl"), ic = /* @__PURE__ */ $((i) => !(i === !1 || ["false", "null", "0"].includes(String(i).trim().toLowerCase())), "evaluate"), J$t = /* @__PURE__ */ $(function(...i) {
  const e = i.filter((t) => !isNaN(t));
  return Math.max(...e);
}, "getMax"), ejt = /* @__PURE__ */ $(function(...i) {
  const e = i.filter((t) => !isNaN(t));
  return Math.min(...e);
}, "getMin"), D2e = /* @__PURE__ */ $(function(i) {
  const e = i.split(/(,)/), t = [];
  for (let n = 0; n < e.length; n++) {
    let r = e[n];
    if (r === "," && n > 0 && n + 1 < e.length) {
      const s = e[n - 1], o = e[n + 1];
      tjt(s, o) && (r = s + "," + o, n++, t.pop());
    }
    t.push(njt(r));
  }
  return t.join("");
}, "parseGenericTypes"), kde = /* @__PURE__ */ $((i, e) => Math.max(0, i.split(e).length - 1), "countOccurrence"), tjt = /* @__PURE__ */ $((i, e) => {
  const t = kde(i, "~"), n = kde(e, "~");
  return t === 1 && n === 1;
}, "shouldCombineSets"), njt = /* @__PURE__ */ $((i) => {
  const e = kde(i, "~");
  let t = !1;
  if (e <= 1)
    return i;
  e % 2 !== 0 && i.startsWith("~") && (i = i.substring(1), t = !0);
  const n = [...i];
  let r = n.indexOf("~"), s = n.lastIndexOf("~");
  for (; r !== -1 && s !== -1 && r !== s; )
    n[r] = "<", n[s] = ">", r = n.indexOf("~"), s = n.lastIndexOf("~");
  return t && n.unshift("~"), n.join("");
}, "processSet"), I2e = /* @__PURE__ */ $(() => window.MathMLElement !== void 0, "isMathMLSupported"), Dde = /\$\$(.*)\$\$/g, AA = /* @__PURE__ */ $((i) => {
  var e;
  return (((e = i.match(Dde)) == null ? void 0 : e.length) ?? 0) > 0;
}, "hasKatex"), ecn = /* @__PURE__ */ $(async (i, e) => {
  const t = document.createElement("div");
  t.innerHTML = await G0e(i, e), t.id = "katex-temp", t.style.visibility = "hidden", t.style.position = "absolute", t.style.top = "0";
  const n = document.querySelector("body");
  n == null || n.insertAdjacentElement("beforeend", t);
  const r = { width: t.clientWidth, height: t.clientHeight };
  return t.remove(), r;
}, "calculateMathMLDimensions"), ijt = /* @__PURE__ */ $(async (i, e) => {
  if (!AA(i))
    return i;
  if (!(I2e() || e.legacyMathML || e.forceLegacyMathML))
    return i.replace(Dde, "MathML is unsupported in this environment.");
  {
    const { default: t } = await import("./katex-ytaZ7GNr.js"), n = e.forceLegacyMathML || !I2e() && e.legacyMathML ? "htmlAndMathml" : "mathml";
    return i.split(b6).map(
      (r) => AA(r) ? `<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${r}</div>` : `<div>${r}</div>`
    ).join("").replace(
      Dde,
      (r, s) => t.renderToString(s, {
        throwOnError: !0,
        displayMode: !0,
        output: n
      }).replace(/\n/g, " ").replace(/<annotation.*<\/annotation>/g, "")
    );
  }
}, "renderKatexUnsanitized"), G0e = /* @__PURE__ */ $(async (i, e) => Xg(await ijt(i, e), e), "renderKatexSanitized"), T2 = {
  getRows: G$t,
  sanitizeText: Xg,
  sanitizeTextOrArray: K$t,
  hasBreaks: Y$t,
  splitBreaks: X$t,
  lineBreakRegex: b6,
  removeScript: jWe,
  getUrl: Q$t,
  evaluate: ic,
  getMax: J$t,
  getMin: ejt
}, rjt = /* @__PURE__ */ $(function(i, e) {
  for (let t of e)
    i.attr(t[0], t[1]);
}, "d3Attrs"), sjt = /* @__PURE__ */ $(function(i, e, t) {
  let n = /* @__PURE__ */ new Map();
  return t ? (n.set("width", "100%"), n.set("style", `max-width: ${e}px;`)) : (n.set("height", i), n.set("width", e)), n;
}, "calculateSvgSizeAttrs"), qWe = /* @__PURE__ */ $(function(i, e, t, n) {
  const r = sjt(e, t, n);
  rjt(i, r);
}, "configureSvgSize"), ojt = /* @__PURE__ */ $(function(i, e, t, n) {
  const r = e.node().getBBox(), s = r.width, o = r.height;
  Ct.info(`SVG bounds: ${s}x${o}`, r);
  let a = 0, l = 0;
  Ct.info(`Graph bounds: ${a}x${l}`, i), a = s + t * 2, l = o + t * 2, Ct.info(`Calculated bounds: ${a}x${l}`), qWe(e, l, a, n);
  const c = `${r.x - t} ${r.y - t} ${r.width + 2 * t} ${r.height + 2 * t}`;
  e.attr("viewBox", c);
}, "setupGraphViewbox"), cV = {}, ajt = /* @__PURE__ */ $((i, e, t) => {
  let n = "";
  return i in cV && cV[i] ? n = cV[i](t) : Ct.warn(`No theme found for ${i}`), ` & {
    font-family: ${t.fontFamily};
    font-size: ${t.fontSize};
    fill: ${t.textColor}
  }
  @keyframes edge-animation-frame {
    from {
      stroke-dashoffset: 0;
    }
  }
  @keyframes dash {
    to {
      stroke-dashoffset: 0;
    }
  }
  & .edge-animation-slow {
    stroke-dasharray: 9,5 !important;
    stroke-dashoffset: 900;
    animation: dash 50s linear infinite;
    stroke-linecap: round;
  }
  & .edge-animation-fast {
    stroke-dasharray: 9,5 !important;
    stroke-dashoffset: 900;
    animation: dash 20s linear infinite;
    stroke-linecap: round;
  }
  /* Classes common for multiple diagrams */

  & .error-icon {
    fill: ${t.errorBkgColor};
  }
  & .error-text {
    fill: ${t.errorTextColor};
    stroke: ${t.errorTextColor};
  }

  & .edge-thickness-normal {
    stroke-width: 1px;
  }
  & .edge-thickness-thick {
    stroke-width: 3.5px
  }
  & .edge-pattern-solid {
    stroke-dasharray: 0;
  }
  & .edge-thickness-invisible {
    stroke-width: 0;
    fill: none;
  }
  & .edge-pattern-dashed{
    stroke-dasharray: 3;
  }
  .edge-pattern-dotted {
    stroke-dasharray: 2;
  }

  & .marker {
    fill: ${t.lineColor};
    stroke: ${t.lineColor};
  }
  & .marker.cross {
    stroke: ${t.lineColor};
  }

  & svg {
    font-family: ${t.fontFamily};
    font-size: ${t.fontSize};
  }
   & p {
    margin: 0
   }

  ${n}

  ${e}
`;
}, "getStyles"), ljt = /* @__PURE__ */ $((i, e) => {
  e !== void 0 && (cV[i] = e);
}, "addStylesForDiagram"), cjt = ajt, KWe = {};
Zzt(KWe, {
  clear: () => ujt,
  getAccDescription: () => gjt,
  getAccTitle: () => hjt,
  getDiagramTitle: () => mjt,
  setAccDescription: () => fjt,
  setAccTitle: () => djt,
  setDiagramTitle: () => pjt
});
var q0e = "", K0e = "", Y0e = "", X0e = /* @__PURE__ */ $((i) => Xg(i, Ku()), "sanitizeText"), ujt = /* @__PURE__ */ $(() => {
  q0e = "", Y0e = "", K0e = "";
}, "clear"), djt = /* @__PURE__ */ $((i) => {
  q0e = X0e(i).replace(/^\s+/g, "");
}, "setAccTitle"), hjt = /* @__PURE__ */ $(() => q0e, "getAccTitle"), fjt = /* @__PURE__ */ $((i) => {
  Y0e = X0e(i).replace(/\n\s+/g, `
`);
}, "setAccDescription"), gjt = /* @__PURE__ */ $(() => Y0e, "getAccDescription"), pjt = /* @__PURE__ */ $((i) => {
  K0e = X0e(i);
}, "setDiagramTitle"), mjt = /* @__PURE__ */ $(() => K0e, "getDiagramTitle"), N2e = Ct, _jt = $0e, Qs = Ku, tcn = VWe, ncn = RA, Z0e = /* @__PURE__ */ $((i) => Xg(i, Qs()), "sanitizeText"), bjt = ojt, vjt = /* @__PURE__ */ $(() => KWe, "getCommonDb"), K$ = {}, Y$ = /* @__PURE__ */ $((i, e, t) => {
  var n;
  K$[i] && N2e.warn(`Diagram with id ${i} already registered. Overwriting.`), K$[i] = e, t && PWe(i, t), ljt(i, e.styles), (n = e.injectUtils) == null || n.call(
    e,
    N2e,
    _jt,
    Qs,
    Z0e,
    bjt,
    vjt(),
    () => {
    }
  );
}, "registerDiagram"), Ide = /* @__PURE__ */ $((i) => {
  if (i in K$)
    return K$[i];
  throw new yjt(i);
}, "getDiagram"), VR, yjt = (VR = class extends Error {
  constructor(e) {
    super(`Diagram ${e} not found.`);
  }
}, $(VR, "DiagramNotFoundError"), VR), Cjt = { value: () => {
} };
function YWe() {
  for (var i = 0, e = arguments.length, t = {}, n; i < e; ++i) {
    if (!(n = arguments[i] + "") || n in t || /[\s.]/.test(n)) throw new Error("illegal type: " + n);
    t[n] = [];
  }
  return new uV(t);
}
function uV(i) {
  this._ = i;
}
function wjt(i, e) {
  return i.trim().split(/^|\s+/).map(function(t) {
    var n = "", r = t.indexOf(".");
    if (r >= 0 && (n = t.slice(r + 1), t = t.slice(0, r)), t && !e.hasOwnProperty(t)) throw new Error("unknown type: " + t);
    return { type: t, name: n };
  });
}
uV.prototype = YWe.prototype = {
  constructor: uV,
  on: function(i, e) {
    var t = this._, n = wjt(i + "", t), r, s = -1, o = n.length;
    if (arguments.length < 2) {
      for (; ++s < o; ) if ((r = (i = n[s]).type) && (r = Sjt(t[r], i.name))) return r;
      return;
    }
    if (e != null && typeof e != "function") throw new Error("invalid callback: " + e);
    for (; ++s < o; )
      if (r = (i = n[s]).type) t[r] = R2e(t[r], i.name, e);
      else if (e == null) for (r in t) t[r] = R2e(t[r], i.name, null);
    return this;
  },
  copy: function() {
    var i = {}, e = this._;
    for (var t in e) i[t] = e[t].slice();
    return new uV(i);
  },
  call: function(i, e) {
    if ((r = arguments.length - 2) > 0) for (var t = new Array(r), n = 0, r, s; n < r; ++n) t[n] = arguments[n + 2];
    if (!this._.hasOwnProperty(i)) throw new Error("unknown type: " + i);
    for (s = this._[i], n = 0, r = s.length; n < r; ++n) s[n].value.apply(e, t);
  },
  apply: function(i, e, t) {
    if (!this._.hasOwnProperty(i)) throw new Error("unknown type: " + i);
    for (var n = this._[i], r = 0, s = n.length; r < s; ++r) n[r].value.apply(e, t);
  }
};
function Sjt(i, e) {
  for (var t = 0, n = i.length, r; t < n; ++t)
    if ((r = i[t]).name === e)
      return r.value;
}
function R2e(i, e, t) {
  for (var n = 0, r = i.length; n < r; ++n)
    if (i[n].name === e) {
      i[n] = Cjt, i = i.slice(0, n).concat(i.slice(n + 1));
      break;
    }
  return t != null && i.push({ name: e, value: t }), i;
}
var Nde = "http://www.w3.org/1999/xhtml";
const A2e = {
  svg: "http://www.w3.org/2000/svg",
  xhtml: Nde,
  xlink: "http://www.w3.org/1999/xlink",
  xml: "http://www.w3.org/XML/1998/namespace",
  xmlns: "http://www.w3.org/2000/xmlns/"
};
function MY(i) {
  var e = i += "", t = e.indexOf(":");
  return t >= 0 && (e = i.slice(0, t)) !== "xmlns" && (i = i.slice(t + 1)), A2e.hasOwnProperty(e) ? { space: A2e[e], local: i } : i;
}
function Ejt(i) {
  return function() {
    var e = this.ownerDocument, t = this.namespaceURI;
    return t === Nde && e.documentElement.namespaceURI === Nde ? e.createElement(i) : e.createElementNS(t, i);
  };
}
function xjt(i) {
  return function() {
    return this.ownerDocument.createElementNS(i.space, i.local);
  };
}
function XWe(i) {
  var e = MY(i);
  return (e.local ? xjt : Ejt)(e);
}
function Ljt() {
}
function Q0e(i) {
  return i == null ? Ljt : function() {
    return this.querySelector(i);
  };
}
function Tjt(i) {
  typeof i != "function" && (i = Q0e(i));
  for (var e = this._groups, t = e.length, n = new Array(t), r = 0; r < t; ++r)
    for (var s = e[r], o = s.length, a = n[r] = new Array(o), l, c, u = 0; u < o; ++u)
      (l = s[u]) && (c = i.call(l, l.__data__, u, s)) && ("__data__" in l && (c.__data__ = l.__data__), a[u] = c);
  return new Jf(n, this._parents);
}
function kjt(i) {
  return i == null ? [] : Array.isArray(i) ? i : Array.from(i);
}
function Djt() {
  return [];
}
function ZWe(i) {
  return i == null ? Djt : function() {
    return this.querySelectorAll(i);
  };
}
function Ijt(i) {
  return function() {
    return kjt(i.apply(this, arguments));
  };
}
function Njt(i) {
  typeof i == "function" ? i = Ijt(i) : i = ZWe(i);
  for (var e = this._groups, t = e.length, n = [], r = [], s = 0; s < t; ++s)
    for (var o = e[s], a = o.length, l, c = 0; c < a; ++c)
      (l = o[c]) && (n.push(i.call(l, l.__data__, c, o)), r.push(l));
  return new Jf(n, r);
}
function QWe(i) {
  return function() {
    return this.matches(i);
  };
}
function JWe(i) {
  return function(e) {
    return e.matches(i);
  };
}
var Rjt = Array.prototype.find;
function Ajt(i) {
  return function() {
    return Rjt.call(this.children, i);
  };
}
function Ojt() {
  return this.firstElementChild;
}
function Mjt(i) {
  return this.select(i == null ? Ojt : Ajt(typeof i == "function" ? i : JWe(i)));
}
var Pjt = Array.prototype.filter;
function Fjt() {
  return Array.from(this.children);
}
function Bjt(i) {
  return function() {
    return Pjt.call(this.children, i);
  };
}
function Hjt(i) {
  return this.selectAll(i == null ? Fjt : Bjt(typeof i == "function" ? i : JWe(i)));
}
function Wjt(i) {
  typeof i != "function" && (i = QWe(i));
  for (var e = this._groups, t = e.length, n = new Array(t), r = 0; r < t; ++r)
    for (var s = e[r], o = s.length, a = n[r] = [], l, c = 0; c < o; ++c)
      (l = s[c]) && i.call(l, l.__data__, c, s) && a.push(l);
  return new Jf(n, this._parents);
}
function eVe(i) {
  return new Array(i.length);
}
function Vjt() {
  return new Jf(this._enter || this._groups.map(eVe), this._parents);
}
function X$(i, e) {
  this.ownerDocument = i.ownerDocument, this.namespaceURI = i.namespaceURI, this._next = null, this._parent = i, this.__data__ = e;
}
X$.prototype = {
  constructor: X$,
  appendChild: function(i) {
    return this._parent.insertBefore(i, this._next);
  },
  insertBefore: function(i, e) {
    return this._parent.insertBefore(i, e);
  },
  querySelector: function(i) {
    return this._parent.querySelector(i);
  },
  querySelectorAll: function(i) {
    return this._parent.querySelectorAll(i);
  }
};
function Ujt(i) {
  return function() {
    return i;
  };
}
function zjt(i, e, t, n, r, s) {
  for (var o = 0, a, l = e.length, c = s.length; o < c; ++o)
    (a = e[o]) ? (a.__data__ = s[o], n[o] = a) : t[o] = new X$(i, s[o]);
  for (; o < l; ++o)
    (a = e[o]) && (r[o] = a);
}
function $jt(i, e, t, n, r, s, o) {
  var a, l, c = /* @__PURE__ */ new Map(), u = e.length, d = s.length, h = new Array(u), g;
  for (a = 0; a < u; ++a)
    (l = e[a]) && (h[a] = g = o.call(l, l.__data__, a, e) + "", c.has(g) ? r[a] = l : c.set(g, l));
  for (a = 0; a < d; ++a)
    g = o.call(i, s[a], a, s) + "", (l = c.get(g)) ? (n[a] = l, l.__data__ = s[a], c.delete(g)) : t[a] = new X$(i, s[a]);
  for (a = 0; a < u; ++a)
    (l = e[a]) && c.get(h[a]) === l && (r[a] = l);
}
function jjt(i) {
  return i.__data__;
}
function Gjt(i, e) {
  if (!arguments.length) return Array.from(this, jjt);
  var t = e ? $jt : zjt, n = this._parents, r = this._groups;
  typeof i != "function" && (i = Ujt(i));
  for (var s = r.length, o = new Array(s), a = new Array(s), l = new Array(s), c = 0; c < s; ++c) {
    var u = n[c], d = r[c], h = d.length, g = qjt(i.call(u, u && u.__data__, c, n)), m = g.length, _ = a[c] = new Array(m), v = o[c] = new Array(m), w = l[c] = new Array(h);
    t(u, d, _, v, w, g, e);
    for (var E = 0, L = 0, T, D; E < m; ++E)
      if (T = _[E]) {
        for (E >= L && (L = E + 1); !(D = v[L]) && ++L < m; ) ;
        T._next = D || null;
      }
  }
  return o = new Jf(o, n), o._enter = a, o._exit = l, o;
}
function qjt(i) {
  return typeof i == "object" && "length" in i ? i : Array.from(i);
}
function Kjt() {
  return new Jf(this._exit || this._groups.map(eVe), this._parents);
}
function Yjt(i, e, t) {
  var n = this.enter(), r = this, s = this.exit();
  return typeof i == "function" ? (n = i(n), n && (n = n.selection())) : n = n.append(i + ""), e != null && (r = e(r), r && (r = r.selection())), t == null ? s.remove() : t(s), n && r ? n.merge(r).order() : r;
}
function Xjt(i) {
  for (var e = i.selection ? i.selection() : i, t = this._groups, n = e._groups, r = t.length, s = n.length, o = Math.min(r, s), a = new Array(r), l = 0; l < o; ++l)
    for (var c = t[l], u = n[l], d = c.length, h = a[l] = new Array(d), g, m = 0; m < d; ++m)
      (g = c[m] || u[m]) && (h[m] = g);
  for (; l < r; ++l)
    a[l] = t[l];
  return new Jf(a, this._parents);
}
function Zjt() {
  for (var i = this._groups, e = -1, t = i.length; ++e < t; )
    for (var n = i[e], r = n.length - 1, s = n[r], o; --r >= 0; )
      (o = n[r]) && (s && o.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(o, s), s = o);
  return this;
}
function Qjt(i) {
  i || (i = Jjt);
  function e(d, h) {
    return d && h ? i(d.__data__, h.__data__) : !d - !h;
  }
  for (var t = this._groups, n = t.length, r = new Array(n), s = 0; s < n; ++s) {
    for (var o = t[s], a = o.length, l = r[s] = new Array(a), c, u = 0; u < a; ++u)
      (c = o[u]) && (l[u] = c);
    l.sort(e);
  }
  return new Jf(r, this._parents).order();
}
function Jjt(i, e) {
  return i < e ? -1 : i > e ? 1 : i >= e ? 0 : NaN;
}
function eGt() {
  var i = arguments[0];
  return arguments[0] = this, i.apply(null, arguments), this;
}
function tGt() {
  return Array.from(this);
}
function nGt() {
  for (var i = this._groups, e = 0, t = i.length; e < t; ++e)
    for (var n = i[e], r = 0, s = n.length; r < s; ++r) {
      var o = n[r];
      if (o) return o;
    }
  return null;
}
function iGt() {
  let i = 0;
  for (const e of this) ++i;
  return i;
}
function rGt() {
  return !this.node();
}
function sGt(i) {
  for (var e = this._groups, t = 0, n = e.length; t < n; ++t)
    for (var r = e[t], s = 0, o = r.length, a; s < o; ++s)
      (a = r[s]) && i.call(a, a.__data__, s, r);
  return this;
}
function oGt(i) {
  return function() {
    this.removeAttribute(i);
  };
}
function aGt(i) {
  return function() {
    this.removeAttributeNS(i.space, i.local);
  };
}
function lGt(i, e) {
  return function() {
    this.setAttribute(i, e);
  };
}
function cGt(i, e) {
  return function() {
    this.setAttributeNS(i.space, i.local, e);
  };
}
function uGt(i, e) {
  return function() {
    var t = e.apply(this, arguments);
    t == null ? this.removeAttribute(i) : this.setAttribute(i, t);
  };
}
function dGt(i, e) {
  return function() {
    var t = e.apply(this, arguments);
    t == null ? this.removeAttributeNS(i.space, i.local) : this.setAttributeNS(i.space, i.local, t);
  };
}
function hGt(i, e) {
  var t = MY(i);
  if (arguments.length < 2) {
    var n = this.node();
    return t.local ? n.getAttributeNS(t.space, t.local) : n.getAttribute(t);
  }
  return this.each((e == null ? t.local ? aGt : oGt : typeof e == "function" ? t.local ? dGt : uGt : t.local ? cGt : lGt)(t, e));
}
function tVe(i) {
  return i.ownerDocument && i.ownerDocument.defaultView || i.document && i || i.defaultView;
}
function fGt(i) {
  return function() {
    this.style.removeProperty(i);
  };
}
function gGt(i, e, t) {
  return function() {
    this.style.setProperty(i, e, t);
  };
}
function pGt(i, e, t) {
  return function() {
    var n = e.apply(this, arguments);
    n == null ? this.style.removeProperty(i) : this.style.setProperty(i, n, t);
  };
}
function mGt(i, e, t) {
  return arguments.length > 1 ? this.each((e == null ? fGt : typeof e == "function" ? pGt : gGt)(i, e, t ?? "")) : OA(this.node(), i);
}
function OA(i, e) {
  return i.style.getPropertyValue(e) || tVe(i).getComputedStyle(i, null).getPropertyValue(e);
}
function _Gt(i) {
  return function() {
    delete this[i];
  };
}
function bGt(i, e) {
  return function() {
    this[i] = e;
  };
}
function vGt(i, e) {
  return function() {
    var t = e.apply(this, arguments);
    t == null ? delete this[i] : this[i] = t;
  };
}
function yGt(i, e) {
  return arguments.length > 1 ? this.each((e == null ? _Gt : typeof e == "function" ? vGt : bGt)(i, e)) : this.node()[i];
}
function nVe(i) {
  return i.trim().split(/^|\s+/);
}
function J0e(i) {
  return i.classList || new iVe(i);
}
function iVe(i) {
  this._node = i, this._names = nVe(i.getAttribute("class") || "");
}
iVe.prototype = {
  add: function(i) {
    var e = this._names.indexOf(i);
    e < 0 && (this._names.push(i), this._node.setAttribute("class", this._names.join(" ")));
  },
  remove: function(i) {
    var e = this._names.indexOf(i);
    e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" ")));
  },
  contains: function(i) {
    return this._names.indexOf(i) >= 0;
  }
};
function rVe(i, e) {
  for (var t = J0e(i), n = -1, r = e.length; ++n < r; ) t.add(e[n]);
}
function sVe(i, e) {
  for (var t = J0e(i), n = -1, r = e.length; ++n < r; ) t.remove(e[n]);
}
function CGt(i) {
  return function() {
    rVe(this, i);
  };
}
function wGt(i) {
  return function() {
    sVe(this, i);
  };
}
function SGt(i, e) {
  return function() {
    (e.apply(this, arguments) ? rVe : sVe)(this, i);
  };
}
function EGt(i, e) {
  var t = nVe(i + "");
  if (arguments.length < 2) {
    for (var n = J0e(this.node()), r = -1, s = t.length; ++r < s; ) if (!n.contains(t[r])) return !1;
    return !0;
  }
  return this.each((typeof e == "function" ? SGt : e ? CGt : wGt)(t, e));
}
function xGt() {
  this.textContent = "";
}
function LGt(i) {
  return function() {
    this.textContent = i;
  };
}
function TGt(i) {
  return function() {
    var e = i.apply(this, arguments);
    this.textContent = e ?? "";
  };
}
function kGt(i) {
  return arguments.length ? this.each(i == null ? xGt : (typeof i == "function" ? TGt : LGt)(i)) : this.node().textContent;
}
function DGt() {
  this.innerHTML = "";
}
function IGt(i) {
  return function() {
    this.innerHTML = i;
  };
}
function NGt(i) {
  return function() {
    var e = i.apply(this, arguments);
    this.innerHTML = e ?? "";
  };
}
function RGt(i) {
  return arguments.length ? this.each(i == null ? DGt : (typeof i == "function" ? NGt : IGt)(i)) : this.node().innerHTML;
}
function AGt() {
  this.nextSibling && this.parentNode.appendChild(this);
}
function OGt() {
  return this.each(AGt);
}
function MGt() {
  this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function PGt() {
  return this.each(MGt);
}
function FGt(i) {
  var e = typeof i == "function" ? i : XWe(i);
  return this.select(function() {
    return this.appendChild(e.apply(this, arguments));
  });
}
function BGt() {
  return null;
}
function HGt(i, e) {
  var t = typeof i == "function" ? i : XWe(i), n = e == null ? BGt : typeof e == "function" ? e : Q0e(e);
  return this.select(function() {
    return this.insertBefore(t.apply(this, arguments), n.apply(this, arguments) || null);
  });
}
function WGt() {
  var i = this.parentNode;
  i && i.removeChild(this);
}
function VGt() {
  return this.each(WGt);
}
function UGt() {
  var i = this.cloneNode(!1), e = this.parentNode;
  return e ? e.insertBefore(i, this.nextSibling) : i;
}
function zGt() {
  var i = this.cloneNode(!0), e = this.parentNode;
  return e ? e.insertBefore(i, this.nextSibling) : i;
}
function $Gt(i) {
  return this.select(i ? zGt : UGt);
}
function jGt(i) {
  return arguments.length ? this.property("__data__", i) : this.node().__data__;
}
function GGt(i) {
  return function(e) {
    i.call(this, e, this.__data__);
  };
}
function qGt(i) {
  return i.trim().split(/^|\s+/).map(function(e) {
    var t = "", n = e.indexOf(".");
    return n >= 0 && (t = e.slice(n + 1), e = e.slice(0, n)), { type: e, name: t };
  });
}
function KGt(i) {
  return function() {
    var e = this.__on;
    if (e) {
      for (var t = 0, n = -1, r = e.length, s; t < r; ++t)
        s = e[t], (!i.type || s.type === i.type) && s.name === i.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++n] = s;
      ++n ? e.length = n : delete this.__on;
    }
  };
}
function YGt(i, e, t) {
  return function() {
    var n = this.__on, r, s = GGt(e);
    if (n) {
      for (var o = 0, a = n.length; o < a; ++o)
        if ((r = n[o]).type === i.type && r.name === i.name) {
          this.removeEventListener(r.type, r.listener, r.options), this.addEventListener(r.type, r.listener = s, r.options = t), r.value = e;
          return;
        }
    }
    this.addEventListener(i.type, s, t), r = { type: i.type, name: i.name, value: e, listener: s, options: t }, n ? n.push(r) : this.__on = [r];
  };
}
function XGt(i, e, t) {
  var n = qGt(i + ""), r, s = n.length, o;
  if (arguments.length < 2) {
    var a = this.node().__on;
    if (a) {
      for (var l = 0, c = a.length, u; l < c; ++l)
        for (r = 0, u = a[l]; r < s; ++r)
          if ((o = n[r]).type === u.type && o.name === u.name)
            return u.value;
    }
    return;
  }
  for (a = e ? YGt : KGt, r = 0; r < s; ++r) this.each(a(n[r], e, t));
  return this;
}
function oVe(i, e, t) {
  var n = tVe(i), r = n.CustomEvent;
  typeof r == "function" ? r = new r(e, t) : (r = n.document.createEvent("Event"), t ? (r.initEvent(e, t.bubbles, t.cancelable), r.detail = t.detail) : r.initEvent(e, !1, !1)), i.dispatchEvent(r);
}
function ZGt(i, e) {
  return function() {
    return oVe(this, i, e);
  };
}
function QGt(i, e) {
  return function() {
    return oVe(this, i, e.apply(this, arguments));
  };
}
function JGt(i, e) {
  return this.each((typeof e == "function" ? QGt : ZGt)(i, e));
}
function* eqt() {
  for (var i = this._groups, e = 0, t = i.length; e < t; ++e)
    for (var n = i[e], r = 0, s = n.length, o; r < s; ++r)
      (o = n[r]) && (yield o);
}
var aVe = [null];
function Jf(i, e) {
  this._groups = i, this._parents = e;
}
function v6() {
  return new Jf([[document.documentElement]], aVe);
}
function tqt() {
  return this;
}
Jf.prototype = v6.prototype = {
  constructor: Jf,
  select: Tjt,
  selectAll: Njt,
  selectChild: Mjt,
  selectChildren: Hjt,
  filter: Wjt,
  data: Gjt,
  enter: Vjt,
  exit: Kjt,
  join: Yjt,
  merge: Xjt,
  selection: tqt,
  order: Zjt,
  sort: Qjt,
  call: eGt,
  nodes: tGt,
  node: nGt,
  size: iGt,
  empty: rGt,
  each: sGt,
  attr: hGt,
  style: mGt,
  property: yGt,
  classed: EGt,
  text: kGt,
  html: RGt,
  raise: OGt,
  lower: PGt,
  append: FGt,
  insert: HGt,
  remove: VGt,
  clone: $Gt,
  datum: jGt,
  on: XGt,
  dispatch: JGt,
  [Symbol.iterator]: eqt
};
function ls(i) {
  return typeof i == "string" ? new Jf([[document.querySelector(i)]], [document.documentElement]) : new Jf([[i]], aVe);
}
function eCe(i, e, t) {
  i.prototype = e.prototype = t, t.constructor = i;
}
function lVe(i, e) {
  var t = Object.create(i.prototype);
  for (var n in e) t[n] = e[n];
  return t;
}
function y6() {
}
var Y5 = 0.7, Z$ = 1 / Y5, vR = "\\s*([+-]?\\d+)\\s*", X5 = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", cb = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", nqt = /^#([0-9a-f]{3,8})$/, iqt = new RegExp(`^rgb\\(${vR},${vR},${vR}\\)$`), rqt = new RegExp(`^rgb\\(${cb},${cb},${cb}\\)$`), sqt = new RegExp(`^rgba\\(${vR},${vR},${vR},${X5}\\)$`), oqt = new RegExp(`^rgba\\(${cb},${cb},${cb},${X5}\\)$`), aqt = new RegExp(`^hsl\\(${X5},${cb},${cb}\\)$`), lqt = new RegExp(`^hsla\\(${X5},${cb},${cb},${X5}\\)$`), O2e = {
  aliceblue: 15792383,
  antiquewhite: 16444375,
  aqua: 65535,
  aquamarine: 8388564,
  azure: 15794175,
  beige: 16119260,
  bisque: 16770244,
  black: 0,
  blanchedalmond: 16772045,
  blue: 255,
  blueviolet: 9055202,
  brown: 10824234,
  burlywood: 14596231,
  cadetblue: 6266528,
  chartreuse: 8388352,
  chocolate: 13789470,
  coral: 16744272,
  cornflowerblue: 6591981,
  cornsilk: 16775388,
  crimson: 14423100,
  cyan: 65535,
  darkblue: 139,
  darkcyan: 35723,
  darkgoldenrod: 12092939,
  darkgray: 11119017,
  darkgreen: 25600,
  darkgrey: 11119017,
  darkkhaki: 12433259,
  darkmagenta: 9109643,
  darkolivegreen: 5597999,
  darkorange: 16747520,
  darkorchid: 10040012,
  darkred: 9109504,
  darksalmon: 15308410,
  darkseagreen: 9419919,
  darkslateblue: 4734347,
  darkslategray: 3100495,
  darkslategrey: 3100495,
  darkturquoise: 52945,
  darkviolet: 9699539,
  deeppink: 16716947,
  deepskyblue: 49151,
  dimgray: 6908265,
  dimgrey: 6908265,
  dodgerblue: 2003199,
  firebrick: 11674146,
  floralwhite: 16775920,
  forestgreen: 2263842,
  fuchsia: 16711935,
  gainsboro: 14474460,
  ghostwhite: 16316671,
  gold: 16766720,
  goldenrod: 14329120,
  gray: 8421504,
  green: 32768,
  greenyellow: 11403055,
  grey: 8421504,
  honeydew: 15794160,
  hotpink: 16738740,
  indianred: 13458524,
  indigo: 4915330,
  ivory: 16777200,
  khaki: 15787660,
  lavender: 15132410,
  lavenderblush: 16773365,
  lawngreen: 8190976,
  lemonchiffon: 16775885,
  lightblue: 11393254,
  lightcoral: 15761536,
  lightcyan: 14745599,
  lightgoldenrodyellow: 16448210,
  lightgray: 13882323,
  lightgreen: 9498256,
  lightgrey: 13882323,
  lightpink: 16758465,
  lightsalmon: 16752762,
  lightseagreen: 2142890,
  lightskyblue: 8900346,
  lightslategray: 7833753,
  lightslategrey: 7833753,
  lightsteelblue: 11584734,
  lightyellow: 16777184,
  lime: 65280,
  limegreen: 3329330,
  linen: 16445670,
  magenta: 16711935,
  maroon: 8388608,
  mediumaquamarine: 6737322,
  mediumblue: 205,
  mediumorchid: 12211667,
  mediumpurple: 9662683,
  mediumseagreen: 3978097,
  mediumslateblue: 8087790,
  mediumspringgreen: 64154,
  mediumturquoise: 4772300,
  mediumvioletred: 13047173,
  midnightblue: 1644912,
  mintcream: 16121850,
  mistyrose: 16770273,
  moccasin: 16770229,
  navajowhite: 16768685,
  navy: 128,
  oldlace: 16643558,
  olive: 8421376,
  olivedrab: 7048739,
  orange: 16753920,
  orangered: 16729344,
  orchid: 14315734,
  palegoldenrod: 15657130,
  palegreen: 10025880,
  paleturquoise: 11529966,
  palevioletred: 14381203,
  papayawhip: 16773077,
  peachpuff: 16767673,
  peru: 13468991,
  pink: 16761035,
  plum: 14524637,
  powderblue: 11591910,
  purple: 8388736,
  rebeccapurple: 6697881,
  red: 16711680,
  rosybrown: 12357519,
  royalblue: 4286945,
  saddlebrown: 9127187,
  salmon: 16416882,
  sandybrown: 16032864,
  seagreen: 3050327,
  seashell: 16774638,
  sienna: 10506797,
  silver: 12632256,
  skyblue: 8900331,
  slateblue: 6970061,
  slategray: 7372944,
  slategrey: 7372944,
  snow: 16775930,
  springgreen: 65407,
  steelblue: 4620980,
  tan: 13808780,
  teal: 32896,
  thistle: 14204888,
  tomato: 16737095,
  turquoise: 4251856,
  violet: 15631086,
  wheat: 16113331,
  white: 16777215,
  whitesmoke: 16119285,
  yellow: 16776960,
  yellowgreen: 10145074
};
eCe(y6, Z5, {
  copy(i) {
    return Object.assign(new this.constructor(), this, i);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: M2e,
  // Deprecated! Use color.formatHex.
  formatHex: M2e,
  formatHex8: cqt,
  formatHsl: uqt,
  formatRgb: P2e,
  toString: P2e
});
function M2e() {
  return this.rgb().formatHex();
}
function cqt() {
  return this.rgb().formatHex8();
}
function uqt() {
  return cVe(this).formatHsl();
}
function P2e() {
  return this.rgb().formatRgb();
}
function Z5(i) {
  var e, t;
  return i = (i + "").trim().toLowerCase(), (e = nqt.exec(i)) ? (t = e[1].length, e = parseInt(e[1], 16), t === 6 ? F2e(e) : t === 3 ? new Wh(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : t === 8 ? oW(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : t === 4 ? oW(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = iqt.exec(i)) ? new Wh(e[1], e[2], e[3], 1) : (e = rqt.exec(i)) ? new Wh(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = sqt.exec(i)) ? oW(e[1], e[2], e[3], e[4]) : (e = oqt.exec(i)) ? oW(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = aqt.exec(i)) ? W2e(e[1], e[2] / 100, e[3] / 100, 1) : (e = lqt.exec(i)) ? W2e(e[1], e[2] / 100, e[3] / 100, e[4]) : O2e.hasOwnProperty(i) ? F2e(O2e[i]) : i === "transparent" ? new Wh(NaN, NaN, NaN, 0) : null;
}
function F2e(i) {
  return new Wh(i >> 16 & 255, i >> 8 & 255, i & 255, 1);
}
function oW(i, e, t, n) {
  return n <= 0 && (i = e = t = NaN), new Wh(i, e, t, n);
}
function dqt(i) {
  return i instanceof y6 || (i = Z5(i)), i ? (i = i.rgb(), new Wh(i.r, i.g, i.b, i.opacity)) : new Wh();
}
function Rde(i, e, t, n) {
  return arguments.length === 1 ? dqt(i) : new Wh(i, e, t, n ?? 1);
}
function Wh(i, e, t, n) {
  this.r = +i, this.g = +e, this.b = +t, this.opacity = +n;
}
eCe(Wh, Rde, lVe(y6, {
  brighter(i) {
    return i = i == null ? Z$ : Math.pow(Z$, i), new Wh(this.r * i, this.g * i, this.b * i, this.opacity);
  },
  darker(i) {
    return i = i == null ? Y5 : Math.pow(Y5, i), new Wh(this.r * i, this.g * i, this.b * i, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new Wh(Xx(this.r), Xx(this.g), Xx(this.b), Q$(this.opacity));
  },
  displayable() {
    return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
  },
  hex: B2e,
  // Deprecated! Use color.formatHex.
  formatHex: B2e,
  formatHex8: hqt,
  formatRgb: H2e,
  toString: H2e
}));
function B2e() {
  return `#${Lx(this.r)}${Lx(this.g)}${Lx(this.b)}`;
}
function hqt() {
  return `#${Lx(this.r)}${Lx(this.g)}${Lx(this.b)}${Lx((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function H2e() {
  const i = Q$(this.opacity);
  return `${i === 1 ? "rgb(" : "rgba("}${Xx(this.r)}, ${Xx(this.g)}, ${Xx(this.b)}${i === 1 ? ")" : `, ${i})`}`;
}
function Q$(i) {
  return isNaN(i) ? 1 : Math.max(0, Math.min(1, i));
}
function Xx(i) {
  return Math.max(0, Math.min(255, Math.round(i) || 0));
}
function Lx(i) {
  return i = Xx(i), (i < 16 ? "0" : "") + i.toString(16);
}
function W2e(i, e, t, n) {
  return n <= 0 ? i = e = t = NaN : t <= 0 || t >= 1 ? i = e = NaN : e <= 0 && (i = NaN), new Qp(i, e, t, n);
}
function cVe(i) {
  if (i instanceof Qp) return new Qp(i.h, i.s, i.l, i.opacity);
  if (i instanceof y6 || (i = Z5(i)), !i) return new Qp();
  if (i instanceof Qp) return i;
  i = i.rgb();
  var e = i.r / 255, t = i.g / 255, n = i.b / 255, r = Math.min(e, t, n), s = Math.max(e, t, n), o = NaN, a = s - r, l = (s + r) / 2;
  return a ? (e === s ? o = (t - n) / a + (t < n) * 6 : t === s ? o = (n - e) / a + 2 : o = (e - t) / a + 4, a /= l < 0.5 ? s + r : 2 - s - r, o *= 60) : a = l > 0 && l < 1 ? 0 : o, new Qp(o, a, l, i.opacity);
}
function fqt(i, e, t, n) {
  return arguments.length === 1 ? cVe(i) : new Qp(i, e, t, n ?? 1);
}
function Qp(i, e, t, n) {
  this.h = +i, this.s = +e, this.l = +t, this.opacity = +n;
}
eCe(Qp, fqt, lVe(y6, {
  brighter(i) {
    return i = i == null ? Z$ : Math.pow(Z$, i), new Qp(this.h, this.s, this.l * i, this.opacity);
  },
  darker(i) {
    return i = i == null ? Y5 : Math.pow(Y5, i), new Qp(this.h, this.s, this.l * i, this.opacity);
  },
  rgb() {
    var i = this.h % 360 + (this.h < 0) * 360, e = isNaN(i) || isNaN(this.s) ? 0 : this.s, t = this.l, n = t + (t < 0.5 ? t : 1 - t) * e, r = 2 * t - n;
    return new Wh(
      Dne(i >= 240 ? i - 240 : i + 120, r, n),
      Dne(i, r, n),
      Dne(i < 120 ? i + 240 : i - 120, r, n),
      this.opacity
    );
  },
  clamp() {
    return new Qp(V2e(this.h), aW(this.s), aW(this.l), Q$(this.opacity));
  },
  displayable() {
    return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
  },
  formatHsl() {
    const i = Q$(this.opacity);
    return `${i === 1 ? "hsl(" : "hsla("}${V2e(this.h)}, ${aW(this.s) * 100}%, ${aW(this.l) * 100}%${i === 1 ? ")" : `, ${i})`}`;
  }
}));
function V2e(i) {
  return i = (i || 0) % 360, i < 0 ? i + 360 : i;
}
function aW(i) {
  return Math.max(0, Math.min(1, i || 0));
}
function Dne(i, e, t) {
  return (i < 60 ? e + (t - e) * i / 60 : i < 180 ? t : i < 240 ? e + (t - e) * (240 - i) / 60 : e) * 255;
}
const tCe = (i) => () => i;
function uVe(i, e) {
  return function(t) {
    return i + t * e;
  };
}
function gqt(i, e, t) {
  return i = Math.pow(i, t), e = Math.pow(e, t) - i, t = 1 / t, function(n) {
    return Math.pow(i + n * e, t);
  };
}
function icn(i, e) {
  var t = e - i;
  return t ? uVe(i, t > 180 || t < -180 ? t - 360 * Math.round(t / 360) : t) : tCe(isNaN(i) ? e : i);
}
function pqt(i) {
  return (i = +i) == 1 ? dVe : function(e, t) {
    return t - e ? gqt(e, t, i) : tCe(isNaN(e) ? t : e);
  };
}
function dVe(i, e) {
  var t = e - i;
  return t ? uVe(i, t) : tCe(isNaN(i) ? e : i);
}
const U2e = (function i(e) {
  var t = pqt(e);
  function n(r, s) {
    var o = t((r = Rde(r)).r, (s = Rde(s)).r), a = t(r.g, s.g), l = t(r.b, s.b), c = dVe(r.opacity, s.opacity);
    return function(u) {
      return r.r = o(u), r.g = a(u), r.b = l(u), r.opacity = c(u), r + "";
    };
  }
  return n.gamma = i, n;
})(1);
function VC(i, e) {
  return i = +i, e = +e, function(t) {
    return i * (1 - t) + e * t;
  };
}
var Ade = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ine = new RegExp(Ade.source, "g");
function mqt(i) {
  return function() {
    return i;
  };
}
function _qt(i) {
  return function(e) {
    return i(e) + "";
  };
}
function bqt(i, e) {
  var t = Ade.lastIndex = Ine.lastIndex = 0, n, r, s, o = -1, a = [], l = [];
  for (i = i + "", e = e + ""; (n = Ade.exec(i)) && (r = Ine.exec(e)); )
    (s = r.index) > t && (s = e.slice(t, s), a[o] ? a[o] += s : a[++o] = s), (n = n[0]) === (r = r[0]) ? a[o] ? a[o] += r : a[++o] = r : (a[++o] = null, l.push({ i: o, x: VC(n, r) })), t = Ine.lastIndex;
  return t < e.length && (s = e.slice(t), a[o] ? a[o] += s : a[++o] = s), a.length < 2 ? l[0] ? _qt(l[0].x) : mqt(e) : (e = l.length, function(c) {
    for (var u = 0, d; u < e; ++u) a[(d = l[u]).i] = d.x(c);
    return a.join("");
  });
}
var z2e = 180 / Math.PI, Ode = {
  translateX: 0,
  translateY: 0,
  rotate: 0,
  skewX: 0,
  scaleX: 1,
  scaleY: 1
};
function hVe(i, e, t, n, r, s) {
  var o, a, l;
  return (o = Math.sqrt(i * i + e * e)) && (i /= o, e /= o), (l = i * t + e * n) && (t -= i * l, n -= e * l), (a = Math.sqrt(t * t + n * n)) && (t /= a, n /= a, l /= a), i * n < e * t && (i = -i, e = -e, l = -l, o = -o), {
    translateX: r,
    translateY: s,
    rotate: Math.atan2(e, i) * z2e,
    skewX: Math.atan(l) * z2e,
    scaleX: o,
    scaleY: a
  };
}
var lW;
function vqt(i) {
  const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(i + "");
  return e.isIdentity ? Ode : hVe(e.a, e.b, e.c, e.d, e.e, e.f);
}
function yqt(i) {
  return i == null || (lW || (lW = document.createElementNS("http://www.w3.org/2000/svg", "g")), lW.setAttribute("transform", i), !(i = lW.transform.baseVal.consolidate())) ? Ode : (i = i.matrix, hVe(i.a, i.b, i.c, i.d, i.e, i.f));
}
function fVe(i, e, t, n) {
  function r(c) {
    return c.length ? c.pop() + " " : "";
  }
  function s(c, u, d, h, g, m) {
    if (c !== d || u !== h) {
      var _ = g.push("translate(", null, e, null, t);
      m.push({ i: _ - 4, x: VC(c, d) }, { i: _ - 2, x: VC(u, h) });
    } else (d || h) && g.push("translate(" + d + e + h + t);
  }
  function o(c, u, d, h) {
    c !== u ? (c - u > 180 ? u += 360 : u - c > 180 && (c += 360), h.push({ i: d.push(r(d) + "rotate(", null, n) - 2, x: VC(c, u) })) : u && d.push(r(d) + "rotate(" + u + n);
  }
  function a(c, u, d, h) {
    c !== u ? h.push({ i: d.push(r(d) + "skewX(", null, n) - 2, x: VC(c, u) }) : u && d.push(r(d) + "skewX(" + u + n);
  }
  function l(c, u, d, h, g, m) {
    if (c !== d || u !== h) {
      var _ = g.push(r(g) + "scale(", null, ",", null, ")");
      m.push({ i: _ - 4, x: VC(c, d) }, { i: _ - 2, x: VC(u, h) });
    } else (d !== 1 || h !== 1) && g.push(r(g) + "scale(" + d + "," + h + ")");
  }
  return function(c, u) {
    var d = [], h = [];
    return c = i(c), u = i(u), s(c.translateX, c.translateY, u.translateX, u.translateY, d, h), o(c.rotate, u.rotate, d, h), a(c.skewX, u.skewX, d, h), l(c.scaleX, c.scaleY, u.scaleX, u.scaleY, d, h), c = u = null, function(g) {
      for (var m = -1, _ = h.length, v; ++m < _; ) d[(v = h[m]).i] = v.x(g);
      return d.join("");
    };
  };
}
var Cqt = fVe(vqt, "px, ", "px)", "deg)"), wqt = fVe(yqt, ", ", ")", ")"), MA = 0, uF = 0, RP = 0, gVe = 1e3, J$, dF, ej = 0, FT = 0, PY = 0, Q5 = typeof performance == "object" && performance.now ? performance : Date, pVe = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(i) {
  setTimeout(i, 17);
};
function nCe() {
  return FT || (pVe(Sqt), FT = Q5.now() + PY);
}
function Sqt() {
  FT = 0;
}
function tj() {
  this._call = this._time = this._next = null;
}
tj.prototype = mVe.prototype = {
  constructor: tj,
  restart: function(i, e, t) {
    if (typeof i != "function") throw new TypeError("callback is not a function");
    t = (t == null ? nCe() : +t) + (e == null ? 0 : +e), !this._next && dF !== this && (dF ? dF._next = this : J$ = this, dF = this), this._call = i, this._time = t, Mde();
  },
  stop: function() {
    this._call && (this._call = null, this._time = 1 / 0, Mde());
  }
};
function mVe(i, e, t) {
  var n = new tj();
  return n.restart(i, e, t), n;
}
function Eqt() {
  nCe(), ++MA;
  for (var i = J$, e; i; )
    (e = FT - i._time) >= 0 && i._call.call(void 0, e), i = i._next;
  --MA;
}
function $2e() {
  FT = (ej = Q5.now()) + PY, MA = uF = 0;
  try {
    Eqt();
  } finally {
    MA = 0, Lqt(), FT = 0;
  }
}
function xqt() {
  var i = Q5.now(), e = i - ej;
  e > gVe && (PY -= e, ej = i);
}
function Lqt() {
  for (var i, e = J$, t, n = 1 / 0; e; )
    e._call ? (n > e._time && (n = e._time), i = e, e = e._next) : (t = e._next, e._next = null, e = i ? i._next = t : J$ = t);
  dF = i, Mde(n);
}
function Mde(i) {
  if (!MA) {
    uF && (uF = clearTimeout(uF));
    var e = i - FT;
    e > 24 ? (i < 1 / 0 && (uF = setTimeout($2e, i - Q5.now() - PY)), RP && (RP = clearInterval(RP))) : (RP || (ej = Q5.now(), RP = setInterval(xqt, gVe)), MA = 1, pVe($2e));
  }
}
function j2e(i, e, t) {
  var n = new tj();
  return e = e == null ? 0 : +e, n.restart((r) => {
    n.stop(), i(r + e);
  }, e, t), n;
}
var Tqt = YWe("start", "end", "cancel", "interrupt"), kqt = [], _Ve = 0, G2e = 1, Pde = 2, dV = 3, q2e = 4, Fde = 5, hV = 6;
function FY(i, e, t, n, r, s) {
  var o = i.__transition;
  if (!o) i.__transition = {};
  else if (t in o) return;
  Dqt(i, t, {
    name: e,
    index: n,
    // For context during callback.
    group: r,
    // For context during callback.
    on: Tqt,
    tween: kqt,
    time: s.time,
    delay: s.delay,
    duration: s.duration,
    ease: s.ease,
    timer: null,
    state: _Ve
  });
}
function iCe(i, e) {
  var t = Lm(i, e);
  if (t.state > _Ve) throw new Error("too late; already scheduled");
  return t;
}
function Fb(i, e) {
  var t = Lm(i, e);
  if (t.state > dV) throw new Error("too late; already running");
  return t;
}
function Lm(i, e) {
  var t = i.__transition;
  if (!t || !(t = t[e])) throw new Error("transition not found");
  return t;
}
function Dqt(i, e, t) {
  var n = i.__transition, r;
  n[e] = t, t.timer = mVe(s, 0, t.time);
  function s(c) {
    t.state = G2e, t.timer.restart(o, t.delay, t.time), t.delay <= c && o(c - t.delay);
  }
  function o(c) {
    var u, d, h, g;
    if (t.state !== G2e) return l();
    for (u in n)
      if (g = n[u], g.name === t.name) {
        if (g.state === dV) return j2e(o);
        g.state === q2e ? (g.state = hV, g.timer.stop(), g.on.call("interrupt", i, i.__data__, g.index, g.group), delete n[u]) : +u < e && (g.state = hV, g.timer.stop(), g.on.call("cancel", i, i.__data__, g.index, g.group), delete n[u]);
      }
    if (j2e(function() {
      t.state === dV && (t.state = q2e, t.timer.restart(a, t.delay, t.time), a(c));
    }), t.state = Pde, t.on.call("start", i, i.__data__, t.index, t.group), t.state === Pde) {
      for (t.state = dV, r = new Array(h = t.tween.length), u = 0, d = -1; u < h; ++u)
        (g = t.tween[u].value.call(i, i.__data__, t.index, t.group)) && (r[++d] = g);
      r.length = d + 1;
    }
  }
  function a(c) {
    for (var u = c < t.duration ? t.ease.call(null, c / t.duration) : (t.timer.restart(l), t.state = Fde, 1), d = -1, h = r.length; ++d < h; )
      r[d].call(i, u);
    t.state === Fde && (t.on.call("end", i, i.__data__, t.index, t.group), l());
  }
  function l() {
    t.state = hV, t.timer.stop(), delete n[e];
    for (var c in n) return;
    delete i.__transition;
  }
}
function Iqt(i, e) {
  var t = i.__transition, n, r, s = !0, o;
  if (t) {
    e = e == null ? null : e + "";
    for (o in t) {
      if ((n = t[o]).name !== e) {
        s = !1;
        continue;
      }
      r = n.state > Pde && n.state < Fde, n.state = hV, n.timer.stop(), n.on.call(r ? "interrupt" : "cancel", i, i.__data__, n.index, n.group), delete t[o];
    }
    s && delete i.__transition;
  }
}
function Nqt(i) {
  return this.each(function() {
    Iqt(this, i);
  });
}
function Rqt(i, e) {
  var t, n;
  return function() {
    var r = Fb(this, i), s = r.tween;
    if (s !== t) {
      n = t = s;
      for (var o = 0, a = n.length; o < a; ++o)
        if (n[o].name === e) {
          n = n.slice(), n.splice(o, 1);
          break;
        }
    }
    r.tween = n;
  };
}
function Aqt(i, e, t) {
  var n, r;
  if (typeof t != "function") throw new Error();
  return function() {
    var s = Fb(this, i), o = s.tween;
    if (o !== n) {
      r = (n = o).slice();
      for (var a = { name: e, value: t }, l = 0, c = r.length; l < c; ++l)
        if (r[l].name === e) {
          r[l] = a;
          break;
        }
      l === c && r.push(a);
    }
    s.tween = r;
  };
}
function Oqt(i, e) {
  var t = this._id;
  if (i += "", arguments.length < 2) {
    for (var n = Lm(this.node(), t).tween, r = 0, s = n.length, o; r < s; ++r)
      if ((o = n[r]).name === i)
        return o.value;
    return null;
  }
  return this.each((e == null ? Rqt : Aqt)(t, i, e));
}
function rCe(i, e, t) {
  var n = i._id;
  return i.each(function() {
    var r = Fb(this, n);
    (r.value || (r.value = {}))[e] = t.apply(this, arguments);
  }), function(r) {
    return Lm(r, n).value[e];
  };
}
function bVe(i, e) {
  var t;
  return (typeof e == "number" ? VC : e instanceof Z5 ? U2e : (t = Z5(e)) ? (e = t, U2e) : bqt)(i, e);
}
function Mqt(i) {
  return function() {
    this.removeAttribute(i);
  };
}
function Pqt(i) {
  return function() {
    this.removeAttributeNS(i.space, i.local);
  };
}
function Fqt(i, e, t) {
  var n, r = t + "", s;
  return function() {
    var o = this.getAttribute(i);
    return o === r ? null : o === n ? s : s = e(n = o, t);
  };
}
function Bqt(i, e, t) {
  var n, r = t + "", s;
  return function() {
    var o = this.getAttributeNS(i.space, i.local);
    return o === r ? null : o === n ? s : s = e(n = o, t);
  };
}
function Hqt(i, e, t) {
  var n, r, s;
  return function() {
    var o, a = t(this), l;
    return a == null ? void this.removeAttribute(i) : (o = this.getAttribute(i), l = a + "", o === l ? null : o === n && l === r ? s : (r = l, s = e(n = o, a)));
  };
}
function Wqt(i, e, t) {
  var n, r, s;
  return function() {
    var o, a = t(this), l;
    return a == null ? void this.removeAttributeNS(i.space, i.local) : (o = this.getAttributeNS(i.space, i.local), l = a + "", o === l ? null : o === n && l === r ? s : (r = l, s = e(n = o, a)));
  };
}
function Vqt(i, e) {
  var t = MY(i), n = t === "transform" ? wqt : bVe;
  return this.attrTween(i, typeof e == "function" ? (t.local ? Wqt : Hqt)(t, n, rCe(this, "attr." + i, e)) : e == null ? (t.local ? Pqt : Mqt)(t) : (t.local ? Bqt : Fqt)(t, n, e));
}
function Uqt(i, e) {
  return function(t) {
    this.setAttribute(i, e.call(this, t));
  };
}
function zqt(i, e) {
  return function(t) {
    this.setAttributeNS(i.space, i.local, e.call(this, t));
  };
}
function $qt(i, e) {
  var t, n;
  function r() {
    var s = e.apply(this, arguments);
    return s !== n && (t = (n = s) && zqt(i, s)), t;
  }
  return r._value = e, r;
}
function jqt(i, e) {
  var t, n;
  function r() {
    var s = e.apply(this, arguments);
    return s !== n && (t = (n = s) && Uqt(i, s)), t;
  }
  return r._value = e, r;
}
function Gqt(i, e) {
  var t = "attr." + i;
  if (arguments.length < 2) return (t = this.tween(t)) && t._value;
  if (e == null) return this.tween(t, null);
  if (typeof e != "function") throw new Error();
  var n = MY(i);
  return this.tween(t, (n.local ? $qt : jqt)(n, e));
}
function qqt(i, e) {
  return function() {
    iCe(this, i).delay = +e.apply(this, arguments);
  };
}
function Kqt(i, e) {
  return e = +e, function() {
    iCe(this, i).delay = e;
  };
}
function Yqt(i) {
  var e = this._id;
  return arguments.length ? this.each((typeof i == "function" ? qqt : Kqt)(e, i)) : Lm(this.node(), e).delay;
}
function Xqt(i, e) {
  return function() {
    Fb(this, i).duration = +e.apply(this, arguments);
  };
}
function Zqt(i, e) {
  return e = +e, function() {
    Fb(this, i).duration = e;
  };
}
function Qqt(i) {
  var e = this._id;
  return arguments.length ? this.each((typeof i == "function" ? Xqt : Zqt)(e, i)) : Lm(this.node(), e).duration;
}
function Jqt(i, e) {
  if (typeof e != "function") throw new Error();
  return function() {
    Fb(this, i).ease = e;
  };
}
function eKt(i) {
  var e = this._id;
  return arguments.length ? this.each(Jqt(e, i)) : Lm(this.node(), e).ease;
}
function tKt(i, e) {
  return function() {
    var t = e.apply(this, arguments);
    if (typeof t != "function") throw new Error();
    Fb(this, i).ease = t;
  };
}
function nKt(i) {
  if (typeof i != "function") throw new Error();
  return this.each(tKt(this._id, i));
}
function iKt(i) {
  typeof i != "function" && (i = QWe(i));
  for (var e = this._groups, t = e.length, n = new Array(t), r = 0; r < t; ++r)
    for (var s = e[r], o = s.length, a = n[r] = [], l, c = 0; c < o; ++c)
      (l = s[c]) && i.call(l, l.__data__, c, s) && a.push(l);
  return new l0(n, this._parents, this._name, this._id);
}
function rKt(i) {
  if (i._id !== this._id) throw new Error();
  for (var e = this._groups, t = i._groups, n = e.length, r = t.length, s = Math.min(n, r), o = new Array(n), a = 0; a < s; ++a)
    for (var l = e[a], c = t[a], u = l.length, d = o[a] = new Array(u), h, g = 0; g < u; ++g)
      (h = l[g] || c[g]) && (d[g] = h);
  for (; a < n; ++a)
    o[a] = e[a];
  return new l0(o, this._parents, this._name, this._id);
}
function sKt(i) {
  return (i + "").trim().split(/^|\s+/).every(function(e) {
    var t = e.indexOf(".");
    return t >= 0 && (e = e.slice(0, t)), !e || e === "start";
  });
}
function oKt(i, e, t) {
  var n, r, s = sKt(e) ? iCe : Fb;
  return function() {
    var o = s(this, i), a = o.on;
    a !== n && (r = (n = a).copy()).on(e, t), o.on = r;
  };
}
function aKt(i, e) {
  var t = this._id;
  return arguments.length < 2 ? Lm(this.node(), t).on.on(i) : this.each(oKt(t, i, e));
}
function lKt(i) {
  return function() {
    var e = this.parentNode;
    for (var t in this.__transition) if (+t !== i) return;
    e && e.removeChild(this);
  };
}
function cKt() {
  return this.on("end.remove", lKt(this._id));
}
function uKt(i) {
  var e = this._name, t = this._id;
  typeof i != "function" && (i = Q0e(i));
  for (var n = this._groups, r = n.length, s = new Array(r), o = 0; o < r; ++o)
    for (var a = n[o], l = a.length, c = s[o] = new Array(l), u, d, h = 0; h < l; ++h)
      (u = a[h]) && (d = i.call(u, u.__data__, h, a)) && ("__data__" in u && (d.__data__ = u.__data__), c[h] = d, FY(c[h], e, t, h, c, Lm(u, t)));
  return new l0(s, this._parents, e, t);
}
function dKt(i) {
  var e = this._name, t = this._id;
  typeof i != "function" && (i = ZWe(i));
  for (var n = this._groups, r = n.length, s = [], o = [], a = 0; a < r; ++a)
    for (var l = n[a], c = l.length, u, d = 0; d < c; ++d)
      if (u = l[d]) {
        for (var h = i.call(u, u.__data__, d, l), g, m = Lm(u, t), _ = 0, v = h.length; _ < v; ++_)
          (g = h[_]) && FY(g, e, t, _, h, m);
        s.push(h), o.push(u);
      }
  return new l0(s, o, e, t);
}
var hKt = v6.prototype.constructor;
function fKt() {
  return new hKt(this._groups, this._parents);
}
function gKt(i, e) {
  var t, n, r;
  return function() {
    var s = OA(this, i), o = (this.style.removeProperty(i), OA(this, i));
    return s === o ? null : s === t && o === n ? r : r = e(t = s, n = o);
  };
}
function vVe(i) {
  return function() {
    this.style.removeProperty(i);
  };
}
function pKt(i, e, t) {
  var n, r = t + "", s;
  return function() {
    var o = OA(this, i);
    return o === r ? null : o === n ? s : s = e(n = o, t);
  };
}
function mKt(i, e, t) {
  var n, r, s;
  return function() {
    var o = OA(this, i), a = t(this), l = a + "";
    return a == null && (l = a = (this.style.removeProperty(i), OA(this, i))), o === l ? null : o === n && l === r ? s : (r = l, s = e(n = o, a));
  };
}
function _Kt(i, e) {
  var t, n, r, s = "style." + e, o = "end." + s, a;
  return function() {
    var l = Fb(this, i), c = l.on, u = l.value[s] == null ? a || (a = vVe(e)) : void 0;
    (c !== t || r !== u) && (n = (t = c).copy()).on(o, r = u), l.on = n;
  };
}
function bKt(i, e, t) {
  var n = (i += "") == "transform" ? Cqt : bVe;
  return e == null ? this.styleTween(i, gKt(i, n)).on("end.style." + i, vVe(i)) : typeof e == "function" ? this.styleTween(i, mKt(i, n, rCe(this, "style." + i, e))).each(_Kt(this._id, i)) : this.styleTween(i, pKt(i, n, e), t).on("end.style." + i, null);
}
function vKt(i, e, t) {
  return function(n) {
    this.style.setProperty(i, e.call(this, n), t);
  };
}
function yKt(i, e, t) {
  var n, r;
  function s() {
    var o = e.apply(this, arguments);
    return o !== r && (n = (r = o) && vKt(i, o, t)), n;
  }
  return s._value = e, s;
}
function CKt(i, e, t) {
  var n = "style." + (i += "");
  if (arguments.length < 2) return (n = this.tween(n)) && n._value;
  if (e == null) return this.tween(n, null);
  if (typeof e != "function") throw new Error();
  return this.tween(n, yKt(i, e, t ?? ""));
}
function wKt(i) {
  return function() {
    this.textContent = i;
  };
}
function SKt(i) {
  return function() {
    var e = i(this);
    this.textContent = e ?? "";
  };
}
function EKt(i) {
  return this.tween("text", typeof i == "function" ? SKt(rCe(this, "text", i)) : wKt(i == null ? "" : i + ""));
}
function xKt(i) {
  return function(e) {
    this.textContent = i.call(this, e);
  };
}
function LKt(i) {
  var e, t;
  function n() {
    var r = i.apply(this, arguments);
    return r !== t && (e = (t = r) && xKt(r)), e;
  }
  return n._value = i, n;
}
function TKt(i) {
  var e = "text";
  if (arguments.length < 1) return (e = this.tween(e)) && e._value;
  if (i == null) return this.tween(e, null);
  if (typeof i != "function") throw new Error();
  return this.tween(e, LKt(i));
}
function kKt() {
  for (var i = this._name, e = this._id, t = yVe(), n = this._groups, r = n.length, s = 0; s < r; ++s)
    for (var o = n[s], a = o.length, l, c = 0; c < a; ++c)
      if (l = o[c]) {
        var u = Lm(l, e);
        FY(l, i, t, c, o, {
          time: u.time + u.delay + u.duration,
          delay: 0,
          duration: u.duration,
          ease: u.ease
        });
      }
  return new l0(n, this._parents, i, t);
}
function DKt() {
  var i, e, t = this, n = t._id, r = t.size();
  return new Promise(function(s, o) {
    var a = { value: o }, l = { value: function() {
      --r === 0 && s();
    } };
    t.each(function() {
      var c = Fb(this, n), u = c.on;
      u !== i && (e = (i = u).copy(), e._.cancel.push(a), e._.interrupt.push(a), e._.end.push(l)), c.on = e;
    }), r === 0 && s();
  });
}
var IKt = 0;
function l0(i, e, t, n) {
  this._groups = i, this._parents = e, this._name = t, this._id = n;
}
function yVe() {
  return ++IKt;
}
var Uv = v6.prototype;
l0.prototype = {
  constructor: l0,
  select: uKt,
  selectAll: dKt,
  selectChild: Uv.selectChild,
  selectChildren: Uv.selectChildren,
  filter: iKt,
  merge: rKt,
  selection: fKt,
  transition: kKt,
  call: Uv.call,
  nodes: Uv.nodes,
  node: Uv.node,
  size: Uv.size,
  empty: Uv.empty,
  each: Uv.each,
  on: aKt,
  attr: Vqt,
  attrTween: Gqt,
  style: bKt,
  styleTween: CKt,
  text: EKt,
  textTween: TKt,
  remove: cKt,
  tween: Oqt,
  delay: Yqt,
  duration: Qqt,
  ease: eKt,
  easeVarying: nKt,
  end: DKt,
  [Symbol.iterator]: Uv[Symbol.iterator]
};
function NKt(i) {
  return ((i *= 2) <= 1 ? i * i * i : (i -= 2) * i * i + 2) / 2;
}
var RKt = {
  time: null,
  // Set on use.
  delay: 0,
  duration: 250,
  ease: NKt
};
function AKt(i, e) {
  for (var t; !(t = i.__transition) || !(t = t[e]); )
    if (!(i = i.parentNode))
      throw new Error(`transition ${e} not found`);
  return t;
}
function OKt(i) {
  var e, t;
  i instanceof l0 ? (e = i._id, i = i._name) : (e = yVe(), (t = RKt).time = nCe(), i = i == null ? null : i + "");
  for (var n = this._groups, r = n.length, s = 0; s < r; ++s)
    for (var o = n[s], a = o.length, l, c = 0; c < a; ++c)
      (l = o[c]) && FY(l, i, e, c, o, t || AKt(l, e));
  return new l0(n, this._parents, i, e);
}
v6.prototype.interrupt = Nqt;
v6.prototype.transition = OKt;
const Bde = Math.PI, Hde = 2 * Bde, RE = 1e-6, MKt = Hde - RE;
function CVe(i) {
  this._ += i[0];
  for (let e = 1, t = i.length; e < t; ++e)
    this._ += arguments[e] + i[e];
}
function PKt(i) {
  let e = Math.floor(i);
  if (!(e >= 0)) throw new Error(`invalid digits: ${i}`);
  if (e > 15) return CVe;
  const t = 10 ** e;
  return function(n) {
    this._ += n[0];
    for (let r = 1, s = n.length; r < s; ++r)
      this._ += Math.round(arguments[r] * t) / t + n[r];
  };
}
class FKt {
  constructor(e) {
    this._x0 = this._y0 = // start of current subpath
    this._x1 = this._y1 = null, this._ = "", this._append = e == null ? CVe : PKt(e);
  }
  moveTo(e, t) {
    this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}`;
  }
  closePath() {
    this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
  }
  lineTo(e, t) {
    this._append`L${this._x1 = +e},${this._y1 = +t}`;
  }
  quadraticCurveTo(e, t, n, r) {
    this._append`Q${+e},${+t},${this._x1 = +n},${this._y1 = +r}`;
  }
  bezierCurveTo(e, t, n, r, s, o) {
    this._append`C${+e},${+t},${+n},${+r},${this._x1 = +s},${this._y1 = +o}`;
  }
  arcTo(e, t, n, r, s) {
    if (e = +e, t = +t, n = +n, r = +r, s = +s, s < 0) throw new Error(`negative radius: ${s}`);
    let o = this._x1, a = this._y1, l = n - e, c = r - t, u = o - e, d = a - t, h = u * u + d * d;
    if (this._x1 === null)
      this._append`M${this._x1 = e},${this._y1 = t}`;
    else if (h > RE) if (!(Math.abs(d * l - c * u) > RE) || !s)
      this._append`L${this._x1 = e},${this._y1 = t}`;
    else {
      let g = n - o, m = r - a, _ = l * l + c * c, v = g * g + m * m, w = Math.sqrt(_), E = Math.sqrt(h), L = s * Math.tan((Bde - Math.acos((_ + h - v) / (2 * w * E))) / 2), T = L / E, D = L / w;
      Math.abs(T - 1) > RE && this._append`L${e + T * u},${t + T * d}`, this._append`A${s},${s},0,0,${+(d * g > u * m)},${this._x1 = e + D * l},${this._y1 = t + D * c}`;
    }
  }
  arc(e, t, n, r, s, o) {
    if (e = +e, t = +t, n = +n, o = !!o, n < 0) throw new Error(`negative radius: ${n}`);
    let a = n * Math.cos(r), l = n * Math.sin(r), c = e + a, u = t + l, d = 1 ^ o, h = o ? r - s : s - r;
    this._x1 === null ? this._append`M${c},${u}` : (Math.abs(this._x1 - c) > RE || Math.abs(this._y1 - u) > RE) && this._append`L${c},${u}`, n && (h < 0 && (h = h % Hde + Hde), h > MKt ? this._append`A${n},${n},0,1,${d},${e - a},${t - l}A${n},${n},0,1,${d},${this._x1 = c},${this._y1 = u}` : h > RE && this._append`A${n},${n},0,${+(h >= Bde)},${d},${this._x1 = e + n * Math.cos(s)},${this._y1 = t + n * Math.sin(s)}`);
  }
  rect(e, t, n, r) {
    this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}h${n = +n}v${+r}h${-n}Z`;
  }
  toString() {
    return this._;
  }
}
function WI(i) {
  return function() {
    return i;
  };
}
const rcn = Math.abs, scn = Math.atan2, ocn = Math.cos, acn = Math.max, lcn = Math.min, ccn = Math.sin, ucn = Math.sqrt, K2e = 1e-12, sCe = Math.PI, Y2e = sCe / 2, dcn = 2 * sCe;
function hcn(i) {
  return i > 1 ? 0 : i < -1 ? sCe : Math.acos(i);
}
function fcn(i) {
  return i >= 1 ? Y2e : i <= -1 ? -Y2e : Math.asin(i);
}
function BKt(i) {
  let e = 3;
  return i.digits = function(t) {
    if (!arguments.length) return e;
    if (t == null)
      e = null;
    else {
      const n = Math.floor(t);
      if (!(n >= 0)) throw new RangeError(`invalid digits: ${t}`);
      e = n;
    }
    return i;
  }, () => new FKt(e);
}
function HKt(i) {
  return typeof i == "object" && "length" in i ? i : Array.from(i);
}
function wVe(i) {
  this._context = i;
}
wVe.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(i, e) {
    switch (i = +i, e = +e, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(i, e) : this._context.moveTo(i, e);
        break;
      case 1:
        this._point = 2;
      // falls through
      default:
        this._context.lineTo(i, e);
        break;
    }
  }
};
function nj(i) {
  return new wVe(i);
}
function WKt(i) {
  return i[0];
}
function VKt(i) {
  return i[1];
}
function UKt(i, e) {
  var t = WI(!0), n = null, r = nj, s = null, o = BKt(a);
  i = typeof i == "function" ? i : i === void 0 ? WKt : WI(i), e = typeof e == "function" ? e : e === void 0 ? VKt : WI(e);
  function a(l) {
    var c, u = (l = HKt(l)).length, d, h = !1, g;
    for (n == null && (s = r(g = o())), c = 0; c <= u; ++c)
      !(c < u && t(d = l[c], c, l)) === h && ((h = !h) ? s.lineStart() : s.lineEnd()), h && s.point(+i(d, c, l), +e(d, c, l));
    if (g) return s = null, g + "" || null;
  }
  return a.x = function(l) {
    return arguments.length ? (i = typeof l == "function" ? l : WI(+l), a) : i;
  }, a.y = function(l) {
    return arguments.length ? (e = typeof l == "function" ? l : WI(+l), a) : e;
  }, a.defined = function(l) {
    return arguments.length ? (t = typeof l == "function" ? l : WI(!!l), a) : t;
  }, a.curve = function(l) {
    return arguments.length ? (r = l, n != null && (s = r(n)), a) : r;
  }, a.context = function(l) {
    return arguments.length ? (l == null ? n = s = null : s = r(n = l), a) : n;
  }, a;
}
class SVe {
  constructor(e, t) {
    this._context = e, this._x = t;
  }
  areaStart() {
    this._line = 0;
  }
  areaEnd() {
    this._line = NaN;
  }
  lineStart() {
    this._point = 0;
  }
  lineEnd() {
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  }
  point(e, t) {
    switch (e = +e, t = +t, this._point) {
      case 0: {
        this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
        break;
      }
      case 1:
        this._point = 2;
      // falls through
      default: {
        this._x ? this._context.bezierCurveTo(this._x0 = (this._x0 + e) / 2, this._y0, this._x0, t, e, t) : this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + t) / 2, e, this._y0, e, t);
        break;
      }
    }
    this._x0 = e, this._y0 = t;
  }
}
function EVe(i) {
  return new SVe(i, !0);
}
function xVe(i) {
  return new SVe(i, !1);
}
function _w() {
}
function ij(i, e, t) {
  i._context.bezierCurveTo(
    (2 * i._x0 + i._x1) / 3,
    (2 * i._y0 + i._y1) / 3,
    (i._x0 + 2 * i._x1) / 3,
    (i._y0 + 2 * i._y1) / 3,
    (i._x0 + 4 * i._x1 + e) / 6,
    (i._y0 + 4 * i._y1 + t) / 6
  );
}
function BY(i) {
  this._context = i;
}
BY.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 3:
        ij(this, this._x1, this._y1);
      // falls through
      case 2:
        this._context.lineTo(this._x1, this._y1);
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(i, e) {
    switch (i = +i, e = +e, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(i, e) : this._context.moveTo(i, e);
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3, this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
      // falls through
      default:
        ij(this, i, e);
        break;
    }
    this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = e;
  }
};
function fV(i) {
  return new BY(i);
}
function LVe(i) {
  this._context = i;
}
LVe.prototype = {
  areaStart: _w,
  areaEnd: _w,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x2, this._y2), this._context.closePath();
        break;
      }
      case 2: {
        this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3), this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3), this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x2, this._y2), this.point(this._x3, this._y3), this.point(this._x4, this._y4);
        break;
      }
    }
  },
  point: function(i, e) {
    switch (i = +i, e = +e, this._point) {
      case 0:
        this._point = 1, this._x2 = i, this._y2 = e;
        break;
      case 1:
        this._point = 2, this._x3 = i, this._y3 = e;
        break;
      case 2:
        this._point = 3, this._x4 = i, this._y4 = e, this._context.moveTo((this._x0 + 4 * this._x1 + i) / 6, (this._y0 + 4 * this._y1 + e) / 6);
        break;
      default:
        ij(this, i, e);
        break;
    }
    this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = e;
  }
};
function zKt(i) {
  return new LVe(i);
}
function TVe(i) {
  this._context = i;
}
TVe.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(i, e) {
    switch (i = +i, e = +e, this._point) {
      case 0:
        this._point = 1;
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3;
        var t = (this._x0 + 4 * this._x1 + i) / 6, n = (this._y0 + 4 * this._y1 + e) / 6;
        this._line ? this._context.lineTo(t, n) : this._context.moveTo(t, n);
        break;
      case 3:
        this._point = 4;
      // falls through
      default:
        ij(this, i, e);
        break;
    }
    this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = e;
  }
};
function $Kt(i) {
  return new TVe(i);
}
function kVe(i, e) {
  this._basis = new BY(i), this._beta = e;
}
kVe.prototype = {
  lineStart: function() {
    this._x = [], this._y = [], this._basis.lineStart();
  },
  lineEnd: function() {
    var i = this._x, e = this._y, t = i.length - 1;
    if (t > 0)
      for (var n = i[0], r = e[0], s = i[t] - n, o = e[t] - r, a = -1, l; ++a <= t; )
        l = a / t, this._basis.point(
          this._beta * i[a] + (1 - this._beta) * (n + l * s),
          this._beta * e[a] + (1 - this._beta) * (r + l * o)
        );
    this._x = this._y = null, this._basis.lineEnd();
  },
  point: function(i, e) {
    this._x.push(+i), this._y.push(+e);
  }
};
const jKt = (function i(e) {
  function t(n) {
    return e === 1 ? new BY(n) : new kVe(n, e);
  }
  return t.beta = function(n) {
    return i(+n);
  }, t;
})(0.85);
function rj(i, e, t) {
  i._context.bezierCurveTo(
    i._x1 + i._k * (i._x2 - i._x0),
    i._y1 + i._k * (i._y2 - i._y0),
    i._x2 + i._k * (i._x1 - e),
    i._y2 + i._k * (i._y1 - t),
    i._x2,
    i._y2
  );
}
function oCe(i, e) {
  this._context = i, this._k = (1 - e) / 6;
}
oCe.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2:
        this._context.lineTo(this._x2, this._y2);
        break;
      case 3:
        rj(this, this._x1, this._y1);
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(i, e) {
    switch (i = +i, e = +e, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(i, e) : this._context.moveTo(i, e);
        break;
      case 1:
        this._point = 2, this._x1 = i, this._y1 = e;
        break;
      case 2:
        this._point = 3;
      // falls through
      default:
        rj(this, i, e);
        break;
    }
    this._x0 = this._x1, this._x1 = this._x2, this._x2 = i, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const DVe = (function i(e) {
  function t(n) {
    return new oCe(n, e);
  }
  return t.tension = function(n) {
    return i(+n);
  }, t;
})(0);
function aCe(i, e) {
  this._context = i, this._k = (1 - e) / 6;
}
aCe.prototype = {
  areaStart: _w,
  areaEnd: _w,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 2: {
        this._context.lineTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
        break;
      }
    }
  },
  point: function(i, e) {
    switch (i = +i, e = +e, this._point) {
      case 0:
        this._point = 1, this._x3 = i, this._y3 = e;
        break;
      case 1:
        this._point = 2, this._context.moveTo(this._x4 = i, this._y4 = e);
        break;
      case 2:
        this._point = 3, this._x5 = i, this._y5 = e;
        break;
      default:
        rj(this, i, e);
        break;
    }
    this._x0 = this._x1, this._x1 = this._x2, this._x2 = i, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const GKt = (function i(e) {
  function t(n) {
    return new aCe(n, e);
  }
  return t.tension = function(n) {
    return i(+n);
  }, t;
})(0);
function lCe(i, e) {
  this._context = i, this._k = (1 - e) / 6;
}
lCe.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(i, e) {
    switch (i = +i, e = +e, this._point) {
      case 0:
        this._point = 1;
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
        break;
      case 3:
        this._point = 4;
      // falls through
      default:
        rj(this, i, e);
        break;
    }
    this._x0 = this._x1, this._x1 = this._x2, this._x2 = i, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const qKt = (function i(e) {
  function t(n) {
    return new lCe(n, e);
  }
  return t.tension = function(n) {
    return i(+n);
  }, t;
})(0);
function cCe(i, e, t) {
  var n = i._x1, r = i._y1, s = i._x2, o = i._y2;
  if (i._l01_a > K2e) {
    var a = 2 * i._l01_2a + 3 * i._l01_a * i._l12_a + i._l12_2a, l = 3 * i._l01_a * (i._l01_a + i._l12_a);
    n = (n * a - i._x0 * i._l12_2a + i._x2 * i._l01_2a) / l, r = (r * a - i._y0 * i._l12_2a + i._y2 * i._l01_2a) / l;
  }
  if (i._l23_a > K2e) {
    var c = 2 * i._l23_2a + 3 * i._l23_a * i._l12_a + i._l12_2a, u = 3 * i._l23_a * (i._l23_a + i._l12_a);
    s = (s * c + i._x1 * i._l23_2a - e * i._l12_2a) / u, o = (o * c + i._y1 * i._l23_2a - t * i._l12_2a) / u;
  }
  i._context.bezierCurveTo(n, r, s, o, i._x2, i._y2);
}
function IVe(i, e) {
  this._context = i, this._alpha = e;
}
IVe.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2:
        this._context.lineTo(this._x2, this._y2);
        break;
      case 3:
        this.point(this._x2, this._y2);
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(i, e) {
    if (i = +i, e = +e, this._point) {
      var t = this._x2 - i, n = this._y2 - e;
      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(t * t + n * n, this._alpha));
    }
    switch (this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(i, e) : this._context.moveTo(i, e);
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3;
      // falls through
      default:
        cCe(this, i, e);
        break;
    }
    this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = i, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const NVe = (function i(e) {
  function t(n) {
    return e ? new IVe(n, e) : new oCe(n, 0);
  }
  return t.alpha = function(n) {
    return i(+n);
  }, t;
})(0.5);
function RVe(i, e) {
  this._context = i, this._alpha = e;
}
RVe.prototype = {
  areaStart: _w,
  areaEnd: _w,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 2: {
        this._context.lineTo(this._x3, this._y3), this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
        break;
      }
    }
  },
  point: function(i, e) {
    if (i = +i, e = +e, this._point) {
      var t = this._x2 - i, n = this._y2 - e;
      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(t * t + n * n, this._alpha));
    }
    switch (this._point) {
      case 0:
        this._point = 1, this._x3 = i, this._y3 = e;
        break;
      case 1:
        this._point = 2, this._context.moveTo(this._x4 = i, this._y4 = e);
        break;
      case 2:
        this._point = 3, this._x5 = i, this._y5 = e;
        break;
      default:
        cCe(this, i, e);
        break;
    }
    this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = i, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const KKt = (function i(e) {
  function t(n) {
    return e ? new RVe(n, e) : new aCe(n, 0);
  }
  return t.alpha = function(n) {
    return i(+n);
  }, t;
})(0.5);
function AVe(i, e) {
  this._context = i, this._alpha = e;
}
AVe.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(i, e) {
    if (i = +i, e = +e, this._point) {
      var t = this._x2 - i, n = this._y2 - e;
      this._l23_a = Math.sqrt(this._l23_2a = Math.pow(t * t + n * n, this._alpha));
    }
    switch (this._point) {
      case 0:
        this._point = 1;
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
        break;
      case 3:
        this._point = 4;
      // falls through
      default:
        cCe(this, i, e);
        break;
    }
    this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = i, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e;
  }
};
const YKt = (function i(e) {
  function t(n) {
    return e ? new AVe(n, e) : new lCe(n, 0);
  }
  return t.alpha = function(n) {
    return i(+n);
  }, t;
})(0.5);
function OVe(i) {
  this._context = i;
}
OVe.prototype = {
  areaStart: _w,
  areaEnd: _w,
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    this._point && this._context.closePath();
  },
  point: function(i, e) {
    i = +i, e = +e, this._point ? this._context.lineTo(i, e) : (this._point = 1, this._context.moveTo(i, e));
  }
};
function XKt(i) {
  return new OVe(i);
}
function X2e(i) {
  return i < 0 ? -1 : 1;
}
function Z2e(i, e, t) {
  var n = i._x1 - i._x0, r = e - i._x1, s = (i._y1 - i._y0) / (n || r < 0 && -0), o = (t - i._y1) / (r || n < 0 && -0), a = (s * r + o * n) / (n + r);
  return (X2e(s) + X2e(o)) * Math.min(Math.abs(s), Math.abs(o), 0.5 * Math.abs(a)) || 0;
}
function Q2e(i, e) {
  var t = i._x1 - i._x0;
  return t ? (3 * (i._y1 - i._y0) / t - e) / 2 : e;
}
function Nne(i, e, t) {
  var n = i._x0, r = i._y0, s = i._x1, o = i._y1, a = (s - n) / 3;
  i._context.bezierCurveTo(n + a, r + a * e, s - a, o - a * t, s, o);
}
function sj(i) {
  this._context = i;
}
sj.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2:
        this._context.lineTo(this._x1, this._y1);
        break;
      case 3:
        Nne(this, this._t0, Q2e(this, this._t0));
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(i, e) {
    var t = NaN;
    if (i = +i, e = +e, !(i === this._x1 && e === this._y1)) {
      switch (this._point) {
        case 0:
          this._point = 1, this._line ? this._context.lineTo(i, e) : this._context.moveTo(i, e);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3, Nne(this, Q2e(this, t = Z2e(this, i, e)), t);
          break;
        default:
          Nne(this, this._t0, t = Z2e(this, i, e));
          break;
      }
      this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = e, this._t0 = t;
    }
  }
};
function MVe(i) {
  this._context = new PVe(i);
}
(MVe.prototype = Object.create(sj.prototype)).point = function(i, e) {
  sj.prototype.point.call(this, e, i);
};
function PVe(i) {
  this._context = i;
}
PVe.prototype = {
  moveTo: function(i, e) {
    this._context.moveTo(e, i);
  },
  closePath: function() {
    this._context.closePath();
  },
  lineTo: function(i, e) {
    this._context.lineTo(e, i);
  },
  bezierCurveTo: function(i, e, t, n, r, s) {
    this._context.bezierCurveTo(e, i, n, t, s, r);
  }
};
function FVe(i) {
  return new sj(i);
}
function BVe(i) {
  return new MVe(i);
}
function HVe(i) {
  this._context = i;
}
HVe.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = [], this._y = [];
  },
  lineEnd: function() {
    var i = this._x, e = this._y, t = i.length;
    if (t)
      if (this._line ? this._context.lineTo(i[0], e[0]) : this._context.moveTo(i[0], e[0]), t === 2)
        this._context.lineTo(i[1], e[1]);
      else
        for (var n = J2e(i), r = J2e(e), s = 0, o = 1; o < t; ++s, ++o)
          this._context.bezierCurveTo(n[0][s], r[0][s], n[1][s], r[1][s], i[o], e[o]);
    (this._line || this._line !== 0 && t === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null;
  },
  point: function(i, e) {
    this._x.push(+i), this._y.push(+e);
  }
};
function J2e(i) {
  var e, t = i.length - 1, n, r = new Array(t), s = new Array(t), o = new Array(t);
  for (r[0] = 0, s[0] = 2, o[0] = i[0] + 2 * i[1], e = 1; e < t - 1; ++e) r[e] = 1, s[e] = 4, o[e] = 4 * i[e] + 2 * i[e + 1];
  for (r[t - 1] = 2, s[t - 1] = 7, o[t - 1] = 8 * i[t - 1] + i[t], e = 1; e < t; ++e) n = r[e] / s[e - 1], s[e] -= n, o[e] -= n * o[e - 1];
  for (r[t - 1] = o[t - 1] / s[t - 1], e = t - 2; e >= 0; --e) r[e] = (o[e] - r[e + 1]) / s[e];
  for (s[t - 1] = (i[t] + r[t - 1]) / 2, e = 0; e < t - 1; ++e) s[e] = 2 * i[e + 1] - r[e + 1];
  return [r, s];
}
function WVe(i) {
  return new HVe(i);
}
function HY(i, e) {
  this._context = i, this._t = e;
}
HY.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = this._y = NaN, this._point = 0;
  },
  lineEnd: function() {
    0 < this._t && this._t < 1 && this._point === 2 && this._context.lineTo(this._x, this._y), (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line >= 0 && (this._t = 1 - this._t, this._line = 1 - this._line);
  },
  point: function(i, e) {
    switch (i = +i, e = +e, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(i, e) : this._context.moveTo(i, e);
        break;
      case 1:
        this._point = 2;
      // falls through
      default: {
        if (this._t <= 0)
          this._context.lineTo(this._x, e), this._context.lineTo(i, e);
        else {
          var t = this._x * (1 - this._t) + i * this._t;
          this._context.lineTo(t, this._y), this._context.lineTo(t, e);
        }
        break;
      }
    }
    this._x = i, this._y = e;
  }
};
function VVe(i) {
  return new HY(i, 0.5);
}
function UVe(i) {
  return new HY(i, 0);
}
function zVe(i) {
  return new HY(i, 1);
}
function hF(i, e, t) {
  this.k = i, this.x = e, this.y = t;
}
hF.prototype = {
  constructor: hF,
  scale: function(i) {
    return i === 1 ? this : new hF(this.k * i, this.x, this.y);
  },
  translate: function(i, e) {
    return i === 0 & e === 0 ? this : new hF(this.k, this.x + this.k * i, this.y + this.k * e);
  },
  apply: function(i) {
    return [i[0] * this.k + this.x, i[1] * this.k + this.y];
  },
  applyX: function(i) {
    return i * this.k + this.x;
  },
  applyY: function(i) {
    return i * this.k + this.y;
  },
  invert: function(i) {
    return [(i[0] - this.x) / this.k, (i[1] - this.y) / this.k];
  },
  invertX: function(i) {
    return (i - this.x) / this.k;
  },
  invertY: function(i) {
    return (i - this.y) / this.k;
  },
  rescaleX: function(i) {
    return i.copy().domain(i.range().map(this.invertX, this).map(i.invert, i));
  },
  rescaleY: function(i) {
    return i.copy().domain(i.range().map(this.invertY, this).map(i.invert, i));
  },
  toString: function() {
    return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
  }
};
hF.prototype;
var ZKt = /* @__PURE__ */ $((i) => {
  var r;
  const { securityLevel: e } = Qs();
  let t = ls("body");
  if (e === "sandbox") {
    const o = ((r = ls(`#i${i}`).node()) == null ? void 0 : r.contentDocument) ?? document;
    t = ls(o.body);
  }
  return t.select(`#${i}`);
}, "selectSvgElement");
function uCe(i) {
  return typeof i > "u" || i === null;
}
$(uCe, "isNothing");
function $Ve(i) {
  return typeof i == "object" && i !== null;
}
$($Ve, "isObject");
function jVe(i) {
  return Array.isArray(i) ? i : uCe(i) ? [] : [i];
}
$(jVe, "toArray");
function GVe(i, e) {
  var t, n, r, s;
  if (e)
    for (s = Object.keys(e), t = 0, n = s.length; t < n; t += 1)
      r = s[t], i[r] = e[r];
  return i;
}
$(GVe, "extend");
function qVe(i, e) {
  var t = "", n;
  for (n = 0; n < e; n += 1)
    t += i;
  return t;
}
$(qVe, "repeat");
function KVe(i) {
  return i === 0 && Number.NEGATIVE_INFINITY === 1 / i;
}
$(KVe, "isNegativeZero");
var QKt = uCe, JKt = $Ve, eYt = jVe, tYt = qVe, nYt = KVe, iYt = GVe, Zl = {
  isNothing: QKt,
  isObject: JKt,
  toArray: eYt,
  repeat: tYt,
  isNegativeZero: nYt,
  extend: iYt
};
function dCe(i, e) {
  var t = "", n = i.reason || "(unknown reason)";
  return i.mark ? (i.mark.name && (t += 'in "' + i.mark.name + '" '), t += "(" + (i.mark.line + 1) + ":" + (i.mark.column + 1) + ")", !e && i.mark.snippet && (t += `

` + i.mark.snippet), n + " " + t) : n;
}
$(dCe, "formatError");
function PA(i, e) {
  Error.call(this), this.name = "YAMLException", this.reason = i, this.mark = e, this.message = dCe(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
}
$(PA, "YAMLException$1");
PA.prototype = Object.create(Error.prototype);
PA.prototype.constructor = PA;
PA.prototype.toString = /* @__PURE__ */ $(function(e) {
  return this.name + ": " + dCe(this, e);
}, "toString");
var Mh = PA;
function gV(i, e, t, n, r) {
  var s = "", o = "", a = Math.floor(r / 2) - 1;
  return n - e > a && (s = " ... ", e = n - a + s.length), t - n > a && (o = " ...", t = n + a - o.length), {
    str: s + i.slice(e, t).replace(/\t/g, "→") + o,
    pos: n - e + s.length
    // relative position
  };
}
$(gV, "getLine");
function pV(i, e) {
  return Zl.repeat(" ", e - i.length) + i;
}
$(pV, "padStart");
function YVe(i, e) {
  if (e = Object.create(e || null), !i.buffer) return null;
  e.maxLength || (e.maxLength = 79), typeof e.indent != "number" && (e.indent = 1), typeof e.linesBefore != "number" && (e.linesBefore = 3), typeof e.linesAfter != "number" && (e.linesAfter = 2);
  for (var t = /\r?\n|\r|\0/g, n = [0], r = [], s, o = -1; s = t.exec(i.buffer); )
    r.push(s.index), n.push(s.index + s[0].length), i.position <= s.index && o < 0 && (o = n.length - 2);
  o < 0 && (o = n.length - 1);
  var a = "", l, c, u = Math.min(i.line + e.linesAfter, r.length).toString().length, d = e.maxLength - (e.indent + u + 3);
  for (l = 1; l <= e.linesBefore && !(o - l < 0); l++)
    c = gV(
      i.buffer,
      n[o - l],
      r[o - l],
      i.position - (n[o] - n[o - l]),
      d
    ), a = Zl.repeat(" ", e.indent) + pV((i.line - l + 1).toString(), u) + " | " + c.str + `
` + a;
  for (c = gV(i.buffer, n[o], r[o], i.position, d), a += Zl.repeat(" ", e.indent) + pV((i.line + 1).toString(), u) + " | " + c.str + `
`, a += Zl.repeat("-", e.indent + u + 3 + c.pos) + `^
`, l = 1; l <= e.linesAfter && !(o + l >= r.length); l++)
    c = gV(
      i.buffer,
      n[o + l],
      r[o + l],
      i.position - (n[o] - n[o + l]),
      d
    ), a += Zl.repeat(" ", e.indent) + pV((i.line + l + 1).toString(), u) + " | " + c.str + `
`;
  return a.replace(/\n$/, "");
}
$(YVe, "makeSnippet");
var rYt = YVe, sYt = [
  "kind",
  "multi",
  "resolve",
  "construct",
  "instanceOf",
  "predicate",
  "represent",
  "representName",
  "defaultStyle",
  "styleAliases"
], oYt = [
  "scalar",
  "sequence",
  "mapping"
];
function XVe(i) {
  var e = {};
  return i !== null && Object.keys(i).forEach(function(t) {
    i[t].forEach(function(n) {
      e[String(n)] = t;
    });
  }), e;
}
$(XVe, "compileStyleAliases");
function ZVe(i, e) {
  if (e = e || {}, Object.keys(e).forEach(function(t) {
    if (sYt.indexOf(t) === -1)
      throw new Mh('Unknown option "' + t + '" is met in definition of "' + i + '" YAML type.');
  }), this.options = e, this.tag = i, this.kind = e.kind || null, this.resolve = e.resolve || function() {
    return !0;
  }, this.construct = e.construct || function(t) {
    return t;
  }, this.instanceOf = e.instanceOf || null, this.predicate = e.predicate || null, this.represent = e.represent || null, this.representName = e.representName || null, this.defaultStyle = e.defaultStyle || null, this.multi = e.multi || !1, this.styleAliases = XVe(e.styleAliases || null), oYt.indexOf(this.kind) === -1)
    throw new Mh('Unknown kind "' + this.kind + '" is specified for "' + i + '" YAML type.');
}
$(ZVe, "Type$1");
var Yu = ZVe;
function Wde(i, e) {
  var t = [];
  return i[e].forEach(function(n) {
    var r = t.length;
    t.forEach(function(s, o) {
      s.tag === n.tag && s.kind === n.kind && s.multi === n.multi && (r = o);
    }), t[r] = n;
  }), t;
}
$(Wde, "compileList");
function QVe() {
  var i = {
    scalar: {},
    sequence: {},
    mapping: {},
    fallback: {},
    multi: {
      scalar: [],
      sequence: [],
      mapping: [],
      fallback: []
    }
  }, e, t;
  function n(r) {
    r.multi ? (i.multi[r.kind].push(r), i.multi.fallback.push(r)) : i[r.kind][r.tag] = i.fallback[r.tag] = r;
  }
  for ($(n, "collectType"), e = 0, t = arguments.length; e < t; e += 1)
    arguments[e].forEach(n);
  return i;
}
$(QVe, "compileMap");
function oj(i) {
  return this.extend(i);
}
$(oj, "Schema$1");
oj.prototype.extend = /* @__PURE__ */ $(function(e) {
  var t = [], n = [];
  if (e instanceof Yu)
    n.push(e);
  else if (Array.isArray(e))
    n = n.concat(e);
  else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit)))
    e.implicit && (t = t.concat(e.implicit)), e.explicit && (n = n.concat(e.explicit));
  else
    throw new Mh("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
  t.forEach(function(s) {
    if (!(s instanceof Yu))
      throw new Mh("Specified list of YAML types (or a single Type object) contains a non-Type object.");
    if (s.loadKind && s.loadKind !== "scalar")
      throw new Mh("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
    if (s.multi)
      throw new Mh("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
  }), n.forEach(function(s) {
    if (!(s instanceof Yu))
      throw new Mh("Specified list of YAML types (or a single Type object) contains a non-Type object.");
  });
  var r = Object.create(oj.prototype);
  return r.implicit = (this.implicit || []).concat(t), r.explicit = (this.explicit || []).concat(n), r.compiledImplicit = Wde(r, "implicit"), r.compiledExplicit = Wde(r, "explicit"), r.compiledTypeMap = QVe(r.compiledImplicit, r.compiledExplicit), r;
}, "extend");
var aYt = oj, lYt = new Yu("tag:yaml.org,2002:str", {
  kind: "scalar",
  construct: /* @__PURE__ */ $(function(i) {
    return i !== null ? i : "";
  }, "construct")
}), cYt = new Yu("tag:yaml.org,2002:seq", {
  kind: "sequence",
  construct: /* @__PURE__ */ $(function(i) {
    return i !== null ? i : [];
  }, "construct")
}), uYt = new Yu("tag:yaml.org,2002:map", {
  kind: "mapping",
  construct: /* @__PURE__ */ $(function(i) {
    return i !== null ? i : {};
  }, "construct")
}), dYt = new aYt({
  explicit: [
    lYt,
    cYt,
    uYt
  ]
});
function JVe(i) {
  if (i === null) return !0;
  var e = i.length;
  return e === 1 && i === "~" || e === 4 && (i === "null" || i === "Null" || i === "NULL");
}
$(JVe, "resolveYamlNull");
function eUe() {
  return null;
}
$(eUe, "constructYamlNull");
function tUe(i) {
  return i === null;
}
$(tUe, "isNull");
var hYt = new Yu("tag:yaml.org,2002:null", {
  kind: "scalar",
  resolve: JVe,
  construct: eUe,
  predicate: tUe,
  represent: {
    canonical: /* @__PURE__ */ $(function() {
      return "~";
    }, "canonical"),
    lowercase: /* @__PURE__ */ $(function() {
      return "null";
    }, "lowercase"),
    uppercase: /* @__PURE__ */ $(function() {
      return "NULL";
    }, "uppercase"),
    camelcase: /* @__PURE__ */ $(function() {
      return "Null";
    }, "camelcase"),
    empty: /* @__PURE__ */ $(function() {
      return "";
    }, "empty")
  },
  defaultStyle: "lowercase"
});
function nUe(i) {
  if (i === null) return !1;
  var e = i.length;
  return e === 4 && (i === "true" || i === "True" || i === "TRUE") || e === 5 && (i === "false" || i === "False" || i === "FALSE");
}
$(nUe, "resolveYamlBoolean");
function iUe(i) {
  return i === "true" || i === "True" || i === "TRUE";
}
$(iUe, "constructYamlBoolean");
function rUe(i) {
  return Object.prototype.toString.call(i) === "[object Boolean]";
}
$(rUe, "isBoolean");
var fYt = new Yu("tag:yaml.org,2002:bool", {
  kind: "scalar",
  resolve: nUe,
  construct: iUe,
  predicate: rUe,
  represent: {
    lowercase: /* @__PURE__ */ $(function(i) {
      return i ? "true" : "false";
    }, "lowercase"),
    uppercase: /* @__PURE__ */ $(function(i) {
      return i ? "TRUE" : "FALSE";
    }, "uppercase"),
    camelcase: /* @__PURE__ */ $(function(i) {
      return i ? "True" : "False";
    }, "camelcase")
  },
  defaultStyle: "lowercase"
});
function sUe(i) {
  return 48 <= i && i <= 57 || 65 <= i && i <= 70 || 97 <= i && i <= 102;
}
$(sUe, "isHexCode");
function oUe(i) {
  return 48 <= i && i <= 55;
}
$(oUe, "isOctCode");
function aUe(i) {
  return 48 <= i && i <= 57;
}
$(aUe, "isDecCode");
function lUe(i) {
  if (i === null) return !1;
  var e = i.length, t = 0, n = !1, r;
  if (!e) return !1;
  if (r = i[t], (r === "-" || r === "+") && (r = i[++t]), r === "0") {
    if (t + 1 === e) return !0;
    if (r = i[++t], r === "b") {
      for (t++; t < e; t++)
        if (r = i[t], r !== "_") {
          if (r !== "0" && r !== "1") return !1;
          n = !0;
        }
      return n && r !== "_";
    }
    if (r === "x") {
      for (t++; t < e; t++)
        if (r = i[t], r !== "_") {
          if (!sUe(i.charCodeAt(t))) return !1;
          n = !0;
        }
      return n && r !== "_";
    }
    if (r === "o") {
      for (t++; t < e; t++)
        if (r = i[t], r !== "_") {
          if (!oUe(i.charCodeAt(t))) return !1;
          n = !0;
        }
      return n && r !== "_";
    }
  }
  if (r === "_") return !1;
  for (; t < e; t++)
    if (r = i[t], r !== "_") {
      if (!aUe(i.charCodeAt(t)))
        return !1;
      n = !0;
    }
  return !(!n || r === "_");
}
$(lUe, "resolveYamlInteger");
function cUe(i) {
  var e = i, t = 1, n;
  if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), n = e[0], (n === "-" || n === "+") && (n === "-" && (t = -1), e = e.slice(1), n = e[0]), e === "0") return 0;
  if (n === "0") {
    if (e[1] === "b") return t * parseInt(e.slice(2), 2);
    if (e[1] === "x") return t * parseInt(e.slice(2), 16);
    if (e[1] === "o") return t * parseInt(e.slice(2), 8);
  }
  return t * parseInt(e, 10);
}
$(cUe, "constructYamlInteger");
function uUe(i) {
  return Object.prototype.toString.call(i) === "[object Number]" && i % 1 === 0 && !Zl.isNegativeZero(i);
}
$(uUe, "isInteger");
var gYt = new Yu("tag:yaml.org,2002:int", {
  kind: "scalar",
  resolve: lUe,
  construct: cUe,
  predicate: uUe,
  represent: {
    binary: /* @__PURE__ */ $(function(i) {
      return i >= 0 ? "0b" + i.toString(2) : "-0b" + i.toString(2).slice(1);
    }, "binary"),
    octal: /* @__PURE__ */ $(function(i) {
      return i >= 0 ? "0o" + i.toString(8) : "-0o" + i.toString(8).slice(1);
    }, "octal"),
    decimal: /* @__PURE__ */ $(function(i) {
      return i.toString(10);
    }, "decimal"),
    /* eslint-disable max-len */
    hexadecimal: /* @__PURE__ */ $(function(i) {
      return i >= 0 ? "0x" + i.toString(16).toUpperCase() : "-0x" + i.toString(16).toUpperCase().slice(1);
    }, "hexadecimal")
  },
  defaultStyle: "decimal",
  styleAliases: {
    binary: [2, "bin"],
    octal: [8, "oct"],
    decimal: [10, "dec"],
    hexadecimal: [16, "hex"]
  }
}), pYt = new RegExp(
  // 2.5e4, 2.5 and integers
  "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
);
function dUe(i) {
  return !(i === null || !pYt.test(i) || // Quick hack to not allow integers end with `_`
  // Probably should update regexp & check speed
  i[i.length - 1] === "_");
}
$(dUe, "resolveYamlFloat");
function hUe(i) {
  var e, t;
  return e = i.replace(/_/g, "").toLowerCase(), t = e[0] === "-" ? -1 : 1, "+-".indexOf(e[0]) >= 0 && (e = e.slice(1)), e === ".inf" ? t === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : e === ".nan" ? NaN : t * parseFloat(e, 10);
}
$(hUe, "constructYamlFloat");
var mYt = /^[-+]?[0-9]+e/;
function fUe(i, e) {
  var t;
  if (isNaN(i))
    switch (e) {
      case "lowercase":
        return ".nan";
      case "uppercase":
        return ".NAN";
      case "camelcase":
        return ".NaN";
    }
  else if (Number.POSITIVE_INFINITY === i)
    switch (e) {
      case "lowercase":
        return ".inf";
      case "uppercase":
        return ".INF";
      case "camelcase":
        return ".Inf";
    }
  else if (Number.NEGATIVE_INFINITY === i)
    switch (e) {
      case "lowercase":
        return "-.inf";
      case "uppercase":
        return "-.INF";
      case "camelcase":
        return "-.Inf";
    }
  else if (Zl.isNegativeZero(i))
    return "-0.0";
  return t = i.toString(10), mYt.test(t) ? t.replace("e", ".e") : t;
}
$(fUe, "representYamlFloat");
function gUe(i) {
  return Object.prototype.toString.call(i) === "[object Number]" && (i % 1 !== 0 || Zl.isNegativeZero(i));
}
$(gUe, "isFloat");
var _Yt = new Yu("tag:yaml.org,2002:float", {
  kind: "scalar",
  resolve: dUe,
  construct: hUe,
  predicate: gUe,
  represent: fUe,
  defaultStyle: "lowercase"
}), pUe = dYt.extend({
  implicit: [
    hYt,
    fYt,
    gYt,
    _Yt
  ]
}), bYt = pUe, mUe = new RegExp(
  "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
), _Ue = new RegExp(
  "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
);
function bUe(i) {
  return i === null ? !1 : mUe.exec(i) !== null || _Ue.exec(i) !== null;
}
$(bUe, "resolveYamlTimestamp");
function vUe(i) {
  var e, t, n, r, s, o, a, l = 0, c = null, u, d, h;
  if (e = mUe.exec(i), e === null && (e = _Ue.exec(i)), e === null) throw new Error("Date resolve error");
  if (t = +e[1], n = +e[2] - 1, r = +e[3], !e[4])
    return new Date(Date.UTC(t, n, r));
  if (s = +e[4], o = +e[5], a = +e[6], e[7]) {
    for (l = e[7].slice(0, 3); l.length < 3; )
      l += "0";
    l = +l;
  }
  return e[9] && (u = +e[10], d = +(e[11] || 0), c = (u * 60 + d) * 6e4, e[9] === "-" && (c = -c)), h = new Date(Date.UTC(t, n, r, s, o, a, l)), c && h.setTime(h.getTime() - c), h;
}
$(vUe, "constructYamlTimestamp");
function yUe(i) {
  return i.toISOString();
}
$(yUe, "representYamlTimestamp");
var vYt = new Yu("tag:yaml.org,2002:timestamp", {
  kind: "scalar",
  resolve: bUe,
  construct: vUe,
  instanceOf: Date,
  represent: yUe
});
function CUe(i) {
  return i === "<<" || i === null;
}
$(CUe, "resolveYamlMerge");
var yYt = new Yu("tag:yaml.org,2002:merge", {
  kind: "scalar",
  resolve: CUe
}), hCe = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;
function wUe(i) {
  if (i === null) return !1;
  var e, t, n = 0, r = i.length, s = hCe;
  for (t = 0; t < r; t++)
    if (e = s.indexOf(i.charAt(t)), !(e > 64)) {
      if (e < 0) return !1;
      n += 6;
    }
  return n % 8 === 0;
}
$(wUe, "resolveYamlBinary");
function SUe(i) {
  var e, t, n = i.replace(/[\r\n=]/g, ""), r = n.length, s = hCe, o = 0, a = [];
  for (e = 0; e < r; e++)
    e % 4 === 0 && e && (a.push(o >> 16 & 255), a.push(o >> 8 & 255), a.push(o & 255)), o = o << 6 | s.indexOf(n.charAt(e));
  return t = r % 4 * 6, t === 0 ? (a.push(o >> 16 & 255), a.push(o >> 8 & 255), a.push(o & 255)) : t === 18 ? (a.push(o >> 10 & 255), a.push(o >> 2 & 255)) : t === 12 && a.push(o >> 4 & 255), new Uint8Array(a);
}
$(SUe, "constructYamlBinary");
function EUe(i) {
  var e = "", t = 0, n, r, s = i.length, o = hCe;
  for (n = 0; n < s; n++)
    n % 3 === 0 && n && (e += o[t >> 18 & 63], e += o[t >> 12 & 63], e += o[t >> 6 & 63], e += o[t & 63]), t = (t << 8) + i[n];
  return r = s % 3, r === 0 ? (e += o[t >> 18 & 63], e += o[t >> 12 & 63], e += o[t >> 6 & 63], e += o[t & 63]) : r === 2 ? (e += o[t >> 10 & 63], e += o[t >> 4 & 63], e += o[t << 2 & 63], e += o[64]) : r === 1 && (e += o[t >> 2 & 63], e += o[t << 4 & 63], e += o[64], e += o[64]), e;
}
$(EUe, "representYamlBinary");
function xUe(i) {
  return Object.prototype.toString.call(i) === "[object Uint8Array]";
}
$(xUe, "isBinary");
var CYt = new Yu("tag:yaml.org,2002:binary", {
  kind: "scalar",
  resolve: wUe,
  construct: SUe,
  predicate: xUe,
  represent: EUe
}), wYt = Object.prototype.hasOwnProperty, SYt = Object.prototype.toString;
function LUe(i) {
  if (i === null) return !0;
  var e = [], t, n, r, s, o, a = i;
  for (t = 0, n = a.length; t < n; t += 1) {
    if (r = a[t], o = !1, SYt.call(r) !== "[object Object]") return !1;
    for (s in r)
      if (wYt.call(r, s))
        if (!o) o = !0;
        else return !1;
    if (!o) return !1;
    if (e.indexOf(s) === -1) e.push(s);
    else return !1;
  }
  return !0;
}
$(LUe, "resolveYamlOmap");
function TUe(i) {
  return i !== null ? i : [];
}
$(TUe, "constructYamlOmap");
var EYt = new Yu("tag:yaml.org,2002:omap", {
  kind: "sequence",
  resolve: LUe,
  construct: TUe
}), xYt = Object.prototype.toString;
function kUe(i) {
  if (i === null) return !0;
  var e, t, n, r, s, o = i;
  for (s = new Array(o.length), e = 0, t = o.length; e < t; e += 1) {
    if (n = o[e], xYt.call(n) !== "[object Object]" || (r = Object.keys(n), r.length !== 1)) return !1;
    s[e] = [r[0], n[r[0]]];
  }
  return !0;
}
$(kUe, "resolveYamlPairs");
function DUe(i) {
  if (i === null) return [];
  var e, t, n, r, s, o = i;
  for (s = new Array(o.length), e = 0, t = o.length; e < t; e += 1)
    n = o[e], r = Object.keys(n), s[e] = [r[0], n[r[0]]];
  return s;
}
$(DUe, "constructYamlPairs");
var LYt = new Yu("tag:yaml.org,2002:pairs", {
  kind: "sequence",
  resolve: kUe,
  construct: DUe
}), TYt = Object.prototype.hasOwnProperty;
function IUe(i) {
  if (i === null) return !0;
  var e, t = i;
  for (e in t)
    if (TYt.call(t, e) && t[e] !== null)
      return !1;
  return !0;
}
$(IUe, "resolveYamlSet");
function NUe(i) {
  return i !== null ? i : {};
}
$(NUe, "constructYamlSet");
var kYt = new Yu("tag:yaml.org,2002:set", {
  kind: "mapping",
  resolve: IUe,
  construct: NUe
}), RUe = bYt.extend({
  implicit: [
    vYt,
    yYt
  ],
  explicit: [
    CYt,
    EYt,
    LYt,
    kYt
  ]
}), bw = Object.prototype.hasOwnProperty, aj = 1, AUe = 2, OUe = 3, lj = 4, Rne = 1, DYt = 2, eOe = 3, IYt = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, NYt = /[\x85\u2028\u2029]/, RYt = /[,\[\]\{\}]/, MUe = /^(?:!|!!|![a-z\-]+!)$/i, PUe = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
function Vde(i) {
  return Object.prototype.toString.call(i);
}
$(Vde, "_class");
function um(i) {
  return i === 10 || i === 13;
}
$(um, "is_EOL");
function O1(i) {
  return i === 9 || i === 32;
}
$(O1, "is_WHITE_SPACE");
function Fd(i) {
  return i === 9 || i === 32 || i === 10 || i === 13;
}
$(Fd, "is_WS_OR_EOL");
function Tx(i) {
  return i === 44 || i === 91 || i === 93 || i === 123 || i === 125;
}
$(Tx, "is_FLOW_INDICATOR");
function FUe(i) {
  var e;
  return 48 <= i && i <= 57 ? i - 48 : (e = i | 32, 97 <= e && e <= 102 ? e - 97 + 10 : -1);
}
$(FUe, "fromHexCode");
function BUe(i) {
  return i === 120 ? 2 : i === 117 ? 4 : i === 85 ? 8 : 0;
}
$(BUe, "escapedHexLen");
function HUe(i) {
  return 48 <= i && i <= 57 ? i - 48 : -1;
}
$(HUe, "fromDecimalCode");
function Ude(i) {
  return i === 48 ? "\0" : i === 97 ? "\x07" : i === 98 ? "\b" : i === 116 || i === 9 ? "	" : i === 110 ? `
` : i === 118 ? "\v" : i === 102 ? "\f" : i === 114 ? "\r" : i === 101 ? "\x1B" : i === 32 ? " " : i === 34 ? '"' : i === 47 ? "/" : i === 92 ? "\\" : i === 78 ? "" : i === 95 ? " " : i === 76 ? "\u2028" : i === 80 ? "\u2029" : "";
}
$(Ude, "simpleEscapeSequence");
function WUe(i) {
  return i <= 65535 ? String.fromCharCode(i) : String.fromCharCode(
    (i - 65536 >> 10) + 55296,
    (i - 65536 & 1023) + 56320
  );
}
$(WUe, "charFromCodepoint");
var VUe = new Array(256), UUe = new Array(256);
for (bE = 0; bE < 256; bE++)
  VUe[bE] = Ude(bE) ? 1 : 0, UUe[bE] = Ude(bE);
var bE;
function zUe(i, e) {
  this.input = i, this.filename = e.filename || null, this.schema = e.schema || RUe, this.onWarning = e.onWarning || null, this.legacy = e.legacy || !1, this.json = e.json || !1, this.listener = e.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = i.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
}
$(zUe, "State$1");
function fCe(i, e) {
  var t = {
    name: i.filename,
    buffer: i.input.slice(0, -1),
    // omit trailing \0
    position: i.position,
    line: i.line,
    column: i.position - i.lineStart
  };
  return t.snippet = rYt(t), new Mh(e, t);
}
$(fCe, "generateError");
function ri(i, e) {
  throw fCe(i, e);
}
$(ri, "throwError");
function J5(i, e) {
  i.onWarning && i.onWarning.call(null, fCe(i, e));
}
$(J5, "throwWarning");
var tOe = {
  YAML: /* @__PURE__ */ $(function(e, t, n) {
    var r, s, o;
    e.version !== null && ri(e, "duplication of %YAML directive"), n.length !== 1 && ri(e, "YAML directive accepts exactly one argument"), r = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), r === null && ri(e, "ill-formed argument of the YAML directive"), s = parseInt(r[1], 10), o = parseInt(r[2], 10), s !== 1 && ri(e, "unacceptable YAML version of the document"), e.version = n[0], e.checkLineBreaks = o < 2, o !== 1 && o !== 2 && J5(e, "unsupported YAML version of the document");
  }, "handleYamlDirective"),
  TAG: /* @__PURE__ */ $(function(e, t, n) {
    var r, s;
    n.length !== 2 && ri(e, "TAG directive accepts exactly two arguments"), r = n[0], s = n[1], MUe.test(r) || ri(e, "ill-formed tag handle (first argument) of the TAG directive"), bw.call(e.tagMap, r) && ri(e, 'there is a previously declared suffix for "' + r + '" tag handle'), PUe.test(s) || ri(e, "ill-formed tag prefix (second argument) of the TAG directive");
    try {
      s = decodeURIComponent(s);
    } catch {
      ri(e, "tag prefix is malformed: " + s);
    }
    e.tagMap[r] = s;
  }, "handleTagDirective")
};
function Uy(i, e, t, n) {
  var r, s, o, a;
  if (e < t) {
    if (a = i.input.slice(e, t), n)
      for (r = 0, s = a.length; r < s; r += 1)
        o = a.charCodeAt(r), o === 9 || 32 <= o && o <= 1114111 || ri(i, "expected valid JSON character");
    else IYt.test(a) && ri(i, "the stream contains non-printable characters");
    i.result += a;
  }
}
$(Uy, "captureSegment");
function zde(i, e, t, n) {
  var r, s, o, a;
  for (Zl.isObject(t) || ri(i, "cannot merge mappings; the provided source object is unacceptable"), r = Object.keys(t), o = 0, a = r.length; o < a; o += 1)
    s = r[o], bw.call(e, s) || (e[s] = t[s], n[s] = !0);
}
$(zde, "mergeMappings");
function kx(i, e, t, n, r, s, o, a, l) {
  var c, u;
  if (Array.isArray(r))
    for (r = Array.prototype.slice.call(r), c = 0, u = r.length; c < u; c += 1)
      Array.isArray(r[c]) && ri(i, "nested arrays are not supported inside keys"), typeof r == "object" && Vde(r[c]) === "[object Object]" && (r[c] = "[object Object]");
  if (typeof r == "object" && Vde(r) === "[object Object]" && (r = "[object Object]"), r = String(r), e === null && (e = {}), n === "tag:yaml.org,2002:merge")
    if (Array.isArray(s))
      for (c = 0, u = s.length; c < u; c += 1)
        zde(i, e, s[c], t);
    else
      zde(i, e, s, t);
  else
    !i.json && !bw.call(t, r) && bw.call(e, r) && (i.line = o || i.line, i.lineStart = a || i.lineStart, i.position = l || i.position, ri(i, "duplicated mapping key")), r === "__proto__" ? Object.defineProperty(e, r, {
      configurable: !0,
      enumerable: !0,
      writable: !0,
      value: s
    }) : e[r] = s, delete t[r];
  return e;
}
$(kx, "storeMappingPair");
function WY(i) {
  var e;
  e = i.input.charCodeAt(i.position), e === 10 ? i.position++ : e === 13 ? (i.position++, i.input.charCodeAt(i.position) === 10 && i.position++) : ri(i, "a line break is expected"), i.line += 1, i.lineStart = i.position, i.firstTabInLine = -1;
}
$(WY, "readLineBreak");
function Ka(i, e, t) {
  for (var n = 0, r = i.input.charCodeAt(i.position); r !== 0; ) {
    for (; O1(r); )
      r === 9 && i.firstTabInLine === -1 && (i.firstTabInLine = i.position), r = i.input.charCodeAt(++i.position);
    if (e && r === 35)
      do
        r = i.input.charCodeAt(++i.position);
      while (r !== 10 && r !== 13 && r !== 0);
    if (um(r))
      for (WY(i), r = i.input.charCodeAt(i.position), n++, i.lineIndent = 0; r === 32; )
        i.lineIndent++, r = i.input.charCodeAt(++i.position);
    else
      break;
  }
  return t !== -1 && n !== 0 && i.lineIndent < t && J5(i, "deficient indentation"), n;
}
$(Ka, "skipSeparationSpace");
function C6(i) {
  var e = i.position, t;
  return t = i.input.charCodeAt(e), !!((t === 45 || t === 46) && t === i.input.charCodeAt(e + 1) && t === i.input.charCodeAt(e + 2) && (e += 3, t = i.input.charCodeAt(e), t === 0 || Fd(t)));
}
$(C6, "testDocumentSeparator");
function VY(i, e) {
  e === 1 ? i.result += " " : e > 1 && (i.result += Zl.repeat(`
`, e - 1));
}
$(VY, "writeFoldedLines");
function $Ue(i, e, t) {
  var n, r, s, o, a, l, c, u, d = i.kind, h = i.result, g;
  if (g = i.input.charCodeAt(i.position), Fd(g) || Tx(g) || g === 35 || g === 38 || g === 42 || g === 33 || g === 124 || g === 62 || g === 39 || g === 34 || g === 37 || g === 64 || g === 96 || (g === 63 || g === 45) && (r = i.input.charCodeAt(i.position + 1), Fd(r) || t && Tx(r)))
    return !1;
  for (i.kind = "scalar", i.result = "", s = o = i.position, a = !1; g !== 0; ) {
    if (g === 58) {
      if (r = i.input.charCodeAt(i.position + 1), Fd(r) || t && Tx(r))
        break;
    } else if (g === 35) {
      if (n = i.input.charCodeAt(i.position - 1), Fd(n))
        break;
    } else {
      if (i.position === i.lineStart && C6(i) || t && Tx(g))
        break;
      if (um(g))
        if (l = i.line, c = i.lineStart, u = i.lineIndent, Ka(i, !1, -1), i.lineIndent >= e) {
          a = !0, g = i.input.charCodeAt(i.position);
          continue;
        } else {
          i.position = o, i.line = l, i.lineStart = c, i.lineIndent = u;
          break;
        }
    }
    a && (Uy(i, s, o, !1), VY(i, i.line - l), s = o = i.position, a = !1), O1(g) || (o = i.position + 1), g = i.input.charCodeAt(++i.position);
  }
  return Uy(i, s, o, !1), i.result ? !0 : (i.kind = d, i.result = h, !1);
}
$($Ue, "readPlainScalar");
function jUe(i, e) {
  var t, n, r;
  if (t = i.input.charCodeAt(i.position), t !== 39)
    return !1;
  for (i.kind = "scalar", i.result = "", i.position++, n = r = i.position; (t = i.input.charCodeAt(i.position)) !== 0; )
    if (t === 39)
      if (Uy(i, n, i.position, !0), t = i.input.charCodeAt(++i.position), t === 39)
        n = i.position, i.position++, r = i.position;
      else
        return !0;
    else um(t) ? (Uy(i, n, r, !0), VY(i, Ka(i, !1, e)), n = r = i.position) : i.position === i.lineStart && C6(i) ? ri(i, "unexpected end of the document within a single quoted scalar") : (i.position++, r = i.position);
  ri(i, "unexpected end of the stream within a single quoted scalar");
}
$(jUe, "readSingleQuotedScalar");
function GUe(i, e) {
  var t, n, r, s, o, a;
  if (a = i.input.charCodeAt(i.position), a !== 34)
    return !1;
  for (i.kind = "scalar", i.result = "", i.position++, t = n = i.position; (a = i.input.charCodeAt(i.position)) !== 0; ) {
    if (a === 34)
      return Uy(i, t, i.position, !0), i.position++, !0;
    if (a === 92) {
      if (Uy(i, t, i.position, !0), a = i.input.charCodeAt(++i.position), um(a))
        Ka(i, !1, e);
      else if (a < 256 && VUe[a])
        i.result += UUe[a], i.position++;
      else if ((o = BUe(a)) > 0) {
        for (r = o, s = 0; r > 0; r--)
          a = i.input.charCodeAt(++i.position), (o = FUe(a)) >= 0 ? s = (s << 4) + o : ri(i, "expected hexadecimal character");
        i.result += WUe(s), i.position++;
      } else
        ri(i, "unknown escape sequence");
      t = n = i.position;
    } else um(a) ? (Uy(i, t, n, !0), VY(i, Ka(i, !1, e)), t = n = i.position) : i.position === i.lineStart && C6(i) ? ri(i, "unexpected end of the document within a double quoted scalar") : (i.position++, n = i.position);
  }
  ri(i, "unexpected end of the stream within a double quoted scalar");
}
$(GUe, "readDoubleQuotedScalar");
function qUe(i, e) {
  var t = !0, n, r, s, o = i.tag, a, l = i.anchor, c, u, d, h, g, m = /* @__PURE__ */ Object.create(null), _, v, w, E;
  if (E = i.input.charCodeAt(i.position), E === 91)
    u = 93, g = !1, a = [];
  else if (E === 123)
    u = 125, g = !0, a = {};
  else
    return !1;
  for (i.anchor !== null && (i.anchorMap[i.anchor] = a), E = i.input.charCodeAt(++i.position); E !== 0; ) {
    if (Ka(i, !0, e), E = i.input.charCodeAt(i.position), E === u)
      return i.position++, i.tag = o, i.anchor = l, i.kind = g ? "mapping" : "sequence", i.result = a, !0;
    t ? E === 44 && ri(i, "expected the node content, but found ','") : ri(i, "missed comma between flow collection entries"), v = _ = w = null, d = h = !1, E === 63 && (c = i.input.charCodeAt(i.position + 1), Fd(c) && (d = h = !0, i.position++, Ka(i, !0, e))), n = i.line, r = i.lineStart, s = i.position, BT(i, e, aj, !1, !0), v = i.tag, _ = i.result, Ka(i, !0, e), E = i.input.charCodeAt(i.position), (h || i.line === n) && E === 58 && (d = !0, E = i.input.charCodeAt(++i.position), Ka(i, !0, e), BT(i, e, aj, !1, !0), w = i.result), g ? kx(i, a, m, v, _, w, n, r, s) : d ? a.push(kx(i, null, m, v, _, w, n, r, s)) : a.push(_), Ka(i, !0, e), E = i.input.charCodeAt(i.position), E === 44 ? (t = !0, E = i.input.charCodeAt(++i.position)) : t = !1;
  }
  ri(i, "unexpected end of the stream within a flow collection");
}
$(qUe, "readFlowCollection");
function KUe(i, e) {
  var t, n, r = Rne, s = !1, o = !1, a = e, l = 0, c = !1, u, d;
  if (d = i.input.charCodeAt(i.position), d === 124)
    n = !1;
  else if (d === 62)
    n = !0;
  else
    return !1;
  for (i.kind = "scalar", i.result = ""; d !== 0; )
    if (d = i.input.charCodeAt(++i.position), d === 43 || d === 45)
      Rne === r ? r = d === 43 ? eOe : DYt : ri(i, "repeat of a chomping mode identifier");
    else if ((u = HUe(d)) >= 0)
      u === 0 ? ri(i, "bad explicit indentation width of a block scalar; it cannot be less than one") : o ? ri(i, "repeat of an indentation width identifier") : (a = e + u - 1, o = !0);
    else
      break;
  if (O1(d)) {
    do
      d = i.input.charCodeAt(++i.position);
    while (O1(d));
    if (d === 35)
      do
        d = i.input.charCodeAt(++i.position);
      while (!um(d) && d !== 0);
  }
  for (; d !== 0; ) {
    for (WY(i), i.lineIndent = 0, d = i.input.charCodeAt(i.position); (!o || i.lineIndent < a) && d === 32; )
      i.lineIndent++, d = i.input.charCodeAt(++i.position);
    if (!o && i.lineIndent > a && (a = i.lineIndent), um(d)) {
      l++;
      continue;
    }
    if (i.lineIndent < a) {
      r === eOe ? i.result += Zl.repeat(`
`, s ? 1 + l : l) : r === Rne && s && (i.result += `
`);
      break;
    }
    for (n ? O1(d) ? (c = !0, i.result += Zl.repeat(`
`, s ? 1 + l : l)) : c ? (c = !1, i.result += Zl.repeat(`
`, l + 1)) : l === 0 ? s && (i.result += " ") : i.result += Zl.repeat(`
`, l) : i.result += Zl.repeat(`
`, s ? 1 + l : l), s = !0, o = !0, l = 0, t = i.position; !um(d) && d !== 0; )
      d = i.input.charCodeAt(++i.position);
    Uy(i, t, i.position, !1);
  }
  return !0;
}
$(KUe, "readBlockScalar");
function $de(i, e) {
  var t, n = i.tag, r = i.anchor, s = [], o, a = !1, l;
  if (i.firstTabInLine !== -1) return !1;
  for (i.anchor !== null && (i.anchorMap[i.anchor] = s), l = i.input.charCodeAt(i.position); l !== 0 && (i.firstTabInLine !== -1 && (i.position = i.firstTabInLine, ri(i, "tab characters must not be used in indentation")), !(l !== 45 || (o = i.input.charCodeAt(i.position + 1), !Fd(o)))); ) {
    if (a = !0, i.position++, Ka(i, !0, -1) && i.lineIndent <= e) {
      s.push(null), l = i.input.charCodeAt(i.position);
      continue;
    }
    if (t = i.line, BT(i, e, OUe, !1, !0), s.push(i.result), Ka(i, !0, -1), l = i.input.charCodeAt(i.position), (i.line === t || i.lineIndent > e) && l !== 0)
      ri(i, "bad indentation of a sequence entry");
    else if (i.lineIndent < e)
      break;
  }
  return a ? (i.tag = n, i.anchor = r, i.kind = "sequence", i.result = s, !0) : !1;
}
$($de, "readBlockSequence");
function YUe(i, e, t) {
  var n, r, s, o, a, l, c = i.tag, u = i.anchor, d = {}, h = /* @__PURE__ */ Object.create(null), g = null, m = null, _ = null, v = !1, w = !1, E;
  if (i.firstTabInLine !== -1) return !1;
  for (i.anchor !== null && (i.anchorMap[i.anchor] = d), E = i.input.charCodeAt(i.position); E !== 0; ) {
    if (!v && i.firstTabInLine !== -1 && (i.position = i.firstTabInLine, ri(i, "tab characters must not be used in indentation")), n = i.input.charCodeAt(i.position + 1), s = i.line, (E === 63 || E === 58) && Fd(n))
      E === 63 ? (v && (kx(i, d, h, g, m, null, o, a, l), g = m = _ = null), w = !0, v = !0, r = !0) : v ? (v = !1, r = !0) : ri(i, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), i.position += 1, E = n;
    else {
      if (o = i.line, a = i.lineStart, l = i.position, !BT(i, t, AUe, !1, !0))
        break;
      if (i.line === s) {
        for (E = i.input.charCodeAt(i.position); O1(E); )
          E = i.input.charCodeAt(++i.position);
        if (E === 58)
          E = i.input.charCodeAt(++i.position), Fd(E) || ri(i, "a whitespace character is expected after the key-value separator within a block mapping"), v && (kx(i, d, h, g, m, null, o, a, l), g = m = _ = null), w = !0, v = !1, r = !1, g = i.tag, m = i.result;
        else if (w)
          ri(i, "can not read an implicit mapping pair; a colon is missed");
        else
          return i.tag = c, i.anchor = u, !0;
      } else if (w)
        ri(i, "can not read a block mapping entry; a multiline key may not be an implicit key");
      else
        return i.tag = c, i.anchor = u, !0;
    }
    if ((i.line === s || i.lineIndent > e) && (v && (o = i.line, a = i.lineStart, l = i.position), BT(i, e, lj, !0, r) && (v ? m = i.result : _ = i.result), v || (kx(i, d, h, g, m, _, o, a, l), g = m = _ = null), Ka(i, !0, -1), E = i.input.charCodeAt(i.position)), (i.line === s || i.lineIndent > e) && E !== 0)
      ri(i, "bad indentation of a mapping entry");
    else if (i.lineIndent < e)
      break;
  }
  return v && kx(i, d, h, g, m, null, o, a, l), w && (i.tag = c, i.anchor = u, i.kind = "mapping", i.result = d), w;
}
$(YUe, "readBlockMapping");
function XUe(i) {
  var e, t = !1, n = !1, r, s, o;
  if (o = i.input.charCodeAt(i.position), o !== 33) return !1;
  if (i.tag !== null && ri(i, "duplication of a tag property"), o = i.input.charCodeAt(++i.position), o === 60 ? (t = !0, o = i.input.charCodeAt(++i.position)) : o === 33 ? (n = !0, r = "!!", o = i.input.charCodeAt(++i.position)) : r = "!", e = i.position, t) {
    do
      o = i.input.charCodeAt(++i.position);
    while (o !== 0 && o !== 62);
    i.position < i.length ? (s = i.input.slice(e, i.position), o = i.input.charCodeAt(++i.position)) : ri(i, "unexpected end of the stream within a verbatim tag");
  } else {
    for (; o !== 0 && !Fd(o); )
      o === 33 && (n ? ri(i, "tag suffix cannot contain exclamation marks") : (r = i.input.slice(e - 1, i.position + 1), MUe.test(r) || ri(i, "named tag handle cannot contain such characters"), n = !0, e = i.position + 1)), o = i.input.charCodeAt(++i.position);
    s = i.input.slice(e, i.position), RYt.test(s) && ri(i, "tag suffix cannot contain flow indicator characters");
  }
  s && !PUe.test(s) && ri(i, "tag name cannot contain such characters: " + s);
  try {
    s = decodeURIComponent(s);
  } catch {
    ri(i, "tag name is malformed: " + s);
  }
  return t ? i.tag = s : bw.call(i.tagMap, r) ? i.tag = i.tagMap[r] + s : r === "!" ? i.tag = "!" + s : r === "!!" ? i.tag = "tag:yaml.org,2002:" + s : ri(i, 'undeclared tag handle "' + r + '"'), !0;
}
$(XUe, "readTagProperty");
function ZUe(i) {
  var e, t;
  if (t = i.input.charCodeAt(i.position), t !== 38) return !1;
  for (i.anchor !== null && ri(i, "duplication of an anchor property"), t = i.input.charCodeAt(++i.position), e = i.position; t !== 0 && !Fd(t) && !Tx(t); )
    t = i.input.charCodeAt(++i.position);
  return i.position === e && ri(i, "name of an anchor node must contain at least one character"), i.anchor = i.input.slice(e, i.position), !0;
}
$(ZUe, "readAnchorProperty");
function QUe(i) {
  var e, t, n;
  if (n = i.input.charCodeAt(i.position), n !== 42) return !1;
  for (n = i.input.charCodeAt(++i.position), e = i.position; n !== 0 && !Fd(n) && !Tx(n); )
    n = i.input.charCodeAt(++i.position);
  return i.position === e && ri(i, "name of an alias node must contain at least one character"), t = i.input.slice(e, i.position), bw.call(i.anchorMap, t) || ri(i, 'unidentified alias "' + t + '"'), i.result = i.anchorMap[t], Ka(i, !0, -1), !0;
}
$(QUe, "readAlias");
function BT(i, e, t, n, r) {
  var s, o, a, l = 1, c = !1, u = !1, d, h, g, m, _, v;
  if (i.listener !== null && i.listener("open", i), i.tag = null, i.anchor = null, i.kind = null, i.result = null, s = o = a = lj === t || OUe === t, n && Ka(i, !0, -1) && (c = !0, i.lineIndent > e ? l = 1 : i.lineIndent === e ? l = 0 : i.lineIndent < e && (l = -1)), l === 1)
    for (; XUe(i) || ZUe(i); )
      Ka(i, !0, -1) ? (c = !0, a = s, i.lineIndent > e ? l = 1 : i.lineIndent === e ? l = 0 : i.lineIndent < e && (l = -1)) : a = !1;
  if (a && (a = c || r), (l === 1 || lj === t) && (aj === t || AUe === t ? _ = e : _ = e + 1, v = i.position - i.lineStart, l === 1 ? a && ($de(i, v) || YUe(i, v, _)) || qUe(i, _) ? u = !0 : (o && KUe(i, _) || jUe(i, _) || GUe(i, _) ? u = !0 : QUe(i) ? (u = !0, (i.tag !== null || i.anchor !== null) && ri(i, "alias node should not have any properties")) : $Ue(i, _, aj === t) && (u = !0, i.tag === null && (i.tag = "?")), i.anchor !== null && (i.anchorMap[i.anchor] = i.result)) : l === 0 && (u = a && $de(i, v))), i.tag === null)
    i.anchor !== null && (i.anchorMap[i.anchor] = i.result);
  else if (i.tag === "?") {
    for (i.result !== null && i.kind !== "scalar" && ri(i, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + i.kind + '"'), d = 0, h = i.implicitTypes.length; d < h; d += 1)
      if (m = i.implicitTypes[d], m.resolve(i.result)) {
        i.result = m.construct(i.result), i.tag = m.tag, i.anchor !== null && (i.anchorMap[i.anchor] = i.result);
        break;
      }
  } else if (i.tag !== "!") {
    if (bw.call(i.typeMap[i.kind || "fallback"], i.tag))
      m = i.typeMap[i.kind || "fallback"][i.tag];
    else
      for (m = null, g = i.typeMap.multi[i.kind || "fallback"], d = 0, h = g.length; d < h; d += 1)
        if (i.tag.slice(0, g[d].tag.length) === g[d].tag) {
          m = g[d];
          break;
        }
    m || ri(i, "unknown tag !<" + i.tag + ">"), i.result !== null && m.kind !== i.kind && ri(i, "unacceptable node kind for !<" + i.tag + '> tag; it should be "' + m.kind + '", not "' + i.kind + '"'), m.resolve(i.result, i.tag) ? (i.result = m.construct(i.result, i.tag), i.anchor !== null && (i.anchorMap[i.anchor] = i.result)) : ri(i, "cannot resolve a node with !<" + i.tag + "> explicit tag");
  }
  return i.listener !== null && i.listener("close", i), i.tag !== null || i.anchor !== null || u;
}
$(BT, "composeNode");
function JUe(i) {
  var e = i.position, t, n, r, s = !1, o;
  for (i.version = null, i.checkLineBreaks = i.legacy, i.tagMap = /* @__PURE__ */ Object.create(null), i.anchorMap = /* @__PURE__ */ Object.create(null); (o = i.input.charCodeAt(i.position)) !== 0 && (Ka(i, !0, -1), o = i.input.charCodeAt(i.position), !(i.lineIndent > 0 || o !== 37)); ) {
    for (s = !0, o = i.input.charCodeAt(++i.position), t = i.position; o !== 0 && !Fd(o); )
      o = i.input.charCodeAt(++i.position);
    for (n = i.input.slice(t, i.position), r = [], n.length < 1 && ri(i, "directive name must not be less than one character in length"); o !== 0; ) {
      for (; O1(o); )
        o = i.input.charCodeAt(++i.position);
      if (o === 35) {
        do
          o = i.input.charCodeAt(++i.position);
        while (o !== 0 && !um(o));
        break;
      }
      if (um(o)) break;
      for (t = i.position; o !== 0 && !Fd(o); )
        o = i.input.charCodeAt(++i.position);
      r.push(i.input.slice(t, i.position));
    }
    o !== 0 && WY(i), bw.call(tOe, n) ? tOe[n](i, n, r) : J5(i, 'unknown document directive "' + n + '"');
  }
  if (Ka(i, !0, -1), i.lineIndent === 0 && i.input.charCodeAt(i.position) === 45 && i.input.charCodeAt(i.position + 1) === 45 && i.input.charCodeAt(i.position + 2) === 45 ? (i.position += 3, Ka(i, !0, -1)) : s && ri(i, "directives end mark is expected"), BT(i, i.lineIndent - 1, lj, !1, !0), Ka(i, !0, -1), i.checkLineBreaks && NYt.test(i.input.slice(e, i.position)) && J5(i, "non-ASCII line breaks are interpreted as content"), i.documents.push(i.result), i.position === i.lineStart && C6(i)) {
    i.input.charCodeAt(i.position) === 46 && (i.position += 3, Ka(i, !0, -1));
    return;
  }
  if (i.position < i.length - 1)
    ri(i, "end of the stream or a document separator is expected");
  else
    return;
}
$(JUe, "readDocument");
function gCe(i, e) {
  i = String(i), e = e || {}, i.length !== 0 && (i.charCodeAt(i.length - 1) !== 10 && i.charCodeAt(i.length - 1) !== 13 && (i += `
`), i.charCodeAt(0) === 65279 && (i = i.slice(1)));
  var t = new zUe(i, e), n = i.indexOf("\0");
  for (n !== -1 && (t.position = n, ri(t, "null byte is not allowed in input")), t.input += "\0"; t.input.charCodeAt(t.position) === 32; )
    t.lineIndent += 1, t.position += 1;
  for (; t.position < t.length - 1; )
    JUe(t);
  return t.documents;
}
$(gCe, "loadDocuments");
function AYt(i, e, t) {
  e !== null && typeof e == "object" && typeof t > "u" && (t = e, e = null);
  var n = gCe(i, t);
  if (typeof e != "function")
    return n;
  for (var r = 0, s = n.length; r < s; r += 1)
    e(n[r]);
}
$(AYt, "loadAll$1");
function eze(i, e) {
  var t = gCe(i, e);
  if (t.length !== 0) {
    if (t.length === 1)
      return t[0];
    throw new Mh("expected a single document in the stream, but found more");
  }
}
$(eze, "load$1");
var OYt = eze, MYt = {
  load: OYt
}, tze = Object.prototype.toString, nze = Object.prototype.hasOwnProperty, pCe = 65279, PYt = 9, eB = 10, FYt = 13, BYt = 32, HYt = 33, WYt = 34, jde = 35, VYt = 37, UYt = 38, zYt = 39, $Yt = 42, ize = 44, jYt = 45, cj = 58, GYt = 61, qYt = 62, KYt = 63, YYt = 64, rze = 91, sze = 93, XYt = 96, oze = 123, ZYt = 124, aze = 125, ud = {};
ud[0] = "\\0";
ud[7] = "\\a";
ud[8] = "\\b";
ud[9] = "\\t";
ud[10] = "\\n";
ud[11] = "\\v";
ud[12] = "\\f";
ud[13] = "\\r";
ud[27] = "\\e";
ud[34] = '\\"';
ud[92] = "\\\\";
ud[133] = "\\N";
ud[160] = "\\_";
ud[8232] = "\\L";
ud[8233] = "\\P";
var QYt = [
  "y",
  "Y",
  "yes",
  "Yes",
  "YES",
  "on",
  "On",
  "ON",
  "n",
  "N",
  "no",
  "No",
  "NO",
  "off",
  "Off",
  "OFF"
], JYt = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
function lze(i, e) {
  var t, n, r, s, o, a, l;
  if (e === null) return {};
  for (t = {}, n = Object.keys(e), r = 0, s = n.length; r < s; r += 1)
    o = n[r], a = String(e[o]), o.slice(0, 2) === "!!" && (o = "tag:yaml.org,2002:" + o.slice(2)), l = i.compiledTypeMap.fallback[o], l && nze.call(l.styleAliases, a) && (a = l.styleAliases[a]), t[o] = a;
  return t;
}
$(lze, "compileStyleMap");
function cze(i) {
  var e, t, n;
  if (e = i.toString(16).toUpperCase(), i <= 255)
    t = "x", n = 2;
  else if (i <= 65535)
    t = "u", n = 4;
  else if (i <= 4294967295)
    t = "U", n = 8;
  else
    throw new Mh("code point within a string may not be greater than 0xFFFFFFFF");
  return "\\" + t + Zl.repeat("0", n - e.length) + e;
}
$(cze, "encodeHex");
var eXt = 1, tB = 2;
function uze(i) {
  this.schema = i.schema || RUe, this.indent = Math.max(1, i.indent || 2), this.noArrayIndent = i.noArrayIndent || !1, this.skipInvalid = i.skipInvalid || !1, this.flowLevel = Zl.isNothing(i.flowLevel) ? -1 : i.flowLevel, this.styleMap = lze(this.schema, i.styles || null), this.sortKeys = i.sortKeys || !1, this.lineWidth = i.lineWidth || 80, this.noRefs = i.noRefs || !1, this.noCompatMode = i.noCompatMode || !1, this.condenseFlow = i.condenseFlow || !1, this.quotingType = i.quotingType === '"' ? tB : eXt, this.forceQuotes = i.forceQuotes || !1, this.replacer = typeof i.replacer == "function" ? i.replacer : null, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null;
}
$(uze, "State");
function Gde(i, e) {
  for (var t = Zl.repeat(" ", e), n = 0, r = -1, s = "", o, a = i.length; n < a; )
    r = i.indexOf(`
`, n), r === -1 ? (o = i.slice(n), n = a) : (o = i.slice(n, r + 1), n = r + 1), o.length && o !== `
` && (s += t), s += o;
  return s;
}
$(Gde, "indentString");
function uj(i, e) {
  return `
` + Zl.repeat(" ", i.indent * e);
}
$(uj, "generateNextLine");
function dze(i, e) {
  var t, n, r;
  for (t = 0, n = i.implicitTypes.length; t < n; t += 1)
    if (r = i.implicitTypes[t], r.resolve(e))
      return !0;
  return !1;
}
$(dze, "testImplicitResolving");
function nB(i) {
  return i === BYt || i === PYt;
}
$(nB, "isWhitespace");
function FA(i) {
  return 32 <= i && i <= 126 || 161 <= i && i <= 55295 && i !== 8232 && i !== 8233 || 57344 <= i && i <= 65533 && i !== pCe || 65536 <= i && i <= 1114111;
}
$(FA, "isPrintable");
function qde(i) {
  return FA(i) && i !== pCe && i !== FYt && i !== eB;
}
$(qde, "isNsCharOrWhitespace");
function Kde(i, e, t) {
  var n = qde(i), r = n && !nB(i);
  return (
    // ns-plain-safe
    (t ? (
      // c = flow-in
      n
    ) : n && i !== ize && i !== rze && i !== sze && i !== oze && i !== aze) && i !== jde && !(e === cj && !r) || qde(e) && !nB(e) && i === jde || e === cj && r
  );
}
$(Kde, "isPlainSafe");
function hze(i) {
  return FA(i) && i !== pCe && !nB(i) && i !== jYt && i !== KYt && i !== cj && i !== ize && i !== rze && i !== sze && i !== oze && i !== aze && i !== jde && i !== UYt && i !== $Yt && i !== HYt && i !== ZYt && i !== GYt && i !== qYt && i !== zYt && i !== WYt && i !== VYt && i !== YYt && i !== XYt;
}
$(hze, "isPlainSafeFirst");
function fze(i) {
  return !nB(i) && i !== cj;
}
$(fze, "isPlainSafeLast");
function LN(i, e) {
  var t = i.charCodeAt(e), n;
  return t >= 55296 && t <= 56319 && e + 1 < i.length && (n = i.charCodeAt(e + 1), n >= 56320 && n <= 57343) ? (t - 55296) * 1024 + n - 56320 + 65536 : t;
}
$(LN, "codePointAt");
function mCe(i) {
  var e = /^\n* /;
  return e.test(i);
}
$(mCe, "needIndentIndicator");
var gze = 1, Yde = 2, pze = 3, mze = 4, ZI = 5;
function _ze(i, e, t, n, r, s, o, a) {
  var l, c = 0, u = null, d = !1, h = !1, g = n !== -1, m = -1, _ = hze(LN(i, 0)) && fze(LN(i, i.length - 1));
  if (e || o)
    for (l = 0; l < i.length; c >= 65536 ? l += 2 : l++) {
      if (c = LN(i, l), !FA(c))
        return ZI;
      _ = _ && Kde(c, u, a), u = c;
    }
  else {
    for (l = 0; l < i.length; c >= 65536 ? l += 2 : l++) {
      if (c = LN(i, l), c === eB)
        d = !0, g && (h = h || // Foldable line = too long, and not more-indented.
        l - m - 1 > n && i[m + 1] !== " ", m = l);
      else if (!FA(c))
        return ZI;
      _ = _ && Kde(c, u, a), u = c;
    }
    h = h || g && l - m - 1 > n && i[m + 1] !== " ";
  }
  return !d && !h ? _ && !o && !r(i) ? gze : s === tB ? ZI : Yde : t > 9 && mCe(i) ? ZI : o ? s === tB ? ZI : Yde : h ? mze : pze;
}
$(_ze, "chooseScalarStyle");
function bze(i, e, t, n, r) {
  i.dump = (function() {
    if (e.length === 0)
      return i.quotingType === tB ? '""' : "''";
    if (!i.noCompatMode && (QYt.indexOf(e) !== -1 || JYt.test(e)))
      return i.quotingType === tB ? '"' + e + '"' : "'" + e + "'";
    var s = i.indent * Math.max(1, t), o = i.lineWidth === -1 ? -1 : Math.max(Math.min(i.lineWidth, 40), i.lineWidth - s), a = n || i.flowLevel > -1 && t >= i.flowLevel;
    function l(c) {
      return dze(i, c);
    }
    switch ($(l, "testAmbiguity"), _ze(
      e,
      a,
      i.indent,
      o,
      l,
      i.quotingType,
      i.forceQuotes && !n,
      r
    )) {
      case gze:
        return e;
      case Yde:
        return "'" + e.replace(/'/g, "''") + "'";
      case pze:
        return "|" + Xde(e, i.indent) + Zde(Gde(e, s));
      case mze:
        return ">" + Xde(e, i.indent) + Zde(Gde(vze(e, o), s));
      case ZI:
        return '"' + yze(e) + '"';
      default:
        throw new Mh("impossible error: invalid scalar style");
    }
  })();
}
$(bze, "writeScalar");
function Xde(i, e) {
  var t = mCe(i) ? String(e) : "", n = i[i.length - 1] === `
`, r = n && (i[i.length - 2] === `
` || i === `
`), s = r ? "+" : n ? "" : "-";
  return t + s + `
`;
}
$(Xde, "blockHeader");
function Zde(i) {
  return i[i.length - 1] === `
` ? i.slice(0, -1) : i;
}
$(Zde, "dropEndingNewline");
function vze(i, e) {
  for (var t = /(\n+)([^\n]*)/g, n = (function() {
    var c = i.indexOf(`
`);
    return c = c !== -1 ? c : i.length, t.lastIndex = c, Qde(i.slice(0, c), e);
  })(), r = i[0] === `
` || i[0] === " ", s, o; o = t.exec(i); ) {
    var a = o[1], l = o[2];
    s = l[0] === " ", n += a + (!r && !s && l !== "" ? `
` : "") + Qde(l, e), r = s;
  }
  return n;
}
$(vze, "foldString");
function Qde(i, e) {
  if (i === "" || i[0] === " ") return i;
  for (var t = / [^ ]/g, n, r = 0, s, o = 0, a = 0, l = ""; n = t.exec(i); )
    a = n.index, a - r > e && (s = o > r ? o : a, l += `
` + i.slice(r, s), r = s + 1), o = a;
  return l += `
`, i.length - r > e && o > r ? l += i.slice(r, o) + `
` + i.slice(o + 1) : l += i.slice(r), l.slice(1);
}
$(Qde, "foldLine");
function yze(i) {
  for (var e = "", t = 0, n, r = 0; r < i.length; t >= 65536 ? r += 2 : r++)
    t = LN(i, r), n = ud[t], !n && FA(t) ? (e += i[r], t >= 65536 && (e += i[r + 1])) : e += n || cze(t);
  return e;
}
$(yze, "escapeString");
function Cze(i, e, t) {
  var n = "", r = i.tag, s, o, a;
  for (s = 0, o = t.length; s < o; s += 1)
    a = t[s], i.replacer && (a = i.replacer.call(t, String(s), a)), (xb(i, e, a, !1, !1) || typeof a > "u" && xb(i, e, null, !1, !1)) && (n !== "" && (n += "," + (i.condenseFlow ? "" : " ")), n += i.dump);
  i.tag = r, i.dump = "[" + n + "]";
}
$(Cze, "writeFlowSequence");
function Jde(i, e, t, n) {
  var r = "", s = i.tag, o, a, l;
  for (o = 0, a = t.length; o < a; o += 1)
    l = t[o], i.replacer && (l = i.replacer.call(t, String(o), l)), (xb(i, e + 1, l, !0, !0, !1, !0) || typeof l > "u" && xb(i, e + 1, null, !0, !0, !1, !0)) && ((!n || r !== "") && (r += uj(i, e)), i.dump && eB === i.dump.charCodeAt(0) ? r += "-" : r += "- ", r += i.dump);
  i.tag = s, i.dump = r || "[]";
}
$(Jde, "writeBlockSequence");
function wze(i, e, t) {
  var n = "", r = i.tag, s = Object.keys(t), o, a, l, c, u;
  for (o = 0, a = s.length; o < a; o += 1)
    u = "", n !== "" && (u += ", "), i.condenseFlow && (u += '"'), l = s[o], c = t[l], i.replacer && (c = i.replacer.call(t, l, c)), xb(i, e, l, !1, !1) && (i.dump.length > 1024 && (u += "? "), u += i.dump + (i.condenseFlow ? '"' : "") + ":" + (i.condenseFlow ? "" : " "), xb(i, e, c, !1, !1) && (u += i.dump, n += u));
  i.tag = r, i.dump = "{" + n + "}";
}
$(wze, "writeFlowMapping");
function Sze(i, e, t, n) {
  var r = "", s = i.tag, o = Object.keys(t), a, l, c, u, d, h;
  if (i.sortKeys === !0)
    o.sort();
  else if (typeof i.sortKeys == "function")
    o.sort(i.sortKeys);
  else if (i.sortKeys)
    throw new Mh("sortKeys must be a boolean or a function");
  for (a = 0, l = o.length; a < l; a += 1)
    h = "", (!n || r !== "") && (h += uj(i, e)), c = o[a], u = t[c], i.replacer && (u = i.replacer.call(t, c, u)), xb(i, e + 1, c, !0, !0, !0) && (d = i.tag !== null && i.tag !== "?" || i.dump && i.dump.length > 1024, d && (i.dump && eB === i.dump.charCodeAt(0) ? h += "?" : h += "? "), h += i.dump, d && (h += uj(i, e)), xb(i, e + 1, u, !0, d) && (i.dump && eB === i.dump.charCodeAt(0) ? h += ":" : h += ": ", h += i.dump, r += h));
  i.tag = s, i.dump = r || "{}";
}
$(Sze, "writeBlockMapping");
function ehe(i, e, t) {
  var n, r, s, o, a, l;
  for (r = t ? i.explicitTypes : i.implicitTypes, s = 0, o = r.length; s < o; s += 1)
    if (a = r[s], (a.instanceOf || a.predicate) && (!a.instanceOf || typeof e == "object" && e instanceof a.instanceOf) && (!a.predicate || a.predicate(e))) {
      if (t ? a.multi && a.representName ? i.tag = a.representName(e) : i.tag = a.tag : i.tag = "?", a.represent) {
        if (l = i.styleMap[a.tag] || a.defaultStyle, tze.call(a.represent) === "[object Function]")
          n = a.represent(e, l);
        else if (nze.call(a.represent, l))
          n = a.represent[l](e, l);
        else
          throw new Mh("!<" + a.tag + '> tag resolver accepts not "' + l + '" style');
        i.dump = n;
      }
      return !0;
    }
  return !1;
}
$(ehe, "detectType");
function xb(i, e, t, n, r, s, o) {
  i.tag = null, i.dump = t, ehe(i, t, !1) || ehe(i, t, !0);
  var a = tze.call(i.dump), l = n, c;
  n && (n = i.flowLevel < 0 || i.flowLevel > e);
  var u = a === "[object Object]" || a === "[object Array]", d, h;
  if (u && (d = i.duplicates.indexOf(t), h = d !== -1), (i.tag !== null && i.tag !== "?" || h || i.indent !== 2 && e > 0) && (r = !1), h && i.usedDuplicates[d])
    i.dump = "*ref_" + d;
  else {
    if (u && h && !i.usedDuplicates[d] && (i.usedDuplicates[d] = !0), a === "[object Object]")
      n && Object.keys(i.dump).length !== 0 ? (Sze(i, e, i.dump, r), h && (i.dump = "&ref_" + d + i.dump)) : (wze(i, e, i.dump), h && (i.dump = "&ref_" + d + " " + i.dump));
    else if (a === "[object Array]")
      n && i.dump.length !== 0 ? (i.noArrayIndent && !o && e > 0 ? Jde(i, e - 1, i.dump, r) : Jde(i, e, i.dump, r), h && (i.dump = "&ref_" + d + i.dump)) : (Cze(i, e, i.dump), h && (i.dump = "&ref_" + d + " " + i.dump));
    else if (a === "[object String]")
      i.tag !== "?" && bze(i, i.dump, e, s, l);
    else {
      if (a === "[object Undefined]")
        return !1;
      if (i.skipInvalid) return !1;
      throw new Mh("unacceptable kind of an object to dump " + a);
    }
    i.tag !== null && i.tag !== "?" && (c = encodeURI(
      i.tag[0] === "!" ? i.tag.slice(1) : i.tag
    ).replace(/!/g, "%21"), i.tag[0] === "!" ? c = "!" + c : c.slice(0, 18) === "tag:yaml.org,2002:" ? c = "!!" + c.slice(18) : c = "!<" + c + ">", i.dump = c + " " + i.dump);
  }
  return !0;
}
$(xb, "writeNode");
function Eze(i, e) {
  var t = [], n = [], r, s;
  for (dj(i, t, n), r = 0, s = n.length; r < s; r += 1)
    e.duplicates.push(t[n[r]]);
  e.usedDuplicates = new Array(s);
}
$(Eze, "getDuplicateReferences");
function dj(i, e, t) {
  var n, r, s;
  if (i !== null && typeof i == "object")
    if (r = e.indexOf(i), r !== -1)
      t.indexOf(r) === -1 && t.push(r);
    else if (e.push(i), Array.isArray(i))
      for (r = 0, s = i.length; r < s; r += 1)
        dj(i[r], e, t);
    else
      for (n = Object.keys(i), r = 0, s = n.length; r < s; r += 1)
        dj(i[n[r]], e, t);
}
$(dj, "inspectNode");
function tXt(i, e) {
  e = e || {};
  var t = new uze(e);
  t.noRefs || Eze(i, t);
  var n = i;
  return t.replacer && (n = t.replacer.call({ "": n }, "", n)), xb(t, 0, n, !0, !0) ? t.dump + `
` : "";
}
$(tXt, "dump$1");
function nXt(i, e) {
  return function() {
    throw new Error("Function yaml." + i + " is removed in js-yaml 4. Use yaml." + e + " instead, which is now safe by default.");
  };
}
$(nXt, "renamed");
var iXt = pUe, rXt = MYt.load;
/*! Bundled license information:

js-yaml/dist/js-yaml.mjs:
  (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
*/
var Wu = {
  aggregation: 17.25,
  extension: 17.25,
  composition: 17.25,
  dependency: 6,
  lollipop: 13.5,
  arrow_point: 4
  //arrow_cross: 24,
}, nOe = {
  arrow_point: 9,
  arrow_cross: 12.5,
  arrow_circle: 12.5
};
function fF(i, e) {
  if (i === void 0 || e === void 0)
    return { angle: 0, deltaX: 0, deltaY: 0 };
  i = Zo(i), e = Zo(e);
  const [t, n] = [i.x, i.y], [r, s] = [e.x, e.y], o = r - t, a = s - n;
  return { angle: Math.atan(a / o), deltaX: o, deltaY: a };
}
$(fF, "calculateDeltaAndAngle");
var Zo = /* @__PURE__ */ $((i) => Array.isArray(i) ? { x: i[0], y: i[1] } : i, "pointTransformer"), sXt = /* @__PURE__ */ $((i) => ({
  x: /* @__PURE__ */ $(function(e, t, n) {
    let r = 0;
    const s = Zo(n[0]).x < Zo(n[n.length - 1]).x ? "left" : "right";
    if (t === 0 && Object.hasOwn(Wu, i.arrowTypeStart)) {
      const { angle: g, deltaX: m } = fF(n[0], n[1]);
      r = Wu[i.arrowTypeStart] * Math.cos(g) * (m >= 0 ? 1 : -1);
    } else if (t === n.length - 1 && Object.hasOwn(Wu, i.arrowTypeEnd)) {
      const { angle: g, deltaX: m } = fF(
        n[n.length - 1],
        n[n.length - 2]
      );
      r = Wu[i.arrowTypeEnd] * Math.cos(g) * (m >= 0 ? 1 : -1);
    }
    const o = Math.abs(
      Zo(e).x - Zo(n[n.length - 1]).x
    ), a = Math.abs(
      Zo(e).y - Zo(n[n.length - 1]).y
    ), l = Math.abs(Zo(e).x - Zo(n[0]).x), c = Math.abs(Zo(e).y - Zo(n[0]).y), u = Wu[i.arrowTypeStart], d = Wu[i.arrowTypeEnd], h = 1;
    if (o < d && o > 0 && a < d) {
      let g = d + h - o;
      g *= s === "right" ? -1 : 1, r -= g;
    }
    if (l < u && l > 0 && c < u) {
      let g = u + h - l;
      g *= s === "right" ? -1 : 1, r += g;
    }
    return Zo(e).x + r;
  }, "x"),
  y: /* @__PURE__ */ $(function(e, t, n) {
    let r = 0;
    const s = Zo(n[0]).y < Zo(n[n.length - 1]).y ? "down" : "up";
    if (t === 0 && Object.hasOwn(Wu, i.arrowTypeStart)) {
      const { angle: g, deltaY: m } = fF(n[0], n[1]);
      r = Wu[i.arrowTypeStart] * Math.abs(Math.sin(g)) * (m >= 0 ? 1 : -1);
    } else if (t === n.length - 1 && Object.hasOwn(Wu, i.arrowTypeEnd)) {
      const { angle: g, deltaY: m } = fF(
        n[n.length - 1],
        n[n.length - 2]
      );
      r = Wu[i.arrowTypeEnd] * Math.abs(Math.sin(g)) * (m >= 0 ? 1 : -1);
    }
    const o = Math.abs(
      Zo(e).y - Zo(n[n.length - 1]).y
    ), a = Math.abs(
      Zo(e).x - Zo(n[n.length - 1]).x
    ), l = Math.abs(Zo(e).y - Zo(n[0]).y), c = Math.abs(Zo(e).x - Zo(n[0]).x), u = Wu[i.arrowTypeStart], d = Wu[i.arrowTypeEnd], h = 1;
    if (o < d && o > 0 && a < d) {
      let g = d + h - o;
      g *= s === "up" ? -1 : 1, r -= g;
    }
    if (l < u && l > 0 && c < u) {
      let g = u + h - l;
      g *= s === "up" ? -1 : 1, r += g;
    }
    return Zo(e).y + r;
  }, "y")
}), "getLineFunctionsWithOffset"), _Ce = /* @__PURE__ */ $(({
  flowchart: i
}) => {
  var r, s;
  const e = ((r = i == null ? void 0 : i.subGraphTitleMargin) == null ? void 0 : r.top) ?? 0, t = ((s = i == null ? void 0 : i.subGraphTitleMargin) == null ? void 0 : s.bottom) ?? 0, n = e + t;
  return {
    subGraphTitleTopMargin: e,
    subGraphTitleBottomMargin: t,
    subGraphTitleTotalMargin: n
  };
}, "getSubGraphTitleMargins"), oXt = /* @__PURE__ */ $((i) => {
  const { handDrawnSeed: e } = Qs();
  return {
    fill: i,
    hachureAngle: 120,
    // angle of hachure,
    hachureGap: 4,
    fillWeight: 2,
    roughness: 0.7,
    stroke: i,
    seed: e
  };
}, "solidStateFill"), k2 = /* @__PURE__ */ $((i) => {
  const e = aXt([
    ...i.cssCompiledStyles || [],
    ...i.cssStyles || [],
    ...i.labelStyle || []
  ]);
  return { stylesMap: e, stylesArray: [...e] };
}, "compileStyles"), aXt = /* @__PURE__ */ $((i) => {
  const e = /* @__PURE__ */ new Map();
  return i.forEach((t) => {
    const [n, r] = t.split(":");
    e.set(n.trim(), r == null ? void 0 : r.trim());
  }), e;
}, "styles2Map"), xze = /* @__PURE__ */ $((i) => i === "color" || i === "font-size" || i === "font-family" || i === "font-weight" || i === "font-style" || i === "text-decoration" || i === "text-align" || i === "text-transform" || i === "line-height" || i === "letter-spacing" || i === "word-spacing" || i === "text-shadow" || i === "text-overflow" || i === "white-space" || i === "word-wrap" || i === "word-break" || i === "overflow-wrap" || i === "hyphens", "isLabelStyle"), Gn = /* @__PURE__ */ $((i) => {
  const { stylesArray: e } = k2(i), t = [], n = [], r = [], s = [];
  return e.forEach((o) => {
    const a = o[0];
    xze(a) ? t.push(o.join(":") + " !important") : (n.push(o.join(":") + " !important"), a.includes("stroke") && r.push(o.join(":") + " !important"), a === "fill" && s.push(o.join(":") + " !important"));
  }), {
    labelStyles: t.join(";"),
    nodeStyles: n.join(";"),
    stylesArray: e,
    borderStyles: r,
    backgroundStyles: s
  };
}, "styles2String"), jn = /* @__PURE__ */ $((i, e) => {
  var l;
  const { themeVariables: t, handDrawnSeed: n } = Qs(), { nodeBorder: r, mainBkg: s } = t, { stylesMap: o } = k2(i);
  return Object.assign(
    {
      roughness: 0.7,
      fill: o.get("fill") || s,
      fillStyle: "hachure",
      // solid fill
      fillWeight: 4,
      hachureGap: 5.2,
      stroke: o.get("stroke") || r,
      seed: n,
      strokeWidth: ((l = o.get("stroke-width")) == null ? void 0 : l.replace("px", "")) || 1.3,
      fillLineDash: [0, 0],
      strokeLineDash: lXt(o.get("stroke-dasharray"))
    },
    e
  );
}, "userNodeOverrides"), lXt = /* @__PURE__ */ $((i) => {
  if (!i)
    return [0, 0];
  const e = i.trim().split(/\s+/).map(Number);
  if (e.length === 1) {
    const r = isNaN(e[0]) ? 0 : e[0];
    return [r, r];
  }
  const t = isNaN(e[0]) ? 0 : e[0], n = isNaN(e[1]) ? 0 : e[1];
  return [t, n];
}, "getStrokeDashArray"), AP = {}, Vl = {}, iOe;
function cXt() {
  return iOe || (iOe = 1, Object.defineProperty(Vl, "__esModule", { value: !0 }), Vl.BLANK_URL = Vl.relativeFirstCharacters = Vl.whitespaceEscapeCharsRegex = Vl.urlSchemeRegex = Vl.ctrlCharactersRegex = Vl.htmlCtrlEntityRegex = Vl.htmlEntitiesRegex = Vl.invalidProtocolRegex = void 0, Vl.invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im, Vl.htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g, Vl.htmlCtrlEntityRegex = /&(newline|tab);/gi, Vl.ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, Vl.urlSchemeRegex = /^.+(:|&colon;)/gim, Vl.whitespaceEscapeCharsRegex = /(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g, Vl.relativeFirstCharacters = [".", "/"], Vl.BLANK_URL = "about:blank"), Vl;
}
var rOe;
function uXt() {
  if (rOe) return AP;
  rOe = 1, Object.defineProperty(AP, "__esModule", { value: !0 }), AP.sanitizeUrl = void 0;
  var i = cXt();
  function e(o) {
    return i.relativeFirstCharacters.indexOf(o[0]) > -1;
  }
  function t(o) {
    var a = o.replace(i.ctrlCharactersRegex, "");
    return a.replace(i.htmlEntitiesRegex, function(l, c) {
      return String.fromCharCode(c);
    });
  }
  function n(o) {
    return URL.canParse(o);
  }
  function r(o) {
    try {
      return decodeURIComponent(o);
    } catch {
      return o;
    }
  }
  function s(o) {
    if (!o)
      return i.BLANK_URL;
    var a, l = r(o.trim());
    do
      l = t(l).replace(i.htmlCtrlEntityRegex, "").replace(i.ctrlCharactersRegex, "").replace(i.whitespaceEscapeCharsRegex, "").trim(), l = r(l), a = l.match(i.ctrlCharactersRegex) || l.match(i.htmlEntitiesRegex) || l.match(i.htmlCtrlEntityRegex) || l.match(i.whitespaceEscapeCharsRegex);
    while (a && a.length > 0);
    var c = l;
    if (!c)
      return i.BLANK_URL;
    if (e(c))
      return c;
    var u = c.trimStart(), d = u.match(i.urlSchemeRegex);
    if (!d)
      return c;
    var h = d[0].toLowerCase().trim();
    if (i.invalidProtocolRegex.test(h))
      return i.BLANK_URL;
    var g = u.replace(/\\/g, "/");
    if (h === "mailto:" || h.includes("://"))
      return g;
    if (h === "http:" || h === "https:") {
      if (!n(g))
        return i.BLANK_URL;
      var m = new URL(g);
      return m.protocol = m.protocol.toLowerCase(), m.hostname = m.hostname.toLowerCase(), m.toString();
    }
    return g;
  }
  return AP.sanitizeUrl = s, AP;
}
var dXt = uXt(), Lze = typeof globalThis == "object" && globalThis && globalThis.Object === Object && globalThis, hXt = typeof self == "object" && self && self.Object === Object && self, Bb = Lze || hXt || Function("return this")(), hj = Bb.Symbol, Tze = Object.prototype, fXt = Tze.hasOwnProperty, gXt = Tze.toString, OP = hj ? hj.toStringTag : void 0;
function pXt(i) {
  var e = fXt.call(i, OP), t = i[OP];
  try {
    i[OP] = void 0;
    var n = !0;
  } catch {
  }
  var r = gXt.call(i);
  return n && (e ? i[OP] = t : delete i[OP]), r;
}
var mXt = Object.prototype, _Xt = mXt.toString;
function bXt(i) {
  return _Xt.call(i);
}
var vXt = "[object Null]", yXt = "[object Undefined]", sOe = hj ? hj.toStringTag : void 0;
function D2(i) {
  return i == null ? i === void 0 ? yXt : vXt : sOe && sOe in Object(i) ? pXt(i) : bXt(i);
}
function mk(i) {
  var e = typeof i;
  return i != null && (e == "object" || e == "function");
}
var CXt = "[object AsyncFunction]", wXt = "[object Function]", SXt = "[object GeneratorFunction]", EXt = "[object Proxy]";
function bCe(i) {
  if (!mk(i))
    return !1;
  var e = D2(i);
  return e == wXt || e == SXt || e == CXt || e == EXt;
}
var Ane = Bb["__core-js_shared__"], oOe = (function() {
  var i = /[^.]+$/.exec(Ane && Ane.keys && Ane.keys.IE_PROTO || "");
  return i ? "Symbol(src)_1." + i : "";
})();
function xXt(i) {
  return !!oOe && oOe in i;
}
var LXt = Function.prototype, TXt = LXt.toString;
function _k(i) {
  if (i != null) {
    try {
      return TXt.call(i);
    } catch {
    }
    try {
      return i + "";
    } catch {
    }
  }
  return "";
}
var kXt = /[\\^$.*+?()[\]{}|]/g, DXt = /^\[object .+?Constructor\]$/, IXt = Function.prototype, NXt = Object.prototype, RXt = IXt.toString, AXt = NXt.hasOwnProperty, OXt = RegExp(
  "^" + RXt.call(AXt).replace(kXt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function MXt(i) {
  if (!mk(i) || xXt(i))
    return !1;
  var e = bCe(i) ? OXt : DXt;
  return e.test(_k(i));
}
function PXt(i, e) {
  return i == null ? void 0 : i[e];
}
function bk(i, e) {
  var t = PXt(i, e);
  return MXt(t) ? t : void 0;
}
var iB = bk(Object, "create");
function FXt() {
  this.__data__ = iB ? iB(null) : {}, this.size = 0;
}
function BXt(i) {
  var e = this.has(i) && delete this.__data__[i];
  return this.size -= e ? 1 : 0, e;
}
var HXt = "__lodash_hash_undefined__", WXt = Object.prototype, VXt = WXt.hasOwnProperty;
function UXt(i) {
  var e = this.__data__;
  if (iB) {
    var t = e[i];
    return t === HXt ? void 0 : t;
  }
  return VXt.call(e, i) ? e[i] : void 0;
}
var zXt = Object.prototype, $Xt = zXt.hasOwnProperty;
function jXt(i) {
  var e = this.__data__;
  return iB ? e[i] !== void 0 : $Xt.call(e, i);
}
var GXt = "__lodash_hash_undefined__";
function qXt(i, e) {
  var t = this.__data__;
  return this.size += this.has(i) ? 0 : 1, t[i] = iB && e === void 0 ? GXt : e, this;
}
function HT(i) {
  var e = -1, t = i == null ? 0 : i.length;
  for (this.clear(); ++e < t; ) {
    var n = i[e];
    this.set(n[0], n[1]);
  }
}
HT.prototype.clear = FXt;
HT.prototype.delete = BXt;
HT.prototype.get = UXt;
HT.prototype.has = jXt;
HT.prototype.set = qXt;
function KXt() {
  this.__data__ = [], this.size = 0;
}
function UY(i, e) {
  return i === e || i !== i && e !== e;
}
function zY(i, e) {
  for (var t = i.length; t--; )
    if (UY(i[t][0], e))
      return t;
  return -1;
}
var YXt = Array.prototype, XXt = YXt.splice;
function ZXt(i) {
  var e = this.__data__, t = zY(e, i);
  if (t < 0)
    return !1;
  var n = e.length - 1;
  return t == n ? e.pop() : XXt.call(e, t, 1), --this.size, !0;
}
function QXt(i) {
  var e = this.__data__, t = zY(e, i);
  return t < 0 ? void 0 : e[t][1];
}
function JXt(i) {
  return zY(this.__data__, i) > -1;
}
function eZt(i, e) {
  var t = this.__data__, n = zY(t, i);
  return n < 0 ? (++this.size, t.push([i, e])) : t[n][1] = e, this;
}
function v0(i) {
  var e = -1, t = i == null ? 0 : i.length;
  for (this.clear(); ++e < t; ) {
    var n = i[e];
    this.set(n[0], n[1]);
  }
}
v0.prototype.clear = KXt;
v0.prototype.delete = ZXt;
v0.prototype.get = QXt;
v0.prototype.has = JXt;
v0.prototype.set = eZt;
var rB = bk(Bb, "Map");
function tZt() {
  this.size = 0, this.__data__ = {
    hash: new HT(),
    map: new (rB || v0)(),
    string: new HT()
  };
}
function nZt(i) {
  var e = typeof i;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? i !== "__proto__" : i === null;
}
function $Y(i, e) {
  var t = i.__data__;
  return nZt(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
}
function iZt(i) {
  var e = $Y(this, i).delete(i);
  return this.size -= e ? 1 : 0, e;
}
function rZt(i) {
  return $Y(this, i).get(i);
}
function sZt(i) {
  return $Y(this, i).has(i);
}
function oZt(i, e) {
  var t = $Y(this, i), n = t.size;
  return t.set(i, e), this.size += t.size == n ? 0 : 1, this;
}
function Ow(i) {
  var e = -1, t = i == null ? 0 : i.length;
  for (this.clear(); ++e < t; ) {
    var n = i[e];
    this.set(n[0], n[1]);
  }
}
Ow.prototype.clear = tZt;
Ow.prototype.delete = iZt;
Ow.prototype.get = rZt;
Ow.prototype.has = sZt;
Ow.prototype.set = oZt;
var aZt = "Expected a function";
function w6(i, e) {
  if (typeof i != "function" || e != null && typeof e != "function")
    throw new TypeError(aZt);
  var t = function() {
    var n = arguments, r = e ? e.apply(this, n) : n[0], s = t.cache;
    if (s.has(r))
      return s.get(r);
    var o = i.apply(this, n);
    return t.cache = s.set(r, o) || s, o;
  };
  return t.cache = new (w6.Cache || Ow)(), t;
}
w6.Cache = Ow;
function lZt() {
  this.__data__ = new v0(), this.size = 0;
}
function cZt(i) {
  var e = this.__data__, t = e.delete(i);
  return this.size = e.size, t;
}
function uZt(i) {
  return this.__data__.get(i);
}
function dZt(i) {
  return this.__data__.has(i);
}
var hZt = 200;
function fZt(i, e) {
  var t = this.__data__;
  if (t instanceof v0) {
    var n = t.__data__;
    if (!rB || n.length < hZt - 1)
      return n.push([i, e]), this.size = ++t.size, this;
    t = this.__data__ = new Ow(n);
  }
  return t.set(i, e), this.size = t.size, this;
}
function I2(i) {
  var e = this.__data__ = new v0(i);
  this.size = e.size;
}
I2.prototype.clear = lZt;
I2.prototype.delete = cZt;
I2.prototype.get = uZt;
I2.prototype.has = dZt;
I2.prototype.set = fZt;
var fj = (function() {
  try {
    var i = bk(Object, "defineProperty");
    return i({}, "", {}), i;
  } catch {
  }
})();
function vCe(i, e, t) {
  e == "__proto__" && fj ? fj(i, e, {
    configurable: !0,
    enumerable: !0,
    value: t,
    writable: !0
  }) : i[e] = t;
}
function the(i, e, t) {
  (t !== void 0 && !UY(i[e], t) || t === void 0 && !(e in i)) && vCe(i, e, t);
}
function gZt(i) {
  return function(e, t, n) {
    for (var r = -1, s = Object(e), o = n(e), a = o.length; a--; ) {
      var l = o[++r];
      if (t(s[l], l, s) === !1)
        break;
    }
    return e;
  };
}
var pZt = gZt(), kze = typeof exports == "object" && exports && !exports.nodeType && exports, aOe = kze && typeof module == "object" && module && !module.nodeType && module, mZt = aOe && aOe.exports === kze, lOe = mZt ? Bb.Buffer : void 0, cOe = lOe ? lOe.allocUnsafe : void 0;
function _Zt(i, e) {
  if (e)
    return i.slice();
  var t = i.length, n = cOe ? cOe(t) : new i.constructor(t);
  return i.copy(n), n;
}
var uOe = Bb.Uint8Array;
function bZt(i) {
  var e = new i.constructor(i.byteLength);
  return new uOe(e).set(new uOe(i)), e;
}
function vZt(i, e) {
  var t = e ? bZt(i.buffer) : i.buffer;
  return new i.constructor(t, i.byteOffset, i.length);
}
function yZt(i, e) {
  var t = -1, n = i.length;
  for (e || (e = Array(n)); ++t < n; )
    e[t] = i[t];
  return e;
}
var dOe = Object.create, CZt = /* @__PURE__ */ (function() {
  function i() {
  }
  return function(e) {
    if (!mk(e))
      return {};
    if (dOe)
      return dOe(e);
    i.prototype = e;
    var t = new i();
    return i.prototype = void 0, t;
  };
})();
function Dze(i, e) {
  return function(t) {
    return i(e(t));
  };
}
var Ize = Dze(Object.getPrototypeOf, Object), wZt = Object.prototype;
function jY(i) {
  var e = i && i.constructor, t = typeof e == "function" && e.prototype || wZt;
  return i === t;
}
function SZt(i) {
  return typeof i.constructor == "function" && !jY(i) ? CZt(Ize(i)) : {};
}
function S6(i) {
  return i != null && typeof i == "object";
}
var EZt = "[object Arguments]";
function hOe(i) {
  return S6(i) && D2(i) == EZt;
}
var Nze = Object.prototype, xZt = Nze.hasOwnProperty, LZt = Nze.propertyIsEnumerable, gj = hOe(/* @__PURE__ */ (function() {
  return arguments;
})()) ? hOe : function(i) {
  return S6(i) && xZt.call(i, "callee") && !LZt.call(i, "callee");
}, pj = Array.isArray, TZt = 9007199254740991;
function Rze(i) {
  return typeof i == "number" && i > -1 && i % 1 == 0 && i <= TZt;
}
function GY(i) {
  return i != null && Rze(i.length) && !bCe(i);
}
function kZt(i) {
  return S6(i) && GY(i);
}
function DZt() {
  return !1;
}
var Aze = typeof exports == "object" && exports && !exports.nodeType && exports, fOe = Aze && typeof module == "object" && module && !module.nodeType && module, IZt = fOe && fOe.exports === Aze, gOe = IZt ? Bb.Buffer : void 0, NZt = gOe ? gOe.isBuffer : void 0, yCe = NZt || DZt, RZt = "[object Object]", AZt = Function.prototype, OZt = Object.prototype, Oze = AZt.toString, MZt = OZt.hasOwnProperty, PZt = Oze.call(Object);
function FZt(i) {
  if (!S6(i) || D2(i) != RZt)
    return !1;
  var e = Ize(i);
  if (e === null)
    return !0;
  var t = MZt.call(e, "constructor") && e.constructor;
  return typeof t == "function" && t instanceof t && Oze.call(t) == PZt;
}
var BZt = "[object Arguments]", HZt = "[object Array]", WZt = "[object Boolean]", VZt = "[object Date]", UZt = "[object Error]", zZt = "[object Function]", $Zt = "[object Map]", jZt = "[object Number]", GZt = "[object Object]", qZt = "[object RegExp]", KZt = "[object Set]", YZt = "[object String]", XZt = "[object WeakMap]", ZZt = "[object ArrayBuffer]", QZt = "[object DataView]", JZt = "[object Float32Array]", eQt = "[object Float64Array]", tQt = "[object Int8Array]", nQt = "[object Int16Array]", iQt = "[object Int32Array]", rQt = "[object Uint8Array]", sQt = "[object Uint8ClampedArray]", oQt = "[object Uint16Array]", aQt = "[object Uint32Array]", $o = {};
$o[JZt] = $o[eQt] = $o[tQt] = $o[nQt] = $o[iQt] = $o[rQt] = $o[sQt] = $o[oQt] = $o[aQt] = !0;
$o[BZt] = $o[HZt] = $o[ZZt] = $o[WZt] = $o[QZt] = $o[VZt] = $o[UZt] = $o[zZt] = $o[$Zt] = $o[jZt] = $o[GZt] = $o[qZt] = $o[KZt] = $o[YZt] = $o[XZt] = !1;
function lQt(i) {
  return S6(i) && Rze(i.length) && !!$o[D2(i)];
}
function cQt(i) {
  return function(e) {
    return i(e);
  };
}
var Mze = typeof exports == "object" && exports && !exports.nodeType && exports, T3 = Mze && typeof module == "object" && module && !module.nodeType && module, uQt = T3 && T3.exports === Mze, One = uQt && Lze.process, pOe = (function() {
  try {
    var i = T3 && T3.require && T3.require("util").types;
    return i || One && One.binding && One.binding("util");
  } catch {
  }
})(), mOe = pOe && pOe.isTypedArray, CCe = mOe ? cQt(mOe) : lQt;
function nhe(i, e) {
  if (!(e === "constructor" && typeof i[e] == "function") && e != "__proto__")
    return i[e];
}
var dQt = Object.prototype, hQt = dQt.hasOwnProperty;
function fQt(i, e, t) {
  var n = i[e];
  (!(hQt.call(i, e) && UY(n, t)) || t === void 0 && !(e in i)) && vCe(i, e, t);
}
function gQt(i, e, t, n) {
  var r = !t;
  t || (t = {});
  for (var s = -1, o = e.length; ++s < o; ) {
    var a = e[s], l = void 0;
    l === void 0 && (l = i[a]), r ? vCe(t, a, l) : fQt(t, a, l);
  }
  return t;
}
function pQt(i, e) {
  for (var t = -1, n = Array(i); ++t < i; )
    n[t] = e(t);
  return n;
}
var mQt = 9007199254740991, _Qt = /^(?:0|[1-9]\d*)$/;
function Pze(i, e) {
  var t = typeof i;
  return e = e ?? mQt, !!e && (t == "number" || t != "symbol" && _Qt.test(i)) && i > -1 && i % 1 == 0 && i < e;
}
var bQt = Object.prototype, vQt = bQt.hasOwnProperty;
function yQt(i, e) {
  var t = pj(i), n = !t && gj(i), r = !t && !n && yCe(i), s = !t && !n && !r && CCe(i), o = t || n || r || s, a = o ? pQt(i.length, String) : [], l = a.length;
  for (var c in i)
    (e || vQt.call(i, c)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
    (c == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    r && (c == "offset" || c == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    s && (c == "buffer" || c == "byteLength" || c == "byteOffset") || // Skip index properties.
    Pze(c, l))) && a.push(c);
  return a;
}
function CQt(i) {
  var e = [];
  if (i != null)
    for (var t in Object(i))
      e.push(t);
  return e;
}
var wQt = Object.prototype, SQt = wQt.hasOwnProperty;
function EQt(i) {
  if (!mk(i))
    return CQt(i);
  var e = jY(i), t = [];
  for (var n in i)
    n == "constructor" && (e || !SQt.call(i, n)) || t.push(n);
  return t;
}
function Fze(i) {
  return GY(i) ? yQt(i, !0) : EQt(i);
}
function xQt(i) {
  return gQt(i, Fze(i));
}
function LQt(i, e, t, n, r, s, o) {
  var a = nhe(i, t), l = nhe(e, t), c = o.get(l);
  if (c) {
    the(i, t, c);
    return;
  }
  var u = s ? s(a, l, t + "", i, e, o) : void 0, d = u === void 0;
  if (d) {
    var h = pj(l), g = !h && yCe(l), m = !h && !g && CCe(l);
    u = l, h || g || m ? pj(a) ? u = a : kZt(a) ? u = yZt(a) : g ? (d = !1, u = _Zt(l, !0)) : m ? (d = !1, u = vZt(l, !0)) : u = [] : FZt(l) || gj(l) ? (u = a, gj(a) ? u = xQt(a) : (!mk(a) || bCe(a)) && (u = SZt(l))) : d = !1;
  }
  d && (o.set(l, u), r(u, l, n, s, o), o.delete(l)), the(i, t, u);
}
function Bze(i, e, t, n, r) {
  i !== e && pZt(e, function(s, o) {
    if (r || (r = new I2()), mk(s))
      LQt(i, e, o, t, Bze, n, r);
    else {
      var a = n ? n(nhe(i, o), s, o + "", i, e, r) : void 0;
      a === void 0 && (a = s), the(i, o, a);
    }
  }, Fze);
}
function Hze(i) {
  return i;
}
function TQt(i, e, t) {
  switch (t.length) {
    case 0:
      return i.call(e);
    case 1:
      return i.call(e, t[0]);
    case 2:
      return i.call(e, t[0], t[1]);
    case 3:
      return i.call(e, t[0], t[1], t[2]);
  }
  return i.apply(e, t);
}
var _Oe = Math.max;
function kQt(i, e, t) {
  return e = _Oe(e === void 0 ? i.length - 1 : e, 0), function() {
    for (var n = arguments, r = -1, s = _Oe(n.length - e, 0), o = Array(s); ++r < s; )
      o[r] = n[e + r];
    r = -1;
    for (var a = Array(e + 1); ++r < e; )
      a[r] = n[r];
    return a[e] = t(o), TQt(i, this, a);
  };
}
function DQt(i) {
  return function() {
    return i;
  };
}
var IQt = fj ? function(i, e) {
  return fj(i, "toString", {
    configurable: !0,
    enumerable: !1,
    value: DQt(e),
    writable: !0
  });
} : Hze, NQt = 800, RQt = 16, AQt = Date.now;
function OQt(i) {
  var e = 0, t = 0;
  return function() {
    var n = AQt(), r = RQt - (n - t);
    if (t = n, r > 0) {
      if (++e >= NQt)
        return arguments[0];
    } else
      e = 0;
    return i.apply(void 0, arguments);
  };
}
var MQt = OQt(IQt);
function PQt(i, e) {
  return MQt(kQt(i, e, Hze), i + "");
}
function FQt(i, e, t) {
  if (!mk(t))
    return !1;
  var n = typeof e;
  return (n == "number" ? GY(t) && Pze(e, t.length) : n == "string" && e in t) ? UY(t[e], i) : !1;
}
function BQt(i) {
  return PQt(function(e, t) {
    var n = -1, r = t.length, s = r > 1 ? t[r - 1] : void 0, o = r > 2 ? t[2] : void 0;
    for (s = i.length > 3 && typeof s == "function" ? (r--, s) : void 0, o && FQt(t[0], t[1], o) && (s = r < 3 ? void 0 : s, r = 1), e = Object(e); ++n < r; ) {
      var a = t[n];
      a && i(e, a, n, s);
    }
    return e;
  });
}
var HQt = BQt(function(i, e, t) {
  Bze(i, e, t);
}), WQt = "​", VQt = {
  curveBasis: fV,
  curveBasisClosed: zKt,
  curveBasisOpen: $Kt,
  curveBumpX: EVe,
  curveBumpY: xVe,
  curveBundle: jKt,
  curveCardinalClosed: GKt,
  curveCardinalOpen: qKt,
  curveCardinal: DVe,
  curveCatmullRomClosed: KKt,
  curveCatmullRomOpen: YKt,
  curveCatmullRom: NVe,
  curveLinear: nj,
  curveLinearClosed: XKt,
  curveMonotoneX: FVe,
  curveMonotoneY: BVe,
  curveNatural: WVe,
  curveStep: VVe,
  curveStepAfter: zVe,
  curveStepBefore: UVe
}, UQt = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi, zQt = /* @__PURE__ */ $(function(i, e) {
  const t = Wze(i, /(?:init\b)|(?:initialize\b)/);
  let n = {};
  if (Array.isArray(t)) {
    const o = t.map((a) => a.args);
    j$(o), n = Xl(n, [...o]);
  } else
    n = t.args;
  if (!n)
    return;
  let r = j0e(i, e);
  const s = "config";
  return n[s] !== void 0 && (r === "flowchart-v2" && (r = "flowchart"), n[r] = n[s], delete n[s]), n;
}, "detectInit"), Wze = /* @__PURE__ */ $(function(i, e = null) {
  var t, n;
  try {
    const r = new RegExp(
      `[%]{2}(?![{]${UQt.source})(?=[}][%]{2}).*
`,
      "ig"
    );
    i = i.trim().replace(r, "").replace(/'/gm, '"'), Ct.debug(
      `Detecting diagram directive${e !== null ? " type:" + e : ""} based on the text:${i}`
    );
    let s;
    const o = [];
    for (; (s = x3.exec(i)) !== null; )
      if (s.index === x3.lastIndex && x3.lastIndex++, s && !e || e && ((t = s[1]) != null && t.match(e)) || e && ((n = s[2]) != null && n.match(e))) {
        const a = s[1] ? s[1] : s[2], l = s[3] ? s[3].trim() : s[4] ? JSON.parse(s[4].trim()) : null;
        o.push({ type: a, args: l });
      }
    return o.length === 0 ? { type: i, args: null } : o.length === 1 ? o[0] : o;
  } catch (r) {
    return Ct.error(
      `ERROR: ${r.message} - Unable to parse directive type: '${e}' based on the text: '${i}'`
    ), { type: void 0, args: null };
  }
}, "detectDirective"), $Qt = /* @__PURE__ */ $(function(i) {
  return i.replace(x3, "");
}, "removeDirectives"), jQt = /* @__PURE__ */ $(function(i, e) {
  for (const [t, n] of e.entries())
    if (n.match(i))
      return t;
  return -1;
}, "isSubstringInArray");
function wCe(i, e) {
  if (!i)
    return e;
  const t = `curve${i.charAt(0).toUpperCase() + i.slice(1)}`;
  return VQt[t] ?? e;
}
$(wCe, "interpolateToCurve");
function Vze(i, e) {
  const t = i.trim();
  if (t)
    return e.securityLevel !== "loose" ? dXt.sanitizeUrl(t) : t;
}
$(Vze, "formatUrl");
var GQt = /* @__PURE__ */ $((i, ...e) => {
  const t = i.split("."), n = t.length - 1, r = t[n];
  let s = window;
  for (let o = 0; o < n; o++)
    if (s = s[t[o]], !s) {
      Ct.error(`Function name: ${i} not found in window`);
      return;
    }
  s[r](...e);
}, "runFunc");
function SCe(i, e) {
  return !i || !e ? 0 : Math.sqrt(Math.pow(e.x - i.x, 2) + Math.pow(e.y - i.y, 2));
}
$(SCe, "distance");
function Uze(i) {
  let e, t = 0;
  i.forEach((r) => {
    t += SCe(r, e), e = r;
  });
  const n = t / 2;
  return ECe(i, n);
}
$(Uze, "traverseEdge");
function zze(i) {
  return i.length === 1 ? i[0] : Uze(i);
}
$(zze, "calcLabelPosition");
var bOe = /* @__PURE__ */ $((i, e = 2) => {
  const t = Math.pow(10, e);
  return Math.round(i * t) / t;
}, "roundNumber"), ECe = /* @__PURE__ */ $((i, e) => {
  let t, n = e;
  for (const r of i) {
    if (t) {
      const s = SCe(r, t);
      if (s === 0)
        return t;
      if (s < n)
        n -= s;
      else {
        const o = n / s;
        if (o <= 0)
          return t;
        if (o >= 1)
          return { x: r.x, y: r.y };
        if (o > 0 && o < 1)
          return {
            x: bOe((1 - o) * t.x + o * r.x, 5),
            y: bOe((1 - o) * t.y + o * r.y, 5)
          };
      }
    }
    t = r;
  }
  throw new Error("Could not find a suitable point for the given distance");
}, "calculatePoint"), qQt = /* @__PURE__ */ $((i, e, t) => {
  Ct.info(`our points ${JSON.stringify(e)}`), e[0] !== t && (e = e.reverse());
  const r = ECe(e, 25), s = i ? 10 : 5, o = Math.atan2(e[0].y - r.y, e[0].x - r.x), a = { x: 0, y: 0 };
  return a.x = Math.sin(o) * s + (e[0].x + r.x) / 2, a.y = -Math.cos(o) * s + (e[0].y + r.y) / 2, a;
}, "calcCardinalityPosition");
function $ze(i, e, t) {
  const n = structuredClone(t);
  Ct.info("our points", n), e !== "start_left" && e !== "start_right" && n.reverse();
  const r = 25 + i, s = ECe(n, r), o = 10 + i * 0.5, a = Math.atan2(n[0].y - s.y, n[0].x - s.x), l = { x: 0, y: 0 };
  return e === "start_left" ? (l.x = Math.sin(a + Math.PI) * o + (n[0].x + s.x) / 2, l.y = -Math.cos(a + Math.PI) * o + (n[0].y + s.y) / 2) : e === "end_right" ? (l.x = Math.sin(a - Math.PI) * o + (n[0].x + s.x) / 2 - 5, l.y = -Math.cos(a - Math.PI) * o + (n[0].y + s.y) / 2 - 5) : e === "end_left" ? (l.x = Math.sin(a) * o + (n[0].x + s.x) / 2 - 5, l.y = -Math.cos(a) * o + (n[0].y + s.y) / 2 - 5) : (l.x = Math.sin(a) * o + (n[0].x + s.x) / 2, l.y = -Math.cos(a) * o + (n[0].y + s.y) / 2), l;
}
$($ze, "calcTerminalLabelPosition");
function jze(i) {
  let e = "", t = "";
  for (const n of i)
    n !== void 0 && (n.startsWith("color:") || n.startsWith("text-align:") ? t = t + n + ";" : e = e + n + ";");
  return { style: e, labelStyle: t };
}
$(jze, "getStylesFromArray");
var vOe = 0, KQt = /* @__PURE__ */ $(() => (vOe++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + vOe), "generateId");
function Gze(i) {
  let e = "";
  const t = "0123456789abcdef", n = t.length;
  for (let r = 0; r < i; r++)
    e += t.charAt(Math.floor(Math.random() * n));
  return e;
}
$(Gze, "makeRandomHex");
var YQt = /* @__PURE__ */ $((i) => Gze(i.length), "random"), XQt = /* @__PURE__ */ $(function() {
  return {
    x: 0,
    y: 0,
    fill: void 0,
    anchor: "start",
    style: "#666",
    width: 100,
    height: 100,
    textMargin: 0,
    rx: 0,
    ry: 0,
    valign: void 0,
    text: ""
  };
}, "getTextObj"), ZQt = /* @__PURE__ */ $(function(i, e) {
  const t = e.text.replace(T2.lineBreakRegex, " "), [, n] = qY(e.fontSize), r = i.append("text");
  r.attr("x", e.x), r.attr("y", e.y), r.style("text-anchor", e.anchor), r.style("font-family", e.fontFamily), r.style("font-size", n), r.style("font-weight", e.fontWeight), r.attr("fill", e.fill), e.class !== void 0 && r.attr("class", e.class);
  const s = r.append("tspan");
  return s.attr("x", e.x + e.textMargin * 2), s.attr("fill", e.fill), s.text(t), r;
}, "drawSimpleText"), QQt = w6(
  (i, e, t) => {
    if (!i || (t = Object.assign(
      { fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "<br/>" },
      t
    ), T2.lineBreakRegex.test(i)))
      return i;
    const n = i.split(" ").filter(Boolean), r = [];
    let s = "";
    return n.forEach((o, a) => {
      const l = c0(`${o} `, t), c = c0(s, t);
      if (l > e) {
        const { hyphenatedStrings: h, remainingWord: g } = JQt(o, e, "-", t);
        r.push(s, ...h), s = g;
      } else c + l >= e ? (r.push(s), s = o) : s = [s, o].filter(Boolean).join(" ");
      a + 1 === n.length && r.push(s);
    }), r.filter((o) => o !== "").join(t.joinWith);
  },
  (i, e, t) => `${i}${e}${t.fontSize}${t.fontWeight}${t.fontFamily}${t.joinWith}`
), JQt = w6(
  (i, e, t = "-", n) => {
    n = Object.assign(
      { fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0 },
      n
    );
    const r = [...i], s = [];
    let o = "";
    return r.forEach((a, l) => {
      const c = `${o}${a}`;
      if (c0(c, n) >= e) {
        const d = l + 1, h = r.length === d, g = `${c}${t}`;
        s.push(h ? c : g), o = "";
      } else
        o = c;
    }), { hyphenatedStrings: s, remainingWord: o };
  },
  (i, e, t = "-", n) => `${i}${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}`
);
function qze(i, e) {
  return xCe(i, e).height;
}
$(qze, "calculateTextHeight");
function c0(i, e) {
  return xCe(i, e).width;
}
$(c0, "calculateTextWidth");
var xCe = w6(
  (i, e) => {
    const { fontSize: t = 12, fontFamily: n = "Arial", fontWeight: r = 400 } = e;
    if (!i)
      return { width: 0, height: 0 };
    const [, s] = qY(t), o = ["sans-serif", n], a = i.split(T2.lineBreakRegex), l = [], c = ls("body");
    if (!c.remove)
      return { width: 0, height: 0, lineHeight: 0 };
    const u = c.append("svg");
    for (const h of o) {
      let g = 0;
      const m = { width: 0, height: 0, lineHeight: 0 };
      for (const _ of a) {
        const v = XQt();
        v.text = _ || WQt;
        const w = ZQt(u, v).style("font-size", s).style("font-weight", r).style("font-family", h), E = (w._groups || w)[0][0].getBBox();
        if (E.width === 0 && E.height === 0)
          throw new Error("svg element not in render tree");
        m.width = Math.round(Math.max(m.width, E.width)), g = Math.round(E.height), m.height += g, m.lineHeight = Math.round(Math.max(m.lineHeight, g));
      }
      l.push(m);
    }
    u.remove();
    const d = isNaN(l[1].height) || isNaN(l[1].width) || isNaN(l[1].lineHeight) || l[0].height > l[1].height && l[0].width > l[1].width && l[0].lineHeight > l[1].lineHeight ? 0 : 1;
    return l[d];
  },
  (i, e) => `${i}${e.fontSize}${e.fontWeight}${e.fontFamily}`
), UR, eJt = (UR = class {
  constructor(e = !1, t) {
    this.count = 0, this.count = t ? t.length : 0, this.next = e ? () => this.count++ : () => Date.now();
  }
}, $(UR, "InitIDGenerator"), UR), cW, tJt = /* @__PURE__ */ $(function(i) {
  return cW = cW || document.createElement("div"), i = escape(i).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";"), cW.innerHTML = i, unescape(cW.textContent);
}, "entityDecode");
function LCe(i) {
  return "str" in i;
}
$(LCe, "isDetailedError");
var nJt = /* @__PURE__ */ $((i, e, t, n) => {
  var s;
  if (!n)
    return;
  const r = (s = i.node()) == null ? void 0 : s.getBBox();
  r && i.append("text").text(n).attr("text-anchor", "middle").attr("x", r.x + r.width / 2).attr("y", -t).attr("class", e);
}, "insertTitle"), qY = /* @__PURE__ */ $((i) => {
  if (typeof i == "number")
    return [i, i + "px"];
  const e = parseInt(i ?? "", 10);
  return Number.isNaN(e) ? [void 0, void 0] : i === String(e) ? [e, i + "px"] : [e, i];
}, "parseFontSize");
function TCe(i, e) {
  return HQt({}, i, e);
}
$(TCe, "cleanAndMerge");
var Jp = {
  assignWithDepth: Xl,
  wrapLabel: QQt,
  calculateTextHeight: qze,
  calculateTextWidth: c0,
  calculateTextDimensions: xCe,
  cleanAndMerge: TCe,
  detectInit: zQt,
  detectDirective: Wze,
  isSubstringInArray: jQt,
  interpolateToCurve: wCe,
  calcLabelPosition: zze,
  calcCardinalityPosition: qQt,
  calcTerminalLabelPosition: $ze,
  formatUrl: Vze,
  getStylesFromArray: jze,
  generateId: KQt,
  random: YQt,
  runFunc: GQt,
  entityDecode: tJt,
  insertTitle: nJt,
  isLabelCoordinateInPath: Kze,
  parseFontSize: qY,
  InitIDGenerator: eJt
}, iJt = /* @__PURE__ */ $(function(i) {
  let e = i;
  return e = e.replace(/style.*:\S*#.*;/g, function(t) {
    return t.substring(0, t.length - 1);
  }), e = e.replace(/classDef.*:\S*#.*;/g, function(t) {
    return t.substring(0, t.length - 1);
  }), e = e.replace(/#\w+;/g, function(t) {
    const n = t.substring(1, t.length - 1);
    return /^\+?\d+$/.test(n) ? "ﬂ°°" + n + "¶ß" : "ﬂ°" + n + "¶ß";
  }), e;
}, "encodeEntities"), vk = /* @__PURE__ */ $(function(i) {
  return i.replace(/ﬂ°°/g, "&#").replace(/ﬂ°/g, "&").replace(/¶ß/g, ";");
}, "decodeEntities"), gcn = /* @__PURE__ */ $((i, e, {
  counter: t = 0,
  prefix: n,
  suffix: r
}, s) => s || `${n ? `${n}_` : ""}${i}_${e}_${t}${r ? `_${r}` : ""}`, "getEdgeId");
function Xu(i) {
  return i ?? null;
}
$(Xu, "handleUndefinedAttr");
function Kze(i, e) {
  const t = Math.round(i.x), n = Math.round(i.y), r = e.replace(
    /(\d+\.\d+)/g,
    (s) => Math.round(parseFloat(s)).toString()
  );
  return r.includes(t.toString()) || r.includes(n.toString());
}
$(Kze, "isLabelCoordinateInPath");
const rJt = Object.freeze({
  left: 0,
  top: 0,
  width: 16,
  height: 16
}), mj = Object.freeze({
  rotate: 0,
  vFlip: !1,
  hFlip: !1
}), Yze = Object.freeze({
  ...rJt,
  ...mj
}), sJt = Object.freeze({
  ...Yze,
  body: "",
  hidden: !1
}), oJt = Object.freeze({
  width: null,
  height: null
}), aJt = Object.freeze({
  ...oJt,
  ...mj
}), lJt = (i, e, t, n = "") => {
  const r = i.split(":");
  if (i.slice(0, 1) === "@") {
    if (r.length < 2 || r.length > 3) return null;
    n = r.shift().slice(1);
  }
  if (r.length > 3 || !r.length) return null;
  if (r.length > 1) {
    const a = r.pop(), l = r.pop(), c = {
      provider: r.length > 0 ? r[0] : n,
      prefix: l,
      name: a
    };
    return Mne(c) ? c : null;
  }
  const s = r[0], o = s.split("-");
  if (o.length > 1) {
    const a = {
      provider: n,
      prefix: o.shift(),
      name: o.join("-")
    };
    return Mne(a) ? a : null;
  }
  if (t && n === "") {
    const a = {
      provider: n,
      prefix: "",
      name: s
    };
    return Mne(a, t) ? a : null;
  }
  return null;
}, Mne = (i, e) => i ? !!((e && i.prefix === "" || i.prefix) && i.name) : !1;
function cJt(i, e) {
  const t = {};
  !i.hFlip != !e.hFlip && (t.hFlip = !0), !i.vFlip != !e.vFlip && (t.vFlip = !0);
  const n = ((i.rotate || 0) + (e.rotate || 0)) % 4;
  return n && (t.rotate = n), t;
}
function yOe(i, e) {
  const t = cJt(i, e);
  for (const n in sJt) n in mj ? n in i && !(n in t) && (t[n] = mj[n]) : n in e ? t[n] = e[n] : n in i && (t[n] = i[n]);
  return t;
}
function uJt(i, e) {
  const t = i.icons, n = i.aliases || /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ Object.create(null);
  function s(o) {
    if (t[o]) return r[o] = [];
    if (!(o in r)) {
      r[o] = null;
      const a = n[o] && n[o].parent, l = a && s(a);
      l && (r[o] = [a].concat(l));
    }
    return r[o];
  }
  return (e || Object.keys(t).concat(Object.keys(n))).forEach(s), r;
}
function COe(i, e, t) {
  const n = i.icons, r = i.aliases || /* @__PURE__ */ Object.create(null);
  let s = {};
  function o(a) {
    s = yOe(n[a] || r[a], s);
  }
  return o(e), t.forEach(o), yOe(i, s);
}
function dJt(i, e) {
  if (i.icons[e]) return COe(i, e, []);
  const t = uJt(i, [e])[e];
  return t ? COe(i, e, t) : null;
}
const hJt = /(-?[0-9.]*[0-9]+[0-9.]*)/g, fJt = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
function wOe(i, e, t) {
  if (e === 1) return i;
  if (t = t || 100, typeof i == "number") return Math.ceil(i * e * t) / t;
  if (typeof i != "string") return i;
  const n = i.split(hJt);
  if (n === null || !n.length) return i;
  const r = [];
  let s = n.shift(), o = fJt.test(s);
  for (; ; ) {
    if (o) {
      const a = parseFloat(s);
      isNaN(a) ? r.push(s) : r.push(Math.ceil(a * e * t) / t);
    } else r.push(s);
    if (s = n.shift(), s === void 0) return r.join("");
    o = !o;
  }
}
function gJt(i, e = "defs") {
  let t = "";
  const n = i.indexOf("<" + e);
  for (; n >= 0; ) {
    const r = i.indexOf(">", n), s = i.indexOf("</" + e);
    if (r === -1 || s === -1) break;
    const o = i.indexOf(">", s);
    if (o === -1) break;
    t += i.slice(r + 1, s).trim(), i = i.slice(0, n).trim() + i.slice(o + 1);
  }
  return {
    defs: t,
    content: i
  };
}
function pJt(i, e) {
  return i ? "<defs>" + i + "</defs>" + e : e;
}
function mJt(i, e, t) {
  const n = gJt(i);
  return pJt(n.defs, e + n.content + t);
}
const _Jt = (i) => i === "unset" || i === "undefined" || i === "none";
function bJt(i, e) {
  const t = {
    ...Yze,
    ...i
  }, n = {
    ...aJt,
    ...e
  }, r = {
    left: t.left,
    top: t.top,
    width: t.width,
    height: t.height
  };
  let s = t.body;
  [t, n].forEach((_) => {
    const v = [], w = _.hFlip, E = _.vFlip;
    let L = _.rotate;
    w ? E ? L += 2 : (v.push("translate(" + (r.width + r.left).toString() + " " + (0 - r.top).toString() + ")"), v.push("scale(-1 1)"), r.top = r.left = 0) : E && (v.push("translate(" + (0 - r.left).toString() + " " + (r.height + r.top).toString() + ")"), v.push("scale(1 -1)"), r.top = r.left = 0);
    let T;
    switch (L < 0 && (L -= Math.floor(L / 4) * 4), L = L % 4, L) {
      case 1:
        T = r.height / 2 + r.top, v.unshift("rotate(90 " + T.toString() + " " + T.toString() + ")");
        break;
      case 2:
        v.unshift("rotate(180 " + (r.width / 2 + r.left).toString() + " " + (r.height / 2 + r.top).toString() + ")");
        break;
      case 3:
        T = r.width / 2 + r.left, v.unshift("rotate(-90 " + T.toString() + " " + T.toString() + ")");
        break;
    }
    L % 2 === 1 && (r.left !== r.top && (T = r.left, r.left = r.top, r.top = T), r.width !== r.height && (T = r.width, r.width = r.height, r.height = T)), v.length && (s = mJt(s, '<g transform="' + v.join(" ") + '">', "</g>"));
  });
  const o = n.width, a = n.height, l = r.width, c = r.height;
  let u, d;
  o === null ? (d = a === null ? "1em" : a === "auto" ? c : a, u = wOe(d, l / c)) : (u = o === "auto" ? l : o, d = a === null ? wOe(u, c / l) : a === "auto" ? c : a);
  const h = {}, g = (_, v) => {
    _Jt(v) || (h[_] = v.toString());
  };
  g("width", u), g("height", d);
  const m = [
    r.left,
    r.top,
    l,
    c
  ];
  return h.viewBox = m.join(" "), {
    attributes: h,
    viewBox: m,
    body: s
  };
}
const vJt = /\sid="(\S+)"/g, SOe = /* @__PURE__ */ new Map();
function yJt(i) {
  i = i.replace(/[0-9]+$/, "") || "a";
  const e = SOe.get(i) || 0;
  return SOe.set(i, e + 1), e ? `${i}${e}` : i;
}
function CJt(i) {
  const e = [];
  let t;
  for (; t = vJt.exec(i); ) e.push(t[1]);
  if (!e.length) return i;
  const n = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
  return e.forEach((r) => {
    const s = yJt(r), o = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
    i = i.replace(new RegExp('([#;"])(' + o + ')([")]|\\.[a-z])', "g"), "$1" + s + n + "$3");
  }), i = i.replace(new RegExp(n, "g"), ""), i;
}
function wJt(i, e) {
  let t = i.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
  for (const n in e) t += " " + n + '="' + e[n] + '"';
  return '<svg xmlns="http://www.w3.org/2000/svg"' + t + ">" + i + "</svg>";
}
function kCe() {
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
}
var yk = kCe();
function Xze(i) {
  yk = i;
}
var k3 = { exec: () => null };
function Es(i, e = "") {
  let t = typeof i == "string" ? i : i.source, n = { replace: (r, s) => {
    let o = typeof s == "string" ? s : s.source;
    return o = o.replace(Bd.caret, "$1"), t = t.replace(r, o), n;
  }, getRegex: () => new RegExp(t, e) };
  return n;
}
var SJt = (() => {
  try {
    return !!new RegExp("(?<=1)(?<!1)");
  } catch {
    return !1;
  }
})(), Bd = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (i) => new RegExp(`^( {0,3}${i})((?:[	 ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (i) => new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), hrRegex: (i) => new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (i) => new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (i) => new RegExp(`^ {0,${Math.min(3, i - 1)}}#`), htmlBeginRegex: (i) => new RegExp(`^ {0,${Math.min(3, i - 1)}}<(?:[a-z].*>|!--)`, "i") }, EJt = /^(?:[ \t]*(?:\n|$))+/, xJt = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, LJt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, E6 = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, TJt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, DCe = /(?:[*+-]|\d{1,9}[.)])/, Zze = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Qze = Es(Zze).replace(/bull/g, DCe).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), kJt = Es(Zze).replace(/bull/g, DCe).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), ICe = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, DJt = /^[^\n]+/, NCe = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, IJt = Es(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", NCe).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), NJt = Es(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, DCe).getRegex(), KY = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", RCe = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, RJt = Es("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))", "i").replace("comment", RCe).replace("tag", KY).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Jze = Es(ICe).replace("hr", E6).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", KY).getRegex(), AJt = Es(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Jze).getRegex(), ACe = { blockquote: AJt, code: xJt, def: IJt, fences: LJt, heading: TJt, hr: E6, html: RJt, lheading: Qze, list: NJt, newline: EJt, paragraph: Jze, table: k3, text: DJt }, EOe = Es("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E6).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}	)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", KY).getRegex(), OJt = { ...ACe, lheading: kJt, table: EOe, paragraph: Es(ICe).replace("hr", E6).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", EOe).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", KY).getRegex() }, MJt = { ...ACe, html: Es(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", RCe).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: k3, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: Es(ICe).replace("hr", E6).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", Qze).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, PJt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, FJt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, e$e = /^( {2,}|\\)\n(?!\s*$)/, BJt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, YY = /[\p{P}\p{S}]/u, OCe = /[\s\p{P}\p{S}]/u, t$e = /[^\s\p{P}\p{S}]/u, HJt = Es(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, OCe).getRegex(), n$e = /(?!~)[\p{P}\p{S}]/u, WJt = /(?!~)[\s\p{P}\p{S}]/u, VJt = /(?:[^\s\p{P}\p{S}]|~)/u, UJt = Es(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", SJt ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), i$e = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, zJt = Es(i$e, "u").replace(/punct/g, YY).getRegex(), $Jt = Es(i$e, "u").replace(/punct/g, n$e).getRegex(), r$e = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", jJt = Es(r$e, "gu").replace(/notPunctSpace/g, t$e).replace(/punctSpace/g, OCe).replace(/punct/g, YY).getRegex(), GJt = Es(r$e, "gu").replace(/notPunctSpace/g, VJt).replace(/punctSpace/g, WJt).replace(/punct/g, n$e).getRegex(), qJt = Es("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, t$e).replace(/punctSpace/g, OCe).replace(/punct/g, YY).getRegex(), KJt = Es(/\\(punct)/, "gu").replace(/punct/g, YY).getRegex(), YJt = Es(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), XJt = Es(RCe).replace("(?:-->|$)", "-->").getRegex(), ZJt = Es("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", XJt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), _j = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, QJt = Es(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", _j).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), s$e = Es(/^!?\[(label)\]\[(ref)\]/).replace("label", _j).replace("ref", NCe).getRegex(), o$e = Es(/^!?\[(ref)\](?:\[\])?/).replace("ref", NCe).getRegex(), JJt = Es("reflink|nolink(?!\\()", "g").replace("reflink", s$e).replace("nolink", o$e).getRegex(), xOe = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, MCe = { _backpedal: k3, anyPunctuation: KJt, autolink: YJt, blockSkip: UJt, br: e$e, code: FJt, del: k3, emStrongLDelim: zJt, emStrongRDelimAst: jJt, emStrongRDelimUnd: qJt, escape: PJt, link: QJt, nolink: o$e, punctuation: HJt, reflink: s$e, reflinkSearch: JJt, tag: ZJt, text: BJt, url: k3 }, een = { ...MCe, link: Es(/^!?\[(label)\]\((.*?)\)/).replace("label", _j).getRegex(), reflink: Es(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _j).getRegex() }, ihe = { ...MCe, emStrongRDelimAst: GJt, emStrongLDelim: $Jt, url: Es(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", xOe).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: Es(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", xOe).getRegex() }, ten = { ...ihe, br: Es(e$e).replace("{2,}", "*").getRegex(), text: Es(ihe.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, uW = { normal: ACe, gfm: OJt, pedantic: MJt }, MP = { normal: MCe, gfm: ihe, breaks: ten, pedantic: een }, nen = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, LOe = (i) => nen[i];
function x_(i, e) {
  if (e) {
    if (Bd.escapeTest.test(i)) return i.replace(Bd.escapeReplace, LOe);
  } else if (Bd.escapeTestNoEncode.test(i)) return i.replace(Bd.escapeReplaceNoEncode, LOe);
  return i;
}
function TOe(i) {
  try {
    i = encodeURI(i).replace(Bd.percentDecode, "%");
  } catch {
    return null;
  }
  return i;
}
function kOe(i, e) {
  var s;
  let t = i.replace(Bd.findPipe, (o, a, l) => {
    let c = !1, u = a;
    for (; --u >= 0 && l[u] === "\\"; ) c = !c;
    return c ? "|" : " |";
  }), n = t.split(Bd.splitPipe), r = 0;
  if (n[0].trim() || n.shift(), n.length > 0 && !((s = n.at(-1)) != null && s.trim()) && n.pop(), e) if (n.length > e) n.splice(e);
  else for (; n.length < e; ) n.push("");
  for (; r < n.length; r++) n[r] = n[r].trim().replace(Bd.slashPipe, "|");
  return n;
}
function PP(i, e, t) {
  let n = i.length;
  if (n === 0) return "";
  let r = 0;
  for (; r < n && i.charAt(n - r - 1) === e; )
    r++;
  return i.slice(0, n - r);
}
function ien(i, e) {
  if (i.indexOf(e[1]) === -1) return -1;
  let t = 0;
  for (let n = 0; n < i.length; n++) if (i[n] === "\\") n++;
  else if (i[n] === e[0]) t++;
  else if (i[n] === e[1] && (t--, t < 0)) return n;
  return t > 0 ? -2 : -1;
}
function DOe(i, e, t, n, r) {
  let s = e.href, o = e.title || null, a = i[1].replace(r.other.outputLinkReplace, "$1");
  n.state.inLink = !0;
  let l = { type: i[0].charAt(0) === "!" ? "image" : "link", raw: t, href: s, title: o, text: a, tokens: n.inlineTokens(a) };
  return n.state.inLink = !1, l;
}
function ren(i, e, t) {
  let n = i.match(t.other.indentCodeCompensation);
  if (n === null) return e;
  let r = n[1];
  return e.split(`
`).map((s) => {
    let o = s.match(t.other.beginningSpace);
    if (o === null) return s;
    let [a] = o;
    return a.length >= r.length ? s.slice(r.length) : s;
  }).join(`
`);
}
var bj = class {
  constructor(e) {
    mi(this, "options");
    mi(this, "rules");
    mi(this, "lexer");
    this.options = e || yk;
  }
  space(e) {
    let t = this.rules.block.newline.exec(e);
    if (t && t[0].length > 0) return { type: "space", raw: t[0] };
  }
  code(e) {
    let t = this.rules.block.code.exec(e);
    if (t) {
      let n = t[0].replace(this.rules.other.codeRemoveIndent, "");
      return { type: "code", raw: t[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : PP(n, `
`) };
    }
  }
  fences(e) {
    let t = this.rules.block.fences.exec(e);
    if (t) {
      let n = t[0], r = ren(n, t[3] || "", this.rules);
      return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
    }
  }
  heading(e) {
    let t = this.rules.block.heading.exec(e);
    if (t) {
      let n = t[2].trim();
      if (this.rules.other.endingHash.test(n)) {
        let r = PP(n, "#");
        (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
      }
      return { type: "heading", raw: t[0], depth: t[1].length, text: n, tokens: this.lexer.inline(n) };
    }
  }
  hr(e) {
    let t = this.rules.block.hr.exec(e);
    if (t) return { type: "hr", raw: PP(t[0], `
`) };
  }
  blockquote(e) {
    let t = this.rules.block.blockquote.exec(e);
    if (t) {
      let n = PP(t[0], `
`).split(`
`), r = "", s = "", o = [];
      for (; n.length > 0; ) {
        let a = !1, l = [], c;
        for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) l.push(n[c]), a = !0;
        else if (!a) l.push(n[c]);
        else break;
        n = n.slice(c);
        let u = l.join(`
`), d = u.replace(this.rules.other.blockquoteSetextReplace, `
    $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
        r = r ? `${r}
${u}` : u, s = s ? `${s}
${d}` : d;
        let h = this.lexer.state.top;
        if (this.lexer.state.top = !0, this.lexer.blockTokens(d, o, !0), this.lexer.state.top = h, n.length === 0) break;
        let g = o.at(-1);
        if ((g == null ? void 0 : g.type) === "code") break;
        if ((g == null ? void 0 : g.type) === "blockquote") {
          let m = g, _ = m.raw + `
` + n.join(`
`), v = this.blockquote(_);
          o[o.length - 1] = v, r = r.substring(0, r.length - m.raw.length) + v.raw, s = s.substring(0, s.length - m.text.length) + v.text;
          break;
        } else if ((g == null ? void 0 : g.type) === "list") {
          let m = g, _ = m.raw + `
` + n.join(`
`), v = this.list(_);
          o[o.length - 1] = v, r = r.substring(0, r.length - g.raw.length) + v.raw, s = s.substring(0, s.length - m.raw.length) + v.raw, n = _.substring(o.at(-1).raw.length).split(`
`);
          continue;
        }
      }
      return { type: "blockquote", raw: r, tokens: o, text: s };
    }
  }
  list(e) {
    let t = this.rules.block.list.exec(e);
    if (t) {
      let n = t[1].trim(), r = n.length > 1, s = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: !1, items: [] };
      n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
      let o = this.rules.other.listItemRegex(n), a = !1;
      for (; e; ) {
        let c = !1, u = "", d = "";
        if (!(t = o.exec(e)) || this.rules.block.hr.test(e)) break;
        u = t[0], e = e.substring(u.length);
        let h = t[2].split(`
`, 1)[0].replace(this.rules.other.listReplaceTabs, (E) => " ".repeat(3 * E.length)), g = e.split(`
`, 1)[0], m = !h.trim(), _ = 0;
        if (this.options.pedantic ? (_ = 2, d = h.trimStart()) : m ? _ = t[1].length + 1 : (_ = t[2].search(this.rules.other.nonSpaceChar), _ = _ > 4 ? 1 : _, d = h.slice(_), _ += t[1].length), m && this.rules.other.blankLine.test(g) && (u += g + `
`, e = e.substring(g.length + 1), c = !0), !c) {
          let E = this.rules.other.nextBulletRegex(_), L = this.rules.other.hrRegex(_), T = this.rules.other.fencesBeginRegex(_), D = this.rules.other.headingBeginRegex(_), N = this.rules.other.htmlBeginRegex(_);
          for (; e; ) {
            let R = e.split(`
`, 1)[0], M;
            if (g = R, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, "  "), M = g) : M = g.replace(this.rules.other.tabCharGlobal, "    "), T.test(g) || D.test(g) || N.test(g) || E.test(g) || L.test(g)) break;
            if (M.search(this.rules.other.nonSpaceChar) >= _ || !g.trim()) d += `
` + M.slice(_);
            else {
              if (m || h.replace(this.rules.other.tabCharGlobal, "    ").search(this.rules.other.nonSpaceChar) >= 4 || T.test(h) || D.test(h) || L.test(h)) break;
              d += `
` + g;
            }
            !m && !g.trim() && (m = !0), u += R + `
`, e = e.substring(R.length + 1), h = M.slice(_);
          }
        }
        s.loose || (a ? s.loose = !0 : this.rules.other.doubleBlankLine.test(u) && (a = !0));
        let v = null, w;
        this.options.gfm && (v = this.rules.other.listIsTask.exec(d), v && (w = v[0] !== "[ ] ", d = d.replace(this.rules.other.listReplaceTask, ""))), s.items.push({ type: "list_item", raw: u, task: !!v, checked: w, loose: !1, text: d, tokens: [] }), s.raw += u;
      }
      let l = s.items.at(-1);
      if (l) l.raw = l.raw.trimEnd(), l.text = l.text.trimEnd();
      else return;
      s.raw = s.raw.trimEnd();
      for (let c = 0; c < s.items.length; c++) if (this.lexer.state.top = !1, s.items[c].tokens = this.lexer.blockTokens(s.items[c].text, []), !s.loose) {
        let u = s.items[c].tokens.filter((h) => h.type === "space"), d = u.length > 0 && u.some((h) => this.rules.other.anyLine.test(h.raw));
        s.loose = d;
      }
      if (s.loose) for (let c = 0; c < s.items.length; c++) s.items[c].loose = !0;
      return s;
    }
  }
  html(e) {
    let t = this.rules.block.html.exec(e);
    if (t) return { type: "html", block: !0, raw: t[0], pre: t[1] === "pre" || t[1] === "script" || t[1] === "style", text: t[0] };
  }
  def(e) {
    let t = this.rules.block.def.exec(e);
    if (t) {
      let n = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
      return { type: "def", tag: n, raw: t[0], href: r, title: s };
    }
  }
  table(e) {
    var a;
    let t = this.rules.block.table.exec(e);
    if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
    let n = kOe(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = (a = t[3]) != null && a.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
`) : [], o = { type: "table", raw: t[0], header: [], align: [], rows: [] };
    if (n.length === r.length) {
      for (let l of r) this.rules.other.tableAlignRight.test(l) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? o.align.push("left") : o.align.push(null);
      for (let l = 0; l < n.length; l++) o.header.push({ text: n[l], tokens: this.lexer.inline(n[l]), header: !0, align: o.align[l] });
      for (let l of s) o.rows.push(kOe(l, o.header.length).map((c, u) => ({ text: c, tokens: this.lexer.inline(c), header: !1, align: o.align[u] })));
      return o;
    }
  }
  lheading(e) {
    let t = this.rules.block.lheading.exec(e);
    if (t) return { type: "heading", raw: t[0], depth: t[2].charAt(0) === "=" ? 1 : 2, text: t[1], tokens: this.lexer.inline(t[1]) };
  }
  paragraph(e) {
    let t = this.rules.block.paragraph.exec(e);
    if (t) {
      let n = t[1].charAt(t[1].length - 1) === `
` ? t[1].slice(0, -1) : t[1];
      return { type: "paragraph", raw: t[0], text: n, tokens: this.lexer.inline(n) };
    }
  }
  text(e) {
    let t = this.rules.block.text.exec(e);
    if (t) return { type: "text", raw: t[0], text: t[0], tokens: this.lexer.inline(t[0]) };
  }
  escape(e) {
    let t = this.rules.inline.escape.exec(e);
    if (t) return { type: "escape", raw: t[0], text: t[1] };
  }
  tag(e) {
    let t = this.rules.inline.tag.exec(e);
    if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), { type: "html", raw: t[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: !1, text: t[0] };
  }
  link(e) {
    let t = this.rules.inline.link.exec(e);
    if (t) {
      let n = t[2].trim();
      if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
        if (!this.rules.other.endAngleBracket.test(n)) return;
        let o = PP(n.slice(0, -1), "\\");
        if ((n.length - o.length) % 2 === 0) return;
      } else {
        let o = ien(t[2], "()");
        if (o === -2) return;
        if (o > -1) {
          let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + o;
          t[2] = t[2].substring(0, o), t[0] = t[0].substring(0, a).trim(), t[3] = "";
        }
      }
      let r = t[2], s = "";
      if (this.options.pedantic) {
        let o = this.rules.other.pedanticHrefTitle.exec(r);
        o && (r = o[1], s = o[3]);
      } else s = t[3] ? t[3].slice(1, -1) : "";
      return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), DOe(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
    }
  }
  reflink(e, t) {
    let n;
    if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
      let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = t[r.toLowerCase()];
      if (!s) {
        let o = n[0].charAt(0);
        return { type: "text", raw: o, text: o };
      }
      return DOe(n, s, n[0], this.lexer, this.rules);
    }
  }
  emStrong(e, t, n = "") {
    let r = this.rules.inline.emStrongLDelim.exec(e);
    if (!(!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[2]) || !n || this.rules.inline.punctuation.exec(n))) {
      let s = [...r[0]].length - 1, o, a, l = s, c = 0, u = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (u.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = u.exec(t)) != null; ) {
        if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
        if (a = [...o].length, r[3] || r[4]) {
          l += a;
          continue;
        } else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
          c += a;
          continue;
        }
        if (l -= a, l > 0) continue;
        a = Math.min(a, a + l + c);
        let d = [...r[0]][0].length, h = e.slice(0, s + r.index + d + a);
        if (Math.min(s, a) % 2) {
          let m = h.slice(1, -1);
          return { type: "em", raw: h, text: m, tokens: this.lexer.inlineTokens(m) };
        }
        let g = h.slice(2, -2);
        return { type: "strong", raw: h, text: g, tokens: this.lexer.inlineTokens(g) };
      }
    }
  }
  codespan(e) {
    let t = this.rules.inline.code.exec(e);
    if (t) {
      let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
      return r && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t[0], text: n };
    }
  }
  br(e) {
    let t = this.rules.inline.br.exec(e);
    if (t) return { type: "br", raw: t[0] };
  }
  del(e) {
    let t = this.rules.inline.del.exec(e);
    if (t) return { type: "del", raw: t[0], text: t[2], tokens: this.lexer.inlineTokens(t[2]) };
  }
  autolink(e) {
    let t = this.rules.inline.autolink.exec(e);
    if (t) {
      let n, r;
      return t[2] === "@" ? (n = t[1], r = "mailto:" + n) : (n = t[1], r = n), { type: "link", raw: t[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
    }
  }
  url(e) {
    var n;
    let t;
    if (t = this.rules.inline.url.exec(e)) {
      let r, s;
      if (t[2] === "@") r = t[0], s = "mailto:" + r;
      else {
        let o;
        do
          o = t[0], t[0] = ((n = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : n[0]) ?? "";
        while (o !== t[0]);
        r = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0];
      }
      return { type: "link", raw: t[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
    }
  }
  inlineText(e) {
    let t = this.rules.inline.text.exec(e);
    if (t) {
      let n = this.lexer.state.inRawBlock;
      return { type: "text", raw: t[0], text: t[0], escaped: n };
    }
  }
}, $p = class rhe {
  constructor(e) {
    mi(this, "tokens");
    mi(this, "options");
    mi(this, "state");
    mi(this, "tokenizer");
    mi(this, "inlineQueue");
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || yk, this.options.tokenizer = this.options.tokenizer || new bj(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
    let t = { other: Bd, block: uW.normal, inline: MP.normal };
    this.options.pedantic ? (t.block = uW.pedantic, t.inline = MP.pedantic) : this.options.gfm && (t.block = uW.gfm, this.options.breaks ? t.inline = MP.breaks : t.inline = MP.gfm), this.tokenizer.rules = t;
  }
  static get rules() {
    return { block: uW, inline: MP };
  }
  static lex(e, t) {
    return new rhe(t).lex(e);
  }
  static lexInline(e, t) {
    return new rhe(t).inlineTokens(e);
  }
  lex(e) {
    e = e.replace(Bd.carriageReturn, `
`), this.blockTokens(e, this.tokens);
    for (let t = 0; t < this.inlineQueue.length; t++) {
      let n = this.inlineQueue[t];
      this.inlineTokens(n.src, n.tokens);
    }
    return this.inlineQueue = [], this.tokens;
  }
  blockTokens(e, t = [], n = !1) {
    var r, s, o;
    for (this.options.pedantic && (e = e.replace(Bd.tabCharGlobal, "    ").replace(Bd.spaceLine, "")); e; ) {
      let a;
      if ((s = (r = this.options.extensions) == null ? void 0 : r.block) != null && s.some((c) => (a = c.call({ lexer: this }, e, t)) ? (e = e.substring(a.raw.length), t.push(a), !0) : !1)) continue;
      if (a = this.tokenizer.space(e)) {
        e = e.substring(a.raw.length);
        let c = t.at(-1);
        a.raw.length === 1 && c !== void 0 ? c.raw += `
` : t.push(a);
        continue;
      }
      if (a = this.tokenizer.code(e)) {
        e = e.substring(a.raw.length);
        let c = t.at(-1);
        (c == null ? void 0 : c.type) === "paragraph" || (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
`) ? "" : `
`) + a.raw, c.text += `
` + a.text, this.inlineQueue.at(-1).src = c.text) : t.push(a);
        continue;
      }
      if (a = this.tokenizer.fences(e)) {
        e = e.substring(a.raw.length), t.push(a);
        continue;
      }
      if (a = this.tokenizer.heading(e)) {
        e = e.substring(a.raw.length), t.push(a);
        continue;
      }
      if (a = this.tokenizer.hr(e)) {
        e = e.substring(a.raw.length), t.push(a);
        continue;
      }
      if (a = this.tokenizer.blockquote(e)) {
        e = e.substring(a.raw.length), t.push(a);
        continue;
      }
      if (a = this.tokenizer.list(e)) {
        e = e.substring(a.raw.length), t.push(a);
        continue;
      }
      if (a = this.tokenizer.html(e)) {
        e = e.substring(a.raw.length), t.push(a);
        continue;
      }
      if (a = this.tokenizer.def(e)) {
        e = e.substring(a.raw.length);
        let c = t.at(-1);
        (c == null ? void 0 : c.type) === "paragraph" || (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
`) ? "" : `
`) + a.raw, c.text += `
` + a.raw, this.inlineQueue.at(-1).src = c.text) : this.tokens.links[a.tag] || (this.tokens.links[a.tag] = { href: a.href, title: a.title }, t.push(a));
        continue;
      }
      if (a = this.tokenizer.table(e)) {
        e = e.substring(a.raw.length), t.push(a);
        continue;
      }
      if (a = this.tokenizer.lheading(e)) {
        e = e.substring(a.raw.length), t.push(a);
        continue;
      }
      let l = e;
      if ((o = this.options.extensions) != null && o.startBlock) {
        let c = 1 / 0, u = e.slice(1), d;
        this.options.extensions.startBlock.forEach((h) => {
          d = h.call({ lexer: this }, u), typeof d == "number" && d >= 0 && (c = Math.min(c, d));
        }), c < 1 / 0 && c >= 0 && (l = e.substring(0, c + 1));
      }
      if (this.state.top && (a = this.tokenizer.paragraph(l))) {
        let c = t.at(-1);
        n && (c == null ? void 0 : c.type) === "paragraph" ? (c.raw += (c.raw.endsWith(`
`) ? "" : `
`) + a.raw, c.text += `
` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = c.text) : t.push(a), n = l.length !== e.length, e = e.substring(a.raw.length);
        continue;
      }
      if (a = this.tokenizer.text(e)) {
        e = e.substring(a.raw.length);
        let c = t.at(-1);
        (c == null ? void 0 : c.type) === "text" ? (c.raw += (c.raw.endsWith(`
`) ? "" : `
`) + a.raw, c.text += `
` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = c.text) : t.push(a);
        continue;
      }
      if (e) {
        let c = "Infinite loop on byte: " + e.charCodeAt(0);
        if (this.options.silent) {
          console.error(c);
          break;
        } else throw new Error(c);
      }
    }
    return this.state.top = !0, t;
  }
  inline(e, t = []) {
    return this.inlineQueue.push({ src: e, tokens: t }), t;
  }
  inlineTokens(e, t = []) {
    var l, c, u, d, h;
    let n = e, r = null;
    if (this.tokens.links) {
      let g = Object.keys(this.tokens.links);
      if (g.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) g.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    let s;
    for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) s = r[2] ? r[2].length : 0, n = n.slice(0, r.index + s) + "[" + "a".repeat(r[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    n = ((c = (l = this.options.hooks) == null ? void 0 : l.emStrongMask) == null ? void 0 : c.call({ lexer: this }, n)) ?? n;
    let o = !1, a = "";
    for (; e; ) {
      o || (a = ""), o = !1;
      let g;
      if ((d = (u = this.options.extensions) == null ? void 0 : u.inline) != null && d.some((_) => (g = _.call({ lexer: this }, e, t)) ? (e = e.substring(g.raw.length), t.push(g), !0) : !1)) continue;
      if (g = this.tokenizer.escape(e)) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      if (g = this.tokenizer.tag(e)) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      if (g = this.tokenizer.link(e)) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      if (g = this.tokenizer.reflink(e, this.tokens.links)) {
        e = e.substring(g.raw.length);
        let _ = t.at(-1);
        g.type === "text" && (_ == null ? void 0 : _.type) === "text" ? (_.raw += g.raw, _.text += g.text) : t.push(g);
        continue;
      }
      if (g = this.tokenizer.emStrong(e, n, a)) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      if (g = this.tokenizer.codespan(e)) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      if (g = this.tokenizer.br(e)) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      if (g = this.tokenizer.del(e)) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      if (g = this.tokenizer.autolink(e)) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      if (!this.state.inLink && (g = this.tokenizer.url(e))) {
        e = e.substring(g.raw.length), t.push(g);
        continue;
      }
      let m = e;
      if ((h = this.options.extensions) != null && h.startInline) {
        let _ = 1 / 0, v = e.slice(1), w;
        this.options.extensions.startInline.forEach((E) => {
          w = E.call({ lexer: this }, v), typeof w == "number" && w >= 0 && (_ = Math.min(_, w));
        }), _ < 1 / 0 && _ >= 0 && (m = e.substring(0, _ + 1));
      }
      if (g = this.tokenizer.inlineText(m)) {
        e = e.substring(g.raw.length), g.raw.slice(-1) !== "_" && (a = g.raw.slice(-1)), o = !0;
        let _ = t.at(-1);
        (_ == null ? void 0 : _.type) === "text" ? (_.raw += g.raw, _.text += g.text) : t.push(g);
        continue;
      }
      if (e) {
        let _ = "Infinite loop on byte: " + e.charCodeAt(0);
        if (this.options.silent) {
          console.error(_);
          break;
        } else throw new Error(_);
      }
    }
    return t;
  }
}, vj = class {
  constructor(e) {
    mi(this, "options");
    mi(this, "parser");
    this.options = e || yk;
  }
  space(e) {
    return "";
  }
  code({ text: e, lang: t, escaped: n }) {
    var o;
    let r = (o = (t || "").match(Bd.notSpaceStart)) == null ? void 0 : o[0], s = e.replace(Bd.endingNewline, "") + `
`;
    return r ? '<pre><code class="language-' + x_(r) + '">' + (n ? s : x_(s, !0)) + `</code></pre>
` : "<pre><code>" + (n ? s : x_(s, !0)) + `</code></pre>
`;
  }
  blockquote({ tokens: e }) {
    return `<blockquote>
${this.parser.parse(e)}</blockquote>
`;
  }
  html({ text: e }) {
    return e;
  }
  def(e) {
    return "";
  }
  heading({ tokens: e, depth: t }) {
    return `<h${t}>${this.parser.parseInline(e)}</h${t}>
`;
  }
  hr(e) {
    return `<hr>
`;
  }
  list(e) {
    let t = e.ordered, n = e.start, r = "";
    for (let a = 0; a < e.items.length; a++) {
      let l = e.items[a];
      r += this.listitem(l);
    }
    let s = t ? "ol" : "ul", o = t && n !== 1 ? ' start="' + n + '"' : "";
    return "<" + s + o + `>
` + r + "</" + s + `>
`;
  }
  listitem(e) {
    var n;
    let t = "";
    if (e.task) {
      let r = this.checkbox({ checked: !!e.checked });
      e.loose ? ((n = e.tokens[0]) == null ? void 0 : n.type) === "paragraph" ? (e.tokens[0].text = r + " " + e.tokens[0].text, e.tokens[0].tokens && e.tokens[0].tokens.length > 0 && e.tokens[0].tokens[0].type === "text" && (e.tokens[0].tokens[0].text = r + " " + x_(e.tokens[0].tokens[0].text), e.tokens[0].tokens[0].escaped = !0)) : e.tokens.unshift({ type: "text", raw: r + " ", text: r + " ", escaped: !0 }) : t += r + " ";
    }
    return t += this.parser.parse(e.tokens, !!e.loose), `<li>${t}</li>
`;
  }
  checkbox({ checked: e }) {
    return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
  }
  paragraph({ tokens: e }) {
    return `<p>${this.parser.parseInline(e)}</p>
`;
  }
  table(e) {
    let t = "", n = "";
    for (let s = 0; s < e.header.length; s++) n += this.tablecell(e.header[s]);
    t += this.tablerow({ text: n });
    let r = "";
    for (let s = 0; s < e.rows.length; s++) {
      let o = e.rows[s];
      n = "";
      for (let a = 0; a < o.length; a++) n += this.tablecell(o[a]);
      r += this.tablerow({ text: n });
    }
    return r && (r = `<tbody>${r}</tbody>`), `<table>
<thead>
` + t + `</thead>
` + r + `</table>
`;
  }
  tablerow({ text: e }) {
    return `<tr>
${e}</tr>
`;
  }
  tablecell(e) {
    let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
    return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
`;
  }
  strong({ tokens: e }) {
    return `<strong>${this.parser.parseInline(e)}</strong>`;
  }
  em({ tokens: e }) {
    return `<em>${this.parser.parseInline(e)}</em>`;
  }
  codespan({ text: e }) {
    return `<code>${x_(e, !0)}</code>`;
  }
  br(e) {
    return "<br>";
  }
  del({ tokens: e }) {
    return `<del>${this.parser.parseInline(e)}</del>`;
  }
  link({ href: e, title: t, tokens: n }) {
    let r = this.parser.parseInline(n), s = TOe(e);
    if (s === null) return r;
    e = s;
    let o = '<a href="' + e + '"';
    return t && (o += ' title="' + x_(t) + '"'), o += ">" + r + "</a>", o;
  }
  image({ href: e, title: t, text: n, tokens: r }) {
    r && (n = this.parser.parseInline(r, this.parser.textRenderer));
    let s = TOe(e);
    if (s === null) return x_(n);
    e = s;
    let o = `<img src="${e}" alt="${n}"`;
    return t && (o += ` title="${x_(t)}"`), o += ">", o;
  }
  text(e) {
    return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : x_(e.text);
  }
}, PCe = class {
  strong({ text: e }) {
    return e;
  }
  em({ text: e }) {
    return e;
  }
  codespan({ text: e }) {
    return e;
  }
  del({ text: e }) {
    return e;
  }
  html({ text: e }) {
    return e;
  }
  text({ text: e }) {
    return e;
  }
  link({ text: e }) {
    return "" + e;
  }
  image({ text: e }) {
    return "" + e;
  }
  br() {
    return "";
  }
}, jp = class she {
  constructor(e) {
    mi(this, "options");
    mi(this, "renderer");
    mi(this, "textRenderer");
    this.options = e || yk, this.options.renderer = this.options.renderer || new vj(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new PCe();
  }
  static parse(e, t) {
    return new she(t).parse(e);
  }
  static parseInline(e, t) {
    return new she(t).parseInline(e);
  }
  parse(e, t = !0) {
    var r, s;
    let n = "";
    for (let o = 0; o < e.length; o++) {
      let a = e[o];
      if ((s = (r = this.options.extensions) == null ? void 0 : r.renderers) != null && s[a.type]) {
        let c = a, u = this.options.extensions.renderers[c.type].call({ parser: this }, c);
        if (u !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(c.type)) {
          n += u || "";
          continue;
        }
      }
      let l = a;
      switch (l.type) {
        case "space": {
          n += this.renderer.space(l);
          continue;
        }
        case "hr": {
          n += this.renderer.hr(l);
          continue;
        }
        case "heading": {
          n += this.renderer.heading(l);
          continue;
        }
        case "code": {
          n += this.renderer.code(l);
          continue;
        }
        case "table": {
          n += this.renderer.table(l);
          continue;
        }
        case "blockquote": {
          n += this.renderer.blockquote(l);
          continue;
        }
        case "list": {
          n += this.renderer.list(l);
          continue;
        }
        case "html": {
          n += this.renderer.html(l);
          continue;
        }
        case "def": {
          n += this.renderer.def(l);
          continue;
        }
        case "paragraph": {
          n += this.renderer.paragraph(l);
          continue;
        }
        case "text": {
          let c = l, u = this.renderer.text(c);
          for (; o + 1 < e.length && e[o + 1].type === "text"; ) c = e[++o], u += `
` + this.renderer.text(c);
          t ? n += this.renderer.paragraph({ type: "paragraph", raw: u, text: u, tokens: [{ type: "text", raw: u, text: u, escaped: !0 }] }) : n += u;
          continue;
        }
        default: {
          let c = 'Token with "' + l.type + '" type was not found.';
          if (this.options.silent) return console.error(c), "";
          throw new Error(c);
        }
      }
    }
    return n;
  }
  parseInline(e, t = this.renderer) {
    var r, s;
    let n = "";
    for (let o = 0; o < e.length; o++) {
      let a = e[o];
      if ((s = (r = this.options.extensions) == null ? void 0 : r.renderers) != null && s[a.type]) {
        let c = this.options.extensions.renderers[a.type].call({ parser: this }, a);
        if (c !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(a.type)) {
          n += c || "";
          continue;
        }
      }
      let l = a;
      switch (l.type) {
        case "escape": {
          n += t.text(l);
          break;
        }
        case "html": {
          n += t.html(l);
          break;
        }
        case "link": {
          n += t.link(l);
          break;
        }
        case "image": {
          n += t.image(l);
          break;
        }
        case "strong": {
          n += t.strong(l);
          break;
        }
        case "em": {
          n += t.em(l);
          break;
        }
        case "codespan": {
          n += t.codespan(l);
          break;
        }
        case "br": {
          n += t.br(l);
          break;
        }
        case "del": {
          n += t.del(l);
          break;
        }
        case "text": {
          n += t.text(l);
          break;
        }
        default: {
          let c = 'Token with "' + l.type + '" type was not found.';
          if (this.options.silent) return console.error(c), "";
          throw new Error(c);
        }
      }
    }
    return n;
  }
}, mW, gF = (mW = class {
  constructor(e) {
    mi(this, "options");
    mi(this, "block");
    this.options = e || yk;
  }
  preprocess(e) {
    return e;
  }
  postprocess(e) {
    return e;
  }
  processAllTokens(e) {
    return e;
  }
  emStrongMask(e) {
    return e;
  }
  provideLexer() {
    return this.block ? $p.lex : $p.lexInline;
  }
  provideParser() {
    return this.block ? jp.parse : jp.parseInline;
  }
}, mi(mW, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), mi(mW, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), mW), sen = class {
  constructor(...e) {
    mi(this, "defaults", kCe());
    mi(this, "options", this.setOptions);
    mi(this, "parse", this.parseMarkdown(!0));
    mi(this, "parseInline", this.parseMarkdown(!1));
    mi(this, "Parser", jp);
    mi(this, "Renderer", vj);
    mi(this, "TextRenderer", PCe);
    mi(this, "Lexer", $p);
    mi(this, "Tokenizer", bj);
    mi(this, "Hooks", gF);
    this.use(...e);
  }
  walkTokens(e, t) {
    var r, s;
    let n = [];
    for (let o of e) switch (n = n.concat(t.call(this, o)), o.type) {
      case "table": {
        let a = o;
        for (let l of a.header) n = n.concat(this.walkTokens(l.tokens, t));
        for (let l of a.rows) for (let c of l) n = n.concat(this.walkTokens(c.tokens, t));
        break;
      }
      case "list": {
        let a = o;
        n = n.concat(this.walkTokens(a.items, t));
        break;
      }
      default: {
        let a = o;
        (s = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && s[a.type] ? this.defaults.extensions.childTokens[a.type].forEach((l) => {
          let c = a[l].flat(1 / 0);
          n = n.concat(this.walkTokens(c, t));
        }) : a.tokens && (n = n.concat(this.walkTokens(a.tokens, t)));
      }
    }
    return n;
  }
  use(...e) {
    let t = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return e.forEach((n) => {
      let r = { ...n };
      if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
        if (!s.name) throw new Error("extension name required");
        if ("renderer" in s) {
          let o = t.renderers[s.name];
          o ? t.renderers[s.name] = function(...a) {
            let l = s.renderer.apply(this, a);
            return l === !1 && (l = o.apply(this, a)), l;
          } : t.renderers[s.name] = s.renderer;
        }
        if ("tokenizer" in s) {
          if (!s.level || s.level !== "block" && s.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
          let o = t[s.level];
          o ? o.unshift(s.tokenizer) : t[s.level] = [s.tokenizer], s.start && (s.level === "block" ? t.startBlock ? t.startBlock.push(s.start) : t.startBlock = [s.start] : s.level === "inline" && (t.startInline ? t.startInline.push(s.start) : t.startInline = [s.start]));
        }
        "childTokens" in s && s.childTokens && (t.childTokens[s.name] = s.childTokens);
      }), r.extensions = t), n.renderer) {
        let s = this.defaults.renderer || new vj(this.defaults);
        for (let o in n.renderer) {
          if (!(o in s)) throw new Error(`renderer '${o}' does not exist`);
          if (["options", "parser"].includes(o)) continue;
          let a = o, l = n.renderer[a], c = s[a];
          s[a] = (...u) => {
            let d = l.apply(s, u);
            return d === !1 && (d = c.apply(s, u)), d || "";
          };
        }
        r.renderer = s;
      }
      if (n.tokenizer) {
        let s = this.defaults.tokenizer || new bj(this.defaults);
        for (let o in n.tokenizer) {
          if (!(o in s)) throw new Error(`tokenizer '${o}' does not exist`);
          if (["options", "rules", "lexer"].includes(o)) continue;
          let a = o, l = n.tokenizer[a], c = s[a];
          s[a] = (...u) => {
            let d = l.apply(s, u);
            return d === !1 && (d = c.apply(s, u)), d;
          };
        }
        r.tokenizer = s;
      }
      if (n.hooks) {
        let s = this.defaults.hooks || new gF();
        for (let o in n.hooks) {
          if (!(o in s)) throw new Error(`hook '${o}' does not exist`);
          if (["options", "block"].includes(o)) continue;
          let a = o, l = n.hooks[a], c = s[a];
          gF.passThroughHooks.has(o) ? s[a] = (u) => {
            if (this.defaults.async && gF.passThroughHooksRespectAsync.has(o)) return (async () => {
              let h = await l.call(s, u);
              return c.call(s, h);
            })();
            let d = l.call(s, u);
            return c.call(s, d);
          } : s[a] = (...u) => {
            if (this.defaults.async) return (async () => {
              let h = await l.apply(s, u);
              return h === !1 && (h = await c.apply(s, u)), h;
            })();
            let d = l.apply(s, u);
            return d === !1 && (d = c.apply(s, u)), d;
          };
        }
        r.hooks = s;
      }
      if (n.walkTokens) {
        let s = this.defaults.walkTokens, o = n.walkTokens;
        r.walkTokens = function(a) {
          let l = [];
          return l.push(o.call(this, a)), s && (l = l.concat(s.call(this, a))), l;
        };
      }
      this.defaults = { ...this.defaults, ...r };
    }), this;
  }
  setOptions(e) {
    return this.defaults = { ...this.defaults, ...e }, this;
  }
  lexer(e, t) {
    return $p.lex(e, t ?? this.defaults);
  }
  parser(e, t) {
    return jp.parse(e, t ?? this.defaults);
  }
  parseMarkdown(e) {
    return (t, n) => {
      let r = { ...n }, s = { ...this.defaults, ...r }, o = this.onError(!!s.silent, !!s.async);
      if (this.defaults.async === !0 && r.async === !1) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
      if (typeof t > "u" || t === null) return o(new Error("marked(): input parameter is undefined or null"));
      if (typeof t != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
      if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
        let a = s.hooks ? await s.hooks.preprocess(t) : t, l = await (s.hooks ? await s.hooks.provideLexer() : e ? $p.lex : $p.lexInline)(a, s), c = s.hooks ? await s.hooks.processAllTokens(l) : l;
        s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
        let u = await (s.hooks ? await s.hooks.provideParser() : e ? jp.parse : jp.parseInline)(c, s);
        return s.hooks ? await s.hooks.postprocess(u) : u;
      })().catch(o);
      try {
        s.hooks && (t = s.hooks.preprocess(t));
        let a = (s.hooks ? s.hooks.provideLexer() : e ? $p.lex : $p.lexInline)(t, s);
        s.hooks && (a = s.hooks.processAllTokens(a)), s.walkTokens && this.walkTokens(a, s.walkTokens);
        let l = (s.hooks ? s.hooks.provideParser() : e ? jp.parse : jp.parseInline)(a, s);
        return s.hooks && (l = s.hooks.postprocess(l)), l;
      } catch (a) {
        return o(a);
      }
    };
  }
  onError(e, t) {
    return (n) => {
      if (n.message += `
Please report this to https://github.com/markedjs/marked.`, e) {
        let r = "<p>An error occurred:</p><pre>" + x_(n.message + "", !0) + "</pre>";
        return t ? Promise.resolve(r) : r;
      }
      if (t) return Promise.reject(n);
      throw n;
    };
  }
}, WT = new sen();
function Js(i, e) {
  return WT.parse(i, e);
}
Js.options = Js.setOptions = function(i) {
  return WT.setOptions(i), Js.defaults = WT.defaults, Xze(Js.defaults), Js;
};
Js.getDefaults = kCe;
Js.defaults = yk;
Js.use = function(...i) {
  return WT.use(...i), Js.defaults = WT.defaults, Xze(Js.defaults), Js;
};
Js.walkTokens = function(i, e) {
  return WT.walkTokens(i, e);
};
Js.parseInline = WT.parseInline;
Js.Parser = jp;
Js.parser = jp.parse;
Js.Renderer = vj;
Js.TextRenderer = PCe;
Js.Lexer = $p;
Js.lexer = $p.lex;
Js.Tokenizer = bj;
Js.Hooks = gF;
Js.parse = Js;
Js.options;
Js.setOptions;
Js.use;
Js.walkTokens;
Js.parseInline;
jp.parse;
$p.lex;
function a$e(i) {
  for (var e = [], t = 1; t < arguments.length; t++)
    e[t - 1] = arguments[t];
  var n = Array.from(typeof i == "string" ? [i] : i);
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
  var r = n.reduce(function(a, l) {
    var c = l.match(/\n([\t ]+|(?!\s).)/g);
    return c ? a.concat(c.map(function(u) {
      var d, h;
      return (h = (d = u.match(/[\t ]/g)) === null || d === void 0 ? void 0 : d.length) !== null && h !== void 0 ? h : 0;
    })) : a;
  }, []);
  if (r.length) {
    var s = new RegExp(`
[	 ]{` + Math.min.apply(Math, r) + "}", "g");
    n = n.map(function(a) {
      return a.replace(s, `
`);
    });
  }
  n[0] = n[0].replace(/^\r?\n/, "");
  var o = n[0];
  return e.forEach(function(a, l) {
    var c = o.match(/(?:^|\n)( *)$/), u = c ? c[1] : "", d = a;
    typeof a == "string" && a.includes(`
`) && (d = String(a).split(`
`).map(function(h, g) {
      return g === 0 ? h : "" + u + h;
    }).join(`
`)), o += d + n[l + 1];
  }), o;
}
var oen = {
  body: '<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',
  height: 80,
  width: 80
}, ohe = /* @__PURE__ */ new Map(), l$e = /* @__PURE__ */ new Map(), aen = /* @__PURE__ */ $((i) => {
  for (const e of i) {
    if (!e.name)
      throw new Error(
        'Invalid icon loader. Must have a "name" property with non-empty string value.'
      );
    if (Ct.debug("Registering icon pack:", e.name), "loader" in e)
      l$e.set(e.name, e.loader);
    else if ("icons" in e)
      ohe.set(e.name, e.icons);
    else
      throw Ct.error("Invalid icon loader:", e), new Error('Invalid icon loader. Must have either "icons" or "loader" property.');
  }
}, "registerIconPacks"), c$e = /* @__PURE__ */ $(async (i, e) => {
  const t = lJt(i, !0, e !== void 0);
  if (!t)
    throw new Error(`Invalid icon name: ${i}`);
  const n = t.prefix || e;
  if (!n)
    throw new Error(`Icon name must contain a prefix: ${i}`);
  let r = ohe.get(n);
  if (!r) {
    const o = l$e.get(n);
    if (!o)
      throw new Error(`Icon set not found: ${t.prefix}`);
    try {
      r = { ...await o(), prefix: n }, ohe.set(n, r);
    } catch (a) {
      throw Ct.error(a), new Error(`Failed to load icon set: ${t.prefix}`);
    }
  }
  const s = dJt(r, t.name);
  if (!s)
    throw new Error(`Icon not found: ${i}`);
  return s;
}, "getRegisteredIconData"), len = /* @__PURE__ */ $(async (i) => {
  try {
    return await c$e(i), !0;
  } catch {
    return !1;
  }
}, "isIconAvailable"), x6 = /* @__PURE__ */ $(async (i, e, t) => {
  let n;
  try {
    n = await c$e(i, e == null ? void 0 : e.fallbackPrefix);
  } catch (o) {
    Ct.error(o), n = oen;
  }
  const r = bJt(n, e), s = wJt(CJt(r.body), {
    ...r.attributes,
    ...t
  });
  return Xg(s, Ku());
}, "getIconSVG");
function u$e(i, { markdownAutoWrap: e }) {
  const n = i.replace(/<br\/>/g, `
`).replace(/\n{2,}/g, `
`), r = a$e(n);
  return e === !1 ? r.replace(/ /g, "&nbsp;") : r;
}
$(u$e, "preprocessMarkdown");
function d$e(i, e = {}) {
  const t = u$e(i, e), n = Js.lexer(t), r = [[]];
  let s = 0;
  function o(a, l = "normal") {
    a.type === "text" ? a.text.split(`
`).forEach((u, d) => {
      d !== 0 && (s++, r.push([])), u.split(" ").forEach((h) => {
        h = h.replace(/&#39;/g, "'"), h && r[s].push({ content: h, type: l });
      });
    }) : a.type === "strong" || a.type === "em" ? a.tokens.forEach((c) => {
      o(c, a.type);
    }) : a.type === "html" && r[s].push({ content: a.text, type: "normal" });
  }
  return $(o, "processNode"), n.forEach((a) => {
    var l;
    a.type === "paragraph" ? (l = a.tokens) == null || l.forEach((c) => {
      o(c);
    }) : a.type === "html" ? r[s].push({ content: a.text, type: "normal" }) : r[s].push({ content: a.raw, type: "normal" });
  }), r;
}
$(d$e, "markdownToLines");
function h$e(i, { markdownAutoWrap: e } = {}) {
  const t = Js.lexer(i);
  function n(r) {
    var s, o, a;
    return r.type === "text" ? e === !1 ? r.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;") : r.text.replace(/\n */g, "<br/>") : r.type === "strong" ? `<strong>${(s = r.tokens) == null ? void 0 : s.map(n).join("")}</strong>` : r.type === "em" ? `<em>${(o = r.tokens) == null ? void 0 : o.map(n).join("")}</em>` : r.type === "paragraph" ? `<p>${(a = r.tokens) == null ? void 0 : a.map(n).join("")}</p>` : r.type === "space" ? "" : r.type === "html" ? `${r.text}` : r.type === "escape" ? r.text : (Ct.warn(`Unsupported markdown: ${r.type}`), r.raw);
  }
  return $(n, "output"), t.map(n).join("");
}
$(h$e, "markdownToHTML");
function f$e(i) {
  return Intl.Segmenter ? [...new Intl.Segmenter().segment(i)].map((e) => e.segment) : [...i];
}
$(f$e, "splitTextToChars");
function g$e(i, e) {
  const t = f$e(e.content);
  return FCe(i, [], t, e.type);
}
$(g$e, "splitWordToFitWidth");
function FCe(i, e, t, n) {
  if (t.length === 0)
    return [
      { content: e.join(""), type: n },
      { content: "", type: n }
    ];
  const [r, ...s] = t, o = [...e, r];
  return i([{ content: o.join(""), type: n }]) ? FCe(i, o, s, n) : (e.length === 0 && r && (e.push(r), t.shift()), [
    { content: e.join(""), type: n },
    { content: t.join(""), type: n }
  ]);
}
$(FCe, "splitWordToFitWidthRecursion");
function p$e(i, e) {
  if (i.some(({ content: t }) => t.includes(`
`)))
    throw new Error("splitLineToFitWidth does not support newlines in the line");
  return yj(i, e);
}
$(p$e, "splitLineToFitWidth");
function yj(i, e, t = [], n = []) {
  if (i.length === 0)
    return n.length > 0 && t.push(n), t.length > 0 ? t : [];
  let r = "";
  i[0].content === " " && (r = " ", i.shift());
  const s = i.shift() ?? { content: " ", type: "normal" }, o = [...n];
  if (r !== "" && o.push({ content: r, type: "normal" }), o.push(s), e(o))
    return yj(i, e, t, o);
  if (n.length > 0)
    t.push(n), i.unshift(s);
  else if (s.content) {
    const [a, l] = g$e(e, s);
    t.push([a]), l.content && i.unshift(l);
  }
  return yj(i, e, t);
}
$(yj, "splitLineToFitWidthRecursion");
function ahe(i, e) {
  e && i.attr("style", e);
}
$(ahe, "applyStyle");
async function m$e(i, e, t, n, r = !1, s = Ku()) {
  const o = i.append("foreignObject");
  o.attr("width", `${10 * t}px`), o.attr("height", `${10 * t}px`);
  const a = o.append("xhtml:div"), l = AA(e.label) ? await G0e(e.label.replace(T2.lineBreakRegex, `
`), s) : Xg(e.label, s), c = e.isNode ? "nodeLabel" : "edgeLabel", u = a.append("span");
  u.html(l), ahe(u, e.labelStyle), u.attr("class", `${c} ${n}`), ahe(a, e.labelStyle), a.style("display", "table-cell"), a.style("white-space", "nowrap"), a.style("line-height", "1.5"), a.style("max-width", t + "px"), a.style("text-align", "center"), a.attr("xmlns", "http://www.w3.org/1999/xhtml"), r && a.attr("class", "labelBkg");
  let d = a.node().getBoundingClientRect();
  return d.width === t && (a.style("display", "table"), a.style("white-space", "break-spaces"), a.style("width", t + "px"), d = a.node().getBoundingClientRect()), o.node();
}
$(m$e, "addHtmlSpan");
function XY(i, e, t) {
  return i.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", e * t - 0.1 + "em").attr("dy", t + "em");
}
$(XY, "createTspan");
function _$e(i, e, t) {
  const n = i.append("text"), r = XY(n, 1, e);
  ZY(r, t);
  const s = r.node().getComputedTextLength();
  return n.remove(), s;
}
$(_$e, "computeWidthOfText");
function cen(i, e, t) {
  var o;
  const n = i.append("text"), r = XY(n, 1, e);
  ZY(r, [{ content: t, type: "normal" }]);
  const s = (o = r.node()) == null ? void 0 : o.getBoundingClientRect();
  return s && n.remove(), s;
}
$(cen, "computeDimensionOfText");
function b$e(i, e, t, n = !1) {
  const s = e.append("g"), o = s.insert("rect").attr("class", "background").attr("style", "stroke: none"), a = s.append("text").attr("y", "-10.1");
  let l = 0;
  for (const c of t) {
    const u = /* @__PURE__ */ $((h) => _$e(s, 1.1, h) <= i, "checkWidth"), d = u(c) ? [c] : p$e(c, u);
    for (const h of d) {
      const g = XY(a, l, 1.1);
      ZY(g, h), l++;
    }
  }
  if (n) {
    const c = a.node().getBBox(), u = 2;
    return o.attr("x", c.x - u).attr("y", c.y - u).attr("width", c.width + 2 * u).attr("height", c.height + 2 * u), s.node();
  } else
    return a.node();
}
$(b$e, "createFormattedText");
function ZY(i, e) {
  i.text(""), e.forEach((t, n) => {
    const r = i.append("tspan").attr("font-style", t.type === "em" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal");
    n === 0 ? r.text(t.content) : r.text(" " + t.content);
  });
}
$(ZY, "updateTextContentAndStyles");
async function v$e(i, e = {}) {
  const t = [];
  i.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (r, s, o) => (t.push(
    (async () => {
      const a = `${s}:${o}`;
      return await len(a) ? await x6(a, void 0, { class: "label-icon" }) : `<i class='${Xg(r, e).replace(":", " ")}'></i>`;
    })()
  ), r));
  const n = await Promise.all(t);
  return i.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => n.shift() ?? "");
}
$(v$e, "replaceIconSubstring");
var Mw = /* @__PURE__ */ $(async (i, e = "", {
  style: t = "",
  isTitle: n = !1,
  classes: r = "",
  useHtmlLabels: s = !0,
  isNode: o = !0,
  width: a = 200,
  addSvgBackground: l = !1
} = {}, c) => {
  if (Ct.debug(
    "XYZ createText",
    e,
    t,
    n,
    r,
    s,
    o,
    "addSvgBackground: ",
    l
  ), s) {
    const u = h$e(e, c), d = await v$e(vk(u), c), h = e.replace(/\\\\/g, "\\"), g = {
      isNode: o,
      label: AA(e) ? h : d,
      labelStyle: t.replace("fill:", "color:")
    };
    return await m$e(i, g, a, r, l, c);
  } else {
    const u = e.replace(/<br\s*\/?>/g, "<br/>"), d = d$e(u.replace("<br>", "<br/>"), c), h = b$e(
      a,
      i,
      d,
      e ? l : !1
    );
    if (o) {
      /stroke:/.exec(t) && (t = t.replace("stroke:", "lineColor:"));
      const g = t.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
      ls(h).attr("style", g);
    } else {
      const g = t.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
      ls(h).select("rect").attr("style", g.replace(/background:/g, "fill:"));
      const m = t.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
      ls(h).select("text").attr("style", m);
    }
    return h;
  }
}, "createText");
function Pne(i, e, t) {
  if (i && i.length) {
    const [n, r] = e, s = Math.PI / 180 * t, o = Math.cos(s), a = Math.sin(s);
    for (const l of i) {
      const [c, u] = l;
      l[0] = (c - n) * o - (u - r) * a + n, l[1] = (c - n) * a + (u - r) * o + r;
    }
  }
}
function uen(i, e) {
  return i[0] === e[0] && i[1] === e[1];
}
function den(i, e, t, n = 1) {
  const r = t, s = Math.max(e, 0.1), o = i[0] && i[0][0] && typeof i[0][0] == "number" ? [i] : i, a = [0, 0];
  if (r) for (const c of o) Pne(c, a, r);
  const l = (function(c, u, d) {
    const h = [];
    for (const E of c) {
      const L = [...E];
      uen(L[0], L[L.length - 1]) || L.push([L[0][0], L[0][1]]), L.length > 2 && h.push(L);
    }
    const g = [];
    u = Math.max(u, 0.1);
    const m = [];
    for (const E of h) for (let L = 0; L < E.length - 1; L++) {
      const T = E[L], D = E[L + 1];
      if (T[1] !== D[1]) {
        const N = Math.min(T[1], D[1]);
        m.push({ ymin: N, ymax: Math.max(T[1], D[1]), x: N === T[1] ? T[0] : D[0], islope: (D[0] - T[0]) / (D[1] - T[1]) });
      }
    }
    if (m.sort(((E, L) => E.ymin < L.ymin ? -1 : E.ymin > L.ymin ? 1 : E.x < L.x ? -1 : E.x > L.x ? 1 : E.ymax === L.ymax ? 0 : (E.ymax - L.ymax) / Math.abs(E.ymax - L.ymax))), !m.length) return g;
    let _ = [], v = m[0].ymin, w = 0;
    for (; _.length || m.length; ) {
      if (m.length) {
        let E = -1;
        for (let L = 0; L < m.length && !(m[L].ymin > v); L++) E = L;
        m.splice(0, E + 1).forEach(((L) => {
          _.push({ s: v, edge: L });
        }));
      }
      if (_ = _.filter(((E) => !(E.edge.ymax <= v))), _.sort(((E, L) => E.edge.x === L.edge.x ? 0 : (E.edge.x - L.edge.x) / Math.abs(E.edge.x - L.edge.x))), (d !== 1 || w % u == 0) && _.length > 1) for (let E = 0; E < _.length; E += 2) {
        const L = E + 1;
        if (L >= _.length) break;
        const T = _[E].edge, D = _[L].edge;
        g.push([[Math.round(T.x), v], [Math.round(D.x), v]]);
      }
      v += d, _.forEach(((E) => {
        E.edge.x = E.edge.x + d * E.edge.islope;
      })), w++;
    }
    return g;
  })(o, s, n);
  if (r) {
    for (const c of o) Pne(c, a, -r);
    (function(c, u, d) {
      const h = [];
      c.forEach(((g) => h.push(...g))), Pne(h, u, d);
    })(l, a, -r);
  }
  return l;
}
function L6(i, e) {
  var t;
  const n = e.hachureAngle + 90;
  let r = e.hachureGap;
  r < 0 && (r = 4 * e.strokeWidth), r = Math.round(Math.max(r, 0.1));
  let s = 1;
  return e.roughness >= 1 && (((t = e.randomizer) === null || t === void 0 ? void 0 : t.next()) || Math.random()) > 0.7 && (s = r), den(i, r, n, s || 1);
}
class BCe {
  constructor(e) {
    this.helper = e;
  }
  fillPolygons(e, t) {
    return this._fillPolygons(e, t);
  }
  _fillPolygons(e, t) {
    const n = L6(e, t);
    return { type: "fillSketch", ops: this.renderLines(n, t) };
  }
  renderLines(e, t) {
    const n = [];
    for (const r of e) n.push(...this.helper.doubleLineOps(r[0][0], r[0][1], r[1][0], r[1][1], t));
    return n;
  }
}
function QY(i) {
  const e = i[0], t = i[1];
  return Math.sqrt(Math.pow(e[0] - t[0], 2) + Math.pow(e[1] - t[1], 2));
}
class hen extends BCe {
  fillPolygons(e, t) {
    let n = t.hachureGap;
    n < 0 && (n = 4 * t.strokeWidth), n = Math.max(n, 0.1);
    const r = L6(e, Object.assign({}, t, { hachureGap: n })), s = Math.PI / 180 * t.hachureAngle, o = [], a = 0.5 * n * Math.cos(s), l = 0.5 * n * Math.sin(s);
    for (const [c, u] of r) QY([c, u]) && o.push([[c[0] - a, c[1] + l], [...u]], [[c[0] + a, c[1] - l], [...u]]);
    return { type: "fillSketch", ops: this.renderLines(o, t) };
  }
}
class fen extends BCe {
  fillPolygons(e, t) {
    const n = this._fillPolygons(e, t), r = Object.assign({}, t, { hachureAngle: t.hachureAngle + 90 }), s = this._fillPolygons(e, r);
    return n.ops = n.ops.concat(s.ops), n;
  }
}
class gen {
  constructor(e) {
    this.helper = e;
  }
  fillPolygons(e, t) {
    const n = L6(e, t = Object.assign({}, t, { hachureAngle: 0 }));
    return this.dotsOnLines(n, t);
  }
  dotsOnLines(e, t) {
    const n = [];
    let r = t.hachureGap;
    r < 0 && (r = 4 * t.strokeWidth), r = Math.max(r, 0.1);
    let s = t.fillWeight;
    s < 0 && (s = t.strokeWidth / 2);
    const o = r / 4;
    for (const a of e) {
      const l = QY(a), c = l / r, u = Math.ceil(c) - 1, d = l - u * r, h = (a[0][0] + a[1][0]) / 2 - r / 4, g = Math.min(a[0][1], a[1][1]);
      for (let m = 0; m < u; m++) {
        const _ = g + d + m * r, v = h - o + 2 * Math.random() * o, w = _ - o + 2 * Math.random() * o, E = this.helper.ellipse(v, w, s, s, t);
        n.push(...E.ops);
      }
    }
    return { type: "fillSketch", ops: n };
  }
}
class pen {
  constructor(e) {
    this.helper = e;
  }
  fillPolygons(e, t) {
    const n = L6(e, t);
    return { type: "fillSketch", ops: this.dashedLine(n, t) };
  }
  dashedLine(e, t) {
    const n = t.dashOffset < 0 ? t.hachureGap < 0 ? 4 * t.strokeWidth : t.hachureGap : t.dashOffset, r = t.dashGap < 0 ? t.hachureGap < 0 ? 4 * t.strokeWidth : t.hachureGap : t.dashGap, s = [];
    return e.forEach(((o) => {
      const a = QY(o), l = Math.floor(a / (n + r)), c = (a + r - l * (n + r)) / 2;
      let u = o[0], d = o[1];
      u[0] > d[0] && (u = o[1], d = o[0]);
      const h = Math.atan((d[1] - u[1]) / (d[0] - u[0]));
      for (let g = 0; g < l; g++) {
        const m = g * (n + r), _ = m + n, v = [u[0] + m * Math.cos(h) + c * Math.cos(h), u[1] + m * Math.sin(h) + c * Math.sin(h)], w = [u[0] + _ * Math.cos(h) + c * Math.cos(h), u[1] + _ * Math.sin(h) + c * Math.sin(h)];
        s.push(...this.helper.doubleLineOps(v[0], v[1], w[0], w[1], t));
      }
    })), s;
  }
}
class men {
  constructor(e) {
    this.helper = e;
  }
  fillPolygons(e, t) {
    const n = t.hachureGap < 0 ? 4 * t.strokeWidth : t.hachureGap, r = t.zigzagOffset < 0 ? n : t.zigzagOffset, s = L6(e, t = Object.assign({}, t, { hachureGap: n + r }));
    return { type: "fillSketch", ops: this.zigzagLines(s, r, t) };
  }
  zigzagLines(e, t, n) {
    const r = [];
    return e.forEach(((s) => {
      const o = QY(s), a = Math.round(o / (2 * t));
      let l = s[0], c = s[1];
      l[0] > c[0] && (l = s[1], c = s[0]);
      const u = Math.atan((c[1] - l[1]) / (c[0] - l[0]));
      for (let d = 0; d < a; d++) {
        const h = 2 * d * t, g = 2 * (d + 1) * t, m = Math.sqrt(2 * Math.pow(t, 2)), _ = [l[0] + h * Math.cos(u), l[1] + h * Math.sin(u)], v = [l[0] + g * Math.cos(u), l[1] + g * Math.sin(u)], w = [_[0] + m * Math.cos(u + Math.PI / 4), _[1] + m * Math.sin(u + Math.PI / 4)];
        r.push(...this.helper.doubleLineOps(_[0], _[1], w[0], w[1], n), ...this.helper.doubleLineOps(w[0], w[1], v[0], v[1], n));
      }
    })), r;
  }
}
const bh = {};
class _en {
  constructor(e) {
    this.seed = e;
  }
  next() {
    return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
  }
}
const ben = 0, Fne = 1, IOe = 2, dW = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 };
function Bne(i, e) {
  return i.type === e;
}
function HCe(i) {
  const e = [], t = (function(o) {
    const a = new Array();
    for (; o !== ""; ) if (o.match(/^([ \t\r\n,]+)/)) o = o.substr(RegExp.$1.length);
    else if (o.match(/^([aAcChHlLmMqQsStTvVzZ])/)) a[a.length] = { type: ben, text: RegExp.$1 }, o = o.substr(RegExp.$1.length);
    else {
      if (!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return [];
      a[a.length] = { type: Fne, text: `${parseFloat(RegExp.$1)}` }, o = o.substr(RegExp.$1.length);
    }
    return a[a.length] = { type: IOe, text: "" }, a;
  })(i);
  let n = "BOD", r = 0, s = t[r];
  for (; !Bne(s, IOe); ) {
    let o = 0;
    const a = [];
    if (n === "BOD") {
      if (s.text !== "M" && s.text !== "m") return HCe("M0,0" + i);
      r++, o = dW[s.text], n = s.text;
    } else Bne(s, Fne) ? o = dW[n] : (r++, o = dW[s.text], n = s.text);
    if (!(r + o < t.length)) throw new Error("Path data ended short");
    for (let l = r; l < r + o; l++) {
      const c = t[l];
      if (!Bne(c, Fne)) throw new Error("Param not a number: " + n + "," + c.text);
      a[a.length] = +c.text;
    }
    if (typeof dW[n] != "number") throw new Error("Bad segment: " + n);
    {
      const l = { key: n, data: a };
      e.push(l), r += o, s = t[r], n === "M" && (n = "L"), n === "m" && (n = "l");
    }
  }
  return e;
}
function y$e(i) {
  let e = 0, t = 0, n = 0, r = 0;
  const s = [];
  for (const { key: o, data: a } of i) switch (o) {
    case "M":
      s.push({ key: "M", data: [...a] }), [e, t] = a, [n, r] = a;
      break;
    case "m":
      e += a[0], t += a[1], s.push({ key: "M", data: [e, t] }), n = e, r = t;
      break;
    case "L":
      s.push({ key: "L", data: [...a] }), [e, t] = a;
      break;
    case "l":
      e += a[0], t += a[1], s.push({ key: "L", data: [e, t] });
      break;
    case "C":
      s.push({ key: "C", data: [...a] }), e = a[4], t = a[5];
      break;
    case "c": {
      const l = a.map(((c, u) => u % 2 ? c + t : c + e));
      s.push({ key: "C", data: l }), e = l[4], t = l[5];
      break;
    }
    case "Q":
      s.push({ key: "Q", data: [...a] }), e = a[2], t = a[3];
      break;
    case "q": {
      const l = a.map(((c, u) => u % 2 ? c + t : c + e));
      s.push({ key: "Q", data: l }), e = l[2], t = l[3];
      break;
    }
    case "A":
      s.push({ key: "A", data: [...a] }), e = a[5], t = a[6];
      break;
    case "a":
      e += a[5], t += a[6], s.push({ key: "A", data: [a[0], a[1], a[2], a[3], a[4], e, t] });
      break;
    case "H":
      s.push({ key: "H", data: [...a] }), e = a[0];
      break;
    case "h":
      e += a[0], s.push({ key: "H", data: [e] });
      break;
    case "V":
      s.push({ key: "V", data: [...a] }), t = a[0];
      break;
    case "v":
      t += a[0], s.push({ key: "V", data: [t] });
      break;
    case "S":
      s.push({ key: "S", data: [...a] }), e = a[2], t = a[3];
      break;
    case "s": {
      const l = a.map(((c, u) => u % 2 ? c + t : c + e));
      s.push({ key: "S", data: l }), e = l[2], t = l[3];
      break;
    }
    case "T":
      s.push({ key: "T", data: [...a] }), e = a[0], t = a[1];
      break;
    case "t":
      e += a[0], t += a[1], s.push({ key: "T", data: [e, t] });
      break;
    case "Z":
    case "z":
      s.push({ key: "Z", data: [] }), e = n, t = r;
  }
  return s;
}
function C$e(i) {
  const e = [];
  let t = "", n = 0, r = 0, s = 0, o = 0, a = 0, l = 0;
  for (const { key: c, data: u } of i) {
    switch (c) {
      case "M":
        e.push({ key: "M", data: [...u] }), [n, r] = u, [s, o] = u;
        break;
      case "C":
        e.push({ key: "C", data: [...u] }), n = u[4], r = u[5], a = u[2], l = u[3];
        break;
      case "L":
        e.push({ key: "L", data: [...u] }), [n, r] = u;
        break;
      case "H":
        n = u[0], e.push({ key: "L", data: [n, r] });
        break;
      case "V":
        r = u[0], e.push({ key: "L", data: [n, r] });
        break;
      case "S": {
        let d = 0, h = 0;
        t === "C" || t === "S" ? (d = n + (n - a), h = r + (r - l)) : (d = n, h = r), e.push({ key: "C", data: [d, h, ...u] }), a = u[0], l = u[1], n = u[2], r = u[3];
        break;
      }
      case "T": {
        const [d, h] = u;
        let g = 0, m = 0;
        t === "Q" || t === "T" ? (g = n + (n - a), m = r + (r - l)) : (g = n, m = r);
        const _ = n + 2 * (g - n) / 3, v = r + 2 * (m - r) / 3, w = d + 2 * (g - d) / 3, E = h + 2 * (m - h) / 3;
        e.push({ key: "C", data: [_, v, w, E, d, h] }), a = g, l = m, n = d, r = h;
        break;
      }
      case "Q": {
        const [d, h, g, m] = u, _ = n + 2 * (d - n) / 3, v = r + 2 * (h - r) / 3, w = g + 2 * (d - g) / 3, E = m + 2 * (h - m) / 3;
        e.push({ key: "C", data: [_, v, w, E, g, m] }), a = d, l = h, n = g, r = m;
        break;
      }
      case "A": {
        const d = Math.abs(u[0]), h = Math.abs(u[1]), g = u[2], m = u[3], _ = u[4], v = u[5], w = u[6];
        d === 0 || h === 0 ? (e.push({ key: "C", data: [n, r, v, w, v, w] }), n = v, r = w) : (n !== v || r !== w) && (w$e(n, r, v, w, d, h, g, m, _).forEach((function(E) {
          e.push({ key: "C", data: E });
        })), n = v, r = w);
        break;
      }
      case "Z":
        e.push({ key: "Z", data: [] }), n = s, r = o;
    }
    t = c;
  }
  return e;
}
function FP(i, e, t) {
  return [i * Math.cos(t) - e * Math.sin(t), i * Math.sin(t) + e * Math.cos(t)];
}
function w$e(i, e, t, n, r, s, o, a, l, c) {
  const u = (d = o, Math.PI * d / 180);
  var d;
  let h = [], g = 0, m = 0, _ = 0, v = 0;
  if (c) [g, m, _, v] = c;
  else {
    [i, e] = FP(i, e, -u), [t, n] = FP(t, n, -u);
    const X = (i - t) / 2, Y = (e - n) / 2;
    let G = X * X / (r * r) + Y * Y / (s * s);
    G > 1 && (G = Math.sqrt(G), r *= G, s *= G);
    const Q = r * r, oe = s * s, Z = Q * oe - Q * Y * Y - oe * X * X, pe = Q * Y * Y + oe * X * X, J = (a === l ? -1 : 1) * Math.sqrt(Math.abs(Z / pe));
    _ = J * r * Y / s + (i + t) / 2, v = J * -s * X / r + (e + n) / 2, g = Math.asin(parseFloat(((e - v) / s).toFixed(9))), m = Math.asin(parseFloat(((n - v) / s).toFixed(9))), i < _ && (g = Math.PI - g), t < _ && (m = Math.PI - m), g < 0 && (g = 2 * Math.PI + g), m < 0 && (m = 2 * Math.PI + m), l && g > m && (g -= 2 * Math.PI), !l && m > g && (m -= 2 * Math.PI);
  }
  let w = m - g;
  if (Math.abs(w) > 120 * Math.PI / 180) {
    const X = m, Y = t, G = n;
    m = l && m > g ? g + 120 * Math.PI / 180 * 1 : g + 120 * Math.PI / 180 * -1, h = w$e(t = _ + r * Math.cos(m), n = v + s * Math.sin(m), Y, G, r, s, o, 0, l, [m, X, _, v]);
  }
  w = m - g;
  const E = Math.cos(g), L = Math.sin(g), T = Math.cos(m), D = Math.sin(m), N = Math.tan(w / 4), R = 4 / 3 * r * N, M = 4 / 3 * s * N, B = [i, e], H = [i + R * L, e - M * E], j = [t + R * D, n - M * T], K = [t, n];
  if (H[0] = 2 * B[0] - H[0], H[1] = 2 * B[1] - H[1], c) return [H, j, K].concat(h);
  {
    h = [H, j, K].concat(h);
    const X = [];
    for (let Y = 0; Y < h.length; Y += 3) {
      const G = FP(h[Y][0], h[Y][1], u), Q = FP(h[Y + 1][0], h[Y + 1][1], u), oe = FP(h[Y + 2][0], h[Y + 2][1], u);
      X.push([G[0], G[1], Q[0], Q[1], oe[0], oe[1]]);
    }
    return X;
  }
}
const ven = { randOffset: function(i, e) {
  return Pi(i, e);
}, randOffsetWithRange: function(i, e, t) {
  return Cj(i, e, t);
}, ellipse: function(i, e, t, n, r) {
  const s = E$e(t, n, r);
  return lhe(i, e, r, s).opset;
}, doubleLineOps: function(i, e, t, n, r) {
  return vw(i, e, t, n, r, !0);
} };
function S$e(i, e, t, n, r) {
  return { type: "path", ops: vw(i, e, t, n, r) };
}
function mV(i, e, t) {
  const n = (i || []).length;
  if (n > 2) {
    const r = [];
    for (let s = 0; s < n - 1; s++) r.push(...vw(i[s][0], i[s][1], i[s + 1][0], i[s + 1][1], t));
    return e && r.push(...vw(i[n - 1][0], i[n - 1][1], i[0][0], i[0][1], t)), { type: "path", ops: r };
  }
  return n === 2 ? S$e(i[0][0], i[0][1], i[1][0], i[1][1], t) : { type: "path", ops: [] };
}
function yen(i, e, t, n, r) {
  return (function(s, o) {
    return mV(s, !0, o);
  })([[i, e], [i + t, e], [i + t, e + n], [i, e + n]], r);
}
function NOe(i, e) {
  if (i.length) {
    const t = typeof i[0][0] == "number" ? [i] : i, n = hW(t[0], 1 * (1 + 0.2 * e.roughness), e), r = e.disableMultiStroke ? [] : hW(t[0], 1.5 * (1 + 0.22 * e.roughness), OOe(e));
    for (let s = 1; s < t.length; s++) {
      const o = t[s];
      if (o.length) {
        const a = hW(o, 1 * (1 + 0.2 * e.roughness), e), l = e.disableMultiStroke ? [] : hW(o, 1.5 * (1 + 0.22 * e.roughness), OOe(e));
        for (const c of a) c.op !== "move" && n.push(c);
        for (const c of l) c.op !== "move" && r.push(c);
      }
    }
    return { type: "path", ops: n.concat(r) };
  }
  return { type: "path", ops: [] };
}
function E$e(i, e, t) {
  const n = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(i / 2, 2) + Math.pow(e / 2, 2)) / 2)), r = Math.ceil(Math.max(t.curveStepCount, t.curveStepCount / Math.sqrt(200) * n)), s = 2 * Math.PI / r;
  let o = Math.abs(i / 2), a = Math.abs(e / 2);
  const l = 1 - t.curveFitting;
  return o += Pi(o * l, t), a += Pi(a * l, t), { increment: s, rx: o, ry: a };
}
function lhe(i, e, t, n) {
  const [r, s] = MOe(n.increment, i, e, n.rx, n.ry, 1, n.increment * Cj(0.1, Cj(0.4, 1, t), t), t);
  let o = wj(r, null, t);
  if (!t.disableMultiStroke && t.roughness !== 0) {
    const [a] = MOe(n.increment, i, e, n.rx, n.ry, 1.5, 0, t), l = wj(a, null, t);
    o = o.concat(l);
  }
  return { estimatedPoints: s, opset: { type: "path", ops: o } };
}
function ROe(i, e, t, n, r, s, o, a, l) {
  const c = i, u = e;
  let d = Math.abs(t / 2), h = Math.abs(n / 2);
  d += Pi(0.01 * d, l), h += Pi(0.01 * h, l);
  let g = r, m = s;
  for (; g < 0; ) g += 2 * Math.PI, m += 2 * Math.PI;
  m - g > 2 * Math.PI && (g = 0, m = 2 * Math.PI);
  const _ = 2 * Math.PI / l.curveStepCount, v = Math.min(_ / 2, (m - g) / 2), w = POe(v, c, u, d, h, g, m, 1, l);
  if (!l.disableMultiStroke) {
    const E = POe(v, c, u, d, h, g, m, 1.5, l);
    w.push(...E);
  }
  return o && (a ? w.push(...vw(c, u, c + d * Math.cos(g), u + h * Math.sin(g), l), ...vw(c, u, c + d * Math.cos(m), u + h * Math.sin(m), l)) : w.push({ op: "lineTo", data: [c, u] }, { op: "lineTo", data: [c + d * Math.cos(g), u + h * Math.sin(g)] })), { type: "path", ops: w };
}
function AOe(i, e) {
  const t = C$e(y$e(HCe(i))), n = [];
  let r = [0, 0], s = [0, 0];
  for (const { key: o, data: a } of t) switch (o) {
    case "M":
      s = [a[0], a[1]], r = [a[0], a[1]];
      break;
    case "L":
      n.push(...vw(s[0], s[1], a[0], a[1], e)), s = [a[0], a[1]];
      break;
    case "C": {
      const [l, c, u, d, h, g] = a;
      n.push(...Cen(l, c, u, d, h, g, s, e)), s = [h, g];
      break;
    }
    case "Z":
      n.push(...vw(s[0], s[1], r[0], r[1], e)), s = [r[0], r[1]];
  }
  return { type: "path", ops: n };
}
function Hne(i, e) {
  const t = [];
  for (const n of i) if (n.length) {
    const r = e.maxRandomnessOffset || 0, s = n.length;
    if (s > 2) {
      t.push({ op: "move", data: [n[0][0] + Pi(r, e), n[0][1] + Pi(r, e)] });
      for (let o = 1; o < s; o++) t.push({ op: "lineTo", data: [n[o][0] + Pi(r, e), n[o][1] + Pi(r, e)] });
    }
  }
  return { type: "fillPath", ops: t };
}
function VI(i, e) {
  return (function(t, n) {
    let r = t.fillStyle || "hachure";
    if (!bh[r]) switch (r) {
      case "zigzag":
        bh[r] || (bh[r] = new hen(n));
        break;
      case "cross-hatch":
        bh[r] || (bh[r] = new fen(n));
        break;
      case "dots":
        bh[r] || (bh[r] = new gen(n));
        break;
      case "dashed":
        bh[r] || (bh[r] = new pen(n));
        break;
      case "zigzag-line":
        bh[r] || (bh[r] = new men(n));
        break;
      default:
        r = "hachure", bh[r] || (bh[r] = new BCe(n));
    }
    return bh[r];
  })(e, ven).fillPolygons(i, e);
}
function OOe(i) {
  const e = Object.assign({}, i);
  return e.randomizer = void 0, i.seed && (e.seed = i.seed + 1), e;
}
function x$e(i) {
  return i.randomizer || (i.randomizer = new _en(i.seed || 0)), i.randomizer.next();
}
function Cj(i, e, t, n = 1) {
  return t.roughness * n * (x$e(t) * (e - i) + i);
}
function Pi(i, e, t = 1) {
  return Cj(-i, i, e, t);
}
function vw(i, e, t, n, r, s = !1) {
  const o = s ? r.disableMultiStrokeFill : r.disableMultiStroke, a = che(i, e, t, n, r, !0, !1);
  if (o) return a;
  const l = che(i, e, t, n, r, !0, !0);
  return a.concat(l);
}
function che(i, e, t, n, r, s, o) {
  const a = Math.pow(i - t, 2) + Math.pow(e - n, 2), l = Math.sqrt(a);
  let c = 1;
  c = l < 200 ? 1 : l > 500 ? 0.4 : -16668e-7 * l + 1.233334;
  let u = r.maxRandomnessOffset || 0;
  u * u * 100 > a && (u = l / 10);
  const d = u / 2, h = 0.2 + 0.2 * x$e(r);
  let g = r.bowing * r.maxRandomnessOffset * (n - e) / 200, m = r.bowing * r.maxRandomnessOffset * (i - t) / 200;
  g = Pi(g, r, c), m = Pi(m, r, c);
  const _ = [], v = () => Pi(d, r, c), w = () => Pi(u, r, c), E = r.preserveVertices;
  return o ? _.push({ op: "move", data: [i + (E ? 0 : v()), e + (E ? 0 : v())] }) : _.push({ op: "move", data: [i + (E ? 0 : Pi(u, r, c)), e + (E ? 0 : Pi(u, r, c))] }), o ? _.push({ op: "bcurveTo", data: [g + i + (t - i) * h + v(), m + e + (n - e) * h + v(), g + i + 2 * (t - i) * h + v(), m + e + 2 * (n - e) * h + v(), t + (E ? 0 : v()), n + (E ? 0 : v())] }) : _.push({ op: "bcurveTo", data: [g + i + (t - i) * h + w(), m + e + (n - e) * h + w(), g + i + 2 * (t - i) * h + w(), m + e + 2 * (n - e) * h + w(), t + (E ? 0 : w()), n + (E ? 0 : w())] }), _;
}
function hW(i, e, t) {
  if (!i.length) return [];
  const n = [];
  n.push([i[0][0] + Pi(e, t), i[0][1] + Pi(e, t)]), n.push([i[0][0] + Pi(e, t), i[0][1] + Pi(e, t)]);
  for (let r = 1; r < i.length; r++) n.push([i[r][0] + Pi(e, t), i[r][1] + Pi(e, t)]), r === i.length - 1 && n.push([i[r][0] + Pi(e, t), i[r][1] + Pi(e, t)]);
  return wj(n, null, t);
}
function wj(i, e, t) {
  const n = i.length, r = [];
  if (n > 3) {
    const s = [], o = 1 - t.curveTightness;
    r.push({ op: "move", data: [i[1][0], i[1][1]] });
    for (let a = 1; a + 2 < n; a++) {
      const l = i[a];
      s[0] = [l[0], l[1]], s[1] = [l[0] + (o * i[a + 1][0] - o * i[a - 1][0]) / 6, l[1] + (o * i[a + 1][1] - o * i[a - 1][1]) / 6], s[2] = [i[a + 1][0] + (o * i[a][0] - o * i[a + 2][0]) / 6, i[a + 1][1] + (o * i[a][1] - o * i[a + 2][1]) / 6], s[3] = [i[a + 1][0], i[a + 1][1]], r.push({ op: "bcurveTo", data: [s[1][0], s[1][1], s[2][0], s[2][1], s[3][0], s[3][1]] });
    }
  } else n === 3 ? (r.push({ op: "move", data: [i[1][0], i[1][1]] }), r.push({ op: "bcurveTo", data: [i[1][0], i[1][1], i[2][0], i[2][1], i[2][0], i[2][1]] })) : n === 2 && r.push(...che(i[0][0], i[0][1], i[1][0], i[1][1], t, !0, !0));
  return r;
}
function MOe(i, e, t, n, r, s, o, a) {
  const l = [], c = [];
  if (a.roughness === 0) {
    i /= 4, c.push([e + n * Math.cos(-i), t + r * Math.sin(-i)]);
    for (let u = 0; u <= 2 * Math.PI; u += i) {
      const d = [e + n * Math.cos(u), t + r * Math.sin(u)];
      l.push(d), c.push(d);
    }
    c.push([e + n * Math.cos(0), t + r * Math.sin(0)]), c.push([e + n * Math.cos(i), t + r * Math.sin(i)]);
  } else {
    const u = Pi(0.5, a) - Math.PI / 2;
    c.push([Pi(s, a) + e + 0.9 * n * Math.cos(u - i), Pi(s, a) + t + 0.9 * r * Math.sin(u - i)]);
    const d = 2 * Math.PI + u - 0.01;
    for (let h = u; h < d; h += i) {
      const g = [Pi(s, a) + e + n * Math.cos(h), Pi(s, a) + t + r * Math.sin(h)];
      l.push(g), c.push(g);
    }
    c.push([Pi(s, a) + e + n * Math.cos(u + 2 * Math.PI + 0.5 * o), Pi(s, a) + t + r * Math.sin(u + 2 * Math.PI + 0.5 * o)]), c.push([Pi(s, a) + e + 0.98 * n * Math.cos(u + o), Pi(s, a) + t + 0.98 * r * Math.sin(u + o)]), c.push([Pi(s, a) + e + 0.9 * n * Math.cos(u + 0.5 * o), Pi(s, a) + t + 0.9 * r * Math.sin(u + 0.5 * o)]);
  }
  return [c, l];
}
function POe(i, e, t, n, r, s, o, a, l) {
  const c = s + Pi(0.1, l), u = [];
  u.push([Pi(a, l) + e + 0.9 * n * Math.cos(c - i), Pi(a, l) + t + 0.9 * r * Math.sin(c - i)]);
  for (let d = c; d <= o; d += i) u.push([Pi(a, l) + e + n * Math.cos(d), Pi(a, l) + t + r * Math.sin(d)]);
  return u.push([e + n * Math.cos(o), t + r * Math.sin(o)]), u.push([e + n * Math.cos(o), t + r * Math.sin(o)]), wj(u, null, l);
}
function Cen(i, e, t, n, r, s, o, a) {
  const l = [], c = [a.maxRandomnessOffset || 1, (a.maxRandomnessOffset || 1) + 0.3];
  let u = [0, 0];
  const d = a.disableMultiStroke ? 1 : 2, h = a.preserveVertices;
  for (let g = 0; g < d; g++) g === 0 ? l.push({ op: "move", data: [o[0], o[1]] }) : l.push({ op: "move", data: [o[0] + (h ? 0 : Pi(c[0], a)), o[1] + (h ? 0 : Pi(c[0], a))] }), u = h ? [r, s] : [r + Pi(c[g], a), s + Pi(c[g], a)], l.push({ op: "bcurveTo", data: [i + Pi(c[g], a), e + Pi(c[g], a), t + Pi(c[g], a), n + Pi(c[g], a), u[0], u[1]] });
  return l;
}
function BP(i) {
  return [...i];
}
function FOe(i, e = 0) {
  const t = i.length;
  if (t < 3) throw new Error("A curve must have at least three points.");
  const n = [];
  if (t === 3) n.push(BP(i[0]), BP(i[1]), BP(i[2]), BP(i[2]));
  else {
    const r = [];
    r.push(i[0], i[0]);
    for (let a = 1; a < i.length; a++) r.push(i[a]), a === i.length - 1 && r.push(i[a]);
    const s = [], o = 1 - e;
    n.push(BP(r[0]));
    for (let a = 1; a + 2 < r.length; a++) {
      const l = r[a];
      s[0] = [l[0], l[1]], s[1] = [l[0] + (o * r[a + 1][0] - o * r[a - 1][0]) / 6, l[1] + (o * r[a + 1][1] - o * r[a - 1][1]) / 6], s[2] = [r[a + 1][0] + (o * r[a][0] - o * r[a + 2][0]) / 6, r[a + 1][1] + (o * r[a][1] - o * r[a + 2][1]) / 6], s[3] = [r[a + 1][0], r[a + 1][1]], n.push(s[1], s[2], s[3]);
    }
  }
  return n;
}
function _V(i, e) {
  return Math.pow(i[0] - e[0], 2) + Math.pow(i[1] - e[1], 2);
}
function wen(i, e, t) {
  const n = _V(e, t);
  if (n === 0) return _V(i, e);
  let r = ((i[0] - e[0]) * (t[0] - e[0]) + (i[1] - e[1]) * (t[1] - e[1])) / n;
  return r = Math.max(0, Math.min(1, r)), _V(i, AE(e, t, r));
}
function AE(i, e, t) {
  return [i[0] + (e[0] - i[0]) * t, i[1] + (e[1] - i[1]) * t];
}
function uhe(i, e, t, n) {
  const r = n || [];
  if ((function(a, l) {
    const c = a[l + 0], u = a[l + 1], d = a[l + 2], h = a[l + 3];
    let g = 3 * u[0] - 2 * c[0] - h[0];
    g *= g;
    let m = 3 * u[1] - 2 * c[1] - h[1];
    m *= m;
    let _ = 3 * d[0] - 2 * h[0] - c[0];
    _ *= _;
    let v = 3 * d[1] - 2 * h[1] - c[1];
    return v *= v, g < _ && (g = _), m < v && (m = v), g + m;
  })(i, e) < t) {
    const a = i[e + 0];
    r.length ? (s = r[r.length - 1], o = a, Math.sqrt(_V(s, o)) > 1 && r.push(a)) : r.push(a), r.push(i[e + 3]);
  } else {
    const l = i[e + 0], c = i[e + 1], u = i[e + 2], d = i[e + 3], h = AE(l, c, 0.5), g = AE(c, u, 0.5), m = AE(u, d, 0.5), _ = AE(h, g, 0.5), v = AE(g, m, 0.5), w = AE(_, v, 0.5);
    uhe([l, h, _, w], 0, t, r), uhe([w, v, m, d], 0, t, r);
  }
  var s, o;
  return r;
}
function Sen(i, e) {
  return Sj(i, 0, i.length, e);
}
function Sj(i, e, t, n, r) {
  const s = r || [], o = i[e], a = i[t - 1];
  let l = 0, c = 1;
  for (let u = e + 1; u < t - 1; ++u) {
    const d = wen(i[u], o, a);
    d > l && (l = d, c = u);
  }
  return Math.sqrt(l) > n ? (Sj(i, e, c + 1, n, s), Sj(i, c, t, n, s)) : (s.length || s.push(o), s.push(a)), s;
}
function Wne(i, e = 0.15, t) {
  const n = [], r = (i.length - 1) / 3;
  for (let s = 0; s < r; s++)
    uhe(i, 3 * s, e, n);
  return t && t > 0 ? Sj(n, 0, n.length, t) : n;
}
const mf = "none";
class Ej {
  constructor(e) {
    this.defaultOptions = { maxRandomnessOffset: 2, roughness: 1, bowing: 1, stroke: "#000", strokeWidth: 1, curveTightness: 0, curveFitting: 0.95, curveStepCount: 9, fillStyle: "hachure", fillWeight: -1, hachureAngle: -41, hachureGap: -1, dashOffset: -1, dashGap: -1, zigzagOffset: -1, seed: 0, disableMultiStroke: !1, disableMultiStrokeFill: !1, preserveVertices: !1, fillShapeRoughnessGain: 0.8 }, this.config = e || {}, this.config.options && (this.defaultOptions = this._o(this.config.options));
  }
  static newSeed() {
    return Math.floor(Math.random() * 2 ** 31);
  }
  _o(e) {
    return e ? Object.assign({}, this.defaultOptions, e) : this.defaultOptions;
  }
  _d(e, t, n) {
    return { shape: e, sets: t || [], options: n || this.defaultOptions };
  }
  line(e, t, n, r, s) {
    const o = this._o(s);
    return this._d("line", [S$e(e, t, n, r, o)], o);
  }
  rectangle(e, t, n, r, s) {
    const o = this._o(s), a = [], l = yen(e, t, n, r, o);
    if (o.fill) {
      const c = [[e, t], [e + n, t], [e + n, t + r], [e, t + r]];
      o.fillStyle === "solid" ? a.push(Hne([c], o)) : a.push(VI([c], o));
    }
    return o.stroke !== mf && a.push(l), this._d("rectangle", a, o);
  }
  ellipse(e, t, n, r, s) {
    const o = this._o(s), a = [], l = E$e(n, r, o), c = lhe(e, t, o, l);
    if (o.fill) if (o.fillStyle === "solid") {
      const u = lhe(e, t, o, l).opset;
      u.type = "fillPath", a.push(u);
    } else a.push(VI([c.estimatedPoints], o));
    return o.stroke !== mf && a.push(c.opset), this._d("ellipse", a, o);
  }
  circle(e, t, n, r) {
    const s = this.ellipse(e, t, n, n, r);
    return s.shape = "circle", s;
  }
  linearPath(e, t) {
    const n = this._o(t);
    return this._d("linearPath", [mV(e, !1, n)], n);
  }
  arc(e, t, n, r, s, o, a = !1, l) {
    const c = this._o(l), u = [], d = ROe(e, t, n, r, s, o, a, !0, c);
    if (a && c.fill) if (c.fillStyle === "solid") {
      const h = Object.assign({}, c);
      h.disableMultiStroke = !0;
      const g = ROe(e, t, n, r, s, o, !0, !1, h);
      g.type = "fillPath", u.push(g);
    } else u.push((function(h, g, m, _, v, w, E) {
      const L = h, T = g;
      let D = Math.abs(m / 2), N = Math.abs(_ / 2);
      D += Pi(0.01 * D, E), N += Pi(0.01 * N, E);
      let R = v, M = w;
      for (; R < 0; ) R += 2 * Math.PI, M += 2 * Math.PI;
      M - R > 2 * Math.PI && (R = 0, M = 2 * Math.PI);
      const B = (M - R) / E.curveStepCount, H = [];
      for (let j = R; j <= M; j += B) H.push([L + D * Math.cos(j), T + N * Math.sin(j)]);
      return H.push([L + D * Math.cos(M), T + N * Math.sin(M)]), H.push([L, T]), VI([H], E);
    })(e, t, n, r, s, o, c));
    return c.stroke !== mf && u.push(d), this._d("arc", u, c);
  }
  curve(e, t) {
    const n = this._o(t), r = [], s = NOe(e, n);
    if (n.fill && n.fill !== mf) if (n.fillStyle === "solid") {
      const o = NOe(e, Object.assign(Object.assign({}, n), { disableMultiStroke: !0, roughness: n.roughness ? n.roughness + n.fillShapeRoughnessGain : 0 }));
      r.push({ type: "fillPath", ops: this._mergedShape(o.ops) });
    } else {
      const o = [], a = e;
      if (a.length) {
        const l = typeof a[0][0] == "number" ? [a] : a;
        for (const c of l) c.length < 3 ? o.push(...c) : c.length === 3 ? o.push(...Wne(FOe([c[0], c[0], c[1], c[2]]), 10, (1 + n.roughness) / 2)) : o.push(...Wne(FOe(c), 10, (1 + n.roughness) / 2));
      }
      o.length && r.push(VI([o], n));
    }
    return n.stroke !== mf && r.push(s), this._d("curve", r, n);
  }
  polygon(e, t) {
    const n = this._o(t), r = [], s = mV(e, !0, n);
    return n.fill && (n.fillStyle === "solid" ? r.push(Hne([e], n)) : r.push(VI([e], n))), n.stroke !== mf && r.push(s), this._d("polygon", r, n);
  }
  path(e, t) {
    const n = this._o(t), r = [];
    if (!e) return this._d("path", r, n);
    e = (e || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
    const s = n.fill && n.fill !== "transparent" && n.fill !== mf, o = n.stroke !== mf, a = !!(n.simplification && n.simplification < 1), l = (function(u, d, h) {
      const g = C$e(y$e(HCe(u))), m = [];
      let _ = [], v = [0, 0], w = [];
      const E = () => {
        w.length >= 4 && _.push(...Wne(w, d)), w = [];
      }, L = () => {
        E(), _.length && (m.push(_), _ = []);
      };
      for (const { key: D, data: N } of g) switch (D) {
        case "M":
          L(), v = [N[0], N[1]], _.push(v);
          break;
        case "L":
          E(), _.push([N[0], N[1]]);
          break;
        case "C":
          if (!w.length) {
            const R = _.length ? _[_.length - 1] : v;
            w.push([R[0], R[1]]);
          }
          w.push([N[0], N[1]]), w.push([N[2], N[3]]), w.push([N[4], N[5]]);
          break;
        case "Z":
          E(), _.push([v[0], v[1]]);
      }
      if (L(), !h) return m;
      const T = [];
      for (const D of m) {
        const N = Sen(D, h);
        N.length && T.push(N);
      }
      return T;
    })(e, 1, a ? 4 - 4 * (n.simplification || 1) : (1 + n.roughness) / 2), c = AOe(e, n);
    if (s) if (n.fillStyle === "solid") if (l.length === 1) {
      const u = AOe(e, Object.assign(Object.assign({}, n), { disableMultiStroke: !0, roughness: n.roughness ? n.roughness + n.fillShapeRoughnessGain : 0 }));
      r.push({ type: "fillPath", ops: this._mergedShape(u.ops) });
    } else r.push(Hne(l, n));
    else r.push(VI(l, n));
    return o && (a ? l.forEach(((u) => {
      r.push(mV(u, !1, n));
    })) : r.push(c)), this._d("path", r, n);
  }
  opsToPath(e, t) {
    let n = "";
    for (const r of e.ops) {
      const s = typeof t == "number" && t >= 0 ? r.data.map(((o) => +o.toFixed(t))) : r.data;
      switch (r.op) {
        case "move":
          n += `M${s[0]} ${s[1]} `;
          break;
        case "bcurveTo":
          n += `C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;
          break;
        case "lineTo":
          n += `L${s[0]} ${s[1]} `;
      }
    }
    return n.trim();
  }
  toPaths(e) {
    const t = e.sets || [], n = e.options || this.defaultOptions, r = [];
    for (const s of t) {
      let o = null;
      switch (s.type) {
        case "path":
          o = { d: this.opsToPath(s), stroke: n.stroke, strokeWidth: n.strokeWidth, fill: mf };
          break;
        case "fillPath":
          o = { d: this.opsToPath(s), stroke: mf, strokeWidth: 0, fill: n.fill || mf };
          break;
        case "fillSketch":
          o = this.fillSketch(s, n);
      }
      o && r.push(o);
    }
    return r;
  }
  fillSketch(e, t) {
    let n = t.fillWeight;
    return n < 0 && (n = t.strokeWidth / 2), { d: this.opsToPath(e), stroke: t.fill || mf, strokeWidth: n, fill: mf };
  }
  _mergedShape(e) {
    return e.filter(((t, n) => n === 0 || t.op !== "move"));
  }
}
class Een {
  constructor(e, t) {
    this.canvas = e, this.ctx = this.canvas.getContext("2d"), this.gen = new Ej(t);
  }
  draw(e) {
    const t = e.sets || [], n = e.options || this.getDefaultOptions(), r = this.ctx, s = e.options.fixedDecimalPlaceDigits;
    for (const o of t) switch (o.type) {
      case "path":
        r.save(), r.strokeStyle = n.stroke === "none" ? "transparent" : n.stroke, r.lineWidth = n.strokeWidth, n.strokeLineDash && r.setLineDash(n.strokeLineDash), n.strokeLineDashOffset && (r.lineDashOffset = n.strokeLineDashOffset), this._drawToContext(r, o, s), r.restore();
        break;
      case "fillPath": {
        r.save(), r.fillStyle = n.fill || "";
        const a = e.shape === "curve" || e.shape === "polygon" || e.shape === "path" ? "evenodd" : "nonzero";
        this._drawToContext(r, o, s, a), r.restore();
        break;
      }
      case "fillSketch":
        this.fillSketch(r, o, n);
    }
  }
  fillSketch(e, t, n) {
    let r = n.fillWeight;
    r < 0 && (r = n.strokeWidth / 2), e.save(), n.fillLineDash && e.setLineDash(n.fillLineDash), n.fillLineDashOffset && (e.lineDashOffset = n.fillLineDashOffset), e.strokeStyle = n.fill || "", e.lineWidth = r, this._drawToContext(e, t, n.fixedDecimalPlaceDigits), e.restore();
  }
  _drawToContext(e, t, n, r = "nonzero") {
    e.beginPath();
    for (const s of t.ops) {
      const o = typeof n == "number" && n >= 0 ? s.data.map(((a) => +a.toFixed(n))) : s.data;
      switch (s.op) {
        case "move":
          e.moveTo(o[0], o[1]);
          break;
        case "bcurveTo":
          e.bezierCurveTo(o[0], o[1], o[2], o[3], o[4], o[5]);
          break;
        case "lineTo":
          e.lineTo(o[0], o[1]);
      }
    }
    t.type === "fillPath" ? e.fill(r) : e.stroke();
  }
  get generator() {
    return this.gen;
  }
  getDefaultOptions() {
    return this.gen.defaultOptions;
  }
  line(e, t, n, r, s) {
    const o = this.gen.line(e, t, n, r, s);
    return this.draw(o), o;
  }
  rectangle(e, t, n, r, s) {
    const o = this.gen.rectangle(e, t, n, r, s);
    return this.draw(o), o;
  }
  ellipse(e, t, n, r, s) {
    const o = this.gen.ellipse(e, t, n, r, s);
    return this.draw(o), o;
  }
  circle(e, t, n, r) {
    const s = this.gen.circle(e, t, n, r);
    return this.draw(s), s;
  }
  linearPath(e, t) {
    const n = this.gen.linearPath(e, t);
    return this.draw(n), n;
  }
  polygon(e, t) {
    const n = this.gen.polygon(e, t);
    return this.draw(n), n;
  }
  arc(e, t, n, r, s, o, a = !1, l) {
    const c = this.gen.arc(e, t, n, r, s, o, a, l);
    return this.draw(c), c;
  }
  curve(e, t) {
    const n = this.gen.curve(e, t);
    return this.draw(n), n;
  }
  path(e, t) {
    const n = this.gen.path(e, t);
    return this.draw(n), n;
  }
}
const fW = "http://www.w3.org/2000/svg";
class xen {
  constructor(e, t) {
    this.svg = e, this.gen = new Ej(t);
  }
  draw(e) {
    const t = e.sets || [], n = e.options || this.getDefaultOptions(), r = this.svg.ownerDocument || window.document, s = r.createElementNS(fW, "g"), o = e.options.fixedDecimalPlaceDigits;
    for (const a of t) {
      let l = null;
      switch (a.type) {
        case "path":
          l = r.createElementNS(fW, "path"), l.setAttribute("d", this.opsToPath(a, o)), l.setAttribute("stroke", n.stroke), l.setAttribute("stroke-width", n.strokeWidth + ""), l.setAttribute("fill", "none"), n.strokeLineDash && l.setAttribute("stroke-dasharray", n.strokeLineDash.join(" ").trim()), n.strokeLineDashOffset && l.setAttribute("stroke-dashoffset", `${n.strokeLineDashOffset}`);
          break;
        case "fillPath":
          l = r.createElementNS(fW, "path"), l.setAttribute("d", this.opsToPath(a, o)), l.setAttribute("stroke", "none"), l.setAttribute("stroke-width", "0"), l.setAttribute("fill", n.fill || ""), e.shape !== "curve" && e.shape !== "polygon" || l.setAttribute("fill-rule", "evenodd");
          break;
        case "fillSketch":
          l = this.fillSketch(r, a, n);
      }
      l && s.appendChild(l);
    }
    return s;
  }
  fillSketch(e, t, n) {
    let r = n.fillWeight;
    r < 0 && (r = n.strokeWidth / 2);
    const s = e.createElementNS(fW, "path");
    return s.setAttribute("d", this.opsToPath(t, n.fixedDecimalPlaceDigits)), s.setAttribute("stroke", n.fill || ""), s.setAttribute("stroke-width", r + ""), s.setAttribute("fill", "none"), n.fillLineDash && s.setAttribute("stroke-dasharray", n.fillLineDash.join(" ").trim()), n.fillLineDashOffset && s.setAttribute("stroke-dashoffset", `${n.fillLineDashOffset}`), s;
  }
  get generator() {
    return this.gen;
  }
  getDefaultOptions() {
    return this.gen.defaultOptions;
  }
  opsToPath(e, t) {
    return this.gen.opsToPath(e, t);
  }
  line(e, t, n, r, s) {
    const o = this.gen.line(e, t, n, r, s);
    return this.draw(o);
  }
  rectangle(e, t, n, r, s) {
    const o = this.gen.rectangle(e, t, n, r, s);
    return this.draw(o);
  }
  ellipse(e, t, n, r, s) {
    const o = this.gen.ellipse(e, t, n, r, s);
    return this.draw(o);
  }
  circle(e, t, n, r) {
    const s = this.gen.circle(e, t, n, r);
    return this.draw(s);
  }
  linearPath(e, t) {
    const n = this.gen.linearPath(e, t);
    return this.draw(n);
  }
  polygon(e, t) {
    const n = this.gen.polygon(e, t);
    return this.draw(n);
  }
  arc(e, t, n, r, s, o, a = !1, l) {
    const c = this.gen.arc(e, t, n, r, s, o, a, l);
    return this.draw(c);
  }
  curve(e, t) {
    const n = this.gen.curve(e, t);
    return this.draw(n);
  }
  path(e, t) {
    const n = this.gen.path(e, t);
    return this.draw(n);
  }
}
var Un = { canvas: (i, e) => new Een(i, e), svg: (i, e) => new xen(i, e), generator: (i) => new Ej(i), newSeed: () => Ej.newSeed() }, ki = /* @__PURE__ */ $(async (i, e, t) => {
  var d, h;
  let n;
  const r = e.useHtmlLabels || ic((d = Qs()) == null ? void 0 : d.htmlLabels);
  t ? n = t : n = "node default";
  const s = i.insert("g").attr("class", n).attr("id", e.domId || e.id), o = s.insert("g").attr("class", "label").attr("style", Xu(e.labelStyle));
  let a;
  e.label === void 0 ? a = "" : a = typeof e.label == "string" ? e.label : e.label[0];
  const l = await Mw(o, Xg(vk(a), Qs()), {
    useHtmlLabels: r,
    width: e.width || ((h = Qs().flowchart) == null ? void 0 : h.wrappingWidth),
    // @ts-expect-error -- This is currently not used. Should this be `classes` instead?
    cssClasses: "markdown-node-label",
    style: e.labelStyle,
    addSvgBackground: !!e.icon || !!e.img
  });
  let c = l.getBBox();
  const u = ((e == null ? void 0 : e.padding) ?? 0) / 2;
  if (r) {
    const g = l.children[0], m = ls(l), _ = g.getElementsByTagName("img");
    if (_) {
      const v = a.replace(/<img[^>]*>/g, "").trim() === "";
      await Promise.all(
        [..._].map(
          (w) => new Promise((E) => {
            function L() {
              if (w.style.display = "flex", w.style.flexDirection = "column", v) {
                const T = Qs().fontSize ? Qs().fontSize : window.getComputedStyle(document.body).fontSize, D = 5, [N = HWe.fontSize] = qY(T), R = N * D + "px";
                w.style.minWidth = R, w.style.maxWidth = R;
              } else
                w.style.width = "100%";
              E(w);
            }
            $(L, "setupImage"), setTimeout(() => {
              w.complete && L();
            }), w.addEventListener("error", L), w.addEventListener("load", L);
          })
        )
      );
    }
    c = g.getBoundingClientRect(), m.attr("width", c.width), m.attr("height", c.height);
  }
  return r ? o.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")") : o.attr("transform", "translate(0, " + -c.height / 2 + ")"), e.centerLabel && o.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")"), o.insert("rect", ":first-child"), { shapeSvg: s, bbox: c, halfPadding: u, label: o };
}, "labelHelper"), Vne = /* @__PURE__ */ $(async (i, e, t) => {
  var l, c, u, d, h, g;
  const n = t.useHtmlLabels || ic((c = (l = Qs()) == null ? void 0 : l.flowchart) == null ? void 0 : c.htmlLabels), r = i.insert("g").attr("class", "label").attr("style", t.labelStyle || ""), s = await Mw(r, Xg(vk(e), Qs()), {
    useHtmlLabels: n,
    width: t.width || ((d = (u = Qs()) == null ? void 0 : u.flowchart) == null ? void 0 : d.wrappingWidth),
    style: t.labelStyle,
    addSvgBackground: !!t.icon || !!t.img
  });
  let o = s.getBBox();
  const a = t.padding / 2;
  if (ic((g = (h = Qs()) == null ? void 0 : h.flowchart) == null ? void 0 : g.htmlLabels)) {
    const m = s.children[0], _ = ls(s);
    o = m.getBoundingClientRect(), _.attr("width", o.width), _.attr("height", o.height);
  }
  return n ? r.attr("transform", "translate(" + -o.width / 2 + ", " + -o.height / 2 + ")") : r.attr("transform", "translate(0, " + -o.height / 2 + ")"), t.centerLabel && r.attr("transform", "translate(" + -o.width / 2 + ", " + -o.height / 2 + ")"), r.insert("rect", ":first-child"), { shapeSvg: i, bbox: o, halfPadding: a, label: r };
}, "insertLabel"), Yn = /* @__PURE__ */ $((i, e) => {
  const t = e.node().getBBox();
  i.width = t.width, i.height = t.height;
}, "updateNodeBounds"), bi = /* @__PURE__ */ $((i, e) => (i.look === "handDrawn" ? "rough-node" : "node") + " " + i.cssClasses + " " + (e || ""), "getNodeClasses");
function Hr(i) {
  const e = i.map((t, n) => `${n === 0 ? "M" : "L"}${t.x},${t.y}`);
  return e.push("Z"), e.join(" ");
}
$(Hr, "createPathFromPoints");
function yw(i, e, t, n, r, s) {
  const o = [], l = t - i, c = n - e, u = l / s, d = 2 * Math.PI / u, h = e + c / 2;
  for (let g = 0; g <= 50; g++) {
    const m = g / 50, _ = i + m * l, v = h + r * Math.sin(d * (_ - i));
    o.push({ x: _, y: v });
  }
  return o;
}
$(yw, "generateFullSineWavePoints");
function sB(i, e, t, n, r, s) {
  const o = [], a = r * Math.PI / 180, u = (s * Math.PI / 180 - a) / (n - 1);
  for (let d = 0; d < n; d++) {
    const h = a + d * u, g = i + t * Math.cos(h), m = e + t * Math.sin(h);
    o.push({ x: -g, y: -m });
  }
  return o;
}
$(sB, "generateCirclePoints");
var Len = /* @__PURE__ */ $((i, e) => {
  var t = i.x, n = i.y, r = e.x - t, s = e.y - n, o = i.width / 2, a = i.height / 2, l, c;
  return Math.abs(s) * o > Math.abs(r) * a ? (s < 0 && (a = -a), l = s === 0 ? 0 : a * r / s, c = a) : (r < 0 && (o = -o), l = o, c = r === 0 ? 0 : o * s / r), { x: t + l, y: n + c };
}, "intersectRect"), N2 = Len;
function L$e(i, e) {
  e && i.attr("style", e);
}
$(L$e, "applyStyle");
async function T$e(i) {
  const e = ls(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), t = e.append("xhtml:div"), n = Qs();
  let r = i.label;
  i.label && AA(i.label) && (r = await G0e(i.label.replace(T2.lineBreakRegex, `
`), n));
  const o = '<span class="' + (i.isNode ? "nodeLabel" : "edgeLabel") + '" ' + (i.labelStyle ? 'style="' + i.labelStyle + '"' : "") + // codeql [js/html-constructed-from-input] : false positive
  ">" + r + "</span>";
  return t.html(Xg(o, n)), L$e(t, i.labelStyle), t.style("display", "inline-block"), t.style("padding-right", "1px"), t.style("white-space", "nowrap"), t.attr("xmlns", "http://www.w3.org/1999/xhtml"), e.node();
}
$(T$e, "addHtmlLabel");
var Ten = /* @__PURE__ */ $(async (i, e, t, n) => {
  let r = i || "";
  if (typeof r == "object" && (r = r[0]), ic(Qs().flowchart.htmlLabels)) {
    r = r.replace(/\\n|\n/g, "<br />"), Ct.info("vertexText" + r);
    const s = {
      isNode: n,
      label: vk(r).replace(
        /fa[blrs]?:fa-[\w-]+/g,
        (a) => `<i class='${a.replace(":", " ")}'></i>`
      ),
      labelStyle: e && e.replace("fill:", "color:")
    };
    return await T$e(s);
  } else {
    const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
    s.setAttribute("style", e.replace("color:", "fill:"));
    let o = [];
    typeof r == "string" ? o = r.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(r) ? o = r : o = [];
    for (const a of o) {
      const l = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
      l.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), l.setAttribute("dy", "1em"), l.setAttribute("x", "0"), t ? l.setAttribute("class", "title-row") : l.setAttribute("class", "row"), l.textContent = a.trim(), s.appendChild(l);
    }
    return s;
  }
}, "createLabel"), Dx = Ten, Pw = /* @__PURE__ */ $((i, e, t, n, r) => [
  "M",
  i + r,
  e,
  // Move to the first point
  "H",
  i + t - r,
  // Draw horizontal line to the beginning of the right corner
  "A",
  r,
  r,
  0,
  0,
  1,
  i + t,
  e + r,
  // Draw arc to the right top corner
  "V",
  e + n - r,
  // Draw vertical line down to the beginning of the right bottom corner
  "A",
  r,
  r,
  0,
  0,
  1,
  i + t - r,
  e + n,
  // Draw arc to the right bottom corner
  "H",
  i + r,
  // Draw horizontal line to the beginning of the left bottom corner
  "A",
  r,
  r,
  0,
  0,
  1,
  i,
  e + n - r,
  // Draw arc to the left bottom corner
  "V",
  e + r,
  // Draw vertical line up to the beginning of the left top corner
  "A",
  r,
  r,
  0,
  0,
  1,
  i + r,
  e,
  // Draw arc to the left top corner
  "Z"
  // Close the path
].join(" "), "createRoundedRectPathD"), k$e = /* @__PURE__ */ $(async (i, e) => {
  Ct.info("Creating subgraph rect for ", e.id, e);
  const t = Qs(), { themeVariables: n, handDrawnSeed: r } = t, { clusterBkg: s, clusterBorder: o } = n, { labelStyles: a, nodeStyles: l, borderStyles: c, backgroundStyles: u } = Gn(e), d = i.insert("g").attr("class", "cluster " + e.cssClasses).attr("id", e.id).attr("data-look", e.look), h = ic(t.flowchart.htmlLabels), g = d.insert("g").attr("class", "cluster-label "), m = await Mw(g, e.label, {
    style: e.labelStyle,
    useHtmlLabels: h,
    isNode: !0
  });
  let _ = m.getBBox();
  if (ic(t.flowchart.htmlLabels)) {
    const R = m.children[0], M = ls(m);
    _ = R.getBoundingClientRect(), M.attr("width", _.width), M.attr("height", _.height);
  }
  const v = e.width <= _.width + e.padding ? _.width + e.padding : e.width;
  e.width <= _.width + e.padding ? e.diff = (v - e.width) / 2 - e.padding : e.diff = -e.padding;
  const w = e.height, E = e.x - v / 2, L = e.y - w / 2;
  Ct.trace("Data ", e, JSON.stringify(e));
  let T;
  if (e.look === "handDrawn") {
    const R = Un.svg(d), M = jn(e, {
      roughness: 0.7,
      fill: s,
      // fill: 'red',
      stroke: o,
      fillWeight: 3,
      seed: r
    }), B = R.path(Pw(E, L, v, w, 0), M);
    T = d.insert(() => (Ct.debug("Rough node insert CXC", B), B), ":first-child"), T.select("path:nth-child(2)").attr("style", c.join(";")), T.select("path").attr("style", u.join(";").replace("fill", "stroke"));
  } else
    T = d.insert("rect", ":first-child"), T.attr("style", l).attr("rx", e.rx).attr("ry", e.ry).attr("x", E).attr("y", L).attr("width", v).attr("height", w);
  const { subGraphTitleTopMargin: D } = _Ce(t);
  if (g.attr(
    "transform",
    // This puts the label on top of the box instead of inside it
    `translate(${e.x - _.width / 2}, ${e.y - e.height / 2 + D})`
  ), a) {
    const R = g.select("span");
    R && R.attr("style", a);
  }
  const N = T.node().getBBox();
  return e.offsetX = 0, e.width = N.width, e.height = N.height, e.offsetY = _.height - e.padding / 2, e.intersect = function(R) {
    return N2(e, R);
  }, { cluster: d, labelBBox: _ };
}, "rect"), ken = /* @__PURE__ */ $((i, e) => {
  const t = i.insert("g").attr("class", "note-cluster").attr("id", e.id), n = t.insert("rect", ":first-child"), r = 0 * e.padding, s = r / 2;
  n.attr("rx", e.rx).attr("ry", e.ry).attr("x", e.x - e.width / 2 - s).attr("y", e.y - e.height / 2 - s).attr("width", e.width + r).attr("height", e.height + r).attr("fill", "none");
  const o = n.node().getBBox();
  return e.width = o.width, e.height = o.height, e.intersect = function(a) {
    return N2(e, a);
  }, { cluster: t, labelBBox: { width: 0, height: 0 } };
}, "noteGroup"), Den = /* @__PURE__ */ $(async (i, e) => {
  const t = Qs(), { themeVariables: n, handDrawnSeed: r } = t, { altBackground: s, compositeBackground: o, compositeTitleBackground: a, nodeBorder: l } = n, c = i.insert("g").attr("class", e.cssClasses).attr("id", e.id).attr("data-id", e.id).attr("data-look", e.look), u = c.insert("g", ":first-child"), d = c.insert("g").attr("class", "cluster-label");
  let h = c.append("rect");
  const g = d.node().appendChild(await Dx(e.label, e.labelStyle, void 0, !0));
  let m = g.getBBox();
  if (ic(t.flowchart.htmlLabels)) {
    const B = g.children[0], H = ls(g);
    m = B.getBoundingClientRect(), H.attr("width", m.width), H.attr("height", m.height);
  }
  const _ = 0 * e.padding, v = _ / 2, w = (e.width <= m.width + e.padding ? m.width + e.padding : e.width) + _;
  e.width <= m.width + e.padding ? e.diff = (w - e.width) / 2 - e.padding : e.diff = -e.padding;
  const E = e.height + _, L = e.height + _ - m.height - 6, T = e.x - w / 2, D = e.y - E / 2;
  e.width = w;
  const N = e.y - e.height / 2 - v + m.height + 2;
  let R;
  if (e.look === "handDrawn") {
    const B = e.cssClasses.includes("statediagram-cluster-alt"), H = Un.svg(c), j = e.rx || e.ry ? H.path(Pw(T, D, w, E, 10), {
      roughness: 0.7,
      fill: a,
      fillStyle: "solid",
      stroke: l,
      seed: r
    }) : H.rectangle(T, D, w, E, { seed: r });
    R = c.insert(() => j, ":first-child");
    const K = H.rectangle(T, N, w, L, {
      fill: B ? s : o,
      fillStyle: B ? "hachure" : "solid",
      stroke: l,
      seed: r
    });
    R = c.insert(() => j, ":first-child"), h = c.insert(() => K);
  } else
    R = u.insert("rect", ":first-child"), R.attr("class", "outer").attr("x", T).attr("y", D).attr("width", w).attr("height", E).attr("data-look", e.look), h.attr("class", "inner").attr("x", T).attr("y", N).attr("width", w).attr("height", L);
  d.attr(
    "transform",
    `translate(${e.x - m.width / 2}, ${D + 1 - (ic(t.flowchart.htmlLabels) ? 0 : 3)})`
  );
  const M = R.node().getBBox();
  return e.height = M.height, e.offsetX = 0, e.offsetY = m.height - e.padding / 2, e.labelBBox = m, e.intersect = function(B) {
    return N2(e, B);
  }, { cluster: c, labelBBox: m };
}, "roundedWithTitle"), Ien = /* @__PURE__ */ $(async (i, e) => {
  Ct.info("Creating subgraph rect for ", e.id, e);
  const t = Qs(), { themeVariables: n, handDrawnSeed: r } = t, { clusterBkg: s, clusterBorder: o } = n, { labelStyles: a, nodeStyles: l, borderStyles: c, backgroundStyles: u } = Gn(e), d = i.insert("g").attr("class", "cluster " + e.cssClasses).attr("id", e.id).attr("data-look", e.look), h = ic(t.flowchart.htmlLabels), g = d.insert("g").attr("class", "cluster-label "), m = await Mw(g, e.label, {
    style: e.labelStyle,
    useHtmlLabels: h,
    isNode: !0,
    width: e.width
  });
  let _ = m.getBBox();
  if (ic(t.flowchart.htmlLabels)) {
    const R = m.children[0], M = ls(m);
    _ = R.getBoundingClientRect(), M.attr("width", _.width), M.attr("height", _.height);
  }
  const v = e.width <= _.width + e.padding ? _.width + e.padding : e.width;
  e.width <= _.width + e.padding ? e.diff = (v - e.width) / 2 - e.padding : e.diff = -e.padding;
  const w = e.height, E = e.x - v / 2, L = e.y - w / 2;
  Ct.trace("Data ", e, JSON.stringify(e));
  let T;
  if (e.look === "handDrawn") {
    const R = Un.svg(d), M = jn(e, {
      roughness: 0.7,
      fill: s,
      // fill: 'red',
      stroke: o,
      fillWeight: 4,
      seed: r
    }), B = R.path(Pw(E, L, v, w, e.rx), M);
    T = d.insert(() => (Ct.debug("Rough node insert CXC", B), B), ":first-child"), T.select("path:nth-child(2)").attr("style", c.join(";")), T.select("path").attr("style", u.join(";").replace("fill", "stroke"));
  } else
    T = d.insert("rect", ":first-child"), T.attr("style", l).attr("rx", e.rx).attr("ry", e.ry).attr("x", E).attr("y", L).attr("width", v).attr("height", w);
  const { subGraphTitleTopMargin: D } = _Ce(t);
  if (g.attr(
    "transform",
    // This puts the label on top of the box instead of inside it
    `translate(${e.x - _.width / 2}, ${e.y - e.height / 2 + D})`
  ), a) {
    const R = g.select("span");
    R && R.attr("style", a);
  }
  const N = T.node().getBBox();
  return e.offsetX = 0, e.width = N.width, e.height = N.height, e.offsetY = _.height - e.padding / 2, e.intersect = function(R) {
    return N2(e, R);
  }, { cluster: d, labelBBox: _ };
}, "kanbanSection"), Nen = /* @__PURE__ */ $((i, e) => {
  const t = Qs(), { themeVariables: n, handDrawnSeed: r } = t, { nodeBorder: s } = n, o = i.insert("g").attr("class", e.cssClasses).attr("id", e.id).attr("data-look", e.look), a = o.insert("g", ":first-child"), l = 0 * e.padding, c = e.width + l;
  e.diff = -e.padding;
  const u = e.height + l, d = e.x - c / 2, h = e.y - u / 2;
  e.width = c;
  let g;
  if (e.look === "handDrawn") {
    const v = Un.svg(o).rectangle(d, h, c, u, {
      fill: "lightgrey",
      roughness: 0.5,
      strokeLineDash: [5],
      stroke: s,
      seed: r
    });
    g = o.insert(() => v, ":first-child");
  } else
    g = a.insert("rect", ":first-child"), g.attr("class", "divider").attr("x", d).attr("y", h).attr("width", c).attr("height", u).attr("data-look", e.look);
  const m = g.node().getBBox();
  return e.height = m.height, e.offsetX = 0, e.offsetY = 0, e.intersect = function(_) {
    return N2(e, _);
  }, { cluster: o, labelBBox: {} };
}, "divider"), Ren = k$e, Aen = {
  rect: k$e,
  squareRect: Ren,
  roundedWithTitle: Den,
  noteGroup: ken,
  divider: Nen,
  kanbanSection: Ien
}, D$e = /* @__PURE__ */ new Map(), Oen = /* @__PURE__ */ $(async (i, e) => {
  const t = e.shape || "rect", n = await Aen[t](i, e);
  return D$e.set(e.id, n), n;
}, "insertCluster"), ycn = /* @__PURE__ */ $(() => {
  D$e = /* @__PURE__ */ new Map();
}, "clear");
function I$e(i, e) {
  return i.intersect(e);
}
$(I$e, "intersectNode");
var Men = I$e;
function N$e(i, e, t, n) {
  var r = i.x, s = i.y, o = r - n.x, a = s - n.y, l = Math.sqrt(e * e * a * a + t * t * o * o), c = Math.abs(e * t * o / l);
  n.x < r && (c = -c);
  var u = Math.abs(e * t * a / l);
  return n.y < s && (u = -u), { x: r + c, y: s + u };
}
$(N$e, "intersectEllipse");
var R$e = N$e;
function A$e(i, e, t) {
  return R$e(i, e, e, t);
}
$(A$e, "intersectCircle");
var Pen = A$e;
function O$e(i, e, t, n) {
  {
    const r = e.y - i.y, s = i.x - e.x, o = e.x * i.y - i.x * e.y, a = r * t.x + s * t.y + o, l = r * n.x + s * n.y + o, c = 1e-6;
    if (a !== 0 && l !== 0 && dhe(a, l))
      return;
    const u = n.y - t.y, d = t.x - n.x, h = n.x * t.y - t.x * n.y, g = u * i.x + d * i.y + h, m = u * e.x + d * e.y + h;
    if (Math.abs(g) < c && Math.abs(m) < c && dhe(g, m))
      return;
    const _ = r * d - u * s;
    if (_ === 0)
      return;
    const v = Math.abs(_ / 2);
    let w = s * h - d * o;
    const E = w < 0 ? (w - v) / _ : (w + v) / _;
    w = u * o - r * h;
    const L = w < 0 ? (w - v) / _ : (w + v) / _;
    return { x: E, y: L };
  }
}
$(O$e, "intersectLine");
function dhe(i, e) {
  return i * e > 0;
}
$(dhe, "sameSign");
var Fen = O$e;
function M$e(i, e, t) {
  let n = i.x, r = i.y, s = [], o = Number.POSITIVE_INFINITY, a = Number.POSITIVE_INFINITY;
  typeof e.forEach == "function" ? e.forEach(function(u) {
    o = Math.min(o, u.x), a = Math.min(a, u.y);
  }) : (o = Math.min(o, e.x), a = Math.min(a, e.y));
  let l = n - i.width / 2 - o, c = r - i.height / 2 - a;
  for (let u = 0; u < e.length; u++) {
    let d = e[u], h = e[u < e.length - 1 ? u + 1 : 0], g = Fen(
      i,
      t,
      { x: l + d.x, y: c + d.y },
      { x: l + h.x, y: c + h.y }
    );
    g && s.push(g);
  }
  return s.length ? (s.length > 1 && s.sort(function(u, d) {
    let h = u.x - t.x, g = u.y - t.y, m = Math.sqrt(h * h + g * g), _ = d.x - t.x, v = d.y - t.y, w = Math.sqrt(_ * _ + v * v);
    return m < w ? -1 : m === w ? 0 : 1;
  }), s[0]) : i;
}
$(M$e, "intersectPolygon");
var Ben = M$e, Sn = {
  node: Men,
  circle: Pen,
  ellipse: R$e,
  polygon: Ben,
  rect: N2
};
function P$e(i, e) {
  const { labelStyles: t } = Gn(e);
  e.labelStyle = t;
  const n = bi(e);
  let r = n;
  n || (r = "anchor");
  const s = i.insert("g").attr("class", r).attr("id", e.domId || e.id), o = 1, { cssStyles: a } = e, l = Un.svg(s), c = jn(e, { fill: "black", stroke: "none", fillStyle: "solid" });
  e.look !== "handDrawn" && (c.roughness = 0);
  const u = l.circle(0, 0, o * 2, c), d = s.insert(() => u, ":first-child");
  return d.attr("class", "anchor").attr("style", Xu(a)), Yn(e, d), e.intersect = function(h) {
    return Ct.info("Circle intersect", e, o, h), Sn.circle(e, o, h);
  }, s;
}
$(P$e, "anchor");
function hhe(i, e, t, n, r, s, o) {
  const l = (i + t) / 2, c = (e + n) / 2, u = Math.atan2(n - e, t - i), d = (t - i) / 2, h = (n - e) / 2, g = d / r, m = h / s, _ = Math.sqrt(g ** 2 + m ** 2);
  if (_ > 1)
    throw new Error("The given radii are too small to create an arc between the points.");
  const v = Math.sqrt(1 - _ ** 2), w = l + v * s * Math.sin(u) * (o ? -1 : 1), E = c - v * r * Math.cos(u) * (o ? -1 : 1), L = Math.atan2((e - E) / s, (i - w) / r);
  let D = Math.atan2((n - E) / s, (t - w) / r) - L;
  o && D < 0 && (D += 2 * Math.PI), !o && D > 0 && (D -= 2 * Math.PI);
  const N = [];
  for (let R = 0; R < 20; R++) {
    const M = R / 19, B = L + M * D, H = w + r * Math.cos(B), j = E + s * Math.sin(B);
    N.push({ x: H, y: j });
  }
  return N;
}
$(hhe, "generateArcPoints");
async function F$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = s.width + e.padding + 20, a = s.height + e.padding, l = a / 2, c = l / (2.5 + a / 50), { cssStyles: u } = e, d = [
    { x: o / 2, y: -a / 2 },
    { x: -o / 2, y: -a / 2 },
    ...hhe(-o / 2, -a / 2, -o / 2, a / 2, c, l, !1),
    { x: o / 2, y: a / 2 },
    ...hhe(o / 2, a / 2, o / 2, -a / 2, c, l, !0)
  ], h = Un.svg(r), g = jn(e, {});
  e.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
  const m = Hr(d), _ = h.path(m, g), v = r.insert(() => _, ":first-child");
  return v.attr("class", "basic label-container"), u && e.look !== "handDrawn" && v.selectAll("path").attr("style", u), n && e.look !== "handDrawn" && v.selectAll("path").attr("style", n), v.attr("transform", `translate(${c / 2}, 0)`), Yn(e, v), e.intersect = function(w) {
    return Sn.polygon(e, d, w);
  }, r;
}
$(F$e, "bowTieRect");
function Fw(i, e, t, n) {
  return i.insert("polygon", ":first-child").attr(
    "points",
    n.map(function(r) {
      return r.x + "," + r.y;
    }).join(" ")
  ).attr("class", "label-container").attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
}
$(Fw, "insertPolygonShape");
async function B$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = s.height + e.padding, a = 12, l = s.width + e.padding + a, c = 0, u = l, d = -o, h = 0, g = [
    { x: c + a, y: d },
    { x: u, y: d },
    { x: u, y: h },
    { x: c, y: h },
    { x: c, y: d + a },
    { x: c + a, y: d }
  ];
  let m;
  const { cssStyles: _ } = e;
  if (e.look === "handDrawn") {
    const v = Un.svg(r), w = jn(e, {}), E = Hr(g), L = v.path(E, w);
    m = r.insert(() => L, ":first-child").attr("transform", `translate(${-l / 2}, ${o / 2})`), _ && m.attr("style", _);
  } else
    m = Fw(r, l, o, g);
  return n && m.attr("style", n), Yn(e, m), e.intersect = function(v) {
    return Sn.polygon(e, g, v);
  }, r;
}
$(B$e, "card");
function H$e(i, e) {
  const { nodeStyles: t } = Gn(e);
  e.label = "";
  const n = i.insert("g").attr("class", bi(e)).attr("id", e.domId ?? e.id), { cssStyles: r } = e, s = Math.max(28, e.width ?? 0), o = [
    { x: 0, y: s / 2 },
    { x: s / 2, y: 0 },
    { x: 0, y: -s / 2 },
    { x: -s / 2, y: 0 }
  ], a = Un.svg(n), l = jn(e, {});
  e.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
  const c = Hr(o), u = a.path(c, l), d = n.insert(() => u, ":first-child");
  return r && e.look !== "handDrawn" && d.selectAll("path").attr("style", r), t && e.look !== "handDrawn" && d.selectAll("path").attr("style", t), e.width = 28, e.height = 28, e.intersect = function(h) {
    return Sn.polygon(e, o, h);
  }, n;
}
$(H$e, "choice");
async function WCe(i, e, t) {
  const { labelStyles: n, nodeStyles: r } = Gn(e);
  e.labelStyle = n;
  const { shapeSvg: s, bbox: o, halfPadding: a } = await ki(i, e, bi(e)), l = (t == null ? void 0 : t.padding) ?? a, c = o.width / 2 + l;
  let u;
  const { cssStyles: d } = e;
  if (e.look === "handDrawn") {
    const h = Un.svg(s), g = jn(e, {}), m = h.circle(0, 0, c * 2, g);
    u = s.insert(() => m, ":first-child"), u.attr("class", "basic label-container").attr("style", Xu(d));
  } else
    u = s.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", r).attr("r", c).attr("cx", 0).attr("cy", 0);
  return Yn(e, u), e.calcIntersect = function(h, g) {
    const m = h.width / 2;
    return Sn.circle(h, m, g);
  }, e.intersect = function(h) {
    return Ct.info("Circle intersect", e, c, h), Sn.circle(e, c, h);
  }, s;
}
$(WCe, "circle");
function W$e(i) {
  const e = Math.cos(Math.PI / 4), t = Math.sin(Math.PI / 4), n = i * 2, r = { x: n / 2 * e, y: n / 2 * t }, s = { x: -(n / 2) * e, y: n / 2 * t }, o = { x: -(n / 2) * e, y: -(n / 2) * t }, a = { x: n / 2 * e, y: -(n / 2) * t };
  return `M ${s.x},${s.y} L ${a.x},${a.y}
                   M ${r.x},${r.y} L ${o.x},${o.y}`;
}
$(W$e, "createLine");
function V$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t, e.label = "";
  const r = i.insert("g").attr("class", bi(e)).attr("id", e.domId ?? e.id), s = Math.max(30, (e == null ? void 0 : e.width) ?? 0), { cssStyles: o } = e, a = Un.svg(r), l = jn(e, {});
  e.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
  const c = a.circle(0, 0, s * 2, l), u = W$e(s), d = a.path(u, l), h = r.insert(() => c, ":first-child");
  return h.insert(() => d), o && e.look !== "handDrawn" && h.selectAll("path").attr("style", o), n && e.look !== "handDrawn" && h.selectAll("path").attr("style", n), Yn(e, h), e.intersect = function(g) {
    return Ct.info("crossedCircle intersect", e, { radius: s, point: g }), Sn.circle(e, s, g);
  }, r;
}
$(V$e, "crossedCircle");
function Gv(i, e, t, n = 100, r = 0, s = 180) {
  const o = [], a = r * Math.PI / 180, u = (s * Math.PI / 180 - a) / (n - 1);
  for (let d = 0; d < n; d++) {
    const h = a + d * u, g = i + t * Math.cos(h), m = e + t * Math.sin(h);
    o.push({ x: -g, y: -m });
  }
  return o;
}
$(Gv, "generateCirclePoints");
async function U$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = s.width + (e.padding ?? 0), l = s.height + (e.padding ?? 0), c = Math.max(5, l * 0.1), { cssStyles: u } = e, d = [
    ...Gv(a / 2, -l / 2, c, 30, -90, 0),
    { x: -a / 2 - c, y: c },
    ...Gv(a / 2 + c * 2, -c, c, 20, -180, -270),
    ...Gv(a / 2 + c * 2, c, c, 20, -90, -180),
    { x: -a / 2 - c, y: -l / 2 },
    ...Gv(a / 2, l / 2, c, 20, 0, 90)
  ], h = [
    { x: a / 2, y: -l / 2 - c },
    { x: -a / 2, y: -l / 2 - c },
    ...Gv(a / 2, -l / 2, c, 20, -90, 0),
    { x: -a / 2 - c, y: -c },
    ...Gv(a / 2 + a * 0.1, -c, c, 20, -180, -270),
    ...Gv(a / 2 + a * 0.1, c, c, 20, -90, -180),
    { x: -a / 2 - c, y: l / 2 },
    ...Gv(a / 2, l / 2, c, 20, 0, 90),
    { x: -a / 2, y: l / 2 + c },
    { x: a / 2, y: l / 2 + c }
  ], g = Un.svg(r), m = jn(e, { fill: "none" });
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const v = Hr(d).replace("Z", ""), w = g.path(v, m), E = Hr(h), L = g.path(E, { ...m }), T = r.insert("g", ":first-child");
  return T.insert(() => L, ":first-child").attr("stroke-opacity", 0), T.insert(() => w, ":first-child"), T.attr("class", "text"), u && e.look !== "handDrawn" && T.selectAll("path").attr("style", u), n && e.look !== "handDrawn" && T.selectAll("path").attr("style", n), T.attr("transform", `translate(${c}, 0)`), o.attr(
    "transform",
    `translate(${-a / 2 + c - (s.x - (s.left ?? 0))},${-l / 2 + (e.padding ?? 0) / 2 - (s.y - (s.top ?? 0))})`
  ), Yn(e, T), e.intersect = function(D) {
    return Sn.polygon(e, h, D);
  }, r;
}
$(U$e, "curlyBraceLeft");
function qv(i, e, t, n = 100, r = 0, s = 180) {
  const o = [], a = r * Math.PI / 180, u = (s * Math.PI / 180 - a) / (n - 1);
  for (let d = 0; d < n; d++) {
    const h = a + d * u, g = i + t * Math.cos(h), m = e + t * Math.sin(h);
    o.push({ x: g, y: m });
  }
  return o;
}
$(qv, "generateCirclePoints");
async function z$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = s.width + (e.padding ?? 0), l = s.height + (e.padding ?? 0), c = Math.max(5, l * 0.1), { cssStyles: u } = e, d = [
    ...qv(a / 2, -l / 2, c, 20, -90, 0),
    { x: a / 2 + c, y: -c },
    ...qv(a / 2 + c * 2, -c, c, 20, -180, -270),
    ...qv(a / 2 + c * 2, c, c, 20, -90, -180),
    { x: a / 2 + c, y: l / 2 },
    ...qv(a / 2, l / 2, c, 20, 0, 90)
  ], h = [
    { x: -a / 2, y: -l / 2 - c },
    { x: a / 2, y: -l / 2 - c },
    ...qv(a / 2, -l / 2, c, 20, -90, 0),
    { x: a / 2 + c, y: -c },
    ...qv(a / 2 + c * 2, -c, c, 20, -180, -270),
    ...qv(a / 2 + c * 2, c, c, 20, -90, -180),
    { x: a / 2 + c, y: l / 2 },
    ...qv(a / 2, l / 2, c, 20, 0, 90),
    { x: a / 2, y: l / 2 + c },
    { x: -a / 2, y: l / 2 + c }
  ], g = Un.svg(r), m = jn(e, { fill: "none" });
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const v = Hr(d).replace("Z", ""), w = g.path(v, m), E = Hr(h), L = g.path(E, { ...m }), T = r.insert("g", ":first-child");
  return T.insert(() => L, ":first-child").attr("stroke-opacity", 0), T.insert(() => w, ":first-child"), T.attr("class", "text"), u && e.look !== "handDrawn" && T.selectAll("path").attr("style", u), n && e.look !== "handDrawn" && T.selectAll("path").attr("style", n), T.attr("transform", `translate(${-c}, 0)`), o.attr(
    "transform",
    `translate(${-a / 2 + (e.padding ?? 0) / 2 - (s.x - (s.left ?? 0))},${-l / 2 + (e.padding ?? 0) / 2 - (s.y - (s.top ?? 0))})`
  ), Yn(e, T), e.intersect = function(D) {
    return Sn.polygon(e, h, D);
  }, r;
}
$(z$e, "curlyBraceRight");
function Xc(i, e, t, n = 100, r = 0, s = 180) {
  const o = [], a = r * Math.PI / 180, u = (s * Math.PI / 180 - a) / (n - 1);
  for (let d = 0; d < n; d++) {
    const h = a + d * u, g = i + t * Math.cos(h), m = e + t * Math.sin(h);
    o.push({ x: -g, y: -m });
  }
  return o;
}
$(Xc, "generateCirclePoints");
async function $$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = s.width + (e.padding ?? 0), l = s.height + (e.padding ?? 0), c = Math.max(5, l * 0.1), { cssStyles: u } = e, d = [
    ...Xc(a / 2, -l / 2, c, 30, -90, 0),
    { x: -a / 2 - c, y: c },
    ...Xc(a / 2 + c * 2, -c, c, 20, -180, -270),
    ...Xc(a / 2 + c * 2, c, c, 20, -90, -180),
    { x: -a / 2 - c, y: -l / 2 },
    ...Xc(a / 2, l / 2, c, 20, 0, 90)
  ], h = [
    ...Xc(-a / 2 + c + c / 2, -l / 2, c, 20, -90, -180),
    { x: a / 2 - c / 2, y: c },
    ...Xc(-a / 2 - c / 2, -c, c, 20, 0, 90),
    ...Xc(-a / 2 - c / 2, c, c, 20, -90, 0),
    { x: a / 2 - c / 2, y: -c },
    ...Xc(-a / 2 + c + c / 2, l / 2, c, 30, -180, -270)
  ], g = [
    { x: a / 2, y: -l / 2 - c },
    { x: -a / 2, y: -l / 2 - c },
    ...Xc(a / 2, -l / 2, c, 20, -90, 0),
    { x: -a / 2 - c, y: -c },
    ...Xc(a / 2 + c * 2, -c, c, 20, -180, -270),
    ...Xc(a / 2 + c * 2, c, c, 20, -90, -180),
    { x: -a / 2 - c, y: l / 2 },
    ...Xc(a / 2, l / 2, c, 20, 0, 90),
    { x: -a / 2, y: l / 2 + c },
    { x: a / 2 - c - c / 2, y: l / 2 + c },
    ...Xc(-a / 2 + c + c / 2, -l / 2, c, 20, -90, -180),
    { x: a / 2 - c / 2, y: c },
    ...Xc(-a / 2 - c / 2, -c, c, 20, 0, 90),
    ...Xc(-a / 2 - c / 2, c, c, 20, -90, 0),
    { x: a / 2 - c / 2, y: -c },
    ...Xc(-a / 2 + c + c / 2, l / 2, c, 30, -180, -270)
  ], m = Un.svg(r), _ = jn(e, { fill: "none" });
  e.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
  const w = Hr(d).replace("Z", ""), E = m.path(w, _), T = Hr(h).replace("Z", ""), D = m.path(T, _), N = Hr(g), R = m.path(N, { ..._ }), M = r.insert("g", ":first-child");
  return M.insert(() => R, ":first-child").attr("stroke-opacity", 0), M.insert(() => E, ":first-child"), M.insert(() => D, ":first-child"), M.attr("class", "text"), u && e.look !== "handDrawn" && M.selectAll("path").attr("style", u), n && e.look !== "handDrawn" && M.selectAll("path").attr("style", n), M.attr("transform", `translate(${c - c / 4}, 0)`), o.attr(
    "transform",
    `translate(${-a / 2 + (e.padding ?? 0) / 2 - (s.x - (s.left ?? 0))},${-l / 2 + (e.padding ?? 0) / 2 - (s.y - (s.top ?? 0))})`
  ), Yn(e, M), e.intersect = function(B) {
    return Sn.polygon(e, g, B);
  }, r;
}
$($$e, "curlyBraces");
async function j$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = 80, a = 20, l = Math.max(o, (s.width + (e.padding ?? 0) * 2) * 1.25, (e == null ? void 0 : e.width) ?? 0), c = Math.max(a, s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), u = c / 2, { cssStyles: d } = e, h = Un.svg(r), g = jn(e, {});
  e.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
  const m = l, _ = c, v = m - u, w = _ / 4, E = [
    { x: v, y: 0 },
    { x: w, y: 0 },
    { x: 0, y: _ / 2 },
    { x: w, y: _ },
    { x: v, y: _ },
    ...sB(-v, -_ / 2, u, 50, 270, 90)
  ], L = Hr(E), T = h.path(L, g), D = r.insert(() => T, ":first-child");
  return D.attr("class", "basic label-container"), d && e.look !== "handDrawn" && D.selectChildren("path").attr("style", d), n && e.look !== "handDrawn" && D.selectChildren("path").attr("style", n), D.attr("transform", `translate(${-l / 2}, ${-c / 2})`), Yn(e, D), e.intersect = function(N) {
    return Sn.polygon(e, E, N);
  }, r;
}
$(j$e, "curvedTrapezoid");
var Hen = /* @__PURE__ */ $((i, e, t, n, r, s) => [
  `M${i},${e + s}`,
  `a${r},${s} 0,0,0 ${t},0`,
  `a${r},${s} 0,0,0 ${-t},0`,
  `l0,${n}`,
  `a${r},${s} 0,0,0 ${t},0`,
  `l0,${-n}`
].join(" "), "createCylinderPathD"), Wen = /* @__PURE__ */ $((i, e, t, n, r, s) => [
  `M${i},${e + s}`,
  `M${i + t},${e + s}`,
  `a${r},${s} 0,0,0 ${-t},0`,
  `l0,${n}`,
  `a${r},${s} 0,0,0 ${t},0`,
  `l0,${-n}`
].join(" "), "createOuterCylinderPathD"), Ven = /* @__PURE__ */ $((i, e, t, n, r, s) => [`M${i - t / 2},${-n / 2}`, `a${r},${s} 0,0,0 ${t},0`].join(" "), "createInnerCylinderPathD");
async function G$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + e.padding, e.width ?? 0), l = a / 2, c = l / (2.5 + a / 50), u = Math.max(s.height + c + e.padding, e.height ?? 0);
  let d;
  const { cssStyles: h } = e;
  if (e.look === "handDrawn") {
    const g = Un.svg(r), m = Wen(0, 0, a, u, l, c), _ = Ven(0, c, a, u, l, c), v = g.path(m, jn(e, {})), w = g.path(_, jn(e, { fill: "none" }));
    d = r.insert(() => w, ":first-child"), d = r.insert(() => v, ":first-child"), d.attr("class", "basic label-container"), h && d.attr("style", h);
  } else {
    const g = Hen(0, 0, a, u, l, c);
    d = r.insert("path", ":first-child").attr("d", g).attr("class", "basic label-container").attr("style", Xu(h)).attr("style", n);
  }
  return d.attr("label-offset-y", c), d.attr("transform", `translate(${-a / 2}, ${-(u / 2 + c)})`), Yn(e, d), o.attr(
    "transform",
    `translate(${-(s.width / 2) - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + (e.padding ?? 0) / 1.5 - (s.y - (s.top ?? 0))})`
  ), e.intersect = function(g) {
    const m = Sn.rect(e, g), _ = m.x - (e.x ?? 0);
    if (l != 0 && (Math.abs(_) < (e.width ?? 0) / 2 || Math.abs(_) == (e.width ?? 0) / 2 && Math.abs(m.y - (e.y ?? 0)) > (e.height ?? 0) / 2 - c)) {
      let v = c * c * (1 - _ * _ / (l * l));
      v > 0 && (v = Math.sqrt(v)), v = c - v, g.y - (e.y ?? 0) > 0 && (v = -v), m.y += v;
    }
    return m;
  }, r;
}
$(G$e, "cylinder");
async function q$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = s.width + e.padding, l = s.height + e.padding, c = l * 0.2, u = -a / 2, d = -l / 2 - c / 2, { cssStyles: h } = e, g = Un.svg(r), m = jn(e, {});
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const _ = [
    { x: u, y: d + c },
    { x: -u, y: d + c },
    { x: -u, y: -d },
    { x: u, y: -d },
    { x: u, y: d },
    { x: -u, y: d },
    { x: -u, y: d + c }
  ], v = g.polygon(
    _.map((E) => [E.x, E.y]),
    m
  ), w = r.insert(() => v, ":first-child");
  return w.attr("class", "basic label-container"), h && e.look !== "handDrawn" && w.selectAll("path").attr("style", h), n && e.look !== "handDrawn" && w.selectAll("path").attr("style", n), o.attr(
    "transform",
    `translate(${u + (e.padding ?? 0) / 2 - (s.x - (s.left ?? 0))}, ${d + c + (e.padding ?? 0) / 2 - (s.y - (s.top ?? 0))})`
  ), Yn(e, w), e.intersect = function(E) {
    return Sn.rect(e, E);
  }, r;
}
$(q$e, "dividedRectangle");
async function K$e(i, e) {
  var h, g;
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, halfPadding: o } = await ki(i, e, bi(e)), l = s.width / 2 + o + 5, c = s.width / 2 + o;
  let u;
  const { cssStyles: d } = e;
  if (e.look === "handDrawn") {
    const m = Un.svg(r), _ = jn(e, { roughness: 0.2, strokeWidth: 2.5 }), v = jn(e, { roughness: 0.2, strokeWidth: 1.5 }), w = m.circle(0, 0, l * 2, _), E = m.circle(0, 0, c * 2, v);
    u = r.insert("g", ":first-child"), u.attr("class", Xu(e.cssClasses)).attr("style", Xu(d)), (h = u.node()) == null || h.appendChild(w), (g = u.node()) == null || g.appendChild(E);
  } else {
    u = r.insert("g", ":first-child");
    const m = u.insert("circle", ":first-child"), _ = u.insert("circle");
    u.attr("class", "basic label-container").attr("style", n), m.attr("class", "outer-circle").attr("style", n).attr("r", l).attr("cx", 0).attr("cy", 0), _.attr("class", "inner-circle").attr("style", n).attr("r", c).attr("cx", 0).attr("cy", 0);
  }
  return Yn(e, u), e.intersect = function(m) {
    return Ct.info("DoubleCircle intersect", e, l, m), Sn.circle(e, l, m);
  }, r;
}
$(K$e, "doublecircle");
function Y$e(i, e, { config: { themeVariables: t } }) {
  const { labelStyles: n, nodeStyles: r } = Gn(e);
  e.label = "", e.labelStyle = n;
  const s = i.insert("g").attr("class", bi(e)).attr("id", e.domId ?? e.id), o = 7, { cssStyles: a } = e, l = Un.svg(s), { nodeBorder: c } = t, u = jn(e, { fillStyle: "solid" });
  e.look !== "handDrawn" && (u.roughness = 0);
  const d = l.circle(0, 0, o * 2, u), h = s.insert(() => d, ":first-child");
  return h.selectAll("path").attr("style", `fill: ${c} !important;`), a && a.length > 0 && e.look !== "handDrawn" && h.selectAll("path").attr("style", a), r && e.look !== "handDrawn" && h.selectAll("path").attr("style", r), Yn(e, h), e.intersect = function(g) {
    return Ct.info("filledCircle intersect", e, { radius: o, point: g }), Sn.circle(e, o, g);
  }, s;
}
$(Y$e, "filledCircle");
async function X$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = s.width + (e.padding ?? 0), l = a + s.height, c = a + s.height, u = [
    { x: 0, y: -l },
    { x: c, y: -l },
    { x: c / 2, y: 0 }
  ], { cssStyles: d } = e, h = Un.svg(r), g = jn(e, {});
  e.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
  const m = Hr(u), _ = h.path(m, g), v = r.insert(() => _, ":first-child").attr("transform", `translate(${-l / 2}, ${l / 2})`);
  return d && e.look !== "handDrawn" && v.selectChildren("path").attr("style", d), n && e.look !== "handDrawn" && v.selectChildren("path").attr("style", n), e.width = a, e.height = l, Yn(e, v), o.attr(
    "transform",
    `translate(${-s.width / 2 - (s.x - (s.left ?? 0))}, ${-l / 2 + (e.padding ?? 0) / 2 + (s.y - (s.top ?? 0))})`
  ), e.intersect = function(w) {
    return Ct.info("Triangle intersect", e, u, w), Sn.polygon(e, u, w);
  }, r;
}
$(X$e, "flippedTriangle");
function Z$e(i, e, { dir: t, config: { state: n, themeVariables: r } }) {
  const { nodeStyles: s } = Gn(e);
  e.label = "";
  const o = i.insert("g").attr("class", bi(e)).attr("id", e.domId ?? e.id), { cssStyles: a } = e;
  let l = Math.max(70, (e == null ? void 0 : e.width) ?? 0), c = Math.max(10, (e == null ? void 0 : e.height) ?? 0);
  t === "LR" && (l = Math.max(10, (e == null ? void 0 : e.width) ?? 0), c = Math.max(70, (e == null ? void 0 : e.height) ?? 0));
  const u = -1 * l / 2, d = -1 * c / 2, h = Un.svg(o), g = jn(e, {
    stroke: r.lineColor,
    fill: r.lineColor
  });
  e.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
  const m = h.rectangle(u, d, l, c, g), _ = o.insert(() => m, ":first-child");
  a && e.look !== "handDrawn" && _.selectAll("path").attr("style", a), s && e.look !== "handDrawn" && _.selectAll("path").attr("style", s), Yn(e, _);
  const v = (n == null ? void 0 : n.padding) ?? 0;
  return e.width && e.height && (e.width += v / 2 || 0, e.height += v / 2 || 0), e.intersect = function(w) {
    return Sn.rect(e, w);
  }, o;
}
$(Z$e, "forkJoin");
async function Q$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const r = 80, s = 50, { shapeSvg: o, bbox: a } = await ki(i, e, bi(e)), l = Math.max(r, a.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), c = Math.max(s, a.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), u = c / 2, { cssStyles: d } = e, h = Un.svg(o), g = jn(e, {});
  e.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
  const m = [
    { x: -l / 2, y: -c / 2 },
    { x: l / 2 - u, y: -c / 2 },
    ...sB(-l / 2 + u, 0, u, 50, 90, 270),
    { x: l / 2 - u, y: c / 2 },
    { x: -l / 2, y: c / 2 }
  ], _ = Hr(m), v = h.path(_, g), w = o.insert(() => v, ":first-child");
  return w.attr("class", "basic label-container"), d && e.look !== "handDrawn" && w.selectChildren("path").attr("style", d), n && e.look !== "handDrawn" && w.selectChildren("path").attr("style", n), Yn(e, w), e.intersect = function(E) {
    return Ct.info("Pill intersect", e, { radius: u, point: E }), Sn.polygon(e, m, E);
  }, o;
}
$(Q$e, "halfRoundedRectangle");
async function J$e(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = s.height + (e.padding ?? 0), a = s.width + (e.padding ?? 0) * 2.5, { cssStyles: l } = e, c = Un.svg(r), u = jn(e, {});
  e.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
  let d = a / 2;
  const h = d / 6;
  d = d + h;
  const g = o / 2, m = g / 2, _ = d - m, v = [
    { x: -_, y: -g },
    { x: 0, y: -g },
    { x: _, y: -g },
    { x: d, y: 0 },
    { x: _, y: g },
    { x: 0, y: g },
    { x: -_, y: g },
    { x: -d, y: 0 }
  ], w = Hr(v), E = c.path(w, u), L = r.insert(() => E, ":first-child");
  return L.attr("class", "basic label-container"), l && e.look !== "handDrawn" && L.selectChildren("path").attr("style", l), n && e.look !== "handDrawn" && L.selectChildren("path").attr("style", n), e.width = a, e.height = o, Yn(e, L), e.intersect = function(T) {
    return Sn.polygon(e, v, T);
  }, r;
}
$(J$e, "hexagon");
async function eje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.label = "", e.labelStyle = t;
  const { shapeSvg: r } = await ki(i, e, bi(e)), s = Math.max(30, (e == null ? void 0 : e.width) ?? 0), o = Math.max(30, (e == null ? void 0 : e.height) ?? 0), { cssStyles: a } = e, l = Un.svg(r), c = jn(e, {});
  e.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
  const u = [
    { x: 0, y: 0 },
    { x: s, y: 0 },
    { x: 0, y: o },
    { x: s, y: o }
  ], d = Hr(u), h = l.path(d, c), g = r.insert(() => h, ":first-child");
  return g.attr("class", "basic label-container"), a && e.look !== "handDrawn" && g.selectChildren("path").attr("style", a), n && e.look !== "handDrawn" && g.selectChildren("path").attr("style", n), g.attr("transform", `translate(${-s / 2}, ${-o / 2})`), Yn(e, g), e.intersect = function(m) {
    return Ct.info("Pill intersect", e, { points: u }), Sn.polygon(e, u, m);
  }, r;
}
$(eje, "hourglass");
async function tje(i, e, { config: { themeVariables: t, flowchart: n } }) {
  const { labelStyles: r } = Gn(e);
  e.labelStyle = r;
  const s = e.assetHeight ?? 48, o = e.assetWidth ?? 48, a = Math.max(s, o), l = n == null ? void 0 : n.wrappingWidth;
  e.width = Math.max(a, l ?? 0);
  const { shapeSvg: c, bbox: u, label: d } = await ki(i, e, "icon-shape default"), h = e.pos === "t", g = a, m = a, { nodeBorder: _ } = t, { stylesMap: v } = k2(e), w = -m / 2, E = -g / 2, L = e.label ? 8 : 0, T = Un.svg(c), D = jn(e, { stroke: "none", fill: "none" });
  e.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
  const N = T.rectangle(w, E, m, g, D), R = Math.max(m, u.width), M = g + u.height + L, B = T.rectangle(-R / 2, -M / 2, R, M, {
    ...D,
    fill: "transparent",
    stroke: "none"
  }), H = c.insert(() => N, ":first-child"), j = c.insert(() => B);
  if (e.icon) {
    const K = c.append("g");
    K.html(
      `<g>${await x6(e.icon, {
        height: a,
        width: a,
        fallbackPrefix: ""
      })}</g>`
    );
    const X = K.node().getBBox(), Y = X.width, G = X.height, Q = X.x, oe = X.y;
    K.attr(
      "transform",
      `translate(${-Y / 2 - Q},${h ? u.height / 2 + L / 2 - G / 2 - oe : -u.height / 2 - L / 2 - G / 2 - oe})`
    ), K.attr("style", `color: ${v.get("stroke") ?? _};`);
  }
  return d.attr(
    "transform",
    `translate(${-u.width / 2 - (u.x - (u.left ?? 0))},${h ? -M / 2 : M / 2 - u.height})`
  ), H.attr(
    "transform",
    `translate(0,${h ? u.height / 2 + L / 2 : -u.height / 2 - L / 2})`
  ), Yn(e, j), e.intersect = function(K) {
    if (Ct.info("iconSquare intersect", e, K), !e.label)
      return Sn.rect(e, K);
    const X = e.x ?? 0, Y = e.y ?? 0, G = e.height ?? 0;
    let Q = [];
    return h ? Q = [
      { x: X - u.width / 2, y: Y - G / 2 },
      { x: X + u.width / 2, y: Y - G / 2 },
      { x: X + u.width / 2, y: Y - G / 2 + u.height + L },
      { x: X + m / 2, y: Y - G / 2 + u.height + L },
      { x: X + m / 2, y: Y + G / 2 },
      { x: X - m / 2, y: Y + G / 2 },
      { x: X - m / 2, y: Y - G / 2 + u.height + L },
      { x: X - u.width / 2, y: Y - G / 2 + u.height + L }
    ] : Q = [
      { x: X - m / 2, y: Y - G / 2 },
      { x: X + m / 2, y: Y - G / 2 },
      { x: X + m / 2, y: Y - G / 2 + g },
      { x: X + u.width / 2, y: Y - G / 2 + g },
      { x: X + u.width / 2 / 2, y: Y + G / 2 },
      { x: X - u.width / 2, y: Y + G / 2 },
      { x: X - u.width / 2, y: Y - G / 2 + g },
      { x: X - m / 2, y: Y - G / 2 + g }
    ], Sn.polygon(e, Q, K);
  }, c;
}
$(tje, "icon");
async function nje(i, e, { config: { themeVariables: t, flowchart: n } }) {
  const { labelStyles: r } = Gn(e);
  e.labelStyle = r;
  const s = e.assetHeight ?? 48, o = e.assetWidth ?? 48, a = Math.max(s, o), l = n == null ? void 0 : n.wrappingWidth;
  e.width = Math.max(a, l ?? 0);
  const { shapeSvg: c, bbox: u, label: d } = await ki(i, e, "icon-shape default"), h = 20, g = e.label ? 8 : 0, m = e.pos === "t", { nodeBorder: _, mainBkg: v } = t, { stylesMap: w } = k2(e), E = Un.svg(c), L = jn(e, {});
  e.look !== "handDrawn" && (L.roughness = 0, L.fillStyle = "solid");
  const T = w.get("fill");
  L.stroke = T ?? v;
  const D = c.append("g");
  e.icon && D.html(
    `<g>${await x6(e.icon, {
      height: a,
      width: a,
      fallbackPrefix: ""
    })}</g>`
  );
  const N = D.node().getBBox(), R = N.width, M = N.height, B = N.x, H = N.y, j = Math.max(R, M) * Math.SQRT2 + h * 2, K = E.circle(0, 0, j, L), X = Math.max(j, u.width), Y = j + u.height + g, G = E.rectangle(-X / 2, -Y / 2, X, Y, {
    ...L,
    fill: "transparent",
    stroke: "none"
  }), Q = c.insert(() => K, ":first-child"), oe = c.insert(() => G);
  return D.attr(
    "transform",
    `translate(${-R / 2 - B},${m ? u.height / 2 + g / 2 - M / 2 - H : -u.height / 2 - g / 2 - M / 2 - H})`
  ), D.attr("style", `color: ${w.get("stroke") ?? _};`), d.attr(
    "transform",
    `translate(${-u.width / 2 - (u.x - (u.left ?? 0))},${m ? -Y / 2 : Y / 2 - u.height})`
  ), Q.attr(
    "transform",
    `translate(0,${m ? u.height / 2 + g / 2 : -u.height / 2 - g / 2})`
  ), Yn(e, oe), e.intersect = function(Z) {
    return Ct.info("iconSquare intersect", e, Z), Sn.rect(e, Z);
  }, c;
}
$(nje, "iconCircle");
async function ije(i, e, { config: { themeVariables: t, flowchart: n } }) {
  const { labelStyles: r } = Gn(e);
  e.labelStyle = r;
  const s = e.assetHeight ?? 48, o = e.assetWidth ?? 48, a = Math.max(s, o), l = n == null ? void 0 : n.wrappingWidth;
  e.width = Math.max(a, l ?? 0);
  const { shapeSvg: c, bbox: u, halfPadding: d, label: h } = await ki(
    i,
    e,
    "icon-shape default"
  ), g = e.pos === "t", m = a + d * 2, _ = a + d * 2, { nodeBorder: v, mainBkg: w } = t, { stylesMap: E } = k2(e), L = -_ / 2, T = -m / 2, D = e.label ? 8 : 0, N = Un.svg(c), R = jn(e, {});
  e.look !== "handDrawn" && (R.roughness = 0, R.fillStyle = "solid");
  const M = E.get("fill");
  R.stroke = M ?? w;
  const B = N.path(Pw(L, T, _, m, 5), R), H = Math.max(_, u.width), j = m + u.height + D, K = N.rectangle(-H / 2, -j / 2, H, j, {
    ...R,
    fill: "transparent",
    stroke: "none"
  }), X = c.insert(() => B, ":first-child").attr("class", "icon-shape2"), Y = c.insert(() => K);
  if (e.icon) {
    const G = c.append("g");
    G.html(
      `<g>${await x6(e.icon, {
        height: a,
        width: a,
        fallbackPrefix: ""
      })}</g>`
    );
    const Q = G.node().getBBox(), oe = Q.width, Z = Q.height, pe = Q.x, J = Q.y;
    G.attr(
      "transform",
      `translate(${-oe / 2 - pe},${g ? u.height / 2 + D / 2 - Z / 2 - J : -u.height / 2 - D / 2 - Z / 2 - J})`
    ), G.attr("style", `color: ${E.get("stroke") ?? v};`);
  }
  return h.attr(
    "transform",
    `translate(${-u.width / 2 - (u.x - (u.left ?? 0))},${g ? -j / 2 : j / 2 - u.height})`
  ), X.attr(
    "transform",
    `translate(0,${g ? u.height / 2 + D / 2 : -u.height / 2 - D / 2})`
  ), Yn(e, Y), e.intersect = function(G) {
    if (Ct.info("iconSquare intersect", e, G), !e.label)
      return Sn.rect(e, G);
    const Q = e.x ?? 0, oe = e.y ?? 0, Z = e.height ?? 0;
    let pe = [];
    return g ? pe = [
      { x: Q - u.width / 2, y: oe - Z / 2 },
      { x: Q + u.width / 2, y: oe - Z / 2 },
      { x: Q + u.width / 2, y: oe - Z / 2 + u.height + D },
      { x: Q + _ / 2, y: oe - Z / 2 + u.height + D },
      { x: Q + _ / 2, y: oe + Z / 2 },
      { x: Q - _ / 2, y: oe + Z / 2 },
      { x: Q - _ / 2, y: oe - Z / 2 + u.height + D },
      { x: Q - u.width / 2, y: oe - Z / 2 + u.height + D }
    ] : pe = [
      { x: Q - _ / 2, y: oe - Z / 2 },
      { x: Q + _ / 2, y: oe - Z / 2 },
      { x: Q + _ / 2, y: oe - Z / 2 + m },
      { x: Q + u.width / 2, y: oe - Z / 2 + m },
      { x: Q + u.width / 2 / 2, y: oe + Z / 2 },
      { x: Q - u.width / 2, y: oe + Z / 2 },
      { x: Q - u.width / 2, y: oe - Z / 2 + m },
      { x: Q - _ / 2, y: oe - Z / 2 + m }
    ], Sn.polygon(e, pe, G);
  }, c;
}
$(ije, "iconRounded");
async function rje(i, e, { config: { themeVariables: t, flowchart: n } }) {
  const { labelStyles: r } = Gn(e);
  e.labelStyle = r;
  const s = e.assetHeight ?? 48, o = e.assetWidth ?? 48, a = Math.max(s, o), l = n == null ? void 0 : n.wrappingWidth;
  e.width = Math.max(a, l ?? 0);
  const { shapeSvg: c, bbox: u, halfPadding: d, label: h } = await ki(
    i,
    e,
    "icon-shape default"
  ), g = e.pos === "t", m = a + d * 2, _ = a + d * 2, { nodeBorder: v, mainBkg: w } = t, { stylesMap: E } = k2(e), L = -_ / 2, T = -m / 2, D = e.label ? 8 : 0, N = Un.svg(c), R = jn(e, {});
  e.look !== "handDrawn" && (R.roughness = 0, R.fillStyle = "solid");
  const M = E.get("fill");
  R.stroke = M ?? w;
  const B = N.path(Pw(L, T, _, m, 0.1), R), H = Math.max(_, u.width), j = m + u.height + D, K = N.rectangle(-H / 2, -j / 2, H, j, {
    ...R,
    fill: "transparent",
    stroke: "none"
  }), X = c.insert(() => B, ":first-child"), Y = c.insert(() => K);
  if (e.icon) {
    const G = c.append("g");
    G.html(
      `<g>${await x6(e.icon, {
        height: a,
        width: a,
        fallbackPrefix: ""
      })}</g>`
    );
    const Q = G.node().getBBox(), oe = Q.width, Z = Q.height, pe = Q.x, J = Q.y;
    G.attr(
      "transform",
      `translate(${-oe / 2 - pe},${g ? u.height / 2 + D / 2 - Z / 2 - J : -u.height / 2 - D / 2 - Z / 2 - J})`
    ), G.attr("style", `color: ${E.get("stroke") ?? v};`);
  }
  return h.attr(
    "transform",
    `translate(${-u.width / 2 - (u.x - (u.left ?? 0))},${g ? -j / 2 : j / 2 - u.height})`
  ), X.attr(
    "transform",
    `translate(0,${g ? u.height / 2 + D / 2 : -u.height / 2 - D / 2})`
  ), Yn(e, Y), e.intersect = function(G) {
    if (Ct.info("iconSquare intersect", e, G), !e.label)
      return Sn.rect(e, G);
    const Q = e.x ?? 0, oe = e.y ?? 0, Z = e.height ?? 0;
    let pe = [];
    return g ? pe = [
      { x: Q - u.width / 2, y: oe - Z / 2 },
      { x: Q + u.width / 2, y: oe - Z / 2 },
      { x: Q + u.width / 2, y: oe - Z / 2 + u.height + D },
      { x: Q + _ / 2, y: oe - Z / 2 + u.height + D },
      { x: Q + _ / 2, y: oe + Z / 2 },
      { x: Q - _ / 2, y: oe + Z / 2 },
      { x: Q - _ / 2, y: oe - Z / 2 + u.height + D },
      { x: Q - u.width / 2, y: oe - Z / 2 + u.height + D }
    ] : pe = [
      { x: Q - _ / 2, y: oe - Z / 2 },
      { x: Q + _ / 2, y: oe - Z / 2 },
      { x: Q + _ / 2, y: oe - Z / 2 + m },
      { x: Q + u.width / 2, y: oe - Z / 2 + m },
      { x: Q + u.width / 2 / 2, y: oe + Z / 2 },
      { x: Q - u.width / 2, y: oe + Z / 2 },
      { x: Q - u.width / 2, y: oe - Z / 2 + m },
      { x: Q - _ / 2, y: oe - Z / 2 + m }
    ], Sn.polygon(e, pe, G);
  }, c;
}
$(rje, "iconSquare");
async function sje(i, e, { config: { flowchart: t } }) {
  const n = new Image();
  n.src = (e == null ? void 0 : e.img) ?? "", await n.decode();
  const r = Number(n.naturalWidth.toString().replace("px", "")), s = Number(n.naturalHeight.toString().replace("px", ""));
  e.imageAspectRatio = r / s;
  const { labelStyles: o } = Gn(e);
  e.labelStyle = o;
  const a = t == null ? void 0 : t.wrappingWidth;
  e.defaultWidth = t == null ? void 0 : t.wrappingWidth;
  const l = Math.max(
    e.label ? a ?? 0 : 0,
    (e == null ? void 0 : e.assetWidth) ?? r
  ), c = e.constraint === "on" && e != null && e.assetHeight ? e.assetHeight * e.imageAspectRatio : l, u = e.constraint === "on" ? c / e.imageAspectRatio : (e == null ? void 0 : e.assetHeight) ?? s;
  e.width = Math.max(c, a ?? 0);
  const { shapeSvg: d, bbox: h, label: g } = await ki(i, e, "image-shape default"), m = e.pos === "t", _ = -c / 2, v = -u / 2, w = e.label ? 8 : 0, E = Un.svg(d), L = jn(e, {});
  e.look !== "handDrawn" && (L.roughness = 0, L.fillStyle = "solid");
  const T = E.rectangle(_, v, c, u, L), D = Math.max(c, h.width), N = u + h.height + w, R = E.rectangle(-D / 2, -N / 2, D, N, {
    ...L,
    fill: "none",
    stroke: "none"
  }), M = d.insert(() => T, ":first-child"), B = d.insert(() => R);
  if (e.img) {
    const H = d.append("image");
    H.attr("href", e.img), H.attr("width", c), H.attr("height", u), H.attr("preserveAspectRatio", "none"), H.attr(
      "transform",
      `translate(${-c / 2},${m ? N / 2 - u : -N / 2})`
    );
  }
  return g.attr(
    "transform",
    `translate(${-h.width / 2 - (h.x - (h.left ?? 0))},${m ? -u / 2 - h.height / 2 - w / 2 : u / 2 - h.height / 2 + w / 2})`
  ), M.attr(
    "transform",
    `translate(0,${m ? h.height / 2 + w / 2 : -h.height / 2 - w / 2})`
  ), Yn(e, B), e.intersect = function(H) {
    if (Ct.info("iconSquare intersect", e, H), !e.label)
      return Sn.rect(e, H);
    const j = e.x ?? 0, K = e.y ?? 0, X = e.height ?? 0;
    let Y = [];
    return m ? Y = [
      { x: j - h.width / 2, y: K - X / 2 },
      { x: j + h.width / 2, y: K - X / 2 },
      { x: j + h.width / 2, y: K - X / 2 + h.height + w },
      { x: j + c / 2, y: K - X / 2 + h.height + w },
      { x: j + c / 2, y: K + X / 2 },
      { x: j - c / 2, y: K + X / 2 },
      { x: j - c / 2, y: K - X / 2 + h.height + w },
      { x: j - h.width / 2, y: K - X / 2 + h.height + w }
    ] : Y = [
      { x: j - c / 2, y: K - X / 2 },
      { x: j + c / 2, y: K - X / 2 },
      { x: j + c / 2, y: K - X / 2 + u },
      { x: j + h.width / 2, y: K - X / 2 + u },
      { x: j + h.width / 2 / 2, y: K + X / 2 },
      { x: j - h.width / 2, y: K + X / 2 },
      { x: j - h.width / 2, y: K - X / 2 + u },
      { x: j - c / 2, y: K - X / 2 + u }
    ], Sn.polygon(e, Y, H);
  }, d;
}
$(sje, "imageSquare");
async function oje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), a = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), l = [
    { x: 0, y: 0 },
    { x: o, y: 0 },
    { x: o + 3 * a / 6, y: -a },
    { x: -3 * a / 6, y: -a }
  ];
  let c;
  const { cssStyles: u } = e;
  if (e.look === "handDrawn") {
    const d = Un.svg(r), h = jn(e, {}), g = Hr(l), m = d.path(g, h);
    c = r.insert(() => m, ":first-child").attr("transform", `translate(${-o / 2}, ${a / 2})`), u && c.attr("style", u);
  } else
    c = Fw(r, o, a, l);
  return n && c.attr("style", n), e.width = o, e.height = a, Yn(e, c), e.intersect = function(d) {
    return Sn.polygon(e, l, d);
  }, r;
}
$(oje, "inv_trapezoid");
async function JY(i, e, t) {
  const { labelStyles: n, nodeStyles: r } = Gn(e);
  e.labelStyle = n;
  const { shapeSvg: s, bbox: o } = await ki(i, e, bi(e)), a = Math.max(o.width + t.labelPaddingX * 2, (e == null ? void 0 : e.width) || 0), l = Math.max(o.height + t.labelPaddingY * 2, (e == null ? void 0 : e.height) || 0), c = -a / 2, u = -l / 2;
  let d, { rx: h, ry: g } = e;
  const { cssStyles: m } = e;
  if (t != null && t.rx && t.ry && (h = t.rx, g = t.ry), e.look === "handDrawn") {
    const _ = Un.svg(s), v = jn(e, {}), w = h || g ? _.path(Pw(c, u, a, l, h || 0), v) : _.rectangle(c, u, a, l, v);
    d = s.insert(() => w, ":first-child"), d.attr("class", "basic label-container").attr("style", Xu(m));
  } else
    d = s.insert("rect", ":first-child"), d.attr("class", "basic label-container").attr("style", r).attr("rx", Xu(h)).attr("ry", Xu(g)).attr("x", c).attr("y", u).attr("width", a).attr("height", l);
  return Yn(e, d), e.calcIntersect = function(_, v) {
    return Sn.rect(_, v);
  }, e.intersect = function(_) {
    return Sn.rect(e, _);
  }, s;
}
$(JY, "drawRect");
async function aje(i, e) {
  const { shapeSvg: t, bbox: n, label: r } = await ki(i, e, "label"), s = t.insert("rect", ":first-child");
  return s.attr("width", 0.1).attr("height", 0.1), t.attr("class", "label edgeLabel"), r.attr(
    "transform",
    `translate(${-(n.width / 2) - (n.x - (n.left ?? 0))}, ${-(n.height / 2) - (n.y - (n.top ?? 0))})`
  ), Yn(e, s), e.intersect = function(l) {
    return Sn.rect(e, l);
  }, t;
}
$(aje, "labelRect");
async function lje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = Math.max(s.width + (e.padding ?? 0), (e == null ? void 0 : e.width) ?? 0), a = Math.max(s.height + (e.padding ?? 0), (e == null ? void 0 : e.height) ?? 0), l = [
    { x: 0, y: 0 },
    { x: o + 3 * a / 6, y: 0 },
    { x: o, y: -a },
    { x: -(3 * a) / 6, y: -a }
  ];
  let c;
  const { cssStyles: u } = e;
  if (e.look === "handDrawn") {
    const d = Un.svg(r), h = jn(e, {}), g = Hr(l), m = d.path(g, h);
    c = r.insert(() => m, ":first-child").attr("transform", `translate(${-o / 2}, ${a / 2})`), u && c.attr("style", u);
  } else
    c = Fw(r, o, a, l);
  return n && c.attr("style", n), e.width = o, e.height = a, Yn(e, c), e.intersect = function(d) {
    return Sn.polygon(e, l, d);
  }, r;
}
$(lje, "lean_left");
async function cje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = Math.max(s.width + (e.padding ?? 0), (e == null ? void 0 : e.width) ?? 0), a = Math.max(s.height + (e.padding ?? 0), (e == null ? void 0 : e.height) ?? 0), l = [
    { x: -3 * a / 6, y: 0 },
    { x: o, y: 0 },
    { x: o + 3 * a / 6, y: -a },
    { x: 0, y: -a }
  ];
  let c;
  const { cssStyles: u } = e;
  if (e.look === "handDrawn") {
    const d = Un.svg(r), h = jn(e, {}), g = Hr(l), m = d.path(g, h);
    c = r.insert(() => m, ":first-child").attr("transform", `translate(${-o / 2}, ${a / 2})`), u && c.attr("style", u);
  } else
    c = Fw(r, o, a, l);
  return n && c.attr("style", n), e.width = o, e.height = a, Yn(e, c), e.intersect = function(d) {
    return Sn.polygon(e, l, d);
  }, r;
}
$(cje, "lean_right");
function uje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.label = "", e.labelStyle = t;
  const r = i.insert("g").attr("class", bi(e)).attr("id", e.domId ?? e.id), { cssStyles: s } = e, o = Math.max(35, (e == null ? void 0 : e.width) ?? 0), a = Math.max(35, (e == null ? void 0 : e.height) ?? 0), l = 7, c = [
    { x: o, y: 0 },
    { x: 0, y: a + l / 2 },
    { x: o - 2 * l, y: a + l / 2 },
    { x: 0, y: 2 * a },
    { x: o, y: a - l / 2 },
    { x: 2 * l, y: a - l / 2 }
  ], u = Un.svg(r), d = jn(e, {});
  e.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
  const h = Hr(c), g = u.path(h, d), m = r.insert(() => g, ":first-child");
  return s && e.look !== "handDrawn" && m.selectAll("path").attr("style", s), n && e.look !== "handDrawn" && m.selectAll("path").attr("style", n), m.attr("transform", `translate(-${o / 2},${-a})`), Yn(e, m), e.intersect = function(_) {
    return Ct.info("lightningBolt intersect", e, _), Sn.polygon(e, c, _);
  }, r;
}
$(uje, "lightningBolt");
var Uen = /* @__PURE__ */ $((i, e, t, n, r, s, o) => [
  `M${i},${e + s}`,
  `a${r},${s} 0,0,0 ${t},0`,
  `a${r},${s} 0,0,0 ${-t},0`,
  `l0,${n}`,
  `a${r},${s} 0,0,0 ${t},0`,
  `l0,${-n}`,
  `M${i},${e + s + o}`,
  `a${r},${s} 0,0,0 ${t},0`
].join(" "), "createCylinderPathD"), zen = /* @__PURE__ */ $((i, e, t, n, r, s, o) => [
  `M${i},${e + s}`,
  `M${i + t},${e + s}`,
  `a${r},${s} 0,0,0 ${-t},0`,
  `l0,${n}`,
  `a${r},${s} 0,0,0 ${t},0`,
  `l0,${-n}`,
  `M${i},${e + s + o}`,
  `a${r},${s} 0,0,0 ${t},0`
].join(" "), "createOuterCylinderPathD"), $en = /* @__PURE__ */ $((i, e, t, n, r, s) => [`M${i - t / 2},${-n / 2}`, `a${r},${s} 0,0,0 ${t},0`].join(" "), "createInnerCylinderPathD");
async function dje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0), e.width ?? 0), l = a / 2, c = l / (2.5 + a / 50), u = Math.max(s.height + c + (e.padding ?? 0), e.height ?? 0), d = u * 0.1;
  let h;
  const { cssStyles: g } = e;
  if (e.look === "handDrawn") {
    const m = Un.svg(r), _ = zen(0, 0, a, u, l, c, d), v = $en(0, c, a, u, l, c), w = jn(e, {}), E = m.path(_, w), L = m.path(v, w);
    r.insert(() => L, ":first-child").attr("class", "line"), h = r.insert(() => E, ":first-child"), h.attr("class", "basic label-container"), g && h.attr("style", g);
  } else {
    const m = Uen(0, 0, a, u, l, c, d);
    h = r.insert("path", ":first-child").attr("d", m).attr("class", "basic label-container").attr("style", Xu(g)).attr("style", n);
  }
  return h.attr("label-offset-y", c), h.attr("transform", `translate(${-a / 2}, ${-(u / 2 + c)})`), Yn(e, h), o.attr(
    "transform",
    `translate(${-(s.width / 2) - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + c - (s.y - (s.top ?? 0))})`
  ), e.intersect = function(m) {
    const _ = Sn.rect(e, m), v = _.x - (e.x ?? 0);
    if (l != 0 && (Math.abs(v) < (e.width ?? 0) / 2 || Math.abs(v) == (e.width ?? 0) / 2 && Math.abs(_.y - (e.y ?? 0)) > (e.height ?? 0) / 2 - c)) {
      let w = c * c * (1 - v * v / (l * l));
      w > 0 && (w = Math.sqrt(w)), w = c - w, m.y - (e.y ?? 0) > 0 && (w = -w), _.y += w;
    }
    return _;
  }, r;
}
$(dje, "linedCylinder");
async function hje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), l = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), c = l / 4, u = l + c, { cssStyles: d } = e, h = Un.svg(r), g = jn(e, {});
  e.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
  const m = [
    { x: -a / 2 - a / 2 * 0.1, y: -u / 2 },
    { x: -a / 2 - a / 2 * 0.1, y: u / 2 },
    ...yw(
      -a / 2 - a / 2 * 0.1,
      u / 2,
      a / 2 + a / 2 * 0.1,
      u / 2,
      c,
      0.8
    ),
    { x: a / 2 + a / 2 * 0.1, y: -u / 2 },
    { x: -a / 2 - a / 2 * 0.1, y: -u / 2 },
    { x: -a / 2, y: -u / 2 },
    { x: -a / 2, y: u / 2 * 1.1 },
    { x: -a / 2, y: -u / 2 }
  ], _ = h.polygon(
    m.map((w) => [w.x, w.y]),
    g
  ), v = r.insert(() => _, ":first-child");
  return v.attr("class", "basic label-container"), d && e.look !== "handDrawn" && v.selectAll("path").attr("style", d), n && e.look !== "handDrawn" && v.selectAll("path").attr("style", n), v.attr("transform", `translate(0,${-c / 2})`), o.attr(
    "transform",
    `translate(${-a / 2 + (e.padding ?? 0) + a / 2 * 0.1 / 2 - (s.x - (s.left ?? 0))},${-l / 2 + (e.padding ?? 0) - c / 2 - (s.y - (s.top ?? 0))})`
  ), Yn(e, v), e.intersect = function(w) {
    return Sn.polygon(e, m, w);
  }, r;
}
$(hje, "linedWaveEdgedRect");
async function fje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), l = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), c = 5, u = -a / 2, d = -l / 2, { cssStyles: h } = e, g = Un.svg(r), m = jn(e, {}), _ = [
    { x: u - c, y: d + c },
    { x: u - c, y: d + l + c },
    { x: u + a - c, y: d + l + c },
    { x: u + a - c, y: d + l },
    { x: u + a, y: d + l },
    { x: u + a, y: d + l - c },
    { x: u + a + c, y: d + l - c },
    { x: u + a + c, y: d - c },
    { x: u + c, y: d - c },
    { x: u + c, y: d },
    { x: u, y: d },
    { x: u, y: d + c }
  ], v = [
    { x: u, y: d + c },
    { x: u + a - c, y: d + c },
    { x: u + a - c, y: d + l },
    { x: u + a, y: d + l },
    { x: u + a, y: d },
    { x: u, y: d }
  ];
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const w = Hr(_), E = g.path(w, m), L = Hr(v), T = g.path(L, { ...m, fill: "none" }), D = r.insert(() => T, ":first-child");
  return D.insert(() => E, ":first-child"), D.attr("class", "basic label-container"), h && e.look !== "handDrawn" && D.selectAll("path").attr("style", h), n && e.look !== "handDrawn" && D.selectAll("path").attr("style", n), o.attr(
    "transform",
    `translate(${-(s.width / 2) - c - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + c - (s.y - (s.top ?? 0))})`
  ), Yn(e, D), e.intersect = function(N) {
    return Sn.polygon(e, _, N);
  }, r;
}
$(fje, "multiRect");
async function gje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), l = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), c = l / 4, u = l + c, d = -a / 2, h = -u / 2, g = 5, { cssStyles: m } = e, _ = yw(
    d - g,
    h + u + g,
    d + a - g,
    h + u + g,
    c,
    0.8
  ), v = _ == null ? void 0 : _[_.length - 1], w = [
    { x: d - g, y: h + g },
    { x: d - g, y: h + u + g },
    ..._,
    { x: d + a - g, y: v.y - g },
    { x: d + a, y: v.y - g },
    { x: d + a, y: v.y - 2 * g },
    { x: d + a + g, y: v.y - 2 * g },
    { x: d + a + g, y: h - g },
    { x: d + g, y: h - g },
    { x: d + g, y: h },
    { x: d, y: h },
    { x: d, y: h + g }
  ], E = [
    { x: d, y: h + g },
    { x: d + a - g, y: h + g },
    { x: d + a - g, y: v.y - g },
    { x: d + a, y: v.y - g },
    { x: d + a, y: h },
    { x: d, y: h }
  ], L = Un.svg(r), T = jn(e, {});
  e.look !== "handDrawn" && (T.roughness = 0, T.fillStyle = "solid");
  const D = Hr(w), N = L.path(D, T), R = Hr(E), M = L.path(R, T), B = r.insert(() => N, ":first-child");
  return B.insert(() => M), B.attr("class", "basic label-container"), m && e.look !== "handDrawn" && B.selectAll("path").attr("style", m), n && e.look !== "handDrawn" && B.selectAll("path").attr("style", n), B.attr("transform", `translate(0,${-c / 2})`), o.attr(
    "transform",
    `translate(${-(s.width / 2) - g - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + g - c / 2 - (s.y - (s.top ?? 0))})`
  ), Yn(e, B), e.intersect = function(H) {
    return Sn.polygon(e, w, H);
  }, r;
}
$(gje, "multiWaveEdgedRectangle");
async function pje(i, e, { config: { themeVariables: t } }) {
  var E;
  const { labelStyles: n, nodeStyles: r } = Gn(e);
  e.labelStyle = n, e.useHtmlLabels || ((E = Ku().flowchart) == null ? void 0 : E.htmlLabels) !== !1 || (e.centerLabel = !0);
  const { shapeSvg: o, bbox: a, label: l } = await ki(i, e, bi(e)), c = Math.max(a.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), u = Math.max(a.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), d = -c / 2, h = -u / 2, { cssStyles: g } = e, m = Un.svg(o), _ = jn(e, {
    fill: t.noteBkgColor,
    stroke: t.noteBorderColor
  });
  e.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
  const v = m.rectangle(d, h, c, u, _), w = o.insert(() => v, ":first-child");
  return w.attr("class", "basic label-container"), g && e.look !== "handDrawn" && w.selectAll("path").attr("style", g), r && e.look !== "handDrawn" && w.selectAll("path").attr("style", r), l.attr(
    "transform",
    `translate(${-a.width / 2 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) - (a.y - (a.top ?? 0))})`
  ), Yn(e, w), e.intersect = function(L) {
    return Sn.rect(e, L);
  }, o;
}
$(pje, "note");
var jen = /* @__PURE__ */ $((i, e, t) => [
  `M${i + t / 2},${e}`,
  `L${i + t},${e - t / 2}`,
  `L${i + t / 2},${e - t}`,
  `L${i},${e - t / 2}`,
  "Z"
].join(" "), "createDecisionBoxPathD");
async function mje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = s.width + e.padding, a = s.height + e.padding, l = o + a, c = 0.5, u = [
    { x: l / 2, y: 0 },
    { x: l, y: -l / 2 },
    { x: l / 2, y: -l },
    { x: 0, y: -l / 2 }
  ];
  let d;
  const { cssStyles: h } = e;
  if (e.look === "handDrawn") {
    const g = Un.svg(r), m = jn(e, {}), _ = jen(0, 0, l), v = g.path(_, m);
    d = r.insert(() => v, ":first-child").attr("transform", `translate(${-l / 2 + c}, ${l / 2})`), h && d.attr("style", h);
  } else
    d = Fw(r, l, l, u), d.attr("transform", `translate(${-l / 2 + c}, ${l / 2})`);
  return n && d.attr("style", n), Yn(e, d), e.calcIntersect = function(g, m) {
    const _ = g.width, v = [
      { x: _ / 2, y: 0 },
      { x: _, y: -_ / 2 },
      { x: _ / 2, y: -_ },
      { x: 0, y: -_ / 2 }
    ], w = Sn.polygon(g, v, m);
    return { x: w.x - 0.5, y: w.y - 0.5 };
  }, e.intersect = function(g) {
    return this.calcIntersect(e, g);
  }, r;
}
$(mje, "question");
async function _je(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0), (e == null ? void 0 : e.width) ?? 0), l = Math.max(s.height + (e.padding ?? 0), (e == null ? void 0 : e.height) ?? 0), c = -a / 2, u = -l / 2, d = u / 2, h = [
    { x: c + d, y: u },
    { x: c, y: 0 },
    { x: c + d, y: -u },
    { x: -c, y: -u },
    { x: -c, y: u }
  ], { cssStyles: g } = e, m = Un.svg(r), _ = jn(e, {});
  e.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
  const v = Hr(h), w = m.path(v, _), E = r.insert(() => w, ":first-child");
  return E.attr("class", "basic label-container"), g && e.look !== "handDrawn" && E.selectAll("path").attr("style", g), n && e.look !== "handDrawn" && E.selectAll("path").attr("style", n), E.attr("transform", `translate(${-d / 2},0)`), o.attr(
    "transform",
    `translate(${-d / 2 - s.width / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) - (s.y - (s.top ?? 0))})`
  ), Yn(e, E), e.intersect = function(L) {
    return Sn.polygon(e, h, L);
  }, r;
}
$(_je, "rect_left_inv_arrow");
async function bje(i, e) {
  var M, B;
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  let r;
  e.cssClasses ? r = "node " + e.cssClasses : r = "node default";
  const s = i.insert("g").attr("class", r).attr("id", e.domId || e.id), o = s.insert("g"), a = s.insert("g").attr("class", "label").attr("style", n), l = e.description, c = e.label, u = a.node().appendChild(await Dx(c, e.labelStyle, !0, !0));
  let d = { width: 0, height: 0 };
  if (ic((B = (M = Qs()) == null ? void 0 : M.flowchart) == null ? void 0 : B.htmlLabels)) {
    const H = u.children[0], j = ls(u);
    d = H.getBoundingClientRect(), j.attr("width", d.width), j.attr("height", d.height);
  }
  Ct.info("Text 2", l);
  const h = l || [], g = u.getBBox(), m = a.node().appendChild(
    await Dx(
      h.join ? h.join("<br/>") : h,
      e.labelStyle,
      !0,
      !0
    )
  ), _ = m.children[0], v = ls(m);
  d = _.getBoundingClientRect(), v.attr("width", d.width), v.attr("height", d.height);
  const w = (e.padding || 0) / 2;
  ls(m).attr(
    "transform",
    "translate( " + (d.width > g.width ? 0 : (g.width - d.width) / 2) + ", " + (g.height + w + 5) + ")"
  ), ls(u).attr(
    "transform",
    "translate( " + (d.width < g.width ? 0 : -(g.width - d.width) / 2) + ", 0)"
  ), d = a.node().getBBox(), a.attr(
    "transform",
    "translate(" + -d.width / 2 + ", " + (-d.height / 2 - w + 3) + ")"
  );
  const E = d.width + (e.padding || 0), L = d.height + (e.padding || 0), T = -d.width / 2 - w, D = -d.height / 2 - w;
  let N, R;
  if (e.look === "handDrawn") {
    const H = Un.svg(s), j = jn(e, {}), K = H.path(
      Pw(T, D, E, L, e.rx || 0),
      j
    ), X = H.line(
      -d.width / 2 - w,
      -d.height / 2 - w + g.height + w,
      d.width / 2 + w,
      -d.height / 2 - w + g.height + w,
      j
    );
    R = s.insert(() => (Ct.debug("Rough node insert CXC", K), X), ":first-child"), N = s.insert(() => (Ct.debug("Rough node insert CXC", K), K), ":first-child");
  } else
    N = o.insert("rect", ":first-child"), R = o.insert("line"), N.attr("class", "outer title-state").attr("style", n).attr("x", -d.width / 2 - w).attr("y", -d.height / 2 - w).attr("width", d.width + (e.padding || 0)).attr("height", d.height + (e.padding || 0)), R.attr("class", "divider").attr("x1", -d.width / 2 - w).attr("x2", d.width / 2 + w).attr("y1", -d.height / 2 - w + g.height + w).attr("y2", -d.height / 2 - w + g.height + w);
  return Yn(e, N), e.intersect = function(H) {
    return Sn.rect(e, H);
  }, s;
}
$(bje, "rectWithTitle");
function pF(i, e, t, n, r, s, o) {
  const l = (i + t) / 2, c = (e + n) / 2, u = Math.atan2(n - e, t - i), d = (t - i) / 2, h = (n - e) / 2, g = d / r, m = h / s, _ = Math.sqrt(g ** 2 + m ** 2);
  if (_ > 1)
    throw new Error("The given radii are too small to create an arc between the points.");
  const v = Math.sqrt(1 - _ ** 2), w = l + v * s * Math.sin(u) * (o ? -1 : 1), E = c - v * r * Math.cos(u) * (o ? -1 : 1), L = Math.atan2((e - E) / s, (i - w) / r);
  let D = Math.atan2((n - E) / s, (t - w) / r) - L;
  o && D < 0 && (D += 2 * Math.PI), !o && D > 0 && (D -= 2 * Math.PI);
  const N = [];
  for (let R = 0; R < 20; R++) {
    const M = R / 19, B = L + M * D, H = w + r * Math.cos(B), j = E + s * Math.sin(B);
    N.push({ x: H, y: j });
  }
  return N;
}
$(pF, "generateArcPoints");
async function vje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = (e == null ? void 0 : e.padding) ?? 0, a = (e == null ? void 0 : e.padding) ?? 0, l = (e != null && e.width ? e == null ? void 0 : e.width : s.width) + o * 2, c = (e != null && e.height ? e == null ? void 0 : e.height : s.height) + a * 2, u = e.radius || 5, d = e.taper || 5, { cssStyles: h } = e, g = Un.svg(r), m = jn(e, {});
  e.stroke && (m.stroke = e.stroke), e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const _ = [
    // Top edge (left to right)
    { x: -l / 2 + d, y: -c / 2 },
    // Top-left corner start (1)
    { x: l / 2 - d, y: -c / 2 },
    // Top-right corner start (2)
    ...pF(l / 2 - d, -c / 2, l / 2, -c / 2 + d, u, u, !0),
    // Top-left arc (2 to 3)
    // Right edge (top to bottom)
    { x: l / 2, y: -c / 2 + d },
    // Top-right taper point (3)
    { x: l / 2, y: c / 2 - d },
    // Bottom-right taper point (4)
    ...pF(l / 2, c / 2 - d, l / 2 - d, c / 2, u, u, !0),
    // Top-left arc (4 to 5)
    // Bottom edge (right to left)
    { x: l / 2 - d, y: c / 2 },
    // Bottom-right corner start (5)
    { x: -l / 2 + d, y: c / 2 },
    // Bottom-left corner start (6)
    ...pF(-l / 2 + d, c / 2, -l / 2, c / 2 - d, u, u, !0),
    // Top-left arc (4 to 5)
    // Left edge (bottom to top)
    { x: -l / 2, y: c / 2 - d },
    // Bottom-left taper point (7)
    { x: -l / 2, y: -c / 2 + d },
    // Top-left taper point (8)
    ...pF(-l / 2, -c / 2 + d, -l / 2 + d, -c / 2, u, u, !0)
    // Top-left arc (4 to 5)
  ], v = Hr(_), w = g.path(v, m), E = r.insert(() => w, ":first-child");
  return E.attr("class", "basic label-container outer-path"), h && e.look !== "handDrawn" && E.selectChildren("path").attr("style", h), n && e.look !== "handDrawn" && E.selectChildren("path").attr("style", n), Yn(e, E), e.intersect = function(L) {
    return Sn.polygon(e, _, L);
  }, r;
}
$(vje, "roundedRect");
async function yje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = (e == null ? void 0 : e.padding) ?? 0, l = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), c = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), u = -s.width / 2 - a, d = -s.height / 2 - a, { cssStyles: h } = e, g = Un.svg(r), m = jn(e, {});
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const _ = [
    { x: u, y: d },
    { x: u + l + 8, y: d },
    { x: u + l + 8, y: d + c },
    { x: u - 8, y: d + c },
    { x: u - 8, y: d },
    { x: u, y: d },
    { x: u, y: d + c }
  ], v = g.polygon(
    _.map((E) => [E.x, E.y]),
    m
  ), w = r.insert(() => v, ":first-child");
  return w.attr("class", "basic label-container").attr("style", Xu(h)), n && e.look !== "handDrawn" && w.selectAll("path").attr("style", n), h && e.look !== "handDrawn" && w.selectAll("path").attr("style", n), o.attr(
    "transform",
    `translate(${-l / 2 + 4 + (e.padding ?? 0) - (s.x - (s.left ?? 0))},${-c / 2 + (e.padding ?? 0) - (s.y - (s.top ?? 0))})`
  ), Yn(e, w), e.intersect = function(E) {
    return Sn.rect(e, E);
  }, r;
}
$(yje, "shadedProcess");
async function Cje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), l = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), c = -a / 2, u = -l / 2, { cssStyles: d } = e, h = Un.svg(r), g = jn(e, {});
  e.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
  const m = [
    { x: c, y: u },
    { x: c, y: u + l },
    { x: c + a, y: u + l },
    { x: c + a, y: u - l / 2 }
  ], _ = Hr(m), v = h.path(_, g), w = r.insert(() => v, ":first-child");
  return w.attr("class", "basic label-container"), d && e.look !== "handDrawn" && w.selectChildren("path").attr("style", d), n && e.look !== "handDrawn" && w.selectChildren("path").attr("style", n), w.attr("transform", `translate(0, ${l / 4})`), o.attr(
    "transform",
    `translate(${-a / 2 + (e.padding ?? 0) - (s.x - (s.left ?? 0))}, ${-l / 4 + (e.padding ?? 0) - (s.y - (s.top ?? 0))})`
  ), Yn(e, w), e.intersect = function(E) {
    return Sn.polygon(e, m, E);
  }, r;
}
$(Cje, "slopedRect");
async function wje(i, e) {
  const t = {
    rx: 0,
    ry: 0,
    labelPaddingX: e.labelPaddingX ?? ((e == null ? void 0 : e.padding) || 0) * 2,
    labelPaddingY: ((e == null ? void 0 : e.padding) || 0) * 1
  };
  return JY(i, e, t);
}
$(wje, "squareRect");
async function Sje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = s.height + e.padding, a = s.width + o / 4 + e.padding, l = o / 2, { cssStyles: c } = e, u = Un.svg(r), d = jn(e, {});
  e.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
  const h = [
    { x: -a / 2 + l, y: -o / 2 },
    { x: a / 2 - l, y: -o / 2 },
    ...sB(-a / 2 + l, 0, l, 50, 90, 270),
    { x: a / 2 - l, y: o / 2 },
    ...sB(a / 2 - l, 0, l, 50, 270, 450)
  ], g = Hr(h), m = u.path(g, d), _ = r.insert(() => m, ":first-child");
  return _.attr("class", "basic label-container outer-path"), c && e.look !== "handDrawn" && _.selectChildren("path").attr("style", c), n && e.look !== "handDrawn" && _.selectChildren("path").attr("style", n), Yn(e, _), e.intersect = function(v) {
    return Sn.polygon(e, h, v);
  }, r;
}
$(Sje, "stadium");
async function Eje(i, e) {
  return JY(i, e, {
    rx: 5,
    ry: 5
  });
}
$(Eje, "state");
function xje(i, e, { config: { themeVariables: t } }) {
  const { labelStyles: n, nodeStyles: r } = Gn(e);
  e.labelStyle = n;
  const { cssStyles: s } = e, { lineColor: o, stateBorder: a, nodeBorder: l } = t, c = i.insert("g").attr("class", "node default").attr("id", e.domId || e.id), u = Un.svg(c), d = jn(e, {});
  e.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
  const h = u.circle(0, 0, 14, {
    ...d,
    stroke: o,
    strokeWidth: 2
  }), g = a ?? l, m = u.circle(0, 0, 5, {
    ...d,
    fill: g,
    stroke: g,
    strokeWidth: 2,
    fillStyle: "solid"
  }), _ = c.insert(() => h, ":first-child");
  return _.insert(() => m), s && _.selectAll("path").attr("style", s), r && _.selectAll("path").attr("style", r), Yn(e, _), e.intersect = function(v) {
    return Sn.circle(e, 7, v);
  }, c;
}
$(xje, "stateEnd");
function Lje(i, e, { config: { themeVariables: t } }) {
  const { lineColor: n } = t, r = i.insert("g").attr("class", "node default").attr("id", e.domId || e.id);
  let s;
  if (e.look === "handDrawn") {
    const a = Un.svg(r).circle(0, 0, 14, oXt(n));
    s = r.insert(() => a), s.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
  } else
    s = r.insert("circle", ":first-child"), s.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
  return Yn(e, s), e.intersect = function(o) {
    return Sn.circle(e, 7, o);
  }, r;
}
$(Lje, "stateStart");
async function Tje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = ((e == null ? void 0 : e.padding) || 0) / 2, a = s.width + e.padding, l = s.height + e.padding, c = -s.width / 2 - o, u = -s.height / 2 - o, d = [
    { x: 0, y: 0 },
    { x: a, y: 0 },
    { x: a, y: -l },
    { x: 0, y: -l },
    { x: 0, y: 0 },
    { x: -8, y: 0 },
    { x: a + 8, y: 0 },
    { x: a + 8, y: -l },
    { x: -8, y: -l },
    { x: -8, y: 0 }
  ];
  if (e.look === "handDrawn") {
    const h = Un.svg(r), g = jn(e, {}), m = h.rectangle(c - 8, u, a + 16, l, g), _ = h.line(c, u, c, u + l, g), v = h.line(c + a, u, c + a, u + l, g);
    r.insert(() => _, ":first-child"), r.insert(() => v, ":first-child");
    const w = r.insert(() => m, ":first-child"), { cssStyles: E } = e;
    w.attr("class", "basic label-container").attr("style", Xu(E)), Yn(e, w);
  } else {
    const h = Fw(r, a, l, d);
    n && h.attr("style", n), Yn(e, h);
  }
  return e.intersect = function(h) {
    return Sn.polygon(e, d, h);
  }, r;
}
$(Tje, "subroutine");
async function kje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), a = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), l = -o / 2, c = -a / 2, u = 0.2 * a, d = 0.2 * a, { cssStyles: h } = e, g = Un.svg(r), m = jn(e, {}), _ = [
    { x: l - u / 2, y: c },
    { x: l + o + u / 2, y: c },
    { x: l + o + u / 2, y: c + a },
    { x: l - u / 2, y: c + a }
  ], v = [
    { x: l + o - u / 2, y: c + a },
    { x: l + o + u / 2, y: c + a },
    { x: l + o + u / 2, y: c + a - d }
  ];
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const w = Hr(_), E = g.path(w, m), L = Hr(v), T = g.path(L, { ...m, fillStyle: "solid" }), D = r.insert(() => T, ":first-child");
  return D.insert(() => E, ":first-child"), D.attr("class", "basic label-container"), h && e.look !== "handDrawn" && D.selectAll("path").attr("style", h), n && e.look !== "handDrawn" && D.selectAll("path").attr("style", n), Yn(e, D), e.intersect = function(N) {
    return Sn.polygon(e, _, N);
  }, r;
}
$(kje, "taggedRect");
async function Dje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), l = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), c = l / 4, u = 0.2 * a, d = 0.2 * l, h = l + c, { cssStyles: g } = e, m = Un.svg(r), _ = jn(e, {});
  e.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
  const v = [
    { x: -a / 2 - a / 2 * 0.1, y: h / 2 },
    ...yw(
      -a / 2 - a / 2 * 0.1,
      h / 2,
      a / 2 + a / 2 * 0.1,
      h / 2,
      c,
      0.8
    ),
    { x: a / 2 + a / 2 * 0.1, y: -h / 2 },
    { x: -a / 2 - a / 2 * 0.1, y: -h / 2 }
  ], w = -a / 2 + a / 2 * 0.1, E = -h / 2 - d * 0.4, L = [
    { x: w + a - u, y: (E + l) * 1.4 },
    { x: w + a, y: E + l - d },
    { x: w + a, y: (E + l) * 0.9 },
    ...yw(
      w + a,
      (E + l) * 1.3,
      w + a - u,
      (E + l) * 1.5,
      -l * 0.03,
      0.5
    )
  ], T = Hr(v), D = m.path(T, _), N = Hr(L), R = m.path(N, {
    ..._,
    fillStyle: "solid"
  }), M = r.insert(() => R, ":first-child");
  return M.insert(() => D, ":first-child"), M.attr("class", "basic label-container"), g && e.look !== "handDrawn" && M.selectAll("path").attr("style", g), n && e.look !== "handDrawn" && M.selectAll("path").attr("style", n), M.attr("transform", `translate(0,${-c / 2})`), o.attr(
    "transform",
    `translate(${-a / 2 + (e.padding ?? 0) - (s.x - (s.left ?? 0))},${-l / 2 + (e.padding ?? 0) - c / 2 - (s.y - (s.top ?? 0))})`
  ), Yn(e, M), e.intersect = function(B) {
    return Sn.polygon(e, v, B);
  }, r;
}
$(Dje, "taggedWaveEdgedRectangle");
async function Ije(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = Math.max(s.width + e.padding, (e == null ? void 0 : e.width) || 0), a = Math.max(s.height + e.padding, (e == null ? void 0 : e.height) || 0), l = -o / 2, c = -a / 2, u = r.insert("rect", ":first-child");
  return u.attr("class", "text").attr("style", n).attr("rx", 0).attr("ry", 0).attr("x", l).attr("y", c).attr("width", o).attr("height", a), Yn(e, u), e.intersect = function(d) {
    return Sn.rect(e, d);
  }, r;
}
$(Ije, "text");
var Gen = /* @__PURE__ */ $((i, e, t, n, r, s) => `M${i},${e}
    a${r},${s} 0,0,1 0,${-n}
    l${t},0
    a${r},${s} 0,0,1 0,${n}
    M${t},${-n}
    a${r},${s} 0,0,0 0,${n}
    l${-t},0`, "createCylinderPathD"), qen = /* @__PURE__ */ $((i, e, t, n, r, s) => [
  `M${i},${e}`,
  `M${i + t},${e}`,
  `a${r},${s} 0,0,0 0,${-n}`,
  `l${-t},0`,
  `a${r},${s} 0,0,0 0,${n}`,
  `l${t},0`
].join(" "), "createOuterCylinderPathD"), Ken = /* @__PURE__ */ $((i, e, t, n, r, s) => [`M${i + t / 2},${-n / 2}`, `a${r},${s} 0,0,0 0,${n}`].join(" "), "createInnerCylinderPathD");
async function Nje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o, halfPadding: a } = await ki(
    i,
    e,
    bi(e)
  ), l = e.look === "neo" ? a * 2 : a, c = s.height + l, u = c / 2, d = u / (2.5 + c / 50), h = s.width + d + l, { cssStyles: g } = e;
  let m;
  if (e.look === "handDrawn") {
    const _ = Un.svg(r), v = qen(0, 0, h, c, d, u), w = Ken(0, 0, h, c, d, u), E = _.path(v, jn(e, {})), L = _.path(w, jn(e, { fill: "none" }));
    m = r.insert(() => L, ":first-child"), m = r.insert(() => E, ":first-child"), m.attr("class", "basic label-container"), g && m.attr("style", g);
  } else {
    const _ = Gen(0, 0, h, c, d, u);
    m = r.insert("path", ":first-child").attr("d", _).attr("class", "basic label-container").attr("style", Xu(g)).attr("style", n), m.attr("class", "basic label-container"), g && m.selectAll("path").attr("style", g), n && m.selectAll("path").attr("style", n);
  }
  return m.attr("label-offset-x", d), m.attr("transform", `translate(${-h / 2}, ${c / 2} )`), o.attr(
    "transform",
    `translate(${-(s.width / 2) - d - (s.x - (s.left ?? 0))}, ${-(s.height / 2) - (s.y - (s.top ?? 0))})`
  ), Yn(e, m), e.intersect = function(_) {
    const v = Sn.rect(e, _), w = v.y - (e.y ?? 0);
    if (u != 0 && (Math.abs(w) < (e.height ?? 0) / 2 || Math.abs(w) == (e.height ?? 0) / 2 && Math.abs(v.x - (e.x ?? 0)) > (e.width ?? 0) / 2 - d)) {
      let E = d * d * (1 - w * w / (u * u));
      E != 0 && (E = Math.sqrt(Math.abs(E))), E = d - E, _.x - (e.x ?? 0) > 0 && (E = -E), v.x += E;
    }
    return v;
  }, r;
}
$(Nje, "tiltedCylinder");
async function Rje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = s.width + e.padding, a = s.height + e.padding, l = [
    { x: -3 * a / 6, y: 0 },
    { x: o + 3 * a / 6, y: 0 },
    { x: o, y: -a },
    { x: 0, y: -a }
  ];
  let c;
  const { cssStyles: u } = e;
  if (e.look === "handDrawn") {
    const d = Un.svg(r), h = jn(e, {}), g = Hr(l), m = d.path(g, h);
    c = r.insert(() => m, ":first-child").attr("transform", `translate(${-o / 2}, ${a / 2})`), u && c.attr("style", u);
  } else
    c = Fw(r, o, a, l);
  return n && c.attr("style", n), e.width = o, e.height = a, Yn(e, c), e.intersect = function(d) {
    return Sn.polygon(e, l, d);
  }, r;
}
$(Rje, "trapezoid");
async function Aje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = 60, a = 20, l = Math.max(o, s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), c = Math.max(a, s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), { cssStyles: u } = e, d = Un.svg(r), h = jn(e, {});
  e.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
  const g = [
    { x: -l / 2 * 0.8, y: -c / 2 },
    { x: l / 2 * 0.8, y: -c / 2 },
    { x: l / 2, y: -c / 2 * 0.6 },
    { x: l / 2, y: c / 2 },
    { x: -l / 2, y: c / 2 },
    { x: -l / 2, y: -c / 2 * 0.6 }
  ], m = Hr(g), _ = d.path(m, h), v = r.insert(() => _, ":first-child");
  return v.attr("class", "basic label-container"), u && e.look !== "handDrawn" && v.selectChildren("path").attr("style", u), n && e.look !== "handDrawn" && v.selectChildren("path").attr("style", n), Yn(e, v), e.intersect = function(w) {
    return Sn.polygon(e, g, w);
  }, r;
}
$(Aje, "trapezoidalPentagon");
async function Oje(i, e) {
  var E;
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = ic((E = Qs().flowchart) == null ? void 0 : E.htmlLabels), l = s.width + (e.padding ?? 0), c = l + s.height, u = l + s.height, d = [
    { x: 0, y: 0 },
    { x: u, y: 0 },
    { x: u / 2, y: -c }
  ], { cssStyles: h } = e, g = Un.svg(r), m = jn(e, {});
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const _ = Hr(d), v = g.path(_, m), w = r.insert(() => v, ":first-child").attr("transform", `translate(${-c / 2}, ${c / 2})`);
  return h && e.look !== "handDrawn" && w.selectChildren("path").attr("style", h), n && e.look !== "handDrawn" && w.selectChildren("path").attr("style", n), e.width = l, e.height = c, Yn(e, w), o.attr(
    "transform",
    `translate(${-s.width / 2 - (s.x - (s.left ?? 0))}, ${c / 2 - (s.height + (e.padding ?? 0) / (a ? 2 : 1) - (s.y - (s.top ?? 0)))})`
  ), e.intersect = function(L) {
    return Ct.info("Triangle intersect", e, d, L), Sn.polygon(e, d, L);
  }, r;
}
$(Oje, "triangle");
async function Mje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), l = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), c = l / 8, u = l + c, { cssStyles: d } = e, g = 70 - a, m = g > 0 ? g / 2 : 0, _ = Un.svg(r), v = jn(e, {});
  e.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
  const w = [
    { x: -a / 2 - m, y: u / 2 },
    ...yw(
      -a / 2 - m,
      u / 2,
      a / 2 + m,
      u / 2,
      c,
      0.8
    ),
    { x: a / 2 + m, y: -u / 2 },
    { x: -a / 2 - m, y: -u / 2 }
  ], E = Hr(w), L = _.path(E, v), T = r.insert(() => L, ":first-child");
  return T.attr("class", "basic label-container"), d && e.look !== "handDrawn" && T.selectAll("path").attr("style", d), n && e.look !== "handDrawn" && T.selectAll("path").attr("style", n), T.attr("transform", `translate(0,${-c / 2})`), o.attr(
    "transform",
    `translate(${-a / 2 + (e.padding ?? 0) - (s.x - (s.left ?? 0))},${-l / 2 + (e.padding ?? 0) - c - (s.y - (s.top ?? 0))})`
  ), Yn(e, T), e.intersect = function(D) {
    return Sn.polygon(e, w, D);
  }, r;
}
$(Mje, "waveEdgedRectangle");
async function Pje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s } = await ki(i, e, bi(e)), o = 100, a = 50, l = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), c = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), u = l / c;
  let d = l, h = c;
  d > h * u ? h = d / u : d = h * u, d = Math.max(d, o), h = Math.max(h, a);
  const g = Math.min(h * 0.2, h / 4), m = h + g * 2, { cssStyles: _ } = e, v = Un.svg(r), w = jn(e, {});
  e.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
  const E = [
    { x: -d / 2, y: m / 2 },
    ...yw(-d / 2, m / 2, d / 2, m / 2, g, 1),
    { x: d / 2, y: -m / 2 },
    ...yw(d / 2, -m / 2, -d / 2, -m / 2, g, -1)
  ], L = Hr(E), T = v.path(L, w), D = r.insert(() => T, ":first-child");
  return D.attr("class", "basic label-container"), _ && e.look !== "handDrawn" && D.selectAll("path").attr("style", _), n && e.look !== "handDrawn" && D.selectAll("path").attr("style", n), Yn(e, D), e.intersect = function(N) {
    return Sn.polygon(e, E, N);
  }, r;
}
$(Pje, "waveRectangle");
async function Fje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, label: o } = await ki(i, e, bi(e)), a = Math.max(s.width + (e.padding ?? 0) * 2, (e == null ? void 0 : e.width) ?? 0), l = Math.max(s.height + (e.padding ?? 0) * 2, (e == null ? void 0 : e.height) ?? 0), c = 5, u = -a / 2, d = -l / 2, { cssStyles: h } = e, g = Un.svg(r), m = jn(e, {}), _ = [
    { x: u - c, y: d - c },
    { x: u - c, y: d + l },
    { x: u + a, y: d + l },
    { x: u + a, y: d - c }
  ], v = `M${u - c},${d - c} L${u + a},${d - c} L${u + a},${d + l} L${u - c},${d + l} L${u - c},${d - c}
                M${u - c},${d} L${u + a},${d}
                M${u},${d - c} L${u},${d + l}`;
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const w = g.path(v, m), E = r.insert(() => w, ":first-child");
  return E.attr("transform", `translate(${c / 2}, ${c / 2})`), E.attr("class", "basic label-container"), h && e.look !== "handDrawn" && E.selectAll("path").attr("style", h), n && e.look !== "handDrawn" && E.selectAll("path").attr("style", n), o.attr(
    "transform",
    `translate(${-(s.width / 2) + c / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + c / 2 - (s.y - (s.top ?? 0))})`
  ), Yn(e, E), e.intersect = function(L) {
    return Sn.polygon(e, _, L);
  }, r;
}
$(Fje, "windowPane");
async function VCe(i, e) {
  var be, re, ze, Ve;
  const t = e;
  if (t.alias && (e.label = t.alias), e.look === "handDrawn") {
    const { themeVariables: st } = Ku(), { background: ot } = st, et = {
      ...e,
      id: e.id + "-background",
      look: "default",
      cssStyles: ["stroke: none", `fill: ${ot}`]
    };
    await VCe(i, et);
  }
  const n = Ku();
  e.useHtmlLabels = n.htmlLabels;
  let r = ((be = n.er) == null ? void 0 : be.diagramPadding) ?? 10, s = ((re = n.er) == null ? void 0 : re.entityPadding) ?? 6;
  const { cssStyles: o } = e, { labelStyles: a, nodeStyles: l } = Gn(e);
  if (t.attributes.length === 0 && e.label) {
    const st = {
      rx: 0,
      ry: 0,
      labelPaddingX: r,
      labelPaddingY: r * 1.5
    };
    c0(e.label, n) + st.labelPaddingX * 2 < n.er.minEntityWidth && (e.width = n.er.minEntityWidth);
    const ot = await JY(i, e, st);
    if (!ic(n.htmlLabels)) {
      const et = ot.select("text"), at = (ze = et.node()) == null ? void 0 : ze.getBBox();
      et.attr("transform", `translate(${-at.width / 2}, 0)`);
    }
    return ot;
  }
  n.htmlLabels || (r *= 1.25, s *= 1.25);
  let c = bi(e);
  c || (c = "node default");
  const u = i.insert("g").attr("class", c).attr("id", e.domId || e.id), d = await QI(u, e.label ?? "", n, 0, 0, ["name"], a);
  d.height += s;
  let h = 0;
  const g = [], m = [];
  let _ = 0, v = 0, w = 0, E = 0, L = !0, T = !0;
  for (const st of t.attributes) {
    const ot = await QI(
      u,
      st.type,
      n,
      0,
      h,
      ["attribute-type"],
      a
    );
    _ = Math.max(_, ot.width + r);
    const et = await QI(
      u,
      st.name,
      n,
      0,
      h,
      ["attribute-name"],
      a
    );
    v = Math.max(v, et.width + r);
    const at = await QI(
      u,
      st.keys.join(),
      n,
      0,
      h,
      ["attribute-keys"],
      a
    );
    w = Math.max(w, at.width + r);
    const en = await QI(
      u,
      st.comment,
      n,
      0,
      h,
      ["attribute-comment"],
      a
    );
    E = Math.max(E, en.width + r);
    const sn = Math.max(ot.height, et.height, at.height, en.height) + s;
    m.push({ yOffset: h, rowHeight: sn }), h += sn;
  }
  let D = 4;
  w <= r && (L = !1, w = 0, D--), E <= r && (T = !1, E = 0, D--);
  const N = u.node().getBBox();
  if (d.width + r * 2 - (_ + v + w + E) > 0) {
    const st = d.width + r * 2 - (_ + v + w + E);
    _ += st / D, v += st / D, w > 0 && (w += st / D), E > 0 && (E += st / D);
  }
  const R = _ + v + w + E, M = Un.svg(u), B = jn(e, {});
  e.look !== "handDrawn" && (B.roughness = 0, B.fillStyle = "solid");
  let H = 0;
  m.length > 0 && (H = m.reduce((st, ot) => st + ((ot == null ? void 0 : ot.rowHeight) ?? 0), 0));
  const j = Math.max(N.width + r * 2, (e == null ? void 0 : e.width) || 0, R), K = Math.max((H ?? 0) + d.height, (e == null ? void 0 : e.height) || 0), X = -j / 2, Y = -K / 2;
  u.selectAll("g:not(:first-child)").each((st, ot, et) => {
    const at = ls(et[ot]), en = at.attr("transform");
    let sn = 0, Vt = 0;
    if (en) {
      const pi = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(en);
      pi && (sn = parseFloat(pi[1]), Vt = parseFloat(pi[2]), at.attr("class").includes("attribute-name") ? sn += _ : at.attr("class").includes("attribute-keys") ? sn += _ + v : at.attr("class").includes("attribute-comment") && (sn += _ + v + w));
    }
    at.attr(
      "transform",
      `translate(${X + r / 2 + sn}, ${Vt + Y + d.height + s / 2})`
    );
  }), u.select(".name").attr("transform", "translate(" + -d.width / 2 + ", " + (Y + s / 2) + ")");
  const G = M.rectangle(X, Y, j, K, B), Q = u.insert(() => G, ":first-child").attr("style", o.join("")), { themeVariables: oe } = Ku(), { rowEven: Z, rowOdd: pe, nodeBorder: J } = oe;
  g.push(0);
  for (const [st, ot] of m.entries()) {
    const at = (st + 1) % 2 === 0 && ot.yOffset !== 0, en = M.rectangle(X, d.height + Y + (ot == null ? void 0 : ot.yOffset), j, ot == null ? void 0 : ot.rowHeight, {
      ...B,
      fill: at ? Z : pe,
      stroke: J
    });
    u.insert(() => en, "g.label").attr("style", o.join("")).attr("class", `row-rect-${at ? "even" : "odd"}`);
  }
  let ae = M.line(X, d.height + Y, j + X, d.height + Y, B);
  u.insert(() => ae).attr("class", "divider"), ae = M.line(_ + X, d.height + Y, _ + X, K + Y, B), u.insert(() => ae).attr("class", "divider"), L && (ae = M.line(
    _ + v + X,
    d.height + Y,
    _ + v + X,
    K + Y,
    B
  ), u.insert(() => ae).attr("class", "divider")), T && (ae = M.line(
    _ + v + w + X,
    d.height + Y,
    _ + v + w + X,
    K + Y,
    B
  ), u.insert(() => ae).attr("class", "divider"));
  for (const st of g)
    ae = M.line(
      X,
      d.height + Y + st,
      j + X,
      d.height + Y + st,
      B
    ), u.insert(() => ae).attr("class", "divider");
  if (Yn(e, Q), l && e.look !== "handDrawn") {
    const st = l.split(";"), ot = (Ve = st == null ? void 0 : st.filter((et) => et.includes("stroke"))) == null ? void 0 : Ve.map((et) => `${et}`).join("; ");
    u.selectAll("path").attr("style", ot ?? ""), u.selectAll(".row-rect-even path").attr("style", l);
  }
  return e.intersect = function(st) {
    return Sn.rect(e, st);
  }, u;
}
$(VCe, "erBox");
async function QI(i, e, t, n = 0, r = 0, s = [], o = "") {
  const a = i.insert("g").attr("class", `label ${s.join(" ")}`).attr("transform", `translate(${n}, ${r})`).attr("style", o);
  e !== D2e(e) && (e = D2e(e), e = e.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
  const l = a.node().appendChild(
    await Mw(
      a,
      e,
      {
        width: c0(e, t) + 100,
        style: o,
        useHtmlLabels: t.htmlLabels
      },
      t
    )
  );
  if (e.includes("&lt;") || e.includes("&gt;")) {
    let u = l.children[0];
    for (u.textContent = u.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">"); u.childNodes[0]; )
      u = u.childNodes[0], u.textContent = u.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
  }
  let c = l.getBBox();
  if (ic(t.htmlLabels)) {
    const u = l.children[0];
    u.style.textAlign = "start";
    const d = ls(l);
    c = u.getBoundingClientRect(), d.attr("width", c.width), d.attr("height", c.height);
  }
  return c;
}
$(QI, "addText");
async function Bje(i, e, t, n, r = t.class.padding ?? 12) {
  const s = n ? 0 : 3, o = i.insert("g").attr("class", bi(e)).attr("id", e.domId || e.id);
  let a = null, l = null, c = null, u = null, d = 0, h = 0, g = 0;
  if (a = o.insert("g").attr("class", "annotation-group text"), e.annotations.length > 0) {
    const E = e.annotations[0];
    await mF(a, { text: `«${E}»` }, 0), d = a.node().getBBox().height;
  }
  l = o.insert("g").attr("class", "label-group text"), await mF(l, e, 0, ["font-weight: bolder"]);
  const m = l.node().getBBox();
  h = m.height, c = o.insert("g").attr("class", "members-group text");
  let _ = 0;
  for (const E of e.members) {
    const L = await mF(c, E, _, [E.parseClassifier()]);
    _ += L + s;
  }
  g = c.node().getBBox().height, g <= 0 && (g = r / 2), u = o.insert("g").attr("class", "methods-group text");
  let v = 0;
  for (const E of e.methods) {
    const L = await mF(u, E, v, [E.parseClassifier()]);
    v += L + s;
  }
  let w = o.node().getBBox();
  if (a !== null) {
    const E = a.node().getBBox();
    a.attr("transform", `translate(${-E.width / 2})`);
  }
  return l.attr("transform", `translate(${-m.width / 2}, ${d})`), w = o.node().getBBox(), c.attr(
    "transform",
    `translate(0, ${d + h + r * 2})`
  ), w = o.node().getBBox(), u.attr(
    "transform",
    `translate(0, ${d + h + (g ? g + r * 4 : r * 2)})`
  ), w = o.node().getBBox(), { shapeSvg: o, bbox: w };
}
$(Bje, "textHelper");
async function mF(i, e, t, n = []) {
  const r = i.insert("g").attr("class", "label").attr("style", n.join("; ")), s = Ku();
  let o = "useHtmlLabels" in e ? e.useHtmlLabels : ic(s.htmlLabels) ?? !0, a = "";
  "text" in e ? a = e.text : a = e.label, !o && a.startsWith("\\") && (a = a.substring(1)), AA(a) && (o = !0);
  const l = await Mw(
    r,
    Z0e(vk(a)),
    {
      width: c0(a, s) + 50,
      // Add room for error when splitting text into multiple lines
      classes: "markdown-node-label",
      useHtmlLabels: o
    },
    s
  );
  let c, u = 1;
  if (o) {
    const d = l.children[0], h = ls(l);
    u = d.innerHTML.split("<br>").length, d.innerHTML.includes("</math>") && (u += d.innerHTML.split("<mrow>").length - 1);
    const g = d.getElementsByTagName("img");
    if (g) {
      const m = a.replace(/<img[^>]*>/g, "").trim() === "";
      await Promise.all(
        [...g].map(
          (_) => new Promise((v) => {
            function w() {
              var E;
              if (_.style.display = "flex", _.style.flexDirection = "column", m) {
                const L = ((E = s.fontSize) == null ? void 0 : E.toString()) ?? window.getComputedStyle(document.body).fontSize, D = parseInt(L, 10) * 5 + "px";
                _.style.minWidth = D, _.style.maxWidth = D;
              } else
                _.style.width = "100%";
              v(_);
            }
            $(w, "setupImage"), setTimeout(() => {
              _.complete && w();
            }), _.addEventListener("error", w), _.addEventListener("load", w);
          })
        )
      );
    }
    c = d.getBoundingClientRect(), h.attr("width", c.width), h.attr("height", c.height);
  } else {
    n.includes("font-weight: bolder") && ls(l).selectAll("tspan").attr("font-weight", ""), u = l.children.length;
    const d = l.children[0];
    (l.textContent === "" || l.textContent.includes("&gt")) && (d.textContent = a[0] + a.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), a[1] === " " && (d.textContent = d.textContent[0] + " " + d.textContent.substring(1))), d.textContent === "undefined" && (d.textContent = ""), c = l.getBBox();
  }
  return r.attr("transform", "translate(0," + (-c.height / (2 * u) + t) + ")"), c.height;
}
$(mF, "addText");
async function Hje(i, e) {
  var B, H;
  const t = Qs(), n = t.class.padding ?? 12, r = n, s = e.useHtmlLabels ?? ic(t.htmlLabels) ?? !0, o = e;
  o.annotations = o.annotations ?? [], o.members = o.members ?? [], o.methods = o.methods ?? [];
  const { shapeSvg: a, bbox: l } = await Bje(i, e, t, s, r), { labelStyles: c, nodeStyles: u } = Gn(e);
  e.labelStyle = c, e.cssStyles = o.styles || "";
  const d = ((B = o.styles) == null ? void 0 : B.join(";")) || u || "";
  e.cssStyles || (e.cssStyles = d.replaceAll("!important", "").split(";"));
  const h = o.members.length === 0 && o.methods.length === 0 && !((H = t.class) != null && H.hideEmptyMembersBox), g = Un.svg(a), m = jn(e, {});
  e.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
  const _ = l.width;
  let v = l.height;
  o.members.length === 0 && o.methods.length === 0 ? v += r : o.members.length > 0 && o.methods.length === 0 && (v += r * 2);
  const w = -_ / 2, E = -v / 2, L = g.rectangle(
    w - n,
    E - n - (h ? n : o.members.length === 0 && o.methods.length === 0 ? -n / 2 : 0),
    _ + 2 * n,
    v + 2 * n + (h ? n * 2 : o.members.length === 0 && o.methods.length === 0 ? -n : 0),
    m
  ), T = a.insert(() => L, ":first-child");
  T.attr("class", "basic label-container");
  const D = T.node().getBBox();
  a.selectAll(".text").each((j, K, X) => {
    var pe;
    const Y = ls(X[K]), G = Y.attr("transform");
    let Q = 0;
    if (G) {
      const ae = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(G);
      ae && (Q = parseFloat(ae[2]));
    }
    let oe = Q + E + n - (h ? n : o.members.length === 0 && o.methods.length === 0 ? -n / 2 : 0);
    s || (oe -= 4);
    let Z = w;
    (Y.attr("class").includes("label-group") || Y.attr("class").includes("annotation-group")) && (Z = -((pe = Y.node()) == null ? void 0 : pe.getBBox().width) / 2 || 0, a.selectAll("text").each(function(J, ae, be) {
      window.getComputedStyle(be[ae]).textAnchor === "middle" && (Z = 0);
    })), Y.attr("transform", `translate(${Z}, ${oe})`);
  });
  const N = a.select(".annotation-group").node().getBBox().height - (h ? n / 2 : 0) || 0, R = a.select(".label-group").node().getBBox().height - (h ? n / 2 : 0) || 0, M = a.select(".members-group").node().getBBox().height - (h ? n / 2 : 0) || 0;
  if (o.members.length > 0 || o.methods.length > 0 || h) {
    const j = g.line(
      D.x,
      N + R + E + n,
      D.x + D.width,
      N + R + E + n,
      m
    );
    a.insert(() => j).attr("class", "divider").attr("style", d);
  }
  if (h || o.members.length > 0 || o.methods.length > 0) {
    const j = g.line(
      D.x,
      N + R + M + E + r * 2 + n,
      D.x + D.width,
      N + R + M + E + n + r * 2,
      m
    );
    a.insert(() => j).attr("class", "divider").attr("style", d);
  }
  if (o.look !== "handDrawn" && a.selectAll("path").attr("style", d), T.select(":nth-child(2)").attr("style", d), a.selectAll(".divider").select("path").attr("style", d), e.labelStyle ? a.selectAll("span").attr("style", e.labelStyle) : a.selectAll("span").attr("style", d), !s) {
    const j = RegExp(/color\s*:\s*([^;]*)/), K = j.exec(d);
    if (K) {
      const X = K[0].replace("color", "fill");
      a.selectAll("tspan").attr("style", X);
    } else if (c) {
      const X = j.exec(c);
      if (X) {
        const Y = X[0].replace("color", "fill");
        a.selectAll("tspan").attr("style", Y);
      }
    }
  }
  return Yn(e, T), e.intersect = function(j) {
    return Sn.rect(e, j);
  }, a;
}
$(Hje, "classBox");
async function Wje(i, e) {
  var N, R;
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const r = e, s = e, o = 20, a = 20, l = "verifyMethod" in e, c = bi(e), u = i.insert("g").attr("class", c).attr("id", e.domId ?? e.id);
  let d;
  l ? d = await L_(
    u,
    `&lt;&lt;${r.type}&gt;&gt;`,
    0,
    e.labelStyle
  ) : d = await L_(u, "&lt;&lt;Element&gt;&gt;", 0, e.labelStyle);
  let h = d;
  const g = await L_(
    u,
    r.name,
    h,
    e.labelStyle + "; font-weight: bold;"
  );
  if (h += g + a, l) {
    const M = await L_(
      u,
      `${r.requirementId ? `ID: ${r.requirementId}` : ""}`,
      h,
      e.labelStyle
    );
    h += M;
    const B = await L_(
      u,
      `${r.text ? `Text: ${r.text}` : ""}`,
      h,
      e.labelStyle
    );
    h += B;
    const H = await L_(
      u,
      `${r.risk ? `Risk: ${r.risk}` : ""}`,
      h,
      e.labelStyle
    );
    h += H, await L_(
      u,
      `${r.verifyMethod ? `Verification: ${r.verifyMethod}` : ""}`,
      h,
      e.labelStyle
    );
  } else {
    const M = await L_(
      u,
      `${s.type ? `Type: ${s.type}` : ""}`,
      h,
      e.labelStyle
    );
    h += M, await L_(
      u,
      `${s.docRef ? `Doc Ref: ${s.docRef}` : ""}`,
      h,
      e.labelStyle
    );
  }
  const m = (((N = u.node()) == null ? void 0 : N.getBBox().width) ?? 200) + o, _ = (((R = u.node()) == null ? void 0 : R.getBBox().height) ?? 200) + o, v = -m / 2, w = -_ / 2, E = Un.svg(u), L = jn(e, {});
  e.look !== "handDrawn" && (L.roughness = 0, L.fillStyle = "solid");
  const T = E.rectangle(v, w, m, _, L), D = u.insert(() => T, ":first-child");
  if (D.attr("class", "basic label-container").attr("style", n), u.selectAll(".label").each((M, B, H) => {
    const j = ls(H[B]), K = j.attr("transform");
    let X = 0, Y = 0;
    if (K) {
      const Z = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(K);
      Z && (X = parseFloat(Z[1]), Y = parseFloat(Z[2]));
    }
    const G = Y - _ / 2;
    let Q = v + o / 2;
    (B === 0 || B === 1) && (Q = X), j.attr("transform", `translate(${Q}, ${G + o})`);
  }), h > d + g + a) {
    const M = E.line(
      v,
      w + d + g + a,
      v + m,
      w + d + g + a,
      L
    );
    u.insert(() => M).attr("style", n);
  }
  return Yn(e, D), e.intersect = function(M) {
    return Sn.rect(e, M);
  }, u;
}
$(Wje, "requirementBox");
async function L_(i, e, t, n = "") {
  if (e === "")
    return 0;
  const r = i.insert("g").attr("class", "label").attr("style", n), s = Qs(), o = s.htmlLabels ?? !0, a = await Mw(
    r,
    Z0e(vk(e)),
    {
      width: c0(e, s) + 50,
      // Add room for error when splitting text into multiple lines
      classes: "markdown-node-label",
      useHtmlLabels: o,
      style: n
    },
    s
  );
  let l;
  if (o) {
    const c = a.children[0], u = ls(a);
    l = c.getBoundingClientRect(), u.attr("width", l.width), u.attr("height", l.height);
  } else {
    const c = a.children[0];
    for (const u of c.children)
      u.textContent = u.textContent.replaceAll("&gt;", ">").replaceAll("&lt;", "<"), n && u.setAttribute("style", n);
    l = a.getBBox(), l.height += 6;
  }
  return r.attr("transform", `translate(${-l.width / 2},${-l.height / 2 + t})`), l.height;
}
$(L_, "addText");
var Yen = /* @__PURE__ */ $((i) => {
  switch (i) {
    case "Very High":
      return "red";
    case "High":
      return "orange";
    case "Medium":
      return null;
    // no stroke
    case "Low":
      return "blue";
    case "Very Low":
      return "lightblue";
  }
}, "colorFromPriority");
async function Vje(i, e, { config: t }) {
  var K, X;
  const { labelStyles: n, nodeStyles: r } = Gn(e);
  e.labelStyle = n || "";
  const s = 10, o = e.width;
  e.width = (e.width ?? 200) - 10;
  const {
    shapeSvg: a,
    bbox: l,
    label: c
  } = await ki(i, e, bi(e)), u = e.padding || 10;
  let d = "", h;
  "ticket" in e && e.ticket && ((K = t == null ? void 0 : t.kanban) != null && K.ticketBaseUrl) && (d = (X = t == null ? void 0 : t.kanban) == null ? void 0 : X.ticketBaseUrl.replace("#TICKET#", e.ticket), h = a.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", d).attr("target", "_blank"));
  const g = {
    useHtmlLabels: e.useHtmlLabels,
    labelStyle: e.labelStyle || "",
    width: e.width,
    img: e.img,
    padding: e.padding || 8,
    centerLabel: !1
  };
  let m, _;
  h ? { label: m, bbox: _ } = await Vne(
    h,
    "ticket" in e && e.ticket || "",
    g
  ) : { label: m, bbox: _ } = await Vne(
    a,
    "ticket" in e && e.ticket || "",
    g
  );
  const { label: v, bbox: w } = await Vne(
    a,
    "assigned" in e && e.assigned || "",
    g
  );
  e.width = o;
  const E = 10, L = (e == null ? void 0 : e.width) || 0, T = Math.max(_.height, w.height) / 2, D = Math.max(l.height + E * 2, (e == null ? void 0 : e.height) || 0) + T, N = -L / 2, R = -D / 2;
  c.attr(
    "transform",
    "translate(" + (u - L / 2) + ", " + (-T - l.height / 2) + ")"
  ), m.attr(
    "transform",
    "translate(" + (u - L / 2) + ", " + (-T + l.height / 2) + ")"
  ), v.attr(
    "transform",
    "translate(" + (u + L / 2 - w.width - 2 * s) + ", " + (-T + l.height / 2) + ")"
  );
  let M;
  const { rx: B, ry: H } = e, { cssStyles: j } = e;
  if (e.look === "handDrawn") {
    const Y = Un.svg(a), G = jn(e, {}), Q = B || H ? Y.path(Pw(N, R, L, D, B || 0), G) : Y.rectangle(N, R, L, D, G);
    M = a.insert(() => Q, ":first-child"), M.attr("class", "basic label-container").attr("style", j || null);
  } else {
    M = a.insert("rect", ":first-child"), M.attr("class", "basic label-container __APA__").attr("style", r).attr("rx", B ?? 5).attr("ry", H ?? 5).attr("x", N).attr("y", R).attr("width", L).attr("height", D);
    const Y = "priority" in e && e.priority;
    if (Y) {
      const G = a.append("line"), Q = N + 2, oe = R + Math.floor((B ?? 0) / 2), Z = R + D - Math.floor((B ?? 0) / 2);
      G.attr("x1", Q).attr("y1", oe).attr("x2", Q).attr("y2", Z).attr("stroke-width", "4").attr("stroke", Yen(Y));
    }
  }
  return Yn(e, M), e.height = D, e.intersect = function(Y) {
    return Sn.rect(e, Y);
  }, a;
}
$(Vje, "kanbanItem");
async function Uje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, halfPadding: o, label: a } = await ki(
    i,
    e,
    bi(e)
  ), l = s.width + 10 * o, c = s.height + 8 * o, u = 0.15 * l, { cssStyles: d } = e, h = s.width + 20, g = s.height + 20, m = Math.max(l, h), _ = Math.max(c, g);
  a.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`);
  let v;
  const w = `M0 0 
    a${u},${u} 1 0,0 ${m * 0.25},${-1 * _ * 0.1}
    a${u},${u} 1 0,0 ${m * 0.25},0
    a${u},${u} 1 0,0 ${m * 0.25},0
    a${u},${u} 1 0,0 ${m * 0.25},${_ * 0.1}

    a${u},${u} 1 0,0 ${m * 0.15},${_ * 0.33}
    a${u * 0.8},${u * 0.8} 1 0,0 0,${_ * 0.34}
    a${u},${u} 1 0,0 ${-1 * m * 0.15},${_ * 0.33}

    a${u},${u} 1 0,0 ${-1 * m * 0.25},${_ * 0.15}
    a${u},${u} 1 0,0 ${-1 * m * 0.25},0
    a${u},${u} 1 0,0 ${-1 * m * 0.25},0
    a${u},${u} 1 0,0 ${-1 * m * 0.25},${-1 * _ * 0.15}

    a${u},${u} 1 0,0 ${-1 * m * 0.1},${-1 * _ * 0.33}
    a${u * 0.8},${u * 0.8} 1 0,0 0,${-1 * _ * 0.34}
    a${u},${u} 1 0,0 ${m * 0.1},${-1 * _ * 0.33}
  H0 V0 Z`;
  if (e.look === "handDrawn") {
    const E = Un.svg(r), L = jn(e, {}), T = E.path(w, L);
    v = r.insert(() => T, ":first-child"), v.attr("class", "basic label-container").attr("style", Xu(d));
  } else
    v = r.insert("path", ":first-child").attr("class", "basic label-container").attr("style", n).attr("d", w);
  return v.attr("transform", `translate(${-m / 2}, ${-_ / 2})`), Yn(e, v), e.calcIntersect = function(E, L) {
    return Sn.rect(E, L);
  }, e.intersect = function(E) {
    return Ct.info("Bang intersect", e, E), Sn.rect(e, E);
  }, r;
}
$(Uje, "bang");
async function zje(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, halfPadding: o, label: a } = await ki(
    i,
    e,
    bi(e)
  ), l = s.width + 2 * o, c = s.height + 2 * o, u = 0.15 * l, d = 0.25 * l, h = 0.35 * l, g = 0.2 * l, { cssStyles: m } = e;
  let _;
  const v = `M0 0 
    a${u},${u} 0 0,1 ${l * 0.25},${-1 * l * 0.1}
    a${h},${h} 1 0,1 ${l * 0.4},${-1 * l * 0.1}
    a${d},${d} 1 0,1 ${l * 0.35},${l * 0.2}

    a${u},${u} 1 0,1 ${l * 0.15},${c * 0.35}
    a${g},${g} 1 0,1 ${-1 * l * 0.15},${c * 0.65}

    a${d},${u} 1 0,1 ${-1 * l * 0.25},${l * 0.15}
    a${h},${h} 1 0,1 ${-1 * l * 0.5},0
    a${u},${u} 1 0,1 ${-1 * l * 0.25},${-1 * l * 0.15}

    a${u},${u} 1 0,1 ${-1 * l * 0.1},${-1 * c * 0.35}
    a${g},${g} 1 0,1 ${l * 0.1},${-1 * c * 0.65}
  H0 V0 Z`;
  if (e.look === "handDrawn") {
    const w = Un.svg(r), E = jn(e, {}), L = w.path(v, E);
    _ = r.insert(() => L, ":first-child"), _.attr("class", "basic label-container").attr("style", Xu(m));
  } else
    _ = r.insert("path", ":first-child").attr("class", "basic label-container").attr("style", n).attr("d", v);
  return a.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`), _.attr("transform", `translate(${-l / 2}, ${-c / 2})`), Yn(e, _), e.calcIntersect = function(w, E) {
    return Sn.rect(w, E);
  }, e.intersect = function(w) {
    return Ct.info("Cloud intersect", e, w), Sn.rect(e, w);
  }, r;
}
$(zje, "cloud");
async function $je(i, e) {
  const { labelStyles: t, nodeStyles: n } = Gn(e);
  e.labelStyle = t;
  const { shapeSvg: r, bbox: s, halfPadding: o, label: a } = await ki(
    i,
    e,
    bi(e)
  ), l = s.width + 8 * o, c = s.height + 2 * o, u = 5, d = `
    M${-l / 2} ${c / 2 - u}
    v${-c + 2 * u}
    q0,-${u} ${u},-${u}
    h${l - 2 * u}
    q${u},0 ${u},${u}
    v${c - 2 * u}
    q0,${u} -${u},${u}
    h${-l + 2 * u}
    q-${u},0 -${u},-${u}
    Z
  `, h = r.append("path").attr("id", "node-" + e.id).attr("class", "node-bkg node-" + e.type).attr("style", n).attr("d", d);
  return r.append("line").attr("class", "node-line-").attr("x1", -l / 2).attr("y1", c / 2).attr("x2", l / 2).attr("y2", c / 2), a.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`), r.append(() => a.node()), Yn(e, h), e.calcIntersect = function(g, m) {
    return Sn.rect(g, m);
  }, e.intersect = function(g) {
    return Sn.rect(e, g);
  }, r;
}
$($je, "defaultMindmapNode");
async function jje(i, e) {
  const t = {
    padding: e.padding ?? 0
  };
  return WCe(i, e, t);
}
$(jje, "mindmapCircle");
var Xen = [
  {
    semanticName: "Process",
    name: "Rectangle",
    shortName: "rect",
    description: "Standard process shape",
    aliases: ["proc", "process", "rectangle"],
    internalAliases: ["squareRect"],
    handler: wje
  },
  {
    semanticName: "Event",
    name: "Rounded Rectangle",
    shortName: "rounded",
    description: "Represents an event",
    aliases: ["event"],
    internalAliases: ["roundedRect"],
    handler: vje
  },
  {
    semanticName: "Terminal Point",
    name: "Stadium",
    shortName: "stadium",
    description: "Terminal point",
    aliases: ["terminal", "pill"],
    handler: Sje
  },
  {
    semanticName: "Subprocess",
    name: "Framed Rectangle",
    shortName: "fr-rect",
    description: "Subprocess",
    aliases: ["subprocess", "subproc", "framed-rectangle", "subroutine"],
    handler: Tje
  },
  {
    semanticName: "Database",
    name: "Cylinder",
    shortName: "cyl",
    description: "Database storage",
    aliases: ["db", "database", "cylinder"],
    handler: G$e
  },
  {
    semanticName: "Start",
    name: "Circle",
    shortName: "circle",
    description: "Starting point",
    aliases: ["circ"],
    handler: WCe
  },
  {
    semanticName: "Bang",
    name: "Bang",
    shortName: "bang",
    description: "Bang",
    aliases: ["bang"],
    handler: Uje
  },
  {
    semanticName: "Cloud",
    name: "Cloud",
    shortName: "cloud",
    description: "cloud",
    aliases: ["cloud"],
    handler: zje
  },
  {
    semanticName: "Decision",
    name: "Diamond",
    shortName: "diam",
    description: "Decision-making step",
    aliases: ["decision", "diamond", "question"],
    handler: mje
  },
  {
    semanticName: "Prepare Conditional",
    name: "Hexagon",
    shortName: "hex",
    description: "Preparation or condition step",
    aliases: ["hexagon", "prepare"],
    handler: J$e
  },
  {
    semanticName: "Data Input/Output",
    name: "Lean Right",
    shortName: "lean-r",
    description: "Represents input or output",
    aliases: ["lean-right", "in-out"],
    internalAliases: ["lean_right"],
    handler: cje
  },
  {
    semanticName: "Data Input/Output",
    name: "Lean Left",
    shortName: "lean-l",
    description: "Represents output or input",
    aliases: ["lean-left", "out-in"],
    internalAliases: ["lean_left"],
    handler: lje
  },
  {
    semanticName: "Priority Action",
    name: "Trapezoid Base Bottom",
    shortName: "trap-b",
    description: "Priority action",
    aliases: ["priority", "trapezoid-bottom", "trapezoid"],
    handler: Rje
  },
  {
    semanticName: "Manual Operation",
    name: "Trapezoid Base Top",
    shortName: "trap-t",
    description: "Represents a manual task",
    aliases: ["manual", "trapezoid-top", "inv-trapezoid"],
    internalAliases: ["inv_trapezoid"],
    handler: oje
  },
  {
    semanticName: "Stop",
    name: "Double Circle",
    shortName: "dbl-circ",
    description: "Represents a stop point",
    aliases: ["double-circle"],
    internalAliases: ["doublecircle"],
    handler: K$e
  },
  {
    semanticName: "Text Block",
    name: "Text Block",
    shortName: "text",
    description: "Text block",
    handler: Ije
  },
  {
    semanticName: "Card",
    name: "Notched Rectangle",
    shortName: "notch-rect",
    description: "Represents a card",
    aliases: ["card", "notched-rectangle"],
    handler: B$e
  },
  {
    semanticName: "Lined/Shaded Process",
    name: "Lined Rectangle",
    shortName: "lin-rect",
    description: "Lined process shape",
    aliases: ["lined-rectangle", "lined-process", "lin-proc", "shaded-process"],
    handler: yje
  },
  {
    semanticName: "Start",
    name: "Small Circle",
    shortName: "sm-circ",
    description: "Small starting point",
    aliases: ["start", "small-circle"],
    internalAliases: ["stateStart"],
    handler: Lje
  },
  {
    semanticName: "Stop",
    name: "Framed Circle",
    shortName: "fr-circ",
    description: "Stop point",
    aliases: ["stop", "framed-circle"],
    internalAliases: ["stateEnd"],
    handler: xje
  },
  {
    semanticName: "Fork/Join",
    name: "Filled Rectangle",
    shortName: "fork",
    description: "Fork or join in process flow",
    aliases: ["join"],
    internalAliases: ["forkJoin"],
    handler: Z$e
  },
  {
    semanticName: "Collate",
    name: "Hourglass",
    shortName: "hourglass",
    description: "Represents a collate operation",
    aliases: ["hourglass", "collate"],
    handler: eje
  },
  {
    semanticName: "Comment",
    name: "Curly Brace",
    shortName: "brace",
    description: "Adds a comment",
    aliases: ["comment", "brace-l"],
    handler: U$e
  },
  {
    semanticName: "Comment Right",
    name: "Curly Brace",
    shortName: "brace-r",
    description: "Adds a comment",
    handler: z$e
  },
  {
    semanticName: "Comment with braces on both sides",
    name: "Curly Braces",
    shortName: "braces",
    description: "Adds a comment",
    handler: $$e
  },
  {
    semanticName: "Com Link",
    name: "Lightning Bolt",
    shortName: "bolt",
    description: "Communication link",
    aliases: ["com-link", "lightning-bolt"],
    handler: uje
  },
  {
    semanticName: "Document",
    name: "Document",
    shortName: "doc",
    description: "Represents a document",
    aliases: ["doc", "document"],
    handler: Mje
  },
  {
    semanticName: "Delay",
    name: "Half-Rounded Rectangle",
    shortName: "delay",
    description: "Represents a delay",
    aliases: ["half-rounded-rectangle"],
    handler: Q$e
  },
  {
    semanticName: "Direct Access Storage",
    name: "Horizontal Cylinder",
    shortName: "h-cyl",
    description: "Direct access storage",
    aliases: ["das", "horizontal-cylinder"],
    handler: Nje
  },
  {
    semanticName: "Disk Storage",
    name: "Lined Cylinder",
    shortName: "lin-cyl",
    description: "Disk storage",
    aliases: ["disk", "lined-cylinder"],
    handler: dje
  },
  {
    semanticName: "Display",
    name: "Curved Trapezoid",
    shortName: "curv-trap",
    description: "Represents a display",
    aliases: ["curved-trapezoid", "display"],
    handler: j$e
  },
  {
    semanticName: "Divided Process",
    name: "Divided Rectangle",
    shortName: "div-rect",
    description: "Divided process shape",
    aliases: ["div-proc", "divided-rectangle", "divided-process"],
    handler: q$e
  },
  {
    semanticName: "Extract",
    name: "Triangle",
    shortName: "tri",
    description: "Extraction process",
    aliases: ["extract", "triangle"],
    handler: Oje
  },
  {
    semanticName: "Internal Storage",
    name: "Window Pane",
    shortName: "win-pane",
    description: "Internal storage",
    aliases: ["internal-storage", "window-pane"],
    handler: Fje
  },
  {
    semanticName: "Junction",
    name: "Filled Circle",
    shortName: "f-circ",
    description: "Junction point",
    aliases: ["junction", "filled-circle"],
    handler: Y$e
  },
  {
    semanticName: "Loop Limit",
    name: "Trapezoidal Pentagon",
    shortName: "notch-pent",
    description: "Loop limit step",
    aliases: ["loop-limit", "notched-pentagon"],
    handler: Aje
  },
  {
    semanticName: "Manual File",
    name: "Flipped Triangle",
    shortName: "flip-tri",
    description: "Manual file operation",
    aliases: ["manual-file", "flipped-triangle"],
    handler: X$e
  },
  {
    semanticName: "Manual Input",
    name: "Sloped Rectangle",
    shortName: "sl-rect",
    description: "Manual input step",
    aliases: ["manual-input", "sloped-rectangle"],
    handler: Cje
  },
  {
    semanticName: "Multi-Document",
    name: "Stacked Document",
    shortName: "docs",
    description: "Multiple documents",
    aliases: ["documents", "st-doc", "stacked-document"],
    handler: gje
  },
  {
    semanticName: "Multi-Process",
    name: "Stacked Rectangle",
    shortName: "st-rect",
    description: "Multiple processes",
    aliases: ["procs", "processes", "stacked-rectangle"],
    handler: fje
  },
  {
    semanticName: "Stored Data",
    name: "Bow Tie Rectangle",
    shortName: "bow-rect",
    description: "Stored data",
    aliases: ["stored-data", "bow-tie-rectangle"],
    handler: F$e
  },
  {
    semanticName: "Summary",
    name: "Crossed Circle",
    shortName: "cross-circ",
    description: "Summary",
    aliases: ["summary", "crossed-circle"],
    handler: V$e
  },
  {
    semanticName: "Tagged Document",
    name: "Tagged Document",
    shortName: "tag-doc",
    description: "Tagged document",
    aliases: ["tag-doc", "tagged-document"],
    handler: Dje
  },
  {
    semanticName: "Tagged Process",
    name: "Tagged Rectangle",
    shortName: "tag-rect",
    description: "Tagged process",
    aliases: ["tagged-rectangle", "tag-proc", "tagged-process"],
    handler: kje
  },
  {
    semanticName: "Paper Tape",
    name: "Flag",
    shortName: "flag",
    description: "Paper tape",
    aliases: ["paper-tape"],
    handler: Pje
  },
  {
    semanticName: "Odd",
    name: "Odd",
    shortName: "odd",
    description: "Odd shape",
    internalAliases: ["rect_left_inv_arrow"],
    handler: _je
  },
  {
    semanticName: "Lined Document",
    name: "Lined Document",
    shortName: "lin-doc",
    description: "Lined document",
    aliases: ["lined-document"],
    handler: hje
  }
], Zen = /* @__PURE__ */ $(() => {
  const e = [
    ...Object.entries({
      // States
      state: Eje,
      choice: H$e,
      note: pje,
      // Rectangles
      rectWithTitle: bje,
      labelRect: aje,
      // Icons
      iconSquare: rje,
      iconCircle: nje,
      icon: tje,
      iconRounded: ije,
      imageSquare: sje,
      anchor: P$e,
      // Kanban diagram
      kanbanItem: Vje,
      //Mindmap diagram
      mindmapCircle: jje,
      defaultMindmapNode: $je,
      // class diagram
      classBox: Hje,
      // er diagram
      erBox: VCe,
      // Requirement diagram
      requirementBox: Wje
    }),
    ...Xen.flatMap((t) => [
      t.shortName,
      ..."aliases" in t ? t.aliases : [],
      ..."internalAliases" in t ? t.internalAliases : []
    ].map((r) => [r, t.handler]))
  ];
  return Object.fromEntries(e);
}, "generateShapeMap"), Gje = Zen();
function Qen(i) {
  return i in Gje;
}
$(Qen, "isValidShape");
var eX = /* @__PURE__ */ new Map();
async function qje(i, e, t) {
  let n, r;
  e.shape === "rect" && (e.rx && e.ry ? e.shape = "roundedRect" : e.shape = "squareRect");
  const s = e.shape ? Gje[e.shape] : void 0;
  if (!s)
    throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);
  if (e.link) {
    let o;
    t.config.securityLevel === "sandbox" ? o = "_top" : e.linkTarget && (o = e.linkTarget || "_blank"), n = i.insert("svg:a").attr("xlink:href", e.link).attr("target", o ?? null), r = await s(n, e, t);
  } else
    r = await s(i, e, t), n = r;
  return e.tooltip && r.attr("title", e.tooltip), eX.set(e.id, n), e.haveCallback && n.attr("class", n.attr("class") + " clickable"), n;
}
$(qje, "insertNode");
var Ccn = /* @__PURE__ */ $((i, e) => {
  eX.set(e.id, i);
}, "setNodeElem"), wcn = /* @__PURE__ */ $(() => {
  eX.clear();
}, "clear"), Scn = /* @__PURE__ */ $((i) => {
  const e = eX.get(i.id);
  Ct.trace(
    "Transforming node",
    i.diff,
    i,
    "translate(" + (i.x - i.width / 2 - 5) + ", " + i.width / 2 + ")"
  );
  const t = 8, n = i.diff || 0;
  return i.clusterNode ? e.attr(
    "transform",
    "translate(" + (i.x + n - i.width / 2) + ", " + (i.y - i.height / 2 - t) + ")"
  ) : e.attr("transform", "translate(" + i.x + ", " + i.y + ")"), n;
}, "positionNode"), Jen = /* @__PURE__ */ $((i, e, t, n, r, s) => {
  e.arrowTypeStart && BOe(i, "start", e.arrowTypeStart, t, n, r, s), e.arrowTypeEnd && BOe(i, "end", e.arrowTypeEnd, t, n, r, s);
}, "addEdgeMarkers"), etn = {
  arrow_cross: { type: "cross", fill: !1 },
  arrow_point: { type: "point", fill: !0 },
  arrow_barb: { type: "barb", fill: !0 },
  arrow_circle: { type: "circle", fill: !1 },
  aggregation: { type: "aggregation", fill: !1 },
  extension: { type: "extension", fill: !1 },
  composition: { type: "composition", fill: !0 },
  dependency: { type: "dependency", fill: !0 },
  lollipop: { type: "lollipop", fill: !1 },
  only_one: { type: "onlyOne", fill: !1 },
  zero_or_one: { type: "zeroOrOne", fill: !1 },
  one_or_more: { type: "oneOrMore", fill: !1 },
  zero_or_more: { type: "zeroOrMore", fill: !1 },
  requirement_arrow: { type: "requirement_arrow", fill: !1 },
  requirement_contains: { type: "requirement_contains", fill: !1 }
}, BOe = /* @__PURE__ */ $((i, e, t, n, r, s, o) => {
  var d;
  const a = etn[t];
  if (!a) {
    Ct.warn(`Unknown arrow type: ${t}`);
    return;
  }
  const l = a.type, u = `${r}_${s}-${l}${e === "start" ? "Start" : "End"}`;
  if (o && o.trim() !== "") {
    const h = o.replace(/[^\dA-Za-z]/g, "_"), g = `${u}_${h}`;
    if (!document.getElementById(g)) {
      const m = document.getElementById(u);
      if (m) {
        const _ = m.cloneNode(!0);
        _.id = g, _.querySelectorAll("path, circle, line").forEach((w) => {
          w.setAttribute("stroke", o), a.fill && w.setAttribute("fill", o);
        }), (d = m.parentNode) == null || d.appendChild(_);
      }
    }
    i.attr(`marker-${e}`, `url(${n}#${g})`);
  } else
    i.attr(`marker-${e}`, `url(${n}#${u})`);
}, "addEdgeMarker"), xj = /* @__PURE__ */ new Map(), Qc = /* @__PURE__ */ new Map(), Ecn = /* @__PURE__ */ $(() => {
  xj.clear(), Qc.clear();
}, "clear"), gW = /* @__PURE__ */ $((i) => i ? i.reduce((t, n) => t + ";" + n, "") : "", "getLabelStyles"), ttn = /* @__PURE__ */ $(async (i, e) => {
  let t = ic(Qs().flowchart.htmlLabels);
  const { labelStyles: n } = Gn(e);
  e.labelStyle = n;
  const r = await Mw(i, e.label, {
    style: e.labelStyle,
    useHtmlLabels: t,
    addSvgBackground: !0,
    isNode: !1
  });
  Ct.info("abc82", e, e.labelType);
  const s = i.insert("g").attr("class", "edgeLabel"), o = s.insert("g").attr("class", "label").attr("data-id", e.id);
  o.node().appendChild(r);
  let a = r.getBBox();
  if (t) {
    const c = r.children[0], u = ls(r);
    a = c.getBoundingClientRect(), u.attr("width", a.width), u.attr("height", a.height);
  }
  o.attr("transform", "translate(" + -a.width / 2 + ", " + -a.height / 2 + ")"), xj.set(e.id, s), e.width = a.width, e.height = a.height;
  let l;
  if (e.startLabelLeft) {
    const c = await Dx(
      e.startLabelLeft,
      gW(e.labelStyle)
    ), u = i.insert("g").attr("class", "edgeTerminals"), d = u.insert("g").attr("class", "inner");
    l = d.node().appendChild(c);
    const h = c.getBBox();
    d.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")"), Qc.get(e.id) || Qc.set(e.id, {}), Qc.get(e.id).startLeft = u, _F(l, e.startLabelLeft);
  }
  if (e.startLabelRight) {
    const c = await Dx(
      e.startLabelRight,
      gW(e.labelStyle)
    ), u = i.insert("g").attr("class", "edgeTerminals"), d = u.insert("g").attr("class", "inner");
    l = u.node().appendChild(c), d.node().appendChild(c);
    const h = c.getBBox();
    d.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")"), Qc.get(e.id) || Qc.set(e.id, {}), Qc.get(e.id).startRight = u, _F(l, e.startLabelRight);
  }
  if (e.endLabelLeft) {
    const c = await Dx(e.endLabelLeft, gW(e.labelStyle)), u = i.insert("g").attr("class", "edgeTerminals"), d = u.insert("g").attr("class", "inner");
    l = d.node().appendChild(c);
    const h = c.getBBox();
    d.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")"), u.node().appendChild(c), Qc.get(e.id) || Qc.set(e.id, {}), Qc.get(e.id).endLeft = u, _F(l, e.endLabelLeft);
  }
  if (e.endLabelRight) {
    const c = await Dx(e.endLabelRight, gW(e.labelStyle)), u = i.insert("g").attr("class", "edgeTerminals"), d = u.insert("g").attr("class", "inner");
    l = d.node().appendChild(c);
    const h = c.getBBox();
    d.attr("transform", "translate(" + -h.width / 2 + ", " + -h.height / 2 + ")"), u.node().appendChild(c), Qc.get(e.id) || Qc.set(e.id, {}), Qc.get(e.id).endRight = u, _F(l, e.endLabelRight);
  }
  return r;
}, "insertEdgeLabel");
function _F(i, e) {
  Qs().flowchart.htmlLabels && i && (i.style.width = e.length * 9 + "px", i.style.height = "12px");
}
$(_F, "setTerminalWidth");
var ntn = /* @__PURE__ */ $((i, e) => {
  Ct.debug("Moving label abc88 ", i.id, i.label, xj.get(i.id), e);
  let t = e.updatedPath ? e.updatedPath : e.originalPath;
  const n = Qs(), { subGraphTitleTotalMargin: r } = _Ce(n);
  if (i.label) {
    const s = xj.get(i.id);
    let o = i.x, a = i.y;
    if (t) {
      const l = Jp.calcLabelPosition(t);
      Ct.debug(
        "Moving label " + i.label + " from (",
        o,
        ",",
        a,
        ") to (",
        l.x,
        ",",
        l.y,
        ") abc88"
      ), e.updatedPath && (o = l.x, a = l.y);
    }
    s.attr("transform", `translate(${o}, ${a + r / 2})`);
  }
  if (i.startLabelLeft) {
    const s = Qc.get(i.id).startLeft;
    let o = i.x, a = i.y;
    if (t) {
      const l = Jp.calcTerminalLabelPosition(i.arrowTypeStart ? 10 : 0, "start_left", t);
      o = l.x, a = l.y;
    }
    s.attr("transform", `translate(${o}, ${a})`);
  }
  if (i.startLabelRight) {
    const s = Qc.get(i.id).startRight;
    let o = i.x, a = i.y;
    if (t) {
      const l = Jp.calcTerminalLabelPosition(
        i.arrowTypeStart ? 10 : 0,
        "start_right",
        t
      );
      o = l.x, a = l.y;
    }
    s.attr("transform", `translate(${o}, ${a})`);
  }
  if (i.endLabelLeft) {
    const s = Qc.get(i.id).endLeft;
    let o = i.x, a = i.y;
    if (t) {
      const l = Jp.calcTerminalLabelPosition(i.arrowTypeEnd ? 10 : 0, "end_left", t);
      o = l.x, a = l.y;
    }
    s.attr("transform", `translate(${o}, ${a})`);
  }
  if (i.endLabelRight) {
    const s = Qc.get(i.id).endRight;
    let o = i.x, a = i.y;
    if (t) {
      const l = Jp.calcTerminalLabelPosition(i.arrowTypeEnd ? 10 : 0, "end_right", t);
      o = l.x, a = l.y;
    }
    s.attr("transform", `translate(${o}, ${a})`);
  }
}, "positionEdgeLabel"), itn = /* @__PURE__ */ $((i, e) => {
  const t = i.x, n = i.y, r = Math.abs(e.x - t), s = Math.abs(e.y - n), o = i.width / 2, a = i.height / 2;
  return r >= o || s >= a;
}, "outsideNode"), rtn = /* @__PURE__ */ $((i, e, t) => {
  Ct.debug(`intersection calc abc89:
  outsidePoint: ${JSON.stringify(e)}
  insidePoint : ${JSON.stringify(t)}
  node        : x:${i.x} y:${i.y} w:${i.width} h:${i.height}`);
  const n = i.x, r = i.y, s = Math.abs(n - t.x), o = i.width / 2;
  let a = t.x < e.x ? o - s : o + s;
  const l = i.height / 2, c = Math.abs(e.y - t.y), u = Math.abs(e.x - t.x);
  if (Math.abs(r - e.y) * o > Math.abs(n - e.x) * l) {
    let d = t.y < e.y ? e.y - l - r : r - l - e.y;
    a = u * d / c;
    const h = {
      x: t.x < e.x ? t.x + a : t.x - u + a,
      y: t.y < e.y ? t.y + c - d : t.y - c + d
    };
    return a === 0 && (h.x = e.x, h.y = e.y), u === 0 && (h.x = e.x), c === 0 && (h.y = e.y), Ct.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${u}, r ${a}`, h), h;
  } else {
    t.x < e.x ? a = e.x - o - n : a = n - o - e.x;
    let d = c * a / u, h = t.x < e.x ? t.x + u - a : t.x - u + a, g = t.y < e.y ? t.y + d : t.y - d;
    return Ct.debug(`sides calc abc89, Q ${c}, q ${d}, R ${u}, r ${a}`, { _x: h, _y: g }), a === 0 && (h = e.x, g = e.y), u === 0 && (h = e.x), c === 0 && (g = e.y), { x: h, y: g };
  }
}, "intersection"), HOe = /* @__PURE__ */ $((i, e) => {
  Ct.warn("abc88 cutPathAtIntersect", i, e);
  let t = [], n = i[0], r = !1;
  return i.forEach((s) => {
    if (Ct.info("abc88 checking point", s, e), !itn(e, s) && !r) {
      const o = rtn(e, n, s);
      Ct.debug("abc88 inside", s, n, o), Ct.debug("abc88 intersection", o, e);
      let a = !1;
      t.forEach((l) => {
        a = a || l.x === o.x && l.y === o.y;
      }), t.some((l) => l.x === o.x && l.y === o.y) ? Ct.warn("abc88 no intersect", o, t) : t.push(o), r = !0;
    } else
      Ct.warn("abc88 outside", s, n), n = s, r || t.push(s);
  }), Ct.debug("returning points", t), t;
}, "cutPathAtIntersect");
function Kje(i) {
  const e = [], t = [];
  for (let n = 1; n < i.length - 1; n++) {
    const r = i[n - 1], s = i[n], o = i[n + 1];
    (r.x === s.x && s.y === o.y && Math.abs(s.x - o.x) > 5 && Math.abs(s.y - r.y) > 5 || r.y === s.y && s.x === o.x && Math.abs(s.x - r.x) > 5 && Math.abs(s.y - o.y) > 5) && (e.push(s), t.push(n));
  }
  return { cornerPoints: e, cornerPointPositions: t };
}
$(Kje, "extractCornerPoints");
var WOe = /* @__PURE__ */ $(function(i, e, t) {
  const n = e.x - i.x, r = e.y - i.y, s = Math.sqrt(n * n + r * r), o = t / s;
  return { x: e.x - o * n, y: e.y - o * r };
}, "findAdjacentPoint"), stn = /* @__PURE__ */ $(function(i) {
  const { cornerPointPositions: e } = Kje(i), t = [];
  for (let n = 0; n < i.length; n++)
    if (e.includes(n)) {
      const r = i[n - 1], s = i[n + 1], o = i[n], a = WOe(r, o, 5), l = WOe(s, o, 5), c = l.x - a.x, u = l.y - a.y;
      t.push(a);
      const d = Math.sqrt(2) * 2;
      let h = { x: o.x, y: o.y };
      if (Math.abs(s.x - r.x) > 10 && Math.abs(s.y - r.y) >= 10) {
        Ct.debug(
          "Corner point fixing",
          Math.abs(s.x - r.x),
          Math.abs(s.y - r.y)
        );
        const g = 5;
        o.x === a.x ? h = {
          x: c < 0 ? a.x - g + d : a.x + g - d,
          y: u < 0 ? a.y - d : a.y + d
        } : h = {
          x: c < 0 ? a.x - d : a.x + d,
          y: u < 0 ? a.y - g + d : a.y + g - d
        };
      } else
        Ct.debug(
          "Corner point skipping fixing",
          Math.abs(s.x - r.x),
          Math.abs(s.y - r.y)
        );
      t.push(h, l);
    } else
      t.push(i[n]);
  return t;
}, "fixCorners"), otn = /* @__PURE__ */ $((i, e, t) => {
  const n = i - e - t, r = 2, s = 2, o = r + s, a = Math.floor(n / o), l = Array(a).fill(`${r} ${s}`).join(" ");
  return `0 ${e} ${l} ${t}`;
}, "generateDashArray"), atn = /* @__PURE__ */ $(function(i, e, t, n, r, s, o, a = !1) {
  var Y;
  const { handDrawnSeed: l } = Qs();
  let c = e.points, u = !1;
  const d = r;
  var h = s;
  const g = [];
  for (const G in e.cssCompiledStyles)
    xze(G) || g.push(e.cssCompiledStyles[G]);
  Ct.debug("UIO intersect check", e.points, h.x, d.x), h.intersect && d.intersect && !a && (c = c.slice(1, e.points.length - 1), c.unshift(d.intersect(c[0])), Ct.debug(
    "Last point UIO",
    e.start,
    "-->",
    e.end,
    c[c.length - 1],
    h,
    h.intersect(c[c.length - 1])
  ), c.push(h.intersect(c[c.length - 1])));
  const m = btoa(JSON.stringify(c));
  e.toCluster && (Ct.info("to cluster abc88", t.get(e.toCluster)), c = HOe(e.points, t.get(e.toCluster).node), u = !0), e.fromCluster && (Ct.debug(
    "from cluster abc88",
    t.get(e.fromCluster),
    JSON.stringify(c, null, 2)
  ), c = HOe(c.reverse(), t.get(e.fromCluster).node).reverse(), u = !0);
  let _ = c.filter((G) => !Number.isNaN(G.y));
  _ = stn(_);
  let v = fV;
  switch (v = nj, e.curve) {
    case "linear":
      v = nj;
      break;
    case "basis":
      v = fV;
      break;
    case "cardinal":
      v = DVe;
      break;
    case "bumpX":
      v = EVe;
      break;
    case "bumpY":
      v = xVe;
      break;
    case "catmullRom":
      v = NVe;
      break;
    case "monotoneX":
      v = FVe;
      break;
    case "monotoneY":
      v = BVe;
      break;
    case "natural":
      v = WVe;
      break;
    case "step":
      v = VVe;
      break;
    case "stepAfter":
      v = zVe;
      break;
    case "stepBefore":
      v = UVe;
      break;
    default:
      v = fV;
  }
  const { x: w, y: E } = sXt(e), L = UKt().x(w).y(E).curve(v);
  let T;
  switch (e.thickness) {
    case "normal":
      T = "edge-thickness-normal";
      break;
    case "thick":
      T = "edge-thickness-thick";
      break;
    case "invisible":
      T = "edge-thickness-invisible";
      break;
    default:
      T = "edge-thickness-normal";
  }
  switch (e.pattern) {
    case "solid":
      T += " edge-pattern-solid";
      break;
    case "dotted":
      T += " edge-pattern-dotted";
      break;
    case "dashed":
      T += " edge-pattern-dashed";
      break;
    default:
      T += " edge-pattern-solid";
  }
  let D, N = e.curve === "rounded" ? Yje(Xje(_, e), 5) : L(_);
  const R = Array.isArray(e.style) ? e.style : [e.style];
  let M = R.find((G) => G == null ? void 0 : G.startsWith("stroke:")), B = !1;
  if (e.look === "handDrawn") {
    const G = Un.svg(i);
    Object.assign([], _);
    const Q = G.path(N, {
      roughness: 0.3,
      seed: l
    });
    T += " transition", D = ls(Q).select("path").attr("id", e.id).attr("class", " " + T + (e.classes ? " " + e.classes : "")).attr("style", R ? R.reduce((Z, pe) => Z + ";" + pe, "") : "");
    let oe = D.attr("d");
    D.attr("d", oe), i.node().appendChild(D.node());
  } else {
    const G = g.join(";"), Q = R ? R.reduce((re, ze) => re + ze + ";", "") : "";
    let oe = "";
    e.animate && (oe = " edge-animation-fast"), e.animation && (oe = " edge-animation-" + e.animation);
    const Z = (G ? G + ";" + Q + ";" : Q) + ";" + (R ? R.reduce((re, ze) => re + ";" + ze, "") : "");
    D = i.append("path").attr("d", N).attr("id", e.id).attr(
      "class",
      " " + T + (e.classes ? " " + e.classes : "") + (oe ?? "")
    ).attr("style", Z), M = (Y = Z.match(/stroke:([^;]+)/)) == null ? void 0 : Y[1], B = e.animate === !0 || !!e.animation || G.includes("animation");
    const pe = D.node(), J = typeof pe.getTotalLength == "function" ? pe.getTotalLength() : 0, ae = nOe[e.arrowTypeStart] || 0, be = nOe[e.arrowTypeEnd] || 0;
    if (e.look === "neo" && !B) {
      const ze = `stroke-dasharray: ${e.pattern === "dotted" || e.pattern === "dashed" ? otn(J, ae, be) : `0 ${ae} ${J - ae - be} ${be}`}; stroke-dashoffset: 0;`;
      D.attr("style", ze + D.attr("style"));
    }
  }
  D.attr("data-edge", !0), D.attr("data-et", "edge"), D.attr("data-id", e.id), D.attr("data-points", m), e.showPoints && _.forEach((G) => {
    i.append("circle").style("stroke", "red").style("fill", "red").attr("r", 1).attr("cx", G.x).attr("cy", G.y);
  });
  let H = "";
  (Qs().flowchart.arrowMarkerAbsolute || Qs().state.arrowMarkerAbsolute) && (H = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, H = H.replace(/\(/g, "\\(").replace(/\)/g, "\\)")), Ct.info("arrowTypeStart", e.arrowTypeStart), Ct.info("arrowTypeEnd", e.arrowTypeEnd), Jen(D, e, H, o, n, M);
  const j = Math.floor(c.length / 2), K = c[j];
  Jp.isLabelCoordinateInPath(K, D.attr("d")) || (u = !0);
  let X = {};
  return u && (X.updatedPath = c), X.originalPath = e.points, X;
}, "insertEdge");
function Yje(i, e) {
  if (i.length < 2)
    return "";
  let t = "";
  const n = i.length, r = 1e-5;
  for (let s = 0; s < n; s++) {
    const o = i[s], a = i[s - 1], l = i[s + 1];
    if (s === 0)
      t += `M${o.x},${o.y}`;
    else if (s === n - 1)
      t += `L${o.x},${o.y}`;
    else {
      const c = o.x - a.x, u = o.y - a.y, d = l.x - o.x, h = l.y - o.y, g = Math.hypot(c, u), m = Math.hypot(d, h);
      if (g < r || m < r) {
        t += `L${o.x},${o.y}`;
        continue;
      }
      const _ = c / g, v = u / g, w = d / m, E = h / m, L = _ * w + v * E, T = Math.max(-1, Math.min(1, L)), D = Math.acos(T);
      if (D < r || Math.abs(Math.PI - D) < r) {
        t += `L${o.x},${o.y}`;
        continue;
      }
      const N = Math.min(e / Math.sin(D / 2), g / 2, m / 2), R = o.x - _ * N, M = o.y - v * N, B = o.x + w * N, H = o.y + E * N;
      t += `L${R},${M}`, t += `Q${o.x},${o.y} ${B},${H}`;
    }
  }
  return t;
}
$(Yje, "generateRoundedPath");
function fhe(i, e) {
  if (!i || !e)
    return { angle: 0, deltaX: 0, deltaY: 0 };
  const t = e.x - i.x, n = e.y - i.y;
  return { angle: Math.atan2(n, t), deltaX: t, deltaY: n };
}
$(fhe, "calculateDeltaAndAngle");
function Xje(i, e) {
  const t = i.map((r) => ({ ...r }));
  if (i.length >= 2 && Wu[e.arrowTypeStart]) {
    const r = Wu[e.arrowTypeStart], s = i[0], o = i[1], { angle: a } = fhe(s, o), l = r * Math.cos(a), c = r * Math.sin(a);
    t[0].x = s.x + l, t[0].y = s.y + c;
  }
  const n = i.length;
  if (n >= 2 && Wu[e.arrowTypeEnd]) {
    const r = Wu[e.arrowTypeEnd], s = i[n - 1], o = i[n - 2], { angle: a } = fhe(o, s), l = r * Math.cos(a), c = r * Math.sin(a);
    t[n - 1].x = s.x - l, t[n - 1].y = s.y - c;
  }
  return t;
}
$(Xje, "applyMarkerOffsetsToPoints");
var ltn = /* @__PURE__ */ $((i, e, t, n) => {
  e.forEach((r) => {
    Etn[r](i, t, n);
  });
}, "insertMarkers"), ctn = /* @__PURE__ */ $((i, e, t) => {
  Ct.trace("Making markers for ", t), i.append("defs").append("marker").attr("id", t + "_" + e + "-extensionStart").attr("class", "marker extension " + e).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), i.append("defs").append("marker").attr("id", t + "_" + e + "-extensionEnd").attr("class", "marker extension " + e).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
}, "extension"), utn = /* @__PURE__ */ $((i, e, t) => {
  i.append("defs").append("marker").attr("id", t + "_" + e + "-compositionStart").attr("class", "marker composition " + e).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", t + "_" + e + "-compositionEnd").attr("class", "marker composition " + e).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
}, "composition"), dtn = /* @__PURE__ */ $((i, e, t) => {
  i.append("defs").append("marker").attr("id", t + "_" + e + "-aggregationStart").attr("class", "marker aggregation " + e).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", t + "_" + e + "-aggregationEnd").attr("class", "marker aggregation " + e).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
}, "aggregation"), htn = /* @__PURE__ */ $((i, e, t) => {
  i.append("defs").append("marker").attr("id", t + "_" + e + "-dependencyStart").attr("class", "marker dependency " + e).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), i.append("defs").append("marker").attr("id", t + "_" + e + "-dependencyEnd").attr("class", "marker dependency " + e).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
}, "dependency"), ftn = /* @__PURE__ */ $((i, e, t) => {
  i.append("defs").append("marker").attr("id", t + "_" + e + "-lollipopStart").attr("class", "marker lollipop " + e).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), i.append("defs").append("marker").attr("id", t + "_" + e + "-lollipopEnd").attr("class", "marker lollipop " + e).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
}, "lollipop"), gtn = /* @__PURE__ */ $((i, e, t) => {
  i.append("marker").attr("id", t + "_" + e + "-pointEnd").attr("class", "marker " + e).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), i.append("marker").attr("id", t + "_" + e + "-pointStart").attr("class", "marker " + e).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
}, "point"), ptn = /* @__PURE__ */ $((i, e, t) => {
  i.append("marker").attr("id", t + "_" + e + "-circleEnd").attr("class", "marker " + e).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), i.append("marker").attr("id", t + "_" + e + "-circleStart").attr("class", "marker " + e).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
}, "circle"), mtn = /* @__PURE__ */ $((i, e, t) => {
  i.append("marker").attr("id", t + "_" + e + "-crossEnd").attr("class", "marker cross " + e).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), i.append("marker").attr("id", t + "_" + e + "-crossStart").attr("class", "marker cross " + e).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
}, "cross"), _tn = /* @__PURE__ */ $((i, e, t) => {
  i.append("defs").append("marker").attr("id", t + "_" + e + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
}, "barb"), btn = /* @__PURE__ */ $((i, e, t) => {
  i.append("defs").append("marker").attr("id", t + "_" + e + "-onlyOneStart").attr("class", "marker onlyOne " + e).attr("refX", 0).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M9,0 L9,18 M15,0 L15,18"), i.append("defs").append("marker").attr("id", t + "_" + e + "-onlyOneEnd").attr("class", "marker onlyOne " + e).attr("refX", 18).attr("refY", 9).attr("markerWidth", 18).attr("markerHeight", 18).attr("orient", "auto").append("path").attr("d", "M3,0 L3,18 M9,0 L9,18");
}, "only_one"), vtn = /* @__PURE__ */ $((i, e, t) => {
  const n = i.append("defs").append("marker").attr("id", t + "_" + e + "-zeroOrOneStart").attr("class", "marker zeroOrOne " + e).attr("refX", 0).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
  n.append("circle").attr("fill", "white").attr("cx", 21).attr("cy", 9).attr("r", 6), n.append("path").attr("d", "M9,0 L9,18");
  const r = i.append("defs").append("marker").attr("id", t + "_" + e + "-zeroOrOneEnd").attr("class", "marker zeroOrOne " + e).attr("refX", 30).attr("refY", 9).attr("markerWidth", 30).attr("markerHeight", 18).attr("orient", "auto");
  r.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 9).attr("r", 6), r.append("path").attr("d", "M21,0 L21,18");
}, "zero_or_one"), ytn = /* @__PURE__ */ $((i, e, t) => {
  i.append("defs").append("marker").attr("id", t + "_" + e + "-oneOrMoreStart").attr("class", "marker oneOrMore " + e).attr("refX", 18).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"), i.append("defs").append("marker").attr("id", t + "_" + e + "-oneOrMoreEnd").attr("class", "marker oneOrMore " + e).attr("refX", 27).attr("refY", 18).attr("markerWidth", 45).attr("markerHeight", 36).attr("orient", "auto").append("path").attr("d", "M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18");
}, "one_or_more"), Ctn = /* @__PURE__ */ $((i, e, t) => {
  const n = i.append("defs").append("marker").attr("id", t + "_" + e + "-zeroOrMoreStart").attr("class", "marker zeroOrMore " + e).attr("refX", 18).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
  n.append("circle").attr("fill", "white").attr("cx", 48).attr("cy", 18).attr("r", 6), n.append("path").attr("d", "M0,18 Q18,0 36,18 Q18,36 0,18");
  const r = i.append("defs").append("marker").attr("id", t + "_" + e + "-zeroOrMoreEnd").attr("class", "marker zeroOrMore " + e).attr("refX", 39).attr("refY", 18).attr("markerWidth", 57).attr("markerHeight", 36).attr("orient", "auto");
  r.append("circle").attr("fill", "white").attr("cx", 9).attr("cy", 18).attr("r", 6), r.append("path").attr("d", "M21,18 Q39,0 57,18 Q39,36 21,18");
}, "zero_or_more"), wtn = /* @__PURE__ */ $((i, e, t) => {
  i.append("defs").append("marker").attr("id", t + "_" + e + "-requirement_arrowEnd").attr("refX", 20).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("path").attr(
    "d",
    `M0,0
      L20,10
      M20,10
      L0,20`
  );
}, "requirement_arrow"), Stn = /* @__PURE__ */ $((i, e, t) => {
  const n = i.append("defs").append("marker").attr("id", t + "_" + e + "-requirement_containsStart").attr("refX", 0).attr("refY", 10).attr("markerWidth", 20).attr("markerHeight", 20).attr("orient", "auto").append("g");
  n.append("circle").attr("cx", 10).attr("cy", 10).attr("r", 9).attr("fill", "none"), n.append("line").attr("x1", 1).attr("x2", 19).attr("y1", 10).attr("y2", 10), n.append("line").attr("y1", 1).attr("y2", 19).attr("x1", 10).attr("x2", 10);
}, "requirement_contains"), Etn = {
  extension: ctn,
  composition: utn,
  aggregation: dtn,
  dependency: htn,
  lollipop: ftn,
  point: gtn,
  circle: ptn,
  cross: mtn,
  barb: _tn,
  only_one: btn,
  zero_or_one: vtn,
  one_or_more: ytn,
  zero_or_more: Ctn,
  requirement_arrow: wtn,
  requirement_contains: Stn
}, xtn = ltn, Ltn = {
  common: T2,
  getConfig: Ku,
  insertCluster: Oen,
  insertEdge: atn,
  insertEdgeLabel: ttn,
  insertMarkers: xtn,
  insertNode: qje,
  interpolateToCurve: wCe,
  labelHelper: ki,
  log: Ct,
  positionEdgeLabel: ntn
}, oB = {}, Zje = /* @__PURE__ */ $((i) => {
  for (const e of i)
    oB[e.name] = e;
}, "registerLayoutLoaders"), Ttn = /* @__PURE__ */ $(() => {
  Zje([
    {
      name: "dagre",
      loader: /* @__PURE__ */ $(async () => await import("./dagre-6UL2VRFP-BPeWim7N.js"), "loader")
    },
    {
      name: "cose-bilkent",
      loader: /* @__PURE__ */ $(async () => await import("./cose-bilkent-S5V4N54A-BGPSPsUd.js"), "loader")
    }
  ]);
}, "registerDefaultLayoutLoaders");
Ttn();
var xcn = /* @__PURE__ */ $(async (i, e) => {
  if (!(i.layoutAlgorithm in oB))
    throw new Error(`Unknown layout algorithm: ${i.layoutAlgorithm}`);
  const t = oB[i.layoutAlgorithm];
  return (await t.loader()).render(i, e, Ltn, {
    algorithm: t.algorithm
  });
}, "render"), Lcn = /* @__PURE__ */ $((i = "", { fallback: e = "dagre" } = {}) => {
  if (i in oB)
    return i;
  if (e in oB)
    return Ct.warn(`Layout algorithm ${i} is not registered. Using ${e} as fallback.`), e;
  throw new Error(`Both layout algorithms ${i} and ${e} are not registered.`);
}, "getRegisteredLayoutAlgorithm"), Qje = "comm", Jje = "rule", eGe = "decl", ktn = "@import", Dtn = "@namespace", Itn = "@keyframes", Ntn = "@layer", tGe = Math.abs, UCe = String.fromCharCode;
function nGe(i) {
  return i.trim();
}
function bV(i, e, t) {
  return i.replace(e, t);
}
function Rtn(i, e, t) {
  return i.indexOf(e, t);
}
function yR(i, e) {
  return i.charCodeAt(e) | 0;
}
function BA(i, e, t) {
  return i.slice(e, t);
}
function B_(i) {
  return i.length;
}
function Atn(i) {
  return i.length;
}
function pW(i, e) {
  return e.push(i), i;
}
var tX = 1, HA = 1, iGe = 0, Zg = 0, ml = 0, R2 = "";
function zCe(i, e, t, n, r, s, o, a) {
  return { value: i, root: e, parent: t, type: n, props: r, children: s, line: tX, column: HA, length: o, return: "", siblings: a };
}
function Otn() {
  return ml;
}
function Mtn() {
  return ml = Zg > 0 ? yR(R2, --Zg) : 0, HA--, ml === 10 && (HA = 1, tX--), ml;
}
function dm() {
  return ml = Zg < iGe ? yR(R2, Zg++) : 0, HA++, ml === 10 && (HA = 1, tX++), ml;
}
function w1() {
  return yR(R2, Zg);
}
function vV() {
  return Zg;
}
function nX(i, e) {
  return BA(R2, i, e);
}
function aB(i) {
  switch (i) {
    // \0 \t \n \r \s whitespace token
    case 0:
    case 9:
    case 10:
    case 13:
    case 32:
      return 5;
    // ! + , / > @ ~ isolate token
    case 33:
    case 43:
    case 44:
    case 47:
    case 62:
    case 64:
    case 126:
    // ; { } breakpoint token
    case 59:
    case 123:
    case 125:
      return 4;
    // : accompanied token
    case 58:
      return 3;
    // " ' ( [ opening delimit token
    case 34:
    case 39:
    case 40:
    case 91:
      return 2;
    // ) ] closing delimit token
    case 41:
    case 93:
      return 1;
  }
  return 0;
}
function Ptn(i) {
  return tX = HA = 1, iGe = B_(R2 = i), Zg = 0, [];
}
function Ftn(i) {
  return R2 = "", i;
}
function Une(i) {
  return nGe(nX(Zg - 1, ghe(i === 91 ? i + 2 : i === 40 ? i + 1 : i)));
}
function Btn(i) {
  for (; (ml = w1()) && ml < 33; )
    dm();
  return aB(i) > 2 || aB(ml) > 3 ? "" : " ";
}
function Htn(i, e) {
  for (; --e && dm() && !(ml < 48 || ml > 102 || ml > 57 && ml < 65 || ml > 70 && ml < 97); )
    ;
  return nX(i, vV() + (e < 6 && w1() == 32 && dm() == 32));
}
function ghe(i) {
  for (; dm(); )
    switch (ml) {
      // ] ) " '
      case i:
        return Zg;
      // " '
      case 34:
      case 39:
        i !== 34 && i !== 39 && ghe(ml);
        break;
      // (
      case 40:
        i === 41 && ghe(i);
        break;
      // \
      case 92:
        dm();
        break;
    }
  return Zg;
}
function Wtn(i, e) {
  for (; dm() && i + ml !== 57; )
    if (i + ml === 84 && w1() === 47)
      break;
  return "/*" + nX(e, Zg - 1) + "*" + UCe(i === 47 ? i : dm());
}
function Vtn(i) {
  for (; !aB(w1()); )
    dm();
  return nX(i, Zg);
}
function Utn(i) {
  return Ftn(yV("", null, null, null, [""], i = Ptn(i), 0, [0], i));
}
function yV(i, e, t, n, r, s, o, a, l) {
  for (var c = 0, u = 0, d = o, h = 0, g = 0, m = 0, _ = 1, v = 1, w = 1, E = 0, L = "", T = r, D = s, N = n, R = L; v; )
    switch (m = E, E = dm()) {
      // (
      case 40:
        if (m != 108 && yR(R, d - 1) == 58) {
          Rtn(R += bV(Une(E), "&", "&\f"), "&\f", tGe(c ? a[c - 1] : 0)) != -1 && (w = -1);
          break;
        }
      // " ' [
      case 34:
      case 39:
      case 91:
        R += Une(E);
        break;
      // \t \n \r \s
      case 9:
      case 10:
      case 13:
      case 32:
        R += Btn(m);
        break;
      // \
      case 92:
        R += Htn(vV() - 1, 7);
        continue;
      // /
      case 47:
        switch (w1()) {
          case 42:
          case 47:
            pW(ztn(Wtn(dm(), vV()), e, t, l), l), (aB(m || 1) == 5 || aB(w1() || 1) == 5) && B_(R) && BA(R, -1, void 0) !== " " && (R += " ");
            break;
          default:
            R += "/";
        }
        break;
      // {
      case 123 * _:
        a[c++] = B_(R) * w;
      // } ; \0
      case 125 * _:
      case 59:
      case 0:
        switch (E) {
          // \0 }
          case 0:
          case 125:
            v = 0;
          // ;
          case 59 + u:
            w == -1 && (R = bV(R, /\f/g, "")), g > 0 && (B_(R) - d || _ === 0 && m === 47) && pW(g > 32 ? UOe(R + ";", n, t, d - 1, l) : UOe(bV(R, " ", "") + ";", n, t, d - 2, l), l);
            break;
          // @ ;
          case 59:
            R += ";";
          // { rule/at-rule
          default:
            if (pW(N = VOe(R, e, t, c, u, r, a, L, T = [], D = [], d, s), s), E === 123)
              if (u === 0)
                yV(R, e, N, N, T, s, d, a, D);
              else {
                switch (h) {
                  // c(ontainer)
                  case 99:
                    if (yR(R, 3) === 110) break;
                  // l(ayer)
                  case 108:
                    if (yR(R, 2) === 97) break;
                  default:
                    u = 0;
                  // d(ocument) m(edia) s(upports)
                  case 100:
                  case 109:
                  case 115:
                }
                u ? yV(i, N, N, n && pW(VOe(i, N, N, 0, 0, r, a, L, r, T = [], d, D), D), r, D, d, a, n ? T : D) : yV(R, N, N, N, [""], D, 0, a, D);
              }
        }
        c = u = g = 0, _ = w = 1, L = R = "", d = o;
        break;
      // :
      case 58:
        d = 1 + B_(R), g = m;
      default:
        if (_ < 1) {
          if (E == 123)
            --_;
          else if (E == 125 && _++ == 0 && Mtn() == 125)
            continue;
        }
        switch (R += UCe(E), E * _) {
          // &
          case 38:
            w = u > 0 ? 1 : (R += "\f", -1);
            break;
          // ,
          case 44:
            a[c++] = (B_(R) - 1) * w, w = 1;
            break;
          // @
          case 64:
            w1() === 45 && (R += Une(dm())), h = w1(), u = d = B_(L = R += Vtn(vV())), E++;
            break;
          // -
          case 45:
            m === 45 && B_(R) == 2 && (_ = 0);
        }
    }
  return s;
}
function VOe(i, e, t, n, r, s, o, a, l, c, u, d) {
  for (var h = r - 1, g = r === 0 ? s : [""], m = Atn(g), _ = 0, v = 0, w = 0; _ < n; ++_)
    for (var E = 0, L = BA(i, h + 1, h = tGe(v = o[_])), T = i; E < m; ++E)
      (T = nGe(v > 0 ? g[E] + " " + L : bV(L, /&\f/g, g[E]))) && (l[w++] = T);
  return zCe(i, e, t, r === 0 ? Jje : a, l, c, u, d);
}
function ztn(i, e, t, n) {
  return zCe(i, e, t, Qje, UCe(Otn()), BA(i, 2, -2), 0, n);
}
function UOe(i, e, t, n, r) {
  return zCe(i, e, t, eGe, BA(i, 0, n), BA(i, n + 1, -1), n, r);
}
function phe(i, e) {
  for (var t = "", n = 0; n < i.length; n++)
    t += e(i[n], n, i, e) || "";
  return t;
}
function $tn(i, e, t, n) {
  switch (i.type) {
    case Ntn:
      if (i.children.length) break;
    case ktn:
    case Dtn:
    case eGe:
      return i.return = i.return || i.value;
    case Qje:
      return "";
    case Itn:
      return i.return = i.value + "{" + phe(i.children, n) + "}";
    case Jje:
      if (!B_(i.value = i.props.join(","))) return "";
  }
  return B_(t = phe(i.children, n)) ? i.return = i.value + "{" + t + "}" : "";
}
var jtn = Dze(Object.keys, Object), Gtn = Object.prototype, qtn = Gtn.hasOwnProperty;
function Ktn(i) {
  if (!jY(i))
    return jtn(i);
  var e = [];
  for (var t in Object(i))
    qtn.call(i, t) && t != "constructor" && e.push(t);
  return e;
}
var mhe = bk(Bb, "DataView"), _he = bk(Bb, "Promise"), bhe = bk(Bb, "Set"), vhe = bk(Bb, "WeakMap"), zOe = "[object Map]", Ytn = "[object Object]", $Oe = "[object Promise]", jOe = "[object Set]", GOe = "[object WeakMap]", qOe = "[object DataView]", Xtn = _k(mhe), Ztn = _k(rB), Qtn = _k(_he), Jtn = _k(bhe), enn = _k(vhe), OE = D2;
(mhe && OE(new mhe(new ArrayBuffer(1))) != qOe || rB && OE(new rB()) != zOe || _he && OE(_he.resolve()) != $Oe || bhe && OE(new bhe()) != jOe || vhe && OE(new vhe()) != GOe) && (OE = function(i) {
  var e = D2(i), t = e == Ytn ? i.constructor : void 0, n = t ? _k(t) : "";
  if (n)
    switch (n) {
      case Xtn:
        return qOe;
      case Ztn:
        return zOe;
      case Qtn:
        return $Oe;
      case Jtn:
        return jOe;
      case enn:
        return GOe;
    }
  return e;
});
var tnn = "[object Map]", nnn = "[object Set]", inn = Object.prototype, rnn = inn.hasOwnProperty;
function KOe(i) {
  if (i == null)
    return !0;
  if (GY(i) && (pj(i) || typeof i == "string" || typeof i.splice == "function" || yCe(i) || CCe(i) || gj(i)))
    return !i.length;
  var e = OE(i);
  if (e == tnn || e == nnn)
    return !i.size;
  if (jY(i))
    return !Ktn(i).length;
  for (var t in i)
    if (rnn.call(i, t))
      return !1;
  return !0;
}
var rGe = "c4", snn = /* @__PURE__ */ $((i) => /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(i), "detector"), onn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./c4Diagram-YG6GDRKO-YZW4OKMZ.js");
  return { id: rGe, diagram: i };
}, "loader"), ann = {
  id: rGe,
  detector: snn,
  loader: onn
}, lnn = ann, sGe = "flowchart", cnn = /* @__PURE__ */ $((i, e) => {
  var t, n;
  return ((t = e == null ? void 0 : e.flowchart) == null ? void 0 : t.defaultRenderer) === "dagre-wrapper" || ((n = e == null ? void 0 : e.flowchart) == null ? void 0 : n.defaultRenderer) === "elk" ? !1 : /^\s*graph/.test(i);
}, "detector"), unn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./flowDiagram-NV44I4VS-DGvF83_j.js");
  return { id: sGe, diagram: i };
}, "loader"), dnn = {
  id: sGe,
  detector: cnn,
  loader: unn
}, hnn = dnn, oGe = "flowchart-v2", fnn = /* @__PURE__ */ $((i, e) => {
  var t, n, r;
  return ((t = e == null ? void 0 : e.flowchart) == null ? void 0 : t.defaultRenderer) === "dagre-d3" ? !1 : (((n = e == null ? void 0 : e.flowchart) == null ? void 0 : n.defaultRenderer) === "elk" && (e.layout = "elk"), /^\s*graph/.test(i) && ((r = e == null ? void 0 : e.flowchart) == null ? void 0 : r.defaultRenderer) === "dagre-wrapper" ? !0 : /^\s*flowchart/.test(i));
}, "detector"), gnn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./flowDiagram-NV44I4VS-DGvF83_j.js");
  return { id: oGe, diagram: i };
}, "loader"), pnn = {
  id: oGe,
  detector: fnn,
  loader: gnn
}, mnn = pnn, aGe = "er", _nn = /* @__PURE__ */ $((i) => /^\s*erDiagram/.test(i), "detector"), bnn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./erDiagram-Q2GNP2WA-D9Icqqei.js");
  return { id: aGe, diagram: i };
}, "loader"), vnn = {
  id: aGe,
  detector: _nn,
  loader: bnn
}, ynn = vnn, lGe = "gitGraph", Cnn = /* @__PURE__ */ $((i) => /^\s*gitGraph/.test(i), "detector"), wnn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./gitGraphDiagram-NY62KEGX-CF7rnCHm.js");
  return { id: lGe, diagram: i };
}, "loader"), Snn = {
  id: lGe,
  detector: Cnn,
  loader: wnn
}, Enn = Snn, cGe = "gantt", xnn = /* @__PURE__ */ $((i) => /^\s*gantt/.test(i), "detector"), Lnn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./ganttDiagram-JELNMOA3-CdCMB5fK.js");
  return { id: cGe, diagram: i };
}, "loader"), Tnn = {
  id: cGe,
  detector: xnn,
  loader: Lnn
}, knn = Tnn, uGe = "info", Dnn = /* @__PURE__ */ $((i) => /^\s*info/.test(i), "detector"), Inn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./infoDiagram-WHAUD3N6-aGj3E132.js");
  return { id: uGe, diagram: i };
}, "loader"), Nnn = {
  id: uGe,
  detector: Dnn,
  loader: Inn
}, dGe = "pie", Rnn = /* @__PURE__ */ $((i) => /^\s*pie/.test(i), "detector"), Ann = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./pieDiagram-ADFJNKIX-rtvol_77.js");
  return { id: dGe, diagram: i };
}, "loader"), Onn = {
  id: dGe,
  detector: Rnn,
  loader: Ann
}, hGe = "quadrantChart", Mnn = /* @__PURE__ */ $((i) => /^\s*quadrantChart/.test(i), "detector"), Pnn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./quadrantDiagram-AYHSOK5B-CjBWfRT3.js");
  return { id: hGe, diagram: i };
}, "loader"), Fnn = {
  id: hGe,
  detector: Mnn,
  loader: Pnn
}, Bnn = Fnn, fGe = "xychart", Hnn = /* @__PURE__ */ $((i) => /^\s*xychart(-beta)?/.test(i), "detector"), Wnn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./xychartDiagram-PRI3JC2R-DOYKU3RQ.js");
  return { id: fGe, diagram: i };
}, "loader"), Vnn = {
  id: fGe,
  detector: Hnn,
  loader: Wnn
}, Unn = Vnn, gGe = "requirement", znn = /* @__PURE__ */ $((i) => /^\s*requirement(Diagram)?/.test(i), "detector"), $nn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./requirementDiagram-UZGBJVZJ-BLihzHxr.js");
  return { id: gGe, diagram: i };
}, "loader"), jnn = {
  id: gGe,
  detector: znn,
  loader: $nn
}, Gnn = jnn, pGe = "sequence", qnn = /* @__PURE__ */ $((i) => /^\s*sequenceDiagram/.test(i), "detector"), Knn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./sequenceDiagram-WL72ISMW-DDLXplSs.js");
  return { id: pGe, diagram: i };
}, "loader"), Ynn = {
  id: pGe,
  detector: qnn,
  loader: Knn
}, Xnn = Ynn, mGe = "class", Znn = /* @__PURE__ */ $((i, e) => {
  var t;
  return ((t = e == null ? void 0 : e.class) == null ? void 0 : t.defaultRenderer) === "dagre-wrapper" ? !1 : /^\s*classDiagram/.test(i);
}, "detector"), Qnn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./classDiagram-2ON5EDUG-CKeAq_VZ.js");
  return { id: mGe, diagram: i };
}, "loader"), Jnn = {
  id: mGe,
  detector: Znn,
  loader: Qnn
}, ein = Jnn, _Ge = "classDiagram", tin = /* @__PURE__ */ $((i, e) => {
  var t;
  return /^\s*classDiagram/.test(i) && ((t = e == null ? void 0 : e.class) == null ? void 0 : t.defaultRenderer) === "dagre-wrapper" ? !0 : /^\s*classDiagram-v2/.test(i);
}, "detector"), nin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./classDiagram-v2-WZHVMYZB-CKeAq_VZ.js");
  return { id: _Ge, diagram: i };
}, "loader"), iin = {
  id: _Ge,
  detector: tin,
  loader: nin
}, rin = iin, bGe = "state", sin = /* @__PURE__ */ $((i, e) => {
  var t;
  return ((t = e == null ? void 0 : e.state) == null ? void 0 : t.defaultRenderer) === "dagre-wrapper" ? !1 : /^\s*stateDiagram/.test(i);
}, "detector"), oin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./stateDiagram-FKZM4ZOC-BUiKCeVu.js");
  return { id: bGe, diagram: i };
}, "loader"), ain = {
  id: bGe,
  detector: sin,
  loader: oin
}, lin = ain, vGe = "stateDiagram", cin = /* @__PURE__ */ $((i, e) => {
  var t;
  return !!(/^\s*stateDiagram-v2/.test(i) || /^\s*stateDiagram/.test(i) && ((t = e == null ? void 0 : e.state) == null ? void 0 : t.defaultRenderer) === "dagre-wrapper");
}, "detector"), uin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./stateDiagram-v2-4FDKWEC3-BpUW61BK.js");
  return { id: vGe, diagram: i };
}, "loader"), din = {
  id: vGe,
  detector: cin,
  loader: uin
}, hin = din, yGe = "journey", fin = /* @__PURE__ */ $((i) => /^\s*journey/.test(i), "detector"), gin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./journeyDiagram-XKPGCS4Q-RwDXzJdX.js");
  return { id: yGe, diagram: i };
}, "loader"), pin = {
  id: yGe,
  detector: fin,
  loader: gin
}, min = pin, _in = /* @__PURE__ */ $((i, e, t) => {
  Ct.debug(`rendering svg for syntax error
`);
  const n = ZKt(e), r = n.append("g");
  n.attr("viewBox", "0 0 2412 512"), qWe(n, 100, 512, !0), r.append("path").attr("class", "error-icon").attr(
    "d",
    "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"
  ), r.append("path").attr("class", "error-icon").attr(
    "d",
    "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"
  ), r.append("path").attr("class", "error-icon").attr(
    "d",
    "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"
  ), r.append("path").attr("class", "error-icon").attr(
    "d",
    "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"
  ), r.append("path").attr("class", "error-icon").attr(
    "d",
    "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"
  ), r.append("path").attr("class", "error-icon").attr(
    "d",
    "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"
  ), r.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text"), r.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${t}`);
}, "draw"), CGe = { draw: _in }, bin = CGe, vin = {
  db: {},
  renderer: CGe,
  parser: {
    parse: /* @__PURE__ */ $(() => {
    }, "parse")
  }
}, yin = vin, wGe = "flowchart-elk", Cin = /* @__PURE__ */ $((i, e = {}) => {
  var t;
  return (
    // If diagram explicitly states flowchart-elk
    /^\s*flowchart-elk/.test(i) || // If a flowchart/graph diagram has their default renderer set to elk
    /^\s*(flowchart|graph)/.test(i) && ((t = e == null ? void 0 : e.flowchart) == null ? void 0 : t.defaultRenderer) === "elk" ? (e.layout = "elk", !0) : !1
  );
}, "detector"), win = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./flowDiagram-NV44I4VS-DGvF83_j.js");
  return { id: wGe, diagram: i };
}, "loader"), Sin = {
  id: wGe,
  detector: Cin,
  loader: win
}, Ein = Sin, SGe = "timeline", xin = /* @__PURE__ */ $((i) => /^\s*timeline/.test(i), "detector"), Lin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./timeline-definition-IT6M3QCI-OOB1gMJm.js");
  return { id: SGe, diagram: i };
}, "loader"), Tin = {
  id: SGe,
  detector: xin,
  loader: Lin
}, kin = Tin, EGe = "mindmap", Din = /* @__PURE__ */ $((i) => /^\s*mindmap/.test(i), "detector"), Iin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./mindmap-definition-VGOIOE7T-WDLOuf1Z.js");
  return { id: EGe, diagram: i };
}, "loader"), Nin = {
  id: EGe,
  detector: Din,
  loader: Iin
}, Rin = Nin, xGe = "kanban", Ain = /* @__PURE__ */ $((i) => /^\s*kanban/.test(i), "detector"), Oin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./kanban-definition-3W4ZIXB7-TTqd20Bd.js");
  return { id: xGe, diagram: i };
}, "loader"), Min = {
  id: xGe,
  detector: Ain,
  loader: Oin
}, Pin = Min, LGe = "sankey", Fin = /* @__PURE__ */ $((i) => /^\s*sankey(-beta)?/.test(i), "detector"), Bin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./sankeyDiagram-TZEHDZUN-CY-pswvn.js");
  return { id: LGe, diagram: i };
}, "loader"), Hin = {
  id: LGe,
  detector: Fin,
  loader: Bin
}, Win = Hin, TGe = "packet", Vin = /* @__PURE__ */ $((i) => /^\s*packet(-beta)?/.test(i), "detector"), Uin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./diagram-S2PKOQOG-CdXZ1WuU.js");
  return { id: TGe, diagram: i };
}, "loader"), zin = {
  id: TGe,
  detector: Vin,
  loader: Uin
}, kGe = "radar", $in = /* @__PURE__ */ $((i) => /^\s*radar-beta/.test(i), "detector"), jin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./diagram-QEK2KX5R-JX_azeen.js");
  return { id: kGe, diagram: i };
}, "loader"), Gin = {
  id: kGe,
  detector: $in,
  loader: jin
}, DGe = "block", qin = /* @__PURE__ */ $((i) => /^\s*block(-beta)?/.test(i), "detector"), Kin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./blockDiagram-VD42YOAC-DDrGbm5Z.js");
  return { id: DGe, diagram: i };
}, "loader"), Yin = {
  id: DGe,
  detector: qin,
  loader: Kin
}, Xin = Yin, IGe = "architecture", Zin = /* @__PURE__ */ $((i) => /^\s*architecture/.test(i), "detector"), Qin = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./architectureDiagram-VXUJARFQ-BAfR2tzv.js");
  return { id: IGe, diagram: i };
}, "loader"), Jin = {
  id: IGe,
  detector: Zin,
  loader: Qin
}, ern = Jin, NGe = "treemap", trn = /* @__PURE__ */ $((i) => /^\s*treemap/.test(i), "detector"), nrn = /* @__PURE__ */ $(async () => {
  const { diagram: i } = await import("./diagram-PSM6KHXK-DEwAXS2s.js");
  return { id: NGe, diagram: i };
}, "loader"), irn = {
  id: NGe,
  detector: trn,
  loader: nrn
}, YOe = !1, iX = /* @__PURE__ */ $(() => {
  YOe || (YOe = !0, Y$("error", yin, (i) => i.toLowerCase().trim() === "error"), Y$(
    "---",
    // --- diagram type may appear if YAML front-matter is not parsed correctly
    {
      db: {
        clear: /* @__PURE__ */ $(() => {
        }, "clear")
      },
      styles: {},
      // should never be used
      renderer: {
        draw: /* @__PURE__ */ $(() => {
        }, "draw")
      },
      parser: {
        parse: /* @__PURE__ */ $(() => {
          throw new Error(
            "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks"
          );
        }, "parse")
      },
      init: /* @__PURE__ */ $(() => null, "init")
      // no op
    },
    (i) => i.toLowerCase().trimStart().startsWith("---")
  ), Lde(Ein, Rin, ern), Lde(
    lnn,
    Pin,
    rin,
    ein,
    ynn,
    knn,
    Nnn,
    Onn,
    Gnn,
    Xnn,
    mnn,
    hnn,
    kin,
    Enn,
    hin,
    lin,
    min,
    Bnn,
    Win,
    zin,
    Unn,
    Xin,
    Gin,
    irn
  ));
}, "addDiagrams"), rrn = /* @__PURE__ */ $(async () => {
  Ct.debug("Loading registered diagrams");
  const e = (await Promise.allSettled(
    Object.entries(MT).map(async ([t, { detector: n, loader: r }]) => {
      if (r)
        try {
          Ide(t);
        } catch {
          try {
            const { diagram: s, id: o } = await r();
            Y$(o, s, n);
          } catch (s) {
            throw Ct.error(`Failed to load external diagram with key ${t}. Removing from detectors.`), delete MT[t], s;
          }
        }
    })
  )).filter((t) => t.status === "rejected");
  if (e.length > 0) {
    Ct.error(`Failed to load ${e.length} external diagrams`);
    for (const t of e)
      Ct.error(t);
    throw new Error(`Failed to load ${e.length} external diagrams`);
  }
}, "loadRegisteredDiagrams"), srn = "graphics-document document";
function RGe(i, e) {
  i.attr("role", srn), e !== "" && i.attr("aria-roledescription", e);
}
$(RGe, "setA11yDiagramInfo");
function AGe(i, e, t, n) {
  if (i.insert !== void 0) {
    if (t) {
      const r = `chart-desc-${n}`;
      i.attr("aria-describedby", r), i.insert("desc", ":first-child").attr("id", r).text(t);
    }
    if (e) {
      const r = `chart-title-${n}`;
      i.attr("aria-labelledby", r), i.insert("title", ":first-child").attr("id", r).text(e);
    }
  }
}
$(AGe, "addSVGa11yTitleDescription");
var YL, yhe = (YL = class {
  constructor(e, t, n, r, s) {
    this.type = e, this.text = t, this.db = n, this.parser = r, this.renderer = s;
  }
  static async fromText(e, t = {}) {
    var c, u;
    const n = Ku(), r = j0e(e, n);
    e = iJt(e) + `
`;
    try {
      Ide(r);
    } catch {
      const d = T$t(r);
      if (!d)
        throw new MWe(`Diagram ${r} not found.`);
      const { id: h, diagram: g } = await d();
      Y$(h, g);
    }
    const { db: s, parser: o, renderer: a, init: l } = Ide(r);
    return o.parser && (o.parser.yy = s), (c = s.clear) == null || c.call(s), l == null || l(n), t.title && ((u = s.setDiagramTitle) == null || u.call(s, t.title)), await o.parse(e), new YL(r, e, s, o, a);
  }
  async render(e, t) {
    await this.renderer.draw(this.text, e, t, this);
  }
  getParser() {
    return this.parser;
  }
  getType() {
    return this.type;
  }
}, $(YL, "Diagram"), YL), XOe = [], orn = /* @__PURE__ */ $(() => {
  XOe.forEach((i) => {
    i();
  }), XOe = [];
}, "attachFunctions"), arn = /* @__PURE__ */ $((i) => i.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart(), "cleanupComments");
function OGe(i) {
  const e = i.match(OWe);
  if (!e)
    return {
      text: i,
      metadata: {}
    };
  let t = rXt(e[1], {
    // To support config, we need JSON schema.
    // https://www.yaml.org/spec/1.2/spec.html#id2803231
    schema: iXt
  }) ?? {};
  t = typeof t == "object" && !Array.isArray(t) ? t : {};
  const n = {};
  return t.displayMode && (n.displayMode = t.displayMode.toString()), t.title && (n.title = t.title.toString()), t.config && (n.config = t.config), {
    text: i.slice(e[0].length),
    metadata: n
  };
}
$(OGe, "extractFrontMatter");
var lrn = /* @__PURE__ */ $((i) => i.replace(/\r\n?/g, `
`).replace(
  /<(\w+)([^>]*)>/g,
  (e, t, n) => "<" + t + n.replace(/="([^"]*)"/g, "='$1'") + ">"
), "cleanupText"), crn = /* @__PURE__ */ $((i) => {
  const { text: e, metadata: t } = OGe(i), { displayMode: n, title: r, config: s = {} } = t;
  return n && (s.gantt || (s.gantt = {}), s.gantt.displayMode = n), { title: r, config: s, text: e };
}, "processFrontmatter"), urn = /* @__PURE__ */ $((i) => {
  const e = Jp.detectInit(i) ?? {}, t = Jp.detectDirective(i, "wrap");
  return Array.isArray(t) ? e.wrap = t.some(({ type: n }) => n === "wrap") : (t == null ? void 0 : t.type) === "wrap" && (e.wrap = !0), {
    text: $Qt(i),
    directive: e
  };
}, "processDirectives");
function $Ce(i) {
  const e = lrn(i), t = crn(e), n = urn(t.text), r = TCe(t.config, n.directive);
  return i = arn(n.text), {
    code: i,
    title: t.title,
    config: r
  };
}
$($Ce, "preprocessDiagram");
function MGe(i) {
  const e = new TextEncoder().encode(i), t = Array.from(e, (n) => String.fromCodePoint(n)).join("");
  return btoa(t);
}
$(MGe, "toBase64");
var drn = 5e4, hrn = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa", frn = "sandbox", grn = "loose", prn = "http://www.w3.org/2000/svg", mrn = "http://www.w3.org/1999/xlink", _rn = "http://www.w3.org/1999/xhtml", brn = "100%", vrn = "100%", yrn = "border:0;margin:0;", Crn = "margin:0", wrn = "allow-top-navigation-by-user-activation allow-popups", Srn = 'The "iframe" tag is not supported by your browser.', Ern = ["foreignobject"], xrn = ["dominant-baseline"];
function jCe(i) {
  const e = $Ce(i);
  return q$(), z$t(e.config ?? {}), e;
}
$(jCe, "processAndSetConfigs");
async function PGe(i, e) {
  iX();
  try {
    const { code: t, config: n } = jCe(i);
    return { diagramType: (await BGe(t)).type, config: n };
  } catch (t) {
    if (e != null && e.suppressErrors)
      return !1;
    throw t;
  }
}
$(PGe, "parse");
var ZOe = /* @__PURE__ */ $((i, e, t = []) => `
.${i} ${e} { ${t.join(" !important; ")} !important; }`, "cssImportantStyles"), Lrn = /* @__PURE__ */ $((i, e = /* @__PURE__ */ new Map()) => {
  var n;
  let t = "";
  if (i.themeCSS !== void 0 && (t += `
${i.themeCSS}`), i.fontFamily !== void 0 && (t += `
:root { --mermaid-font-family: ${i.fontFamily}}`), i.altFontFamily !== void 0 && (t += `
:root { --mermaid-alt-font-family: ${i.altFontFamily}}`), e instanceof Map) {
    const a = i.htmlLabels ?? ((n = i.flowchart) == null ? void 0 : n.htmlLabels) ? ["> *", "span"] : ["rect", "polygon", "ellipse", "circle", "path"];
    e.forEach((l) => {
      KOe(l.styles) || a.forEach((c) => {
        t += ZOe(l.id, c, l.styles);
      }), KOe(l.textStyles) || (t += ZOe(
        l.id,
        "tspan",
        ((l == null ? void 0 : l.textStyles) || []).map((c) => c.replace("color", "fill"))
      ));
    });
  }
  return t;
}, "createCssStyles"), Trn = /* @__PURE__ */ $((i, e, t, n) => {
  const r = Lrn(i, t), s = cjt(e, r, i.themeVariables);
  return phe(Utn(`${n}{${s}}`), $tn);
}, "createUserStyles"), krn = /* @__PURE__ */ $((i = "", e, t) => {
  let n = i;
  return !t && !e && (n = n.replace(
    /marker-end="url\([\d+./:=?A-Za-z-]*?#/g,
    'marker-end="url(#'
  )), n = vk(n), n = n.replace(/<br>/g, "<br/>"), n;
}, "cleanUpSvgCode"), Drn = /* @__PURE__ */ $((i = "", e) => {
  var r, s;
  const t = (s = (r = e == null ? void 0 : e.viewBox) == null ? void 0 : r.baseVal) != null && s.height ? e.viewBox.baseVal.height + "px" : vrn, n = MGe(`<body style="${Crn}">${i}</body>`);
  return `<iframe style="width:${brn};height:${t};${yrn}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${wrn}">
  ${Srn}
</iframe>`;
}, "putIntoIFrame"), QOe = /* @__PURE__ */ $((i, e, t, n, r) => {
  const s = i.append("div");
  s.attr("id", t), n && s.attr("style", n);
  const o = s.append("svg").attr("id", e).attr("width", "100%").attr("xmlns", prn);
  return r && o.attr("xmlns:xlink", r), o.append("g"), i;
}, "appendDivSvgG");
function Che(i, e) {
  return i.append("iframe").attr("id", e).attr("style", "width: 100%; height: 100%;").attr("sandbox", "");
}
$(Che, "sandboxedIframe");
var Irn = /* @__PURE__ */ $((i, e, t, n) => {
  var r, s, o;
  (r = i.getElementById(e)) == null || r.remove(), (s = i.getElementById(t)) == null || s.remove(), (o = i.getElementById(n)) == null || o.remove();
}, "removeExistingElements"), Nrn = /* @__PURE__ */ $(async function(i, e, t) {
  var K, X, Y, G, Q, oe;
  iX();
  const n = jCe(e);
  e = n.code;
  const r = Ku();
  Ct.debug(r), e.length > ((r == null ? void 0 : r.maxTextSize) ?? drn) && (e = hrn);
  const s = "#" + i, o = "i" + i, a = "#" + o, l = "d" + i, c = "#" + l, u = /* @__PURE__ */ $(() => {
    const pe = ls(h ? a : c).node();
    pe && "remove" in pe && pe.remove();
  }, "removeTempElements");
  let d = ls("body");
  const h = r.securityLevel === frn, g = r.securityLevel === grn, m = r.fontFamily;
  if (t !== void 0) {
    if (t && (t.innerHTML = ""), h) {
      const Z = Che(ls(t), o);
      d = ls(Z.nodes()[0].contentDocument.body), d.node().style.margin = 0;
    } else
      d = ls(t);
    QOe(d, i, l, `font-family: ${m}`, mrn);
  } else {
    if (Irn(document, i, l, o), h) {
      const Z = Che(ls("body"), o);
      d = ls(Z.nodes()[0].contentDocument.body), d.node().style.margin = 0;
    } else
      d = ls("body");
    QOe(d, i, l);
  }
  let _, v;
  try {
    _ = await yhe.fromText(e, { title: n.title });
  } catch (Z) {
    if (r.suppressErrorRendering)
      throw u(), Z;
    _ = await yhe.fromText("error"), v = Z;
  }
  const w = d.select(c).node(), E = _.type, L = w.firstChild, T = L.firstChild, D = (X = (K = _.renderer).getClasses) == null ? void 0 : X.call(K, e, _), N = Trn(r, E, D, s), R = document.createElement("style");
  R.innerHTML = N, L.insertBefore(R, T);
  try {
    await _.renderer.draw(e, i, _2e.version, _);
  } catch (Z) {
    throw r.suppressErrorRendering ? u() : bin.draw(e, i, _2e.version), Z;
  }
  const M = d.select(`${c} svg`), B = (G = (Y = _.db).getAccTitle) == null ? void 0 : G.call(Y), H = (oe = (Q = _.db).getAccDescription) == null ? void 0 : oe.call(Q);
  HGe(E, M, B, H), d.select(`[id="${i}"]`).selectAll("foreignobject > *").attr("xmlns", _rn);
  let j = d.select(c).node().innerHTML;
  if (Ct.debug("config.arrowMarkerAbsolute", r.arrowMarkerAbsolute), j = krn(j, h, ic(r.arrowMarkerAbsolute)), h) {
    const Z = d.select(c + " svg").node();
    j = Drn(j, Z);
  } else g || (j = NA.sanitize(j, {
    ADD_TAGS: Ern,
    ADD_ATTR: xrn,
    HTML_INTEGRATION_POINTS: { foreignobject: !0 }
  }));
  if (orn(), v)
    throw v;
  return u(), {
    diagramType: E,
    svg: j,
    bindFunctions: _.db.bindFunctions
  };
}, "render");
function FGe(i = {}) {
  var n;
  const e = Xl({}, i);
  e != null && e.fontFamily && !((n = e.themeVariables) != null && n.fontFamily) && (e.themeVariables || (e.themeVariables = {}), e.themeVariables.fontFamily = e.fontFamily), V$t(e), e != null && e.theme && e.theme in Vy ? e.themeVariables = Vy[e.theme].getThemeVariables(
    e.themeVariables
  ) : e && (e.themeVariables = Vy.default.getThemeVariables(e.themeVariables));
  const t = typeof e == "object" ? W$t(e) : WWe();
  $0e(t.logLevel), iX();
}
$(FGe, "initialize");
var BGe = /* @__PURE__ */ $((i, e = {}) => {
  const { code: t } = $Ce(i);
  return yhe.fromText(t, e);
}, "getDiagramFromText");
function HGe(i, e, t, n) {
  RGe(e, i), AGe(e, t, n, e.attr("id"));
}
$(HGe, "addA11yInfo");
var VT = Object.freeze({
  render: Nrn,
  parse: PGe,
  getDiagramFromText: BGe,
  initialize: FGe,
  getConfig: Ku,
  setConfig: VWe,
  getSiteConfig: WWe,
  updateSiteConfig: U$t,
  reset: /* @__PURE__ */ $(() => {
    q$();
  }, "reset"),
  globalReset: /* @__PURE__ */ $(() => {
    q$(RA);
  }, "globalReset"),
  defaultConfig: RA
});
$0e(Ku().logLevel);
q$(Ku());
var Rrn = /* @__PURE__ */ $((i, e, t) => {
  Ct.warn(i), LCe(i) ? (t && t(i.str, i.hash), e.push({ ...i, message: i.str, error: i })) : (t && t(i), i instanceof Error && e.push({
    str: i.message,
    message: i.message,
    hash: i.name,
    error: i
  }));
}, "handleError"), WGe = /* @__PURE__ */ $(async function(i = {
  querySelector: ".mermaid"
}) {
  try {
    await Arn(i);
  } catch (e) {
    if (LCe(e) && Ct.error(e.str), zf.parseError && zf.parseError(e), !i.suppressErrors)
      throw Ct.error("Use the suppressErrors option to suppress these errors"), e;
  }
}, "run"), Arn = /* @__PURE__ */ $(async function({ postRenderCallback: i, querySelector: e, nodes: t } = {
  querySelector: ".mermaid"
}) {
  const n = VT.getConfig();
  Ct.debug(`${i ? "" : "No "}Callback function found`);
  let r;
  if (t)
    r = t;
  else if (e)
    r = document.querySelectorAll(e);
  else
    throw new Error("Nodes and querySelector are both undefined");
  Ct.debug(`Found ${r.length} diagrams`), (n == null ? void 0 : n.startOnLoad) !== void 0 && (Ct.debug("Start On Load: " + (n == null ? void 0 : n.startOnLoad)), VT.updateSiteConfig({ startOnLoad: n == null ? void 0 : n.startOnLoad }));
  const s = new Jp.InitIDGenerator(n.deterministicIds, n.deterministicIDSeed);
  let o;
  const a = [];
  for (const l of Array.from(r)) {
    if (Ct.info("Rendering diagram: " + l.id), l.getAttribute("data-processed"))
      continue;
    l.setAttribute("data-processed", "true");
    const c = `mermaid-${s.next()}`;
    o = l.innerHTML, o = a$e(Jp.entityDecode(o)).trim().replace(/<br\s*\/?>/gi, "<br/>");
    const u = Jp.detectInit(o);
    u && Ct.debug("Detected early reinit: ", u);
    try {
      const { svg: d, bindFunctions: h } = await $Ge(c, o, l);
      l.innerHTML = d, i && await i(c), h && h(l);
    } catch (d) {
      Rrn(d, a, zf.parseError);
    }
  }
  if (a.length > 0)
    throw a[0];
}, "runThrowsErrors"), VGe = /* @__PURE__ */ $(function(i) {
  VT.initialize(i);
}, "initialize"), Orn = /* @__PURE__ */ $(async function(i, e, t) {
  Ct.warn("mermaid.init is deprecated. Please use run instead."), i && VGe(i);
  const n = { postRenderCallback: t, querySelector: ".mermaid" };
  typeof e == "string" ? n.querySelector = e : e && (e instanceof HTMLElement ? n.nodes = [e] : n.nodes = e), await WGe(n);
}, "init"), Mrn = /* @__PURE__ */ $(async (i, {
  lazyLoad: e = !0
} = {}) => {
  iX(), Lde(...i), e === !1 && await rrn();
}, "registerExternalDiagrams"), UGe = /* @__PURE__ */ $(function() {
  if (zf.startOnLoad) {
    const { startOnLoad: i } = VT.getConfig();
    i && zf.run().catch((e) => Ct.error("Mermaid failed to initialize", e));
  }
}, "contentLoaded");
typeof document < "u" && window.addEventListener("load", UGe, !1);
var Prn = /* @__PURE__ */ $(function(i) {
  zf.parseError = i;
}, "setParseErrorHandler"), Lj = [], zne = !1, zGe = /* @__PURE__ */ $(async () => {
  if (!zne) {
    for (zne = !0; Lj.length > 0; ) {
      const i = Lj.shift();
      if (i)
        try {
          await i();
        } catch (e) {
          Ct.error("Error executing queue", e);
        }
    }
    zne = !1;
  }
}, "executeQueue"), Frn = /* @__PURE__ */ $(async (i, e) => new Promise((t, n) => {
  const r = /* @__PURE__ */ $(() => new Promise((s, o) => {
    VT.parse(i, e).then(
      (a) => {
        s(a), t(a);
      },
      (a) => {
        var l;
        Ct.error("Error parsing", a), (l = zf.parseError) == null || l.call(zf, a), o(a), n(a);
      }
    );
  }), "performCall");
  Lj.push(r), zGe().catch(n);
}), "parse"), $Ge = /* @__PURE__ */ $((i, e, t) => new Promise((n, r) => {
  const s = /* @__PURE__ */ $(() => new Promise((o, a) => {
    VT.render(i, e, t).then(
      (l) => {
        o(l), n(l);
      },
      (l) => {
        var c;
        Ct.error("Error parsing", l), (c = zf.parseError) == null || c.call(zf, l), a(l), r(l);
      }
    );
  }), "performCall");
  Lj.push(s), zGe().catch(r);
}), "render"), Brn = /* @__PURE__ */ $(() => Object.keys(MT).map((i) => ({
  id: i
})), "getRegisteredDiagramsMetadata"), zf = {
  startOnLoad: !0,
  mermaidAPI: VT,
  parse: Frn,
  render: $Ge,
  init: Orn,
  run: WGe,
  registerExternalDiagrams: Mrn,
  registerLayoutLoaders: Zje,
  initialize: VGe,
  parseError: void 0,
  contentLoaded: UGe,
  setParseErrorHandler: Prn,
  detectType: j0e,
  registerIconPacks: aen,
  getRegisteredDiagramsMetadata: Brn
}, jGe = zf;
/*! Check if previously processed */
/*!
 * Wait for document loaded before starting the execution
 */
let JOe = !1;
function Hrn() {
  JOe || (jGe.initialize({
    startOnLoad: !1,
    theme: "dark",
    securityLevel: "strict",
    fontFamily: 'Consolas, "Courier New", monospace',
    flowchart: {
      useMaxWidth: !0,
      htmlLabels: !0,
      curve: "basis"
    },
    sequence: {
      useMaxWidth: !0,
      wrap: !0
    },
    gantt: {
      useMaxWidth: !0
    }
  }), JOe = !0);
}
function Wrn({ content: i }) {
  const e = Zn.useRef(null);
  return Zn.useEffect(() => {
    Hrn();
  }, []), Zn.useEffect(() => {
    const n = setTimeout(async () => {
      var s, o;
      if (!e.current) return;
      const r = e.current.querySelectorAll("code.language-mermaid");
      for (const a of r) {
        const l = a.textContent || "", c = a.parentElement;
        if (!c || c.tagName !== "PRE") continue;
        const u = YQe();
        try {
          const { svg: d } = await jGe.render(u, l), h = document.createElement("div");
          h.className = "mermaid-diagram", h.innerHTML = d, (s = c.parentNode) == null || s.replaceChild(h, c);
        } catch (d) {
          Xp.error("Mermaid render error:", d);
          const h = document.createElement("div");
          h.className = "mermaid-error", h.textContent = `Mermaid Error: ${d instanceof Error ? d.message : "Unknown error"}

${l}`, (o = c.parentNode) == null || o.replaceChild(h, c);
        }
      }
    }, oMe.MERMAID_RENDER_DELAY_MS);
    return () => clearTimeout(n);
  }, [i]), /* @__PURE__ */ hr.jsx(
    "div",
    {
      ref: e,
      className: "h-full overflow-auto bg-[var(--editor-bg)] px-6 py-4",
      children: /* @__PURE__ */ hr.jsx(
        Gzt,
        {
          source: i,
          style: {
            backgroundColor: "transparent",
            color: "var(--editor-text-light)"
          },
          wrapperElement: {
            "data-color-mode": "dark"
          }
        }
      )
    }
  );
}
function Vrn({ documentId: i }) {
  const [e, t] = Zn.useState("edit"), { content: n, setContent: r, error: s, isLoading: o } = XQe(i), a = Zn.useCallback(() => {
    t((c) => c === "edit" ? "preview" : "edit");
  }, []), l = Zn.useCallback((c) => {
    r(c);
  }, [r]);
  return o ? /* @__PURE__ */ hr.jsx("div", { className: "h-screen flex items-center justify-center bg-[var(--editor-bg)] text-[var(--editor-text)]", children: /* @__PURE__ */ hr.jsxs("div", { className: "text-center", children: [
    /* @__PURE__ */ hr.jsx("div", { className: "animate-spin w-8 h-8 border-2 border-[var(--focus-ring)] border-t-transparent rounded-full mx-auto mb-4" }),
    /* @__PURE__ */ hr.jsx("p", { className: "text-sm", children: "Loading document..." })
  ] }) }) : s ? /* @__PURE__ */ hr.jsx("div", { className: "h-screen flex items-center justify-center bg-[var(--editor-bg)] text-[var(--error-text)]", children: /* @__PURE__ */ hr.jsxs("div", { className: "text-center max-w-md", children: [
    /* @__PURE__ */ hr.jsx("h2", { className: "text-lg font-semibold mb-2", children: "Failed to load document" }),
    /* @__PURE__ */ hr.jsx("p", { className: "text-sm text-[var(--editor-text)]", children: s })
  ] }) }) : /* @__PURE__ */ hr.jsxs("div", { className: "h-screen flex flex-col bg-[var(--editor-bg)]", children: [
    /* @__PURE__ */ hr.jsx(
      ZJe,
      {
        mode: e,
        onToggleMode: a
      }
    ),
    /* @__PURE__ */ hr.jsx("div", { className: "flex-1 overflow-hidden", children: e === "edit" ? /* @__PURE__ */ hr.jsx(
      M3t,
      {
        value: n,
        onChange: l
      }
    ) : /* @__PURE__ */ hr.jsx(Wrn, { content: n }) })
  ] });
}
typeof document < "u" && ((e) => {
  if (!document.querySelector(`link[href="${e}"]`)) {
    const n = document.createElement("link");
    n.rel = "stylesheet", n.href = e, n.type = "text/css", document.head.appendChild(n);
  }
})("./mendix-markdown.css");
class Urn extends nb.Component {
  constructor(e) {
    super(e), this.state = { hasError: !1 };
  }
  static getDerivedStateFromError(e) {
    return { hasError: !0, error: e };
  }
  componentDidCatch(e, t) {
    Xp.error("Error Boundary caught an error:", e, t);
  }
  render() {
    var e;
    return this.state.hasError ? /* @__PURE__ */ hr.jsxs("div", { style: {
      height: "100vh",
      display: "flex",
      flexDirection: "column",
      alignItems: "center",
      justifyContent: "center",
      backgroundColor: "var(--editor-bg)",
      color: "var(--error-text)",
      padding: "20px"
    }, children: [
      /* @__PURE__ */ hr.jsx("h1", { style: { fontSize: "18px", fontWeight: "bold", marginBottom: "16px" }, children: "Markdown Editor Error" }),
      /* @__PURE__ */ hr.jsx("div", { style: {
        backgroundColor: "var(--error-bg)",
        padding: "16px",
        borderRadius: "6px",
        maxWidth: "600px",
        marginBottom: "16px"
      }, children: /* @__PURE__ */ hr.jsx("pre", { style: { fontFamily: "monospace", fontSize: "12px", whiteSpace: "pre-wrap" }, children: ((e = this.state.error) == null ? void 0 : e.message) || "Unknown error" }) }),
      /* @__PURE__ */ hr.jsx(
        "button",
        {
          onClick: () => window.location.reload(),
          style: {
            backgroundColor: "var(--error-btn)",
            color: "white",
            padding: "8px 16px",
            borderRadius: "4px",
            border: "none",
            cursor: "pointer"
          },
          children: "Reload Editor"
        }
      )
    ] }) : this.props.children;
  }
}
const Tcn = {
  async loaded(i, e) {
    try {
      const t = qQe(i);
      window.studioPro = t;
      const n = e == null ? void 0 : e.documentId;
      if (!n)
        throw Xp.error("No document ID provided"), new Error("No document ID provided to editor");
      Xp.log("Loading editor for document:", n);
      const r = document.getElementById("root");
      if (!r)
        throw new Error("Root element not found");
      jQe.createRoot(r).render(
        /* @__PURE__ */ hr.jsx(Zn.StrictMode, { children: /* @__PURE__ */ hr.jsx(Urn, { children: /* @__PURE__ */ hr.jsx(Vrn, { documentId: n }) }) })
      ), Xp.log("Editor loaded successfully");
    } catch (t) {
      throw Xp.error("Failed to load editor:", t), t;
    }
  }
};
export {
  KWe as $,
  E3 as A,
  Zzt as B,
  bjt as C,
  TCe as D,
  Ku as E,
  HWe as F,
  YQt as G,
  ZKt as H,
  _2e as I,
  iXt as J,
  A$t as K,
  AA as L,
  ecn as M,
  qY as N,
  Q$t as O,
  G0e as P,
  D2e as Q,
  UKt as R,
  fV as S,
  KQt as T,
  b6 as U,
  ojt as V,
  _6 as W,
  Hn as X,
  di as Y,
  WQt as Z,
  $ as _,
  hjt as a,
  mk as a$,
  BKt as a0,
  Y2e as a1,
  K2e as a2,
  dcn as a3,
  ocn as a4,
  ccn as a5,
  lcn as a6,
  rcn as a7,
  WI as a8,
  sCe as a9,
  ntn as aA,
  ttn as aB,
  cen as aC,
  HKt as aD,
  Jln as aE,
  GY as aF,
  pj as aG,
  Hze as aH,
  WA as aI,
  x6 as aJ,
  aen as aK,
  oen as aL,
  tCe as aM,
  VC as aN,
  U2e as aO,
  bqt as aP,
  Z5 as aQ,
  gQt as aR,
  Fze as aS,
  Ize as aT,
  bZt as aU,
  hj as aV,
  vZt as aW,
  S6 as aX,
  OE as aY,
  cQt as aZ,
  pOe as a_,
  ucn as aa,
  scn as ab,
  fcn as ac,
  hcn as ad,
  acn as ae,
  Oen as af,
  qje as ag,
  Scn as ah,
  sXt as ai,
  ic as aj,
  Mw as ak,
  _Ce as al,
  v$e as am,
  vk as an,
  jze as ao,
  Ui as ap,
  Eb as aq,
  QB as ar,
  o7e as as,
  xtn as at,
  wcn as au,
  Ecn as av,
  ycn as aw,
  Yn as ax,
  Ccn as ay,
  atn as az,
  djt as b,
  yZt as b0,
  yCe as b1,
  _Zt as b2,
  SZt as b3,
  I2 as b4,
  fQt as b5,
  PQt as b6,
  kZt as b7,
  DQt as b8,
  bCe as b9,
  FQt as bA,
  vCe as bB,
  HQt as bC,
  Tcn as bD,
  KOe as ba,
  Gn as bb,
  xze as bc,
  Wh as bd,
  dqt as be,
  eCe as bf,
  lVe as bg,
  y6 as bh,
  dVe as bi,
  icn as bj,
  Xzt as bk,
  D2 as bl,
  yQt as bm,
  Ktn as bn,
  w6 as bo,
  gj as bp,
  Ow as bq,
  UY as br,
  uOe as bs,
  CCe as bt,
  Rze as bu,
  Pze as bv,
  pZt as bw,
  bhe as bx,
  MQt as by,
  kQt as bz,
  Qs as c,
  ls as d,
  qWe as e,
  Xl as f,
  gjt as g,
  c0 as h,
  Xg as i,
  dXt as j,
  T2 as k,
  Ct as l,
  qze as m,
  tcn as n,
  Lcn as o,
  pjt as p,
  mjt as q,
  xcn as r,
  fjt as s,
  rXt as t,
  Jp as u,
  Qen as v,
  QQt as w,
  gcn as x,
  ujt as y,
  ncn as z
};
